本文整理汇总了PHP中Dropdown::showListLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::showListLimit方法的具体用法?PHP Dropdown::showListLimit怎么用?PHP Dropdown::showListLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::showListLimit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectorLimit
/**
* Show a dropdown list to select the number of datas to show
*/
static function selectorLimit()
{
Dropdown::showListLimit();
}
示例2: printPagerForm
/**
* Display the list_limit combo choice
*
* @param $action page would be posted when change the value (URL + param) (default '')
*
* ajax Pager will be displayed if empty
*
* @return nothing (print a combo)
**/
static function printPagerForm($action = "")
{
if ($action) {
echo "<form method='POST' action=\"{$action}\">";
echo "<span class='responsive_hidden'>" . __('Display (number of items)') . "</span> ";
Dropdown::showListLimit("submit()");
} else {
echo "<form method='POST' action =''>\n";
echo "<span class='responsive_hidden'>" . __('Display (number of items)') . "</span> ";
Dropdown::showListLimit("reloadTab(\"glpilist_limit=\"+this.value)");
}
Html::closeForm();
}
示例3: menu
/**
* @param $item
* @param $action
**/
function menu($item, $action)
{
global $DB, $PLUGIN_HOOKS;
$type = $item->getType();
// $ID set if current object, not set from preference
if (isset($item->fields['id'])) {
$ID = $item->fields['id'];
} else {
$ID = 0;
$item->getEmpty();
}
if (!isset($PLUGIN_HOOKS['plugin_pdf'][$type]) || !class_exists($PLUGIN_HOOKS['plugin_pdf'][$type])) {
return;
}
$itempdf = new $PLUGIN_HOOKS['plugin_pdf'][$type]($item);
$options = $itempdf->defineAllTabs();
$formid = "plugin_pdf_{$type}_" . mt_rand();
echo "<form name='" . $formid . "' id='" . $formid . "' action='{$action}' method='post' " . ($ID ? "target='_blank'" : "") . "><table class='tab_cadre_fixe'>";
$landscape = false;
$values = array();
$sql = "SELECT `tabref`\n FROM `" . $this->getTable() . "`\n WHERE `users_ID` = '" . $_SESSION['glpiID'] . "'\n AND `itemtype` = '{$type}'";
foreach ($DB->request($sql) as $data) {
if ($data["tabref"] == 'landscape') {
$landscape = true;
} else {
$values[$data["tabref"]] = $data["tabref"];
}
}
// Always export, at least, main part.
if (!count($values) && isset($options['_main_'])) {
$values['_main_'] = 1;
}
echo "<tr><th colspan='6'>" . sprintf(__('%1$s: %2$s'), __('Choose the tables to print in pdf', 'pdf'), $item->getTypeName());
echo "</th></tr>";
$i = 0;
foreach ($options as $num => $title) {
if (!$i) {
echo "<tr class='tab_bg_1'>";
}
if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {
$title = "{$title} ({$num})";
}
$this->checkbox($num, $title, isset($values[$num]) ? true : false);
if ($i == 4) {
echo "</tr>";
$i = 0;
} else {
$i++;
}
}
if ($i) {
while ($i <= 4) {
echo "<td width='20%'> </td>";
$i++;
}
echo "</tr>";
}
echo "<tr class='tab_bg_2'><td colspan='2' class='left'>";
echo "<a onclick=\"if (markCheckboxes('" . $formid . "') ) return false;\" href='" . $_SERVER['PHP_SELF'] . "?select=all'>" . __('Check all') . "</a> / ";
echo "<a onclick=\"if (unMarkCheckboxes('" . $formid . "') ) return false;\" href='" . $_SERVER['PHP_SELF'] . "?select=none'>" . __('Uncheck all') . "</a></td>";
echo "<td colspan='4' class='center'>";
echo "<input type='hidden' name='plugin_pdf_inventory_type' value='" . $type . "'>";
echo "<input type='hidden' name='indice' value='" . count($options) . "'>";
if ($ID) {
printf(__('Display %d items', 'pdf'), Dropdown::showListLimit());
}
echo "<select name='page'>\n";
echo "<option value='0'>" . __('Portrait', 'pdf') . "</option>\n";
// Portrait
echo "<option value='1'" . ($landscape ? "selected='selected'" : '') . ">" . __('Landscape', 'pdf') . "</option>\n";
// Paysage
echo "</select> \n";
if ($ID) {
echo "<input type='hidden' name='itemID' value='" . $ID . "'>";
echo "<input type='submit' value='" . _sx('button', 'Print', 'pdf') . "' name='generate' class='submit'></td></tr>";
} else {
echo "<input type='submit' value='" . _sx('button', 'Save') . "' name='plugin_pdf_user_preferences_save' class='submit'></td></tr>";
}
echo "</table>";
Html::closeForm();
}