本文整理汇总了PHP中WT_Filter::getInteger方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_Filter::getInteger方法的具体用法?PHP WT_Filter::getInteger怎么用?PHP WT_Filter::getInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_Filter
的用法示例。
在下文中一共展示了WT_Filter::getInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$PEDIGREE_FULL_DETAILS = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_FULL_DETAILS');
$MAX_DESCENDANCY_GENERATIONS = get_gedcom_setting(WT_GED_ID, 'MAX_DESCENDANCY_GENERATIONS');
// Extract the request parameters
$this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
$this->show_spouse = WT_Filter::getInteger('show_spouse', 0, 1);
$this->descent = WT_Filter::getInteger('descent', 0, 9, 5);
$this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 2);
$this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
// Box sizes are set globally in the theme. Modify them here.
global $bwidth, $bheight, $cbwidth, $cbheight, $Dbwidth, $bhalfheight, $Dbheight;
$Dbwidth = $this->box_width * $bwidth / 100;
//$Dbheight=$this->box_width * $bheight / 100;
$bwidth = $Dbwidth;
$bheight = $Dbheight;
// -- adjust size of the compact box
if (!$this->show_full) {
$bwidth = $this->box_width * $cbwidth / 100;
$bheight = $cbheight;
}
$bhalfheight = $bheight / 2;
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(WT_I18N::translate('Family book of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(WT_I18N::translate('Family book'));
}
//Checks how many generations of descendency is for the person for formatting purposes
$this->dgenerations = $this->max_descendency_generations($this->pid, 0);
if ($this->dgenerations < 1) {
$this->dgenerations = 1;
}
}
示例2: getBlock
public function getBlock($block_id, $template = true, $cfg = null)
{
global $ctype;
switch (WT_Filter::get('action')) {
case 'deletenews':
$news_id = WT_Filter::getInteger('news_id');
if ($news_id) {
deleteNews($news_id);
}
break;
}
$block = get_block_setting($block_id, 'block', true);
if ($cfg) {
foreach (array('block') as $name) {
if (array_key_exists($name, $cfg)) {
${$name} = $cfg[$name];
}
}
}
$usernews = getUserNews(WT_USER_ID);
$id = $this->getName() . $block_id;
$class = $this->getName() . '_block';
$title = '';
$title .= $this->getTitle();
$content = '';
if (count($usernews) == 0) {
$content .= WT_I18N::translate('You have not created any journal items.');
}
foreach ($usernews as $key => $news) {
$day = date('j', $news['date']);
$mon = date('M', $news['date']);
$year = date('Y', $news['date']);
$content .= "<div class=\"journal_box\">";
$content .= "<div class=\"news_title\">" . $news['title'] . '</div>';
$content .= "<div class=\"news_date\">" . format_timestamp($news['date']) . '</div>';
if ($news["text"] == strip_tags($news["text"])) {
// No HTML?
$news["text"] = nl2br($news["text"], false);
}
$content .= $news["text"] . "<br><br>";
$content .= "<a href=\"#\" onclick=\"window.open('editnews.php?news_id='+" . $key . ", '_blank', indx_window_specs); return false;\">" . WT_I18N::translate('Edit') . "</a> | ";
$content .= "<a href=\"index.php?action=deletenews&news_id={$key}&ctype={$ctype}\" onclick=\"return confirm('" . WT_I18N::translate('Are you sure you want to delete this journal entry?') . "');\">" . WT_I18N::translate('Delete') . "</a><br>";
$content .= "</div><br>";
}
if (WT_USER_ID) {
$content .= "<br><a href=\"#\" onclick=\"window.open('editnews.php?user_id='+WT_USER_ID, '_blank', indx_window_specs); return false;\">" . WT_I18N::translate('Add a new journal entry') . "</a>";
}
if ($template) {
if ($block) {
require WT_THEME_DIR . 'templates/block_small_temp.php';
} else {
require WT_THEME_DIR . 'templates/block_main_temp.php';
}
} else {
return $content;
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
$default_generations = get_gedcom_setting(WT_GED_ID, 'DEFAULT_PEDIGREE_GENERATIONS');
// Extract the request parameters
$this->fan_style = WT_Filter::getInteger('fan_style', 2, 4, 3);
$this->fan_width = WT_Filter::getInteger('fan_width', 50, 300, 100);
$this->generations = WT_Filter::getInteger('generations', 2, 9, $default_generations);
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(WT_I18N::translate('Fan chart of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(WT_I18N::translate('Fan chart'));
}
}
示例4: __construct
function __construct($rootid = '', $show_full = 1)
{
global $bheight, $bwidth, $cbwidth, $cbheight, $bhalfheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS;
global $TEXT_DIRECTION, $show_full;
parent::__construct();
// Extract parameters from from
$this->pid = WT_Filter::get('rootid', WT_REGEX_XREF);
$this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
$this->show_spouse = WT_Filter::getInteger('show_spouse', 0, 1, 0);
$this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 3);
$this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
// This is passed as a global. A parameter would be better...
$show_full = $this->show_full;
if (!empty($rootid)) {
$this->pid = $rootid;
}
//-- flip the arrows for RTL languages
if ($TEXT_DIRECTION == 'ltr') {
$this->left_arrow = 'icon-larrow';
$this->right_arrow = 'icon-rarrow';
} else {
$this->left_arrow = 'icon-larrow';
$this->right_arrow = 'icon-larrow';
}
// -- size of the detailed boxes based upon optional width parameter
$Dbwidth = $this->box_width * $bwidth / 100;
$Dbheight = $this->box_width * $bheight / 100;
$bwidth = $Dbwidth;
$bheight = $Dbheight;
// -- adjust size of the compact box
if (!$this->show_full) {
$bwidth = $this->box_width * $cbwidth / 100;
$bheight = $cbheight;
}
$bhalfheight = (int) ($bheight / 2);
// Validate parameters
$this->hourPerson = WT_Individual::getInstance($this->pid);
if (!$this->hourPerson) {
$this->hourPerson = $this->getSignificantIndividual();
$this->pid = $this->hourPerson->getXref();
}
$this->name = $this->hourPerson->getFullName();
//Checks how many generations of descendency is for the person for formatting purposes
$this->dgenerations = $this->max_descendency_generations($this->pid, 0);
if ($this->dgenerations < 1) {
$this->dgenerations = 1;
}
$this->setPageTitle(WT_I18N::translate('Hourglass chart of %s', $this->name));
}
示例5: __construct
function __construct()
{
global $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS;
global $DEFAULT_PEDIGREE_GENERATIONS, $PEDIGREE_GENERATIONS, $MAX_PEDIGREE_GENERATIONS, $OLD_PGENS, $box_width, $Dbwidth, $Dbheight;
global $show_full;
parent::__construct();
// Extract form parameters
$this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
$this->show_cousins = WT_Filter::getInteger('show_cousins', 0, 1);
$this->chart_style = WT_Filter::getInteger('chart_style', 0, 3);
$box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
$PEDIGREE_GENERATIONS = WT_Filter::getInteger('PEDIGREE_GENERATIONS', 2, $MAX_PEDIGREE_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
// This is passed as a global. A parameter would be better...
$show_full = $this->show_full;
$OLD_PGENS = $PEDIGREE_GENERATIONS;
// -- size of the detailed boxes based upon optional width parameter
$Dbwidth = $box_width * $bwidth / 100;
$Dbheight = $box_width * $bheight / 100;
$bwidth = $Dbwidth;
$bheight = $Dbheight;
// -- adjust size of the compact box
if (!$this->show_full) {
$bwidth = $cbwidth;
$bheight = $cbheight;
}
$pbwidth = $bwidth + 12;
$pbheight = $bheight + 14;
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(WT_I18N::translate('Ancestors of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(WT_I18N::translate('Ancestors'));
}
if (strlen($this->name) < 30) {
$this->cellwidth = "420";
} else {
$this->cellwidth = strlen($this->name) * 14;
}
}
示例6: __construct
function __construct()
{
global $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS, $show_full;
parent::__construct();
// Extract parameters from form
$this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
$this->chart_style = WT_Filter::getInteger('chart_style', 0, 3, 0);
$this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
$this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
// This is passed as a global. A parameter would be better...
$show_full = $this->show_full;
if (!isset($this->personcount)) {
$this->personcount = 1;
}
// -- size of the detailed boxes based upon optional width parameter
$Dbwidth = $this->box_width * $bwidth / 100;
$Dbheight = $this->box_width * $bheight / 100;
$bwidth = $Dbwidth;
$bheight = $Dbheight;
// -- adjust size of the compact box
if (!$this->show_full) {
$bwidth = $cbwidth;
$bheight = $cbheight;
}
$pbwidth = $bwidth + 12;
$pbheight = $bheight + 14;
// Validate form variables
if (strlen($this->name) < 30) {
$this->cellwidth = 420;
} else {
$this->cellwidth = strlen($this->name) * 14;
}
if ($this->root && $this->root->canShowName()) {
$this->setPageTitle(WT_I18N::translate('Descendants of %s', $this->root->getFullName()));
} else {
$this->setPageTitle(WT_I18N::translate('Descendants'));
}
}
示例7: __construct
function __construct()
{
parent::__construct();
$this->setPageTitle(WT_I18N::translate('Timeline'));
$this->baseyear = date("Y");
// new pid
$newpid = WT_Filter::get('newpid', WT_REGEX_XREF);
// pids array
$this->pids = WT_Filter::getArray('pids', WT_REGEX_XREF);
// make sure that arrays are indexed by numbers
$this->pids = array_values($this->pids);
if (!empty($newpid) && !in_array($newpid, $this->pids)) {
$this->pids[] = $newpid;
}
if (count($this->pids) == 0) {
$this->pids[] = $this->getSignificantIndividual()->getXref();
}
$remove = WT_Filter::get('remove', WT_REGEX_XREF);
// cleanup user input
$newpids = array();
foreach ($this->pids as $value) {
if ($value != $remove) {
$newpids[] = $value;
$person = WT_Individual::getInstance($value);
if ($person) {
$this->people[] = $person;
}
}
}
$this->pids = $newpids;
$this->pidlinks = "";
/* @var $indi Person */
foreach ($this->people as $p => $indi) {
if (!is_null($indi) && $indi->canShow()) {
// setup string of valid pids for links
$this->pidlinks .= "pids%5B%5D=" . $indi->getXref() . "&";
$bdate = $indi->getBirthDate();
if ($bdate->isOK()) {
$date = $bdate->MinDate();
$date = $date->convert_to_cal('gregorian');
if ($date->y) {
$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) {
$fact->spouse = $family->getSpouse($indi);
$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();
$date = $date->MinDate();
$date = $date->convert_to_cal('gregorian');
if ($date->y) {
$this->baseyear = min($this->baseyear, $date->y);
$this->topyear = max($this->topyear, $date->y);
if (!$indi->isDead()) {
$this->topyear = max($this->topyear, date('Y'));
}
$event->temp = $p;
// do not add the same fact twice (prevents marriages from being added multiple times)
// TODO - this code does not work. If both spouses are shown, their marriage is duplicated...
if (!in_array($event, $this->indifacts, true)) {
$this->indifacts[] = $event;
}
}
}
}
}
}
$scale = WT_Filter::getInteger('scale', 0, 200);
if ($scale == 0) {
$this->scale = round(($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;
}
示例8: define
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
define('WT_SCRIPT_NAME', 'import.php');
require './includes/session.php';
require_once WT_ROOT . 'includes/functions/functions_import.php';
if (!WT_USER_GEDCOM_ADMIN) {
header('HTTP/1.1 403 Access Denied');
exit;
}
$controller = new WT_Controller_Ajax();
$controller->pageHeader();
// Don't use ged=XX as we want to be able to run without changing the current gedcom.
// This will let us load several gedcoms together, or to edit one while loading another.
$gedcom_id = WT_Filter::getInteger('gedcom_id');
// Don't allow the user to cancel the request. We do not want to be left
// with an incomplete transaction.
ignore_user_abort(true);
// Run in a transaction
WT_DB::exec("START TRANSACTION");
// Only allow one process to import each gedcom at a time
WT_DB::prepare("SELECT * FROM `##gedcom_chunk` WHERE gedcom_id=? FOR UPDATE")->execute(array($gedcom_id));
// What is the current import status?
$row = WT_DB::prepare("SELECT" . " SUM(IF(imported, LENGTH(chunk_data), 0)) AS import_offset," . " SUM(LENGTH(chunk_data)) AS import_total" . " FROM `##gedcom_chunk` WHERE gedcom_id=?")->execute(array($gedcom_id))->fetchOneRow();
if ($row->import_offset == $row->import_total) {
set_gedcom_setting($gedcom_id, 'imported', true);
// Finished? Show the maintenance links, similar to admin_trees_manage.php
WT_DB::exec("COMMIT");
$controller->addInlineJavascript('jQuery("#import' . $gedcom_id . '").toggle();' . 'jQuery("#actions' . $gedcom_id . '").toggle();');
exit;
示例9: delete
private function delete()
{
if (WT_USER_CAN_EDIT) {
$block_id = WT_Filter::getInteger('block_id');
WT_DB::prepare("DELETE FROM `##block_setting` WHERE block_id=?")->execute(array($block_id));
WT_DB::prepare("DELETE FROM `##block` WHERE block_id=?")->execute(array($block_id));
} else {
header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH);
exit;
}
}
示例10: __construct
function __construct()
{
global $WT_SESSION;
parent::__construct();
$this->setPageTitle(WT_I18N::translate('Lifespans'));
$this->colorindex = 0;
$this->Fcolorindex = 0;
$this->Mcolorindex = 0;
$this->zoomfactor = 10;
$this->color = "#0000FF";
$this->currentYear = date("Y");
$this->deathMod = 0;
$this->endDate = $this->currentYear;
// Request parameters
$newpid = WT_Filter::get('newpid', WT_REGEX_XREF);
$remove = WT_Filter::get('remove', WT_REGEX_XREF);
$pids = WT_Filter::getArray('pids', WT_REGEX_XREF);
$clear = WT_Filter::getBool('clear');
$addfam = WT_Filter::getBool('addFamily');
$place = WT_Filter::get('place');
$beginYear = WT_Filter::getInteger('beginYear', 0, date('Y') + 100, 0);
$endYear = WT_Filter::getInteger('endYear', 0, date('Y') + 100, 0);
if ($clear) {
// Empty list
$this->pids = array();
} elseif ($pids) {
// List of specified records
$this->pids = $pids;
} elseif ($place) {
// All records found in a place
$wt_place = new WT_Place($place, WT_GED_ID);
$this->pids = WT_DB::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?")->execute(array($wt_place->getPlaceId(), WT_GED_ID))->fetchOneColumn();
$this->place = $place;
} else {
// Modify an existing list of records
if (is_array($WT_SESSION->timeline_pids)) {
$this->pids = $WT_SESSION->timeline_pids;
} else {
$this->pids = array();
}
if ($remove) {
foreach ($this->pids as $key => $value) {
if ($value == $remove) {
unset($this->pids[$key]);
}
}
} elseif ($newpid) {
$person = WT_Individual::getInstance($newpid);
$this->addFamily($person, $addfam);
} elseif (!$this->pids) {
$this->addFamily($this->getSignificantIndividual(), false);
}
}
$WT_SESSION->timeline_pids = $this->pids;
$this->beginYear = $beginYear;
$this->endYear = $endYear;
if ($beginYear == 0 || $endYear == 0) {
//-- cleanup user input
$this->pids = array_unique($this->pids);
//removes duplicates
foreach ($this->pids as $key => $value) {
if ($value != $remove) {
$this->pids[$key] = $value;
$person = WT_Individual::getInstance($value);
// list of linked records includes families as well as individuals.
if ($person) {
$bdate = $person->getEstimatedBirthDate();
if ($bdate->isOK() && $person->canShow()) {
$this->people[] = $person;
}
}
}
}
} else {
//--Finds if the begin year and end year textboxes are not empty
//-- reset the people array when doing a year range search
$this->people = array();
//Takes the begining year and end year passed by the postback and modifies them and uses them to populate
//the time line
//Variables to restrict the person boxes to the year searched.
//--Searches for individuals who had an even between the year begin and end years
$indis = self::search_indis_year_range($beginYear, $endYear);
//--Populates an array of people that had an event within those years
foreach ($indis as $person) {
if (empty($searchplace) || in_array($person->getXref(), $this->pids)) {
$bdate = $person->getEstimatedBirthDate();
if ($bdate->isOK() && $person->canShow()) {
$this->people[] = $person;
}
}
}
$WT_SESSION->timeline_pids = null;
}
// Sort the array in order of birth year
uasort($this->people, function (WT_Individual $a, WT_Individual $b) {
return WT_Date::Compare($a->getEstimatedBirthDate(), $b->getEstimatedBirthDate());
});
//If there is people in the array posted back this if occurs
if (isset($this->people[0])) {
//Find the maximum Death year and mimimum Birth year for each individual returned in the array.
//.........这里部分代码省略.........
示例11: define
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 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, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
define('WT_SCRIPT_NAME', 'statistics.php');
require './includes/session.php';
// check for on demand content loading
$tab = WT_Filter::getInteger('tab', 0, 3);
$ajax = WT_Filter::getBool('ajax');
if (!$ajax) {
$controller = new WT_Controller_Page();
$controller->setPageTitle(WT_I18N::translate('Statistics'))->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('
jQuery("#statistics_chart").css("visibility", "visible");
jQuery("#statistics_chart").tabs({
load: function() {
jQuery("#loading-indicator").removeClass("loading-image");
},
beforeLoad: function(event, ui) {
jQuery("#loading-indicator").addClass("loading-image");
// Only load each tab once
if (ui.tab.data("loaded")) {
event.preventDefault();
return;
示例12: define
//
// 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, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'editnews.php');
require './includes/session.php';
$controller = new WT_Controller_Simple();
$controller->setPageTitle(WT_I18N::translate('Add/edit a journal/news entry'))->restrictAccess(Auth::isMember())->pageHeader();
$action = WT_Filter::get('action', 'compose|save|delete', 'compose');
$news_id = WT_Filter::getInteger('news_id');
$user_id = WT_Filter::get('user_id', WT_REGEX_INTEGER, WT_Filter::post('user_id', WT_REGEX_INTEGER));
$gedcom_id = WT_Filter::get('gedcom_id', WT_REGEX_INTEGER, WT_Filter::post('gedcom_id', WT_REGEX_INTEGER));
$date = WT_Filter::postInteger('date', 0, PHP_INT_MAX, WT_TIMESTAMP);
$title = WT_Filter::post('title');
$text = WT_Filter::post('text');
switch ($action) {
case 'compose':
if (array_key_exists('ckeditor', WT_Module::getActiveModules())) {
ckeditor_WT_Module::enableEditor($controller);
}
echo '<h3>' . WT_I18N::translate('Add/edit a journal/news entry') . '</h3>';
echo '<form style="overflow: hidden;" name="messageform" method="post" action="editnews.php?action=save&news_id=' . $news_id . '">';
if ($news_id) {
$news = getNewsItem($news_id);
} else {
示例13: foreach
break;
}
}
} else {
$ORDER_BY = '1 ASC';
}
// This becomes a JSON list, not array, so need to fetch with numeric keys.
$data = WT_DB::prepare($SELECT1 . $WHERE . $ORDER_BY . $LIMIT)->execute($args)->fetchAll(PDO::FETCH_NUM);
foreach ($data as &$datum) {
$datum[2] = WT_Filter::escapeHtml($datum[2]);
}
// Total filtered/unfiltered rows
$recordsFiltered = WT_DB::prepare("SELECT FOUND_ROWS()")->fetchColumn();
$recordsTotal = WT_DB::prepare($SELECT2 . $WHERE)->execute($args)->fetchColumn();
header('Content-type: application/json');
echo json_encode(array('sEcho' => WT_Filter::getInteger('sEcho'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data));
exit;
}
$controller->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
jQuery("#log_list").dataTable( {
dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
processing: true,
serverSide: true,
ajax: "' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?action=load_json&from=' . $from . '&to=' . $to . '&type=' . $type . '&text=' . rawurlencode($text) . '&ip=' . rawurlencode($ip) . '&user=' . rawurlencode($user) . '&gedc=' . rawurlencode($gedc) . '",
' . WT_I18N::datatablesI18N(array(10, 20, 50, 100, 500, 1000, -1)) . ',
jQueryUI: true,
autoWidth: false,
sorting: [[ 0, "desc" ]],
pageLength: ' . Auth::user()->getSetting('admin_site_log_page_size', 20) . ',
pagingType: "full_numbers"
});
示例14: WT_Controller_Page
$controller = new WT_Controller_Page();
$controller->setPageTitle(WT_I18N::translate('Media objects'))->pageHeader();
$search = WT_Filter::get('search');
$sortby = WT_Filter::get('sortby', 'file|title', 'title');
if (!WT_USER_CAN_EDIT && !WT_USER_CAN_ACCEPT) {
$sortby = 'title';
}
$start = WT_Filter::getInteger('start');
$max = WT_Filter::get('max', '10|20|30|40|50|75|100|125|150|200', '20');
$folder = WT_Filter::get('folder', null, '');
// MySQL needs an empty string, not NULL
$reset = WT_Filter::get('reset');
$apply_filter = WT_Filter::get('apply_filter');
$filter = WT_Filter::get('filter', null, '');
// MySQL needs an empty string, not NULL
$columns = WT_Filter::getInteger('columns', 1, 2, 2);
$subdirs = WT_Filter::get('subdirs', 'on');
$currentdironly = $subdirs == 'on' ? false : true;
// reset all variables
if ($reset == 'Reset') {
$sortby = 'title';
$max = '20';
$folder = '';
$columns = '2';
$currentdironly = true;
$filter = '';
}
// A list of all subfolders used by this tree
$folders = WT_Query_Media::folderList();
// A list of all media objects matching the search criteria
$medialist = WT_Query_Media::mediaList($folder, $currentdironly ? 'exclude' : 'include', $sortby, $filter);
示例15: moveup
private function moveup()
{
$block_id = WT_Filter::getInteger('block_id');
$block_order = WT_DB::prepare("SELECT block_order FROM `##block` WHERE block_id=?")->execute(array($block_id))->fetchOne();
$swap_block = WT_DB::prepare("SELECT block_order, block_id" . " FROM `##block`" . " WHERE block_order=(" . " SELECT MAX(block_order) FROM `##block` WHERE block_order < ? AND module_name=?" . " ) AND module_name=?" . " LIMIT 1")->execute(array($block_order, $this->getName(), $this->getName()))->fetchOneRow();
if ($swap_block) {
WT_DB::prepare("UPDATE `##block` SET block_order=? WHERE block_id=?")->execute(array($swap_block->block_order, $block_id));
WT_DB::prepare("UPDATE `##block` SET block_order=? WHERE block_id=?")->execute(array($block_order, $swap_block->block_id));
}
}