2 namespace TYPO3\CMS\Frontend\ContentObject;
32 public function render($conf = array())
34 if (!empty($conf[
'if.']) && !$this->cObj->checkIf($conf[
'if.'])) {
39 $fileObjects = $fileCollector->getFiles();
40 $availableFileObjectCount = count($fileObjects);
43 $splitConf =
$GLOBALS[
'TSFE']->tmpl->splitConfArray($conf, $availableFileObjectCount);
46 if (!empty($conf[
'begin'])) {
47 $start = (int)$conf[
'begin'];
49 if (!empty($conf[
'begin.'])) {
50 $start = (int)$this->cObj->stdWrap($start, $conf[
'begin.']);
54 $limit = $availableFileObjectCount;
55 if (!empty($conf[
'maxItems'])) {
56 $limit = (int)$conf[
'maxItems'];
58 if (!empty($conf[
'maxItems.'])) {
59 $limit = (int)$this->cObj->stdWrap($limit, $conf[
'maxItems.']);
64 $GLOBALS[
'TSFE']->register[
'FILES_COUNT'] = min($limit, $availableFileObjectCount);
65 $fileObjectCounter = 0;
66 $keys = array_keys($fileObjects);
69 for ($i = $start; $i < $end; $i++) {
71 $fileObject = $fileObjects[$key];
73 $GLOBALS[
'TSFE']->register[
'FILE_NUM_CURRENT'] = $fileObjectCounter;
74 $this->cObj->setCurrentFile($fileObject);
75 $content .= $this->cObj->cObjGetSingle($splitConf[$key][
'renderObj'], $splitConf[$key][
'renderObj.']);
79 return $this->cObj->stdWrap($content, $conf[
'stdWrap.']);
94 if ($conf[
'references'] || $conf[
'references.']) {
106 $referencesUidList = $this->cObj->stdWrapValue(
'references', $conf);
108 $fileCollector->addFileReferences($referencesUids);
110 if (!empty($conf[
'references.'])) {
115 if ($conf[
'files'] || $conf[
'files.']) {
123 $fileCollector->addFiles($fileUids);
126 if ($conf[
'collections'] || $conf[
'collections.']) {
128 $fileCollector->addFilesFromFileCollections($collectionUids);
131 if ($conf[
'folders'] || $conf[
'folders.']) {
133 $fileCollector->addFilesFromFolders($folderIdentifiers, !empty($conf[
'folders.'][
'recursive']));
137 $sortingProperty =
'';
138 if ($conf[
'sorting'] || $conf[
'sorting.']) {
139 $sortingProperty = $this->cObj->stdWrapValue(
'sorting', $conf);
141 if ($sortingProperty !==
'') {
142 $sortingDirection = isset($conf[
'sorting.'][
'direction']) ? $conf[
'sorting.'][
'direction'] :
'';
143 if (isset($conf[
'sorting.'][
'direction.'])) {
144 $sortingDirection = $this->cObj->stdWrap($sortingDirection, $conf[
'sorting.'][
'direction.']);
146 $fileCollector->sort($sortingProperty, $sortingDirection);
149 return $fileCollector;
164 $referencesFieldName = $this->cObj->stdWrapValue(
'fieldName', $configuration[
'references.']);
167 if (empty($referencesFieldName)) {
171 $currentId = !empty($element[
'uid']) ? $element[
'uid'] : 0;
172 $tableName = $this->cObj->getCurrentTable();
175 $referencesForeignTable = $this->cObj->stdWrapValue(
'table', $configuration[
'references.'], $tableName);
176 $referencesForeignUid = $this->cObj->stdWrapValue(
'uid', $configuration[
'references.'], $currentId);
180 if ($referencesForeignTable !== $tableName || $referencesForeignUid !== $currentId) {
181 $element = $pageRepository->getRawRecord(
182 $referencesForeignTable,
183 $referencesForeignUid,
188 $pageRepository->versionOL($referencesForeignTable, $element,
true);
189 if ($referencesForeignTable ===
'pages') {
190 $element = $pageRepository->getPageOverlay($element);
192 $element = $pageRepository->getRecordOverlay(
193 $referencesForeignTable,
195 $GLOBALS[
'TSFE']->sys_language_content,
196 $GLOBALS[
'TSFE']->sys_language_contentOL
201 if (is_array($element)) {