当前位置: 首页>>代码示例>>PHP>>正文


PHP WT_Filter::postBool方法代码示例

本文整理汇总了PHP中WT_Filter::postBool方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_Filter::postBool方法的具体用法?PHP WT_Filter::postBool怎么用?PHP WT_Filter::postBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WT_Filter的用法示例。


在下文中一共展示了WT_Filter::postBool方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configureBlock

    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&amp;surname_sublist=yes&amp;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>
//.........这里部分代码省略.........
开发者ID:jacoline,项目名称:webtrees,代码行数:101,代码来源:module.php

示例2: configureBlock

 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>';
 }
开发者ID:brambravo,项目名称:webtrees,代码行数:28,代码来源:module.php

示例3: edit

 private function edit()
 {
     require_once WT_ROOT . 'includes/functions/functions_edit.php';
     if (WT_USER_CAN_EDIT) {
         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=?, xref=? WHERE block_id=?")->execute(array(WT_Filter::postInteger('gedcom_id'), WT_Filter::post('xref', WT_REGEX_XREF), $block_id));
             } else {
                 WT_DB::prepare("INSERT INTO `##block` (gedcom_id, xref, module_name, block_order) VALUES (?, ?, ?, ?)")->execute(array(WT_Filter::postInteger('gedcom_id'), WT_Filter::post('xref', WT_REGEX_XREF), $this->getName(), 0));
                 $block_id = WT_DB::getInstance()->lastInsertId();
             }
             set_block_setting($block_id, 'title', WT_Filter::post('title'));
             set_block_setting($block_id, 'story_body', WT_Filter::post('story_body'));
             $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 story'));
                 $title = get_block_setting($block_id, 'title');
                 $story_body = get_block_setting($block_id, 'story_body');
                 $gedcom_id = WT_DB::prepare("SELECT gedcom_id FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
                 $xref = WT_DB::prepare("SELECT xref FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
             } else {
                 $controller->setPageTitle(WT_I18N::translate('Add a story'));
                 $title = '';
                 $story_body = '';
                 $gedcom_id = WT_GED_ID;
                 $xref = WT_Filter::get('xref', WT_REGEX_XREF);
             }
             $controller->pageHeader()->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();');
             if (array_key_exists('ckeditor', WT_Module::getActiveModules())) {
                 ckeditor_WT_Module::enableEditor($controller);
             }
             echo '<form name="story" method="post" action="module.php?mod=', $this->getName(), '&amp;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 '<input type="hidden" name="gedcom_id" value="', WT_GED_ID, '">';
             echo '<table id="story_module">';
             echo '<tr><th>';
             echo WT_I18N::translate('Story title');
             echo '</th></tr><tr><td><textarea name="title" rows="1" cols="90" tabindex="2">', WT_Filter::escapeHtml($title), '</textarea></td></tr>';
             echo '<tr><th>';
             echo WT_I18N::translate('Story');
             echo '</th></tr><tr><td>';
             echo '<textarea name="story_body" class="html-edit" rows="10" cols="90" tabindex="2">', WT_Filter::escapeHtml($story_body), '</textarea>';
             echo '</td></tr>';
             echo '</table><table id="story_module2">';
             echo '<tr>';
             echo '<th>', WT_I18N::translate('Individual'), '</th>';
             echo '<th>', WT_I18N::translate('Show this block for which languages?'), '</th>';
             echo '</tr>';
             echo '<tr>';
             echo '<td class="optionbox">';
             echo '<input data-autocomplete-type="INDI" type="text" name="xref" id="pid" size="4" value="' . $xref . '">';
             echo print_findindi_link('pid');
             if ($xref) {
                 $person = WT_Individual::getInstance($xref);
                 if ($person) {
                     echo ' ', $person->format_list('span');
                 }
             }
             echo '</td>';
             $languages = get_block_setting($block_id, 'languages');
             echo '<td class="optionbox">';
             echo edit_language_checkboxes('lang_', $languages);
             echo '</td></tr></table>';
             echo '<p><input type="submit" value="', WT_I18N::translate('save'), '" tabindex="5">';
             echo '</p>';
             echo '</form>';
             exit;
         }
     } else {
         header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH);
         exit;
     }
 }
开发者ID:brambravo,项目名称:webtrees,代码行数:86,代码来源:module.php

示例4: define

