[BUGFIX] Fix wrong image reference in ext:taskcenter 10/38910/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 24 Apr 2015 18:56:42 +0000 (20:56 +0200)
committerXavier Perseguers <xavier@typo3.org>
Sun, 26 Apr 2015 07:16:40 +0000 (09:16 +0200)
Path to image does not exists, rename it to the existing png file.

Furthermore this patch shortens a few namespaces and uses
GeneralUtility::quoteJSvalue for the url in openInNewWindow function.

Resolves: #66584
Releases: master
Change-Id: I9b17aafae6a4f94ddefa5d012c447b8eacc0495d
Reviewed-on: http://review.typo3.org/38910
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php

index c5d2f14..aa1521d 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Taskcenter\Controller;
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -50,10 +52,10 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                parent::init();
                // Initialize document
                $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
-               $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('taskcenter') . 'Resources/Private/Templates/mod_template.html');
+               $this->doc->setModuleTemplate(ExtensionManagementUtility::extPath('taskcenter') . 'Resources/Private/Templates/mod_template.html');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->getPageRenderer()->loadJquery();
-               $this->doc->addStyleSheet('tx_taskcenter', '../' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('taskcenter') . 'Resources/Public/Styles/styles.css');
+               $this->doc->addStyleSheet('tx_taskcenter', '../' . ExtensionManagementUtility::siteRelPath('taskcenter') . 'Resources/Public/Styles/styles.css');
        }
 
        /**
@@ -81,7 +83,7 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
 
                // Render content depending on the mode
                $mode = (string)$this->MOD_SETTINGS['mode'];
-               if ($mode == 'information') {
+               if ($mode === 'information') {
                        $this->renderInformationContent();
                } else {
                        $this->renderModuleContent();
@@ -126,16 +128,31 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                if ($this->checkAccess($extKey, $taskClass)) {
                                        $actionContent .= $taskInstance->getTask();
                                } else {
-                                       $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $this->getLanguageService()->getLL('error-access', TRUE), $this->getLanguageService()->getLL('error_header'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
+                                       $flashMessage = GeneralUtility::makeInstance(
+                                               FlashMessage::class,
+                                               $this->getLanguageService()->getLL('error-access', TRUE),
+                                               $this->getLanguageService()->getLL('error_header'),
+                                               FlashMessage::ERROR
+                                       );
                                        $actionContent .= $flashMessage->render();
                                }
                        } else {
                                // Error if the task is not an instance of \TYPO3\CMS\Taskcenter\TaskInterface
-                               $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, sprintf($this->getLanguageService()->getLL('error_no-instance', TRUE), $taskClass, \TYPO3\CMS\Taskcenter\TaskInterface::class), $this->getLanguageService()->getLL('error_header'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
+                               $flashMessage = GeneralUtility::makeInstance(
+                                       FlashMessage::class,
+                                       sprintf($this->getLanguageService()->getLL('error_no-instance', TRUE), $taskClass, \TYPO3\CMS\Taskcenter\TaskInterface::class),
+                                       $this->getLanguageService()->getLL('error_header'),
+                                       FlashMessage::ERROR
+                               );
                                $actionContent .= $flashMessage->render();
                        }
                } else {
-                       $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $this->getLanguageService()->sL('LLL:EXT:taskcenter/task/locallang_mod.xlf:mlang_labels_tabdescr'), $this->getLanguageService()->sL('LLL:EXT:taskcenter/task/locallang_mod.xlf:mlang_tabs_tab'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
+                       $flashMessage = GeneralUtility::makeInstance(
+                               FlashMessage::class,
+                               $this->getLanguageService()->sL('LLL:EXT:taskcenter/task/locallang_mod.xlf:mlang_labels_tabdescr'),
+                               $this->getLanguageService()->sL('LLL:EXT:taskcenter/task/locallang_mod.xlf:mlang_tabs_tab'),
+                               FlashMessage::INFO
+                       );
                        $actionContent .= $flashMessage->render();
                }
                $content = '<div id="taskcenter-main">
@@ -274,7 +291,7 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
        protected function indexAction() {
                $content = '';
                $tasks = array();
-               $icon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('taskcenter') . 'Resources/Public/Icons/module-taskcenter.gif';
+               $icon = ExtensionManagementUtility::extRelPath('taskcenter') . 'Resources/Public/Icons/module-taskcenter.png';
                // Render the tasks only if there are any available
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']) && count($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']) > 0) {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter'] as $extKey => $extensionReports) {
@@ -309,7 +326,12 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                        }
                        $content .= $this->renderListMenu($tasks, TRUE);
                } else {
-                       $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $this->getLanguageService()->getLL('no-tasks', TRUE), '', \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
+                       $flashMessage = GeneralUtility::makeInstance(
+                               FlashMessage::class,
+                               $this->getLanguageService()->getLL('no-tasks', TRUE),
+                               '',
+                               FlashMessage::INFO
+                       );
                        $this->content .= $flashMessage->render();
                }
                return $content;
@@ -392,7 +414,7 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
         */
        protected function openInNewWindow() {
                $url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
-               $onClick = 'devlogWin=window.open(\'' . $url . '\',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
+               $onClick = 'devlogWin=window.open(' . GeneralUtility::quoteJSvalue($url) . ',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
                $content = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' .
                        IconUtility::getSpriteIcon('actions-window-open', array('title' => $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', TRUE))) .
                '</a>';