getName().$block_id;
$class=$this->getName().'_block';
$title='';
if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user" && WT_USER_ID) {
$title .= "";
$title .= "";
}
// I18N: There are separate lists of male/female names, containing %d names each
$title .= WT_I18N::plural('Top given name', 'Top %d given names', $num, $num);
$content = '
';
//Select List or Table
switch ($infoStyle) {
case "list": // Output style 1: Simple list style. Better suited to left side of page.
if ($TEXT_DIRECTION=='ltr') $padding = 'padding-left: 15px';
else $padding = 'padding-right: 15px';
$params=array(1,$num,'rcount');
//List Female names
$totals=$stats->commonGivenFemaleTotals($params);
if ($totals) {
$content.=''.WT_I18N::translate('Females').'
'.$totals.'
';
}
//List Male names
$totals=$stats->commonGivenMaleTotals($params);
if ($totals) {
$content.=''.WT_I18N::translate('Males').'
';
}
break;
case "table": // Style 2: Tabular format. Narrow, 2 or 3 column table, good on right side of page
$params=array(1,$num,'rcount');
$content.='
'.$stats->commonGivenFemaleTable($params).'
'.$stats->commonGivenMaleTable($params).'
';
if ($showUnknown) {
$content.='
'.$stats->commonGivenUnknownTable($params).'
';
}
$content.='
';
break;
}
$content .= "
";
if ($template) {
if ($block) {
require WT_THEME_DIR.'templates/block_small_temp.php';
} else {
require WT_THEME_DIR.'templates/block_main_temp.php';
}
} else {
return $content;
}
}
// Implement class WT_Module_Block
public function loadAjax() {
return true;
}
// Implement class WT_Module_Block
public function isUserBlock() {
return true;
}
// Implement class WT_Module_Block
public function isGedcomBlock() {
return true;
}
// Implement class WT_Module_Block
public function configureBlock($block_id) {
if (safe_POST_bool('save')) {
set_block_setting($block_id, 'num', safe_POST_integer('num', 1, 10000, 10));
set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'table'), 'table'));
set_block_setting($block_id, 'showUnknown', safe_POST_bool('showUnknown'));
set_block_setting($block_id, 'block', safe_POST_bool('block'));
echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END;
exit;
}
require_once WT_ROOT.'includes/functions/functions_edit.php';
$num=get_block_setting($block_id, 'num', 10);
echo '
';
echo WT_I18N::translate('Number of items to show');
echo '