navigation MDL-23036 Fixed issue when generation was limited to course+categories causing JS to error

This commit is contained in:
Sam Hemelryk
2010-07-01 03:33:16 +00:00
parent e3b8897c3a
commit 1af67ecb1a
3 changed files with 33 additions and 9 deletions
+9
View File
@@ -1875,7 +1875,16 @@ class global_navigation extends navigation_node {
public function set_expansion_limit($type) {
$nodes = $this->find_all_of_type($type);
foreach ($nodes as &$node) {
// We need to generate the full site node
if ($type == self::TYPE_COURSE && $node->key == SITEID) {
continue;
}
foreach ($node->children as &$child) {
// We still want to show course reports and participants containers
// or there will be navigation missing.
if ($type == self::TYPE_COURSE && $child->type === self::TYPE_CONTAINER) {
continue;
}
$child->display = false;
}
}