From 8665cc33e07c651331124fde93dde49df24fba72 Mon Sep 17 00:00:00 2001 From: Fotis Skandalis Date: Mon, 10 Sep 2018 16:51:35 +0300 Subject: [PATCH] MDL-62714 theme_boost: Course visibility in navigation bar Added check in navbar.mustache to add dimmed_text class if needed. Added is_hidden() in navigationlib.php to return if the class needs to be added. --- lib/navigationlib.php | 9 +++++++++ theme/boost/templates/core/navbar.mustache | 19 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 398e56e0b8c..b30c1d1d8dc 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -686,6 +686,15 @@ class navigation_node implements renderable { return !empty($this->action); } + /** + * Used to easily determine if this link in the breadcrumbs is hidden. + * + * @return boolean + */ + public function is_hidden() { + return $this->hidden; + } + /** * Gets the CSS class to add to this node to describe its type * diff --git a/theme/boost/templates/core/navbar.mustache b/theme/boost/templates/core/navbar.mustache index c74410d268b..07d0c0404aa 100644 --- a/theme/boost/templates/core/navbar.mustache +++ b/theme/boost/templates/core/navbar.mustache @@ -31,6 +31,7 @@ * action - string * get_title - string * get_content - string + * is_hidden - boolean Example context (json): { @@ -39,21 +40,25 @@ "has_action": true, "action": "#", "get_title": "Test title", - "get_content": "First & fresh" + "get_content": "First & fresh", + "is_hidden": false }, { "has_action": true, "action": "#", "get_title": "Second item & a title", - "get_content": "Second item" + "get_content": "Second item", + "is_hidden": false }, { "has_action": false, - "get_content": "Third item" + "get_content": "Third item", + "is_hidden": false }, { "has_action": false, - "get_content": "Fourth & last" + "get_content": "Fourth & last", + "is_hidden": true } ] } @@ -62,10 +67,12 @@