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 3 require_once("../../../../config/dmsDefaults.php");
4 4 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc");
5 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 11 * $Id$
... ... @@ -24,9 +27,6 @@ require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc
24 27 // only if we have a valid session
25 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 30 $oPatternCustom = & new PatternCustom();
31 31  
32 32 if (isset($fFolderSubscriptionIDs) || isset($fDocumentSubscriptionIDs)) {
... ...
presentation/lookAndFeel/knowledgeTree/subscriptions/removeSubscriptionBL.php
... ... @@ -3,6 +3,9 @@
3 3 require_once("../../../../config/dmsDefaults.php");
4 4 require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc");
5 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 11 * $Id$
... ... @@ -29,9 +32,6 @@ require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc
29 32  
30 33 // only if we have a valid session
31 34 if (checkSession()) {
32   -
33   - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
34   - require_once("subscriptionUI.inc");
35 35  
36 36 $oPatternCustom = & new PatternCustom();
37 37  
... ...
presentation/lookAndFeel/knowledgeTree/subscriptions/subscriptionUI.inc
... ... @@ -11,15 +11,6 @@
11 11 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
12 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 16 * Displays all current subscriptions with remove checkbox
... ... @@ -32,8 +23,8 @@ function renderManagePage() {
32 23 $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions($_SESSION["userID"], SubscriptionConstants::subscriptionType("DocumentSubscription"));
33 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 28 if ($bNoSubscriptions) {
38 29 $sToRender .= "<tr><td>You are not subscribed to any documents or folders.</td></tr>\n";
39 30 } else {
... ... @@ -91,8 +82,8 @@ $sToRender .= &quot;&lt;tr/&gt;\n&quot;;
91 82 function renderMultipleRemoveConfirmationPage($aFolderSubscriptions, $aDocumentSubscriptions) {
92 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 87 $sToRender .= "<tr><td>You have chosen to delete the following subscription(s):</td></tr>\n";
97 88 $sToRender .= "<tr/>\n";
98 89 $sToRender .= "<tr/>\n";
... ... @@ -149,8 +140,8 @@ function renderRemoveConfirmationPage($oSubscription) {
149 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 145 $sToRender .= "<tr><td>You have chosen to delete the your $sContentType subscription to '$sContentName'.</td></tr>\n";
155 146 $sToRender .= "<tr/>\n";
156 147 $sToRender .= "<tr/>\n";
... ... @@ -182,8 +173,8 @@ function renderAddConfirmationPage($oSubscription) {
182 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 178 $sToRender .= "<tr><td>You have chosen to subscribe to the $sContentType entitled '$sContentName'.</td></tr>\n";
188 179 $sToRender .= "<tr/>\n";
189 180 $sToRender .= "<tr>\n";
... ... @@ -200,8 +191,8 @@ function renderAddConfirmationPage($oSubscription) {
200 191  
201 192 function renderErrorPage($sErrorMessage) {
202 193 global $default;
203   - $sToRender = "<table>\n";
204   - $sToRender .= renderHeading();
  194 + $sToRender = renderHeading("Subscriptions", "Subscriptions");
  195 + $sToRender .= "<table>\n";
205 196 $sToRender .= "<tr><td><p class=\"errorText\">$sErrorMessage</p>\n" .
206 197 "<a href=\"javascript:history.go(-1)\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\"/></a>\n" .
207 198 "</p></td></tr></table>\n";
... ...