[BUGFIX] Broken icons in extension manager 79/34779/5
authorFrank Nägler <typo3@naegler.net>
Sat, 29 Nov 2014 19:10:13 +0000 (20:10 +0100)
committerBenjamin Mack <benni@typo3.org>
Sat, 29 Nov 2014 23:03:19 +0000 (00:03 +0100)
fix broken icons in extension manager from
EXT:documentation.
Documentation: added icons to button group.

Resolves: #63430
Releases: master
Change-Id: I753685acb93ca29662c2e437b2332b18637698ca
Reviewed-on: http://review.typo3.org/34779
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
typo3/sysext/documentation/Classes/Slots/ExtensionManager.php
typo3/sysext/documentation/Classes/ViewHelpers/FormatsViewHelper.php
typo3/sysext/documentation/Resources/Private/Templates/Document/List.html
typo3/sysext/extensionmanager/Resources/Public/Css/main.css

index 5794480..4828074 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Documentation\Slots;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Backend\Utility\IconUtility;
 
 /**
  * This slot listens to a signal in Extension Manager to add links to
@@ -58,6 +59,10 @@ class ExtensionManager {
                        foreach ($document->getTranslations() as $documentTranslation) {
                                $actions[] = $formatsViewHelper->render($documentTranslation);
                        }
+               } else {
+                       $actions[] = '<span class="btn disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
+                       $actions[] = '<span class="btn disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
+                       $actions[] = '<span class="btn disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
                }
        }
 
index e187455..227d9af 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Documentation\ViewHelpers;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Backend\Utility\IconUtility;
 
 /**
  * ViewHelper to display all download links for a document
@@ -30,8 +31,15 @@ class FormatsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHel
         * @return string
         */
        public function render(\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $documentTranslation) {
-               $output = '';
-               foreach ($documentTranslation->getFormats() as $format) {
+               $icons = array(
+                       'html' => '<a class="btn disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>',
+                       'pdf' => '<a class="btn disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>',
+                       'sxw' => '<a class="btn disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</a>'
+               );
+               $formats = $documentTranslation->getFormats();
+
+               foreach ($formats as $format) {
+                       $output = '';
                        /** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format */
                        $output .= '<a ';
 
@@ -39,7 +47,7 @@ class FormatsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHel
                        $extension = substr($uri, strrpos($uri, '.') + 1);
                        if (strlen($extension) < 5) {
                                // This is direct link to a file
-                               $output .= 'href="' . $uri . '"';
+                               $output .= 'href="' . $uri . '" class="btn"';
                        } else {
                                $extension = $format->getFormat();
                                if ($extension === 'json') {
@@ -56,8 +64,8 @@ class FormatsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHel
                        $output .= ' title="' . htmlspecialchars($title) . '">';
                        $spriteIconHtml = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForFile($extension);
                        $output .= $spriteIconHtml . '</a>' . LF;
+                       $icons[$format->getFormat()] = $output;
                }
-               return $output;
+               return implode('', array_values($icons));
        }
-
 }
index 1d7e234..8d624b1 100644 (file)
                                                </td>
                                                <td>{translation.description}</td>
                                                <td class="actions icons">
+                                                       <div class="btn-group">
                                                        <doc:formats documentTranslation="{translation}" />
+                                                       </div>
                                                </td>
                                        </tr>
                                </f:for>
                        </f:for>
                </tbody>
        </table>
-</f:section>
\ No newline at end of file
+</f:section>
index 42f87a2..2e212aa 100644 (file)
   color: #000; }
 
 .typo3-extension-list td.icons {
-  width: 140px; }
+  width: 205px; }
 
 #typo3-extension-configuration-forms .info {
   color: #666;