Commit 80be4aa66eec687d4e0c46ad29723f9d781e922c
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
Showing
1 changed file
with
35 additions
and
17 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | require_once("$default->owl_fs_root/presentation/Html.inc"); | 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 | * $Id$ | 8 | * $Id$ |
| 7 | * | 9 | * |
| 8 | * Document browsing page html UI building functions. | 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 | * @version $Revision$ | 14 | * @version $Revision$ |
| 13 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 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 +32,48 @@ function browseTypeSelect($sBrowseType) { | ||
| 30 | (($sBrowseType=="documentType") ? "checked" : "") . "> Document Type\n</span>"; | 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 | function displayCategoryPathLink($sCategoryName) { | 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 | function displayCategoryLink($sCategoryName) { | 49 | function displayCategoryLink($sCategoryName) { |
| 38 | return generateLink($_SERVER["PHP_SELF"], | 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 | $sCategoryName); | 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 | function displayDocumentTypeLink($aDocumentType) { | 71 | function displayDocumentTypeLink($aDocumentType) { |
| 44 | return generateLink($_SERVER["PHP_SELF"], | 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 | $aDocumentType["name"]); | 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 | ?> |