Cleanup: Set SVN properties
authorOliver Hader <oliver.hader@typo3.org>
Thu, 17 Sep 2009 15:20:16 +0000 (15:20 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 17 Sep 2009 15:20:16 +0000 (15:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5951 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_pagerenderer.php
t3lib/tceforms/class.t3lib_tceforms_suggest.php

index a059e95..93307b5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-17  Oliver Hader  <oliver@typo3.org>
+
+       * Cleanup: Set SVN properties
+
 2009-09-17  Sebastian Kurfuerst  <sebastian@typo3.org>
 
        * Raised Extbase and Fluid Versions from 0.9.5 to 0.9.6
index 79174b1..e879319 100644 (file)
-<?php\r
-/***************************************************************\r
- *  Copyright notice\r
- *\r
- *  (c) 2009 Steffen Kamper (info@sk-typo3.de)\r
- *  All rights reserved\r
- *\r
- *  This script is part of the TYPO3 project. The TYPO3 project is\r
- *  free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  The GNU General Public License can be found at\r
- *  http://www.gnu.org/copyleft/gpl.html.\r
- *  A copy is found in the textfile GPL.txt and important notices to the license\r
- *  from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *\r
- *  This script is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * TYPO3 pageRender class (new in TYPO3 4.3.0)\r
- * This class render the HTML of a webpage, usable for BE and FE\r
- *\r
- * @author     Steffen Kamper <info@sk-typo3.de>\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- * $Id:$\r
- */\r
-abstract class t3lib_PageRenderer implements t3lib_Singleton {\r
-       \r
-       protected $compressJavascript = FALSE;\r
-       protected $compressCss = FALSE;\r
-       protected $removeLineBreaksFromTemplate = FALSE;\r
-\r
-       protected $concatenateFiles = FALSE;\r
-\r
-       protected $moveJsFromHeaderToFooter = FALSE;\r
-\r
-       protected $csConvObj;\r
-       protected $lang;\r
-\r
-       // static array containing associative array for the included files\r
-       protected static $jsFiles = array ();\r
-       protected static $jsFooterFiles = array ();\r
-       protected static $jsLibs = array ();\r
-       protected static $jsFooterLibs = array ();\r
-       protected static $cssFiles = array ();\r
-\r
-       protected $title;\r
-       protected $charSet;\r
-       protected $favIcon;\r
-       protected $baseUrl;\r
-\r
-       // static header blocks\r
-       protected $xmlPrologAndDocType = '';\r
-       protected $metaTags = array ();\r
-       protected $inlineComments = array ();\r
-       protected $headerData = array ();\r
-       protected $footerData = array ();\r
-       protected $titleTag = '<title>|</title>';\r
-       protected $metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />';\r
-       protected $htmlTag = '<html>';\r
-       protected $headTag = '<head>';\r
-       protected $baseUrlTag = '<base href="|" />';\r
-       protected $iconMimeType = '';\r
-       protected $shortcutTag = '<link rel="shortcut icon" href="%1$s"%2$s />\r
-<link rel="icon" href="%1$s"%2$s />';\r
-\r
-       // static inline code blocks\r
-       protected $jsInline = array ();\r
-       protected $extOnReadyCode = array ();\r
-       protected $cssInline = array ();\r
-\r
-       protected $bodyContent;\r
-\r
-       protected $templateFile;\r
-\r
-       protected $jsLibraryNames = array ('prototype', 'scriptaculous', 'extjs');\r
-\r
-       const PART_COMPLETE = 0;\r
-       const PART_HEADER = 1;\r
-       const PART_FOOTER = 2;\r
-\r
-       // internal flags for JS-libraries\r
-       protected $addPrototype = FALSE;\r
-       protected $addScriptaculous = FALSE;\r
-       protected $addScriptaculousModules = array ('builder' => FALSE, 'effects' => FALSE, 'dragdrop' => FALSE, 'controls' => FALSE, 'slider' => FALSE);\r
-       protected $addExtJS = FALSE;\r
-       protected $addExtCore = FALSE;\r
-       protected $extJSadapter = 'ext/ext-base.js';\r
-\r
-       protected $enableExtJsDebug = FALSE;\r
-       protected $enableExtCoreDebug = FALSE;\r
-\r
-       // available adapters for extJs\r
-       const EXTJS_ADAPTER_JQUERY = 'jquery';\r
-       const EXTJS_ADAPTER_PROTOTYPE = 'prototype';\r
-       const EXTJS_ADAPTER_YUI = 'yui';\r
-\r
-       protected $enableExtJSQuickTips = false;\r
-\r
-       protected $inlineLanguageLabels = array ();\r
-       protected $inlineSettings = array ();\r
-\r
-       protected $inlineJavascriptWrap = array ();\r
-\r
-       // used by BE modules\r
-       public $backPath;\r
-\r
-       /**\r
-        * Constructor\r
-        *\r
-        * @param string $templateFile  declare the used template file. Omit this parameter will use default template\r
-        * @param string $backPath      relative path to typo3-folder. It varies for BE modules, in FE it will be typo3/\r
-        * @return void\r
-        */\r
-       public function __construct($templateFile = '', $backPath = '') {\r
-\r
-               $this->reset();\r
-\r
-               if (strlen($templateFile)) {\r
-                       $this->templateFile = $templateFile;\r
-               }\r
-               $this->backPath = $backPath;\r
-               \r
-               $this->inlineJavascriptWrap = array(\r
-                       '<script type="text/javascript">' . chr(10) . '/*<![CDATA[*/' . chr(10) . '<!-- ' . chr(10),\r
-                       '// -->' . chr(10) . '/*]]>*/' . chr(10) . '</script>' . chr(10)\r
-               );\r
-               $this->inlineCssWrap = array(\r
-                       '<style type="text/css">' . chr(10) . '/*<![CDATA[*/' . chr(10) . '<!-- ' . chr(10),\r
-                       '-->' . chr(10) . '/*]]>*/' . chr(10) . '</style>' . chr(10)\r
-               );\r
-\r
-       }\r
-\r
-       /**\r
-        * reset all vars to initial values\r
-        * \r
-        * @return void\r
-        */\r
-       protected function reset() {\r
-               $this->templateFile = TYPO3_mainDir . 'templates/template_page_backend.html';\r
-               $this->jsFiles = array ();\r
-               $this->jsFooterFiles = array ();\r
-               $this->jsInline = array ();\r
-               $this->jsFooterInline = array ();\r
-               $this->jsLibs = array ();\r
-               $this->cssFiles = array ();\r
-               $this->cssInline = array ();\r
-               $this->metaTags = array ();\r
-               $this->inlineComments = array ();\r
-               $this->headerData = array ();\r
-               $this->footerData = array ();\r
-               $this->extOnReadyCode = array ();\r
-       }\r
-       /*****************************************************/\r
-       /*                                                   */\r
-       /*  Public Setters                                   */\r
-       /*                                                   */\r
-       /*                                                   */\r
-       /*****************************************************/\r
-\r
-       /**\r
-        * Sets the title\r
-        *\r
-        * @param string $title title of webpage\r
-        * @return void\r
-        */\r
-       public function setTitle($title) {\r
-               $this->title = $title;\r
-       }\r
-\r
-       /**\r
-        * Sets xml prolog and docType\r
-        *\r
-        * @param string $xmlPrologAndDocType   complete tags for xml prolog and docType\r
-        * @return void\r
-        */\r
-       public function setXmlPrologAndDocType($xmlPrologAndDocType) {\r
-               $this->xmlPrologAndDocType = $xmlPrologAndDocType;\r
-       }\r
-\r
-       /**\r
-        * Sets meta charset\r
-        * @return void\r
-        *\r
-        * @param string $charSet       used charset\r
-        */\r
-       public function setCharSet($charSet) {\r
-               $this->charSet = $charSet;\r
-       }\r
-\r
-       /**\r
-        * Sets html tag\r
-        *\r
-        * @param string $htmlTag       html tag\r
-        * @return void\r
-        */\r
-       public function setHtmlTag($htmlTag) {\r
-               $this->htmlTag = $htmlTag;\r
-       }\r
-\r
-       /**\r
-        * Sets head tag\r
-        *\r
-        * @param string $tag   head tag\r
-        * @return void\r
-        */\r
-       public function setHeadTag($headTag) {\r
-               $this->headTag = $headTag;\r
-       }\r
-\r
-       /**\r
-        * Sets favicon\r
-        *\r
-        * @param string $favIcon\r
-        * @return void\r
-        */\r
-       public function setFavIcon($favIcon) {\r
-               $this->favIcon = $favIcon;\r
-       }\r
-\r
-       /**\r
-        * Sets icon mime type\r
-        *\r
-        * @param string $iconMimeType\r
-        * @return void\r
-        */\r
-       public function setIconMimeType($iconMimeType) {\r
-               $this->iconMimeType = $iconMimeType;\r
-       }\r
-\r
-       /**\r
-        * Sets base url\r
-        *\r
-        * @param string $url\r
-        * @return void\r
-        */\r
-       public function setBaseUrl($baseUrl) {\r
-               $this->baseUrl = $baseUrl;\r
-       }\r
-\r
-       /**\r
-        * Sets template file\r
-        *\r
-        * @param string $file\r
-        * @return void\r
-        */\r
-       public function setTemplateFile($file) {\r
-               $this->templateFile = $file;\r
-       }\r
-\r
-       /**\r
-        * Sets Content for Body\r
-        *\r
-        * @param string $content\r
-        * @return void\r
-        */\r
-       public function setBodyContent($content) {\r
-               $this->bodyContent = $content;\r
-       }\r
-\r
-       /*****************************************************/\r
-       /*                                                   */\r
-       /*  Public Enablers                                  */\r
-       /*                                                   */\r
-       /*                                                   */\r
-       /*****************************************************/\r
-       /**\r
-        * Enables MoveJsFromHeaderToFooter\r
-        *\r
-        * @param void\r
-        * @return void\r
-        */\r
-       public function enableMoveJsFromHeaderToFooter() {\r
-               $this->moveJsFromHeaderToFooter = TRUE;\r
-       }\r
-\r
-       /**\r
-        * Enables compression of javascript\r
-        *\r
-        * @param void\r
-        * @return void\r
-        */\r
-       public function enableCompressJavascript() {\r
-               $this->compressJavascript = TRUE;\r
-       }\r
-\r
-       /**\r
-        * Enables compression of css\r
-        *\r
-        * @param void\r
-        * @return void\r
-        */\r
-       public function enableCompressCss() {\r
-               $this->compressCss = TRUE;\r
-       }\r
-\r
-       /**\r
-       /**\r
-        * Enables concatenation of js/css files\r
-        *\r
-        * @param void\r
-        * @return void\r
-        */\r
-       public function enableConcatenateFiles() {\r
-               $this->concatenateFiles = TRUE;\r
-       }\r
-\r
-       /**\r
-        * Sets removal of all line breaks in template\r
-        *\r
-        * @param void\r
-        * @return void\r
-        */\r
-       public function enableRemoveLineBreaksFromTemplate() {\r
-               $this->removeLineBreaksFromTemplate = TRUE;\r
-       }\r
-\r
-       /*****************************************************/\r
-       /*                                                   */\r
-       /*  Public Getters                                   */\r
-       /*                                                   */\r
-       /*                                                   */\r
-       /*****************************************************/\r
-\r
-       /**\r
-        * Gets the title\r
-        *\r
-        * @return string $title                title of webpage\r
-        */\r
-       public function getTitle() {\r
-               return $this->title;\r
-       }\r
-\r
-       /**\r
-        * Gets the charSet\r
-        *\r
-        * @return string $charSet\r
-        */\r
-       public function getCharSet() {\r
-               return $this->charSet;\r
-       }\r
-\r
-       /**\r
-        * Gets html tag\r
-        *\r
-        * @return string $htmlTag      html tag\r
-        */\r
-       public function getHtmlTag() {\r
-               return $this->htmlTag;\r
-       }\r
-\r
-       /**\r
-        * Gets head tag\r
-        *\r
-        * @return string $tag  head tag\r
-        */\r
-       public function getHeadTag() {\r
-               return $this->headTag;\r
-       }\r
-\r
-       /**\r
-        * Gets favicon\r
-        *\r
-        * @return string $favIcon\r
-        */\r
-       public function getFavIcon() {\r
-               return $this->favIcon;\r
-       }\r
-\r
-       /**\r
-        * Gets icon mime type\r
-        *\r
-        * @return string $iconMimeType\r
-        */\r
-       public function getIconMimeType() {\r
-               return $this->iconMimeType;\r
-       }\r
-\r
-       /**\r
-        * Gets base url\r
-        *\r
-        * @return string $url\r
-        */\r
-       public function getBaseUrl() {\r
-               return $this->baseUrl;\r
-       }\r
-\r
-       /**\r
-        * Gets template file\r
-        *\r
-        * @return string $file\r
-        */\r
-       public function getTemplateFile($file) {\r
-               return $this->templateFile;\r
-       }\r
-\r
-       /**\r
-        * Gets MoveJsFromHeaderToFooter\r
-        *\r
-        * @return boolean \r
-        */\r
-       public function getMoveJsFromHeaderToFooter() {\r
-               return $this->moveJsFromHeaderToFooter;\r
-       }\r
-\r
-       /**\r
-        * Gets compress of javascript\r
-        *\r
-        * @return boolean \r
-        */\r
-       public function getCompressJavascript() {\r
-               return $this->compressJavascript;\r
-       }\r
-\r
-       /**\r
-        * Gets compress of css\r
-        *\r
-        * @return boolean \r
-        */\r
-       public function getCompressCss() {\r
-               return $this->compressCss;\r
-       }\r
-\r
-       /**\r
-        * Gets concatenate of files\r
-        *\r
-        * @return boolean \r
-        */\r
-       public function getConcatenateFiles() {\r
-               return $this->concatenateFiles;\r
-       }\r
-\r
-       /**\r
-        * Gets remove of empty lines from template\r
-        *\r
-        * @return boolean \r
-        */\r
-       public function getRemoveLineBreaksFromTemplate() {\r
-               return $this->removeLineBreaksFromTemplate;\r
-       }\r
-\r
-       /**\r
-        * Gets content for body\r
-        *\r
-        * @return string\r
-        */\r
-       public function getBodyContent() {\r
-               return $this->bodyContent;\r
-       }\r
-\r
-       /*****************************************************/\r
-       /*                                                   */\r
-       /*  Public Function to add Data                      */\r
-       /*                                                   */\r
-       /*                                                   */\r
-       /*****************************************************/\r
-       \r
-       /**\r
-        * Adds meta data\r
-        *\r
-        * @param string $meta  meta data (complete metatag)\r
-        * @return void\r
-        */\r
-       public function addMetaTag($meta) {\r
-               if (!in_array($meta, $this->metaTags)) {\r
-                       $this->metaTags[] = $meta;\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds inline HTML comment\r
-        *\r
-        * @param string $comment\r
-        * @return void\r
-        */\r
-       public function addInlineComment($comment) {\r
-               if (!in_array($comment, $this->inlineComments)) {\r
-                       $this->inlineComments[] = $comment;\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds header data\r
-        *\r
-        * @param string $data  free header data for HTML header\r
-        * @return void\r
-        */\r
-       public function addHeaderData($data) {\r
-               if (!in_array($data, $this->headerData)) {\r
-                       $this->headerData[] = $data;\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds footer data\r
-        *\r
-        * @param string $data  free header data for HTML header\r
-        * @return void\r
-        */\r
-       public function addFooterData($data) {\r
-               if (!in_array($data, $this->footerData)) {\r
-                       $this->footerData[] = $data;\r
-               }\r
-       }\r
-\r
-       /* Javascript Files */\r
-       \r
-       /**\r
-        * Adds JS Library. JS Library block is rendered on top of the JS files.\r
-        *\r
-        * @param string $name\r
-        * @param string $file\r
-        * @param string $type\r
-        * @param boolean $compressed   flag if library is compressed\r
-        * @param boolean $forceOnTop   flag if added library should be inserted at begin of this block\r
-        * @param string $allWrap\r
-        * @return void\r
-        */\r
-       public function addJsLibrary($name, $file, $type = 'text/javascript', $compressed = TRUE, $forceOnTop = FALSE, $allWrap = '') {\r
-               if (!in_array(strtolower($name), $this->jsLibs)) {\r
-                       $this->jsLibs[strtolower($name)] = array (\r
-                               'file'        => $file, \r
-                               'type'        => $type, \r
-                               'section'     => self::PART_HEADER,\r
-                               'compressed'  => $compressed, \r
-                               'forceOnTop'  => $forceOnTop,\r
-                               'allWrap'     => $allWrap\r
-                       );\r
-               }\r
-       \r
-       }\r
-\r
-       /**\r
-        * Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.\r
-        *\r
-        * @param string $name\r
-        * @param string $file\r
-        * @param string $type\r
-        * @param boolean $compressed   flag if library is compressed\r
-        * @param boolean $forceOnTop   flag if added library should be inserted at begin of this block\r
-        * @param string $allWrap\r
-        * @return void\r
-        */\r
-       public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compressed = TRUE, $forceOnTop = FALSE, $allWrap = '') {\r
-               if (!in_array(strtolower($name), $this->jsLibs)) {\r
-                       $this->jsLibs[strtolower($name)] = array (\r
-                               'file'        => $file, \r
-                               'type'        => $type, \r
-                               'section'     => self::PART_FOOTER,\r
-                               'compressed'  => $compressed, \r
-                               'forceOnTop'  => $forceOnTop,\r
-                               'allWrap'     => $allWrap\r
-                       );\r
-               }\r
-       \r
-       }\r
-\r
-       /**\r
-        * Adds JS file\r
-        *\r
-        * @param string $file\r
-        * @param string $type\r
-        * @param boolean $compressed\r
-        * @param boolean $forceOnTop\r
-        * @param string $allWrap\r
-        * @return void\r
-        */\r
-       public function addJsFile($file, $type = 'text/javascript', $compressed = FALSE, $forceOnTop = FALSE, $allWrap = '') {\r
-               if (!isset($this->jsFiles[$file])) {\r
-                       $this->jsFiles[$file] = array (\r
-                               'type'        => $type, \r
-                               'section'     => self::PART_HEADER, \r
-                               'compressed'  => $compressed, \r
-                               'forceOnTop'  => $forceOnTop, \r
-                               'allWrap'     => $allWrap\r
-                       );\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds JS file to footer\r
-        *\r
-        * @param string $file\r
-        * @param string $type\r
-        * @param boolean $compressed\r
-        * @param boolean $forceOnTop\r
-        * @return void\r
-        */\r
-       public function addJsFooterFile($file, $type = 'text/javascript', $compressed = FALSE, $forceOnTop = FALSE, $allWrap = '') {\r
-               if (!isset($this->jsFiles[$file])) {\r
-                       $this->jsFiles[$file] = array (\r
-                               'type'        => $type, \r
-                               'section'     => self::PART_FOOTER, \r
-                               'compressed'  => $compressed, \r
-                               'forceOnTop'  => $forceOnTop, \r
-                               'allWrap'     => $allWrap\r
-                       );\r
-               }\r
-       }\r
-\r
-       /*Javascript Inline Blocks */\r
-       \r
-       /**\r
-        * Adds JS inline code\r
-        *\r
-        * @param string $name\r
-        * @param string $block\r
-        * @param boolean $compressed\r
-        * @param boolean $forceOnTop\r
-        * @return void\r
-        */\r
-       public function addJsInlineCode($name, $block, $compressed = FALSE, $forceOnTop = FALSE) {\r
-               if (!isset($this->jsInline[$name])) {\r
-                       $this->jsInline[$name] = array (\r
-                               'code'        => $block . chr(10),\r
-                               'section'     => self::PART_HEADER, \r
-                               'compressed'  => $compressed,\r
-                               'forceOnTop'  => $forceOnTop\r
-                       );\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds JS inline code to footer\r
-        *\r
-        * @param string $name\r
-        * @param string $block\r
-        * @param boolean $compressed\r
-        * @param boolean $forceOnTop\r
-        * @return void\r
-        */\r
-       public function addJsFooterInlineCode($name, $block, $compressed = FALSE, $forceOnTop = FALSE) {\r
-               if (!isset($this->jsInline[$name])) {\r
-                       $this->jsInline[$name] = array (\r
-                               'code'        => $block . chr(10),\r
-                               'section'     => self::PART_FOOTER,\r
-                               'compressed'  => $compressed,\r
-                               'forceOnTop'  => $forceOnTop\r
-                       );\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds Ext.onready code, which will be wrapped in Ext.onReady(function() {...});\r
-        *\r
-        * @param string $block\r
-        * @return void\r
-        */\r
-       public function addExtOnReadyCode($block) {\r
-               if (!in_array($block, $this->extOnReadyCode)) {\r
-                       $this->extOnReadyCode[] = $block;\r
-               }\r
-       }\r
-\r
-       /* CSS Files */\r
-       \r
-       /**\r
-        * Adds CSS file\r
-        *\r
-        * @param string $file\r
-        * @param string $rel\r
-        * @param string $media\r
-        * @param string $title\r
-        * @param boolean $compressed\r
-        * @param boolean $forceOnTop\r
-        * @return void\r
-        */\r
-       public function addCssFile($file, $rel = 'stylesheet', $media = 'screen', $title = '', $compressed = FALSE, $forceOnTop = FALSE, $allWrap = '') {\r
-               if (!isset($this->cssFiles[$file])) {\r
-                       $this->cssFiles[$file] = array ('rel' => $rel, 'media' => $media, 'title' => $title, 'compressed' => $compressed, 'forceOnTop' => $forceOnTop, 'allWrap' => $allWrap);\r
-               }\r
-       }\r
-\r
-       /*CSS Inline Blocks */\r
-       \r
-       /**\r
-        * Adds CSS inline code\r
-        *\r
-        * @param string $name\r
-        * @param string $block\r
-        * @param boolean $compressed\r
-        * @param boolean $forceOnTop\r
-        * @return void\r
-        */\r
-       public function addCssInlineBlock($name, $block, $compressed = FALSE, $forceOnTop = FALSE) {\r
-               if (!isset($this->cssInline[$name])) {\r
-                       $this->cssInline[$name] = array ('code' => $block, 'compressed' => $compressed, 'forceOnTop' => $forceOnTop);\r
-               }\r
-       }\r
-\r
-       /* JS Libraries */\r
-       \r
-       /**\r
-        *  call function if you need the prototype library\r
-        *\r
-        * @return void\r
-        */\r
-       public function loadPrototype() {\r
-               $this->addPrototype = TRUE;\r
-       }\r
-\r
-       /**\r
-        * call function if you need the Scriptaculous library\r
-        *\r
-        * @param string $modules   add modules you need. use "all" if you need complete modules\r
-        * @return void\r
-        */\r
-       public function loadScriptaculous($modules = '') {\r
-               // Scriptaculous require prototype, so load prototype too.\r
-               $this->addPrototype = TRUE;\r
-               $this->addScriptaculous = TRUE;\r
-               if ($modules) {\r
-                       if ($modules == 'all') {\r
-                               foreach ($this->addScriptaculousModules as $key => $value) {\r
-                                       $this->addScriptaculousModules[$key] = TRUE;\r
-                               }\r
-                       } else {\r
-                               $mods = t3lib_div::trimExplode(',', $modules);\r
-                               foreach ($mods as $mod) {\r
-                                       if (isset($this->addScriptaculousModules[strtolower($mod)])) {\r
-                                               $this->addScriptaculousModules[strtolower($mod)] = TRUE;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-\r
-       /**\r
-        * call this function if you need the extJS library\r
-        *\r
-        * @param boolean $css flag, if set the ext-css will be loaded\r
-        * @param boolean $theme flag, if set the ext-theme "grey" will be loaded\r
-        * @param string $adapter choose alternative adapter, possible values: yui, prototype, jquery\r
-        * @return void\r
-        */\r
-       public function loadExtJS($css = TRUE, $theme = TRUE, $adapter = '') {\r
-               if ($adapter) {\r
-                       // empty $adapter will always load the ext adapter\r
-                       switch (t3lib_div::strtolower(trim($adapter))) {\r
-                               case self::EXTJS_ADAPTER_YUI :\r
-                                       $this->extJSadapter = 'yui/ext-yui-adapter.js';\r
-                                       break;\r
-                               case self::EXTJS_ADAPTER_PROTOTYPE :\r
-                                       $this->extJSadapter = 'prototype/ext-prototype-adapter.js';\r
-                                       break;\r
-                               case self::EXTJS_ADAPTER_JQUERY :\r
-                                       $this->extJSadapter = 'jquery/ext-jquery-adapter.js';\r
-                                       break;\r
-                       }\r
-               }\r
-               if (!$this->addExtJS) {\r
-                       $this->addExtJS = TRUE;\r
-                       if ($theme) {\r
-                               if (isset($GLOBALS['TBE_STYLES']['extJS']['theme'])) {\r
-                                       $this->addCssFile($this->backPath . $GLOBALS['TBE_STYLES']['extJS']['theme'], 'stylesheet', 'screen', '', FALSE, TRUE);\r
-                               } else {\r
-                                       $this->addCssFile($this->backPath . 'contrib/extjs/resources/css/xtheme-blue.css', 'stylesheet', 'screen', '', FALSE, TRUE);\r
-                               }\r
-                       }\r
-                       if ($css) {\r
-                               if (isset($GLOBALS['TBE_STYLES']['extJS']['all'])) {\r
-                                       $this->addCssFile($this->backPath . $GLOBALS['TBE_STYLES']['extJS']['all'], 'stylesheet', 'screen', '', FALSE, TRUE);\r
-                               } else {\r
-                                       $this->addCssFile($this->backPath . 'contrib/extjs/resources/css/ext-all-notheme.css', 'stylesheet', 'screen', '', FALSE, TRUE);\r
-                               }\r
-                       }\r
-               \r
-               }\r
-       }\r
-\r
-       /**\r
-        * Enables ExtJs QuickTips\r
-        * Need extJs loaded\r
-        * \r
-        * @return void\r
-        * \r
-        */\r
-       public function enableExtJSQuickTips() {\r
-               $this->enableExtJSQuickTips = TRUE;\r
-       }\r
-\r
-\r
-       /**\r
-        * call function if you need the ExtCore library\r
-        *\r
-        * @return void\r
-        */\r
-       public function loadExtCore() {\r
-               $this->addExtCore = TRUE;\r
-       }\r
-\r
-       /**     \r
-        * call this function to load debug version of ExtJS. Use this for development only\r
-        *\r
-        */\r
-       public function enableExtJsDebug() {\r
-               $this->enableExtJsDebug = TRUE;\r
-       }\r
-\r
-       /**\r
-        * call this function to load debug version of ExtCore. Use this for development only\r
-        *\r
-        * @return void\r
-        */\r
-       public function enableExtCoreDebug() {\r
-               $this->enableExtCoreDebug = TRUE;\r
-       }\r
-\r
-       /**\r
-        * Adds Javascript Inline Label. This will occur in TYPO3.lang - object\r
-        * The label can be used in scripts with TYPO3.lang.<key>\r
-        * Need extJs loaded\r
-        * \r
-        * @param string $key\r
-        * @param string $value\r
-        * @return void\r
-        */\r
-       public function addInlineLanguageLabel($key, $value) {\r
-               $this->inlineLanguageLabels[$key] = $value;\r
-       }\r
-\r
-       /**\r
-        * Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object\r
-        * The label can be used in scripts with TYPO3.lang.<key>\r
-        * Array will be merged with existing array.\r
-        * Need extJs loaded   \r
-        * \r
-        * @param array $array\r
-        * @return void\r
-        */\r
-       public function addInlineLanguageLabelArray(array $array) {\r
-               $this->inlineLanguageLabels = array_merge($this->inlineLanguageLabels, $array);\r
-       }\r
-\r
-       /**\r
-        * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object\r
-        * The label can be used in scripts with TYPO3.setting.<key>\r
-        * Need extJs loaded   \r
-        * \r
-        * @param string $namespace\r
-        * @param string $key\r
-        * @param string $value\r
-        * @return void\r
-        */\r
-       public function addInlineSetting($namespace, $key, $value) {\r
-               if ($namespace) {\r
-                       if (strpos($namespace, '.')) {\r
-                               $parts = explode('.', $namespace);\r
-                               $a = &$this->inlineSettings;\r
-                               foreach ($parts as $part) {\r
-                                       $a = &$a[$part];\r
-                               }\r
-                               $a[$key] = $value;\r
-                       } else {\r
-                               $this->inlineSettings[$namespace][$key] = $value;\r
-                       }\r
-               } else {\r
-                       $this->inlineSettings[$key] = $value;\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object\r
-        * The label can be used in scripts with TYPO3.setting.<key>\r
-        * Array will be merged with existing array.\r
-        * Need extJs loaded   \r
-        * \r
-        * @param string $namespace\r
-        * @param array $array\r
-        * @return void\r
-        */\r
-       public function addInlineSettingArray($namespace, array $array) {\r
-               if ($namespace) {\r
-                       if (strpos($namespace, '.')) {\r
-                               $parts = explode('.', $namespace);\r
-                               $a = &$this->inlineSettings;\r
-                               foreach ($parts as $part) {\r
-                                       $a = &$a[$part];\r
-                               }\r
-                               $a = array_merge((array) $a, $array);\r
-                       } else {\r
-                               $this->inlineSettings[$namespace] = array_merge((array) $this->inlineSettings[$namespace], $array);\r
-                       }\r
-               } else {\r
-                       $this->inlineSettings = array_merge($this->inlineSettings, $array);\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Adds content to body content\r
-        *\r
-        * @param string $content\r
-        * @return void\r
-        */\r
-       public function addBodyContent($content) {\r
-               $this->bodyContent .= $content;\r
-       }\r
-\r
-       /*****************************************************/\r
-       /*                                                   */\r
-       /*  Render Functions                                 */\r
-       /*                                                   */\r
-       /*                                                   */\r
-       /*****************************************************/\r
-       \r
-       /**\r
-        * render the section (Header or Footer)\r
-        *\r
-        * @param int $part     section which should be rendered: self::PART_COMPLETE, self::PART_HEADER or self::PART_FOOTER\r
-        * @return string       content of rendered section\r
-        */\r
-       public function render($part = self::PART_COMPLETE) {\r
-\r
-               $jsFiles = '';\r
-               $cssFiles = '';\r
-               $cssInline = '';\r
-               $jsInline = '';\r
-               $jsFooterInline = '';\r
-               $jsFooterLibs = '';\r
-               $jsFooterFiles = '';\r
-               $noJS = FALSE;\r
-\r
-               $jsLibs = $this->renderJsLibraries();\r
-\r
-               if ($this->compressCss || $this->compressJavascript) {\r
-                               // do the file compression\r
-                       $this->doCompress();\r
-               }\r
-               if ($this->concatenateFiles) {\r
-                               // do the file concatenation\r
-                       $this->doConcatenate();\r
-               }\r
-\r
-               $metaTags = implode(chr(10), $this->metaTags);\r
-\r
-               if (count($this->cssFiles)) {\r
-                       foreach ($this->cssFiles as $file => $properties) {\r
-                               $tag = '<link rel="' . $properties['rel'] . '" type="text/css" href="' . $file . '" media="' . $properties['media'] . '"' . ($properties['title'] ? ' title="' . $properties['title'] . '"' : '') . ' />';\r
-                               if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {\r
-                                       $tag = str_replace('|', $tag, $properties['allWrap']);\r
-                               }\r
-                               if ($properties['forceOnTop']) {\r
-                                       $cssFiles = $tag . chr(10) . $cssFiles;\r
-                               } else {\r
-                                       $cssFiles .= chr(10) . $tag;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               if (count($this->cssInline)) {\r
-                       \r
-                       foreach ($this->cssInline as $name => $properties) {\r
-                               if ($properties['forceOnTop']) {\r
-                                       $cssInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $cssInline;\r
-                               } else {\r
-                                       $cssInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);\r
-                               }\r
-                       }\r
-                       $cssInline = $this->inlineCssWrap[0] . $cssInline . $this->inlineCssWrap[1];\r
-\r
-               }\r
-\r
-               if (count($this->jsLibs)) {\r
-                       foreach ($this->jsLibs as $name => $properties) {\r
-                               $tag = '<script src="' . $properties['file'] . '" type="' . $properties['type'] . '"></script>';\r
-                               if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {\r
-                                       $tag = str_replace('|', $tag, $properties['allWrap']);\r
-                               }\r
-                               if ($properties['forceOnTop']) {\r
-                                       if ($properties['section'] === self::PART_HEADER) {\r
-                                               $jsLibs = $tag . chr(10) . $jsLibs;\r
-                                       } else {\r
-                                               $jsFooterLibs = $tag . chr(10) . $jsFooterLibs;\r
-                                       }\r
-                               } else {\r
-                                       if ($properties['section'] === self::PART_HEADER) {\r
-                                               $jsLibs .= chr(10) . $tag;\r
-                                       } else {\r
-                                               $jsFooterLibs .= chr(10) . $tag;\r
-                                       }\r
-                               }\r
-                               \r
-                       }\r
-               }\r
-\r
-               if (count($this->jsFiles)) {\r
-                       foreach ($this->jsFiles as $file => $properties) {\r
-                                       $tag = '<script src="' . $file . '" type="' . $properties['type'] . '"></script>';\r
-                                       if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {\r
-                                               $tag = str_replace('|', $tag, $properties['allWrap']);\r
-                                       }\r
-                                       if ($properties['forceOnTop']) {\r
-                                               if ($properties['section'] === self::PART_HEADER) {\r
-                                                       $jsFiles = $tag . chr(10) . $jsFiles;\r
-                                               } else {\r
-                                                       $jsFooterFiles = $tag . chr(10) . $jsFooterFiles;\r
-                                               }\r
-                                       } else {\r
-                                               if ($properties['section'] === self::PART_HEADER) {\r
-                                                       $jsFiles .= chr(10) . $tag;\r
-                                               } else {\r
-                                                       $jsFooterFiles .= chr(10) . $tag;\r
-                                               }\r
-                                       }\r
-                       }\r
-               }\r
-\r
-               if (count($this->jsInline)) {\r
-                       foreach ($this->jsInline as $name => $properties) {\r
-                               if ($properties['forceOnTop']) {\r
-                                       if ($properties['section'] === self::PART_HEADER) {\r
-                                               $jsInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $jsInline;        \r
-                                       } else {\r
-                                               $jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $jsFooterInline;\r
-                                       }\r
-                               } else {\r
-                                       if ($properties['section'] === self::PART_HEADER) {\r
-                                               $jsInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);\r
-                                       } else {\r
-                                               $jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-\r
-               if ($jsInline) {\r
-                       $jsInline = $this->inlineJavascriptWrap[0] . $jsInline . $this->inlineJavascriptWrap[1];\r
-               }\r
-\r
-               if ($jsFooterInline) {\r
-                       $jsFooterInline = $this->inlineJavascriptWrap[0] . $jsFooterInline . $this->inlineJavascriptWrap[1];\r
-               }\r
-\r
-\r
-                       // get template\r
-               $templateFile = t3lib_div::getFileAbsFileName($this->templateFile, TRUE);\r
-               $template = t3lib_div::getURL($templateFile);\r
-\r
-               if ($this->removeEmptyLinesFromTemplate) {\r
-                       $template = strtr($template, array(chr(10) => '', chr(13) => ''));\r
-               }\r
-               if ($part != self::PART_COMPLETE) {\r
-                       $templatePart = explode('###BODY###', $template);\r
-                       $template = $templatePart[$part - 1];\r
-               }\r
-\r
-               if ($this->moveJsFromHeaderToFooter) {\r
-                       $jsFooterLibs = $jsLibs . chr(10) . $jsFooterLibs;\r
-                       $jsLibs = '';\r
-                       $jsFooterFiles = $jsFiles . chr(10) . $jsFooterFiles;\r
-                       $jsFiles = '';\r
-                       $jsFooterInline = $jsInline . chr(10) . $jsFooterInline;\r
-                       $jsInline = '';\r
-               }       \r
-\r
-               $markerArray = array(\r
-                       'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType, \r
-                       'HTMLTAG'           => $this->htmlTag, \r
-                       'HEADTAG'           => $this->headTag, \r
-                       'METACHARSET'       => $this->charSet ? str_replace('|', htmlspecialchars($this->charSet), $this->metaCharsetTag) : '', \r
-                       'INLINECOMMENT'     => $this->inlineComments ? chr(10) . chr(10) . '<!-- ' . chr(10) . implode(chr(10), $this->inlineComments) . '-->' . chr(10) . chr(10) : '', \r
-                       'BASEURL'           => $this->baseUrl ? str_replace('|', $this->baseUrl, $this->baseUrlTag) : '',\r
-                       'SHORTCUT'          => $this->favIcon ? sprintf($this->shortcutTag, htmlspecialchars($this->favIcon), $this->iconMimeType) : '', \r
-                       'CSS_INCLUDE'       => $cssFiles, \r
-                       'CSS_INLINE'        => $cssInline, \r
-                       'JS_INLINE'         => $jsInline, \r
-                       'JS_INCLUDE'        => $jsFiles, \r
-                       'JS_LIBS'               => $jsLibs, \r
-                       'TITLE'             => $this->title ? str_replace('|', htmlspecialchars($this->title), $this->titleTag) : '', \r
-                       'META'              => $metaTags, \r
-                       'HEADERDATA'        => $this->headerData ? implode(chr(10), $this->headerData) : '', \r
-                       'FOOTERDATA'        => $this->footerData ? implode(chr(10), $this->footerData) : '', \r
-                       'JS_LIBS_FOOTER'        => $jsFooterLibs, \r
-                       'JS_INCLUDE_FOOTER' => $jsFooterFiles, \r
-                       'JS_INLINE_FOOTER'  => $jsFooterInline,\r
-                       'BODY'                          => $this->bodyContent, \r
-               );\r
-\r
-               $markerArray = array_map('trim', $markerArray);\r
-\r
-               $this->reset();\r
-               return trim(t3lib_parsehtml::substituteMarkerArray($template, $markerArray, '###|###'));\r
-       }\r
-\r
-       /**\r
-        * helper function for render the javascript libraries\r
-        *\r
-        * @return string       content with javascript libraries\r
-        */\r
-       protected function renderJsLibraries() {\r
-               $out = '';\r
-\r
-               if ($this->addPrototype) {\r
-                       $out .= '<script src="' . $this->backPath . 'contrib/prototype/prototype.js" type="text/javascript"></script>' . chr(10);\r
-                       unset($this->jsFiles[$this->backPath . 'contrib/prototype/prototype.js']);\r
-               }\r
-\r
-               if ($this->addScriptaculous) {\r
-                       $mods = array ();\r
-                       foreach ($this->addScriptaculousModules as $key => $value) {\r
-                               if ($this->addScriptaculousModules[$key]) {\r
-                                       $mods[] = $key;\r
-                               }\r
-                       }\r
-                               // resolve dependencies\r
-                       if (in_array('dragdrop', $mods) || in_array('controls', $mods)) {\r
-                               $mods = array_merge(array('effects'), $mods);\r
-                       }\r
-\r
-                       if (count($mods)) {\r
-                               $moduleLoadString = '?load=' . implode(',', $mods);\r
-                       }\r
-\r
-                       $out .= '<script src="' . $this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString . '" type="text/javascript"></script>' . chr(10);\r
-                       unset($this->jsFiles[$this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString]);\r
-               }\r
-\r
-                       // include extCore\r
-               if ($this->addExtCore) {\r
-                       $out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . chr(10);\r
-                       unset($this->jsFiles[$this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js']);\r
-               }\r
-\r
-                       // include extJS\r
-               if ($this->addExtJS) {\r
-                               // use the base adapter all the time\r
-                       $out .= '<script src="' . $this->backPath . 'contrib/extjs/adapter/' . $this->extJSadapter . '" type="text/javascript"></script>' . chr(10);\r
-                       $out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-all' . ($this->enableExtJsDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . chr(10);\r
-\r
-                               // add extJS localization\r
-                       $localeMap = $this->csConvObj->isoArray; // load standard ISO mapping and modify for use with ExtJS\r
-                       $localeMap[''] = 'en';\r
-                       $localeMap['default'] = 'en';\r
-                       $localeMap['gr'] = 'el_GR'; // Greek\r
-                       $localeMap['no'] = 'no_BO'; // Norwegian Bokmaal\r
-                       $localeMap['se'] = 'se_SV'; // Swedish\r
-\r
-\r
-                       $extJsLang = isset($localeMap[$this->lang]) ? $localeMap[$this->lang] : $this->lang;\r
-                               // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!\r
-                       $extJsLocaleFile = 'contrib/extjs/locale/ext-lang-' . $extJsLang . '-min.js';\r
-                       if (file_exists(PATH_typo3 . $extJsLocaleFile)) {\r
-                               $out .= '<script src="' . $this->backPath . $extJsLocaleFile . '" type="text/javascript"></script>' . chr(10);\r
-                       }\r
-\r
-\r
-                               // remove extjs from JScodeLibArray\r
-                       unset(\r
-                               $this->jsFiles[$this->backPath . 'contrib/extjs/ext-all.js'], $this->jsFiles[$this->backPath . 'contrib/extjs/ext-all-debug.js']\r
-                       );\r
-               }\r
-               if ($this->addExtCore || $this->addExtJS) {\r
-                               // set clear.gif, move it on top, add handler code\r
-                       $code = '';\r
-                       if (count($this->extOnReadyCode)) {\r
-                               foreach ($this->extOnReadyCode as $block) {\r
-                                       $code .= $block;\r
-                               }\r
-                       }\r
-\r
-                       $out .= $this->inlineJavascriptWrap[0] . '\r
-                               Ext.ns("TYPO3");\r
-                               Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(t3lib_div::locationHeaderUrl($this->backPath . 'gfx/clear.gif')) . '";' . chr(10) . \r
-                               'TYPO3.lang = ' . json_encode($this->inlineLanguageLabels) . ';' . 'TYPO3.settings = ' . json_encode($this->inlineSettings) . ';' .\r
-                               'Ext.onReady(function() {' .\r
-                               ($this->enableExtJSQuickTips ? 'Ext.QuickTips.init();' . chr(10) : '') . $code .\r
-                               ' });' . $this->inlineJavascriptWrap[1];\r
-                       unset ($this->extOnReadyCode);\r
-               }\r
-\r
-               return $out;\r
-       }\r
-\r
-       /*****************************************************/\r
-       /*                                                   */\r
-       /*  Tools                                            */\r
-       /*                                                   */\r
-       /*                                                   */\r
-       /*****************************************************/\r
-       \r
-       /**\r
-        * concatenate files into one file\r
-        * registered handler\r
-        * TODO: implement own method\r
-        *\r
-        * @return void\r
-        */\r
-       protected function doConcatenate() {\r
-               // traverse the arrays, concatenate in one file\r
-               // then remove concatenated files from array and add the concatenated file\r
-\r
-\r
-                       // extern concatination\r
-               if ($this->concatenateFiles && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['concatenateHandler']) {\r
-                       // use extern concatenate routine\r
-                       $params = array (\r
-                               'jsLibs'         => &$this->jsLibs, \r
-                               'jsFiles'        => &$this->jsFiles, \r
-                               'jsFooterFiles'  => &$this->jsFiles, \r
-                               'cssFiles'       => &$this->cssFiles,\r
-                       );\r
-                       t3lib_div::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['concatenateHandler'], $params, $this);\r
-               } else {\r
-                       // own method, nothing implemented atm\r
-\r
-\r
-               }\r
-       }\r
-\r
-       /**\r
-        * compress inline code\r
-        *\r
-        */\r
-       protected function doCompress() {\r
-\r
-               if ($this->compressJavascript && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler']) {\r
-                       // use extern compress routine\r
-                       $params = array (\r
-                               'jsInline'        => &$this->jsInline, \r
-                               'jsFooterInline'  => &$this->jsFooterInline\r
-                       );\r
-                       t3lib_div::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler'], $params, $this);\r
-               } else {\r
-                               // traverse the arrays, compress files\r
-                       $this->compressError = '';\r
-                       \r
-                       if ($this->compressJavascript) {\r
-                               if (count($this->jsInline)) {\r
-                                       foreach ($this->jsInline as $name => $properties) {\r
-                                               if (!$properties['compressed']) {\r
-                                                       $error = '';\r
-                                                       $this->jsInline[$name]['code'] = t3lib_div::minifyJavaScript($properties['code'], $error);\r
-                                                       if ($error) {\r
-                                                               $this->compressError .= 'Error with minify JS Inline Block "' . $name . '": ' . $error . chr(10);\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-               if ($this->compressCss && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler']) {\r
-                               // use extern compress routine\r
-                       $params = array (\r
-                               'cssInline' => &$this->cssInline\r
-                       );\r
-                       t3lib_div::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler'], $params, $this);\r
-               } else {\r
-                       if ($this->compressCss) {\r
-                               // own method, nothing implemented atm\r
-                       }\r
-               }\r
-       }\r
-\r
-}\r
-\r
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']) {\r
-       include_once ($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']);\r
-}\r
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2009 Steffen Kamper (info@sk-typo3.de)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * TYPO3 pageRender class (new in TYPO3 4.3.0)
+ * This class render the HTML of a webpage, usable for BE and FE
+ *
+ * @author     Steffen Kamper <info@sk-typo3.de>
+ * @package TYPO3
+ * @subpackage t3lib
+ * $Id$
+ */
+abstract class t3lib_PageRenderer implements t3lib_Singleton {
+       
+       protected $compressJavascript = FALSE;
+       protected $compressCss = FALSE;
+       protected $removeLineBreaksFromTemplate = FALSE;
+
+       protected $concatenateFiles = FALSE;
+
+       protected $moveJsFromHeaderToFooter = FALSE;
+
+       protected $csConvObj;
+       protected $lang;
+
+       // static array containing associative array for the included files
+       protected static $jsFiles = array ();
+       protected static $jsFooterFiles = array ();
+       protected static $jsLibs = array ();
+       protected static $jsFooterLibs = array ();
+       protected static $cssFiles = array ();
+
+       protected $title;
+       protected $charSet;
+       protected $favIcon;
+       protected $baseUrl;
+
+       // static header blocks
+       protected $xmlPrologAndDocType = '';
+       protected $metaTags = array ();
+       protected $inlineComments = array ();
+       protected $headerData = array ();
+       protected $footerData = array ();
+       protected $titleTag = '<title>|</title>';
+       protected $metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />';
+       protected $htmlTag = '<html>';
+       protected $headTag = '<head>';
+       protected $baseUrlTag = '<base href="|" />';
+       protected $iconMimeType = '';
+       protected $shortcutTag = '<link rel="shortcut icon" href="%1$s"%2$s />
+<link rel="icon" href="%1$s"%2$s />';
+
+       // static inline code blocks
+       protected $jsInline = array ();
+       protected $extOnReadyCode = array ();
+       protected $cssInline = array ();
+
+       protected $bodyContent;
+
+       protected $templateFile;
+
+       protected $jsLibraryNames = array ('prototype', 'scriptaculous', 'extjs');
+
+       const PART_COMPLETE = 0;
+       const PART_HEADER = 1;
+       const PART_FOOTER = 2;
+
+       // internal flags for JS-libraries
+       protected $addPrototype = FALSE;
+       protected $addScriptaculous = FALSE;
+       protected $addScriptaculousModules = array ('builder' => FALSE, 'effects' => FALSE, 'dragdrop' => FALSE, 'controls' => FALSE, 'slider' => FALSE);
+       protected $addExtJS = FALSE;
+       protected $addExtCore = FALSE;
+       protected $extJSadapter = 'ext/ext-base.js';
+
+       protected $enableExtJsDebug = FALSE;
+       protected $enableExtCoreDebug = FALSE;
+
+       // available adapters for extJs
+       const EXTJS_ADAPTER_JQUERY = 'jquery';
+       const EXTJS_ADAPTER_PROTOTYPE = 'prototype';
+       const EXTJS_ADAPTER_YUI = 'yui';
+
+       protected $enableExtJSQuickTips = false;
+
+       protected $inlineLanguageLabels = array ();
+       protected $inlineSettings = array ();
+
+       protected $inlineJavascriptWrap = array ();
+
+       // used by BE modules
+       public $backPath;
+
+       /**
+        * Constructor
+        *
+        * @param string $templateFile  declare the used template file. Omit this parameter will use default template
+        * @param string $backPath      relative path to typo3-folder. It varies for BE modules, in FE it will be typo3/
+        * @return void
+        */
+       public function __construct($templateFile = '', $backPath = '') {
+
+               $this->reset();
+
+               if (strlen($templateFile)) {
+                       $this->templateFile = $templateFile;
+               }
+               $this->backPath = $backPath;
+               
+               $this->inlineJavascriptWrap = array(
+                       '<script type="text/javascript">' . chr(10) . '/*<![CDATA[*/' . chr(10) . '<!-- ' . chr(10),
+                       '// -->' . chr(10) . '/*]]>*/' . chr(10) . '</script>' . chr(10)
+               );
+               $this->inlineCssWrap = array(
+                       '<style type="text/css">' . chr(10) . '/*<![CDATA[*/' . chr(10) . '<!-- ' . chr(10),
+                       '-->' . chr(10) . '/*]]>*/' . chr(10) . '</style>' . chr(10)
+               );
+
+       }
+
+       /**
+        * reset all vars to initial values
+        * 
+        * @return void
+        */
+       protected function reset() {
+               $this->templateFile = TYPO3_mainDir . 'templates/template_page_backend.html';
+               $this->jsFiles = array ();
+               $this->jsFooterFiles = array ();
+               $this->jsInline = array ();
+               $this->jsFooterInline = array ();
+               $this->jsLibs = array ();
+               $this->cssFiles = array ();
+               $this->cssInline = array ();
+               $this->metaTags = array ();
+               $this->inlineComments = array ();
+               $this->headerData = array ();
+               $this->footerData = array ();
+               $this->extOnReadyCode = array ();
+       }
+       /*****************************************************/
+       /*                                                   */
+       /*  Public Setters                                   */
+       /*                                                   */
+       /*                                                   */
+       /*****************************************************/
+
+       /**
+        * Sets the title
+        *
+        * @param string $title title of webpage
+        * @return void
+        */
+       public function setTitle($title) {
+               $this->title = $title;
+       }
+
+       /**
+        * Sets xml prolog and docType
+        *
+        * @param string $xmlPrologAndDocType   complete tags for xml prolog and docType
+        * @return void
+        */
+       public function setXmlPrologAndDocType($xmlPrologAndDocType) {
+               $this->xmlPrologAndDocType = $xmlPrologAndDocType;
+       }
+
+       /**
+        * Sets meta charset
+        * @return void
+        *
+        * @param string $charSet       used charset
+        */
+       public function setCharSet($charSet) {
+               $this->charSet = $charSet;
+       }
+
+       /**
+        * Sets html tag
+        *
+        * @param string $htmlTag       html tag
+        * @return void
+        */
+       public function setHtmlTag($htmlTag) {
+               $this->htmlTag = $htmlTag;
+       }
+
+       /**
+        * Sets head tag
+        *
+        * @param string $tag   head tag
+        * @return void
+        */
+       public function setHeadTag($headTag) {
+               $this->headTag = $headTag;
+       }
+
+       /**
+        * Sets favicon
+        *
+        * @param string $favIcon
+        * @return void
+        */
+       public function setFavIcon($favIcon) {
+               $this->favIcon = $favIcon;
+       }
+
+       /**
+        * Sets icon mime type
+        *
+        * @param string $iconMimeType
+        * @return void
+        */
+       public function setIconMimeType($iconMimeType) {
+               $this->iconMimeType = $iconMimeType;
+       }
+
+       /**
+        * Sets base url
+        *
+        * @param string $url
+        * @return void
+        */
+       public function setBaseUrl($baseUrl) {
+               $this->baseUrl = $baseUrl;
+       }
+
+       /**
+        * Sets template file
+        *
+        * @param string $file
+        * @return void
+        */
+       public function setTemplateFile($file) {
+               $this->templateFile = $file;
+       }
+
+       /**
+        * Sets Content for Body
+        *
+        * @param string $content
+        * @return void
+        */
+       public function setBodyContent($content) {
+               $this->bodyContent = $content;
+       }
+
+       /*****************************************************/
+       /*                                                   */
+       /*  Public Enablers                                  */
+       /*                                                   */
+       /*                                                   */
+       /*****************************************************/
+       /**
+        * Enables MoveJsFromHeaderToFooter
+        *
+        * @param void
+        * @return void
+        */
+       public function enableMoveJsFromHeaderToFooter() {
+               $this->moveJsFromHeaderToFooter = TRUE;
+       }
+
+       /**
+        * Enables compression of javascript
+        *
+        * @param void
+        * @return void
+        */
+       public function enableCompressJavascript() {
+               $this->compressJavascript = TRUE;
+       }
+
+       /**
+        * Enables compression of css
+        *
+        * @param void
+        * @return void
+        */
+       public function enableCompressCss() {
+               $this->compressCss = TRUE;
+       }
+
+       /**
+       /**
+        * Enables concatenation of js/css files
+        *
+        * @param void
+        * @return void
+        */
+       public function enableConcatenateFiles() {
+               $this->concatenateFiles = TRUE;
+       }
+
+       /**
+        * Sets removal of all line breaks in template
+        *
+        * @param void
+        * @return void
+        */
+       public function enableRemoveLineBreaksFromTemplate() {
+               $this->removeLineBreaksFromTemplate = TRUE;
+       }
+
+       /*****************************************************/
+       /*                                                   */
+       /*  Public Getters                                   */
+       /*                                                   */
+       /*                                                   */
+       /*****************************************************/
+
+       /**
+        * Gets the title
+        *
+        * @return string $title                title of webpage
+        */
+       public function getTitle() {
+               return $this->title;
+       }
+
+       /**
+        * Gets the charSet
+        *
+        * @return string $charSet
+        */
+       public function getCharSet() {
+               return $this->charSet;
+       }
+
+       /**
+        * Gets html tag
+        *
+        * @return string $htmlTag      html tag
+        */
+       public function getHtmlTag() {
+               return $this->htmlTag;
+       }
+
+       /**
+        * Gets head tag
+        *
+        * @return string $tag  head tag
+        */
+       public function getHeadTag() {
+               return $this->headTag;
+       }
+
+       /**
+        * Gets favicon
+        *
+        * @return string $favIcon
+        */
+       public function getFavIcon() {
+               return $this->favIcon;
+       }
+
+       /**
+        * Gets icon mime type
+        *
+        * @return string $iconMimeType
+        */
+       public function getIconMimeType() {
+               return $this->iconMimeType;
+       }
+
+       /**
+        * Gets base url
+        *
+        * @return string $url
+        */
+       public function getBaseUrl() {
+               return $this->baseUrl;
+       }
+
+       /**
+        * Gets template file
+        *
+        * @return string $file
+        */
+       public function getTemplateFile($file) {
+               return $this->templateFile;
+       }
+
+       /**
+        * Gets MoveJsFromHeaderToFooter
+        *
+        * @return boolean 
+        */
+       public function getMoveJsFromHeaderToFooter() {
+               return $this->moveJsFromHeaderToFooter;
+       }
+
+       /**
+        * Gets compress of javascript
+        *
+        * @return boolean 
+        */
+       public function getCompressJavascript() {
+               return $this->compressJavascript;
+       }
+
+       /**
+        * Gets compress of css
+        *
+        * @return boolean 
+        */
+       public function getCompressCss() {
+               return $this->compressCss;
+       }
+
+       /**
+        * Gets concatenate of files
+        *
+        * @return boolean 
+        */
+       public function getConcatenateFiles() {
+               return $this->concatenateFiles;
+       }
+
+       /**
+        * Gets remove of empty lines from template
+        *
+        * @return boolean 
+        */
+       public function getRemoveLineBreaksFromTemplate() {
+               return $this->removeLineBreaksFromTemplate;
+       }
+
+       /**
+        * Gets content for body
+        *
+        * @return string
+        */
+       public function getBodyContent() {
+               return $this->bodyContent;
+       }
+
+       /*****************************************************/
+       /*                                                   */
+       /*  Public Function to add Data                      */
+       /*                                                   */
+       /*                                                   */
+       /*****************************************************/
+       
+       /**
+        * Adds meta data
+        *
+        * @param string $meta  meta data (complete metatag)
+        * @return void
+        */
+       public function addMetaTag($meta) {
+               if (!in_array($meta, $this->metaTags)) {
+                       $this->metaTags[] = $meta;
+               }
+       }
+
+       /**
+        * Adds inline HTML comment
+        *
+        * @param string $comment
+        * @return void
+        */
+       public function addInlineComment($comment) {
+               if (!in_array($comment, $this->inlineComments)) {
+                       $this->inlineComments[] = $comment;
+               }
+       }
+
+       /**
+        * Adds header data
+        *
+        * @param string $data  free header data for HTML header
+        * @return void
+        */
+       public function addHeaderData($data) {
+               if (!in_array($data, $this->headerData)) {
+                       $this->headerData[] = $data;
+               }
+       }
+
+       /**
+        * Adds footer data
+        *
+        * @param string $data  free header data for HTML header
+        * @return void
+        */
+       public function addFooterData($data) {
+               if (!in_array($data, $this->footerData)) {
+                       $this->footerData[] = $data;
+               }
+       }
+
+       /* Javascript Files */
+       
+       /**
+        * Adds JS Library. JS Library block is rendered on top of the JS files.
+        *
+        * @param string $name
+        * @param string $file
+        * @param string $type
+        * @param boolean $compressed   flag if library is compressed
+        * @param boolean $forceOnTop   flag if added library should be inserted at begin of this block
+        * @param string $allWrap
+        * @return void
+        */
+       public function addJsLibrary($name, $file, $type = 'text/javascript', $compressed = TRUE, $forceOnTop = FALSE, $allWrap = '') {
+               if (!in_array(strtolower($name), $this->jsLibs)) {
+                       $this->jsLibs[strtolower($name)] = array (
+                               'file'        => $file, 
+                               'type'        => $type, 
+                               'section'     => self::PART_HEADER,
+                               'compressed'  => $compressed, 
+                               'forceOnTop'  => $forceOnTop,
+                               'allWrap'     => $allWrap
+                       );
+               }
+       
+       }
+
+       /**
+        * Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.
+        *
+        * @param string $name
+        * @param string $file
+        * @param string $type
+        * @param boolean $compressed   flag if library is compressed
+        * @param boolean $forceOnTop   flag if added library should be inserted at begin of this block
+        * @param string $allWrap
+        * @return void
+        */
+       public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compressed = TRUE, $forceOnTop = FALSE, $allWrap = '') {
+               if (!in_array(strtolower($name), $this->jsLibs)) {
+                       $this->jsLibs[strtolower($name)] = array (
+                               'file'        => $file, 
+                               'type'        => $type, 
+                               'section'     => self::PART_FOOTER,
+                               'compressed'  => $compressed, 
+                               'forceOnTop'  => $forceOnTop,
+                               'allWrap'     => $allWrap
+                       );
+               }
+       
+       }
+
+       /**
+        * Adds JS file
+        *
+        * @param string $file
+        * @param string $type
+        * @param boolean $compressed
+        * @param boolean $forceOnTop
+        * @param string $allWrap
+        * @return void
+        */
+       public function addJsFile($file, $type = 'text/javascript', $compressed = FALSE, $forceOnTop = FALSE, $allWrap = '') {
+               if (!isset($this->jsFiles[$file])) {
+                       $this->jsFiles[$file] = array (
+                               'type'        => $type, 
+                               'section'     => self::PART_HEADER, 
+                               'compressed'  => $compressed, 
+                               'forceOnTop'  => $forceOnTop, 
+                               'allWrap'     => $allWrap
+                       );
+               }
+       }
+
+       /**
+        * Adds JS file to footer
+        *
+        * @param string $file
+        * @param string $type
+        * @param boolean $compressed
+        * @param boolean $forceOnTop
+        * @return void
+        */
+       public function addJsFooterFile($file, $type = 'text/javascript', $compressed = FALSE, $forceOnTop = FALSE, $allWrap = '') {
+               if (!isset($this->jsFiles[$file])) {
+                       $this->jsFiles[$file] = array (
+                               'type'        => $type, 
+                               'section'     => self::PART_FOOTER, 
+                               'compressed'  => $compressed, 
+                               'forceOnTop'  => $forceOnTop, 
+                               'allWrap'     => $allWrap
+                       );
+               }
+       }
+
+       /*Javascript Inline Blocks */
+       
+       /**
+        * Adds JS inline code
+        *
+        * @param string $name
+        * @param string $block
+        * @param boolean $compressed
+        * @param boolean $forceOnTop
+        * @return void
+        */
+       public function addJsInlineCode($name, $block, $compressed = FALSE, $forceOnTop = FALSE) {
+               if (!isset($this->jsInline[$name])) {
+                       $this->jsInline[$name] = array (
+                               'code'        => $block . chr(10),
+                               'section'     => self::PART_HEADER, 
+                               'compressed'  => $compressed,
+                               'forceOnTop'  => $forceOnTop
+                       );
+               }
+       }
+
+       /**
+        * Adds JS inline code to footer
+        *
+        * @param string $name
+        * @param string $block
+        * @param boolean $compressed
+        * @param boolean $forceOnTop
+        * @return void
+        */
+       public function addJsFooterInlineCode($name, $block, $compressed = FALSE, $forceOnTop = FALSE) {
+               if (!isset($this->jsInline[$name])) {
+                       $this->jsInline[$name] = array (
+                               'code'        => $block . chr(10),
+                               'section'     => self::PART_FOOTER,
+                               'compressed'  => $compressed,
+                               'forceOnTop'  => $forceOnTop
+                       );
+               }
+       }
+
+       /**
+        * Adds Ext.onready code, which will be wrapped in Ext.onReady(function() {...});
+        *
+        * @param string $block
+        * @return void
+        */
+       public function addExtOnReadyCode($block) {
+               if (!in_array($block, $this->extOnReadyCode)) {
+                       $this->extOnReadyCode[] = $block;
+               }
+       }
+
+       /* CSS Files */
+       
+       /**
+        * Adds CSS file
+        *
+        * @param string $file
+        * @param string $rel
+        * @param string $media
+        * @param string $title
+        * @param boolean $compressed
+        * @param boolean $forceOnTop
+        * @return void
+        */
+       public function addCssFile($file, $rel = 'stylesheet', $media = 'screen', $title = '', $compressed = FALSE, $forceOnTop = FALSE, $allWrap = '') {
+               if (!isset($this->cssFiles[$file])) {
+                       $this->cssFiles[$file] = array ('rel' => $rel, 'media' => $media, 'title' => $title, 'compressed' => $compressed, 'forceOnTop' => $forceOnTop, 'allWrap' => $allWrap);
+               }
+       }
+
+       /*CSS Inline Blocks */
+       
+       /**
+        * Adds CSS inline code
+        *
+        * @param string $name
+        * @param string $block
+        * @param boolean $compressed
+        * @param boolean $forceOnTop
+        * @return void
+        */
+       public function addCssInlineBlock($name, $block, $compressed = FALSE, $forceOnTop = FALSE) {
+               if (!isset($this->cssInline[$name])) {
+                       $this->cssInline[$name] = array ('code' => $block, 'compressed' => $compressed, 'forceOnTop' => $forceOnTop);
+               }
+       }
+
+       /* JS Libraries */
+       
+       /**
+        *  call function if you need the prototype library
+        *
+        * @return void
+        */
+       public function loadPrototype() {
+               $this->addPrototype = TRUE;
+       }
+
+       /**
+        * call function if you need the Scriptaculous library
+        *
+        * @param string $modules   add modules you need. use "all" if you need complete modules
+        * @return void
+        */
+       public function loadScriptaculous($modules = '') {
+               // Scriptaculous require prototype, so load prototype too.
+               $this->addPrototype = TRUE;
+               $this->addScriptaculous = TRUE;
+               if ($modules) {
+                       if ($modules == 'all') {
+                               foreach ($this->addScriptaculousModules as $key => $value) {
+                                       $this->addScriptaculousModules[$key] = TRUE;
+                               }
+                       } else {
+                               $mods = t3lib_div::trimExplode(',', $modules);
+                               foreach ($mods as $mod) {
+                                       if (isset($this->addScriptaculousModules[strtolower($mod)])) {
+                                               $this->addScriptaculousModules[strtolower($mod)] = TRUE;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       /**
+        * call this function if you need the extJS library
+        *
+        * @param boolean $css flag, if set the ext-css will be loaded
+        * @param boolean $theme flag, if set the ext-theme "grey" will be loaded
+        * @param string $adapter choose alternative adapter, possible values: yui, prototype, jquery
+        * @return void
+        */
+       public function loadExtJS($css = TRUE, $theme = TRUE, $adapter = '') {
+               if ($adapter) {
+                       // empty $adapter will always load the ext adapter
+                       switch (t3lib_div::strtolower(trim($adapter))) {
+                               case self::EXTJS_ADAPTER_YUI :
+                                       $this->extJSadapter = 'yui/ext-yui-adapter.js';
+                                       break;
+                               case self::EXTJS_ADAPTER_PROTOTYPE :
+                                       $this->extJSadapter = 'prototype/ext-prototype-adapter.js';
+                                       break;
+                               case self::EXTJS_ADAPTER_JQUERY :
+                                       $this->extJSadapter = 'jquery/ext-jquery-adapter.js';
+                                       break;
+                       }
+               }
+               if (!$this->addExtJS) {
+                       $this->addExtJS = TRUE;
+                       if ($theme) {
+                               if (isset($GLOBALS['TBE_STYLES']['extJS']['theme'])) {
+                                       $this->addCssFile($this->backPath . $GLOBALS['TBE_STYLES']['extJS']['theme'], 'stylesheet', 'screen', '', FALSE, TRUE);
+                               } else {
+                                       $this->addCssFile($this->backPath . 'contrib/extjs/resources/css/xtheme-blue.css', 'stylesheet', 'screen', '', FALSE, TRUE);
+                               }
+                       }
+                       if ($css) {
+                               if (isset($GLOBALS['TBE_STYLES']['extJS']['all'])) {
+                                       $this->addCssFile($this->backPath . $GLOBALS['TBE_STYLES']['extJS']['all'], 'stylesheet', 'screen', '', FALSE, TRUE);
+                               } else {
+                                       $this->addCssFile($this->backPath . 'contrib/extjs/resources/css/ext-all-notheme.css', 'stylesheet', 'screen', '', FALSE, TRUE);
+                               }
+                       }
+               
+               }
+       }
+
+       /**
+        * Enables ExtJs QuickTips
+        * Need extJs loaded
+        * 
+        * @return void
+        * 
+        */
+       public function enableExtJSQuickTips() {
+               $this->enableExtJSQuickTips = TRUE;
+       }
+
+
+       /**
+        * call function if you need the ExtCore library
+        *
+        * @return void
+        */
+       public function loadExtCore() {
+               $this->addExtCore = TRUE;
+       }
+
+       /**     
+        * call this function to load debug version of ExtJS. Use this for development only
+        *
+        */
+       public function enableExtJsDebug() {
+               $this->enableExtJsDebug = TRUE;
+       }
+
+       /**
+        * call this function to load debug version of ExtCore. Use this for development only
+        *
+        * @return void
+        */
+       public function enableExtCoreDebug() {
+               $this->enableExtCoreDebug = TRUE;
+       }
+
+       /**
+        * Adds Javascript Inline Label. This will occur in TYPO3.lang - object
+        * The label can be used in scripts with TYPO3.lang.<key>
+        * Need extJs loaded
+        * 
+        * @param string $key
+        * @param string $value
+        * @return void
+        */
+       public function addInlineLanguageLabel($key, $value) {
+               $this->inlineLanguageLabels[$key] = $value;
+       }
+
+       /**
+        * Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object
+        * The label can be used in scripts with TYPO3.lang.<key>
+        * Array will be merged with existing array.
+        * Need extJs loaded   
+        * 
+        * @param array $array
+        * @return void
+        */
+       public function addInlineLanguageLabelArray(array $array) {
+               $this->inlineLanguageLabels = array_merge($this->inlineLanguageLabels, $array);
+       }
+
+       /**
+        * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
+        * The label can be used in scripts with TYPO3.setting.<key>
+        * Need extJs loaded   
+        * 
+        * @param string $namespace
+        * @param string $key
+        * @param string $value
+        * @return void
+        */
+       public function addInlineSetting($namespace, $key, $value) {
+               if ($namespace) {
+                       if (strpos($namespace, '.')) {
+                               $parts = explode('.', $namespace);
+                               $a = &$this->inlineSettings;
+                               foreach ($parts as $part) {
+                                       $a = &$a[$part];
+                               }
+                               $a[$key] = $value;
+                       } else {
+                               $this->inlineSettings[$namespace][$key] = $value;
+                       }
+               } else {
+                       $this->inlineSettings[$key] = $value;
+               }
+       }
+
+       /**
+        * Adds Javascript Inline Setting. This will occur in TYPO3.settings - object
+        * The label can be used in scripts with TYPO3.setting.<key>
+        * Array will be merged with existing array.
+        * Need extJs loaded   
+        * 
+        * @param string $namespace
+        * @param array $array
+        * @return void
+        */
+       public function addInlineSettingArray($namespace, array $array) {
+               if ($namespace) {
+                       if (strpos($namespace, '.')) {
+                               $parts = explode('.', $namespace);
+                               $a = &$this->inlineSettings;
+                               foreach ($parts as $part) {
+                                       $a = &$a[$part];
+                               }
+                               $a = array_merge((array) $a, $array);
+                       } else {
+                               $this->inlineSettings[$namespace] = array_merge((array) $this->inlineSettings[$namespace], $array);
+                       }
+               } else {
+                       $this->inlineSettings = array_merge($this->inlineSettings, $array);
+               }
+       }
+
+       /**
+        * Adds content to body content
+        *
+        * @param string $content
+        * @return void
+        */
+       public function addBodyContent($content) {
+               $this->bodyContent .= $content;
+       }
+
+       /*****************************************************/
+       /*                                                   */
+       /*  Render Functions                                 */
+       /*                                                   */
+       /*                                                   */
+       /*****************************************************/
+       
+       /**
+        * render the section (Header or Footer)
+        *
+        * @param int $part     section which should be rendered: self::PART_COMPLETE, self::PART_HEADER or self::PART_FOOTER
+        * @return string       content of rendered section
+        */
+       public function render($part = self::PART_COMPLETE) {
+
+               $jsFiles = '';
+               $cssFiles = '';
+               $cssInline = '';
+               $jsInline = '';
+               $jsFooterInline = '';
+               $jsFooterLibs = '';
+               $jsFooterFiles = '';
+               $noJS = FALSE;
+
+               $jsLibs = $this->renderJsLibraries();
+
+               if ($this->compressCss || $this->compressJavascript) {
+                               // do the file compression
+                       $this->doCompress();
+               }
+               if ($this->concatenateFiles) {
+                               // do the file concatenation
+                       $this->doConcatenate();
+               }
+
+               $metaTags = implode(chr(10), $this->metaTags);
+
+               if (count($this->cssFiles)) {
+                       foreach ($this->cssFiles as $file => $properties) {
+                               $tag = '<link rel="' . $properties['rel'] . '" type="text/css" href="' . $file . '" media="' . $properties['media'] . '"' . ($properties['title'] ? ' title="' . $properties['title'] . '"' : '') . ' />';
+                               if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
+                                       $tag = str_replace('|', $tag, $properties['allWrap']);
+                               }
+                               if ($properties['forceOnTop']) {
+                                       $cssFiles = $tag . chr(10) . $cssFiles;
+                               } else {
+                                       $cssFiles .= chr(10) . $tag;
+                               }
+                       }
+               }
+
+               if (count($this->cssInline)) {
+                       
+                       foreach ($this->cssInline as $name => $properties) {
+                               if ($properties['forceOnTop']) {
+                                       $cssInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $cssInline;
+                               } else {
+                                       $cssInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);
+                               }
+                       }
+                       $cssInline = $this->inlineCssWrap[0] . $cssInline . $this->inlineCssWrap[1];
+
+               }
+
+               if (count($this->jsLibs)) {
+                       foreach ($this->jsLibs as $name => $properties) {
+                               $tag = '<script src="' . $properties['file'] . '" type="' . $properties['type'] . '"></script>';
+                               if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
+                                       $tag = str_replace('|', $tag, $properties['allWrap']);
+                               }
+                               if ($properties['forceOnTop']) {
+                                       if ($properties['section'] === self::PART_HEADER) {
+                                               $jsLibs = $tag . chr(10) . $jsLibs;
+                                       } else {
+                                               $jsFooterLibs = $tag . chr(10) . $jsFooterLibs;
+                                       }
+                               } else {
+                                       if ($properties['section'] === self::PART_HEADER) {
+                                               $jsLibs .= chr(10) . $tag;
+                                       } else {
+                                               $jsFooterLibs .= chr(10) . $tag;
+                                       }
+                               }
+                               
+                       }
+               }
+
+               if (count($this->jsFiles)) {
+                       foreach ($this->jsFiles as $file => $properties) {
+                                       $tag = '<script src="' . $file . '" type="' . $properties['type'] . '"></script>';
+                                       if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) {
+                                               $tag = str_replace('|', $tag, $properties['allWrap']);
+                                       }
+                                       if ($properties['forceOnTop']) {
+                                               if ($properties['section'] === self::PART_HEADER) {
+                                                       $jsFiles = $tag . chr(10) . $jsFiles;
+                                               } else {
+                                                       $jsFooterFiles = $tag . chr(10) . $jsFooterFiles;
+                                               }
+                                       } else {
+                                               if ($properties['section'] === self::PART_HEADER) {
+                                                       $jsFiles .= chr(10) . $tag;
+                                               } else {
+                                                       $jsFooterFiles .= chr(10) . $tag;
+                                               }
+                                       }
+                       }
+               }
+
+               if (count($this->jsInline)) {
+                       foreach ($this->jsInline as $name => $properties) {
+                               if ($properties['forceOnTop']) {
+                                       if ($properties['section'] === self::PART_HEADER) {
+                                               $jsInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $jsInline;        
+                                       } else {
+                                               $jsFooterInline = '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10) . $jsFooterInline;
+                                       }
+                               } else {
+                                       if ($properties['section'] === self::PART_HEADER) {
+                                               $jsInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);
+                                       } else {
+                                               $jsFooterInline .= '/*' . htmlspecialchars($name) . '*/' . chr(10) . $properties['code'] . chr(10);
+                                       }
+                               }
+                       }
+               }
+
+
+               if ($jsInline) {
+                       $jsInline = $this->inlineJavascriptWrap[0] . $jsInline . $this->inlineJavascriptWrap[1];
+               }
+
+               if ($jsFooterInline) {
+                       $jsFooterInline = $this->inlineJavascriptWrap[0] . $jsFooterInline . $this->inlineJavascriptWrap[1];
+               }
+
+
+                       // get template
+               $templateFile = t3lib_div::getFileAbsFileName($this->templateFile, TRUE);
+               $template = t3lib_div::getURL($templateFile);
+
+               if ($this->removeEmptyLinesFromTemplate) {
+                       $template = strtr($template, array(chr(10) => '', chr(13) => ''));
+               }
+               if ($part != self::PART_COMPLETE) {
+                       $templatePart = explode('###BODY###', $template);
+                       $template = $templatePart[$part - 1];
+               }
+
+               if ($this->moveJsFromHeaderToFooter) {
+                       $jsFooterLibs = $jsLibs . chr(10) . $jsFooterLibs;
+                       $jsLibs = '';
+                       $jsFooterFiles = $jsFiles . chr(10) . $jsFooterFiles;
+                       $jsFiles = '';
+                       $jsFooterInline = $jsInline . chr(10) . $jsFooterInline;
+                       $jsInline = '';
+               }       
+
+               $markerArray = array(
+                       'XMLPROLOG_DOCTYPE' => $this->xmlPrologAndDocType, 
+                       'HTMLTAG'           => $this->htmlTag, 
+                       'HEADTAG'           => $this->headTag, 
+                       'METACHARSET'       => $this->charSet ? str_replace('|', htmlspecialchars($this->charSet), $this->metaCharsetTag) : '', 
+                       'INLINECOMMENT'     => $this->inlineComments ? chr(10) . chr(10) . '<!-- ' . chr(10) . implode(chr(10), $this->inlineComments) . '-->' . chr(10) . chr(10) : '', 
+                       'BASEURL'           => $this->baseUrl ? str_replace('|', $this->baseUrl, $this->baseUrlTag) : '',
+                       'SHORTCUT'          => $this->favIcon ? sprintf($this->shortcutTag, htmlspecialchars($this->favIcon), $this->iconMimeType) : '', 
+                       'CSS_INCLUDE'       => $cssFiles, 
+                       'CSS_INLINE'        => $cssInline, 
+                       'JS_INLINE'         => $jsInline, 
+                       'JS_INCLUDE'        => $jsFiles, 
+                       'JS_LIBS'               => $jsLibs, 
+                       'TITLE'             => $this->title ? str_replace('|', htmlspecialchars($this->title), $this->titleTag) : '', 
+                       'META'              => $metaTags, 
+                       'HEADERDATA'        => $this->headerData ? implode(chr(10), $this->headerData) : '', 
+                       'FOOTERDATA'        => $this->footerData ? implode(chr(10), $this->footerData) : '', 
+                       'JS_LIBS_FOOTER'        => $jsFooterLibs, 
+                       'JS_INCLUDE_FOOTER' => $jsFooterFiles, 
+                       'JS_INLINE_FOOTER'  => $jsFooterInline,
+                       'BODY'                          => $this->bodyContent, 
+               );
+
+               $markerArray = array_map('trim', $markerArray);
+
+               $this->reset();
+               return trim(t3lib_parsehtml::substituteMarkerArray($template, $markerArray, '###|###'));
+       }
+
+       /**
+        * helper function for render the javascript libraries
+        *
+        * @return string       content with javascript libraries
+        */
+       protected function renderJsLibraries() {
+               $out = '';
+
+               if ($this->addPrototype) {
+                       $out .= '<script src="' . $this->backPath . 'contrib/prototype/prototype.js" type="text/javascript"></script>' . chr(10);
+                       unset($this->jsFiles[$this->backPath . 'contrib/prototype/prototype.js']);
+               }
+
+               if ($this->addScriptaculous) {
+                       $mods = array ();
+                       foreach ($this->addScriptaculousModules as $key => $value) {
+                               if ($this->addScriptaculousModules[$key]) {
+                                       $mods[] = $key;
+                               }
+                       }
+                               // resolve dependencies
+                       if (in_array('dragdrop', $mods) || in_array('controls', $mods)) {
+                               $mods = array_merge(array('effects'), $mods);
+                       }
+
+                       if (count($mods)) {
+                               $moduleLoadString = '?load=' . implode(',', $mods);
+                       }
+
+                       $out .= '<script src="' . $this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString . '" type="text/javascript"></script>' . chr(10);
+                       unset($this->jsFiles[$this->backPath . 'contrib/scriptaculous/scriptaculous.js' . $moduleLoadString]);
+               }
+
+                       // include extCore
+               if ($this->addExtCore) {
+                       $out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . chr(10);
+                       unset($this->jsFiles[$this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js']);
+               }
+
+                       // include extJS
+               if ($this->addExtJS) {
+                               // use the base adapter all the time
+                       $out .= '<script src="' . $this->backPath . 'contrib/extjs/adapter/' . $this->extJSadapter . '" type="text/javascript"></script>' . chr(10);
+                       $out .= '<script src="' . $this->backPath . 'contrib/extjs/ext-all' . ($this->enableExtJsDebug ? '-debug' : '') . '.js" type="text/javascript"></script>' . chr(10);
+
+                               // add extJS localization
+                       $localeMap = $this->csConvObj->isoArray; // load standard ISO mapping and modify for use with ExtJS
+                       $localeMap[''] = 'en';
+                       $localeMap['default'] = 'en';
+                       $localeMap['gr'] = 'el_GR'; // Greek
+                       $localeMap['no'] = 'no_BO'; // Norwegian Bokmaal
+                       $localeMap['se'] = 'se_SV'; // Swedish
+
+
+                       $extJsLang = isset($localeMap[$this->lang]) ? $localeMap[$this->lang] : $this->lang;
+                               // TODO autoconvert file from UTF8 to current BE charset if necessary!!!!
+                       $extJsLocaleFile = 'contrib/extjs/locale/ext-lang-' . $extJsLang . '-min.js';
+                       if (file_exists(PATH_typo3 . $extJsLocaleFile)) {
+                               $out .= '<script src="' . $this->backPath . $extJsLocaleFile . '" type="text/javascript"></script>' . chr(10);
+                       }
+
+
+                               // remove extjs from JScodeLibArray
+                       unset(
+                               $this->jsFiles[$this->backPath . 'contrib/extjs/ext-all.js'], $this->jsFiles[$this->backPath . 'contrib/extjs/ext-all-debug.js']
+                       );
+               }
+               if ($this->addExtCore || $this->addExtJS) {
+                               // set clear.gif, move it on top, add handler code
+                       $code = '';
+                       if (count($this->extOnReadyCode)) {
+                               foreach ($this->extOnReadyCode as $block) {
+                                       $code .= $block;
+                               }
+                       }
+
+                       $out .= $this->inlineJavascriptWrap[0] . '
+                               Ext.ns("TYPO3");
+                               Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(t3lib_div::locationHeaderUrl($this->backPath . 'gfx/clear.gif')) . '";' . chr(10) . 
+                               'TYPO3.lang = ' . json_encode($this->inlineLanguageLabels) . ';' . 'TYPO3.settings = ' . json_encode($this->inlineSettings) . ';' .
+                               'Ext.onReady(function() {' .
+                               ($this->enableExtJSQuickTips ? 'Ext.QuickTips.init();' . chr(10) : '') . $code .
+                               ' });' . $this->inlineJavascriptWrap[1];
+                       unset ($this->extOnReadyCode);
+               }
+
+               return $out;
+       }
+
+       /*****************************************************/
+       /*                                                   */
+       /*  Tools                                            */
+       /*                                                   */
+       /*                                                   */
+       /*****************************************************/
+       
+       /**
+        * concatenate files into one file
+        * registered handler
+        * TODO: implement own method
+        *
+        * @return void
+        */
+       protected function doConcatenate() {
+               // traverse the arrays, concatenate in one file
+               // then remove concatenated files from array and add the concatenated file
+
+
+                       // extern concatination
+               if ($this->concatenateFiles && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['concatenateHandler']) {
+                       // use extern concatenate routine
+                       $params = array (
+                               'jsLibs'         => &$this->jsLibs, 
+                               'jsFiles'        => &$this->jsFiles, 
+                               'jsFooterFiles'  => &$this->jsFiles, 
+                               'cssFiles'       => &$this->cssFiles,
+                       );
+                       t3lib_div::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['concatenateHandler'], $params, $this);
+               } else {
+                       // own method, nothing implemented atm
+
+
+               }
+       }
+
+       /**
+        * compress inline code
+        *
+        */
+       protected function doCompress() {
+
+               if ($this->compressJavascript && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler']) {
+                       // use extern compress routine
+                       $params = array (
+                               'jsInline'        => &$this->jsInline, 
+                               'jsFooterInline'  => &$this->jsFooterInline
+                       );
+                       t3lib_div::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['jsCompressHandler'], $params, $this);
+               } else {
+                               // traverse the arrays, compress files
+                       $this->compressError = '';
+                       
+                       if ($this->compressJavascript) {
+                               if (count($this->jsInline)) {
+                                       foreach ($this->jsInline as $name => $properties) {
+                                               if (!$properties['compressed']) {
+                                                       $error = '';
+                                                       $this->jsInline[$name]['code'] = t3lib_div::minifyJavaScript($properties['code'], $error);
+                                                       if ($error) {
+                                                               $this->compressError .= 'Error with minify JS Inline Block "' . $name . '": ' . $error . chr(10);
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               if ($this->compressCss && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler']) {
+                               // use extern compress routine
+                       $params = array (
+                               'cssInline' => &$this->cssInline
+                       );
+                       t3lib_div::callUserFunction($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler'], $params, $this);
+               } else {
+                       if ($this->compressCss) {
+                               // own method, nothing implemented atm
+                       }
+               }
+       }
+
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']) {
+       include_once ($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagerenderer.php']);
+}
 ?>
\ No newline at end of file
index 8a7c990..88954de 100644 (file)
@@ -27,7 +27,7 @@
 /**
  * TCEforms wizard for rendering an AJAX selector for records
  *
- * $Id:$
+ * $Id$
  *
  * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
  * @author Benjamin Mack <benni@typo3.org>