getName().$block_id;
$class=$this->getName().'_block';
if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) {
$title='';
} else {
$title='';
}
if ($num==1) {
// I18N: i.e. most popular given name.
$title.=WT_I18N::translate('Top given name');
} else {
// I18N: Title for a list of the most common given names, %s is a number. Note that a separate translation exists when %s is 1
$title.=WT_I18N::plural('Top %s given name', 'Top %s given names', $num, WT_I18N::number($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').'
'.$totals.'
';
}
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).'
';
$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 (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) {
set_block_setting($block_id, 'num', WT_Filter::postInteger('num', 1, 10000, 10));
set_block_setting($block_id, 'infoStyle', WT_Filter::post('infoStyle', 'list|table', 'table'));
set_block_setting($block_id, 'block', WT_Filter::postBool('block'));
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 '