+2010-05-30 Oliver Hader <oliver@typo3.org>
+
+ * Added feature #14383: Integrate hooks to backend.php to perform several customizations
+
2010-05-29 Christian Kuhn <lolli@schwarzbu.ch>
* Fixed bug #12872: Use "strong" instead of "b" (Thanks to Steffen Kamper and Stefano Kowalke)
if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW']) && (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'] != (int) $this->menuWidth) {
$this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
}
+
+ $this->executeHook('constructPostProcess');
}
/**
* @return void
*/
public function render() {
+ $this->executeHook('renderPreProcess');
if (t3lib_div::makeInstance('DonateWindow')->isDonateWindowAllowed()) {
$this->pageRenderer->addJsFile('js/donate.js');
$this->content .= $backendScaffolding;
$this->content .= $GLOBALS['TBE_TEMPLATE']->endPage();
+ $hookConfiguration = array('content' => &$this->content);
+ $this->executeHook('renderPostProcess', $hookConfiguration);
+
echo $this->content;
}
unset($toolbarItem);
}
}
+
+ /**
+ * Executes defined hooks functions for the given identifier.
+ *
+ * These hook identifiers are valid:
+ * + constructPostProcess
+ * + renderPreProcess
+ * + renderPostProcess
+ *
+ * @param string $identifier Specific hook identifier
+ * @param array $hookConfiguration Additional configuration passed to hook functions
+ * @return void
+ */
+ protected function executeHook($identifier, array $hookConfiguration = array()) {
+ $options =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/backend.php'];
+
+ if(isset($options[$identifier]) && is_array($options[$identifier])) {
+ foreach($options[$identifier] as $hookFunction) {
+ t3lib_div::callUserFunction($hookFunction, $hookConfiguration, $this);
+ }
+ }
+ }
}