summaryrefslogtreecommitdiffstats
path: root/web/lib/routing.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib/routing.inc.php')
-rw-r--r--web/lib/routing.inc.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/web/lib/routing.inc.php b/web/lib/routing.inc.php
index 0d940a2..e8a2deb 100644
--- a/web/lib/routing.inc.php
+++ b/web/lib/routing.inc.php
@@ -17,6 +17,8 @@ $ROUTES = array(
'/addvote' => 'addvote.php',
);
+$PKG_PATH = '/packages';
+
function get_route($path) {
global $ROUTES;
@@ -37,3 +39,19 @@ function get_uri($path) {
return get_route($path);
}
}
+
+function get_pkg_route() {
+ global $PKG_PATH;
+ return $PKG_PATH;
+}
+
+function get_pkg_uri($pkgname) {
+ global $USE_VIRTUAL_URLS;
+ global $PKG_PATH;
+
+ if ($USE_VIRTUAL_URLS) {
+ return $PKG_PATH . '/' . urlencode($pkgname) . '/';
+ } else {
+ return get_route($PKG_PATH) . '?N=' . urlencode($pkgname);
+ }
+}