Added feature #14546: Hook in typo3/template.php to add additional header data (Thank...
authorBenni Mack <benni.mack@typo3.org>
Fri, 11 Jun 2010 21:59:10 +0000 (21:59 +0000)
committerBenni Mack <benni.mack@typo3.org>
Fri, 11 Jun 2010 21:59:10 +0000 (21:59 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7882 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/template.php

index 9b866ee..544fdab 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-06-11  Benjamin Mack  <benni@typo3.org>
 
+       * Added feature #14546: Hook in typo3/template.php to add additional header data (Thanks to Steffen Ritter)
        * Fixed bug #14598: Add unique column name in page module (Thanks to Steffen Gebert)
        * Followup to #485: Hookrequest for ~ TemplaVoila unlink doesn't work for Non-Admins - added an additional hook parameter (Thanks to Tolleiv Nietsch)
 
index ea70409..92b37aa 100644 (file)
@@ -798,6 +798,19 @@ class template {
                        $this->pageRenderer->addExtOnReadyCode($this->extJScode);
                }
 
+                       // hook for additional headerData
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'])) {
+                       $preHeaderRenderHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'];
+                       if (is_array($preHeaderRenderHook)) {
+                               $hookParameters = array(
+                                       'pageRenderer' => &$this->pageRenderer,
+                               );
+                               foreach ($preHeaderRenderHook as $hookFunction) {
+                                       t3lib_div::callUserFunction($hookFunction, $hookParameters, $this);
+                               }
+                       }
+               }
+
                        // Construct page header.
                $str = $this->pageRenderer->render(t3lib_PageRenderer::PART_HEADER);
 
@@ -814,8 +827,8 @@ $str.=$this->docBodyTagBegin().
 ($this->divClass?'
 
 <!-- Wrapping DIV-section for whole page BEGIN -->
-<div class="'.$this->divClass.'">
-':'').trim($this->form);
+<div class="' . $this->divClass . '">
+' : '' ) . trim($this->form);
                return $str;
        }
 
@@ -2278,4 +2291,5 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/templ
 // ******************************
 $GLOBALS['TBE_TEMPLATE'] = t3lib_div::makeInstance('template');
 
+
 ?>