本文整理汇总了PHP中Dropdown::getGlobalSwitch方法的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown::getGlobalSwitch方法的具体用法?PHP Dropdown::getGlobalSwitch怎么用?PHP Dropdown::getGlobalSwitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dropdown
的用法示例。
在下文中一共展示了Dropdown::getGlobalSwitch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showCacheRuleDetail
function showCacheRuleDetail($fields)
{
global $LANG;
echo "<td class='tab_bg_2'>" . $fields["old_value"] . "</td>";
echo "<td class='tab_bg_2'>" . $fields["manufacturer"] . "</td>";
echo "<td class='tab_bg_2'>" . ($fields["new_value"] != '' ? $fields["new_value"] : $LANG['rulesengine'][106]) . "</td>";
echo "<td class='tab_bg_2'>" . ($fields["is_global"] != '' ? Dropdown::getGlobalSwitch($fields["is_global"]) : $LANG['rulesengine'][106]) . "</td>";
echo "<td class='tab_bg_2'>" . (isset($fields["new_manufacturer"]) && $fields["new_manufacturer"] != '' ? Dropdown::getDropdownName("glpi_manufacturers", $fields["new_manufacturer"]) : $LANG['rulesengine'][106]) . "</td>";
echo "<td class='tab_bg_2'>";
if ($fields["ignore_ocs_import"] == '') {
echo " ";
} else {
echo Dropdown::getYesNo($fields["ignore_ocs_import"]);
}
echo "</td>";
}
示例2: getActionValue
/**
* Return a "display" value associated with a pattern associated to a criteria
*
* @param $ID the given action
* @param $type the type of action
* @param $value the value
**/
function getActionValue($ID, $type, $value)
{
$action = $this->getAction($ID);
if (isset($action['type'])) {
switch ($action['type']) {
case "dropdown":
if ($type == 'fromuser' || $type == 'fromitem') {
return Dropdown::getYesNo($value);
}
// $type == assign
$tmp = Dropdown::getDropdownName($action["table"], $value);
return $tmp == ' ' ? NOT_AVAILABLE : $tmp;
case "dropdown_status":
return Ticket::getStatus($value);
case "dropdown_assign":
case "dropdown_users":
case "dropdown_users_validate":
return getUserName($value);
case "dropdown_groups_validate":
return Dropdown::getDropdownName('glpi_groups', $value);
case "dropdown_validation_percent":
return Dropdown::getValueWithUnit($value, '%');
case "yesonly":
case "yesno":
return Dropdown::getYesNo($value);
case "dropdown_urgency":
return Ticket::getUrgencyName($value);
case "dropdown_impact":
return Ticket::getImpactName($value);
case "dropdown_priority":
return Ticket::getPriorityName($value);
case "dropdown_tickettype":
return Ticket::getTicketTypeName($value);
case "dropdown_management":
return Dropdown::getGlobalSwitch($value);
default:
return $this->displayAdditionRuleActionValue($value);
}
}
return $value;
}
示例3: getActionValue
/**
* Return a value associated with a pattern associated to a criteria
*
* @param $ID the given action
* @param $value the value
**/
function getActionValue($ID, $value)
{
global $LANG;
$action = $this->getAction($ID);
if (isset($action['type'])) {
switch ($action['type']) {
case "dropdown":
return Dropdown::getDropdownName($action["table"], $value);
case "dropdown_status":
return Ticket::getStatus($value);
case "dropdown_assign":
case "dropdown_users":
case "dropdown_users_validate":
return getUserName($value);
case "yesonly":
case "yesno":
if ($value) {
return $LANG['choice'][1];
}
return $LANG['choice'][0];
case "dropdown_urgency":
return Ticket::getUrgencyName($value);
case "dropdown_impact":
return Ticket::getImpactName($value);
case "dropdown_priority":
return Ticket::getPriorityName($value);
case "dropdown_management":
return Dropdown::getGlobalSwitch($value);
default:
return $this->displayAdditionRuleActionValue($value);
}
}
return $value;
}