listDeletedDocumentsUI.inc
3.12 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
<?php
/**
* $Id$
*
* This page holds all presentation code for displaying deleted documents management pages.
*
* Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @version $Revision$
* @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
* @package administration.documentmanagement
*/
/**
* Lists all deleted documents
*/
function renderListDeletedDocumentsPage($aDocuments) {
global $default;
$sToRender = renderHeading("Expunge Deleted Documents");
$sToRender .= "<table>";
if (count($aDocuments) > 0) {
$sToRender .= "<tr><td>" . _("The following documents have been deleted from the DMS.") . "</td></tr>\n";
$sToRender .= "<tr><td>" . _("Select the documents you would like to completely remove and click 'Expunge', or click on the document name link to restore the document.") . "</td></tr>\n";
$sToRender .= "<tr/><tr/>";
// loop through them
for ($i = 0; $i < count($aDocuments); $i++) {
$sToRender .= "\t<tr>\n";
$sToRender .= "\t\t<td bgcolor=\"" . getColour($i) . "\">\n";
$sToRender .= "<input type=\"checkbox\" name=\"fDocumentIDs[]\" value=\"" . $aDocuments[$i]->getID() . "\"/>\n";
// get an existing folder to restore the document to
$oFolder = Folder::get($aDocuments[$i]->getFolderID());
// if the folder no longer exists, use the root folder to start browsing from
$iFolderID = ($oFolder ? $aDocuments[$i]->getFolderID() : User::getUserRootFolderID());
$sToRender .= generateControllerLink("restoreDeletedDocument",
"fDocumentID=" . $aDocuments[$i]->getID() . "&fFolderID=$iFolderID",
($aDocuments[$i]->getFolderID() == $iFolderID) ? $aDocuments[$i]->getDisplayPath(true) : $aDocuments[$i]->getIcon() . $aDocuments[$i]->getName()) . "\n";
$sToRender .= "\t\t</td>\n";
$sToRender .= "\t</tr>\n";
}
$sToRender .= "<tr/><tr/>";
$sToRender .= "<tr><td><input type=\"image\" src=\"$default->graphicsUrl/widgets/expunge.gif\" border=\"0\"/></td></tr>\n";
} else {
$sToRender .= "<tr><td>" . _("There are currently no deleted documents in the system") . "</td></tr>";
$sToRender .= "<tr/><tr/>";
$sToRender .= "<tr><td><a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a></td></tr>\n";
}
$sToRender .= "</table>";
return $sToRender;
}
?>