4020ce12b7d50e72ad02668dc1a758cf1211e2fb
[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
304 if ($this->type !== 'folder') {
305 $extraFields = array(
306 'crdate' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', TRUE),
307 'cruser_id' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationUserId', TRUE),
308 'tstamp' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', TRUE)
309 );
310 }
311
312 foreach ($extraFields as $name => $value) {
313 $rowValue = BackendUtility::getProcessedValueExtra($this->table, $name, $this->row[$name]);
314 if ($name === 'cruser_id' && $rowValue) {
315 $userTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('username, realName', 'be_users', 'uid = ' . intval($rowValue));
316 if ($userTemp[0]['username'] !== '') {
317 $rowValue = $userTemp[0]['username'];
318 if ($userTemp[0]['realName'] !== '') {
319 $rowValue .= ' - ' . $userTemp[0]['realName'];
320 }
321 }
322 }
323 $tableRows[] = '
324 <tr>
325 <td class="t3-col-header">' . rtrim($value, ':') . '</td>
326 <td>' . htmlspecialchars($rowValue) . '</td>
327 </tr>';
328 }
329
330 // Traverse the list of fields to display for the record:
331 $fieldList = GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$this->table]['interface']['showRecordFieldList'], TRUE);
332 foreach ($fieldList as $name) {
333 $name = trim($name);
334 $uid = $this->row['uid'];
335
336 if (!isset($GLOBALS['TCA'][$this->table]['columns'][$name])) {
337 continue;
338 }
339
340 $isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $name));
341 if ($isExcluded) {
342 continue;
343 }
344
345 $itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE, $uid);
346 $itemLabel = $GLOBALS['LANG']->sL(BackendUtility::getItemLabel($this->table, $name), TRUE);
347 $tableRows[] = '
348 <tr>
349 <td class="t3-col-header">' . $itemLabel . '</td>
350 <td>' . htmlspecialchars($itemValue) . '</td>
351 </tr>';
352 }
353
354 return '<table id="typo3-showitem" class="t3-table-info">' .
355 implode('', $tableRows) .
356 '</table>';
357 }
358
359 /*
360 * Render references section (references from and references to current record)
361 *
362 * @return string
363 */
364 protected function renderReferences() {
365 $content = '';
366
367 switch ($this->type) {
368 case 'db': {
369 $references = $this->makeRef($this->table, $this->row['uid']);
370 if (!empty($references)) {
371 $content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem'), $references);
372 }
373
374 $referencesFrom = $this->makeRefFrom($this->table, $this->row['uid']);
375 if (!empty($referencesFrom)) {
376 $content .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem'), $referencesFrom);
377 }
378 break;
379 }
380
381 case 'file': {
382 if ($this->fileObject && $this->fileObject->isIndexed()) {
383 $references = $this->makeRef('_FILE', $this->fileObject);
384
385 if (!empty($references)) {
386 $header = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem');
387 $content .= $this->doc->section($header, $references);
388 }
389 }
390 break;
391 }
392 }
393
394 return $content;
395 }
396
397 /**
398 * Renders file properties as html table
399 *
400 * @param array $fieldList
401 * @return string
402 */
403 protected function renderFileInformationAsTable($fieldList) {
404 $tableRows = array();
405 foreach ($fieldList as $name) {
406 if (!isset($GLOBALS['TCA'][$this->table]['columns'][$name])) {
407 continue;
408 }
409 $isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $name));
410 if ($isExcluded) {
411 continue;
412 }
413 $uid = $this->row['uid'];
414 $itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE, $uid);
415 $itemLabel = $GLOBALS['LANG']->sL(BackendUtility::getItemLabel($this->table, $name), TRUE);
416 $tableRows[] = '
417 <tr>
418 <td class="t3-col-header">' . $itemLabel . '</td>
419 <td>' . htmlspecialchars($itemValue) . '</td>
420 </tr>';
421 }
422
423 if (!$tableRows) {
424 return '';
425 }
426
427 return '<table id="typo3-showitem" class="t3-table-info">' .
428 implode('', $tableRows) .
429 '</table>';
430 }
431
432 /**
433 * End page and print content
434 *
435 * @return void
436 */
437 public function printContent() {
438 echo $this->doc->startPage('') .
439 $this->doc->insertStylesAndJS($this->content) .
440 $this->doc->endPage();
441 }
442
443 /**
444 * Get field name for specified table/column name
445 *
446 * @param string $tableName Table name
447 * @param string $fieldName Column name
448 * @return string label
449 */
450 public function getLabelForTableColumn($tableName, $fieldName) {
451 if ($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label'] !== NULL) {
452 $field = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label']);
453 if (trim($field) === '') {
454 $field = $fieldName;
455 }
456 } else {
457 $field = $fieldName;
458 }
459 return $field;
460 }
461
462 /**
463 * Returns the rendered record actions
464 *
465 * @param string $table
466 * @param integer $uid
467 * @return string
468 */
469 protected function getRecordActions($table, $uid) {
470 if ($table === '' || $uid < 0) {
471 return '';
472 }
473
474 $editOnClick = BackendUtility::editOnClick('&edit[' . $table . '][' . $uid . ']=edit', $GLOBALS['BACK_PATH']);
475 $icon = IconUtility::getSpriteIcon('actions-document-open');
476 $pageActionIcons = '<a href="#" onclick="' . htmlspecialchars($editOnClick) . '">' . $icon . '</a>';
477 $historyOnClick = 'window.location.href=\'show_rechis.php?element=' . $table . '%3A' .
478 $uid . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')) . '\'; return false;';
479
480 $icon = IconUtility::getSpriteIcon('actions-document-history-open');
481 $pageActionIcons .= '<a href="#" onclick="' . $historyOnClick . '">' . $icon . '</a>';
482 if ($table === 'pages') {
483 $pageActionIcons .= $this->doc->viewPageIcon($uid, '');
484 }
485 return $pageActionIcons;
486 }
487
488 /**
489 * Make reference display
490 *
491 * @param string $table Table name
492 * @param string|\TYPO3\CMS\Core\Resource\File $ref Filename or uid
493 * @return string HTML
494 */
495 protected function makeRef($table, $ref) {
496 // Files reside in sys_file table
497 if ($table === '_FILE') {
498 $selectTable = 'sys_file';
499 $selectUid = $ref->getUid();
500 } else {
501 $selectTable = $table;
502 $selectUid = $ref;
503 }
504 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
505 '*',
506 'sys_refindex',
507 'ref_table=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($selectTable, 'sys_refindex') . ' AND ref_uid=' . intval($selectUid) . ' AND deleted=0'
508 );
509
510 // Compile information for title tag:
511 $infoData = array();
512 if (count($rows)) {
513 $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>';
514 }
515 foreach ($rows as $row) {
516 if ($row['tablename'] === 'sys_file_reference') {
517 $row = $this->transformFileReferenceToRecordReference($row);
518 }
519 $record = BackendUtility::getRecord($row['tablename'], $row['recuid']);
520 $parentRecord = BackendUtility::getRecord('pages', $record['pid']);
521 $actions = $this->getRecordActions($row['tablename'], $row['recuid']);
522 $infoData[] = '<tr class="db_list_normal">' .
523 '<td style="white-space:nowrap;">' . $actions . '</td>' .
524 '<td>' . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$row['tablename']]['ctrl']['title'], TRUE) . '</td>' .
525 '<td>' . BackendUtility::getRecordTitle($row['tablename'], $record, TRUE) . '</td>' .
526 '<td><span title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:page') . ': ' .
527 htmlspecialchars(BackendUtility::getRecordTitle('pages', $parentRecord)) . ' (uid=' . $record['pid'] . ')">' .
528 $record['uid'] . '</span></td>' .
529 '<td>' . htmlspecialchars($this->getLabelForTableColumn($row['tablename'], $row['field'])) . '</td>' .
530 '<td>' . htmlspecialchars($row['flexpointer']) . '</td>' . '<td>' . htmlspecialchars($row['softref_key']) . '</td>' .
531 '<td>' . htmlspecialchars($row['sorting']) . '</td>' .
532 '</tr>';
533 }
534 $referenceLine = '';
535 if (count($infoData)) {
536 $referenceLine = '<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' .
537 '<thead>' . $infoDataHeader . '</thead>' .
538 '<tbody>' .
539 implode('', $infoData) .
540 '</tbody></table>';
541 }
542 return $referenceLine;
543 }
544
545 /**
546 * Make reference display (what this elements points to)
547 *
548 * @param string $table Table name
549 * @param string $ref Filename or uid
550 * @return string HTML
551 */
552 protected function makeRefFrom($table, $ref) {
553 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
554 '*',
555 'sys_refindex',
556 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_refindex') . ' AND recuid=' . intval($ref)
557 );
558
559 // Compile information for title tag:
560 $infoData = array();
561 if (count($rows)) {
562 $infoDataHeader = '<tr class="t3-row-header">' .
563 '<td>&nbsp;</td>' .
564 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.field') . '</td>' .
565 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.flexpointer') . '</td>' .
566 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.softrefKey') . '</td>' .
567 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.sorting') . '</td>' .
568 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.refTable') . '</td>' .
569 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.refUid') . '</td>' .
570 '<td>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.refString') . '</td>' .
571 '</tr>';
572 }
573 foreach ($rows as $row) {
574 $actions = $this->getRecordActions($row['ref_table'], $row['ref_uid']);
575 $infoData[] = '<tr class="db_list_normal">' .
576 '<td style="white-space:nowrap;">' . $actions . '</td>' .
577 '<td>' . htmlspecialchars($this->getLabelForTableColumn($table, $row['field'])) . '</td>' .
578 '<td>' . htmlspecialchars($row['flexpointer']) . '</td>' .
579 '<td>' . htmlspecialchars($row['softref_key']) . '</td>' .
580 '<td>' . htmlspecialchars($row['sorting']) . '</td>' .
581 '<td>' . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$row['ref_table']]['ctrl']['title'], TRUE) . '</td>' .
582 '<td>' . htmlspecialchars($row['ref_uid']) . '</td>' .
583 '<td>' . htmlspecialchars($row['ref_string']) . '</td>' .
584 '</tr>';
585 }
586
587 if (empty($infoData)) {
588 return;
589 }
590
591 return '<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' .
592 '<thead>' . $infoDataHeader . '</thead>' .
593 '<tbody>' .
594 implode('', $infoData) .
595 '</tbody></table>';
596 }
597
598 /**
599 * Convert FAL file reference (sys_file_reference) to reference index (sys_refindex) table format
600 *
601 * @param array $referenceRecord
602 * @return array
603 */
604 protected function transformFileReferenceToRecordReference(array $referenceRecord) {
605 $fileReference = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
606 '*',
607 'sys_file_reference',
608 'uid=' . (int)$referenceRecord['recuid']
609 );
610 return array(
611 'recuid' => $fileReference['uid_foreign'],
612 'tablename' => $fileReference['tablenames'],
613 'field' => $fileReference['fieldname'],
614 'flexpointer' => '',
615 'softref_key' => '',
616 'sorting' => $fileReference['sorting_foreign']
617 );
618 }
619
620 }