Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
2098cbd8
Commit
2098cbd8
authored
13 years ago
by
Aamir Khan
Browse files
Options
Downloads
Patches
Plain Diff
redirect_url to be respected in linkTo function
parent
7d2784c4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/helper.php
+12
-5
12 additions, 5 deletions
lib/helper.php
with
12 additions
and
5 deletions
lib/helper.php
100644 → 100755
+
12
−
5
View file @
2098cbd8
...
...
@@ -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
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment