MDL-70801 core_my: Add a new courses page

This commit is contained in:
Mathew May 2021-10-21 12:13:36 +08:00
parent c69c33b14d
commit 6ca9c2154a
33 changed files with 417 additions and 51 deletions

View file

@ -2647,7 +2647,30 @@ function blocks_add_default_system_blocks() {
$subpagepattern = null;
}
$newblocks = array('timeline', 'private_files', 'badges', 'calendar_month');
$newcontent = array('myoverview');
$page->blocks->add_blocks(array(BLOCK_POS_RIGHT => $newblocks, 'content' => $newcontent), 'my-index', $subpagepattern);
if ($defaultmycoursespage = $DB->get_record('my_pages', array('userid' => null, 'name' => '__courses', 'private' => 0))) {
$mycoursesubpagepattern = $defaultmycoursespage->id;
} else {
$mycoursesubpagepattern = null;
}
$page->blocks->add_blocks([
BLOCK_POS_RIGHT => [
'private_files',
'badges',
],
'content' => [
'timeline',
'calendar_month',
]],
'my-index',
$subpagepattern
);
$page->blocks->add_blocks([
'content' => [
'myoverview'
]],
'my-index',
$mycoursesubpagepattern
);
}