mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-32652 - Make block drag-drop work throughout Moodle
Other than shifting the initialisation from course/lib.php to lib/outputrequirementslib.php, some workarounds/tweaks were required in order to make it work correctly on admin pages and My Home.
This commit is contained in:
parent
ca48fe5f97
commit
d7c29c2257
4 changed files with 41 additions and 11 deletions
|
@ -282,6 +282,21 @@ class page_requirements_manager {
|
|||
if ($page->pagelayout === 'frametop') {
|
||||
$this->js_init_call('M.util.init_frametop');
|
||||
}
|
||||
|
||||
// Include block drag/drop if editing is on
|
||||
if ($page->user_is_editing()) {
|
||||
$params = array(
|
||||
'courseid' => $page->course->id,
|
||||
'pagetype' => $page->pagetype,
|
||||
'pagelayout' => $page->pagelayout,
|
||||
'subpage' => $page->subpage,
|
||||
'regions' => $page->blocks->get_regions(),
|
||||
);
|
||||
if (!empty($page->cm->id)) {
|
||||
$params['cmid'] = $page->cm->id;
|
||||
}
|
||||
$page->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue