Prettied up the permissions page a bit
[gwvp.git] / gwvplib / gwvpweb.php
index 9c08a3c..6f8c36c 100644 (file)
@@ -94,7 +94,7 @@ function gwvp_goMainPage($bodyFunction = null)
                echo "</td></tr>";
        }
        
-       echo "<tr width=\"100%\" bgcolor=\"#fff0f0\"><td>";
+       echo "<tr width=\"100%\" bgcolor=\"#ddffdd\"><td>";
        gwvp_MenuBuilder();
        echo "</td><td align=\"right\">";
        gwvp_LoginBuilder();
@@ -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,31 @@ function gwvp_MenuBuilder()
        foreach($MENU_ITEMS as $key => $val) {
                $link = $val["link"];
                $text = $val["text"];
+               
+               // TODO: redo this bit with stristr to find urls - special case for home
+               $menucolor = "";
+               if(isset($_REQUEST["q"])) {
+                       $extlink = str_replace("$BASE_URL/", "", $link);
+                       error_log("trying to do replace of $BASE_URL in $link, got $extlink for ".$_REQUEST["q"]);
+                       if(stristr($_REQUEST["q"], $extlink)!==false) {
+                               $menucolor = " bgcolor=\"#ffdddd\"";
+                               
+                       }
+               } else {
+                       // special case for home
+                       if($link == $BASE_URL) $menucolor = " bgcolor=\"#ffdddd\"";
+               }
+               
+               
+               
+               
                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>";