[BUGFIX] Add stdWrap for excludeUidList for HMENU.
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / publish.php
old mode 100755 (executable)
new mode 100644 (file)
index 10c8c5e..d821384
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -30,7 +30,7 @@
  * Is included from index_ts.php
  * $Id$
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tslib
  */
@@ -58,15 +58,14 @@ if (!is_object($TSFE))      {die('You cannot execute this file directly. It\'s meant
        // Storing the TSFE object
 $temp_publish_TSFE = $TSFE;
 $TT->push('Publishing','');
-$temp_publish_pages = explode(',',$BE_USER->extPublishList);
+$temp_publish_pages = explode(',', $BE_USER->adminPanel->getExtPublishList());
 $temp_publish_imagesTotal = array();
 $temp_publish_array = array(); // Collects the rendered pages.
 
-while(list(,$temp_publish_id)=each($temp_publish_pages))       {
+foreach ($temp_publish_pages as $temp_publish_id) {
        $TT->push('Page '.$temp_publish_id,'');
-//debug($temp_publish_id,1);
-               $temp_TSFEclassName=t3lib_div::makeInstanceClassName('tslib_fe');
-               $TSFE = new $temp_TSFEclassName($TYPO3_CONF_VARS,$temp_publish_id,0);
+//debug($temp_publish_id);
+               $TSFE = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, $temp_publish_id, 0);
 
                $TSFE->initFEuser();
                $TSFE->clear_preview();
@@ -82,12 +81,10 @@ while(list(,$temp_publish_id)=each($temp_publish_pages))    {
                                if ($temp_theScript)    {
                                        include($temp_theScript);
                                } else {
-                                       require_once (PATH_tslib.'class.tslib_pagegen.php');            // Just formal, this is already included from index_ts.php
                                        include(PATH_tslib.'pagegen.php');
                                }
                                $TSFE->generatePage_postProcessing();
                } elseif ($TSFE->isINTincScript())      {
-                       require_once (PATH_tslib.'class.tslib_pagegen.php');    // Just formal, this is already included from index_ts.php
                        include(PATH_tslib.'pagegen.php');
                }
 
@@ -96,24 +93,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();
                }
@@ -140,13 +119,12 @@ while(list(,$temp_publish_id)=each($temp_publish_pages))  {
 // ***************************
 $publishDir = $TYPO3_CONF_VARS['FE']['publish_dir'];
 if ($publishDir && @is_dir($publishDir))       {
-       $publishDir = ereg_replace('/*$','',$publishDir).'/';
-       debug('Publishing in: '.$publishDir,1);
-       reset($temp_publish_array);
-       while(list($key,$val)=each($temp_publish_array))        {
+       $publishDir = rtrim($publishDir, '/').'/';
+       debug('Publishing in: '.$publishDir, 'Publish');
+       foreach ($temp_publish_array as $key => $val) {
                $file = $publishDir.$key;
                t3lib_div::writeFile($file,$val[2]);
-               debug('Writing: '.$file,1);
+               debug('Writing: '.$file, 'Publish');
        }
 //     debug($temp_publish_array);
 } else {