fixed bug #6885: Nested USER_INT, COA_INT, etc. objects are not rendered, credits...
authorIngo Renner <ingo.renner@typo3.org>
Fri, 22 Feb 2008 20:35:06 +0000 (20:35 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Fri, 22 Feb 2008 20:35:06 +0000 (20:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3265 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/index_ts.php
typo3/sysext/cms/tslib/publish.php

index ba14430..9a5a680 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
        * added feature #7592: Enable tabs for be_users, credits Francois Suter
        * added feature #6846: enable Tabs in tt_content, credits Steffen Kamper
        * fixed bug #7608: Keys for clear-cache labels must be renamed
+       * fixed bug #6885: Nested USER_INT, COA_INT, etc. objects are not rendered, credits Oliver Hader
 
 2008-02-22  Benjamin Mack  <mack@xnos.org>
 
index 7c1008f..8416382 100755 (executable)
@@ -2936,12 +2936,6 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
         * @return      void
         */
        function INTincScript() {
-               $GLOBALS['TT']->push('Split content');
-               $INTiS_splitC = explode('<!--INT_SCRIPT.',$this->content);                      // Splits content with the key.
-               $this->content='';
-               $GLOBALS['TT']->setTSlogMessage('Parts: '.count($INTiS_splitC));
-               $GLOBALS['TT']->pull();
-
                        // Deprecated stuff:
                $this->additionalHeaderData = is_array($this->config['INTincScript_ext']['additionalHeaderData']) ? $this->config['INTincScript_ext']['additionalHeaderData'] : array();
                $this->additionalJavaScript = $this->config['INTincScript_ext']['additionalJavaScript'];
@@ -2950,7 +2944,64 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
                $this->JSImgCode = $this->additionalHeaderData['JSImgCode'];
                $this->divSection='';
 
-               $INTiS_config = $GLOBALS['TSFE']->config['INTincScript'];
+               do {
+                       $INTiS_config = $GLOBALS['TSFE']->config['INTincScript'];
+                       $this->INTincScript_includeLibs($INTiS_config);
+                       $this->INTincScript_process($INTiS_config);
+                               // Check if there were new items added to INTincScript during the previos execution:
+                       $INTiS_config = array_diff_assoc($GLOBALS['TSFE']->config['INTincScript'], $INTiS_config);
+                       $reprocess = (count($INTiS_config) ? true : false);
+               } while($reprocess);
+
+               $GLOBALS['TT']->push('Substitute header section');
+               $this->INTincScript_loadJSCode();
+               $this->content = str_replace('<!--HD_'.$this->config['INTincScript_ext']['divKey'].'-->', $this->convOutputCharset(implode(chr(10),$this->additionalHeaderData),'HD'), $this->content);
+               $this->content = str_replace('<!--TDS_'.$this->config['INTincScript_ext']['divKey'].'-->', $this->convOutputCharset($this->divSection,'TDS'), $this->content);
+               $this->setAbsRefPrefix();
+               $GLOBALS['TT']->pull();
+       }
+
+       /**
+        * Include libraries for uncached objects.
+        *
+        * @param       array           $INTiS_config: $GLOBALS['TSFE']->config['INTincScript'] or part of it
+        * @return      void
+        * @see         INTincScript()
+        */
+       protected function INTincScript_includeLibs($INTiS_config) {
+               $GLOBALS['TT']->push('Include libraries');
+               foreach($INTiS_config as $INTiS_cPart)  {
+                       if ($INTiS_cPart['conf']['includeLibs'])        {
+                               $INTiS_resourceList = t3lib_div::trimExplode(',', $INTiS_cPart['conf']['includeLibs'],1);
+                               $GLOBALS['TT']->setTSlogMessage('Files for inclusion: "'.implode(', ', $INTiS_resourceList).'"');
+
+                               foreach($INTiS_resourceList as $INTiS_theLib)   {
+                                       $INTiS_incFile = $this->tmpl->getFileName($INTiS_theLib);
+                                       if ($INTiS_incFile)     {
+                                               require_once('./'.$INTiS_incFile);
+                                       } else {
+                                               $GLOBALS['TT']->setTSlogMessage('Include file "'.$INTiS_theLib.'" did not exist!', 2);
+                                       }
+                               }
+                       }
+               }
+               $GLOBALS['TT']->pull();
+       }
+
+       /**
+        * Processes the INTinclude-scripts and substitue in content.
+        *
+        * @param       array           $INTiS_config: $GLOBALS['TSFE']->config['INTincScript'] or part of it
+        * @return      void
+        * @see         INTincScript()
+        */
+       protected function INTincScript_process($INTiS_config)  {
+               $GLOBALS['TT']->push('Split content');
+               $INTiS_splitC = explode('<!--INT_SCRIPT.',$this->content);                      // Splits content with the key.
+               $this->content='';
+               $GLOBALS['TT']->setTSlogMessage('Parts: '.count($INTiS_splitC));
+               $GLOBALS['TT']->pull();
+
                foreach($INTiS_splitC as $INTiS_c => $INTiS_cPart)      {
                        if (substr($INTiS_cPart,32,3)=='-->')   {       // If the split had a comment-end after 32 characters it's probably a split-string
                                $INTiS_key = 'INT_SCRIPT.'.substr($INTiS_cPart,0,32);
@@ -2981,12 +3032,6 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
                                $this->content.= ($INTiS_c?'<!--INT_SCRIPT.':'').$INTiS_cPart;
                        }
                }
-               $GLOBALS['TT']->push('Substitute header section');
-               $this->INTincScript_loadJSCode();
-               $this->content = str_replace('<!--HD_'.$this->config['INTincScript_ext']['divKey'].'-->', $this->convOutputCharset(implode(chr(10),$this->additionalHeaderData),'HD'), $this->content);
-               $this->content = str_replace('<!--TDS_'.$this->config['INTincScript_ext']['divKey'].'-->', $this->convOutputCharset($this->divSection,'TDS'), $this->content);
-               $this->setAbsRefPrefix();
-               $GLOBALS['TT']->pull();
        }
 
        /**
index a2c42a2..f62f822 100755 (executable)
@@ -449,26 +449,6 @@ $TT->pull();
 // *******************************
 if ($TSFE->isINTincScript())           {
        $TT->push('Non-cached objects','');
-               $INTiS_config = $TSFE->config['INTincScript'];
-
-                       // Special feature: Include libraries
-               $TT->push('Include libraries');
-               foreach($INTiS_config as $INTiS_cPart)  {
-                       if ($INTiS_cPart['conf']['includeLibs'])        {
-                               $INTiS_resourceList = t3lib_div::trimExplode(',',$INTiS_cPart['conf']['includeLibs'],1);
-                               $TT->setTSlogMessage('Files for inclusion: "'.implode(', ',$INTiS_resourceList).'"');
-
-                               foreach($INTiS_resourceList as $INTiS_theLib)   {
-                                       $INTiS_incFile = $TSFE->tmpl->getFileName($INTiS_theLib);
-                                       if ($INTiS_incFile)     {
-                                               require_once('./'.$INTiS_incFile);
-                                       } else {
-                                               $TT->setTSlogMessage('Include file "'.$INTiS_theLib.'" did not exist!',2);
-                                       }
-                               }
-                       }
-               }
-               $TT->pull();
                $TSFE->INTincScript();
        $TT->pull();
 }
index 4aa696b..d88289d 100755 (executable)
@@ -96,24 +96,6 @@ while(list(,$temp_publish_id)=each($temp_publish_pages))     {
                // *******************************
                if ($TSFE->isINTincScript())            {
                        $TT->push('Internal PHP-scripts','');
-                               $INTiS_config = $GLOBALS['TSFE']->config['INTincScript'];
-
-                                       // Special feature: Include libraries
-                               $TT->push('Include libraries');
-                               reset($INTiS_config);
-                               while(list(,$INTiS_cPart)=each($INTiS_config))  {
-                                       if ($INTiS_cPart['conf']['includeLibs'])        {
-                                               $INTiS_resourceList = t3lib_div::trimExplode(',',$INTiS_cPart['conf']['includeLibs'],1);
-                                               reset($INTiS_resourceList);
-                                               while(list(,$INTiS_theLib)=each($INTiS_resourceList))   {
-                                                       $INTiS_incFile=$GLOBALS['TSFE']->tmpl->getFileName($INTiS_theLib);
-                                                       if ($INTiS_incFile)     {
-                                                               include_once('./'.$INTiS_incFile);
-                                                       }
-                                               }
-                                       }
-                               }
-                               $TT->pull();
                                $TSFE->INTincScript();
                        $TT->pull();
                }