Commit a68aba7955b13be702bf8eefaf79dd2923cf6c2a

Authored by Michael Joseph
1 parent a80ca265

renderHeading refactoring


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1958 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/subscriptions/manageSubscriptionsBL.php
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 require_once("../../../../config/dmsDefaults.php"); 3 require_once("../../../../config/dmsDefaults.php");
4 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc"); 4 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc");
5 require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc"); 5 require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc");
  6 +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
  7 +require_once("subscriptionUI.inc");
  8 +require_once("$default->fileSystemRoot/presentation/Html.inc");
6 9
7 /** 10 /**
8 * $Id$ 11 * $Id$
@@ -24,9 +27,6 @@ require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc @@ -24,9 +27,6 @@ require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc
24 // only if we have a valid session 27 // only if we have a valid session
25 if (checkSession()) { 28 if (checkSession()) {
26 29
27 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
28 - require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc");  
29 - require_once("subscriptionUI.inc");  
30 $oPatternCustom = & new PatternCustom(); 30 $oPatternCustom = & new PatternCustom();
31 31
32 if (isset($fFolderSubscriptionIDs) || isset($fDocumentSubscriptionIDs)) { 32 if (isset($fFolderSubscriptionIDs) || isset($fDocumentSubscriptionIDs)) {
presentation/lookAndFeel/knowledgeTree/subscriptions/removeSubscriptionBL.php
@@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
3 require_once("../../../../config/dmsDefaults.php"); 3 require_once("../../../../config/dmsDefaults.php");
4 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc"); 4 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc");
5 require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc"); 5 require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc");
  6 +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
  7 +require_once("subscriptionUI.inc");
  8 +require_once("$default->fileSystemRoot/presentation/Html.inc");
6 9
7 /** 10 /**
8 * $Id$ 11 * $Id$
@@ -29,9 +32,6 @@ require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc @@ -29,9 +32,6 @@ require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc
29 32
30 // only if we have a valid session 33 // only if we have a valid session
31 if (checkSession()) { 34 if (checkSession()) {
32 -  
33 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");  
34 - require_once("subscriptionUI.inc");  
35 35
36 $oPatternCustom = & new PatternCustom(); 36 $oPatternCustom = & new PatternCustom();
37 37
presentation/lookAndFeel/knowledgeTree/subscriptions/subscriptionUI.inc
@@ -11,15 +11,6 @@ @@ -11,15 +11,6 @@
11 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 11 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
12 * @package presentation.lookAndFeel.knowledgeTree.subscriptions 12 * @package presentation.lookAndFeel.knowledgeTree.subscriptions
13 */ 13 */
14 -  
15 -/*function renderHeading() {  
16 - global $default;  
17 - $sColor = $default->siteMap->getSectionColour("Subscriptions", "th");  
18 - $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">Subscriptions</font></th></tr>\n";  
19 - $sToRender .= "<tr/>\n";  
20 - $sToRender .= "<tr/>\n";  
21 - return $sToRender;  
22 -}*/  
23 14
24 /** 15 /**
25 * Displays all current subscriptions with remove checkbox 16 * Displays all current subscriptions with remove checkbox
@@ -32,8 +23,8 @@ function renderManagePage() { @@ -32,8 +23,8 @@ function renderManagePage() {
32 $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions($_SESSION["userID"], SubscriptionConstants::subscriptionType("DocumentSubscription")); 23 $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions($_SESSION["userID"], SubscriptionConstants::subscriptionType("DocumentSubscription"));
33 $bNoSubscriptions = ( (count($aFolderSubscriptions) == 0) && (count($aDocumentSubscriptions) == 0) ) ? true : false; 24 $bNoSubscriptions = ( (count($aFolderSubscriptions) == 0) && (count($aDocumentSubscriptions) == 0) ) ? true : false;
34 25
35 - $sToRender = "<table width=\"600\">\n";  
36 - $sToRender .= renderHeading("Subscriptions"); 26 + $sToRender = renderHeading("Subscriptions", "Subscriptions");
  27 + $sToRender .= "<table width=\"600\">\n";
37 if ($bNoSubscriptions) { 28 if ($bNoSubscriptions) {
38 $sToRender .= "<tr><td>You are not subscribed to any documents or folders.</td></tr>\n"; 29 $sToRender .= "<tr><td>You are not subscribed to any documents or folders.</td></tr>\n";
39 } else { 30 } else {
@@ -91,8 +82,8 @@ $sToRender .= &quot;&lt;tr/&gt;\n&quot;; @@ -91,8 +82,8 @@ $sToRender .= &quot;&lt;tr/&gt;\n&quot;;
91 function renderMultipleRemoveConfirmationPage($aFolderSubscriptions, $aDocumentSubscriptions) { 82 function renderMultipleRemoveConfirmationPage($aFolderSubscriptions, $aDocumentSubscriptions) {
92 global $default; 83 global $default;
93 84
94 - $sToRender = "<table width=\"600\">\n";  
95 - $sToRender .= renderHeading(); 85 + $sToRender = renderHeading("Subscriptions", "Subscriptions");
  86 + $sToRender .= "<table width=\"600\">\n";
96 $sToRender .= "<tr><td>You have chosen to delete the following subscription(s):</td></tr>\n"; 87 $sToRender .= "<tr><td>You have chosen to delete the following subscription(s):</td></tr>\n";
97 $sToRender .= "<tr/>\n"; 88 $sToRender .= "<tr/>\n";
98 $sToRender .= "<tr/>\n"; 89 $sToRender .= "<tr/>\n";
@@ -149,8 +140,8 @@ function renderRemoveConfirmationPage($oSubscription) { @@ -149,8 +140,8 @@ function renderRemoveConfirmationPage($oSubscription) {
149 $sContentUrl = "fDocumentID=" . $oSubscription->getExternalID(); 140 $sContentUrl = "fDocumentID=" . $oSubscription->getExternalID();
150 } 141 }
151 142
152 - $sToRender = "<table width=\"600\">\n";  
153 - $sToRender .= renderHeading(); 143 + $sToRender = renderHeading("Subscriptions", "Subscriptions");
  144 + $sToRender .= "<table width=\"600\">\n";
154 $sToRender .= "<tr><td>You have chosen to delete the your $sContentType subscription to '$sContentName'.</td></tr>\n"; 145 $sToRender .= "<tr><td>You have chosen to delete the your $sContentType subscription to '$sContentName'.</td></tr>\n";
155 $sToRender .= "<tr/>\n"; 146 $sToRender .= "<tr/>\n";
156 $sToRender .= "<tr/>\n"; 147 $sToRender .= "<tr/>\n";
@@ -182,8 +173,8 @@ function renderAddConfirmationPage($oSubscription) { @@ -182,8 +173,8 @@ function renderAddConfirmationPage($oSubscription) {
182 $sContentUrl = "fDocumentID=" . $oSubscription->getExternalID(); 173 $sContentUrl = "fDocumentID=" . $oSubscription->getExternalID();
183 } 174 }
184 175
185 - $sToRender = "<table width=\"600\">\n";  
186 - $sToRender .= renderHeading(); 176 + $sToRender = renderHeading("Subscriptions", "Subscriptions");
  177 + $sToRender .= "<table width=\"600\">\n";
187 $sToRender .= "<tr><td>You have chosen to subscribe to the $sContentType entitled '$sContentName'.</td></tr>\n"; 178 $sToRender .= "<tr><td>You have chosen to subscribe to the $sContentType entitled '$sContentName'.</td></tr>\n";
188 $sToRender .= "<tr/>\n"; 179 $sToRender .= "<tr/>\n";
189 $sToRender .= "<tr>\n"; 180 $sToRender .= "<tr>\n";
@@ -200,8 +191,8 @@ function renderAddConfirmationPage($oSubscription) { @@ -200,8 +191,8 @@ function renderAddConfirmationPage($oSubscription) {
200 191
201 function renderErrorPage($sErrorMessage) { 192 function renderErrorPage($sErrorMessage) {
202 global $default; 193 global $default;
203 - $sToRender = "<table>\n";  
204 - $sToRender .= renderHeading(); 194 + $sToRender = renderHeading("Subscriptions", "Subscriptions");
  195 + $sToRender .= "<table>\n";
205 $sToRender .= "<tr><td><p class=\"errorText\">$sErrorMessage</p>\n" . 196 $sToRender .= "<tr><td><p class=\"errorText\">$sErrorMessage</p>\n" .
206 "<a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n" . 197 "<a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n" .
207 "</p></td></tr></table>\n"; 198 "</p></td></tr></table>\n";