本文整理汇总了PHP中Fisharebest\Webtrees\Filter::getCsrf方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::getCsrf方法的具体用法?PHP Filter::getCsrf怎么用?PHP Filter::getCsrf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Filter
的用法示例。
在下文中一共展示了Filter::getCsrf方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pageBody
private function pageBody(PageController $controller)
{
?>
<!-- ADMIN PAGE CONTENT -->
<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 class="form-inline" method="post">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="save" value="1">
<!-- SHOW PDF -->
<div class="form-group">
<label class="control-label">
<?php
echo I18N::translate('Access level');
?>
</label>
<?php
echo FunctionsEdit::editFieldAccessLevel('NEW_FTV_PDF_ACCESS_LEVEL', $this->getSetting('FTV_PDF_ACCESS_LEVEL'), 'class="form-control"');
?>
</div>
<!-- BUTTONS -->
<button class="btn btn-primary" type="submit">
<i class="fa fa-check"></i>
<?php
echo I18N::translate('save');
?>
</button>
</form>
<?php
}
示例2:
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h1><?php
echo $controller->getPageTitle();
?>
</h1>
<form class="form form-horizontal" method="post" action="admin_trees_export.php">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="ged" value="<?php
echo $WT_TREE->getNameHtml();
?>
">
<div class="form-group">
<label for="submit-export" class="col-sm-3 control-label">
<?php
echo I18N::translate('A file on the server');
?>
</label>
<div class="col-sm-9">
<button id="submit-export" type="submit" class="btn btn-primary">
<?php
示例3: 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>
//.........这里部分代码省略.........
示例4: print_indi_form
//.........这里部分代码省略.........
break;
case 'add_spouse_to_family_action':
if ($father) {
$name_fields = $surname_tradition->newSpouseNames($father_name, $gender) + $name_fields;
} else {
$name_fields = $surname_tradition->newSpouseNames($mother_name, $gender) + $name_fields;
}
break;
case 'add_spouse_to_individual_action':
$name_fields = $surname_tradition->newSpouseNames($indi_name, $gender) + $name_fields;
break;
case 'add_unlinked_indi_action':
case 'update':
if ($surname_tradition->hasSurnames()) {
$name_fields['NAME'] = '//';
}
break;
}
}
$bdm = '';
// used to copy '1 SOUR' to '2 SOUR' for BIRT DEAT MARR
echo '<div id="edit_interface-page">';
echo '<h4>', $controller->getPageTitle(), '</h4>';
FunctionsPrint::initializeCalendarPopup();
echo '<form method="post" name="addchildform" onsubmit="return checkform();">';
echo '<input type="hidden" name="ged" value="', $WT_TREE->getNameHtml(), '">';
echo '<input type="hidden" name="action" value="', $nextaction, '">';
echo '<input type="hidden" name="fact_id" value="', $name_fact_id, '">';
echo '<input type="hidden" name="xref" value="', $xref, '">';
echo '<input type="hidden" name="famtag" value="', $famtag, '">';
echo '<input type="hidden" name="gender" value="', $gender, '">';
echo '<input type="hidden" name="goto" value="">';
// set by javascript
echo Filter::getCsrf();
echo '<table class="facts_table">';
switch ($nextaction) {
case 'add_child_to_family_action':
case 'add_child_to_individual_action':
// When adding a new child, specify the pedigree
FunctionsEdit::addSimpleTag('0 PEDI');
break;
case 'update':
// When adding/editing a name, specify the type
FunctionsEdit::addSimpleTag('0 TYPE ' . $name_type, '', '', null, $person);
break;
}
// First - new/existing standard name fields
foreach ($name_fields as $tag => $value) {
if (substr_compare($tag, '_', 0, 1) !== 0) {
FunctionsEdit::addSimpleTag('0 ' . $tag . ' ' . $value);
}
}
// Second - new/existing advanced name fields
if ($surname_tradition->hasMarriedNames() || preg_match('/\\n2 _MARNM /', $namerec)) {
$adv_name_fields = array('_MARNM' => '');
} else {
$adv_name_fields = array();
}
if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $WT_TREE->getPreference('ADVANCED_NAME_FACTS'), $match)) {
foreach ($match[1] as $tag) {
$adv_name_fields[$tag] = '';
}
}
foreach (array_keys($adv_name_fields) as $tag) {
// Edit existing tags, grouped together
if (preg_match_all('/2 ' . $tag . ' (.+)/', $namerec, $match)) {
示例5: renderContent
/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
/** @var GeoAnalysis $ga */
$ga = $this->data->get('geo_analysis');
$is_new = is_null($ga);
$places_hierarchy = $this->data->get('places_hierarchy');
?>
<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><a href="<?php
echo $this->data->get('admin_config_url');
?>
"><?php
echo $this->data->get('module_title');
?>
</a></li>
<li class="active"><?php
echo $this->data->get('title');
?>
</li>
</ol>
<h1><?php
echo $this->data->get('title');
?>
</h1>
<form class="form-horizontal" name="newform" method="post" role="form" action="<?php
echo $this->data->get('save_url');
?>
" autocomplete="off">
<?php
echo Filter::getCsrf();
?>
<?php
if (!$is_new) {
?>
<input type="hidden" name="ga_id" value="<?php
echo $ga->getId();
?>
">
<?php
}
?>
<!-- DESCRIPTION -->
<div class="form-group">
<label class="control-label col-sm-3" for="description">
<?php
echo I18N::translate('Description');
?>
</label>
<div class="col-sm-9">
<input class="form-control" type="text" id="description" name="description" required maxlength="70" <?php
if (!$is_new) {
echo 'value="' . Filter::escapeHtml($ga->getTitle()) . '"';
}
?>
dir="auto">
<p class="small text-muted">
<?php
echo I18N::translate('Description to be given to the geographical dispersion analysis. It will be used as the page title for it.');
?>
</p>
</div>
</div>
<!-- ANALYSIS LEVEL -->
<div class="form-group">
<label class="control-label col-sm-3" for="analysislevel">
<?php
echo I18N::translate('Analysis level');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::selectEditControl('analysislevel', $places_hierarchy['hierarchy'], null, $is_new ? '' : $ga->getAnalysisLevel() - 1, 'class="form-control"');
?>
<p class="small text-muted">
<?php
echo I18N::translate('Subdivision level used for the analysis.');
?>
</p>
</div>
</div>
<h3><?php
echo I18N::translate('Display options');
//.........这里部分代码省略.........
示例6: edit
/**
* Action from the configuration page
*/
private function edit()
{
global $WT_TREE;
if (Filter::postBool('save') && Filter::checkCsrf()) {
$block_id = Filter::postInteger('block_id');
if ($block_id) {
Database::prepare("UPDATE `##block` SET gedcom_id = NULLIF(:tree_id, '0'), block_order = :block_order WHERE block_id = :block_id")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'block_order' => Filter::postInteger('block_order'), 'block_id' => $block_id));
} else {
Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(:tree_id, '0'), :module_name, :block_order)")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'module_name' => $this->getName(), 'block_order' => Filter::postInteger('block_order')));
$block_id = Database::getInstance()->lastInsertId();
}
$this->setBlockSetting($block_id, 'header', Filter::post('header'));
$this->setBlockSetting($block_id, 'faqbody', Filter::post('faqbody'));
$languages = Filter::postArray('lang');
$this->setBlockSetting($block_id, 'languages', implode(',', $languages));
$this->config();
} else {
$block_id = Filter::getInteger('block_id');
$controller = new PageController();
if ($block_id) {
$controller->setPageTitle(I18N::translate('Edit FAQ item'));
$header = $this->getBlockSetting($block_id, 'header');
$faqbody = $this->getBlockSetting($block_id, 'faqbody');
$block_order = Database::prepare("SELECT block_order FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne();
$gedcom_id = Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne();
} else {
$controller->setPageTitle(I18N::translate('Add an FAQ item'));
$header = '';
$faqbody = '';
$block_order = Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name = :module_name")->execute(array('module_name' => $this->getName()))->fetchOne();
$gedcom_id = $WT_TREE->getTreeId();
}
$controller->pageHeader();
if (Module::getModuleByName('ckeditor')) {
CkeditorModule::enableEditor($controller);
}
?>
<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><a
href="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_config"><?php
echo I18N::translate('Frequently asked questions');
?>
</a>
</li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h1><?php
echo $controller->getPageTitle();
?>
</h1>
<form name="faq" class="form-horizontal" method="post" action="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_edit">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="save" value="1">
<input type="hidden" name="block_id" value="<?php
echo $block_id;
?>
">
<div class="form-group">
<label for="header" class="col-sm-3 control-label">
<?php
echo I18N::translate('Question');
?>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="header" id="header"
value="<?php
echo Filter::escapeHtml($header);
?>
">
</div>
</div>
<div class="form-group">
<label for="faqbody" class="col-sm-3 control-label">
<?php
//.........这里部分代码省略.........
示例7: renderContent
/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
if (Module::getModuleByName('ckeditor')) {
CkeditorModule::enableEditor($this->ctrl);
}
/** @var AbstractModule $module */
$module = $this->data->get('module');
?>
<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 $this->data->get('title');
?>
</li>
</ol>
<h1><?php
echo $this->data->get('title');
?>
</h1>
<form method="post" class="form-horizontal">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="action" value="update">
<h3><?php
echo I18N::translate('Titles');
?>
</h3>
<!-- MAJ_TITLE_PREFIX -->
<div class="form-group">
<label for="MAJ_TITLE_PREFIX" class="col-sm-3 control-label">
<?php
echo I18N::translate('Title prefixes');
?>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" dir="auto" id="MAJ_TITLE_PREFIX" name="MAJ_TITLE_PREFIX" value="<?php
echo Filter::escapeHtml($module->getSetting('MAJ_TITLE_PREFIX'));
?>
" maxlength="255" placeholder="de |d'|du |of |von |vom |am |zur |van |del |della |t'|da |ten |ter |das |dos |af ">
<p class="small text-muted">
<?php
echo I18N::translate('Set possible aristocratic particles to separate titles from the land they refer to (e.g. Earl <strong>of</strong> Essex). Variants must be separated by the character |.');
?>
<br />
<?php
echo I18N::translate('An example for this setting is : <strong>de |d\'|du |of |von |vom |am |zur |van |del |della |t\'|da |ten |ter |das |dos |af </strong> (covering some of French, English, German, Dutch, Italian, Spanish, Portuguese, Swedish common particles).');
?>
</p>
</div>
</div>
<h3><?php
echo I18N::translate('Header');
?>
</h3>
<!-- MAJ_ADD_HTML_HEADER -->
<div class="form-group">
<label class="control-label col-sm-3" for="MAJ_ADD_HTML_HEADER">
<?php
echo I18N::translate('Include additional HTML in header');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::editFieldYesNo('MAJ_ADD_HTML_HEADER', $module->getSetting('MAJ_ADD_HTML_HEADER', 0), 'class="radio-inline"');
?>
<p class="small text-muted">
<?php
echo I18N::translate('Enable this option to include raw additional HTML in the header of the page.');
?>
</p>
</div>
</div>
<!-- MAJ_SHOW_HTML_HEADER -->
<div class="form-group">
<label class="control-label col-sm-3" for="MAJ_SHOW_HTML_HEADER">
<?php
echo I18N::translate('Hide additional header');
?>
</label>
<div class="col-sm-9">
//.........这里部分代码省略.........
示例8: pageBody
private function pageBody(PageController $controller)
{
$FTV_SETTINGS = unserialize($this->getSetting('FTV_SETTINGS'));
?>
<!-- ADMIN PAGE CONTENT -->
<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 1 *** -->
<form class="form-horizontal" method="post" name="form1">
<?php
echo Filter::getCsrf();
?>
<!-- SELECT TREE -->
<div class="form-group">
<label class="control-label col-sm-2" for="tree">
<?php
echo I18N::translate('Family tree');
?>
</label>
<div class="col-sm-4">
<select id="tree" name="NEW_FIB_TREE" class="form-control">
<?php
foreach (Tree::getAll() as $tree) {
?>
<?php
if ($tree->getTreeId() == $this->tree_id) {
?>
<option value="<?php
echo $tree->getTreeId();
?>
" data-ged="<?php
echo $tree->getNameHtml();
?>
" selected="selected">
<?php
echo $tree->getTitleHtml();
?>
</option>
<?php
} else {
?>
<option value="<?php
echo $tree->getTreeId();
?>
" data-ged="<?php
echo $tree->getNameHtml();
?>
">
<?php
echo $tree->getTitleHtml();
?>
</option>
<?php
}
?>
<?php
}
?>
</select>
</div>
</div>
</form>
<!-- PANEL GROUP ACCORDION -->
<div class="panel-group" id="accordion">
<!-- PANEL 1 -->
<div class="panel panel-default" id="panel1">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-target="#collapseOne" href="#">
<?php
echo I18N::translate('Pages');
?>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<?php
if (empty($FTV_SETTINGS) || !empty($FTV_SETTINGS) && !$this->searchArray($FTV_SETTINGS, 'TREE', $this->tree_id)) {
?>
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="' . I18N::translate('close') . '">
//.........这里部分代码省略.........
示例9: edit
/**
* Show and process a form to edit a story.
*/
private function edit()
{
global $WT_TREE;
if (Auth::isEditor($WT_TREE)) {
if (Filter::postBool('save') && Filter::checkCsrf()) {
$block_id = Filter::postInteger('block_id');
if ($block_id) {
Database::prepare("UPDATE `##block` SET gedcom_id=?, xref=? WHERE block_id=?")->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $block_id));
} else {
Database::prepare("INSERT INTO `##block` (gedcom_id, xref, module_name, block_order) VALUES (?, ?, ?, ?)")->execute(array(Filter::postInteger('gedcom_id'), Filter::post('xref', WT_REGEX_XREF), $this->getName(), 0));
$block_id = Database::getInstance()->lastInsertId();
}
$this->setBlockSetting($block_id, 'title', Filter::post('title'));
$this->setBlockSetting($block_id, 'story_body', Filter::post('story_body'));
$languages = Filter::postArray('lang');
$this->setBlockSetting($block_id, 'languages', implode(',', $languages));
$this->config();
} else {
$block_id = Filter::getInteger('block_id');
$controller = new PageController();
if ($block_id) {
$controller->setPageTitle(I18N::translate('Edit story'));
$title = $this->getBlockSetting($block_id, 'title');
$story_body = $this->getBlockSetting($block_id, 'story_body');
$xref = Database::prepare("SELECT xref FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
} else {
$controller->setPageTitle(I18N::translate('Add a story'));
$title = '';
$story_body = '';
$xref = Filter::get('xref', WT_REGEX_XREF);
}
$controller->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
if (Module::getModuleByName('ckeditor')) {
CkeditorModule::enableEditor($controller);
}
$individual = Individual::getInstance($xref, $WT_TREE);
?>
<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><a href="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_config"><?php
echo $this->getTitle();
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h1><?php
echo $controller->getPageTitle();
?>
</h1>
<form class="form-horizontal" method="post" action="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_edit">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="save" value="1">
<input type="hidden" name="block_id" value="<?php
echo $block_id;
?>
">
<input type="hidden" name="gedcom_id" value="<?php
echo $WT_TREE->getTreeId();
?>
">
<div class="form-group">
<label for="title" class="col-sm-3 control-label">
<?php
echo I18N::translate('Story title');
?>
</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="title" id="title" value="<?php
echo Filter::escapeHtml($title);
?>
">
</div>
</div>
<div class="form-group">
<label for="story_body" class="col-sm-3 control-label">
//.........这里部分代码省略.........
示例10: createMap
/**
* Called by placelist.php
*/
public function createMap()
{
global $level, $levelm, $plzoom, $WT_TREE;
Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
$STREETVIEW = (bool) $this->getSetting('GM_USE_STREETVIEW');
$parent = Filter::getArray('parent');
$levelm = $this->setLevelMap($level, $parent);
$latlng = Database::prepare("SELECT pl_place, pl_id, pl_lati, pl_long, pl_zoom, sv_long, sv_lati, sv_bearing, sv_elevation, sv_zoom FROM `##placelocation` WHERE pl_id=?")->execute(array($levelm))->fetch(PDO::FETCH_ASSOC);
echo '<table style="margin:auto; border-collapse: collapse;">';
echo '<tr style="vertical-align:top;"><td>';
if ($STREETVIEW && $level != 0) {
// Leave space for the Street View buttons, so that the maps align vertically
echo '<div id="place_map" style="margin-top:25px; border:1px solid gray; width: ', $this->getSetting('GM_PH_XSIZE'), 'px; height: ', $this->getSetting('GM_PH_YSIZE'), 'px; ';
} else {
echo '<div id="place_map" style="border:1px solid gray; width:', $this->getSetting('GM_PH_XSIZE'), 'px; height:', $this->getSetting('GM_PH_YSIZE'), 'px; ';
}
echo '"><i class="icon-loading-large"></i></div>';
echo '<script src="', $this->googleMapsScript(), '"></script>';
$plzoom = $latlng['pl_zoom'];
// Map zoom level
if (Auth::isAdmin()) {
$placecheck_url = 'module.php?mod=googlemap&mod_action=admin_placecheck';
if ($parent && isset($parent[0])) {
$placecheck_url .= '&country=' . $parent[0];
if (isset($parent[1])) {
$placecheck_url .= '&state=' . $parent[1];
}
}
$adminplaces_url = 'module.php?mod=googlemap&mod_action=admin_places';
if ($latlng && isset($latlng['pl_id'])) {
$adminplaces_url .= '&parent=' . $latlng['pl_id'];
}
$update_places_url = 'admin_trees_places.php?ged=' . $WT_TREE->getNameHtml() . '&search=' . urlencode(implode(', ', array_reverse($parent)));
echo '<div class="gm-options">';
echo '<a href="module.php?mod=googlemap&mod_action=admin_config">', I18N::translate('Google Maps™ preferences'), '</a>';
echo ' | <a href="' . $adminplaces_url . '">' . I18N::translate('Geographic data') . '</a>';
echo ' | <a href="' . $placecheck_url . '">' . I18N::translate('Place check') . '</a>';
echo ' | <a href="' . $update_places_url . '">' . I18N::translate('Update place names') . '</a>';
echo '</div>';
}
echo '</td>';
if ($STREETVIEW) {
echo '<td>';
global $pl_lati, $pl_long;
if ($level >= 1) {
$pl_lati = strtr($latlng['pl_lati'], array('N' => '', 'S' => '-', ',' => '.'));
// WT_placelocation lati
$pl_long = strtr($latlng['pl_long'], array('E' => '', 'W' => '-', ',' => '.'));
// WT_placelocation long
// Check if Streetview location parameters are stored in database
$placeid = $latlng['pl_id'];
// Placelocation place id
$sv_lat = $latlng['sv_lati'];
// StreetView Point of View Latitude
$sv_lng = $latlng['sv_long'];
// StreetView Point of View Longitude
$sv_dir = $latlng['sv_bearing'];
// StreetView Point of View Direction (degrees from North)
$sv_pitch = $latlng['sv_elevation'];
// StreetView Point of View Elevation (+90 to -90 degrees (+=down, -=up)
$sv_zoom = $latlng['sv_zoom'];
// StreetView Point of View Zoom (0, 1, 2 or 3)
// Check if Street View Lati/Long are the default of 0, if so use regular Place Lati/Long to set an initial location for the panda
if ($latlng['sv_lati'] == 0 && $latlng['sv_long'] == 0) {
$sv_lat = $pl_lati;
$sv_lng = $pl_long;
}
$frameheight = $this->getSetting('GM_PH_YSIZE') + 35;
// Add height of buttons
?>
<iframe class="gm-streetview-frame" style="height: <?php
echo $frameheight;
?>
px;" src="module.php?mod=googlemap&mod_action=wt_street_view&x=<?php
echo $sv_lng;
?>
&y=<?php
echo $sv_lat;
?>
&z=18&t=2&c=1&s=1&b=<?php
echo $sv_dir;
?>
&p=<?php
echo $sv_pitch;
?>
&m=<?php
echo $sv_zoom;
?>
&j=1&k=1&v=1"></iframe>
<?php
if (Auth::isAdmin()) {
?>
<div class="gm-streetview-parameters">
<form method="post" action="module.php?mod=googlemap&mod_action=places_edit">
<?php
echo Filter::getCsrf();
?>
//.........这里部分代码省略.........
示例11: renderContent
/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
/** @var AbstractTask $task */
$task = $this->data->get('task');
?>
<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><a href="<?php
echo $this->data->get('admin_config_url');
?>
"><?php
echo $this->data->get('module_title');
?>
</a></li>
<li class="active"><?php
echo $this->data->get('title');
?>
</li>
</ol>
<h1><?php
echo $this->data->get('title');
?>
</h1>
<form class="form-horizontal" name="newform" method="post" role="form" action="<?php
echo $this->data->get('save_url');
?>
" autocomplete="off">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="task" value="<?php
echo $task->getName();
?>
">
<h3><?php
echo I18N::translate('General');
?>
</h3>
<!-- FREQUENCY -->
<div class="form-group">
<label class="control-label col-sm-3" for="frequency">
<?php
echo I18N::translate('Frequency');
?>
</label>
<div class="col-sm-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group" >
<input class="form-control" type="number" min="0" id="frequency" name="frequency" required maxlength="70" value="<?php
echo $task->getFrequency();
?>
" dir="auto">
<span class="input-group-addon">
<?php
echo I18N::translate('minutes');
?>
</span>
</div>
</div>
</div>
<p class="small text-muted">
<?php
echo I18N::translate('Frequency at which the task should be run (in minutes).');
?>
<?php
echo I18N::translate('The actual run of the task may not be fired exactly at the frequency defined, but should be run as close as possible to it.');
?>
</p>
</div>
</div>
<!-- LIMITED OCCURRENCES -->
<div class="form-group">
<label class="control-label col-sm-3" for="is_limited">
<?php
echo I18N::translate('Run a limited number of times');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::editFieldYesNo('is_limited', $task->getRemainingOccurrences() > 0 ? 1 : 0, 'class="radio-inline"');
?>
<p class="small text-muted">
//.........这里部分代码省略.........
示例12: renderContent
/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
?>
<div id="maj-sosa-config-page">
<h2><?php
echo $this->data->get('title');
?>
</h2>
<form name="maj-sosa-config-form" method="post" action="<?php
echo $this->data->get('form_url');
?>
">
<input type="hidden" name="action" value="update">
<?php
echo Filter::getCsrf();
?>
<div id="maj-sosa-config-page-table">
<div class="label">
<?php
echo I18N::translate('Tree');
?>
</div>
<div class="value">
<label><?php
echo $this->data->get('tree')->getTitleHtml();
?>
</label>
</div>
<div class="label">
<?php
echo I18N::translate('For user');
?>
</div>
<div class="value">
<?php
$users = $this->data->get('users_settings');
if (count($users) == 1) {
$root_indi = $users[0]['rootid'];
?>
<label>
<input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php
echo $users[0]['user']->getUserId();
?>
" />
<?php
echo $users[0]['user']->getRealNameHtml();
?>
</label>
<?php
} else {
if (count($users) > 1) {
?>
<select id='maj-sosa-config-select' name="userid">
<?php
$root_indi = $users[0]['rootid'];
foreach ($this->data->get('users_settings') as $user) {
?>
<option value="<?php
echo $user['user']->getUserId();
?>
"><?php
echo $user['user']->getRealNameHtml();
?>
</option>
<?php
}
?>
</select>
<?php
}
}
?>
</div>
<div class="label">
<?php
echo I18N::translate('Root individual');
?>
</div>
<div class="value">
<input data-autocomplete-type="INDI" type="text" name="rootid" id="rootid" size="3" value="<?php
echo $root_indi;
?>
">
<?php
echo FunctionsPrint::printFindIndividualLink('rootid');
?>
</div>
<div class="label"></div>
<div class="value">
<input type="submit" value="<?php
echo I18N::translate('Save');
?>
">
//.........这里部分代码省略.........
示例13: renderContent
/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
/** @var AbstractModule $module */
$module = $this->data->get('module');
?>
<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 $this->data->get('title');
?>
</li>
</ol>
<h1><?php
echo $this->data->get('title');
?>
</h1>
<form method="post" class="form-horizontal">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="action" value="update">
<h3><?php
echo I18N::translate('General');
?>
</h3>
<!-- MAJ_CERT_ROOTDIR -->
<div class="form-group">
<label class="control-label col-sm-3" for="MAJ_CERT_ROOTDIR">
<?php
echo I18N::translate('Certificates directory');
?>
</label>
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon">
<?php
echo WT_DATA_DIR;
?>
</span>
<input
class="form-control"
dir="ltr"
id="MAJ_CERT_ROOTDIR"
maxlength="255"
name="MAJ_CERT_ROOTDIR"
type="text"
value="<?php
echo Filter::escapeHtml($module->getSetting('MAJ_CERT_ROOTDIR', 'certificates/'));
?>
"
required
>
</div>
<p class="small text-muted">
<?php
echo I18N::translate('This folder will be used to store the certificate files.');
?>
<?php
echo I18N::translate('If you select a different folder, you must also move any certificate files from the existing folder to the new one.');
?>
</p>
</div>
</div>
<!-- MAJ_SHOW_CERT -->
<div class="form-group">
<label class="control-label col-sm-3" for="MAJ_SHOW_CERT">
<?php
echo I18N::translate('Show certificates');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::editFieldAccessLevel('MAJ_SHOW_CERT', $module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE), 'class="form-control"');
?>
<p class="small text-muted">
<?php
echo I18N::translate('Define access level required to display certificates in facts sources. By default, nobody can see the certificates.');
?>
</p>
</div>
</div>
<h3><?php
//.........这里部分代码省略.........
示例14: renderContent
/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
$table_id = $this->data->get('table_id');
?>
<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 $this->data->get('title');
?>
</li>
</ol>
<div align="center">
<div id="tabs">
<form method="post" action="#">
<?php
echo Filter::getCsrf();
?>
<input type="hidden" name="action" value="update">
<table id="<?php
echo $table_id;
?>
" class="table table-bordered table-condensed table-hover table-site-changes" >
<thead>
<tr>
<th><?php
echo I18N::translate('Enabled');
?>
</th>
<th>ENABLED_SORT</th>
<th><?php
echo I18N::translate('Hook Function');
?>
</th>
<th><?php
echo I18N::translate('Hook Context');
?>
</th>
<th><?php
echo I18N::translate('Module Name');
?>
</th>
<th><?php
echo I18N::translate('Priority (1 is high)');
?>
</th>
<th>PRIORITY_SORT</th>
</tr>
</thead>
<tbody>
<?php
$hooks = $this->data->get('hook_list');
foreach ($hooks as $hook) {
?>
<tr>
<td>
<input type="hidden" name="hook-<?php
echo $hook->id;
?>
" value="yes" >
<?php
echo FunctionsEdit::twoStateCheckbox('status-' . $hook->id, $hook->status == 'enabled');
?>
</td>
<td><?php
echo $hook->status == 'enabled';
?>
</td>
<td><?php
echo $hook->hook;
?>
</td>
<td><?php
echo $hook->context;
?>
</td>
<td><?php
if ($mod = Module::getModuleByName($hook->module)) {
echo $mod->getTitle();
}
?>
</td>
<td><input type="text" class="center" size="2" value="<?php
echo $hook->priority;
?>
" name="moduleorder-<?php
echo $hook->id;
?>
//.........这里部分代码省略.........