MDL-34322 Don't display empty navigation nodes which have no link

This commit is contained in:
Andrew Robert Nicols
2012-07-13 15:01:39 +01:00
parent 904673dd20
commit 65dcd906e3
+5
View File
@@ -77,6 +77,11 @@ class block_navigation_renderer extends plugin_renderer_base {
$isexpandable = (empty($expansionlimit) || ($item->type > navigation_node::TYPE_ACTIVITY || $item->type < $expansionlimit) || ($item->contains_active_node() && $item->children->count() > 0));
$isbranch = $isexpandable && ($item->children->count() > 0 || ($item->has_children() && (isloggedin() || $item->type <= navigation_node::TYPE_CATEGORY)));
// Skip elements which have no content and no action - no point in showing them
if (!$isexpandable && empty($item->action)) {
continue;
}
$hasicon = ((!$isbranch || $item->type == navigation_node::TYPE_ACTIVITY || $item->type == navigation_node::TYPE_RESOURCE) && $item->icon instanceof renderable);
if ($hasicon) {