Revert "[FEATURE] Improve usability for BE database thumbnails/file icons" 09/24809/2
authorOliver Hader <oliver.hader@typo3.org>
Tue, 15 Oct 2013 15:17:19 +0000 (17:17 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 15 Oct 2013 15:19:09 +0000 (17:19 +0200)
This reverts commit bedddf2e0fb50b0ebe3751f8563ee8021c945303

Reason for reverting the mentioned commit:
Fatal error: Call to undefined method
TYPO3\CMS\Core\Resource\File::getAlternative()

Related: #47709
Releases: 6.2

Change-Id: Ie0ed98b2315bedf4475d25e92a3842972e85b7bf
Reviewed-on: https://review.typo3.org/24809
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 6e557d5..c5f2535 100644 (file)
@@ -1540,11 +1540,6 @@ class BackendUtility {
                        foreach ($referenceUids as $referenceUid) {
                                $fileReferenceObject = ResourceFactory::getInstance()->getFileReferenceObject($referenceUid['uid']);
                                $fileObject = $fileReferenceObject->getOriginalFile();
-                               $fileAlternative = $fileReferenceObject->getAlternative();
-                               $fileTitle = $fileReferenceObject->getTitle();
-                               if ($fileTitle === '') {
-                                       $fileTitle = $fileReferenceObject->getName();
-                               }
 
                                if ($fileObject->isMissing()) {
                                        $flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
@@ -1558,16 +1553,10 @@ class BackendUtility {
                                                'width' => $sizeParts[0],
                                                'height' => $sizeParts[1]
                                        ))->getPublicUrl(TRUE);
-                                       $imgTag = '<img src="' . $imageUrl . '" alt="' . htmlspecialchars($fileAlternative) . '" title="' . htmlspecialchars($fileTitle) . '" />';
+                                       $imgTag = '<img src="' . $imageUrl . '" alt="' . htmlspecialchars($fileReferenceObject->getName()) . '" />';
                                } else {
                                        // Icon
-                                       $imgTag = IconUtility::getSpriteIconForFile(
-                                               strtolower($fileObject->getExtension()),
-                                               array(
-                                                       'title' => $fileTitle,
-                                                       'alt'=> $fileAlternative
-                                               )
-                                       );
+                                       $imgTag = IconUtility::getSpriteIconForFile(strtolower($fileObject->getExtension()), array('title' => $fileObject->getName()));
                                }
                                if ($linkInfoPopup) {
                                        $onClick = 'top.launchView(\'_FILE\',\'' . $fileObject->getUid() . '\',\'' . $backPath . '\'); return false;';
@@ -1590,11 +1579,6 @@ class BackendUtility {
                                        $fileName = trim($uploaddir . '/' . $theFile, '/');
                                        $fileObject = ResourceFactory::getInstance()->retrieveFileOrFolderObject($fileName);
                                        $fileExtension = $fileObject->getExtension();
-                                       $fileAlternative = $fileObject->getAlternative();
-                                       $fileTitle = $fileObject->getTitle();
-                                       if ($fileTitle === '') {
-                                               $fileTitle = $fileObject->getName();
-                                       }
 
                                        if ($fileObject->isMissing()) {
                                                $flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
@@ -1607,7 +1591,7 @@ class BackendUtility {
                                                        'width' => $sizeParts[0],
                                                        'height' => $sizeParts[1]
                                                ))->getPublicUrl(TRUE);
-                                               $image = '<img src="' . htmlspecialchars($imageUrl) . '" hspace="2" border="0" title="' . htmlspecialchars($fileTitle) . '"' . $tparams . ' alt="' . htmlspecialchars($fileAlternative) . '" />';
+                                               $image = '<img src="' . htmlspecialchars($imageUrl) . '" hspace="2" border="0" title="' . htmlspecialchars($fileObject->getName()) . '"' . $tparams . ' alt="" />';
                                                if ($linkInfoPopup) {
                                                        $onClick = 'top.launchView(\'_FILE\', \'' . $fileName . '\',\'\',\'' . $backPath . '\');return false;';
                                                        $thumbData .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $image . '</a> ';
@@ -1616,13 +1600,7 @@ class BackendUtility {
                                                }
                                        } else {
                                                // Gets the icon
-                                               $fileIcon = IconUtility::getSpriteIconForFile(
-                                                       $fileExtension,
-                                                       array(
-                                                               'title' => $fileTitle,
-                                                               'alt' => $fileAlternative
-                                                       )
-                                               );
+                                               $fileIcon = IconUtility::getSpriteIconForFile($fileExtension, array('title' => $fileObject->getName()));
                                                if ($linkInfoPopup) {
                                                        $onClick = 'top.launchView(\'_FILE\', \'' . $fileName . '\',\'\',\'' . $backPath . '\'); return false;';
                                                        $thumbData .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $fileIcon . '</a> ';