[!!!][TASK] Remove unused tabmenu JavaScript and CSS 01/43301/2
authorBenjamin Mack <benni@typo3.org>
Mon, 14 Sep 2015 14:30:16 +0000 (16:30 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 14 Sep 2015 20:10:56 +0000 (22:10 +0200)
Due to the shift to the new tabmenu logic, all leftover code
that is unused is now removed.

Releases: master
Resolves: #69795
Change-Id: Ia875c2938dc852b478e49be82bf2922ce67ab165
Reviewed-on: http://review.typo3.org/43301
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Build/Resources/Public/Less/TYPO3/structure/_module_user_ws.less [deleted file]
Build/Resources/Public/Less/backend.less
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Resources/Public/JavaScript/backend.js
typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js [deleted file]
typo3/sysext/core/Documentation/Changelog/master/Breaking-69795-UnusedDTMTabmenuCodeRemoved.rst [new file with mode: 0644]

diff --git a/Build/Resources/Public/Less/TYPO3/structure/_module_user_ws.less b/Build/Resources/Public/Less/TYPO3/structure/_module_user_ws.less
deleted file mode 100644 (file)
index 164c22f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-//
-// Styling for the module User => Workspace
-//
-
-#typo3-mod-user-ws-index-php .typo3-dyntabmenu-divs {
-       padding: 10px;
-}
index 3a7b7f1..487c3ec 100644 (file)
@@ -76,7 +76,6 @@
 
 @import "TYPO3/structure/_element_version.less";
 @import "TYPO3/structure/_element_wizard.less";
-@import "TYPO3/structure/_module_user_ws.less";
 @import "TYPO3/structure/_module_web_list.less";
 
 @import "TYPO3/visual/_element_extjs_icons.less";
index 4af8bee..c39aa50 100755 (executable)
@@ -551,70 +551,6 @@ class PageLayoutController {
                                        return false;
                                }
                        ');
