Skip to content

Commit

Permalink
MDL-31263 Rewrite block drag/drop using YUI3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Kabalin authored and danpoltawski committed Apr 24, 2012
1 parent 15e2552 commit 5683815
Show file tree
Hide file tree
Showing 7 changed files with 386 additions and 397 deletions.
21 changes: 15 additions & 6 deletions course/lib.php
Expand Up @@ -4488,21 +4488,30 @@ function include_course_ajax($course, $modules = array(), $config = null) {
);

// Include course dragdrop
$PAGE->requires->yui_module('moodle-course-dragdrop',
'M.core_course.init_resource_dragdrop',
if ($course->id != SITEID) {
$PAGE->requires->yui_module('moodle-course-dragdrop', 'M.core_course.init_section_dragdrop',
array(array(
'courseid' => $course->id,
'ajaxurl' => $config->resourceurl,
'ajaxurl' => $config->sectionurl,
'config' => $config,
)), null, true);

$PAGE->requires->yui_module('moodle-course-dragdrop',
'M.core_course.init_section_dragdrop',
$PAGE->requires->yui_module('moodle-course-dragdrop', 'M.core_course.init_resource_dragdrop',
array(array(
'courseid' => $course->id,
'ajaxurl' => $config->sectionurl,
'ajaxurl' => $config->resourceurl,
'config' => $config,
)), null, true);
}

// Include blocks dragdrop
$params = array(
'courseid' => $course->id,
'pagetype' => $PAGE->pagetype,
'pagelayout' => $PAGE->pagelayout,
'regions' => $PAGE->blocks->get_regions(),
);
$PAGE->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);

// Require various strings for the command toolbox
$PAGE->requires->strings_for_js(array(
Expand Down

0 comments on commit 5683815

Please sign in to comment.