示例#1
0
function jabRouteAuth($auth)
{
    jabSetRouteHandlerPath(dirname(__FILE__));
    jabRoute("get;post", $auth['routePrefix'] . "/login", "auth_controller.php", "login_{httpmethod}", $auth);
    jabRoute("get", $auth['routePrefix'] . "/logout", "auth_controller.php", "logout", $auth);
    jabSetRouteHandlerPath(NULL);
}
示例#2
0
function jabRouteEditor($editor)
{
    jabSetAuthContext("editor");
    jabSetRouteHandlerPath(dirname(__FILE__));
    jabRoute("get;post", $editor['routePrefix'], "editor_controller.php", "editor_{httpmethod}", $editor);
    jabSetRouteHandlerPath(null);
    jabSetAuthContext(null);
}
示例#3
0
文件: auth.php 项目: RedBlueThing/jab
function jabRouteAuth($auth)
{
    jabSetRouteHanderPath(dirname(__FILE__));
    jabRoute("get;post", $auth['routePrefix'] . "/login", "auth_controller.php", "login_{httpmethod}", $auth);
    jabRoute("get", $auth['routePrefix'] . "/logout", "auth_controller.php", "logout", $auth);
    jabRoute("get;post", $auth['routePrefix'] . "/register", "auth_controller.php", "register_{httpmethod}", $auth);
    jabRoute("get;post", $auth['routePrefix'] . "/settings", "auth_controller.php", "settings_{httpmethod}", $auth);
    jabRoute("get", $auth['routePrefix'] . "/activate/{username}/{activationId}", "auth_controller.php", "activate", $auth);
    jabSetRouteHanderPath(NULL);
}
示例#4
0
文件: blog.php 项目: RedBlueThing/jab
function jabRouteBlog($blog)
{
    jabSetAuthContext("blog");
    jabSetRouteHandlerPath(dirname(__FILE__));
    jabRoute("get", $blog['routePrefix'] . "/index/{page}", "blog_controller.php", "index", $blog);
    jabRoute("get", $blog['routePrefix'] . "/fullindex", "blog_controller.php", "fullindex", $blog);
    jabRoute("get", $blog['routePrefix'] . "/drafts", "blog_controller.php", "drafts", $blog);
    jabRoute("get", $blog['routePrefix'] . "/edit/new", "blog_controller.php", "new_post", $blog);
    jabRoute("get", $blog['routePrefix'] . "/edit/{id}", "blog_controller.php", "edit_article_get", $blog);
    jabRoute("post", $blog['routePrefix'] . "/edit/{id}", "blog_controller.php", "edit_article_post", $blog);
    jabRoute("get;post", $blog['routePrefix'] . "/delete/{id}", "blog_controller.php", "delete_post_{httpmethod}", $blog);
    jabRoute("get;post", $blog['routePrefix'] . "/posts/{id}/*", "blog_controller.php", "view_post_{httpmethod}", $blog);
    jabRoute("get", $blog['routePrefix'] . "/comments/accept/{articleid}/{commentid}", "blog_controller.php", "accept_comment", $blog);
    jabRoute("get", $blog['routePrefix'] . "/comments/reject/{articleid}/{commentid}", "blog_controller.php", "reject_comment", $blog);
    jabRoute("get", $blog['routePrefix'] . "/comments/delete/{articleid}/{commentid}", "blog_controller.php", "delete_comment", $blog);
    jabRoute("get", $blog['routePrefix'] . "/feed.rss", "blog_controller.php", "get_rss_feed", $blog);
    jabRoute("get", $blog['routePrefix'] . "/index.rss", "blog_controller.php", "get_rss_feed", $blog);
    jabRoute("get", $blog['routePrefix'] . "/export", "blog_controller.php", "get_export", $blog);
    jabRoute("get;post", $blog['routePrefix'] . "/import", "blog_controller.php", "import_{httpmethod}", $blog);
    jabRoute("get", $blog['routePrefix'] . "/upgrade", "blog_controller.php", "upgrade", $blog);
    jabRouteStaticContent($blog['routePrefix'], $blog['uploadfolder']);
    jabSetRouteHandlerPath(null);
    jabSetAuthContext(null);
}
示例#5
0
function jabRouteStaticContent($routePrefix, $contentRoot)
{
    $routeData['contentRoot'] = $contentRoot;
    $routeData['routePrefix'] = $routePrefix;
    if (strlen($routePrefix) == 0) {
        $routePrefix = "*";
    } else {
        $routePrefix .= "/*";
    }
    jabRoute("get", $routePrefix, null, "jabDoRouteStaticContent", $routeData);
}
示例#6
0
function jabRouteContact($contact)
{
    jabSetRouteHandlerPath(dirname(__FILE__));
    jabRoute("get;post", $contact['routePrefix'], "contact_controller.php", "contact_{httpmethod}", $contact);
    jabSetRouteHandlerPath(null);
}