Index: typo3/backend.php =================================================================== --- typo3/backend.php (revision 7072) +++ typo3/backend.php (working copy) @@ -76,6 +76,14 @@ protected $moduleMenu; /** + * Pagerenderer + * + * @var $pageRenderer t3lib_PageRenderer + */ + protected $pageRenderer; + + + /** * constructor * * @return void @@ -88,6 +96,21 @@ $this->moduleMenu = t3lib_div::makeInstance('ModuleMenu'); + + $this->pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer(); + $this->pageRenderer->loadScriptaculous('builder,effects,controls,dragdrop'); + $this->pageRenderer->loadExtJS(); + + // register the extDirect API providers + // Note: we need to iterate thru the object, because the addProvider method + // does this only with multiple arguments + $this->pageRenderer->addExtOnReadyCode( + 'for (var api in Ext.app.ExtDirectAPI) { + Ext.Direct.addProvider(Ext.app.ExtDirectAPI[api]); + }', + TRUE + ); + // add default BE javascript $this->js = ''; $this->jsFiles = array( @@ -103,13 +126,11 @@ 'js/iecompatibility.js', 'js/flashupload.js', '../t3lib/jsfunc.evalfield.js', - 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Backend' - ); - - $this->jsFilesAfterInline = array( + 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Backend', 'js/backend.js', 'js/loginrefresh.js', ); + // add default BE css $this->css = ''; $this->cssFiles = array( @@ -207,50 +228,23 @@ * now put the complete backend document together ******************************************************/ - /** @var $pageRenderer t3lib_PageRenderer */ - $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer(); - $pageRenderer->loadScriptaculous('builder,effects,controls,dragdrop'); - $pageRenderer->loadExtJS(); - - // register the extDirect API providers - // Note: we need to iterate thru the object, because the addProvider method - // does this only with multiple arguments - $pageRenderer->addExtOnReadyCode( - 'for (var api in Ext.app.ExtDirectAPI) { - Ext.Direct.addProvider(Ext.app.ExtDirectAPI[api]); - }', - TRUE - ); - - // remove duplicate entries - $this->jsFiles = array_unique($this->jsFiles); - - // add javascript - foreach($this->jsFiles as $jsFile) { - $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib($jsFile); - } - $GLOBALS['TBE_TEMPLATE']->JScode .= chr(10); - $this->generateJavascript(); - $GLOBALS['TBE_TEMPLATE']->JScode .= $GLOBALS['TBE_TEMPLATE']->wrapScriptTags($this->js) . chr(10); - - foreach($this->jsFilesAfterInline as $jsFile) { - $GLOBALS['TBE_TEMPLATE']->JScode .= ' - '; - } - - - // FIXME abusing the JS container to add CSS, need to fix template.php foreach($this->cssFiles as $cssFileName => $cssFile) { - $GLOBALS['TBE_TEMPLATE']->addStyleSheet($cssFileName, $cssFile); - + $this->pageRenderer->addCssFile($cssFile); // load addditional css files to overwrite existing core styles if(!empty($GLOBALS['TBE_STYLES']['stylesheets'][$cssFileName])) { - $GLOBALS['TBE_TEMPLATE']->addStyleSheet($cssFileName . 'TBE_STYLES', $GLOBALS['TBE_STYLES']['stylesheets'][$cssFileName]); + $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheets'][$cssFileName]); } } + foreach ($this->jsFiles as $jsFile) { + $this->pageRenderer->addJsFile($jsFile); + } + + $this->generateJavascript(); + $this->pageRenderer->addJsInlineCode('BackendInlineJavascript', $this->js); + if(!empty($this->css)) { - $GLOBALS['TBE_TEMPLATE']->inDocStylesArray['backend.php'] = $this->css; + $this->pageRenderer->addCssInlineBlock('BackendInlineCSS', $this->css); } // set document title: @@ -642,7 +636,7 @@ } /** - * adds a css file to the backend after it has been checked that it exists + * adds a css file to the backend * * @param string the css file's name with out the .css ending * @param string css file reference @@ -651,13 +645,9 @@ public function addCssFile($cssFileName, $cssFile) { $cssFileAdded = false; - //TODO add more checks if neccessary - if(file_exists(t3lib_div::resolveBackPath(PATH_typo3.$cssFile))) { - // prevent overwriting existing css files - if(empty($this->cssFiles[$cssFileName])) { - $this->cssFiles[$cssFileName] = $cssFile; - $cssFileAdded = true; - } + if(empty($this->cssFiles[$cssFileName])) { + $this->cssFiles[$cssFileName] = $cssFile; + $cssFileAdded = true; } return $cssFileAdded; Index: typo3/js/backend.js =================================================================== --- typo3/js/backend.js (revision 7072) +++ typo3/js/backend.js (working copy) @@ -29,8 +29,8 @@ */ +Ext.ns('TYPO3.configuration'); - /** * jump the backend to a module */