MDL-55123 forms: do not call non-static methods statically
this breaks in PHP7.1
This commit is contained in:
@@ -130,18 +130,18 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group {
|
||||
$dateformat = $calendartype->get_date_order($this->_options['startyear'], $this->_options['stopyear']);
|
||||
foreach ($dateformat as $key => $value) {
|
||||
// E_STRICT creating elements without forms is nasty because it internally uses $this
|
||||
$this->_elements[] = @MoodleQuickForm::createElement('select', $key, get_string($key, 'form'), $value, $this->getAttributes(), true);
|
||||
$this->_elements[] = $this->createFormElement('select', $key, get_string($key, 'form'), $value, $this->getAttributes(), true);
|
||||
}
|
||||
// The YUI2 calendar only supports the gregorian calendar type so only display the calendar image if this is being used.
|
||||
if ($calendartype->get_name() === 'gregorian') {
|
||||
$image = $OUTPUT->pix_icon('i/calendar', get_string('calendar', 'calendar'), 'moodle');
|
||||
$this->_elements[] = @MoodleQuickForm::createElement('link', 'calendar',
|
||||
$this->_elements[] = $this->createFormElement('link', 'calendar',
|
||||
null, '#', $image,
|
||||
array('class' => 'visibleifjs'));
|
||||
}
|
||||
// If optional we add a checkbox which the user can use to turn if on
|
||||
if ($this->_options['optional']) {
|
||||
$this->_elements[] = @MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
|
||||
$this->_elements[] = $this->createFormElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
|
||||
}
|
||||
foreach ($this->_elements as $element){
|
||||
if (method_exists($element, 'setHiddenLabel')){
|
||||
@@ -160,6 +160,7 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group {
|
||||
* @return bool
|
||||
*/
|
||||
function onQuickFormEvent($event, $arg, &$caller) {
|
||||
$this->setMoodleForm($caller);
|
||||
switch ($event) {
|
||||
case 'updateValue':
|
||||
// Constant values override both default and submitted ones
|
||||
|
||||
Reference in New Issue
Block a user