Skip to content
Snippets Groups Projects
Commit 2fda51d6 authored by Xavier Perseguers's avatar Xavier Perseguers Committed by Christian Kuhn
Browse files

[BUGFIX] EXT:documentation does not support ext_icon.png

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
parent e1db658c
Branches
Tags
No related merge requests found
......@@ -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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment