git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2998 709f56b5-9817-0410-a4d7...
authorKasper Skårhøj <kasper@typo3.org>
Thu, 31 Jan 2008 21:16:53 +0000 (21:16 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Thu, 31 Jan 2008 21:16:53 +0000 (21:16 +0000)
ChangeLog
typo3/alt_clickmenu.php

index 3a73108..effc1c1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2008-01-31  Kasper Sk\8crh¿j <kasper2008@typo3.com>
 
+       * - Removed copy/cut/pasteafter/delete from context menu of DB mounts. Could lead to confusing scenarios for admin users in workspaces.
        * - Added TCA feature in [ctrl][versioningWS_alwaysAllowLiveEdit] allowed to permanently set records to be edited directly. This enables that backend users can still be edited while in a workspace. Convenient for admins.
        * - Also, the User Admin module is now available in draft workspaces
        * tcemain:
index 2f966d7..83f9992 100755 (executable)
@@ -257,11 +257,17 @@ class clickMenu {
                        // Get record:
                $this->rec = t3lib_BEfunc::getRecordWSOL($table,$uid);
                $menuItems=array();
+
                $root=0;
+               $DBmount = FALSE;
                if ($table=='pages' && !strcmp($uid,'0'))       {       // Rootlevel
                        $root=1;
                }
 
+               if ($table=='pages' && in_array($uid,$GLOBALS['BE_USER']->returnWebmounts()))   {       // DB mount
+                       $DBmount = TRUE;
+               }
+
                        // If record found (or root), go ahead and fill the $menuItems array which will contain data for the elements to render.
                if (is_array($this->rec) || $root)      {
 
@@ -292,9 +298,9 @@ class clickMenu {
                        $menuItems['spacer1']='spacer';
 
                                // Copy:
-                       if(!in_array('copy',$this->disabledItems) && !$root)    $menuItems['copy']=$this->DB_copycut($table,$uid,'copy');
+                       if(!in_array('copy',$this->disabledItems) && !$root && !$DBmount)       $menuItems['copy']=$this->DB_copycut($table,$uid,'copy');
                                // Cut:
-                       if(!in_array('cut',$this->disabledItems) && !$root)     $menuItems['cut']=$this->DB_copycut($table,$uid,'cut');
+                       if(!in_array('cut',$this->disabledItems) && !$root && !$DBmount)        $menuItems['cut']=$this->DB_copycut($table,$uid,'cut');
 
                                // Paste:
                        $elFromAllTables = count($this->clipObj->elFromTable(''));
@@ -310,12 +316,12 @@ class clickMenu {
                                }
 
                                $elFromTable = count($this->clipObj->elFromTable($table));
-                               if (!$root && $elFromTable  && $TCA[$table]['ctrl']['sortby'])  $menuItems['pasteafter']=$this->DB_paste($table,-$uid,'after',$elInfo);
+                               if (!$root && !$DBmount && $elFromTable  && $TCA[$table]['ctrl']['sortby'])     $menuItems['pasteafter']=$this->DB_paste($table,-$uid,'after',$elInfo);
                        }
 
                                // Delete:
                        $elInfo=array(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$this->rec),$BE_USER->uc['titleLen']));
-                       if(!in_array('delete',$this->disabledItems) && !$root && $BE_USER->isPSet($lCP,$table,'delete'))        {
+                       if(!in_array('delete',$this->disabledItems) && !$root && !$DBmount && $BE_USER->isPSet($lCP,$table,'delete'))   {
                                $menuItems['spacer2']='spacer';
                                $menuItems['delete']=$this->DB_delete($table,$uid,$elInfo);
                        }