diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index bba8fceb20e..cdfd76b405e 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -455,7 +455,7 @@ class assignment_base { $assignment->id = $returnid; if ($assignment->timedue) { - $event = new object(); + $event = new stdClass(); $event->name = $assignment->name; $event->description = format_module_intro('assignment', $assignment, $assignment->coursemodule); $event->courseid = $assignment->course; @@ -542,7 +542,7 @@ class assignment_base { $DB->update_record('assignment', $assignment); if ($assignment->timedue) { - $event = new object(); + $event = new stdClass(); if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'assignment', 'instance'=>$assignment->id))) { @@ -553,7 +553,7 @@ class assignment_base { $calendarevent = calendar_event::load($event->id); $calendarevent->update($event); } else { - $event = new object(); + $event = new stdClass(); $event->name = $assignment->name; $event->description = format_module_intro('assignment', $assignment, $assignment->coursemodule); $event->courseid = $assignment->course; @@ -1653,7 +1653,7 @@ class assignment_base { * @return object The submission */ function prepare_new_submission($userid, $teachermodified=false) { - $submission = new Object; + $submission = new stdClass(); $submission->assignment = $this->assignment->id; $submission->userid = $userid; $submission->timecreated = time(); @@ -1724,7 +1724,7 @@ class assignment_base { $strsubmitted = get_string('submitted', 'assignment'); foreach ($teachers as $teacher) { - $info = new object(); + $info = new stdClass(); $info->username = fullname($user, true); $info->assignment = format_string($this->assignment->name,true); $info->url = $CFG->wwwroot.'/mod/assignment/submissions.php?id='.$this->cm->id; @@ -1733,7 +1733,7 @@ class assignment_base { $posttext = $this->email_teachers_text($info); $posthtml = ($teacher->mailformat == 1) ? $this->email_teachers_html($info) : ''; - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'assignment'; $eventdata->userfrom = $user; $eventdata->userto = $teacher; @@ -1945,7 +1945,7 @@ class assignment_base { */ function user_outline($grade) { - $result = new object(); + $result = new stdClass(); $result->info = get_string('grade').': '.$grade->str_long_grade; $result->time = $grade->dategraded; return $result; @@ -2571,7 +2571,7 @@ function assignment_cron () { $strassignments = get_string("modulenameplural", "assignment"); $strassignment = get_string("modulename", "assignment"); - $assignmentinfo = new object(); + $assignmentinfo = new stdClass(); $assignmentinfo->teacher = fullname($teacher); $assignmentinfo->assignment = format_string($submission->name,true); $assignmentinfo->url = "$CFG->wwwroot/mod/assignment/view.php?id=$mod->id"; @@ -2594,7 +2594,7 @@ function assignment_cron () { $posthtml = ""; } - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'assignment'; $eventdata->userfrom = $teacher; $eventdata->userto = $user; @@ -2878,7 +2878,7 @@ function assignment_refresh_events($courseid = 0) { foreach ($assignments as $assignment) { $cm = get_coursemodule_from_id('assignment', $assignment->id); - $event = new object(); + $event = new stdClass(); $event->name = $assignment->name; $event->description = format_module_intro('assignment', $assignment, $cm->id); $event->timestart = $assignment->timedue; @@ -3109,7 +3109,7 @@ function assignment_get_recent_mod_activity(&$activities, &$index, $timestart, $ $aname = format_string($cm->name,true); foreach ($show as $submission) { - $tmpactivity = new object(); + $tmpactivity = new stdClass(); $tmpactivity->type = 'assignment'; $tmpactivity->cmid = $cm->id; @@ -3309,7 +3309,7 @@ function assignment_get_coursemodule_info($coursemodule) { if ($result = $ass->get_coursemodule_info($coursemodule)) { return $result; } else { - $info = new object(); + $info = new stdClass(); $info->name = $assignment->name; return $info; } @@ -3494,7 +3494,7 @@ function assignment_get_types() { global $CFG; $types = array(); - $type = new object(); + $type = new stdClass(); $type->modclass = MOD_CLASS_ACTIVITY; $type->type = "assignment_group_start"; $type->typestr = '--'.get_string('modulenameplural', 'assignment'); @@ -3502,7 +3502,7 @@ function assignment_get_types() { $standardassignments = array('upload','online','uploadsingle','offline'); foreach ($standardassignments as $assignmenttype) { - $type = new object(); + $type = new stdClass(); $type->modclass = MOD_CLASS_ACTIVITY; $type->type = "assignment&type=$assignmenttype"; $type->typestr = get_string("type$assignmenttype", 'assignment'); @@ -3516,7 +3516,7 @@ function assignment_get_types() { continue; } if (!in_array($assignmenttype, $standardassignments)) { - $type = new object(); + $type = new stdClass(); $type->modclass = MOD_CLASS_ACTIVITY; $type->type = "assignment&type=$assignmenttype"; $type->typestr = get_string("type$assignmenttype", 'assignment_'.$assignmenttype); @@ -3524,7 +3524,7 @@ function assignment_get_types() { } } - $type = new object(); + $type = new stdClass(); $type->modclass = MOD_CLASS_ACTIVITY; $type->type = "assignment_group_end"; $type->typestr = '--'; diff --git a/mod/assignment/type/offline/assignment.class.php b/mod/assignment/type/offline/assignment.class.php index 1bff0084d9d..04097dc8b7f 100644 --- a/mod/assignment/type/offline/assignment.class.php +++ b/mod/assignment/type/offline/assignment.class.php @@ -19,7 +19,7 @@ class assignment_offline extends assignment_base { } function prepare_new_submission($userid) { - $submission = new Object; + $submission = new stdClass(); $submission->assignment = $this->assignment->id; $submission->userid = $userid; $submission->timecreated = time(); // needed for offline assignments diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index 5c83c288a3c..a4a3e81fe27 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -36,7 +36,7 @@ class assignment_online extends assignment_base { // prepare form and process submitted data $editoroptions = array('noclean'=>false, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$this->course->maxbytes); - $data = new object(); + $data = new stdClass(); $data->id = $this->cm->id; $data->edit = 1; if ($submission) { @@ -174,7 +174,7 @@ class assignment_online extends assignment_base { $submission = $this->get_submission($USER->id, true); - $update = new object(); + $update = new stdClass(); $update->id = $submission->id; $update->data1 = $data->text; $update->data2 = $data->textformat; diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index 17d84fe5061..2b3c0a1b89e 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -447,7 +447,7 @@ class assignment_upload extends assignment_base { $mform = new mod_assignment_upload_notes_form(); - $defaults = new object(); + $defaults = new stdClass(); $defaults->id = $this->cm->id; if ($submission = $this->get_submission($USER->id)) { @@ -473,7 +473,7 @@ class assignment_upload extends assignment_base { if ($data = $mform->get_data() and $action == 'savenotes') { $submission = $this->get_submission($USER->id, true); // get or create submission - $updated = new object(); + $updated = new stdClass(); $updated->id = $submission->id; $updated->timemodified = time(); $updated->data1 = $data->text; @@ -541,7 +541,7 @@ class assignment_upload extends assignment_base { $submission = $this->get_submission($USER->id, true); //create new submission if needed $fs->delete_area_files($this->context->id, 'mod_assignment', 'submission', $submission->id); $formdata = file_postupdate_standard_filemanager($formdata, 'files', $options, $this->context, 'mod_assignment', 'submission', $submission->id); - $updates = new object(); + $updates = new stdClass(); $updates->id = $submission->id; $updates->timemodified = time(); $DB->update_record('assignment_submissions', $updates); @@ -555,7 +555,7 @@ class assignment_upload extends assignment_base { // send files to event system $files = $fs->get_area_files($this->context->id, 'mod_assignment', 'submission', $submission->id); // Let Moodle know that assessable files were uploaded (eg for plagiarism detection) - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'assignment'; $eventdata->cmid = $this->cm->id; $eventdata->itemid = $submission->id; @@ -658,7 +658,7 @@ class assignment_upload extends assignment_base { die; } } - $updated = new object(); + $updated = new stdClass(); $updated->id = $submission->id; $updated->data2 = ASSIGNMENT_STATUS_SUBMITTED; $updated->timemodified = time(); @@ -671,7 +671,7 @@ class assignment_upload extends assignment_base { $this->email_teachers($submission); // Trigger assessable_files_done event to show files are complete - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'assignment'; $eventdata->cmid = $this->cm->id; $eventdata->itemid = $submission->id; @@ -699,7 +699,7 @@ class assignment_upload extends assignment_base { redirect($returnurl); // probably closed already } - $updated = new object(); + $updated = new stdClass(); $updated->id = $submission->id; $updated->data2 = ASSIGNMENT_STATUS_CLOSED; @@ -727,7 +727,7 @@ class assignment_upload extends assignment_base { and $this->can_unfinalize($submission) and confirm_sesskey()) { - $updated = new object(); + $updated = new stdClass(); $updated->id = $submission->id; $updated->data2 = ''; $DB->update_record('assignment_submissions', $updated); diff --git a/mod/assignment/type/upload/upload.php b/mod/assignment/type/upload/upload.php index 877b2de3402..93b0f7799ca 100644 --- a/mod/assignment/type/upload/upload.php +++ b/mod/assignment/type/upload/upload.php @@ -30,7 +30,7 @@ require_once("$CFG->dirroot/repository/lib.php"); $contextid = required_param('contextid', PARAM_INT); $id = optional_param('id', null, PARAM_INT); -$formdata = new object(); +$formdata = new stdClass(); $formdata->userid = required_param('userid', PARAM_INT); $formdata->offset = optional_param('offset', null, PARAM_INT); $formdata->forcerefresh = optional_param('forcerefresh', null, PARAM_INT); diff --git a/mod/assignment/type/uploadsingle/assignment.class.php b/mod/assignment/type/uploadsingle/assignment.class.php index 3183f709caa..33845581878 100644 --- a/mod/assignment/type/uploadsingle/assignment.class.php +++ b/mod/assignment/type/uploadsingle/assignment.class.php @@ -128,7 +128,7 @@ class assignment_uploadsingle extends assignment_base { } echo $output; } - + function can_manage_responsefiles() { if (has_capability('mod/assignment:grade', $this->context)) { return true; @@ -196,7 +196,7 @@ class assignment_uploadsingle extends assignment_base { $file = $mform->save_stored_file('assignment_file', $this->context->id, 'mod_assignment', 'submission', $submission->id, '/', $newfilename); - $updates = new object(); //just enough data for updating the submission + $updates = new stdClass(); //just enough data for updating the submission $updates->timemodified = time(); $updates->numfiles = 1; $updates->id = $submission->id; @@ -206,7 +206,7 @@ class assignment_uploadsingle extends assignment_base { $this->email_teachers($submission); // Let Moodle know that an assessable file was uploaded (eg for plagiarism detection) - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'assignment'; $eventdata->cmid = $this->cm->id; $eventdata->itemid = $submission->id; @@ -294,7 +294,7 @@ class assignment_uploadsingle extends assignment_base { if ($USER->id != $submission->userid and !has_capability('mod/assignment:grade', $this->context)) { return false; } - + $relativepath = implode('/', $args); $fullpath = '/'.$this->context->id.'/mod_assignment/'.$filearea.'/'.$submissionid.'/'.$relativepath; diff --git a/mod/assignment/type/uploadsingle/upload.php b/mod/assignment/type/uploadsingle/upload.php index 83aa186e89b..fbac468d9bb 100644 --- a/mod/assignment/type/uploadsingle/upload.php +++ b/mod/assignment/type/uploadsingle/upload.php @@ -30,7 +30,7 @@ require_once("$CFG->dirroot/repository/lib.php"); $contextid = required_param('contextid', PARAM_INT); $id = optional_param('id', null, PARAM_INT); -$formdata = new object(); +$formdata = new stdClass(); $formdata->userid = required_param('userid', PARAM_INT); $formdata->offset = optional_param('offset', null, PARAM_INT); $formdata->forcerefresh = optional_param('forcerefresh', null, PARAM_INT); diff --git a/mod/chat/chat_ajax.php b/mod/chat/chat_ajax.php index 1d31fc11f8e..8542b3dfca4 100644 --- a/mod/chat/chat_ajax.php +++ b/mod/chat/chat_ajax.php @@ -75,7 +75,7 @@ case 'chat': } if (!empty($chat_message)) { - $message = new object(); + $message = new stdClass(); $message->chatid = $chatuser->chatid; $message->userid = $chatuser->userid; $message->groupid = $chatuser->groupid; diff --git a/mod/chat/gui_basic/index.php b/mod/chat/gui_basic/index.php index 61bc84c3021..19eb29bfc28 100644 --- a/mod/chat/gui_basic/index.php +++ b/mod/chat/gui_basic/index.php @@ -92,7 +92,7 @@ if (!empty($refresh) and data_submitted()) { } else if (empty($refresh) and data_submitted() and confirm_sesskey()) { if ($message!='') { - $newmessage = new object(); + $newmessage = new stdClass(); $newmessage->chatid = $chat->id; $newmessage->userid = $USER->id; $newmessage->groupid = $groupid; @@ -154,7 +154,7 @@ echo '
'; echo '

'.get_string('messages', 'chat').'

'; $allmessages = array(); -$options = new object(); +$options = new stdClass(); $options->para = false; $options->newlines = true; diff --git a/mod/chat/gui_header_js/insert.php b/mod/chat/gui_header_js/insert.php index 13c6c0834d2..6b842d2977b 100644 --- a/mod/chat/gui_header_js/insert.php +++ b/mod/chat/gui_header_js/insert.php @@ -44,7 +44,7 @@ $chat_message = clean_text($chat_message, FORMAT_MOODLE); // Strip bad tags if (!empty($chat_message)) { - $message = new object(); + $message = new stdClass(); $message->chatid = $chatuser->chatid; $message->userid = $chatuser->userid; $message->groupid = $chatuser->groupid; diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 25ffe73090d..6d5857fc734 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -147,7 +147,7 @@ function chat_update_instance($chat) { $DB->update_record("chat", $chat); - $event = new object(); + $event = new stdClass(); if ($event->id = $DB->get_field('event', 'id', array('modulename'=>'chat', 'instance'=>$chat->id))) { @@ -483,7 +483,7 @@ function chat_refresh_events($courseid = 0) { foreach ($chats as $chat) { $cm = get_coursemodule_from_id('chat', $chat->id); - $event = new object(); + $event = new stdClass(); $event->name = $chat->name; $event->description = format_module_intro('chat', $chat, $cm->id); $event->timestart = $chat->chattime; @@ -608,7 +608,7 @@ function chat_login_user($chatid, $version, $groupid, $course) { $DB->update_record('chat_users', $chatuser); } else { - $chatuser = new object(); + $chatuser = new stdClass(); $chatuser->chatid = $chatid; $chatuser->userid = $USER->id; $chatuser->groupid = $groupid; @@ -632,7 +632,7 @@ function chat_login_user($chatid, $version, $groupid, $course) { if ($version == 'sockets') { // do not send 'enter' message, chatd will do it } else { - $message = new object(); + $message = new stdClass(); $message->chatid = $chatuser->chatid; $message->userid = $chatuser->userid; $message->groupid = $groupid; @@ -667,7 +667,7 @@ function chat_delete_old_users() { if ($oldusers = $DB->get_records_select('chat_users', $query, $params) ) { $DB->delete_records_select('chat_users', $query, $params); foreach ($oldusers as $olduser) { - $message = new object(); + $message = new stdClass(); $message->chatid = $olduser->chatid; $message->userid = $olduser->userid; $message->groupid = $olduser->groupid; @@ -725,7 +725,7 @@ function chat_update_chat_times($chatid=0) { } $DB->update_record("chat", $chat); - $event = new object(); // Update calendar too + $event = new stdClass(); // Update calendar too $cond = "modulename='chat' AND instance = :chatid AND timestart <> :chattime"; $params = array('chattime'=>$chat->chattime, 'chatid'=>$chatid); @@ -751,7 +751,7 @@ function chat_update_chat_times($chatid=0) { function chat_format_message_manually($message, $courseid, $sender, $currentuser, $chat_lastrow=NULL) { global $CFG, $USER, $OUTPUT; - $output = new object(); + $output = new stdClass(); $output->beep = false; // by default $output->refreshusers = false; // by default @@ -802,7 +802,7 @@ function chat_format_message_manually($message, $courseid, $sender, $currentuser /// Parse the text to clean and filter it - $options = new object(); + $options = new stdClass(); $options->para = false; $text = format_text($text, FORMAT_MOODLE, $options, $courseid); @@ -908,7 +908,7 @@ function chat_format_message_theme ($message, $courseid, $currentuser, $theme = static $users; // Cache user lookups - $result = new object(); + $result = new stdClass(); if (file_exists($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$theme.'/config.php')) { include($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$theme.'/config.php'); @@ -959,7 +959,7 @@ function chat_format_message_theme ($message, $courseid, $currentuser, $theme = $text = $message->message; /// Parse the text to clean and filter it - $options = new object(); + $options = new stdClass(); $options->para = false; $text = format_text($text, FORMAT_MOODLE, $options, $courseid); diff --git a/mod/choice/lib.php b/mod/choice/lib.php index 02b89fec76a..ac786065e8d 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -70,7 +70,7 @@ $CHOICE_DISPLAY = array (CHOICE_DISPLAY_HORIZONTAL => get_string('displayhoriz function choice_user_outline($course, $user, $mod, $choice) { global $DB; if ($answer = $DB->get_record('choice_answers', array('choiceid' => $choice->id, 'userid' => $user->id))) { - $result = new object(); + $result = new stdClass(); $result->info = "'".format_string(choice_get_option_text($choice, $answer->optionid))."'"; $result->time = $answer->timemodified; return $result; @@ -89,7 +89,7 @@ function choice_user_outline($course, $user, $mod, $choice) { function choice_user_complete($course, $user, $mod, $choice) { global $DB; if ($answer = $DB->get_record('choice_answers', array("choiceid" => $choice->id, "userid" => $user->id))) { - $result = new object(); + $result = new stdClass(); $result->info = "'".format_string(choice_get_option_text($choice, $answer->optionid))."'"; $result->time = $answer->timemodified; echo get_string("answered", "choice").": $result->info. ".get_string("updated", '', userdate($result->time)); @@ -123,7 +123,7 @@ function choice_add_instance($choice) { foreach ($choice->option as $key => $value) { $value = trim($value); if (isset($value) && $value <> '') { - $option = new object(); + $option = new stdClass(); $option->text = $value; $option->choiceid = $choice->id; if (isset($choice->limit[$key])) { @@ -161,7 +161,7 @@ function choice_update_instance($choice) { //update, delete or insert answers foreach ($choice->option as $key => $value) { $value = trim($value); - $option = new object(); + $option = new stdClass(); $option->text = $value; $option->choiceid = $choice->id; if (isset($choice->limit[$key])) { diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index 9f216a5b997..6c47c6d7bfd 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -155,7 +155,7 @@ function xmldb_data_upgrade($oldversion) { AND (d.requiredentries > 0 OR d.requiredentriestoview > 0) ORDER BY c.fullname, d.name"); if (!empty($databases)) { - $a = new object(); + $a = new stdClass(); $a->text = ''; foreach($databases as $database) { $a->text .= $database->fullname." - " .$database->name. " (course id: ".$database->course." - database id: ".$database->id.")
"; diff --git a/mod/data/export_form.php b/mod/data/export_form.php index 877dbfbf533..61bf349f17a 100644 --- a/mod/data/export_form.php +++ b/mod/data/export_form.php @@ -49,7 +49,7 @@ class mod_data_export_form extends moodleform { $mform->addElement('advcheckbox', 'field_'.$field->field->id, '
' . $field->field->name . '
', ' (' . $field->name() . ')', array('group'=>1)); $mform->setDefault('field_'.$field->field->id, 1); } else { - $a = new object; + $a = new stdClass(); $a->fieldtype = $field->name(); $mform->addElement('static', 'unsupported'.$field->field->id, $field->field->name, get_string('unsupportedexport', 'data', $a)); } diff --git a/mod/data/field.php b/mod/data/field.php index b04770bdccf..01ec6dfdc9f 100755 --- a/mod/data/field.php +++ b/mod/data/field.php @@ -187,7 +187,7 @@ switch ($mode) { // Update the default sort field if ($fid == $data->defaultsort) { - $rec = new object(); + $rec = new stdClass(); $rec->id = $data->id; $rec->defaultsort = 0; $rec->defaultsortdir = 0; @@ -220,7 +220,7 @@ switch ($mode) { case 'sort': // Set the default sort parameters if (confirm_sesskey()) { - $rec = new object(); + $rec = new stdClass(); $rec->id = $data->id; $rec->defaultsort = $defaultsort; $rec->defaultsortdir = $defaultsortdir; diff --git a/mod/data/field/checkbox/field.class.php b/mod/data/field/checkbox/field.class.php index 35a6e8ffe57..edaf71ffe6b 100755 --- a/mod/data/field/checkbox/field.class.php +++ b/mod/data/field/checkbox/field.class.php @@ -134,7 +134,7 @@ class data_field_checkbox extends data_field_base { function update_content($recordid, $value, $name='') { global $DB; - $content = new object(); + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $content->content = $this->format_data_field_checkbox_content($value); diff --git a/mod/data/field/date/field.class.php b/mod/data/field/date/field.class.php index 693ba4bf800..8934ed73684 100755 --- a/mod/data/field/date/field.class.php +++ b/mod/data/field/date/field.class.php @@ -94,7 +94,7 @@ class data_field_date extends data_field_base { if ($this->day and $this->month and $this->year) { // All of them have been collected now - $content = new object; + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $content->content = make_timestamp($this->year, $this->month, $this->day, 12, 0, 0, 0, false); diff --git a/mod/data/field/file/field.class.php b/mod/data/field/file/field.class.php index 26e2fe1d801..3aa2bcbfeeb 100755 --- a/mod/data/field/file/field.class.php +++ b/mod/data/field/file/field.class.php @@ -156,7 +156,7 @@ class data_field_file extends data_field_base { if (!$content = $DB->get_record('data_content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid))) { // Quickly make one now! - $content = new object(); + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $id = $DB->insert_record('data_content', $content); diff --git a/mod/data/field/latlong/field.class.php b/mod/data/field/latlong/field.class.php index 2b0b6bd3f46..444fcb75623 100755 --- a/mod/data/field/latlong/field.class.php +++ b/mod/data/field/latlong/field.class.php @@ -162,7 +162,7 @@ class data_field_latlong extends data_field_base { function update_content($recordid, $value, $name='') { global $DB; - $content = new object; + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $value = trim($value); diff --git a/mod/data/field/latlong/kml.php b/mod/data/field/latlong/kml.php index 7db3e11058f..4a5cf402a5b 100644 --- a/mod/data/field/latlong/kml.php +++ b/mod/data/field/latlong/kml.php @@ -100,7 +100,7 @@ header('Content-Disposition: attachment; filename="moodleearth-'.$d.'-'.$rid.'-' echo data_latlong_kml_top(); if($rid) { // List one single item - $pm = new object(); + $pm = new stdClass(); $pm->name = data_latlong_kml_get_item_name($content, $field); $pm->description = "<a href='$CFG->wwwroot/mod/data/view.php?d=$d&rid=$rid'>Item #$rid</a> in Moodle data activity"; $pm->long = $content->content1; diff --git a/mod/data/field/multimenu/field.class.php b/mod/data/field/multimenu/field.class.php index 8e898049643..b72e656453e 100755 --- a/mod/data/field/multimenu/field.class.php +++ b/mod/data/field/multimenu/field.class.php @@ -170,7 +170,7 @@ class data_field_multimenu extends data_field_base { function update_content($recordid, $value, $name='') { global $DB; - $content = new object; + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $content->content = $this->format_data_field_multimenu_content($value); diff --git a/mod/data/field/number/field.class.php b/mod/data/field/number/field.class.php index bb80ec3aa91..ee905ca6dfc 100755 --- a/mod/data/field/number/field.class.php +++ b/mod/data/field/number/field.class.php @@ -28,7 +28,7 @@ class data_field_number extends data_field_base { function update_content($recordid, $value, $name='') { global $DB; - $content = new object; + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $value = trim($value); diff --git a/mod/data/field/picture/field.class.php b/mod/data/field/picture/field.class.php index fb8c3a82341..3faf33d5b42 100755 --- a/mod/data/field/picture/field.class.php +++ b/mod/data/field/picture/field.class.php @@ -202,7 +202,7 @@ class data_field_picture extends data_field_base { if (!$content = $DB->get_record('data_content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid))) { // Quickly make one now! - $content = new object(); + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $id = $DB->insert_record('data_content', $content); diff --git a/mod/data/field/textarea/field.class.php b/mod/data/field/textarea/field.class.php index 3a28d57f47e..5a39cbcfc93 100755 --- a/mod/data/field/textarea/field.class.php +++ b/mod/data/field/textarea/field.class.php @@ -105,7 +105,7 @@ class data_field_textarea extends data_field_base { function update_content($recordid, $value, $name='') { global $DB; - $content = new object; + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; diff --git a/mod/data/field/url/field.class.php b/mod/data/field/url/field.class.php index 663f6aa3311..d720c5705e6 100755 --- a/mod/data/field/url/field.class.php +++ b/mod/data/field/url/field.class.php @@ -119,7 +119,7 @@ class data_field_url extends data_field_base { function update_content($recordid, $value, $name='') { global $DB; - $content = new object; + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $names = explode('_', $name); diff --git a/mod/data/import.php b/mod/data/import.php index 36b4bf8325e..60d5c72a1c4 100755 --- a/mod/data/import.php +++ b/mod/data/import.php @@ -143,7 +143,7 @@ if (!$formdata = $form->get_data()) { // Insert new data_content fields with NULL contents: foreach ($fields as $field) { - $content = new object(); + $content = new stdClass(); $content->recordid = $recordid; $content->fieldid = $field->id; $DB->insert_record('data_content', $content); @@ -152,7 +152,7 @@ if (!$formdata = $form->get_data()) { foreach ($record as $key => $value) { $name = $fieldnames[$key]; $field = $fields[$name]; - $content = new object(); + $content = new stdClass(); $content->fieldid = $field->id; $content->recordid = $recordid; if ($field->type == 'textarea') { diff --git a/mod/data/index.php b/mod/data/index.php index a3d7c53cb15..2109246b5f0 100755 --- a/mod/data/index.php +++ b/mod/data/index.php @@ -84,7 +84,7 @@ if ($rss) { array_push($table->align, 'center'); } -$options = new object(); +$options = new stdClass(); $options->noclean = true; $currentsection = ""; diff --git a/mod/data/lib.php b/mod/data/lib.php index 9ac1ded459d..b556f01e661 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -128,7 +128,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/ if (empty($this->data->id)) { echo $OUTPUT->notification('Programmer error: dataid not defined in field class'); } - $this->field = new object; + $this->field = new stdClass(); $this->field->id = 0; $this->field->dataid = $this->data->id; $this->field->type = $this->type; @@ -305,7 +305,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/ if ($content = $DB->get_record('data_content', array('fieldid'=>$this->field->id, 'recordid'=>$recordid))) { if (isset($content->content)) { - $options = new object(); + $options = new stdClass(); if ($this->field->param1 == '1') { // We are autolinking this field, so disable linking within us //$content->content = ''.$content->content.''; //$content->content1 = FORMAT_HTML; @@ -332,7 +332,7 @@ class data_field_base { // Base class for Database Field Types (see field/*/ function update_content($recordid, $value, $name=''){ global $DB; - $content = new object(); + $content = new stdClass(); $content->fieldid = $this->field->id; $content->recordid = $recordid; $content->content = clean_param($value, PARAM_NOTAGS); @@ -546,7 +546,7 @@ function data_generate_default_template(&$data, $template, $recordid=0, $form=fa } if ($update) { - $newdata = new object(); + $newdata = new stdClass(); $newdata->id = $data->id; $newdata->{$template} = $str; $DB->update_record('data', $newdata); @@ -583,7 +583,7 @@ function data_replace_field_in_templates($data, $searchfieldname, $newfieldname) $idpart = ''; } - $newdata = new object(); + $newdata = new stdClass(); $newdata->id = $data->id; $newdata->singletemplate = str_ireplace('[['.$searchfieldname.']]', $prestring.$newfieldname.$poststring, $data->singletemplate); @@ -614,7 +614,7 @@ function data_replace_field_in_templates($data, $searchfieldname, $newfieldname) function data_append_new_field_to_templates($data, $newfieldname) { global $DB; - $newdata = new object(); + $newdata = new stdClass(); $newdata->id = $data->id; $change = false; @@ -788,7 +788,7 @@ function data_add_record($data, $groupid=0){ $cm = get_coursemodule_from_instance('data', $data->id); $context = get_context_instance(CONTEXT_MODULE, $cm->id); - $record = new object(); + $record = new stdClass(); $record->userid = $USER->id; $record->dataid = $data->id; $record->groupid = $groupid; @@ -952,7 +952,7 @@ function data_user_outline($course, $user, $mod, $data) { if ($countrecords = $DB->count_records('data_records', array('dataid'=>$data->id, 'userid'=>$user->id))) { - $result = new object(); + $result = new stdClass(); $result->info = get_string('numrecords', 'data', $countrecords); $lastrecord = $DB->get_record_sql('SELECT id,timemodified FROM {data_records} WHERE dataid = ? AND userid = ? @@ -963,7 +963,7 @@ function data_user_outline($course, $user, $mod, $data) { } return $result; } else if ($grade) { - $result = new object(); + $result = new stdClass(); $result->info = get_string('grade') . ': ' . $grade->str_long_grade; $result->time = $grade->dategraded; return $result; @@ -1045,7 +1045,7 @@ function data_update_grades($data, $userid=0, $nullifnone=true) { data_grade_item_update($data, $grades); } else if ($userid and $nullifnone) { - $grade = new object(); + $grade = new stdClass(); $grade->userid = $userid; $grade->rawgrade = NULL; data_grade_item_update($data, $grade); @@ -1545,7 +1545,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order=' // actual replacement of the tags $newtext = preg_replace($patterns, $replacement, $data->asearchtemplate); - $options = new object(); + $options = new stdClass(); $options->para=false; $options->noclean=true; echo ''; @@ -1810,7 +1810,7 @@ function data_get_available_presets($context) { foreach ($dirs as $dir) { $fulldir = $CFG->dirroot.'/mod/data/preset/'.$dir; if (is_directory_a_preset($fulldir)) { - $preset = new object; + $preset = new stdClass(); $preset->path = $fulldir; $preset->userid = 0; $preset->shortname = $dir; diff --git a/mod/data/templates.php b/mod/data/templates.php index beb8ecf7d35..73263018a2c 100755 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -112,7 +112,7 @@ include('tabs.php'); $resettemplate = false; if (($mytemplate = data_submitted()) && confirm_sesskey()) { - $newtemplate = new object(); + $newtemplate = new stdClass(); $newtemplate->id = $data->id; $newtemplate->{$mode} = $mytemplate->template; diff --git a/mod/data/view.php b/mod/data/view.php index 4deaf4e59f1..f68f41ca367 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -169,7 +169,7 @@ } } if (!empty($val)) { - $search_array[$field->id] = new object(); + $search_array[$field->id] = new stdClass(); list($search_array[$field->id]->sql, $search_array[$field->id]->params) = $searchfield->generate_sql('c'.$field->id, $val); $search_array[$field->id]->data = $val; $vals[] = $val; @@ -189,7 +189,7 @@ $ln = isset($search_array[DATA_LASTNAME]) ? $search_array[DATA_LASTNAME]->data : ''; } if (!empty($fn)) { - $search_array[DATA_FIRSTNAME] = new object(); + $search_array[DATA_FIRSTNAME] = new stdClass(); $search_array[DATA_FIRSTNAME]->sql = ''; $search_array[DATA_FIRSTNAME]->params = array(); $search_array[DATA_FIRSTNAME]->field = 'u.firstname'; @@ -199,7 +199,7 @@ unset($search_array[DATA_FIRSTNAME]); } if (!empty($ln)) { - $search_array[DATA_LASTNAME] = new object(); + $search_array[DATA_LASTNAME] = new stdClass(); $search_array[DATA_LASTNAME]->sql = ''; $search_array[DATA_FIRSTNAME]->params = array(); $search_array[DATA_LASTNAME]->field = 'u.lastname'; @@ -323,7 +323,7 @@ }*/ if ($data->intro and empty($page) and empty($record) and $mode != 'single') { - $options = new object(); + $options = new stdClass(); $options->noclean = true; echo $OUTPUT->box(format_module_intro('data', $data, $cm->id), 'generalbox', 'intro'); } @@ -405,7 +405,7 @@ if ($showactivity) { if ($approve && confirm_sesskey() && $approvecap) { if ($approverecord = $DB->get_record('data_records', array('id'=>$approve))) { // Need to check this is valid if ($approverecord->dataid == $data->id) { // Must be from this database - $newrecord = new object(); + $newrecord = new stdClass(); $newrecord->id = $approverecord->id; $newrecord->approved = 1; $DB->update_record('data_records', $newrecord); @@ -619,7 +619,7 @@ if ($showactivity) { if (empty($records)) { if ($maxcount){ - $a = new object(); + $a = new stdClass(); $a->max = $maxcount; $a->reseturl = "view.php?id=$cm->id&mode=$mode&search=&advanced=0"; echo $OUTPUT->notification(get_string('foundnorecords','data', $a)); @@ -630,7 +630,7 @@ if ($showactivity) { } else { // We have some records to print if ($maxcount != $totalcount) { - $a = new object(); + $a = new stdClass(); $a->num = $totalcount; $a->max = $maxcount; $a->reseturl = "view.php?id=$cm->id&mode=$mode&search=&advanced=0"; diff --git a/mod/feedback/analysis_to_excel.php b/mod/feedback/analysis_to_excel.php index 0ea20131dd5..2a5e9506e60 100644 --- a/mod/feedback/analysis_to_excel.php +++ b/mod/feedback/analysis_to_excel.php @@ -49,7 +49,7 @@ require_capability('mod/feedback:viewreports', $context); //buffering any output //this prevents some output before the excel-header will be send ob_start(); -$fstring = new object(); +$fstring = new stdClass(); $fstring->bold = get_string('bold', 'feedback'); $fstring->page = get_string('page', 'feedback'); $fstring->of = get_string('of', 'feedback'); @@ -84,7 +84,7 @@ $workbook->send($filename); // $workbook->setVersion(8); //creating the needed formats -$xlsFormats = new object(); +$xlsFormats = new stdClass(); $xlsFormats->head1 = $workbook->add_format(array( 'bold'=>1, 'size'=>12)); diff --git a/mod/feedback/choose_group_form.php b/mod/feedback/choose_group_form.php index e5e8b3e17ae..07e0f1aa15f 100644 --- a/mod/feedback/choose_group_form.php +++ b/mod/feedback/choose_group_form.php @@ -17,7 +17,7 @@ class feedback_choose_group_form extends moodleform { var $feedbackdata; function definition() { - $this->feedbackdata = new object(); + $this->feedbackdata = new stdClass(); //this function can not be called, because not all data are available at this time //I use set_form_elements instead } diff --git a/mod/feedback/complete.php b/mod/feedback/complete.php index 6d5b99a27d6..15931092a6d 100644 --- a/mod/feedback/complete.php +++ b/mod/feedback/complete.php @@ -231,7 +231,7 @@ feedback_send_email_anonym($cm, $feedback, $course, $userid); } //tracking the submit - $tracking = new object(); + $tracking = new stdClass(); $tracking->userid = $USER->id; $tracking->feedback = $feedback->id; $tracking->completed = $new_completed_id; @@ -386,7 +386,7 @@ $itemnr = $DB->count_records_select('feedback_item', 'feedback = ? AND hasvalue = 1 AND position < ?', array($feedback->id, $startposition)); $lastbreakposition = 0; $align = right_to_left() ? 'right' : 'left'; - + foreach($feedbackitems as $feedbackitem){ if(!isset($startitem)) { //avoid showing double pagebreaks @@ -395,7 +395,7 @@ } $startitem = $feedbackitem; } - + if($feedbackitem->dependitem > 0) { //chech if the conditions are ok if(!isset($feedbackcompletedtmp->id) OR !feedback_compare_item_value($feedbackcompletedtmp->id, $feedbackitem->dependitem, $feedbackitem->dependvalue, true)) { @@ -404,13 +404,13 @@ continue; } } - + if($feedbackitem->dependitem > 0) { $dependstyle = ' feedback_complete_depend'; }else { $dependstyle = ''; } - + echo $OUTPUT->box_start('feedback_item_box_'.$align.$dependstyle); $value = ''; //get the value @@ -467,7 +467,7 @@ echo ''; echo ''; echo $OUTPUT->box_end(); - + echo $OUTPUT->box_start('feedback_complete_cancel'); if($courseid) { echo '
'; diff --git a/mod/feedback/edit_form.php b/mod/feedback/edit_form.php index f4d995172af..0ce6ab71677 100644 --- a/mod/feedback/edit_form.php +++ b/mod/feedback/edit_form.php @@ -46,7 +46,7 @@ class feedback_edit_use_template_form extends moodleform { var $feedbackdata; function definition() { - $this->feedbackdata = new object(); + $this->feedbackdata = new stdClass(); //this function can not be called, because not all data are available at this time //I use set_form_elements instead } @@ -133,7 +133,7 @@ class feedback_edit_create_template_form extends moodleform { $elementgroup[] =& $mform->createElement('static', 'templatenamelabel', get_string('name', 'feedback')); $elementgroup[] =& $mform->createElement('text', 'templatename', get_string('name', 'feedback'), array('size'=>'40', 'maxlength'=>'200')); - + //public templates are currently deactivated // if(has_capability('mod/feedback:createpublictemplate', $this->feedbackdata->context)) { // $elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback')); diff --git a/mod/feedback/import.php b/mod/feedback/import.php index a87e4235392..f065bdadc93 100644 --- a/mod/feedback/import.php +++ b/mod/feedback/import.php @@ -37,7 +37,7 @@ if (! $feedback = $DB->get_record("feedback", array("id"=>$cm->instance))) { print_error('invalidcoursemodule'); } - + if (!$context = get_context_instance(CONTEXT_MODULE, $cm->id)) { print_error('badcontext'); } @@ -92,11 +92,11 @@ /// Print the page header $strfeedbacks = get_string("modulenameplural", "feedback"); $strfeedback = get_string("modulename", "feedback"); - + $PAGE->set_heading(format_string($course->fullname)); $PAGE->set_title(format_string($feedback->name)); echo $OUTPUT->header(); - + /// print the tabs include('tabs.php'); @@ -113,9 +113,9 @@ } echo $OUTPUT->box_end(); } - + $mform->display(); - + // echo $OUTPUT->container_start('mdl-align'); // echo $OUTPUT->single_button(new moodle_url('edit.php', array('id'=>$id, 'do_show'=>'templates')), get_string('cancel')); // echo $OUTPUT->container_end(); @@ -140,10 +140,10 @@ global $CFG, $DB; feedback_load_feedback_items(); - + $deleteolditems = optional_param('deleteolditems', 0, PARAM_INT); - $error = new object(); + $error = new stdClass(); $error->stat = true; $error->msg = array(); @@ -204,7 +204,7 @@ } $itemobj = new $itemclass(); - $newitem = new object(); + $newitem = new stdClass(); $newitem->feedback = $feedbackid; $newitem->template = 0; $newitem->typ = $typ; @@ -230,7 +230,7 @@ $newitem->presentation = 'd>>>>>'.$newitem->presentation; break; } - + if(isset($item['#']['DEPENDITEM'][0]['#'])) { $newitem->dependitem = intval($item['#']['DEPENDITEM'][0]['#']); }else { @@ -242,7 +242,7 @@ $newitem->dependvalue = ''; } $olditemid = intval($item['#']['ITEMID'][0]['#']); - + if($typ != 'pagebreak') { $newitem->hasvalue = $itemobj->get_hasvalue(); }else { @@ -251,7 +251,7 @@ $newitem->required = intval($item['@']['REQUIRED']); $newitem->position = $position; $newid = $DB->insert_record('feedback_item', $newitem); - + $itembackup[$olditemid] = $newid; if($newitem->dependitem) { $dependitemsmap[$newid] = $newitem->dependitem; @@ -263,8 +263,8 @@ $newitem = $DB->get_record('feedback_item', array('id'=>$key)); $newitem->dependitem = $itembackup[$newitem->dependitem]; $DB->update_record('feedback_item', $newitem); - } - + } + return $error; } diff --git a/mod/feedback/item/captcha/print_captcha.php b/mod/feedback/item/captcha/print_captcha.php index 6441ff7e17e..7ac8bc443ea 100644 --- a/mod/feedback/item/captcha/print_captcha.php +++ b/mod/feedback/item/captcha/print_captcha.php @@ -65,7 +65,7 @@ for($i = 0; $i < $charcount; $i++) { $properties = array(); for($x = 0; $x < $factorX; $x++) { for($y = 0; $y < $factorY; $y++) { - $propobj = new object(); + $propobj = new stdClass(); $propobj->x = intval($x / $scale); $propobj->y = intval($y / $scale); $propobj->red = get_random_color($col_el[0], $col_el[1]); @@ -90,7 +90,7 @@ for($i = 0; $i < ($factorX * $factorY); $i++) { $checkchar = ''; for($i = 0; $i < $charcount; $i++) { $colnum = rand(1,2); - $textcol = new object(); + $textcol = new stdClass(); $textcol->red = get_random_color(${'col_text'.$colnum}[0], ${'col_text'.$colnum}[1]); $textcol->green = get_random_color(${'col_text'.$colnum}[0], ${'col_text'.$colnum}[1]); $textcol->blue = get_random_color(${'col_text'.$colnum}[0], ${'col_text'.$colnum}[1]); diff --git a/mod/feedback/item/info/lib.php b/mod/feedback/item/info/lib.php index d2cd251503a..cbeaf480f29 100644 --- a/mod/feedback/item/info/lib.php +++ b/mod/feedback/item/info/lib.php @@ -94,7 +94,7 @@ class feedback_item_info extends feedback_item_base { $values = feedback_get_group_values($item, $groupid, $courseid); if($values) { $data = array(); - $datavalue = new object(); + $datavalue = new stdClass(); foreach($values as $value) { switch($presentation) { diff --git a/mod/feedback/item/label/lib.php b/mod/feedback/item/label/lib.php index b820fc36881..fb88cf2d538 100644 --- a/mod/feedback/item/label/lib.php +++ b/mod/feedback/item/label/lib.php @@ -188,7 +188,7 @@ class feedback_item_label extends feedback_item_base { function get_presentation($data) { // $context = get_context_instance(CONTEXT_MODULE, $data->cmid); - // $presentation = new object(); + // $presentation = new stdClass(); // $presentation->id = null; // $presentation->definition = ''; // $presentation->format = FORMAT_HTML; @@ -206,7 +206,7 @@ class feedback_item_label extends feedback_item_base { $context = get_context_instance(CONTEXT_MODULE, $item->cmid); $item = file_postupdate_standard_editor($item, 'presentation', $this->presentationoptions, $context, 'mod_feedback', 'item', $item->id); - // $item = new object(); + // $item = new stdClass(); // $item->id = $data->id $DB->update_record('feedback_item', $item); return $item->id; diff --git a/mod/feedback/item/multichoice/lib.php b/mod/feedback/item/multichoice/lib.php index 1811531ce73..a663c975559 100644 --- a/mod/feedback/item/multichoice/lib.php +++ b/mod/feedback/item/multichoice/lib.php @@ -13,7 +13,7 @@ class feedback_item_multichoice extends feedback_item_base { var $commonparams; var $item_form; var $item; - + function init() { } @@ -35,13 +35,13 @@ class feedback_item_multichoice extends feedback_item_base { } //the elements for position dropdownlist $positionlist = array_slice(range(0,$i_formselect_last),1,$i_formselect_last,true); - + $item->presentation = empty($item->presentation) ? '' : $item->presentation; $info = $this->get_info($item); $item->ignoreempty = $this->ignoreempty($item); $item->hidenoselect = $this->hidenoselect($item); - + //all items for dependitem $feedbackitems = feedback_get_depend_candidates_for_item($feedback, $item); $commonparams = array('cmid'=>$cm->id, @@ -58,7 +58,7 @@ class feedback_item_multichoice extends feedback_item_base { function show_editform() { $this->item_form->display(); } - + function is_cancelled() { return $this->item_form->is_cancelled(); } @@ -72,17 +72,17 @@ class feedback_item_multichoice extends feedback_item_base { function save_item() { global $DB; - + if(!$item = $this->item_form->get_data()) { return false; } - + if(isset($item->clone_item) AND $item->clone_item) { $item->id = ''; //to clone this item $item->position++; } - - $this->set_ignoreempty($item, $item->ignoreempty); + + $this->set_ignoreempty($item, $item->ignoreempty); $this->set_hidenoselect($item, $item->hidenoselect); $item->hasvalue = $this->get_hasvalue(); @@ -91,7 +91,7 @@ class feedback_item_multichoice extends feedback_item_base { }else { $DB->update_record('feedback_item', $item); } - + return $DB->get_record('feedback_item', array('id'=>$item->id)); } @@ -247,8 +247,8 @@ class feedback_item_multichoice extends feedback_item_base { $rowOffset +=3 ; return $rowOffset; } - - /** + + /** * print the item at the edit-page of feedback * * @global object @@ -266,7 +266,7 @@ class feedback_item_multichoice extends feedback_item_base { //test if required and no value is set so we have to mark this item //we have to differ check and the other subtypes $requiredmark = ($item->required == 1) ? '' : ''; - + //print the question and label echo ''; - + //print the presentation echo ''; } - - /** + + /** * print the item at the complete-page of feedback * * @global object @@ -365,7 +365,7 @@ class feedback_item_multichoice extends feedback_item_base { //print the presentation echo ''; } - /** + /** * print the item at the complete-page of feedback * * @global object @@ -429,13 +429,13 @@ class feedback_item_multichoice extends feedback_item_base { }else { $requiredmark = ($item->required == 1)?'':''; } - + //print the question and label echo ''; - + //print the presentation echo ''; + $button->render(); + echo '
'; } if ($forum->type != 'single' @@ -259,7 +259,7 @@ echo ""; if (!empty($forum->blockafter) && !empty($forum->blockperiod)) { - $a = new object(); + $a = new stdClass(); $a->blockafter = $forum->blockafter; $a->blockperiod = get_string('secondstotime'.$forum->blockperiod); echo $OUTPUT->notification(get_string('thisforumisthrottled','forum',$a)); diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 025f4b41351..0f760e11ac6 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -74,7 +74,7 @@ function forum_add_instance($forum, $mform) { $modcontext = get_context_instance(CONTEXT_MODULE, $forum->coursemodule); if ($forum->type == 'single') { // Create related discussion. - $discussion = new object(); + $discussion = new stdClass(); $discussion->course = $forum->course; $discussion->forum = $forum->id; $discussion->name = $forum->name; @@ -158,7 +158,7 @@ function forum_update_instance($forum, $mform) { $discussion = array_pop($discussions); } else { // try to recover by creating initial discussion - MDL-16262 - $discussion = new object(); + $discussion = new stdClass(); $discussion->course = $forum->course; $discussion->forum = $forum->id; $discussion->name = $forum->name; @@ -507,7 +507,7 @@ function forum_cron() { // reset the caches foreach ($coursemodules as $forumid=>$unused) { - $coursemodules[$forumid]->cache = new object(); + $coursemodules[$forumid]->cache = new stdClass(); $coursemodules[$forumid]->cache->caps = array(); unset($coursemodules[$forumid]->uservisible); } @@ -590,7 +590,7 @@ function forum_cron() { // Does the user want this post in a digest? If so postpone it for now. if ($userto->maildigest > 0) { // This user wants the mails to be in digest form - $queue = new object(); + $queue = new stdClass(); $queue->userid = $userto->id; $queue->discussionid = $discussion->id; $queue->postid = $post->id; @@ -626,7 +626,7 @@ function forum_cron() { mtrace('Sending ', ''); - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->component = 'mod_forum'; $eventdata->name = 'posts'; $eventdata->userfrom = $userfrom; @@ -800,7 +800,7 @@ function forum_cron() { $postsubject = get_string('digestmailsubject', 'forum', format_string($site->shortname, true)); - $headerdata = new object(); + $headerdata = new stdClass(); $headerdata->sitename = format_string($site->fullname, true); $headerdata->userprefs = $CFG->wwwroot.'/user/edit.php?id='.$userid.'&course='.$site->id; @@ -889,7 +889,7 @@ function forum_cron() { if ($userto->maildigest == 2) { // Subjects only - $by = new object(); + $by = new stdClass(); $by->name = fullname($userfrom); $by->date = userdate($post->modified); $posttext .= "\n".format_string($post->subject,true).' '.get_string("bynameondate", "forum", $by); @@ -1127,7 +1127,7 @@ function forum_user_outline($course, $user, $mod, $forum) { $count = forum_count_user_posts($forum->id, $user->id); if ($count && $count->postcount > 0) { - $result = new object(); + $result = new stdClass(); $result->info = get_string("numposts", "forum", $count->postcount); $result->time = $count->lastpost; if ($grade) { @@ -1135,7 +1135,7 @@ function forum_user_outline($course, $user, $mod, $forum) { } return $result; } else if ($grade) { - $result = new object(); + $result = new stdClass(); $result->info = get_string('grade') . ': ' . $grade->str_long_grade; $result->time = $grade->dategraded; return $result; @@ -1485,7 +1485,7 @@ function forum_update_grades($forum, $userid=0, $nullifnone=true) { forum_grade_item_update($forum, $grades); } else if ($userid and $nullifnone) { - $grade = new object(); + $grade = new stdClass(); $grade->userid = $userid; $grade->rawgrade = NULL; forum_grade_item_update($forum, $grade); @@ -2934,7 +2934,7 @@ function forum_get_course_forum($courseid, $type) { echo $OUTPUT->notification("Could not find forum module!!"); return false; } - $mod = new object(); + $mod = new stdClass(); $mod->course = $courseid; $mod->module = $module->id; $mod->instance = $forum->id; @@ -2991,7 +2991,7 @@ function forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfro } // format the post body - $options = new object(); + $options = new stdClass(); $options->para = true; $formattedtext = format_text($post->message, $post->messageformat, $options, $course->id); @@ -3009,7 +3009,7 @@ function forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfro $output .= '
'.format_string($post->subject).'
'; $fullname = fullname($userfrom, $viewfullnames); - $by = new object(); + $by = new stdClass(); $by->name = ''.$fullname.''; $by->date = userdate($post->modified, '', $userto->timezone); $output .= '
'.get_string('bynameondate', 'forum', $by).'
'; @@ -3125,7 +3125,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa // caching if (!isset($cm->cache)) { - $cm->cache = new object(); + $cm->cache = new stdClass(); } if (!isset($cm->cache->caps)) { @@ -3208,7 +3208,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa echo ''; // Picture - $postuser = new object(); + $postuser = new stdClass(); $postuser->id = $post->userid; $postuser->firstname = $post->firstname; $postuser->lastname = $post->lastname; @@ -3234,7 +3234,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa echo '
'; $fullname = fullname($postuser, $cm->cache->caps['moodle/site:viewfullnames']); - $by = new object(); + $by = new stdClass(); $by->name = ''.$fullname.''; $by->date = userdate($post->modified); @@ -3271,7 +3271,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa echo '
'; } - $options = new object(); + $options = new stdClass(); $options->para = false; $options->trusted = $post->messagetrust; if ($link and (strlen(strip_tags($post->message)) > $CFG->forum_longpost)) { @@ -3486,7 +3486,7 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring="" echo "\n"; // Picture - $postuser = new object; + $postuser = new stdClass(); $postuser->id = $post->userid; $postuser->firstname = $post->firstname; $postuser->lastname = $post->lastname; @@ -3554,7 +3554,7 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring="" echo '
'; $usedate = (empty($post->timemodified)) ? $post->modified : $post->timemodified; // Just in case $parenturl = (empty($post->lastpostid)) ? '' : '&parent='.$post->lastpostid; - $usermodified = new object(); + $usermodified = new stdClass(); $usermodified->id = $post->usermodified; $usermodified->firstname = $post->umfirstname; $usermodified->lastname = $post->umlastname; @@ -3737,7 +3737,7 @@ function forum_move_attachments($discussion, $forumfrom, $forumto) { foreach ($posts as $post) { if ($oldfiles = $fs->get_area_files($oldcontext->id, 'mod_forum', 'attachment', $post->id, "id", false)) { foreach ($oldfiles as $oldfile) { - $file_record = new object(); + $file_record = new stdClass(); $file_record->contextid = $newcontext->id; $fs->create_file_from_storedfile($file_record, $oldfile); } @@ -4074,7 +4074,7 @@ function forum_add_discussion($discussion, $mform=null, &$message=null, $userid= $forum = $DB->get_record('forum', array('id'=>$discussion->forum)); $cm = get_coursemodule_from_instance('forum', $forum->id); - $post = new object(); + $post = new stdClass(); $post->discussion = 0; $post->parent = 0; $post->userid = $userid; @@ -4342,7 +4342,7 @@ function forum_subscribe($userid, $forumid) { return true; } - $sub = new object(); + $sub = new stdClass(); $sub->userid = $userid; $sub->forum = $forumid; @@ -4403,7 +4403,7 @@ function forum_post_subscription($post, $forum) { } } - $info = new object(); + $info = new stdClass(); $info->name = fullname($USER); $info->forum = format_string($forum->name); @@ -5242,7 +5242,7 @@ function forum_print_discussion($course, $cm, $forum, $discussion, $post, $mode, } // $cm holds general cache for forum functions - $cm->cache = new object(); + $cm->cache = new stdClass(); $cm->cache->groups = groups_get_all_groups($course->id, 0, $cm->groupingid); $cm->cache->usersgroups = array(); @@ -5400,7 +5400,7 @@ function forum_print_posts_threaded($course, &$cm, $forum, $discussion, $parent, echo "\n"; continue; } - $by = new object(); + $by = new stdClass(); $by->name = fullname($post, $canviewfullnames); $by->date = userdate($post->modified); @@ -5557,7 +5557,7 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours $aname = format_string($cm->name,true); foreach ($printposts as $post) { - $tmpactivity = new object(); + $tmpactivity = new stdClass(); $tmpactivity->type = 'forum'; $tmpactivity->cmid = $cm->id; @@ -5565,13 +5565,13 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours $tmpactivity->sectionnum = $cm->sectionnum; $tmpactivity->timestamp = $post->modified; - $tmpactivity->content = new object(); + $tmpactivity->content = new stdClass(); $tmpactivity->content->id = $post->id; $tmpactivity->content->discussion = $post->discussion; $tmpactivity->content->subject = format_string($post->subject); $tmpactivity->content->parent = $post->parent; - $tmpactivity->user = new object(); + $tmpactivity->user = new stdClass(); $tmpactivity->user->id = $post->userid; $tmpactivity->user->firstname = $post->firstname; $tmpactivity->user->lastname = $post->lastname; @@ -6692,7 +6692,7 @@ function forum_tp_stop_tracking($forumid, $userid=false) { } if (!$DB->record_exists('forum_track_prefs', array('userid' => $userid, 'forumid' => $forumid))) { - $track_prefs = new object(); + $track_prefs = new stdClass(); $track_prefs->userid = $userid; $track_prefs->forumid = $forumid; $DB->insert_record('forum_track_prefs', $track_prefs); @@ -6760,7 +6760,7 @@ function forum_discussion_update_last_post($discussionid) { // Lets go find the last post if (($lastposts = $DB->get_records_sql($sql, array($discussionid), 0, 1))) { $lastpost = reset($lastposts); - $discussionobject = new Object; + $discussionobject = new stdClass(); $discussionobject->id = $discussionid; $discussionobject->usermodified = $lastpost->userid; $discussionobject->timemodified = $lastpost->modified; @@ -6855,7 +6855,7 @@ function forum_check_throttling($forum, $cm=null) { .' ON p.discussion = d.id WHERE d.forum = ?' .' AND p.userid = ? AND p.created > ?', array($forum->id, $USER->id, $timeafter)); - $a = new object(); + $a = new stdClass(); $a->blockafter = $forum->blockafter; $a->numposts = $numposts; $a->blockperiod = get_string('secondstotime'.$forum->blockperiod); @@ -7128,7 +7128,7 @@ function forum_convert_to_roles($forum, $forummodid, $teacherroles=array(), } else { // Create a course module for the forum and assign it to // section 0 in the course. - $mod = new object; + $mod = new stdClass(); $mod->course = $forum->course; $mod->module = $forummodid; $mod->instance = $forum->id; diff --git a/mod/forum/locallib.php b/mod/forum/locallib.php index e7082b8b1a4..8b324fce635 100644 --- a/mod/forum/locallib.php +++ b/mod/forum/locallib.php @@ -293,7 +293,7 @@ class forum_portfolio_caller extends portfolio_module_caller_base { $post->author = $users[$post->userid]; $viewfullnames = true; // format the post body - $options = new object(); + $options = new stdClass(); $options->para = true; $format = $this->get('exporter')->get('format'); $formattedtext = format_text($post->message, $post->messageformat, $options, $this->get('course')->id); @@ -312,7 +312,7 @@ class forum_portfolio_caller extends portfolio_module_caller_base { $output .= '
'.format_string($post->subject).'
'; $fullname = fullname($users[$post->userid], $viewfullnames); - $by = new object(); + $by = new stdClass(); $by->name = $fullname; $by->date = userdate($post->modified, '', $this->user->timezone); $output .= '
'.get_string('bynameondate', 'forum', $by).'
'; diff --git a/mod/forum/markposts.php b/mod/forum/markposts.php index 3ecd611bc74..a47f0495a11 100644 --- a/mod/forum/markposts.php +++ b/mod/forum/markposts.php @@ -71,7 +71,7 @@ if (isguestuser()) { // Guests can't change forum exit; } -$info = new object(); +$info = new stdClass(); $info->name = fullname($user); $info->forum = format_string($forum->name); diff --git a/mod/forum/post.php b/mod/forum/post.php index 1ec81d44bc8..9094d6a74c9 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -132,7 +132,7 @@ if (!empty($forum)) { // User is starting a new discussion in a forum // Load up the $post variable. - $post = new object(); + $post = new stdClass(); $post->course = $course->id; $post->forum = $forum->id; $post->discussion = 0; // ie discussion # not defined yet @@ -208,7 +208,7 @@ if (!empty($forum)) { // User is starting a new discussion in a forum // Load up the $post variable. - $post = new object(); + $post = new stdClass(); $post->course = $course->id; $post->forum = $forum->id; $post->discussion = $parent->discussion; @@ -411,7 +411,7 @@ if (!empty($forum)) { // User is starting a new discussion in a forum if (!empty($name) && confirm_sesskey()) { // User has confirmed the prune - $newdiscussion = new object(); + $newdiscussion = new stdClass(); $newdiscussion->course = $discussion->course; $newdiscussion->forum = $discussion->forum; $newdiscussion->name = $name; @@ -425,7 +425,7 @@ if (!empty($forum)) { // User is starting a new discussion in a forum $newid = $DB->insert_record('forum_discussions', $newdiscussion); - $newpost = new object(); + $newpost = new stdClass(); $newpost->id = $post->id; $newpost->parent = 0; $newpost->subject = $name; @@ -591,7 +591,7 @@ if ($fromform = $mform_post->get_data()) { //fix for bug #4314 if (!$realpost = $DB->get_record('forum_posts', array('id' => $fromform->id))) { - $realpost = new object; + $realpost = new stdClass(); $realpost->userid = -1; } @@ -776,7 +776,7 @@ if (empty($post->edit)) { if (empty($discussion->name)) { if (empty($discussion)) { - $discussion = new object; + $discussion = new stdClass(); } $discussion->name = $forum->name; } diff --git a/mod/forum/rsslib.php b/mod/forum/rsslib.php index b266c95e8dd..9f9057b713e 100644 --- a/mod/forum/rsslib.php +++ b/mod/forum/rsslib.php @@ -282,11 +282,11 @@ function forum_rss_feed_contents($forum, $sql) { $isdiscussion = false; } - $formatoptions = new object; + $formatoptions = new stdClass(); $items = array(); foreach ($recs as $rec) { - $item = new object(); - $user = new object(); + $item = new stdClass(); + $user = new stdClass(); $item->title = format_string($rec->discussionname); $user->firstname = $rec->userfirstname; $user->lastname = $rec->userlastname; diff --git a/mod/forum/search.php b/mod/forum/search.php index 34c8a0f0cf8..ae02c98f03c 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -125,7 +125,7 @@ if (!$search || $showform) { $PAGE->navbar->add(get_string('advancedsearch', 'forum')); $PAGE->set_title($strsearch); - $PAGE->set_heading($course->fullname); + $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); forum_print_big_search_form($course); @@ -144,7 +144,7 @@ $PAGE->navbar->add($strsearch, new moodle_url('/mod/forum/search.php', array('id $PAGE->navbar->add(s($search, true)); if (!$posts = forum_search_posts($searchterms, $course->id, $page*$perpage, $perpage, $totalcount)) { $PAGE->set_title($strsearchresults); - $PAGE->set_heading($course->fullname); + $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string("nopostscontaining", "forum", $search)); @@ -232,7 +232,7 @@ foreach ($posts as $post) { // will do it for us later. $missing_terms = ""; - $options = new object(); + $options = new stdClass(); $options->trusted = $post->messagetrust; $message = highlight($strippedsearch, format_text($post->message, $post->messageformat, $options, $course->id), diff --git a/mod/forum/settracking.php b/mod/forum/settracking.php index b8b908b3ea1..9a39722194a 100644 --- a/mod/forum/settracking.php +++ b/mod/forum/settracking.php @@ -55,7 +55,7 @@ if (!forum_tp_can_track_forums($forum)) { redirect($returnto); } -$info = new object(); +$info = new stdClass(); $info->name = fullname($USER); $info->forum = format_string($forum->name); if (forum_tp_is_tracked($forum) ) { diff --git a/mod/forum/user.php b/mod/forum/user.php index 02041286127..8def729dd85 100644 --- a/mod/forum/user.php +++ b/mod/forum/user.php @@ -156,7 +156,7 @@ if ($posts = forum_search_posts($searchterms, $searchcourse, $page*$perpage, $pe $ratings = null; if ($forum->assessed) { if ($scale = make_grades_menu($forum->scale)) { - $ratings =new object(); + $ratings =new stdClass(); $ratings->scale = $scale; $ratings->assesstimestart = $forum->assesstimestart; $ratings->assesstimefinish = $forum->assesstimefinish; diff --git a/mod/glossary/approve.php b/mod/glossary/approve.php index 0a389add9e2..579ea45d95c 100644 --- a/mod/glossary/approve.php +++ b/mod/glossary/approve.php @@ -22,7 +22,7 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/glossary:approve', $context); if (!$entry->approved and confirm_sesskey()) { - $newentry = new object(); + $newentry = new stdClass(); $newentry->id = $entry->id; $newentry->approved = 1; $newentry->timemodified = time(); // wee need this date here to speed up recent activity, TODO: use timestamp in approved field instead in 2.0 diff --git a/mod/glossary/deleteentry.php b/mod/glossary/deleteentry.php index 6ea89806296..dbaccf45e51 100644 --- a/mod/glossary/deleteentry.php +++ b/mod/glossary/deleteentry.php @@ -78,7 +78,7 @@ if ($confirm and confirm_sesskey()) { // the operation was confirmed. if ($oldfiles = $fs->get_area_files($context->id, 'mod_glossary', 'attachment', $entry->id)) { foreach ($oldfiles as $oldfile) { - $file_record = new object(); + $file_record = new stdClass(); $file_record->contextid = $newcontext->id; $fs->create_file_from_storedfile($file_record, $oldfile); } diff --git a/mod/glossary/edit.php b/mod/glossary/edit.php index d332e7d5912..c59d6c73382 100644 --- a/mod/glossary/edit.php +++ b/mod/glossary/edit.php @@ -59,7 +59,7 @@ if ($id) { // if entry is specified } else { // new entry require_capability('mod/glossary:write', $context); // note: guest user does not have any write capability - $entry = new object(); + $entry = new stdClass(); $entry->id = null; } @@ -145,7 +145,7 @@ if ($mform->is_cancelled()){ // TODO: this deletes cats from both both main and secondary glossary :-( if (!empty($categories) and array_search(0, $categories) === false) { foreach ($categories as $catid) { - $newcategory = new object(); + $newcategory = new stdClass(); $newcategory->entryid = $entry->id; $newcategory->categoryid = $catid; $DB->insert_record('glossary_entries_categories', $newcategory, false); @@ -159,7 +159,7 @@ if ($mform->is_cancelled()){ foreach ($aliases as $alias) { $alias = trim($alias); if ($alias !== '') { - $newalias = new object(); + $newalias = new stdClass(); $newalias->entryid = $entry->id; $newalias->alias = $alias; $DB->insert_record('glossary_alias', $newalias, false); diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index c83192d1802..e8c265be561 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -84,7 +84,7 @@ if ( $hook >0 ) { if ( $action == "edit" ) { if ( $confirm ) { $action = ""; - $cat = new object(); + $cat = new stdClass(); $cat->id = $hook; $cat->name = $name; $cat->usedynalink = $usedynalink; @@ -170,7 +170,7 @@ if ( $hook >0 ) { } else { $action = ""; - $cat = new object(); + $cat = new stdClass(); $cat->name = $name; $cat->usedynalink = $usedynalink; $cat->glossaryid = $glossary->id; diff --git a/mod/glossary/exportentry.php b/mod/glossary/exportentry.php index 49f6e6ae97e..e4bff6a53d8 100644 --- a/mod/glossary/exportentry.php +++ b/mod/glossary/exportentry.php @@ -108,7 +108,7 @@ if (!data_submitted() or !$confirm or !confirm_sesskey()) { if ($oldfiles = $fs->get_area_files($context->id, 'mod_glossary', 'attachment', $entry->id)) { foreach ($oldfiles as $oldfile) { - $file_record = new object(); + $file_record = new stdClass(); $file_record->contextid = $maincontext->id; $fs->create_file_from_storedfile($file_record, $oldfile); } diff --git a/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php b/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php index d7b3550caad..45d089920ad 100755 --- a/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php +++ b/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php @@ -23,7 +23,7 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', //Use this code to show author's name //Comments: Configuration not supported $fullname = fullname($user); - $by = new object(); + $by = new stdClass(); $by->name = ''.$fullname.''; $by->date = userdate($entry->timemodified); echo ''.get_string('bynameondate', 'forum', $by).'' . '
'; diff --git a/mod/glossary/formats/encyclopedia/encyclopedia_format.php b/mod/glossary/formats/encyclopedia/encyclopedia_format.php index 5b301f78ebc..60b5ba4b7cc 100644 --- a/mod/glossary/formats/encyclopedia/encyclopedia_format.php +++ b/mod/glossary/formats/encyclopedia/encyclopedia_format.php @@ -21,7 +21,7 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode echo ''; $fullname = fullname($user); - $by = new object(); + $by = new stdClass(); $by->name = ''.$fullname.''; $by->date = userdate($entry->timemodified); echo ''.get_string('bynameondate', 'forum', $by).''; diff --git a/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php b/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php index bae5a3184a1..0d34805c43a 100644 --- a/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php +++ b/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php @@ -22,7 +22,7 @@ function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mo echo ''; $fullname = fullname($user); - $by = new object(); + $by = new stdClass(); $by->name = ''.$fullname.''; $by->date = userdate($entry->timemodified); echo ''.get_string('bynameondate', 'forum', $by).''; diff --git a/mod/glossary/import.php b/mod/glossary/import.php index 52d8cee675c..00d607d4c0c 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -247,7 +247,7 @@ if ($xml = glossary_read_imported_file($result)) { $aliasname = $xmlalias['#']['NAME'][0]['#']; if (!empty($aliasname)) { - $newalias = new object(); + $newalias = new stdClass(); $newalias->entryid = $newentry->id; $newalias->alias = trim($aliasname); $newalias->id = $DB->insert_record("glossary_alias",$newalias); @@ -260,12 +260,12 @@ if ($xml = glossary_read_imported_file($result)) { for($k = 0; $k < sizeof($xmlcats); $k++) { $xmlcat = $xmlcats[$k]; - $newcat = new object(); + $newcat = new stdClass(); $newcat->name = $xmlcat['#']['NAME'][0]['#']; $newcat->usedynalink = $xmlcat['#']['USEDYNALINK'][0]['#']; if ( !$category = $DB->get_record("glossary_categories", array("glossaryid"=>$glossary->id,"name"=>$newcat->name))) { // Create the category if it does not exist - $category = new object(); + $category = new stdClass(); $category->name = $newcat->name; $category->glossaryid = $glossary->id; $category->id = $DB->insert_record("glossary_categories",$category); @@ -273,7 +273,7 @@ if ($xml = glossary_read_imported_file($result)) { } if ( $category ) { // inserting the new relation - $entrycat = new object(); + $entrycat = new stdClass(); $entrycat->entryid = $newentry->id; $entrycat->categoryid = $category->id; $DB->insert_record("glossary_entries_categories",$entrycat); diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 058300d97fc..17193875beb 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -166,7 +166,7 @@ function glossary_delete_instance($id) { $newcontext = get_context_instance(CONTEXT_MODULE, $entry->sourcecmid); if ($oldfiles = $fs->get_area_files($context->id, 'mod_glossary', 'attachment', $entry->id)) { foreach ($oldfiles as $oldfile) { - $file_record = new object(); + $file_record = new stdClass(); $file_record->contextid = $newcontext->id; $fs->create_file_from_storedfile($file_record, $oldfile); } @@ -228,7 +228,7 @@ function glossary_user_outline($course, $user, $mod, $glossary) { } if ($entries = glossary_get_user_entries($glossary->id, $user->id)) { - $result = new object(); + $result = new stdClass(); $result->info = count($entries) . ' ' . get_string("entries", "glossary"); $lastentry = array_pop($entries); @@ -239,7 +239,7 @@ function glossary_user_outline($course, $user, $mod, $glossary) { } return $result; } else if ($grade) { - $result = new object(); + $result = new stdClass(); $result->info = get_string('grade') . ': ' . $grade->str_long_grade; $result->time = $grade->dategraded; return $result; @@ -492,7 +492,7 @@ function glossary_update_grades($glossary=null, $userid=0, $nullifnone=true) { glossary_grade_item_update($glossary, $grades); } else if ($userid and $nullifnone) { - $grade = new object(); + $grade = new stdClass(); $grade->userid = $userid; $grade->rawgrade = NULL; glossary_grade_item_update($glossary, $grade); @@ -670,7 +670,7 @@ function glossary_get_available_formats() { //If the format doesn't exist in the table if (!$rec = $DB->get_record('glossary_formats', array('name'=>$format))) { //Insert the record in glossary_formats - $gf = new object(); + $gf = new stdClass(); $gf->name = $format; $gf->popupformatname = $format; $gf->visible = 1; @@ -842,7 +842,7 @@ function glossary_print_entry_default ($entry, $glossary, $cm) { $context = get_context_instance(CONTEXT_MODULE, $cm->id); $definition = file_rewrite_pluginfile_urls($definition, 'pluginfile.php', $context->id, 'mod_glossary', 'entry', $entry->id); - $options = new object(); + $options = new stdClass(); $options->para = false; $options->trusted = $entry->definitiontrust; $definition = format_text($definition, $entry->definitionformat, $options); @@ -856,7 +856,7 @@ function glossary_print_entry_default ($entry, $glossary, $cm) { */ function glossary_print_entry_concept($entry, $return=false) { global $OUTPUT; - $options = new object(); + $options = new stdClass(); $options->para = false; $text = format_text($OUTPUT->heading('' . $entry->concept . '', 3, 'nolink'), FORMAT_MOODLE, $options); if (!empty($entry->highlight)) { @@ -895,7 +895,7 @@ function glossary_print_entry_definition($entry, $glossary, $cm) { } } - $options = new object(); + $options = new stdClass(); $options->para = false; $options->trusted = $entry->definitiontrust; diff --git a/mod/glossary/locallib.php b/mod/glossary/locallib.php index f464642079a..bdd76c354a8 100644 --- a/mod/glossary/locallib.php +++ b/mod/glossary/locallib.php @@ -375,7 +375,7 @@ class glossary_entry_portfolio_caller extends portfolio_module_caller_base { global $OUTPUT, $DB; $entry = clone $entry; $context = get_context_instance(CONTEXT_MODULE, $cm->id); - $options = new object(); + $options = new stdClass(); $options->para = false; $options->trusted = $entry->definitiontrust; $options->context = $context; diff --git a/mod/glossary/rsslib.php b/mod/glossary/rsslib.php index 4d6a9f3cedb..7cff81b0d31 100644 --- a/mod/glossary/rsslib.php +++ b/mod/glossary/rsslib.php @@ -44,19 +44,19 @@ } $items = array(); - - $formatoptions = new object; + + $formatoptions = new stdClass(); $formatoptions->trusttext = true; foreach ($recs as $rec) { - $item = new object(); - $user = new object(); + $item = new stdClass(); + $user = new stdClass(); $item->title = $rec->entryconcept; if ($glossary->rsstype == 1) {//With author $user->firstname = $rec->userfirstname; $user->lastname = $rec->userlastname; - + $item->author = fullname($user); } diff --git a/mod/imscp/db/upgradelib.php b/mod/imscp/db/upgradelib.php index 54bdf6837d8..e905f397c51 100644 --- a/mod/imscp/db/upgradelib.php +++ b/mod/imscp/db/upgradelib.php @@ -66,7 +66,7 @@ function imscp_20_migrate() { $introformat = FORMAT_MOODLE; } - $imscp = new object(); + $imscp = new stdClass(); $imscp->course = $candidate->course; $imscp->name = $candidate->name; $imscp->intro = $intro; diff --git a/mod/imscp/lib.php b/mod/imscp/lib.php index c95853815f4..f777ae1cfe4 100644 --- a/mod/imscp/lib.php +++ b/mod/imscp/lib.php @@ -212,7 +212,7 @@ function imscp_user_outline($course, $user, $mod, $imscp) { $numviews = count($logs); $lastlog = array_pop($logs); - $result = new object(); + $result = new stdClass(); $result->info = get_string('numviews', '', $numviews); $result->time = $lastlog->time; diff --git a/mod/label/lib.php b/mod/label/lib.php index 4605114640c..a80a08d1082 100644 --- a/mod/label/lib.php +++ b/mod/label/lib.php @@ -142,7 +142,7 @@ function label_get_coursemodule_info($coursemodule) { $label->name = "label{$label->id}"; $DB->set_field('label', 'name', $label->name, array('id'=>$label->id)); } - $info = new object(); + $info = new stdClass(); // no filtering hre because this info is cached and filtered later $info->extra = format_module_intro('label', $label, $coursemodule->id, false); $info->name = $label->name; diff --git a/mod/lesson/continue.php b/mod/lesson/continue.php index 49e7b67c93f..b9e36345f2f 100644 --- a/mod/lesson/continue.php +++ b/mod/lesson/continue.php @@ -133,7 +133,7 @@ if ($result->nodefaultresponse) { if ($canmanage) { // This is the warning msg for teachers to inform them that cluster and unseen does not work while logged in as a teacher if(lesson_display_teacher_warning($lesson)) { - $warningvars = new object(); + $warningvars = new stdClass(); $warningvars->cluster = get_string("clusterjump", "lesson"); $warningvars->unseen = get_string("unseenpageinbranch", "lesson"); $lesson->add_message(get_string("teacherjumpwarning", "lesson", $warningvars)); diff --git a/mod/lesson/essay.php b/mod/lesson/essay.php index f9b5764aa90..6015d55aeeb 100644 --- a/mod/lesson/essay.php +++ b/mod/lesson/essay.php @@ -105,7 +105,7 @@ switch ($mode) { $gradeinfo = lesson_grade($lesson, $attempt->retry, $attempt->userid); // Set and update - $updategrade = new object(); + $updategrade = new stdClass(); $updategrade->id = $grade->id; $updategrade->grade = $gradeinfo->grade; $DB->update_record('lesson_grades', $updategrade); @@ -202,7 +202,7 @@ switch ($mode) { // Subject $subject = get_string('essayemailsubject', 'lesson', format_string($pages[$attempt->pageid]->title,true)); - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'lesson'; $eventdata->userfrom = $USER; $eventdata->userto = $users[$attempt->userid]; diff --git a/mod/lesson/format.php b/mod/lesson/format.php index 5aa5b157842..5a2ea0c8798 100644 --- a/mod/lesson/format.php +++ b/mod/lesson/format.php @@ -57,7 +57,7 @@ function lesson_save_question_options($question, $lesson) { $manager = lesson_page_type_manager::get($lesson); $timenow = time(); - $result = new object(); + $result = new stdClass(); switch ($question->qtype) { case LESSON_PAGE_SHORTANSWER: diff --git a/mod/lesson/importpptlib.php b/mod/lesson/importpptlib.php index aaaf04218f8..8550e6105fb 100644 --- a/mod/lesson/importpptlib.php +++ b/mod/lesson/importpptlib.php @@ -137,7 +137,7 @@ function lesson_create_objects($pageobjects, $lessonid) { $branchtable = new stdClass; // all pages have this info - $page = new object(); + $page = new stdClass(); $page->lessonid = $lessonid; $page->prevpageid = 0; $page->nextpageid = 0; @@ -149,7 +149,7 @@ function lesson_create_objects($pageobjects, $lessonid) { $page->timemodified = 0; // all answers are the same - $answer = new object(); + $answer = new stdClass(); $answer->lessonid = $lessonid; $answer->jumpto = LESSON_NEXTPAGE; $answer->grade = 0; diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php index 9e84d556744..3bfaa4178be 100644 --- a/mod/lesson/lib.php +++ b/mod/lesson/lib.php @@ -160,7 +160,7 @@ function lesson_user_outline($course, $user, $mod, $lesson) { require_once("$CFG->libdir/gradelib.php"); $grades = grade_get_grades($course->id, 'mod', 'lesson', $lesson->id, $user->id); - $return = new object(); + $return = new stdClass(); if (empty($grades->items[0]->grades)) { $return->info = get_string("no")." ".get_string("attempts", "lesson"); } else { @@ -403,7 +403,7 @@ function lesson_update_grades($lesson, $userid=0, $nullifnone=true) { lesson_grade_item_update($lesson, $grades); } else if ($userid and $nullifnone) { - $grade = new object(); + $grade = new stdClass(); $grade->userid = $userid; $grade->rawgrade = NULL; lesson_grade_item_update($lesson, $grade); diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php index 7bad4787fb1..9903a6d47c6 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -134,7 +134,7 @@ class lesson_page_type_matching extends lesson_page { public function check_answer() { global $CFG, $PAGE; - $formattextdefoptions = new object(); + $formattextdefoptions = new stdClass(); $formattextdefoptions->noclean = true; $formattextdefoptions->para = false; diff --git a/mod/lesson/pagetypes/multichoice.php b/mod/lesson/pagetypes/multichoice.php index 6beb9c477ee..c411247e46a 100644 --- a/mod/lesson/pagetypes/multichoice.php +++ b/mod/lesson/pagetypes/multichoice.php @@ -102,7 +102,7 @@ class lesson_page_type_multichoice extends lesson_page { global $DB, $CFG, $PAGE; $result = parent::check_answer(); - $formattextdefoptions = new object(); + $formattextdefoptions = new stdClass(); $formattextdefoptions->noclean = true; $formattextdefoptions->para = false; diff --git a/mod/lesson/pagetypes/truefalse.php b/mod/lesson/pagetypes/truefalse.php index 11e81cce8ac..5bdbe2224fe 100644 --- a/mod/lesson/pagetypes/truefalse.php +++ b/mod/lesson/pagetypes/truefalse.php @@ -63,7 +63,7 @@ class lesson_page_type_truefalse extends lesson_page { } public function check_answer() { global $DB, $CFG; - $formattextdefoptions = new object(); + $formattextdefoptions = new stdClass(); $formattextdefoptions->noclean = true; $formattextdefoptions->para = false; @@ -101,7 +101,7 @@ class lesson_page_type_truefalse extends lesson_page { public function display_answers(html_table $table) { $answers = $this->get_answers(); - $options = new object(); + $options = new stdClass(); $options->noclean = true; $options->para = false; $i = 1; @@ -177,7 +177,7 @@ class lesson_page_type_truefalse extends lesson_page { public function report_answers($answerpage, $answerdata, $useranswer, $pagestats, &$i, &$n) { $answers = $this->get_answers(); - $formattextdefoptions = new object(); //I'll use it widely in this page + $formattextdefoptions = new stdClass(); //I'll use it widely in this page $formattextdefoptions->para = false; $formattextdefoptions->noclean = true; foreach ($answers as $answer) { @@ -301,7 +301,7 @@ class lesson_display_answer_form_truefalse extends moodleform { $mform->addElement('header', 'pageheader', $OUTPUT->box($contents, 'contents')); - $options = new object(); + $options = new stdClass(); $options->para = false; $options->noclean = true; diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 76bd04375f2..992c3455b44 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -429,7 +429,7 @@ if ($pageid != LESSON_EOL) { $a->total = $lesson->grade; $lessoncontent .= $lessonoutput->paragraph(get_string("yourcurrentgradeisoutof", "lesson", $a), 'center'); - $grade = new object(); + $grade = new stdClass(); $grade->lessonid = $lesson->id; $grade->userid = $USER->id; $grade->grade = $gradeinfo->grade; @@ -451,7 +451,7 @@ if ($pageid != LESSON_EOL) { } else { if ($lesson->timed) { if ($outoftime == 'normal') { - $grade = new object();; + $grade = new stdClass();; $grade->lessonid = $lesson->id; $grade->userid = $USER->id; $grade->grade = 0; diff --git a/mod/page/db/upgradelib.php b/mod/page/db/upgradelib.php index b40b590d52c..d2849d05a5d 100644 --- a/mod/page/db/upgradelib.php +++ b/mod/page/db/upgradelib.php @@ -82,7 +82,7 @@ function page_20_migrate_candidate($candidate, $fs, $format) { $introformat = FORMAT_MOODLE; } - $page = new object(); + $page = new stdClass(); $page->course = $candidate->course; $page->name = $candidate->name; $page->intro = $intro; diff --git a/mod/page/lib.php b/mod/page/lib.php index f3bd4d43ac3..cc1f7074fd4 100644 --- a/mod/page/lib.php +++ b/mod/page/lib.php @@ -194,7 +194,7 @@ function page_user_outline($course, $user, $mod, $page) { $numviews = count($logs); $lastlog = array_pop($logs); - $result = new object(); + $result = new stdClass(); $result->info = get_string('numviews', '', $numviews); $result->time = $lastlog->time; @@ -256,7 +256,7 @@ function page_get_coursemodule_info($coursemodule) { return NULL; } - $info = new object(); + $info = new stdClass(); $info->name = $page->name; if ($page->display != RESOURCELIB_DISPLAY_POPUP) { diff --git a/mod/quiz/attemptlib.php b/mod/quiz/attemptlib.php index 8de1af86fec..b2e87e054b7 100644 --- a/mod/quiz/attemptlib.php +++ b/mod/quiz/attemptlib.php @@ -926,7 +926,7 @@ class quiz_attempt extends quiz { /// Work out a nice title. $student = $DB->get_record('user', array('id' => $this->get_userid())); - $a = new object(); + $a = new stdClass(); $a->fullname = fullname($student, true); $a->attempt = $this->get_attempt_number(); diff --git a/mod/quiz/db/install.php b/mod/quiz/db/install.php index 85c9ca45739..cb9036e8396 100644 --- a/mod/quiz/db/install.php +++ b/mod/quiz/db/install.php @@ -8,17 +8,17 @@ function xmldb_quiz_install() { global $DB; - $record = new object(); + $record = new stdClass(); $record->name = 'overview'; $record->displayorder = '10000'; $DB->insert_record('quiz_report', $record); - $record = new object(); + $record = new stdClass(); $record->name = 'responses'; $record->displayorder = '9000'; $DB->insert_record('quiz_report', $record); - $record = new object(); + $record = new stdClass(); $record->name = 'grading'; $record->displayorder = '6000'; $DB->insert_record('quiz_report', $record); diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php index b528afa02a2..21290ebaf3c 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -49,22 +49,22 @@ function xmldb_quiz_upgrade($oldversion) { } if ($oldversion < 2008062001) { - $reporttoinsert = new object(); + $reporttoinsert = new stdClass(); $reporttoinsert->name = 'overview'; $reporttoinsert->displayorder = 10000; $DB->insert_record('quiz_report', $reporttoinsert); - $reporttoinsert = new object(); + $reporttoinsert = new stdClass(); $reporttoinsert->name = 'responses'; $reporttoinsert->displayorder = 9000; $DB->insert_record('quiz_report', $reporttoinsert); - $reporttoinsert = new object(); + $reporttoinsert = new stdClass(); $reporttoinsert->name = 'regrade'; $reporttoinsert->displayorder = 7000; $DB->insert_record('quiz_report', $reporttoinsert); - $reporttoinsert = new object(); + $reporttoinsert = new stdClass(); $reporttoinsert->name = 'grading'; $reporttoinsert->displayorder = 6000; $DB->insert_record('quiz_report', $reporttoinsert); diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 50d66b7272e..ec964e5fc22 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -578,7 +578,7 @@ function quiz_update_grades($quiz, $userid=0, $nullifnone=true) { quiz_grade_item_update($quiz, $grades); } else if ($userid and $nullifnone) { - $grade = new object(); + $grade = new stdClass(); $grade->userid = $userid; $grade->rawgrade = NULL; quiz_grade_item_update($quiz, $grade); diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 20beeba7fd5..234dc27421f 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -1016,7 +1016,7 @@ function quiz_send_confirmation($a) { $body = get_string('emailconfirmbody', 'quiz', $a); // send email and analyse result - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'quiz'; $eventdata->userfrom = get_admin(); $eventdata->userto = $USER; @@ -1050,7 +1050,7 @@ function quiz_send_notification($recipient, $a) { $body = get_string('emailnotifybody', 'quiz', $a); // send email and analyse result - $eventdata = new object(); + $eventdata = new stdClass(); $eventdata->modulename = 'quiz'; $eventdata->userfrom = $USER; $eventdata->userto = $recipient; diff --git a/mod/quiz/overrideedit.php b/mod/quiz/overrideedit.php index 3e8f1eec511..d340435157a 100644 --- a/mod/quiz/overrideedit.php +++ b/mod/quiz/overrideedit.php @@ -86,7 +86,7 @@ if ($overrideid) { } else { // new override - $data = new object(); + $data = new stdClass(); } // merge quiz defaults with data diff --git a/mod/quiz/processattempt.php b/mod/quiz/processattempt.php index 9dbb1d1e330..d2f6f8b22ac 100644 --- a/mod/quiz/processattempt.php +++ b/mod/quiz/processattempt.php @@ -196,7 +196,7 @@ $accessmanager = $attemptobj->get_access_manager($timenow); $accessmanager->clear_password_access(); /// Trigger event -$eventdata = new object(); +$eventdata = new stdClass(); $eventdata->component = 'mod_quiz'; $eventdata->course = $attemptobj->get_courseid(); $eventdata->quiz = $attemptobj->get_quizid(); diff --git a/mod/quiz/report/grading/report.php b/mod/quiz/report/grading/report.php index 6070d876372..f956b209ec6 100644 --- a/mod/quiz/report/grading/report.php +++ b/mod/quiz/report/grading/report.php @@ -170,7 +170,7 @@ class quiz_grading_report extends quiz_default_report { } $qmenu = array(); foreach ($gradeableqs as $qid => $questionformenu){ - $a= new object(); + $a= new stdClass(); $a->number = $gradeableqs[$qid]->number; $a->name = $gradeableqs[$qid]->name; $a->gradedattempts =$qattempts[$qid]->gradedattempts; @@ -188,7 +188,7 @@ class quiz_grading_report extends quiz_default_report { if (!$questionid){ return true; } - $a= new object(); + $a= new stdClass(); $a->number = $question->number; $a->name = $question->name; $a->gradedattempts =$qattempts[$question->id]->gradedattempts; @@ -356,7 +356,7 @@ class quiz_grading_report extends quiz_default_report { } else if ($userid){ echo $OUTPUT->heading(get_string('gradinguser','quiz_grading', $fullname), 3); } else if ($attemptid){ - $a = new object(); + $a = new stdClass(); $a->fullname = $fullname; $a->attempt = $firstattempt->attempt; echo $OUTPUT->heading(get_string('gradingattempt','quiz_grading', $a), 3); @@ -391,7 +391,7 @@ class quiz_grading_report extends quiz_default_report { $gradedclass = 'main'; $gradedstring = ''; } - $a = new object(); + $a = new stdClass(); $a->fullname = fullname($attempt, true); $a->attempt = $attempt->attempt; diff --git a/mod/quiz/report/overview/overview_table.php b/mod/quiz/report/overview/overview_table.php index fed94b3f2cd..a2e5ae2f891 100644 --- a/mod/quiz/report/overview/overview_table.php +++ b/mod/quiz/report/overview/overview_table.php @@ -119,7 +119,7 @@ class quiz_report_overview_table extends table_sql { function col_picture($attempt){ global $COURSE, $OUTPUT; - $user = new object(); + $user = new stdClass(); $user->id = $attempt->userid; $user->lastname = $attempt->lastname; $user->firstname = $attempt->firstname; diff --git a/mod/quiz/report/overview/overviewsettings_form.php b/mod/quiz/report/overview/overviewsettings_form.php index b7be5bc2102..b1630818ac7 100644 --- a/mod/quiz/report/overview/overviewsettings_form.php +++ b/mod/quiz/report/overview/overviewsettings_form.php @@ -11,7 +11,7 @@ class mod_quiz_report_overview_settings extends moodleform { if (!$this->_customdata['currentgroup']){ $studentsstring = get_string('participants'); } else { - $a = new object(); + $a = new stdClass(); $a->coursestudent = get_string('participants'); $a->groupname = groups_get_group_name($this->_customdata['currentgroup']); if (20 < strlen($a->groupname)){ diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php index 9a17fa6f706..92c758bc276 100644 --- a/mod/quiz/report/overview/report.php +++ b/mod/quiz/report/overview/report.php @@ -198,7 +198,7 @@ class quiz_overview_report extends quiz_default_report { echo '
' . $strattemptnum . '
'; } } - + if (!$nostudents || ($attemptsmode == QUIZ_REPORT_ATTEMPTS_ALL)) { // Construct the SQL @@ -250,7 +250,7 @@ class quiz_overview_report extends quiz_default_report { $table->set_count_sql("SELECT COUNT(1) FROM $from WHERE $where", $params); - $sqlobject = new object; + $sqlobject = new stdClass(); $sqlobject->from = $from; $sqlobject->where = $where; $sqlobject->params = $params; @@ -274,7 +274,7 @@ class quiz_overview_report extends quiz_default_report { if (has_capability('mod/quiz:regrade', $this->context)) { $countregradeneeded = $this->count_regrade_all_needed($quiz, $groupstudents); if ($currentgroup) { - $a= new object(); + $a= new stdClass(); $a->groupname = groups_get_group_name($currentgroup); $a->coursestudents = get_string('participants'); $a->countregradeneeded = $countregradeneeded; @@ -467,14 +467,14 @@ class quiz_overview_report extends quiz_default_report { $changed = regrade_question_in_attempt($question, $attempt, $quiz, true, $dry); $attemptsdone++; - $a = new object(); + $a = new stdClass(); $a->done = $attemptsdone; $a->todo = $attemptstodo; $apb->update($attemptsdone, $attemptstodo, get_string('attemptprogress', 'quiz_overview', $a)); } $qsdone++; if (isset($qpb)) { - $a = new object(); + $a = new stdClass(); $a->done = $qsdone; $a->todo = $qstodo; $qpb->update($qsdone, $qstodo, get_string('qprogress', 'quiz_overview', $a)); @@ -545,7 +545,7 @@ class quiz_overview_report extends quiz_default_report { } if (!empty($apb)) { $attemptsdone++; - $a = new object(); + $a = new stdClass(); $a->done = $attemptsdone; $a->todo = $attemptstodo; $apb->update($attemptsdone, $attemptstodo, get_string('attemptprogress', 'quiz_overview', $a)); diff --git a/mod/quiz/report/responses/responses_table.php b/mod/quiz/report/responses/responses_table.php index 8bb48e2c4cb..5bb8d74f7fd 100644 --- a/mod/quiz/report/responses/responses_table.php +++ b/mod/quiz/report/responses/responses_table.php @@ -75,7 +75,7 @@ class quiz_report_responses_table extends table_sql { function col_picture($attempt){ global $COURSE, $OUTPUT; - $user = new object(); + $user = new stdClass(); $user->id = $attempt->userid; $user->lastname = $attempt->lastname; $user->firstname = $attempt->firstname; diff --git a/mod/quiz/report/responses/responsessettings_form.php b/mod/quiz/report/responses/responsessettings_form.php index d0039bec3d1..15fa3985102 100644 --- a/mod/quiz/report/responses/responsessettings_form.php +++ b/mod/quiz/report/responses/responsessettings_form.php @@ -11,7 +11,7 @@ class mod_quiz_report_responses_settings extends moodleform { if (!$this->_customdata['currentgroup']){ $studentsstring = get_string('participants'); } else { - $a = new object(); + $a = new stdClass(); $a->coursestudent = get_string('participants'); $a->groupname = groups_get_group_name($this->_customdata['currentgroup']); if (20 < strlen($a->groupname)){ diff --git a/mod/quiz/report/simpletest/testreportlib.php b/mod/quiz/report/simpletest/testreportlib.php index be39c3bc666..ed8629b89d3 100644 --- a/mod/quiz/report/simpletest/testreportlib.php +++ b/mod/quiz/report/simpletest/testreportlib.php @@ -19,7 +19,7 @@ class question_reportlib_test extends UnitTestCase { public static $includecoverage = array('mod/quiz/report/reportlib.php'); function test_quiz_report_index_by_keys() { $datum = array(); - $object = new object(); + $object = new stdClass(); $object->qid = 3; $object->aid = 101; $object->response = ''; diff --git a/mod/quiz/report/statistics/db/install.php b/mod/quiz/report/statistics/db/install.php index 0c9b3bfc2b8..24ddba85d3c 100644 --- a/mod/quiz/report/statistics/db/install.php +++ b/mod/quiz/report/statistics/db/install.php @@ -6,7 +6,7 @@ function xmldb_quiz_statistics_install() { global $DB; - $record = new object(); + $record = new stdClass(); $record->name = 'statistics'; $record->displayorder = 8000; $record->cron = 18000; diff --git a/mod/quiz/report/statistics/qstats.php b/mod/quiz/report/statistics/qstats.php index c2ae7221180..cb2e05e7757 100644 --- a/mod/quiz/report/statistics/qstats.php +++ b/mod/quiz/report/statistics/qstats.php @@ -21,7 +21,7 @@ class qstats{ $this->questions = $questions; } function stats_init_object(){ - $statsinit = new object(); + $statsinit = new stdClass(); $statsinit->s = 0; $statsinit->totalgrades = 0; $statsinit->totalothergrades = 0; diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php index a0fffcb2e7a..cb95ebb7ccc 100644 --- a/mod/quiz/report/statistics/report.php +++ b/mod/quiz/report/statistics/report.php @@ -263,7 +263,7 @@ class quiz_statistics_report extends quiz_default_report { uasort($responses[$subqid][$aid], array('quiz_statistics_report', 'sort_answers')); } if (isset($responses[$subqid]['0'])){ - $wildcardresponse = new object(); + $wildcardresponse = new stdClass(); $wildcardresponse->answer = '*'; $wildcardresponse->credit = 0; $teacherresponses[$subqid][0] = $wildcardresponse; @@ -279,7 +279,7 @@ class quiz_statistics_report extends quiz_default_report { } uasort($tresponsesforsubq, array('quiz_statistics_report', 'sort_response_details')); foreach ($tresponsesforsubq as $aid => $teacherresponse){ - $teacherresponserow = new object(); + $teacherresponserow = new stdClass(); $teacherresponserow->response = $teacherresponse->answer; $teacherresponserow->rcount = 0; $teacherresponserow->subq = $subq; @@ -405,7 +405,7 @@ class quiz_statistics_report extends quiz_default_report { $sql = 'SELECT COUNT(1) ' . 'FROM ' .$fromqa.' '. 'WHERE ' .$whereqa.' AND qa.timefinish > :time'; - $a = new object(); + $a = new stdClass(); $a->lastcalculated = format_time(time() - $quizstats->timemodified); if (!$a->count = $DB->count_records_sql($sql, array('time'=>$quizstats->timemodified)+$qaparams)){ $a->count = 0; @@ -464,7 +464,7 @@ class quiz_statistics_report extends quiz_default_report { $usingattemptsstring = ''; } else { $firstattempt = $attempttotals[1]; - $allattempts = new object(); + $allattempts = new stdClass(); $allattempts->countrecs = $firstattempt->countrecs + (isset($attempttotals[0])?$attempttotals[0]->countrecs:0); $allattempts->total = $firstattempt->total + @@ -485,7 +485,7 @@ class quiz_statistics_report extends quiz_default_report { } else { $s = 0; } - $quizstats = new object(); + $quizstats = new stdClass(); if ($s == 0){ $quizstats->firstattemptscount = 0; $quizstats->allattemptscount = 0; diff --git a/mod/quiz/report/statistics/simpletest/test_qstats.php b/mod/quiz/report/statistics/simpletest/test_qstats.php index d629c550759..f234aecb52f 100644 --- a/mod/quiz/report/statistics/simpletest/test_qstats.php +++ b/mod/quiz/report/statistics/simpletest/test_qstats.php @@ -88,7 +88,7 @@ class quiz_report_qstats_test extends UnitTestCase { while (NULL !== ($line = array_shift($filecontents))) { $data = $this->get_fields_from_csv($line); $arraykey = reset($data); - $object = new object(); + $object = new stdClass(); foreach ($keys as $key) { $value = array_shift($data); if ($value !== NULL){ diff --git a/mod/quiz/restorelibpre15.php b/mod/quiz/restorelibpre15.php index 9b3a928c371..78061fa7675 100644 --- a/mod/quiz/restorelibpre15.php +++ b/mod/quiz/restorelibpre15.php @@ -170,7 +170,7 @@ //Iterate over questions for($i = 0; $i < sizeof($questions); $i++) { - $question = new object; + $question = new stdClass(); $que_info = $questions[$i]; //traverse_xmlize($que_info); //Debug //print_object ($GLOBALS['traverse_array']); //Debug @@ -974,7 +974,7 @@ $multianswer->answers = implode(",",$ansarr); //Build the new question structure - $question = new object; + $question = new stdClass(); $question->category = $parentquestion->category; $question->parent = $parentquestion->id; $question->name = $parentquestion->name; @@ -1034,7 +1034,7 @@ if ($status) { ksort($createdquestions); - $multianswerdb = new object; + $multianswerdb = new stdClass(); $multianswerdb->question = $parentquestion->id; $multianswerdb->sequence = implode(",",$createdquestions); $mid = $DB->insert_record('question_multianswer', $multianswerdb); diff --git a/mod/quiz/startattempt.php b/mod/quiz/startattempt.php index 68d9c5b3ea8..c6f54c7600b 100644 --- a/mod/quiz/startattempt.php +++ b/mod/quiz/startattempt.php @@ -123,7 +123,7 @@ foreach ($quizobj->get_questions() as $i => $question) { save_question_session($question, $states[$i]); } /// Trigger event -$eventdata = new object(); +$eventdata = new stdClass(); $eventdata->component = 'mod_quiz'; $eventdata->course = $quizobj->get_courseid(); $eventdata->quiz = $quizobj->get_quizid(); diff --git a/mod/resource/db/upgradelib.php b/mod/resource/db/upgradelib.php index 877d8991f65..56f33611f25 100644 --- a/mod/resource/db/upgradelib.php +++ b/mod/resource/db/upgradelib.php @@ -61,7 +61,7 @@ function resource_20_migrate() { // public site files $path = $matches[2]; - $resource = new object(); + $resource = new stdClass(); $resource->id = $candidate->oldid; $resource->tobemigrated = 0; $resource->mainfile = $path; @@ -83,7 +83,7 @@ function resource_20_migrate() { // current course files $path = $matches[2]; - $resource = new object(); + $resource = new stdClass(); $resource->id = $candidate->oldid; $resource->tobemigrated = 0; $resource->mainfile = $path; @@ -117,7 +117,7 @@ function resource_20_migrate() { preg_match("/^[^?#]+/", $path, $matches); $parts = $matches[0]; - $resource = new object(); + $resource = new stdClass(); $resource->id = $candidate->oldid; $resource->tobemigrated = 0; $resource->mainfile = $path; diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 214cccd8fbc..024ddfbbc85 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -173,7 +173,7 @@ function resource_user_outline($course, $user, $mod, $resource) { $numviews = count($logs); $lastlog = array_pop($logs); - $result = new object(); + $result = new stdClass(); $result->info = get_string('numviews', '', $numviews); $result->time = $lastlog->time; @@ -237,7 +237,7 @@ function resource_get_coursemodule_info($coursemodule) { return NULL; } - $info = new object(); + $info = new stdClass(); $info->name = $resource->name; if ($resource->tobemigrated) { diff --git a/mod/scorm/aicc.php b/mod/scorm/aicc.php index 921900ef738..86b3de42019 100755 --- a/mod/scorm/aicc.php +++ b/mod/scorm/aicc.php @@ -353,7 +353,7 @@ $track->timemodified = time(); $DB->update_record('scorm_scoes_track',$track); } else { - $track = new object(); + $track = new stdClass(); $track->userid = $USER->id; $track->scormid = $scorm->id; $track->scoid = $sco->id; diff --git a/mod/scorm/datamodels/aicclib.php b/mod/scorm/datamodels/aicclib.php index 5650ca0bd9d..e5d633e4700 100644 --- a/mod/scorm/datamodels/aicclib.php +++ b/mod/scorm/datamodels/aicclib.php @@ -59,7 +59,7 @@ function scorm_add_time($a, $b) { */ function scorm_get_aicc_columns($row,$mastername='system_id') { $tok = strtok(strtolower($row),"\",\n\r"); - $result = new object(); + $result = new stdClass(); $result->columns = array(); $i=0; while ($tok) { @@ -225,7 +225,7 @@ function scorm_parse_aicc($scorm) { $launch = 0; if (isset($courses)) { foreach ($courses as $course) { - $sco = new object(); + $sco = new stdClass(); $sco->identifier = $course->id; $sco->scorm = $scorm->id; $sco->organization = ''; @@ -275,7 +275,7 @@ function scorm_parse_aicc($scorm) { $id = $DB->insert_record('scorm_scoes',$sco); } if (!empty($id)) { - $scodata = new object(); + $scodata = new stdClass(); $scodata->scoid = $id; if (isset($element->web_launch)) { $scodata->name = 'parameters'; diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 56d74937105..f8f4985b0db 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -292,7 +292,7 @@ function scorm_user_outline($course, $user, $mod, $scorm) { $grades = grade_get_grades($course->id, 'mod', 'scorm', $scorm->id, $user->id); if (!empty($grades->items[0]->grades)) { $grade = reset($grades->items[0]->grades); - $result = new object(); + $result = new stdClass(); $result->info = get_string('grade') . ': '. $grade->str_long_grade; $result->time = $grade->dategraded; return $result; @@ -507,7 +507,7 @@ function scorm_get_user_grades($scorm, $userid=0) { if (empty($userid)) { if ($scousers = $DB->get_records_select('scorm_scoes_track', "scormid=? GROUP BY userid", array($scorm->id), "", "userid,null")) { foreach ($scousers as $scouser) { - $grades[$scouser->userid] = new object(); + $grades[$scouser->userid] = new stdClass(); $grades[$scouser->userid]->id = $scouser->userid; $grades[$scouser->userid]->userid = $scouser->userid; $grades[$scouser->userid]->rawgrade = scorm_grade_user($scorm, $scouser->userid); @@ -520,7 +520,7 @@ function scorm_get_user_grades($scorm, $userid=0) { if (!$DB->get_records_select('scorm_scoes_track', "scormid=? AND userid=? GROUP BY userid", array($scorm->id, $userid), "", "userid,null")) { return false; //no attempt yet } - $grades[$userid] = new object(); + $grades[$userid] = new stdClass(); $grades[$userid]->id = $userid; $grades[$userid]->userid = $userid; $grades[$userid]->rawgrade = scorm_grade_user($scorm, $userid); @@ -546,7 +546,7 @@ function scorm_update_grades($scorm, $userid=0, $nullifnone=true) { scorm_grade_item_update($scorm, $grades); } else if ($userid and $nullifnone) { - $grade = new object(); + $grade = new stdClass(); $grade->userid = $userid; $grade->rawgrade = NULL; scorm_grade_item_update($scorm, $grade); diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index f60d79365ca..0f589f6cfa2 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -422,7 +422,7 @@ function scorm_get_tracks($scoid,$userid,$attempt='') { } } if ($tracks = $DB->get_records('scorm_scoes_track', array('userid'=>$userid, 'scoid'=>$scoid, 'attempt'=>$attempt),'element ASC')) { - $usertrack = new object(); + $usertrack = new stdClass(); $usertrack->userid = $userid; $usertrack->scoid = $scoid; // Defined in order to unify scorm1.2 and scorm2004 @@ -483,7 +483,7 @@ function scorm_get_tracks($scoid,$userid,$attempt='') { function scorm_get_sco_runtime($scormid, $scoid, $userid, $attempt=1) { global $DB; - $timedata = new object(); + $timedata = new stdClass(); $sql = !empty($scoid) ? "userid=$userid AND scormid=$scormid AND scoid=$scoid AND attempt=$attempt" : "userid=$userid AND scormid=$scormid AND attempt=$attempt"; $tracks = $DB->get_records_select('scorm_scoes_track',"$sql ORDER BY timemodified ASC"); if ($tracks) { diff --git a/mod/survey/lib.php b/mod/survey/lib.php index bc52cf2127b..4abf9aaeff2 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -152,7 +152,7 @@ function survey_user_outline($course, $user, $mod, $survey) { if ($answers = $DB->get_records("survey_answers", array('survey'=>$survey->id, 'userid'=>$user->id))) { $lastanswer = array_pop($answers); - $result = new object(); + $result = new stdClass(); $result->info = get_string("done", "survey"); $result->time = $lastanswer->time; return $result; @@ -430,7 +430,7 @@ function survey_get_user_answer($surveyid, $questionid, $userid) { function survey_add_analysis($survey, $user, $notes) { global $DB; - $record = new object(); + $record = new stdClass(); $record->survey = $survey; $record->userid = $user; $record->notes = $notes; diff --git a/mod/survey/save.php b/mod/survey/save.php index 6878bf6e71c..1ed6e79f4ea 100644 --- a/mod/survey/save.php +++ b/mod/survey/save.php @@ -94,7 +94,7 @@ $timenow = time(); foreach ($answers as $key => $val) { if ($key != 'sesskey') { - $newdata = new object(); + $newdata = new stdClass(); $newdata->time = $timenow; $newdata->userid = $USER->id; $newdata->survey = $survey->id; diff --git a/mod/url/db/upgradelib.php b/mod/url/db/upgradelib.php index b70486c3f2a..c47b733ee93 100644 --- a/mod/url/db/upgradelib.php +++ b/mod/url/db/upgradelib.php @@ -82,7 +82,7 @@ function url_20_migrate() { $introformat = FORMAT_MOODLE; } - $url = new object(); + $url = new stdClass(); $url->course = $candidate->course; $url->name = $candidate->name; $url->intro = $intro; diff --git a/mod/url/lib.php b/mod/url/lib.php index 471336d23cf..f79913b991f 100644 --- a/mod/url/lib.php +++ b/mod/url/lib.php @@ -200,7 +200,7 @@ function url_user_outline($course, $user, $mod, $url) { $numviews = count($logs); $lastlog = array_pop($logs); - $result = new object(); + $result = new stdClass(); $result->info = get_string('numviews', '', $numviews); $result->time = $lastlog->time; @@ -262,7 +262,7 @@ function url_get_coursemodule_info($coursemodule) { return NULL; } - $info = new object(); + $info = new stdClass(); $info->name = $url->name; //note: there should be a way to differentiate links from normal resources diff --git a/mod/wiki/db/migration/wiki/ewiki/ewiki.php b/mod/wiki/db/migration/wiki/ewiki/ewiki.php index 561a2128536..b1b9688950d 100644 --- a/mod/wiki/db/migration/wiki/ewiki/ewiki.php +++ b/mod/wiki/db/migration/wiki/ewiki/ewiki.php @@ -1590,7 +1590,7 @@ function ewiki_page_edit_form(&$id, &$data, &$hidden_postdata) { $usehtmleditor = can_use_html_editor(); echo '
'; if ($usehtmleditor) { //clean and convert before editing - $options = new object(); + $options = new stdClass(); $options->smiley = false; $options->filter = false; $oldtext = format_text(ewiki_format($data["content"]), $moodle_format, $options);