Outputs an indigo, red, non-clickable menu entry if action file is missing
authorRoland Häder <roland@mxchange.org>
Wed, 4 Nov 2009 11:54:37 +0000 (11:54 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 4 Nov 2009 11:54:37 +0000 (11:54 +0000)
inc/language/de.php
inc/modules/admin/admin-inc.php

index c787381d1350f753ca0ee75902e00d8844963319..4960b03aacbfc2e24af4fbd08693080bb71d2809 100644 (file)
@@ -1185,8 +1185,9 @@ addMessages(array(
 // Status changes
        'ADMIN_STATUS_CHANGED' => "Es wurden <span class=\"data\">%s</span> von <span class=\"data\">%s</span> Eintr&auml;gen ge&auml;ndert.",
 
-// Missing menu whats
-       'MENU_WHAT_404' => "Men&uuml; deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
+// Missing menu entries
+       'MENU_ACTION_404' => "Hauptmen&uuml; deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
+       'MENU_WHAT_404' => "Untermen&uuml; deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.",
 
 // Cache messages
        'CACHE_PROBLEMS_DETECTED' => "Probleme mit dem Cache-Subsystem erkannt.",
index db07ff35968b8cbb59178f0ba959cbe33d2f0bd1..a7d42b877d5df5efa802501b88898b045e510ca7 100644 (file)
@@ -343,6 +343,8 @@ WHERE
 ORDER BY
        `sort` ASC,
        `id` DESC", __FUNCTION__, __LINE__);
+
+       // Do we have entries?
        if (SQL_NUMROWS($result_main) > 0) {
                $OUT = "<div style=\"height:7px\" class=\"seperator\">&nbsp;</div>\n";
                $OUT .= "<ul class=\"admin_menu_main\">\n";
@@ -355,6 +357,12 @@ ORDER BY
                                $ACL = true;
                        }
 
+                       // Filename
+                       $inc = sprintf("inc/modules/admin/action-%s.php", $menu);
+
+                       // Is the file readable?
+                       $readable = isIncludeReadable($inc);
+
                        if ($ACL === true) {
                                if ($SUB === false) {
                                        // Insert compiled menu title and description
@@ -364,18 +372,26 @@ ORDER BY
                                $OUT .= "<li class=\"admin_menu\">
 <div class=\"nobr\"><strong>&middot;</strong>&nbsp;";
 
-                               if (($menu == $action) && (empty($what))) {
-                                       $OUT .= "<strong>";
+                               if ($readable === true) {
+                                       if (($menu == $action) && (empty($what))) {
+                                               $OUT .= "<strong>";
+                                       } else {
+                                               $OUT .= "[<a href=\"{?URL?}/modules.php?module=admin&amp;action=".$menu."\">";
+                                       }
                                } else {
-                                       $OUT .= "[<a href=\"{?URL?}/modules.php?module=admin&amp;action=".$menu."\">";
+                                       $OUT .= "<em style=\"cursor:help\" class=\"admin_note\" title=\"{--MENU_ACTION_404--}\">";
                                }
 
                                $OUT .= $title;
 
-                               if (($menu == $action) && (empty($what))) {
-                                       $OUT .= "</strong>";
+                               if ($readable === true) {
+                                       if (($menu == $action) && (empty($what))) {
+                                               $OUT .= "</strong>";
+                                       } else {
+                                               $OUT .= "</a>]";
+                                       }
                                } else {
-                                       $OUT .= "</a>]";
+                                       $OUT .= "</em>";
                                }
 
                                $OUT .= "</div>