[TASK] Use ModuleTemplate API for ext:belog 50/43350/4
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 15 Sep 2015 15:53:17 +0000 (17:53 +0200)
committerFrans Saris <franssaris@gmail.com>
Tue, 6 Oct 2015 08:22:04 +0000 (10:22 +0200)
Ext:belog will use the ModuleTemplate API for its Backend Module.

Change-Id: I22e172ad99abdccf8eb122153edbf4a4762d195f
Resolves: #69843
Relates: #69841
Relates: #69842
Releases: master
Reviewed-on: http://review.typo3.org/43350
Reviewed-by: Ruud Silvrants <ruudsilvrants@gmail.com>
Tested-by: Ruud Silvrants <ruudsilvrants@gmail.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/belog/Classes/Controller/AbstractController.php
typo3/sysext/belog/Resources/Private/Layouts/DocHeader.html [deleted file]
typo3/sysext/belog/Resources/Private/Templates/Tools/Index.html
typo3/sysext/belog/Resources/Private/Templates/WebInfo/Index.html

index 8d7d982..572d66d 100644 (file)
@@ -15,11 +15,14 @@ namespace TYPO3\CMS\Belog\Controller;
  */
 
 use TYPO3\CMS\Core\Page\PageRenderer;
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
+use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
+use TYPO3\CMS\Backend\View\BackendTemplateView;
 
 /**
  * Abstract class to show log entries from sys_log
  */
-abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
+abstract class AbstractController extends ActionController {
 
        /**
         * @var int
@@ -76,9 +79,16 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
        protected $logEntryRepository = NULL;
 
        /**
-        * @var PageRenderer
+        * @var BackendTemplateView
         */
-       protected $pageRenderer;
+       protected $view;
+
+       /**
+        * BackendTemplateView Container
+        *
+        * @var BackendTemplateView
+        */
+       protected $defaultViewObjectName = BackendTemplateView::class;
 
        /**
         * @param \TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository $logEntryRepository
@@ -88,12 +98,23 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
        }
 
        /**
+        * Initialize the view
+        *
+        * @param ViewInterface $view The view
+        * @return void
+        */
+       protected function initializeView(ViewInterface $view) {
+               /** @var BackendTemplateView $view */
+               parent::initializeView($view);
+               $view->getModuleTemplate()->getPageRenderer()->loadExtJS();
+               $view->getModuleTemplate()->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/DateTimePicker');
+       }
+
+       /**
         * init all actions
         * @return void
         */
        public function initializeAction() {
-               $this->pageRenderer = $this->objectManager->get(PageRenderer::class);
-               $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DateTimePicker');
        }
 
        /**
@@ -344,5 +365,4 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
                $constraint->setStartTimestamp($startTime);
                $constraint->setEndTimestamp($endTime);
        }
-
 }
diff --git a/typo3/sysext/belog/Resources/Private/Layouts/DocHeader.html b/typo3/sysext/belog/Resources/Private/Layouts/DocHeader.html
deleted file mode 100644 (file)
index 4d7a8c0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<f:be.container loadExtJs="1">
-       <div class="typo3-fullDoc">
-               <div id="typo3-docheader">
-                       <div class="typo3-docheader-functions">&nbsp;</div>
-                       <div class="typo3-docheader-buttons">&nbsp;</div>
-               </div>
-
-               <div id="typo3-docbody">
-                       <div id="typo3-inner-docbody">
-                               <f:render section="Content" />
-                       </div>
-               </div>
-       </div>
-</f:be.container>
\ No newline at end of file
index 1f58e6a..b2de4e7 100644 (file)
@@ -1,8 +1 @@
-<f:layout name="DocHeader" />
-
-<f:section name="Content">
-       <f:render
-               partial="Content"
-               arguments="{_all}"
-       />
-</f:section>
\ No newline at end of file
+<f:render partial="Content" arguments="{_all}" />
\ No newline at end of file
index 6510dc0..b2de4e7 100644 (file)
@@ -1,4 +1 @@
-<f:render
-       partial="Content"
-       arguments="{_all}"
-/>
\ No newline at end of file
+<f:render partial="Content" arguments="{_all}" />
\ No newline at end of file