コード例 #1
0
ファイル: router.php プロジェクト: matthisamoto/Graphfan
            $ga->cacheInformation();
        } catch (Exception $e) {
            // We should log this in 4.1
        }
    }
}
// Normal page routing.
$ispage = false;
$inc = false;
$primary_route = $bigtree["path"][1];
$module_path = array_slice($bigtree["path"], 1);
// Check custom
list($inc, $commands) = BigTree::route(SERVER_ROOT . "custom/admin/modules/", $module_path);
// Check core if we didn't find the page or if we found the page but it had commands (because we may be overriding a page earlier in the chain but using the core further down)
if (!$inc || count($commands)) {
    list($core_inc, $core_commands) = BigTree::route(SERVER_ROOT . "core/admin/modules/", $module_path);
    // If we either never found the custom file or if there are more routes found in the core file use the core.
    if (!$inc || $inc && $core_inc && count($core_commands) < count($commands)) {
        $inc = $core_inc;
        $commands = $core_commands;
    }
}
if (count($commands)) {
    $bigtree["module_path"] = array_slice($module_path, 1, -1 * count($commands));
} else {
    $bigtree["module_path"] = array_slice($module_path, 1);
}
// Check pages
if (!$inc) {
    $inc = BigTree::path("admin/pages/{$primary_route}.php");
    if (file_exists($inc)) {
コード例 #2
0
ファイル: router.php プロジェクト: kalle0045/BigTree-CMS
 }
 // If the template is a module, do its routing for it, otherwise just include the template.
 if ($routed) {
     // Allow the homepage to be routed
     if ($bigtree["page"]["path"]) {
         $path_components = explode("/", substr(implode("/", $bigtree["path"]) . "/", strlen($bigtree["page"]["path"] . "/")));
     } else {
         $path_components = $bigtree["path"];
     }
     if (end($path_components) === "") {
         array_pop($path_components);
     }
     if ($extension) {
         list($inc, $commands) = BigTree::route(SERVER_ROOT . "extensions/{$extension}/templates/routed/{$template}/", $path_components);
     } else {
         list($inc, $commands) = BigTree::route(SERVER_ROOT . "templates/routed/" . $bigtree["page"]["template"] . "/", $path_components);
     }
     $bigtree["routed_inc"] = $inc;
     $bigtree["commands"] = $commands;
     if (count($commands)) {
         $bigtree["routed_path"] = $bigtree["module_path"] = array_slice($path_components, 0, -1 * count($commands));
     } else {
         $bigtree["routed_path"] = $bigtree["module_path"] = array_slice($path_components, 0);
     }
     // Get the pieces of the location so we can get header and footers. Take away the first 2 routes since they're templates/routed/.
     $pieces = array_slice(explode("/", str_replace(SERVER_ROOT, "", $inc)), 2);
     if ($extension) {
         $pieces = array_slice($pieces, 2);
     }
     // Include all headers in the module directory in the order they occur.
     $inc_path = "";