mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
Merge branch 'MDL-73670-master' of https://github.com/jleyva/moodle
This commit is contained in:
commit
3b68a32832
@ -290,34 +290,6 @@ class core_block_external extends external_api {
|
||||
$returninvisible = has_capability('moodle/my:manageblocks', $context) ? true : false;
|
||||
$allblocks = self::get_all_current_page_blocks($returninvisible, $params['returncontents']);
|
||||
|
||||
// Temporary hack to be removed in 4.1.
|
||||
// Return always the course overview block so old versions of the app can list the user courses.
|
||||
if ($mypage == MY_PAGE_DEFAULT && core_useragent::is_moodle_app()) {
|
||||
$myoverviewfound = false;
|
||||
|
||||
foreach ($allblocks as $block) {
|
||||
if ($block['name'] == 'myoverview' && $block['visible']) {
|
||||
$myoverviewfound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$myoverviewfound) {
|
||||
// Include a course overview fake block.
|
||||
$allblocks[] = [
|
||||
'instanceid' => 0,
|
||||
'name' => 'myoverview',
|
||||
'region' => 'forced',
|
||||
'positionid' => null,
|
||||
'collapsible' => true,
|
||||
'dockable' => false,
|
||||
'weight' => 0,
|
||||
'visible' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
// End of the hack to be removed in 4.1 see MDL-73670.
|
||||
|
||||
return array(
|
||||
'blocks' => $allblocks,
|
||||
'warnings' => $warnings
|
||||
|
Loading…
x
Reference in New Issue
Block a user