diff --git a/cohort/edit.php b/cohort/edit.php index 5fc63b6fccb..250fd164e3e 100644 --- a/cohort/edit.php +++ b/cohort/edit.php @@ -46,7 +46,7 @@ if ($id) { if ($context->contextlevel != CONTEXT_COURSECAT and $context->contextlevel != CONTEXT_SYSTEM) { print_error('invalidcontext'); } - $cohort = new object(); + $cohort = new stdClass(); $cohort->id = 0; $cohort->contextid = $context->id; $cohort->name = ''; diff --git a/cohort/lib.php b/cohort/lib.php index 1b89be32a4d..9a084eb63b7 100644 --- a/cohort/lib.php +++ b/cohort/lib.php @@ -132,7 +132,7 @@ function cohort_delete_category($category) { */ function cohort_add_member($cohortid, $userid) { global $DB; - $record = new object(); + $record = new stdClass(); $record->cohortid = $cohortid; $record->userid = $userid; $record->timeadded = time(); diff --git a/comment/lib.php b/comment/lib.php index cce87d4420c..61036304d99 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -412,7 +412,7 @@ EOD; $candelete = has_capability('moodle/comment:delete', $this->context); $rs = $DB->get_recordset_sql($sql, $params, $start, $CFG->commentsperpage); foreach ($rs as $u) { - $c = new object(); + $c = new stdClass(); $c->id = $u->cid; $c->content = $u->ccontent; $c->format = $u->cformat; diff --git a/course/format/topics/format.php b/course/format/topics/format.php index b40ecaaea1f..be93c5d8f84 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -103,7 +103,7 @@ if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing()) $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); $summarytext = file_rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', $coursecontext->id, 'course', 'section', $thissection->id); - $summaryformatoptions = new object(); + $summaryformatoptions = new stdClass(); $summaryformatoptions->noclean = true; echo format_text($summarytext, $thissection->summaryformat, $summaryformatoptions); @@ -225,7 +225,7 @@ while ($section <= $course->numsections) { if ($thissection->summary) { $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); $summarytext = file_rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', $coursecontext->id, 'course', 'section', $thissection->id); - $summaryformatoptions = new object(); + $summaryformatoptions = new stdClass(); $summaryformatoptions->noclean = true; echo format_text($summarytext, $thissection->summaryformat, $summaryformatoptions); } else { diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 470f0532206..472725a5463 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -96,7 +96,7 @@ $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); $summarytext = file_rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', $coursecontext->id, 'course', 'section', $thissection->id); - $summaryformatoptions = new object(); + $summaryformatoptions = new stdClass(); $summaryformatoptions->noclean = true; echo format_text($summarytext, $thissection->summaryformat, $summaryformatoptions); @@ -227,7 +227,7 @@ echo '
'; $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); $summarytext = file_rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', $coursecontext->id, 'course', 'section', $thissection->id); - $summaryformatoptions = new object(); + $summaryformatoptions = new stdClass(); $summaryformatoptions->noclean = true; echo format_text($summarytext, $thissection->summaryformat, $summaryformatoptions); diff --git a/course/import/groups/index.php b/course/import/groups/index.php index eb5d373a40f..789163329dd 100755 --- a/course/import/groups/index.php +++ b/course/import/groups/index.php @@ -128,7 +128,7 @@ die; while (!feof ($fp)) { - $newgroup = new object();//to make Martin happy + $newgroup = new stdClass();//to make Martin happy foreach ($optionalDefaults as $key => $value) { $newgroup->$key = current_language(); //defaults to current language } diff --git a/course/index.php b/course/index.php index afdcf7efb0c..b1998ef8fa6 100644 --- a/course/index.php +++ b/course/index.php @@ -171,7 +171,7 @@ if (!empty($delete) and confirm_sesskey()) { /// Create a default category if necessary if (!$categories = get_categories()) { /// No category yet! // Try and make one - $tempcat = new object(); + $tempcat = new stdClass(); $tempcat->name = get_string('miscellaneous'); $tempcat->id = $DB->insert_record('course_categories', $tempcat); $tempcat->context = get_context_instance(CONTEXT_COURSECAT, $tempcat->id); diff --git a/course/lib.php b/course/lib.php index 8a68ed40a65..506b93e0301 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1207,7 +1207,7 @@ function course_set_display($courseid, $display=0) { } else if ($DB->record_exists("course_display", array("userid" => $USER->id, "course"=>$courseid))) { $DB->set_field("course_display", "display", $display, array("userid"=>$USER->id, "course"=>$courseid)); } else { - $record = new object(); + $record = new stdClass(); $record->userid = $USER->id; $record->course = $courseid; $record->display = $display; @@ -1270,7 +1270,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, $initialised = true; } - $labelformatoptions = new object(); + $labelformatoptions = new stdClass(); $labelformatoptions->noclean = true; /// Casting $course->modinfo to string prevents one notice when the field is null @@ -2514,7 +2514,7 @@ function get_course_section($section, $courseid) { if ($cw = $DB->get_record("course_sections", array("section"=>$section, "course"=>$courseid))) { return $cw; } - $cw = new object(); + $cw = new stdClass(); $cw->course = $courseid; $cw->section = $section; $cw->summary = ""; @@ -3062,7 +3062,7 @@ function update_restricted_mods($course, $mods) { if ($mod == 0) { continue; // this is the 'allow none' option } - $am = new object(); + $am = new stdClass(); $am->course = $course->id; $am->module = $mod; $DB->insert_record('course_allowed_modules',$am); @@ -3519,7 +3519,7 @@ function create_course($data, $editoroptions = NULL) { // Setup the blocks blocks_add_default_course_blocks($course); - $section = new object(); + $section = new stdClass(); $section->course = $course->id; // Create a default section. $section->section = 0; $section->summaryformat = FORMAT_HTML; @@ -3920,7 +3920,7 @@ class course_request { $this->delete(); - $a = new object(); + $a = new stdClass(); $a->name = $course->fullname; $a->url = $CFG->wwwroot.'/course/view.php?id=' . $course->id; $this->notify($user, $USER, 'courserequestapproved', get_string('courseapprovedsubject'), get_string('courseapprovedemail2', 'moodle', $a)); @@ -3961,7 +3961,7 @@ class course_request { * @param string $message */ protected function notify($touser, $fromuser, $name='courserequested', $subject, $message) { - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'moodle'; $eventdata->component = 'course'; $eventdata->name = $name; diff --git a/course/mod.php b/course/mod.php index 2d9b6b3c437..062760f08ba 100644 --- a/course/mod.php +++ b/course/mod.php @@ -148,7 +148,7 @@ if (!empty($add)) { } // Trigger a mod_deleted event with information about this module. - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = $cm->modname; $eventdata->cmid = $cm->id; $eventdata->courseid = $course->id; diff --git a/course/modedit.php b/course/modedit.php index 4b5583891d3..36dd26596d1 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -63,7 +63,7 @@ if (!empty($add)) { $cm = null; - $data = new object(); + $data = new stdClass(); $data->section = $section; // The section number itself - relative!!! (section column in course_sections) $data->visible = $cw->visible; $data->course = $course->id; @@ -92,7 +92,7 @@ if (!empty($add)) { $fullmodulename = get_string('modulename', $module->name); if ($data->section && $course->format != 'site') { - $heading = new object(); + $heading = new stdClass(); $heading->what = $fullmodulename; $heading->to = $sectionname; $pageheading = get_string('addinganewto', 'moodle', $heading); @@ -177,7 +177,7 @@ if (!empty($add)) { $fullmodulename = get_string('modulename', $module->name); if ($data->section && $course->format != 'site') { - $heading = new object(); + $heading = new stdClass(); $heading->what = $fullmodulename; $heading->in = $sectionname; $pageheading = get_string('updatingain', 'moodle', $heading); @@ -341,7 +341,7 @@ if ($mform->is_cancelled()) { } // Trigger mod_updated event with information about this module. - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = $fromform->modulename; $eventdata->name = $fromform->name; $eventdata->cmid = $fromform->coursemodule; @@ -367,7 +367,7 @@ if ($mform->is_cancelled()) { } // first add course_module record because we need the context - $newcm = new object(); + $newcm = new stdClass(); $newcm->course = $course->id; $newcm->module = $fromform->module; $newcm->instance = 0; // not known yet, will be updated later (this is similar to restore code) @@ -453,7 +453,7 @@ if ($mform->is_cancelled()) { } // Trigger mod_created event with information about this module. - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = $fromform->modulename; $eventdata->name = $fromform->name; $eventdata->cmid = $fromform->coursemodule; diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index 7956c9e7eb4..591da0e3972 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -76,7 +76,7 @@ abstract class moodleform_mod extends moodleform { protected function init_features() { global $CFG; - $this->_features = new object(); + $this->_features = new stdClass(); $this->_features->groups = plugin_supports('mod', $this->_modname, FEATURE_GROUPS, true); $this->_features->groupings = plugin_supports('mod', $this->_modname, FEATURE_GROUPINGS, false); $this->_features->groupmembersonly = (!empty($CFG->enablegroupmembersonly) and plugin_supports('mod', $this->_modname, FEATURE_GROUPMEMBERSONLY, false)); diff --git a/course/recent.php b/course/recent.php index 7c8b7d97723..134cce0e07b 100644 --- a/course/recent.php +++ b/course/recent.php @@ -48,7 +48,7 @@ if (!isguestuser() and !empty($USER->lastcourseaccess[$COURSE->id])) { } } -$param = new object(); +$param = new stdClass(); $param->user = 0; $param->modid = 'all'; $param->group = 0; @@ -130,7 +130,7 @@ $index = 0; foreach ($sections as $section) { - $activity = new object(); + $activity = new stdClass(); $activity->type = 'section'; if ($section->section > 0) { $activity->name = get_section_name($course, $section); @@ -169,7 +169,7 @@ foreach ($sections as $section) { $get_recent_mod_activity = $cm->modname."_get_recent_mod_activity"; if (function_exists($get_recent_mod_activity)) { - $activity = new object(); + $activity = new stdClass(); $activity->type = 'activity'; $activity->cmid = $cmid; $activities[$index++] = $activity; diff --git a/course/report/completion/index.php b/course/report/completion/index.php index ff26f2cc05a..382bcfdb520 100644 --- a/course/report/completion/index.php +++ b/course/report/completion/index.php @@ -617,7 +617,7 @@ foreach ($progress as $user) { $describe = get_string('completion-alt-auto-'.$completiontype, 'completion'); - $a = new Object(); + $a = new stdClass(); $a->state = $describe; $a->date = $is_complete ? userdate($criteria_completion->timecompleted) : ''; $a->user = fullname($user); diff --git a/course/report/log/lib.php b/course/report/log/lib.php index 2b49f9f1fd9..e12de536482 100644 --- a/course/report/log/lib.php +++ b/course/report/log/lib.php @@ -257,7 +257,7 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select $courses[$course->id] = $course->fullname . ((empty($course->category)) ? ' ('.get_string('site').') ' : ''); echo html_writer::select($courses,"id",$course->id, false); if (has_capability('coursereport/log:view', $sitecontext)) { - $a = new object(); + $a = new stdClass(); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; print_string('logtoomanycourses','moodle',$a); @@ -470,7 +470,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today' $courses[$course->id] = $course->fullname . (($course->id == SITEID) ? ' ('.get_string('site').') ' : ''); echo html_writer::select($courses,"id",$course->id, false); if (has_capability('coursereport/log:view', $sitecontext)) { - $a = new object(); + $a = new stdClass(); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showcourses=1&showusers=$showusers"; print_string('logtoomanycourses','moodle',$a); @@ -502,7 +502,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today' $users[0] = get_string('allparticipants'); } echo html_writer::select($users, "user", $selecteduser, false); - $a = new object(); + $a = new stdClass(); $a->url = "$CFG->wwwroot/course/report/log/index.php?chooselog=0&group=$selectedgroup&user=$selecteduser" ."&id=$course->id&date=$selecteddate&modid=$selectedactivity&showusers=1&showcourses=$showcourses"; print_string('logtoomanyusers','moodle',$a); diff --git a/course/rest.php b/course/rest.php index 5cf6d7e94b3..df8c613e885 100644 --- a/course/rest.php +++ b/course/rest.php @@ -158,7 +158,7 @@ switch($requestmethod) { case 'course': switch($field) { case 'marker': - $newcourse = new object; + $newcourse = new stdClass(); $newcourse->id = $course->id; $newcourse->marker = $value; $DB->update_record('course', $newcourse);