subscriptionUI.inc
3.27 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
80
81
82
83
84
<?php
/**
* $Id$
*
* UI for subscription pages.
*
* 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.subscriptions
*/
/**
* Confirms the users subscription deletion
*
* @param object the subscription
*/
function renderSubscriptionRemoveConfirmationPage($oSubscription) {
global $default;
$sContentType = $oSubscription->getSubscriptionTypeName();
if ($sContentType == "folder") {
$sContentName = Folder::getFolderName($oSubscription->getExternalID());
$sContentUrl = "fFolderID=" . $oSubscription->getExternalID();
} else {
$sContentName = Document::getDocumentName($oSubscription->getExternalID());
$sContentUrl = "fDocumentID=" . $oSubscription->getExternalID();
}
$sToRender = "<table>\n";
$sToRender .= "<td>You have chosen to delete the your $sContentType subscription to '$sContentName'.</td>\n";
$sToRender .= "<tr/>\n";
$sToRender .= "<tr/>\n";
$sToRender .= "<td>Select 'Unsubscribe' to confirm the deletion, or 'Cancel' to cancel it</td>\n";
$sToRender .= "</tr>\n";
$sToRender .= "<tr/>\n";
$sToRender .= "<tr><td><a href=\"$default->rootUrl/control.php?action=removeSubscription&$sContentUrl&fConfirmed=1\"><img src =\"$default->graphicsUrl/widgets/unsubscribe.gif\" border=\"0\"/></a>\n";
$sToRender .= "<a href=\"" . $oSubscription->getContentUrl() . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td>\n";
$sToRender .= "</tr>\n";
$sToRender .= "</table>\n";
return $sToRender;
}
/**
* Confirms the users subscription addition
*
* @param object the subscription
*/
function renderSubscriptionAddConfirmationPage($oSubscription) {
global $default;
$sContentType = $oSubscription->getSubscriptionTypeName();
if ($sContentType == "folder") {
$sContentName = Folder::getFolderName($oSubscription->getExternalID());
$sContentUrl = "fFolderID=" . $oSubscription->getExternalID();
} else {
$sContentName = Document::getDocumentName($oSubscription->getExternalID());
$sContentUrl = "fDocumentID=" . $oSubscription->getExternalID();
}
$sToRender = "<table>\n";
$sToRender .= "<td>You have chosen to subscribe to the $sContentType entitled '$sContentName'.</td>\n";
$sToRender .= "<tr/>\n";
$sToRender .= "<tr>\n";
$sToRender .= "<td>Select 'Subscribe' to confirm the subscription, or 'Cancel' to cancel it</td>\n";
$sToRender .= "</tr>\n";
$sToRender .= "<tr/>\n";
$sToRender .= "<tr><td><a href=\"$default->rootUrl/control.php?action=addSubscription&$sContentUrl&fConfirmed=1\"><img src =\"$default->graphicsUrl/widgets/subscribe.gif\" border=\"0\"/></a>\n";
$sToRender .= "<a href=\"" . $oSubscription->getContentUrl() . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a></td>\n";
$sToRender .= "</tr>\n";
$sToRender .= "</table>\n";
return $sToRender;
}
function renderErrorPage($sErrorMessage) {
global $default;
return "<p class=\"errorText\">$sErrorMessage</p>\n" .
"<a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n";
}
?>