MDL-33128 Swap Activities and Resources in the module chooser

This commit is contained in:
Andrew Robert Nicols
2012-05-21 11:08:32 +01:00
parent 4f7f2a8828
commit 48a5e55ee2
+9 -9
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);
}
// Activities
$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