From: moodler Date: Mon, 2 Oct 2006 06:37:58 +0000 (+0000) Subject: Highlight the currently selected admin menu 8-) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c5d08a152688693cac9beb0bb3d317dc87e6f099;p=moodle.git Highlight the currently selected admin menu 8-) --- diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index 95dd95f4dd..d6ad1b92be 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -46,23 +46,26 @@ class block_admin_tree extends block_base { $this->tempcontent .= "\n"; } - function create_item($visiblename,$link,$icon) { + function create_item($visiblename,$link,$icon,$class) { global $CFG; for ($i = 0; $i < $this->currentdepth; $i++) { $this->tempcontent .= "   "; } - $this->tempcontent .= '[item] ' . $visiblename . '
' . "\n"; + $this->tempcontent .= '[item]'. + $visiblename.'
'."\n"; } function build_tree (&$content) { global $CFG; if (is_a($content, 'admin_settingpage')) { if ($content->check_access() and !$content->is_hidden()) { - $this->create_item($content->visiblename,$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=' . $content->name,$CFG->wwwroot .'/blocks/admin_tree/item.gif'); + $class = ($content->name == $this->section) ? 'link current' : 'link'; + $this->create_item($content->visiblename,$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=' . $content->name,$CFG->wwwroot .'/blocks/admin_tree/item.gif', $class); } } else if (is_a($content, 'admin_externalpage')) { if ($content->check_access() and !$content->is_hidden()) { - $this->create_item($content->visiblename, $content->url, $CFG->wwwroot . '/blocks/admin_tree/item.gif'); + $class = ($content->name == $this->section) ? 'link current' : 'link'; + $this->create_item($content->visiblename, $content->url, $CFG->wwwroot . '/blocks/admin_tree/item.gif', $class); } } else if (is_a($content, 'admin_category')) { if ($content->check_access() and !$content->is_hidden()) { @@ -93,7 +96,7 @@ class block_admin_tree extends block_base { global $CFG, $ADMIN; - require_once($CFG->libdir.'/adminlib.php'); + require_once($CFG->libdir.'/adminlib.php'); $adminroot = admin_get_root(); if ($this->content !== NULL) { diff --git a/theme/standard/styles_color.css b/theme/standard/styles_color.css index 78f7197be5..7a5455c692 100644 --- a/theme/standard/styles_color.css +++ b/theme/standard/styles_color.css @@ -318,6 +318,10 @@ table.flexible .r1 { color: #888; } +.block_admin_tree.sideblock .link.current { + background-color:#EEEEEE; +} + /*** *** Blocks ***/