Follow-up 2 to bug #12017: Respect full path of CSS inclusion (RTE)
authorSteffen Kamper <info@sk-typo3.de>
Wed, 23 Sep 2009 07:35:10 +0000 (07:35 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 23 Sep 2009 07:35:10 +0000 (07:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6035 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tceforms_fe.php

index 489e436..0ba8c22 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-23  Steffen Kamper  <info@sk-typo3.de>
+
+       * Follow-up 2 to bug #12017: Respect full path of CSS inclusion (RTE)
+
 2009-09-22  Oliver Hader  <oliver@typo3.org>
 
        * Reverted bugfix #9599: felogin - forget password action and logout action are still cached
index 60b5c26..7d5e97b 100644 (file)
@@ -5252,7 +5252,7 @@ class t3lib_TCEforms      {
 
                                // make textareas resizable and flexible
                        if (!($GLOBALS['BE_USER']->uc['resizeTextareas'] == '0' && $GLOBALS['BE_USER']->uc['resizeTextareas_Flexible'] == '0')) {
-                               $GLOBALS['SOBE']->doc->addStyleSheet('ext.resizable', '../t3lib/js/extjs/ux/resize.css');
+                               $pageRenderer->addCssFile($this->backPath . '../t3lib/js/extjs/ux/resize.css');
                                $this->loadJavascriptLib('../t3lib/js/extjs/ux/ext.resizable.js');
                        }
                        $resizableSettings = array(
index 8c853d7..3cad7cb 100644 (file)
@@ -138,7 +138,7 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
        public function loadJavascriptLib($lib) {
                /** @var $pageRenderer t3lib_PageRenderer */
                $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
-               $pageRenderer->addJsLibrary($lib, $this->backPath . $lib);
+               $pageRenderer->addJsLibrary($lib, $this->prependBackPath($lib));
                
        }
 
@@ -154,7 +154,7 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
        public function addStyleSheet($key, $href, $title='', $relation='stylesheet') {
                /** @var $pageRenderer t3lib_PageRenderer */
                $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
-               $pageRenderer->addCssFile($this->backPath . $href, $relation, 'screen', $title);
+               $pageRenderer->addCssFile($this->prependBackPath($href), $relation, 'screen', $title);
         }
 
        /**
@@ -170,6 +170,21 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
                $GLOBALS['SOBE'] = new stdClass();
                $GLOBALS['SOBE']->doc = $GLOBALS['TBE_TEMPLATE'];
        }
+
+       /**
+        * Prepends backPath to given URL if it's not an absolute URL
+        * 
+        * @param string $url
+        * @return string
+        */
+       private function prependBackPath($url) {
+               if (strpos($url, '://') !== FALSE || substr($url, 0, 1) === '/') {
+                       return $url;
+               } else {
+                       return $this->backPath . $url;
+               }
+               
+       }
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']) {