summaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorAamir Khan <ak4u2009@gmail.com>2011-06-25 01:14:28 +0530
committerAamir Khan <ak4u2009@gmail.com>2011-06-25 01:14:28 +0530
commit2098cbd8222fe7657fec5538798426495a9b9888 (patch)
tree958e83d190d702a8077ef5c1854a3486c8f8fd75 /lib/helper.php
parent7d2784c4c3145c8dcf15fb357f2325ae29d65717 (diff)
downloadnextcloud-server-2098cbd8222fe7657fec5538798426495a9b9888.tar.gz
nextcloud-server-2098cbd8222fe7657fec5538798426495a9b9888.zip
redirect_url to be respected in linkTo function
Diffstat (limited to 'lib/helper.php')
-rwxr-xr-x[-rw-r--r--]lib/helper.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/helper.php b/lib/helper.php
index 8cd6ebf75a5..96d5bfad826 100644..100755
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -29,11 +29,12 @@ class OC_HELPER {
* @brief Creates an url
* @param $app app
* @param $file file
+ * @param $redirect_url redirect_url variable is appended to the URL
* @returns the url
*
* Returns a url to the given app and file.
*/
- public static function linkTo( $app, $file ){
+ public static function linkTo( $app, $file , $redirect_url=NULL ){
global $WEBROOT;
global $SERVERROOT;
@@ -41,20 +42,26 @@ class OC_HELPER {
$app .= '/';
// Check if the app is in the app folder
if( file_exists( $SERVERROOT . '/apps/'. $app.$file )){
- return $WEBROOT . '/apps/' . $app . $file;
+ $urlLinkTo = $WEBROOT . '/apps/' . $app . $file;
}
else{
- return $WEBROOT . '/' . $app . $file;
+ $urlLinkTo = $WEBROOT . '/' . $app . $file;
}
}
else{
if( file_exists( $SERVERROOT . '/core/'. $file )){
- return $WEBROOT . '/core/'.$file;
+ $urlLinkTo = $WEBROOT . '/core/'.$file;
}
else{
- return $WEBROOT . '/'.$file;
+ $urlLinkTo = $WEBROOT . '/'.$file;
}
}
+
+ if($redirect_url)
+ return $urlLinkTo.'?redirect_url='.$redirect_url;
+ else
+ return $urlLinkTo;
+
}
/**