Commit 80be4aa66eec687d4e0c46ad29723f9d781e922c

Authored by michael
1 parent ec5c0e51

updated category and document type path displaying functions


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@533 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
1 1 <?php
2 2  
3 3 require_once("$default->owl_fs_root/presentation/Html.inc");
  4 +require_once("$default->owl_ui_directory/foldermanagement/folderUI.inc");
  5 +require_once("$default->owl_ui_directory/documentmanagement/documentUI.inc");
4 6  
5 7 /**
6 8 * $Id$
7 9 *
8 10 * Document browsing page html UI building functions.
9 11 *
10   - * Licensed under the GNU GPL. For full terms see the file COPYING.
  12 + * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING.
11 13 *
12 14 * @version $Revision$
13 15 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
14   - * @package presentation.documentmanagement
  16 + * @package presentation.lookAndFeel.knowledgeTree.documentmanagement
15 17 */
16 18  
17 19 /**
... ... @@ -30,32 +32,48 @@ function browseTypeSelect($sBrowseType) {
30 32 (($sBrowseType=="documentType") ? "checked" : "") . "> Document Type\n</span>";
31 33 }
32 34  
  35 +/**
  36 + * Displays the passed category path as a link
  37 + *
  38 + * @param string the category name to display
  39 + */
33 40 function displayCategoryPathLink($sCategoryName) {
34   - return "<span class=\"browseTypeSelect\">Categories</span> > " . displayCategoryLink($sCategoryName);
  41 + return displayCategoryLink("Categories") . " > " . displayCategoryLink($sCategoryName);
35 42 }
36 43  
  44 +/**
  45 + * Displays the passed category as a link
  46 + *
  47 + * @param string the category name to display
  48 + */
37 49 function displayCategoryLink($sCategoryName) {
38 50 return generateLink($_SERVER["PHP_SELF"],
39   - "fBrowseType=category&fCategoryName=$sCategoryName",
  51 + "fBrowseType=category" .
  52 + // if the category title is passed in, link back to the list of categories
  53 + (($sCategoryName == "Categories") ? "" : "&fCategoryName=$sCategoryName"),
40 54 $sCategoryName);
41 55 }
42 56  
  57 +/**
  58 + * Displays the passed document type path as a link
  59 + *
  60 + * @param string the document type to display
  61 + */
  62 +function displayDocumentTypePathLink($aDocumentType) {
  63 + return displayDocumentTypeLink(array("name"=>"Document Types")) . " > " . displayDocumentTypeLink($aDocumentType);
  64 +}
  65 +
  66 +/**
  67 + * Displays the passed document type as a link
  68 + *
  69 + * @param string the document type to display
  70 + */
43 71 function displayDocumentTypeLink($aDocumentType) {
44 72 return generateLink($_SERVER["PHP_SELF"],
45   - "fBrowseType=documentType&fDocumentTypeID=" . $aDocumentType["id"],
  73 + "fBrowseType=documentType" .
  74 + // if the document type title is passed in, link back to the list of document types
  75 + (($aDocumentType["name"] == "Document Types") ? "" : "&fDocumentTypeID=" . $aDocumentType["id"]),
46 76 $aDocumentType["name"]);
47 77 }
48 78  
49   -function displayDocumentTypePathLink($aDocumentType) {
50   - return "<span class=\"browseTypeSelect\">Document Types</span> > " . displayDocumentTypeLink($aDocumentType);
51   -}
52   -
53   -function displayDocumentLink($oDocument, $bDisplayFullPath = false) {
54   - global $default;
55   - $sIconPath = generateImage($oDocument->getMimeTypeIconUrl());
56   - return generateLink("$default->owl_root_url/control.php?action=viewDocument",
57   - "fDocumentID=" . $oDocument->getID(),
58   - ($sIconPath ? $sIconPath : "") .
59   - ($bDisplayFullPath ? implode(" > ", $oDocument->getDocumentPathAsArray($oDocument->getID())) : $oDocument->getName()));
60   -}
61 79 ?>
... ...