Commit 6d861768c952c9d2971ad2aa38d82192e442f5b2
1 parent
f7308cbe
added optional template browsing support
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2764 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
6 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| @@ -192,7 +192,7 @@ function renderDocumentTypeResults($aResults) { | @@ -192,7 +192,7 @@ function renderDocumentTypeResults($aResults) { | ||
| 192 | * | 192 | * |
| 193 | * @param array the browse result objects | 193 | * @param array the browse result objects |
| 194 | */ | 194 | */ |
| 195 | -function renderFolderResults($aResults) { | 195 | +function renderFolderResults($aResults, $bTemplateBrowsing = false) { |
| 196 | global $default, $browse_no_sub_folders, $browse_no_documents, $browse_no_document_permission; | 196 | global $default, $browse_no_sub_folders, $browse_no_documents, $browse_no_document_permission; |
| 197 | $sToRender = ""; | 197 | $sToRender = ""; |
| 198 | 198 | ||
| @@ -220,7 +220,7 @@ function renderFolderResults($aResults) { | @@ -220,7 +220,7 @@ function renderFolderResults($aResults) { | ||
| 220 | $sToRender .= "<tr><td colspan=\"5\">" . $browse_no_sub_folders . "</td></tr>"; | 220 | $sToRender .= "<tr><td colspan=\"5\">" . $browse_no_sub_folders . "</td></tr>"; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | - $sToRender .= "<tr><td>" . renderDocumentList($aResults, $browse_no_documents, $browse_no_document_permission) . "</td></tr>\n"; | 223 | + $sToRender .= "<tr><td>" . renderDocumentList($aResults, $browse_no_documents, $browse_no_document_permission, false, $bTemplateBrowsing) . "</td></tr>\n"; |
| 224 | 224 | ||
| 225 | return $sToRender; | 225 | return $sToRender; |
| 226 | } | 226 | } |
| @@ -277,7 +277,7 @@ function renderSortHeadings($sSortBy, $sSortDirection) { | @@ -277,7 +277,7 @@ function renderSortHeadings($sSortBy, $sSortDirection) { | ||
| 277 | * @param string the message to display if the current user doesn't have permission to view the documents | 277 | * @param string the message to display if the current user doesn't have permission to view the documents |
| 278 | * @param boolean whether to display the complete path to the document or not | 278 | * @param boolean whether to display the complete path to the document or not |
| 279 | */ | 279 | */ |
| 280 | -function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { | 280 | +function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false, $bTemplateBrowsing = false) { |
| 281 | global $default; | 281 | global $default; |
| 282 | 282 | ||
| 283 | $iFolderCount = count($aResults["folders"]) - 1; | 283 | $iFolderCount = count($aResults["folders"]) - 1; |
| @@ -286,7 +286,8 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | @@ -286,7 +286,8 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | ||
| 286 | for ($i=0; $i<count($aResults["documents"]); $i++) { | 286 | for ($i=0; $i<count($aResults["documents"]); $i++) { |
| 287 | // in order for candy striping to work we need to take the number of folders | 287 | // in order for candy striping to work we need to take the number of folders |
| 288 | // into account when alternating | 288 | // into account when alternating |
| 289 | - $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td valign=\"bottom\">" . displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath) . "</td>"; | 289 | + $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td valign=\"bottom\">" . ($bTemplateBrowsing ? displayDocumentLinkForTemplateBrowsing($aResults["documents"][$i], $bDisplayFullPath) : displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath)) . "</td>"; |
| 290 | + | ||
| 290 | $sToRender .= "<td valign=\"bottom\">" . $aResults["documents"][$i]->getFileName() . "</td>"; | 291 | $sToRender .= "<td valign=\"bottom\">" . $aResults["documents"][$i]->getFileName() . "</td>"; |
| 291 | $oCreator = User::get($aResults["documents"][$i]->getCreatorID()); | 292 | $oCreator = User::get($aResults["documents"][$i]->getCreatorID()); |
| 292 | $sToRender .= "<td valign=\"bottom\">" . ($oCreator ? $oCreator->getName() : "") . "</td>"; | 293 | $sToRender .= "<td valign=\"bottom\">" . ($oCreator ? $oCreator->getName() : "") . "</td>"; |
| @@ -314,7 +315,8 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | @@ -314,7 +315,8 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | ||
| 314 | * @param string the field to sort the results by | 315 | * @param string the field to sort the results by |
| 315 | * @param string the direction to sort | 316 | * @param string the direction to sort |
| 316 | */ | 317 | */ |
| 317 | -function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { | 318 | + |
| 319 | +function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection, $bTemplateBrowsing = false) { | ||
| 318 | global $default, $browse_collection_heading; | 320 | global $default, $browse_collection_heading; |
| 319 | 321 | ||
| 320 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | 322 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); |
| @@ -340,7 +342,7 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { | @@ -340,7 +342,7 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { | ||
| 340 | $sToRender .= renderSortHeadings($sSortBy, $sSortDirection); | 342 | $sToRender .= renderSortHeadings($sSortBy, $sSortDirection); |
| 341 | $sToRender .= "<tr><td>\n"; | 343 | $sToRender .= "<tr><td>\n"; |
| 342 | switch ($sBrowseType) { | 344 | switch ($sBrowseType) { |
| 343 | - case "folder" : $sToRender .= renderFolderResults($aResults, $sSortBy, $sSortDirection); break; | 345 | + case "folder" : $sToRender .= renderFolderResults($aResults, $sSortBy, $sSortDirection, $bTemplateBrowsing); break; |
| 344 | case "category" : $sToRender .= renderCategoryResults($aResults); break; | 346 | case "category" : $sToRender .= renderCategoryResults($aResults); break; |
| 345 | case "documentType" : $sToRender .= renderDocumentTypeResults($aResults); break; | 347 | case "documentType" : $sToRender .= renderDocumentTypeResults($aResults); break; |
| 346 | } | 348 | } |