diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-05 02:06:54 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-04-05 12:21:36 +0200 |
commit | f7d13b5b368f1432b9a1eb1798f94a70b9dc03b7 (patch) | |
tree | 5f6c1980ce15a5ddacba66bd80cbac9f5d6d4e24 /web/lib/routing.inc.php | |
parent | fb81bfd8dff66073de6704c1880fb921e58ef137 (diff) | |
download | aur-f7d13b5b368f1432b9a1eb1798f94a70b9dc03b7.tar.gz aur-f7d13b5b368f1432b9a1eb1798f94a70b9dc03b7.tar.xz |
Add package base detail pages
This adds package base details pages, similar to the package details
pages. Each package base details page contains general information
(package base name, category, submitter, maintainer, ...) and links to
all the corresponding packages. As on the package details pages,
comments and links to several package actions are also provided.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/routing.inc.php')
-rw-r--r-- | web/lib/routing.inc.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/web/lib/routing.inc.php b/web/lib/routing.inc.php index b1e5be2b..1b2aa52b 100644 --- a/web/lib/routing.inc.php +++ b/web/lib/routing.inc.php @@ -4,6 +4,7 @@ $ROUTES = array( '' => 'home.php', '/index.php' => 'home.php', '/packages' => 'packages.php', + '/pkgbase' => 'pkgbase.php', '/register' => 'account.php', '/account' => 'account.php', '/accounts' => 'account.php', @@ -18,6 +19,7 @@ $ROUTES = array( ); $PKG_PATH = '/packages'; +$PKGBASE_PATH = '/pkgbase'; $USER_PATH = '/account'; function get_route($path) { @@ -47,6 +49,11 @@ function get_pkg_route() { return $PKG_PATH; } +function get_pkgbase_route() { + global $PKGBASE_PATH; + return $PKGBASE_PATH; +} + function get_pkg_uri($pkgname) { global $USE_VIRTUAL_URLS; global $PKG_PATH; @@ -59,7 +66,14 @@ function get_pkg_uri($pkgname) { } function get_pkgbase_uri($pkgbase_name) { - return get_pkg_uri($pkgbase_name); + global $USE_VIRTUAL_URLS; + global $PKGBASE_PATH; + + if ($USE_VIRTUAL_URLS) { + return $PKGBASE_PATH . '/' . urlencode($pkgbase_name) . '/'; + } else { + return '/' . get_route($PKGBASE_PATH) . '?N=' . urlencode($pkgbase_name); + } } function get_user_route() { |