getName().$block_id;
$title='';
if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user" && WT_USER_ID) {
$title.="";
$title.="";
}
$title.= i18n::translate('Upcoming Events').help_link('upcoming_events', $this->getName());
$content = "";
switch ($infoStyle) {
case "list":
// Output style 1: Old format, no visible tables, much smaller text. Better suited to right side of page.
$content.=print_events_list($startjd, $endjd, $onlyBDM?'BIRT MARR DEAT':'', $filter, 'style1');
break;
case "table":
// Style 2: New format, tables, big text, etc. Not too good on right side of page
ob_start();
$content.=print_events_table($startjd, $endjd, $onlyBDM?'BIRT MARR DEAT':'', $filter, 'style2');
$content.=ob_get_clean();
break;
}
if ($template) {
if ($block) {
require $THEME_DIR.'templates/block_small_temp.php';
} else {
require $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, 'days', safe_POST_integer('days', 1, 30, 7));
set_block_setting($block_id, 'filter', safe_POST_bool('filter'));
set_block_setting($block_id, 'onlyBDM', safe_POST_bool('onlyBDM'));
set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'table'), 'table'));
set_block_setting($block_id, 'sortStyle', safe_POST('sortStyle', array('alpha', 'anniv'), 'alpha'));
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';
$days=get_block_setting($block_id, 'days', 7);
echo '