Code Duplication    Length = 10-10 lines in 2 locations

main/inc/lib/formvalidator/FormValidator.class.php 2 locations

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