browseUI.inc
3.2 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
<?php
require_once("$default->owl_fs_root/presentation/Html.inc");
/**
* $Id$
*
* Document browsing page html UI building functions.
*
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* @version $Revision$
* @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
* @package presentation.documentmanagement
*/
function browseTypeSelect($sBrowseType) {
return "View documents by: <input type=\"radio\" name=\"fBrowseType\" value=\"folder\"" .
((($sBrowseType=="folder") || (strlen($sBrowseType)==0)) ? "checked" : "") . "> Folders" .
"<input type=\"radio\" name=\"fBrowseType\" value=\"category\"" .
(($sBrowseType=="category") ? "checked" : "") . "> Category" .
"<input type=\"radio\" name=\"fBrowseType\" value=\"documentType\"" .
(($sBrowseType=="documentType") ? "checked" : "") . "> Document Type";
}
function displayFolderPathLink($aPathArray) {
// display a separate link to each folder in the path
for ($i=0; $i<count($aPathArray); $i++) {
// retrieve the folder id for this folder name
$iFolderID = Folder::getFolderID($aPathArray[$i]);
// generate a link back to this page setting fFolderID
$sLink = generateLink($_SERVER["PHP_SELF"],
"fBrowseType=folder&fFolderID=$iFolderID",
$aPathArray[$i]);
$sPathLinks = (strlen($sPathLinks) > 0) ? $sPathLinks . " > " . $sLink : $sLink;
}
return $sPathLinks;
}
function displayFolderLink($oFolder) {
global $default;
$sFolderIconPath = generateImage($default->owl_graphics_url . "/widgets/dfolder.gif");
return generateLink($_SERVER["PHP_SELF"],
"fBrowseType=folder&fFolderID=" . $oFolder->getID(),
$sFolderIconPath .
$oFolder->getName());
}
function displayCategoryPathLink($sCategoryName) {
return "Categories > " . displayCategoryLink($sCategoryName);
}
function displayCategoryLink($sCategoryName) {
return generateLink($_SERVER["PHP_SELF"],
"fBrowseType=category&fCategoryName=$sCategoryName",
$sCategoryName);
}
function displayDocumentTypeLink($aDocumentType) {
return generateLink($_SERVER["PHP_SELF"],
"fBrowseType=documentType&fDocumentTypeID=" . $aDocumentType["id"],
$aDocumentType["name"]);
}
function displayDocumentTypePathLink($aDocumentType) {
return "Document Types > " . displayDocumentTypeLink($aDocumentType);
}
function displayDocumentLink($oDocument, $bDisplayFullPath = false) {
global $default;
$sIconPath = generateImage($oDocument->getMimeTypeIconUrl());
return generateLink("$default->owl_ui_url/documentmanagement/documentViewBL.php",
"fDocumentID=" . $oDocument->getID(),
($sIconPath ? $sIconPath : "") .
($bDisplayFullPath ? implode(" > ", $oDocument->getDocumentPathAsArray($oDocument->getID())) : $oDocument->getName()));
}
?>