private $css;
private $html;
- function cssparser($html = true) {
+ public function __construct($html = true) {
// Register "destructor"
core_shutdown_manager::register_function(array(&$this, "finalize"));
$this->html = ($html != false);
}
return $result;
}
-}
\ No newline at end of file
+}
* external 'helper' binaries.
* Other platforms could/should be added
*/
- function latex() {
+ public function __construct() {
global $CFG;
// construct directory structure
/**
* Constructor - creates the buffer and initialises the time stamp
*/
- public function grade_export_update_buffer() {
+ public function __construct() {
$this->update_list = array();
$this->export_time = time();
}
*
* @param array $params - associative array with return parameters, if null parameter are taken from _GET or _POST
*/
- public function grade_plugin_return($params = null) {
+ public function __construct($params = null) {
if (empty($params)) {
$this->type = optional_param('gpr_type', null, PARAM_SAFEDIR);
$this->plugin = optional_param('gpr_plugin', null, PARAM_PLUGIN);
* @param bool $category_grade_last category grade item is the last child
* @param bool $nooutcomes Whether or not outcomes should be included
*/
- public function grade_seq($courseid, $category_grade_last=false, $nooutcomes=false) {
+ public function __construct($courseid, $category_grade_last=false, $nooutcomes=false) {
global $USER, $CFG;
$this->courseid = $courseid;
* @param array $collapsed array of collapsed categories
* @param bool $nooutcomes Whether or not outcomes should be included
*/
- public function grade_tree($courseid, $fillers=true, $category_grade_last=false,
+ public function __construct($courseid, $fillers=true, $category_grade_last=false,
$collapsed=null, $nooutcomes=false) {
global $USER, $CFG, $COURSE, $DB;
/**
* Calls parent::__construct with specific arguments
*/
- function admin_setting_special_gradelimiting() {
+ public function __construct() {
parent::__construct('unlimitedgrades', get_string('unlimitedgrades', 'grades'),
get_string('unlimitedgrades_help', 'grades'), '0', '1', '0');
}
* be expanded (default='' = moodledataitself)
* @return object
*/
- function component_installer ($sourcebase, $zippath, $zipfilename, $md5filename='', $destpath='') {
+ public function __construct($sourcebase, $zippath, $zipfilename, $md5filename='', $destpath='') {
$this->sourcebase = $sourcebase;
$this->zippath = $zippath;
*\r
* @param $config Configuration name/value array.\r
*/\r
- function SpellChecker(&$config) {\r
+ public function __construct(&$config) {\r
$this->_config = $config;\r
}\r
\r
var $_location, $_lastLocations;
var $_needProp;
- function Moxiecode_JSONReader($data) {
+ public function __construct($data) {
$this->_data = $data;
$this->_len = strlen($data);
$this->_pos = -1;
* @package MCManager.utils
*/
class Moxiecode_JSON {
- function Moxiecode_JSON() {
+ public function __construct() {
}
function decode($input) {
/**\r
* Constructs a new logger instance.\r
*/\r
- function Moxiecode_Logger() {\r
+ public function __construct() {\r
$this->_path = "";\r
$this->_filename = "{level}.log";\r
$this->setMaxSize("100k");\r
}\r
}\r
\r
-?>
\ No newline at end of file
+?>\r
* Moved static files to /tinymce/ subfolder.
* MDL-25736 - French spellchecker fixes.
* Fix htmlentities conversion in GoogleSpell.php
+* Constructors in Moxiecode_JSONReader, Moxiecode_JSON, Moxiecode_Logger, SpellChecker are renamed to __construct()
*
* @param string $part
*/
- function environment_results($part) {
+ public function __construct($part) {
$this->part=$part;
$this->status=false;
$this->error_code=NO_ERROR;
var $allowimplicitmultiplication;
- function EvalMath($allowconstants = false, $allowimplicitmultiplication = false) {
+ public function __construct($allowconstants = false, $allowimplicitmultiplication = false) {
if ($allowconstants){
$this->v['pi'] = pi();
$this->v['e'] = exp(1);
* made a function to test a string to see if it is a valid func or var name.
* localized strings
* added round, ceil and floor functions.
+* EvalMath::EvalMath() changed to EvalMath::__construct()
To see all changes diff against version 1.1, available from:
http://www.phpclasses.org/browse/package/2695.html
return array('min' => $min, 'max' => $max);
}
- function graph() {
+ public function __construct() {
if (func_num_args() == 2) {
$this->parameter['width'] = func_get_arg(0);
$this->parameter['height'] = func_get_arg(1);
* for insensitive.
* @access public
*/
- function ParallelRegex($case) {
+ public function __construct($case) {
$this->_case = $case;
$this->_patterns = array();
$this->_labels = array();
* @param string $start Starting state name.
* @access public
*/
- function StateStack($start) {
+ public function __construct($start) {
$this->_stack = array($start);
}
* @param bool $case True for case sensitive.
* @access public
*/
- function Lexer(&$parser, $start = "accept", $case = false) {
+ public function __construct(&$parser, $start = "accept", $case = false) {
$this->_case = $case;
$this->_regexes = array();
$this->_parser = &$parser;
$this->_mode = new StateStack($start);
$this->_mode_handlers = array();
}
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function Lexer(&$parser, $start = "accept", $case = false) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($parser, $start, $case);
+ }
/**
* Adds a token search pattern for a particular
* @param string $formula with leading =
* @param array $params associative array of parameters used in formula. All parameter names must be lowercase!
*/
- function calc_formula($formula, $params=false) {
+ public function __construct($formula, $params=false) {
$this->_em = new EvalMath();
$this->_em->suppress_errors = true; // no PHP errors!
if (strpos($formula, '=') !== 0) {
private $value;
private $type;
- function search_token($type,$value){
+ public function __construct($type,$value){
$this->type = $type;
$this->value = $this->sanitize($value);
*/
class search_lexer extends Lexer{
- function search_lexer(&$parser){
+ public function __construct(&$parser){
// Call parent constructor.
- $this->Lexer($parser);
+ parent::__construct($parser);
//Set up the state machine and pattern matches for transitions.
* started yet.
*/
var $documentstarted = false;
- function table_default_export_format_parent(&$table) {
+
+ /**
+ * Constructor
+ *
+ * @param flexible_table $table
+ */
+ public function __construct(&$table) {
$this->table =& $table;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function table_default_export_format_parent(&$table) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($table);
+ }
+
function set_table(&$table) {
$this->table =& $table;
}
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().
+ * profile_field_base::profile_field_base() is deprecated, use parent::__construct()
+ in custom profile fields constructors. Similar deprecations in exsiting
+ profile_field_* classes.
+ * user_filter_type::user_filter_type() is deprecated, use parent::__construct() in
+ custom user filters. Similar deprecations in existing user_filter_* classes.
+ * table_default_export_format_parent::table_default_export_format_parent() is
+ deprecated, use parent::__construct() in extending classes.
=== 3.0 ===
class _WikiDiffOp_Copy extends _WikiDiffOp {
var $type = 'copy';
- function _WikiDiffOp_Copy ($orig, $closing = false) {
+ public function __construct ($orig, $closing = false) {
if (!is_array($closing))
$closing = $orig;
$this->orig = $orig;
class _WikiDiffOp_Delete extends _WikiDiffOp {
var $type = 'delete';
- function _WikiDiffOp_Delete ($lines) {
+ public function __construct ($lines) {
$this->orig = $lines;
$this->closing = false;
}
class _WikiDiffOp_Add extends _WikiDiffOp {
var $type = 'add';
- function _WikiDiffOp_Add ($lines) {
+ public function __construct ($lines) {
$this->closing = $lines;
$this->orig = false;
}
class _WikiDiffOp_Change extends _WikiDiffOp {
var $type = 'change';
- function _WikiDiffOp_Change ($orig, $closing) {
+ public function __construct ($orig, $closing) {
$this->orig = $orig;
$this->closing = $closing;
}
* (Typically these are lines from a file.)
* @param $to_lines array An array of strings.
*/
- function WikiDiff($from_lines, $to_lines) {
+ public function __construct($from_lines, $to_lines) {
$eng = new _WikiDiffEngine;
$this->edits = $eng->diff($from_lines, $to_lines);
//$this->_check($from_lines, $to_lines);
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function WikiDiff($from_lines, $to_lines) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($from_lines, $to_lines);
+ }
+
/**
* Compute reversed WikiDiff.
*
* @param $mapped_to_lines array This array should
* have the same number of elements as $to_lines.
*/
- function MappedWikiDiff($from_lines, $to_lines,
+ public function __construct($from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines) {
assert(sizeof($from_lines) == sizeof($mapped_from_lines));
assert(sizeof($to_lines) == sizeof($mapped_to_lines));
- $this->WikiDiff($mapped_from_lines, $mapped_to_lines);
+ parent::__construct($mapped_from_lines, $mapped_to_lines);
$xi = $yi = 0;
for ($i = 0; $i < sizeof($this->edits); $i++) {
define('NBSP', ' '); // iso-8859-x non-breaking space.
class _WikiHWLDF_WordAccumulator {
- function _WikiHWLDF_WordAccumulator () {
+ public function __construct () {
$this->_lines = array();
$this->_line = '';
$this->_group = '';
class WordLevelWikiDiff extends MappedWikiDiff
{
- function WordLevelWikiDiff ($orig_lines, $closing_lines) {
+ function __construct ($orig_lines, $closing_lines) {
list ($orig_words, $orig_stripped) = $this->_split($orig_lines);
list ($closing_words, $closing_stripped) = $this->_split($closing_lines);
- $this->MappedWikiDiff($orig_words, $closing_words,
+ parent::__construct($orig_words, $closing_words,
$orig_stripped, $closing_stripped);
}
{
var $htmltable = array();
- function TableWikiDiffFormatter() {
+ public function __construct() {
$this->leading_context_lines = 2;
$this->trailing_context_lines = 2;
}
* @param string $data Text data that makes up this 'line'. (May include line breaks etc.)
* @param int $linepos Position number for first character in text
*/
- function ouwiki_line($data,$linepos) {
+ public function __construct($data,$linepos) {
// 1. Turn things we don't want into spaces (so that positioning stays same)
// Whitespace replaced with space
/** Start position in original xhtml */
var $start;
- function ouwiki_word($word,$start) {
+ public function __construct($word,$start) {
$this->word=$word;
$this->start=$start;
}
* to indices in file2. All indices 1-based.
* @param int $count2 Number of lines in file2
*/
- function ouwiki_changes($diff,$count2) {
+ public function __construct($diff,$count2) {
// Find deleted lines
$this->deletes=self::internal_find_deletes($diff,$count2);
*
* Gets necessary strings and sets relevant path information
*/
- public function question_category_object($page, $pageurl, $contexts, $currentcat, $defaultcategory, $todelete, $addcontexts) {
+ public function __construct($page, $pageurl, $contexts, $currentcat, $defaultcategory, $todelete, $addcontexts) {
global $CFG, $COURSE, $OUTPUT;
$this->tab = str_repeat(' ', $this->tabsize);
* Constructor
* @param boolean $advanced advanced form element flag
*/
+ public function __construct($advanced) {
+ parent::__construct('cohort', get_string('idnumber', 'core_cohort'), $advanced);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
public function user_filter_cohort($advanced) {
- parent::user_filter_type('cohort', get_string('idnumber', 'core_cohort'), $advanced);
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($advanced);
}
/**
* @param string $label the label of the filter instance
* @param boolean $advanced advanced form element flag
*/
+ public function __construct($name, $label, $advanced) {
+ parent::__construct($name, $label, $advanced);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
public function user_filter_courserole($name, $label, $advanced) {
- parent::user_filter_type($name, $label, $advanced);
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced);
}
/**
* @param boolean $advanced advanced form element flag
* @param string $field user table filed name
*/
- public function user_filter_date($name, $label, $advanced, $field) {
- parent::user_filter_type($name, $label, $advanced);
+ public function __construct($name, $label, $advanced, $field) {
+ parent::__construct($name, $label, $advanced);
$this->_field = $field;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function user_filter_date($name, $label, $advanced, $field) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced, $field);
+ }
+
/**
* Adds controls specific to this filter in the form.
* @param object $mform a MoodleForm object to setup
* @param string $label the label of the filter instance
* @param boolean $advanced advanced form element flag
*/
+ public function __construct($name, $label, $advanced) {
+ parent::__construct($name, $label, $advanced);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
public function user_filter_globalrole($name, $label, $advanced) {
- parent::user_filter_type($name, $label, $advanced);
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced);
}
/**
* @param string $baseurl base url used for submission/return, null if the same of current page
* @param array $extraparams extra page parameters
*/
- public function user_filtering($fieldnames = null, $baseurl = null, $extraparams = null) {
+ public function __construct($fieldnames = null, $baseurl = null, $extraparams = null) {
global $SESSION;
if (!isset($SESSION->user_filtering)) {
* @param string $label the label of the filter instance
* @param boolean $advanced advanced form element flag
*/
- public function user_filter_type($name, $label, $advanced) {
+ public function __construct($name, $label, $advanced) {
$this->_name = $name;
$this->_label = $label;
$this->_advanced = $advanced;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function user_filter_type($name, $label, $advanced) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced);
+ }
+
/**
* Returns the condition to be used with SQL where
* @param array $data filter settings
* @param string $label the label of the filter instance
* @param boolean $advanced advanced form element flag
*/
+ public function __construct($name, $label, $advanced) {
+ parent::__construct($name, $label, $advanced);
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
public function user_filter_profilefield($name, $label, $advanced) {
- parent::user_filter_type($name, $label, $advanced);
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced);
}
/**
* @param array $options select options
* @param mixed $default option
*/
- public function user_filter_select($name, $label, $advanced, $field, $options, $default=null) {
- parent::user_filter_type($name, $label, $advanced);
+ public function __construct($name, $label, $advanced, $field, $options, $default=null) {
+ parent::__construct($name, $label, $advanced);
$this->_field = $field;
$this->_options = $options;
$this->_default = $default;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function user_filter_select($name, $label, $advanced, $field, $options, $default=null) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced, $field, $options, $default=null);
+ }
+
/**
* Returns an array of comparison operators
* @return array of comparison operators
* @param string $field user table filed name
* @param array $options select options
*/
- public function user_filter_simpleselect($name, $label, $advanced, $field, $options) {
- parent::user_filter_type($name, $label, $advanced);
+ public function __construct($name, $label, $advanced, $field, $options) {
+ parent::__construct($name, $label, $advanced);
$this->_field = $field;
$this->_options = $options;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function user_filter_simpleselect($name, $label, $advanced, $field, $options) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced, $field, $options);
+ }
+
/**
* Adds controls specific to this filter in the form.
* @param moodleform $mform a MoodleForm object to setup
* @param boolean $advanced advanced form element flag
* @param string $field user table filed name
*/
- public function user_filter_text($name, $label, $advanced, $field) {
- parent::user_filter_type($name, $label, $advanced);
+ public function __construct($name, $label, $advanced, $field) {
+ parent::__construct($name, $label, $advanced);
$this->_field = $field;
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function user_filter_text($name, $label, $advanced, $field) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced, $field);
+ }
+
/**
* Returns an array of comparison operators
* @return array of comparison operators
* @param boolean $advanced advanced form element flag
* @param string $field user table filed name
*/
+ public function __construct($name, $label, $advanced, $field) {
+ parent::__construct($name, $label, $advanced, $field, array(0 => get_string('no'), 1 => get_string('yes')));
+ }
+
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
public function user_filter_yesno($name, $label, $advanced, $field) {
- parent::user_filter_simpleselect($name, $label, $advanced, $field, array(0 => get_string('no'), 1 => get_string('yes')));
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($name, $label, $advanced, $field);
}
/**
* @param int $fieldid
* @param int $userid
*/
- public function profile_field_checkbox($fieldid=0, $userid=0) {
+ public function __construct($fieldid=0, $userid=0) {
global $DB;
// First call parent constructor.
- $this->profile_field_base($fieldid, $userid);
+ parent::__construct($fieldid, $userid);
if (!empty($this->field)) {
$datafield = $DB->get_field('user_info_data', 'data', array('userid' => $this->userid, 'fieldid' => $this->fieldid));
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function profile_field_checkbox($fieldid=0, $userid=0) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($fieldid, $userid);
+ }
+
/**
* Add elements for editing the profile field value.
* @param moodleform $mform
* @param int $fieldid
* @param int $userid
*/
- public function profile_field_menu($fieldid = 0, $userid = 0) {
+ public function __construct($fieldid = 0, $userid = 0) {
// First call parent constructor.
- $this->profile_field_base($fieldid, $userid);
+ parent::__construct($fieldid, $userid);
// Param 1 for menu type is the options.
if (isset($this->field->param1)) {
}
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function profile_field_menu($fieldid=0, $userid=0) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($fieldid, $userid);
+ }
+
/**
* Create the code snippet for this field instance
* Overwrites the base class method
* @param int $fieldid id of the profile from the user_info_field table
* @param int $userid id of the user for whom we are displaying data
*/
- public function profile_field_base($fieldid=0, $userid=0) {
+ public function __construct($fieldid=0, $userid=0) {
global $USER;
$this->set_fieldid($fieldid);
$this->load_data();
}
+ /**
+ * Old syntax of class constructor. Deprecated in PHP7.
+ *
+ * @deprecated since Moodle 3.1
+ */
+ public function profile_field_base($fieldid=0, $userid=0) {
+ debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
+ self::__construct($fieldid, $userid);
+ }
+
/**
* Abstract method: Adds the profile field to the moodle form class
* @abstract The following methods must be overwritten by child classes