[FEATURE] Add hook to post-process countVersionsOfRecordsOnPage 71/32871/7
authorOliver Hader <oliver@typo3.org>
Thu, 18 Sep 2014 16:31:44 +0000 (18:31 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 19 Jan 2015 07:23:45 +0000 (08:23 +0100)
Hook to post-process BackendUtility::countVersionsOfRecordsOnPage
result. BackendUtility::countVersionsOfRecordsOnPage is used to
visualize workspace states in e.g. the page tree.

Resolves: #61725
Releases: master
Change-Id: I195167ff7989fb9b4ceeb910e2091fad9c9f475c
Reviewed-on: http://review.typo3.org/32871
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Documentation/Changelog/master/Feature-61725-AddHookToBackendUtilityCountVersionsOfRecordsOnPage.rst [new file with mode: 0644]

index 26334bf..cbf884a 100644 (file)
@@ -4132,6 +4132,17 @@ class BackendUtility {
                                }
                        }
                }
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['countVersionsOfRecordsOnPage'])) {
+                       $reference = NULL;
+                       $parameters = array(
+                               'workspace' => 'workspace',
+                               'pageId' => $pageId,
+                               'versions' => &$output,
+                       );
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['countVersionsOfRecordsOnPage'] as $hookFunction) {
+                               GeneralUtility::callUserFunction($hookFunction, $parameters, $reference);
+                       }
+               }
                return $output;
        }
 
@@ -4400,4 +4411,4 @@ class BackendUtility {
                return $GLOBALS['TBE_TEMPLATE'];
        }
 
-}
+}
\ No newline at end of file
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-61725-AddHookToBackendUtilityCountVersionsOfRecordsOnPage.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-61725-AddHookToBackendUtilityCountVersionsOfRecordsOnPage.rst
new file mode 100644 (file)
index 0000000..044a03d
--- /dev/null
@@ -0,0 +1,15 @@
+=========================================================================
+Feature: #61725 - Hook for BackendUtility::countVersionsOfRecordsOnPage()
+=========================================================================
+
+Description
+===========
+
+Hook to post-process BackendUtility::countVersionsOfRecordsOnPage
+result. BackendUtility::countVersionsOfRecordsOnPage is used to
+visualize workspace states in e.g. the page tree.
+
+Register like this:
+
+.. code-block:: php
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['countVersionsOfRecordsOnPage'][] = 'My\Package\HookClass->hookMethod';
\ No newline at end of file