62 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
71 trigger_error(
'FileFacade->getIcon() will be removed in TYPO3 v10.0, use ViewHelper <core:iconForResource /> instead.', E_USER_DEPRECATED);
72 $title = htmlspecialchars($this->resource->getName() .
' [' . (
int)$this->resource->getProperty(
'uid') .
']');
73 return '<span title="' . $title .
'">' . $this->iconFactory->getIconForResource($this->resource,
Icon::SIZE_SMALL) .
'</span>';
90 && GeneralUtility::inList(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'textfile_ext'], $this->resource->getExtension());
107 $method =
'_getMetadata';
108 if (is_callable([$this->resource, $method])) {
109 $metadata = call_user_func([$this->resource, $method]);
111 if (isset($metadata[
'uid'])) {
112 $uid = (int)$metadata[
'uid'];
124 return $this->resource->getName();
132 $method =
'getReadablePath';
133 if (is_callable([$this->resource->getParentFolder(), $method])) {
134 return call_user_func([$this->resource->getParentFolder(), $method]);
145 return $this->resource->getPublicUrl(
true);
153 return strtoupper($this->resource->getExtension());
161 return $this->resource->getStorage()->getUid() .
':' . $this->resource->getIdentifier();
177 return GeneralUtility::formatSize($this->resource->getSize(), htmlspecialchars($this->
getLanguageService()->getLL(
'byteSizeUnits')));
185 $method =
'checkActionPermission';
186 if (is_callable([$this->resource, $method])) {
187 return call_user_func_array([$this->resource, $method], [
'read']);
198 $method =
'checkActionPermission';
199 if (is_callable([$this->resource, $method])) {
200 return call_user_func_array([$this->resource, $method], [
'write']);
211 $method =
'checkActionPermission';
212 if (is_callable([$this->resource, $method])) {
213 return call_user_func_array([$this->resource, $method], [
'replace']);
224 $method =
'checkActionPermission';
225 if (is_callable([$this->resource, $method])) {
226 return call_user_func_array([$this->resource, $method], [
'rename']);
237 $method =
'checkActionPermission';
238 if (is_callable([$this->resource, $method])) {
239 return call_user_func_array([$this->resource, $method], [
'copy']);
250 $method =
'checkActionPermission';
251 if (is_callable([$this->resource, $method])) {
252 return call_user_func_array([$this->resource, $method], [
'move']);
263 $method =
'checkActionPermission';
264 if (is_callable([$this->resource, $method])) {
265 return call_user_func_array([$this->resource, $method], [
'delete']);
277 $md5 = GeneralUtility::shortMD5($fullIdentifier);
280 $clipboard = GeneralUtility::makeInstance(Clipboard::class);
281 $clipboard->initializeClipboard();
283 $isSel = $clipboard->isSelected(
'_FILE', $md5);
297 return GeneralUtility::inList(
$GLOBALS[
'TYPO3_CONF_VARS'][
'GFX'][
'imagefile_ext'], strtolower($this->
getExtension()));
307 $uid = (int)$this->resource->getProperty(
'uid');
313 if (!isset(static::$referenceCounts[$uid])) {
314 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'sys_refindex');
315 $count = $queryBuilder->count(
'*')
316 ->from(
'sys_refindex')
318 $queryBuilder->expr()->eq(
'deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
319 $queryBuilder->expr()->eq(
321 $queryBuilder->createNamedParameter(
'sys_file', \PDO::PARAM_STR)
323 $queryBuilder->expr()->eq(
325 $queryBuilder->createNamedParameter($this->resource->getProperty(
'uid'), \PDO::PARAM_INT)
327 $queryBuilder->expr()->neq(
329 $queryBuilder->createNamedParameter(
'sys_file_metadata', \PDO::PARAM_STR)
335 static::$referenceCounts[$uid] = $count;
338 return static::$referenceCounts[$uid];
347 public function __call($method, $arguments)
349 if (is_callable([$this->resource, $method])) {
350 return call_user_func_array([$this->resource, $method], $arguments);