[BUGFIX] Consolidate usage of DocumentTemplate
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 30 Sep 2012 11:23:42 +0000 (13:23 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 30 Sep 2012 11:25:29 +0000 (13:25 +0200)
Do not use the global SOBE to get an instance
of DocumentTemplate. Instead make use of the
getter which is in the AbstractBackendViewHelper

Resolves: #41329
Releases: 6.0

Change-Id: Ic84e460670903869189955ca771f42066db8dda4
Reviewed-on: http://review.typo3.org/15165
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php

index e8c7bf5..c3e013d 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
  * @package TYPO3
  * @subpackage belog
  */
-class ErrorIconViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
+class ErrorIconViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper {
 
        /**
         * Renders an error icon link as known from the TYPO3 backend.
@@ -42,7 +42,11 @@ class ErrorIconViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewH
         * @return string the rendered error icon link
         */
        public function render($errorNumber = 0) {
-               return $GLOBALS['SOBE']->doc->icons($errorNumber >= 2 ? \TYPO3\CMS\Backend\Template\DocumentTemplate::STATUS_ICON_ERROR : \TYPO3\CMS\Backend\Template\DocumentTemplate::STATUS_ICON_WARNING);
+               return $this->getDocInstance()->icons(
+                       $errorNumber >= 2
+                                       ? \TYPO3\CMS\Backend\Template\DocumentTemplate::STATUS_ICON_ERROR
+                                       : \TYPO3\CMS\Backend\Template\DocumentTemplate::STATUS_ICON_WARNING
+               );
        }
 
 }