Fixed bug #8418: visual problems of BE[accessListRenderMode] (thanx to Steffen Kamper)
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Wed, 28 May 2008 10:35:04 +0000 (10:35 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Wed, 28 May 2008 10:35:04 +0000 (10:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3729 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
typo3/sysext/lang/locallang_core.xml
typo3/sysext/t3skin/stylesheets/typo3-TCEforms.css

index d94c9c9..b27e0de 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+
+2008-05-18  Martin Kutschker  <masi@typo3.org>
+
+       * Fixed bug #8418: visual problems of BE[accessListRenderMode] (thanx to Steffen Kamper)
+
 2008-05-28  Benjamin Mack  <benni@typo3.org>
 
        * Fixed bug #8494: Admin Tools => DB Check => Find Filename has duplicate selectboxes
index 00339d1..e7d42b2 100755 (executable)
@@ -1646,7 +1646,7 @@ class t3lib_TCEforms      {
 
                        // Get values in an array (and make unique, which is fine because there can be no duplicates anyway):
                $itemArray = array_flip($this->extractValuesOnlyFromValueLabelList($PA['itemFormElValue']));
-
+               
                $disabled = '';
                if($this->renderReadonly || $config['readOnly'])  {
                        $disabled = ' disabled="disabled"';
@@ -1663,18 +1663,22 @@ class t3lib_TCEforms    {
                                if (!strcmp($p[1],'--div--'))   {
                                        if (count($setAll))     {
                                                        $tRows[] = '
-                                                               <tr>
-                                                                       <td colspan="2">'.
-                                                                       '<a href="#" onclick="'.htmlspecialchars(implode('',$setAll).' return false;').'">'.
-                                                                       htmlspecialchars($this->getLL('l_setAllCheckboxes')).
-                                                                       '</a></td>
+                                                               <tr class="c-header-checkbox-controls">
+                                                                       <td colspan="3">' .
+                                                                               '<a href="#" onclick="' . htmlspecialchars(implode('', $setAll).' return false;') . '">' .
+                                                                               htmlspecialchars($this->getLL('l_checkAll')) .
+                                                                               '</a>  
+                                                                               <a href="#" onclick="' . htmlspecialchars(implode('', $unSetAll).' return false;').'">' .
+                                                                               htmlspecialchars($this->getLL('l_uncheckAll')) .
+                                                                               '</a>
+                                                                       </td>
                                                                </tr>';
                                                        $setAll = array();
                                        }
 
                                        $tRows[] = '
                                                <tr class="c-header">
-                                                       <td colspan="2">'.htmlspecialchars($p[0]).'</td>
+                                                       <td colspan="3">'.htmlspecialchars($p[0]).'</td>
                                                </tr>';
                                } else {
                                                // Selected or not by default:
@@ -1691,17 +1695,39 @@ class t3lib_TCEforms    {
                                        }
 
                                                // Compile row:
-                                       $onClickCell = $this->elName($PA['itemFormElName'].'['.$c.']').'.checked=!'.$this->elName($PA['itemFormElName'].'['.$c.']').'.checked;';
-                                       $onClick = 'this.attributes.getNamedItem("class").nodeValue = '.$this->elName($PA['itemFormElName'].'['.$c.']').'.checked ? "c-selectedItem" : "";';
-                                       $setAll[] = $this->elName($PA['itemFormElName'].'['.$c.']').'.checked=1;';
+                                       $rowId = uniqid('select_checkbox_row_');
+                                       $onClickCell = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=!' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked;';
+                                       $onClick = 'this.attributes.getNamedItem("class").nodeValue = ' . $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked ? "c-selectedItem" : "c-unselectedItem";';
+                                       $setAll[] = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=1;';
+                                       $setAll[] .= '$(\'' . $rowId . '\').removeClassName(\'c-unselectedItem\');$(\'' . $rowId . '\').addClassName(\'c-selectedItem\');';
+                                       $unSetAll[] = $this->elName($PA['itemFormElName'].'['.$c.']').'.checked=0;';
+                                       $unSetAll[] .= '$(\'' . $rowId . '\').removeClassName(\'c-selectedItem\');$(\'' . $rowId . '\').addClassName(\'c-unselectedItem\');';
+                                       $restoreCmd[] = $this->elName($PA['itemFormElName'] . '[' . $c . ']') . '.checked=' . ($sM ? 1 : 0) . ';' .
+                                                               '$(\'' . $rowId . '\').removeClassName(\'c-selectedItem\');$(\'' . $rowId . '\').removeClassName(\'c-unselectedItem\');' .
+                                                               '$(\'' . $rowId . '\').addClassName(\'c-' . ($sM ? '' : 'un') . 'selectedItem\');';
+                                       
+                                       $hasHelp = ($p[3] !='');
+                                       
+                                       $label = t3lib_div::deHSCentities(htmlspecialchars($p[0]));
+                                       $help = $hasHelp ? '<span class="typo3-csh-inline show-right"><span class="header">' . $label . '</span>' . 
+                                               '<span class="paragraph">' . $GLOBALS['LANG']->hscAndCharConv(nl2br(trim(htmlspecialchars($p[3]))), false) . '</span></span>' : '';
+                                       
+                                       if ($hasHelp && $this->edit_showFieldHelp == 'icon') {
+                                               $helpIcon  = '<a class="typo3-csh-link" href="#">';
+                                               $helpIcon .= '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/helpbubble.gif', 'width="14" height="14"');
+                                               $helpIcon .= ' hspace="2" border="0" class="absmiddle"' . ($GLOBALS['CLIENT']['FORMSTYLE'] ? ' style="cursor:help;"' : '') . ' alt="" />' . $help;
+                                               $helpIcon .= '</a>';
+                                               $help = $helpIcon;
+                                       }
+
                                        $tRows[] = '
-                                               <tr class="'.($sM ? 'c-selectedItem' : '').'" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
-                                                       <td><input type="checkbox"'.$this->insertDefStyle('check').' name="'.htmlspecialchars($PA['itemFormElName'].'['.$c.']').'" value="'.htmlspecialchars($p[1]).'"'.$sM.' onclick="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].' /></td>
+                                               <tr id="' . $rowId . '" class="'.($sM ? 'c-selectedItem' : 'c-unselectedItem').'" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
+                                                       <td width="12"><input type="checkbox"'.$this->insertDefStyle('check').' name="'.htmlspecialchars($PA['itemFormElName'].'['.$c.']').'" value="'.htmlspecialchars($p[1]).'"'.$sM.' onclick="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].' /></td>
                                                        <td class="c-labelCell" onclick="'.htmlspecialchars($onClickCell).'">'.
                                                                ($selIconFile ? '<img src="'.$selIconFile.'" '.$selIconInfo[3].' vspace="2" border="0" class="absmiddle" style="margin-right: 4px;" alt="" />' : '').
-                                                               t3lib_div::deHSCentities(htmlspecialchars($p[0])).
-                                                               (strcmp($p[3],'') ? '<br/><p class="c-descr">'.nl2br(trim(htmlspecialchars($p[3]))).'</p>' : '').
+                                                               $label .
                                                                '</td>
+                                                               <td class="c-descr" onclick="'.htmlspecialchars($onClickCell).'">' . (strcmp($p[3],'') ? $help : '') . '</td>
                                                </tr>';
                                        $c++;
                                }
@@ -1710,11 +1736,15 @@ class t3lib_TCEforms    {
                                // Remaining checkboxes will get their set-all link:
                        if (count($setAll))     {
                                        $tRows[] = '
-                                               <tr>
-                                                       <td colspan="2">'.
-                                                       '<a href="#" onclick="'.htmlspecialchars(implode('',$setAll).' return false;').'">'.
-                                                       htmlspecialchars($this->getLL('l_setAllCheckboxes')).
-                                                       '</a></td>
+                                               <tr class="c-header-checkbox-controls">
+                                                       <td colspan="3">'.
+                                                               '<a href="#" onclick="' . htmlspecialchars(implode('', $setAll).' return false;') . '">' .
+                                                               htmlspecialchars($this->getLL('l_checkAll')) .
+                                                               '</a>  
+                                                               <a href="#" onclick="' . htmlspecialchars(implode('', $unSetAll).' return false;') . '">' .
+                                                               htmlspecialchars($this->getLL('l_uncheckAll')) .
+                                                               '</a>
+                                                       </td>
                                                </tr>';
                        }
                }
@@ -1728,17 +1758,23 @@ class t3lib_TCEforms    {
                                                        <td><input type="checkbox"'.$this->insertDefStyle('check').' name="'.htmlspecialchars($PA['itemFormElName'].'['.$c.']').'" value="'.htmlspecialchars($theNoMatchValue).'" checked="checked" onclick="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].$disabled.' /></td>
                                                        <td class="c-labelCell">'.
                                                                t3lib_div::deHSCentities(htmlspecialchars(@sprintf($nMV_label, $theNoMatchValue))).
-                                                               '</td>
+                                                               '</td><td>&nbsp;</td>
                                                </tr>');
                                $c++;
                        }
                }
 
                        // Add an empty hidden field which will send a blank value if all items are unselected.
-               $item.='<input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']).'" value="" />';
+               $item .= '<input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']) . '" value="" />';
 
