/***************************************************************
* Copyright notice
*
-* (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
+* (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
var $currentTable = array(); // Used for tracking next/prev uids
var $duplicateStack=array(); // Used for tracking duplicate values of fields
-
+ var $modTSconfig; // module configuratio
$this->JScode='';
$this->HTMLcode='';
+ // limits
+ if(isset($this->modTSconfig['properties']['itemsLimitPerTable'])) {
+ $this->itemsLimitPerTable = t3lib_div::intInRange(intval($this->modTSconfig['properties']['itemsLimitPerTable']), 1, 10000);
+ }
+ if(isset($this->modTSconfig['properties']['itemsLimitSingleTable'])) {
+ $this->itemsLimitSingleTable = t3lib_div::intInRange(intval($this->modTSconfig['properties']['itemsLimitSingleTable']), 1, 10000);
+ }
+
// Set select levels:
$sL=intval($this->searchLevels);
$this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
// Save modified user uc
$GLOBALS['BE_USER']->uc['moduleData']['db_list.php'] = $this->tablesCollapsed;
$GLOBALS['BE_USER']->writeUC($GLOBALS['BE_USER']->uc);
+ if (t3lib_div::_GP('returnUrl')) {
+ $location = t3lib_div::_GP('returnUrl');
+ t3lib_utility_Http::redirect($location);
+ }
}
if ($sL>0) {
* @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'];
'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;
}
* @see makeQueryArray()
*/
function setTotalItems($queryParts) {
- $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
- 'count(*)',
- $queryParts['FROM'],
- $queryParts['WHERE']
- );
- list($rCount) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
- $this->totalItems = $rCount;
+ $this->totalItems = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
+ '*',
+ $queryParts['FROM'],
+ $queryParts['WHERE']
+ );
}
/**
// Traverse the configured columns and add all columns that can be searched:
foreach($TCA[$table]['columns'] as $fieldName => $info) {
- if ($info['config']['type']=='text' || ($info['config']['type']=='input' && !ereg('date|time|int',$info['config']['eval']))) {
+ if ($info['config']['type']=='text' || ($info['config']['type']=='input' && !preg_match('/date|time|int/',$info['config']['eval']))) {
$sfields[]=$fieldName;
}
}
if (!strcmp($code,'')) {
$code = '<i>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</i> - '.htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$row),$GLOBALS['BE_USER']->uc['titleLen']));
} else {
- $code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code, t3lib_div::intval_positive($GLOBALS['BE_USER']->uc['titleLen']) ? $GLOBALS['BE_USER']->uc['titleLen'] : $this->fixedL));
+ $code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code, $this->fixedL));
if ($code != htmlspecialchars($origCode)) {
$code = '<span title="'.htmlspecialchars($origCode).'">'.$code.'</span>';
}
* @return string URL
*/
function listURL($altId='',$table=-1,$exclList='') {
- return $this->script.
+ return $GLOBALS['BACK_PATH'] . $this->script.
'?id='.(strcmp($altId,'')?$altId:$this->id).
'&table='.rawurlencode($table==-1?$this->table:$table).
($this->thumbs?'&imagemode='.$this->thumbs:'').
$returnUrl = '&returnUrl='.rawurlencode($this->listURL());
$location = $GLOBALS['BACK_PATH'].'alt_doc.php?'.$params.$returnUrl;
- header('Location: '.t3lib_div::locationHeaderUrl($location));
- exit;
+ t3lib_utility_Http::redirect($location);
}
}
}
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list.inc']);
}
-?>
\ No newline at end of file
+?>