47 public function render($conf = array()) {
49 $this->itemArray = array();
50 $this->data = array();
53 $originalRec =
$GLOBALS[
'TSFE']->currentRecord;
57 ++
$GLOBALS[
'TSFE']->recordRegister[$originalRec];
59 $tables = isset($conf[
'tables.']) ? $this->cObj->stdWrap($conf[
'tables'], $conf[
'tables.']) : $conf[
'tables'];
60 $source = isset($conf[
'source.']) ? $this->cObj->stdWrap($conf[
'source'], $conf[
'source.']) : $conf[
'source'];
61 $categories = isset($conf[
'categories.']) ? $this->cObj->stdWrap($conf[
'categories'], $conf[
'categories.']) : $conf[
'categories'];
66 if (is_array($conf[
'conf.'])) {
67 foreach ($conf[
'conf.'] as $key => $value) {
68 if (substr($key, -1) !=
'.' && !in_array($key, $tablesArray)) {
69 $tablesArray[] = $key;
77 $this->collectRecordsFromSource($source, $tablesArray);
78 } elseif ($categories) {
79 $relationField = isset($conf[
'categories.'][
'relation.']) ? $this->cObj->stdWrap($conf[
'categories.'][
'relation'], $conf[
'categories.'][
'relation.']) : $conf[
'categories.'][
'relation'];
83 if (count($this->itemArray) > 0) {
86 $cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
87 $this->cObj->currentRecordNumber = 0;
88 $this->cObj->currentRecordTotal = count($this->itemArray);
89 foreach ($this->itemArray as $val) {
90 $row = $this->data[$val[
'table']][$val[
'id']];
94 $GLOBALS[
'TSFE']->sys_page->versionOL($val[
'table'], $row);
96 if (is_array($row) &&
$GLOBALS[
'TSFE']->sys_language_contentOL) {
97 if ($val[
'table'] ===
'pages') {
98 $row =
$GLOBALS[
'TSFE']->sys_page->getPageOverlay($row);
100 $row =
$GLOBALS[
'TSFE']->sys_page->getRecordOverlay($val[
'table'], $row,
$GLOBALS[
'TSFE']->sys_language_content,
$GLOBALS[
'TSFE']->sys_language_contentOL);
105 if (is_array($row)) {
106 $dontCheckPid = isset($conf[
'dontCheckPid.']) ? $this->cObj->stdWrap($conf[
'dontCheckPid'], $conf[
'dontCheckPid.']) : $conf[
'dontCheckPid'];
107 if (!$dontCheckPid) {
108 $row = $this->cObj->checkPid($row[
'pid']) ? $row :
'';
110 if ($row && !
$GLOBALS[
'TSFE']->recordRegister[($val[
'table'] .
':' . $val[
'id'])]) {
111 $renderObjName = $conf[
'conf.'][$val[
'table']] ?:
'<' . $val[
'table'];
112 $renderObjKey = $conf[
'conf.'][$val[
'table']] ?
'conf.' . $val[
'table'] :
'';
113 $renderObjConf = $conf[
'conf.'][$val[
'table'] .
'.'];
114 $this->cObj->currentRecordNumber++;
115 $cObj->parentRecordNumber = $this->cObj->currentRecordNumber;
116 $GLOBALS[
'TSFE']->currentRecord = $val[
'table'] .
':' . $val[
'id'];
117 $this->cObj->lastChanged($row[
'tstamp']);
118 $cObj->start($row, $val[
'table']);
119 $tmpValue =
$cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
120 $theValue .= $tmpValue;
126 $wrap = isset($conf[
'wrap.']) ? $this->cObj->stdWrap($conf[
'wrap'], $conf[
'wrap.']) : $conf[
'wrap'];
128 $theValue = $this->cObj->wrap($theValue, $wrap);
130 if (isset($conf[
'stdWrap.'])) {
131 $theValue = $this->cObj->stdWrap($theValue, $conf[
'stdWrap.']);
134 $GLOBALS[
'TSFE']->currentRecord = $originalRec;
136 --
$GLOBALS[
'TSFE']->recordRegister[$originalRec];
148 protected function collectRecordsFromSource($source, array $tables) {
151 $loadDB->setFetchAllFields(TRUE);
152 $loadDB->start($source, implode(
',', $tables));
153 foreach ($loadDB->tableArray as $table => $v) {
154 if (isset(
$GLOBALS[
'TCA'][$table])) {
155 $loadDB->additionalWhere[$table] = $this->cObj->enableFields($table);
158 $this->data = $loadDB->getFromDB();
159 reset($loadDB->itemArray);
160 $this->itemArray = $loadDB->itemArray;
175 foreach ($tables as $table) {
178 $tableRecords = array();
179 $categoriesPerRecord = array();
180 foreach ($selectedCategories as $aCategory) {
188 if ($collection->count() > 0) {
190 foreach ($collection as $item) {
191 $tableRecords[$item[
'uid']] = $item;
193 if (!isset($categoriesPerRecord[$item[
'uid']])) {
194 $categoriesPerRecord[$item[
'uid']] = array();
196 $categoriesPerRecord[$item[
'uid']][] = $aCategory;
201 'Could not get records for category id %d. Error: %s (%d)',
210 if (count($tableRecords) > 0) {
211 $this->data[$table] = array();
212 foreach ($tableRecords as $record) {
213 $this->itemArray[] = array(
214 'id' => $record[
'uid'],
218 $record[
'_categories'] = implode(
',', $categoriesPerRecord[$record[
'uid']]);
219 $this->data[$table][$record[
'uid']] = $record;
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static makeInstance($className)
collectRecordsFromCategories($selectedCategories, array $tables, $relationField)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static load($id, $fillItems=FALSE, $tableName='', $fieldName='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]