MDL-24321 switching to stdClass in /mod/
authorPetr Skoda <skodak@moodle.org>
Tue, 21 Sep 2010 08:37:36 +0000 (08:37 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 21 Sep 2010 08:37:36 +0000 (08:37 +0000)
111 files changed:
mod/assignment/lib.php
mod/assignment/type/offline/assignment.class.php
mod/assignment/type/online/assignment.class.php
mod/assignment/type/upload/assignment.class.php
mod/assignment/type/upload/upload.php
mod/assignment/type/uploadsingle/assignment.class.php
mod/assignment/type/uploadsingle/upload.php
mod/chat/chat_ajax.php
mod/chat/gui_basic/index.php
mod/chat/gui_header_js/insert.php
mod/chat/lib.php
mod/choice/lib.php
mod/data/db/upgrade.php
mod/data/export_form.php
mod/data/field.php
mod/data/field/checkbox/field.class.php
mod/data/field/date/field.class.php
mod/data/field/file/field.class.php
mod/data/field/latlong/field.class.php
mod/data/field/latlong/kml.php
mod/data/field/multimenu/field.class.php
mod/data/field/number/field.class.php
mod/data/field/picture/field.class.php
mod/data/field/textarea/field.class.php
mod/data/field/url/field.class.php
mod/data/import.php
mod/data/index.php
mod/data/lib.php
mod/data/templates.php
mod/data/view.php
mod/feedback/analysis_to_excel.php
mod/feedback/choose_group_form.php
mod/feedback/complete.php
mod/feedback/edit_form.php
mod/feedback/import.php
mod/feedback/item/captcha/print_captcha.php
mod/feedback/item/info/lib.php
mod/feedback/item/label/lib.php
mod/feedback/item/multichoice/lib.php
mod/feedback/item/multichoicerated/lib.php
mod/feedback/lib.php
mod/feedback/show_nonrespondents.php
mod/folder/db/upgradelib.php
mod/folder/edit.php
mod/folder/lib.php
mod/forum/discuss.php
mod/forum/lib.php
mod/forum/locallib.php
mod/forum/markposts.php
mod/forum/post.php
mod/forum/rsslib.php
mod/forum/search.php
mod/forum/settracking.php
mod/forum/user.php
mod/glossary/approve.php
mod/glossary/deleteentry.php
mod/glossary/edit.php
mod/glossary/editcategories.php
mod/glossary/exportentry.php
mod/glossary/formats/TEMPLATE/TEMPLATE_format.php
mod/glossary/formats/encyclopedia/encyclopedia_format.php
mod/glossary/formats/fullwithauthor/fullwithauthor_format.php
mod/glossary/import.php
mod/glossary/lib.php
mod/glossary/locallib.php
mod/glossary/rsslib.php
mod/imscp/db/upgradelib.php
mod/imscp/lib.php
mod/label/lib.php
mod/lesson/continue.php
mod/lesson/essay.php
mod/lesson/format.php
mod/lesson/importpptlib.php
mod/lesson/lib.php
mod/lesson/pagetypes/matching.php
mod/lesson/pagetypes/multichoice.php
mod/lesson/pagetypes/truefalse.php
mod/lesson/view.php
mod/page/db/upgradelib.php
mod/page/lib.php
mod/quiz/attemptlib.php
mod/quiz/db/install.php
mod/quiz/db/upgrade.php
mod/quiz/lib.php
mod/quiz/locallib.php
mod/quiz/overrideedit.php
mod/quiz/processattempt.php
mod/quiz/report/grading/report.php
mod/quiz/report/overview/overview_table.php
mod/quiz/report/overview/overviewsettings_form.php
mod/quiz/report/overview/report.php
mod/quiz/report/responses/responses_table.php
mod/quiz/report/responses/responsessettings_form.php
mod/quiz/report/simpletest/testreportlib.php
mod/quiz/report/statistics/db/install.php
mod/quiz/report/statistics/qstats.php
mod/quiz/report/statistics/report.php
mod/quiz/report/statistics/simpletest/test_qstats.php
mod/quiz/restorelibpre15.php
mod/quiz/startattempt.php
mod/resource/db/upgradelib.php
mod/resource/lib.php
mod/scorm/aicc.php
mod/scorm/datamodels/aicclib.php
mod/scorm/lib.php
mod/scorm/locallib.php
mod/survey/lib.php
mod/survey/save.php
mod/url/db/upgradelib.php
mod/url/lib.php
mod/wiki/db/migration/wiki/ewiki/ewiki.php

index bba8fce..cdfd76b 100644 (file)
@@ -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&amp;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&amp;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 = '--';
index 1bff008..04097dc 100644 (file)
@@ -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
index 5c83c28..a4a3e81 100644 (file)
@@ -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;
index 17d84fe..2b3c0a1 100644 (file)
@@ -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);
index 877b2de..93b0f77 100644 (file)
@@ -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);
index 3183f70..3384558 100644 (file)
@@ -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;
 
