group-type selector has top/up/down/bottom buttons now.
authorKasper Skårhøj <kasper@typo3.org>
Mon, 4 Apr 2005 19:28:28 +0000 (19:28 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Mon, 4 Apr 2005 19:28:28 +0000 (19:28 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@600 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_tceforms.php
t3lib/gfx/down.gif [new file with mode: 0644]
t3lib/gfx/group_tobottom.gif [new file with mode: 0644]
t3lib/gfx/up.gif [new file with mode: 0644]
typo3/alt_menu.php
typo3/sysext/lang/locallang_core.xml

index 495f36e..f818e91 100755 (executable)
@@ -2620,8 +2620,8 @@ class t3lib_TCEforms      {
                }
 
                        // Create selector box of the options
+               $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC+1,t3lib_div::intInRange($params['size'],1),$params['autoSizeMax']) : $params['size'];
                if (!$selector) {
-                       $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC+1,t3lib_div::intInRange($params['size'],1),$params['autoSizeMax']) : $params['size'];
                        $selector = '<select size="'.$sSize.'"'.$this->insertDefStyle('group').' multiple="multiple" name="'.$fName.'_list" '.$onFocus.$params['style'].'>'.implode('',$opt).'</select>';
                }
 
@@ -2637,9 +2637,22 @@ class t3lib_TCEforms     {
                                        '</a>';
                }
                if (!$params['dontShowMoveIcons'])      {
+                       if ($sSize>=5)  {
+                               $icons['L'][]='<a href="#" onclick="setFormValueManipulate(\''.$fName.'\',\'Top\'); return false;">'.
+                                               '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/group_totop.gif','width="14" height="14"').' border="0" '.t3lib_BEfunc::titleAltAttrib($this->getLL('l_move_to_top')).' />'.
+                                               '</a>';
+                       }
                        $icons['L'][]='<a href="#" onclick="setFormValueManipulate(\''.$fName.'\',\'Up\'); return false;">'.
-                                       '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/group_totop.gif','width="14" height="14"').' border="0" '.t3lib_BEfunc::titleAltAttrib($this->getLL('l_move_to_top')).' />'.
+                                       '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/up.gif','width="14" height="14"').' border="0" '.t3lib_BEfunc::titleAltAttrib($this->getLL('l_move_up')).' />'.
+                                       '</a>';
+                       $icons['L'][]='<a href="#" onclick="setFormValueManipulate(\''.$fName.'\',\'Down\'); return false;">'.
+                                       '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/down.gif','width="14" height="14"').' border="0" '.t3lib_BEfunc::titleAltAttrib($this->getLL('l_move_down')).' />'.
                                        '</a>';
+                       if ($sSize>=5)  {
+                               $icons['L'][]='<a href="#" onclick="setFormValueManipulate(\''.$fName.'\',\'Bottom\'); return false;">'.
+                                               '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/group_tobottom.gif','width="14" height="14"').' border="0" '.t3lib_BEfunc::titleAltAttrib($this->getLL('l_move_to_bottom')).' />'.
+                                               '</a>';
+                       }
                }
 
                $clipElements = $this->getClipboardElements($allowed,$mode);
