Skip to content

Commit

Permalink
MDL-24321 switching to stdClass in /e*/
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 21, 2010
1 parent fbaea88 commit 94b9c2e
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions enrol/authorize/localfuncs.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function message_to_admin($subject, $data) {

$emailmessage = "$SITE->fullname: Transaction failed.\n\n$subject\n\n";
$emailmessage .= print_r($data, true);
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_authorize';
$eventdata->name = 'authorize_enrolment';
Expand Down Expand Up @@ -231,7 +231,7 @@ function send_welcome_messages($orderdata) {
$a->paymenturl = "$CFG->wwwroot/enrol/authorize/index.php?user=$lastuserid";
$emailmessage = get_string('welcometocoursesemail', 'enrol_authorize', $a);

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_authorize';
$eventdata->name = 'authorize_enrolment';
Expand Down
2 changes: 1 addition & 1 deletion enrol/authorize/uploadcsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function authorize_process_csv($filename) {
if (!empty($ignoredlines)) {
$admin = get_admin();

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_authorize';
$eventdata->name = 'authorize_enrolment';
Expand Down
8 changes: 4 additions & 4 deletions enrol/database/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function sync_enrolments() {
if (!empty($mapping) and !isset($existing[$mapping])) {
$params['mapping'] = $mapping;
if ($course = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE)) {
$new = new object();
$new = new stdClass();
$new->id = $course->id;
$new->visible = $course->visible;
$new->mapping = $mapping;
Expand Down Expand Up @@ -519,7 +519,7 @@ public function sync_courses() {
// invalid category id, better to skip
continue;
}
$course = new object();
$course = new stdClass();
$course->fullname = $fields[$fullname];
$course->shortname = $fields[$shortname];
$course->idnumber = $idnumber ? $fields[$idnumber] : NULL;
Expand All @@ -546,10 +546,10 @@ public function sync_courses() {
unset($template->shortname);
unset($template->idnumber);
} else {
$template = new object();
$template = new stdClass();
}
} else {
$template = new object();
$template = new stdClass();
}
if (!$DB->record_exists('course_categories', array('id'=>$defaultcategory))) {
$categories = $DB->get_records('course_categories', array(), 'sortorder', 'id', 0, 1);
Expand Down
14 changes: 7 additions & 7 deletions enrol/flatfile/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected function process_file() {
} // end of if(file_open)

if(! @unlink($filename)) {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->name = 'flatfile_enrolment';
Expand All @@ -167,7 +167,7 @@ protected function process_file() {
if (!empty($mailadmins)) {

// Send mail to admin
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->name = 'flatfile_enrolment';
Expand Down Expand Up @@ -213,7 +213,7 @@ private function process_records($action, $roleid, $user, $course, $timestart, $
if ($timestart > time()) {
if ($store_to_buffer) {
// populate into enrol_flatfile table as a future role to be assigned by cron.
$future_en = new object();
$future_en = new stdClass();
$future_en->action = $action;
$future_en->roleid = $roleid;
$future_en->userid = $user->id;
Expand Down Expand Up @@ -273,11 +273,11 @@ private function process_records($action, $roleid, $user, $course, $timestart, $

if (!empty($mailstudents)) {
// Send mail to students
$a = new object();
$a = new stdClass();
$a->coursename = "$course->fullname";
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->name = 'flatfile_enrolment';
Expand All @@ -295,11 +295,11 @@ private function process_records($action, $roleid, $user, $course, $timestart, $

// Send mail to teachers
foreach($teachers as $teacher) {
$a = new object();
$a = new stdClass();
$a->course = "$course->fullname";
$a->user = fullname($user);

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'course';
$eventdata->name = 'flatfile_enrolment';
Expand Down
12 changes: 6 additions & 6 deletions enrol/imsenterprise/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function cron() {
$msg .= "Logging is currently not active.";
}

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'imsenterprise';
$eventdata->name = 'imsenterprise_enrolment';
Expand Down Expand Up @@ -311,7 +311,7 @@ function process_group_tag($tagcontents){
$createnewcategories = $this->get_config('createnewcategories');

// Process tag contents
$group = new object();
$group = new stdClass();
if(preg_match('{<sourcedid>.*?<id>(.+?)</id>.*?</sourcedid>}is', $tagcontents, $matches)){
$group->coursecode = trim($matches[1]);
}
Expand Down Expand Up @@ -356,7 +356,7 @@ function process_group_tag($tagcontents){
$this->log_line("Course $coursecode not found in Moodle's course idnumbers.");
} else {
// Create the (hidden) course(s) if not found
$course = new object();
$course = new stdClass();
$course->fullname = $group->description;
$course->shortname = $coursecode;
$course->idnumber = $coursecode;
Expand All @@ -372,7 +372,7 @@ function process_group_tag($tagcontents){
$course->category = $catid;
} elseif($createnewcategories) {
// Else if we're allowed to create new categories, let's create this one
$newcat = new object();
$newcat = new stdClass();
$newcat->name = $group->category;
$newcat->visible = 0;
$catid = $DB->insert_record('course_categories', $newcat);
Expand All @@ -398,7 +398,7 @@ function process_group_tag($tagcontents){
$course = $DB->get_record('course', array('id' => $courseid));
blocks_add_default_course_blocks($course);

$section = new object();
$section = new stdClass();
$section->course = $course->id; // Create a default section.
$section->section = 0;
$section->summaryformat = FORMAT_HTML;
Expand Down Expand Up @@ -430,7 +430,7 @@ function process_person_tag($tagcontents){
$imsdeleteusers = $this->get_config('imsdeleteusers');
$createnewusers = $this->get_config('createnewusers');

$person = new object();
$person = new stdClass();
if(preg_match('{<sourcedid>.*?<id>(.+?)</id>.*?</sourcedid>}is', $tagcontents, $matches)){
$person->idnumber = trim($matches[1]);
}
Expand Down
6 changes: 3 additions & 3 deletions enrol/ldap/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function sync_user_enrolments($user) {
WHERE c.id = :courseid";
$params = array('courseid'=>$course->id);
if (!($course_instance = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE))) {
$course_instance = new object();
$course_instance = new stdClass();
$course_instance->id = $course->id;
$course_instance->visible = $course->visible;
$course_instance->enrolid = $this->add_instance($course_instance);
Expand Down Expand Up @@ -501,7 +501,7 @@ public function sync_enrolments() {
WHERE c.id = :courseid";
$params = array('courseid'=>$course_obj->id);
if (!($course_instance = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE))) {
$course_instance = new object();
$course_instance = new stdClass();
$course_instance->id = $course_obj->id;
$course_instance->visible = $course_obj->visible;
$course_instance->enrolid = $this->add_instance($course_instance);
Expand Down Expand Up @@ -875,7 +875,7 @@ function create_course($course_ext, $skip_fix_course_sortorder=false) {
require_once("$CFG->dirroot/course/lib.php");

// Override defaults with template course
$course = new object();
$course = new stdClass();
if ($this->get_config('template')) {
if($template = $DB->get_record('course', array('shortname'=>$this->get_config('template')))) {
unset($template->id); // So we are clear to reinsert the record
Expand Down
2 changes: 1 addition & 1 deletion enrol/manual/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
require_capability('moodle/course:enrolconfig', $context);
// no instance yet, we have to add new instance
navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id)));
$instance = new object();
$instance = new stdClass();
$instance->id = null;
$instance->courseid = $course->id;
}
Expand Down
2 changes: 1 addition & 1 deletion enrol/paypal/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
require_capability('moodle/course:enrolconfig', $context);
// no instance yet, we have to add new instance
navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id)));
$instance = new object();
$instance = new stdClass();
$instance->id = null;
$instance->courseid = $course->id;
}
Expand Down
12 changes: 6 additions & 6 deletions enrol/paypal/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

$req = 'cmd=_notify-validate';

$data = new object();
$data = new stdClass();

foreach ($_POST as $key => $value) {
$req .= "&$key=".urlencode($value);
Expand Down Expand Up @@ -135,7 +135,7 @@
// Email user to let them know. Email admin.

if ($data->payment_status == "Pending" and $data->pending_reason != "echeck") {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_paypal';
$eventdata->name = 'paypal_enrolment';
Expand Down Expand Up @@ -233,7 +233,7 @@
$a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id";

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_paypal';
$eventdata->name = 'paypal_enrolment';
Expand All @@ -252,7 +252,7 @@
$a->course = $course->fullname;
$a->user = fullname($user);

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_paypal';
$eventdata->name = 'paypal_enrolment';
Expand All @@ -271,7 +271,7 @@
$a->user = fullname($user);
$admins = get_admins();
foreach ($admins as $admin) {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_paypal';
$eventdata->name = 'paypal_enrolment';
Expand Down Expand Up @@ -310,7 +310,7 @@ function message_paypal_error_to_admin($subject, $data) {
$message .= "$key => $value\n";
}

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->component = 'enrol_paypal';
$eventdata->name = 'paypal_enrolment';
Expand Down
2 changes: 1 addition & 1 deletion enrol/self/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
require_capability('moodle/course:enrolconfig', $context);
// no instance yet, we have to add new instance
navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id)));
$instance = new object();
$instance = new stdClass();
$instance->id = null;
$instance->courseid = $course->id;
}
Expand Down
2 changes: 1 addition & 1 deletion enrol/self/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected function email_welcome_message($instance, $user) {

$course = $DB->get_record('course', array('id'=>$instance->courseid), '*', MUST_EXIST);

$a = new object();
$a = new stdClass();
$a->coursename = format_string($course->fullname);
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id";

Expand Down
4 changes: 2 additions & 2 deletions error/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
print_error('cannotfindadmin', 'debug');
}

$supportuser = new object;
$supportuser = new stdClass();
$supportuser->email = $CFG->supportemail ? $CFG->supportemail : $admin->email;
$supportuser->firstname = $CFG->supportname ? $CFG->supportname : $admin->firstname;
$supportuser->lastname = $CFG->supportname ? '' : $admin->lastname;
$supportuser->maildisplay = true;

/// Send the message and redirect
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $USER;
$eventdata->userto = $supportuser;
Expand Down

0 comments on commit 94b9c2e

Please sign in to comment.