‪TYPO3CMS  10.4
FileList.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
16 namespace ‪TYPO3\CMS\Filelist;
17 
40 
47 {
53  public ‪$iLimit = 40;
54 
60  public ‪$thumbs = false;
61 
67  public ‪$spaceIcon;
68 
74  public ‪$fixedL = 30;
75 
81  public ‪$sort = '';
82 
88  public ‪$sortRev = true;
89 
93  public ‪$firstElementNumber = 0;
94 
98  public ‪$totalbytes = 0;
99 
105  public ‪$totalItems = 0;
106 
112  public ‪$fieldArray = [];
113 
119  public ‪$counter = 0;
120 
126  public ‪$eCounter = 0;
127 
131  public ‪$translateTools;
132 
138  public ‪$addElement_tdCssClass = [
139  '_CONTROL_' => 'col-control',
140  '_CLIPBOARD_' => 'col-clipboard',
141  'file' => 'col-title col-responsive',
142  '_LOCALIZATION_' => 'col-localizationa',
143  ];
144 
148  protected ‪$folderObject;
149 
153  public ‪$CBnames = [];
154 
158  public ‪$clipObj;
159 
164 
168  protected ‪$iconFactory;
169 
173  protected ‪$id = 0;
174 
178  protected ‪$thumbnailConfiguration;
179 
183  protected ‪$uriBuilder;
184 
185  public function ‪__construct()
186  {
187  // Setting the maximum length of the filenames to the user's settings or minimum 30 (= $this->fixedL)
188  $this->fixedL = max($this->fixedL, $this->‪getBackendUser()->uc['titleLen'] ?? 1);
189  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
190  $this->translateTools = GeneralUtility::makeInstance(TranslationConfigurationProvider::class);
191  $this->thumbnailConfiguration = GeneralUtility::makeInstance(ThumbnailConfiguration::class);
192  $this->iLimit = ‪MathUtility::forceIntegerInRange(
193  $this->‪getBackendUser()->getTSConfig()['options.']['file_list.']['filesPerPage'] ?? $this->iLimit,
194  1
195  );
196  // Create clipboard object and initialize that
197  $this->clipObj = GeneralUtility::makeInstance(Clipboard::class);
198  $this->clipObj->fileMode = true;
199  $this->clipObj->initializeClipboard();
200  $this->resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
201  $this->‪getLanguageService()->‪includeLLFile('EXT:core/Resources/Private/Language/locallang_common.xlf');
202  $this->uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
203  $this->spaceIcon = '<span class="btn btn-default disabled">' . $this->iconFactory->getIcon('empty-empty', ‪Icon::SIZE_SMALL)->render() . '</span>';
204  }
205 
216  public function ‪start(‪Folder ‪$folderObject, $pointer, ‪$sort, ‪$sortRev, $clipBoard = false, $bigControlPanel = false)
217  {
218  $this->folderObject = ‪$folderObject;
219  $this->counter = 0;
220  $this->totalbytes = 0;
221  $this->sort = ‪$sort;
222  $this->sortRev = ‪$sortRev;
223  $this->firstElementNumber = $pointer;
224  // Cleaning rowlist for duplicates and place the $titleCol as the first column always!
225  $rowlist = 'file,_LOCALIZATION_,fileext,tstamp,size,rw,_REF_';
226  if ($clipBoard) {
227  $rowlist = str_replace('_LOCALIZATION_,', '_LOCALIZATION_,_CLIPBOARD_,', $rowlist);
228  }
229  if ($bigControlPanel) {
230  $rowlist = str_replace('_LOCALIZATION_,', '_LOCALIZATION_,_CONTROL_,', $rowlist);
231  }
232  $this->fieldArray = explode(',', $rowlist);
233  }
234 
243  public function ‪linkClipboardHeaderIcon($string, $cmd, $warning = '')
244  {
245  if ($warning) {
246  $attributes['class'] = 'btn btn-default t3js-modal-trigger';
247  $attributes['data-severity'] = 'warning';
248  $attributes['data-content'] = $warning;
249  $attributes['data-event-name'] = 'filelist:clipboard:cmd';
250  $attributes['data-event-payload'] = $cmd;
251  } else {
252  $attributes['class'] = 'btn btn-default';
253  $attributes['data-filelist-clipboard-cmd'] = $cmd;
254  }
255 
256  return '<a href="#" ' . GeneralUtility::implodeAttributes($attributes, true) . '>' . $string . '</a>';
257  }
258 
264  public function ‪getTable()
265  {
266  // @todo use folder methods directly when they support filters
267  $storage = $this->folderObject->getStorage();
268  $storage->resetFileAndFolderNameFiltersToDefault();
269 
270  // Only render the contents of a browsable storage
271  if (!$this->folderObject->getStorage()->isBrowsable()) {
272  return '';
273  }
274  try {
275  $foldersCount = $storage->countFoldersInFolder($this->folderObject);
276  $filesCount = $storage->countFilesInFolder($this->folderObject);
277  } catch (InsufficientFolderAccessPermissionsException $e) {
278  $foldersCount = 0;
279  $filesCount = 0;
280  }
281 
282  if ($foldersCount <= $this->firstElementNumber) {
283  $foldersFrom = false;
284  $foldersNum = false;
285  } else {
286  $foldersFrom = ‪$this->firstElementNumber;
287  if ($this->firstElementNumber + $this->iLimit > $foldersCount) {
288  $foldersNum = $foldersCount - ‪$this->firstElementNumber;
289  } else {
290  $foldersNum = ‪$this->iLimit;
291  }
292  }
293  if ($foldersCount >= $this->firstElementNumber + $this->iLimit) {
294  $filesFrom = false;
295  $filesNum = false;
296  } else {
297  if ($this->firstElementNumber <= $foldersCount) {
298  $filesFrom = 0;
299  $filesNum = $this->iLimit - $foldersNum;
300  } else {
301  $filesFrom = $this->firstElementNumber - $foldersCount;
302  if ($filesFrom + $this->iLimit > $filesCount) {
303  $filesNum = $filesCount - $filesFrom;
304  } else {
305  $filesNum = ‪$this->iLimit;
306  }
307  }
308  }
309 
310  $folders = $storage->getFoldersInFolder($this->folderObject, $foldersFrom, $foldersNum, true, false, trim($this->sort), (bool)$this->sortRev);
311  $files = $this->folderObject->getFiles($filesFrom, $filesNum, ‪Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, false, trim($this->sort), (bool)$this->sortRev);
312  $this->totalItems = $foldersCount + $filesCount;
313  // Adds the code of files/dirs
314 
315  $folders = ‪ListUtility::resolveSpecialFolderNames($folders);
316 
317  $iOut = '';
318  // Directories are added
319  $this->eCounter = ‪$this->firstElementNumber;
320  $iOut .= $this->‪fwd_rwd_nav();
321 
322  $iOut .= $this->‪formatDirList($folders);
323  // Files are added
324  $iOut .= $this->‪formatFileList($files);
325 
326  $this->eCounter = $this->firstElementNumber + $this->iLimit < $this->totalItems
327  ? $this->firstElementNumber + $this->iLimit
328  : -1;
329  $iOut .= $this->‪fwd_rwd_nav();
330 
331  // Header line is drawn
332  $theData = [];
333  foreach ($this->fieldArray as $v) {
334  if ($v === '_CLIPBOARD_') {
335  $theData[$v] = $this->‪renderClipboardHeaderRow(!empty($iOut));
336  } elseif ($v === '_REF_') {
337  $theData[$v] = htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels._REF_'));
338  } else {
339  // Normal row
340  $theData[$v] = $this->‪linkWrapSort($this->folderObject->getCombinedIdentifier(), $v);
341  }
342  }
343 
344  return '
345  <div class="panel panel-default">
346  <div class="table-fit">
347  <table class="table table-striped table-hover" id="typo3-filelist">
348  <thead>' . $this->‪addElement('', $theData, 'th') . '</thead>
349  <tbody>' . $iOut . '</tbody>
350  </table>
351  </div>
352  </div>';
353  }
354 
355  protected function ‪renderClipboardHeaderRow(bool $hasContent): string
356  {
357  $cells = [];
358  $elFromTable = $this->clipObj->elFromTable('_FILE');
359  if (!empty($elFromTable) && $this->folderObject->checkActionPermission('write')) {
360  $clipboardMode = $this->clipObj->clipData[$this->clipObj->current]['mode'] ?? '';
361  $permission = $clipboardMode === 'copy' ? 'copy' : 'move';
362  $addPasteButton = $this->folderObject->checkActionPermission($permission);
363  $elToConfirm = [];
364  foreach ($elFromTable as $key => $element) {
365  $clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
366  if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $this->folderObject)) {
367  $addPasteButton = false;
368  }
369  $elToConfirm[$key] = $clipBoardElement->getName();
370  }
371  if ($addPasteButton) {
372  $cells[] = '<a class="btn btn-default t3js-modal-trigger"' .
373  ' href="' . htmlspecialchars($this->clipObj->pasteUrl(
374  '_FILE',
375  $this->folderObject->getCombinedIdentifier()
376  )) . '"'
377  . ' data-content="' . htmlspecialchars($this->clipObj->confirmMsgText(
378  '_FILE',
379  $this->folderObject->getReadablePath(),
380  'into',
381  $elToConfirm
382  )) . '"'
383  . ' data-severity="warning"'
384  . ' data-title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_paste')) . '"'
385  . ' title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_paste')) . '">'
386  . $this->iconFactory->getIcon('actions-document-paste-into', ‪Icon::SIZE_SMALL)
387  ->render()
388  . '</a>';
389  } else {
390  $cells[] = ‪$this->spaceIcon;
391  }
392  }
393  if ($this->clipObj->current !== 'normal' && $hasContent) {
394  $cells[] = $this->‪linkClipboardHeaderIcon('<span title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_selectMarked')) . '">' . $this->iconFactory->getIcon('actions-edit-copy', ‪Icon::SIZE_SMALL)->render() . '</span>', 'setCB');
395  $cells[] = $this->‪linkClipboardHeaderIcon('<span title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_deleteMarked')) . '">' . $this->iconFactory->getIcon('actions-edit-delete', ‪Icon::SIZE_SMALL)->render() . '</span>', 'delete', $this->getLanguageService()->getLL('clip_deleteMarkedWarning'));
396  $cells[] = '<a class="btn btn-default t3js-toggle-all-checkboxes" data-checkboxes-names="' . htmlspecialchars(implode(',', $this->CBnames)) . '" rel="" href="#" title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_markRecords')) . '">' . $this->iconFactory->getIcon('actions-document-select', ‪Icon::SIZE_SMALL)->render() . '</a>';
397  }
398  return implode('', $cells);
399  }
400 
411  public function ‪addElement($icon, $data, $colType = 'td')
412  {
413  $colType = ($colType === 'th') ? 'th' : 'td';
414  // Start up:
415  $l10nParent = (int)($data['_l10nparent_'] ?? 0);
416  $out = '
417  <tr data-uid="' . (int)($data['uid'] ?? 0) . '" data-l10nparent="' . $l10nParent . '">';
418  $out .= '
419  <' . $colType . ' class="col-icon nowrap">';
420  if ($icon) {
421  $out .= $icon;
422  }
423  $out .= '</' . $colType . '>';
424  // Init rendering.
425  $colsp = '';
426  $lastKey = '';
427  $c = 0;
428  $ccount = 0;
429  // __label is used as the label key to circumvent problems with uid used as label (see #67756)
430  // as it was introduced later on, check if it really exists before using it
432  if ($colType === 'td' && array_key_exists('__label', $data)) {
433  ‪$fields[0] = '__label';
434  }
435  // Traverse field array which contains the data to present:
436  foreach (‪$fields as $vKey) {
437  if (isset($data[$vKey])) {
438  if ($lastKey) {
439  $cssClass = $this->addElement_tdCssClass[$lastKey] ?? '';
440  $out .= '
441  <' . $colType . ' class="' . $cssClass . '"' . $colsp . '>' . $data[$lastKey] . '</' . $colType . '>';
442  }
443  $lastKey = $vKey;
444  $c = 1;
445  $ccount++;
446  } else {
447  if (!$lastKey) {
448  $lastKey = $vKey;
449  }
450  $c++;
451  }
452  if ($c > 1) {
453  $colsp = ' colspan="' . $c . '"';
454  } else {
455  $colsp = '';
456  }
457  }
458  if ($lastKey) {
459  $cssClass = $this->addElement_tdCssClass[$lastKey] ?? '';
460  $out .= '
461  <' . $colType . ' class="' . $cssClass . '"' . $colsp . '>' . $data[$lastKey] . '</' . $colType . '>';
462  }
463  $out .= '
464  </tr>';
465  return $out;
466  }
467 
473  public function ‪fwd_rwd_nav()
474  {
475  $code = '';
476  if ($this->eCounter >= $this->firstElementNumber && $this->eCounter < $this->firstElementNumber + $this->iLimit) {
477  if ($this->firstElementNumber && $this->eCounter == $this->firstElementNumber) {
478  // Reverse
479  $theData = [];
480  $theData['file'] = $this->‪fwd_rwd_HTML('fwd', $this->eCounter);
481  $code = $this->‪addElement('', $theData);
482  }
483  return $code;
484  }
485  if ($this->eCounter == $this->firstElementNumber + $this->iLimit) {
486  // Forward
487  $theData = [];
488  $theData['file'] = $this->‪fwd_rwd_HTML('rwd', $this->eCounter);
489  $code = $this->‪addElement('', $theData);
490  }
491  return $code;
492  }
493 
502  public function ‪fwd_rwd_HTML($type, $pointer)
503  {
504  $content = '';
505  switch ($type) {
506  case 'fwd':
507  $href = $this->‪listURL() . '&pointer=' . ($pointer - ‪$this->iLimit);
508  $content = '<a href="' . htmlspecialchars($href) . '">' . $this->iconFactory->getIcon(
509  'actions-move-up',
511  )->render() . ' <i>[' . (max(0, $pointer - $this->iLimit) + 1) . ' - ' . $pointer . ']</i></a>';
512  break;
513  case 'rwd':
514  $href = $this->‪listURL() . '&pointer=' . $pointer;
515  $content = '<a href="' . htmlspecialchars($href) . '">' . $this->iconFactory->getIcon(
516  'actions-move-down',
518  )->render() . ' <i>[' . ($pointer + 1) . ' - ' . $this->totalItems . ']</i></a>';
519  break;
520  }
521  return $content;
522  }
523 
529  public function ‪getFolderInfo()
530  {
531  if ($this->counter == 1) {
532  $fileLabel = htmlspecialchars($this->‪getLanguageService()->getLL('file'));
533  } else {
534  $fileLabel = htmlspecialchars($this->‪getLanguageService()->getLL('files'));
535  }
536  return $this->counter . ' ' . $fileLabel . ', ' . GeneralUtility::formatSize($this->totalbytes, htmlspecialchars($this->‪getLanguageService()->getLL('byteSizeUnits')));
537  }
538 
545  public function ‪formatDirList(array $folders)
546  {
547  $out = '';
548  foreach ($folders as $folderName => ‪$folderObject) {
549  $role = ‪$folderObject->‪getRole();
550  if ($role === ‪FolderInterface::ROLE_PROCESSING) {
551  // don't show processing-folder
552  continue;
553  }
554  if ($role !== ‪FolderInterface::ROLE_DEFAULT) {
555  $displayName = '<strong>' . htmlspecialchars($folderName) . '</strong>';
556  } else {
557  $displayName = htmlspecialchars($folderName);
558  }
559 
560  $isLocked = ‪$folderObject instanceof InaccessibleFolder;
561  $isWritable = ‪$folderObject->‪checkActionPermission('write');
562 
563  // Initialization
564  $this->counter++;
565 
566  // The icon with link
567  $theIcon = '<span title="' . htmlspecialchars($folderName) . '">' . $this->iconFactory->getIconForResource(‪$folderObject, ‪Icon::SIZE_SMALL)->render() . '</span>';
568  if (!$isLocked) {
570  }
571 
572  // Preparing and getting the data-array
573  $theData = [];
574  if ($isLocked) {
575  foreach ($this->fieldArray as $field) {
576  $theData[$field] = '';
577  }
578  $theData['file'] = $displayName;
579  } else {
580  foreach ($this->fieldArray as $field) {
581  switch ($field) {
582  case 'size':
583  try {
584  $numFiles = ‪$folderObject->‪getFileCount();
585  } catch (InsufficientFolderAccessPermissionsException $e) {
586  $numFiles = 0;
587  }
588  $theData[$field] = $numFiles . ' ' . htmlspecialchars($this->‪getLanguageService()->getLL(($numFiles === 1 ? 'file' : 'files')));
589  break;
590  case 'rw':
591  $theData[$field] = '<strong class="text-danger">' . htmlspecialchars($this->‪getLanguageService()->getLL('read')) . '</strong>' . (!$isWritable ? '' : '<strong class="text-danger">' . htmlspecialchars($this->‪getLanguageService()->getLL('write')) . '</strong>');
592  break;
593  case 'fileext':
594  $theData[$field] = htmlspecialchars($this->‪getLanguageService()->getLL('folder'));
595  break;
596  case 'tstamp':
598  $theData[$field] = $tstamp ? ‪BackendUtility::date($tstamp) : '-';
599  break;
600  case 'file':
601  $theData[$field] = $this->‪linkWrapDir($displayName, ‪$folderObject);
602  break;
603  case '_CONTROL_':
604  $theData[$field] = $this->‪makeEdit($folderObject);
605  break;
606  case '_CLIPBOARD_':
607  $theData[$field] = $this->‪makeClip($folderObject);
608  break;
609  case '_REF_':
610  $theData[$field] = $this->‪makeRef($folderObject);
611  break;
612  default:
613  $theData[$field] = GeneralUtility::fixed_lgd_cs($theData[$field] ?? '', $this->fixedL);
614  }
615  }
616  }
617  $out .= $this->‪addElement($theIcon, $theData);
618  }
619  return $out;
620  }
621 
629  public function ‪linkWrapDir($title, Folder ‪$folderObject)
630  {
631  $href = (string)$this->uriBuilder->buildUriFromRoute('file_FilelistList', ['id' => ‪$folderObject->‪getCombinedIdentifier()]);
632  $triggerTreeUpdateAttribute = sprintf(
633  ' data-tree-update-request="%s"',
634  htmlspecialchars('folder' . GeneralUtility::md5int(‪$folderObject->‪getCombinedIdentifier()))
635  );
636  // Sometimes $code contains plain HTML tags. In such a case the string should not be modified!
637  if ((string)$title === strip_tags($title)) {
638  return '<a href="' . htmlspecialchars($href) . '"' . $triggerTreeUpdateAttribute . ' title="' . htmlspecialchars($title) . '">' . $title . '</a>';
639  }
640  return '<a href="' . htmlspecialchars($href) . '"' . $triggerTreeUpdateAttribute . '>' . $title . '</a>';
641  }
642 
650  public function ‪linkWrapFile($code, File $fileObject)
651  {
652  try {
653  if ($fileObject instanceof File && $fileObject->isIndexed() && $fileObject->checkActionPermission('editMeta') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
654  $metaData = $fileObject->getMetaData()->get();
655  if (!empty($metaData['uid'] ?? 0)) {
656  $urlParameters = [
657  'edit' => [
658  'sys_file_metadata' => [
659  $metaData['uid'] => 'edit'
660  ]
661  ],
662  'returnUrl' => $this->‪listURL()
663  ];
664  $url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
665  $title = htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.editMetadata'));
666  $code = '<a class="responsive-title" href="' . htmlspecialchars($url) . '" title="' . $title . '">' . $code . '</a>';
667  }
668  }
669  } catch (\Exception $e) {
670  // intentional fall-through
671  }
672  return $code;
673  }
674 
682  public function ‪listURL()
683  {
684  return GeneralUtility::linkThisScript([
685  'target' => rawurlencode($this->folderObject->getCombinedIdentifier()),
686  'imagemode' => $this->thumbs
687  ]);
688  }
689 
690  protected function ‪getAvailableSystemLanguages(): array
691  {
692  // first two keys are "0" (default) and "-1" (multiple), after that comes the "other languages"
693  $allSystemLanguages = $this->translateTools->getSystemLanguages();
694  return array_filter($allSystemLanguages, function ($languageRecord) {
695  if ($languageRecord['uid'] === -1 || $languageRecord['uid'] === 0 || !$this->‪getBackendUser()->checkLanguageAccess($languageRecord['uid'])) {
696  return false;
697  }
698  return true;
699  });
700  }
707  public function ‪formatFileList(array $files)
708  {
709  $out = '';
710  $systemLanguages = $this->‪getAvailableSystemLanguages();
711  foreach ($files as $fileObject) {
712  // Initialization
713  $this->counter++;
714  $this->totalbytes += $fileObject->getSize();
715  $ext = $fileObject->getExtension();
716  $fileName = trim($fileObject->getName());
717  // The icon with link
718  $theIcon = '<span title="' . htmlspecialchars($fileName . ' [' . (int)$fileObject->getUid() . ']') . '">'
719  . $this->iconFactory->getIconForResource($fileObject, ‪Icon::SIZE_SMALL)->render() . '</span>';
720  $theIcon = ‪BackendUtility::wrapClickMenuOnIcon($theIcon, 'sys_file', $fileObject->getCombinedIdentifier());
721  // Preparing and getting the data-array
722  $theData = [];
723  foreach ($this->fieldArray as $field) {
724  switch ($field) {
725  case 'size':
726  $theData[$field] = GeneralUtility::formatSize((int)$fileObject->getSize(), htmlspecialchars($this->‪getLanguageService()->getLL('byteSizeUnits')));
727  break;
728  case 'rw':
729  $theData[$field] = '' . (!$fileObject->checkActionPermission('read') ? ' ' : '<strong class="text-danger">' . htmlspecialchars($this->‪getLanguageService()->getLL('read')) . '</strong>') . (!$fileObject->checkActionPermission('write') ? '' : '<strong class="text-danger">' . htmlspecialchars($this->‪getLanguageService()->getLL('write')) . '</strong>');
730  break;
731  case 'fileext':
732  $theData[$field] = htmlspecialchars(strtoupper($ext));
733  break;
734  case 'tstamp':
735  $theData[$field] = ‪BackendUtility::date($fileObject->getModificationTime());
736  break;
737  case '_CONTROL_':
738  $theData[$field] = $this->‪makeEdit($fileObject);
739  break;
740  case '_CLIPBOARD_':
741  $theData[$field] = $this->‪makeClip($fileObject);
742  break;
743  case '_LOCALIZATION_':
744  if (!empty($systemLanguages) && $fileObject->isIndexed() && $fileObject->checkActionPermission('editMeta') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata') && !empty(‪$GLOBALS['TCA']['sys_file_metadata']['ctrl']['languageField'] ?? null)) {
745  $metaDataRecord = $fileObject->getMetaData()->get();
746  $translations = $this->‪getTranslationsForMetaData($metaDataRecord);
747  $languageCode = '';
748 
749  foreach ($systemLanguages as $language) {
750  $languageId = $language['uid'];
751  $flagIcon = $language['flagIcon'];
752  if (array_key_exists($languageId, $translations)) {
753  $title = htmlspecialchars(sprintf($this->‪getLanguageService()->getLL('editMetadataForLanguage'), $language['title']));
754  $urlParameters = [
755  'edit' => [
756  'sys_file_metadata' => [
757  $translations[$languageId]['uid'] => 'edit'
758  ]
759  ],
760  'returnUrl' => $this->‪listURL()
761  ];
762  $flagButtonIcon = $this->iconFactory->getIcon($flagIcon, ‪Icon::SIZE_SMALL, 'overlay-edit')->render();
763  $url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
764  $languageCode .= '<a href="' . htmlspecialchars($url) . '" class="btn btn-default" title="' . $title . '">'
765  . $flagButtonIcon . '</a>';
766  } else {
767  $parameters = [
768  'justLocalized' => 'sys_file_metadata:' . $metaDataRecord['uid'] . ':' . $languageId,
769  'returnUrl' => $this->‪listURL()
770  ];
771  $returnUrl = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $parameters);
773  '&cmd[sys_file_metadata][' . $metaDataRecord['uid'] . '][localize]=' . $languageId,
774  $returnUrl
775  );
776  $flagButtonIcon = '<span title="' . htmlspecialchars(sprintf($this->‪getLanguageService()->getLL('createMetadataForLanguage'), $language['title'])) . '">' . $this->iconFactory->getIcon($flagIcon, ‪Icon::SIZE_SMALL, 'overlay-new')->render() . '</span>';
777  $languageCode .= '<a href="' . htmlspecialchars($href) . '" class="btn btn-default">' . $flagButtonIcon . '</a> ';
778  }
779  }
780 
781  // Hide flag button bar when not translated yet
782  $theData[$field] = ' <div class="localisationData btn-group" data-fileid="' . $fileObject->getUid() . '"' .
783  (empty($translations) ? ' style="display: none;"' : '') . '>' . $languageCode . '</div>';
784  $theData[$field] .= '<a class="btn btn-default filelist-translationToggler" data-fileid="' . $fileObject->getUid() . '">' .
785  '<span title="' . htmlspecialchars($this->‪getLanguageService()->getLL('translateMetadata')) . '">'
786  . $this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', ‪Icon::SIZE_SMALL)->render() . '</span>'
787  . '</a>';
788  }
789  break;
790  case '_REF_':
791  $theData[$field] = $this->‪makeRef($fileObject);
792  break;
793  case 'file':
794  // Edit metadata of file
795  $theData[$field] = $this->‪linkWrapFile(htmlspecialchars($fileName), $fileObject);
796 
797  if ($fileObject->isMissing()) {
798  $theData[$field] .= '<span class="label label-danger label-space-left">'
799  . htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.file_missing'))
800  . '</span>';
801  // Thumbnails?
802  } elseif ($this->thumbs && ($fileObject->isImage() || $fileObject->isMediaFile())) {
803  $processedFile = $fileObject->process(
805  [
806  'width' => $this->thumbnailConfiguration->getWidth(),
807  'height' => $this->thumbnailConfiguration->getHeight(),
808  ]
809  );
810  $theData[$field] .= '<br /><img src="' . htmlspecialchars($processedFile->getPublicUrl(true)) . '" ' .
811  'width="' . htmlspecialchars($processedFile->getProperty('width')) . '" ' .
812  'height="' . htmlspecialchars($processedFile->getProperty('height')) . '" ' .
813  'title="' . htmlspecialchars($fileName) . '" alt="" />';
814  }
815  break;
816  default:
817  $theData[$field] = '';
818  if ($fileObject->hasProperty($field)) {
819  $theData[$field] = htmlspecialchars(GeneralUtility::fixed_lgd_cs($fileObject->getProperty($field), $this->fixedL));
820  }
821  }
822  }
823  $out .= $this->‪addElement($theIcon, $theData);
824  }
825  return $out;
826  }
827 
834  protected function ‪getTranslationsForMetaData($metaDataRecord)
835  {
836  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file_metadata');
837  $queryBuilder->getRestrictions()->removeAll();
838  $translationRecords = $queryBuilder->select('*')
839  ->from('sys_file_metadata')
840  ->where(
841  $queryBuilder->expr()->eq(
842  ‪$GLOBALS['TCA']['sys_file_metadata']['ctrl']['transOrigPointerField'],
843  $queryBuilder->createNamedParameter($metaDataRecord['uid'], \PDO::PARAM_INT)
844  ),
845  $queryBuilder->expr()->gt(
846  ‪$GLOBALS['TCA']['sys_file_metadata']['ctrl']['languageField'],
847  $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
848  )
849  )
850  ->execute()
851  ->fetchAll();
852 
853  $translations = [];
854  foreach ($translationRecords as $record) {
855  $translations[$record[‪$GLOBALS['TCA']['sys_file_metadata']['ctrl']['languageField']]] = $record;
856  }
857  return $translations;
858  }
859 
867  public function ‪isImage($ext)
868  {
869  return GeneralUtility::inList(strtolower(‪$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']), strtolower($ext));
870  }
871 
879  public function ‪isMediaFile($ext)
880  {
881  return GeneralUtility::inList(strtolower(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext']), strtolower($ext));
882  }
883 
891  public function ‪linkWrapSort($folderIdentifier, $col)
892  {
893  $code = htmlspecialchars($this->‪getLanguageService()->getLL('c_' . $col));
894  $params = ['id' => $folderIdentifier, 'SET' => ['sort' => $col]];
895 
896  if ($this->sort === $col) {
897  // Check reverse sorting
898  $params['SET']['reverse'] = ($this->sortRev ? '0' : '1');
899  $sortArrow = $this->iconFactory->getIcon('status-status-sorting-' . ($this->sortRev ? 'desc' : 'asc'), ‪Icon::SIZE_SMALL)->render();
900  } else {
901  $params['SET']['reverse'] = 0;
902  $sortArrow = '';
903  }
904  $href = (string)$this->uriBuilder->buildUriFromRoute('file_FilelistList', $params);
905  return '<a href="' . htmlspecialchars($href) . '">' . $code . ' ' . $sortArrow . '</a>';
906  }
907 
914  public function ‪makeClip($fileOrFolderObject)
915  {
916  if (!$fileOrFolderObject->checkActionPermission('read')) {
917  return '';
918  }
919  $cells = [];
920  $fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
921  $fullName = $fileOrFolderObject->getName();
922  $md5 = GeneralUtility::shortMD5($fullIdentifier);
923  // For normal clipboard, add copy/cut buttons:
924  if ($this->clipObj->current === 'normal') {
925  $isSel = $this->clipObj->isSelected('_FILE', $md5);
926  $copyTitle = htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy'));
927  $cutTitle = htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cut'));
928  $copyIcon = $this->iconFactory->getIcon('actions-edit-copy', ‪Icon::SIZE_SMALL)->render();
929  $cutIcon = $this->iconFactory->getIcon('actions-edit-cut', ‪Icon::SIZE_SMALL)->render();
930 
931  if ($isSel === 'copy') {
932  $copyIcon = $this->iconFactory->getIcon('actions-edit-copy-release', ‪Icon::SIZE_SMALL)->render();
933  } elseif ($isSel === 'cut') {
934  $cutIcon = $this->iconFactory->getIcon('actions-edit-cut-release', ‪Icon::SIZE_SMALL)->render();
935  }
936 
937  if ($fileOrFolderObject->checkActionPermission('copy')) {
938  $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->selUrlFile(
939  $fullIdentifier,
940  1,
941  $isSel === 'copy'
942  )) . '" title="' . $copyTitle . '">' . $copyIcon . '</a>';
943  } else {
944  $cells[] = ‪$this->spaceIcon;
945  }
946  // we can only cut if file can be moved
947  if ($fileOrFolderObject->checkActionPermission('move')) {
948  $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->selUrlFile(
949  $fullIdentifier,
950  0,
951  $isSel === 'cut'
952  )) . '" title="' . $cutTitle . '">' . $cutIcon . '</a>';
953  } else {
954  $cells[] = ‪$this->spaceIcon;
955  }
956  } else {
957  // For numeric pads, add select checkboxes:
958  $n = '_FILE|' . $md5;
959  $this->CBnames[] = $n;
960  $checked = $this->clipObj->isSelected('_FILE', $md5) ? ' checked="checked"' : '';
961  $cells[] = '<input type="hidden" name="CBH[' . $n . ']" value="0" /><label class="btn btn-default btn-checkbox"><input type="checkbox" name="CBC[' . $n . ']" value="' . htmlspecialchars($fullIdentifier) . '" ' . $checked . ' /><span class="t3-icon fa"></span></label>';
962  }
963  // Display PASTE button, if directory:
964  $elFromTable = $this->clipObj->elFromTable('_FILE');
965  if ($fileOrFolderObject instanceof Folder && !empty($elFromTable) && $fileOrFolderObject->checkActionPermission('write')) {
966  $clipboardMode = $this->clipObj->clipData[$this->clipObj->current]['mode'] ?? '';
967  $permission = $clipboardMode === 'copy' ? 'copy' : 'move';
968  $addPasteButton = $this->folderObject->checkActionPermission($permission);
969  $elToConfirm = [];
970  foreach ($elFromTable as $key => $element) {
971  $clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
972  if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $fileOrFolderObject)) {
973  $addPasteButton = false;
974  }
975  $elToConfirm[$key] = $clipBoardElement->getName();
976  }
977  if ($addPasteButton) {
978  $cells[] = '<a class="btn btn-default t3js-modal-trigger" '
979  . ' href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '"'
980  . ' data-content="' . htmlspecialchars($this->clipObj->confirmMsgText('_FILE', $fullName, 'into', $elToConfirm)) . '"'
981  . ' data-severity="warning"'
982  . ' data-title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_pasteInto')) . '"'
983  . ' title="' . htmlspecialchars($this->‪getLanguageService()->getLL('clip_pasteInto')) . '"'
984  . '>'
985  . $this->iconFactory->getIcon('actions-document-paste-into', ‪Icon::SIZE_SMALL)->render()
986  . '</a>';
987  } else {
988  $cells[] = ‪$this->spaceIcon;
989  }
990  }
991  // Compile items into a DIV-element:
992  return ' <div class="btn-group" role="group">' . implode('', $cells) . '</div>';
993  }
994 
1001  public function ‪makeEdit($fileOrFolderObject)
1002  {
1003  $cells = [];
1004  $fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
1005 
1006  // Edit file content (if editable)
1007  if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('write') && $fileOrFolderObject->isTextFile()) {
1008  $attributes = [
1009  'href' => (string)$this->uriBuilder->buildUriFromRoute('file_edit', ['target' => $fullIdentifier, 'returnUrl' => $this->listURL()]),
1010  'title' => $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.editcontent'),
1011  ];
1012  $cells['edit'] = '<a class="btn btn-default" ' . GeneralUtility::implodeAttributes($attributes, true) . '>'
1013  . $this->iconFactory->getIcon('actions-page-open', ‪Icon::SIZE_SMALL)->render()
1014  . '</a>';
1015  } else {
1016  $cells['edit'] = ‪$this->spaceIcon;
1017  }
1018 
1019  // Edit metadata of file
1020  if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('editMeta') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
1021  $metaData = $fileOrFolderObject->getMetaData()->get();
1022  if (!empty($metaData['uid'] ?? 0)) {
1023  $urlParameters = [
1024  'edit' => [
1025  'sys_file_metadata' => [
1026  $metaData['uid'] => 'edit'
1027  ]
1028  ],
1029  'returnUrl' => $this->‪listURL()
1030  ];
1031  $url = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
1032  $title = htmlspecialchars($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.editMetadata'));
1033  $cells['metadata'] = '<a class="btn btn-default" href="' . htmlspecialchars($url) . '" title="' . $title . '">' . $this->iconFactory->getIcon('actions-open', ‪Icon::SIZE_SMALL)->render() . '</a>';
1034  } else {
1035  $cells['metadata'] = ‪$this->spaceIcon;
1036  }
1037  }
1038 
1039  // document view
1040  if ($fileOrFolderObject instanceof File) {
1041  $fileUrl = $fileOrFolderObject->getPublicUrl(true);
1042  if ($fileUrl) {
1043  $cells['view'] = '<a href="' . htmlspecialchars($fileUrl) . '" target="_blank" class="btn btn-default" title="' . $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.view') . '">' . $this->iconFactory->getIcon('actions-document-view', ‪Icon::SIZE_SMALL)->render() . '</a>';
1044  } else {
1045  $cells['view'] = ‪$this->spaceIcon;
1046  }
1047  } else {
1048  $cells['view'] = ‪$this->spaceIcon;
1049  }
1050 
1051  // replace file
1052  if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('replace')) {
1053  $attributes = [
1054  'href' => $url = (string)$this->uriBuilder->buildUriFromRoute('file_replace', ['target' => $fullIdentifier, 'uid' => $fileOrFolderObject->getUid(), 'returnUrl' => $this->‪listURL()]),
1055  'title' => $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.replace'),
1056  ];
1057  $cells['replace'] = '<a class="btn btn-default" ' . GeneralUtility::implodeAttributes($attributes, true) . '>' . $this->iconFactory->getIcon('actions-edit-replace', ‪Icon::SIZE_SMALL)->render() . '</a>';
1058  }
1059 
1060  // rename the file
1061  if ($fileOrFolderObject->checkActionPermission('rename')) {
1062  $attributes = [
1063  'href' => (string)$this->uriBuilder->buildUriFromRoute('file_rename', ['target' => $fullIdentifier, 'returnUrl' => $this->listURL()]),
1064  'title' => $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.rename'),
1065  ];
1066  $cells['rename'] = '<a class="btn btn-default" ' . GeneralUtility::implodeAttributes($attributes, true) . '>' . $this->iconFactory->getIcon('actions-edit-rename', ‪Icon::SIZE_SMALL)->render() . '</a>';
1067  } else {
1068  $cells['rename'] = ‪$this->spaceIcon;
1069  }
1070 
1071  // upload files
1072  if ($fileOrFolderObject->getStorage()->checkUserActionPermission('add', 'File') && $fileOrFolderObject->checkActionPermission('write')) {
1073  if ($fileOrFolderObject instanceof Folder) {
1074  $attributes = [
1075  'href' => (string)$this->uriBuilder->buildUriFromRoute('file_upload', ['target' => $fullIdentifier, 'returnUrl' => $this->listURL()]),
1076  'title' => $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.upload'),
1077  ];
1078  $cells['upload'] = '<a class="btn btn-default" ' . GeneralUtility::implodeAttributes($attributes, true) . '>' . $this->iconFactory->getIcon('actions-edit-upload', ‪Icon::SIZE_SMALL)->render() . '</a>';
1079  }
1080  }
1081 
1082  if ($fileOrFolderObject->checkActionPermission('read')) {
1083  $attributes = [
1084  'title' => $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.info'),
1085  ];
1086  if ($fileOrFolderObject instanceof Folder || $fileOrFolderObject instanceof File) {
1087  $attributes['data-filelist-show-item-type'] = $fileOrFolderObject instanceof File ? '_FILE' : '_FOLDER';
1088  $attributes['data-filelist-show-item-identifier'] = $fullIdentifier;
1089  }
1090  $cells['info'] = '<a href="#" class="btn btn-default" ' . GeneralUtility::implodeAttributes($attributes, true) . '>'
1091  . $this->iconFactory->getIcon('actions-document-info', ‪Icon::SIZE_SMALL)->render() . '</a>';
1092  } else {
1093  $cells['info'] = ‪$this->spaceIcon;
1094  }
1095 
1096  // delete the file
1097  if ($fileOrFolderObject->checkActionPermission('delete')) {
1098  $identifier = $fileOrFolderObject->getIdentifier();
1099  if ($fileOrFolderObject instanceof Folder) {
1100  $referenceCountText = ‪BackendUtility::referenceCount('_FILE', $identifier, ' ' . $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.referencesToFolder'));
1101  $deleteType = 'delete_folder';
1102  } else {
1103  $referenceCountText = ‪BackendUtility::referenceCount('sys_file', (string)$fileOrFolderObject->getUid(), ' ' . $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.referencesToFile'));
1104  $deleteType = 'delete_file';
1105  }
1106 
1107  if ($this->‪getBackendUser()->jsConfirmation(‪JsConfirmation::DELETE)) {
1108  $confirmationCheck = '1';
1109  } else {
1110  $confirmationCheck = '0';
1111  }
1112 
1113  $deleteUrl = (string)$this->uriBuilder->buildUriFromRoute('tce_file');
1114  $confirmationMessage = sprintf($this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:mess.delete'), $fileOrFolderObject->getName()) . $referenceCountText;
1115  $title = $this->‪getLanguageService()->‪sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.delete');
1116  $cells['delete'] = '<a href="#" class="btn btn-default t3js-filelist-delete" data-content="' . htmlspecialchars($confirmationMessage)
1117  . '" data-check="' . $confirmationCheck
1118  . '" data-delete-url="' . htmlspecialchars($deleteUrl)
1119  . '" data-title="' . htmlspecialchars($title)
1120  . '" data-identifier="' . htmlspecialchars($fileOrFolderObject->getCombinedIdentifier())
1121  . '" data-delete-type="' . $deleteType
1122  . '" title="' . htmlspecialchars($title) . '">'
1123  . $this->iconFactory->getIcon('actions-edit-delete', ‪Icon::SIZE_SMALL)->render() . '</a>';
1124  } else {
1125  $cells['delete'] = ‪$this->spaceIcon;
1126  }
1127 
1128  // Hook for manipulating edit icons.
1129  $cells['__fileOrFolderObject'] = $fileOrFolderObject;
1130  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] ?? [] as $className) {
1131  $hookObject = GeneralUtility::makeInstance($className);
1132  if (!$hookObject instanceof ‪FileListEditIconHookInterface) {
1133  throw new \UnexpectedValueException(
1134  $className . ' must implement interface ' . FileListEditIconHookInterface::class,
1135  1235225797
1136  );
1137  }
1138  $hookObject->manipulateEditIcons($cells, $this);
1139  }
1140  unset($cells['__fileOrFolderObject']);
1141  // Compile items into a DIV-element:
1142  return '<div class="btn-group">' . implode('', $cells) . '</div>';
1143  }
1144 
1151  public function ‪makeRef($fileOrFolderObject)
1152  {
1153  if ($fileOrFolderObject instanceof FolderInterface) {
1154  return '-';
1155  }
1156  // Look up the file in the sys_refindex.
1157  // Exclude sys_file_metadata records as these are no use references
1158  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_refindex');
1159  $referenceCount = $queryBuilder->count('*')
1160  ->from('sys_refindex')
1161  ->where(
1162  $queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
1163  $queryBuilder->expr()->eq(
1164  'ref_table',
1165  $queryBuilder->createNamedParameter('sys_file', \PDO::PARAM_STR)
1166  ),
1167  $queryBuilder->expr()->eq(
1168  'ref_uid',
1169  $queryBuilder->createNamedParameter($fileOrFolderObject->getUid(), \PDO::PARAM_INT)
1170  ),
1171  $queryBuilder->expr()->neq(
1172  'tablename',
1173  $queryBuilder->createNamedParameter('sys_file_metadata', \PDO::PARAM_STR)
1174  )
1175  )
1176  ->execute()
1177  ->fetchColumn();
1178 
1179  return $this->‪generateReferenceToolTip($referenceCount, $fileOrFolderObject);
1180  }
1181 
1187  protected function ‪getLanguageService()
1188  {
1189  return ‪$GLOBALS['LANG'];
1190  }
1191 
1197  protected function ‪getBackendUser()
1198  {
1199  return ‪$GLOBALS['BE_USER'];
1200  }
1201 
1210  protected function ‪generateReferenceToolTip($references, $fileObject)
1211  {
1212  if (!$references) {
1213  return '-';
1214  }
1215  $attributes = [
1216  'data-filelist-show-item-type' => '_FILE',
1217  'data-filelist-show-item-identifier' => $fileObject->getCombinedIdentifier(),
1218  'title' => $this->‪getLanguageService()
1219  ->‪sL('LLL:EXT:backend/Resources/Private/Language/locallang.xlf:show_references')
1220  . ' (' . $references . ')'
1221  ];
1222  $htmlCode = '<a href="#" ' . GeneralUtility::implodeAttributes($attributes, true) . '>';
1223  $htmlCode .= $references;
1224  $htmlCode .= '</a>';
1225  return $htmlCode;
1226  }
1227 }
‪TYPO3\CMS\Filelist\FileList\formatFileList
‪string formatFileList(array $files)
Definition: FileList.php:685
‪TYPO3\CMS\Filelist\FileList\$addElement_tdCssClass
‪array $addElement_tdCssClass
Definition: FileList.php:124
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:30
‪TYPO3\CMS\Filelist\Configuration\ThumbnailConfiguration
Definition: ThumbnailConfiguration.php:27
‪TYPO3\CMS\Core\Resource\File\getMetaData
‪MetaDataAspect getMetaData()
Definition: File.php:356
‪TYPO3\CMS\Core\Resource\ProcessedFile\CONTEXT_IMAGEPREVIEW
‪const CONTEXT_IMAGEPREVIEW
Definition: ProcessedFile.php:52
‪TYPO3\CMS\Core\Localization\LanguageService\includeLLFile
‪array includeLLFile($fileRef, $setGlobal=null, $mergeLocalOntoDefault=null)
Definition: LanguageService.php:297
‪TYPO3\CMS\Filelist\FileList\listURL
‪string listURL()
Definition: FileList.php:660
‪TYPO3\CMS\Backend\Utility\BackendUtility\getLinkToDataHandlerAction
‪static string getLinkToDataHandlerAction($parameters, $redirectUrl='')
Definition: BackendUtility.php:2539
‪TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException
Definition: InsufficientFolderAccessPermissionsException.php:24
‪TYPO3\CMS\Filelist\FileList\$translateTools
‪TranslationConfigurationProvider $translateTools
Definition: FileList.php:118
‪TYPO3\CMS\Filelist\FileList\makeRef
‪string makeRef($fileOrFolderObject)
Definition: FileList.php:1129
‪TYPO3\CMS\Filelist\FileList\$spaceIcon
‪string $spaceIcon
Definition: FileList.php:64
‪TYPO3\CMS\Backend\Clipboard\Clipboard
Definition: Clipboard.php:43
‪TYPO3\CMS\Core\Resource\File\isIndexed
‪bool null isIndexed()
Definition: File.php:166
‪TYPO3\CMS\Filelist\FileList\linkWrapSort
‪string linkWrapSort($folderIdentifier, $col)
Definition: FileList.php:869
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Core\Resource\FolderInterface\ROLE_DEFAULT
‪const ROLE_DEFAULT
Definition: FolderInterface.php:26
‪TYPO3\CMS\Filelist\FileList\$iLimit
‪int $iLimit
Definition: FileList.php:52
‪TYPO3\CMS\Filelist\FileList\getAvailableSystemLanguages
‪getAvailableSystemLanguages()
Definition: FileList.php:668
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
Definition: MathUtility.php:32
‪TYPO3\CMS\Filelist\FileList\$resourceFactory
‪ResourceFactory $resourceFactory
Definition: FileList.php:145
‪TYPO3\CMS\Core\Resource\Folder\getFileCount
‪int getFileCount(array $filterMethods=[], $recursive=false)
Definition: Folder.php:261
‪TYPO3\CMS\Filelist\FileList\$counter
‪int $counter
Definition: FileList.php:108
‪TYPO3\CMS\Core\Resource\Folder\FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS
‪const FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS
Definition: Folder.php:69
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:33
‪TYPO3\CMS\Filelist\FileList\formatDirList
‪string formatDirList(array $folders)
Definition: FileList.php:523
‪TYPO3\CMS\Filelist\FileList\$clipObj
‪Clipboard $clipObj
Definition: FileList.php:141
‪TYPO3\CMS\Filelist\FileList\$thumbs
‪bool $thumbs
Definition: FileList.php:58
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:194
‪TYPO3\CMS\Core\Resource\Utility\ListUtility
Definition: ListUtility.php:25
‪$fields
‪$fields
Definition: pages.php:5
‪TYPO3\CMS\Filelist\FileList\$sortRev
‪bool $sortRev
Definition: FileList.php:82
‪TYPO3\CMS\Filelist
‪TYPO3\CMS\Filelist\FileList\getLanguageService
‪LanguageService getLanguageService()
Definition: FileList.php:1165
‪TYPO3\CMS\Filelist\FileList\makeClip
‪string makeClip($fileOrFolderObject)
Definition: FileList.php:892
‪TYPO3\CMS\Filelist\FileList\$CBnames
‪array $CBnames
Definition: FileList.php:137
‪TYPO3\CMS\Filelist\FileList\$totalbytes
‪int $totalbytes
Definition: FileList.php:90
‪TYPO3\CMS\Filelist\FileList\$folderObject
‪Folder $folderObject
Definition: FileList.php:133
‪TYPO3\CMS\Filelist\FileList\$eCounter
‪int $eCounter
Definition: FileList.php:114
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation\DELETE
‪const DELETE
Definition: JsConfirmation.php:39
‪TYPO3\CMS\Backend\Utility\BackendUtility\wrapClickMenuOnIcon
‪static string wrapClickMenuOnIcon( $content, $table, $uid=0, $context='', $_addParams='', $_enDisItems='', $returnTagParameters=false)
Definition: BackendUtility.php:2510
‪TYPO3\CMS\Core\Resource\Folder\getStorage
‪ResourceStorage getStorage()
Definition: Folder.php:149
‪TYPO3\CMS\Core\Resource\InaccessibleFolder
Definition: InaccessibleFolder.php:29
‪TYPO3\CMS\Core\Resource\Folder\getModificationTime
‪int getModificationTime()
Definition: Folder.php:546
‪TYPO3\CMS\Core\Resource\AbstractFile
Definition: AbstractFile.php:26
‪TYPO3\CMS\Filelist\FileList
Definition: FileList.php:47
‪TYPO3\CMS\Filelist\FileList\generateReferenceToolTip
‪string generateReferenceToolTip($references, $fileObject)
Definition: FileList.php:1188
‪TYPO3\CMS\Filelist\FileList\addElement
‪string addElement($icon, $data, $colType='td')
Definition: FileList.php:389
‪TYPO3\CMS\Filelist\FileList\__construct
‪__construct()
Definition: FileList.php:163
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:38
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:37
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Filelist\FileList\$fixedL
‪int $fixedL
Definition: FileList.php:70
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:24
‪TYPO3\CMS\Core\Resource\ResourceStorage\isWithinFolder
‪bool isWithinFolder(Folder $folder, ResourceInterface $resource)
Definition: ResourceStorage.php:2596
‪TYPO3\CMS\Filelist\FileList\isImage
‪bool isImage($ext)
Definition: FileList.php:845
‪TYPO3\CMS\Core\Resource\MetaDataAspect\get
‪array get()
Definition: MetaDataAspect.php:76
‪TYPO3\CMS\Core\Resource\Folder\checkActionPermission
‪bool checkActionPermission($action)
Definition: Folder.php:423
‪TYPO3\CMS\Filelist\FileList\linkWrapFile
‪string linkWrapFile($code, File $fileObject)
Definition: FileList.php:628
‪TYPO3\CMS\Filelist\FileList\getTable
‪string getTable()
Definition: FileList.php:242
‪TYPO3\CMS\Filelist\FileList\linkClipboardHeaderIcon
‪string linkClipboardHeaderIcon($string, $cmd, $warning='')
Definition: FileList.php:221
‪TYPO3\CMS\Filelist\FileList\isMediaFile
‪bool isMediaFile($ext)
Definition: FileList.php:857
‪TYPO3\CMS\Filelist\FileList\$fieldArray
‪array $fieldArray
Definition: FileList.php:102
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Resource\FolderInterface\ROLE_PROCESSING
‪const ROLE_PROCESSING
Definition: FolderInterface.php:28
‪TYPO3\CMS\Filelist\FileList\getBackendUser
‪BackendUserAuthentication getBackendUser()
Definition: FileList.php:1175
‪TYPO3\CMS\Core\Resource\Folder\getRole
‪string getRole()
Definition: Folder.php:522
‪TYPO3\CMS\Filelist\FileList\$uriBuilder
‪UriBuilder $uriBuilder
Definition: FileList.php:161
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Filelist\FileList\$firstElementNumber
‪int $firstElementNumber
Definition: FileList.php:86
‪TYPO3\CMS\Filelist\FileList\fwd_rwd_nav
‪string fwd_rwd_nav()
Definition: FileList.php:451
‪TYPO3\CMS\Filelist\FileList\fwd_rwd_HTML
‪string fwd_rwd_HTML($type, $pointer)
Definition: FileList.php:480
‪TYPO3\CMS\Core\Resource\File\checkActionPermission
‪bool checkActionPermission($action)
Definition: File.php:235
‪TYPO3\CMS\Core\Resource\ProcessedFile
Definition: ProcessedFile.php:44
‪TYPO3\CMS\Filelist\FileList\getFolderInfo
‪string getFolderInfo()
Definition: FileList.php:507
‪TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider
Definition: TranslationConfigurationProvider.php:35
‪TYPO3\CMS\Filelist\FileList\$thumbnailConfiguration
‪ThumbnailConfiguration $thumbnailConfiguration
Definition: FileList.php:157
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Filelist\FileList\getTranslationsForMetaData
‪array getTranslationsForMetaData($metaDataRecord)
Definition: FileList.php:812
‪TYPO3\CMS\Filelist\FileList\renderClipboardHeaderRow
‪renderClipboardHeaderRow(bool $hasContent)
Definition: FileList.php:333
‪TYPO3\CMS\Core\Resource\FolderInterface
Definition: FolderInterface.php:22
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:22
‪TYPO3\CMS\Core\Resource\Folder\getCombinedIdentifier
‪string getCombinedIdentifier()
Definition: Folder.php:181
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Backend\Utility\BackendUtility\date
‪static string date($tstamp)
Definition: BackendUtility.php:978
‪TYPO3\CMS\Filelist\FileList\$sort
‪string $sort
Definition: FileList.php:76
‪TYPO3\CMS\Core\Resource\Utility\ListUtility\resolveSpecialFolderNames
‪static array resolveSpecialFolderNames(array $folders)
Definition: ListUtility.php:32
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation
Definition: JsConfirmation.php:25
‪TYPO3\CMS\Filelist\FileList\$totalItems
‪int $totalItems
Definition: FileList.php:96
‪TYPO3\CMS\Filelist\FileList\linkWrapDir
‪string linkWrapDir($title, Folder $folderObject)
Definition: FileList.php:607
‪TYPO3\CMS\Filelist\FileListEditIconHookInterface
Definition: FileListEditIconHookInterface.php:22
‪TYPO3\CMS\Backend\Utility\BackendUtility\referenceCount
‪static string int referenceCount($table, $ref, $msg='', $count=null)
Definition: BackendUtility.php:3311
‪TYPO3\CMS\Filelist\FileList\$id
‪int $id
Definition: FileList.php:153
‪TYPO3\CMS\Filelist\FileList\makeEdit
‪string makeEdit($fileOrFolderObject)
Definition: FileList.php:979
‪TYPO3\CMS\Filelist\FileList\start
‪start(Folder $folderObject, $pointer, $sort, $sortRev, $clipBoard=false, $bigControlPanel=false)
Definition: FileList.php:194
‪TYPO3\CMS\Filelist\FileList\$iconFactory
‪IconFactory $iconFactory
Definition: FileList.php:149