[BUGFIX] Cannot show information of a directory
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Controller / ContentElement / ElementInformationController.php
1 <?php
2 namespace TYPO3\CMS\Backend\Controller\ContentElement;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29
30 use TYPO3\CMS\Backend\Utility\BackendUtility;
31 use TYPO3\CMS\Backend\Utility\IconUtility;
32 use TYPO3\CMS\Core\Resource\ProcessedFile;
33 use TYPO3\CMS\Core\Utility\GeneralUtility;
34
35 /**
36 * Script Class for showing information about an item.
37 *
38 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
39 */
40 class ElementInformationController {
41
42 /**
43 * Record table name
44 *
45 * @var string
46 */
47 public $table;
48
49 /**
50 * Record uid
51 *
52 * @var int
53 */
54 public $uid;
55
56 /**
57 * @var string
58 */
59 protected $permsClause;
60
61 /**
62 * @var boolean
63 */
64 public $access = FALSE;
65
66 /**
67 * Which type of element:
68 * - "file"
69 * - "db"
70 *
71 * @var string
72 */
73 public $type = '';
74
75 /**
76 * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
77 */
78 public $doc;
79
80 /**
81 * @var string
82 */
83 protected $content = '';
84
85 /**
86 * For type "db": Set to page record of the parent page of the item set
87 * (if type="db")
88 *
89 * @var array
90 * @todo Define visibility
91 */
92 public $pageinfo;
93
94 /**
95 * Database records identified by table/uid
96 *
97 * @var array
98 */
99 protected $row;
100
101 /**
102 * @var \TYPO3\CMS\Core\Resource\File
103 */
104 protected $fileObject;
105
106 /**
107 * @var \TYPO3\CMS\Core\Resource\Folder
108 */
109 protected $folderObject;
110
111 /**
112 * Constructor
113 */
114 public function __construct() {
115 $GLOBALS['BACK_PATH'] = '';
116 $GLOBALS['SOBE'] = $this;
117
118 $this->init();
119 }
120
121 /**
122 * Determines if table/uid point to database record or file and
123 * if user has access to view information
124 *
125 * @return void
126 */
127 public function init() {
128 $this->table = GeneralUtility::_GET('table');
129 $this->uid = GeneralUtility::_GET('uid');
130
131 $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
132 $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
133
134 if (isset($GLOBALS['TCA'][$this->table])) {
135 $this->initDatabaseRecord();
136 } elseif ($this->table == '_FILE' || $this->table == '_FOLDER' || $this->table == 'sys_file') {
137 $this->initFileOrFolderRecord();
138 }
139 }
140
141 /**
142 * Init database records (table)
143 */
144 protected function initDatabaseRecord() {
145 $this->type = 'db';
146 $this->uid = intval($this->uid);
147
148 // Check permissions and uid value:
149 if ($this->uid && $GLOBALS['BE_USER']->check('tables_select', $this->table)) {
150 if ((string) $this->table == 'pages') {
151 $this->pageinfo = BackendUtility::readPageAccess($this->uid, $this->perms_clause);
152 $this->access = is_array($this->pageinfo) ? 1 : 0;
153 $this->row = $this->pageinfo;
154 } else {
155 $this->row = BackendUtility::getRecordWSOL($this->table, $this->uid);
156 if ($this->row) {
157 $this->pageinfo = BackendUtility::readPageAccess($this->row['pid'], $this->perms_clause);
158 $this->access = is_array($this->pageinfo) ? 1 : 0;
159 }
160 }
161 /** @var $treatData \TYPO3\CMS\Backend\Form\DataPreprocessor */
162 $treatData = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\DataPreprocessor');
163 $treatData->renderRecord($this->table, $this->uid, 0, $this->row);
164 }
165 }
166
167 /**
168 * Init file/folder parameters
169 */
170 protected function initFileOrFolderRecord() {
171 $fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->
172 retrieveFileOrFolderObject($this->uid);
173
174 if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
175 $this->folderObject = $fileOrFolderObject;
176 $this->access = $this->folderObject->checkActionPermission('read');
177 $this->type = 'folder';
178 } else {
179 $this->fileObject = $fileOrFolderObject;
180 $this->access = $this->fileObject->checkActionPermission('read');
181 $this->type = 'file';
182 $this->table = 'sys_file_metadata';
183
184 try {
185 $metaData = $fileOrFolderObject->_getMetaData();
186 $this->row = BackendUtility::getRecordWSOL($this->table, $metaData['uid']);
187 } catch (\Exception $e) {
188 $this->row = array();
189 }
190 }
191 }
192
193 /**
194 * @return void
195 */
196 public function main() {
197 if (!$this->access) {
198 return;
199 }
200
201 // render type by user func
202 $typeRendered = FALSE;
203 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'])) {
204 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/show_item.php']['typeRendering'] as $classRef) {
205 $typeRenderObj = GeneralUtility::getUserObj($classRef);
206 // @TODO should have an interface
207 if (is_object($typeRenderObj) && method_exists($typeRenderObj, 'isValid') && method_exists($typeRenderObj, 'render')) {
208 if ($typeRenderObj->isValid($this->type, $this)) {
209 $this->content .= $typeRenderObj->render($this->type, $this);
210 $typeRendered = TRUE;
211 break;
212 }
213 }
214 }
215 }
216
217 if (!$typeRendered) {
218 $this->content .= $this->renderPageTitle();
219 $this->content .= $this->renderPreview();
220 $this->content .= $this->renderPropertiesAsTable();
221 $this->content .= $this->renderReferences();
222 }
223 }
224
225 /**
226 * Render page title with icon, table title and record title
227 *
228 * @return string
229 */
230 protected function renderPageTitle() {
231 if ($this->type === 'folder') {
232 $title = IconUtility::getSpriteIcon('apps-filetree-folder-default') . ' ' .
233 $this->folderObject->getName();
234 } else {
235 $table = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$this->table]['ctrl']['title']);
236 $title = $this->doc->getHeader($this->table, $this->row, $this->pageinfo['_thePath'], 1, array(' ', ''));
237 }
238
239 return '<h1>' .
240 ($table ? '<small>' . $table . '</small><br />' : '') .
241 $title .
242 '</h1>';
243 }
244
245 /**
246 * Render preview for current record
247 *
248 * @return string
249 */
250 protected function renderPreview() {
251 // Perhaps @TODO in future: Also display preview for records - without fileObject
252 if (!$this->fileObject) {
253 return;
254 }
255 $imageTag = '';
256 $downloadLink = '';
257
258 // check if file is marked as missing
259 if ($this->fileObject->isMissing()) {
260 $flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($this->fileObject);
261 $imageTag .= $flashMessage->render();
262
263 } else {
264
265 $fileExtension = $this->fileObject->getExtension();
266 $thumbUrl = '';
267 if (GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileExtension)) {
268 $thumbUrl = $this->fileObject->process(
269 ProcessedFile::CONTEXT_IMAGEPREVIEW,
270 array(
271 'width' => '400m',
272 'height' => '400m'
273 )
274 )->getPublicUrl(TRUE);
275 }
276
277 // Create thumbnail image?
278 if ($thumbUrl) {
279 $imageTag .= '<img src="' . $thumbUrl . '" ' .
280 'alt="' . htmlspecialchars(trim($this->fileObject->getName())) . '" ' .
281 'title="' . htmlspecialchars(trim($this->fileObject->getName())) . '" />';
282 }
283
284 // Display download link?
285 if ($this->fileObject->getPublicUrl()) {
286 $downloadLink .= '<a href="../' . $this->fileObject->getPublicUrl() . '" target="_blank">' .
287 $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:download', TRUE) .
288 '</a>';
289 }
290 }
291
292 return ($imageTag ? '<p>' . $imageTag . '</p>' : '') .
293 ($downloadLink ? '<p>' . $downloadLink . '</p>' : '');
294 }
295
296 /**
297 * Render property array as html table
298 *
299 * @return string
300 */
301 protected function renderPropertiesAsTable() {
302 $tableRows = array();
303 $extraFields = array();
304
305 if ($this->type !== 'folder') {
306 $extraFields = array(
307 'crdate' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', TRUE),
308 'cruser_id' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationUserId', TRUE),
309 'tstamp' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', TRUE)
310 );
311 }
312
313 foreach ($extraFields as $name => $value) {
314 $rowValue = BackendUtility::getProcessedValueExtra($this->table, $name, $this->row[$name]);
315 if ($name === 'cruser_id' && $rowValue) {
316 $userTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('username, realName', 'be_users', 'uid = ' . intval($rowValue));
317 if ($userTemp[0]['username'] !== '') {
318 $rowValue = $userTemp[0]['username'];
319 if ($userTemp[0]['realName'] !== '') {
320 $rowValue .= ' - ' . $userTemp[0]['realName'];
321 }
322 }
323 }
324 $tableRows[] = '
325 <tr>
326 <td class="t3-col-header">' . rtrim($value, ':') . '</td>
327 <td>' . htmlspecialchars($rowValue) . '</td>
328 </tr>';
329 }
330
331 // Traverse the list of fields to display for the record:
332 $fieldList = GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$this->table]['interface']['showRecordFieldList'], TRUE);
333 foreach ($fieldList as $name) {
334 $name = trim($name);
335 $uid = $this->row['uid'];
336
337 if (!isset($GLOBALS['TCA'][$this->table]['columns'][$name])) {
338 continue;
339 }
340
341 $isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $name));
342 if ($isExcluded) {
343 continue;
344 }
345
346 $itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE, $uid);
347 $itemLabel = $GLOBALS['LANG']->sL(BackendUtility::getItemLabel($this->table, $name), TRUE);
348 $tableRows[] = '
349 <tr>
350 <td class="t3-col-header">' . $itemLabel . '</td>
351 <td>' . htmlspecialchars($itemValue) . '</td>
352 </tr>';
353 }
354
355 return '<table id="typo3-showitem" class="t3-table-info">' .
356 implode('', $tableRows) .
357 '</table>';
358 }
359
360 /*
361 * Render references section (references from and references to current record)
362 *
363 * @return string
364 */
365 protected function renderReferences() {
366 $content = '';
367
368 switch ($this->type) {
369 case 'db': {
370 $references = $this->makeRef($this->table, $this->row['uid']);
371 if (!empty($references)) {
372 $content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem'), $references);
373 }
374
375 $referencesFrom = $this->makeRefFrom($this->table, $this->row['uid']);
376 if (!empty($referencesFrom)) {
377 $content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem'), $referencesFrom);
378 }
379 break;
380 }
381
382 case 'file': {
383 if ($this->fileObject && $this->fileObject->isIndexed()) {
384 $references = $this->makeRef('_FILE', $this->fileObject);
385
386 if (!empty($references)) {
387 $header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem');
388 $content .= $this->doc->section($header, $references);
389 }
390 }
391 break;
392 }
393 }
394
395 return $content;
396 }
397
398 /**
399 * Renders file properties as html table
400 *
401 * @param array $fieldList
402 * @return string
403 */
404 protected function renderFileInformationAsTable($fieldList) {
405 $tableRows = array();
406 foreach ($fieldList as $name) {
407 if (!isset($GLOBALS['TCA'][$this->table]['columns'][$name])) {
408 continue;
409 }
410 $isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $name));
411 if ($isExcluded) {
412 continue;
413 }
414 $uid = $this->row['uid'];
415 $itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE, $uid);
416 $itemLabel = $GLOBALS['LANG']->sL(BackendUtility::getItemLabel($this->table, $name), TRUE);
417 $tableRows[] = '
418 <tr>
419 <td class="t3-col-header">' . $itemLabel . '</td>
420 <td>' . htmlspecialchars($itemValue) . '</td>
421 </tr>';
422 }
423
424 if (!$tableRows) {
425 return '';
426 }
427
428 return '<table id="typo3-showitem" class="t3-table-info">' .
429 implode('', $tableRows) .
430 '</table>';
431 }
432
433 /**
434 * End page and print content
435 *
436 * @return void
437 */
438 public function printContent() {
439 echo $this->doc->startPage('') .
440 $this->doc->insertStylesAndJS($this->content) .
441 $this->doc->endPage();
442 }
443
444 /**
445 * Get field name for specified table/column name
446 *
447 * @param string $tableName Table name
448 * @param string $fieldName Column name
449 * @return string label
450 */
451 public function getLabelForTableColumn($tableName, $fieldName) {
452 if ($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label'] !== NULL) {
453 $field = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label']);
454 if (trim($field) === '') {
455 $field = $fieldName;
456 }
457 } else {
458 $field = $fieldName;
459 }
460 return $field;
461 }
462
463 /**
464 * Returns the rendered record actions
465 *
466 * @param string $table
467 * @param integer $uid
468 * @return string
469 */
470 protected function getRecordActions($table, $uid) {
471 if ($table === '' || $uid < 0) {
472 return '';
473 }
474
475 $editOnClick = BackendUtility::editOnClick('&edit[' . $table . '][' . $uid . ']=edit', $GLOBALS['BACK_PATH']);
476 $icon = IconUtility::getSpriteIcon('actions-document-open');
477 $pageActionIcons = '<a href="#" onclick="' . htmlspecialchars($editOnClick) . '">' . $icon . '</a>';
478 $historyOnClick = 'window.location.href=\'show_rechis.php?element=' . $table . '%3A' .
479 $uid . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')) . '\'; return false;';
480
481 $icon = IconUtility::getSpriteIcon('actions-document-history-open');
482 $pageActionIcons .= '<a href="#" onclick="' . $historyOnClick . '">' . $icon . '</a>';
483 if ($table === 'pages') {
484 $pageActionIcons .= $this->doc->viewPageIcon($uid, '');
485 }
486 return $pageActionIcons;
487 }
488
489 /**
490 * Make reference display
491 *
492 * @param string $table Table name
493 * @param string|\TYPO3\CMS\Core\Resource\File $ref Filename or uid
494 * @return string HTML
495 */
496 protected function makeRef($table, $ref) {
497 // Files reside in sys_file table
498 if ($table === '_FILE') {
499 $selectTable = 'sys_file';
500 $selectUid = $ref->getUid();
501 } else {
502 $selectTable = $table;
503 $selectUid = $ref;
504 }
505 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
506 '*',
507 'sys_refindex',
508 'ref_table=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($selectTable, 'sys_refindex') . ' AND ref_uid=' . intval($selectUid) . ' AND deleted=0'
509 );
510
511 // Compile information for title tag:
512 $infoData = array();
513 if (count($rows)) {
514 $infoDataHeader = '<tr class="t3-row-header">' . '<td>&nbsp;</td>' . '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.table') . '</td>' . '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.title') . '</td>' . '<td>[uid]</td>' . '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.field') . '</td>' . '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.flexpointer') . '</td>' . '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.softrefKey') . '</td>' . '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.sorting') . '</td>' . '</tr>';
515 }
516 foreach ($rows as $row) {
517 if ($row['tablename'] === 'sys_file_reference') {
518 $row = $this->transformFileReferenceToRecordReference($row);
519 }
520 $record = BackendUtility::getRecord($row['tablename'], $row['recuid']);
521 $parentRecord = BackendUtility::getRecord('pages', $record['pid']);
522 $actions = $this->getRecordActions($row['tablename'], $row['recuid']);
523 $infoData[] = '<tr class="db_list_normal">' .
524 '<td style="white-space:nowrap;">' . $actions . '</td>' .
525 '<td>' . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$row['tablename']]['ctrl']['title'], TRUE) . '</td>' .
526 '<td>' . BackendUtility::getRecordTitle($row['tablename'], $record, TRUE) . '</td>' .
527 '<td><span title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:page') . ': ' .
528 htmlspecialchars(BackendUtility::getRecordTitle('pages', $parentRecord)) . ' (uid=' . $record['pid'] . ')">' .
529 $record['uid'] . '</span></td>' .
530 '<td>' . htmlspecialchars($this->getLabelForTableColumn($row['tablename'], $row['field'])) . '</td>' .
531 '<td>' . htmlspecialchars($row['flexpointer']) . '</td>' . '<td>' . htmlspecialchars($row['softref_key']) . '</td>' .
532 '<td>' . htmlspecialchars($row['sorting']) . '</td>' .
533 '</tr>';
534 }
535 $referenceLine = '';
536 if (count($infoData)) {
537 $referenceLine = '<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' .
538 '<thead>' . $infoDataHeader . '</thead>' .
539 '<tbody>' .
540 implode('', $infoData) .
541 '</tbody></table>';
542 }
543 return $referenceLine;
544 }
545
546 /**
547 * Make reference display (what this elements points to)
548 *
549 * @param string $table Table name
550 * @param string $ref Filename or uid
551 * @return string HTML
552 */
553 protected function makeRefFrom($table, $ref) {
554 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
555 '*',
556 'sys_refindex',
557 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_refindex') . ' AND recuid=' . intval($ref)
558 );
559
560 // Compile information for title tag:
561 $infoData = array();
562 if (count($rows)) {
563 $infoDataHeader = '<tr class="t3-row-header">' .
564 '<td>&nbsp;</td>' .
565 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.field') . '</td>' .
566 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.flexpointer') . '</td>' .
567 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.softrefKey') . '</td>' .
568 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.sorting') . '</td>' .
569 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.refTable') . '</td>' .
570 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.refUid') . '</td>' .
571 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.refString') . '</td>' .
572 '</tr>';
573 }
574 foreach ($rows as $row) {
575 $actions = $this->getRecordActions($row['ref_table'], $row['ref_uid']);
576 $infoData[] = '<tr class="db_list_normal">' .
577 '<td style="white-space:nowrap;">' . $actions . '</td>' .
578 '<td>' . htmlspecialchars($this->getLabelForTableColumn($table, $row['field'])) . '</td>' .
579 '<td>' . htmlspecialchars($row['flexpointer']) . '</td>' .
580 '<td>' . htmlspecialchars($row['softref_key']) . '</td>' .
581 '<td>' . htmlspecialchars($row['sorting']) . '</td>' .
582 '<td>' . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$row['ref_table']]['ctrl']['title'], TRUE) . '</td>' .
583 '<td>' . htmlspecialchars($row['ref_uid']) . '</td>' .
584 '<td>' . htmlspecialchars($row['ref_string']) . '</td>' .
585 '</tr>';
586 }
587
588 if (empty($infoData)) {
589 return;
590 }
591
592 return '<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' .
593 '<thead>' . $infoDataHeader . '</thead>' .
594 '<tbody>' .
595 implode('', $infoData) .
596 '</tbody></table>';
597 }
598
599 /**
600 * Convert FAL file reference (sys_file_reference) to reference index (sys_refindex) table format
601 *
602 * @param array $referenceRecord
603 * @return array
604 */
605 protected function transformFileReferenceToRecordReference(array $referenceRecord) {
606 $fileReference = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
607 '*',
608 'sys_file_reference',
609 'uid=' . (int)$referenceRecord['recuid']
610 );
611 return array(
612 'recuid' => $fileReference['uid_foreign'],
613 'tablename' => $fileReference['tablenames'],
614 'field' => $fileReference['fieldname'],
615 'flexpointer' => '',
616 'softref_key' => '',
617 'sorting' => $fileReference['sorting_foreign']
618 );
619 }
620
621 }