I really should just focus on something and finish that one thing
authorpaulr <me@pjr.cc>
Mon, 7 Nov 2011 11:18:20 +0000 (22:18 +1100)
committerpaulr <me@pjr.cc>
Mon, 7 Nov 2011 11:18:20 +0000 (22:18 +1100)
before moving onto some other bits of code.
added some menu colours
added some config dialog
added some repo config dialog

gwvplib/gwvpweb.php

index 476a850..c88e302 100644 (file)
@@ -147,7 +147,7 @@ function gwvp_MessageBuilder()
 // builds the menu structure
 function gwvp_MenuBuilder()
 {
-       global $MENU_ITEMS;
+       global $MENU_ITEMS, $BASE_URL;
        
        ksort($MENU_ITEMS);
        
@@ -155,13 +155,21 @@ function gwvp_MenuBuilder()
        foreach($MENU_ITEMS as $key => $val) {
                $link = $val["link"];
                $text = $val["text"];
+               $q = "";
+               if(isset($_REQUEST["q"])) $q = $BASE_URL."/".$_REQUEST["q"];
+               else $q = $BASE_URL;
+               if($q == $link) $menucolor = " bgcolor=\"#ffdddd\"";
+               else $menucolor = "";
+               
+               error_log("checking $q against $link now $menucolor");
+               
                if(isset($val["userlevel"])) {
                        if(gwvp_CheckAuthLevel($val["userlevel"])) {
-                               echo "<td><a href=\"$link\">$text</a></td>";
+                               echo "<td$menucolor><a href=\"$link\">$text</a></td>";
                        }
                        
                } else {
-                       echo "<td><a href=\"$link\">$text</a></td>";
+                       echo "<td$menucolor><a href=\"$link\">$text</a></td>";
                }
        }
        echo "</tr></table>";