Fixed bug #14116: Selecting/deselecting all records does not work with translated...
authorSteffen Kamper <info@sk-typo3.de>
Fri, 30 Apr 2010 10:20:51 +0000 (10:20 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Fri, 30 Apr 2010 10:20:51 +0000 (10:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7455 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_recordlist.php
typo3/class.db_list_extra.inc
typo3/class.file_list.inc

index 5ce08bb..fde538a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-30  Steffen Kamper  <info@sk-typo3.de>
+
+       * Fixed bug #14116: Selecting/deselecting all records does not work with translated records (thanks to Reinhard F├╝hricht)
+
 2010-04-29  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Fixed bug #11005: Browse Links Popup shows no files when all file types are allowed
index 54a3754..df1ab36 100644 (file)
@@ -317,33 +317,19 @@ class t3lib_recordList {
        function CBfunctions()  {
                return '
                // checkOffCB()
-       function checkOffCB(listOfCBnames)      {       //
-               var notChecked=0;
-               var total=0;
-
-                       // Checking how many is checked, how many is not
-               var pointer=0;
-               var pos = listOfCBnames.indexOf(",");
-               while (pos!=-1) {
-                       if (!cbValue(listOfCBnames.substr(pointer,pos-pointer))) notChecked++;
-                       total++;
-                       pointer=pos+1;
-                       pos = listOfCBnames.indexOf(",",pointer);
+       function checkOffCB(listOfCBnames, link)        {       //
+               var checkBoxes, flag, i;
+               var checkBoxes = listOfCBnames.split(",");
+               if (link.rel === "") {
+                       link.rel = "allChecked";
+                       flag = true;
+               } else {
+                       link.rel = "";
+                       flag = false;
                }
-               if (!cbValue(listOfCBnames.substr(pointer))) notChecked++;
-               total++;
-
-                       // Setting the status...
-               var flag = notChecked*2>total;
-               pointer=0;
-               pos = listOfCBnames.indexOf(",");
-               while (pos!=-1) {
-                       setcbValue(listOfCBnames.substr(pointer,pos-pointer),flag);
-
-                       pointer=pos+1;
-                       pos = listOfCBnames.indexOf(",",pointer);
+               for (i = 0; i < checkBoxes.length; i++) {
+                       setcbValue(checkBoxes[i], flag);
                }
-               setcbValue(listOfCBnames.substr(pointer),flag);
        }
                // cbValue()
        function cbValue(CBname)        {       //
@@ -353,7 +339,9 @@ class t3lib_recordList {
                // setcbValue()
        function setcbValue(CBname,flag)        {       //
                CBfullName = "CBC["+CBname+"]";
-               document.dblistForm[CBfullName].checked = flag ? "on" : 0;
+               if(document.dblistForm[CBfullName]) {
+                       document.dblistForm[CBfullName].checked = flag ? "on" : 0;
+               }
        }
 
                ';
index e49386b..7f7b113 100644 (file)
@@ -872,7 +872,7 @@ class localRecordList extends recordList {
                                                $cells['delete']=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('clip_deleteMarked',1).'" alt="" />',$table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'),$LANG->sL($TCA[$table]['ctrl']['title'])));
 
                                                        // The "Select all" link:
-                                               $cells['markAll']='<a href="#" onclick="'.htmlspecialchars('checkOffCB(\''.implode(',',$this->CBnames).'\'); return false;').'">'.
+                                               $cells['markAll'] = '<a class="cbcCheckAll" rel="" href="#" onclick="' . htmlspecialchars('checkOffCB(\'' . implode(',', $this->CBnames) . '\', this); return false;') . '">' .
                                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_select.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_markRecords',1).'" alt="" />'.
                                                                '</a>';
                                        } else {
index b87de89..2f56814 100644 (file)
@@ -266,8 +266,8 @@ class fileList extends t3lib_recordList {
                                if ($this->clipObj->current!='normal' && $iOut) {
                                        $cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg('','gfx/clip_copy.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_selectMarked',1).'" alt="'.$GLOBALS['LANG']->getLL('clip_selectMarked',1).'" />',$table,'setCB');
                                        $cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg('','gfx/garbage.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_deleteMarked',1).'" alt="'.$GLOBALS['LANG']->getLL('clip_deleteMarked',1).'" />',$table,'delete',$GLOBALS['LANG']->getLL('clip_deleteMarkedWarning'));
-                                       $onClick = 'checkOffCB(\''.implode(',',$this->CBnames).'\'); return false;';
-                                       $cells[]='<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
+                                       $onClick = 'checkOffCB(\'' . implode(',', $this->CBnames) . '\', this); return false;';
+                                       $cells[] = '<a class="cbcCheckAll" rel="" href="#" onclick="' . htmlspecialchars($onClick) . '">'.
                                                        '<img'.t3lib_iconWorks::skinImg('','gfx/clip_select.gif','width="12" height="12"').' title="'.$GLOBALS['LANG']->getLL('clip_markRecords',1).'" alt="'.$GLOBALS['LANG']->getLL('clip_markRecords',1).'" />'.
                                                        '</a>';
                                }