MDL-55700 theme_noname: Allow text nodes in breadcrumb

The new theme was showing all nodes in the breadcrumb as links even when there is no
valid link.

Part of MDL-55071
This commit is contained in:
Damyon Wiese 2016-08-25 11:53:30 +08:00 committed by Dan Poltawski
parent b4e5fcf5e2
commit d893a4111e
2 changed files with 14 additions and 5 deletions

View File

@ -592,6 +592,15 @@ class navigation_node implements renderable {
}
}
/**
* Used to easily determine if this link in the breadcrumbs has a valid action/url.
*
* @return boolean
*/
public function has_action() {
return !empty($this->action);
}
/**
* Gets the CSS class to add to this node to describe its type
*

View File

@ -1,10 +1,10 @@
<ol class="breadcrumb" role="navigation">
{{#get_items}}
{{#action}}
{{#has_action}}
<li class="breadcrumb-item {{#is_active}}active{{/is_active}}"><a href="{{action}}" {{#get_title}}title="{{get_title}}"{{/get_title}}>{{text}}</a></li>
{{/action}}
{{^action}}
{{/has_action}}
{{^has_action}}
<li class="breadcrumb-item {{#is_active}}active{{/is_active}}">{{text}}</li>
{{/action}}
{{/has_action}}
{{/get_items}}
</ol>
</ol>