Search for ext_icon.png and ext_icon.gif and store to
$GLOBALS['TYPO3_LOADED_EXT'][$_EXTKEY]['ext_icon']
Change-Id: I4867ba9c46b3c9d1674d91313599b2aada5e9295
Resolves: #37595
Releases: 6.0
Reviewed-on: http://review.typo3.org/13888
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
public static function addPlugin($itemArray, $type = 'list_type') {
$_EXTKEY = $GLOBALS['_EXTKEY'];
if ($_EXTKEY && !$itemArray[2]) {
public static function addPlugin($itemArray, $type = 'list_type') {
$_EXTKEY = $GLOBALS['_EXTKEY'];
if ($_EXTKEY && !$itemArray[2]) {
- $itemArray[2] = self::extRelPath($_EXTKEY) . 'ext_icon.gif';
+ $itemArray[2] = self::extRelPath($_EXTKEY) .
+ $GLOBALS['TYPO3_LOADED_EXT'][$_EXTKEY]['ext_icon'];
}
t3lib_div::loadTCA('tt_content');
}
t3lib_div::loadTCA('tt_content');
+ // Register found extension icon
+ $loadedExtensionInformation[$extensionKey]['ext_icon'] = self::getExtensionIcon(PATH_site . $loadedExtensionInformation[$extensionKey]['siteRelPath']);
}
return $loadedExtensionInformation;
}
}
return $loadedExtensionInformation;
}
+ /**
+ * Find extension icon
+ *
+ * @param string $extensionPath Path to extension directory.
+ * @param string $returnFullPath Return full path of file.
+ * @return string
+ * @throws BadFunctionCallException
+ */
+ public static function getExtensionIcon($extensionPath, $returnFullPath = FALSE){
+ $icon = '';
+ $iconFileTypesToCheckFor = array(
+ 'png',
+ 'gif',
+ );
+
+ foreach ($iconFileTypesToCheckFor as $fileType){
+ if (@is_file($extensionPath . 'ext_icon.' . $fileType)) {
+ $icon = 'ext_icon.' . $fileType;
+ break;
+ }
+ }
+
+ return $returnFullPath ? $extensionPath . $icon : $icon;
+ }
+
/**
* Cache identifier of cached Typo3LoadedExtensionInformation array
*
/**
* Cache identifier of cached Typo3LoadedExtensionInformation array
*
include(t3lib_extMgm::extPath($_EXTKEY) . 'ext_emconf.php');
$thisTitle = $EM_CONF[$_EXTKEY]['title'];
}
include(t3lib_extMgm::extPath($_EXTKEY) . 'ext_emconf.php');
$thisTitle = $EM_CONF[$_EXTKEY]['title'];
}
- $iconFile[$_EXTKEY] = '<img src="' . t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif" />';
+ $iconFile[$_EXTKEY] = '<img alt="" src="' . t3lib_extMgm::extRelPath($_EXTKEY) .
+ $GLOBALS['TYPO3_LOADED_EXT'][$_EXTKEY]['ext_icon'] . '" height="16" />';
} else {
$thisTitle = $nameParts[1];
$iconFile[$_EXTKEY] = '';
} else {
$thisTitle = $nameParts[1];
$iconFile[$_EXTKEY] = '';
$extensions[$extKey] = array(
'siteRelPath' => str_replace(PATH_site, '', $path . $extKey),
'type' => $installationType,
$extensions[$extKey] = array(
'siteRelPath' => str_replace(PATH_site, '', $path . $extKey),
'type' => $installationType,
+ 'key' => $extKey,
+ 'ext_icon' => t3lib_extMgm::getExtensionIcon( $path . $extKey . '/'),
- * Reduce the available extensions list to only installed extensions
+ * Reduce the available extensions list to only loaded extensions
*
* @param array $availableExtensions
* @return array
*
* @param array $availableExtensions
* @return array
- <em:image src="../{extension.siteRelPath}/ext_icon.gif" alt="{extension.title}" />{extension.title}
+ <em:image src="../{extension.siteRelPath}/{extension.ext_icon}" alt="{extension.title}" height="16" />{extension.title}
</td>
<td>
{extensionKey}
</td>
<td>
{extensionKey}