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));
}