Commit 971153ca586e7350036d03d2b0aabee49f3bbb98
1 parent
2b80144d
added message if there are no folders or documents
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1343 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
13 additions
and
5 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| @@ -130,9 +130,13 @@ function renderFolderResults($aResults) { | @@ -130,9 +130,13 @@ function renderFolderResults($aResults) { | ||
| 130 | global $default; | 130 | global $default; |
| 131 | $sToRender = ""; | 131 | $sToRender = ""; |
| 132 | // now loop through the rest of the folders and display links | 132 | // now loop through the rest of the folders and display links |
| 133 | - for ($i=1; $i<count($aResults["folders"]); $i++) { | ||
| 134 | - $sRow = displayFolderLink($aResults["folders"][$i]); | ||
| 135 | - $sToRender .= "<tr><td nowrap width=\"100%\" bgcolor=\"" . getColour($i) . "\">" . $sRow . "</td></tr>\n"; | 133 | + if (count($aResults["folders"]) > 1) { |
| 134 | + for ($i=1; $i<count($aResults["folders"]); $i++) { | ||
| 135 | + $sRow = displayFolderLink($aResults["folders"][$i]); | ||
| 136 | + $sToRender .= "<tr><td nowrap width=\"100%\" bgcolor=\"" . getColour($i) . "\">" . $sRow . "</td></tr>\n"; | ||
| 137 | + } | ||
| 138 | + } else { | ||
| 139 | + $sToRender .= "<tr><td>This folder contains no sub folders</td></tr>"; | ||
| 136 | } | 140 | } |
| 137 | 141 | ||
| 138 | $sToRender .= "<tr><td> </td></tr>"; | 142 | $sToRender .= "<tr><td> </td></tr>"; |
| @@ -143,8 +147,12 @@ function renderFolderResults($aResults) { | @@ -143,8 +147,12 @@ function renderFolderResults($aResults) { | ||
| 143 | 147 | ||
| 144 | function renderDocumentList($aDocuments, $bDisplayFullPath = false) { | 148 | function renderDocumentList($aDocuments, $bDisplayFullPath = false) { |
| 145 | // loop through the files and display links | 149 | // loop through the files and display links |
| 146 | - for ($i=0; $i<count($aDocuments); $i++) { | ||
| 147 | - $sToRender .= "<tr><td bgcolor=\"" . getColour($i) . "\">" . displayDocumentLink($aDocuments[$i], $bDisplayFullPath) . "</td></tr>"; | 150 | + if (count($aDocuments) > 0) { |
| 151 | + for ($i=0; $i<count($aDocuments); $i++) { | ||
| 152 | + $sToRender .= "<tr><td bgcolor=\"" . getColour($i) . "\">" . displayDocumentLink($aDocuments[$i], $bDisplayFullPath) . "</td></tr>"; | ||
| 153 | + } | ||
| 154 | + } else { | ||
| 155 | + $sToRender .= "<tr><td>This folder contains no documents</td></tr>"; | ||
| 148 | } | 156 | } |
| 149 | return $sToRender; | 157 | return $sToRender; |
| 150 | } | 158 | } |