+                       // Add revert icon
+               if (is_array($restoreCmd)) {
+                       $item .= '<a href="#" onclick="' . implode('', $restoreCmd).' return false;' . '">' .
+                               '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/undo.gif','width="13" height="12"') . ' title="' . 
+                               htmlspecialchars($this->getLL('l_revertSelection')) . '" alt="" />' .'</a>';
+               }
                        // Implode rows in table:
-               $item.= '
+               $item .= '
                        <table border="0" cellpadding="0" cellspacing="0" class="typo3-TCEforms-select-checkbox">'.
                                implode('',$tRows).'
                        </table>
@@ -1847,7 +1883,7 @@ class t3lib_TCEforms      {
                                        </td>
                                        <td valign="top">
                                        <a href="#" onclick="'.htmlspecialchars($this->elName($PA['itemFormElName'].'[]').'.selectedIndex=-1;'.implode('',$restoreCmd).' return false;').'">'.
-                                               '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/history.gif','width="13" height="12"').' title="'.htmlspecialchars($this->getLL('l_revertSelection')).'" alt="" />'.
+                                               '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/undo.gif','width="13" height="12"').' title="'.htmlspecialchars($this->getLL('l_revertSelection')).'" alt="" />'.
                                                '</a>
                                        </td>
                                </tr>