index 83aa186..fbac468 100644 (file)
@@ -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);
index 1d31fc1..8542b3d 100644 (file)
@@ -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;
index 61bc84c..19eb29b 100644 (file)
@@ -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 '<div id="messages">';
 echo '<h2>'.get_string('messages', 'chat').'</h2>';
 
 $allmessages = array();
-$options = new object();
+$options = new stdClass();
 $options->para = false;
 $options->newlines = true;
 
index 13c6c08..6b842d2 100644 (file)
@@ -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;
index 25ffe73..6d5857f 100644 (file)
@@ -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);
 
index 02b89fe..ac78606 100644 (file)
@@ -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])) {
index 9f216a5..6c47c6d 100644 (file)
@@ -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.")<br/>";
index 877dbfb..61bf349 100644 (file)
@@ -49,7 +49,7 @@ class mod_data_export_form extends moodleform {
                 $mform->addElement('advcheckbox', 'field_'.$field->field->id, '<div title="' . s($field->field->description) . '">' . $field->field->name . '</div>', ' (' . $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));
             }
index b04770b..01ec6df 100755 (executable)
@@ -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;
index 35a6e8f..edaf71f 100755 (executable)
@@ -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);
index 693ba4b..8934ed7 100755 (executable)
@@ -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);
index 26e2fe1..3aa2bcb 100755 (executable)
@@ -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);
index 2b0b6bd..444fcb7 100755 (executable)
@@ -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);
index 7db3e11..4a5cf40 100644 (file)
@@ -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 = "&lt;a href='$CFG->wwwroot/mod/data/view.php?d=$d&amp;rid=$rid'&gt;Item #$rid&lt;/a&gt; in Moodle data activity";
     $pm->long = $content->content1;
index 8e89804..b72e656 100755 (executable)
@@ -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);
index bb80ec3..ee905ca 100755 (executable)
@@ -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);
index fb8c3a8..3faf33d 100755 (executable)
@@ -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);
index 3a28d57..5a39cbc 100755 (executable)
@@ -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;
 
index 663f6aa..d720c57 100755 (executable)
@@ -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);
index 36b4bf8..60d5c72 100755 (executable)
@@ -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') {
index a3d7c53..2109246 100755 (executable)
@@ -84,7 +84,7 @@ if ($rss) {
     array_push($table->align, 'center');
 }
 
-$options = new object();
+$options = new stdClass();
 $options->noclean = true;
 
 $currentsection = "";
index 9ac1ded..b556f01 100755 (executable)
@@ -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 = '<span class="nolink">'.$content->content.'</span>';
                     //$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 '<tr><td>';
@@ -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;
index beb8ecf..7326301 100755 (executable)
@@ -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;
 
index 4deaf4e..f68f41c 100755 (executable)
                     }
                 }
                 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;
             $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';
             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';
     }*/
 
     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&amp;mode=$mode&amp;search=&amp;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&amp;mode=$mode&amp;search=&amp;advanced=0";
index 0ea2013..2a5e950 100644 (file)
@@ -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));
index e5e8b3e..07e0f1a 100644 (file)
@@ -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
     }
index 6d5b99a..1593109 100644 (file)
                     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;
                 $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
                         }
                         $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)) {
                             continue;
                         }
                     }
-                    
+
                     if($feedbackitem->dependitem > 0) {
                         $dependstyle = ' feedback_complete_depend';
                     }else {
                         $dependstyle = '';
                     }
-                    
+
                     echo $OUTPUT->box_start('feedback_item_box_'.$align.$dependstyle);
                         $value = '';
                         //get the value
                 echo '</fieldset>';
                 echo '</form>';
                 echo $OUTPUT->box_end();
-                
+
                 echo $OUTPUT->box_start('feedback_complete_cancel');
                 if($courseid) {
                     echo '<form action="'.$CFG->wwwroot.'/course/view.php?id='.$courseid.'" method="post" onsubmit=" ">';
index f4d9951..0ce6ab7 100644 (file)
@@ -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'));
index a87e423..f065bda 100644 (file)
@@ -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');
     }
     /// 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');
 
         }
         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();
         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();
 
             }
             $itemobj = new $itemclass();
 
-            $newitem = new object();
+            $newitem = new stdClass();
             $newitem->feedback = $feedbackid;
             $newitem->template = 0;
             $newitem->typ = $typ;
                     $newitem->presentation = 'd>>>>>'.$newitem->presentation;
                     break;
             }
