mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
blocklib: MDL-19010 eliminate remaining calls to blocks_repopulate_page
This commit is contained in:
parent
cf37931b7f
commit
6cbcbf0fb3
7 changed files with 15 additions and 17 deletions
|
@ -67,13 +67,13 @@
|
|||
}
|
||||
|
||||
/// Insert the record.
|
||||
if ($courseid = $DB->insert_record("course",$course)) {
|
||||
$page = page_create_object(PAGE_COURSE_VIEW, $courseid);
|
||||
blocks_repopulate_page($page); // Return value not checked because you can always edit later
|
||||
if ($courseid = $DB->insert_record('course', $course)) {
|
||||
$course = $DB->get_record('course', array('id' => $courseid));
|
||||
blocks_add_default_course_blocks($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $courseid);
|
||||
role_assign($CFG->creatornewroleid, $teacherid, 0, $context->id); // assing teacher role
|
||||
$course->id = $courseid;
|
||||
if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) { // if we're all or requested we're ok.
|
||||
if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) {
|
||||
// if we're all or requested we're ok.
|
||||
$allowedmods = explode(',',$CFG->defaultallowedmodules);
|
||||
update_restricted_mods($course,$allowedmods);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue