[BUGFIX] Allow EXT:syntax for icons in new CE wizard 96/40496/3
authorBenjamin Mack <benni@typo3.org>
Sat, 20 Jun 2015 18:02:32 +0000 (20:02 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 21 Jun 2015 21:12:37 +0000 (23:12 +0200)
Allow EXT:myicon.png instead of just relative paths
for the new Content Element wizard to be more
flexible.

Resolves: #46433
Releases: master
Change-Id: I8a56650e9ebee29f1c846b59fdfef2c40dcbd496
Reviewed-on: http://review.typo3.org/40496
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php

index 769be7b..226e530 100644 (file)
@@ -239,12 +239,17 @@ class NewContentElementController {
                                                $aOnClick = "document.editForm.defValues.value=unescape('" . rawurlencode($wInfo['params']) . "');goToalt_doc();" . (!$this->onClickEvent?"window.location.hash='#sel2';":'');
                                        }
 
+                                       $icon = $wInfo['icon'];
+                                       if (strpos($wInfo['icon'], '..') === FALSE) {
+                                               $icon = GeneralUtility::getFileAbsFileName($icon, TRUE, TRUE);
+                                               $icon = substr($icon, strlen(PATH_typo3));
+                                       }
                                        $menuItems[$key]['content'] .= '
                                                <div class="media">
                                                        ' . $content . '
                                                        <div class="media-left">
                                                                <a href="#" onclick="' . htmlspecialchars($aOnClick) . '">
-                                                                       <img' . IconUtility::skinImg($this->doc->backPath, $wInfo['icon'], '') . ' alt="" />
+                                                                       <img' . IconUtility::skinImg($this->doc->backPath, $icon) . ' alt="" />
                                                                </a>
                                                        </div>
                                                        <div class="media-body">