mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
MDL-24321 switching to stdClass in /blog/
This commit is contained in:
parent
dd4bee83ae
commit
e463f508cb
3 changed files with 13 additions and 13 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue