Commit f2ff454888d97b74531a28fed03c2814d0e06836

Authored by kevin_fourie
1 parent f94d28b3

Merged in...

KTS-3813
"Breadcrumb of "Manage External RSS Feeds" page is not translatable"
Fixed. Removed the domain from _kt() so the plugin would use the default knowledgetree domain.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.4-Release-Branch@9583 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/rssplugin/manageRSSFeeds.php
@@ -7,31 +7,31 @@ @@ -7,31 +7,31 @@
7 * Document Management Made Simple 7 * Document Management Made Simple
8 * Copyright (C) 2008 KnowledgeTree Inc. 8 * Copyright (C) 2008 KnowledgeTree Inc.
9 * Portions copyright The Jam Warehouse Software (Pty) Limited 9 * Portions copyright The Jam Warehouse Software (Pty) Limited
10 - * 10 + *
11 * This program is free software; you can redistribute it and/or modify it under 11 * This program is free software; you can redistribute it and/or modify it under
12 * the terms of the GNU General Public License version 3 as published by the 12 * the terms of the GNU General Public License version 3 as published by the
13 * Free Software Foundation. 13 * Free Software Foundation.
14 - * 14 + *
15 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * details. 18 * details.
19 - * 19 + *
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 - *  
23 - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, 22 + *
  23 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
