getAttribute('formatResult'); $formatCondition = null; if (!empty($formatResult)) { $formatCondition = ', formatResult : '.$formatResult.', formatSelection : '.$formatResult.','; } $defaultValues = $this->getAttribute('defaults'); $dataCondition = null; $tags = null; if (!empty($defaultValues)) { $result = json_encode($defaultValues); $result = str_replace('"id"', 'id', $result); $result = str_replace('"text"', 'text', $result); $dataCondition = '$("#'.$this->getAttribute('name').'").select2("data", '.$result.')'; $tags = ', tags : function() { return '.$result.'} '; } $width = 'element'; $givenWidth = $this->getAttribute('width'); if (!empty($givenWidth)) { $width = $givenWidth; } //Get the minimumInputLength for select2 $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ? $this->getAttribute('minimumInputLength') : 3 ; $plHolder = $this->getAttribute('placeholder'); if (empty($plHolder)) { $plHolder = get_lang('SelectAnOption'); } $html .= ''; $html .= ''; return $html; } }