[Pkg-owncloud-commits] [owncloud] 51/67: core.js and core.css don't need to be absolute

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:10:43 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.1
in repository owncloud.

commit f47c64cec696dcd870432c0f4e6d49ca1d10fec2
Author: Bart Visscher <bartv at thisnet.nl>
Date:   Wed Oct 17 10:52:16 2012 +0200

    core.js and core.css don't need to be absolute
---
 lib/helper.php         |   13 ++++++++++++-
 lib/templatelayout.php |    4 ++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/lib/helper.php b/lib/helper.php
index 908a61b..2753d69 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 c898628..715b68c 100644
--- a/lib/templatelayout.php
+++ b/lib/templatelayout.php
@@ -50,7 +50,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];
@@ -63,7 +63,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];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list