MDL-24321 switching to stdClass in /admin/ and /

This commit is contained in:
Petr Skoda
2010-09-21 08:44:02 +00:00
parent 39790bd805
commit a226a972f7
24 changed files with 61 additions and 61 deletions
+8 -8
View File
@@ -202,7 +202,7 @@ if ($formdata = $mform->is_cancelled()) {
$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
@@ -641,7 +641,7 @@ if ($formdata = $mform->is_cancelled()) {
$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));
@@ -660,11 +660,11 @@ if ($formdata = $mform->is_cancelled()) {
$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;
}
@@ -675,7 +675,7 @@ if ($formdata = $mform->is_cancelled()) {
$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)){
@@ -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 : '';
@@ -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;
}