Permalink
Browse files

MDL-34762 course Hide system archetypes from mod chooser

  • Loading branch information...
micaherne authored and danpoltawski committed Oct 29, 2012
1 parent 5ac25e0 commit b622d36f13e68be31066ad087448e534d411ba5f
Showing with 7 additions and 5 deletions.
  1. +7 −5 course/renderer.php
View
@@ -188,17 +188,19 @@ public function course_modchooser($modules, $course) {
// Put all options into one tag 'alloptions' to allow us to handle scrolling
$formcontent .= html_writer::start_tag('div', array('class' => 'alloptions'));
- // Activities
- $activities = array_filter($modules,
- create_function('$mod', 'return ($mod->archetype !== MOD_CLASS_RESOURCE);'));
+ // Activities
+ $activities = array_filter($modules, function($mod) {
+ return ($mod->archetype !== MOD_ARCHETYPE_RESOURCE && $mod->archetype !== MOD_ARCHETYPE_SYSTEM);
+ });
if (count($activities)) {
$formcontent .= $this->course_modchooser_title('activities');
$formcontent .= $this->course_modchooser_module_types($activities);
}
// Resources
- $resources = array_filter($modules,
- create_function('$mod', 'return ($mod->archetype === MOD_CLASS_RESOURCE);'));
+ $resources = array_filter($modules, function($mod) {
+ return ($mod->archetype === MOD_ARCHETYPE_RESOURCE);
+ });
if (count($resources)) {
$formcontent .= $this->course_modchooser_title('resources');
$formcontent .= $this->course_modchooser_module_types($resources);

0 comments on commit b622d36

Please sign in to comment.