Skip to content
Snippets Groups Projects
Commit 2098cbd8 authored by Aamir Khan's avatar Aamir Khan
Browse files

redirect_url to be respected in linkTo function

parent 7d2784c4
No related branches found
No related tags found
No related merge requests found
lib/helper.php 100644 → 100755
......@@ -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;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment