[TASK] Add sys_notes to info module again
authorGeorg Ringer <mail@ringerge.org>
Thu, 16 Aug 2012 11:35:05 +0000 (13:35 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 18 Aug 2012 10:16:41 +0000 (12:16 +0200)
Once sys_note records have been shown in the info module but
after changing the code, this didn't work anymore.

This patch adds a hook which is then used by sys_note

Change-Id: Ib73db81a508ec88b9502a41c1405e6a47c056c61
Resolves: #39234
Releases: 6.0
Reviewed-on: http://review.typo3.org/13813
Reviewed-by: Wouter Wolters
Reviewed-by: Felix Kopp
Tested-by: Felix Kopp
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/web_info/class.tx_cms_webinfo.php
typo3/sysext/sys_note/Classes/Hooks/InfoModule.php [new file with mode: 0644]
typo3/sysext/sys_note/ext_localconf.php

index 1ed20db..afafcf0 100644 (file)
@@ -109,17 +109,12 @@ class tx_cms_webinfo_page extends t3lib_extobjbase {
                        1
                );
 
-                       // SYS_NOTES:
-               if (t3lib_extMgm::isLoaded('sys_note')) {
-                       $dblist->start($this->pObj->id, 'sys_note', 0);
-                       $dblist->generateList();
-                       if ($dblist->HTMLcode) {
-                               $theOutput.=$this->pObj->doc->spacer(10);
-                               $theOutput.=$this->pObj->doc->section($LANG->getLL('page_sysnote'),
-                                       $dblist->HTMLcode,
-                                       0,
-                                       1
-                               );
+                       // Additional footer content
+               $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
+               if (is_array($footerContentHook)) {
+                       foreach ($footerContentHook as $hook) {
+                               $params = array();
+                               $theOutput .= t3lib_div::callUserFunction($hook, $params, $this);
                        }
                }
 
diff --git a/typo3/sysext/sys_note/Classes/Hooks/InfoModule.php b/typo3/sysext/sys_note/Classes/Hooks/InfoModule.php
new file mode 100644 (file)
index 0000000..6181bc4
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Georg Ringer <typo3@ringerge.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Hook for the info module
+ *
+ * @package TYPO3
+ * @subpackage sys_note
+ * @author Georg Ringer <typo3@ringerge.org>
+ */
+class Tx_SysNote_Hooks_InfoModule {
+
+       /**
+        * Add sys_notes as additional content to the footer of the page module
+        *
+        * @param array $params
+        * @param SC_db_layout $parentObject
+        * @return string
+        */
+       public function render(array $params = array(), tx_cms_webinfo_page $parentObject) {
+               $sysNote = t3lib_div::makeInstance('Tx_SysNote_SysNote');
+
+               $content = $sysNote->renderByPid($parentObject->pObj->id);
+               return $content;
+       }
+}
+
+?>
\ No newline at end of file
index 355ef81..4b0f778 100644 (file)
@@ -7,8 +7,13 @@ if (!defined ('TYPO3_MODE')) {
        // Hook into the list module
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['recordlist/mod1/index.php']['drawFooterHook'][$_EXTKEY] =
        'EXT:' . $_EXTKEY . '/Classes/Hooks/RecordList.php:Tx_Sysnote_Hooks_RecordList->render';
+
        // Hook into the page module
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook'][$_EXTKEY] =
        'EXT:' . $_EXTKEY . '/Classes/Hooks/Page.php:Tx_Sysnote_Hooks_Page->render';
 
+       // Hook into the info module
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'][$_EXTKEY] =
+       'EXT:' . $_EXTKEY . '/Classes/Hooks/InfoModule.php:Tx_Sysnote_Hooks_InfoModule->render';
+
 ?>
\ No newline at end of file