-            
+
             if(isset($item['#']['DEPENDITEM'][0]['#'])) {
                 $newitem->dependitem = intval($item['#']['DEPENDITEM'][0]['#']);
             }else {
                 $newitem->dependvalue = '';
             }
             $olditemid = intval($item['#']['ITEMID'][0]['#']);
-            
+
             if($typ != 'pagebreak') {
                 $newitem->hasvalue = $itemobj->get_hasvalue();
             }else {
             $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;
             $newitem = $DB->get_record('feedback_item', array('id'=>$key));
             $newitem->dependitem = $itembackup[$newitem->dependitem];
             $DB->update_record('feedback_item', $newitem);
-        }    
-        
+        }
+
         return $error;
     }
 
index 6441ff7..7ac8bc4 100644 (file)
@@ -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]);
index d2cd251..cbeaf48 100644 (file)
@@ -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) {
index b820fc3..fb88cf2 100644 (file)
@@ -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;
index 1811531..a663c97 100644 (file)
@@ -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) ? '<span class="feedback_required_mark">*</span>' : '';
-        
+
         //print the question and label
         echo '<div class="feedback_item_label_'.$align.'">';
         echo '('.$item->label.') ';
@@ -277,7 +277,7 @@ class feedback_item_multichoice extends feedback_item_base {
             }
         }
         echo '</div>';
-        
+
         //print the presentation
         echo '<div class="feedback_item_presentation_'.$align.'">';
         $index = 1;
@@ -288,7 +288,7 @@ class feedback_item_multichoice extends feedback_item_base {
         }else {
             $hv = 'v';
         }
-        
+
         if($info->subtype == 'r' AND !$this->hidenoselect($item)) {
         //print the "not_selected" item on radiobuttons
         ?>
@@ -317,8 +317,8 @@ class feedback_item_multichoice extends feedback_item_base {
         echo '</ul>';
         echo '</div>';
     }
-    
-    /**     
+
+    /**
      * 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 '<div class="feedback_item_presentation_'.$align.$highlight.'">';
-        
+
         echo '<ul>';
         if($info->horizontal) {
             $hv = 'h';
@@ -401,7 +401,7 @@ class feedback_item_multichoice extends feedback_item_base {
         echo '</div>';
     }
 
-    /**     
+    /**
      * 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)?'<span class="feedback_required_mark">*</span>':'';
         }
-        
+
         //print the question and label
         echo '<div class="feedback_item_label_'.$align.'">';
         echo '('.$item->label.') ';
         echo format_text($item->name . $requiredmark, true, false, false);
         echo '</div>';
-        
+
         //print the presentation
         echo '<div class="feedback_item_presentation_'.$align.'">';
         $index = 1;
@@ -490,7 +490,7 @@ class feedback_item_multichoice extends feedback_item_base {
         $vallist = $data;
         return trim($this->item_arrayToString($vallist));
     }
-    
+
     //compares the dbvalue with the dependvalue
     //dbvalue is the number of one selection
     //dependvalue is the presentation of one selection
@@ -501,7 +501,7 @@ class feedback_item_multichoice extends feedback_item_base {
         }else {
             $dbvalues = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $dbvalue);
         }
-        
+
         $info = $this->get_info($item);
         $presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);
         $index = 1;
@@ -515,7 +515,7 @@ class feedback_item_multichoice extends feedback_item_base {
         }
         return false;
     }
-    
+
     function get_presentation($data) {
         $present = str_replace("\n", FEEDBACK_MULTICHOICE_LINE_SEP, trim($data->itemvalues));
         if(!isset($data->subtype)) {
@@ -536,7 +536,7 @@ class feedback_item_multichoice extends feedback_item_base {
     function get_info($item) {
         $presentation = empty($item->presentation) ? '' : $item->presentation;
 
-        $info = new object();
+        $info = new stdClass();
         //check the subtype of the multichoice
         //it can be check(c), radio(r) or dropdown(d)
         $info->subtype = '';
@@ -576,7 +576,7 @@ class feedback_item_multichoice extends feedback_item_base {
     function print_item_radio($presentation, $item, $value, $info, $align) {
         $index = 1;
         $checked = '';
-        
+
         if($info->horizontal) {
             $hv = 'h';
         }else {
@@ -612,7 +612,7 @@ class feedback_item_multichoice extends feedback_item_base {
         }else {
             $values = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $value);
         }
-        
+
         if($info->horizontal) {
             $hv = 'h';
         }else {
@@ -652,7 +652,7 @@ class feedback_item_multichoice extends feedback_item_base {
         }else {
             $hv = 'v';
         }
-        
+
         ?>
         <li class="feedback_item_select_<?php echo $hv.'_'.$align;?>">
             <select name="<?php echo $item->typ .'_' . $item->id;?>" size="1">
@@ -676,36 +676,36 @@ class feedback_item_multichoice extends feedback_item_base {
         </li>
         <?php
     }
-    
+
     function set_ignoreempty($item, $ignoreempty=true) {
         $item->options = str_replace(FEEDBACK_MULTICHOICE_IGNOREEMPTY, '', $item->options);
         if($ignoreempty) {
             $item->options .= FEEDBACK_MULTICHOICE_IGNOREEMPTY;
         }
     }
-    
+
     function ignoreempty($item) {
         if(strstr($item->options, FEEDBACK_MULTICHOICE_IGNOREEMPTY)) {
             return true;
         }
         return false;
     }
-    
+
     function set_hidenoselect($item, $hidenoselect=true) {
         $item->options = str_replace(FEEDBACK_MULTICHOICE_HIDENOSELECT, '', $item->options);
         if($hidenoselect) {
             $item->options .= FEEDBACK_MULTICHOICE_HIDENOSELECT;
         }
     }
-    
+
     function hidenoselect($item) {
         if(strstr($item->options, FEEDBACK_MULTICHOICE_HIDENOSELECT)) {
             return true;
         }
         return false;
     }
-    
-    
+
+
     function can_switch_require() {
         return true;
     }
index bc79071..af4cf02 100644 (file)
@@ -18,7 +18,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
     var $commonparams;
     var $item_form;
     var $item;
-    
+
     function init() {
 
     }
@@ -40,10 +40,10 @@ class feedback_item_multichoicerated 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);
 
@@ -63,7 +63,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
     function show_editform() {
         $this->item_form->display();
     }
-    
+
     function is_cancelled() {
         return $this->item_form->is_cancelled();
     }
@@ -77,26 +77,26 @@ class feedback_item_multichoicerated 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();
         if(!$item->id) {
             $item->id = $DB->insert_record('feedback_item', $item);
         }else {
             $DB->update_record('feedback_item', $item);
         }
-        
+
         return $DB->get_record('feedback_item', array('id'=>$item->id));
     }
 
@@ -237,8 +237,8 @@ class feedback_item_multichoicerated extends feedback_item_base {
         $rowOffset +=2 ;
         return $rowOffset;
     }
-    
-    /**     
+
+    /**
      * print the item at the edit-page of feedback
      *
      * @global object
@@ -247,7 +247,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
      */
     function print_item_preview($item) {
         global $OUTPUT, $DB;
-        
+
         $align = right_to_left() ? 'right' : 'left';
         $info = $this->get_info($item);
 
@@ -263,7 +263,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
             }
         }
         echo '</div>';
