--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2007 Ingo Renner <ingo@typo3.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.
+* A copy is found in the textfile GPL.txt and important notices to the license
+* from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+* 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!
+***************************************************************/
+
+
+/**
+ * interface for classes which hook into localRecordList and do additional getTable processing
+ *
+ * @author Ingo Renner <ingo@typo3.org>
+ * @package TYPO3
+ * @subpackage t3lib
+ */
+interface t3lib_localRecordListGetTableHook {
+
+ /**
+ * modifies the DB list query
+ *
+ * @param string the current database table
+ * @param integer the record's unique ID
+ * @param string an additional WHERE clause
+ * @param string comma separated list of selected fields
+ * @param localRecordList parent localRecordList object
+ * @return void
+ */
+ public function getDBlistQuery($table, $uid, $additionalWhereClause, $selectedFieldsList, $parentObject);
+
+}
+
+?>
\ No newline at end of file
* @return string HTML table with the listing for the record.
*/
function getTable($table,$id,$rowlist) {
- global $TCA;
+ global $TCA, $TYPO3_CONF_VARS;
// Loading all TCA details for this table:
t3lib_div::loadTCA($table);
$selectFields = array_intersect($selectFields,$this->makeFieldList($table,1)); // Making sure that the fields in the field-list ARE in the field-list from TCA!
$selFieldList = implode(',',$selectFields); // implode it into a list of fields for the SQL-statement.
+ // DB-List getTable-Hook
+ if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'])) {
+ foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'] as $classData) {
+ $hookObject = &t3lib_div::getUserObj($classData);
+
+ if(!($hookObject instanceof t3lib_localRecordListGetTableHook)) {
+ throw new UnexpectedValueException('$hookObject must implement interface t3lib_localRecordListGetTableHook', 1195114460);
+ }
+
+ $hookObject->getDBlistQuery($table, $id, $addWhere, $selFieldList, $this);
+ }
+ }
+
// Create the SQL query for selecting the elements in the listing:
$queryParts = $this->makeQueryArray($table, $id,$addWhere,$selFieldList); // (API function from class.db_list.inc)
$this->setTotalItems($queryParts); // Finding the total amount of records on the page (API function from class.db_list.inc)
$prevPrevUid = 0;
$accRows = array(); // Accumulate rows here
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
-
+
// In offline workspace, look for alternative record:
t3lib_BEfunc::workspaceOL($table, $row, $GLOBALS['BE_USER']->workspace, TRUE);
-
+
if (is_array($row)) {
$accRows[] = $row;
$currentIdList[] = $row['uid'];
foreach($translations as $lRow) {
// In offline workspace, look for alternative record:
t3lib_BEfunc::workspaceOL($table, $lRow, $GLOBALS['BE_USER']->workspace);
-
+
if (is_array($lRow) && $GLOBALS['BE_USER']->checkLanguageAccess($lRow[$TCA[$table]['ctrl']['languageField']])) {
$currentIdList[] = $lRow['uid'];
$iOut.=$this->renderListRow($table,$lRow,$cc,$titleCol,$thumbsCol,18);
$stat.=t3lib_div::callUserFunction($_funcRef,$_params,$this);
}
$cells[] = $stat;
- }
+ }
// Compile items into a DIV-element:
return '