TYPO3 CMS  TYPO3_7-6
FolderLinkHandler.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
22 
27 {
31  protected $mode = 'folder';
32 
36  protected $additionalFolderClass = 'bg-success';
37 
41  protected $expectedClass = Folder::class;
42 
46  protected function getTitle()
47  {
48  return $this->getLanguageService()->getLL('folders');
49  }
50 
56  protected function getFolderContent(Folder $folder, $extensionList)
57  {
58  return $folder->getSubfolders();
59  }
60 
69  protected function renderItem(ResourceInterface $fileOrFolderObject)
70  {
71  if (!$fileOrFolderObject instanceof Folder) {
72  throw new \InvalidArgumentException('Expected Folder object, got "' . get_class($fileOrFolderObject) . '" object.', 1443651369);
73  }
74  $fileIdentifier = $fileOrFolderObject->getCombinedIdentifier();
75  $overlay = null;
76  if ($fileOrFolderObject instanceof InaccessibleFolder) {
77  $overlay = ['status-overlay-locked' => []];
78  }
79  $icon = '<span title="' . htmlspecialchars($fileOrFolderObject->getName()) . '">'
80  . $this->iconFactory->getIcon('apps-filetree-folder-default', Icon::SIZE_SMALL, $overlay)->render()
81  . '</span>';
82  return [$fileIdentifier, $icon];
83  }
84 }
getSubfolders($start=0, $numberOfItems=0, $filterMode=self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive=false)
Definition: Folder.php:273