示例#1
0
 if ($module && !$admin->checkAccess($module["id"])) {
     $admin->stop(file_get_contents(BigTree::path("admin/pages/_denied.php")));
 } elseif ($module) {
     $bigtree["in_module"] = true;
     // Append module navigation.
     $actions = $admin->getModuleActions($module);
     // Append module info to the admin nav to draw the headers and breadcrumb and such.
     $bigtree["nav_tree"]["auto-module"] = array("title" => $module["name"], "link" => $module["route"], "icon" => "modules", "children" => array());
     foreach ($actions as $action) {
         $hidden = $action["in_nav"] ? false : true;
         $route = $action["route"] ? $module["route"] . "/" . $action["route"] : $module["route"];
         $bigtree["nav_tree"]["auto-module"]["children"][] = array("title" => $action["name"], "link" => $route, "nav_icon" => $action["class"], "hidden" => $hidden, "level" => $action["level"]);
     }
     // Bring in related modules if this one is in a group.
     if ($module["group"]) {
         $related_modules = $admin->getModulesByGroup($module["group"]);
         $related_group = $admin->getModuleGroup($module["group"]);
         if (count($related_modules) > 1) {
             $bigtree["related_modules"] = array();
             $bigtree["related_group"] = $related_group["name"];
             foreach ($related_modules as $rm) {
                 $bigtree["related_modules"][] = array("title" => $rm["name"], "link" => $rm["route"]);
             }
         }
     }
     // Give modules their information.
     $bigtree["module"] = $module;
     define("MODULE_ROOT", ADMIN_ROOT . $module["route"] . "/");
 }
 $route_response = $admin->getModuleActionByRoute($module["id"], array_slice($bigtree["path"], 2));
 if ($route_response) {