global $CFG;
$this->block = $block;
$this->page = $page;
- parent::moodleform($actionurl);
+ parent::__construct($actionurl);
}
function definition() {
function __construct($actionurl, $isadding, $caneditshared) {
$this->isadding = $isadding;
$this->caneditshared = $caneditshared;
- parent::moodleform($actionurl);
+ parent::__construct($actionurl);
}
function definition() {
/** @var object The course format of the current course. */
protected $courseformat;
- function moodleform_mod($current, $section, $cm, $course) {
+ public function __construct($current, $section, $cm, $course) {
global $CFG;
$this->current = $current;
}
$this->_modname = $matches[1];
$this->init_features();
- parent::moodleform('modedit.php');
+ parent::__construct('modedit.php');
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function moodleform_mod($current, $section, $cm, $course) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($current, $section, $cm, $course);
}
protected function init_features() {
public function __construct($submiturl, $filter, $context) {
$this->filter = $filter;
$this->context = $context;
- parent::moodleform($submiturl);
+ parent::__construct($submiturl);
}
/**
* @param string $elementlabel
* @param array $attributes
*/
+ public function __construct($elementname=null, $elementlabel=null, $attributes=null) {
+ parent::__construct($elementname, $elementlabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
public function moodlequickform_guideeditor($elementname=null, $elementlabel=null, $attributes=null) {
- parent::HTML_QuickForm_input($elementname, $elementlabel, $attributes);
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementname, $elementlabel, $attributes);
}
/**
* @param string $elementLabel
* @param array $attributes
*/
- function MoodleQuickForm_rubriceditor($elementName=null, $elementLabel=null, $attributes=null) {
- parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_rubriceditor($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
}
/**
* or an associative array
* @param mixed $values (optional) Values to pass if checked or not checked
*/
- function MoodleQuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
+ public function __construct($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
{
if ($values === null){
$values = array(0, 1);
}
}
- parent::HTML_QuickForm_advcheckbox($elementName, $elementLabel, $text, $attributes, $values);
+ parent::__construct($elementName, $elementLabel, $text, $attributes, $values);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text, $attributes, $values);
}
/**
* @param mixed $attributes Either a typical HTML attribute string or an associative array. Special options
* "tags", "placeholder", "ajax", "multiple", "casesensitive" are supported.
*/
- function MoodleQuickForm_autocomplete($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
// Even if the constructor gets called twice we do not really want 2x options (crazy forms!).
$this->_options = array();
if ($attributes === null) {
$this->casesensitive = $attributes['casesensitive'] ? true : false;
unset($attributes['casesensitive']);
}
- parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes);
+ parent::__construct($elementName, $elementLabel, $options, $attributes);
$this->_type = 'autocomplete';
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_autocomplete($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
/**
* Returns HTML for select form element.
*
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_button($elementName=null, $value=null, $attributes=null) {
- parent::HTML_QuickForm_button($elementName, $value, $attributes);
+ public function __construct($elementName=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, $value, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_button($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
}
/**
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_cancel($elementName=null, $value=null, $attributes=null)
+ public function __construct($elementName=null, $value=null, $attributes=null)
{
if ($elementName==null){
$elementName='cancel';
if ($value==null){
$value=get_string('cancel');
}
- MoodleQuickForm_submit::MoodleQuickForm_submit($elementName, $value, $attributes);
+ parent::__construct($elementName, $value, $attributes);
$this->updateAttributes(array('onclick'=>'skipClientValidation = true; return true;'));
// Add the class btn-cancel.
$this->updateAttributes(array('class' => $class . ' btn-cancel'));
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_cancel($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
+ }
+
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
{
switch ($event) {
case 'createElement':
- $className = get_class($this);
- $this->$className($arg[0], $arg[1], $arg[2]);
+ static::__construct($arg[0], $arg[1], $arg[2]);
$caller->_registerCancelButton($this->getName());
return true;
break;
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_checkbox($elementName=null, $elementLabel=null, $text='', $attributes=null) {
- parent::HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $text='', $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $text, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_checkbox($elementName=null, $elementLabel=null, $text='', $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text, $attributes);
}
/**
* @param array $options Options to control the element's display
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_date_selector($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
// Get the calendar type used - see MDL-18375.
$calendartype = \core_calendar\type_factory::get_calendar_instance();
$this->_options = array('startyear' => $calendartype->get_min_year(), 'stopyear' => $calendartype->get_max_year(),
'defaulttime' => 0, 'timezone' => 99, 'step' => 5, 'optional' => false);
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date_selector';
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_date_selector($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
/**
* This will create date group element constisting of day, month and year.
*
* @param array $options Options to control the element's display
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_date_time_selector($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
// Get the calendar type used - see MDL-18375.
$calendartype = \core_calendar\type_factory::get_calendar_instance();
$this->_options = array('startyear' => $calendartype->get_min_year(), 'stopyear' => $calendartype->get_max_year(),
'defaulttime' => 0, 'timezone' => 99, 'step' => 5, 'optional' => false);
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date_time_selector';
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_date_time_selector($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
/**
* This will create date group element constisting of day, month and year.
*
* If not specified, minutes is used.
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_duration($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'duration';
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_duration($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
/**
* Returns time associative array of unit length.
*
* or an associative array
* @param array $options set of options to initalize filepicker
*/
- function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
global $CFG, $PAGE;
$options = (array)$options;
}
}
$this->_options['trusted'] = trusttext_trusted($this->_options['context']);
- parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
// Note: for some reason the code using this setting does not like bools.
$this->_options['subdirs'] = (int)($this->_options['subdirs'] == 1);
editors_head_setup();
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
+ }
+
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* or an associative array
* @param array $options set of options to initalize filemanager
*/
- function MoodleQuickForm_filemanager($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
global $CFG, $PAGE;
$options = (array)$options;
$this->_options['return_types'] = (FILE_INTERNAL | FILE_REFERENCE);
}
$this->_type = 'filemanager';
- parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_filemanager($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
}
/**
* or an associative array
* @param array $options set of options to initalize filepicker
*/
- function MoodleQuickForm_filepicker($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
global $CFG, $PAGE;
$options = (array)$options;
}
$this->_options['maxbytes'] = get_user_max_upload_file_size($PAGE->context, $CFG->maxbytes, $coursemaxbytes, $fpmaxbytes);
$this->_type = 'filepicker';
- parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_filepicker($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
}
/**
* @param mixed $elementLabel Label(s) for the input field
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- public function MoodleQuickForm_grading($elementName=null, $elementLabel=null, $attributes=null) {
- parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->gradingattributes = $attributes;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_grading($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
+
/**
* Helper function to retrieve gradingform_instance passed in element attributes
*
* @param string $separator (optional) string to seperate elements.
* @param string $appendName (optional) string to appened to grouped elements.
*/
- function MoodleQuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) {
- parent::HTML_QuickForm_group($elementName, $elementLabel, $elements, $separator, $appendName);
+ public function __construct($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) {
+ parent::__construct($elementName, $elementLabel, $elements, $separator, $appendName);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $elements, $separator, $appendName);
}
/** @var string template type, would cause problems with client side validation so will leave for now */
* @param string $elementName name of the header element
* @param string $text text displayed in header element
*/
- function MoodleQuickForm_header($elementName = null, $text = null) {
- parent::HTML_QuickForm_header($elementName, $text);
+ public function __construct($elementName = null, $text = null) {
+ parent::__construct($elementName, $text);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_header($elementName = null, $text = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $text);
}
/**
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_hidden($elementName=null, $value='', $attributes=null) {
- parent::HTML_QuickForm_hidden($elementName, $value, $attributes);
+ public function __construct($elementName=null, $value='', $attributes=null) {
+ parent::__construct($elementName, $value, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_hidden($elementName=null, $value='', $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ return self::__construct($elementName, $value, $attributes);
}
/**
* @param array $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_htmleditor($elementName=null, $elementLabel=null, $options=array(), $attributes=null){
- parent::MoodleQuickForm_textarea($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $options=array(), $attributes=null){
+ parent::__construct($elementName, $elementLabel, $attributes);
// set the options, do not bother setting bogus ones
if (is_array($options)) {
foreach ($options as $name => $value) {
editors_head_setup();
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_htmleditor($elementName=null, $elementLabel=null, $options=array(), $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
/**
* Returns the input field in HTML
*
* @param array $attributes (optional) Either a typical HTML attribute string or an associative array.
* @param array $options set of options to initalize listing.
*/
- function MoodleQuickForm_listing($elementName=null, $elementLabel=null, $attributes=null, $options=array()) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=array()) {
$this->_type = 'listing';
if (!empty($options['items'])) {
} else {
$this->hideall = get_string('hide');
}
- parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_listing($elementName=null, $elementLabel=null, $attributes=null, $options=array()) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
}
/**
* @param array $options Options to control the element's display. Not used.
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- public function MoodleQuickForm_modgrade($elementname = null, $elementlabel = null, $options = array(), $attributes = null) {
- $this->HTML_QuickForm_element($elementname, $elementlabel, $attributes);
+ public function __construct($elementname = null, $elementlabel = null, $options = array(), $attributes = null) {
+ HTML_QuickForm_element::__construct($elementname, $elementlabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'modgrade';
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_modgrade($elementname = null, $elementlabel = null, $options = array(), $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementname, $elementlabel, $options, $attributes);
+ }
+
/**
* Create elements for this group.
*/
* @param mixed $attributes Either a typical HTML attribute string or an associative array
* @param array $options ignored
*/
- function MoodleQuickForm_modvisible($elementName=null, $elementLabel=null, $attributes=null, $options=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes, null);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes, null);
$this->_type = 'modvisible';
+ }
-
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_modvisible($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
}
/**
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attributes=null) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
global $CFG;
// no standard mform in moodle should allow autocomplete of passwords
if (empty($attributes)) {
}
}
- parent::HTML_QuickForm_password($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
}
/**
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
global $CFG;
// no standard mform in moodle should allow autocomplete of passwords
if (empty($attributes)) {
}
}
- parent::MoodleQuickForm_password($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
}
/**
* from moodlelib.php.
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_questioncategory($elementName = null, $elementLabel = null, $options = null, $attributes = null) {
- MoodleQuickForm_selectgroups::MoodleQuickForm_selectgroups($elementName, $elementLabel, array(), $attributes);
+ public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null) {
+ parent::__construct($elementName, $elementLabel, array(), $attributes);
$this->_type = 'questioncategory';
if (is_array($options)) {
$this->_options = $options + $this->_options;
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_questioncategory($elementName = null, $elementLabel = null, $options = null, $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
}
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) {
- parent::HTML_QuickForm_radio($elementName, $elementLabel, $text, $value, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $text, $value, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text, $value, $attributes);
}
/**
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
*/
- function MoodleQuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) {
+ public function __construct($elementName = null, $elementLabel = null, $attributes = null) {
global $CFG;
- parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_type = 'recaptcha';
if (is_https()) {
$this->_https = true;
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_recaptcha($elementName = null, $elementLabel = null, $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
+
/**
* Returns the recaptcha element in HTML
*
* @param array $options additional options.
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_searchableselector($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
//set size default to 12
if (empty($attributes) || empty($attributes['size'])) {
$attributes['size'] = 12;
}
- parent::MoodleQuickForm_select($elementName, $elementLabel, $options, $attributes);
+ parent::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_searchableselector($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
}
/**
* @param mixed $options Data to be used to populate options
* @param mixed $attributes Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
- parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
}
/**
* @param mixed $attributes Either a typical HTML attribute string or an associative array
* @param bool $showchoose add standard moodle "Choose..." option as first item
*/
- function MoodleQuickForm_selectgroups($elementName=null, $elementLabel=null, $optgrps=null, $attributes=null, $showchoose=false)
+ public function __construct($elementName=null, $elementLabel=null, $optgrps=null, $attributes=null, $showchoose=false)
{
$this->showchoose = $showchoose;
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'selectgroups';
if (isset($optgrps)) {
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_selectgroups($elementName=null, $elementLabel=null, $optgrps=null, $attributes=null, $showchoose=false) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $optgrps, $attributes, $showchoose);
+ }
+
/**
* Sets the default values of the select box
*
* @param mixed $attributes Either a typical HTML attribute string or an associative array
* @param bool $linkdata data to be posted
*/
- function MoodleQuickForm_selectwithlink($elementName=null, $elementLabel=null, $options=null, $attributes=null, $linkdata=null)
- {
+ public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null, $linkdata=null) {
if (!empty($linkdata['link']) && !empty($linkdata['label'])) {
$this->_link = $linkdata['link'];
$this->_linklabel = $linkdata['label'];
$this->_linkreturn = $linkdata['return'];
}
- parent::HTML_QuickForm_select($elementName, $elementLabel, $options, $attributes);
+ parent::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_selectwithlink($elementName=null, $elementLabel=null, $options=null, $attributes=null, $linkdata=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes, $linkdata);
}
/**
* @param mixed $attributes Either a typical HTML attribute string or an associative array
* @param mixed $options ignored, not used.
*/
- function MoodleQuickForm_selectyesno($elementName=null, $elementLabel=null, $attributes=null, $options=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes, null);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes, null);
$this->_type = 'selectyesno';
$this->_persistantFreeze = true;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_selectyesno($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
+ }
+
/**
* Called by HTML_QuickForm whenever form event is made on this element
*
* @param string $elementLabel (optional) text field label
* @param string $text (optional) Text to put in text field
*/
- function MoodleQuickForm_static($elementName=null, $elementLabel=null, $text=null) {
- parent::HTML_QuickForm_static($elementName, $elementLabel, $text);
+ public function __construct($elementName=null, $elementLabel=null, $text=null) {
+ parent::__construct($elementName, $elementLabel, $text);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_static($elementName=null, $elementLabel=null, $text=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text);
}
/**
* @param string $value (optional) field label
* @param string $attributes (optional) Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null) {
- parent::HTML_QuickForm_submit($elementName, $value, $attributes);
+ public function __construct($elementName=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, $value, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
}
/**
* @param string $value (optional) field label
* @param string $attributes (optional) Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_submitlink($elementName=null, $value=null, $attributes=null) {
- parent::MoodleQuickForm_submit($elementName, $value, $attributes);
+ public function __construct($elementName=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, $value, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_submitlink($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
}
/**
* @param array $options Options to control the element's display
* @param mixed $attributes Either a typical HTML attribute string or an associative array.
*/
- function MoodleQuickForm_tags($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
if (!isset($options['display'])) {
$options['display'] = self::DEFAULTUI;
}
$attributes['placeholder'] = get_string('entertags', 'tag');
$attributes['showsuggestions'] = $this->showingofficial;
- parent::MoodleQuickForm_autocomplete($elementName, $elementLabel, $validoptions, $attributes);
+ parent::__construct($elementName, $elementLabel, $validoptions, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_tags($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
}
/**
* @param string $elementLabel (optional) text field label
* @param string $attributes (optional) Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_text($elementName=null, $elementLabel=null, $attributes=null) {
- parent::HTML_QuickForm_text($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_text($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
}
/**
* @param string $elementLabel (optional) text field label
* @param string $attributes (optional) Either a typical HTML attribute string or an associative array
*/
- function MoodleQuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null) {
- parent::HTML_QuickForm_textarea($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
}
/**
* @param mixed $attributes Either a typical HTML attribute string or an associative array.
* @param array $options data which need to be posted.
*/
- function MoodleQuickForm_url($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
global $CFG;
require_once("$CFG->dirroot/repository/lib.php");
$options = (array)$options;
if (!isset($this->_options['usefilepicker'])) {
$this->_options['usefilepicker'] = true;
}
- parent::HTML_QuickForm_text($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_url($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $options);
}
/**
* @param string $elementClass (optional) show as warning or notification => 'notifyproblem'
* @param string $text (optional) Text to put in warning field
*/
- function MoodleQuickForm_warning($elementName=null, $elementClass='notifyproblem', $text=null) {
- parent::HTML_QuickForm_static($elementName, null, $text);
+ public function __construct($elementName=null, $elementClass='notifyproblem', $text=null) {
+ parent::__construct($elementName, null, $text);
$this->_type = 'warning';
if (is_null($elementClass)) {
$elementClass = 'notifyproblem';
$this->_class = $elementClass;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_warning($elementName=null, $elementClass='notifyproblem', $text=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementClass, $text);
+ }
+
/**
* Returns HTML for this form element.
*
* @param mixed $attributes you can pass a string of html attributes here or an array.
* @param bool $editable
*/
- function moodleform($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true) {
+ public function __construct($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true) {
global $CFG, $FULLME;
// no standard mform in moodle should allow autocomplete with the exception of user signup
if (empty($attributes)) {
$this->_process_submission($method);
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function moodleform($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($action, $customdata, $method, $target, $attributes, $editable);
+ }
+
/**
* It should returns unique identifier for the form.
* Currently it will return class name, but in case two same forms have to be
* @param string $target (optional)Form's target defaults to none
* @param mixed $attributes (optional)Extra attributes for <form> tag
*/
- function MoodleQuickForm($formName, $method, $action, $target='', $attributes=null){
+ public function __construct($formName, $method, $action, $target='', $attributes=null) {
global $CFG, $OUTPUT;
static $formcounter = 1;
- HTML_Common::HTML_Common($attributes);
+ HTML_Common::__construct($attributes);
$target = empty($target) ? array() : array('target' => $target);
$this->_formName = $formName;
if (is_a($action, 'moodle_url')){
$this->setRequiredNote(get_string('somefieldsrequired', 'form', '<img alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->pix_url('req') .'" />'));
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm($formName, $method, $action, $target='', $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($formName, $method, $action, $target, $attributes);
+ }
+
/**
* Use this method to indicate an element in a form is an advanced field. If items in a form
* are marked as advanced then 'Hide/Show Advanced' buttons will automatically be displayed in the
/**
* Constructor
*/
- function MoodleQuickForm_Renderer(){
+ public function __construct() {
// switch next two lines for ol li containers for form items.
// $this->_elementTemplates=array('default'=>"\n\t\t".'<li class="fitem"><label>{label}{help}<!-- BEGIN required -->{req}<!-- END required --></label><div class="qfelement<!-- BEGIN error --> error<!-- END error --> {type}"><!-- BEGIN error --><span class="error">{error}</span><br /><!-- END error -->{element}</div></li>');
$this->_elementTemplates = array(
'nodisplay'=>'');
- parent::HTML_QuickForm_Renderer_Tableless();
+ parent::__construct();
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_Renderer() {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct();
}
/**
* @param int $tabOffset Indent offset in tabs
* @access public
*/
- function HTML_Common($attributes = null, $tabOffset = 0)
+ public function __construct($attributes = null, $tabOffset = 0)
{
$this->setAttributes($attributes);
$this->setTabOffset($tabOffset);
} // end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_Common($attributes = null, $tabOffset = 0) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($attributes, $tabOffset);
+ }
+
public static function raiseError($message = null,
$code = null,
$mode = null,
* @param bool $trackSubmit (optional)Whether to track if the form was submitted by adding a special hidden field
* @access public
*/
- function HTML_QuickForm($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)
+ public function __construct($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false)
{
- HTML_Common::HTML_Common($attributes);
+ parent::__construct($attributes);
$method = (strtoupper($method) == 'GET') ? 'get' : 'post';
$action = ($action == '') ? $_SERVER['PHP_SELF'] : $action;
$target = empty($target) ? array() : array('target' => $target);
}
} // end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm($formName='', $method='post', $action='', $target='', $attributes=null, $trackSubmit = false) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($formName, $method, $action, $target, $attributes, $trackSubmit);
+ }
+
// }}}
// {{{ apiVersion()
* @param int $level intensity of the error (PHP error code)
* @param mixed $debuginfo any information that can inform user as to nature of the error
*/
- function HTML_QuickForm_Error($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN,
+ public function __construct($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN,
$level = E_USER_NOTICE, $debuginfo = null)
{
if (is_int($code)) {
- $this->PEAR_Error(HTML_QuickForm::errorMessage($code), $code, $mode, $level, $debuginfo);
+ parent::__construct(HTML_QuickForm::errorMessage($code), $code, $mode, $level, $debuginfo);
} else {
- $this->PEAR_Error("Invalid error code: $code", QUICKFORM_ERROR, $mode, $level, $debuginfo);
+ parent::__construct("Invalid error code: $code", QUICKFORM_ERROR, $mode, $level, $debuginfo);
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_Error($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN,
+ $level = E_USER_NOTICE, $debuginfo = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($code, $mode, $level, $debuginfo);
+ }
+
// }}}
} // end class HTML_QuickForm_Error
?>
*
* @access public
*/
- function HTML_QuickForm_Renderer()
- {
+ public function __construct() {
} // end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_Renderer() {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct();
+ }
+
/**
* Called when visiting a form, before processing any form elements
*
* @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key"
* @access public
*/
- function HTML_QuickForm_Renderer_Array($collectHidden = false, $staticLabels = false)
- {
- $this->HTML_QuickForm_Renderer();
+ public function __construct($collectHidden = false, $staticLabels = false) {
+ parent::__construct();
$this->_collectHidden = $collectHidden;
$this->_staticLabels = $staticLabels;
} // end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_Renderer_Array($collectHidden = false, $staticLabels = false) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($collectHidden, $staticLabels);
+ }
/**
* Returns the resultant array
*
* @access public
*/
- function HTML_QuickForm_Renderer_Default()
- {
- $this->HTML_QuickForm_Renderer();
+ public function __construct() {
+ parent::__construct();
+ } // end constructor
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_Renderer_Default() {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct();
} // end constructor
/**
* @param collecthidden bool true: collect all hidden elements
* @access public
*/
- function HTML_QuickForm_Renderer_Object($collecthidden = false)
- {
- $this->HTML_QuickForm_Renderer();
+ public function __construct($collecthidden = false) {
+ parent::__construct();
$this->_collectHidden = $collecthidden;
$this->_obj = new QuickformForm;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_Renderer_Object($collecthidden = false) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($collecthidden);
+ }
+
/**
* Return the rendered Object
* @access public
*
* @access public
*/
- function HTML_QuickForm_Renderer_Tableless()
- {
- $this->HTML_QuickForm_Renderer_Default();
+ public function __construct() {
+ parent::__construct();
} // end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_Renderer_Tableless() {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct();
+ }
+
/**
* Called when visiting a header element
*
* @access public
* @return void
*/
- function HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
- {
- $this->HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null) {
+ parent::__construct($elementName, $elementLabel, $text, $attributes);
$this->setValues($values);
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text, $attributes, $values);
+ }
+
// }}}
// {{{ getPrivateName()
* @access public
* @return void
*/
- function HTML_QuickForm_autocomplete($elementName = null, $elementLabel = null, $options = null, $attributes = null)
- {
- $this->HTML_QuickForm_text($elementName, $elementLabel, $attributes);
+ public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'autocomplete';
if (isset($options)) {
}
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_autocomplete($elementName = null, $elementLabel = null, $options = null, $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
// }}}
// {{{ setOptions()
* @access public
* @return void
*/
- function HTML_QuickForm_button($elementName=null, $value=null, $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
+ public function __construct($elementName=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, null, $attributes);
$this->_persistantFreeze = false;
$this->setValue($value);
$this->setType('button');
} //end constructor
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_button($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
+ }
// }}}
// {{{ freeze()
* @access public
* @return void
*/
- function HTML_QuickForm_checkbox($elementName=null, $elementLabel=null, $text='', $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $text='', $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_text = $text;
$this->setType('checkbox');
$this->updateAttributes(array('value'=>1));
} //end constructor
-
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_checkbox($elementName=null, $elementLabel=null, $text='', $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text, $attributes);
+ }
+
// }}}
// {{{ setChecked()
* @param array Options to control the element's display
* @param mixed Either a typical HTML attribute string or an associative array
*/
- function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
- {
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date';
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
// }}}
// {{{ _createElements()
* @access public
* @return void
*/
- function HTML_QuickForm_element($elementName=null, $elementLabel=null, $attributes=null)
- {
- HTML_Common::HTML_Common($attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($attributes);
if (isset($elementName)) {
$this->setName($elementName);
}
$this->setLabel($elementLabel);
}
} //end constructor
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_element($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
// }}}
// {{{ apiVersion()
{
switch ($event) {
case 'createElement':
- $className = get_class($this);
- $this->$className($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
+ static::__construct($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
break;
case 'addElement':
$this->onQuickFormEvent('createElement', $arg, $caller);
* @since 1.0
* @access public
*/
- function HTML_QuickForm_file($elementName=null, $elementLabel=null, $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->setType('file');
} //end constructor
-
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_file($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
+
// }}}
// {{{ setSize()
return $this->onQuickFormEvent('updateValue', null, $caller);
break;
case 'createElement':
- $className = get_class($this);
- $this->$className($arg[0], $arg[1], $arg[2]);
+ static::__construct($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
break;
}
return true;
* @access public
* @return void
*/
- function HTML_QuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true)
- {
- $this->HTML_QuickForm_element($elementName, $elementLabel);
+ public function __construct($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) {
+ parent::__construct($elementName, $elementLabel);
$this->_type = 'group';
if (isset($elements) && is_array($elements)) {
$this->setElements($elements);
}
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_group($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $elements, $separator, $appendName);
+ }
+
// }}}
// {{{ setName()
* @access public
* @return void
*/
- function HTML_QuickForm_header($elementName = null, $text = null)
- {
- $this->HTML_QuickForm_static($elementName, null, $text);
+ public function __construct($elementName = null, $text = null) {
+ parent::__construct($elementName, null, $text);
$this->_type = 'header';
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_header($elementName = null, $text = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $text);
+ }
+
// }}}
// {{{ accept()
* @access public
* @return void
*/
- function HTML_QuickForm_hidden($elementName=null, $value='', $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
+ public function __construct($elementName=null, $value='', $attributes=null) {
+ parent::__construct($elementName, null, $attributes);
$this->setType('hidden');
$this->setValue($value);
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_hidden($elementName=null, $value='', $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ return self::__construct($elementName, $value, $attributes);
+ }
+
// }}}
// {{{ freeze()
* @access public
* @return void
*/
- function HTML_QuickForm_hiddenselect($elementName=null, $elementLabel=null, $options=null, $attributes=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'hiddenselect';
if (isset($options)) {
}
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_hiddenselect($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $options, $attributes);
+ }
+
// }}}
// {{{ toHtml()
* @access public
* @return void
*/
- function HTML_QuickForm_hierselect($elementName=null, $elementLabel=null, $attributes=null, $separator=null)
- {
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null, $separator=null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
if (isset($separator)) {
$this->_separator = $separator;
$this->_appendName = true;
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_hierselect($elementName=null, $elementLabel=null, $attributes=null, $separator=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $separator);
+ }
+
// }}}
// {{{ setOptions()
* @access public
* @return void
*/
- function HTML_QuickForm_html($text = null)
- {
- $this->HTML_QuickForm_static(null, null, $text);
+ public function __construct($text = null) {
+ parent::__construct(null, null, $text);
$this->_type = 'html';
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_html($text = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($text);
+ }
+
// }}}
// {{{ accept()
* @access public
* @return void
*/
- function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
+ public function __construct($elementName=null, $src='', $attributes=null) {
+ parent::__construct($elementName, null, $attributes);
$this->setType('image');
$this->setSource($src);
} // end class constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_image($elementName=null, $src='', $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $src, $attributes);
+ }
+
// }}}
// {{{ setSource()
* @access public
* @return void
*/
- function HTML_QuickForm_input($elementName=null, $elementLabel=null, $attributes=null)
- {
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_input($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
+
// }}}
// {{{ setType()
* @return void
* @throws
*/
- function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = false;
$this->_type = 'link';
$this->setHref($href);
$this->_text = $text;
} //end constructor
-
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $href, $text, $attributes);
+ }
+
// }}}
// {{{ setName()
* @return void
* @throws
*/
- function HTML_QuickForm_password($elementName=null, $elementLabel=null, $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->setType('password');
} //end constructor
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_password($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
// }}}
// {{{ setSize()
* @access public
* @return void
*/
- function HTML_QuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null)
- {
- $this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) {
+ HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
if (isset($value)) {
$this->setValue($value);
}
$this->_text = $text;
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_radio($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text, $value, $attributes);
+ }
+
// }}}
function _generateId() {
* @access public
* @return void
*/
- function HTML_QuickForm_reset($elementName=null, $value=null, $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
+ public function __construct($elementName=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, null, $attributes);
$this->setValue($value);
$this->setType('reset');
} //end constructor
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_reset($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
+ }
+
// }}}
// {{{ freeze()
* @access public
* @return void
*/
- function HTML_QuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'select';
if (isset($options)) {
$this->load($options);
}
} //end constructor
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_select($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
// }}}
// {{{ apiVersion()
* @access public
* @return void
*/
- function HTML_QuickForm_static($elementName=null, $elementLabel=null, $text=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel);
+ public function __construct($elementName=null, $elementLabel=null, $text=null) {
+ parent::__construct($elementName, $elementLabel);
$this->_persistantFreeze = false;
$this->_type = 'static';
$this->_text = $text;
} //end constructor
-
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_static($elementName=null, $elementLabel=null, $text=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $text);
+ }
+
// }}}
// {{{ setName()
* @access public
* @return void
*/
- function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
+ public function __construct($elementName=null, $value=null, $attributes=null) {
+ parent::__construct($elementName, null, $attributes);
$this->setValue($value);
$this->setType('submit');
} //end constructor
-
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $value, $attributes);
+ }
+
// }}}
// {{{ freeze()
* @access public
* @return void
*/
- function HTML_QuickForm_text($elementName=null, $elementLabel=null, $attributes=null)
- {
- HTML_QuickForm_input::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->setType('text');
} //end constructor
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_text($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
// }}}
// {{{ setSize()
* @access public
* @return void
*/
- function HTML_QuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null)
- {
- HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'textarea';
} //end constructor
-
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_textarea($elementName=null, $elementLabel=null, $attributes=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
+ }
+
// }}}
// {{{ setName()
* @param mixed Either a typical HTML attribute string or an associative array
* @access public
*/
- function HTML_QuickForm_xbutton($elementName = null, $elementContent = null, $attributes = null)
- {
- $this->HTML_QuickForm_element($elementName, null, $attributes);
+ public function __construct($elementName = null, $elementContent = null, $attributes = null) {
+ parent::__construct($elementName, null, $attributes);
$this->setContent($elementContent);
$this->setPersistantFreeze(false);
$this->_type = 'xbutton';
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function HTML_QuickForm_xbutton($elementName = null, $elementContent = null, $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementContent, $attributes);
+ }
function toHtml()
{
* @access public
* @return void
*/
- function PEAR($error_class = null)
+ function __construct($error_class = null)
{
$classname = strtolower(get_class($this));
if ($this->_debug) {
}
}
+ /**
+ * Only here for backwards compatibility.
+ * E.g. Archive_Tar calls $this->PEAR() in its constructor.
+ *
+ * @param string $error_class Which class to use for error objects,
+ * defaults to PEAR_Error.
+ */
+ public function PEAR($error_class = null)
+ {
+ $this->__construct($error_class);
+ }
+
/**
* Destructor (the emulated type of...). Does nothing right now,
* but is included for forward compatibility, so subclass
* @access public
*
*/
- function PEAR_Error($message = 'unknown error', $code = null,
+ function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
}
}
+ /**
+ * Old syntax of class constructor for backward compatibility.
+ */
+ public function PEAR_Error($message = 'unknown error', $code = null,
+ $mode = null, $options = null, $userinfo = null) {
+ self::__construct($message, $code, $mode, $options, $userinfo);
+ }
+
/**
* Get the error mode from an error object.
*
MDL-20876 - replaced split() with explode() or preg_split() where appropriate
MDL-40267 - Moodle core_text strlen functions used for range rule rule to be utf8 safe.
MDL-46467 - $mform->hardfreeze causes labels to loose their for HTML attribute
+MDL-52081 - made all constructors PHP7 compatible
+
+
+Pear
+====
+Changed constructors in classes PEAR and PEAR_ERROR to be __construct(). This has
+been already changed upstream in 1.10.0, remove this line after upgrade.
\ No newline at end of file
* Ajax calls going through lib/ajax/* now validate the return values before sending
the response. If the validation does not pass an exception is raised. This behaviour
is consistent with web services.
+* Several changes in Moodle core, standard plugins and third party libraries to
+ ensure compatibility with PHP7. All plugins are recommended to perform testing
+ against PHP7 as well. The following changes may affect you:
+ * Class moodleform, moodleform_mod and some module classes have been changed to use
+ __construct() for the constructor. Calling parent constructors by the class
+ name will display debugging message. Incorrect: parent::moodleform(),
+ correct: parent::__construct()
+ * All form elements have also changed the constructor syntax. No changes are
+ needed for using form elements, however if plugin defines new form element it
+ needs to use correct syntax. For example, incorrect: parent::HTML_QuickForm_input(),
+ HTML_QuickForm_input::HTML_QuickForm_input(), $this->HTML_QuickForm_input().
+ Correct: HTML_QuickForm_input::__construct() or parent::__construct().
=== 3.0 ===
// @param string $url: the url to post to
// @param array $datafields: objects in this database
- function mod_data_export_form($url, $datafields, $cm, $data) {
+ public function __construct($url, $datafields, $cm, $data) {
$this->_datafields = $datafields;
$this->_cm = $cm;
$this->_data = $data;
- parent::moodleform($url);
+ parent::__construct($url);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function mod_data_export_form($url, $datafields, $cm, $data) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($url, $datafields, $cm, $data);
}
function definition() {
protected $course = null;
- public function mod_lesson_mod_form($current, $section, $cm, $course) {
+ public function __construct($current, $section, $cm, $course) {
$this->course = $course;
- parent::moodleform_mod($current, $section, $cm, $course);
+ parent::__construct($current, $section, $cm, $course);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function mod_lesson_mod_form($current, $section, $cm, $course) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($current, $section, $cm, $course);
}
function definition() {
private $files;
- function MoodleQuickForm_wikieditor($elementName = null, $elementLabel = null, $attributes = null) {
+ /**
+ * Constructor
+ *
+ * @param string $elementName (optional) name of the text field
+ * @param string $elementLabel (optional) text field label
+ * @param string $attributes (optional) Either a typical HTML attribute string or an associative array
+ */
+ function __construct($elementName = null, $elementLabel = null, $attributes = null) {
if (isset($attributes['wiki_format'])) {
$this->wikiformat = $attributes['wiki_format'];
unset($attributes['wiki_format']);
unset($attributes['files']);
}
- parent::MoodleQuickForm_textarea($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_wikieditor($elementName = null, $elementLabel = null, $attributes = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes);
}
function setWikiFormat($wikiformat) {
private $_fileinfo;
private $_value = array();
- function MoodleQuickForm_wikifiletable($elementName = null, $elementLabel = null, $attributes = null, $fileinfo = null, $format = null) {
+ public function __construct($elementName = null, $elementLabel = null, $attributes = null, $fileinfo = null, $format = null) {
- parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
+ parent::__construct($elementName, $elementLabel, $attributes);
$this->_fileinfo = $fileinfo;
$this->_format = $format;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function MoodleQuickForm_wikifiletable($elementName = null, $elementLabel = null, $attributes = null, $fileinfo = null, $format = null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($elementName, $elementLabel, $attributes, $fileinfo, $format);
+ }
+
function onQuickFormEvent($event, $arg, &$caller) {
global $OUTPUT;