summaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-27 15:46:05 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-27 20:37:38 -0400
commit0a9d1ed3a645efda56ae757f45aa7efb5a35ce4f (patch)
treea2fbdc55f42a149c8a5e738763ce731e9c55f6dc /lib/helper.php
parent8374a49cc19cf43489a415388fd782ba1574ee82 (diff)
downloadnextcloud-server-0a9d1ed3a645efda56ae757f45aa7efb5a35ce4f.tar.gz
nextcloud-server-0a9d1ed3a645efda56ae757f45aa7efb5a35ce4f.zip
Initial previewer for public links
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php
index 8c362747a27..3cf464dfa7b 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -101,6 +101,17 @@ class OC_Helper {
}
/**
+ * @brief Creates an absolute url for public use
+ * @param $service id
+ * @returns the url
+ *
+ * Returns a absolute url to the given service.
+ */
+ public static function linkToPublic($service, $add_slash = false) {
+ return self::linkToAbsolute( '', 'public.php') . '?service=' . $service . (($add_slash && $service[strlen($service)-1]!='/')?'/':'');
+ }
+
+ /**
* @brief Creates path to an image
* @param $app app
* @param $image image name