本文整理汇总了PHP中State::dropdownBehaviour方法的典型用法代码示例。如果您正苦于以下问题:PHP State::dropdownBehaviour方法的具体用法?PHP State::dropdownBehaviour怎么用?PHP State::dropdownBehaviour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State
的用法示例。
在下文中一共展示了State::dropdownBehaviour方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFormInventory
/**
* Print the config form for restrictions
*
* @return Nothing (display)
**/
function showFormInventory()
{
global $DB, $CFG_GLPI;
if (!self::canView()) {
return false;
}
$canedit = Config::canUpdate();
if ($canedit) {
echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>";
}
echo "<div class='center' id='tabsbody'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . __('Assets') . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td width='30%'>" . __('Enable the financial and administrative information by default') . "</td>";
echo "<td width='20%'>";
Dropdown::ShowYesNo('auto_create_infocoms', $CFG_GLPI["auto_create_infocoms"]);
echo "</td><td width='20%'> " . __('Restrict monitor management') . "</td>";
echo "<td width='30%'>";
$this->dropdownGlobalManagement("monitors_management_restrict", $CFG_GLPI["monitors_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Software category deleted by the dictionary rules') . "</td><td>";
SoftwareCategory::dropdown(array('value' => $CFG_GLPI["softwarecategories_id_ondelete"], 'name' => "softwarecategories_id_ondelete"));
echo "</td><td> " . __('Restrict device management') . "</td><td>";
$this->dropdownGlobalManagement("peripherals_management_restrict", $CFG_GLPI["peripherals_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Beginning of fiscal year') . "</td><td>";
Html::showDateField("date_tax", array('value' => $CFG_GLPI["date_tax"], 'maybeempty' => false, 'canedit' => true, 'min' => '', 'max' => '', 'showyear' => false));
echo "</td><td> " . __('Restrict phone management') . "</td><td>";
$this->dropdownGlobalManagement("phones_management_restrict", $CFG_GLPI["phones_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Automatic fields (marked by *)') . "</td><td>";
$tab = array(0 => __('Global'), 1 => __('By entity'));
Dropdown::showFromArray('use_autoname_by_entity', $tab, array('value' => $CFG_GLPI["use_autoname_by_entity"]));
echo "</td><td> " . __('Restrict printer management') . "</td><td>";
$this->dropdownGlobalManagement("printers_management_restrict", $CFG_GLPI["printers_management_restrict"]);
echo "</td></tr>";
echo "</table>";
if (Session::haveRightsOr("transfer", array(CREATE, UPDATE)) && Session::isMultiEntitiesMode()) {
echo "<br><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Automatic transfer of computers') . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Template for the automatic transfer of computers in another entity') . "</td><td>";
Transfer::dropdown(array('value' => $CFG_GLPI["transfers_id_auto"], 'name' => "transfers_id_auto", 'emptylabel' => __('No automatic transfer')));
echo "</td></tr>";
echo "</table>";
}
echo "<br><table class='tab_cadre_fixe'>";
echo "<tr>";
echo "<th colspan='4'>" . __('Automatically update of the elements related to the computers');
echo "</th><th colspan='2'>" . __('Unit management') . "</th></tr>";
echo "<tr><th> </th>";
echo "<th>" . __('Alternate username') . "</th>";
echo "<th>" . __('User') . "</th>";
echo "<th>" . __('Group') . "</th>";
echo "<th>" . __('Location') . "</th>";
echo "<th>" . __('Status') . "</th>";
echo "</tr>";
$fields = array("contact", "user", "group", "location");
echo "<tr class='tab_bg_2'>";
echo "<td> " . __('When connecting or updating') . "</td>";
$values[0] = __('Do not copy');
$values[1] = __('Copy');
foreach ($fields as $field) {
echo "<td>";
$fieldname = "is_" . $field . "_autoupdate";
Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname]));
echo "</td>";
}
echo "<td>";
State::dropdownBehaviour("state_autoupdate_mode", __('Copy computer status'), $CFG_GLPI["state_autoupdate_mode"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td> " . __('When disconnecting') . "</td>";
$values[0] = __('Do not delete');
$values[1] = __('Clear');
foreach ($fields as $field) {
echo "<td>";
$fieldname = "is_" . $field . "_autoclean";
Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname]));
echo "</td>";
}
echo "<td>";
State::dropdownBehaviour("state_autoclean_mode", __('Clear status'), $CFG_GLPI["state_autoclean_mode"]);
echo "</td></tr>";
if ($canedit) {
echo "<tr class='tab_bg_2'>";
echo "<td colspan='6' class='center'>";
echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">";
echo "</td></tr>";
}
echo "</table></div>";
Html::closeForm();
//.........这里部分代码省略.........
示例2: showFormInventory
/**
* Print the config form for restrictions
*
* @return Nothing (display)
**/
function showFormInventory()
{
global $DB, $LANG, $CFG_GLPI;
if (!haveRight("config", "w")) {
return false;
}
echo "<form name='form' action=\"" . getItemTypeFormURL(__CLASS__) . "\" method='post'>";
echo "<div class='center' id='tabsbody'>";
echo "<input type='hidden' name='id' value='" . $CFG_GLPI["id"] . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . $LANG['Menu'][38] . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td> " . $LANG['setup'][133] . " :</td><td>";
Dropdown::showYesNo("use_ocs_mode", $CFG_GLPI["use_ocs_mode"]);
echo "</td><td> " . $LANG['setup'][271] . " :</td>";
echo "<td>";
$this->dropdownGlobalManagement("monitors_management_restrict", $CFG_GLPI["monitors_management_restrict"]);
echo "</td</tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][8] . " :</td><td>";
Dropdown::ShowYesNo('auto_create_infocoms', $CFG_GLPI["auto_create_infocoms"]);
echo "</td></td><td> " . $LANG['setup'][272] . " :</td><td>";
$this->dropdownGlobalManagement("peripherals_management_restrict", $CFG_GLPI["peripherals_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . $LANG['rulesengine'][86] . " :</td><td>";
Dropdown::show('SoftwareCategory', array('value' => $CFG_GLPI["softwarecategories_id_ondelete"], 'name' => "softwarecategories_id_ondelete"));
echo "</td><td> " . $LANG['setup'][273] . " :</td><td>";
$this->dropdownGlobalManagement("phones_management_restrict", $CFG_GLPI["phones_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][221] . " :</td><td>";
showDateFormItem("date_tax", $CFG_GLPI["date_tax"], false, true, '', '', false);
echo "</td><td> " . $LANG['setup'][275] . " :</td><td>";
$this->dropdownGlobalManagement("printers_management_restrict", $CFG_GLPI["printers_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][360] . " :</td><td>";
$tab = array(0 => $LANG['common'][59], 1 => $LANG['entity'][8]);
Dropdown::showFromArray('use_autoname_by_entity', $tab, array('value' => $CFG_GLPI["use_autoname_by_entity"]));
echo "</td></td>";
echo "<td colspan='2'> ";
echo "</td></tr>";
echo "</table>";
if (haveRight("transfer", "w") && isMultiEntitiesMode()) {
echo "<br><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . $LANG['setup'][290] . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][291] . " :</td><td>";
Dropdown::show('Transfer', array('value' => $CFG_GLPI["transfers_id_auto"], 'name' => "transfers_id_auto", 'emptylabel' => $LANG['setup'][292]));
echo "</td></td></tr>";
echo "</table>";
}
echo "<br><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='6'>" . $LANG['setup'][280] . " (" . $LANG['peripherals'][32] . ")</th></tr>";
echo "<tr><th> </th>";
echo "<th>" . $LANG['common'][18] . "</th>";
echo "<th>" . $LANG['common'][34] . "</th>";
echo "<th>" . $LANG['common'][35] . "</th>";
echo "<th>" . $LANG['common'][15] . "</th>";
echo "<th>" . $LANG['state'][0] . "</th>";
echo "</tr>";
$fields = array("contact", "group", "location", "user");
echo "<tr class='tab_bg_2'>";
echo "<td> " . $LANG['setup'][281] . " :</td>";
$values[0] = $LANG['setup'][285];
$values[1] = $LANG['setup'][283];
foreach ($fields as $field) {
echo "<td>";
$fieldname = "is_" . $field . "_autoupdate";
Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname]));
echo "</td>";
}
echo "<td>";
State::dropdownBehaviour("state_autoupdate_mode", $LANG['setup'][197], $CFG_GLPI["state_autoupdate_mode"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td> " . $LANG['setup'][282] . " :</td>";
$values[0] = $LANG['setup'][286];
$values[1] = $LANG['setup'][284];
foreach ($fields as $field) {
echo "<td>";
$fieldname = "is_" . $field . "_autoclean";
Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname]));
echo "</td>";
}
echo "<td>";
State::dropdownBehaviour("state_autoclean_mode", $LANG['setup'][196], $CFG_GLPI["state_autoclean_mode"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td colspan='6' class='center'>";
echo "<input type='submit' name='update' class='submit' value=\"" . $LANG['buttons'][2] . "\">";
echo "</td></tr>";
echo "</table></div>";
echo "</form>";
}