(bugfix) #2936, 5613: Improvements to clipboard copy/move selection by Bernhard Kraft
authorBenni Mack <benni.mack@typo3.org>
Tue, 15 Jan 2008 10:32:06 +0000 (10:32 +0000)
committerBenni Mack <benni.mack@typo3.org>
Tue, 15 Jan 2008 10:32:06 +0000 (10:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2893 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_clipboard.php
typo3/sysext/lang/locallang_misc.xml

index 6802193..5b764cf 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-01-15  Benjamin Mack  <mack@xnos.org>
 
-       * (cleanup) #6958: added comments in t3lib_htmlmail.php, used foreach and some better variable namings
+       * (bugfix) #2936, 5613: Improvements to clipboard copy/move selection (by Bernhard Kraft)
+       * (cleanup) #6958: added comments in t3lib_htmlmail.php, used foreach and some better variable namings (thanks to Stefano Cecere and Steffen Kamper)
        * (bugfix) #5482:t3lib_htmlmail.php is now initialized with empty variables
 
 2008-01-15     Dmitry Dulepov  <dmitry@typo3.org>
index a20466b..1d9addb 100755 (executable)
@@ -317,8 +317,17 @@ class t3lib_clipboard {
 
                        // Button/menu header:
                $thumb_url = t3lib_div::linkThisScript(array('CB'=>array('setThumb'=>$this->clipData['_setThumb']?0:1)));
-               $copymode_url = t3lib_div::linkThisScript(array('CB'=>array('setCopyMode'=>($this->currentMode()=='copy'?'':'copy'))));
                $rmall_url = t3lib_div::linkThisScript(array('CB'=>array('removeAll'=>$this->current)));
+                       
+                       // Copymode Selector menu
+               $copymode_url = t3lib_div::linkThisScript();
+               $moveLabel = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.php:moveElements'));
+               $copyLabel = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.php:copyElements'));
+               $opt=array();
+               $opt[]='<option style="padding-left: 20px; background-image: url(\''.t3lib_iconWorks::skinImg($this->backPath, 'gfx/clip_cut.gif', '', 1).'\'); background-repeat: no-repeat;" value="" '.(($this->currentMode()=='copy')?'':'selected="selected"').'>'.$moveLabel .'</option>';
+               $opt[]='<option style="padding-left: 20px; background-image: url(\''.t3lib_iconWorks::skinImg($this->backPath, 'gfx/clip_copy.gif', '', 1).'\'); background-repeat: no-repeat;" value="1" '.(($this->currentMode()=='copy')?'selected="selected"':'').'>'.$copyLabel .'</option>';
+
+               $copymode_selector = ' <select name="CB[setCopyMode]" onchange="this.form.method=\'POST\'; this.form.action=\''.$copymode_url.'&CB[setCopyMode]=\'+(this.options[this.selectedIndex].value); this.form.submit(); return true;" >'.implode('',$opt).'</select>';
 
                        // Selector menu + clear button
                $opt=array();
@@ -352,11 +361,11 @@ class t3lib_clipboard {
                                '<a href="'.htmlspecialchars($thumb_url).'#clip_head">'.
                                        '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/thumb_'.($this->clipData['_setThumb']?'s':'n').'.gif','width="21" height="16"').' vspace="2" border="0" title="'.$this->clLabel('thumbmode_clip').'" alt="" />'.
                                        '</a>'.
-                               '<a href="'.htmlspecialchars($copymode_url).'#clip_head">'.
-                                       '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/copymode_'.($this->currentMode()=='copy'?'s':'n').'.gif','width="21" height="16"').' vspace="2" border="0" title="'.$this->clLabel('copymode').'" alt="" />'.
-                                       '</a>'.
                                '</td>
-                               <td width="95%">'.$selector_menu.'</td>
+                               <td width="95%" nowrap="nowrap">'.
+                                       $copymode_selector.' '.
+                                       $selector_menu.
+                               '</td>
                                <td>'.
                                '<a href="'.htmlspecialchars($rmall_url).'#clip_head">'.
                                        '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/closedok_2.gif','width="21" height="16"').' vspace="2" border="0" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:buttons.clear',1).'" alt="" />'.
index dbca1ac..75c3e08 100755 (executable)
@@ -38,6 +38,8 @@
                        <label index="insertNewRecordHere">Insert new record here</label>
                        <label index="movePageToHere">Move page to this position</label>
                        <label index="moveElement">Move element</label>
+                       <label index="moveElements">Move elements</label>
+                       <label index="copyElements">Copy elements</label>
                        <label index="selectPositionOfElement">Select position of the element</label>
                        <label index="movingElement">Move element</label>
                        <label index="makeCopy">Make copy instead of moving element</label>