本文整理匯總了PHP中CommonDropdown::getSpecificValueToSelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDropdown::getSpecificValueToSelect方法的具體用法?PHP CommonDropdown::getSpecificValueToSelect怎麽用?PHP CommonDropdown::getSpecificValueToSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonDropdown
的用法示例。
在下文中一共展示了CommonDropdown::getSpecificValueToSelect方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
$options['value'] = $values[$field];
switch ($field) {
case 'type_menu':
$tab = array('' => Dropdown::EMPTY_VALUE);
$menus = Html::getMenuInfos();
foreach ($menus as $key => $value) {
if ($key != 'plugins' && $key != 'preference') {
$tab[$key] = $menus[$key]['title'];
}
}
return Dropdown::showFromArray($name, $tab, $options);
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例2: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'field':
if (isset($values['itemtype']) && !empty($values['itemtype'])) {
$options['value'] = $values[$field];
$options['name'] = $name;
return self::dropdownField($values['itemtype'], $options);
}
break;
case 'value':
if (isset($values['itemtype']) && !empty($values['itemtype'])) {
if ($item = getItemForItemtype($values['itemtype'])) {
if (isset($values['field']) && !empty($values['field'])) {
$searchOption = $item->getSearchOptionByField('field', $values['field']);
return $item->getValueToSelect($searchOption, $name, $values[$field], $options);
}
}
}
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例3: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
global $DB;
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'fields':
if (isset($values['itemtype']) && !empty($values['itemtype'])) {
$options['values'] = explode(',', $values[$field]);
$options['name'] = $name;
return self::dropdownFields($values['itemtype'], $options);
}
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例4: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'type':
$options['value'] = $values[$field];
return self::dropdownType($name, $options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例5: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'icon':
return Dropdown::dropdownIcons($name, $values[$field], GLPI_ROOT . "/pics/icones", false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}