Commit 2d3e88ba596fc217255d4358ae345a4e44ec63ed

Authored by michael
1 parent b18dc419

don't display blank categories


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1486 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
... ... @@ -68,11 +68,15 @@ function displayCategoryPathLink($aCategories) {
68 68 * @param string the category name to display
69 69 */
70 70 function displayCategoryLink($sCategoryName) {
71   - return generateLink($_SERVER["PHP_SELF"],
72   - "fBrowseType=category" .
73   - // if the category title is passed in, link back to the list of categories
74   - (($sCategoryName == "Categories") ? "" : "&fCategoryName=" . urlencode($sCategoryName)),
75   - $sCategoryName);
  71 + if ($sCategoryName != "") {
  72 + return generateLink($_SERVER["PHP_SELF"],
  73 + "fBrowseType=category" .
  74 + // if the category title is passed in, link back to the list of categories
  75 + (($sCategoryName == "Categories") ? "" : "&fCategoryName=" . urlencode($sCategoryName)),
  76 + $sCategoryName);
  77 + } else {
  78 + return false;
  79 + }
76 80 }
77 81  
78 82 function renderCategoryResults($aResults) {
... ... @@ -82,7 +86,7 @@ function renderCategoryResults($aResults) {
82 86 if ($aResults["categories"][0] == "Categories") {
83 87 // loop through categories and display them
84 88 for ($i=1; $i<count($aResults["categories"]); $i++) {
85   - $sToRender .= "<tr><td bgcolor=\"" . getColour($i) . "\">" . displayCategoryLink($aResults["categories"][$i]) . "</td></tr>";
  89 + $sToRender .= "<tr><td bgcolor=\"" . getColour($i) . "\">" . displayCategoryLink($aResults["categories"][$i]) . "</td></tr>\n";
86 90 }
87 91 } else {
88 92 // else the first entry is the category name, so display the documents in the category
... ...