index 7af1b5b..c086929 100755 (executable)
@@ -85,6 +85,8 @@ Do you want to continue WITHOUT saving?</label>
                        <label index="labels.holdDownCTRL">Important: Hold down the CTRL key while toggling elements in this list!</label>
                        <label index="labels.revertSelection">Revert selection</label>
                        <label index="labels.setAllCheckboxes">Select All Checkboxes</label>
+                       <label index="labels.checkAll">Check all</label>
+                       <label index="labels.uncheckAll">Uncheck all</label>
                        <label index="labels.changeInOrig">Changed in original translation</label>
                        <label index="labels.expandAll">Expand all</label>
                        <label index="labels.new_section">Create new:</label>
index a50227f..bf449bb 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * typo3-TCEforms.css
  */
 
@@ -49,6 +49,45 @@ table.typo3-TCEforms span.typo3-TCEforms-helpText {
 }
 
 
+table.typo3-TCEforms-select-checkbox  {
+       width: 98%;
+       border: 1px solid #aaa;
+       background-color; #efeff4;
+       
+}
+
+table.typo3-TCEforms-select-checkbox tr {
+       background-color; #efeff4;
+}
+
+table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-selectedItem {
+    background-color:#d7dbe2;
+}
+table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-unselectedItem {
+    background-color:#efeff4;
+}
+
+table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header-checkbox-controls td {
+    background-color: #B8BEC9;
+    text-align: right;
+    padding-right: 16px;
+}
+
+table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header-checkbox-controls td a {
+    padding-left: 16px;
+    color: white;
+}
+
+table.typo3-TCEforms table.typo3-TCEforms-select-checkbox tr.c-header td {
+    background-color:#fff;
+    padding-left: 4px;
+    border-bottom:1px solid #999999;
+}
+
+table.typo3-TCEforms table.typo3-TCEforms-select-checkbox td.c-descr img {
+       float:right;
+}
+
 /* Default. Always used on main-palettes in the bottom of the forms */
 TABLE.typo3-TCEforms .class-main1,
 TABLE.typo3-TCEforms .class-main11,
