diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-09-03 18:13:45 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-09-03 21:51:32 +0200 |
commit | 1a461924336f8ab227c135e13d7661b7a4f1e1df (patch) | |
tree | 3a4236425f21c926317593f444f4d4909cb2819a /lib/helper.php | |
parent | 38116c7efa2b922c2fa0eaa48eb538e8bb420f57 (diff) | |
download | nextcloud-server-1a461924336f8ab227c135e13d7661b7a4f1e1df.tar.gz nextcloud-server-1a461924336f8ab227c135e13d7661b7a4f1e1df.zip |
Add args parameter to linkTo(Absolute) function, to append the args automaticly
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/helper.php b/lib/helper.php index 3cf464dfa7b..ea43304da5f 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -32,11 +32,12 @@ class OC_Helper { * @brief Creates an url * @param $app app * @param $file file + * @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 linkTo( $app, $file ){ + public static function linkTo( $app, $file, $args = array() ){ if( $app != '' ){ $app_path = OC_App::getAppPath($app); // Check if the app is in the app folder @@ -61,6 +62,10 @@ class OC_Helper { } } + foreach($args as $k => $v) { + $urlLinkTo .= '&'.$k.'='.$v; + } + return $urlLinkTo; } @@ -68,12 +73,13 @@ class OC_Helper { * @brief Creates an absolute url * @param $app app * @param $file file + * @param $args array with param=>value, will be appended to the returned url * @returns the url * * Returns a absolute url to the given app and file. */ - public static function linkToAbsolute( $app, $file ) { - $urlLinkTo = self::linkTo( $app, $file ); + public static function linkToAbsolute( $app, $file, $args = array() ) { + $urlLinkTo = self::linkTo( $app, $file, $args ); return self::makeURLAbsolute($urlLinkTo); } |