navigation MDL-22072 Icons are no longer shown on the navigation bar by default.
This commit is contained in:
@@ -122,6 +122,8 @@ class navigation_node implements renderable {
|
||||
public $forcetitle = false;
|
||||
/** @var navigation_node A reference to the node parent */
|
||||
public $parent = null;
|
||||
/** @var bool Override to not display the icon even if one is provided **/
|
||||
public $hideicon = false;
|
||||
/** @var array */
|
||||
protected $namedtypes = array(0=>'system',10=>'category',20=>'course',30=>'structure',40=>'activity',50=>'resource',60=>'custom',70=>'setting', 80=>'user');
|
||||
/** @var moodle_url */
|
||||
|
||||
@@ -2067,6 +2067,7 @@ END;
|
||||
$htmlblocks = array();
|
||||
// Iterate the navarray and display each node
|
||||
foreach ($items as $item) {
|
||||
$item->hideicon = true;
|
||||
$htmlblocks[] = html_writer::tag('li', $this->render($item));
|
||||
}
|
||||
|
||||
@@ -2077,7 +2078,7 @@ END;
|
||||
protected function render_navigation_node(navigation_node $item) {
|
||||
$content = $item->get_content();
|
||||
$title = $item->get_title();
|
||||
if ($item->icon instanceof renderable) {
|
||||
if ($item->icon instanceof renderable && !$item->hideicon) {
|
||||
$icon = $this->render($item->icon);
|
||||
$content = $icon.' '.$content; // use CSS for spacing of icons
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user