diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-10-27 11:58:02 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-10-27 11:58:02 +0200 |
commit | 0120f3fd629e772d9a7493e5289c1d6708ba92d5 (patch) | |
tree | dbee6eba6d11afe887a6235375119b7a6bd71b69 /lib/helper.php | |
parent | 74665faec533430be37879bfc0ef24aa7f211f6e (diff) | |
parent | beaaf5425dc2dfb7456efa934fa8eb91ac28c677 (diff) | |
download | nextcloud-server-0120f3fd629e772d9a7493e5289c1d6708ba92d5.tar.gz nextcloud-server-0120f3fd629e772d9a7493e5289c1d6708ba92d5.zip |
Merge branch 'routing'
Conflicts:
core/lostpassword/index.php
core/lostpassword/resetpassword.php
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/helper.php b/lib/helper.php index 2da06c4cc45..060d887fd67 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -29,6 +29,20 @@ class OC_Helper { private static $tmpFiles=array(); /** + * @brief Creates an url using a defined route + * @param $route + * @param $parameters + * @param $args array with param=>value, will be appended to the returned url + * @returns the url + * + * Returns a url to the given app and file. + */ + public static function linkToRoute( $route, $parameters = array() ) { + $urlLinkTo = OC::getRouter()->generate($route, $parameters); + return $urlLinkTo; + } + + /** * @brief Creates an url * @param string $app app * @param string $file file @@ -44,8 +58,8 @@ class OC_Helper { // Check if the app is in the app folder if( $app_path && file_exists( $app_path.'/'.$file )) { if(substr($file, -3) == 'php' || substr($file, -3) == 'css') { - $urlLinkTo = OC::$WEBROOT . '/?app=' . $app; - $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; + $urlLinkTo = OC::$WEBROOT . '/index.php/apps/' . $app; + $urlLinkTo .= ($file!='index.php') ? '/' . $file : ''; }else{ $urlLinkTo = OC_App::getAppWebPath($app) . '/' . $file; } |