[BUGFIX] Change TS property includeJSlibs to proper camelcase 12/33312/7
authorStefan Froemken <froemken@gmail.com>
Tue, 14 Oct 2014 19:36:39 +0000 (21:36 +0200)
committerBenjamin Mack <benni@typo3.org>
Sat, 31 Jan 2015 18:04:59 +0000 (19:04 +0100)
LowerCamelCase told us to use includeJSLibs
instead of includeJSlibs. We also use
includeJSFooter.

Resolves: #61605
Releases: master
Change-Id: I65966482c32b28c59d3d7402b01f6ff80129e3c9
Reviewed-on: http://review.typo3.org/33312
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-61605-ChangeNamingOfIncludeJSlibs.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/t3editor/res/tsref/tsref.xml

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-61605-ChangeNamingOfIncludeJSlibs.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-61605-ChangeNamingOfIncludeJSlibs.rst
new file mode 100644 (file)
index 0000000..05d7e99
--- /dev/null
@@ -0,0 +1,27 @@
+=============================================================================
+Deprecation: #61605 - Change naming of TypoScript property page.includeJSlibs
+=============================================================================
+
+Description
+===========
+
+The existing TypoScript option ``page.includeJSlibs`` has been renamed
+to ``page.includeJSLibs`` to follow the lower camel case naming scheme.
+The existing property is now deprecated.
+
+Impact
+======
+
+The old property will be removed with CMS 8, and should be avoided, if
+it has been used before.
+
+Affected Installations
+======================
+
+Any installation using the ``page.includeJSlibs`` option.
+
+Migration
+=========
+
+Search and replace all TypoScript code of the installation from
+``includeJSlibs`` to ``includeJSLibs``.
index d087a29..2d362fa 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Frontend\Page;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Service\TypoScriptService;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@@ -646,15 +647,28 @@ class PageGenerator {
                        }
                }
                // JavaScript library files
-               if (is_array($GLOBALS['TSFE']->pSetup['includeJSlibs.'])) {
-                       foreach ($GLOBALS['TSFE']->pSetup['includeJSlibs.'] as $key => $JSfile) {
+               if (is_array($GLOBALS['TSFE']->pSetup['includeJSlibs.']) || is_array($GLOBALS['TSFE']->pSetup['includeJSLibs.'])) {
+                       if (!is_array($GLOBALS['TSFE']->pSetup['includeJSlibs.'])) {
+                               $GLOBALS['TSFE']->pSetup['includeJSlibs.'] = array();
+                       } else {
+                               GeneralUtility::deprecationLog('The property page.includeJSlibs is marked for deprecation and will be removed in TYPO3 CMS 8. Please use page.includeJSLibs (with a uppercase L) instead.');
+                       }
+                       if (!is_array($GLOBALS['TSFE']->pSetup['includeJSLibs.'])) {
+                               $GLOBALS['TSFE']->pSetup['includeJSLibs.'] = array();
+                       }
+                       ArrayUtility::mergeRecursiveWithOverrule(
+                               $GLOBALS['TSFE']->pSetup['includeJSLibs.'],
+                               $GLOBALS['TSFE']->pSetup['includeJSlibs.']
+                       );
+                       unset($GLOBALS['TSFE']->pSetup['includeJSlibs.']);
+                       foreach ($GLOBALS['TSFE']->pSetup['includeJSLibs.'] as $key => $JSfile) {
                                if (!is_array($JSfile)) {
-                                       if (isset($GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($GLOBALS['TSFE']->pSetup['includeJSlibs.'][($key . '.')]['if.'])) {
+                                       if (isset($GLOBALS['TSFE']->pSetup['includeJSLibs.'][$key . '.']['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($GLOBALS['TSFE']->pSetup['includeJSLibs.'][($key . '.')]['if.'])) {
                                                continue;
                                        }
-                                       $ss = $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);
+                                       $ss = $GLOBALS['TSFE']->pSetup['includeJSLibs.'][$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);
                                        if ($ss) {
-                                               $jsFileConfig = &$GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.'];
+                                               $jsFileConfig = &$GLOBALS['TSFE']->pSetup['includeJSLibs.'][$key . '.'];
                                                $type = $jsFileConfig['type'];
                                                if (!$type) {
                                                        $type = 'text/javascript';
index fd43d9a..2bf15b6 100644 (file)
@@ -5817,7 +5817,7 @@ includeJS {
                        <default><![CDATA[
 ]]></default>
                </property>
-               <property name="includeJSlibs" type="array">
+               <property name="includeJSLibs" type="array">
                        <description><![CDATA[Adds JS library files to head of page.
 
 The file definition must be a valid "resource" datatype, otherwise nothing is inserted. This means that remote files cannot be referenced (i.e. using "http://..."), except by using the ".external" property.
@@ -5830,9 +5830,9 @@ Each file has optional properties:
 
 Example:
 
-includeJSlibs.twitter = http://twitter.com/javascripts/blogger.js
+includeJSLibs.twitter = http://twitter.com/javascripts/blogger.js
 
-includeJSlibs.twitter.external = 1
+includeJSLibs.twitter.external = 1
 ]]></description>
                        <default><![CDATA[
 ]]></default>
@@ -5845,7 +5845,7 @@ includeJSlibs.twitter.external = 1
 ]]></default>
                </property>
                <property name="includeJSFooterlibs" type="array">
-                       <description><![CDATA[  Same as includeJSlibs above, except that this block gets included at the bottom of the page (just before the closing body tag).
+                       <description><![CDATA[  Same as includeJSLibs above, except that this block gets included at the bottom of the page (just before the closing body tag).
 ]]></description>
                        <default><![CDATA[
 ]]></default>