120 $this->perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
123 if (isset(
$GLOBALS[
'TCA'][$this->table])) {
124 $this->initDatabaseRecord();
125 } elseif ($this->table ==
'_FILE' || $this->table ==
'_FOLDER' || $this->table ==
'sys_file') {
133 protected function initDatabaseRecord() {
135 $this->uid = (int)$this->uid;
138 if ($this->uid &&
$GLOBALS[
'BE_USER']->check(
'tables_select', $this->table)) {
139 if ((
string) $this->table ==
'pages') {
141 $this->access = is_array($this->pageinfo) ? 1 : 0;
147 $this->access = is_array($this->pageinfo) ? 1 : 0;
152 $treatData->renderRecord($this->table, $this->uid, 0, $this->row);
162 if ($fileOrFolderObject instanceof
Folder) {
163 $this->folderObject = $fileOrFolderObject;
164 $this->access = $this->folderObject->checkActionPermission(
'read');
165 $this->type =
'folder';
167 $this->fileObject = $fileOrFolderObject;
168 $this->access = $this->fileObject->checkActionPermission(
'read');
169 $this->type =
'file';
170 $this->table =
'sys_file';
174 }
catch (\Exception $e) {
175 $this->row = array();
184 if (!$this->access) {
189 $typeRendered = FALSE;
190 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/show_item.php'][
'typeRendering'])) {
191 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'typo3/show_item.php'][
'typeRendering'] as $classRef) {
194 if (is_object($typeRenderObj) && method_exists($typeRenderObj,
'isValid') && method_exists($typeRenderObj,
'render')) {
195 if ($typeRenderObj->isValid($this->type, $this)) {
196 $this->content .= $typeRenderObj->render($this->type, $this);
197 $typeRendered = TRUE;
204 if (!$typeRendered) {
218 if ($this->type ===
'folder') {
219 $table =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_common.xlf:folder');
220 $title = $this->doc->getResourceHeader($this->folderObject, array(
' ',
''), FALSE);
221 } elseif ($this->type ===
'file') {
223 $title = $this->doc->getResourceHeader($this->fileObject, array(
' ',
''), FALSE);
226 $title = $this->doc->getHeader($this->table, $this->row, $this->pageinfo[
'_thePath'], 1, array(
' ',
''), FALSE);
242 if (!$this->fileObject) {
249 if ($this->fileObject->isMissing()) {
250 $flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($this->fileObject);
251 $imageTag .= $flashMessage->render();
255 $fileExtension = $this->fileObject->getExtension();
258 $thumbUrl = $this->fileObject->process(
264 )->getPublicUrl(TRUE);
269 $imageTag .=
'<img src="' . $thumbUrl .
'" ' .
270 'alt="' . htmlspecialchars(trim($this->fileObject->getName())) .
'" ' .
271 'title="' . htmlspecialchars(trim($this->fileObject->getName())) .
'" />';
275 $url = $this->fileObject->getPublicUrl(TRUE);
278 $downloadLink .=
'<a href="' . htmlspecialchars($url) .
'" target="_blank" class="t3-button">' .
280 $GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_common.xlf:download', TRUE) .
285 return ($imageTag ?
'<p>' . $imageTag .
'</p>' :
'') .
286 ($downloadLink ?
'<p>' . $downloadLink .
'</p>' :
'');
295 $tableRows = array();
296 $extraFields = array();
298 if (in_array($this->type, array(
'folder',
'file'), TRUE)) {
299 if ($this->type ===
'file') {
300 $extraFields[
'creation_date'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', TRUE);
301 $extraFields[
'modification_date'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', TRUE);
303 $extraFields[
'storage'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_tca.xlf:sys_file.storage', TRUE);
304 $extraFields[
'folder'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_common.xlf:folder', TRUE);
306 $extraFields[
'crdate'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', TRUE);
307 $extraFields[
'cruser_id'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.creationUserId', TRUE);
308 $extraFields[
'tstamp'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', TRUE);
311 foreach ($extraFields as $fieldName => $fieldLabel) {
312 if (isset(
$GLOBALS[
'TCA'][$this->table][
'ctrl'][$fieldName])) {
315 unset($extraFields[$fieldName]);
320 foreach ($extraFields as $name => $fieldLabel) {
322 if (!isset($this->row[$name])) {
324 if ($name ===
'storage') {
325 $rowValue = $resourceObject->getStorage()->getName();
326 } elseif ($name ===
'folder') {
327 $rowValue = $resourceObject->getParentFolder()->getReadablePath();
329 } elseif (in_array($name, array(
'creation_date',
'modification_date'), TRUE)) {
335 if ($name ===
'cruser_id' && $rowValue) {
336 $userTemp =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'username, realName',
'be_users',
'uid = ' . (
int)$rowValue);
337 if ($userTemp[
'username'] !==
'') {
338 $rowValue = $userTemp[
'username'];
339 if ($userTemp[
'realName'] !==
'') {
340 $rowValue .=
' - ' . $userTemp[
'realName'];
346 <th>' . rtrim($fieldLabel,
':') .
'</th> 347 <td>' . htmlspecialchars($rowValue) .
'</td> 353 foreach ($fieldList as $name) {
355 $uid = $this->row[
'uid'];
357 if (!isset(
$GLOBALS[
'TCA'][$this->table][
'columns'][$name])) {
362 if ($this->type ===
'file' && $name ===
'storage') {
366 $isExcluded = !(!
$GLOBALS[
'TCA'][
$this->table][
'columns'][$name][
'exclude'] ||
$GLOBALS[
'BE_USER']->check(
'non_exclude_fields', $this->table .
':' . $name));
371 $itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE,
$uid);
375 <td><strong>' . $itemLabel .
'</strong></td> 376 <td>' . htmlspecialchars($itemValue) .
'</td> 380 return '<table class="t3-table">' . implode(
'', $tableRows) .
'</table>';
391 switch ($this->type) {
393 $references = $this->
makeRef($this->table, $this->row[
'uid']);
394 if (!empty($references)) {
395 $content .= $this->doc->section(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem'), $references);
398 $referencesFrom = $this->
makeRefFrom($this->table, $this->row[
'uid']);
399 if (!empty($referencesFrom)) {
400 $content .= $this->doc->section(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem'), $referencesFrom);
406 if ($this->fileObject && $this->fileObject->isIndexed()) {
407 $references = $this->
makeRef(
'_FILE', $this->fileObject);
409 if (!empty($references)) {
410 $header =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem');
411 $content .= $this->doc->section($header, $references);
428 $tableRows = array();
429 foreach ($fieldList as $name) {
430 if (!isset(
$GLOBALS[
'TCA'][$this->table][
'columns'][$name])) {
433 $isExcluded = !(!
$GLOBALS[
'TCA'][
$this->table][
'columns'][$name][
'exclude'] ||
$GLOBALS[
'BE_USER']->check(
'non_exclude_fields', $this->table .
':' . $name));
437 $uid = $this->row[
'uid'];
438 $itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, FALSE,
$uid);
442 <td><strong>' . $itemLabel .
'</strong></td> 443 <td>' . htmlspecialchars($itemValue) .
'</td> 451 return '<table id="typo3-showitem" class="t3-table-info">' .
452 implode(
'', $tableRows) .
462 echo $this->doc->startPage(
'') .
463 $this->doc->insertStylesAndJS($this->content) .
464 $this->doc->endPage();
475 if (
$GLOBALS[
'TCA'][$tableName][
'columns'][$fieldName][
'label'] !== NULL) {
476 $field =
$GLOBALS[
'LANG']->sL(
$GLOBALS[
'TCA'][$tableName][
'columns'][$fieldName][
'label']);
477 if (trim($field) ===
'') {
500 $pageActionIcons =
'<a href="#" onclick="' . htmlspecialchars($editOnClick) .
'">' . $icon .
'</a>';
501 $historyOnClick =
'window.location.href=' .
506 'element' =>
$table .
':' . $uid,
510 ) .
'; return false;';
513 $pageActionIcons .=
'<a href="#" onclick="' . htmlspecialchars($historyOnClick) .
'">' . $icon .
'</a>';
515 $pageActionIcons .= $this->doc->viewPageIcon($uid,
'');
517 return $pageActionIcons;
530 $selectTable =
'sys_file';
531 $selectUid = $ref->getUid();
536 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
539 'ref_table=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($selectTable,
'sys_refindex') .
' AND ref_uid=' . (
int)$selectUid .
' AND deleted=0' 544 $infoDataHeader =
'';
546 $infoDataHeader =
'<tr>' .
'<td> </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>';
548 foreach ($rows as
$row) {
549 if ($row[
'tablename'] ===
'sys_file_reference') {
551 if ($row[
'tablename'] === NULL || $row[
'recuid'] === NULL) {
555 $record = BackendUtility::getRecord($row[
'tablename'], $row[
'recuid']);
557 $parentRecord = BackendUtility::getRecord(
'pages', $record[
'pid']);
558 $parentRecordTitle = is_array($parentRecord)
562 $infoData[] =
'<tr class="db_list_normal">' .
563 '<td style="white-space:nowrap;">' . $actions .
'</td>' .
564 '<td>' .
$GLOBALS[
'LANG']->sL(
$GLOBALS[
'TCA'][$row[
'tablename']][
'ctrl'][
'title'], TRUE) .
'</td>' .
566 '<td><span title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_common.xlf:page') .
': ' .
567 htmlspecialchars($parentRecordTitle) .
' (uid=' . $record[
'pid'] .
')">' .
568 $record[
'uid'] .
'</span></td>' .
570 '<td>' . htmlspecialchars($row[
'flexpointer']) .
'</td>' .
571 '<td>' . htmlspecialchars($row[
'softref_key']) .
'</td>' .
572 '<td>' . htmlspecialchars($row[
'sorting']) .
'</td>' .
575 $infoData[] =
'<tr class="db_list_normal">' .
576 '<td style="white-space:nowrap;"></td>' .
577 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.missing_record') .
' (uid=' . $row[
'recuid'] .
')</td>' .
578 '<td>' . htmlspecialchars(
$GLOBALS[
'LANG']->sL(
$GLOBALS[
'TCA'][$row[
'tablename']][
'ctrl'][
'title']) ?: $row[
'tablename']) .
'</td>' .
581 '<td>' . htmlspecialchars($row[
'flexpointer']) .
'</td>' .
582 '<td>' . htmlspecialchars($row[
'softref_key']) .
'</td>' .
583 '<td>' . htmlspecialchars($row[
'sorting']) .
'</td>' .
588 if (count($infoData)) {
589 $referenceLine =
'<table class="t3-table">' .
590 '<thead>' . $infoDataHeader .
'</thead>' .
592 implode(
'', $infoData) .
595 return $referenceLine;
606 $rows =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
609 'tablename=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr(
$table,
'sys_refindex') .
' AND recuid=' . (
int)$ref
615 $infoDataHeader =
'<tr class="t3-row-header">' .
617 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.field') .
'</td>' .
618 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.flexpointer') .
'</td>' .
619 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.softrefKey') .
'</td>' .
620 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.sorting') .
'</td>' .
621 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.refTable') .
'</td>' .
622 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.refUid') .
'</td>' .
623 '<td>' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:show_item.php.refString') .
'</td>' .
626 foreach ($rows as
$row) {
628 $infoData[] =
'<tr class="db_list_normal">' .
629 '<td style="white-space:nowrap;">' . $actions .
'</td>' .
631 '<td>' . htmlspecialchars($row[
'flexpointer']) .
'</td>' .
632 '<td>' . htmlspecialchars($row[
'softref_key']) .
'</td>' .
633 '<td>' . htmlspecialchars($row[
'sorting']) .
'</td>' .
634 '<td>' .
$GLOBALS[
'LANG']->sL(
$GLOBALS[
'TCA'][$row[
'ref_table']][
'ctrl'][
'title'], TRUE) .
'</td>' .
635 '<td>' . htmlspecialchars($row[
'ref_uid']) .
'</td>' .
636 '<td>' . htmlspecialchars($row[
'ref_string']) .
'</td>' .
640 if (empty($infoData)) {
644 return '<table class="t3-table">' .
645 '<thead>' . $infoDataHeader .
'</thead>' .
647 implode(
'', $infoData) .
658 $fileReference =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
660 'sys_file_reference',
661 'uid=' . (
int)$referenceRecord[
'recuid']
664 'recuid' => $fileReference[
'uid_foreign'],
665 'tablename' => $fileReference[
'tablenames'],
666 'field' => $fileReference[
'fieldname'],
669 'sorting' => $fileReference[
'sorting_foreign']
static getRecordWSOL($table, $uid, $fields=' *', $where='', $useDeleteClause=TRUE, $unsetMovePointers=FALSE)
static readPageAccess($id, $perms_clause)
static editOnClick($params, $backPath='', $requestUri='')
static getItemLabel($table, $col, $printAllWrap='')
renderFileInformationAsTable($fieldList)
static quoteJSvalue($value)
static getIndpEnv($getEnvName)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
renderPropertiesAsTable()
static getProcessedValueExtra($table, $fN, $fV, $fixed_lgd_chars=0, $uid=0, $forceResult=TRUE)
makeRefFrom($table, $ref)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
getRecordActions($table, $uid)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
getLabelForTableColumn($tableName, $fieldName)
static inList($list, $item)
transformFileReferenceToRecordReference(array $referenceRecord)
const CONTEXT_IMAGEPREVIEW