Fixed bug #17279: Old Contextmenu: Partly broken - Mount as TreeRoot / Hide / Unhide...
authorSteffen Gebert <steffen.gebert@typo3.org>
Wed, 26 Jan 2011 10:17:14 +0000 (10:17 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Wed, 26 Jan 2011 10:17:14 +0000 (10:17 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10329 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/alt_clickmenu.php

index 0060675..00f0cee 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
 
        * Follow-up to #17321: Add missing PHPdoc
        * Fixed bug #17202: Cursor not changing to help over some labels
+       * Fixed bug #17279: Old Contextmenu: Partly broken - Mount as TreeRoot / Hide / Unhide / Delete (Thanks to Stefan Galinski)
 
 2011-01-26  Sebastian Kurfuerst  <sebastian@typo3.org>
 
index 69cfa2f..e964508 100644 (file)
@@ -753,7 +753,7 @@ class clickMenu {
                        $conf = '1==1';
                }
                $editOnClick = 'if(' . $loc . " && " . $conf . " ){" . $loc . ".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(" . $this->frameLocation($loc . '.document') . ")+'".
-                       "&cmd[" . $table . '][' . $uid . '][delete]=1&prErr=1&vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction') . "';}hideCM();top.nav.refresh();";
+                       "&cmd[" . $table . '][' . $uid . '][delete]=1&prErr=1&vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction') . "';}hideCM();top.nav.refresh.defer(500, top.nav);";
 
                return $this->linkItem(
                        $this->label('delete'),
@@ -789,7 +789,24 @@ class clickMenu {
                return $this->linkItem(
                        $this->label('tempMountPoint'),
                        $this->excludeIcon(t3lib_iconWorks::getSpriteIcon('apps-pagetree-page-mountpoint')),
-                       "if (top.content.nav_frame) { top.content.nav_frame.location.href = 'alt_db_navframe.php?setTempDBmount=".intval($page_id)."'; } return hideCM();"
+                       "if (top.content.nav_frame) {
+                               var node = top.TYPO3.Backend.NavigationContainer.PageTree.getSelected();
+                               if (node === null) {
+                                       return false;
+                               }
+
+                               var useNode = {
+                                       attributes: {
+                                               nodeData: {
+                                                       id: " . intval($page_id) . "
+                                               }
+                                       }
+                               };
+
+                               node.ownerTree.commandProvider.mountAsTreeRoot(useNode, node.ownerTree);
+                        }
+                        return hideCM();
+                       "
                );
        }
 
@@ -823,7 +840,7 @@ class clickMenu {
                $loc = 'top.content.list_frame';
                $editOnClick = 'if(' . $loc . '){' . $loc . ".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(" . $this->frameLocation($loc . '.document') . ")+'" .
                        "&data[" . $table . '][' . $uid . '][' . $flagField . ']=' .
-                ($rec[$flagField] ? 0 : 1) . '&prErr=1&vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction') . "';}hideCM();top.nav.refresh();";
+                ($rec[$flagField] ? 0 : 1) . '&prErr=1&vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction') . "';}hideCM();top.nav.refresh.defer(500, top.nav);";
 
                return $this->linkItem(
                        $title,