#9742:[Feature] Zebra columns for fileadmin listing (thanks to Stefano Kowalke)
authorSteffen Kamper <info@sk-typo3.de>
Thu, 27 Nov 2008 21:11:45 +0000 (21:11 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 27 Nov 2008 21:11:45 +0000 (21:11 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4494 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/class.file_list.inc
typo3/stylesheet.css
typo3/sysext/t3skin/stylesheets/typo3-file-list.css

index bcf0921..015b4a7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-11-27  Steffen Kamper  <info@sk-typo3.de>
 
+       * #9742:[Feature] Zebra columns for fileadmin listing (thanks to Stefano Kowalke)
+
+2008-11-27  Steffen Kamper  <info@sk-typo3.de>
+
        * #9822: New rendering method for content elements (lesser markup, cleaner code) (thanks to Susanne Moog)
 
 2008-11-27  Steffen Kamper  <info@sk-typo3.de>
index 0b4e502..8221e8e 100755 (executable)
@@ -93,6 +93,7 @@ class fileList extends t3lib_recordList {
        var $files = Array();
        var $path = '';
        var $eCounter=0;                                        // Counting the elements no matter what...
+       var $dirCounter = 0;
        var $totalItems='';
 
        var $CBnames=array();
@@ -237,7 +238,6 @@ class fileList extends t3lib_recordList {
                                // half line is drawn
                        $theData = Array();
                        $theData[$titleCol] = '';
-                       $iOut.=$this->addelement(0,'',$theData);
                }
 
 
@@ -284,7 +284,7 @@ class fileList extends t3lib_recordList {
                <!--
                        File list table:
                -->
-                       <table border="0" cellpadding="0" cellspacing="0" id="typo3-filelist">
+                       <table border="0" cellpadding="0" cellspacing="1" id="typo3-filelist">
                                '.$out.'
                        </table>';
        }
@@ -312,7 +312,7 @@ class fileList extends t3lib_recordList {
        function formatDirList($items)  {
                $out='';
 
-                       // Files:
+               // Folders:
                if (count($items['sorting']))   {
                        reset($items['sorting']);
                        while (list($key,) = each($items['sorting']))   {
@@ -335,13 +335,13 @@ class fileList extends t3lib_recordList {
                                        while(list(,$field)=each($this->fieldArray))    {
                                                switch($field)  {
                                                        case 'size':
-       //                                                      $theData[$field]=t3lib_div::formatSize($theFile[$field]);
+                                                               $theData[$field]=t3lib_div::formatSize($theFile[$field]);
                                                        break;
                                                        case 'rw':
                                                                $theData[$field]= (($theFile['readable'])?'':'<span class="typo3-red"><b>R</b></span>').(($theFile['writable'])?'':'<span class="typo3-red"><b>W</b></span>');
                                                        break;
                                                        case 'fileext':
-       //                                                      $theData[$field]=strtoupper($theFile['fileext']);
+                                                               $theData[$field]=strtoupper($theFile['fileext']);
                                                        break;
                                                        case 'tstamp':
                                                                $theData[$field]=Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $theFile['tstamp']);
@@ -360,9 +360,12 @@ class fileList extends t3lib_recordList {
                                                        break;
                                                }
                                        }
-                                       $out.=$this->addelement(1,$theIcon,$theData);
+                                       $altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor6' : 'bgColor4') . '"';
+
+                                       $out .= $this->addelement(1, $theIcon, $theData, $altRows);
                                }
                                $this->eCounter++;
+                               $this->dirCounter = $this->eCounter;
                        }
                }
                return $out;
@@ -497,7 +500,13 @@ class fileList extends t3lib_recordList {
                                                        break;
                                                }
                                        }
-                                       $out.= $this->addelement(1,$theIcon,$theData);
+                                       if ($this->dirCounter % 2 == 0) {
+                                               $altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor6' : 'bgColor4') . '"';
+                                       } else {
+                                               $altRows = 'class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '"';
+                                       }
+
+                                       $out .= $this->addelement(1, $theIcon, $theData, $altRows);
 
                                                // Thumbsnails?
                                        if ($this->thumbs && $this->isImage($theFile['fileext']))       {
index c37e66c..16607a1 100755 (executable)
@@ -1993,7 +1993,7 @@ table#typo3-filelist tr td {
        padding: 3px;
 }
 
-table#typo3-filelist tr td.c-headLine {
+table#typo3-filelist tr.c-headLine td {
        background-color: #ccc;
        font-weight: bold;
        height: 16px;
index 78f412a..37e8013 100644 (file)
@@ -11,7 +11,6 @@ Description : Overwrites default styles for the File->Filelist module.
 - - - - - - - - - - - - - - - - - - - - - */
 
 table#typo3-filelist {
-       border:1px solid #A2AAB8;
        margin-top:10px;
 }
 
@@ -19,43 +18,13 @@ table#typo3-filelist-top tr {
        vertical-align: bottom;
 }
 
-table#typo3-filelist tr td.c-headLine {
-       background-color:#B8BEC9;
-       background-image:url(../icons/gfx/alt_menu_mainitem_bg.gif);
-       background-repeat:repeat-x;
-}
-
-table#typo3-filelist tr td.c-headLine a {
-       color:#FFFFFF;
-}
-
-
-table#typo3-filelist tr td img {
-       text-align: center;
-}
-
-table#typo3-filelist tr td div.typo3-clipCtrl {
-       background-color:transparent;
-}
-/* - - - - - - - - - - - - - - - - - - - - -
-
-Title  : TYPO3 File->Filelist Styles
-Author : Jeff Segars <jeff@webempoweredchurch.org
-URL    : http://typo3.org
-
-Description : Overwrites default styles for the File->Filelist module.
-
-       $Id$
-
-- - - - - - - - - - - - - - - - - - - - - */
-
-table#typo3-filelist {
-       border:1px solid #A2AAB8;
-       margin-top:10px;
+table#typo3-filelist tr.c-headLine {
+       background-color: #A2AAB8;
+       font-weight: bold;      
 }
 
-table#typo3-filelist-top tr {
-       vertical-align: bottom;
+table#typo3-filelist tr.c-headLine td a {
+       color: #fff;
 }
 
 table#typo3-filelist tr td.c-headLine {
@@ -65,14 +34,13 @@ table#typo3-filelist tr td.c-headLine {
 }
 
 table#typo3-filelist tr td.c-headLine a {
-       color:#FFFFFF;
+       color:#fff;
 }
 
-
 table#typo3-filelist tr td img {
        text-align: center;
 }
 
 table#typo3-filelist tr td div.typo3-clipCtrl {
        background-color:transparent;
-}
\ No newline at end of file
+}