‪TYPO3CMS  9.5
FileNameFilter.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 
18 
23 {
29  protected static ‪$showHiddenFilesAndFolders = false;
30 
44  public static function ‪filterHiddenFilesAndFolders($itemName, $itemIdentifier, $parentIdentifier, array $additionalInformation, ‪DriverInterface $driverInstance)
45  {
46  // Only apply the filter if you want to hide the hidden files
47  if (self::$showHiddenFilesAndFolders === false && strpos($itemIdentifier, '/.') !== false) {
48  return -1;
49  }
50  return true;
51  }
52 
59  public static function ‪getShowHiddenFilesAndFolders()
60  {
62  }
63 
72  {
73  return self::$showHiddenFilesAndFolders = (bool)‪$showHiddenFilesAndFolders;
74  }
75 }
‪TYPO3\CMS\Core\Resource\Driver\DriverInterface
Definition: DriverInterface.php:22
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\getShowHiddenFilesAndFolders
‪static bool getShowHiddenFilesAndFolders()
Definition: FileNameFilter.php:58
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\filterHiddenFilesAndFolders
‪static bool int filterHiddenFilesAndFolders($itemName, $itemIdentifier, $parentIdentifier, array $additionalInformation, DriverInterface $driverInstance)
Definition: FileNameFilter.php:43
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\setShowHiddenFilesAndFolders
‪static bool setShowHiddenFilesAndFolders($showHiddenFilesAndFolders)
Definition: FileNameFilter.php:70
‪TYPO3\CMS\Core\Resource\Filter
Definition: FileExtensionFilter.php:2
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\$showHiddenFilesAndFolders
‪static bool $showHiddenFilesAndFolders
Definition: FileNameFilter.php:28
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter
Definition: FileNameFilter.php:23