Merge branch 'MDL-33128-master-1' of git://git.luns.net.uk/moodle

This commit is contained in:
Sam Hemelryk 2012-06-13 15:40:39 +12:00
commit 463ccee1de

View File

@ -188,15 +188,7 @@ class core_course_renderer extends plugin_renderer_base {
// Put all options into one tag 'alloptions' to allow us to handle scrolling
$formcontent .= html_writer::start_tag('div', array('class' => 'alloptions'));
// First display Resources
$resources = array_filter($modules,
create_function('$mod', 'return ($mod->archetype === MOD_CLASS_RESOURCE);'));
if (count($resources)) {
$formcontent .= $this->course_modchooser_title('resources');
$formcontent .= $this->course_modchooser_module_types($resources);
}
// Then activities
// Activities
$activities = array_filter($modules,
create_function('$mod', 'return ($mod->archetype !== MOD_CLASS_RESOURCE);'));
if (count($activities)) {
@ -204,6 +196,14 @@ class core_course_renderer extends plugin_renderer_base {
$formcontent .= $this->course_modchooser_module_types($activities);
}
// Resources
$resources = array_filter($modules,
create_function('$mod', 'return ($mod->archetype === MOD_CLASS_RESOURCE);'));
if (count($resources)) {
$formcontent .= $this->course_modchooser_title('resources');
$formcontent .= $this->course_modchooser_module_types($resources);
}
$formcontent .= html_writer::end_tag('div'); // modoptions
$formcontent .= html_writer::end_tag('div'); // types