summaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-27 14:28:24 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-27 14:28:24 +0200
commit38371d12756a3d64b8381cf034ae0774b5934df1 (patch)
tree913bdd5346a76af3c06604a7a3c6fa16cd5f97fa /lib/helper.php
parent0fb707d2c90846c1231cdefac79e9b58c8351c81 (diff)
parent0c40a061e4925181101196d379137fb020924980 (diff)
downloadnextcloud-server-38371d12756a3d64b8381cf034ae0774b5934df1.tar.gz
nextcloud-server-38371d12756a3d64b8381cf034ae0774b5934df1.zip
Merge branch 'master' into filesystem
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php18
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;
}