[BUGFIX] Supply setter for bodytag in ModuleTemplate 54/44554/2
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Thu, 5 Nov 2015 13:41:54 +0000 (14:41 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 5 Nov 2015 13:48:54 +0000 (14:48 +0100)
It is convenient to be able to set a custom body tag in a module.
While we're at it... let's add one at all

Resolves: #71349
Releases: master
Change-Id: I37b800709ee049f460352b93fafe1185b40252b7
Reviewed-on: https://review.typo3.org/44554
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Template/ModuleTemplate.php

index 396e0b5..17360c6 100644 (file)
@@ -165,6 +165,13 @@ class ModuleTemplate
     protected $title = '';
 
     /**
+     * Body Tag
+     *
+     * @var string
+     */
+    protected $bodyTag = '<body>';
+
+    /**
      * Flash message queue
      *
      * @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue
@@ -172,6 +179,26 @@ class ModuleTemplate
     protected $flashMessageQueue;
 
     /**
+     * Returns the current body tag
+     *
+     * @return string
+     */
+    public function getBodyTag()
+    {
+        return $this->bodyTag;
+    }
+
+    /**
+     * Sets the body tag
+     *
+     * @param string $bodyTag
+     */
+    public function setBodyTag($bodyTag)
+    {
+        $this->bodyTag = $bodyTag;
+    }
+
+    /**
      * Gets the standalone view.
      *
      * @return StandaloneView
@@ -330,6 +357,7 @@ class ModuleTemplate
         }
 
         $renderedPage = $this->pageRenderer->render(PageRenderer::PART_HEADER);
+        $renderedPage.= $this->bodyTag;
         $renderedPage .= $this->view->render();
         $this->pageRenderer->addJsFooterInlineCode('updateSignals', BackendUtility::getUpdateSignalCode());
         $renderedPage .= $this->pageRenderer->render(PageRenderer::PART_FOOTER);