‪TYPO3CMS  11.5
FileLinktype.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 
17 
22 
27 {
36  public function ‪fetchType($value, $type, $key)
37  {
38  if (strpos(strtolower($value['tokenValue'] ?? ''), 'file:') === 0) {
39  $type = 'file';
40  }
41  return $type;
42  }
43 
52  public function ‪checkLink($url, $softRefEntry, $reference)
53  {
54  $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
55  try {
56  $file = $resourceFactory->retrieveFileOrFolderObject($url);
58  return false;
59  }
60 
61  return ($file !== null) ? !$file->isMissing() : false;
62  }
63 
72  {
73  return $this->‪getLanguageService()->‪getLL('list.report.filenotexisting');
74  }
75 
82  public function ‪getBrokenUrl($row)
83  {
84  return ‪$GLOBALS['TYPO3_REQUEST']->getAttribute('normalizedParams')->getSiteUrl() . $row['url'];
85  }
86 }
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\$errorParams
‪array $errorParams
Definition: AbstractLinktype.php:29
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractLinktype.php:93
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\getErrorMessage
‪string getErrorMessage($errorParams)
Definition: FileLinktype.php:71
‪TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException
Definition: FileDoesNotExistException.php:21
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype
Definition: AbstractLinktype.php:24
‪TYPO3\CMS\Linkvalidator\Linktype
Definition: AbstractLinktype.php:16
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype
Definition: FileLinktype.php:27
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException
Definition: FolderDoesNotExistException.php:21
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\fetchType
‪string fetchType($value, $type, $key)
Definition: FileLinktype.php:36
‪TYPO3\CMS\Core\Localization\LanguageService\getLL
‪string getLL($index)
Definition: LanguageService.php:121
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\getBrokenUrl
‪string getBrokenUrl($row)
Definition: FileLinktype.php:82
‪TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\checkLink
‪bool checkLink($url, $softRefEntry, $reference)
Definition: FileLinktype.php:52