[TASK] Rename method "JStop"" to "addCssFiles" 80/50080/4
authormjankiewicz <michal.jankiewicz@gmail.com>
Sat, 1 Oct 2016 15:20:09 +0000 (17:20 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 7 Oct 2016 11:47:22 +0000 (13:47 +0200)
The old name has nothing to do with JS.

Resolves: #75363
Releases: master
Change-Id: Ie6dec85a89ca39561b04450bcb871ce272f8c49a
Reviewed-on: https://review.typo3.org/50080
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Karol Lamparski <klamparski@gmail.com>
Tested-by: Karol Lamparski <klamparski@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/RteController.php
typo3/sysext/backend/Classes/Form/FormResultCompiler.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-75363-DeprecateFormResultCompilerJStop.rst [new file with mode: 0644]

index 51a0847..da435a0 100644 (file)
@@ -980,7 +980,7 @@ class EditDocumentController extends AbstractModule
                     $this->viewId,
                     'mod.xMOD_alt_doc'
                 ) : [];
-                $body = $this->formResultCompiler->JStop();
+                $body = $this->formResultCompiler->addCssFiles();
                 $body .= $this->compileForm($editForm);
                 $body .= $this->formResultCompiler->printNeededJSFunctions();
                 $body .= '</form>';
@@ -1146,7 +1146,7 @@ class EditDocumentController extends AbstractModule
                                 $formResult['doSaveFieldName'] = 'doSave';
 
                                 // @todo: Put all the stuff into FormEngine as final "compiler" class
-                                // @todo: This is done here for now to not rewrite JStop()
+                                // @todo: This is done here for now to not rewrite addCssFiles()
                                 // @todo: and printNeededJSFunctions() now
                                 $this->formResultCompiler->mergeResult($formResult);
 
index 47a9931..d2aa3ff 100644 (file)
@@ -967,7 +967,7 @@ class PageLayoutController
                     <input type="hidden" name="redirect" value="' . htmlspecialchars($redirect) . '" />
                     ';
                 // Add JavaScript as needed around the form:
-                $content = $formResultCompiler->JStop() . $panel . $formResultCompiler->printNeededJSFunctions();
+                $content = $formResultCompiler->addCssFiles() . $panel . $formResultCompiler->printNeededJSFunctions();
 
                 // Display "is-locked" message:
                 if ($command === 'edit') {
index b9e2711..5046e78 100644 (file)
@@ -212,7 +212,7 @@ class RteController extends AbstractWizardController
             $formContent .= '<input type="hidden" name="redirect" value="' . htmlspecialchars($this->R_URI) . '" />
                                                <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />';
             // Finally, add the whole setup:
-            $this->content .= $formResultCompiler->JStop()
+            $this->content .= $formResultCompiler->addCssFiles()
                 . $formContent
                 . $formResultCompiler->printNeededJSFunctions();
         } else {
index 447b7b3..2db8b2c 100644 (file)
@@ -169,9 +169,21 @@ class FormResultCompiler
      * JavaScript code added BEFORE the form is drawn:
      *
      * @return string
+     * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
      */
     public function JStop()
     {
+        GeneralUtility::logDeprecatedFunction();
+        return $this->addCssFiles();
+    }
+
+    /**
+     * Adds CSS files BEFORE the form is drawn
+     *
+     * @return string
+     */
+    public function addCssFiles()
+    {
         $pageRenderer = $this->getPageRenderer();
         foreach ($this->stylesheetFiles as $stylesheetFile) {
             $pageRenderer->addCssFile($stylesheetFile);
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-75363-DeprecateFormResultCompilerJStop.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-75363-DeprecateFormResultCompilerJStop.rst
new file mode 100644 (file)
index 0000000..09aacd5
--- /dev/null
@@ -0,0 +1,34 @@
+
+.. include:: ../../Includes.txt
+
+=========================================================================
+Deprecation: #75363 - Deprecate FormResultCompiler->JStop()
+=========================================================================
+
+See :issue:`75363`
+
+Description
+===========
+
+The method has been renamed to `addCssFiles()`. The old method name is
+still present as a deprecated alias, which will be removed in TYPO3 v9.
+
+
+Impact
+======
+
+Calling this method will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+Any extensions calling `JStop()`.
+
+
+Migration
+=========
+
+Instead of :php:`JStop()` use :php:`addCssFiles()`.
+
+.. index:: php