navigation MDL-23881 Labels are now added to the navigation but the display property is set to false.

This commit is contained in:
Sam Hemelryk 2010-08-23 02:03:54 +00:00
parent c47cc9fe16
commit 93ea1294e3

View File

@ -1406,7 +1406,7 @@ class global_navigation extends navigation_node {
foreach ($modinfo->sections[$sectionnumber] as $cmid) {
$cm = $modinfo->cms[$cmid];
if ($cm->modname == 'label' || (!$viewhiddenactivities && !$cm->visible)) {
if (!$viewhiddenactivities && !$cm->visible) {
continue;
}
if ($cm->icon) {
@ -1418,7 +1418,9 @@ class global_navigation extends navigation_node {
$activitynode = $sectionnode->add($cm->name, $url, navigation_node::TYPE_ACTIVITY, $cm->name, $cm->id, $icon);
$activitynode->title(get_string('modulename', $cm->modname));
$activitynode->hidden = (!$cm->visible);
if ($this->module_extends_navigation($cm->modname)) {
if ($cm->modname == 'label') {
$activitynode->display = false;
} else if ($this->module_extends_navigation($cm->modname)) {
$activitynode->nodetype = navigation_node::NODETYPE_BRANCH;
}
$activities[$cmid] = $activitynode;