navigation MDL-22072 Icons are no longer shown on the navigation bar by default.

This commit is contained in:
Sam Hemelryk
2010-04-23 04:21:33 +00:00
parent af8fe217ad
commit 493a48f3d6
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -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 */
+2 -1
View File
@@ -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
}