Commit 00253e4954f12ac0894d466ec8096ce9b3de357a
1 parent
a7532035
fixed candy striping
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1888 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| ... | ... | @@ -190,14 +190,15 @@ function renderDocumentTypeResults($aResults) { |
| 190 | 190 | function renderFolderResults($aResults) { |
| 191 | 191 | global $default; |
| 192 | 192 | $sToRender = ""; |
| 193 | - | |
| 193 | + | |
| 194 | 194 | // now loop through the rest of the folders and display links |
| 195 | 195 | if (count($aResults["folders"]) > 1) { |
| 196 | 196 | for ($i=1; $i<count($aResults["folders"]); $i++) { |
| 197 | 197 | $sFolderLink = displayFolderLink($aResults["folders"][$i]); |
| 198 | 198 | $oCreator = User::get($aResults["folders"][$i]->getCreatorID()); |
| 199 | 199 | |
| 200 | - $sToRender .= "<tr bgcolor=\"" . getColour($i) . "\">"; | |
| 200 | + // the first element of the array contains the current folder name | |
| 201 | + $sToRender .= "<tr bgcolor=\"" . getColour($i-1) . "\">"; | |
| 201 | 202 | // folder name |
| 202 | 203 | $sToRender .= "<td>" . $sFolderLink . "</td>"; |
| 203 | 204 | // blank filename (??: folder description?) |
| ... | ... | @@ -272,11 +273,13 @@ function renderSortHeadings($sSortBy, $sSortDirection) { |
| 272 | 273 | * @param boolean whether to display the complete path to the document or not |
| 273 | 274 | */ |
| 274 | 275 | function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { |
| 276 | + $iFolderCount = count($aResults["folders"]) - 1; | |
| 275 | 277 | // loop through the files and display links |
| 276 | 278 | if (count($aResults["documents"]) > 0) { |
| 277 | 279 | for ($i=0; $i<count($aResults["documents"]); $i++) { |
| 278 | - $sToRender .= "<tr bgcolor=\"" . getColour($i) . "\" width=\"100%\"><td>" . displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath) . "</td>"; | |
| 279 | - //$sToRender .= "<tr>"; | |
| 280 | + // in order for candy striping to work we need to take the number of folders | |
| 281 | + // into account when alternating | |
| 282 | + $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td>" . displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath) . "</td>"; | |
| 280 | 283 | $sToRender .= "<td>" . $aResults["documents"][$i]->getFileName() . "</td>"; |
| 281 | 284 | $oCreator = User::get($aResults["documents"][$i]->getCreatorID()); |
| 282 | 285 | $sToRender .= "<td>" . $oCreator->getName() . "</td>"; | ... | ... |