[FEATURE] Add hook to custom header in page mod 60/24460/2
authoreric.chavaillaz <eric@hemmer.ch>
Mon, 7 Oct 2013 15:54:00 +0000 (17:54 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 8 Oct 2013 19:57:36 +0000 (21:57 +0200)
Add an hook to allow modifying the header of a page in the page module.
This hook is called before the content of the page is rendered.

Resolves: #52579
Releases: 6.2
Change-Id: I8914f5617d1529e98b9bc2b27cdc5a4378b0a7da
Reviewed-on: https://review.typo3.org/24460
Reviewed-by: Daniel Huf
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/backend/Classes/Controller/PageLayoutController.php

index bc50244..9ec4e23 100644 (file)
@@ -953,6 +953,16 @@ class PageLayoutController {
                // END: traverse tables
                // For Context Sensitive Menus:
                $this->doc->getContextMenuCode();
+               // Init the content
+               $content = '';
+               // Additional header content
+               $headerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'];
+               if (is_array($headerContentHook)) {
+                       foreach ($headerContentHook as $hook) {
+                               $params = array();
+                               $content .= GeneralUtility::callUserFunction($hook, $params, $this);
+                       }
+               }
                // Add the content for each table we have rendered (traversing $tableOutput variable)
                foreach ($tableOutput as $table => $output) {
                        $content .= $this->doc->section('', $output, TRUE, TRUE, 0, TRUE);