acollab fix: a module that has custom priv but no Manage page
authorjoel kronenberg <joel.kronenberg@utoronto.ca>
Wed, 7 Dec 2005 16:17:29 +0000 (16:17 -0000)
committerjoel kronenberg <joel.kronenberg@utoronto.ca>
Wed, 7 Dec 2005 16:17:29 +0000 (16:17 -0000)
docs/tools/index.php

index 328a109..755e0fd 100644 (file)
@@ -24,16 +24,17 @@ echo '<ol id="tools">';
 foreach ($keys as $module_name) {
        $module =& $module_list[$module_name];
        if ($module->getPrivilege() && authenticate($module->getPrivilege(), AT_PRIV_RETURN)) {
-               $parent = $module->getChildPage('tools/index.php');
-               echo '<li class="top-tool"><a href="' . $parent . '">' . $module->getName() . '</a>';
-               if ($_pages[$parent]['children']) {
-                       echo '<ul class="child-top-tool">';
-                       foreach ($_pages[$parent]['children'] as $child) {
-                               echo '<li class="child-tool"><a href="'.$child.'">'._AT($_pages[$child]['title_var']).'</li>';
+               if ($parent = $module->getChildPage('tools/index.php')) {
+                       echo '<li class="top-tool"><a href="' . $parent . '">' . $module->getName() . '</a>';
+                       if ($_pages[$parent]['children']) {
+                               echo '<ul class="child-top-tool">';
+                               foreach ($_pages[$parent]['children'] as $child) {
+                                       echo '<li class="child-tool"><a href="'.$child.'">'._AT($_pages[$child]['title_var']).'</li>';
+                               }
+                               echo '</ul>';
                        }
-                       echo '</ul>';
+                       echo '</li>';
                }
-               echo '</li>';
        }
 }
 echo '</ol>';