@@ 200-209 (lines=10) @@ | ||
197 | * @param bool $required |
|
198 | * @param array $attributes |
|
199 | */ |
|
200 | public function addDateRangePicker($name, $label, $required = true, $attributes = array()) |
|
201 | { |
|
202 | $this->addElement('date_range_picker', $name, $label, $attributes); |
|
203 | $this->addElement('hidden', $name.'_start'); |
|
204 | $this->addElement('hidden', $name.'_end'); |
|
205 | ||
206 | if ($required) { |
|
207 | $this->addRule($name, get_lang('ThisFieldIsRequired'), 'required'); |
|
208 | } |
|
209 | } |
|
210 | ||
211 | /** |
|
212 | * @param string $name |
|
@@ 1238-1247 (lines=10) @@ | ||
1235 | * @param type $required Optional. Is the form-element required (default=true) |
|
1236 | * @param type $attributes Optional. List of attributes for the form-element |
|
1237 | */ |
|
1238 | public function addUrl($name, $label, $required = true, $attributes = array()) |
|
1239 | { |
|
1240 | $this->addElement('url', $name, $label, $attributes); |
|
1241 | $this->applyFilter($name, 'trim'); |
|
1242 | $this->addRule($name, get_lang('InsertAValidUrl'), 'url'); |
|
1243 | ||
1244 | if ($required) { |
|
1245 | $this->addRule($name, get_lang('ThisFieldIsRequired'), 'required'); |
|
1246 | } |
|
1247 | } |
|
1248 | ||
1249 | /** |
|
1250 | * Adds a text field for letters to the form. |