-        
+
         //print the presentation
         echo '<div class="feedback_item_presentation_'.$align.'">';
         switch($info->subtype) {
@@ -276,8 +276,8 @@ class feedback_item_multichoicerated extends feedback_item_base {
         }
         echo '</div>';
     }
-    
-    /**     
+
+    /**
      * print the item at the complete-page of feedback
      *
      * @global object
@@ -298,12 +298,12 @@ class feedback_item_multichoicerated extends feedback_item_base {
         }else {
             $highlight = '';
         }
-        
+
         //print the question and label
         echo '<div class="feedback_item_label_'.$align.$highlight.'">';
             echo format_text($item->name.$requiredmark, true, false, false);
         echo '</div>';
-        
+
         //print the presentation
         echo '<div class="feedback_item_presentation_'.$align.$highlight.'">';
         switch($info->subtype) {
@@ -317,7 +317,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
         echo '</div>';
     }
 
-    /**     
+    /**
      * print the item at the complete-page of feedback
      *
      * @global object
@@ -332,13 +332,13 @@ class feedback_item_multichoicerated extends feedback_item_base {
 
         $lines = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, $info->presentation);
         $requiredmark =  ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
-        
+
         //print the question and label
         echo '<div class="feedback_item_label_'.$align.'">';
             echo '('.$item->label.') ';
             echo format_text($item->name . $requiredmark, true, false, false);
         echo '</div>';
-        
+
         //print the presentation
         echo '<div class="feedback_item_presentation_'.$align.'">';
         $index = 1;
@@ -376,7 +376,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
         }else {
             $dbvalues = explode(FEEDBACK_MULTICHOICERATED_LINE_SEP, $dbvalue);
         }
-        
+
         $info = $this->get_info($item);
         $presentation = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, $info->presentation);
         $index = 1;
@@ -414,13 +414,13 @@ class feedback_item_multichoicerated extends feedback_item_base {
     function get_info($item) {
         $presentation = empty($item->presentation) ? '' : $item->presentation;
 
-        $info = new object();
+        $info = new stdClass();
         //check the subtype of the multichoice
         //it can be check(c), radio(r) or dropdown(d)
         $info->subtype = '';
         $info->presentation = '';
         $info->horizontal = false;
-        
+
         @list($info->subtype, $info->presentation) = explode(FEEDBACK_MULTICHOICERATED_TYPE_SEP, $item->presentation);
 
         if(!isset($info->subtype)) {
@@ -445,7 +445,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
     function print_item_radio($item, $value, $info, $align, $showrating, $lines) {
         $index = 1;
         $checked = '';
-        
+
         if($info->horizontal) {
             $hv = 'h';
         }else {
@@ -473,7 +473,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
             $radio_value = explode(FEEDBACK_MULTICHOICERATED_VALUE_SEP, $line);
             $inputname = $item->typ . '_' . $item->id;
             $inputid = $inputname.'_'.$index;
-        ?>            
+        ?>
             <li class="feedback_item_radio_<?php echo $hv.'_'.$align;?>">
                 <span class="feedback_item_radio_<?php echo $hv.'_'.$align;?>">
                     <input type="radio" name="<?php echo $inputname;?>" id="<?php echo $inputid;?>" value="<?php echo $index;?>" <?php echo $checked;?> />
@@ -565,28 +565,28 @@ class feedback_item_multichoicerated extends feedback_item_base {
             $item->options .= FEEDBACK_MULTICHOICERATED_IGNOREEMPTY;
         }
     }
-    
+
     function ignoreempty($item) {
         if(strstr($item->options, FEEDBACK_MULTICHOICERATED_IGNOREEMPTY)) {
             return true;
         }
         return false;
     }
-    
+
     function set_hidenoselect($item, $hidenoselect=true) {
         $item->options = str_replace(FEEDBACK_MULTICHOICERATED_HIDENOSELECT, '', $item->options);
         if($hidenoselect) {
             $item->options .= FEEDBACK_MULTICHOICERATED_HIDENOSELECT;
         }
     }
-    
+
     function hidenoselect($item) {
         if(strstr($item->options, FEEDBACK_MULTICHOICERATED_HIDENOSELECT)) {
             return true;
         }
         return false;
     }
-    
+
     function can_switch_require() {
         return true;
     }
index 2029092..6fcf870 100644 (file)
@@ -355,7 +355,7 @@ function feedback_get_recent_mod_activity(&$activities, &$index, $timemodified,
             }
        }
 
-        $tmpactivity = new object();
+        $tmpactivity = new stdClass();
 
         $tmpactivity->type      = 'feedback';
         $tmpactivity->cmid      = $cm->id;
@@ -903,7 +903,7 @@ function feedback_get_receivemail_users($cmid, $groups = false) {
 function feedback_create_template($courseid, $name, $ispublic = 0) {
     global $DB;
 
-    $templ = new object();
+    $templ = new stdClass();
     $templ->course   = $courseid;
     $templ->name     = $name;
     $templ->ispublic = $ispublic;
@@ -959,7 +959,7 @@ function feedback_save_as_template($feedback, $name, $ispublic = 0) {
         //copy all included files to the feedback_template filearea
         if ($itemfiles = $fs->get_area_files($f_context->id, 'mod_feedback', 'item', $item->id, "id", false)) {
             foreach($itemfiles as $ifile) {
-                $file_record = new object();
+                $file_record = new stdClass();
                 $file_record->contextid = $c_context->id;
                 $file_record->component = 'mod_feedback';
                 $file_record->filearea = 'template';
@@ -1077,7 +1077,7 @@ function feedback_items_from_template($feedback, $templateid, $deleteold = false
         //TODO: moving the files to the new items
         if ($templatefiles = $fs->get_area_files($c_context->id, 'mod_feedback', 'template', $t_item->id, "id", false)) {
             foreach($templatefiles as $tfile) {
-                $file_record = new object();
+                $file_record = new stdClass();
                 $file_record->contextid = $f_context->id;
                 $file_record->component = 'mod_feedback';
                 $file_record->filearea = 'item';
@@ -1228,7 +1228,7 @@ function feedback_get_depend_candidates_for_item($feedback, $item) {
 function feedback_create_item($data) {
     global $DB;
 
-    $item = new object;
+    $item = new stdClass();
     $item->feedback = $data->feedbackid;
 
     $item->template=0;
@@ -1547,7 +1547,7 @@ function feedback_set_tmp_values($feedbackcompleted) {
     global $DB;
 
     //first we create a completedtmp
-    $tmpcpl = new object();
+    $tmpcpl = new stdClass();
     foreach($feedbackcompleted as $key => $value) {
         $tmpcpl->{$key} = $value;
     }
@@ -1657,7 +1657,7 @@ function feedback_create_pagebreak($feedbackid) {
         return false;
     }
 
-    $item = new object();
+    $item = new stdClass();
     $item->feedback = $feedbackid;
 
     $item->template=0;
@@ -1930,7 +1930,7 @@ function feedback_create_values($usrid, $timemodified, $tmp = false, $guestid =
 
     $tmpstr = $tmp ? 'tmp' : '';
     //first we create a new completed record
-    $completed = new object();
+    $completed = new stdClass();
     $completed->feedback           = $feedbackid;
     $completed->userid             = $usrid;
     $completed->guestid            = $guestid;
@@ -1954,7 +1954,7 @@ function feedback_create_values($usrid, $timemodified, $tmp = false, $guestid =
         if(is_null($itemvalue)) {
             continue;
         }
-        $value = new object();
+        $value = new stdClass();
         $value->item = $item->id;
         $value->completed = $completed->id;
         $value->course_id = $courseid;
@@ -2000,7 +2000,7 @@ function feedback_update_values($completed, $tmp = false) {
             continue;
         }
 
-        $newvalue = new object();
+        $newvalue = new stdClass();
         $newvalue->item = $item->id;
         $newvalue->completed = $completed->id;
         $newvalue->course_id = $courseid;
@@ -2488,7 +2488,7 @@ function feedback_send_email($cm, $feedback, $course, $userid) {
         $printusername = $feedback->anonymous == FEEDBACK_ANONYMOUS_NO ? fullname($user) : get_string('anonymous_user', 'feedback');
 
         foreach ($teachers as $teacher) {
-            $info = new object();
+            $info = new stdClass();
             $info->username = $printusername;
             $info->feedback = format_string($feedback->name,true);
             $info->url = $CFG->wwwroot.'/mod/feedback/show_entries.php?id='.$cm->id.'&userid='.$userid.'&do_show=showentries';
@@ -2498,7 +2498,7 @@ function feedback_send_email($cm, $feedback, $course, $userid) {
             $posthtml = ($teacher->mailformat == 1) ? feedback_send_email_html($info, $course, $cm) : '';
 
             if($feedback->anonymous == FEEDBACK_ANONYMOUS_NO) {
-                $eventdata = new object();
+                $eventdata = new stdClass();
                 $eventdata->name             = 'feedback';
                 $eventdata->component        = 'mod';
                 $eventdata->userfrom         = $user;
@@ -2510,7 +2510,7 @@ function feedback_send_email($cm, $feedback, $course, $userid) {
                 $eventdata->smallmessage     = '';
                 message_send($eventdata);
             }else {
-                $eventdata = new object();
+                $eventdata = new stdClass();
                 $eventdata->name             = 'feedback';
                 $eventdata->component        = 'mod';
                 $eventdata->userfrom         = $teacher;
@@ -2553,7 +2553,7 @@ function feedback_send_email_anonym($cm, $feedback, $course) {
         $printusername = get_string('anonymous_user', 'feedback');
 
         foreach ($teachers as $teacher) {
-            $info = new object();
+            $info = new stdClass();
             $info->username = $printusername;
             $info->feedback = format_string($feedback->name,true);
             $info->url = $CFG->wwwroot.'/mod/feedback/show_entries_anonym.php?id='.$cm->id;
@@ -2562,7 +2562,7 @@ function feedback_send_email_anonym($cm, $feedback, $course) {
             $posttext = feedback_send_email_text($info, $course);
             $posthtml = ($teacher->mailformat == 1) ? feedback_send_email_html($info, $course, $cm) : '';
 
-            $eventdata = new object();
+            $eventdata = new stdClass();
             $eventdata->name             = 'feedback';
             $eventdata->component        = 'mod';
             $eventdata->userfrom         = $teacher;
@@ -2693,7 +2693,7 @@ function feedback_init_feedback_session() {
     global $SESSION;
     if (!empty($SESSION)) {
         if (!isset($SESSION->feedback) OR !is_object($SESSION->feedback)) {
-            $SESSION->feedback = new object();
+            $SESSION->feedback = new stdClass();
         }
     }
 }
\ No newline at end of file
index aec85cc..4bbc51b 100644 (file)
@@ -74,7 +74,7 @@
         if(is_array($messageuser)) {
             foreach ($messageuser as $userid) {
                 $senduser = $DB->get_record('user', array('id'=>$userid));
-                $eventdata = new object();
+                $eventdata = new stdClass();
                 $eventdata->name             = 'feedback';
                 $eventdata->component        = 'mod';
                 $eventdata->userfrom         = $USER;
index 7f53242..016f079 100644 (file)
@@ -68,7 +68,7 @@ function folder_20_migrate() {
             $introformat = FORMAT_MOODLE;
         }
 
-        $folder = new object();
+        $folder = new stdClass();
         $folder->course       = $candidate->course;
         $folder->name         = $candidate->name;
         $folder->intro        = $intro;
index fc93199..80415b9 100644 (file)
@@ -46,7 +46,7 @@ $PAGE->set_title($course->shortname.': '.$folder->name);
 $PAGE->set_heading($course->fullname);
 $PAGE->set_activity_record($folder);
 
-$data = new object();
+$data = new stdClass();
 $data->id = $cm->id;
 $options = array('subdirs'=>1, 'maxbytes'=>$CFG->maxbytes, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
 file_prepare_standard_filemanager($data, 'files', $options, $context, 'mod_folder', 'content', 0);
index 0e7c364..71b9442 100644 (file)
@@ -168,7 +168,7 @@ function folder_user_outline($course, $user, $mod, $folder) {
         $numviews = count($logs);
         $lastlog = array_pop($logs);
 
-        $result = new object();
+        $result = new stdClass();
         $result->info = get_string('numviews', '', $numviews);
         $result->time = $lastlog->time;
 
index 2160ab0..181b5a7 100644 (file)
     }
 
     $searchform = forum_search_form($course);
-    
+
     if ($parent != $discussion->firstpost) {
         $PAGE->navbar->add(format_string($post->subject));
     }
         require_once($CFG->libdir.'/portfoliolib.php');
         $button = new portfolio_add_button();
         $button->set_callback_options('forum_portfolio_caller', array('discussionid' => $discussion->id), '/mod/forum/locallib.php');
-        $button->render();        
-        echo '</div>';        
+        $button->render();
+        echo '</div>';
     }
 
     if ($forum->type != 'single'
     echo "</div>";
 
     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));
index 025f4b4..0f760e1 100644 (file)
@@ -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.'&amp;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 .= '<div class="subject">'.format_string($post->subject).'</div>';
 
     $fullname = fullname($userfrom, $viewfullnames);
-    $by = new object();
+    $by = new stdClass();
     $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$userfrom->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
     $by->date = userdate($post->modified, '', $userto->timezone);
     $output .= '<div class="author">'.get_string('bynameondate', 'forum', $by).'</div>';
@@ -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 '<table cellspacing="0" class="forumpost'.$read_style.'">';
 
     // 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 '<div class="author">';
     $fullname = fullname($postuser, $cm->cache->caps['moodle/site:viewfullnames']);
-    $by = new object();
+    $by = new stdClass();
     $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.
                 $post->userid.'&amp;course='.$course->id.'">'.$fullname.'</a>';
     $by->date = userdate($post->modified);
@@ -3271,7 +3271,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
         echo '</div>';
     }
 
-    $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 "</td>\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 '<td class="lastpost">';
     $usedate = (empty($post->timemodified)) ? $post->modified : $post->timemodified;  // Just in case
     $parenturl = (empty($post->lastpostid)) ? '' : '&amp;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 "</div>\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;
index e7082b8..8b324fc 100644 (file)
@@ -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 .= '<div class="subject">'.format_string($post->subject).'</div>';
 
         $fullname = fullname($users[$post->userid], $viewfullnames);
-        $by = new object();
+        $by = new stdClass();
         $by->name = $fullname;
         $by->date = userdate($post->modified, '', $this->user->timezone);
         $output .= '<div class="author">'.get_string('bynameondate', 'forum', $by).'</div>';
index 3ecd611..a47f049 100644 (file)
@@ -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);
 
index 1ec81d4..9094d6a 100644 (file)
@@ -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;
 }
index b266c95..9f9057b 100644 (file)
@@ -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;
index 34c8a0f..ae02c98 100644 (file)
@@ -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),
index b8b908b..9a39722 100644 (file)
@@ -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) ) {
index 0204128..8def729 100644 (file)
@@ -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;
index 0a389ad..579ea45 100644 (file)
@@ -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
index 6ea8980..dbaccf4 100644 (file)
@@ -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);
             }
index d332e7d..c59d6c7 100644 (file)
@@ -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);
index c83192d..e8c265b 100644 (file)
@@ -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;
index 49f6e6a..e4bff6a 100644 (file)
@@ -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);
         }
index d7b3550..45d0899 100755 (executable)
@@ -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 = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
         $by->date = userdate($entry->timemodified);
         echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>' . '<br />';
index 5b301f7..60b5ba4 100644 (file)
@@ -21,7 +21,7 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode
         echo '</div>';
 
         $fullname = fullname($user);
-        $by = new object();
+        $by = new stdClass();
         $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
         $by->date = userdate($entry->timemodified);
         echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
index bae5a31..0d34805 100644 (file)
@@ -22,7 +22,7 @@ function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mo
         echo '</div>';
 
         $fullname = fullname($user);
-        $by = new object();
+        $by = new stdClass();
         $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
         $by->date = userdate($entry->timemodified);
         echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
index 52d8cee..00d607d 100644 (file)
@@ -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);
index 058300d..1719387 100644 (file)
@@ -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('<span class="nolink">' . $entry->concept . '</span>', 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;
 
index f464642..bdd76c3 100644 (file)
@@ -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;
index 4d6a9f3..7cff81b 100644 (file)
             }
 
             $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);
                 }
 
index 54bdf68..e905f39 100644 (file)
@@ -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;
index c958538..f777ae1 100644 (file)
@@ -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;
 
index 4605114..a80a08d 100644 (file)
@@ -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;
index 49e7b67..b9e3634 100644 (file)
@@ -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));
index f9b5764..6015d55 100644 (file)
@@ -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];
index 5aa5b15..5a2ea0c 100644 (file)
@@ -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:
 
index aaaf042..8550e61 100644 (file)
@@ -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;
index 9e84d55..3bfaa41 100644 (file)
@@ -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);
index 7bad478..9903a6d 100644 (file)
@@ -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;
 
index 6beb9c4..c411247 100644 (file)
@@ -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;
 
index 11e81cc..5bdbe22 100644 (file)
@@ -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;
 
index 76bd043..992c345 100644 (file)
@@ -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;
index b40b590..d2849d0 100644 (file)
@@ -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;
index f3bd4d4..cc1f707 100644 (file)
@@ -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) {
index 8de1af8..b2e87e0 100644 (file)
@@ -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();
 
index 85c9ca4..cb9036e 100644 (file)
@@ -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);
index b528afa..21290eb 100644 (file)
@@ -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);
index 50d66b7..ec964e5 100644 (file)
@@ -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);
index 20beeba..234dc27 100644 (file)
@@ -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;
index 3e8f1ee..d340435 100644 (file)
@@ -86,7 +86,7 @@ if ($overrideid) {
 }
 else {
     // new override
-    $data = new object();
+    $data = new stdClass();
 }
 
 // merge quiz defaults with data
index 9dbb1d1..d2f6f8b 100644 (file)
@@ -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();
index 6070d87..f956b20 100644 (file)
@@ -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;
 
index fed94b3..a2e5ae2 100644 (file)
@@ -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;
index b7be5bc..b163081 100644 (file)
@@ -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)){
index 9a17fa6..92c758b 100644 (file)
@@ -198,7 +198,7 @@ class quiz_overview_report extends quiz_default_report {
                 echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
             }
         }
-        
+
         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));
index 8bb48e2..5bb8d74 100644 (file)
@@ -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;
index d0039be..15fa398 100644 (file)
@@ -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)){
index be39c3b..ed8629b 100644 (file)
@@ -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 = '';
index 0c9b3bf..24ddba8 100644 (file)
@@ -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;
index c2ae722..cb2e05e 100644 (file)
@@ -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;
index a0fffcb..cb95ebb 100644 (file)
@@ -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;
index d629c55..f234aec 100644 (file)
@@ -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){
index 9b3a928..78061fa 100644 (file)
 
         //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
             $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;
         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);
index 68d9c5b..c6f54c7 100644 (file)
@@ -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();
index 877d899..56f3361 100644 (file)
@@ -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;
index 214cccd..024ddfb 100644 (file)
@@ -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) {
index 921900e..86b3de4 100755 (executable)
                                 $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;
index 5650ca0..e5d633e 100644 (file)
@@ -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';
index 56d7493..f8f4985 100755 (executable)
@@ -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);
index f60d793..0f589f6 100755 (executable)
@@ -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) {
index bc52cf2..4abf9aa 100644 (file)
@@ -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;
index 6878bf6..1ed6e79 100644 (file)
@@ -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;
index b70486c..c47b733 100644 (file)
@@ -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;
index 471336d..f79913b 100644 (file)
@@ -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
index 561a212..b1b9688 100644 (file)
@@ -1590,7 +1590,7 @@ function ewiki_page_edit_form(&$id, &$data, &$hidden_postdata) {
      $usehtmleditor = can_use_html_editor();
      echo '<table><tr><td>';
      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);