public function getBlock($block_id, $template = true, $cfg = null) { global $ctype; switch (WT_Filter::get('action')) { case 'deletenews': $news_id = WT_Filter::getInteger('news_id'); if ($news_id) { deleteNews($news_id); } break; } $block = get_block_setting($block_id, 'block', true); if ($cfg) { foreach (array('block') as $name) { if (array_key_exists($name, $cfg)) { ${$name} = $cfg[$name]; } } } $usernews = getUserNews(WT_USER_ID); $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; $title = ''; $title .= $this->getTitle(); $content = ''; if (count($usernews) == 0) { $content .= WT_I18N::translate('You have not created any journal items.'); } foreach ($usernews as $key => $news) { $day = date('j', $news['date']); $mon = date('M', $news['date']); $year = date('Y', $news['date']); $content .= "<div class=\"journal_box\">"; $content .= "<div class=\"news_title\">" . $news['title'] . '</div>'; $content .= "<div class=\"news_date\">" . format_timestamp($news['date']) . '</div>'; if ($news["text"] == strip_tags($news["text"])) { // No HTML? $news["text"] = nl2br($news["text"], false); } $content .= $news["text"] . "<br><br>"; $content .= "<a href=\"#\" onclick=\"window.open('editnews.php?news_id='+" . $key . ", '_blank', indx_window_specs); return false;\">" . WT_I18N::translate('Edit') . "</a> | "; $content .= "<a href=\"index.php?action=deletenews&news_id={$key}&ctype={$ctype}\" onclick=\"return confirm('" . WT_I18N::translate('Are you sure you want to delete this journal entry?') . "');\">" . WT_I18N::translate('Delete') . "</a><br>"; $content .= "</div><br>"; } if (WT_USER_ID) { $content .= "<br><a href=\"#\" onclick=\"window.open('editnews.php?user_id='+WT_USER_ID, '_blank', indx_window_specs); return false;\">" . WT_I18N::translate('Add a new journal entry') . "</a>"; } 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; } }
public function configureBlock($block_id) { global $ctype, $controller; $PEDIGREE_ROOT_ID = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_ROOT_ID'); if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'details', WT_Filter::postBool('details')); set_block_setting($block_id, 'type', WT_Filter::post('type', 'pedigree|descendants|hourglass|treenav', 'pedigree')); set_block_setting($block_id, 'pid', WT_Filter::post('pid', WT_REGEX_XREF)); exit; } $details = get_block_setting($block_id, 'details', false); $type = get_block_setting($block_id, 'type', 'pedigree'); $pid = get_block_setting($block_id, 'pid', WT_USER_ID ? WT_USER_GEDCOM_ID ? WT_USER_GEDCOM_ID : $PEDIGREE_ROOT_ID : $PEDIGREE_ROOT_ID); $controller->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();'); ?> <tr><td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Chart type'); ?> </td> <td class="optionbox"> <select name="type"> <option value="pedigree"<?php if ($type == "pedigree") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Pedigree'); ?> </option> <option value="descendants"<?php if ($type == "descendants") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Descendants'); ?> </option> <option value="hourglass"<?php if ($type == "hourglass") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Hourglass chart'); ?> </option> <option value="treenav"<?php if ($type == "treenav") { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('Interactive tree'); ?> </option> </select> </td></tr> <tr> <td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Show details'); ?> </td> <td class="optionbox"> <select name="details"> <option value="no" <?php if (!$details) { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('no'); ?> </option> <option value="yes" <?php if ($details) { echo " selected=\"selected\""; } ?> ><?php echo WT_I18N::translate('yes'); ?> </option> </select> </td> </tr> <tr> <td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Individual'); ?> </td> <td class="optionbox"> <input data-autocomplete-type="INDI" type="text" name="pid" id="pid" value="<?php echo $pid; ?> " size="5"> <?php echo print_findindi_link('pid'); $root = WT_Individual::getInstance($pid); if ($root) { echo ' <span class="list_item">', $root->getFullName(), $root->format_first_major_fact(WT_EVENTS_BIRT, 1), '</span>'; } ?> </td> </tr> <?php require_once WT_ROOT . 'includes/functions/functions_edit.php'; $block = get_block_setting($block_id, 'block', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $block = get_block_setting($block_id, 'block', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'days', WT_Filter::postInteger('days', 1, self::MAX_DAYS, self::DEFAULT_DAYS)); set_block_setting($block_id, 'infoStyle', WT_Filter::post('infoStyle', 'list|table', 'table')); set_block_setting($block_id, 'sortStyle', WT_Filter::post('sortStyle', 'name|date_asc|date_desc', 'date_desc')); set_block_setting($block_id, 'hide_empty', WT_Filter::postBool('hide_empty')); set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $days = get_block_setting($block_id, 'days', self::DEFAULT_DAYS); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Number of days to show'); echo '</td><td class="optionbox">'; echo '<input type="text" name="days" size="2" value="', $days, '">'; echo ' <em>', WT_I18N::plural('maximum %d day', 'maximum %d days', self::MAX_DAYS, self::MAX_DAYS), '</em>'; echo '</td></tr>'; $infoStyle = get_block_setting($block_id, 'infoStyle', 'table'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; echo select_edit_control('infoStyle', array('list' => WT_I18N::translate('list'), 'table' => WT_I18N::translate('table')), null, $infoStyle, ''); echo '</td></tr>'; $sortStyle = get_block_setting($block_id, 'sortStyle', 'date'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Sort order'); echo '</td><td class="optionbox">'; echo select_edit_control('sortStyle', array('name' => WT_I18N::translate('sort by name'), 'date_asc' => WT_I18N::translate('sort by date, oldest first'), 'date_desc' => WT_I18N::translate('sort by date, newest first')), null, $sortStyle, ''); echo '</td></tr>'; $block = get_block_setting($block_id, 'block', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; $hide_empty = get_block_setting($block_id, 'hide_empty', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Should this block be hidden when it is empty?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('hide_empty', $hide_empty); echo '</td></tr>'; echo '<tr><td colspan="2" class="optionbox wrap">'; echo '<span class="error">', WT_I18N::translate('If you hide an empty block, you will not be able to change its configuration until it becomes visible by no longer being empty.'), '</span>'; echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'days', WT_Filter::postInteger('days', 1, 30, 7)); set_block_setting($block_id, 'filter', WT_Filter::postBool('filter')); set_block_setting($block_id, 'onlyBDM', WT_Filter::postBool('onlyBDM')); set_block_setting($block_id, 'infoStyle', WT_Filter::post('infoStyle', 'list|table', 'table')); set_block_setting($block_id, 'sortStyle', WT_Filter::post('sortStyle', 'alpha|anniv', 'alpha')); set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $days = get_block_setting($block_id, 'days', 7); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Number of days to show'); echo '</td><td class="optionbox">'; echo '<input type="text" name="days" size="2" value="', $days, '">'; echo ' <em>', WT_I18N::plural('maximum %d day', 'maximum %d days', 30, 30), '</em>'; echo '</td></tr>'; $filter = get_block_setting($block_id, 'filter', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show only events of living individuals?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('filter', $filter); echo '</td></tr>'; $onlyBDM = get_block_setting($block_id, 'onlyBDM', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show only births, deaths, and marriages?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('onlyBDM', $onlyBDM); echo '</td></tr>'; $infoStyle = get_block_setting($block_id, 'infoStyle', 'table'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; echo select_edit_control('infoStyle', array('list' => WT_I18N::translate('list'), 'table' => WT_I18N::translate('table')), null, $infoStyle, ''); echo '</td></tr>'; $sortStyle = get_block_setting($block_id, 'sortStyle', 'alpha'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Sort order'); echo '</td><td class="optionbox">'; echo select_edit_control('sortStyle', array('alpha' => WT_I18N::translate('sort by name'), 'anniv' => WT_I18N::translate('sort by date')), null, $sortStyle, ''); echo '</td></tr>'; $block = get_block_setting($block_id, 'block', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'days', WT_Filter::postInteger('num', 1, 180, 7)); set_block_setting($block_id, 'sendmail', WT_Filter::postBool('sendmail')); set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $sendmail = get_block_setting($block_id, 'sendmail', true); $days = get_block_setting($block_id, 'days', 7); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Send out reminder emails?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('sendmail', $sendmail); echo '<br>'; echo WT_I18N::translate('Reminder email frequency (days)') . " <input type='text' name='days' value='" . $days . "' size='2'>"; echo '</td></tr>'; $block = get_block_setting($block_id, 'block', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'filter', WT_Filter::post('filter', 'indi|event|all', 'all')); set_block_setting($block_id, 'controls', WT_Filter::postBool('controls')); set_block_setting($block_id, 'start', WT_Filter::postBool('start')); set_block_setting($block_id, 'filter_avi', WT_Filter::postBool('filter_avi')); set_block_setting($block_id, 'filter_bmp', WT_Filter::postBool('filter_bmp')); set_block_setting($block_id, 'filter_gif', WT_Filter::postBool('filter_gif')); set_block_setting($block_id, 'filter_jpeg', WT_Filter::postBool('filter_jpeg')); set_block_setting($block_id, 'filter_mp3', WT_Filter::postBool('filter_mp3')); set_block_setting($block_id, 'filter_ole', WT_Filter::postBool('filter_ole')); set_block_setting($block_id, 'filter_pcx', WT_Filter::postBool('filter_pcx')); set_block_setting($block_id, 'filter_pdf', WT_Filter::postBool('filter_pdf')); set_block_setting($block_id, 'filter_png', WT_Filter::postBool('filter_png')); set_block_setting($block_id, 'filter_tiff', WT_Filter::postBool('filter_tiff')); set_block_setting($block_id, 'filter_wav', WT_Filter::postBool('filter_wav')); set_block_setting($block_id, 'filter_audio', WT_Filter::postBool('filter_audio')); set_block_setting($block_id, 'filter_book', WT_Filter::postBool('filter_book')); set_block_setting($block_id, 'filter_card', WT_Filter::postBool('filter_card')); set_block_setting($block_id, 'filter_certificate', WT_Filter::postBool('filter_certificate')); set_block_setting($block_id, 'filter_coat', WT_Filter::postBool('filter_coat')); set_block_setting($block_id, 'filter_document', WT_Filter::postBool('filter_document')); set_block_setting($block_id, 'filter_electronic', WT_Filter::postBool('filter_electronic')); set_block_setting($block_id, 'filter_fiche', WT_Filter::postBool('filter_fiche')); set_block_setting($block_id, 'filter_film', WT_Filter::postBool('filter_film')); set_block_setting($block_id, 'filter_magazine', WT_Filter::postBool('filter_magazine')); set_block_setting($block_id, 'filter_manuscript', WT_Filter::postBool('filter_manuscript')); set_block_setting($block_id, 'filter_map', WT_Filter::postBool('filter_map')); set_block_setting($block_id, 'filter_newspaper', WT_Filter::postBool('filter_newspaper')); set_block_setting($block_id, 'filter_other', WT_Filter::postBool('filter_other')); set_block_setting($block_id, 'filter_painting', WT_Filter::postBool('filter_painting')); set_block_setting($block_id, 'filter_photo', WT_Filter::postBool('filter_photo')); set_block_setting($block_id, 'filter_tombstone', WT_Filter::postBool('filter_tombstone')); set_block_setting($block_id, 'filter_video', WT_Filter::postBool('filter_video')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $filter = get_block_setting($block_id, 'filter', 'all'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show only individuals, events, or all?'); echo '</td><td class="optionbox">'; echo select_edit_control('filter', array('indi' => WT_I18N::translate('Individuals'), 'event' => WT_I18N::translate('Facts and events'), 'all' => WT_I18N::translate('All')), null, $filter, ''); echo '</td></tr>'; $filters = array('avi' => get_block_setting($block_id, 'filter_avi', false), 'bmp' => get_block_setting($block_id, 'filter_bmp', true), 'gif' => get_block_setting($block_id, 'filter_gif', true), 'jpeg' => get_block_setting($block_id, 'filter_jpeg', true), 'mp3' => get_block_setting($block_id, 'filter_mp3', false), 'ole' => get_block_setting($block_id, 'filter_ole', true), 'pcx' => get_block_setting($block_id, 'filter_pcx', true), 'pdf' => get_block_setting($block_id, 'filter_pdf', false), 'png' => get_block_setting($block_id, 'filter_png', true), 'tiff' => get_block_setting($block_id, 'filter_tiff', true), 'wav' => get_block_setting($block_id, 'filter_wav', false), 'audio' => get_block_setting($block_id, 'filter_audio', false), 'book' => get_block_setting($block_id, 'filter_book', true), 'card' => get_block_setting($block_id, 'filter_card', true), 'certificate' => get_block_setting($block_id, 'filter_certificate', true), 'coat' => get_block_setting($block_id, 'filter_coat', true), 'document' => get_block_setting($block_id, 'filter_document', true), 'electronic' => get_block_setting($block_id, 'filter_electronic', true), 'fiche' => get_block_setting($block_id, 'filter_fiche', true), 'film' => get_block_setting($block_id, 'filter_film', true), 'magazine' => get_block_setting($block_id, 'filter_magazine', true), 'manuscript' => get_block_setting($block_id, 'filter_manuscript', true), 'map' => get_block_setting($block_id, 'filter_map', true), 'newspaper' => get_block_setting($block_id, 'filter_newspaper', true), 'other' => get_block_setting($block_id, 'filter_other', true), 'painting' => get_block_setting($block_id, 'filter_painting', true), 'photo' => get_block_setting($block_id, 'filter_photo', true), 'tombstone' => get_block_setting($block_id, 'filter_tombstone', true), 'video' => get_block_setting($block_id, 'filter_video', false)); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Filter'); ?> </td> <td class="optionbox"> <center><b><?php echo WT_Gedcom_Tag::getLabel('FORM'); ?> </b></center> <table class="width100"> <tr> <td class="width33"><input type="checkbox" value="yes" name="filter_avi" <?php if ($filters['avi']) { echo " checked=\"checked\""; } ?> > avi </td> <td class="width33"><input type="checkbox" value="yes" name="filter_bmp" <?php if ($filters['bmp']) { echo " checked=\"checked\""; } ?> > bmp </td> <td class="width33"><input type="checkbox" value="yes" name="filter_gif" <?php if ($filters['gif']) { echo " checked=\"checked\""; } ?> > gif </td> </tr> <tr> <td class="width33"><input type="checkbox" value="yes" name="filter_jpeg" <?php if ($filters['jpeg']) { echo " checked=\"checked\""; } ?> > jpeg </td> <td class="width33"><input type="checkbox" value="yes" name="filter_mp3" <?php if ($filters['mp3']) { echo " checked=\"checked\""; } ?> > mp3 </td> <td class="width33"><input type="checkbox" value="yes" name="filter_ole" <?php if ($filters['ole']) { echo " checked=\"checked\""; } ?> > ole </td> </tr> <tr> <td class="width33"><input type="checkbox" value="yes" name="filter_pcx" <?php if ($filters['pcx']) { echo " checked=\"checked\""; } ?> > pcx </td> <td class="width33"><input type="checkbox" value="yes" name="filter_pdf" <?php if ($filters['pdf']) { echo " checked=\"checked\""; } ?> > pdf </td> <td class="width33"><input type="checkbox" value="yes" name="filter_png" <?php if ($filters['png']) { echo " checked=\"checked\""; } ?> > png </td> </tr> <tr> <td class="width33"><input type="checkbox" value="yes" name="filter_tiff" <?php if ($filters['tiff']) { echo " checked=\"checked\""; } ?> > tiff </td> <td class="width33"><input type="checkbox" value="yes" name="filter_wav" <?php if ($filters['wav']) { echo " checked=\"checked\""; } ?> > wav </td> <td class="width33"> </td> <td class="width33"> </td> </tr> </table> <br> <center><b><?php echo WT_Gedcom_Tag::getLabel('TYPE'); ?> </b></center> <table class="width100"> <tr> <?php //-- Build the list of checkboxes $i = 0; foreach (WT_Gedcom_Tag::getFileFormTypes() as $typeName => $typeValue) { $i++; if ($i > 3) { $i = 1; echo "</tr><tr>"; } echo "<td class=\"width33\"><input type=\"checkbox\" value=\"yes\" name=\"filter_" . $typeName . "\""; if ($filters[$typeName]) { echo " checked=\"checked\""; } echo "> " . $typeValue . " </td>"; } ?> </tr> </table> </td> </tr> <?php $controls = get_block_setting($block_id, 'controls', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show slide show controls?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('controls', $controls); echo '</td></tr>'; $start = get_block_setting($block_id, 'start', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Start slide show on page load?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('start', $start); echo '</td></tr>'; }
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, 'count_placement', WT_Filter::post('count_placement', 'before|after', 'before')); 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 '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Number of items to show'); echo '</td><td class="optionbox">'; echo '<input type="text" name="num" size="2" value="', $num, '">'; echo '</td></tr>'; $count_placement = get_block_setting($block_id, 'count_placement', 'left'); echo "<tr><td class=\"descriptionbox wrap width33\">"; echo WT_I18N::translate('Place counts before or after name?'); echo "</td><td class=\"optionbox\">"; echo select_edit_control('count_placement', array('before' => WT_I18N::translate('before'), 'after' => WT_I18N::translate('after')), null, $count_placement, ''); echo '</td></tr>'; $block = get_block_setting($block_id, 'block', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
private function show_list() { global $controller; $controller = new WT_Controller_Page(); $controller->setPageTitle($this->getTitle())->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript(' jQuery("#story_table").dataTable({ dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\', ' . WT_I18N::datatablesI18N() . ', autoWidth: false, paging: true, pagingType: "full_numbers", lengthChange: true, filter: true, info: true, jQueryUI: true, sorting: [[0,"asc"]], columns: [ /* 0-name */ null, /* 1-NAME */ null ] }); '); $stories = WT_DB::prepare("SELECT block_id, xref" . " FROM `##block` b" . " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref")->execute(array($this->getName(), WT_GED_ID))->fetchAll(); echo '<h2 class="center">', WT_I18N::translate('Stories'), '</h2>'; if (count($stories) > 0) { echo '<table id="story_table" class="width100">'; echo '<thead><tr> <th>', WT_I18N::translate('Story title'), '</th> <th>', WT_I18N::translate('Individual'), '</th> </tr></thead> <tbody>'; foreach ($stories as $story) { $indi = WT_Individual::getInstance($story->xref); $story_title = get_block_setting($story->block_id, 'title'); $languages = get_block_setting($story->block_id, 'languages'); if (!$languages || in_array(WT_LOCALE, explode(',', $languages))) { if ($indi) { if ($indi->canShow()) { echo '<tr><td><a href="' . $indi->getHtmlUrl() . '#stories">' . $story_title . '</a></td><td><a href="' . $indi->getHtmlUrl() . '#stories">' . $indi->getFullName() . '</a></td></tr>'; } } else { echo '<tr><td>', $story_title, '</td><td class="error">', $story->xref, '</td></tr>'; } } } echo '</tbody></table>'; } }
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|array|table|tagcloud', '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 '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Number of items to show'); echo '</td><td class="optionbox">'; echo '<input type="text" name="num" size="2" value="', $num, '">'; echo '</td></tr>'; $infoStyle = get_block_setting($block_id, 'infoStyle', 'table'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; echo select_edit_control('infoStyle', array('list' => WT_I18N::translate('bullet list'), 'array' => WT_I18N::translate('compact list'), 'table' => WT_I18N::translate('table'), 'tagcloud' => WT_I18N::translate('tag cloud')), null, $infoStyle, ''); echo '</td></tr>'; $block = get_block_setting($block_id, 'block', false); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'show_last_update', WT_Filter::postBool('show_last_update')); set_block_setting($block_id, 'show_common_surnames', WT_Filter::postBool('show_common_surnames')); set_block_setting($block_id, 'stat_indi', WT_Filter::postBool('stat_indi')); set_block_setting($block_id, 'stat_fam', WT_Filter::postBool('stat_fam')); set_block_setting($block_id, 'stat_sour', WT_Filter::postBool('stat_sour')); set_block_setting($block_id, 'stat_other', WT_Filter::postBool('stat_other')); set_block_setting($block_id, 'stat_media', WT_Filter::postBool('stat_media')); set_block_setting($block_id, 'stat_repo', WT_Filter::postBool('stat_repo')); set_block_setting($block_id, 'stat_surname', WT_Filter::postBool('stat_surname')); set_block_setting($block_id, 'stat_events', WT_Filter::postBool('stat_events')); set_block_setting($block_id, 'stat_users', WT_Filter::postBool('stat_users')); set_block_setting($block_id, 'stat_first_birth', WT_Filter::postBool('stat_first_birth')); set_block_setting($block_id, 'stat_last_birth', WT_Filter::postBool('stat_last_birth')); set_block_setting($block_id, 'stat_first_death', WT_Filter::postBool('stat_first_death')); set_block_setting($block_id, 'stat_last_death', WT_Filter::postBool('stat_last_death')); set_block_setting($block_id, 'stat_long_life', WT_Filter::postBool('stat_long_life')); set_block_setting($block_id, 'stat_avg_life', WT_Filter::postBool('stat_avg_life')); set_block_setting($block_id, 'stat_most_chil', WT_Filter::postBool('stat_most_chil')); set_block_setting($block_id, 'stat_avg_chil', WT_Filter::postBool('stat_avg_chil')); set_block_setting($block_id, 'stat_link', WT_Filter::postBool('stat_link')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $show_last_update = get_block_setting($block_id, 'show_last_update', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show date of last update?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_last_update', $show_last_update); echo '</td></tr>'; $show_common_surnames = get_block_setting($block_id, 'show_common_surnames', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show common surnames?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_common_surnames', $show_common_surnames); echo '</td></tr>'; $stat_indi = get_block_setting($block_id, 'stat_indi', true); $stat_fam = get_block_setting($block_id, 'stat_fam', true); $stat_sour = get_block_setting($block_id, 'stat_sour', true); $stat_other = get_block_setting($block_id, 'stat_other', true); $stat_media = get_block_setting($block_id, 'stat_media', true); $stat_repo = get_block_setting($block_id, 'stat_repo', true); $stat_surname = get_block_setting($block_id, 'stat_surname', true); $stat_events = get_block_setting($block_id, 'stat_events', true); $stat_users = get_block_setting($block_id, 'stat_users', true); $stat_first_birth = get_block_setting($block_id, 'stat_first_birth', true); $stat_last_birth = get_block_setting($block_id, 'stat_last_birth', true); $stat_first_death = get_block_setting($block_id, 'stat_first_death', true); $stat_last_death = get_block_setting($block_id, 'stat_last_death', true); $stat_long_life = get_block_setting($block_id, 'stat_long_life', true); $stat_avg_life = get_block_setting($block_id, 'stat_avg_life', true); $stat_most_chil = get_block_setting($block_id, 'stat_most_chil', true); $stat_avg_chil = get_block_setting($block_id, 'stat_avg_chil', true); $stat_link = get_block_setting($block_id, 'stat_link', true); ?> <tr> <td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Select the stats to show in this block'); ?> </td> <td class="optionbox"> <table> <tr> <td><input type="checkbox" value="yes" name="stat_indi" <?php if ($stat_indi) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Individuals'); ?> </td> <td><input type="checkbox" value="yes" name="stat_first_birth" <?php if ($stat_first_birth) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Earliest birth year'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_surname" <?php if ($stat_surname) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Total surnames'); ?> </td> <td><input type="checkbox" value="yes" name="stat_last_birth" <?php if ($stat_last_birth) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Latest birth year'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_fam" <?php if ($stat_fam) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Families'); ?> </td> <td><input type="checkbox" value="yes" name="stat_first_death" <?php if ($stat_first_death) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Earliest death year'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_sour" <?php if ($stat_sour) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Sources'); ?> </td> <td><input type="checkbox" value="yes" name="stat_last_death" <?php if ($stat_last_death) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Latest death year'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_media" <?php if ($stat_media) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Media objects'); ?> </td> <td><input type="checkbox" value="yes" name="stat_long_life" <?php if ($stat_long_life) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Individual who lived the longest'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_repo" <?php if ($stat_repo) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Repositories'); ?> </td> <td><input type="checkbox" value="yes" name="stat_avg_life" <?php if ($stat_avg_life) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Average age at death'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_other" <?php if ($stat_other) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Other records'); ?> </td> <td><input type="checkbox" value="yes" name="stat_most_chil" <?php if ($stat_most_chil) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Family with the most children'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_events" <?php if ($stat_events) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Total events'); ?> </td> <td><input type="checkbox" value="yes" name="stat_avg_chil" <?php if ($stat_avg_chil) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Average number of children per family'); ?> </td> </tr> <tr> <td><input type="checkbox" value="yes" name="stat_users" <?php if ($stat_users) { echo ' checked="checked"'; } ?> > <?php echo WT_I18N::translate('Total users'); ?> </td> <td> </td> </tr> </table> </td> </tr> <?php $stat_link = get_block_setting($block_id, 'stat_link', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show link to Statistics charts?'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('stat_link', $stat_link); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'days', WT_Filter::postInteger('days', 1, 30, 7)); set_block_setting($block_id, 'infoStyle', WT_Filter::post('infoStyle', 'list|table', 'table')); set_block_setting($block_id, 'calendar', WT_Filter::post('calendar', 'jewish|gregorian', 'jewish')); set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $days = get_block_setting($block_id, 'days', 7); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Number of days to show'); echo '</td><td class="optionbox">'; echo '<input type="text" name="days" size="2" value="' . $days . '">'; echo ' <em>', WT_I18N::plural('maximum %d day', 'maximum %d days', 30, 30), '</em>'; echo '</td></tr>'; $infoStyle = get_block_setting($block_id, 'infoStyle', 'table'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Presentation style'); echo '</td><td class="optionbox">'; echo select_edit_control('infoStyle', array('list' => WT_I18N::translate('list'), 'table' => WT_I18N::translate('table')), null, $infoStyle, ''); echo '</td></tr>'; $calendar = get_block_setting($block_id, 'calendar'); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Calendar'); echo '</td><td class="optionbox">'; echo select_edit_control('calendar', array('jewish' => WT_Date_Jewish::calendarName(), 'gregorian' => WT_Date_Gregorian::calendarName()), null, $calendar, ''); echo '</td></tr>'; $block = get_block_setting($block_id, 'block', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
private function edit() { require_once WT_ROOT . 'includes/functions/functions_edit.php'; if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { $block_id = WT_Filter::postInteger('block_id'); if ($block_id) { WT_DB::prepare("UPDATE `##block` SET gedcom_id=NULLIF(?, '0'), block_order=? WHERE block_id=?")->execute(array(WT_Filter::postInteger('gedcom_id'), WT_Filter::postInteger('block_order'), $block_id)); } else { WT_DB::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(?, '0'), ?, ?)")->execute(array(WT_Filter::postInteger('gedcom_id'), $this->getName(), WT_Filter::postInteger('block_order'))); $block_id = WT_DB::getInstance()->lastInsertId(); } set_block_setting($block_id, 'header', WT_Filter::post('header')); set_block_setting($block_id, 'faqbody', WT_Filter::post('faqbody')); $languages = array(); foreach (WT_I18N::installed_languages() as $code => $name) { if (WT_Filter::postBool('lang_' . $code)) { $languages[] = $code; } } set_block_setting($block_id, 'languages', implode(',', $languages)); $this->config(); } else { $block_id = WT_Filter::getInteger('block_id'); $controller = new WT_Controller_Page(); if ($block_id) { $controller->setPageTitle(WT_I18N::translate('Edit FAQ item')); $header = get_block_setting($block_id, 'header'); $faqbody = get_block_setting($block_id, 'faqbody'); $block_order = WT_DB::prepare("SELECT block_order FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne(); $gedcom_id = WT_DB::prepare("SELECT gedcom_id FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne(); } else { $controller->setPageTitle(WT_I18N::translate('Add an FAQ item')); $header = ''; $faqbody = ''; $block_order = WT_DB::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name=?")->execute(array($this->getName()))->fetchOne(); $gedcom_id = WT_GED_ID; } $controller->pageHeader(); if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { ckeditor_WT_Module::enableEditor($controller); } // "Help for this page" link echo '<div id="page_help">', help_link('add_faq_item', $this->getName()), '</div>'; echo '<form name="faq" method="post" action="module.php?mod=', $this->getName(), '&mod_action=admin_edit">'; echo WT_Filter::getCsrf(); echo '<input type="hidden" name="save" value="1">'; echo '<input type="hidden" name="block_id" value="', $block_id, '">'; echo '<table id="faq_module">'; echo '<tr><th>'; echo WT_I18N::translate('Question'); echo '</th></tr><tr><td><input type="text" name="header" size="90" tabindex="1" value="' . WT_Filter::escapeHtml($header) . '"></td></tr>'; echo '<tr><th>'; echo WT_I18N::translate('Answer'); echo '</th></tr><tr><td>'; echo '<textarea name="faqbody" class="html-edit" rows="10" cols="90" tabindex="2">', WT_Filter::escapeHtml($faqbody), '</textarea>'; echo '</td></tr>'; echo '</table><table id="faq_module2">'; echo '<tr>'; echo '<th>', WT_I18N::translate('Show this block for which languages?'), '</th>'; echo '<th>', WT_I18N::translate('FAQ position'), help_link('add_faq_order', $this->getName()), '</th>'; echo '<th>', WT_I18N::translate('FAQ visibility'), help_link('add_faq_visibility', $this->getName()), '</th>'; echo '</tr><tr>'; echo '<td>'; $languages = get_block_setting($block_id, 'languages'); echo edit_language_checkboxes('lang_', $languages); echo '</td><td>'; echo '<input type="text" name="block_order" size="3" tabindex="3" value="', $block_order, '"></td>'; echo '</td><td>'; echo select_edit_control('gedcom_id', WT_Tree::getIdList(), WT_I18N::translate('All'), $gedcom_id, 'tabindex="4"'); echo '</td></tr>'; echo '</table>'; echo '<p><input type="submit" value="', WT_I18N::translate('save'), '" tabindex="5">'; echo '</form>'; exit; } }
private function show() { global $controller; $controller = new WT_Controller_Page(); $controller->setPageTitle($this->getTitle())->pageHeader(); $faqs = WT_DB::prepare("SELECT block_id, bs1.setting_value AS header, bs2.setting_value AS body" . " FROM `##block` b" . " JOIN `##block_setting` bs1 USING (block_id)" . " JOIN `##block_setting` bs2 USING (block_id)" . " WHERE module_name=?" . " AND bs1.setting_name='header'" . " AND bs2.setting_name='faqbody'" . " AND IFNULL(gedcom_id, ?)=?" . " ORDER BY block_order")->execute(array($this->getName(), WT_GED_ID, WT_GED_ID))->fetchAll(); // Define your colors for the alternating rows echo '<h2 class="center">', WT_I18N::translate('Frequently asked questions'), '</h2>'; // Instructions echo '<div class="faq_italic">', WT_I18N::translate('Click on a title to go straight to it, or scroll down to read them all'); if (WT_USER_GEDCOM_ADMIN) { echo '<div class="faq_edit">', '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_config">', WT_I18N::translate('Click here to add, edit, or delete'), '</a>', '</div>'; } echo '</div>'; //Start the table to contain the list of headers $row_count = 0; echo '<table class="faq">'; // List of titles foreach ($faqs as $id => $faq) { $header = get_block_setting($faq->block_id, 'header'); $faqbody = get_block_setting($faq->block_id, 'faqbody'); $languages = get_block_setting($faq->block_id, 'languages'); if (!$languages || in_array(WT_LOCALE, explode(',', $languages))) { $row_color = $row_count % 2 ? 'odd' : 'even'; // NOTE: Print the header of the current item echo '<tr class="', $row_color, '"><td style="padding: 5px;">'; echo '<a href="#faq', $id, '">', $faq->header, '</a>'; echo '</td></tr>'; $row_count++; } } echo '</table><hr>'; // Detailed entries foreach ($faqs as $id => $faq) { $header = get_block_setting($faq->block_id, 'header'); $faqbody = get_block_setting($faq->block_id, 'faqbody'); $languages = get_block_setting($faq->block_id, 'languages'); if (!$languages || in_array(WT_LOCALE, explode(',', $languages))) { // NOTE: Print the body text of the current item, with its header echo '<div class="faq_title" id="faq', $id, '">', $faq->header; echo '<div class="faq_top faq_italic">'; echo '<a href="#body">', WT_I18N::translate('back to top'), '</a>'; echo '</div>'; echo '</div>'; echo '<div class="faq_body">', substr($faqbody, 0, 1) == '<' ? $faqbody : nl2br($faqbody, false), '</div>'; echo '<hr>'; } } }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'gedcom', WT_Filter::post('gedcom')); set_block_setting($block_id, 'title', WT_Filter::post('title')); set_block_setting($block_id, 'html', WT_Filter::post('html')); set_block_setting($block_id, 'show_timestamp', WT_Filter::postBool('show_timestamp')); set_block_setting($block_id, 'timestamp', WT_Filter::post('timestamp')); $languages = array(); foreach (WT_I18N::installed_languages() as $code => $name) { if (WT_Filter::postBool('lang_' . $code)) { $languages[] = $code; } } set_block_setting($block_id, 'languages', implode(',', $languages)); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $templates = array(WT_I18N::translate('Keyword examples') => '#getAllTagsTable#', WT_I18N::translate('Narrative description') => WT_I18N::translate('This GEDCOM (family tree) was last updated on #gedcomUpdated#. There are #totalSurnames# surnames in this family tree. The earliest recorded event is the #firstEventType# of #firstEventName# in #firstEventYear#. The most recent event is the #lastEventType# of #lastEventName# in #lastEventYear#.<br><br>If you have any comments or feedback please contact #contactWebmaster#.'), WT_I18N::translate('Statistics') => '<div class="gedcom_stats"> <span style="font-weight: bold"><a href="index.php?command=gedcom">#gedcomTitle#</a></span><br> ' . WT_I18N::translate('This family tree was last updated on %s.', '#gedcomUpdated#') . ' <table id="keywords"> <tr> <td valign="top" class="width20"> <table cellspacing="1" cellpadding="0"> <tr> <td class="facts_label">' . WT_I18N::translate('Individuals') . '</td> <td class="facts_value" align="right"><a href="indilist.php?surname_sublist=no">#totalIndividuals#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Males') . '</td> <td class="facts_value" align="right">#totalSexMales#<br>#totalSexMalesPercentage#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Females') . '</td> <td class="facts_value" align="right">#totalSexFemales#<br>#totalSexFemalesPercentage#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Total surnames') . '</td> <td class="facts_value" align="right"><a href="indilist.php?show_all=yes&surname_sublist=yes&ged=' . WT_GEDURL . '">#totalSurnames#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Families') . '</td> <td class="facts_value" align="right"><a href="famlist.php?ged=' . WT_GEDURL . '">#totalFamilies#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Sources') . '</td> <td class="facts_value" align="right"><a href="sourcelist.php?ged=' . WT_GEDURL . '">#totalSources#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Media objects') . '</td> <td class="facts_value" align="right"><a href="medialist.php?ged=' . WT_GEDURL . '">#totalMedia#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Repositories') . '</td> <td class="facts_value" align="right"><a href="repolist.php?ged=' . WT_GEDURL . '">#totalRepositories#</a></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Total events') . '</td> <td class="facts_value" align="right">#totalEvents#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Total users') . '</td> <td class="facts_value" align="right">#totalUsers#</td> </tr> </table> </td> <td><br></td> <td valign="top"> <table cellspacing="1" cellpadding="0" border="0"> <tr> <td class="facts_label">' . WT_I18N::translate('Earliest birth year') . '</td> <td class="facts_value" align="right">#firstBirthYear#</td> <td class="facts_value">#firstBirth#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Latest birth year') . '</td> <td class="facts_value" align="right">#lastBirthYear#</td> <td class="facts_value">#lastBirth#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Earliest death year') . '</td> <td class="facts_value" align="right">#firstDeathYear#</td> <td class="facts_value">#firstDeath#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Latest death year') . '</td> <td class="facts_value" align="right">#lastDeathYear#</td> <td class="facts_value">#lastDeath#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Individual who lived the longest') . '</td> <td class="facts_value" align="right">#longestLifeAge#</td> <td class="facts_value">#longestLife#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Average age at death') . '</td> <td class="facts_value" align="right">#averageLifespan#</td> <td class="facts_value"></td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Family with the most children') . '</td> <td class="facts_value" align="right">#largestFamilySize#</td> <td class="facts_value">#largestFamily#</td> </tr> <tr> <td class="facts_label">' . WT_I18N::translate('Average number of children per family') . '</td> <td class="facts_value" align="right">#averageChildren#</td> <td class="facts_value"></td> </tr> </table> </td> </tr> </table><br> <span style="font-weight: bold">' . WT_I18N::translate('Most common surnames') . '</span><br> #commonSurnames# </div>'); $title = get_block_setting($block_id, 'title'); $html = get_block_setting($block_id, 'html'); // title echo '<tr><td class="descriptionbox wrap">', WT_Gedcom_Tag::getLabel('TITL'), '</td><td class="optionbox"><input type="text" name="title" size="30" value="', WT_Filter::escapeHtml($title), '"></td></tr>'; // templates echo '<tr><td class="descriptionbox wrap">', WT_I18N::translate('Templates'), help_link('block_html_template', $this->getName()), '</td><td class="optionbox">'; // The CK editor needs lots of help to load/save data :-( if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { $ckeditor_onchange = 'CKEDITOR.instances.html.setData(document.block.html.value);'; } else { $ckeditor_onchange = ''; } echo '<select name="template" onchange="document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;', $ckeditor_onchange, '">'; echo '<option value="', WT_Filter::escapeHtml($html), '">', WT_I18N::translate('Custom'), '</option>'; foreach ($templates as $title => $template) { echo '<option value="', WT_Filter::escapeHtml($template), '">', $title, '</option>'; } echo '</select></td></tr>'; // gedcom $gedcom = get_block_setting($block_id, 'gedcom'); if (count(WT_Tree::getAll()) > 1) { if ($gedcom == '__current__') { $sel_current = ' selected="selected"'; } else { $sel_current = ''; } if ($gedcom == '__default__') { $sel_default = ' selected="selected"'; } else { $sel_default = ''; } echo '<tr><td class="descriptionbox wrap">', WT_I18N::translate('Family tree'), '</td><td class="optionbox">', '<select name="gedcom">', '<option value="__current__"', $sel_current, '>', WT_I18N::translate('Current'), '</option>', '<option value="__default__"', $sel_default, '>', WT_I18N::translate('Default'), '</option>'; foreach (WT_Tree::getAll() as $tree) { if ($tree->tree_name == $gedcom) { $sel = ' selected="selected"'; } else { $sel = ''; } echo '<option value="', $tree->tree_name, '"', $sel, ' dir="auto">', $tree->tree_title_html, '</option>'; } echo '</select></td></tr>'; } // html echo '<tr><td colspan="2" class="descriptionbox">', WT_I18N::translate('Content'), help_link('block_html_content', $this->getName()), '</td></tr><tr>', '<td colspan="2" class="optionbox">'; echo '<textarea name="html" class="html-edit" rows="10" style="width:98%;">', WT_Filter::escapeHtml($html), '</textarea>'; echo '</td></tr>'; $show_timestamp = get_block_setting($block_id, 'show_timestamp', false); echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Show the date and time of update'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_timestamp', $show_timestamp); echo '<input type="hidden" name="timestamp" value="', WT_TIMESTAMP, '">'; echo '</td></tr>'; $languages = get_block_setting($block_id, 'languages'); echo '<tr><td class="descriptionbox wrap">'; echo WT_I18N::translate('Show this block for which languages?'); echo '</td><td class="optionbox">'; echo edit_language_checkboxes('lang_', $languages); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'show_other', WT_Filter::postBool('show_other')); set_block_setting($block_id, 'show_unassigned', WT_Filter::postBool('show_unassigned')); set_block_setting($block_id, 'show_future', WT_Filter::postBool('show_future')); set_block_setting($block_id, 'block', WT_Filter::postBool('block')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; $show_other = get_block_setting($block_id, 'show_other', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show research tasks that are assigned to other users'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_other', $show_other); echo '</td></tr>'; $show_unassigned = get_block_setting($block_id, 'show_unassigned', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show research tasks that are not assigned to any user'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_unassigned', $show_unassigned); echo '</td></tr>'; $show_future = get_block_setting($block_id, 'show_future', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Show research tasks that have a date in the future'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('show_future', $show_future); echo '</td></tr>'; $block = get_block_setting($block_id, 'block', true); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Add a scrollbar when block contents grow'); echo '</td><td class="optionbox">'; echo edit_field_yes_no('block', $block); echo '</td></tr>'; }
public function configureBlock($block_id) { if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) { set_block_setting($block_id, 'limit', WT_Filter::post('limit')); set_block_setting($block_id, 'flag', WT_Filter::post('flag')); exit; } require_once WT_ROOT . 'includes/functions/functions_edit.php'; // Limit Type $limit = get_block_setting($block_id, 'limit', 'nolimit'); echo '<tr><td class="descriptionbox wrap width33">', WT_I18N::translate('Limit display by:'), help_link('gedcom_news_limit'), '</td><td class="optionbox"><select name="limit"><option value="nolimit"', ($limit == 'nolimit' ? ' selected="selected"' : '') . ">", WT_I18N::translate('No limit') . "</option>", '<option value="date"' . ($limit == 'date' ? ' selected="selected"' : '') . ">" . WT_I18N::translate('Age of item') . "</option>", '<option value="count"' . ($limit == 'count' ? ' selected="selected"' : '') . ">" . WT_I18N::translate('Number of items') . "</option>", '</select></td></tr>'; // Flag to look for $flag = get_block_setting($block_id, 'flag', 0); echo '<tr><td class="descriptionbox wrap width33">'; echo WT_I18N::translate('Limit:'), help_link('gedcom_news_flag'); echo '</td><td class="optionbox"><input type="text" name="flag" size="4" maxlength="4" value="' . $flag . '"></td></tr>'; }