本文整理汇总了PHP中Fisharebest\Webtrees\Filter::getInteger方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::getInteger方法的具体用法?PHP Filter::getInteger怎么用?PHP Filter::getInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Filter
的用法示例。
在下文中一共展示了Filter::getInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create the chart controller
*
* @param int $show_full needed for use by charts module
*/
public function __construct($show_full = 1)
{
global $WT_TREE;
parent::__construct();
$rootid = Filter::get('rootid', WT_REGEX_XREF);
$this->root = Individual::getInstance($rootid, $WT_TREE);
if (!$this->root) {
// Missing root individual? Show the chart for someone.
$this->root = $this->getSignificantIndividual();
}
if (!$this->root || !$this->root->canShowName()) {
http_response_code(404);
$this->error_message = I18N::translate('This individual does not exist or you do not have permission to view it.');
}
// Extract parameter from form
if ($show_full) {
$this->show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
} else {
$this->show_full = 0;
}
$this->box = new \stdClass();
if ($this->showFull()) {
$this->box->width = Theme::theme()->parameter('chart-box-x');
$this->box->height = Theme::theme()->parameter('chart-box-y');
} else {
$this->box->width = Theme::theme()->parameter('compact-chart-box-x');
$this->box->height = Theme::theme()->parameter('compact-chart-box-y');
}
}
示例2: __construct
/**
* {@inheritDoc}
* @see \MyArtJaub\Webtrees\Mvc\Controller\MvcController::__construct(AbstractModule $module)
*/
public function __construct(AbstractModule $module)
{
global $WT_TREE;
parent::__construct($module);
$this->sosa_provider = new SosaProvider($WT_TREE, Auth::user());
$this->generation = Filter::getInteger('gen');
$this->view_bag = new ViewBag();
$this->view_bag->set('generation', $this->generation);
$this->view_bag->set('max_gen', $this->sosa_provider->getLastGeneration());
$this->view_bag->set('is_setup', $this->sosa_provider->isSetup() && $this->view_bag->get('max_gen', 0) > 0);
}
示例3: getBlock
/**
* Generate the HTML content of this block.
*
* @param int $block_id
* @param bool $template
* @param string[] $cfg
*
* @return string
*/
public function getBlock($block_id, $template = true, $cfg = array())
{
global $ctype, $WT_TREE;
switch (Filter::get('action')) {
case 'deletenews':
$news_id = Filter::get('news_id');
if ($news_id) {
Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute(array($news_id));
}
break;
}
$more_news = Filter::getInteger('more_news');
$limit = 5 * (1 + $more_news);
$articles = Database::prepare("SELECT SQL_CACHE news_id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) + :offset AS updated, subject, body FROM `##news` WHERE gedcom_id = :tree_id ORDER BY updated DESC LIMIT :limit")->execute(array('offset' => WT_TIMESTAMP_OFFSET, 'tree_id' => $WT_TREE->getTreeId(), 'limit' => $limit))->fetchAll();
$count = Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##news` WHERE gedcom_id = :tree_id")->execute(array('tree_id' => $WT_TREE->getTreeId()))->fetchOne();
$id = $this->getName() . $block_id;
$class = $this->getName() . '_block';
$title = $this->getTitle();
$content = '';
if (empty($articles)) {
$content .= I18N::translate('No news articles have been submitted.');
}
foreach ($articles as $article) {
$content .= '<div class="news_box">';
$content .= '<div class="news_title">' . Filter::escapeHtml($article->subject) . '</div>';
$content .= '<div class="news_date">' . FunctionsDate::formatTimestamp($article->updated) . '</div>';
if ($article->body == strip_tags($article->body)) {
$article->body = nl2br($article->body, false);
}
$content .= $article->body;
if (Auth::isManager($WT_TREE)) {
$content .= '<hr>';
$content .= '<a href="#" onclick="window.open(\'editnews.php?news_id=\'+' . $article->news_id . ', \'_blank\', news_window_specs); return false;">' . I18N::translate('Edit') . '</a>';
$content .= ' | ';
$content .= '<a href="index.php?action=deletenews&news_id=' . $article->news_id . '&ctype=' . $ctype . '&ged=' . $WT_TREE->getNameHtml() . '" onclick="return confirm(\'' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeHtml($article->subject)) . "');\">" . I18N::translate('Delete') . '</a><br>';
}
$content .= '</div>';
}
if (Auth::isManager($WT_TREE)) {
$content .= '<a href="#" onclick="window.open(\'editnews.php?gedcom_id=' . $WT_TREE->getTreeId() . '\', \'_blank\', news_window_specs); return false;">' . I18N::translate('Add a news article') . '</a>';
}
if ($count > $limit) {
if (Auth::isManager($WT_TREE)) {
$content .= ' | ';
}
$content .= '<a href="#" onclick="jQuery(\'#' . $id . '\').load(\'index.php?ctype=gedcom&ged=' . $WT_TREE->getNameUrl() . '&block_id=' . $block_id . '&action=ajax&more_news=' . ($more_news + 1) . '\'); return false;">' . I18N::translate('More news articles') . "</a>";
}
if ($template) {
return Theme::theme()->formatBlock($id, $title, $class, $content);
} else {
return $content;
}
}
示例4: __construct
/**
* Create the descendancy controller
*/
public function __construct()
{
global $WT_TREE;
parent::__construct();
// Extract parameters from form
$this->chart_style = Filter::getInteger('chart_style', 0, 3, 0);
$this->generations = Filter::getInteger('generations', 2, $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS'), $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(I18N::translate('Descendants of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(I18N::translate('Descendants'));
}
}
示例5: __construct
/**
* Startup activity
*/
public function __construct()
{
global $WT_TREE;
parent::__construct();
// Extract form parameters
$this->show_cousins = Filter::getInteger('show_cousins', 0, 1);
$this->chart_style = Filter::getInteger('chart_style', 0, 3);
$this->generations = Filter::getInteger('PEDIGREE_GENERATIONS', 2, $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'), $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(I18N::translate('Ancestors of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(I18N::translate('Ancestors'));
}
}
示例6: getBlock
/**
* Generate the HTML content of this block.
*
* @param int $block_id
* @param bool $template
* @param string[] $cfg
*
* @return string
*/
public function getBlock($block_id, $template = true, $cfg = array())
{
global $ctype, $WT_TREE;
switch (Filter::get('action')) {
case 'deletenews':
$news_id = Filter::getInteger('news_id');
if ($news_id) {
Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute(array($news_id));
}
break;
}
$block = $this->getBlockSetting($block_id, 'block', '1');
foreach (array('block') as $name) {
if (array_key_exists($name, $cfg)) {
${$name} = $cfg[$name];
}
}
$usernews = Database::prepare("SELECT SQL_CACHE news_id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) AS updated, subject, body FROM `##news` WHERE user_id = ? ORDER BY updated DESC")->execute(array(Auth::id()))->fetchAll();
$id = $this->getName() . $block_id;
$class = $this->getName() . '_block';
$title = '';
$title .= $this->getTitle();
$content = '';
if (!$usernews) {
$content .= I18N::translate('You have not created any journal items.');
}
foreach ($usernews as $news) {
$content .= '<div class="journal_box">';
$content .= '<div class="news_title">' . $news->subject . '</div>';
$content .= '<div class="news_date">' . FunctionsDate::formatTimestamp($news->updated) . '</div>';
if ($news->body == strip_tags($news->body)) {
// No HTML?
$news->body = nl2br($news->body, false);
}
$content .= $news->body . '<br><br>';
$content .= '<a href="#" onclick="window.open(\'editnews.php?news_id=\'+' . $news->news_id . ', \'_blank\', indx_window_specs); return false;">' . I18N::translate('Edit') . '</a> | ';
$content .= '<a href="index.php?action=deletenews&news_id=' . $news->news_id . '&ctype=' . $ctype . '&ged=' . $WT_TREE->getNameHtml() . '" onclick="return confirm(\'' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeHtml($news->subject)) . "');\">" . I18N::translate('Delete') . '</a><br>';
$content .= "</div><br>";
}
$content .= '<br><a href="#" onclick="window.open(\'editnews.php?user_id=' . Auth::id() . '\', \'_blank\', indx_window_specs); return false;">' . I18N::translate('Add a new journal entry') . '</a>';
if ($template) {
if ($block) {
$class .= ' small_inner_block';
}
return Theme::theme()->formatBlock($id, $title, $class, $content);
} else {
return $content;
}
}
示例7: __construct
/**
* Create the controller
*/
public function __construct()
{
global $WT_TREE;
parent::__construct();
$default_generations = $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS');
// Extract the request parameters
$this->fan_style = Filter::getInteger('fan_style', 2, 4, 3);
$this->fan_width = Filter::getInteger('fan_width', 50, 500, 100);
$this->generations = Filter::getInteger('generations', 2, 9, $default_generations);
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(I18N::translate('Fan chart of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(I18N::translate('Fan chart'));
}
}
示例8: __construct
/**
* Create a family-book controller
*/
public function __construct()
{
global $WT_TREE;
parent::__construct();
// Extract the request parameters
$this->show_spouse = Filter::getInteger('show_spouse', 0, 1);
$this->descent = Filter::getInteger('descent', 0, 9, 5);
$this->generations = Filter::getInteger('generations', 2, $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS'), 2);
$this->bhalfheight = $this->getBoxDimensions()->height / 2;
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(I18N::translate('Family book of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(I18N::translate('Family book'));
}
//Checks how many generations of descendency is for the person for formatting purposes
$this->dgenerations = $this->maxDescendencyGenerations($this->root->getXref(), 0);
if ($this->dgenerations < 1) {
$this->dgenerations = 1;
}
}
示例9: getBlock
/**
* Generate the HTML content of this block.
*
* @param int $block_id
* @param bool $template
* @param string[] $cfg
*
* @return string
*/
public function getBlock($block_id, $template = true, $cfg = array())
{
global $ctype, $WT_TREE;
switch (Filter::get('action')) {
case 'deletenews':
$news_id = Filter::getInteger('news_id');
if ($news_id) {
Database::prepare("DELETE FROM `##news` WHERE news_id = ?")->execute(array($news_id));
}
break;
}
$articles = Database::prepare("SELECT SQL_CACHE news_id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) + :offset AS updated, subject, body FROM `##news` WHERE user_id = :user_id ORDER BY updated DESC")->execute(array('offset' => WT_TIMESTAMP_OFFSET, 'user_id' => Auth::id()))->fetchAll();
$id = $this->getName() . $block_id;
$class = $this->getName() . '_block';
$title = $this->getTitle();
$content = '';
if (empty($articles)) {
$content .= '<p>' . I18N::translate('You have not created any journal items.') . '</p>';
}
foreach ($articles as $article) {
$content .= '<div class="journal_box">';
$content .= '<div class="news_title">' . Filter::escapeHtml($article->subject) . '</div>';
$content .= '<div class="news_date">' . FunctionsDate::formatTimestamp($article->updated) . '</div>';
if ($article->body == strip_tags($article->body)) {
$article->body = nl2br($article->body, false);
}
$content .= $article->body;
$content .= '<a href="#" onclick="window.open(\'editnews.php?news_id=\'+' . $article->news_id . ', \'_blank\', indx_window_specs); return false;">' . I18N::translate('Edit') . '</a>';
$content .= ' | ';
$content .= '<a href="index.php?action=deletenews&news_id=' . $article->news_id . '&ctype=' . $ctype . '&ged=' . $WT_TREE->getNameHtml() . '" onclick="return confirm(\'' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeHtml($article->subject)) . "');\">" . I18N::translate('Delete') . '</a><br>';
$content .= '</div><br>';
}
$content .= '<p><a href="#" onclick="window.open(\'editnews.php?user_id=' . Auth::id() . '\', \'_blank\', indx_window_specs); return false;">' . I18N::translate('Add a journal entry') . '</a></p>';
if ($template) {
return Theme::theme()->formatBlock($id, $title, $class, $content);
} else {
return $content;
}
}
示例10: __construct
/**
* Create the hourglass controller.
*
* @param string $rootid
* @param int $show_full
* @param bool $loadJS
*/
public function __construct($rootid = '', $show_full = 1, $loadJS = true)
{
global $WT_TREE;
parent::__construct($show_full);
// Extract parameters from
$this->show_spouse = Filter::getInteger('show_spouse', 0, 1, 0);
$this->generations = Filter::getInteger('generations', 2, $WT_TREE->getPreference('MAX_DESCENDANCY_GENERATIONS'), 3);
$this->canLoadJS = $loadJS;
//-- flip the arrows for RTL languages
if (I18N::direction() === 'ltr') {
$this->left_arrow = 'icon-larrow';
$this->right_arrow = 'icon-rarrow';
} else {
$this->left_arrow = 'icon-rarrow';
$this->right_arrow = 'icon-larrow';
}
$this->bhalfheight = (int) ($this->getBoxDimensions()->height / 2);
//Checks how many generations of descendency is for the person for formatting purposes
$this->dgenerations = $this->maxDescendencyGenerations($this->root, 0);
if ($this->dgenerations < 1) {
$this->dgenerations = 1;
}
$this->setPageTitle(I18N::translate('Hourglass chart of %s', $this->root->getFullName()));
}
示例11: header
* 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\Module\CkeditorModule;
define('WT_SCRIPT_NAME', 'block_edit.php');
require './includes/session.php';
$block_id = Filter::getInteger('block_id');
$block = Database::prepare("SELECT SQL_CACHE * FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOneRow();
// Check access. (1) the block must exist and be enabled, (2) gedcom blocks require
// 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;
}
示例12: pedigreeMap
/**
* Display a map showing the originas of ones ancestors.
*/
private function pedigreeMap()
{
global $controller, $WT_TREE;
$MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS');
$controller = new ChartController();
$this->generations = Filter::getInteger('PEDIGREE_GENERATIONS', 2, $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'), $WT_TREE->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
$this->treesize = pow(2, $this->generations) - 1;
$this->ancestors = array_values($controller->sosaAncestors($this->generations));
// Start of internal configuration variables
// Limit this to match available number of icons.
// 8 generations equals 255 individuals
$MAX_PEDIGREE_GENERATIONS = min($MAX_PEDIGREE_GENERATIONS, 8);
// End of internal configuration variables
$controller->setPageTitle(I18N::translate('Pedigree map of %s', $controller->root->getFullName()))->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
echo '<link type="text/css" href="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/css/wt_v3_googlemap.css" rel="stylesheet">';
echo '<div id="pedigreemap-page">
<h2>', $controller->getPageTitle(), '</h2>';
// -- print the form to change the number of displayed generations
?>
<form name="people" method="get" action="?">
<input type="hidden" name="ged" value="<?php
echo $WT_TREE->getNameHtml();
?>
">
<input type="hidden" name="mod" value="googlemap">
<input type="hidden" name="mod_action" value="pedigree_map">
<table class="list_table" width="555">
<tr>
<td class="descriptionbox wrap">
<?php
echo I18N::translate('Individual');
?>
</td>
<td class="optionbox">
<input class="pedigree_form" data-autocomplete-type="INDI" type="text" id="rootid" name="rootid" size="3" value="<?php
echo $controller->root->getXref();
?>
">
<?php
echo FunctionsPrint::printFindIndividualLink('rootid');
?>
</td>
<td class="topbottombar" rowspan="2">
<input type="submit" value="<?php
echo I18N::translate('View');
?>
">
</td>
</tr>
<tr>
<td class="descriptionbox wrap">
<?php
echo I18N::translate('Generations');
?>
</td>
<td class="optionbox">
<select name="PEDIGREE_GENERATIONS">
<?php
for ($p = 3; $p <= $MAX_PEDIGREE_GENERATIONS; $p++) {
echo '<option value="', $p, '" ';
if ($p == $this->generations) {
echo 'selected';
}
echo '>', $p, '</option>';
}
?>
</select>
</td>
</tr>
</table>
</form>
<!-- end of form -->
<!-- count records by type -->
<?php
$curgen = 1;
$priv = 0;
$count = 0;
$miscount = 0;
$missing = '';
$latlongval = array();
$lat = array();
$lon = array();
for ($i = 0; $i < $this->treesize; $i++) {
// -- check to see if we have moved to the next generation
if ($i + 1 >= pow(2, $curgen)) {
$curgen++;
}
$person = $this->ancestors[$i];
if (!empty($person)) {
$name = $person->getFullName();
if ($name == I18N::translate('Private')) {
$priv++;
}
$place = $person->getBirthPlace();
if (empty($place)) {
$latlongval[$i] = null;
//.........这里部分代码省略.........
示例13: foreach
// This becomes a JSON list, not array, so need to fetch with numeric keys.
$data = Database::prepare($sql_select . $where . $order_by . $limit)->execute($args)->fetchAll(PDO::FETCH_NUM);
foreach ($data as &$datum) {
$datum[2] = I18N::translate($datum[2]);
$datum[3] = '<a href="gedrecord.php?pid=' . $datum[3] . '&ged=' . $datum[7] . '">' . $datum[3] . '</a>';
$datum[4] = '<div class="gedcom-data" dir="ltr">' . Filter::escapeHtml($datum[4]) . '</div>';
$datum[5] = '<div class="gedcom-data" dir="ltr">' . Filter::escapeHtml($datum[5]) . '</div>';
$datum[6] = Filter::escapeHtml($datum[6]);
$datum[7] = Filter::escapeHtml($datum[7]);
}
// Total filtered/unfiltered rows
$recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
$recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne();
header('Content-type: application/json');
// See http://www.datatables.net/usage/server-side
echo json_encode(array('draw' => Filter::getInteger('draw'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data));
return;
}
$controller->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addExternalJavascript(WT_MOMENT_JS_URL)->addExternalJavascript(WT_BOOTSTRAP_DATETIMEPICKER_JS_URL)->addInlineJavascript('
jQuery(".table-site-changes").dataTable( {
processing: true,
serverSide: true,
ajax: "' . WT_BASE_URL . WT_SCRIPT_NAME . '?action=load_json&from=' . $from . '&to=' . $to . '&type=' . $type . '&oldged=' . rawurlencode($oldged) . '&newged=' . rawurlencode($newged) . '&xref=' . rawurlencode($xref) . '&user=' . rawurlencode($user) . '&gedc=' . rawurlencode($gedc) . '",
' . I18N::datatablesI18N(array(10, 20, 50, 100, 500, 1000, -1)) . ',
sorting: [[ 0, "desc" ]],
pageLength: ' . Auth::user()->getPreference('admin_site_change_page_size', 10) . ',
columns: [
/* change_id */ { visible: false },
/* Timestamp */ { sort: 0 },
/* Status */ { },
/* Record */ { },
示例14: __construct
/**
* Startup activity
*/
public function __construct()
{
global $WT_TREE;
parent::__construct();
$this->setPageTitle(I18N::translate('Timeline'));
$this->baseyear = (int) date('Y');
$pids = Filter::getArray('pids', WT_REGEX_XREF);
$remove = Filter::get('remove', WT_REGEX_XREF);
foreach (array_unique($pids) as $pid) {
if ($pid !== $remove) {
$person = Individual::getInstance($pid, $WT_TREE);
if ($person && $person->canShow()) {
$this->people[] = $person;
}
}
}
$this->pidlinks = '';
foreach ($this->people as $indi) {
// setup string of valid pids for links
$this->pidlinks .= 'pids%5B%5D=' . $indi->getXref() . '&';
$bdate = $indi->getBirthDate();
if ($bdate->isOK()) {
$date = new GregorianDate($bdate->minimumJulianDay());
$this->birthyears[$indi->getXref()] = $date->y;
$this->birthmonths[$indi->getXref()] = max(1, $date->m);
$this->birthdays[$indi->getXref()] = max(1, $date->d);
}
// find all the fact information
$facts = $indi->getFacts();
foreach ($indi->getSpouseFamilies() as $family) {
foreach ($family->getFacts() as $fact) {
$facts[] = $fact;
}
}
foreach ($facts as $event) {
// get the fact type
$fact = $event->getTag();
if (!in_array($fact, $this->nonfacts)) {
// check for a date
$date = $event->getDate();
if ($date->isOK()) {
$date = new GregorianDate($date->minimumJulianDay());
$this->baseyear = min($this->baseyear, $date->y);
$this->topyear = max($this->topyear, $date->y);
if (!$indi->isDead()) {
$this->topyear = max($this->topyear, (int) date('Y'));
}
// do not add the same fact twice (prevents marriages from being added multiple times)
if (!in_array($event, $this->indifacts, true)) {
$this->indifacts[] = $event;
}
}
}
}
}
$scale = Filter::getInteger('scale', 0, 200);
if ($scale === 0) {
$this->scale = (int) (($this->topyear - $this->baseyear) / 20 * count($this->indifacts) / 4);
if ($this->scale < 6) {
$this->scale = 6;
}
} else {
$this->scale = $scale;
}
if ($this->scale < 2) {
$this->scale = 2;
}
$this->baseyear -= 5;
$this->topyear += 5;
}
示例15: RelationshipController
/**
* Defined in session.php
*
* @global Tree $WT_TREE
*/
global $WT_TREE;
use Fisharebest\Webtrees\Controller\RelationshipController;
use Fisharebest\Webtrees\Functions\Functions;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
define('WT_SCRIPT_NAME', 'relationship.php');
require './includes/session.php';
$controller = new RelationshipController();
$pid1 = Filter::get('pid1', WT_REGEX_XREF);
$pid2 = Filter::get('pid2', WT_REGEX_XREF);
$show_full = Filter::getInteger('show_full', 0, 1, $WT_TREE->getPreference('PEDIGREE_FULL_DETAILS'));
$find_all = Filter::getBool('find_all');
$person1 = Individual::getInstance($pid1, $WT_TREE);
$person2 = Individual::getInstance($pid2, $WT_TREE);
$controller->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
if ($person1 && $person2) {
$controller->setPageTitle(I18N::translate('Relationships between %1$s and %2$s', $person1->getFullName(), $person2->getFullName()))->pageHeader();
$paths = $controller->calculateRelationships($person1, $person2, $find_all);
} else {
$controller->setPageTitle(I18N::translate('Relationships'))->pageHeader();
$paths = array();
}
?>
<h2><?php
echo $controller->getPageTitle();
?>