diff --git a/admin/tool/xmldb/actions/XMLDBAction.class.php b/admin/tool/xmldb/actions/XMLDBAction.class.php index b853a7e631d..d984894fabf 100644 --- a/admin/tool/xmldb/actions/XMLDBAction.class.php +++ b/admin/tool/xmldb/actions/XMLDBAction.class.php @@ -54,18 +54,11 @@ class XMLDBAction { var $sesskey_protected; // Actions must be protected by sesskey mechanism - /** - * Constructor - */ - function XMLDBAction() { - $this->init(); - } - /** * Constructor to keep PHP5 happy */ function __construct() { - $this->XMLDBAction(); + $this->init(); } /** diff --git a/auth/cas/auth.php b/auth/cas/auth.php index fa6fb0f6147..d8c95231ffb 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -215,7 +215,7 @@ class auth_plugin_cas extends auth_plugin_ldap { * @param object object with submitted configuration settings (without system magic quotes) * @param array $err array of error messages */ - function validate_form(&$form, &$err) { + function validate_form($form, &$err) { $certificate_path = trim($form->certificate_path); if ($form->certificate_check && empty($certificate_path)) { $err['certificate_path'] = get_string('auth_cas_certificate_path_empty', 'auth_cas'); diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index 605783147fa..5a268b40c0f 100644 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -355,7 +355,7 @@ class grade_edit_tree { * @param string type "extra" or "weight": the type of the column hosting the weight input * @return string HTML */ - function get_weight_input($item, $type) { + static function get_weight_input($item, $type) { global $OUTPUT; if (!is_object($item) || get_class($item) !== 'grade_item') { @@ -387,7 +387,7 @@ class grade_edit_tree { //Trims trailing zeros //Used on the 'categories and items' page for grade items settings like aggregation co-efficient //Grader report has its own decimal place settings so they are handled elsewhere - function format_number($number) { + static function format_number($number) { $formatted = rtrim(format_float($number, 4),'0'); if (substr($formatted, -1)=='.') { //if last char is the decimal point $formatted .= '0'; diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index eca29e3f5d1..3ec4d7a7405 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -1207,7 +1207,7 @@ class grade_report_grader extends grade_report { foreach ($this->gtree->items as $itemid=>$unused) { // emulate grade element - $item =& $this->gtree->get_item($itemid); + $item = $this->gtree->get_item($itemid); $eid = $this->gtree->get_item_eid($item); $element = $this->gtree->locate_element($eid); diff --git a/lib/authlib.php b/lib/authlib.php index 334bd44b542..7bb1d17324f 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -366,7 +366,7 @@ class auth_plugin_base { * @param object object with submitted configuration settings (without system magic quotes) * @param array $err array of error messages */ - function validate_form(&$form, &$err) { + function validate_form($form, &$err) { //override if needed } diff --git a/lib/cronlib.php b/lib/cronlib.php index 11c3def5f86..818a774bdc4 100644 --- a/lib/cronlib.php +++ b/lib/cronlib.php @@ -356,7 +356,7 @@ function cron_run() { require_once($CFG->dirroot . '/blog/lib.php'); mtrace("Fetching external blog entries...", ''); $sql = "timefetched < ? OR timefetched = 0"; - $externalblogs = $DB->get_records_select('blog_external', $sql, array(mktime() - $CFG->externalblogcrontime)); + $externalblogs = $DB->get_records_select('blog_external', $sql, array(time() - $CFG->externalblogcrontime)); foreach ($externalblogs as $eb) { blog_sync_external_entries($eb); diff --git a/lib/form/dateselector.php b/lib/form/dateselector.php index 5b36e4e2d09..969b11c4dc6 100644 --- a/lib/form/dateselector.php +++ b/lib/form/dateselector.php @@ -108,7 +108,7 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group $this->_elements[] = @MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); // If optional we add a checkbox which the user can use to turn if on if($this->_options['optional']) { - $this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true); + $this->_elements[] =@MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true); } foreach ($this->_elements as $element){ if (method_exists($element, 'setHiddenLabel')){ diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index 97a78f74c86..ca67450c4ab 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -1011,7 +1011,8 @@ class grade_category extends grade_object { 'children'=>$course_category->get_children($include_category_items)); $course_category->sortorder = $course_category->get_sortorder(); - return grade_category::_fetch_course_tree_recursion($category_array, $course_category->get_sortorder()); + $sortorder = $course_category->get_sortorder(); + return grade_category::_fetch_course_tree_recursion($category_array, $sortorder); } /** diff --git a/question/category_class.php b/question/category_class.php index 07c2d91be93..96b5efa32ab 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -73,7 +73,7 @@ class question_category_list extends moodle_list { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class question_category_list_item extends list_item { - public function set_icon_html($first, $last, &$lastitem){ + public function set_icon_html($first, $last, $lastitem){ global $CFG; $category = $this->item; $url = new moodle_url('/question/category.php', ($this->parentlist->pageurl->params() + array('edit'=>$category->id))); @@ -155,6 +155,7 @@ class question_category_object { $this->tab = str_repeat(' ', $this->tabsize); + $this->str = new stdClass(); $this->str->course = get_string('course'); $this->str->category = get_string('category', 'question'); $this->str->categoryinfo = get_string('categoryinfo', 'question'); diff --git a/question/format/aiken/format.php b/question/format/aiken/format.php index 4e64c2f6a93..06afee43e8f 100644 --- a/question/format/aiken/format.php +++ b/question/format/aiken/format.php @@ -58,7 +58,7 @@ class qformat_aiken extends qformat_default { return true; } - public function readquestions($lines) { + public function readquestions($lines, $context) { $questions = array(); $question = $this->defaultquestion(); $endchar = chr(13); diff --git a/question/format/blackboard/format.php b/question/format/blackboard/format.php index 1abf61f6cef..015c903782e 100644 --- a/question/format/blackboard/format.php +++ b/question/format/blackboard/format.php @@ -41,7 +41,7 @@ class qformat_blackboard extends qformat_default { return true; } - function readquestions ($lines) { + function readquestions ($lines, $context) { /// Parses an array of lines into an array of questions, /// where each item is a question object as defined by /// readquestion(). diff --git a/question/format/blackboard_six/format.php b/question/format/blackboard_six/format.php index 08614d3f024..4c996231864 100644 --- a/question/format/blackboard_six/format.php +++ b/question/format/blackboard_six/format.php @@ -243,7 +243,7 @@ class qformat_blackboard_six extends qformat_default { - function readquestions ($lines) { + protected function readquestions ($lines, $context) { /// Parses an array of lines into an array of questions, /// where each item is a question object as defined by /// readquestion(). diff --git a/question/format/examview/format.php b/question/format/examview/format.php index 53bb360fcf3..ba51cbc0c0c 100644 --- a/question/format/examview/format.php +++ b/question/format/examview/format.php @@ -149,7 +149,7 @@ class qformat_examview extends qformat_default { return str_replace('’', "'", $text); } - function readquestions($lines) { + protected function readquestions($lines, $context) { /// Parses an array of lines into an array of questions, /// where each item is a question object as defined by /// readquestion(). diff --git a/question/format/learnwise/format.php b/question/format/learnwise/format.php index a27e86f1e00..d625ae8b7bb 100644 --- a/question/format/learnwise/format.php +++ b/question/format/learnwise/format.php @@ -46,7 +46,7 @@ class qformat_learnwise extends qformat_default { return true; } - function readquestions($lines) { + protected function readquestions($lines, $context) { $questions = array(); $currentquestion = array(); diff --git a/question/format/multianswer/format.php b/question/format/multianswer/format.php index 45179d8d9f6..d8a94045404 100644 --- a/question/format/multianswer/format.php +++ b/question/format/multianswer/format.php @@ -40,7 +40,7 @@ class qformat_multianswer extends qformat_default { return true; } - protected function readquestions($lines) { + protected function readquestions($lines, $context) { // For this class the method has been simplified as // there can never be more than one question for a // multianswer import diff --git a/question/format/webct/format.php b/question/format/webct/format.php index db833a0bf8c..b00063f56d9 100644 --- a/question/format/webct/format.php +++ b/question/format/webct/format.php @@ -172,7 +172,7 @@ class qformat_webct extends qformat_default { return true; } - function readquestions ($lines) { + protected function readquestions($lines, $context) { $webctnumberregex = '[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)((e|E|\\*10\\*\\*)([+-]?[0-9]+|\\([+-]?[0-9]+\\)))?'; diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 2633deba953..d7508641ca9 100644 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -886,9 +886,10 @@ class qformat_xml extends qformat_default { * this *could* burn memory - but it won't happen that much * so fingers crossed! * @param array of lines from the input file. + * @param stdClass $context * @return array (of objects) question objects. */ - protected function readquestions($lines) { + protected function readquestions($lines, $context) { // We just need it as one big string $text = implode($lines, ' '); unset($lines);