當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonDBChild::getSpecificValueToSelect方法代碼示例

本文整理匯總了PHP中CommonDBChild::getSpecificValueToSelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDBChild::getSpecificValueToSelect方法的具體用法?PHP CommonDBChild::getSpecificValueToSelect怎麽用?PHP CommonDBChild::getSpecificValueToSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonDBChild的用法示例。


在下文中一共展示了CommonDBChild::getSpecificValueToSelect方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getSpecificValueToSelect

 /**
  * Define how to display search field for a specific type
  *
  * @since version 0.84
  *
  * @param String $field           Name of the field as define in $this->getSearchOptions()
  * @param String $name            Name attribute for the field to be posted (default '')
  * @param Array  $values          Array of all values to display in search engine (default '')
  * @param Array  $options         Options (optional)
  *
  * @return String                 Html string to be displayed for the form field
  **/
 public static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
 {
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     $options['display'] = false;
     switch ($field) {
         case 'status':
             $output = '<select name="' . $name . '">';
             $output .= '<option value="waiting" ' . ($values[$field] == 'waiting' ? ' selected ' : '') . '>' . __('waiting', 'formcreator') . '</option>';
             $output .= '<option value="accepted" ' . ($values[$field] == 'accepted' ? ' selected ' : '') . '>' . __('accepted', 'formcreator') . '</option>';
             $output .= '<option value="refused" ' . ($values[$field] == 'refused' ? ' selected ' : '') . '>' . __('refused', 'formcreator') . '</option>';
             $output .= '</select>';
             return $output;
             break;
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
開發者ID:jcr0ch4,項目名稱:formcreator,代碼行數:30,代碼來源:formanswer.class.php

示例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 'status':
             $options['value'] = $values[$field];
             return self::dropdownStatus($name, $options);
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
開發者ID:gaforeror,項目名稱:glpi,代碼行數:21,代碼來源:ticketvalidation.class.php

示例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 'criteria':
             $generic_rule = new Rule();
             if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) {
                 if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) {
                     $options['value'] = $values[$field];
                     $options['name'] = $name;
                     return $rule->dropdownCriteria($options);
                 }
             }
             break;
         case 'condition':
             $generic_rule = new Rule();
             if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) {
                 if (isset($values['criteria']) && !empty($values['criteria'])) {
                     $options['criterion'] = $values['criteria'];
                 }
                 $options['value'] = $values[$field];
                 $options['name'] = $name;
                 return $rule->dropdownConditions($generic_rule->fields["sub_type"], $options);
             }
             break;
         case 'pattern':
             if (!isset($values["criteria"]) || !isset($values["condition"])) {
                 return NOT_AVAILABLE;
             }
             $generic_rule = new Rule();
             if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) {
                 if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) {
                     /// TODO : manage display param to this function : need to send ot to all under functions
                     $rule->displayCriteriaSelectPattern($name, $values["criteria"], $values["condition"], $values[$field]);
                 }
             }
             break;
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
開發者ID:korial29,項目名稱:glpi,代碼行數:52,代碼來源:rulecriteria.class.php

示例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 "sink_type":
             return self::dropdownAmortType($name, $values[$field], false);
         case "alert":
             $options['name'] = $name;
             $options['value'] = $values[$field];
             return self::dropdownAlert($options);
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
開發者ID:gaforeror,項目名稱:glpi,代碼行數:24,代碼來源:infocom.class.php

示例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())
 {
     global $DB;
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     $options['display'] = false;
     switch ($field) {
         case 'field':
             $generic_rule = new Rule();
             if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) {
                 if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) {
                     $options['value'] = $values[$field];
                     $options['name'] = $name;
                     return $rule->dropdownActions($options);
                 }
             }
             break;
         case 'action_type':
             $generic_rule = new Rule();
             if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) {
                 return self::dropdownActions(array('subtype' => $generic_rule->fields["sub_type"], 'name' => $name, 'value' => $values[$field], 'alreadyused' => false, 'display' => false));
             }
             break;
         case 'pattern':
             if (!isset($values["field"]) || !isset($values["action_type"])) {
                 return NOT_AVAILABLE;
             }
             $generic_rule = new Rule();
             if (isset($values['rules_id']) && !empty($values['rules_id']) && $generic_rule->getFromDB($values['rules_id'])) {
                 if ($rule = getItemForItemtype($generic_rule->fields["sub_type"])) {
                     /// TODO review it : need to pass display param and others...
                     return $this->displayActionSelectPattern($values);
                 }
             }
             break;
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
開發者ID:stweil,項目名稱:glpi,代碼行數:47,代碼來源:ruleaction.class.php


注:本文中的CommonDBChild::getSpecificValueToSelect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。