@@ -4472,18 +4485,18 @@ class t3lib_TCEforms    {
                                if (formObj)    {
                                        var localArray_V = new Array();
                                        var localArray_L = new Array();
+                                       var localArray_S = new Array();
                                        var fObjSel = formObj[fName+"_list"];
                                        var l=fObjSel.length;
                                        var c=0;
-                                       var cS=0;
-                                       if (type=="Remove" || type=="Up")       {
-                                               if (type=="Up") {
+                                       if (type=="Remove" || type=="Top" || type=="Bottom")    {
+                                               if (type=="Top")        {
                                                        for (a=0;a<l;a++)       {
                                                                if (fObjSel.options[a].selected==1)     {
                                                                        localArray_V[c]=fObjSel.options[a].value;
                                                                        localArray_L[c]=fObjSel.options[a].text;
+                                                                       localArray_S[c]=1;
                                                                        c++;
-                                                                       cS++;
                                                                }
                                                        }
                                                }
@@ -4491,15 +4504,109 @@ class t3lib_TCEforms   {
                                                        if (fObjSel.options[a].selected!=1)     {
                                                                localArray_V[c]=fObjSel.options[a].value;
                                                                localArray_L[c]=fObjSel.options[a].text;
+                                                               localArray_S[c]=0;
                                                                c++;
                                                        }
                                                }
+                                               if (type=="Bottom")     {
+                                                       for (a=0;a<l;a++)       {
+                                                               if (fObjSel.options[a].selected==1)     {
+                                                                       localArray_V[c]=fObjSel.options[a].value;
+                                                                       localArray_L[c]=fObjSel.options[a].text;
+                                                                       localArray_S[c]=1;
+                                                                       c++;
+                                                               }
+                                                       }
+                                               }
                                        }
+                                       if (type=="Down")       {
+                                               var tC = 0;
+                                               var tA = new Array();
+
+                                               for (a=0;a<l;a++)       {
+                                                       if (fObjSel.options[a].selected!=1)     {
+                                                                       // Add non-selected element:
+                                                               localArray_V[c]=fObjSel.options[a].value;
+                                                               localArray_L[c]=fObjSel.options[a].text;
+                                                               localArray_S[c]=0;
+                                                               c++;
+
+                                                                       // Transfer any accumulated and reset:
+                                                               if (tA.length > 0)      {
+                                                                       for (aa=0;aa<tA.length;aa++)    {
+                                                                               localArray_V[c]=fObjSel.options[tA[aa]].value;
+                                                                               localArray_L[c]=fObjSel.options[tA[aa]].text;
+                                                                               localArray_S[c]=1;
+                                                                               c++;
+                                                                       }
+
+                                                                       var tC = 0;
+                                                                       var tA = new Array();
+                                                               }
+                                                       } else {
+                                                               tA[tC] = a;
+                                                               tC++;
+                                                       }
+                                               }
+                                                       // Transfer any remaining:
+                                               if (tA.length > 0)      {
+                                                       for (aa=0;aa<tA.length;aa++)    {
+                                                               localArray_V[c]=fObjSel.options[tA[aa]].value;
+                                                               localArray_L[c]=fObjSel.options[tA[aa]].text;
+                                                               localArray_S[c]=1;
+                                                               c++;
+                                                       }
+                                               }
+                                       }
+                                       if (type=="Up") {
+                                               var tC = 0;
+                                               var tA = new Array();
+                                               var c = l-1;
+
+                                               for (a=l-1;a>=0;a--)    {
+                                                       if (fObjSel.options[a].selected!=1)     {
+
+                                                                       // Add non-selected element:
+                                                               localArray_V[c]=fObjSel.options[a].value;
+                                                               localArray_L[c]=fObjSel.options[a].text;
+                                                               localArray_S[c]=0;
+                                                               c--;
+
+                                                                       // Transfer any accumulated and reset:
+                                                               if (tA.length > 0)      {
+                                                                       for (aa=0;aa<tA.length;aa++)    {
+                                                                               localArray_V[c]=fObjSel.options[tA[aa]].value;
+                                                                               localArray_L[c]=fObjSel.options[tA[aa]].text;
+                                                                               localArray_S[c]=1;
+                                                                               c--;
+                                                                       }
+
+                                                                       var tC = 0;
+                                                                       var tA = new Array();
+                                                               }
+                                                       } else {
+                                                               tA[tC] = a;
+                                                               tC++;
+                                                       }
+                                               }
+                                                       // Transfer any remaining:
+                                               if (tA.length > 0)      {
+                                                       for (aa=0;aa<tA.length;aa++)    {
+                                                               localArray_V[c]=fObjSel.options[tA[aa]].value;
+                                                               localArray_L[c]=fObjSel.options[tA[aa]].text;
+                                                               localArray_S[c]=1;
+                                                               c--;
+                                                       }
+                                               }
+                                               c=l;    // Restore length value in "c"
+                                       }
+
+                                               // Transfer items in temporary storage to list object:
                                        fObjSel.length = c;
                                        for (a=0;a<c;a++)       {
                                                fObjSel.options[a].value = localArray_V[a];
                                                fObjSel.options[a].text = localArray_L[a];
-                                               fObjSel.options[a].selected=(a<cS)?1:0;
+                                               fObjSel.options[a].selected = localArray_S[a];
                                        }
                                        setHiddenFromList(fObjSel,formObj[fName]);
 
diff --git a/t3lib/gfx/down.gif b/t3lib/gfx/down.gif
new file mode 100644 (file)
index 0000000..19dec64
Binary files /dev/null and b/t3lib/gfx/down.gif differ
diff --git a/t3lib/gfx/group_tobottom.gif b/t3lib/gfx/group_tobottom.gif
new file mode 100644 (file)
index 0000000..00b1392
Binary files /dev/null and b/t3lib/gfx/group_tobottom.gif differ
diff --git a/t3lib/gfx/up.gif b/t3lib/gfx/up.gif
new file mode 100644 (file)
index 0000000..997142c
Binary files /dev/null and b/t3lib/gfx/up.gif differ
index 208021d..07ac6d6 100755 (executable)
@@ -109,7 +109,7 @@ class SC_alt_menu {
 
                $TBE_TEMPLATE->docType='xhtml_trans';
                $TBE_TEMPLATE->divClass='vertical-menu';
-               $TBE_TEMPLATE->bodyTagAdditions = 'onLoad="top.restoreHighlightedModuleMenuItem()"';
+               $TBE_TEMPLATE->bodyTagAdditions = 'onload="top.restoreHighlightedModuleMenuItem()"';
                $this->content.=$TBE_TEMPLATE->startPage('Vertical Backend Menu');
                $backPath = $GLOBALS['BACK_PATH'];
 
index 17d8c54..d44bf51 100755 (executable)
@@ -68,7 +68,10 @@ Do you want to continue WITHOUT saving?</label>
                        <label index="labels.selected">Selected</label>
                        <label index="labels.items">Items</label>
                        <label index="labels.remove_selected">Remove selected items</label>
-                       <label index="labels.move_to_top">Move selected item upwards</label>
+                       <label index="labels.move_to_top">Move selected items to top</label>
+                       <label index="labels.move_up">Move selected items upwards</label>
+                       <label index="labels.move_down">Move selected items downwards</label>
+                       <label index="labels.move_to_bottom">Move selected items to bottom</label>
                        <label index="labels.browse_file">Browse for files</label>
                        <label index="labels.browse_db">Browse for records</label>
                        <label index="labels.clipInsert_file">Insert %s file(s) from the clipboard</label>