diff --git a/admin/cron.php b/admin/cron.php index 5b473a3fff1..cce8ae32ef0 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -81,6 +81,9 @@ if (check_browser_version('MSIE')) { @header('Content-Type: text/plain; charset=utf-8'); } +// we do not want html markup in emulated CLI +@ini_set('html_errors', 'off'); + // execute the cron cron_run(); diff --git a/admin/index.php b/admin/index.php index 70dcafa0805..5baad8c73ce 100644 --- a/admin/index.php +++ b/admin/index.php @@ -307,7 +307,8 @@ if (during_initial_install()) { } // at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that - $adminuser = get_complete_user_data('id', reset(explode(',', $CFG->siteadmins))); + $adminids = explode(',', $CFG->siteadmins); + $adminuser = get_complete_user_data('id', reset($adminids)); if ($adminuser->password === 'adminsetuppending') { // prevent installation hijacking diff --git a/admin/mnet/peer_forms.php b/admin/mnet/peer_forms.php index 4c5243bf8a5..4725e1fe3c7 100644 --- a/admin/mnet/peer_forms.php +++ b/admin/mnet/peer_forms.php @@ -141,10 +141,10 @@ class mnet_review_host_form extends moodleform { if ($mnet_peer && !empty($mnet_peer->deleted)) { $radioarray = array(); - $radioarray[] = MoodleQuickForm::createElement('static', 'deletedinfo', '', + $radioarray[] = $mform->createElement('static', 'deletedinfo', '', $OUTPUT->container(get_string('deletedhostinfo', 'mnet'), 'deletedhostinfo')); - $radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('yes'), 1); - $radioarray[] = MoodleQuickForm::createElement('radio', 'deleted', '', get_string('no'), 0); + $radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('yes'), 1); + $radioarray[] = $mform->createElement('radio', 'deleted', '', get_string('no'), 0); $mform->addGroup($radioarray, 'radioar', get_string('deleted'), array(' ', ' '), false); } else { $mform->addElement('hidden', 'deleted'); diff --git a/admin/tool/unittest/dbtest.php b/admin/tool/unittest/dbtest.php index 8a0a60c646f..e5e2eb193ee 100644 --- a/admin/tool/unittest/dbtest.php +++ b/admin/tool/unittest/dbtest.php @@ -27,6 +27,11 @@ define('NO_OUTPUT_BUFFERING', true); require(dirname(__FILE__) . '/../../../config.php'); require_once($CFG->libdir.'/adminlib.php'); + +// unfortunately outdated SimpleTest is not E_STRICT compatible +$CFG->debug = ($CFG->debug & ~E_STRICT); +error_reporting($CFG->debug); + require_once('simpletestlib.php'); require_once('simpletestcoveragelib.php'); require_once('ex_simple_test.php'); diff --git a/admin/tool/unittest/index.php b/admin/tool/unittest/index.php index 4deef62da5d..62a60a7c97d 100644 --- a/admin/tool/unittest/index.php +++ b/admin/tool/unittest/index.php @@ -28,16 +28,18 @@ define('NO_OUTPUT_BUFFERING', true); require(dirname(__FILE__) . '/../../../config.php'); require_once($CFG->libdir.'/adminlib.php'); + +// Always run the unit tests in developer debug mode. +// unfortunately outdated SimpleTest is not E_STRICT compatible +$CFG->debug = (DEBUG_DEVELOPER & ~E_STRICT); +error_reporting($CFG->debug); +raise_memory_limit(MEMORY_EXTRA); + require_once('simpletestlib.php'); require_once('simpletestcoveragelib.php'); require_once('ex_simple_test.php'); require_once('ex_reporter.php'); -// Always run the unit tests in developer debug mode. -$CFG->debug = DEBUG_DEVELOPER; -error_reporting($CFG->debug); -raise_memory_limit(MEMORY_EXTRA); - // page parameters $path = optional_param('path', null, PARAM_PATH); $showpasses = optional_param('showpasses', false, PARAM_BOOL); 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/blocks/quiz_results/block_quiz_results.php b/blocks/quiz_results/block_quiz_results.php index a8d24e51edd..7ea73f0cf54 100644 --- a/blocks/quiz_results/block_quiz_results.php +++ b/blocks/quiz_results/block_quiz_results.php @@ -76,7 +76,7 @@ class block_quiz_results extends block_base { return $cm->instance; } - function instance_config_save($data) { + function instance_config_save($data, $nolongerused = false) { if (empty($data->quizid)) { $data->quizid = $this->get_owning_quiz(); } diff --git a/calendar/lib.php b/calendar/lib.php index 645ae189470..7280f14c7a8 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -497,7 +497,7 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve if ($events !== false) { - $modinfo =& get_fast_modinfo($COURSE); + $modinfo = get_fast_modinfo($COURSE); foreach($events as $event) { diff --git a/course/lib.php b/course/lib.php index fd8a1e1e23c..dfc33df1c0e 100644 --- a/course/lib.php +++ b/course/lib.php @@ -932,7 +932,7 @@ function print_recent_activity($course) { /// Next, have there been any modifications to the course structure? - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $changelist = array(); diff --git a/course/recent.php b/course/recent.php index fcf09fd9f40..f33ef54c617 100644 --- a/course/recent.php +++ b/course/recent.php @@ -82,7 +82,7 @@ echo $OUTPUT->heading(format_string($course->fullname) . ": $userinfo", 2); $mform->display(); -$modinfo =& get_fast_modinfo($course); +$modinfo = get_fast_modinfo($course); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused); if (has_capability('moodle/course:viewhiddensections', $context)) { diff --git a/course/view.php b/course/view.php index 8b2621f38a0..49bbbe87c92 100644 --- a/course/view.php +++ b/course/view.php @@ -226,12 +226,12 @@ // Course wrapper start. echo html_writer::start_tag('div', array('class'=>'course-content')); - $modinfo =& get_fast_modinfo($COURSE); + $modinfo = get_fast_modinfo($COURSE); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused); foreach($mods as $modid=>$unused) { if (!isset($modinfo->cms[$modid])) { rebuild_course_cache($course->id); - $modinfo =& get_fast_modinfo($COURSE); + $modinfo = get_fast_modinfo($COURSE); debugging('Rebuilding course cache', DEBUG_DEVELOPER); break; } 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/export/grade_export_form.php b/grade/export/grade_export_form.php index bd6e39601ab..a5c02c6ce81 100644 --- a/grade/export/grade_export_form.php +++ b/grade/export/grade_export_form.php @@ -73,8 +73,8 @@ class grade_export_form extends moodleform { if (!empty($features['includeseparator'])) { $radio = array(); - $radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('septab', 'grades'), 'tab'); - $radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('sepcomma', 'grades'), 'comma'); + $radio[] = $mform->createElement('radio', 'separator', null, get_string('septab', 'grades'), 'tab'); + $radio[] = $mform->createElement('radio', 'separator', null, get_string('sepcomma', 'grades'), 'comma'); $mform->addGroup($radio, 'separator', get_string('separator', 'grades'), ' ', false); $mform->setDefault('separator', 'comma'); } diff --git a/grade/import/grade_import_form.php b/grade/import/grade_import_form.php index 6021f60a297..76514b3ac9f 100644 --- a/grade/import/grade_import_form.php +++ b/grade/import/grade_import_form.php @@ -46,8 +46,8 @@ class grade_import_form extends moodleform { if (!empty($features['includeseparator'])) { $radio = array(); - $radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('septab', 'grades'), 'tab'); - $radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('sepcomma', 'grades'), 'comma'); + $radio[] = $mform->createElement('radio', 'separator', null, get_string('septab', 'grades'), 'tab'); + $radio[] = $mform->createElement('radio', 'separator', null, get_string('sepcomma', 'grades'), 'comma'); $mform->addGroup($radio, 'separator', get_string('separator', 'grades'), ' ', false); $mform->setDefault('separator', 'comma'); } 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/blocklib.php b/lib/blocklib.php index 90d990cd708..69b93da2b30 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -226,10 +226,13 @@ class block_manager { $pageformat = $this->page->pagetype; foreach($allblocks as $block) { + if (!$bi = block_instance($block->name)) { + continue; + } if ($block->visible && - (block_method_result($block->name, 'instance_allow_multiple') || !$this->is_block_present($block->name)) && + ($bi->instance_allow_multiple() || !$this->is_block_present($block->name)) && blocks_name_allowed_in_format($block->name, $pageformat) && - block_method_result($block->name, 'user_can_addto', $this->page)) { + $bi->user_can_addto($this->page)) { $this->addableblocks[$block->name] = $block; } } @@ -1850,7 +1853,11 @@ function blocks_remove_inappropriate($course) { function blocks_name_allowed_in_format($name, $pageformat) { $accept = NULL; $maxdepth = -1; - $formats = block_method_result($name, 'applicable_formats'); + if (!$bi = block_instance($name)) { + return false; + } + + $formats = $bi->applicable_formats(); if (!$formats) { $formats = array(); } 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/csslib.php b/lib/csslib.php index 0995948714d..03d728c289c 100644 --- a/lib/csslib.php +++ b/lib/csslib.php @@ -1249,7 +1249,7 @@ class css_rule { list($name, $value) = array_map('trim', $bits); } if (isset($name) && isset($value) && $name !== '' && $value !== '') { - $style = css_style::init($name, $value); + $style = css_style::init_automatic($name, $value); } } else if ($style instanceof css_style) { // Clone the style as it may be coming from another rule and we don't @@ -1646,7 +1646,7 @@ abstract class css_style { * @param string $value The value of the style. * @return css_style_generic */ - public static function init($name, $value) { + public static function init_automatic($name, $value) { $specificclass = 'css_style_'.preg_replace('#[^a-zA-Z0-9]+#', '', $name); if (class_exists($specificclass)) { return $specificclass::init($value); diff --git a/lib/csvlib.class.php b/lib/csvlib.class.php index d88716e3953..92296fd481a 100644 --- a/lib/csvlib.class.php +++ b/lib/csvlib.class.php @@ -289,7 +289,7 @@ class csv_import_reader { * @param string separator name * @return string encoded delimiter char */ - function get_encoded_delimiter($delimiter_name) { + static function get_encoded_delimiter($delimiter_name) { global $CFG; if ($delimiter_name == 'cfg' and isset($CFG->CSV_ENCODE)) { return $CFG->CSV_ENCODE; @@ -305,7 +305,7 @@ class csv_import_reader { * @param string who imports? * @return int iid */ - function get_new_iid($type) { + static function get_new_iid($type) { global $USER; $filename = make_temp_directory('csvimport/'.$type.'/'.$USER->id); diff --git a/lib/enrollib.php b/lib/enrollib.php index 7fd29e68f08..befe5d2a728 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -1733,9 +1733,10 @@ abstract class enrol_plugin { * Returns true if the plugin has one or more bulk operations that can be performed on * user enrolments. * + * @param course_enrolment_manager $manager * @return bool */ - public function has_bulk_operations() { + public function has_bulk_operations(course_enrolment_manager $manager) { return false; } @@ -1743,9 +1744,10 @@ abstract class enrol_plugin { * Return an array of enrol_bulk_enrolment_operation objects that define * the bulk actions that can be performed on user enrolments by the plugin. * + * @param course_enrolment_manager $manager * @return array */ - public function get_bulk_operations() { + public function get_bulk_operations(course_enrolment_manager $manager) { return array(); } } diff --git a/lib/form/dateselector.php b/lib/form/dateselector.php index be2cfda3f2c..969b11c4dc6 100644 --- a/lib/form/dateselector.php +++ b/lib/form/dateselector.php @@ -102,12 +102,13 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group for ($i=$this->_options['startyear']; $i<=$this->_options['stopyear']; $i++) { $years[$i] = $i; } - $this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); + // E_STRICT creating elements without forms is nasty because it internally uses $this + $this->_elements[] = @MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); + $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/form/datetimeselector.php b/lib/form/datetimeselector.php index 1f8e4cafcf7..f7468c23c37 100644 --- a/lib/form/datetimeselector.php +++ b/lib/form/datetimeselector.php @@ -109,19 +109,20 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group{ for ($i=0; $i<60; $i+=$this->_options['step']) { $minutes[$i] = sprintf("%02d",$i); } - $this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); + // E_STRICT creating elements without forms is nasty because it internally uses $this + $this->_elements[] = @MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true); if (right_to_left()) { // Switch order of elements for Right-to-Left - $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); } else { - $this->_elements[] =& MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); - $this->_elements[] =& MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'hour', get_string('hour', 'form'), $hours, $this->getAttributes(), true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'minute', get_string('minute', 'form'), $minutes, $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/form/duration.php b/lib/form/duration.php index 565d43b7e0c..06cd85ad329 100644 --- a/lib/form/duration.php +++ b/lib/form/duration.php @@ -131,12 +131,13 @@ class MoodleQuickForm_duration extends MoodleQuickForm_group { $attributes['size'] = 3; } $this->_elements = array(); - $this->_elements[] = MoodleQuickForm::createElement('text', 'number', get_string('time', 'form'), $attributes, true); + // E_STRICT creating elements without forms is nasty because it internally uses $this + $this->_elements[] = @MoodleQuickForm::createElement('text', 'number', get_string('time', 'form'), $attributes, true); unset($attributes['size']); - $this->_elements[] = MoodleQuickForm::createElement('select', 'timeunit', get_string('timeunit', 'form'), $this->get_units(), $attributes, true); + $this->_elements[] = @MoodleQuickForm::createElement('select', 'timeunit', get_string('timeunit', 'form'), $this->get_units(), $attributes, 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')){ @@ -153,7 +154,7 @@ class MoodleQuickForm_duration extends MoodleQuickForm_group { * @param object $caller calling object * @return bool */ - function onQuickFormEvent($event, $arg, $caller) { + function onQuickFormEvent($event, $arg, &$caller) { switch ($event) { case 'updateValue': // constant values override both default and submitted ones @@ -216,7 +217,7 @@ class MoodleQuickForm_duration extends MoodleQuickForm_group { * @param bool $required Whether a group is required * @param string $error An error message associated with a group */ - function accept($renderer, $required = false, $error = null) { + function accept(&$renderer, $required = false, $error = null) { $renderer->renderElement($this, $required, $error); } @@ -228,7 +229,7 @@ class MoodleQuickForm_duration extends MoodleQuickForm_group { * @param bool $notused Not used. * @return array field name => value. The value is the time interval in seconds. */ - function exportValue($submitValues, $notused = false) { + function exportValue(&$submitValues, $notused = false) { // Get the values from all the child elements. $valuearray = array(); foreach ($this->_elements as $element) { diff --git a/lib/form/editor.php b/lib/form/editor.php index 33941e669be..a993ffd467a 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -361,8 +361,9 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { if (count($formats)>1) { $str.= html_writer::select($formats, $elname.'[format]', $format, false); } else { + $keys = array_keys($formats); $str.= html_writer::empty_tag('input', - array('name'=>$elname.'[format]', 'type'=> 'hidden', 'value' => array_pop(array_keys($formats)))); + array('name'=>$elname.'[format]', 'type'=> 'hidden', 'value' => array_pop($keys))); } $str .= ''; diff --git a/lib/form/header.php b/lib/form/header.php index 042fb09d6cd..c232d9941cd 100644 --- a/lib/form/header.php +++ b/lib/form/header.php @@ -57,7 +57,7 @@ class MoodleQuickForm_header extends HTML_QuickForm_header * * @param HTML_QuickForm_Renderer $renderer a HTML_QuickForm_Renderer object */ - function accept(&$renderer) + function accept(&$renderer, $required=false, $error=null) { $this->_text .= $this->getHelpButton(); $renderer->renderHeader($this); diff --git a/lib/form/tags.php b/lib/form/tags.php index 9f73b178768..bdaa1337cdd 100644 --- a/lib/form/tags.php +++ b/lib/form/tags.php @@ -150,7 +150,8 @@ class MoodleQuickForm_tags extends MoodleQuickForm_group { // Create the element. $size = min(5, count($officialtags)); - $officialtagsselect = MoodleQuickForm::createElement('select', 'officialtags', $label, $officialtags, array('size' => $size)); + // E_STRICT creating elements without forms is nasty because it internally uses $this + $officialtagsselect = @MoodleQuickForm::createElement('select', 'officialtags', $label, $officialtags, array('size' => $size)); $officialtagsselect->setMultiple(true); if ($noofficial) { $officialtagsselect->updateAttributes(array('disabled' => 'disabled')); @@ -165,7 +166,8 @@ class MoodleQuickForm_tags extends MoodleQuickForm_group { } else { $label = get_string('entertags', 'tag'); } - $othertags = MoodleQuickForm::createElement('textarea', 'othertags', $label, array('cols'=>'40', 'rows'=>'5')); + // E_STRICT creating elements without forms is nasty because it internally uses $this + $othertags = @MoodleQuickForm::createElement('textarea', 'othertags', $label, array('cols'=>'40', 'rows'=>'5')); $this->_elements[] = $othertags; } diff --git a/lib/formslib.php b/lib/formslib.php index 9fd09d963e8..a00506416a9 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -62,7 +62,9 @@ function pear_handle_error($error){ } if (!empty($CFG->debug) and $CFG->debug >= DEBUG_ALL){ - PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_handle_error'); + //TODO: this is a wrong place to init PEAR! + $GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_CALLBACK; + $GLOBALS['_PEAR_default_error_options'] = 'pear_handle_error'; } /** @@ -1638,7 +1640,7 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { } foreach ($elementList as $elementName) { $value = $this->exportValue($elementName); - if (PEAR::isError($value)) { + if (@PEAR::isError($value)) { return $value; } //oh, stock QuickFOrm was returning array of arrays! 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/lib/grade/grade_grade.php b/lib/grade/grade_grade.php index e3568a39316..a51586be56b 100644 --- a/lib/grade/grade_grade.php +++ b/lib/grade/grade_grade.php @@ -400,7 +400,7 @@ class grade_grade extends grade_object { * @param array $items array of all grade item ids * @return void */ - public function check_locktime_all($items) { + public static function check_locktime_all($items) { global $CFG, $DB; $now = time(); // no rounding needed, this is not supposed to be called every 10 seconds diff --git a/lib/grade/grade_scale.php b/lib/grade/grade_scale.php index 5483ce04860..d26f10a0ce0 100644 --- a/lib/grade/grade_scale.php +++ b/lib/grade/grade_scale.php @@ -244,7 +244,7 @@ class grade_scale extends grade_object { * * @return object */ - public function fetch_all_global() { + public static function fetch_all_global() { return grade_scale::fetch_all(array('courseid'=>0)); } diff --git a/lib/pear/HTML/QuickForm.php b/lib/pear/HTML/QuickForm.php index 62dc2d09d19..ccca6fb13bd 100644 --- a/lib/pear/HTML/QuickForm.php +++ b/lib/pear/HTML/QuickForm.php @@ -329,7 +329,7 @@ class HTML_QuickForm extends HTML_Common { * @access public * @return void */ - function registerElementType($typeName, $include, $className) + static function registerElementType($typeName, $include, $className) { $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][strtolower($typeName)] = array($include, $className); } // end func registerElementType @@ -348,7 +348,7 @@ class HTML_QuickForm extends HTML_Common { * @access public * @return void */ - function registerRule($ruleName, $type, $data1, $data2 = null) + static function registerRule($ruleName, $type, $data1, $data2 = null) { include_once('HTML/QuickForm/RuleRegistry.php'); $registry =& HTML_QuickForm_RuleRegistry::singleton(); @@ -600,7 +600,7 @@ class HTML_QuickForm extends HTML_Common { } else { $args = func_get_args(); $elementObject =& $this->_loadElement('addElement', $element, array_slice($args, 1)); - if (PEAR::isError($elementObject)) { + if (@PEAR::isError($elementObject)) { return $elementObject; } } @@ -1260,8 +1260,10 @@ class HTML_QuickForm extends HTML_Common { * @param array $b array which will be merged into first one * @return array merged array */ - function arrayMerge($a, $b) + static function arrayMerge($a, $b) { + if (is_null($a)) {$a = array();} + if (is_null($b)) {$b = array();} foreach ($b as $k => $v) { if (is_array($v)) { if (isset($a[$k]) && !is_array($a[$k])) { diff --git a/lib/pear/HTML/QuickForm/RuleRegistry.php b/lib/pear/HTML/QuickForm/RuleRegistry.php index 6e65362e812..7372dc3ce00 100644 --- a/lib/pear/HTML/QuickForm/RuleRegistry.php +++ b/lib/pear/HTML/QuickForm/RuleRegistry.php @@ -44,7 +44,7 @@ class HTML_QuickForm_RuleRegistry * @static * @return object Reference to the HTML_QuickForm_RuleRegistry singleton */ - function &singleton() + static function &singleton() { static $obj; if (!isset($obj)) { diff --git a/lib/pear/HTML/QuickForm/advcheckbox.php b/lib/pear/HTML/QuickForm/advcheckbox.php index 0a9089f66e8..cc14b715dbf 100644 --- a/lib/pear/HTML/QuickForm/advcheckbox.php +++ b/lib/pear/HTML/QuickForm/advcheckbox.php @@ -27,15 +27,15 @@ require_once('HTML/QuickForm/checkbox.php'); * Basically this fixes a problem that HTML has had * where checkboxes can only pass a single value (the * value of the checkbox when checked). A value for when - * the checkbox is not checked cannot be passed, and + * the checkbox is not checked cannot be passed, and * furthermore the checkbox variable doesn't even exist if * the checkbox was submitted unchecked. * * It works by prepending a hidden field with the same name and * another "unchecked" value to the checbox. If the checkbox is * checked, PHP overwrites the value of the hidden field with - * its value. - * + * its value. + * * @author Jason Rust * @since 2.0 * @access public @@ -65,13 +65,13 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox /** * Class constructor - * + * * @param string $elementName (optional)Input field name attribute - * @param string $elementLabel (optional)Input field label + * @param string $elementLabel (optional)Input field label * @param string $text (optional)Text to put after the checkbox - * @param mixed $attributes (optional)Either a typical HTML attribute string + * @param mixed $attributes (optional)Either a typical HTML attribute string * or an associative array - * @param mixed $values (optional)Values to pass if checked or not checked + * @param mixed $values (optional)Values to pass if checked or not checked * * @since 1.0 * @access public @@ -82,7 +82,7 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox $this->HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes); $this->setValues($values); } //end constructor - + // }}} // {{{ getPrivateName() @@ -139,7 +139,7 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox // give it default checkbox behavior $this->_values = array('', 1); } elseif (is_scalar($values)) { - // if it's string, then assume the value to + // if it's string, then assume the value to // be passed is for when the element is checked $this->_values = array('', $values); } else { @@ -154,7 +154,7 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox /** * Sets the element's value - * + * * @param mixed Element's value * @access public */ @@ -188,7 +188,7 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox /** * Returns the checkbox element in HTML * and the additional hidden element in HTML - * + * * @access public * @return string */ @@ -198,14 +198,14 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox return parent::toHtml(); } else { return '_getAttrString(array( - 'type' => 'hidden', - 'name' => $this->getName(), + 'type' => 'hidden', + 'name' => $this->getName(), 'value' => $this->_values[0] )) . ' />' . parent::toHtml(); - + } } //end func toHtml - + // }}} // {{{ getFrozenHtml() @@ -262,7 +262,7 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox * This element has a value even if it is not checked, thus we override * checkbox's behaviour here */ - function exportValue(&$submitValues, $assoc) + function exportValue(&$submitValues, $assoc = false) { $value = $this->_findValue($submitValues); if (null === $value) { diff --git a/lib/pear/HTML/QuickForm/header.php b/lib/pear/HTML/QuickForm/header.php index b1745ab3d1f..b13eb2df4db 100644 --- a/lib/pear/HTML/QuickForm/header.php +++ b/lib/pear/HTML/QuickForm/header.php @@ -21,7 +21,7 @@ require_once 'HTML/QuickForm/static.php'; /** - * A pseudo-element used for adding headers to form + * A pseudo-element used for adding headers to form * * @author Alexey Borzov * @access public @@ -32,7 +32,7 @@ class HTML_QuickForm_header extends HTML_QuickForm_static /** * Class constructor - * + * * @param string $elementName Header name * @param string $text Header text * @access public @@ -52,9 +52,9 @@ class HTML_QuickForm_header extends HTML_QuickForm_static * * @param object An HTML_QuickForm_Renderer object * @access public - * @return void + * @return void */ - function accept(&$renderer) + function accept(&$renderer, $required=false, $error=null) { $renderer->renderHeader($this); } // end func accept diff --git a/lib/pear/HTML/QuickForm/hidden.php b/lib/pear/HTML/QuickForm/hidden.php index acd4a48aa20..e758aeef81d 100644 --- a/lib/pear/HTML/QuickForm/hidden.php +++ b/lib/pear/HTML/QuickForm/hidden.php @@ -23,7 +23,7 @@ require_once("HTML/QuickForm/input.php"); /** * HTML class for a hidden type element - * + * * @author Adam Daniel * @author Bertrand Mansion * @version 1.0 @@ -36,10 +36,10 @@ class HTML_QuickForm_hidden extends HTML_QuickForm_input /** * Class constructor - * + * * @param string $elementName (optional)Input field name attribute * @param string $value (optional)Input field value - * @param mixed $attributes (optional)Either a typical HTML attribute string + * @param mixed $attributes (optional)Either a typical HTML attribute string * or an associative array * @since 1.0 * @access public @@ -51,13 +51,13 @@ class HTML_QuickForm_hidden extends HTML_QuickForm_input $this->setType('hidden'); $this->setValue($value); } //end constructor - + // }}} // {{{ freeze() /** * Freeze the element so that only its value is returned - * + * * @access public * @return void */ @@ -74,9 +74,9 @@ class HTML_QuickForm_hidden extends HTML_QuickForm_input * * @param object An HTML_QuickForm_Renderer object * @access public - * @return void + * @return void */ - function accept(&$renderer) + function accept(&$renderer, $required=false, $error=null) { $renderer->renderHidden($this); } // end func accept diff --git a/lib/pear/HTML/QuickForm/hiddenselect.php b/lib/pear/HTML/QuickForm/hiddenselect.php index 3fb26b2cb6a..458aa5c3ddc 100644 --- a/lib/pear/HTML/QuickForm/hiddenselect.php +++ b/lib/pear/HTML/QuickForm/hiddenselect.php @@ -29,7 +29,7 @@ require_once('HTML/QuickForm/select.php'); * selected values to be passed. * * @author Isaac Shepard - * + * * @version 1.0 * @since 2.1 * @access public @@ -37,10 +37,10 @@ require_once('HTML/QuickForm/select.php'); class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select { // {{{ constructor - + /** * Class constructor - * + * * @param string Select name attribute * @param mixed Label(s) for the select (not used) * @param mixed Data to be used to populate options @@ -58,7 +58,7 @@ class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select $this->load($options); } } //end constructor - + // }}} // {{{ toHtml() @@ -68,7 +68,7 @@ class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select * @since 1.0 * @access public * @return string - * @throws + * @throws */ function toHtml() { @@ -90,14 +90,14 @@ class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select return $strHtml; } //end func toHtml - + // }}} // {{{ accept() /** - * This is essentially a hidden element and should be rendered as one + * This is essentially a hidden element and should be rendered as one */ - function accept(&$renderer) + function accept(&$renderer, $required=false, $error=null) { $renderer->renderHidden($this); } diff --git a/lib/pear/HTML/QuickForm/html.php b/lib/pear/HTML/QuickForm/html.php index 6d96e4f6440..10b773e1372 100644 --- a/lib/pear/HTML/QuickForm/html.php +++ b/lib/pear/HTML/QuickForm/html.php @@ -22,7 +22,7 @@ require_once 'HTML/QuickForm/static.php'; /** * A pseudo-element used for adding raw HTML to form - * + * * Intended for use with the default renderer only, template-based * ones may (and probably will) completely ignore this * @@ -35,7 +35,7 @@ class HTML_QuickForm_html extends HTML_QuickForm_static /** * Class constructor - * + * * @param string $text raw HTML to add * @access public * @return void @@ -54,9 +54,9 @@ class HTML_QuickForm_html extends HTML_QuickForm_static * * @param object An HTML_QuickForm_Renderer object * @access public - * @return void + * @return void */ - function accept(&$renderer) + function accept(&$renderer, $required=false, $error=null) { $renderer->renderHtml($this); } // end func accept diff --git a/lib/portfolio/forms.php b/lib/portfolio/forms.php index 7a779fab512..ba408f78486 100644 --- a/lib/portfolio/forms.php +++ b/lib/portfolio/forms.php @@ -77,8 +77,8 @@ final class portfolio_export_form extends moodleform { && $this->_customdata['expectedtime'] != PORTFOLIO_TIME_LOW && $this->_customdata['expectedtime'] != PORTFOLIO_TIME_FORCEQUEUE) { $radioarray = array(); - $radioarray[] = &MoodleQuickForm::createElement('radio', 'wait', '', get_string('wait', 'portfolio'), 1); - $radioarray[] = &MoodleQuickForm::createElement('radio', 'wait', '', get_string('dontwait', 'portfolio'), 0); + $radioarray[] = $mform->createElement('radio', 'wait', '', get_string('wait', 'portfolio'), 1); + $radioarray[] = $mform->createElement('radio', 'wait', '', get_string('dontwait', 'portfolio'), 0); $mform->addGroup($radioarray, 'radioar', get_string('wanttowait_' . $this->_customdata['expectedtime'], 'portfolio') , array(' '), false); $mform->setDefault('wait', 0); } else { diff --git a/lib/upgradelib.php b/lib/upgradelib.php index e58c69a9c49..4f2544822bc 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -1707,7 +1707,8 @@ function upgrade_plugin_mnet_functions($component) { * @return array */ function admin_mnet_method_profile(Zend_Server_Reflection_Function_Abstract $function) { - $proto = array_pop($function->getPrototypes()); + $protos = $function->getPrototypes(); + $proto = array_pop($protos); $ret = $proto->getReturnValue(); $profile = array( 'parameters' => array(), diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 5b1fa8d4d20..12fcf56cf6d 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -2560,7 +2560,7 @@ class mod_assignment_grading_form extends moodleform { } } - function add_action_buttons() { + function add_action_buttons($cancel = true, $submitlabel = NULL) { $mform =& $this->_form; //if there are more to be graded. if ($this->_customdata->nextid>0) { @@ -3211,7 +3211,7 @@ function assignment_print_recent_activity($course, $viewfullnames, $timestart) { return false; } - $modinfo =& get_fast_modinfo($course); // reference needed because we might load the groups + $modinfo = get_fast_modinfo($course); // reference needed because we might load the groups $show = array(); $grader = array(); @@ -3294,7 +3294,7 @@ function assignment_get_recent_mod_activity(&$activities, &$index, $timestart, $ $course = $DB->get_record('course', array('id'=>$courseid)); } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $cm = $modinfo->cms[$cmid]; diff --git a/mod/assignment/type/offline/assignment.class.php b/mod/assignment/type/offline/assignment.class.php index 04097dc8b7f..71942680a6c 100644 --- a/mod/assignment/type/offline/assignment.class.php +++ b/mod/assignment/type/offline/assignment.class.php @@ -18,7 +18,7 @@ class assignment_offline extends assignment_base { return '';//does nothing! } - function prepare_new_submission($userid) { + function prepare_new_submission($userid, $teachermodified=false) { $submission = new stdClass(); $submission->assignment = $this->assignment->id; $submission->userid = $userid; @@ -37,7 +37,7 @@ class assignment_offline extends assignment_base { } // needed for the timemodified override - function process_feedback() { + function process_feedback($formdata=null) { global $CFG, $USER, $DB; require_once($CFG->libdir.'/gradelib.php'); diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index b705528be3c..0985666d170 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -214,8 +214,15 @@ class assignment_online extends assignment_base { return $output; } - function print_user_files($userid, $return=false) { - global $OUTPUT, $CFG; + function print_user_files($userid=0, $return=false) { + global $OUTPUT, $CFG, $USER; + + if (!$userid) { + if (!isloggedin()) { + return ''; + } + $userid = $USER->id; + } if (!$submission = $this->get_submission($userid)) { return ''; diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index 117ebf4cb85..0b537d5adb4 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -383,7 +383,7 @@ class assignment_upload extends assignment_base { parent::submissions($mode); } - function process_feedback() { + function process_feedback($formdata=null) { if (!$feedback = data_submitted() or !confirm_sesskey()) { // No incoming data? return false; } diff --git a/mod/assignment/type/uploadsingle/assignment.class.php b/mod/assignment/type/uploadsingle/assignment.class.php index 08cd0068468..a3998d89dd6 100644 --- a/mod/assignment/type/uploadsingle/assignment.class.php +++ b/mod/assignment/type/uploadsingle/assignment.class.php @@ -92,7 +92,7 @@ class assignment_uploadsingle extends assignment_base { $this->view_footer(); } - function process_feedback() { + function process_feedback($formdata=null) { if (!$feedback = data_submitted() or !confirm_sesskey()) { // No incoming data? return false; } diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 283c99abc00..ba6b622404c 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -267,7 +267,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) { $past = array(); $current = array(); - $modinfo =& get_fast_modinfo($course); // reference needed because we might load the groups + $modinfo = get_fast_modinfo($course); // reference needed because we might load the groups foreach ($mcms as $cmid=>$mcm) { if (!array_key_exists($cmid, $modinfo->cms)) { diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index afacc4a9a6a..70812f68b41 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -27,10 +27,10 @@ class mod_choice_mod_form extends moodleform_mod { //------------------------------------------------------------------------------- $repeatarray = array(); - $repeatarray[] = &MoodleQuickForm::createElement('header', '', get_string('option','choice').' {no}'); - $repeatarray[] = &MoodleQuickForm::createElement('text', 'option', get_string('option','choice')); - $repeatarray[] = &MoodleQuickForm::createElement('text', 'limit', get_string('limit','choice')); - $repeatarray[] = &MoodleQuickForm::createElement('hidden', 'optionid', 0); + $repeatarray[] = $mform->createElement('header', '', get_string('option','choice').' {no}'); + $repeatarray[] = $mform->createElement('text', 'option', get_string('option','choice')); + $repeatarray[] = $mform->createElement('text', 'limit', get_string('limit','choice')); + $repeatarray[] = $mform->createElement('hidden', 'optionid', 0); $menuoptions = array(); $menuoptions[0] = get_string('disable'); diff --git a/mod/data/export_form.php b/mod/data/export_form.php index 7b045da46bd..054397ce458 100644 --- a/mod/data/export_form.php +++ b/mod/data/export_form.php @@ -29,11 +29,11 @@ class mod_data_export_form extends moodleform { unset($choices[$key]); } $typesarray = array(); - $typesarray[] = &MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('csvwithselecteddelimiter', 'data') . ' ', 'csv'); - $typesarray[] = &MoodleQuickForm::createElement('select', 'delimiter_name', null, $choices); + $typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('csvwithselecteddelimiter', 'data') . ' ', 'csv'); + $typesarray[] = $mform->createElement('select', 'delimiter_name', null, $choices); //temporarily commenting out Excel export option. See MDL-19864 - //$typesarray[] = &MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('excel', 'data'), 'xls'); - $typesarray[] = &MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('ods', 'data'), 'ods'); + //$typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('excel', 'data'), 'xls'); + $typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('ods', 'data'), 'ods'); $mform->addGroup($typesarray, 'exportar', '', array(''), false); $mform->addRule('exportar', null, 'required'); $mform->setDefault('exporttype', 'csv'); diff --git a/mod/feedback/lib.php b/mod/feedback/lib.php index ae6cd7fe803..45a9a3d2301 100644 --- a/mod/feedback/lib.php +++ b/mod/feedback/lib.php @@ -344,7 +344,7 @@ function feedback_get_recent_mod_activity(&$activities, &$index, $course = $DB->get_record('course', array('id'=>$courseid)); } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $cm = $modinfo->cms[$cmid]; diff --git a/mod/forum/index.php b/mod/forum/index.php index c15b40b9000..5899c412bcc 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -116,7 +116,7 @@ $forums = $DB->get_records('forum', array('course' => $course->id)); $generalforums = array(); $learningforums = array(); -$modinfo =& get_fast_modinfo($course); +$modinfo = get_fast_modinfo($course); if (!isset($modinfo->instances['forum'])) { $modinfo->instances['forum'] = array(); diff --git a/mod/forum/lib.php b/mod/forum/lib.php index a3677dd15d9..eb78a1474bf 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1373,7 +1373,7 @@ function forum_print_recent_activity($course, $viewfullnames, $timestart) { return false; } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $groupmodes = array(); $cms = array(); @@ -1858,7 +1858,7 @@ function forum_get_readable_forums($userid, $courseid=0) { foreach ($courses as $course) { - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); if (is_null($modinfo->groups)) { $modinfo->groups = groups_get_user_groups($course->id, $userid); } @@ -2442,7 +2442,7 @@ function forum_count_discussions($forum, $cm, $course) { require_once($CFG->dirroot.'/course/lib.php'); - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); if (is_null($modinfo->groups)) { $modinfo->groups = groups_get_user_groups($course->id, $USER->id); } @@ -5750,7 +5750,7 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours $course = $DB->get_record('course', array('id' => $courseid)); } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $cm = $modinfo->cms[$cmid]; $params = array($timestart, $cm->instance); @@ -6451,7 +6451,7 @@ function forum_tp_count_forum_unread_posts($cm, $course) { require_once($CFG->dirroot.'/course/lib.php'); - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); if (is_null($modinfo->groups)) { $modinfo->groups = groups_get_user_groups($course->id, $USER->id); } diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 0925fa0df72..f35864e89b3 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -830,7 +830,7 @@ abstract class lesson_add_page_form_base extends moodleform { * * @return bool */ - public function construction_override() { + public function construction_override($pageid, lesson $lesson) { return true; } } @@ -1620,14 +1620,16 @@ abstract class lesson_base { return !empty($this->properties->{$key}); } + //NOTE: E_STRICT does not allow to change function signature! + /** - * If overridden should create a new instance, save it in the DB and return it + * If implemented should create a new instance, save it in the DB and return it */ - public static function create() {} + //public static function create() {} /** - * If overridden should load an instance from the DB and return it + * If implemented should load an instance from the DB and return it */ - public static function load() {} + //public static function load() {} /** * Fetches all of the properties of the object * @return stdClass diff --git a/mod/lesson/pagetypes/branchtable.php b/mod/lesson/pagetypes/branchtable.php index dffa778fbe4..3965bf72cb0 100644 --- a/mod/lesson/pagetypes/branchtable.php +++ b/mod/lesson/pagetypes/branchtable.php @@ -72,7 +72,7 @@ class lesson_page_type_branchtable extends lesson_page { return $jumps; } - public static function get_jumptooptions($firstpage, $lesson) { + public static function get_jumptooptions($firstpage, lesson $lesson) { global $DB, $PAGE; $jump = array(); $jump[0] = get_string("thispage", "lesson"); @@ -199,7 +199,7 @@ class lesson_page_type_branchtable extends lesson_page { redirect(new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id,'pageid'=>$newpageid))); } - public function display_answers($table) { + public function display_answers(html_table $table) { $answers = $this->get_answers(); $options = new stdClass; $options->noclean = true; @@ -243,7 +243,7 @@ class lesson_page_type_branchtable extends lesson_page { return $answerpage; } - public function update($properties) { + public function update($properties, $context = null, $maxbytes = null) { if (empty($properties->display)) { $properties->display = '0'; } diff --git a/mod/lesson/pagetypes/endofbranch.php b/mod/lesson/pagetypes/endofbranch.php index 7d24849a9b8..f328429abb5 100644 --- a/mod/lesson/pagetypes/endofbranch.php +++ b/mod/lesson/pagetypes/endofbranch.php @@ -99,7 +99,7 @@ class lesson_page_type_endofbranch extends lesson_page { public function get_grayout() { return 1; } - public function update($properties) { + public function update($properties, $context = null, $maxbytes = null) { global $DB, $PAGE; $properties->id = $this->properties->id; @@ -178,7 +178,7 @@ class lesson_add_page_form_endofbranch extends lesson_add_page_form_base { $this->add_jumpto(0); } - public function construction_override($pageid, $lesson) { + public function construction_override($pageid, lesson $lesson) { global $DB, $CFG, $PAGE; require_sesskey(); diff --git a/mod/lesson/pagetypes/endofcluster.php b/mod/lesson/pagetypes/endofcluster.php index 290609def74..05b3f6d6182 100644 --- a/mod/lesson/pagetypes/endofcluster.php +++ b/mod/lesson/pagetypes/endofcluster.php @@ -68,7 +68,7 @@ class lesson_page_type_endofcluster extends lesson_page { public function get_grayout() { return 1; } - public function update($properties) { + public function update($properties, $context = null, $maxbytes = null) { global $DB, $PAGE; $properties->id = $this->properties->id; @@ -160,7 +160,7 @@ class lesson_add_page_form_endofcluster extends lesson_add_page_form_base { $this->add_jumpto(0); } - public function construction_override($pageid, $lesson) { + public function construction_override($pageid, lesson $lesson) { global $CFG, $PAGE, $DB; require_sesskey(); diff --git a/mod/lesson/pagetypes/essay.php b/mod/lesson/pagetypes/essay.php index 43f8e1447b6..78323ec299b 100644 --- a/mod/lesson/pagetypes/essay.php +++ b/mod/lesson/pagetypes/essay.php @@ -126,7 +126,7 @@ class lesson_page_type_essay extends lesson_page { $result->studentanswer = s($studentanswer); return $result; } - public function update($properties) { + public function update($properties, $context = null, $maxbytes = null) { global $DB, $PAGE; $answers = $this->get_answers(); $properties->id = $this->properties->id; diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php index 2ba1aa57add..057297828d7 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -293,7 +293,7 @@ class lesson_page_type_matching extends lesson_page { * @param stdClass $properties * @return bool */ - public function update($properties) { + public function update($properties, $context = null, $maxbytes = null) { global $DB, $PAGE; $answers = $this->get_answers(); $properties->id = $this->properties->id; diff --git a/mod/lesson/pagetypes/truefalse.php b/mod/lesson/pagetypes/truefalse.php index 7ce13ecc93d..8566244a3ef 100644 --- a/mod/lesson/pagetypes/truefalse.php +++ b/mod/lesson/pagetypes/truefalse.php @@ -153,7 +153,7 @@ class lesson_page_type_truefalse extends lesson_page { * @param stdClass $properties * @return bool */ - public function update($properties) { + public function update($properties, $context = null, $maxbytes = null) { global $DB, $PAGE; $answers = $this->get_answers(); $properties->id = $this->properties->id; diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 32ef8bf03ef..df9d9d16e40 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -763,7 +763,7 @@ function quiz_get_recent_mod_activity(&$activities, &$index, $timestart, $course = $DB->get_record('course', array('id' => $courseid)); } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $cm = $modinfo->cms[$cmid]; $quiz = $DB->get_record('quiz', array('id' => $cm->instance)); diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index a4b8620bc73..6190daa4a6f 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -317,10 +317,10 @@ class mod_quiz_mod_form extends moodleform_mod { $repeatarray = array(); $repeatedoptions = array(); - $repeatarray[] = MoodleQuickForm::createElement('editor', 'feedbacktext', + $repeatarray[] = $mform->createElement('editor', 'feedbacktext', get_string('feedback', 'quiz'), null, array('maxfiles' => EDITOR_UNLIMITED_FILES, 'noclean' => true, 'context' => $this->context)); - $repeatarray[] = MoodleQuickForm::createElement('text', 'feedbackboundaries', + $repeatarray[] = $mform->createElement('text', 'feedbackboundaries', get_string('gradeboundary', 'quiz'), array('size' => 10)); $repeatedoptions['feedbacktext']['type'] = PARAM_RAW; $repeatedoptions['feedbackboundaries']['type'] = PARAM_RAW; @@ -338,12 +338,12 @@ class mod_quiz_mod_form extends moodleform_mod { get_string('addmoreoverallfeedbacks', 'quiz'), true); // Put some extra elements in before the button - $mform->insertElementBefore(MoodleQuickForm::createElement('editor', + $mform->insertElementBefore($mform->createElement('editor', "feedbacktext[$nextel]", get_string('feedback', 'quiz'), null, array('maxfiles' => EDITOR_UNLIMITED_FILES, 'noclean' => true, 'context' => $this->context)), 'boundary_add_fields'); - $mform->insertElementBefore(MoodleQuickForm::createElement('static', + $mform->insertElementBefore($mform->createElement('static', 'gradeboundarystatic2', get_string('gradeboundary', 'quiz'), '0%'), 'boundary_add_fields'); diff --git a/mod/wiki/lib.php b/mod/wiki/lib.php index d1e78cb7fee..9dbd3f110e8 100644 --- a/mod/wiki/lib.php +++ b/mod/wiki/lib.php @@ -288,7 +288,7 @@ function wiki_print_recent_activity($course, $viewfullnames, $timestart) { if (!$pages = $DB->get_records_sql($sql, array($timestart, $course->id))) { return false; } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $wikis = array(); diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index c3adb19fa0d..5c44c504569 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -343,7 +343,7 @@ function workshop_print_recent_activity($course, $viewfullnames, $timestart) { $rs = $DB->get_recordset_sql($sql, array($course->id, $timestart, $timestart)); - $modinfo =& get_fast_modinfo($course); // reference needed because we might load the groups + $modinfo = get_fast_modinfo($course); // reference needed because we might load the groups $submissions = array(); // recent submissions indexed by submission id $assessments = array(); // recent assessments indexed by assessment id @@ -552,7 +552,7 @@ function workshop_get_recent_mod_activity(&$activities, &$index, $timestart, $co $course = $DB->get_record('course', array('id'=>$courseid)); } - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); $cm = $modinfo->cms[$cmid]; diff --git a/question/behaviour/deferredcbm/behaviour.php b/question/behaviour/deferredcbm/behaviour.php index 1c6bcf2e2d1..f1aa74fef76 100644 --- a/question/behaviour/deferredcbm/behaviour.php +++ b/question/behaviour/deferredcbm/behaviour.php @@ -82,13 +82,13 @@ class qbehaviour_deferredcbm extends qbehaviour_deferredfeedback { } } - protected function is_same_response($pendingstep) { + protected function is_same_response(question_attempt_step $pendingstep) { return parent::is_same_response($pendingstep) && $this->qa->get_last_behaviour_var('certainty') == $pendingstep->get_behaviour_var('certainty'); } - protected function is_complete_response($pendingstep) { + protected function is_complete_response(question_attempt_step $pendingstep) { return parent::is_complete_response($pendingstep) && $pendingstep->has_behaviour_var('certainty'); } diff --git a/question/behaviour/immediatecbm/behaviour.php b/question/behaviour/immediatecbm/behaviour.php index a188c2c871a..b8515b241e2 100644 --- a/question/behaviour/immediatecbm/behaviour.php +++ b/question/behaviour/immediatecbm/behaviour.php @@ -80,13 +80,13 @@ class qbehaviour_immediatecbm extends qbehaviour_immediatefeedback { } } - protected function is_same_response($pendingstep) { + protected function is_same_response(question_attempt_step $pendingstep) { return parent::is_same_response($pendingstep) && $this->qa->get_last_behaviour_var('certainty') == $pendingstep->get_behaviour_var('certainty'); } - protected function is_complete_response($pendingstep) { + protected function is_complete_response(question_attempt_step $pendingstep) { return parent::is_complete_response($pendingstep) && $pendingstep->has_behaviour_var('certainty'); } 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/engine/bank.php b/question/engine/bank.php index 5a3118b98ee..2864f048af9 100644 --- a/question/engine/bank.php +++ b/question/engine/bank.php @@ -324,7 +324,7 @@ abstract class question_bank { self::$testdata[$question->id] = $question; } - protected function ensure_fraction_options_initialised() { + protected static function ensure_fraction_options_initialised() { if (!is_null(self::$fractionoptions)) { return; } diff --git a/question/engine/questionattempt.php b/question/engine/questionattempt.php index 4a2253ebcef..070c4fc56b5 100644 --- a/question/engine/questionattempt.php +++ b/question/engine/questionattempt.php @@ -1277,10 +1277,10 @@ class question_attempt_with_restricted_history extends question_attempt { protected function add_step(question_attempt_step $step) { coding_exception('Cannot modify a question_attempt_with_restricted_history.'); } - public function process_action($submitteddata, $timestamp = null, $userid = null) { + public function process_action($submitteddata, $timestamp = null, $userid = null, $existingstepid = null) { coding_exception('Cannot modify a question_attempt_with_restricted_history.'); } - public function start($preferredbehaviour, $variant, $submitteddata = array(), $timestamp = null, $userid = null) { + public function start($preferredbehaviour, $variant, $submitteddata = array(), $timestamp = null, $userid = null, $existingstepid = null) { coding_exception('Cannot modify a question_attempt_with_restricted_history.'); } 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); diff --git a/question/type/calculated/edit_calculated_form.php b/question/type/calculated/edit_calculated_form.php index 76dc6cd7288..a7af2824803 100644 --- a/question/type/calculated/edit_calculated_form.php +++ b/question/type/calculated/edit_calculated_form.php @@ -162,8 +162,8 @@ class qtype_calculated_edit_form extends qtype_numerical_edit_form { return $question; } - protected function data_preprocessing_answers($question) { - $question = parent::data_preprocessing_answers($question); + protected function data_preprocessing_answers($question, $withanswerfiles = false) { + $question = parent::data_preprocessing_answers($question, $withanswerfiles); if (empty($question->options->answers)) { return $question; } diff --git a/question/type/calculatedmulti/edit_calculatedmulti_form.php b/question/type/calculatedmulti/edit_calculatedmulti_form.php index ff2b9864355..0ac528bb33f 100644 --- a/question/type/calculatedmulti/edit_calculatedmulti_form.php +++ b/question/type/calculatedmulti/edit_calculatedmulti_form.php @@ -194,8 +194,8 @@ class qtype_calculatedmulti_edit_form extends question_edit_form { return $question; } - protected function data_preprocessing_answers($question) { - $question = parent::data_preprocessing_answers($question); + protected function data_preprocessing_answers($question, $withanswerfiles = false) { + $question = parent::data_preprocessing_answers($question, $withanswerfiles); if (empty($question->options->answers)) { return $question; } diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index 3dc969aa496..5196bd5ffa2 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -190,7 +190,7 @@ class qtype_multianswer extends question_type { parent::delete_question($questionid, $contextid); } - protected function initialise_question_instance($question, $questiondata) { + protected function initialise_question_instance(question_definition $question, $questiondata) { parent::initialise_question_instance($question, $questiondata); $bits = preg_split('/\{#(\d+)\}/', $question->questiontext, diff --git a/question/type/numerical/edit_numerical_form.php b/question/type/numerical/edit_numerical_form.php index 2775ef0b8d5..24ec05c440f 100644 --- a/question/type/numerical/edit_numerical_form.php +++ b/question/type/numerical/edit_numerical_form.php @@ -174,8 +174,8 @@ class qtype_numerical_edit_form extends question_edit_form { return $question; } - protected function data_preprocessing_answers($question) { - $question = parent::data_preprocessing_answers($question); + protected function data_preprocessing_answers($question, $withanswerfiles = false) { + $question = parent::data_preprocessing_answers($question, $withanswerfiles); if (empty($question->options->answers)) { return $question; } diff --git a/repository/coursefiles/lib.php b/repository/coursefiles/lib.php index 8b0fa15773e..9a12e85ae11 100644 --- a/repository/coursefiles/lib.php +++ b/repository/coursefiles/lib.php @@ -41,7 +41,7 @@ class repository_coursefiles extends repository { * @param string $encodedpath * @return mixed */ - public function get_listing($encodedpath = '') { + public function get_listing($encodedpath = '', $page = '') { global $CFG, $USER, $OUTPUT; $ret = array(); $ret['dynload'] = true; diff --git a/repository/lib.php b/repository/lib.php index eae607275dc..3cbea5b4d29 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -1952,7 +1952,7 @@ final class repository_instance_form extends moodleform { } } - public function validation($data) { + public function validation($data, $files) { global $DB; $errors = array(); $plugin = $this->_customdata['plugin']; @@ -2062,7 +2062,7 @@ final class repository_type_form extends moodleform { $this->add_action_buttons(true, get_string('save','repository')); } - public function validation($data) { + public function validation($data, $files) { $errors = array(); $plugin = $this->_customdata['plugin']; $instance = (isset($this->_customdata['instance']) diff --git a/repository/local/lib.php b/repository/local/lib.php index 14a1948ee07..5ff5bdb51d2 100644 --- a/repository/local/lib.php +++ b/repository/local/lib.php @@ -41,7 +41,7 @@ class repository_local extends repository { * @param string $encodedpath * @return mixed */ - public function get_listing($encodedpath = '') { + public function get_listing($encodedpath = '', $page = '') { global $CFG, $USER, $OUTPUT; $ret = array(); $ret['dynload'] = true; diff --git a/repository/merlot/lib.php b/repository/merlot/lib.php index 981a684b721..154889db862 100644 --- a/repository/merlot/lib.php +++ b/repository/merlot/lib.php @@ -68,7 +68,7 @@ class repository_merlot extends repository { * Get a list of links * @return array */ - public function get_listing() { + public function get_listing($path = '', $page = '') { $ret = array(); $ret['nologin'] = true; $ret['list'] = $this->_get_collection($this->keyword); diff --git a/repository/recent/lib.php b/repository/recent/lib.php index e9756dd73f4..0924458003b 100644 --- a/repository/recent/lib.php +++ b/repository/recent/lib.php @@ -132,8 +132,8 @@ class repository_recent extends repository { return array('recentfilesnumber', 'pluginname'); } - public function type_config_form($mform) { - parent::type_config_form($mform); + public function type_config_form($mform, $classname = 'repository') { + parent::type_config_form($mform, $classname); $number = get_config('repository_recent', 'recentfilesnumber'); if (empty($number)) { $number = DEFAULT_RECENT_FILES_NUM; diff --git a/repository/s3/lib.php b/repository/s3/lib.php index 0aa03fea8ad..9e0f734a631 100644 --- a/repository/s3/lib.php +++ b/repository/s3/lib.php @@ -50,7 +50,7 @@ class repository_s3 extends repository { * @param string $path * @return array The file list and options */ - public function get_listing($path = '') { + public function get_listing($path = '', $page = '') { global $CFG, $OUTPUT; if (empty($this->access_key)) { die(json_encode(array('e'=>get_string('needaccesskey', 'repository_s3')))); diff --git a/repository/upload/lib.php b/repository/upload/lib.php index 447fd0861e5..8b2641ea312 100644 --- a/repository/upload/lib.php +++ b/repository/upload/lib.php @@ -214,7 +214,7 @@ class repository_upload extends repository { * Return a upload form * @return array */ - public function get_listing() { + public function get_listing($path = '', $page = '') { global $CFG; $ret = array(); $ret['nologin'] = true; diff --git a/repository/user/lib.php b/repository/user/lib.php index 38d6d1ba3fc..c86eb3cb02b 100644 --- a/repository/user/lib.php +++ b/repository/user/lib.php @@ -41,7 +41,7 @@ class repository_user extends repository { * @param string $encodedpath * @return mixed */ - public function get_listing($encodedpath = '') { + public function get_listing($encodedpath = '', $page = '') { global $CFG, $USER, $OUTPUT; $ret = array(); $ret['dynload'] = true; diff --git a/rss/file.php b/rss/file.php index 16976c0b2e9..fdc4958e675 100644 --- a/rss/file.php +++ b/rss/file.php @@ -77,7 +77,7 @@ if ($token==="$inttoken") { //find the context id if ($course = $DB->get_record('course', array('id' => $courseid))) { - $modinfo =& get_fast_modinfo($course); + $modinfo = get_fast_modinfo($course); if (!isset($modinfo->instances[$componentname])) { $modinfo->instances[$componentname] = array(); diff --git a/user/filters/checkbox.php b/user/filters/checkbox.php index 61f5097a5cd..34ad74754a8 100644 --- a/user/filters/checkbox.php +++ b/user/filters/checkbox.php @@ -72,7 +72,7 @@ class user_filter_checkbox extends user_filter_type { * * @param moodleform $mform a MoodleQuickForm object in which element will be added */ - public function setupForm(MoodleQuickForm &$mform) { + public function setupForm(&$mform) { $objs = array(); $objs[] = $mform->createElement('checkbox', $this->_name, null, ''); diff --git a/webservice/xmlrpc/lib.php b/webservice/xmlrpc/lib.php index 06a5016839e..5b68fe253df 100644 --- a/webservice/xmlrpc/lib.php +++ b/webservice/xmlrpc/lib.php @@ -67,7 +67,7 @@ class webservice_xmlrpc_client extends Zend_XmlRpc_Client { * @param array $params the parameters of the function * @return mixed */ - public function call($functionname, $params) { + public function call($functionname, $params=array()) { global $DB, $CFG; //zend expects 0 based array with numeric indexes