MDL-24321 switching to stdClass in /blog/

This commit is contained in:
Petr Skoda 2010-09-21 08:11:06 +00:00
parent dd4bee83ae
commit e463f508cb
3 changed files with 13 additions and 13 deletions

View File

@ -75,12 +75,12 @@ class blog_edit_form extends moodleform {
$course = $DB->get_record('course', array('id' => $courseid));
$mform->addElement('header', 'assochdr', get_string('associations', 'blog'));
$context = get_context_instance(CONTEXT_COURSE, $courseid);
$a = new object();
$a = new stdClass();
$a->coursename = $course->fullname;
$contextid = $context->id;
} else {
$sql = 'SELECT fullname FROM {course} cr LEFT JOIN {context} ct ON ct.instanceid = cr.id WHERE ct.id = ?';
$a = new object();
$a = new stdClass();
$a->coursename = $DB->get_field_sql($sql, array($entry->courseassoc));
$contextid = $entry->courseassoc;
}
@ -90,14 +90,14 @@ class blog_edit_form extends moodleform {
} else if ((!empty($entry->modassoc) || !empty($modid)) && has_capability('moodle/blog:associatemodule', $sitecontext)) {
if (!empty($modid)) {
$mod = get_coursemodule_from_id(false, $modid);
$a = new object();
$a = new stdClass();
$a->modtype = get_string('modulename', $mod->modname);
$a->modname = $mod->name;
$context = get_context_instance(CONTEXT_MODULE, $modid);
} else {
$context = $DB->get_record('context', array('id' => $entry->modassoc));
$cm = $DB->get_record('course_modules', array('id' => $context->instanceid));
$a = new object();
$a = new stdClass();
$a->modtype = $DB->get_field('modules', 'name', array('id' => $cm->module));
$a->modname = $DB->get_field($a->modtype, 'name', array('id' => $cm->instance));
}

View File

@ -187,7 +187,7 @@ function blog_sync_external_entries($externalblog) {
}
}
$newentry = new object();
$newentry = new stdClass();
$newentry->userid = $externalblog->userid;
$newentry->module = 'blog_external';
$newentry->content = $externalblog->id;
@ -662,7 +662,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$cm = $DB->get_record('course_modules', array('id' => $modid));
$cm->modname = $DB->get_field('modules', 'name', array('id' => $cm->module));
$cm->name = $DB->get_field($cm->modname, 'name', array('id' => $cm->instance));
$a = new object();
$a = new stdClass();
$a->type = get_string('modulename', $cm->modname);
$PAGE->set_cm($cm, $course);
$headers['stradd'] = get_string('blogaboutthis', 'blog', $a);
@ -741,7 +741,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$PAGE->set_title("$site->shortname: $cm->name: " . fullname($user) . ': ' . get_string('blogentries', 'blog'));
$PAGE->set_heading("$site->shortname: $cm->name: " . fullname($user) . ': ' . get_string('blogentries', 'blog'));
$a = new object();
$a = new stdClass();
$a->user = fullname($user);
$a->mod = $cm->name;
$a->type = get_string('modulename', $cm->modname);
@ -760,7 +760,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$PAGE->set_title("$site->shortname: $course->shortname: " . fullname($user) . ': ' . get_string('blogentries', 'blog'));
$PAGE->set_heading("$site->shortname: $course->shortname: " . fullname($user) . ': ' . get_string('blogentries', 'blog'));
$a = new object();
$a = new stdClass();
$a->user = fullname($user);
$a->course = $course->fullname;
$a->type = get_string('course');
@ -784,7 +784,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$PAGE->set_title("$site->shortname: $course->shortname: " . get_string('blogentries', 'blog') . ": $group->name");
$PAGE->set_heading("$site->shortname: $course->shortname: " . get_string('blogentries', 'blog') . ": $group->name");
$a = new object();
$a = new stdClass();
$a->group = $group->name;
$a->course = $course->fullname;
$a->type = get_string('course');
@ -805,7 +805,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$PAGE->set_title("$site->shortname: $course->shortname: $cm->name: " . get_string('blogentries', 'blog') . ": $group->name");
$PAGE->set_heading("$site->shortname: $course->shortname: $cm->name: " . get_string('blogentries', 'blog') . ": $group->name");
$a = new object();
$a = new stdClass();
$a->group = $group->name;
$a->mod = $cm->name;
$a->type = get_string('modulename', $cm->modname);
@ -823,7 +823,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$PAGE->set_title("$site->shortname: $course->shortname: $cm->name: " . get_string('blogentries', 'blog'));
$PAGE->set_heading("$site->shortname: $course->shortname: $cm->name: " . get_string('blogentries', 'blog'));
$headers['heading'] = get_string('blogentriesabout', 'blog', $cm->name);
$a = new object();
$a = new stdClass();
$a->type = get_string('modulename', $cm->modname);
$headers['stradd'] = get_string('blogaboutthis', 'blog', $a);
$headers['strview'] = get_string('viewallmodentries', 'blog', $a);
@ -835,7 +835,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$PAGE->navbar->add($strblogentries, $blogurl);
$PAGE->set_title("$site->shortname: $course->shortname: " . get_string('blogentries', 'blog'));
$PAGE->set_heading("$site->shortname: $course->shortname: " . get_string('blogentries', 'blog'));
$a = new object();
$a = new stdClass();
$a->type = get_string('course');
$headers['heading'] = get_string('blogentriesabout', 'blog', $course->fullname);
$headers['stradd'] = get_string('blogaboutthis', 'blog', $a);

View File

@ -157,7 +157,7 @@ class blog_entry {
$topiccell->text .= $OUTPUT->container_start('author');
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $PAGE->course->id)));
$by = new object();
$by = new stdClass();
$by->name = html_writer::link(new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $PAGE->course->id)), $fullname);
$by->date = $template['created'];