本文整理汇总了PHP中Fisharebest\Webtrees\Filter::getArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::getArray方法的具体用法?PHP Filter::getArray怎么用?PHP Filter::getArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Filter
的用法示例。
在下文中一共展示了Filter::getArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createMap
/**
* Called by placelist.php
*
* @param string $placelevels
*/
public function createMap($placelevels)
{
global $level, $levelm, $plzoom, $controller, $WT_TREE;
Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
$STREETVIEW = $this->getSetting('GM_USE_STREETVIEW');
$parent = Filter::getArray('parent');
// create the map
echo '<table style="margin:20px auto 0 auto;"><tr valign="top"><td>';
//<!-- start of map display -->
echo '<table><tr valign="top">';
echo '<td class="center" width="200px">';
$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);
if ($STREETVIEW && $level != 0) {
echo '<div id="place_map" style="margin-top:20px; 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 '</td>';
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'];
}
echo '</tr><tr><td>';
echo '<a href="module.php?mod=googlemap&mod_action=admin_config">', I18N::translate('Google Maps™ preferences'), '</a>';
echo ' | ';
echo '<a href="' . $adminplaces_url . '">', I18N::translate('Geographic data'), '</a>';
echo ' | ';
echo '<a href="' . $placecheck_url . '">', I18N::translate('Place check'), '</a>';
if (Module::getModuleByName('batch_update')) {
$placelevels = preg_replace('/, ' . I18N::translate('unknown') . '/', ', ', $placelevels);
// replace ", unknown" with ", "
$placelevels = substr($placelevels, 2);
// remove the leading ", "
if ($placelevels) {
$batchupdate_url = 'module.php?mod=batch_update&mod_action=admin_batch_update&plugin=BatchUpdateSearchReplacePlugin&method=exact&ged=' . $WT_TREE->getNameHtml() . '&search=' . urlencode($placelevels);
// exact match
echo ' | ';
echo '<a href="' . $batchupdate_url . '">', I18N::translate('Batch update'), '</a>';
}
}
}
echo '</td></tr></table>';
echo '</td>';
echo '<td style="margin-left:15px; float:right;">';
if ($STREETVIEW) {
$controller->addInlineJavascript('
function update_sv_params(placeid) {
var svlati = document.getElementById("sv_latiText").value.slice(0, -1);
var svlong = document.getElementById("sv_longText").value.slice(0, -1);
var svbear = document.getElementById("sv_bearText").value.slice(0, -1);
var svelev = document.getElementById("sv_elevText").value.slice(0, -1);
var svzoom = document.getElementById("sv_zoomText").value;
win03 = window.open("module.php?mod=googlemap&mod_action=places_edit&action=update_sv_params&placeid="+placeid+"&svlati="+svlati+"&svlong="+svlong+"&svbear="+svbear+"&svelev="+svelev+"&svzoom="+svzoom, "win03", indx_window_specs);
if (window.focus) {win03.focus();}
}
');
global $pl_lati, $pl_long;
if ($level >= 1) {
$pl_lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $latlng['pl_lati']);
// WT_placelocation lati
$pl_long = str_replace(array('E', 'W', ','), array('', '-', '.'), $latlng['pl_long']);
// 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;
}
?>
<div>
//.........这里部分代码省略.........
示例2: USING
$sql_delete = "DELETE `##change` FROM `##change`" . " LEFT JOIN `##user` USING (user_id)" . " LEFT JOIN `##gedcom` USING (gedcom_id)";
// gedcom may be deleted
Database::prepare($sql_delete . $where)->execute($args);
break;
case 'export':
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="webtrees-changes.csv"');
$rows = Database::prepare($sql_select . $where . ' ORDER BY change_id')->execute($args)->fetchAll();
foreach ($rows as $row) {
echo '"', $row->change_time, '",', '"', $row->status, '",', '"', $row->xref, '",', '"', str_replace('"', '""', $row->old_gedcom), '",', '"', str_replace('"', '""', $row->new_gedcom), '",', '"', str_replace('"', '""', $row->user_name), '",', '"', str_replace('"', '""', $row->gedcom_name), '"', "\n";
}
return;
case 'load_json':
$start = Filter::getInteger('start');
$length = Filter::getInteger('length');
$order = Filter::getArray('order');
if ($order) {
$order_by = " ORDER BY ";
foreach ($order as $key => $value) {
if ($key > 0) {
$order_by .= ',';
}
// Datatables numbers columns 0, 1, 2, ...
// MySQL numbers columns 1, 2, 3, ...
switch ($value['dir']) {
case 'asc':
$order_by .= 1 + $value['column'] . " ASC ";
break;
case 'desc':
$order_by .= 1 + $value['column'] . " DESC ";
break;
示例3: 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();
?>
//.........这里部分代码省略.........
示例4: __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;
}
示例5: PageController
namespace Fisharebest\Webtrees;
/**
* Defined in session.php
*
* @global Tree $WT_TREE
*/
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
define('WT_SCRIPT_NAME', 'placelist.php');
require './includes/session.php';
$controller = new PageController();
$action = Filter::get('action', 'find|show', 'find');
$display = Filter::get('display', 'hierarchy|list', 'hierarchy');
$parent = Filter::getArray('parent');
$level = count($parent);
if ($display == 'hierarchy') {
if ($level) {
$controller->setPageTitle(I18N::translate('Place hierarchy') . ' - <span dir="auto">' . Filter::escapeHtml(end($parent)) . '</span>');
} else {
$controller->setPageTitle(I18N::translate('Place hierarchy'));
}
} else {
$controller->setPageTitle(I18N::translate('Place list'));
}
$controller->pageHeader();
echo '<div id="place-hierarchy">';
switch ($display) {
case 'list':
echo '<h2>', $controller->getPageTitle(), '</h2>';