Skip to content

Commit

Permalink
MDL-24321 switching to stdClass in /admin/ and /
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 21, 2010
1 parent 39790bd commit a226a97
Show file tree
Hide file tree
Showing 24 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blockobject = false;
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
$plugin = new object();
$plugin = new stdClass();
$plugin->version = $block->version;

} else {
$plugin = new object();
$plugin = new stdClass();
$plugin->version = '???';
if (file_exists("$CFG->dirroot/blocks/$blockname/version.php")) {
include("$CFG->dirroot/blocks/$blockname/version.php");
Expand Down
6 changes: 3 additions & 3 deletions admin/bloglevelupgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
$bloggers = $DB->get_records_sql("SELECT userid FROM {post} WHERE module = 'blog' GROUP BY userid");
require_once($CFG->dirroot.'/mod/forum/lib.php');

$a = new object();
$a = new stdClass();
$a->userscount = 0;
$a->blogcount = 0;

Expand Down Expand Up @@ -107,7 +107,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {

if (!empty($files)) {
foreach ($files as $storedfile) {
$newfile = new object();
$newfile = new stdClass();
$newfile->component = 'mod_forum';
$newfile->filearea = 'attachment';
$newfile->itemid = $discussion->firstpost;
Expand All @@ -120,7 +120,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {

if (!empty($files)) {
foreach ($files as $storedfile) {
$newfile = new object();
$newfile = new stdClass();
$newfile->component = 'mod_forum';
$newfile->filearea = 'post';
$newfile->itemid = $discussion->firstpost;
Expand Down
2 changes: 1 addition & 1 deletion admin/generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public function generate_forum_posts($course_users, $modules) {

require_once($CFG->dirroot.'/mod/forum/lib.php');

$discussion = new object();
$discussion = new stdClass();
$discussion->course = $forum->course;
$discussion->forum = $forum->id;
$discussion->name = 'Test discussion';
Expand Down
6 changes: 3 additions & 3 deletions admin/handlevirus.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function notify_user($user,$subject,$a) {
}
$body = get_string('virusfoundlater','moodle',$a);

$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = get_admin();
$eventdata->userto = $user;
Expand All @@ -80,7 +80,7 @@ function notify_admins($user,$subject,$a) {

$body = get_string('virusfoundlateradmin','moodle',$a);
foreach ($admins as $admin) {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;
Expand All @@ -101,7 +101,7 @@ function notify_admins_unknown($file,$a) {
$subject = get_string('virusfoundsubject','moodle',format_string($site->fullname));
$body = get_string('virusfoundlateradminnolog','moodle',$a);
foreach ($admins as $admin) {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;
Expand Down
4 changes: 2 additions & 2 deletions admin/langimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
switch ($status) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new object();
$a = new stdClass();
$a->url = 'http://download.moodle.org/langpack/'.$thisversion.'/'.$pack.'.zip';
$a->dest = $CFG->dataroot.'/lang';
print_error($cd->get_error(), 'error', 'langimport.php', $a);
Expand Down Expand Up @@ -274,7 +274,7 @@

if ($missingparents) {
foreach ($missingparents as $l=>$parent) {
$a = new object();
$a = new stdClass();
$a->lang = $installedlangs[$l];
$a->parent = $parent;
foreach ($availablelangs as $alang) {
Expand Down
2 changes: 1 addition & 1 deletion admin/process_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// BOUNCE EMAILS TO NOREPLY
if ($_ENV['RECIPIENT'] == $CFG->noreplyaddress) {
$user = new object();
$user = new stdClass();
$user->email = $_ENV['SENDER'];

if (!validate_email($user->email)) {
Expand Down
2 changes: 1 addition & 1 deletion admin/report/configlog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$baseurl = new moodle_url('index.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage));
echo $OUTPUT->paging_bar($changescount, $page, $perpage, $baseurl);

$override = new object();
$override = new stdClass();
$override->firstname = 'firstname';
$override->lastname = 'lastname';
$fullnamelanguage = get_string('fullnamedisplay', '', $override);
Expand Down
38 changes: 19 additions & 19 deletions admin/report/security/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function report_security_doc_link($issue, $name) {
* @return object result
*/
function report_security_check_globals($detailed=false) {
$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_globals';
$result->name = get_string('check_globals_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -114,7 +114,7 @@ function report_security_check_globals($detailed=false) {
function report_security_check_noauth($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_noauth';
$result->name = get_string('check_noauth_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -146,7 +146,7 @@ function report_security_check_noauth($detailed=false) {
function report_security_check_passwordpolicy($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_passwordpolicy';
$result->name = get_string('check_passwordpolicy_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -177,7 +177,7 @@ function report_security_check_passwordpolicy($detailed=false) {
function report_security_check_embed($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_embed';
$result->name = get_string('check_embed_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -208,7 +208,7 @@ function report_security_check_embed($detailed=false) {
function report_security_check_mediafilterswf($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_mediafilterswf';
$result->name = get_string('check_mediafilterswf_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -241,7 +241,7 @@ function report_security_check_mediafilterswf($detailed=false) {
function report_security_check_unsecuredataroot($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_unsecuredataroot';
$result->name = get_string('check_unsecuredataroot_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -278,7 +278,7 @@ function report_security_check_unsecuredataroot($detailed=false) {
* @return object result
*/
function report_security_check_displayerrors($detailed=false) {
$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_displayerrors';
$result->name = get_string('check_displayerrors_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -309,7 +309,7 @@ function report_security_check_displayerrors($detailed=false) {
function report_security_check_openprofiles($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_openprofiles';
$result->name = get_string('check_openprofiles_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -341,7 +341,7 @@ function report_security_check_openprofiles($detailed=false) {
function report_security_check_google($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_google';
$result->name = get_string('check_google_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -375,7 +375,7 @@ function report_security_check_google($detailed=false) {
function report_security_check_emailchangeconfirmation($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_emailchangeconfirmation';
$result->name = get_string('check_emailchangeconfirmation_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -416,7 +416,7 @@ function report_security_check_cookiesecure($detailed=false) {
return null;
}

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_cookiesecure';
$result->name = get_string('check_cookiesecure_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -448,7 +448,7 @@ function report_security_check_cookiesecure($detailed=false) {
function report_security_check_configrw($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_configrw';
$result->name = get_string('check_configrw_name', 'report_security');
$result->info = null;
Expand All @@ -474,7 +474,7 @@ function report_security_check_configrw($detailed=false) {
function report_security_check_passwordsaltmain($detailed=false) {
global $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_passwordsaltmain';
$result->name = get_string('check_passwordsaltmain_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -510,7 +510,7 @@ function report_security_check_passwordsaltmain($detailed=false) {
function report_security_check_riskxss($detailed=false) {
global $DB;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_riskxss';
$result->name = get_string('check_riskxss_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -557,7 +557,7 @@ function report_security_check_riskxss($detailed=false) {
function report_security_check_defaultuserrole($detailed=false) {
global $DB, $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_defaultuserrole';
$result->name = get_string('check_defaultuserrole_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -615,7 +615,7 @@ function report_security_check_defaultuserrole($detailed=false) {
function report_security_check_guestrole($detailed=false) {
global $DB, $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_guestrole';
$result->name = get_string('check_guestrole_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -673,7 +673,7 @@ function report_security_check_guestrole($detailed=false) {
function report_security_check_frontpagerole($detailed=false) {
global $DB, $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_frontpagerole';
$result->name = get_string('check_frontpagerole_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -732,7 +732,7 @@ function report_security_check_frontpagerole($detailed=false) {
function report_security_check_riskadmin($detailed=false) {
global $DB, $CFG;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_riskadmin';
$result->name = get_string('check_riskadmin_name', 'report_security');
$result->info = null;
Expand Down Expand Up @@ -773,7 +773,7 @@ function report_security_check_riskadmin($detailed=false) {
function report_security_check_riskbackup($detailed=false) {
global $CFG, $DB;

$result = new object();
$result = new stdClass();
$result->issue = 'report_security_check_riskbackup';
$result->name = get_string('check_riskbackup_name', 'report_security');
$result->info = null;
Expand Down
2 changes: 1 addition & 1 deletion admin/report/spamcleaner/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function print_user_entry($user, $keywords, $count) {

global $SESSION, $CFG;

$smalluserobject = new object; // All we need to delete them later
$smalluserobject = new stdClass(); // All we need to delete them later
$smalluserobject->id = $user->id;
$smalluserobject->email = $user->email;
$smalluserobject->auth = $user->auth;
Expand Down
2 changes: 1 addition & 1 deletion admin/report/unittest/dbtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
echo $OUTPUT->header();

global $UNITTEST;
$UNITTEST = new object();
$UNITTEST = new stdClass();

if (!data_submitted()) {
$selected = array();
Expand Down
2 changes: 1 addition & 1 deletion admin/report/unittest/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$unittest = true;

global $UNITTEST;
$UNITTEST = new object();
$UNITTEST = new stdClass();

// Print the header.
$strtitle = get_string('unittests', 'simpletest');
Expand Down
4 changes: 2 additions & 2 deletions admin/roles/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
// show confirmation
echo $OUTPUT->header();
$optionsyes = array('action'=>'delete', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$a = new object();
$a = new stdClass();
$a->id = $roleid;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
Expand Down Expand Up @@ -150,7 +150,7 @@
echo $OUTPUT->header();
$optionsyes = array('action'=>'reset', 'roleid'=>$roleid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('action'=>'view', 'roleid'=>$roleid);
$a = new object();
$a = new stdClass();
$a->id = $roleid;
$a->name = $roles[$roleid]->name;
$a->shortname = $roles[$roleid]->shortname;
Expand Down
16 changes: 8 additions & 8 deletions admin/uploaduser.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@

$forcechangepassword = false;

$user = new object();
$user = new stdClass();
// by default, use the local mnet id (this may be changed in the file)
$user->mnethostid = $CFG->mnet_localhost_id;
// add fields to user object
Expand Down Expand Up @@ -641,7 +641,7 @@

$manual->enrol_user($manualcache[$courseid], $user->id, $rid, $today, $timeend, true);

$a = new object();
$a = new stdClass();
$a->course = $shortname;
$a->role = $rolecache[$rid]->name;
$upt->track('enrolments', get_string('enrolledincourserole', 'enrol_manual', $a));
Expand All @@ -660,11 +660,11 @@
$ccache[$shortname]->groups = array();
if ($groups = groups_get_all_groups($courseid)) {
foreach ($groups as $gid=>$group) {
$ccache[$shortname]->groups[$gid] = new object();
$ccache[$shortname]->groups[$gid] = new stdClass();
$ccache[$shortname]->groups[$gid]->id = $gid;
$ccache[$shortname]->groups[$gid]->name = $group->name;
if (!is_numeric($group->name)) { // only non-numeric names are supported!!!
$ccache[$shortname]->groups[$group->name] = new object();
$ccache[$shortname]->groups[$group->name] = new stdClass();
$ccache[$shortname]->groups[$group->name]->id = $gid;
$ccache[$shortname]->groups[$group->name]->name = $group->name;
}
Expand All @@ -675,7 +675,7 @@
$addgroup = $user->{'group'.$i};
if (!array_key_exists($addgroup, $ccache[$shortname]->groups)) {
// if group doesn't exist, create it
$newgroupdata = new object();
$newgroupdata = new stdClass();
$newgroupdata->name = $addgroup;
$newgroupdata->courseid = $ccache[$shortname]->id;
if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group($newgroupdata)){
Expand Down Expand Up @@ -1086,7 +1086,7 @@ function process_template($template, $user) {

// very very ugly hack!
global $template_globals;
$template_globals = new object();
$template_globals = new stdClass();
$template_globals->username = isset($user->username) ? $user->username : '';
$template_globals->firstname = isset($user->firstname) ? $user->firstname : '';
$template_globals->lastname = isset($user->lastname) ? $user->lastname : '';
Expand Down Expand Up @@ -1157,11 +1157,11 @@ function uu_allowed_roles() {
function uu_allowed_roles_cache() {
$allowedroles = get_assignable_roles(get_context_instance(CONTEXT_COURSE, SITEID), ROLENAME_SHORT);
foreach ($allowedroles as $rid=>$rname) {
$rolecache[$rid] = new object();
$rolecache[$rid] = new stdClass();
$rolecache[$rid]->id = $rid;
$rolecache[$rid]->name = $rname;
if (!is_numeric($rname)) { // only non-numeric shortnames are supported!!!
$rolecache[$rname] = new object();
$rolecache[$rname] = new stdClass();
$rolecache[$rname]->id = $rid;
$rolecache[$rname]->name = $rname;
}
Expand Down
Loading

0 comments on commit a226a97

Please sign in to comment.