24 * California 94120-7775, or email info@knowledgetree.com. 24 * California 94120-7775, or email info@knowledgetree.com.
25 - * 25 + *
26 * The interactive user interfaces in modified source and object code versions 26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under 27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU General Public License version 3. 28 * Section 5 of the GNU General Public License version 3.
29 - * 29 + *
30 * In accordance with Section 7(b) of the GNU General Public License version 3, 30 * In accordance with Section 7(b) of the GNU General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by 31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 32 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
34 - * must display the words "Powered by KnowledgeTree" and retain the original 34 + * must display the words "Powered by KnowledgeTree" and retain the original
35 * copyright notice. 35 * copyright notice.
36 * Contributor( s): ______________________________________ 36 * Contributor( s): ______________________________________
37 * 37 *
@@ -45,12 +45,12 @@ require_once(KT_LIB_DIR . &quot;/templating/kt3template.inc.php&quot;); @@ -45,12 +45,12 @@ require_once(KT_LIB_DIR . &quot;/templating/kt3template.inc.php&quot;);
45 require_once(KT_DIR. '/plugins/rssplugin/KTrss.inc.php'); 45 require_once(KT_DIR. '/plugins/rssplugin/KTrss.inc.php');
46 46
47 class ManageRSSFeedsDispatcher extends KTStandardDispatcher { 47 class ManageRSSFeedsDispatcher extends KTStandardDispatcher {
48 - 48 +
49 function do_main() { 49 function do_main() {
50 // This line adds your page to the breadcrumbs list at the top 50 // This line adds your page to the breadcrumbs list at the top
51 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Manage External RSS Feeds','rssplugin')); 51 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Manage External RSS Feeds'));
52 $iUId = $this->oUser->getId(); 52 $iUId = $this->oUser->getId();
53 - 53 +
54 $oTemplating =& KTTemplating::getSingleton(); 54 $oTemplating =& KTTemplating::getSingleton();
55 $oTemplate = $oTemplating->loadTemplate('RSSPlugin/managerssfeeds'); 55 $oTemplate = $oTemplating->loadTemplate('RSSPlugin/managerssfeeds');
56 56
@@ -64,29 +64,29 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher { @@ -64,29 +64,29 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher {
64 64
65 return $oTemplate->render($aTemplateData); 65 return $oTemplate->render($aTemplateData);
66 } 66 }
67 - 67 +
68 // Delete feed function 68 // Delete feed function
69 function do_deleteFeed(){ 69 function do_deleteFeed(){
70 $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id'); 70 $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id');
71 - 71 +
72 $res = KTrss::deleteFeed($iFeedId); 72 $res = KTrss::deleteFeed($iFeedId);
73 -  
74 - if (PEAR::isError($res)) {  
75 - $this->errorRedirectToMain(sprintf(_kt('Unable to delete item: %s','rssplugin'), $res->getMessage())); 73 +
  74 + if (PEAR::isError($res)) {
  75 + $this->errorRedirectToMain(sprintf(_kt('Unable to delete item: %s'), $res->getMessage()));
76 } 76 }
77 else{ 77 else{
78 - $this->successRedirectToMain(sprintf(_kt('RSS feed deleted','rssplugin'))); 78 + $this->successRedirectToMain(sprintf(_kt('RSS feed deleted')));
79 } 79 }
80 } 80 }
81 - 81 +
82 // Edit feed function 82 // Edit feed function
83 - function do_editFeed(){ 83 + function do_editFeed(){
84 $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id'); 84 $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id');
85 - 85 +
86 $add_fields = array(); 86 $add_fields = array();
87 - $add_fields[] = new KTStringWidget(_kt('Title','rssplugin'),_kt('The title of the RSS feed','rssplugin'), 'title', KTrss::getExternalFeedTitle($iFeedId), $this->oPage, true, null, null);  
88 - $add_fields[] = new KTStringWidget(_kt('URL','rssplugin'),_kt('The url of the RSS feed','rssplugin'), 'url', KTrss::getExternalFeedUrl($iFeedId), $this->oPage, false, null, null);  
89 - 87 + $add_fields[] = new KTStringWidget(_kt('Title'),_kt('The title of the RSS feed'), 'title', KTrss::getExternalFeedTitle($iFeedId), $this->oPage, true, null, null);
  88 + $add_fields[] = new KTStringWidget(_kt('URL'),_kt('The url of the RSS feed'), 'url', KTrss::getExternalFeedUrl($iFeedId), $this->oPage, false, null, null);
  89 +
90 $oTemplating =& KTTemplating::getSingleton(); 90 $oTemplating =& KTTemplating::getSingleton();
91 $oTemplate = $oTemplating->loadTemplate("RSSPlugin/editfeed"); 91 $oTemplate = $oTemplating->loadTemplate("RSSPlugin/editfeed");
92 $aTemplateData = array( 92 $aTemplateData = array(
@@ -95,45 +95,45 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher { @@ -95,45 +95,45 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher {
95 "feed_id" => $iFeedId, 95 "feed_id" => $iFeedId,
96 ); 96 );
97 return $oTemplate->render($aTemplateData); 97 return $oTemplate->render($aTemplateData);
98 - 98 +
99 } 99 }
100 - 100 +
101 // Update feed function on post 101 // Update feed function on post
102 - function do_updateFeed(){  
103 - $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id');  
104 - 102 + function do_updateFeed(){
  103 + $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id');
  104 +
105 $aErrorOptions = array( 105 $aErrorOptions = array(
106 'redirect_to' => array('editFeed', sprintf('feed_id=%s', $iFeedId)) 106 'redirect_to' => array('editFeed', sprintf('feed_id=%s', $iFeedId))
107 ); 107 );
108 - 108 +
109 $sTitle = $this->oValidator->validateString( 109 $sTitle = $this->oValidator->validateString(
110 KTUtil::arrayGet($_REQUEST, 'title'), 110 KTUtil::arrayGet($_REQUEST, 'title'),
111 - KTUtil::meldOptions($aErrorOptions, array('message' => _kt("You must provide a title",'rssplugin'))) 111 + KTUtil::meldOptions($aErrorOptions, array('message' => _kt("You must provide a title")))
112 ); 112 );
113 - 113 +
114 $sUrl =KTUtil::arrayGet($_REQUEST, 'url'); 114 $sUrl =KTUtil::arrayGet($_REQUEST, 'url');
115 - 115 +
116 $res = KTrss::updateFeed($iFeedId, $sTitle, $sUrl); 116 $res = KTrss::updateFeed($iFeedId, $sTitle, $sUrl);
117 117
118 - if (PEAR::isError($res)) {  
119 - $this->errorRedirectToMain(sprintf(_kt('Unable to delete item: %s','rssplugin'), $res->getMessage())); 118 + if (PEAR::isError($res)) {
  119 + $this->errorRedirectToMain(sprintf(_kt('Unable to delete item: %s'), $res->getMessage()));
120 } 120 }
121 else{ 121 else{
122 - $this->successRedirectToMain(sprintf(_kt('Updated news item.','rssplugin'))); 122 + $this->successRedirectToMain(sprintf(_kt('Updated news item.')));
123 } 123 }
124 } 124 }
125 - 125 +
126 // Add feed function 126 // Add feed function
127 function do_addFeed(){ 127 function do_addFeed(){
128 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Manage RSS Feeds'));  
129 - $this->oPage->setBreadcrumbDetails(_kt("Create a new RSS feed",'rssplugin'));  
130 - $this->oPage->setTitle(_kt("Create a link to a new RSS feed",'rssplugin'));  
131 - 128 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Manage RSS Feeds'));
  129 + $this->oPage->setBreadcrumbDetails(_kt("Create a new RSS feed"));
  130 + $this->oPage->setTitle(_kt("Create a link to a new RSS feed"));
  131 +
132 $add_fields = array(); 132 $add_fields = array();
133 - $add_fields[] = new KTStringWidget(_kt('Title','rssplugin'),_kt('The title of rss feed','rssplugin'), 'title', null, $this->oPage, true, null, null);  
134 -  
135 - $add_fields[] = new KTStringWidget(_kt('URL','rssplugin'),_kt('The url to the rss feed','rssplugin'), 'url', null, $this->oPage, false, null, null);  
136 - 133 + $add_fields[] = new KTStringWidget(_kt('Title'),_kt('The title of rss feed'), 'title', null, $this->oPage, true, null, null);
  134 +
  135 + $add_fields[] = new KTStringWidget(_kt('URL'),_kt('The url to the rss feed'), 'url', null, $this->oPage, false, null, null);
  136 +
137 $oTemplating =& KTTemplating::getSingleton(); 137 $oTemplating =& KTTemplating::getSingleton();
138 $oTemplate = $oTemplating->loadTemplate("RSSPlugin/addfeed"); 138 $oTemplate = $oTemplating->loadTemplate("RSSPlugin/addfeed");
139 $aTemplateData = array( 139 $aTemplateData = array(
@@ -141,24 +141,24 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher { @@ -141,24 +141,24 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher {
141 "add_fields" => $add_fields, 141 "add_fields" => $add_fields,
142 ); 142 );
143 return $oTemplate->render($aTemplateData); 143 return $oTemplate->render($aTemplateData);
144 - 144 +
145 } 145 }
146 - 146 +
147 // Create feed on post 147 // Create feed on post
148 function do_createFeed() { 148 function do_createFeed() {
149 $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id'); 149 $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id');
150 // use the validator object 150 // use the validator object
151 - $aErrorOptions = array('redirect_to' => array('addFeed'), 'message' => _kt('You must specify a title for the rss feed.','newsdashletplugin')); 151 + $aErrorOptions = array('redirect_to' => array('addFeed'), 'message' => _kt('You must specify a title for the rss feed.'));
152 $sTitle = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'title'), $aErrorOptions); 152 $sTitle = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'title'), $aErrorOptions);
153 - 153 +
154 $sUrl = KTUtil::arrayGet($_REQUEST, 'url'); 154 $sUrl = KTUtil::arrayGet($_REQUEST, 'url');
155 $res = KTrss::createFeed($sTitle, $sUrl, $this->oUser->getId()); 155 $res = KTrss::createFeed($sTitle, $sUrl, $this->oUser->getId());
156 -  
157 - if (PEAR::isError($res)) {  
158 - $this->errorRedirectToMain(sprintf(_kt('Unable to create feed: %s','rssplugin'), $res->getMessage())); 156 +
  157 + if (PEAR::isError($res)) {
  158 + $this->errorRedirectToMain(sprintf(_kt('Unable to create feed: %s'), $res->getMessage()));
159 } 159 }
160 else{ 160 else{
161 - $this->successRedirectToMain(sprintf(_kt('Created new rss feed: %s','rssplugin'), KTrss::getExternalFeedTitle($res))); 161 + $this->successRedirectToMain(sprintf(_kt('Created new rss feed: %s'), KTrss::getExternalFeedTitle($res)));
162 } 162 }
163 } 163 }
164 } 164 }