dropdownState() 정적인 공개 메소드

Dropdown of state
static public dropdownState ( $name, $value, $display = true ) : nothing
$name select name
$value default value (default 0)
$display display or get string (true by default)
리턴 nothing (display)
예제 #1
0
 /**
  * @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'] = 0;
     switch ($field) {
         case 'mode':
             $options['value'] = $values[$field];
             $tab[self::MODE_INTERNAL] = self::getModeName(self::MODE_INTERNAL);
             $tab[self::MODE_EXTERNAL] = self::getModeName(self::MODE_EXTERNAL);
             return Dropdown::showFromArray($name, $tab, $options);
         case 'state':
             return CronTask::dropdownState($name, $values[$field], false);
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
예제 #2
0
         $display = true;
         break;
     case "glpi_users.name":
         User::dropdown(array('name' => $inputname, 'value' => $_REQUEST['value'], 'comments' => false, 'right' => isset($searchopt['filter']) ? $searchopt['filter'] : 'all'));
         $display = true;
         break;
     case "glpi_ticketvalidations.status":
         TicketValidation::dropdownStatus($inputname, array('value' => $_REQUEST['value'], 'all' => 1));
         $display = true;
         break;
     case "glpi_ticketsatisfactions.type":
         Dropdown::showFromArray($inputname, array(1 => $LANG['satisfaction'][9], 2 => $LANG['satisfaction'][10]), array('value' => $_REQUEST['value']));
         $display = true;
         break;
     case "glpi_crontasks.state":
         CronTask::dropdownState($inputname, $_REQUEST['value']);
         $display = true;
         break;
 }
 // Standard datatype usage
 if (!$display && isset($searchopt['datatype'])) {
     switch ($searchopt['datatype']) {
         case "bool":
             Dropdown::showYesNo($inputname, $_REQUEST['value']);
             $display = true;
             break;
         case "right":
             // No access not displayed because empty not take into account for search
             Profile::dropdownNoneReadWrite($inputname, $_REQUEST['value'], 1, 1, 1);
             $display = true;
             break;