[BUGFIX] EXT:documentation does not support ext_icon.png 33/24533/4
authorXavier Perseguers <xavier@typo3.org>
Thu, 10 Oct 2013 16:01:13 +0000 (18:01 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 10 Oct 2013 17:44:07 +0000 (19:44 +0200)
Since TYPO3 6.0, extensions may provide an icon as png instead of gif.

Fixes: #52667
Releases: 6.2
Change-Id: I93eb8790f9f5977b0ac23394f753711450a5ec98
Reviewed-on: https://review.typo3.org/24533
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/documentation/Classes/Utility/GeneralUtility.php

index b58a7ca..c6dd2b4 100644 (file)
@@ -24,6 +24,8 @@ namespace TYPO3\CMS\Documentation\Utility;
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+
 /**
  * General utility.
  *
@@ -40,7 +42,7 @@ class GeneralUtility {
        static public function getExtensionMetaData($extensionKey) {
                $_EXTKEY = $extensionKey;
                $EM_CONF = array();
-               $extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey);
+               $extPath = ExtensionManagementUtility::extPath($extensionKey);
                include($extPath . 'ext_emconf.php');
 
                $release = $EM_CONF[$_EXTKEY]['version'];
@@ -67,13 +69,15 @@ class GeneralUtility {
                $documentPath = $basePath . $documentKey . '/';
 
                // Fallback icon
-               $icon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('documentation') . 'ext_icon.gif';
+               $icon = ExtensionManagementUtility::siteRelPath('documentation') . 'ext_icon.gif';
 
                if (\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($documentKey, 'typo3cms.extensions.')) {
                        // Standard extension icon
                        $extensionKey = substr($documentKey, 20);
-                       if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extensionKey)) {
-                               $icon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($extensionKey) . 'ext_icon.gif';
+                       if (ExtensionManagementUtility::isLoaded($extensionKey)) {
+                               $extensionPath = ExtensionManagementUtility::extPath($extensionKey);
+                               $siteRelativePath = ExtensionManagementUtility::siteRelPath($extensionKey);
+                               $icon = $siteRelativePath . ExtensionManagementUtility::getExtensionIcon($extensionPath);
                        }
                } elseif (is_file(PATH_site . $documentPath . 'icon.png')) {
                        $icon = $documentPath . 'icon.png';
@@ -84,4 +88,4 @@ class GeneralUtility {
                return $icon;
        }
 
-}
+}
\ No newline at end of file