48 return $this->form->dropDownList(
49 $this->model->{$this->attribute},
51 $this->getDropDownArray(),
52 $this->getEditableHtmlOptions()
56 protected function resolveIdForLabel()
58 return $this->getIdForSelectInput();
69 $dropDownModel = $this->model->{$this->attribute};
70 $dropDownArray = $this->getDropDownArray();
74 protected function convertDropDownModelsToArrayByIdName($dropDownModels)
77 if (!empty($dropDownModels))
79 foreach ($dropDownModels as $dropDownModel)
81 $array[$dropDownModel->id] = $dropDownModel;
87 protected function getAddBlank()
99 public function getIdForSelectInput()
101 return $this->getEditableInputId($this->attribute,
'value');
104 protected function getNameForSelectInput()
106 return $this->getEditableInputName($this->attribute,
'value');
109 public function getEditableNameIds()
112 $this->getIdForSelectInput(),
116 protected function getEditableHtmlOptions()
118 $htmlOptions = array(
119 'name' => $this->getNameForSelectInput(),
120 'id' => $this->getIdForSelectInput(),
122 if ($this->getAddBlank())
124 $htmlOptions[
'empty'] = Zurmo::t(
'Core',
'(None)');
126 $htmlOptions[
'disabled'] = $this->getDisabledValue();
130 protected function getDropDownArray()
132 $dropDownModel = $this->model->{$this->attribute};
135 return $dataAndLabels;
144 return $this->form->error($this->model, $this->attribute,
145 array(
'inputID' => $this->getEditableInputId($this->attribute,
'value')));
static getDataIndexedByDataAndTranslatedLabelsByLanguage(CustomFieldData $customFieldData, $language)
renderControlNonEditable()
static getArrayValue($array, $element, $defaultValue=null)