From 114fc15c00ce52914f2eb574ca7a4f1c29310c6c Mon Sep 17 00:00:00 2001 From: Steffen Kamper Date: Fri, 30 Apr 2010 10:20:51 +0000 Subject: [PATCH] =?utf8?q?Fixed=20bug=20#14116:=20Selecting/deselecting=20?= =?utf8?q?all=20records=20does=20not=20work=20with=20translated=20records?= =?utf8?q?=20(thanks=20to=20Reinhard=20F=C3=BChricht)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7455 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ t3lib/class.t3lib_recordlist.php | 40 +++++++++++--------------------- typo3/class.db_list_extra.inc | 2 +- typo3/class.file_list.inc | 4 ++-- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ce08bbf7f59..fde538a086d6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-04-30 Steffen Kamper + + * Fixed bug #14116: Selecting/deselecting all records does not work with translated records (thanks to Reinhard Führicht) + 2010-04-29 Jeff Segars * Fixed bug #11005: Browse Links Popup shows no files when all file types are allowed diff --git a/t3lib/class.t3lib_recordlist.php b/t3lib/class.t3lib_recordlist.php index 54a375403ac2..df1ab360afb9 100644 --- a/t3lib/class.t3lib_recordlist.php +++ b/t3lib/class.t3lib_recordlist.php @@ -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; + } } '; diff --git a/typo3/class.db_list_extra.inc b/typo3/class.db_list_extra.inc index e49386b695bb..7f7b1136fdbe 100644 --- a/typo3/class.db_list_extra.inc +++ b/typo3/class.db_list_extra.inc @@ -872,7 +872,7 @@ class localRecordList extends recordList { $cells['delete']=$this->linkClipboardHeaderIcon('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']=''. + $cells['markAll'] = '' . 'backPath,'gfx/clip_select.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_markRecords',1).'" alt="" />'. ''; } else { diff --git a/typo3/class.file_list.inc b/typo3/class.file_list.inc index b87de89c3ca7..2f56814f899c 100644 --- a/typo3/class.file_list.inc +++ b/typo3/class.file_list.inc @@ -266,8 +266,8 @@ class fileList extends t3lib_recordList { if ($this->clipObj->current!='normal' && $iOut) { $cells[]=$this->linkClipboardHeaderIcon('',$table,'setCB'); $cells[]=$this->linkClipboardHeaderIcon('',$table,'delete',$GLOBALS['LANG']->getLL('clip_deleteMarkedWarning')); - $onClick = 'checkOffCB(\''.implode(',',$this->CBnames).'\'); return false;'; - $cells[]=''. + $onClick = 'checkOffCB(\'' . implode(',', $this->CBnames) . '\', this); return false;'; + $cells[] = ''. ''. ''; } -- 2.20.1