-                       $this->doc->JScode .= $this->doc->wrapScriptTags('
-                               var DTM_array = [];
-                               var DTM_origClass = "";
-
-                                       // if tabs are used in a popup window the array might not exists
-                               if(!top.DTM_currentTabs) {
-                                       top.DTM_currentTabs = [];
-                               }
-
-                               function DTM_activate(idBase,index,doToogle) {  //
-                                               // Hiding all:
-                                       if (DTM_array[idBase]) {
-                                               for(cnt = 0; cnt < DTM_array[idBase].length ; cnt++) {
-                                                       if (DTM_array[idBase][cnt] != idBase+"-"+index) {
-                                                               document.getElementById(DTM_array[idBase][cnt]+"-DIV").className = "tab-pane";
-                                                               document.getElementById(DTM_array[idBase][cnt]+"-MENU").attributes.getNamedItem("class").value = "tab";
-                                                       }
-                                               }
-                                       }
-
-                                               // Showing one:
-                                       if (document.getElementById(idBase+"-"+index+"-DIV")) {
-                                               if (doToogle && document.getElementById(idBase+"-"+index+"-DIV").className === "tab-pane active") {
-                                                       document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane";
-                                                       if(DTM_origClass=="") {
-                                                               document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "tab";
-                                                       } else {
-                                                               DTM_origClass = "tab";
-                                                       }
-                                                       top.DTM_currentTabs[idBase] = -1;
-                                               } else {
-                                                       document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane active";
-                                                       if(DTM_origClass=="") {
-                                                               document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "active";
-                                                       } else {
-                                                               DTM_origClass = "active";
-                                                       }
-                                                       top.DTM_currentTabs[idBase] = index;
-                                               }
-                                       }
-                               }
-                               function DTM_toggle(idBase,index,isInit) {      //
-                                               // Showing one:
-                                       if (document.getElementById(idBase+"-"+index+"-DIV")) {
-                                               if (document.getElementById(idBase+"-"+index+"-DIV").style.display == "block") {
-                                                       document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane";
-                                                       if(isInit) {
-                                                               document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "tab";
-                                                       } else {
-                                                               DTM_origClass = "tab";
-                                                       }
-                                                       top.DTM_currentTabs[idBase+"-"+index] = 0;
-                                               } else {
-                                                       document.getElementById(idBase+"-"+index+"-DIV").className = "tab-pane active";
-                                                       if(isInit) {
-                                                               document.getElementById(idBase+"-"+index+"-MENU").attributes.getNamedItem("class").value = "active";
-                                                       } else {
-                                                               DTM_origClass = "active";
-                                                       }
-                                                       top.DTM_currentTabs[idBase+"-"+index] = 1;
-                                               }
-                                       }
-                               }
-                       ');
                        // Setting doc-header
                        $this->doc->form = '<form action="' . htmlspecialchars(
                                BackendUtility::getModuleUrl(
index 138cdf0..e14a268 100644 (file)
@@ -204,8 +204,5 @@ function debugObj(obj,name) {       //
 var currentSubScript = "";
 var currentSubNavScript = "";
 
-       // Used for tab-panels:
-var DTM_currentTabs = [];
-
        // status of WS FE preview
 var WorkspaceFrontendPreviewEnabled = TYPO3.configuration.workspaceFrontendPreviewEnabled;
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js
deleted file mode 100644 (file)
index 12f71b7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * javascript functions regarding the "dyntabmenu" used throughout the TYPO3 backend
- */
-
-var DTM_array = DTM_array || [];
-
-       // if tabs are used in a popup window the array might not exists
-if (!top.DTM_currentTabs) {
-       top.DTM_currentTabs = [];
-}
-
-function DTM_activate(idBase,index,doToogle) {
-               // Check, whether the given index really exists
-       if (!document.getElementById(idBase+'-'+index+'-MENU')) {
-               // force the index to be the first one in case of saved settings are not valid anymore
-               index = 1;
-       }
-
-               // Hiding all:
-       if (DTM_array[idBase]) {
-               for(var cnt = 0; cnt < DTM_array[idBase].length; cnt++) {
-                       if (DTM_array[idBase][cnt] !== idBase + '-' + index) {
-                               document.getElementById(DTM_array[idBase][cnt]+'-DIV').className = "tab-pane";
-                               // Only Overriding when Tab not disabled
-                               if (document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').value !== 'disabled') {
-                                       document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').value = 'tab';
-                               }
-                       }
-               }
-       }
-
-               // Showing one:
-       if (document.getElementById(idBase+'-'+index+'-DIV')) {
-               if (doToogle && document.getElementById(idBase+'-'+index+'-DIV').className === 'tab-pane active') {
-                       document.getElementById(idBase+'-'+index+'-DIV').className = "tab-pane";
-                       document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').value = 'tab';
-                       top.DTM_currentTabs[idBase] = -1;
-               } else {
-                       document.getElementById(idBase+'-'+index+'-DIV').className = "tab-pane active";
-                       document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').value = 'active';
-                       top.DTM_currentTabs[idBase] = index;
-               }
-       }
-       document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').value = 'active';
-}
-function DTM_toggle(idBase,index,isInit) {
-               // Showing one:
-       if (document.getElementById(idBase+'-'+index+'-DIV')) {
-               if (document.getElementById(idBase+'-'+index+'-DIV').className === 'tab-pane active') {
-                       document.getElementById(idBase+'-'+index+'-DIV').className = "tab-pane";
-                       if (isInit) {
-                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').value = 'tab';
-                       }
-                       top.DTM_currentTabs[idBase+'-'+index] = 0;
-               } else {
-                       document.getElementById(idBase+'-'+index+'-DIV').className = "tab-pane active";
-                       if (isInit) {
-                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').value = 'active';
-                       }
-                       top.DTM_currentTabs[idBase+'-'+index] = 1;
-               }
-       }
-}
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-69795-UnusedDTMTabmenuCodeRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69795-UnusedDTMTabmenuCodeRemoved.rst
new file mode 100644 (file)
index 0000000..49af09e
--- /dev/null
@@ -0,0 +1,26 @@
+==================================================
+Breaking: #69795 - Unused DTM Tabmenu code removed
+==================================================
+
+Description
+===========
+
+All DynTabMenu JavaScript and CSS code which was previously used to render Tab Menus in the TYPO3 Backend has been removed without substitution.
+
+
+Impact
+======
+
+All logic that requires EXT:backend/Resources/Public/JavaScript/tabmenu.js directly and/or use the JavaScript code of ``DTM_activate()`` or ``DTM_toggle()`` directly have been removed.
+
+
+Affected Installations
+======================
+
+TYPO3 Installations with custom extensions that use the logic mentioned above.
+
+
+Migration
+=========
+
+Use DocumentTemplate::getDynamicTabMenu() directly to use the Bootstrap-based API shipped with the TYPO3 Core.
\ No newline at end of file