Commit f2ff454888d97b74531a28fed03c2814d0e06836
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
Showing
1 changed file
with
53 additions
and
53 deletions
plugins/rssplugin/manageRSSFeeds.php
| ... | ... | @@ -7,31 +7,31 @@ |
| 7 | 7 | * Document Management Made Simple |
| 8 | 8 | * Copyright (C) 2008 KnowledgeTree Inc. |
| 9 | 9 | * Portions copyright The Jam Warehouse Software (Pty) Limited |
| 10 | - * | |
| 10 | + * | |
| 11 | 11 | * This program is free software; you can redistribute it and/or modify it under |
| 12 | 12 | * the terms of the GNU General Public License version 3 as published by the |
| 13 | 13 | * Free Software Foundation. |
| 14 | - * | |
| 14 | + * | |
| 15 | 15 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 16 | 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 17 | 17 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 18 | 18 | * details. |
| 19 | - * | |
| 19 | + * | |
| 20 | 20 | * You should have received a copy of the GNU General Public License |
| 21 | 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 | 24 | * California 94120-7775, or email info@knowledgetree.com. |
| 25 | - * | |
| 25 | + * | |
| 26 | 26 | * The interactive user interfaces in modified source and object code versions |
| 27 | 27 | * of this program must display Appropriate Legal Notices, as required under |
| 28 | 28 | * Section 5 of the GNU General Public License version 3. |
| 29 | - * | |
| 29 | + * | |
| 30 | 30 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 31 | 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 | 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 | 35 | * copyright notice. |
| 36 | 36 | * Contributor( s): ______________________________________ |
| 37 | 37 | * |
| ... | ... | @@ -45,12 +45,12 @@ require_once(KT_LIB_DIR . "/templating/kt3template.inc.php"); |
| 45 | 45 | require_once(KT_DIR. '/plugins/rssplugin/KTrss.inc.php'); |
| 46 | 46 | |
| 47 | 47 | class ManageRSSFeedsDispatcher extends KTStandardDispatcher { |
| 48 | - | |
| 48 | + | |
| 49 | 49 | function do_main() { |
| 50 | 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 | 52 | $iUId = $this->oUser->getId(); |
| 53 | - | |
| 53 | + | |
| 54 | 54 | $oTemplating =& KTTemplating::getSingleton(); |
| 55 | 55 | $oTemplate = $oTemplating->loadTemplate('RSSPlugin/managerssfeeds'); |
| 56 | 56 | |
| ... | ... | @@ -64,29 +64,29 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher { |
| 64 | 64 | |
| 65 | 65 | return $oTemplate->render($aTemplateData); |
| 66 | 66 | } |
| 67 | - | |
| 67 | + | |
| 68 | 68 | // Delete feed function |
| 69 | 69 | function do_deleteFeed(){ |
| 70 | 70 | $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id'); |
| 71 | - | |
| 71 | + | |
| 72 | 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 | 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 | 82 | // Edit feed function |
| 83 | - function do_editFeed(){ | |
| 83 | + function do_editFeed(){ | |
| 84 | 84 | $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id'); |
| 85 | - | |
| 85 | + | |
| 86 | 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 | 90 | $oTemplating =& KTTemplating::getSingleton(); |
| 91 | 91 | $oTemplate = $oTemplating->loadTemplate("RSSPlugin/editfeed"); |
| 92 | 92 | $aTemplateData = array( |
| ... | ... | @@ -95,45 +95,45 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher { |
| 95 | 95 | "feed_id" => $iFeedId, |
| 96 | 96 | ); |
| 97 | 97 | return $oTemplate->render($aTemplateData); |
| 98 | - | |
| 98 | + | |
| 99 | 99 | } |
| 100 | - | |
| 100 | + | |
| 101 | 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 | 105 | $aErrorOptions = array( |
| 106 | 106 | 'redirect_to' => array('editFeed', sprintf('feed_id=%s', $iFeedId)) |
| 107 | 107 | ); |
| 108 | - | |
| 108 | + | |
| 109 | 109 | $sTitle = $this->oValidator->validateString( |
| 110 | 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 | 114 | $sUrl =KTUtil::arrayGet($_REQUEST, 'url'); |
| 115 | - | |
| 115 | + | |
| 116 | 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 | 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 | 126 | // Add feed function |
| 127 | 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 | 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 | 137 | $oTemplating =& KTTemplating::getSingleton(); |
| 138 | 138 | $oTemplate = $oTemplating->loadTemplate("RSSPlugin/addfeed"); |
| 139 | 139 | $aTemplateData = array( |
| ... | ... | @@ -141,24 +141,24 @@ class ManageRSSFeedsDispatcher extends KTStandardDispatcher { |
| 141 | 141 | "add_fields" => $add_fields, |
| 142 | 142 | ); |
| 143 | 143 | return $oTemplate->render($aTemplateData); |
| 144 | - | |
| 144 | + | |
| 145 | 145 | } |
| 146 | - | |
| 146 | + | |
| 147 | 147 | // Create feed on post |
| 148 | 148 | function do_createFeed() { |
| 149 | 149 | $iFeedId = KTUtil::arrayGet($_REQUEST, 'feed_id'); |
| 150 | 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 | 152 | $sTitle = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'title'), $aErrorOptions); |
| 153 | - | |
| 153 | + | |
| 154 | 154 | $sUrl = KTUtil::arrayGet($_REQUEST, 'url'); |
| 155 | 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 | 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 | } | ... | ... |