mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
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:
parent
b4e5fcf5e2
commit
d893a4111e
@ -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
|
||||
*
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user