示例#1
0
        $ispage = true;
    } else {
        $inc = false;
    }
}
$bigtree["in_module"] = false;
// If this is a module or an auto module, check permissions on it.
if (!$ispage || !$inc) {
    $bigtree["current_module"] = $module = $admin->getModuleByRoute($primary_route);
    // If this is a module and the user doesn't have access, include the denied page and stop.
    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) {