Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34762 course Hide system archetypes from mod chooser

  • Loading branch information...
commit b622d36f13e68be31066ad087448e534d411ba5f 1 parent 5ac25e0
@micaherne micaherne authored danpoltawski committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 course/renderer.php
View
12 course/renderer.php
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.