diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-10-17 10:52:16 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-10-17 10:52:16 +0200 |
commit | 04824162d9230faaf0992b3b0e3e52e01011bf78 (patch) | |
tree | 9ceea8c91827abacede21fd1962cbe80d12018ef | |
parent | d5e91216b526f2ff57b1321c6c40685c669bb78f (diff) | |
download | nextcloud-server-04824162d9230faaf0992b3b0e3e52e01011bf78.tar.gz nextcloud-server-04824162d9230faaf0992b3b0e3e52e01011bf78.zip |
core.js and core.css don't need to be absolute
-rw-r--r-- | lib/helper.php | 13 | ||||
-rw-r--r-- | lib/templatelayout.php | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/helper.php b/lib/helper.php index 2c221ddf195..a52adc96958 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -101,6 +101,17 @@ class OC_Helper { } /** + * @brief Creates an url for remote use + * @param string $service id + * @return string the url + * + * Returns a url to the given service. + */ + public static function linkToRemoteBase( $service ) { + return self::linkTo( '', 'remote.php') . '/' . $service; + } + + /** * @brief Creates an absolute url for remote use * @param string $service id * @return string the url @@ -108,7 +119,7 @@ class OC_Helper { * Returns a absolute url to the given service. */ public static function linkToRemote( $service, $add_slash = true ) { - return self::linkToAbsolute( '', 'remote.php') . '/' . $service . (($add_slash && $service[strlen($service)-1]!='/')?'/':''); + return self::makeURLAbsolute(self::linkToRemoteBase($service)) . (($add_slash && $service[strlen($service)-1]!='/')?'/':''); } /** diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 4f26775b48e..78893457f47 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -49,7 +49,7 @@ class OC_TemplateLayout extends OC_Template { $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (!empty(OC_Util::$core_scripts)) { - $this->append( 'jsfiles', OC_Helper::linkToRemote('core.js', false)); + $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false)); } foreach($jsfiles as $info) { $root = $info[0]; @@ -62,7 +62,7 @@ class OC_TemplateLayout extends OC_Template { $cssfiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); if (!empty(OC_Util::$core_styles)) { - $this->append( 'cssfiles', OC_Helper::linkToRemote('core.css', false)); + $this->append( 'cssfiles', OC_Helper::linkToRemoteBase('core.css', false)); } foreach($cssfiles as $info) { $root = $info[0]; |