TYPO3 CMS  TYPO3_6-2
FileLinktype.php
Go to the documentation of this file.
1 <?php
3 
19 
27 
36  public function fetchType($value, $type, $key) {
37  if (GeneralUtility::isFirstPartOfStr(strtolower($value['tokenValue']), 'file:')) {
38  $type = 'file';
39  }
40  return $type;
41  }
42 
51  public function checkLink($url, $softRefEntry, $reference) {
52  $resourceFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
53  try {
54  $file = $resourceFactory->retrieveFileOrFolderObject($url);
55  } catch (FileDoesNotExistException $e) {
56  return FALSE;
57  }
58  return !$file->isMissing();
59  }
60 
67  public function getErrorMessage($errorParams) {
68  $response = $GLOBALS['LANG']->getLL('list.report.filenotexisting');
69  return $response;
70  }
71 
78  public function getBrokenUrl($row) {
79  $brokenUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $row['url'];
80  return $brokenUrl;
81  }
82 }
checkLink($url, $softRefEntry, $reference)
static isFirstPartOfStr($str, $partStr)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]