Skip to content

Commit

Permalink
MDL-24321 switching to stdClass in /mod/
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 21, 2010
1 parent 7a424cc commit 39790bd
Show file tree
Hide file tree
Showing 111 changed files with 366 additions and 366 deletions.
32 changes: 16 additions & 16 deletions mod/assignment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ function add_instance($assignment) {
$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;
Expand Down Expand Up @@ -542,7 +542,7 @@ function update_instance($assignment) {
$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))) {

Expand All @@ -553,7 +553,7 @@ function update_instance($assignment) {
$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;
Expand Down Expand Up @@ -1653,7 +1653,7 @@ function get_submission($userid=0, $createnew=false, $teachermodified=false) {
* @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();
Expand Down Expand Up @@ -1724,7 +1724,7 @@ function email_teachers($submission) {
$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;
Expand All @@ -1733,7 +1733,7 @@ function email_teachers($submission) {
$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;
Expand Down Expand Up @@ -1945,7 +1945,7 @@ function description_is_hidden() {
*/
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;
Expand Down Expand Up @@ -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";
Expand All @@ -2594,7 +2594,7 @@ function assignment_cron () {
$posthtml = "";
}

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'assignment';
$eventdata->userfrom = $teacher;
$eventdata->userto = $user;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -3494,15 +3494,15 @@ 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');
$types[] = $type;

$standardassignments = array('upload','online','uploadsingle','offline');
foreach ($standardassignments as $assignmenttype) {
$type = new object();
$type = new stdClass();
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "assignment&type=$assignmenttype";
$type->typestr = get_string("type$assignmenttype", 'assignment');
Expand All @@ -3516,15 +3516,15 @@ function assignment_get_types() {
continue;
}
if (!in_array($assignmenttype, $standardassignments)) {
$type = new object();
$type = new stdClass();
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "assignment&type=$assignmenttype";
$type->typestr = get_string("type$assignmenttype", 'assignment_'.$assignmenttype);
$types[] = $type;
}
}

$type = new object();
$type = new stdClass();
$type->modclass = MOD_CLASS_ACTIVITY;
$type->type = "assignment_group_end";
$type->typestr = '--';
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/type/offline/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function print_student_answer($studentid){
}

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
Expand Down
4 changes: 2 additions & 2 deletions mod/assignment/type/online/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function view() {
// 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) {
Expand Down Expand Up @@ -174,7 +174,7 @@ function update_submission($data) {

$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;
Expand Down
16 changes: 8 additions & 8 deletions mod/assignment/type/upload/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function upload_notes() {

$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)) {
Expand All @@ -473,7 +473,7 @@ function upload_notes() {

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;
Expand Down Expand Up @@ -541,7 +541,7 @@ function upload_file($mform, $options) {
$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);
Expand All @@ -555,7 +555,7 @@ function upload_file($mform, $options) {
// 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;
Expand Down Expand Up @@ -658,7 +658,7 @@ function finalize($forcemode=null) {
die;
}
}
$updated = new object();
$updated = new stdClass();
$updated->id = $submission->id;
$updated->data2 = ASSIGNMENT_STATUS_SUBMITTED;
$updated->timemodified = time();
Expand All @@ -671,7 +671,7 @@ function finalize($forcemode=null) {
$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;
Expand Down Expand Up @@ -699,7 +699,7 @@ function finalizeclose() {
redirect($returnurl); // probably closed already
}

$updated = new object();
$updated = new stdClass();
$updated->id = $submission->id;
$updated->data2 = ASSIGNMENT_STATUS_CLOSED;

Expand Down Expand Up @@ -727,7 +727,7 @@ function unfinalize($forcemode=null) {
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);
Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/type/upload/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$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);
Expand Down
8 changes: 4 additions & 4 deletions mod/assignment/type/uploadsingle/assignment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function print_responsefiles($userid, $return=false) {
}
echo $output;
}

function can_manage_responsefiles() {
if (has_capability('mod/assignment:grade', $this->context)) {
return true;
Expand Down Expand Up @@ -196,7 +196,7 @@ function upload_file($mform) {
$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;
Expand All @@ -206,7 +206,7 @@ function upload_file($mform) {
$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;
Expand Down Expand Up @@ -294,7 +294,7 @@ function send_file($filearea, $args) {
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;

Expand Down
2 changes: 1 addition & 1 deletion mod/assignment/type/uploadsingle/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$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);
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/chat_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}

if (!empty($chat_message)) {
$message = new object();
$message = new stdClass();
$message->chatid = $chatuser->chatid;
$message->userid = $chatuser->userid;
$message->groupid = $chatuser->groupid;
Expand Down
4 changes: 2 additions & 2 deletions mod/chat/gui_basic/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
} 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;
Expand Down Expand Up @@ -154,7 +154,7 @@
echo '<h2>'.get_string('messages', 'chat').'</h2>';

$allmessages = array();
$options = new object();
$options = new stdClass();
$options->para = false;
$options->newlines = true;

Expand Down
2 changes: 1 addition & 1 deletion mod/chat/gui_header_js/insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

if (!empty($chat_message)) {

$message = new object();
$message = new stdClass();
$message->chatid = $chatuser->chatid;
$message->userid = $chatuser->userid;
$message->groupid = $chatuser->groupid;
Expand Down
Loading

0 comments on commit 39790bd

Please sign in to comment.