Skip to content
Browse files

MDL-34762 course Hide system archetypes from mod chooser

  • Loading branch information...
1 parent 59d332e commit 5035ed637694391abf08bf15ef10ca79a4146de8 @micaherne micaherne committed with danpoltawski Oct 29, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 course/renderer.php
View
12 course/renderer.php
@@ -233,17 +233,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 5035ed6

Please sign in to comment.
Something went wrong with that request. Please try again.