| @@ 143-170 (lines=28) @@ | ||
| 140 | /** |
|
| 141 | * {@inheritdoc} |
|
| 142 | */ |
|
| 143 | public function Field($properties = array()) |
|
| 144 | { |
|
| 145 | Requirements::css(TAG_FIELD_DIR . '/css/select2.min.css'); |
|
| 146 | Requirements::css(TAG_FIELD_DIR . '/css/TagField.css'); |
|
| 147 | ||
| 148 | Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); |
|
| 149 | Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js'); |
|
| 150 | Requirements::javascript(TAG_FIELD_DIR . '/js/select2.js'); |
|
| 151 | Requirements::javascript(TAG_FIELD_DIR . '/js/TagField.js'); |
|
| 152 | ||
| 153 | $this->addExtraClass('ss-tag-field'); |
|
| 154 | ||
| 155 | if ($this->getIsMultiple()) { |
|
| 156 | $this->setAttribute('multiple', 'multiple'); |
|
| 157 | } |
|
| 158 | ||
| 159 | if ($this->getShouldLazyLoad()) { |
|
| 160 | $this->setAttribute('data-ss-tag-field-suggest-url', $this->getSuggestURL()); |
|
| 161 | } else { |
|
| 162 | $properties = array_merge($properties, array( |
|
| 163 | 'Options' => $this->getOptions() |
|
| 164 | )); |
|
| 165 | } |
|
| 166 | ||
| 167 | return $this |
|
| 168 | ->customise($properties) |
|
| 169 | ->renderWith(array("templates/TagField")); |
|
| 170 | } |
|
| 171 | ||
| 172 | /** |
|
| 173 | * @return string |
|
| @@ 157-184 (lines=28) @@ | ||
| 154 | /** |
|
| 155 | * {@inheritdoc} |
|
| 156 | */ |
|
| 157 | public function Field($properties = array()) |
|
| 158 | { |
|
| 159 | Requirements::css(TAG_FIELD_DIR . '/css/select2.min.css'); |
|
| 160 | Requirements::css(TAG_FIELD_DIR . '/css/TagField.css'); |
|
| 161 | ||
| 162 | Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); |
|
| 163 | Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js'); |
|
| 164 | Requirements::javascript(TAG_FIELD_DIR . '/js/select2.js'); |
|
| 165 | Requirements::javascript(TAG_FIELD_DIR . '/js/TagField.js'); |
|
| 166 | ||
| 167 | $this->addExtraClass('ss-tag-field'); |
|
| 168 | ||
| 169 | if ($this->getIsMultiple()) { |
|
| 170 | $this->setAttribute('multiple', 'multiple'); |
|
| 171 | } |
|
| 172 | ||
| 173 | if ($this->shouldLazyLoad) { |
|
| 174 | $this->setAttribute('data-ss-tag-field-suggest-url', $this->getSuggestURL()); |
|
| 175 | } else { |
|
| 176 | $properties = array_merge($properties, array( |
|
| 177 | 'Options' => $this->getOptions() |
|
| 178 | )); |
|
| 179 | } |
|
| 180 | ||
| 181 | return $this |
|
| 182 | ->customise($properties) |
|
| 183 | ->renderWith(array("templates/TagField")); |
|
| 184 | } |
|
| 185 | ||
| 186 | /** |
|
| 187 | * @return string |
|