[FEATURE] Add drawHeaderHook to EXT:recordlist 23/55423/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 22 Jan 2018 09:11:29 +0000 (10:11 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 23 Jan 2018 19:28:02 +0000 (20:28 +0100)
Add an additional hook to the EXT:recordlist which makes
it possible to add content above any other content.

Resolves: #61170
Releases: master
Change-Id: I2f6ad79cfb5ff19f57da63346735b743947ddf99
Reviewed-on: https://review.typo3.org/55423
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Peter Kraume <peter.kraume@gmx.de>
Tested-by: Peter Kraume <peter.kraume@gmx.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Feature-61170-AddAdditionalHookForRecordList.rst [new file with mode: 0644]
typo3/sysext/recordlist/Classes/RecordList.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-61170-AddAdditionalHookForRecordList.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-61170-AddAdditionalHookForRecordList.rst
new file mode 100644 (file)
index 0000000..150505a
--- /dev/null
@@ -0,0 +1,20 @@
+.. include:: ../../Includes.txt
+
+=====================================================
+Feature: #61170 - Add additional hook for record list
+=====================================================
+
+See :issue:`61170`
+
+Description
+===========
+
+An additional hook is added to `EXT:recordlist` to render content above any other content.
+
+Example of usage
+
+.. code-block:: php
+
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook']['sys_note'] = \Vendor\Extkey\Hooks\PageHook::class . '->render';
+
+.. index:: Backend, NotScanned
index d2afff3..2dcc33d 100644 (file)
@@ -460,6 +460,13 @@ class RecordList
             $title = $this->pageinfo['title'];
         }
         $this->body = $this->moduleTemplate->header($title);
+
+        // Additional header content
+        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/Modules/Recordlist/index.php']['drawHeaderHook'] ?? [] as $hook) {
+            $params = [];
+            $this->body .= GeneralUtility::callUserFunction($hook, $params, $this);
+        }
+
         $this->moduleTemplate->setTitle($title);
 
         $output = '';