Added feature #13952: Hookrequest - t3lib_page::getPageOverlay (thanks to Tolleiv...
authorSteffen Kamper <info@sk-typo3.de>
Sat, 10 Apr 2010 21:01:53 +0000 (21:01 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sat, 10 Apr 2010 21:01:53 +0000 (21:01 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7273 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_page.php
t3lib/core_autoload.php
t3lib/interfaces/interface.t3lib_pageselect_getpageoverlayhook.php [new file with mode: 0644]

index 05ba681..4cb6d16 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-04-10  Steffen Kamper  <info@sk-typo3.de>
 
+       * Added feature  #13952: Hookrequest - t3lib_page::getPageOverlay (thanks to Tolleiv Nietsch)
        * Fixed bug #485: Hookrequest for ~ TemplaVoila unlink doesn't work for Non-Admins (thanks to Tolleiv Nietsch)
 
 2010-04-10  Stanislas Rolland  <typo3@sjbr.ca>
index fe3e619..ec96876 100644 (file)
@@ -306,6 +306,18 @@ class t3lib_pageSelect {
                if ($lUid<0)    $lUid = $this->sys_language_uid;
                $row = NULL;
 
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] as $classRef) {
+                               $hookObject = t3lib_div::getUserObj($classRef);
+
+                               if (!($hookObject instanceof t3lib_pageSelect_getPageOverlayHook)) {
+                                       throw new UnexpectedValueException('$hookObject must implement interface t3lib_pageSelect_getPageOverlayHook', 1269878881);
+                               }
+
+                               $hookObject->getPageOverlay_preProcess($pageInput, $lUid, $this);
+                       }
+               }
+
                        // If language UID is different from zero, do overlay:
                if ($lUid)      {
                        $fieldArr = explode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields']);
index 9f72d0d..46de3af 100644 (file)
@@ -112,6 +112,7 @@ return array(
        't3lib_browselinkshook' => PATH_t3lib . 'interfaces/interface.t3lib_browselinkshook.php',
        't3lib_localrecordlistgettablehook' => PATH_t3lib . 'interfaces/interface.t3lib_localrecordlistgettablehook.php',
        't3lib_pageselect_getpagehook' => PATH_t3lib . 'interfaces/interface.t3lib_pageselect_getpagehook.php',
+       't3lib_pageselect_getpageoverlayhook' => PATH_t3lib . 'interfaces/interface.t3lib_pageselect_getpageoverlayhook.php',
        't3lib_singleton' => PATH_t3lib . 'interfaces/interface.t3lib_singleton.php',
        't3lib_tceformsinlinehook' => PATH_t3lib . 'interfaces/interface.t3lib_tceformsinlinehook.php',
        't3lib_tcemain_checkmodifyaccesslisthook' => PATH_t3lib . 'interfaces/interface.t3lib_tcemain_checkmodifyaccesslisthook.php',
diff --git a/t3lib/interfaces/interface.t3lib_pageselect_getpageoverlayhook.php b/t3lib/interfaces/interface.t3lib_pageselect_getpageoverlayhook.php
new file mode 100644 (file)
index 0000000..e773a70
--- /dev/null
@@ -0,0 +1,50 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 2010 Tolleiv Nietsch <nietsch@aoemedia.de>\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*  A copy is found in the textfile GPL.txt and important notices to the license\r
+*  from the author is found in LICENSE.txt distributed with these scripts.\r
+*\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+\r
+/**\r
+ * interface for classes which hook into t3lib_pageSelect\r
+ *\r
+ * @author     Tolleiv Nietsch <nietsch@aoemedia.de>\r
+ * @package TYPO3\r
+ * @subpackage t3lib\r
+ */\r
+interface t3lib_pageSelect_getPageOverlayHook {\r
+\r
+       /**\r
+        * enables to preprocess the pageoverlay\r
+        *\r
+        * @param array                         $pageInput      - the page record\r
+        * @param integer                       $lUid           - the overlay language\r
+        * @param t3lib_pageSelect      $parent         - the calling parent object\r
+        * @return void\r
+        */\r
+       public function getPageOverlay_preProcess(&$pageInput, &$lUid, t3lib_pageSelect $parent);\r
+\r
+}\r
+\r
+?>\r