[TASK] Fix deprecated $doc->isCMlayers()
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 22 Sep 2012 22:25:27 +0000 (00:25 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 15 Nov 2012 22:05:53 +0000 (23:05 +0100)
Function TYPO3\CMS\Backend\Template\DocumentTemplate->isCMlayers()
is not needed and can be removed.

Change-Id: I7cef6a7711055c8cd6ce7ca0b3bf94b22e50a62f
Resolves: #41272
Releases: 6.0
Reviewed-on: http://review.typo3.org/14955
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Controller/ClickMenuController.php
typo3/sysext/backend/Classes/Controller/FileSystemNavigationFrameController.php
typo3/sysext/backend/Classes/Controller/PageTreeNavigationController.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php

index 6cf5c0b..7b36f76 100644 (file)
@@ -72,12 +72,6 @@ class ClickMenu {
         */
        public $disabledItems = array();
 
-       // If TRUE, the context sensitive menu will not appear in the top frame, only as a layer.
-       /**
-        * @todo Define visibility
-        */
-       public $dontDisplayTopFrameCM = 0;
-
        // If TRUE, Show icons on the left.
        /**
         * @todo Define visibility
@@ -181,13 +175,11 @@ class ClickMenu {
         *
         * @return boolean
         * @todo Define visibility
+        * @deprecated since TYPO3 6.0, will be removed in 6.2 as there is no click menu in the topframe anymore (no topframe at all actually)
         */
        public function doDisplayTopFrameCM() {
-               if ($this->ajax) {
-                       return FALSE;
-               } else {
-                       return !$GLOBALS['SOBE']->doc->isCMlayers() || !$this->dontDisplayTopFrameCM;
-               }
+               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
+               return FALSE;
        }
 
        /***************************************
@@ -1007,8 +999,7 @@ class ClickMenu {
         *
         **************************************/
        /**
-        * Prints the items from input $menuItems array - both as topframe menu AND the JS section for writing to the div-layers.
-        * Of course the topframe menu will appear only if $this->doDisplayTopFrameCM() returns TRUE
+        * Prints the items from input $menuItems array - as JS section for writing to the div-layers.
         *
         * @param array $menuItems Array
         * @param string $item HTML code for the element which was clicked - shown in the end of the horizontal menu in topframe after the close-button.
@@ -1021,34 +1012,6 @@ class ClickMenu {
                $menuItems = $this->enableDisableItems($menuItems);
                // Clean up spacers:
                $menuItems = $this->cleanUpSpacers($menuItems);
-               // Adding topframe part (horizontal clickmenu)
-               if ($this->doDisplayTopFrameCM()) {
-                       $out .= '
-
-                               <!--
-                                       Table, which contains the click menu when shown in the top frame of the backend:
-                               -->
-                               <table border="0" cellpadding="0" cellspacing="0" id="typo3-CSM-top">
-                                       <tr>
-
-                                                       <!-- Items: -->
-                                               <td class="c-item">' . implode(('</td>
-                                               <td><img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->PH_backPath, 'gfx/acm_spacer2.gif', 'width="8" height="12"') . ' alt="" /></td>
-                                               <td class="c-item">'), $this->menuItemsForTopFrame($menuItems)) . '</td>
-
-                                                       <!-- Close button: -->
-                                               <td class="c-closebutton"><a href="#" onclick="hideCM();return false;">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close', array(
-                               'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.close', 1)
-                       )) . '</a></td>
-
-                                                       <!-- The item of the clickmenu: -->
-                                               <td class="c-itemicon">' . $item . '</td>
-                                       </tr>
-                               </table>
-                       ';
-                       // Set remaining BACK_PATH to blank (if any)
-                       $out = str_replace($this->PH_backPath, '', $out);
-               }
                // Adding JS part:
                $out .= $this->printLayerJScode($menuItems);
                // Return the content
@@ -1089,7 +1052,8 @@ class ClickMenu {
                                if (top.content && top.content' . $frameName . ' && top.content' . $frameName . '.Clickmenu) {
                                        top.content' . $frameName . '.Clickmenu.populateData(unescape("' . GeneralUtility::rawurlencodeJS($CMtable) . '"),' . $this->cmLevel . ');
                                }
-                               ' . (!$this->doDisplayTopFrameCM() ? 'hideCM();' : ''));
+                               hideCM();
+                               ');
                                return $script;
                        }
                }
@@ -1378,11 +1342,7 @@ class ClickMenu {
         * @todo Define visibility
         */
        public function isCMlayers() {
-               if ($this->ajax) {
-                       return !$this->CB;
-               } else {
-                       return $GLOBALS['SOBE']->doc->isCMlayers() && !$this->CB;
-               }
+               return !$this->CB;
        }
 
        /**
@@ -1399,4 +1359,4 @@ class ClickMenu {
 }
 
 
-?>
\ No newline at end of file
+?>
index e0b3394..766ce70 100644 (file)
@@ -55,12 +55,6 @@ class ClickMenuController {
         */
        public $extClassArray = array();
 
-       // If set, then the clickmenu will NOT display in the top frame.
-       /**
-        * @todo Define visibility
-        */
-       public $dontDisplayTopFrameCM = 0;
-
        /**
         * Constructor function for script class.
         *
@@ -97,10 +91,7 @@ class ClickMenuController {
                        $this->doc->backPath = $GLOBALS['BACK_PATH'];
                }
                // Setting mode for display and background image in the top frame
-               $this->dontDisplayTopFrameCM = $this->doc->isCMlayers() && !$GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.options.alwaysShowClickMenuInTopFrame');
-               if ($this->dontDisplayTopFrameCM) {
-                       $this->doc->bodyTagId .= '-notop';
-               }
+
                // Setting clickmenu timeout
                $secs = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.options.clickMenuTimeOut'), 1, 100, 5);
                // default is 5
@@ -175,7 +166,6 @@ class ClickMenuController {
                // Set internal vars in clickmenu object:
                $clickMenu->clipObj = $clipObj;
                $clickMenu->extClassArray = $this->extClassArray;
-               $clickMenu->dontDisplayTopFrameCM = $this->dontDisplayTopFrameCM;
                $clickMenu->backPath = $this->backPath;
                // Start page
                if (!$this->ajax) {
index f864a43..9b2c99a 100644 (file)
@@ -169,7 +169,7 @@ class FileSystemNavigationFrameController {
                // Adding javascript for drag & drop activation and highlighting
                $this->content .= $this->doc->wrapScriptTags('
                        ' . ($this->doHighlight ? 'Tree.highlightActiveItem("", top.fsMod.navFrameHighlightedID["file"]);' : '') . '
-                       ' . (!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();'));
+                       Tree.registerDragDropHandlers();');
                // Setting up the buttons and markers for docheader
                $docHeaderButtons = $this->getButtons();
                $markers = array(
@@ -239,4 +239,4 @@ class FileSystemNavigationFrameController {
 }
 
 
-?>
\ No newline at end of file
+?>
index 9b4b8f0..722d58d 100644 (file)
@@ -178,7 +178,7 @@ class PageTreeNavigationController {
                // Adding javascript for drag & drop activation and highlighting
                $this->content .= $this->doc->wrapScriptTags('
                        ' . ($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '') . '
-                       ' . (!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();'));
+                       Tree.registerDragDropHandlers();');
                // Setting up the buttons and markers for docheader
                $docHeaderButtons = $this->getButtons();
                $markers = array(
@@ -329,4 +329,4 @@ class PageTreeNavigationController {
 }
 
 
-?>
\ No newline at end of file
+?>
index abbb730..42d96f8 100644 (file)
@@ -1521,7 +1521,7 @@ class DocumentTemplate {
                $this->loadJavascriptLib('js/clickmenu.js');
                $this->JScodeArray['clickmenu'] = '
                        Clickmenu.clickURL = "' . $this->backPath . 'alt_clickmenu.php";
-                       Clickmenu.ajax     = ' . ($this->isCMLayers() ? 'true' : 'false') . ';';
+                       Clickmenu.ajax     = true;';
        }
 
        /**