diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-10-27 14:28:24 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-10-27 14:28:24 +0200 |
commit | 38371d12756a3d64b8381cf034ae0774b5934df1 (patch) | |
tree | 913bdd5346a76af3c06604a7a3c6fa16cd5f97fa /lib/helper.php | |
parent | 0fb707d2c90846c1231cdefac79e9b58c8351c81 (diff) | |
parent | 0c40a061e4925181101196d379137fb020924980 (diff) | |
download | nextcloud-server-38371d12756a3d64b8381cf034ae0774b5934df1.tar.gz nextcloud-server-38371d12756a3d64b8381cf034ae0774b5934df1.zip |
Merge branch 'master' into filesystem
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 aa453ad7504..6f7ada39c1d 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; } |