browseUI.inc
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
require_once("$default->owl_fs_root/presentation/Html.inc");
require_once("$default->owl_ui_directory/foldermanagement/folderUI.inc");
require_once("$default->owl_ui_directory/documentmanagement/documentUI.inc");
/**
* $Id$
*
* Document browsing page html UI building functions.
*
* Licensed under the GNU GPL. For full terms see the file DOCS/COPYING.
*
* @version $Revision$
* @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
* @package presentation.lookAndFeel.knowledgeTree.documentmanagement
*/
/**
* Generates radio button selects for document browse by type
* Javascript refreshes the form when it changes
*
* @param string the selected browse by option
*/
function browseTypeSelect($sBrowseType) {
return "<span class=\"browseTypeSelect\">\n
\tView documents by: <input type=\"radio\" name=\"fBrowseType\" onChange=\"document.forms[0].submit()\" value=\"folder\"" .
((($sBrowseType=="folder") || (strlen($sBrowseType)==0)) ? "checked" : "") . "> Folders\n" .
"<input type=\"radio\" name=\"fBrowseType\" onChange=\"document.forms[0].submit()\" value=\"category\"" .
(($sBrowseType=="category") ? "checked" : "") . "> Category\n" .
"<input type=\"radio\" name=\"fBrowseType\" onChange=\"document.forms[0].submit()\" value=\"documentType\"" .
(($sBrowseType=="documentType") ? "checked" : "") . "> Document Type\n</span>";
}
/**
* Displays the passed category path as a link
*
* @param string the category name to display
*/
function displayCategoryPathLink($sCategoryName) {
return displayCategoryLink("Categories") . " > " . displayCategoryLink($sCategoryName);
}
/**
* Displays the passed category as a link
*
* @param string the category name to display
*/
function displayCategoryLink($sCategoryName) {
return generateLink($_SERVER["PHP_SELF"],
"fBrowseType=category" .
// if the category title is passed in, link back to the list of categories
(($sCategoryName == "Categories") ? "" : "&fCategoryName=$sCategoryName"),
$sCategoryName);
}
/**
* Displays the passed document type path as a link
*
* @param string the document type to display
*/
function displayDocumentTypePathLink($aDocumentType) {
return displayDocumentTypeLink(array("name"=>"Document Types")) . " > " . displayDocumentTypeLink($aDocumentType);
}
/**
* Displays the passed document type as a link
*
* @param string the document type to display
*/
function displayDocumentTypeLink($aDocumentType) {
return generateLink($_SERVER["PHP_SELF"],
"fBrowseType=documentType" .
// if the document type title is passed in, link back to the list of document types
(($aDocumentType["name"] == "Document Types") ? "" : "&fDocumentTypeID=" . $aDocumentType["id"]),
$aDocumentType["name"]);
}
?>