本文整理汇总了PHP中Fisharebest\Webtrees\Controller\PageController::setPageTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP PageController::setPageTitle方法的具体用法?PHP PageController::setPageTitle怎么用?PHP PageController::setPageTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Controller\PageController
的用法示例。
在下文中一共展示了PageController::setPageTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pageHeader
private function pageHeader(PageController $controller)
{
$controller->setPageTitle(I18N::translate('Descendants of %s', $this->getRootPerson()->getFullName()))->pageHeader();
// add javascript files and scripts
$this->includeJs($controller, 'page');
if ($this->pdf()) {
$this->pdf()->includeJs($controller);
}
}
示例2: index
/**
* SosaStats@index
*/
public function index()
{
global $WT_TREE;
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Sosa Statistics'))->addInlineJavascript('$(".help_tooltip").tooltip();');
$view_bag = new ViewBag();
$view_bag->set('title', $controller->getPageTitle());
$view_bag->set('is_setup', false);
if ($this->sosa_provider->isSetup()) {
$view_bag->set('is_setup', true);
$view_bag->set('root_indi', $this->sosa_provider->getRootIndi());
$sosaCount = $this->sosa_provider->getSosaCount();
$diffSosaCount = $this->sosa_provider->getDifferentSosaCount();
$general_stats = array('sosa_count' => $sosaCount, 'distinct_count' => $diffSosaCount, 'sosa_rate' => Functions::safeDivision($diffSosaCount, $this->sosa_provider->getTotalIndividuals()), 'pedi_collapse' => 1 - Functions::safeDivision($diffSosaCount, $sosaCount), 'mean_gen_time' => $this->sosa_provider->getMeanGenerationTime());
$view_bag->set('general_stats', $general_stats);
$stats_gen = $this->sosa_provider->getStatisticsByGeneration();
$view_bag->set('missinganc_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=SosaList@missing&ged=' . $WT_TREE->getNameUrl() . '&gen=');
$view_bag->set('sosaanc_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=SosaList&ged=' . $WT_TREE->getNameUrl() . '&gen=');
$gen_theoretical = 1;
$total_theoretical = 0;
$prev_diff = 0;
$prev_known = 0.5;
$gen_equiv = 0;
$generation_stats = array();
foreach ($stats_gen as $gen => $tab) {
$genY1 = I18N::translate('-');
$genY2 = I18N::translate('-');
if ($tab['firstBirth'] > 0) {
$genY1 = $tab['firstBirth'];
}
if ($tab['lastBirth'] > 0) {
$genY2 = $tab['lastBirth'];
}
$total_theoretical += $gen_theoretical;
$perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical);
$gen_equiv += $perc_sosa_count_theor;
$missing = 2 * $prev_known - $tab['sosaCount'];
$gen_diff = $tab['diffSosaTotalCount'] - $prev_diff;
$generation_stats[$gen] = array('gen_min_birth' => $genY1, 'gen_max_birth' => $genY2, 'theoretical' => $gen_theoretical, 'known' => $tab['sosaCount'], 'perc_known' => $perc_sosa_count_theor, 'missing' => $missing, 'perc_missing' => 1 - Functions::safeDivision($tab['sosaCount'], 2 * $prev_known), 'total_known' => $tab['sosaTotalCount'], 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), 'different' => $gen_diff, 'perc_different' => Functions::safeDivision($gen_diff, $tab['sosaCount']), 'total_different' => $tab['diffSosaTotalCount'], 'pedi_collapse' => 1 - Functions::safeDivision($tab['diffSosaTotalCount'], $tab['sosaTotalCount']));
$gen_theoretical = $gen_theoretical * 2;
$prev_known = $tab['sosaCount'];
$prev_diff = $tab['diffSosaTotalCount'];
}
$view_bag->set('generation_stats', $generation_stats);
$view_bag->set('equivalent_gen', $gen_equiv);
$view_bag->set('chart_img_g2', $this->htmlAncestorDispersionG2());
$view_bag->set('chart_img_g3', $this->htmlAncestorDispersionG3());
}
ViewFactory::make('SosaStats', $this, $controller, $view_bag)->render();
}
示例3: index
/**
* SosaConfig@index
*/
public function index()
{
global $WT_TREE;
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Sosa Configuration'))->restrictAccess(Auth::check())->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();')->addInlineJavascript('
$( document ).ready(function() {
$("#bt_sosa_compute").click(function() {
majComputeSosa($("#maj_sosa_input_userid, #maj-sosa-config-select option:selected").val());
});
});
function majComputeSosa(user_id) {
jQuery("#bt_sosa_compute").prop( "disabled", true );
jQuery("#bt_sosa_computing").empty().html("<i class=\\"icon-loading-small\\"></i> ' . I18N::translate('Computing...') . '");
jQuery("#bt_sosa_computing").load(
"module.php?mod=' . $this->module->getName() . '&mod_action=SosaConfig@computeAll&ged=' . $WT_TREE->getNameUrl() . '&userid=" + user_id,
function() {
jQuery("#bt_sosa_compute").prop( "disabled", false );
});
}');
$action = Filter::post('action');
if ($action === 'update') {
$this->update($controller);
}
$view_bag = new ViewBag();
$view_bag->set('title', $controller->getPageTitle());
$view_bag->set('tree', $WT_TREE);
$view_bag->set('form_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=SosaConfig&ged=' . $WT_TREE->getNameUrl());
$users_root = array();
$users_js_array = 'var users_array = [];';
if (Auth::check()) {
$root_id = $WT_TREE->getUserPreference(Auth::user(), 'MAJ_SOSA_ROOT_ID');
$users_root[] = array('user' => Auth::user(), 'rootid' => $root_id);
$users_js_array .= 'users_array["' . Auth::user()->getUserId() . '"] = "' . $root_id . '";';
if (Auth::isManager($WT_TREE)) {
$default_user = User::find(-1);
$default_root_id = $WT_TREE->getUserPreference($default_user, 'MAJ_SOSA_ROOT_ID');
$users_root[] = array('user' => $default_user, 'rootid' => $default_root_id);
$users_js_array .= 'users_array["' . $default_user->getUserId() . '"] = "' . $default_root_id . '";';
}
}
$view_bag->set('users_settings', $users_root);
$controller->addInlineJavascript($users_js_array . '
$("#maj-sosa-config-select").change(function() {
$("#rootid").val(users_array[this.value]);
});
');
ViewFactory::make('SosaConfig', $this, $controller, $view_bag)->render();
}
示例4: show
private function show()
{
global $controller, $WT_TREE;
$items_header_description = '<img src="data/magaziny/Global-Network-icon-128.png" align="left" height="96" id="obrazek-odkazy"><p><br />Zde je nashromážděna sbírka odkazů, které mohou být užitečné nebo zajímavé jak pro členy Naší rodiny, tak pro jiné badatele v rodinné historii. Mnohé z nich používáme pravidelně. Jejich obsahová úroveň je proměnlivá, jak se dá očekávat u tak rozsáhlého výběru, a za jejich obsah neručíme.</p><p>Odkazy čas od času testujeme - ale odkazy měnívají adresu nebo mizí. Pokud narazíte na neplatný odkaz, dejte nám vědět na adresu technické podpory na stránce vespod.</p>';
//Add your own header here.
$items_id = webtrees\Filter::get('pages_id');
$controller = new webtrees\Controller\PageController();
$controller->setPageTitle(webtrees\I18N::translate('Odkazy do okolního světa'))->pageHeader();
// HTML common to all pages
$html = '<div id="pages-container">' . '<h2>' . $controller->getPageTitle() . '</h2>' . $items_header_description . '<div style="clear:both;"></div>' . '<div id="pages_tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">' . '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
$items_list = $this->getPagesList();
foreach ($items_list as $items) {
$languages = $this->getBlockSetting($items->block_id, 'languages');
if ((!$languages || in_array(WT_LOCALE, explode(',', $languages))) && $items->pages_access >= webtrees\Auth::accessLevel($WT_TREE)) {
$html .= '<li class="ui-state-default ui-corner-top' . ($items_id == $items->block_id ? ' ui-tabs-selected ui-state-active' : '') . '">' . '<a href="module.php?mod=' . $this->getName() . '&mod_action=show&pages_id=' . $items->block_id . '">' . '<span title="' . str_replace("{@PERC@}", "%", webtrees\I18N::translate(str_replace("%", "{@PERC@}", $items->pages_title))) . '">' . str_replace("{@PERC@}", "%", webtrees\I18N::translate(str_replace("%", "{@PERC@}", $items->pages_title))) . '</span></a></li>';
}
}
$html .= '</ul>';
$html .= '<div id="outer_pages_container" style="padding: 1em;">';
foreach ($items_list as $items) {
$languages = $this->getBlockSetting($items->block_id, 'languages');
if ((!$languages || in_array(WT_LOCALE, explode(',', $languages))) && $items_id == $items->block_id && $items->pages_access >= webtrees\Auth::accessLevel($WT_TREE)) {
$items_content = str_replace("{@PERC@}", "%", webtrees\I18N::translate(str_replace("%", "{@PERC@}", $items->pages_content)));
}
}
if (isset($items_content)) {
$html .= $items_content;
} else {
$html .= webtrees\I18N::translate('No content found for current access level and language');
}
$html .= '</div>';
//close outer_pages_container
$html .= '</div>';
//close pages_tabs
$html .= '</div>';
//close pages-container
$html .= '<script>document.onreadystatechange = function () {if (document.readyState == "complete") {$(".pages-accordion").accordion({heightStyle: "content", collapsible: true});}}</script>';
echo $html;
}
示例5: rawurlencode
if ($year === 0) {
$year = $cal_date->y;
}
// Extract values from date
$days_in_month = $cal_date->daysInMonth();
$days_in_week = $cal_date->daysInWeek();
$cal_month = $cal_date->format('%O');
$today_month = $today->format('%O');
// Invalid dates? Go to monthly view, where they'll be found.
if ($cal_date->d > $days_in_month && $view === 'day') {
$view = 'month';
}
// All further uses of $cal are to generate URLs
$cal = rawurlencode($cal);
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Anniversary calendar'));
switch ($view) {
case 'day':
$controller->setPageTitle(I18N::translate('On this day…') . ' ' . $ged_date->display(false));
break;
case 'month':
$controller->setPageTitle(I18N::translate('In this month…') . ' ' . $ged_date->display(false, '%F %Y'));
break;
case 'year':
$controller->setPageTitle(I18N::translate('In this year…') . ' ' . $ged_date->display(false, '%Y'));
break;
}
$controller->pageHeader();
?>
<div id="calendar-page">
<table class="facts_table width100">
示例6: edit
private function edit()
{
global $WT_TREE;
if (webtrees\Filter::postBool('save') && webtrees\Filter::checkCsrf()) {
$block_id = webtrees\Filter::post('block_id');
if ($block_id) {
webtrees\Database::prepare("UPDATE `##block` SET gedcom_id=NULLIF(?, ''), block_order=? WHERE block_id=?")->execute(array(webtrees\Filter::post('gedcom_id'), (int) webtrees\Filter::post('block_order'), $block_id));
} else {
webtrees\Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(?, ''), ?, ?)")->execute(array(webtrees\Filter::post('gedcom_id'), $this->getName(), (int) webtrees\Filter::post('block_order')));
$block_id = webtrees\Database::getInstance()->lastInsertId();
}
$this->setBlockSetting($block_id, 'menu_title', webtrees\Filter::post('menu_title'));
$this->setBlockSetting($block_id, 'menu_address', webtrees\Filter::post('menu_address'));
$this->setBlockSetting($block_id, 'menu_access', webtrees\Filter::post('menu_access'));
$languages = array();
foreach (webtrees\I18N::installedLocales() as $locale) {
if (webtrees\Filter::postBool('lang_' . $locale->languageTag())) {
$languages[] = $locale->languageTag();
}
}
$this->setBlockSetting($block_id, 'languages', implode(',', $languages));
$this->config();
} else {
$block_id = webtrees\Filter::get('block_id');
$controller = new webtrees\Controller\PageController();
$controller->restrictAccess(webtrees\Auth::isEditor($WT_TREE));
if ($block_id) {
$controller->setPageTitle(webtrees\I18N::translate('Edit menu'));
$menu_title = $this->getBlockSetting($block_id, 'menu_title');
$menu_address = $this->getBlockSetting($block_id, 'menu_address');
$menu_access = $this->getBlockSetting($block_id, 'menu_access');
$block_order = webtrees\Database::prepare("SELECT block_order FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
$gedcom_id = webtrees\Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
} else {
$controller->setPageTitle(webtrees\I18N::translate('Add menu'));
$menu_access = 1;
$menu_title = '';
$menu_address = '';
$block_order = webtrees\Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name=?")->execute(array($this->getName()))->fetchOne();
$gedcom_id = $WT_TREE->getTreeId();
}
$controller->pageHeader();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo webtrees\I18N::translate('Control panel');
?>
</a></li>
<li><a href="admin_modules.php"><?php
echo webtrees\I18N::translate('Module administration');
?>
</a></li>
<li><a href="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_config"><?php
echo webtrees\I18N::translate($this->getTitle());
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<form class="form-horizontal" method="POST" action="#" name="menu" id="menuForm">
<?php
echo webtrees\Filter::getCsrf();
?>
<input type="hidden" name="save" value="1">
<input type="hidden" name="block_id" value="<?php
echo $block_id;
?>
">
<h3><?php
echo webtrees\I18N::translate('General');
?>
</h3>
<div class="form-group">
<label class="control-label col-sm-3" for="menu_title">
<?php
echo webtrees\I18N::translate('Title');
?>
</label>
<div class="col-sm-9">
<input
class="form-control"
id="menu_title"
size="90"
name="menu_title"
required
type="text"
value="<?php
echo webtrees\Filter::escapeHtml($menu_title);
?>
"
>
</div>
//.........这里部分代码省略.........
示例7: PageController
* webtrees: online genealogy
* Copyright (C) 2015 webtrees development team
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Fisharebest\Webtrees;
/**
* Defined in session.php
*
* @global Tree $WT_TREE
*/
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsDb;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
define('WT_SCRIPT_NAME', 'notelist.php');
require './includes/session.php';
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Shared notes'));
$controller->pageHeader();
echo '<div id="notelist-page">', '<h2>', I18N::translate('Shared notes'), '</h2>', FunctionsPrintLists::noteTable(FunctionsDb::getNoteList($WT_TREE));
echo '</div>';
示例8: header
// managers, (3) user blocks require the user or an admin
$blocks = Module::getActiveBlocks($WT_TREE);
if (!$block || !array_key_exists($block->module_name, $blocks) || $block->gedcom_id && !Auth::isManager(Tree::findById($block->gedcom_id)) || $block->user_id && $block->user_id != Auth::id() && !Auth::isAdmin()) {
header('Location: ' . WT_BASE_URL);
return;
}
$block = $blocks[$block->module_name];
if (Filter::post('save')) {
$ctype = Filter::post('ctype', 'user', 'gedcom');
header('Location: ' . WT_BASE_URL . 'index.php?ctype=' . $ctype . '&ged=' . $WT_TREE->getNameUrl());
$block->configureBlock($block_id);
return;
}
$ctype = FIlter::get('ctype', 'user', 'gedcom');
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Configure') . ' — ' . $block->getTitle())->pageHeader();
if (Module::getModuleByName('ckeditor')) {
CkeditorModule::enableEditor($controller);
}
?>
<h2><?php
echo $controller->getPageTitle();
?>
</h2>
<form name="block" method="post" action="?block_id=<?php
echo $block_id;
?>
">
<input type="hidden" name="save" value="1">
<input type="hidden" name="ged" value="<?php
示例9: header
// managers, (3) user blocks require the user or an admin
$blocks = Module::getActiveBlocks($WT_TREE);
if (!$block || !array_key_exists($block->module_name, $blocks) || $block->gedcom_id && !Auth::isManager(Tree::findById($block->gedcom_id)) || $block->user_id && $block->user_id != Auth::id() && !Auth::isAdmin()) {
header('Location: ' . WT_BASE_URL);
return;
}
$block = $blocks[$block->module_name];
if (Filter::post('save')) {
$ctype = Filter::post('ctype', 'user', 'gedcom');
header('Location: ' . WT_BASE_URL . 'index.php?ctype=' . $ctype . '&ged=' . $WT_TREE->getNameUrl());
$block->configureBlock($block_id);
return;
}
$ctype = Filter::get('ctype', 'user', 'gedcom');
$controller = new PageController();
$controller->setPageTitle($block->getTitle() . ' — ' . I18N::translate('Preferences'))->pageHeader();
if (Module::getModuleByName('ckeditor')) {
CkeditorModule::enableEditor($controller);
}
?>
<h2><?php
echo $controller->getPageTitle();
?>
</h2>
<form name="block" method="post" action="?block_id=<?php
echo $block_id;
?>
">
<input type="hidden" name="save" value="1">
<input type="hidden" name="ged" value="<?php
示例10: missing
/**
* SosaList@missing
*/
public function missing()
{
global $WT_TREE;
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Missing Ancestors'));
$this->view_bag->set('title', $controller->getPageTitle());
if ($this->view_bag->get('is_setup', false)) {
$this->view_bag->set('url_module', $this->module->getName());
$this->view_bag->set('url_action', 'SosaList@missing');
$this->view_bag->set('url_ged', $WT_TREE->getNameUrl());
$this->view_bag->set('min_gen', 2);
$missing_list = $this->sosa_provider->getMissingSosaListAtGeneration($this->generation);
$this->view_bag->set('has_missing', $this->generation > 0 && count($missing_list) > 0);
$perc_sosa = Functions::safeDivision($this->sosa_provider->getSosaCountAtGeneration($this->generation), pow(2, $this->generation - 1));
$this->view_bag->set('perc_sosa', $perc_sosa);
if ($this->view_bag->get('has_missing', false)) {
$table_id = 'table-sosa-missing-' . Uuid::uuid4();
$this->view_bag->set('table_id', $table_id);
$controller->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addInlineJavascript('
/* Initialise datatables */
jQuery.fn.dataTableExt.oSort["unicode-asc" ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))};
jQuery.fn.dataTableExt.oSort["unicode-desc" ]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))};
jQuery.fn.dataTableExt.oSort["num-html-asc" ]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a<b) ? -1 : (a>b ? 1 : 0);};
jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
jQuery("#' . $table_id . '").dataTable( {
dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
' . I18N::datatablesI18N() . ',
jQueryUI: true,
autoWidth:false,
processing: true,
retrieve: true,
columns: [
/* 0-Sosa */ { type: "num", class: "center" },
/* 1-ID */ { class: "center" },
/* 2-givn */ { dataSort: 4, class: "left"},
/* 3-surn */ { dataSort: 5},
/* 4-GIVN,SURN */ { type: "unicode", visible: false},
/* 5-SURN,GIVN */ { type: "unicode", visible: false},
/* PERSO Modify table to include IsSourced module */
/* 6-INDI_SOUR */ { dataSort : 7, class: "center", visible: ' . (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME) ? 'true' : 'false') . ' },
/* 7-SORT_INDISC */ { visible : false},
/* 8-Father */ { class: "center"},
/* 9-Mother */ { class: "center"},
/* 10-Birth */ { dataSort : 11 , class: "center"},
/* 11-SORT_BIRT */ { visible : false},
/* 12-BIRT_PLAC */ { type: "unicode", class: "center"},
/* 13-BIRT_SOUR */ { dataSort : 14, class: "center", visible: ' . (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME) ? 'true' : 'false') . ' },
/* 14-SORT_BIRTSC */{ visible : false},
/* 15-SEX */ { visible : false}
/* END PERSO */
],
sorting: [[0,"asc"]],
displayLength: 20,
pagingType: "full_numbers"
});
jQuery("#' . $table_id . '")
/* Filter buttons in table header */
.on("click", "button[data-filter-column]", function() {
var btn = jQuery(this);
// De-activate the other buttons in this button group
btn.siblings().removeClass("ui-state-active");
// Apply (or clear) this filter
var col = jQuery("#' . $table_id . '").DataTable().column(btn.data("filter-column"));
if (btn.hasClass("ui-state-active")) {
btn.removeClass("ui-state-active");
col.search("").draw();
} else {
btn.addClass("ui-state-active");
col.search(btn.data("filter-value")).draw();
}
});
jQuery(".smissing-list").css("visibility", "visible");
jQuery(".loading-image").css("display", "none");
');
$unique_indis = array();
$sum_missing_different = 0;
$sum_missing_different_without_hidden = 0;
foreach ($missing_list as $num => $missing_tab) {
if (isset($unique_indis[$missing_tab['indi']])) {
unset($missing_list[$num]);
continue;
}
$sum_missing_different += !$missing_tab['has_father'] + !$missing_tab['has_mother'];
$person = Individual::getInstance($missing_tab['indi'], $WT_TREE);
if (!$person || !$person->canShowName()) {
unset($missing_list[$num]);
continue;
}
$sum_missing_different_without_hidden += !$missing_tab['has_father'] + !$missing_tab['has_mother'];
$unique_indis[$person->getXref()] = true;
$missing_tab['indi'] = $person;
$missing_list[$num] = $missing_tab;
}
$this->view_bag->set('missing_list', $missing_list);
//.........这里部分代码省略.........
示例11: main
/**
* Main entry point
*
* @return string
*/
private function main()
{
global $WT_TREE;
$this->plugins = $this->getPluginList();
// List of available plugins
$this->plugin = Filter::get('plugin');
// User parameters
$this->xref = Filter::get('xref', WT_REGEX_XREF);
$this->action = Filter::get('action');
$this->data = Filter::get('data');
// Don't do any processing until a plugin is chosen.
if ($this->plugin && array_key_exists($this->plugin, $this->plugins)) {
$this->PLUGIN = new $this->plugin();
$this->PLUGIN->getOptions();
$this->getAllXrefs();
switch ($this->action) {
case 'update':
$record = self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]);
if ($this->PLUGIN->doesRecordNeedUpdate($this->xref, $record)) {
$newrecord = $this->PLUGIN->updateRecord($this->xref, $record);
if ($newrecord != $record) {
if ($newrecord) {
GedcomRecord::getInstance($this->xref, $WT_TREE)->updateRecord($newrecord, $this->PLUGIN->chan);
} else {
GedcomRecord::getInstance($this->xref, $WT_TREE)->deleteRecord();
}
}
}
$this->xref = $this->findNextXref($this->xref);
break;
case 'update_all':
foreach ($this->all_xrefs as $xref => $type) {
$record = self::getLatestRecord($xref, $type);
if ($this->PLUGIN->doesRecordNeedUpdate($xref, $record)) {
$newrecord = $this->PLUGIN->updateRecord($xref, $record);
if ($newrecord != $record) {
if ($newrecord) {
GedcomRecord::getInstance($xref, $WT_TREE)->updateRecord($newrecord, $this->PLUGIN->chan);
} else {
GedcomRecord::getInstance($xref, $WT_TREE)->deleteRecord();
}
}
}
}
$this->xref = '';
break;
}
// Make sure that our requested record really does need updating.
// It may have been updated in another session, or may not have
// been specified at all.
if (array_key_exists($this->xref, $this->all_xrefs) && $this->PLUGIN->doesRecordNeedUpdate($this->xref, self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]))) {
$this->curr_xref = $this->xref;
}
// The requested record doesn't need updating - find one that does
if (!$this->curr_xref) {
$this->curr_xref = $this->findNextXref($this->xref);
}
if (!$this->curr_xref) {
$this->curr_xref = $this->findPrevXref($this->xref);
}
// If we've found a record to update, get details and look for the next/prev
if ($this->curr_xref) {
$this->prev_xref = $this->findPrevXref($this->curr_xref);
$this->next_xref = $this->findNextXref($this->curr_xref);
}
}
// HTML common to all pages
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Batch update'))->restrictAccess(Auth::isAdmin())->pageHeader();
echo $this->getJavascript();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo I18N::translate('Control panel');
?>
</a></li>
<li><a href="admin_modules.php"><?php
echo I18N::translate('Module administration');
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h2><?php
echo $controller->getPageTitle();
?>
</h2>
<form id="batch_update_form" class="form-horizontal" action="module.php" method="get">
<input type="hidden" name="mod" value="batch_update">
<input type="hidden" name="mod_action" value="admin_batch_update">
<input type="hidden" name="xref" value="' . $this->xref . '">
<input type="hidden" name="action" value=""><?php
//.........这里部分代码省略.........
示例12: PageController
*
* @global Tree $WT_TREE
*/
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsDb;
define('WT_SCRIPT_NAME', 'index_edit.php');
require './includes/session.php';
$controller = new PageController();
// Only one of $user_id and $gedcom_id should be set
$user_id = Filter::get('user_id', WT_REGEX_INTEGER, Filter::post('user_id', WT_REGEX_INTEGER));
$gedcom_id = Filter::get('gedcom_id', WT_REGEX_INTEGER, Filter::post('gedcom_id', WT_REGEX_INTEGER));
if ($user_id) {
$gedcom_id = null;
if ($user_id < 0) {
$controller->setPageTitle(I18N::translate('Set the default blocks for new users'));
$can_reset = false;
} else {
$controller->setPageTitle(I18N::translate('Change the “My page” blocks'));
$can_reset = true;
}
} else {
if ($gedcom_id < 0) {
$controller->setPageTitle(I18N::translate('Set the default blocks for new family trees'));
$can_reset = false;
} else {
$controller->setPageTitle(I18N::translate('Change the “Home page” blocks'));
$can_reset = true;
}
}
// Only an admin can edit the "default" page
示例13: array
$reports = array();
foreach (Module::getActiveReports($WT_TREE) as $rep) {
$menu = $rep->getReportMenu();
if (preg_match('/report=(' . preg_quote(WT_MODULES_DIR, '/') . '[a-z0-9_]+\\/[a-z0-9_]+\\.xml)/', $menu->getLink(), $match)) {
$reports[$match[1]] = $menu->getLabel();
}
}
if (!empty($report)) {
if (!array_key_exists($report, $reports)) {
$action = 'choose';
}
}
//-- choose a report to run
switch ($action) {
case 'choose':
$controller->setPageTitle(I18N::translate('Choose a report to run'))->pageHeader();
echo '<div id="reportengine-page">
<form name="choosereport" method="get" action="reportengine.php">
<input type="hidden" name="action" value="setup">
<input type="hidden" name="output" value="', Filter::escapeHtml($output), '">
<table class="facts_table width40">
<tr><td class="topbottombar" colspan="2">', I18N::translate('Choose a report to run'), '</td></tr>
<tr><td class="descriptionbox wrap width33 vmiddle">', I18N::translate('Report'), '</td>
<td class="optionbox"><select name="report">';
foreach ($reports as $file => $report) {
echo '<option value="', Filter::escapeHtml($file), '">', Filter::escapeHtml($report), '</option>';
}
echo '</select></td></tr>
<tr><td class="topbottombar" colspan="2"><input type="submit" value="', I18N::translate('continue'), '"></td></tr>
</table></form></div>';
break;
示例14: index
/**
* Lineage@index
*/
public function index()
{
global $WT_TREE;
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Patronymic Lineages') . ' : ' . $this->legend);
$view_bag = new ViewBag();
$view_bag->set('title', $controller->getPageTitle());
$view_bag->set('tree', $WT_TREE);
$view_bag->set('alpha', $this->alpha);
$view_bag->set('surname', $this->surname);
$view_bag->set('legend', $this->legend);
$view_bag->set('show_all', $this->show_all);
if ($this->isShowingSurnames()) {
$view_bag->set('issurnames', true);
$view_bag->set('surnameslist', $this->getSurnamesList());
}
if ($this->isShowingLineages()) {
$view_bag->set('islineages', true);
$view_bag->set('lineages', $this->getLineages());
if ($this->show_all === 'no') {
$view_bag->set('table_title', I18N::translate('Individuals in %s lineages', $this->legend));
} else {
$view_bag->set('table_title', I18N::translate('All lineages'));
}
}
ViewFactory::make('Lineage', $this, $controller, $view_bag)->render();
}
示例15: header
}
if (array_key_exists($module_name, $active_blocks)) {
echo $active_blocks[$module_name]->getBlock($block_id);
}
return;
}
// Redirect search engines to the full URL
if (Filter::get('ctype') !== $ctype || Filter::get('ged') !== $WT_TREE->getName()) {
header('Location: ' . WT_BASE_URL . 'index.php?ctype=' . $ctype . '&ged=' . $WT_TREE->getNameUrl());
return;
}
$controller = new PageController();
if ($ctype === 'user') {
$controller->restrictAccess(Auth::check());
}
$controller->setPageTitle($ctype === 'user' ? I18N::translate('My page') : $WT_TREE->getTitle())->setMetaRobots('index,follow')->pageHeader()->addInlineJavascript('jQuery.ajaxSetup({cache:true});');
if ($ctype === 'user') {
echo '<div id="my-page">';
echo '<h1 class="center">', I18N::translate('My page'), '</h1>';
} else {
echo '<div id="home-page">';
}
if ($blocks['main']) {
if ($blocks['side']) {
echo '<div id="index_main_blocks">';
} else {
echo '<div id="index_full_blocks">';
}
foreach ($blocks['main'] as $block_id => $module_name) {
if (array_key_exists($module_name, $active_blocks)) {
if (Auth::isSearchEngine() || !$active_blocks[$module_name]->loadAjax()) {