@@ -57,7 +96,7 @@ TABLE.typo3-TCEforms .class-main31,
 TABLE.typo3-TCEforms .class-main41,
 TABLE.typo3-TCEforms .class-main51 {
        background: #EFEFF4;
-}
+       }
 
 TABLE.typo3-TCEforms .class-main1 td,
 TABLE.typo3-TCEforms .class-main11 td,
@@ -66,7 +105,7 @@ TABLE.typo3-TCEforms .class-main31 td,
 TABLE.typo3-TCEforms .class-main41 td,
 TABLE.typo3-TCEforms .class-main51 td {
        padding: 2px 0px 2px 0px;
-}
+       }
 
 TABLE.typo3-TCEforms .class-main2 td,
 TABLE.typo3-TCEforms .class-main12 td,
@@ -76,7 +115,7 @@ TABLE.typo3-TCEforms .class-main42 td,
 TABLE.typo3-TCEforms .class-main52 td {
        padding: 2px 0px 2px 0px;
        color: #FFFFFF;
-}
+       }
 
 TABLE.typo3-TCEforms .class-main2,
 TABLE.typo3-TCEforms .class-main12,
@@ -109,7 +148,7 @@ TABLE.typo3-TCEforms .class-main33,
 TABLE.typo3-TCEforms .class-main43,
 TABLE.typo3-TCEforms .class-main53 {
        padding: 2px 0px 2px 0px;
-}
+       }
 
 TABLE.typo3-TCEforms .class-main4,
 TABLE.typo3-TCEforms .class-main14,
@@ -118,7 +157,7 @@ TABLE.typo3-TCEforms .class-main34,
 TABLE.typo3-TCEforms .class-main44,
 TABLE.typo3-TCEforms .class-main54 {
        color: #FFFFFF;
-}
+       }
 
 TABLE.typo3-TCEforms .class-main5,
 TABLE.typo3-TCEforms .class-main15,
@@ -127,7 +166,7 @@ TABLE.typo3-TCEforms .class-main35,
 TABLE.typo3-TCEforms .class-main45,
 TABLE.typo3-TCEforms .class-main55 {
        color: #3C3C44;
-}
+       }
 
 TABLE.typo3-TCEforms .formField,
 TABLE.typo3-TCEforms .formField1,
@@ -136,7 +175,7 @@ TABLE.typo3-TCEforms .formField3,
 TABLE.typo3-TCEforms .formField4,
 TABLE.typo3-TCEforms .formField5 {
        margin: 4px 2px 4px 2px;
-}
+       }
 
 TABLE.typo3-TCEforms .wrapperTable,
 TABLE.typo3-TCEforms .wrapperTable1,
@@ -146,7 +185,7 @@ TABLE.typo3-TCEforms .wrapperTable4,
 TABLE.typo3-TCEforms .wrapperTable5 {
        border: 1px solid #A2AAB8;
        margin: 0 0 5px 0;
-}
+       }
 
 TABLE.typo3-TCEforms TABLE.wrapperAttention .wrapperTable,
 TABLE.typo3-TCEforms TABLE.wrapperAttention .wrapperTable1,
@@ -155,7 +194,7 @@ TABLE.typo3-TCEforms TABLE.wrapperAttention .wrapperTable3,
 TABLE.typo3-TCEforms TABLE.wrapperAttention .wrapperTable4,
 TABLE.typo3-TCEforms TABLE.wrapperAttention .wrapperTable5 {
        border: 1px solid #A30904;
-}
+       }
 
 
 TABLE.typo3-TCEforms td.icons {