Code Duplication    Length = 23-23 lines in 2 locations

main/inc/lib/formvalidator/Element/DatePicker.php 1 location

@@ 33-55 (lines=23) @@
30
     *
31
     * @return string
32
    */
33
    public function toHtml()
34
    {
35
        if ($this->_flagFrozen) {
36
            return $this->getFrozenHtml();
37
        }
38
39
        $id = $this->getAttribute('id');
40
        $value = $this->getValue();
41
        $label = $this->getLabel();
42
43
        if (!empty($value)) {
44
            $value = api_format_date($value, DATE_TIME_FORMAT_LONG_24H);
45
        }
46
47
        return $this->getElementJS() . '
48
            <div class="input-group">
49
                <span class="input-group-addon">
50
                    <input ' . $this->_getAttrString($this->_attributes) . '>
51
                </span>
52
                <input class="form-control" type="text" readonly id="' . $id . '_alt" value="' . $value . '">
53
            </div>
54
        ';
55
    }
56
57
    /**
58
     * @param string $value

main/inc/lib/formvalidator/Element/DateTimePicker.php 1 location

@@ 27-49 (lines=23) @@
24
     * HTML code to display this datepicker
25
     * @return string
26
     */
27
    public function toHtml()
28
    {
29
        if ($this->_flagFrozen) {
30
            return $this->getFrozenHtml();
31
        }
32
33
        $id = $this->getAttribute('id');
34
        $value = $this->getValue();
35
        $label = $this->getLabel();
36
37
        if (!empty($value)) {
38
            $value = api_format_date($value, DATE_TIME_FORMAT_LONG_24H);
39
        }
40
41
        return $this->getElementJS() . '
42
            <div class="input-group">
43
                <span class="input-group-addon">
44
                    <input ' . $this->_getAttrString($this->_attributes) . '>
45
                </span>
46
                <input class="form-control" type="text" readonly id="' . $id . '_alt" value="' . $value . '">
47
            </div>
48
        ';
49
    }
50
51
    /**
52
     * @param string $value