Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 131... Línea 131...
131
        if ($this->_options['optional']) {
131
        if ($this->_options['optional']) {
132
            $this->_elements[] = $this->createFormElement('checkbox', 'enabled', null,
132
            $this->_elements[] = $this->createFormElement('checkbox', 'enabled', null,
133
                get_string('enable'), $this->getAttributesForFormElement(), true);
133
                get_string('enable'), $this->getAttributesForFormElement(), true);
134
        }
134
        }
135
        foreach ($dateformat as $key => $value) {
135
        foreach ($dateformat as $key => $value) {
136
            // E_STRICT creating elements without forms is nasty because it internally uses $this
-
 
137
            $this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $value,
136
            $this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $value,
138
                $this->getAttributesForFormElement(), true);
137
                $this->getAttributesForFormElement(), true);
139
        }
138
        }
140
        // The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
139
        // The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
141
        if ($calendartype->get_name() === 'gregorian') {
140
        if ($calendartype->get_name() === 'gregorian') {
142
            $image = $OUTPUT->pix_icon('i/calendar', get_string('calendar', 'calendar'), 'moodle');
141
            $image = $OUTPUT->pix_icon('i/calendar', '');
143
            $this->_elements[] = $this->createFormElement('link', 'calendar',
142
            $this->_elements[] = $this->createFormElement(
-
 
143
                'button',
-
 
144
                'calendar',
-
 
145
                $image,
-
 
146
                [
144
                    null, '#', $image);
147
                    'type' => 'button',
-
 
148
                    'title' => get_string('datepicker', 'calendar'),
-
 
149
                    'aria-label' => get_string('datepicker', 'calendar'),
-
 
150
                ],
-
 
151
                [
-
 
152
                    'customclassoverride' => 'btn-link btn-sm icon-no-margin',
-
 
153
                ],
-
 
154
            );
145
        }
155
        }
146
        foreach ($this->_elements as $element){
156
        foreach ($this->_elements as $element){
147
            if (method_exists($element, 'setHiddenLabel')){
157
            if (method_exists($element, 'setHiddenLabel')){
148
                $element->setHiddenLabel(true);
158
                $element->setHiddenLabel(true);
149
            }
159
            }