Added #4361: Added new hook in class.db_list.inc for the list module (On behalf of...
authorBenni Mack <benni.mack@typo3.org>
Sat, 27 Jun 2009 14:33:38 +0000 (14:33 +0000)
committerBenni Mack <benni.mack@typo3.org>
Sat, 27 Jun 2009 14:33:38 +0000 (14:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5645 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/class.db_list.inc

index 33f7c6e..424b20b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-06-27  Benjamin Mack  <benni@typo3.org>
 
+       * Added #4361: Added new hook in class.db_list.inc for the list module (On behalf of Michael Stucki)
        * Fixed bug #6125: MENU before/after* might create invalid HTML output (Thanks to Nabil Saleh)
 
 2009-06-27  Christian Kuhn  <lolli@schwarzbu.ch>
index 23cf818..0e0b4ab 100644 (file)
@@ -462,8 +462,15 @@ class recordList extends t3lib_recordList {
         * @param       string          Field list to select, * for all (for "SELECT [fieldlist] FROM ...")
         * @return      array           Returns query array
         */
-       function makeQueryArray($table, $id, $addWhere="",$fieldList='*')       {
-               global $TCA;
+       function makeQueryArray($table, $id, $addWhere='', $fieldList='*')      {
+               global $TCA, $TYPO3_CONF_VARS;
+
+               $hookObjectsArr = array();
+               if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list.inc']['makeQueryArray'])) {
+                       foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list.inc']['makeQueryArray'] as $classRef) {
+                               $hookObjectsArr[] = &t3lib_div::getUserObj($classRef);
+                       }
+               }
 
                        // Set ORDER BY:
                $orderBy = ($TCA[$table]['ctrl']['sortby']) ? 'ORDER BY '.$TCA[$table]['ctrl']['sortby'] : $TCA[$table]['ctrl']['default_sortby'];
@@ -498,6 +505,19 @@ class recordList extends t3lib_recordList {
                        'LIMIT' => $limit
                );
 
+                       // Apply hook as requested in http://bugs.typo3.org/view.php?id=4361
+               foreach ($hookObjectsArr as $hookObj) {
+                       if (method_exists($hookObj, 'makeQueryArray_post')) {
+                               $_params = array(
+                                       'orderBy' => $orderBy,
+                                       'limit' => $limit,
+                                       'pC' => $pC,
+                                       'search' => $search,
+                               );
+                               $hookObj->makeQueryArray_post(&$queryParts, $this, $table, $id, $addWhere, $fieldList, $_params);
+                       }
+               }
+
                        // Return query:
                return $queryParts;
        }