]> git.mjollnir.org Git - moodle.git/commitdiff
Highlight the currently selected admin menu 8-)
authormoodler <moodler>
Mon, 2 Oct 2006 06:37:58 +0000 (06:37 +0000)
committermoodler <moodler>
Mon, 2 Oct 2006 06:37:58 +0000 (06:37 +0000)
blocks/admin_tree/block_admin_tree.php
theme/standard/styles_color.css

index 95dd95f4dde7fb0e93c1a03c7f2f8dc9c9aa0c4d..d6ad1b92be8dbc18490465e957823336ead6aad5 100644 (file)
@@ -46,23 +46,26 @@ class block_admin_tree extends block_base {
         $this->tempcontent .= "</span>\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 .= "&nbsp;&nbsp;&nbsp;";
         }
-        $this->tempcontent .= '<a href="' . $link . '"><img src="' . $icon . '" border="0" alt="[item]" /> ' . $visiblename . '</a><br />' . "\n";
+        $this->tempcontent .= '<a class="'.$class.'" href="'.$link.'"><img src="'.$icon.'" border="0" alt="[item]" />'.
+                               $visiblename.'</a><br />'."\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) {
index 78f7197be583184b3d0ebe7ce9035b77c694e405..7a5455c692052ff7b027c1e8dc109dd4440dcfa7 100644 (file)
@@ -318,6 +318,10 @@ table.flexible .r1 {
     color: #888;
 }
 
+.block_admin_tree.sideblock .link.current {
+  background-color:#EEEEEE;
+}
+
 /***
  *** Blocks
  ***/