Fixed bug #11805: IRRE does not work correctly with FE-editing
authorOliver Hader <oliver.hader@typo3.org>
Sun, 14 Mar 2010 20:28:35 +0000 (20:28 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 14 Mar 2010 20:28:35 +0000 (20:28 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7110 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms_fe.php
t3lib/jsfunc.inline.js
typo3/jsfunc.tbe_editor.js

index 38076f7..a14cc5d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Fixed bug #13283: Thumbnail generation broken for PDF files (thanks to Michael Stucki & Andy Grunwald)
        * Fixed bug #13690: Clean up class definition of frontendDoc in template.php
+       * Fixed bug #11805: IRRE does not work correctly with FE-editing (thanks to Bjoern Pedersen)
 
 2010-03-14  Jochen Rau <jochen.rau@typoplanet.de>
 
index 71fe91c..728f85d 100644 (file)
@@ -166,6 +166,9 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
        public function initializeTemplateContainer() {
                t3lib_div::requireOnce(PATH_typo3 . 'template.php');
                $GLOBALS['TBE_TEMPLATE'] = t3lib_div::makeInstance('frontendDoc');
+               $GLOBALS['TBE_TEMPLATE']->getPageRenderer()->addInlineSetting(
+                       '', 'PATH_typo3', t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')) . '/' . TYPO3_mainDir
+               );
 
                $GLOBALS['SOBE'] = new stdClass();
                $GLOBALS['SOBE']->doc = $GLOBALS['TBE_TEMPLATE'];
index b19c5cd..ba42bbe 100644 (file)
@@ -129,7 +129,7 @@ var inline = {
        makeAjaxCall: function(method, params, lock) {
                var max, url='', urlParams='', options={};
                if (method && params && params.length && this.lockAjaxMethod(method, lock)) {
-                       url = 'ajax.php';
+                       url = TBE_EDITOR.getBackendPath() + 'ajax.php';
                        urlParams = '&ajaxID=t3lib_TCEforms_inline::'+method;
                        for (var i=0, max=params.length; i<max; i++) {
                                urlParams += '&ajax['+i+']='+params[i];
index b3df55f..fb839bd 100644 (file)
@@ -566,7 +566,23 @@ var TBE_EDITOR = {
                        }
                }
                return false;
-       }       
+       },
+
+       /**
+        * Determines backend path to be used for e.g. ajax.php
+        * @return string
+        */
+       getBackendPath: function() {
+               var backendPath = '';
+               if (TYPO3) {
+                       if (TYPO3.configuration && TYPO3.configuration.PATH_typo3) {
+                               backendPath = TYPO3.configuration.PATH_typo3;
+                       } else if (TYPO3.settings && TYPO3.settings.PATH_typo3) {
+                               backendPath = TYPO3.settings.PATH_typo3;
+                       }
+               }
+               return backendPath;
+       }
 };
 
 function typoSetup     () {