[FOLLOWUP][TASK] Decouple t3editor hooks from DocumentTemplate 25/43825/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 5 Oct 2015 17:21:16 +0000 (19:21 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 5 Oct 2015 17:42:12 +0000 (19:42 +0200)
Clean up calling code as well.

Releases: master
Resolves: #70387
Change-Id: I04a542c02f353db1052aed646e7537d47a80d8df
Reviewed-on: http://review.typo3.org/43825
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/t3editor/Classes/Hook/FileEditHook.php
typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php

index 91244d8..38b65f5 100644 (file)
@@ -61,16 +61,14 @@ class FileEditHook {
         * Hook-function: inject t3editor JavaScript code before the page is compiled
         * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage
         *
-        * @param array $parameters
-        * @param \TYPO3\CMS\Backend\Template\DocumentTemplate $documentTemplate
         * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage
         */
-       public function preStartPageHook($parameters, $documentTemplate) {
+       public function preStartPageHook() {
                // @todo: this is a workaround. Ideally the document template holds the current request so we can match the route
                // against the name of the route and not the GET parameter
                if (GeneralUtility::_GET('route') === '/file/editcontent') {
                        $t3editor = $this->getT3editor();
-                       $t3editor->getJavascriptCode($documentTemplate);
+                       $t3editor->getJavascriptCode();
                        $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/T3editor/FileEdit');
                }
        }
index b02e3e6..aee807a 100644 (file)
@@ -43,17 +43,15 @@ class TypoScriptTemplateInfoHook {
         * Hook-function: inject t3editor JavaScript code before the page is compiled
         * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage
         *
-        * @param array $parameters
-        * @param \TYPO3\CMS\Backend\Template\DocumentTemplate $pObj
         * @return void
         * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage
         */
-       public function preStartPageHook($parameters, $pObj) {
+       public function preStartPageHook() {
                // Enable editor in Template-Modul
                if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('M') === 'web_ts') {
                        $t3editor = $this->getT3editor();
-                       // Insert javascript code in document header
-                       $pObj->JScode .= $t3editor->getJavascriptCode($pObj);
+                       // Insert javascript code
+                       $t3editor->getJavascriptCode();
                }
        }