Index: t3lib/class.t3lib_pageincludes.php =================================================================== --- t3lib/class.t3lib_pageincludes.php (revision 0) +++ t3lib/class.t3lib_pageincludes.php (revision 0) @@ -0,0 +1,909 @@ + + * @package TYPO3 + * @subpackage t3lib + */ +class t3lib_pageIncludes implements t3lib_Singleton { + + + public $compressJavascript = FALSE; + public $compressCss = FALSE; + + public $concatenateFiles = FALSE; + + public $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(); + + // static header blocks + protected static $xmlPrologAndDocType = ''; + protected static $metaTags = ''; + protected static $inlineComment = ''; + protected static $headerData = ''; + protected static $footerData = ''; + protected $metaCharsetTag = ''; + protected $titleTag = ''; + protected $htmlTag = ''; + protected $headTag = ''; + protected $baseUrlTag = ''; + protected $shortcutTag = ''; + + // static inline code blocks + protected static $jsInline = array(); + protected static $jsFooterInline = array(); + protected static $jsHandlerCode = array(); + protected static $cssInline = array(); + + protected $templateFile; + + protected $jsLibraryNames = array('prototype', 'scriptaculous', 'extjs'); + + const PART_HEADER = 0; + const PART_FOOTER = 1; + + // 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 $appLoader = FALSE; + protected $appLoaderLabels = ''; + protected $appLoaderIcon = ''; + + 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'; + + // available inline-JsHandler + const JSHANDLER_EXTONREADY = 1; + + public $enableExtJSQuickTips = false; + + protected $inlineLanguageLabels = array(); + protected $inlineSettings = 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->templateFile = $templateFile; + if ($this->templateFile === '') { + $this->templateFile = TYPO3_mainDir.'templates/pageincludes.html'; + } + $this->backPath = $backPath; + $this->csConvObj = TYPO3_MODE == 'BE' ? $GLOBAL['LANG']->csConvObj : $GLOBALS['TSFE']->csConvObj; + $this->lang = TYPO3_MODE == 'BE' ? $GLOBALS['BE_USER']->uc['lang'] : $GLOBALS['TSFE']->lang; + + //init vars + $this->jsFiles = $this->jsFooterFiles = $this->jsInline = $this->jsFooterInline = $this->jsLibs = array(); + $this->cssFiles = $this->cssInline = array(); + + $this->jsHandlerCode[self::JSHANDLER_EXTONREADY] = ''; + } + + + /*****************************************************/ + /* */ + /* Public Function to add Data */ + /* */ + /* */ + /*****************************************************/ + + /** + * set xml prolog and docType + * + * @param string $xmlPrologAndDocType complete tags for xml prolog and docType + */ + public function setXmlPrologAndDocType($xmlPrologAndDocType) { + $this->xmlPrologAndDocType = $xmlPrologAndDocType; + } + + /** + * set page title + * + * @param string $title title of webpage + */ + public function setTitle($title) { + $this->titleTag = '