[BUGFIX] Improve hook in Admin Panel
authorGeorg Ringer <mail@ringerge.org>
Mon, 1 Aug 2011 10:56:57 +0000 (12:56 +0200)
committerXavier Perseguers <xavier@typo3.org>
Tue, 2 Aug 2011 14:08:40 +0000 (16:08 +0200)
The current implementation is buggy and can be improved.
- Add $moduleContent as argument
- Use '.=' instead of '='

Change-Id: I0cf40a6f09f5233cdbe3edf58ae1fe383d0b7fb5
Resolve: #28639
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/3973
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/cms/tslib/class.tslib_adminpanel.php
typo3/sysext/cms/tslib/interfaces/interface.tslib_adminPanelHook.php

index 24fd090..f9dd71b 100644 (file)
@@ -285,7 +285,7 @@ class tslib_AdminPanel {
                                        throw new UnexpectedValueException('$hookObject must implement interface tslib_adminPanelHook', 1311942539);
                                }
 
-                               $moduleContent = $hookObject->extendAdminPanel($this);
+                               $moduleContent .= $hookObject->extendAdminPanel($moduleContent, $this);
                        }
                }
 
index b7ad90f..4a4e491 100644 (file)
@@ -37,9 +37,10 @@ interface tslib_adminPanelHook {
        /**
         * Extend the adminPanel
         *
-        * @param tslib_AdminPanel The adminPanel object
-        * @return string Returns additional code
+        * @param string $moduleContent Content of the admin panel
+        * @param tslib_AdminPanel $obj The adminPanel object
+        * @return string Returns content of admin panel
         */
-       public function extendAdminPanel(tslib_AdminPanel $obj);
+       public function extendAdminPanel($moduleContent, tslib_AdminPanel $obj);
 }
 ?>
\ No newline at end of file