From f7d13b5b368f1432b9a1eb1798f94a70b9dc03b7 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 5 Apr 2014 02:06:54 +0200 Subject: 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 --- web/lib/routing.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'web/lib/routing.inc.php') 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() { -- cgit v1.2.3-24-g4f1b