define('WT_SCRIPT_NAME', 'addmedia.php');
require './includes/session.php';
require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$pid = WT_Filter::get('pid', WT_REGEX_XREF, WT_Filter::post('pid', WT_REGEX_XREF));
// edit this media object
$linktoid = WT_Filter::get('linktoid', WT_REGEX_XREF, WT_Filter::post('linktoid', WT_REGEX_XREF));
// create a new media object, linked to this record
$action = WT_Filter::get('action', null, WT_Filter::post('action'));
$filename = WT_Filter::get('filename', null, WT_Filter::post('filename'));
$text = WT_Filter::postArray('text');
$tag = WT_Filter::postArray('tag', WT_REGEX_TAG);
$islink = WT_Filter::postArray('islink');
$glevels = WT_Filter::postArray('glevels', '[0-9]');
$folder = WT_Filter::post('folder');
$update_CHAN = !WT_Filter::postBool('preserve_last_changed');
$controller = new WT_Controller_Simple();
$controller->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->restrictAccess(Auth::isMember());
$disp = true;
$media = WT_Media::getInstance($pid);
if ($media) {
    $disp = $media->canShow();
}
if ($action == 'update' || $action == 'create') {
    if ($linktoid) {
        $disp = WT_GedcomRecord::getInstance($linktoid)->canShow();
    }
}
if (!WT_USER_CAN_EDIT || !$disp) {
    $controller->pageHeader()->addInlineJavascript('closePopupAndReloadParent();');
    exit;
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:addmedia.php

示例5: header

        echo WT_I18N::translate('sort by date of marriage');
        ?>
">
			<input type="button" class="cancel" value="<?php 
        echo WT_I18N::translate('close');
        ?>
" onclick="window.close();">
		</p>
	</form>
	</div>
	<?php 
        break;
    case 'reorder_fams_update':
        $xref = WT_Filter::post('xref', WT_REGEX_XREF);
        $order = WT_Filter::post('order');
        $keep_chan = WT_Filter::postBool('keep_chan');
        if (!WT_Filter::checkCsrf()) {
            Zend_Session::writeClose();
            header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?action=reorder_fams&xref=' . $xref);
            exit;
        }
        $person = WT_Individual::getInstance($xref);
        check_record_access($person);
        $controller->setPageTitle(WT_I18N::translate('Re-order families'))->pageHeader();
        if (is_array($order)) {
            $gedcom = array('0 @' . $person->getXref() . '@ INDI');
            $facts = $person->getFacts();
            // Move families to the end of the record
            foreach ($order as $family => $num) {
                foreach ($facts as $n => $fact) {
                    if ($fact->getValue() == '@' . $family . '@') {
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:edit_interface.php

示例6: set_gedcom_setting

 set_gedcom_setting(WT_GED_ID, 'SHOW_STATS', WT_Filter::postBool('NEW_SHOW_STATS'));
 set_gedcom_setting(WT_GED_ID, 'SOURCE_ID_PREFIX', WT_Filter::post('NEW_SOURCE_ID_PREFIX'));
 set_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_ADD', str_replace(' ', '', WT_Filter::post('NEW_SOUR_FACTS_ADD')));
 set_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_QUICK', str_replace(' ', '', WT_Filter::post('NEW_SOUR_FACTS_QUICK')));
 set_gedcom_setting(WT_GED_ID, 'SOUR_FACTS_UNIQUE', str_replace(' ', '', WT_Filter::post('NEW_SOUR_FACTS_UNIQUE')));
 set_gedcom_setting(WT_GED_ID, 'SUBLIST_TRIGGER_I', WT_Filter::post('NEW_SUBLIST_TRIGGER_I', WT_REGEX_INTEGER, 200));
 set_gedcom_setting(WT_GED_ID, 'SURNAME_LIST_STYLE', WT_Filter::post('NEW_SURNAME_LIST_STYLE'));
 set_gedcom_setting(WT_GED_ID, 'SURNAME_TRADITION', WT_Filter::post('NEW_SURNAME_TRADITION'));
 set_gedcom_setting(WT_GED_ID, 'THEME_DIR', WT_Filter::post('NEW_THEME_DIR'));
 set_gedcom_setting(WT_GED_ID, 'THUMBNAIL_WIDTH', WT_Filter::post('NEW_THUMBNAIL_WIDTH'));
 set_gedcom_setting(WT_GED_ID, 'USE_RIN', WT_Filter::postBool('NEW_USE_RIN'));
 set_gedcom_setting(WT_GED_ID, 'USE_SILHOUETTE', WT_Filter::postBool('NEW_USE_SILHOUETTE'));
 set_gedcom_setting(WT_GED_ID, 'WATERMARK_THUMB', WT_Filter::postBool('NEW_WATERMARK_THUMB'));
 set_gedcom_setting(WT_GED_ID, 'WEBMASTER_USER_ID', WT_Filter::post('NEW_WEBMASTER_USER_ID'));
 set_gedcom_setting(WT_GED_ID, 'WEBTREES_EMAIL', WT_Filter::post('NEW_WEBTREES_EMAIL'));
 set_gedcom_setting(WT_GED_ID, 'WORD_WRAPPED_NOTES', WT_Filter::postBool('NEW_WORD_WRAPPED_NOTES'));
 if (WT_Filter::post('gedcom_title')) {
     set_gedcom_setting(WT_GED_ID, 'title', WT_Filter::post('gedcom_title'));
 }
 // Only accept valid folders for NEW_MEDIA_DIRECTORY
 $NEW_MEDIA_DIRECTORY = preg_replace('/[\\/\\\\]+/', '/', WT_Filter::post('NEW_MEDIA_DIRECTORY') . '/');
 if (substr($NEW_MEDIA_DIRECTORY, 0, 1) == '/') {
     $NEW_MEDIA_DIRECTORY = substr($NEW_MEDIA_DIRECTORY, 1);
 }
 if ($NEW_MEDIA_DIRECTORY) {
     if (is_dir(WT_DATA_DIR . $NEW_MEDIA_DIRECTORY)) {
         set_gedcom_setting(WT_GED_ID, 'MEDIA_DIRECTORY', $NEW_MEDIA_DIRECTORY);
     } elseif (@mkdir(WT_DATA_DIR . $NEW_MEDIA_DIRECTORY, 0755, true)) {
         set_gedcom_setting(WT_GED_ID, 'MEDIA_DIRECTORY', $NEW_MEDIA_DIRECTORY);
         WT_FlashMessages::addMessage(WT_I18N::translate('The folder %s was created.', WT_DATA_DIR . $NEW_MEDIA_DIRECTORY));
     } else {
开发者ID:jacoline,项目名称:webtrees,代码行数:31,代码来源:admin_trees_config.php

示例7: edit

 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(), '&amp;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;
     }
 }
开发者ID:jacoline,项目名称:webtrees,代码行数:76,代码来源:module.php

示例8: __construct

 function __construct()
 {
     parent::__construct();
     // $action comes from GET (menus) or POST (form submission)
     $this->action = WT_Filter::post('action', 'advanced|general|soundex|replace');
     if (!$this->action) {
         $this->action = WT_Filter::get('action', 'advanced|general|soundex|replace', 'general');
     }
     $topsearch = WT_Filter::postBool('topsearch');
     if ($topsearch) {
         $this->isPostBack = true;
         $this->srfams = 'yes';
         $this->srindi = 'yes';
         $this->srsour = 'yes';
         $this->srnote = 'yes';
     }
     // Get the query
     $this->query = WT_Filter::post('query', '.{2,}');
     $this->myquery = WT_Filter::escapeHtml($this->query);
     $this->replace = WT_Filter::post('replace');
     $this->replaceNames = WT_Filter::postBool('replaceNames');
     $this->replacePlaces = WT_Filter::postBool('replacePlaces');
     $this->replacePlacesWord = WT_Filter::postBool('replacePlacesWord');
     $this->replaceAll = WT_Filter::postBool('replaceAll');
     // TODO: fetch each variable independently, using appropriate validation
     // Aquire all the variables values from the $_REQUEST
     $varNames = array("isPostBack", "srfams", "srindi", "srsour", "srnote", "view", "soundex", "subaction", "nameprt", "showasso", "resultsPageNum", "resultsPerPage", "totalResults", "totalGeneralResults", "indiResultsPrinted", "famResultsPrinted", "srcResultsPrinted", "myindilist", "mysourcelist", "mynotelist", "myfamlist");
     $this->setRequestValues($varNames);
     if (!$this->isPostBack) {
         // Enable the default gedcom for search
         $str = str_replace(array(".", "-", " "), array("_", "_", "_"), WT_GEDCOM);
         $_REQUEST["{$str}"] = $str;
     }
     // Retrieve the gedcoms to search in
     if (count(WT_Tree::getAll()) > 1 && WT_Site::getPreference('ALLOW_CHANGE_GEDCOM')) {
         foreach (WT_Tree::getAll() as $tree) {
             $str = str_replace(array(".", "-", " "), array("_", "_", "_"), $tree->tree_name);
             if (isset($_REQUEST["{$str}"]) || $topsearch) {
                 $this->sgeds[$tree->tree_id] = $tree->tree_name;
                 $_REQUEST["{$str}"] = 'yes';
             }
         }
     } else {
         $this->sgeds[WT_GED_ID] = WT_GEDCOM;
     }
     // vars use for soundex search
     $this->firstname = WT_Filter::post('firstname');
     $this->lastname = WT_Filter::post('lastname');
     $this->place = WT_Filter::post('place');
     $this->year = WT_Filter::post('year');
     // Set the search result titles for soundex searches
     if ($this->firstname || $this->lastname || $this->place) {
         $this->myquery = WT_Filter::escapeHtml(implode(' ', array($this->firstname, $this->lastname, $this->place)));
     }
     if (!empty($_REQUEST["name"])) {
         $this->name = $_REQUEST["name"];
         $this->myname = $this->name;
     } else {
         $this->name = "";
         $this->myname = "";
     }
     if (!empty($_REQUEST["birthdate"])) {
         $this->birthdate = $_REQUEST["birthdate"];
         $this->mybirthdate = $this->birthdate;
     } else {
         $this->birthdate = "";
         $this->mybirthdate = "";
     }
     if (!empty($_REQUEST["birthplace"])) {
         $this->birthplace = $_REQUEST["birthplace"];
         $this->mybirthplace = $this->birthplace;
     } else {
         $this->birthplace = "";
         $this->mybirthplace = "";
     }
     if (!empty($_REQUEST["deathdate"])) {
         $this->deathdate = $_REQUEST["deathdate"];
         $this->mydeathdate = $this->deathdate;
     } else {
         $this->deathdate = "";
         $this->mydeathdate = "";
     }
     if (!empty($_REQUEST["deathplace"])) {
         $this->deathplace = $_REQUEST["deathplace"];
         $this->mydeathplace = $this->deathplace;
     } else {
         $this->deathplace = "";
         $this->mydeathplace = "";
     }
     if (!empty($_REQUEST["gender"])) {
         $this->gender = $_REQUEST["gender"];
         $this->mygender = $this->gender;
     } else {
         $this->gender = "";
         $this->mygender = "";
     }
     $this->inputFieldNames[] = "action";
     $this->inputFieldNames[] = "isPostBack";
     $this->inputFieldNames[] = "resultsPerPage";
     $this->inputFieldNames[] = "query";
//.........这里部分代码省略.........
开发者ID:jacoline,项目名称:webtrees,代码行数:101,代码来源:Search.php

示例9: array

$ALL_THEMES_DIRS = array();
foreach (get_theme_names() as $themename => $themedir) {
    $ALL_THEME_DIRS[] = $themedir;
}
// Extract form variables
$form_action = WT_Filter::post('form_action');
$form_username = WT_Filter::post('form_username');
$form_realname = WT_Filter::post('form_realname');
$form_pass1 = WT_Filter::post('form_pass1', WT_REGEX_PASSWORD);
$form_pass2 = WT_Filter::post('form_pass2', WT_REGEX_PASSWORD);
$form_email = WT_Filter::postEmail('form_email');
$form_rootid = WT_Filter::post('form_rootid', WT_REGEX_XREF);
$form_theme = WT_Filter::post('form_theme', implode('|', $ALL_THEME_DIRS));
$form_language = WT_Filter::post('form_language', implode('|', array_keys(WT_I18N::installed_languages())), WT_LOCALE);
$form_contact_method = WT_Filter::post('form_contact_method');
$form_visible_online = WT_Filter::postBool('form_visible_online');
// Respond to form action
if ($form_action == 'update' && WT_Filter::checkCsrf()) {
    if ($form_username != Auth::user()->getUserName() && User::findByIdentifier($form_username)) {
        WT_FlashMessages::addMessage(WT_I18N::translate('Duplicate user name.  A user with that user name already exists.  Please choose another user name.'));
    } elseif ($form_email != Auth::user()->getEmail() && User::findByIdentifier($form_email)) {
        WT_FlashMessages::addMessage(WT_I18N::translate('Duplicate email address.  A user with that email already exists.'));
    } else {
        // Change username
        if ($form_username != WT_USER_NAME) {
            Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username);
            Auth::user()->setUserName($form_username);
        }
        // Change password
        if ($form_pass1 && $form_pass1 == $form_pass2) {
            Auth::user()->setPassword($form_pass1);
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:edituser.php

示例10: foreach

            foreach ($_FILES as $FILE) {
                if ($FILE['error'] == 0 && is_readable($FILE['tmp_name'])) {
                    import_gedcom_file($gedcom_id, $FILE['tmp_name'], $FILE['name']);
                }
            }
        }
        header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?keep_media' . $gedcom_id . '=' . WT_Filter::postBool('keep_media' . $gedcom_id));
        exit;
    case 'replace_import':
        $gedcom_id = WT_Filter::postInteger('gedcom_id');
        // Make sure the gedcom still exists
        if (WT_Filter::checkCsrf() && get_gedcom_from_id($gedcom_id)) {
            $ged_name = basename(WT_Filter::post('ged_name'));
            import_gedcom_file($gedcom_id, WT_DATA_DIR . $ged_name, $ged_name);
        }
        header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?keep_media' . $gedcom_id . '=' . WT_Filter::postBool('keep_media' . $gedcom_id));
        exit;
}
$controller->pageHeader();
// Process GET actions
switch (WT_Filter::get('action')) {
    case 'uploadform':
    case 'importform':
        $gedcom_id = WT_Filter::getInteger('gedcom_id');
        $gedcom_name = get_gedcom_from_id($gedcom_id);
        // Check it exists
        if (!$gedcom_name) {
            break;
        }
        echo '<p>', WT_I18N::translate('This will delete all the genealogical data from <b>%s</b> and replace it with data from another GEDCOM.', $gedcom_name), '</p>';
        // the javascript in the next line strips any path associated with the file before comparing it to the current GEDCOM name (both Chrome and IE8 include c:\fakepath\ in the filename).
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:admin_trees_manage.php

示例11: addNewFact

function addNewFact($fact)
{
    global $ADVANCED_PLAC_FACTS;
    $FACT = WT_Filter::post($fact);
    $DATE = WT_Filter::post("{$fact}_DATE");
    $PLAC = WT_Filter::post("{$fact}_PLAC");
    if ($DATE || $PLAC || $FACT && $FACT != 'Y') {
        if ($FACT && $FACT != 'Y') {
            $gedrec = "\n1 {$fact} {$FACT}";
        } else {
            $gedrec = "\n1 {$fact}";
        }
        if ($DATE) {
            $gedrec .= "\n2 DATE {$DATE}";
        }
        if ($PLAC) {
            $gedrec .= "\n2 PLAC {$PLAC}";
            if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $ADVANCED_PLAC_FACTS, $match)) {
                foreach ($match[1] as $tag) {
                    $TAG = WT_Filter::post("{$fact}_{$tag}");
                    if ($TAG) {
                        $gedrec .= "\n3 {$tag} {$TAG}";
                    }
                }
            }
            $LATI = WT_Filter::post("{$fact}_LATI");
            $LONG = WT_Filter::post("{$fact}_LONG");
            if ($LATI || $LONG) {
                $gedrec .= "\n3 MAP\n4 LATI {$LATI}\n4 LONG {$LONG}";
            }
        }
        if (WT_Filter::postBool("SOUR_{$fact}")) {
            return updateSOUR($gedrec, 2);
        } else {
            return $gedrec;
        }
    } elseif ($FACT == 'Y') {
        if (WT_Filter::postBool("SOUR_{$fact}")) {
            return updateSOUR("\n1 {$fact} Y", 2);
        } else {
            return "\n1 {$fact} Y";
        }
    } else {
        return '';
    }
}
开发者ID:jacoline,项目名称:webtrees,代码行数:46,代码来源:functions_edit.php

示例12: implode

$ged = WT_Filter::post('ged');
// Extract form variables
$realname = WT_Filter::post('realname');
$pass1 = WT_Filter::post('pass1', WT_REGEX_PASSWORD);
$pass2 = WT_Filter::post('pass2', WT_REGEX_PASSWORD);
$emailaddress = WT_Filter::postEmail('emailaddress');
$user_theme = WT_Filter::post('user_theme', implode('|', $ALL_THEME_DIRS));
$user_language = WT_Filter::post('user_language', implode('|', array_keys(WT_I18N::installed_languages())), WT_LOCALE);
$new_contact_method = WT_Filter::post('new_contact_method');
$new_comment = WT_Filter::post('new_comment');
$new_auto_accept = WT_Filter::postBool('new_auto_accept');
$canadmin = WT_Filter::postBool('canadmin');
$visibleonline = WT_Filter::postBool('visibleonline');
$editaccount = WT_Filter::postBool('editaccount');
$verified = WT_Filter::postBool('verified');
$verified_by_admin = WT_Filter::postBool('verified_by_admin');
switch ($action) {
    case 'loadrows':
        // Generate an AJAX/JSON response for datatables to load a block of rows
        $search = WT_Filter::get('search');
        $search = $search['value'];
        $start = WT_Filter::getInteger('start');
        $length = WT_Filter::getInteger('length');
        $WHERE = " WHERE u.user_id>0";
        $ARGS = array();
        if ($search) {
            $WHERE .= " AND (" . " user_name LIKE CONCAT('%', ?, '%') OR " . " real_name LIKE CONCAT('%', ?, '%') OR " . " email     LIKE CONCAT('%', ?, '%'))";
            $ARGS = array($search, $search, $search);
        }
        Auth::user()->setSetting('admin_users_page_size', $length);
        if ($length > 0) {
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:admin_users.php

示例13: admin

 private function admin()
 {
     $controller = new WT_Controller_Page();
     $controller->restrictAccess(Auth::isAdmin())->setPageTitle($this->getTitle())->pageHeader();
     // Save the updated preferences
     if (WT_Filter::post('action') == 'save') {
         foreach (WT_Tree::getAll() as $tree) {
             set_gedcom_setting($tree->tree_id, 'include_in_sitemap', WT_Filter::postBool('include' . $tree->tree_id));
         }
         // Clear cache and force files to be regenerated
         WT_DB::prepare("DELETE FROM `##module_setting` WHERE setting_name LIKE 'sitemap%'")->execute();
     }
     $include_any = false;
     echo '<h3>', $this->getTitle(), '</h3>', '<p>', WT_I18N::translate('Sitemaps are a way for webmasters to tell search engines about the pages on a website that are available for crawling.  All major search engines support sitemaps.  For more information, see <a href="http://www.sitemaps.org/">www.sitemaps.org</a>.') . '</p>', '<p>', WT_I18N::translate('Which family trees should be included in the sitemaps?'), '</p>', '<form method="post" action="module.php?mod=' . $this->getName() . '&amp;mod_action=admin">', '<input type="hidden" name="action" value="save">';
     foreach (WT_Tree::getAll() as $tree) {
         echo '<p><input type="checkbox" name="include', $tree->tree_id, '"';
         if (get_gedcom_setting($tree->tree_id, 'include_in_sitemap')) {
             echo ' checked="checked"';
             $include_any = true;
         }
         echo '>', $tree->tree_title_html, '</p>';
     }
     echo '<input type="submit" value="', WT_I18N::translate('save'), '">', '</form>', '<hr>';
     if ($include_any) {
         $site_map_url1 = WT_SERVER_NAME . WT_SCRIPT_PATH . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap.xml';
         $site_map_url2 = rawurlencode(WT_SERVER_NAME . WT_SCRIPT_PATH . 'module.php?mod=' . $this->getName() . '&mod_action=generate&file=sitemap.xml');
         echo '<p>', WT_I18N::translate('To tell search engines that sitemaps are available, you should add the following line to your robots.txt file.'), '</p>';
         echo '<pre>Sitemap: ', $site_map_url1, '</pre>', '<hr>', '<p>', WT_I18N::translate('To tell search engines that sitemaps are available, you can use the following links.'), '</p>', '<ul>', '<li><a target="_blank" href="http://www.bing.com/webmaster/ping.aspx?siteMap=' . $site_map_url2 . '">Bing</a></li>', '<li><a target="_blank" href="http://www.google.com/webmasters/tools/ping?sitemap=' . $site_map_url2 . '">Google</a></li>', '</ul>';
     }
 }
开发者ID:brambravo,项目名称:webtrees,代码行数:30,代码来源:module.php


注:本文中的WT_Filter::postBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。