MDL-34322 Don't display empty navigation nodes which have no link
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user