|
@@ 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 |
|
@@ 1096-1105 (lines=10) @@
|
| 1093 |
|
* @param type $required Optional. Is the form-element required (default=true) |
| 1094 |
|
* @param type $attributes Optional. List of attributes for the form-element |
| 1095 |
|
*/ |
| 1096 |
|
public function addUrl($name, $label, $required = true, $attributes = array()) |
| 1097 |
|
{ |
| 1098 |
|
$this->addElement('url', $name, $label, $attributes); |
| 1099 |
|
$this->applyFilter($name, 'trim'); |
| 1100 |
|
$this->addRule($name, get_lang('InsertAValidUrl'), 'url'); |
| 1101 |
|
|
| 1102 |
|
if ($required) { |
| 1103 |
|
$this->addRule($name, get_lang('ThisFieldIsRequired'), 'required'); |
| 1104 |
|
} |
| 1105 |
|
} |
| 1106 |
|
|
| 1107 |
|
/** |
| 1108 |
|
* Adds a text field for letters to the form. |