本文整理汇总了PHP中Dropdown::getStandardDropdownItemTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::getStandardDropdownItemTypes方法的具体用法?PHP Dropdown::getStandardDropdownItemTypes怎么用?PHP Dropdown::getStandardDropdownItemTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::getStandardDropdownItemTypes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _n
echo _n('GLPI object', 'GLPI objects', 1, 'formcreator');
?>
</label>
<label for="dropdown_ldap_auth<?php
echo $rand;
?>
" id="label_glpi_ldap">
<?php
echo _n('LDAP directory', 'LDAP directories', 1);
?>
</label>
</td>
<td>
<div id="dropdown_values_field">
<?php
$optgroup = Dropdown::getStandardDropdownItemTypes();
array_unshift($optgroup, '---');
Dropdown::showFromArray('dropdown_values', $optgroup, array('value' => $question->fields['values'], 'rand' => $rand, 'on_change' => 'change_dropdown();'));
?>
</div>
<div id="glpi_objects_field">
<?php
$optgroup = array(__("Assets") => array('Computer' => _n("Computer", "Computers", 2), 'Monitor' => _n("Monitor", "Monitors", 2), 'Software' => _n("Software", "Software", 2), 'Networkequipment' => _n("Network", "Networks", 2), 'Peripheral' => _n("Device", "Devices", 2), 'Printer' => _n("Printer", "Printers", 2), 'Cartridgeitem' => _n("Cartridge", "Cartridges", 2), 'Consumableitem' => _n("Consumable", "Consumables", 2), 'Phone' => _n("Phone", "Phones", 2)), __("Assistance") => array('Ticket' => _n("Ticket", "Tickets", 2), 'Problem' => _n("Problem", "Problems", 2), 'TicketRecurrent' => __("Recurrent tickets")), __("Management") => array('Budget' => _n("Budget", "Budgets", 2), 'Supplier' => _n("Supplier", "Suppliers", 2), 'Contact' => _n("Contact", "Contacts", 2), 'Contract' => _n("Contract", "Contracts", 2), 'Document' => _n("Document", "Documents", 2)), __("Tools") => array('Notes' => __("Notes"), 'RSSFeed' => __("RSS feed")), __("Administration") => array('User' => _n("User", "Users", 2), 'Group' => _n("Group", "Groups", 2), 'Entity' => _n("Entity", "Entities", 2), 'Profile' => _n("Profile", "Profiles", 2)));
array_unshift($optgroup, '---');
Dropdown::showFromArray('glpi_objects', $optgroup, array('value' => $question->fields['values'], 'rand' => $rand, 'on_change' => 'change_glpi_objects();'));
?>
</div>
<div id="glpi_ldap_field">
<?php
$ldap_values = json_decode($question->fields['values']);
Dropdown::show('AuthLDAP', array('name' => 'ldap_auth', 'rand' => $rand, 'value' => isset($ldap_values->ldap_auth) ? $ldap_values->ldap_auth : '', 'on_change' => 'change_LDAP(this)'));
示例2: commonHeader
//.........这里部分代码省略.........
if (haveRight("rule_dictionnary_printer", "w")) {
$menu['admin']['content']['dictionnary']['options']['printer']['links']['add'] = '/front/ruledictionnaryprinter.form.php';
}
}
}
if (haveRight("profile", "r")) {
$menu['admin']['content']['profile']['title'] = $LANG['Menu'][35];
$menu['admin']['content']['profile']['shortcut'] = 'p';
$menu['admin']['content']['profile']['page'] = '/front/profile.php';
$menu['admin']['content']['profile']['links']['search'] = "/front/profile.php";
if (haveRight("profile", "w")) {
$menu['admin']['content']['profile']['links']['add'] = "/front/profile.form.php";
}
}
if (haveRight("backup", "w")) {
$menu['admin']['content']['backup']['title'] = $LANG['Menu'][12];
$menu['admin']['content']['backup']['shortcut'] = 'b';
$menu['admin']['content']['backup']['page'] = '/front/backup.php';
}
if (haveRight("logs", "r")) {
$menu['admin']['content']['log']['title'] = $LANG['Menu'][30];
$menu['admin']['content']['log']['shortcut'] = 'l';
$menu['admin']['content']['log']['page'] = '/front/event.php';
}
/// CONFIG
$config = array();
$addconfig = array();
$menu['config']['title'] = $LANG['common'][12];
if (haveRight("dropdown", "r") || haveRight("entity_dropdown", "r")) {
$menu['config']['content']['dropdowns']['title'] = $LANG['setup'][0];
$menu['config']['content']['dropdowns']['page'] = '/front/dropdown.php';
$menu['config']['default'] = '/front/dropdown.php';
if ($item == "dropdowns") {
$dps = Dropdown::getStandardDropdownItemTypes();
foreach ($dps as $tab) {
foreach ($tab as $key => $val) {
if ($key == $option) {
$tmp = new $key();
$menu['config']['content']['dropdowns']['options'][$option]['title'] = $val;
$menu['config']['content']['dropdowns']['options'][$option]['page'] = $tmp->getSearchURL(false);
$menu['config']['content']['dropdowns']['options'][$option]['links']['search'] = $tmp->getSearchURL(false);
if ($tmp->canCreate()) {
$menu['config']['content']['dropdowns']['options'][$option]['links']['add'] = $tmp->getFormURL(false);
}
}
}
}
}
}
if (haveRight("device", "w")) {
$menu['config']['content']['device']['title'] = $LANG['title'][30];
$menu['config']['content']['device']['page'] = '/front/device.php';
if ($item == "device") {
$dps = Dropdown::getDeviceItemTypes();
foreach ($dps as $tab) {
foreach ($tab as $key => $val) {
if ($key == $option) {
$tmp = new $key();
$menu['config']['content']['device']['options'][$option]['title'] = $val;
$menu['config']['content']['device']['options'][$option]['page'] = $tmp->getSearchURL(false);
$menu['config']['content']['device']['options'][$option]['links']['search'] = $tmp->getSearchURL(false);
if ($tmp->canCreate()) {
$menu['config']['content']['device']['options'][$option]['links']['add'] = $tmp->getFormURL(false);
}
}
}
示例3: title
/**
* Display title above search engine
*
* @return nothing (HTML display if needed)
**/
function title()
{
if ($this->display_dropdowntitle) {
Dropdown::showItemTypeMenu(_n('Dropdown', 'Dropdowns', Session::getPluralNumber()), Dropdown::getStandardDropdownItemTypes(), $this->getSearchURL());
}
}
示例4: header
//.........这里部分代码省略.........
$menu['admin']['content']['dictionnary']['options']['printer']['links']['add'] = '/front/ruledictionnaryprinter.form.php';
}
}
}
if (Session::haveRight("profile", "r")) {
$menu['admin']['content']['profile']['title'] = _n('Profile', 'Profiles', 2);
$menu['admin']['content']['profile']['shortcut'] = '';
$menu['admin']['content']['profile']['page'] = '/front/profile.php';
$menu['admin']['content']['profile']['links']['search'] = "/front/profile.php";
if (Session::haveRight("profile", "w")) {
$menu['admin']['content']['profile']['links']['add'] = "/front/profile.form.php";
}
}
if (Session::haveRight("backup", "w")) {
$menu['admin']['content']['backup']['title'] = __('Maintenance');
$menu['admin']['content']['backup']['shortcut'] = '';
$menu['admin']['content']['backup']['page'] = '/front/backup.php';
}
if (Session::haveRight("logs", "r")) {
$menu['admin']['content']['log']['title'] = _n('Log', 'Logs', 2);
$menu['admin']['content']['log']['shortcut'] = '';
$menu['admin']['content']['log']['page'] = '/front/event.php';
}
/// CONFIG
$config = array();
$addconfig = array();
$menu['config']['title'] = __('Setup');
if (Session::haveRight("dropdown", "r") || Session::haveRight("entity_dropdown", "r") || Session::haveRight("internet", "r")) {
$menu['config']['content']['dropdowns']['title'] = _n('Dropdown', 'Dropdowns', 2);
$menu['config']['content']['dropdowns']['shortcut'] = 'n';
$menu['config']['content']['dropdowns']['page'] = '/front/dropdown.php';
$menu['config']['default'] = '/front/dropdown.php';
if ($item == "dropdowns") {
$dps = Dropdown::getStandardDropdownItemTypes();
foreach ($dps as $tab) {
foreach ($tab as $key => $val) {
if ($key == $option) {
if ($tmp = getItemForItemtype($key)) {
$menu['config']['content']['dropdowns']['options'][$option]['title'] = $val;
$menu['config']['content']['dropdowns']['options'][$option]['page'] = $tmp->getSearchURL(false);
$menu['config']['content']['dropdowns']['options'][$option]['links']['search'] = $tmp->getSearchURL(false);
if ($tmp->canCreate()) {
$menu['config']['content']['dropdowns']['options'][$option]['links']['add'] = $tmp->getFormURL(false);
}
}
}
}
}
}
}
if (Session::haveRight("device", "w")) {
$menu['config']['content']['device']['title'] = _n('Component', 'Components', 2);
$menu['config']['content']['device']['page'] = '/front/device.php';
if ($item == "device") {
$dps = Dropdown::getDeviceItemTypes();
foreach ($dps as $tab) {
foreach ($tab as $key => $val) {
if ($key == $option) {
if ($tmp = getItemForItemtype($key)) {
$menu['config']['content']['device']['options'][$option]['title'] = $val;
$menu['config']['content']['device']['options'][$option]['page'] = $tmp->getSearchURL(false);
$menu['config']['content']['device']['options'][$option]['links']['search'] = $tmp->getSearchURL(false);
if ($tmp->canCreate()) {
$menu['config']['content']['device']['options'][$option]['links']['add'] = $tmp->getFormURL(false);
}
}
示例5: title
/**
* Display title above search engine
*
* @return nothing (HTML display if needed)
**/
function title()
{
global $LANG;
Dropdown::showItemTypeMenu($LANG['setup'][0], Dropdown::getStandardDropdownItemTypes(), $this->getSearchUrl());
}