Commit 507aa97574e09314dfb7aeefd44272291f407898

Authored by nbm
1 parent 4c496647

Replace all instances of gettext's _ with _kt


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5137 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 44 changed files with 823 additions and 823 deletions
plugins/ktcore/KTCorePlugin.php
@@ -65,7 +65,7 @@ class KTCorePlugin extends KTPlugin { @@ -65,7 +65,7 @@ class KTCorePlugin extends KTPlugin {
65 $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php'); 65 $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php');
66 $this->registerDashlet('KTIndexerStatusDashlet', 'ktcore.dashlet.indexer_status', 'KTDashlets.php'); 66 $this->registerDashlet('KTIndexerStatusDashlet', 'ktcore.dashlet.indexer_status', 'KTDashlets.php');
67 67
68 - $this->registerAdminPage('authentication', 'KTAuthenticationAdminPage', 'principals', _('Authentication'), _('By default, KnowledgeTree controls its own users and groups and stores all information about them inside the database. In many situations, an organisation will already have a list of users and groups, and needs to use that existing information to allow access to the DMS. These <strong>Authentication Sources</strong> allow the system administrator to specify additional sources of authentication data.'), 'authentication/authenticationadminpage.inc.php'); 68 + $this->registerAdminPage('authentication', 'KTAuthenticationAdminPage', 'principals', _kt('Authentication'), _('By default, KnowledgeTree controls its own users and groups and stores all information about them inside the database. In many situations, an organisation will already have a list of users and groups, and needs to use that existing information to allow access to the DMS. These <strong>Authentication Sources</strong> allow the system administrator to specify additional sources of authentication data.'), 'authentication/authenticationadminpage.inc.php');
69 69
70 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n'); 70 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
71 71
@@ -88,83 +88,83 @@ class KTCorePlugin extends KTPlugin { @@ -88,83 +88,83 @@ class KTCorePlugin extends KTPlugin {
88 88
89 function setupAdmin() { 89 function setupAdmin() {
90 // set up the categories. 90 // set up the categories.
91 - $this->registerAdminCategory("principals", _("Users and Groups"),  
92 - _("Control which users can log in, and are part of which groups and organisational units, from these management panels."));  
93 - $this->registerAdminCategory("security", _("Security Management"),  
94 - _("Assign permissions to users and groups, and specify which permissions are required to interact with various parts of the Document Management System."));  
95 - //$this->registerAdminCategory("plugins", _("Plugin Management"),  
96 - // _("Control which plugins are loaded, register new plugins and configure individual plugins."));  
97 - $this->registerAdminCategory("storage", _("Document Storage"),  
98 - _("Manage checked-out, archived and deleted documents."));  
99 - $this->registerAdminCategory("documents", _("Document Metadata and Workflow Configuration"),  
100 - _("Configure the document metadata: Document Types, Document Fieldsets, Link Types and Workflows."));  
101 - $this->registerAdminCategory("misc", _("Miscellaneous"),  
102 - _("Various settings which do not fit into the other categories, including managing help and saved searches.")); 91 + $this->registerAdminCategory("principals", _kt("Users and Groups"),
  92 + _kt("Control which users can log in, and are part of which groups and organisational units, from these management panels."));
  93 + $this->registerAdminCategory("security", _kt("Security Management"),
  94 + _kt("Assign permissions to users and groups, and specify which permissions are required to interact with various parts of the Document Management System."));
  95 + //$this->registerAdminCategory("plugins", _kt("Plugin Management"),
  96 + // _kt("Control which plugins are loaded, register new plugins and configure individual plugins."));
  97 + $this->registerAdminCategory("storage", _kt("Document Storage"),
  98 + _kt("Manage checked-out, archived and deleted documents."));
  99 + $this->registerAdminCategory("documents", _kt("Document Metadata and Workflow Configuration"),
  100 + _kt("Configure the document metadata: Document Types, Document Fieldsets, Link Types and Workflows."));
  101 + $this->registerAdminCategory("misc", _kt("Miscellaneous"),
  102 + _kt("Various settings which do not fit into the other categories, including managing help and saved searches."));
103 103
104 // users and groups 104 // users and groups
105 $this->registerAdminPage("users", 'KTUserAdminDispatcher', "principals", 105 $this->registerAdminPage("users", 'KTUserAdminDispatcher', "principals",
106 - _("Manage Users"), _("Add or remove users from the system."), 106 + _kt("Manage Users"), _("Add or remove users from the system."),
107 'admin/userManagement.php', null); 107 'admin/userManagement.php', null);
108 $this->registerAdminPage("groups", 'KTGroupAdminDispatcher', "principals", 108 $this->registerAdminPage("groups", 'KTGroupAdminDispatcher', "principals",
109 - _("Manage Groups"), _("Add or remove groups from the system."), 109 + _kt("Manage Groups"), _("Add or remove groups from the system."),
110 'admin/groupManagement.php', null); 110 'admin/groupManagement.php', null);
111 $this->registerAdminPage("units", 'KTUnitAdminDispatcher', "principals", 111 $this->registerAdminPage("units", 'KTUnitAdminDispatcher', "principals",
112 - _("Control Units"), _("Specify which organisational units are available within the repository."), 112 + _kt("Control Units"), _("Specify which organisational units are available within the repository."),
113 'admin/unitManagement.php', null); 113 'admin/unitManagement.php', null);
114 114
115 // security 115 // security
116 $this->registerAdminPage("permissions", 'ManagePermissionsDispatcher', "security", 116 $this->registerAdminPage("permissions", 'ManagePermissionsDispatcher', "security",
117 - _("Permissions"), _("Create or delete permissions."), 'admin/managePermissions.php', null); 117 + _kt("Permissions"), _("Create or delete permissions."), 'admin/managePermissions.php', null);
118 $this->registerAdminPage("roles", 'RoleAdminDispatcher', "security", 118 $this->registerAdminPage("roles", 'RoleAdminDispatcher', "security",
119 - _("Roles"), _("Create or delete roles"), 119 + _kt("Roles"), _("Create or delete roles"),
120 'admin/roleManagement.php', null); 120 'admin/roleManagement.php', null);
121 $this->registerAdminPage("conditions", 'KTConditionDispatcher', "security", 121 $this->registerAdminPage("conditions", 'KTConditionDispatcher', "security",
122 - _("Dynamic Conditions"),  
123 - _("Manage criteria which determine whether a user is permitted to perform a system action."), 122 + _kt("Dynamic Conditions"),
  123 + _kt("Manage criteria which determine whether a user is permitted to perform a system action."),
124 'admin/conditions.php', null); 124 'admin/conditions.php', null);
125 125
126 // documents 126 // documents
127 $this->registerAdminPage("typemanagement", 'KTDocumentTypeDispatcher', 'documents', 127 $this->registerAdminPage("typemanagement", 'KTDocumentTypeDispatcher', 'documents',
128 - _('Document Types'),  
129 - _('Manage the different classes of document which can be added to the system.'), 128 + _kt('Document Types'),
  129 + _kt('Manage the different classes of document which can be added to the system.'),
130 'admin/documentTypes.php', null); 130 'admin/documentTypes.php', null);
131 $this->registerAdminPage("fieldmanagement", 'KTDocumentFieldDispatcher', 'documents', 131 $this->registerAdminPage("fieldmanagement", 'KTDocumentFieldDispatcher', 'documents',
132 - _('Document Fieldsets'),  
133 - _('Manage the different types of information that can be associated with classes of documents.'), 132 + _kt('Document Fieldsets'),
  133 + _kt('Manage the different types of information that can be associated with classes of documents.'),
134 'admin/documentFields.php', null); 134 'admin/documentFields.php', null);
135 $this->registerAdminPage("linkmanagement", 'KTDocLinkAdminDispatcher', 'documents', 135 $this->registerAdminPage("linkmanagement", 'KTDocLinkAdminDispatcher', 'documents',
136 - _('Link Type Management'),  
137 - _('Manage the different ways documents can be associated with one another.'), 136 + _kt('Link Type Management'),
  137 + _kt('Manage the different ways documents can be associated with one another.'),
138 'admin/documentLinks.php', null); 138 'admin/documentLinks.php', null);
139 $this->registerAdminPage("workflows", 'KTWorkflowDispatcher', 'documents', 139 $this->registerAdminPage("workflows", 'KTWorkflowDispatcher', 'documents',
140 - _('Workflows'), _('Configure the process documents go through.'), 140 + _kt('Workflows'), _('Configure the process documents go through.'),
141 'admin/workflows.php', null); 141 'admin/workflows.php', null);
142 142
143 // storage 143 // storage
144 $this->registerAdminPage("checkout", 'KTCheckoutAdminDispatcher', 'storage', 144 $this->registerAdminPage("checkout", 'KTCheckoutAdminDispatcher', 'storage',
145 - _('Checked Out Document Control'),  
146 - _('Override the checked-out status of documents if a user has failed to do so.'), 145 + _kt('Checked Out Document Control'),
  146 + _kt('Override the checked-out status of documents if a user has failed to do so.'),
147 'admin/documentCheckout.php', null); 147 'admin/documentCheckout.php', null);
148 $this->registerAdminPage("archived", 'ArchivedDocumentsDispatcher', 'storage', 148 $this->registerAdminPage("archived", 'ArchivedDocumentsDispatcher', 'storage',
149 - _('Archived Document Restoration'), _("Restore old (archived) documents, usually at a user's request."), 149 + _kt('Archived Document Restoration'), _("Restore old (archived) documents, usually at a user's request."),
150 'admin/archivedDocuments.php', null); 150 'admin/archivedDocuments.php', null);
151 $this->registerAdminPage("expunge", 'DeletedDocumentsDispatcher', 'storage', 151 $this->registerAdminPage("expunge", 'DeletedDocumentsDispatcher', 'storage',
152 - _('Restore or Expunge Deleted Documents'), _('Restore previously deleted documents, or permanently expunge them.'), 152 + _kt('Restore or Expunge Deleted Documents'), _('Restore previously deleted documents, or permanently expunge them.'),
153 'admin/deletedDocuments.php', null); 153 'admin/deletedDocuments.php', null);
154 154
155 // misc 155 // misc
156 $this->registerAdminPage("helpmanagement", 'ManageHelpDispatcher', 'misc', 156 $this->registerAdminPage("helpmanagement", 'ManageHelpDispatcher', 'misc',
157 - _('Edit Help files'), _('Change the help files that are displayed to users.'), 157 + _kt('Edit Help files'), _('Change the help files that are displayed to users.'),
158 'admin/manageHelp.php', null); 158 'admin/manageHelp.php', null);
159 $this->registerAdminPage("savedsearch", 'KTSavedSearchDispatcher', 'misc', 159 $this->registerAdminPage("savedsearch", 'KTSavedSearchDispatcher', 'misc',
160 - _('Saved searches'),  
161 - _('Manage saved searches - searches available by default to all users.'), 160 + _kt('Saved searches'),
  161 + _kt('Manage saved searches - searches available by default to all users.'),
162 'admin/savedSearch.php', null); 162 'admin/savedSearch.php', null);
163 $this->registerAdminPage("plugins", 'KTPluginDispatcher', 'misc', 163 $this->registerAdminPage("plugins", 'KTPluginDispatcher', 'misc',
164 - _('Manage plugins'), _('Register new plugins, disable plugins, and so forth'), 164 + _kt('Manage plugins'), _('Register new plugins, disable plugins, and so forth'),
165 'admin/plugins.php', null); 165 'admin/plugins.php', null);
166 $this->registerAdminPage("techsupport", 'KTSupportDispatcher', 'misc', 166 $this->registerAdminPage("techsupport", 'KTSupportDispatcher', 'misc',
167 - _('Support and System information'), _('Information about this system and how to get support.'), 167 + _kt('Support and System information'), _('Information about this system and how to get support.'),
168 'admin/techsupport.php', null); 168 'admin/techsupport.php', null);
169 // plugins 169 // plugins
170 170
plugins/ktcore/KTDocumentActions.php
@@ -42,12 +42,12 @@ class KTDocumentDetailsAction extends KTDocumentAction { @@ -42,12 +42,12 @@ class KTDocumentDetailsAction extends KTDocumentAction {
42 var $sName = 'ktcore.actions.document.displaydetails'; 42 var $sName = 'ktcore.actions.document.displaydetails';
43 43
44 function do_main() { 44 function do_main() {
45 - redirect(generateControllerLink('viewDocument',sprintf(_('fDocumentId=%d'),$this->oDocument->getId()))); 45 + redirect(generateControllerLink('viewDocument',sprintf(_kt('fDocumentId=%d'),$this->oDocument->getId())));
46 exit(0); 46 exit(0);
47 } 47 }
48 48
49 function getDisplayName() { 49 function getDisplayName() {
50 - return _('Display Details'); 50 + return _kt('Display Details');
51 } 51 }
52 } 52 }
53 // }}} 53 // }}}
@@ -57,11 +57,11 @@ class KTDocumentViewAction extends KTDocumentAction { @@ -57,11 +57,11 @@ class KTDocumentViewAction extends KTDocumentAction {
57 var $sName = 'ktcore.actions.document.view'; 57 var $sName = 'ktcore.actions.document.view';
58 58
59 function getDisplayName() { 59 function getDisplayName() {
60 - return _('Download'); 60 + return _kt('Download');
61 } 61 }
62 62
63 function customiseInfo($aInfo) { 63 function customiseInfo($aInfo) {
64 - $aInfo['alert'] = _("This will download a copy of the document and is not the same as Checking Out a document. Changes to this downloaded file will not be managed in the DMS."); 64 + $aInfo['alert'] = _kt("This will download a copy of the document and is not the same as Checking Out a document. Changes to this downloaded file will not be managed in the DMS.");
65 return $aInfo; 65 return $aInfo;
66 } 66 }
67 67
@@ -90,7 +90,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { @@ -90,7 +90,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
90 var $_sShowPermission = "ktcore.permissions.write"; 90 var $_sShowPermission = "ktcore.permissions.write";
91 91
92 function getDisplayName() { 92 function getDisplayName() {
93 - return _('Checkout'); 93 + return _kt('Checkout');
94 } 94 }
95 95
96 function getInfo() { 96 function getInfo() {
@@ -112,7 +112,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { @@ -112,7 +112,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
112 112
113 // "normal". 113 // "normal".
114 if ($this->oDocument->getIsCheckedOut()) { 114 if ($this->oDocument->getIsCheckedOut()) {
115 - $_SESSION['KTErrorMessage'][] = _("This document is already checked out"); 115 + $_SESSION['KTErrorMessage'][] = _kt("This document is already checked out");
116 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 116 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
117 exit(0); 117 exit(0);
118 } 118 }
@@ -123,7 +123,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { @@ -123,7 +123,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
123 $this->oPage->setBreadcrumbDetails("checkout"); 123 $this->oPage->setBreadcrumbDetails("checkout");
124 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout'); 124 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout');
125 $checkout_fields = array(); 125 $checkout_fields = array();
126 - $checkout_fields[] = new KTStringWidget(_('Reason'), _('The reason for the checkout of this document for historical purposes, and to inform those who wish to check out this document.'), 'reason', "", $this->oPage, true); 126 + $checkout_fields[] = new KTStringWidget(_kt('Reason'), _('The reason for the checkout of this document for historical purposes, and to inform those who wish to check out this document.'), 'reason', "", $this->oPage, true);
127 127
128 $oTemplate->setData(array( 128 $oTemplate->setData(array(
129 'context' => &$this, 129 'context' => &$this,
@@ -144,7 +144,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { @@ -144,7 +144,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
144 $this->startTransaction(); 144 $this->startTransaction();
145 $res = KTDocumentUtil::checkout($this->oDocument, $sReason, $this->oUser); 145 $res = KTDocumentUtil::checkout($this->oDocument, $sReason, $this->oUser);
146 if (PEAR::isError($res)) { 146 if (PEAR::isError($res)) {
147 - return $this->errorRedirectToMain(sprintf(_('Failed to check out the document: %s'), $res->getMessage())); 147 + return $this->errorRedirectToMain(sprintf(_kt('Failed to check out the document: %s'), $res->getMessage()));
148 } 148 }
149 149
150 $this->commitTransaction(); 150 $this->commitTransaction();
@@ -174,7 +174,7 @@ class KTDocumentCheckInAction extends KTDocumentAction { @@ -174,7 +174,7 @@ class KTDocumentCheckInAction extends KTDocumentAction {
174 var $_sShowPermission = "ktcore.permissions.write"; 174 var $_sShowPermission = "ktcore.permissions.write";
175 175
176 function getDisplayName() { 176 function getDisplayName() {
177 - return _('Checkin'); 177 + return _kt('Checkin');
178 } 178 }
179 179
180 function getInfo() { 180 function getInfo() {
@@ -194,12 +194,12 @@ class KTDocumentCheckInAction extends KTDocumentAction { @@ -194,12 +194,12 @@ class KTDocumentCheckInAction extends KTDocumentAction {
194 return $res; 194 return $res;
195 } 195 }
196 if (!$this->oDocument->getIsCheckedOut()) { 196 if (!$this->oDocument->getIsCheckedOut()) {
197 - $_SESSION['KTErrorMessage'][] = _("This document is not checked out"); 197 + $_SESSION['KTErrorMessage'][] = _kt("This document is not checked out");
198 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 198 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
199 exit(0); 199 exit(0);
200 } 200 }
201 if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) { 201 if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) {
202 - $_SESSION['KTErrorMessage'][] = _("This document is checked out, but not by you"); 202 + $_SESSION['KTErrorMessage'][] = _kt("This document is checked out, but not by you");
203 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 203 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
204 exit(0); 204 exit(0);
205 } 205 }
@@ -212,8 +212,8 @@ class KTDocumentCheckInAction extends KTDocumentAction { @@ -212,8 +212,8 @@ class KTDocumentCheckInAction extends KTDocumentAction {
212 212
213 $sReason = KTUtil::arrayGet($_REQUEST, 'reason', ""); 213 $sReason = KTUtil::arrayGet($_REQUEST, 'reason', "");
214 $checkin_fields = array(); 214 $checkin_fields = array();
215 - $checkin_fields[] = new KTFileUploadWidget(_('File'), _('The updated document.'), 'file', "", $this->oPage, true);  
216 - $checkin_fields[] = new KTStringWidget(_('Description'), _('Describe the changes made to the document.'), 'reason', $sReason, $this->oPage, true); 215 + $checkin_fields[] = new KTFileUploadWidget(_kt('File'), _('The updated document.'), 'file', "", $this->oPage, true);
  216 + $checkin_fields[] = new KTStringWidget(_kt('Description'), _('Describe the changes made to the document.'), 'reason', $sReason, $this->oPage, true);
217 217
218 $oTemplate->setData(array( 218 $oTemplate->setData(array(
219 'context' => &$this, 219 'context' => &$this,
@@ -228,19 +228,19 @@ class KTDocumentCheckInAction extends KTDocumentAction { @@ -228,19 +228,19 @@ class KTDocumentCheckInAction extends KTDocumentAction {
228 228
229 // make sure the user actually selected a file first 229 // make sure the user actually selected a file first
230 if (strlen($_FILES['file']['name']) == 0) { 230 if (strlen($_FILES['file']['name']) == 0) {
231 - $this->errorRedirectToMain(_("No file was uploaded"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); 231 + $this->errorRedirectToMain(_kt("No file was uploaded"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
232 } 232 }
233 233
234 // and that the filename matches 234 // and that the filename matches
235 global $default; 235 global $default;
236 $default->log->info("checkInDocumentBL.php uploaded filename=" . $_FILES['file']['name'] . "; current filename=" . $this->oDocument->getFileName()); 236 $default->log->info("checkInDocumentBL.php uploaded filename=" . $_FILES['file']['name'] . "; current filename=" . $this->oDocument->getFileName());
237 if ($this->oDocument->getFileName() != $_FILES['file']['name']) { 237 if ($this->oDocument->getFileName() != $_FILES['file']['name']) {
238 - $this->errorRedirectToMain(_("The file name of the uploaded file does not match the file name of the document in the system"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); 238 + $this->errorRedirectToMain(_kt("The file name of the uploaded file does not match the file name of the document in the system"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
239 } 239 }
240 240
241 $res = KTDocumentUtil::checkin($this->oDocument, $_FILES['file']['tmp_name'], $sReason, $this->oUser); 241 $res = KTDocumentUtil::checkin($this->oDocument, $_FILES['file']['tmp_name'], $sReason, $this->oUser);
242 if (PEAR::isError($res)) { 242 if (PEAR::isError($res)) {
243 - $this->errorRedirectToMain(_("An error occurred while trying to check in the document"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); 243 + $this->errorRedirectToMain(_kt("An error occurred while trying to check in the document"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
244 } 244 }
245 redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID()); 245 redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID());
246 } 246 }
@@ -255,7 +255,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { @@ -255,7 +255,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
255 var $_sShowPermission = "ktcore.permissions.write"; 255 var $_sShowPermission = "ktcore.permissions.write";
256 256
257 function getDisplayName() { 257 function getDisplayName() {
258 - return _('Cancel Checkout'); 258 + return _kt('Cancel Checkout');
259 } 259 }
260 260
261 function getInfo() { 261 function getInfo() {
@@ -275,12 +275,12 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { @@ -275,12 +275,12 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
275 return $res; 275 return $res;
276 } 276 }
277 if (!$this->oDocument->getIsCheckedOut()) { 277 if (!$this->oDocument->getIsCheckedOut()) {
278 - $_SESSION['KTErrorMessage'][] = _("This document is not checked out"); 278 + $_SESSION['KTErrorMessage'][] = _kt("This document is not checked out");
279 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 279 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
280 exit(0); 280 exit(0);
281 } 281 }
282 if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) { 282 if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) {
283 - $_SESSION['KTErrorMessage'][] = _("This document is checked out, but not by you"); 283 + $_SESSION['KTErrorMessage'][] = _kt("This document is checked out, but not by you");
284 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 284 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
285 exit(0); 285 exit(0);
286 } 286 }
@@ -293,7 +293,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { @@ -293,7 +293,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
293 293
294 $sReason = KTUtil::arrayGet($_REQUEST, 'reason', ""); 294 $sReason = KTUtil::arrayGet($_REQUEST, 'reason', "");
295 $checkin_fields = array(); 295 $checkin_fields = array();
296 - $checkin_fields[] = new KTStringWidget(_('Reason'), _('Give a reason for cancelling this checkout.'), 'reason', $sReason, $this->oPage, true); 296 + $checkin_fields[] = new KTStringWidget(_kt('Reason'), _('Give a reason for cancelling this checkout.'), 'reason', $sReason, $this->oPage, true);
297 297
298 $oTemplate->setData(array( 298 $oTemplate->setData(array(
299 'context' => &$this, 299 'context' => &$this,
@@ -315,7 +315,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { @@ -315,7 +315,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
315 $this->oDocument->setCheckedOutUserID(-1); 315 $this->oDocument->setCheckedOutUserID(-1);
316 if (!$this->oDocument->update()) { 316 if (!$this->oDocument->update()) {
317 $this->rollbackTransaction(); 317 $this->rollbackTransaction();
318 - return $this->errorRedirectToMain(_("Failed to force the document's checkin."),sprintf('fDocumentId=%d'),$this->oDocument->getId()); 318 + return $this->errorRedirectToMain(_kt("Failed to force the document's checkin."),sprintf('fDocumentId=%d'),$this->oDocument->getId());
319 } 319 }
320 320
321 // checkout cancelled transaction 321 // checkout cancelled transaction
@@ -323,7 +323,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction { @@ -323,7 +323,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
323 $res = $oDocumentTransaction->create(); 323 $res = $oDocumentTransaction->create();
324 if (PEAR::isError($res) || ($res == false)) { 324 if (PEAR::isError($res) || ($res == false)) {
325 $this->rollbackTransaction(); 325 $this->rollbackTransaction();
326 - return $this->errorRedirectToMain(_("Failed to force the document's checkin."),sprintf('fDocumentId=%d'),$this->oDocument->getId()); 326 + return $this->errorRedirectToMain(_kt("Failed to force the document's checkin."),sprintf('fDocumentId=%d'),$this->oDocument->getId());
327 } 327 }
328 $this->commitTransaction(); // FIXME do we want to do this if we can't created the document-transaction? 328 $this->commitTransaction(); // FIXME do we want to do this if we can't created the document-transaction?
329 redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID()); 329 redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID());
@@ -346,7 +346,7 @@ class KTDocumentEditAction extends KTDocumentAction { @@ -346,7 +346,7 @@ class KTDocumentEditAction extends KTDocumentAction {
346 } 346 }
347 347
348 function getDisplayName() { 348 function getDisplayName() {
349 - return _('Edit metadata'); 349 + return _kt('Edit metadata');
350 } 350 }
351 351
352 function getURL() { 352 function getURL() {
@@ -362,7 +362,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { @@ -362,7 +362,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
362 var $_sShowPermission = "ktcore.permissions.delete"; 362 var $_sShowPermission = "ktcore.permissions.delete";
363 363
364 function getDisplayName() { 364 function getDisplayName() {
365 - return _('Delete'); 365 + return _kt('Delete');
366 } 366 }
367 367
368 function getInfo() { 368 function getInfo() {
@@ -378,7 +378,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { @@ -378,7 +378,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
378 return $res; 378 return $res;
379 } 379 }
380 if ($this->oDocument->getIsCheckedOut()) { 380 if ($this->oDocument->getIsCheckedOut()) {
381 - $_SESSION["KTErrorMessage"][]= _("This document can't be deleted because it is checked out"); 381 + $_SESSION["KTErrorMessage"][]= _kt("This document can't be deleted because it is checked out");
382 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 382 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
383 exit(0); 383 exit(0);
384 } 384 }
@@ -389,7 +389,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { @@ -389,7 +389,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
389 $this->oPage->setBreadcrumbDetails("delete"); 389 $this->oPage->setBreadcrumbDetails("delete");
390 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete'); 390 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete');
391 $delete_fields = array(); 391 $delete_fields = array();
392 - $delete_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be removed.'), 'reason', "", $this->oPage, true); 392 + $delete_fields[] = new KTStringWidget(_kt('Reason'), _('The reason for this document to be removed.'), 'reason', "", $this->oPage, true);
393 393
394 $oTemplate->setData(array( 394 $oTemplate->setData(array(
395 'context' => &$this, 395 'context' => &$this,
@@ -410,7 +410,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { @@ -410,7 +410,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
410 $_SESSION['KTErrorMessage'][] = $res->getMessage(); 410 $_SESSION['KTErrorMessage'][] = $res->getMessage();
411 controllerRedirect('viewDocument',sprintf('fDocumentId=%d', $this->oDocument->getId())); 411 controllerRedirect('viewDocument',sprintf('fDocumentId=%d', $this->oDocument->getId()));
412 } else { 412 } else {
413 - $_SESSION['KTInfoMessage'][] = sprintf(_('Document "%s" Deleted.'),$this->oDocument->getName()); 413 + $_SESSION['KTInfoMessage'][] = sprintf(_kt('Document "%s" Deleted.'),$this->oDocument->getName());
414 } 414 }
415 415
416 416
@@ -438,7 +438,7 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -438,7 +438,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
438 var $_sShowPermission = "ktcore.permissions.write"; 438 var $_sShowPermission = "ktcore.permissions.write";
439 439
440 function getDisplayName() { 440 function getDisplayName() {
441 - return _('Move'); 441 + return _kt('Move');
442 } 442 }
443 443
444 function getInfo() { 444 function getInfo() {
@@ -454,7 +454,7 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -454,7 +454,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
454 return $res; 454 return $res;
455 } 455 }
456 if ($this->oDocument->getIsCheckedOut()) { 456 if ($this->oDocument->getIsCheckedOut()) {
457 - $_SESSION["KTErrorMessage"][]= _("This document can't be deleted because it is checked out"); 457 + $_SESSION["KTErrorMessage"][]= _kt("This document can't be deleted because it is checked out");
458 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 458 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
459 exit(0); 459 exit(0);
460 } 460 }
@@ -465,13 +465,13 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -465,13 +465,13 @@ class KTDocumentMoveAction extends KTDocumentAction {
465 } 465 }
466 466
467 function do_main() { 467 function do_main() {
468 - $this->oPage->setBreadcrumbDetails(_("move")); 468 + $this->oPage->setBreadcrumbDetails(_kt("move"));
469 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move'); 469 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move');
470 $move_fields = array(); 470 $move_fields = array();
471 $aNames = $this->oDocumentFolder->getPathArray(); 471 $aNames = $this->oDocumentFolder->getPathArray();
472 $aNames[] = $this->oDocument->getName(); 472 $aNames[] = $this->oDocument->getName();
473 $sDocumentName = join(" &raquo; ", $aNames); 473 $sDocumentName = join(" &raquo; ", $aNames);
474 - $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false); 474 + $move_fields[] = new KTStaticTextWidget(_kt('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
475 475
476 $collection = new DocumentCollection(); 476 $collection = new DocumentCollection();
477 $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument)); 477 $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument));
@@ -518,16 +518,16 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -518,16 +518,16 @@ class KTDocumentMoveAction extends KTDocumentAction {
518 } 518 }
519 519
520 function do_move() { 520 function do_move() {
521 - $this->oPage->setBreadcrumbDetails(_("move")); 521 + $this->oPage->setBreadcrumbDetails(_kt("move"));
522 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move_final'); 522 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move_final');
523 $sFolderPath = join(" &raquo; ", $this->oFolder->getPathArray()); 523 $sFolderPath = join(" &raquo; ", $this->oFolder->getPathArray());
524 $aNames = $this->oDocumentFolder->getPathArray(); 524 $aNames = $this->oDocumentFolder->getPathArray();
525 $aNames[] = $this->oDocument->getName(); 525 $aNames[] = $this->oDocument->getName();
526 $sDocumentName = join(" &raquo; ", $aNames); 526 $sDocumentName = join(" &raquo; ", $aNames);
527 $move_fields = array(); 527 $move_fields = array();
528 - $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);  
529 - $move_fields[] = new KTStaticTextWidget(_('Target folder'), '', 'fFolderId', $sFolderPath, $this->oPage, false);  
530 - $move_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be moved.'), 'reason', "", $this->oPage, true); 528 + $move_fields[] = new KTStaticTextWidget(_kt('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
  529 + $move_fields[] = new KTStaticTextWidget(_kt('Target folder'), '', 'fFolderId', $sFolderPath, $this->oPage, false);
  530 + $move_fields[] = new KTStringWidget(_kt('Reason'), _('The reason for this document to be moved.'), 'reason', "", $this->oPage, true);
531 531
532 $oTemplate->setData(array( 532 $oTemplate->setData(array(
533 'context' => &$this, 533 'context' => &$this,
@@ -539,13 +539,13 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -539,13 +539,13 @@ class KTDocumentMoveAction extends KTDocumentAction {
539 function do_move_final() { 539 function do_move_final() {
540 $sReason = KTUtil::arrayGet($_REQUEST, 'reason'); 540 $sReason = KTUtil::arrayGet($_REQUEST, 'reason');
541 $aOptions = array( 541 $aOptions = array(
542 - 'message' => _("No reason given"), 542 + 'message' => _kt("No reason given"),
543 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())), 543 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())),
544 ); 544 );
545 $this->oValidator->notEmpty($sReason, $aOptions); 545 $this->oValidator->notEmpty($sReason, $aOptions);
546 546
547 if (!Permission::userHasFolderWritePermission($this->oFolder)) { 547 if (!Permission::userHasFolderWritePermission($this->oFolder)) {
548 - $this->errorRedirectTo("main", _("You do not have permission to move a document to this location"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); 548 + $this->errorRedirectTo("main", _kt("You do not have permission to move a document to this location"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
549 exit(0); 549 exit(0);
550 } 550 }
551 551
@@ -562,7 +562,7 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -562,7 +562,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
562 //put the document in the new folder 562 //put the document in the new folder
563 $this->oDocument->setFolderID($this->oFolder->getId()); 563 $this->oDocument->setFolderID($this->oFolder->getId());
564 if (!$this->oDocument->update(true)) { 564 if (!$this->oDocument->update(true)) {
565 - $this->errorRedirectTo("main", _("There was a problem updating the document's location in the database"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); 565 + $this->errorRedirectTo("main", _kt("There was a problem updating the document's location in the database"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
566 } 566 }
567 567
568 568
@@ -571,7 +571,7 @@ class KTDocumentMoveAction extends KTDocumentAction { @@ -571,7 +571,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
571 if (!$oStorage->moveDocument($this->oDocument, $this->oDocumentFolder, $this->oFolder)) { 571 if (!$oStorage->moveDocument($this->oDocument, $this->oDocumentFolder, $this->oFolder)) {
572 $this->oDocument->setFolderID($this->oDocumentFolder->getId()); 572 $this->oDocument->setFolderID($this->oDocumentFolder->getId());
573 $this->oDocument->update(true); 573 $this->oDocument->update(true);
574 - $this->errorRedirectTo("move", _("There was a problem updating the document's location in the repository storage"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); 574 + $this->errorRedirectTo("move", _kt("There was a problem updating the document's location in the repository storage"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
575 } 575 }
576 576
577 $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s", 577 $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s",
@@ -630,7 +630,7 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -630,7 +630,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
630 var $_sShowPermission = "ktcore.permissions.read"; 630 var $_sShowPermission = "ktcore.permissions.read";
631 631
632 function getDisplayName() { 632 function getDisplayName() {
633 - return _('Copy'); 633 + return _kt('Copy');
634 } 634 }
635 635
636 function getInfo() { 636 function getInfo() {
@@ -649,7 +649,7 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -649,7 +649,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
649 return $res; 649 return $res;
650 } 650 }
651 if ($this->oDocument->getIsCheckedOut()) { 651 if ($this->oDocument->getIsCheckedOut()) {
652 - $_SESSION["KTErrorMessage"][]= _("This document can't be copied because it is checked out"); 652 + $_SESSION["KTErrorMessage"][]= _kt("This document can't be copied because it is checked out");
653 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 653 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
654 exit(0); 654 exit(0);
655 } 655 }
@@ -660,13 +660,13 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -660,13 +660,13 @@ class KTDocumentCopyAction extends KTDocumentAction {
660 } 660 }
661 661
662 function do_main() { 662 function do_main() {
663 - $this->oPage->setBreadcrumbDetails(_("Copy")); 663 + $this->oPage->setBreadcrumbDetails(_kt("Copy"));
664 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/copy'); 664 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/copy');
665 $move_fields = array(); 665 $move_fields = array();
666 $aNames = $this->oDocumentFolder->getPathArray(); 666 $aNames = $this->oDocumentFolder->getPathArray();
667 $aNames[] = $this->oDocument->getName(); 667 $aNames[] = $this->oDocument->getName();
668 $sDocumentName = join(" &raquo; ", $aNames); 668 $sDocumentName = join(" &raquo; ", $aNames);
669 - $move_fields[] = new KTStaticTextWidget(_('Document to copy'), '', 'fDocumentId', $sDocumentName, $this->oPage, false); 669 + $move_fields[] = new KTStaticTextWidget(_kt('Document to copy'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
670 670
671 $collection = new DocumentCollection(); 671 $collection = new DocumentCollection();
672 $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument)); 672 $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument));
@@ -713,16 +713,16 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -713,16 +713,16 @@ class KTDocumentCopyAction extends KTDocumentAction {
713 } 713 }
714 714
715 function do_copy() { 715 function do_copy() {
716 - $this->oPage->setBreadcrumbDetails(_("Copy")); 716 + $this->oPage->setBreadcrumbDetails(_kt("Copy"));
717 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/copy_final'); 717 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/copy_final');
718 $sFolderPath = join(" &raquo; ", $this->oFolder->getPathArray()); 718 $sFolderPath = join(" &raquo; ", $this->oFolder->getPathArray());
719 $aNames = $this->oDocumentFolder->getPathArray(); 719 $aNames = $this->oDocumentFolder->getPathArray();
720 $aNames[] = $this->oDocument->getName(); 720 $aNames[] = $this->oDocument->getName();
721 $sDocumentName = join(" &raquo; ", $aNames); 721 $sDocumentName = join(" &raquo; ", $aNames);
722 $move_fields = array(); 722 $move_fields = array();
723 - $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);  
724 - $move_fields[] = new KTStaticTextWidget(_('Target folder'), '', 'fFolderId', $sFolderPath, $this->oPage, false);  
725 - $move_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be moved.'), 'reason', "", $this->oPage, true); 723 + $move_fields[] = new KTStaticTextWidget(_kt('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
  724 + $move_fields[] = new KTStaticTextWidget(_kt('Target folder'), '', 'fFolderId', $sFolderPath, $this->oPage, false);
  725 + $move_fields[] = new KTStringWidget(_kt('Reason'), _('The reason for this document to be moved.'), 'reason', "", $this->oPage, true);
726 726
727 $oTemplate->setData(array( 727 $oTemplate->setData(array(
728 'context' => &$this, 728 'context' => &$this,
@@ -734,13 +734,13 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -734,13 +734,13 @@ class KTDocumentCopyAction extends KTDocumentAction {
734 function do_copy_final() { 734 function do_copy_final() {
735 $sReason = KTUtil::arrayGet($_REQUEST, 'reason'); 735 $sReason = KTUtil::arrayGet($_REQUEST, 'reason');
736 $aOptions = array( 736 $aOptions = array(
737 - 'message' => _("No reason given"), 737 + 'message' => _kt("No reason given"),
738 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())), 738 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())),
739 ); 739 );
740 $this->oValidator->notEmpty($sReason, $aOptions); 740 $this->oValidator->notEmpty($sReason, $aOptions);
741 741
742 if (!Permission::userHasFolderWritePermission($this->oFolder)) { 742 if (!Permission::userHasFolderWritePermission($this->oFolder)) {
743 - $this->errorRedirectTo("main", _("You do not have permission to move a document to this location"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); 743 + $this->errorRedirectTo("main", _kt("You do not have permission to move a document to this location"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
744 exit(0); 744 exit(0);
745 } 745 }
746 746
@@ -750,7 +750,7 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -750,7 +750,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
750 750
751 $oNewDoc = KTDocumentUtil::copy($this->oDocument, $this->oFolder); 751 $oNewDoc = KTDocumentUtil::copy($this->oDocument, $this->oFolder);
752 if (PEAR::isError($oNewDoc)) { 752 if (PEAR::isError($oNewDoc)) {
753 - $this->errorRedirectTo("main", _("Failed to move document: ") . $oNewDoc->getMessage(), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId())); 753 + $this->errorRedirectTo("main", _kt("Failed to move document: ") . $oNewDoc->getMessage(), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
754 exit(0); 754 exit(0);
755 } 755 }
756 756
@@ -776,7 +776,7 @@ class KTDocumentCopyAction extends KTDocumentAction { @@ -776,7 +776,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
776 $oDocumentTransaction = & new DocumentTransaction($oNewDoc, "Document copied from old version.", 'ktcore.transactions.create', $aOptions); 776 $oDocumentTransaction = & new DocumentTransaction($oNewDoc, "Document copied from old version.", 'ktcore.transactions.create', $aOptions);
777 $res = $oDocumentTransaction->create(); 777 $res = $oDocumentTransaction->create();
778 778
779 - $_SESSION['KTInfoMessage'][] = _('Document copied.'); 779 + $_SESSION['KTInfoMessage'][] = _kt('Document copied.');
780 780
781 controllerRedirect('viewDocument', 'fDocumentId=' . $oNewDoc->getId()); 781 controllerRedirect('viewDocument', 'fDocumentId=' . $oNewDoc->getId());
782 exit(0); 782 exit(0);
@@ -789,7 +789,7 @@ class KTDocumentTransactionHistoryAction extends KTDocumentAction { @@ -789,7 +789,7 @@ class KTDocumentTransactionHistoryAction extends KTDocumentAction {
789 var $sName = 'ktcore.actions.document.transactionhistory'; 789 var $sName = 'ktcore.actions.document.transactionhistory';
790 790
791 function getDisplayName() { 791 function getDisplayName() {
792 - return _('Transaction History'); 792 + return _kt('Transaction History');
793 } 793 }
794 794
795 function getURL() { 795 function getURL() {
@@ -803,7 +803,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction { @@ -803,7 +803,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction {
803 var $sName = 'ktcore.actions.document.versionhistory'; 803 var $sName = 'ktcore.actions.document.versionhistory';
804 804
805 function getDisplayName() { 805 function getDisplayName() {
806 - return _('Version History'); 806 + return _kt('Version History');
807 } 807 }
808 808
809 function getURL() { 809 function getURL() {
@@ -818,7 +818,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { @@ -818,7 +818,7 @@ class KTDocumentArchiveAction extends KTDocumentAction {
818 var $_sShowPermission = "ktcore.permissions.write"; 818 var $_sShowPermission = "ktcore.permissions.write";
819 819
820 function getDisplayName() { 820 function getDisplayName() {
821 - return _('Archive'); 821 + return _kt('Archive');
822 } 822 }
823 823
824 function getInfo() { 824 function getInfo() {
@@ -829,10 +829,10 @@ class KTDocumentArchiveAction extends KTDocumentAction { @@ -829,10 +829,10 @@ class KTDocumentArchiveAction extends KTDocumentAction {
829 } 829 }
830 830
831 function do_main() { 831 function do_main() {
832 - $this->oPage->setBreadcrumbDetails(_("archiving")); 832 + $this->oPage->setBreadcrumbDetails(_kt("archiving"));
833 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive'); 833 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive');
834 $fields = array(); 834 $fields = array();
835 - $fields[] = new KTStringWidget(_('Reason'), _('The reason for the archiving of this document. This will be displayed when the archived document is to be displayed.'), 'reason', "", $this->oPage, true); 835 + $fields[] = new KTStringWidget(_kt('Reason'), _('The reason for the archiving of this document. This will be displayed when the archived document is to be displayed.'), 'reason', "", $this->oPage, true);
836 836
837 $oTemplate->setData(array( 837 $oTemplate->setData(array(
838 'context' => &$this, 838 'context' => &$this,
@@ -854,11 +854,11 @@ class KTDocumentArchiveAction extends KTDocumentAction { @@ -854,11 +854,11 @@ class KTDocumentArchiveAction extends KTDocumentAction {
854 $this->startTransaction(); 854 $this->startTransaction();
855 $this->oDocument->setStatusID(ARCHIVED); 855 $this->oDocument->setStatusID(ARCHIVED);
856 if (!$this->oDocument->update()) { 856 if (!$this->oDocument->update()) {
857 - $_SESSION['KTErrorMessage'][] = _("There was a database error while trying to archive this file"); 857 + $_SESSION['KTErrorMessage'][] = _kt("There was a database error while trying to archive this file");
858 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 858 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
859 exit(0); 859 exit(0);
860 } 860 }
861 - $oDocumentTransaction = & new DocumentTransaction($this->oDocument, sprintf(_("Document archived: %s"), $sReason), 'ktcore.transactions.update'); 861 + $oDocumentTransaction = & new DocumentTransaction($this->oDocument, sprintf(_kt("Document archived: %s"), $sReason), 'ktcore.transactions.update');
862 $oDocumentTransaction->create(); 862 $oDocumentTransaction->create();
863 863
864 $this->commitTransaction(); 864 $this->commitTransaction();
@@ -879,7 +879,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { @@ -879,7 +879,7 @@ class KTDocumentArchiveAction extends KTDocumentAction {
879 } 879 }
880 } 880 }
881 881
882 - $_SESSION['KTInfoMessage'][] = _("Document archived."); 882 + $_SESSION['KTInfoMessage'][] = _kt("Document archived.");
883 controllerRedirect('browse', 'fFolderId=' . $this->oDocument->getFolderID()); 883 controllerRedirect('browse', 'fFolderId=' . $this->oDocument->getFolderID());
884 exit(0); 884 exit(0);
885 } 885 }
@@ -894,11 +894,11 @@ class KTDocumentWorkflowAction extends KTDocumentAction { @@ -894,11 +894,11 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
894 var $sHelpPage = 'ktcore/workflow.html'; 894 var $sHelpPage = 'ktcore/workflow.html';
895 895
896 function getDisplayName() { 896 function getDisplayName() {
897 - return _('Workflow'); 897 + return _kt('Workflow');
898 } 898 }
899 899
900 function do_main() { 900 function do_main() {
901 - $this->oPage->setBreadcrumbDetails(_("workflow")); 901 + $this->oPage->setBreadcrumbDetails(_kt("workflow"));
902 $oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow"); 902 $oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow");
903 $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); 903 $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']);
904 904
@@ -918,9 +918,9 @@ class KTDocumentWorkflowAction extends KTDocumentAction { @@ -918,9 +918,9 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
918 $aVocab[$oTransition->getId()] = $oTransition->showDescription(); 918 $aVocab[$oTransition->getId()] = $oTransition->showDescription();
919 } 919 }
920 $fieldOptions = array("vocab" => $aVocab); 920 $fieldOptions = array("vocab" => $aVocab);
921 - $transition_fields[] = new KTLookupWidget(_('Transition to perform'), 'The transition listed will cause the document to change from its current state to the listed destination state.', 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); 921 + $transition_fields[] = new KTLookupWidget(_kt('Transition to perform'), 'The transition listed will cause the document to change from its current state to the listed destination state.', 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
922 $transition_fields[] = new KTTextWidget( 922 $transition_fields[] = new KTTextWidget(
923 - _('Reason for transition'), _('Describe why this document qualifies to be changed from its current state to the destination state of the transition chosen.'), 923 + _kt('Reason for transition'), _('Describe why this document qualifies to be changed from its current state to the destination state of the transition chosen.'),
924 'fComments', "", 924 'fComments', "",
925 $this->oPage, true, null, null, 925 $this->oPage, true, null, null,
926 array('cols' => 80, 'rows' => 4)); 926 array('cols' => 80, 'rows' => 4));
@@ -943,7 +943,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { @@ -943,7 +943,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
943 if (PEAR::isError($res)) { 943 if (PEAR::isError($res)) {
944 $this->errorRedirectToMain($res->message, sprintf('fDocumentId=%s',$oDocument->getId())); 944 $this->errorRedirectToMain($res->message, sprintf('fDocumentId=%s',$oDocument->getId()));
945 } 945 }
946 - $this->successRedirectToMain(_('Workflow started'), 946 + $this->successRedirectToMain(_kt('Workflow started'),
947 array('fDocumentId' => $oDocument->getId())); 947 array('fDocumentId' => $oDocument->getId()));
948 exit(0); 948 exit(0);
949 } 949 }
@@ -961,7 +961,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { @@ -961,7 +961,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
961 961
962 $oUser =& User::get($_SESSION['userID']); 962 $oUser =& User::get($_SESSION['userID']);
963 $res = KTWorkflowUtil::performTransitionOnDocument($oTransition, $oDocument, $oUser, $sComments); 963 $res = KTWorkflowUtil::performTransitionOnDocument($oTransition, $oDocument, $oUser, $sComments);
964 - $this->successRedirectToMain(_('Transition performed'), 964 + $this->successRedirectToMain(_kt('Transition performed'),
965 array('fDocumentId' => $oDocument->getId())); 965 array('fDocumentId' => $oDocument->getId()));
966 } 966 }
967 } 967 }
plugins/ktcore/KTFolderActions.php
@@ -46,14 +46,14 @@ class KTFolderAddFolderAction extends KTFolderAction { @@ -46,14 +46,14 @@ class KTFolderAddFolderAction extends KTFolderAction {
46 var $_sShowPermission = "ktcore.permissions.addFolder"; 46 var $_sShowPermission = "ktcore.permissions.addFolder";
47 47
48 function getDisplayName() { 48 function getDisplayName() {
49 - return _('Add a Folder'); 49 + return _kt('Add a Folder');
50 } 50 }
51 51
52 function do_main() { 52 function do_main() {
53 - $this->oPage->setBreadcrumbDetails(_("add folder")); 53 + $this->oPage->setBreadcrumbDetails(_kt("add folder"));
54 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/addFolder'); 54 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/addFolder');
55 $fields = array(); 55 $fields = array();
56 - $fields[] = new KTStringWidget(_('Folder name'), _('The name for the new folder.'), 'name', "", $this->oPage, true); 56 + $fields[] = new KTStringWidget(_kt('Folder name'), _('The name for the new folder.'), 'name', "", $this->oPage, true);
57 57
58 $oTemplate->setData(array( 58 $oTemplate->setData(array(
59 'context' => &$this, 59 'context' => &$this,
@@ -67,13 +67,13 @@ class KTFolderAddFolderAction extends KTFolderAction { @@ -67,13 +67,13 @@ class KTFolderAddFolderAction extends KTFolderAction {
67 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), 67 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
68 ); 68 );
69 $sFolderName = KTUtil::arrayGet($_REQUEST, 'name'); 69 $sFolderName = KTUtil::arrayGet($_REQUEST, 'name');
70 - $aErrorOptions['defaultmessage'] = _("No name given"); 70 + $aErrorOptions['defaultmessage'] = _kt("No name given");
71 $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions); 71 $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions);
72 72
73 $this->startTransaction(); 73 $this->startTransaction();
74 74
75 $res = KTFolderUtil::add($this->oFolder, $sFolderName, $this->oUser); 75 $res = KTFolderUtil::add($this->oFolder, $sFolderName, $this->oUser);
76 - $aErrorOptions['defaultmessage'] = _("Could not create folder in the document management system"); 76 + $aErrorOptions['defaultmessage'] = _kt("Could not create folder in the document management system");
77 $this->oValidator->notError($res, $aErrorOptions); 77 $this->oValidator->notError($res, $aErrorOptions);
78 78
79 $this->commitTransaction(); 79 $this->commitTransaction();
@@ -90,11 +90,11 @@ class KTFolderPermissionsAction extends KTFolderAction { @@ -90,11 +90,11 @@ class KTFolderPermissionsAction extends KTFolderAction {
90 var $bAutomaticTransaction = true; 90 var $bAutomaticTransaction = true;
91 91
92 function getDisplayName() { 92 function getDisplayName() {
93 - return _('Permissions'); 93 + return _kt('Permissions');
94 } 94 }
95 95
96 function do_main() { 96 function do_main() {
97 - $this->oPage->setBreadcrumbDetails(_("viewing permissions")); 97 + $this->oPage->setBreadcrumbDetails(_kt("viewing permissions"));
98 $oTemplating =& KTTemplating::getSingleton(); 98 $oTemplating =& KTTemplating::getSingleton();
99 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions"); 99 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions");
100 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); 100 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
@@ -177,13 +177,13 @@ class KTFolderPermissionsAction extends KTFolderAction { @@ -177,13 +177,13 @@ class KTFolderPermissionsAction extends KTFolderAction {
177 177
178 function do_copyPermissions() { 178 function do_copyPermissions() {
179 KTPermissionUtil::copyPermissionObject($this->oFolder); 179 KTPermissionUtil::copyPermissionObject($this->oFolder);
180 - return $this->successRedirectToMain(_('Permissions updated'), 180 + return $this->successRedirectToMain(_kt('Permissions updated'),
181 array('fFolderId' => $this->oFolder->getId())); 181 array('fFolderId' => $this->oFolder->getId()));
182 } 182 }
183 183
184 function do_inheritPermissions() { 184 function do_inheritPermissions() {
185 KTPermissionUtil::inheritPermissionObject($this->oFolder); 185 KTPermissionUtil::inheritPermissionObject($this->oFolder);
186 - return $this->successRedirectToMain(_('Permissions updated'), 186 + return $this->successRedirectToMain(_kt('Permissions updated'),
187 array('fFolderId' => $this->oFolder->getId())); 187 array('fFolderId' => $this->oFolder->getId()));
188 } 188 }
189 189
@@ -194,7 +194,7 @@ class KTFolderPermissionsAction extends KTFolderAction { @@ -194,7 +194,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
194 $oGroup =& $this->oValidator->validateGroup($_REQUEST['fGroupId'], $aOptions); 194 $oGroup =& $this->oValidator->validateGroup($_REQUEST['fGroupId'], $aOptions);
195 $oCondition =& $this->oValidator->validateCondition($_REQUEST['fConditionId'], $aOptions); 195 $oCondition =& $this->oValidator->validateCondition($_REQUEST['fConditionId'], $aOptions);
196 $aPermissionIds = (array) $_REQUEST['fPermissionIds']; 196 $aPermissionIds = (array) $_REQUEST['fPermissionIds'];
197 - if (empty($aPermissionIds)) { $this->errorRedirectTo('main',_('Please select one or more permissions.'), sprintf('fFolderId=%d', $this->oFolder->getId())); } 197 + if (empty($aPermissionIds)) { $this->errorRedirectTo('main', _kt('Please select one or more permissions.'), sprintf('fFolderId=%d', $this->oFolder->getId())); }
198 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); 198 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
199 199
200 $oDynamicCondition = KTPermissionDynamicCondition::createFromArray(array( 200 $oDynamicCondition = KTPermissionDynamicCondition::createFromArray(array(
@@ -206,7 +206,7 @@ class KTFolderPermissionsAction extends KTFolderAction { @@ -206,7 +206,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
206 $res = $oDynamicCondition->saveAssignment($aPermissionIds); 206 $res = $oDynamicCondition->saveAssignment($aPermissionIds);
207 $this->oValidator->notError($res, $aOptions); 207 $this->oValidator->notError($res, $aOptions);
208 KTPermissionUtil::updatePermissionLookupForPO($oPO); 208 KTPermissionUtil::updatePermissionLookupForPO($oPO);
209 - $this->successRedirectToMain(_("Dynamic permission added"), "fFolderId=" . $this->oFolder->getId()); 209 + $this->successRedirectToMain(_kt("Dynamic permission added"), "fFolderId=" . $this->oFolder->getId());
210 } 210 }
211 211
212 function do_removeDynamicCondition() { 212 function do_removeDynamicCondition() {
@@ -218,7 +218,7 @@ class KTFolderPermissionsAction extends KTFolderAction { @@ -218,7 +218,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
218 $this->oValidator->notError($res, $aOptions); 218 $this->oValidator->notError($res, $aOptions);
219 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); 219 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
220 KTPermissionUtil::updatePermissionLookupForPO($oPO); 220 KTPermissionUtil::updatePermissionLookupForPO($oPO);
221 - $this->successRedirectToMain(_("Dynamic permission removed"), "fFolderId=" . $this->oFolder->getId()); 221 + $this->successRedirectToMain(_kt("Dynamic permission removed"), "fFolderId=" . $this->oFolder->getId());
222 } 222 }
223 } 223 }
224 224
plugins/ktcore/KTPermissions.php
@@ -50,7 +50,7 @@ class KTDocumentPermissionsAction extends KTDocumentAction { @@ -50,7 +50,7 @@ class KTDocumentPermissionsAction extends KTDocumentAction {
50 var $_bAdminAlwaysAvailable = true; 50 var $_bAdminAlwaysAvailable = true;
51 51
52 function getDisplayName() { 52 function getDisplayName() {
53 - return _('Permissions'); 53 + return _kt('Permissions');
54 } 54 }
55 55
56 function do_main() { 56 function do_main() {
@@ -150,12 +150,12 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -150,12 +150,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
150 var $_bAdminAlwaysAvailable = true; 150 var $_bAdminAlwaysAvailable = true;
151 151
152 function getDisplayName() { 152 function getDisplayName() {
153 - return _('Allocate Roles'); 153 + return _kt('Allocate Roles');
154 } 154 }
155 155
156 function do_main() { 156 function do_main() {
157 - $this->oPage->setTitle(_("Allocate Roles"));  
158 - $this->oPage->setBreadcrumbDetails(_("Allocate Roles")); 157 + $this->oPage->setTitle(_kt("Allocate Roles"));
  158 + $this->oPage->setBreadcrumbDetails(_kt("Allocate Roles"));
159 $oTemplating =& KTTemplating::getSingleton(); 159 $oTemplating =& KTTemplating::getSingleton();
160 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/roles"); 160 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/roles");
161 161
@@ -230,7 +230,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -230,7 +230,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
230 } 230 }
231 } 231 }
232 if (empty($_users)) { 232 if (empty($_users)) {
233 - $aRoles[$key]['users'] = '<span class="descriptiveText"> ' . _('no users') . '</span>'; 233 + $aRoles[$key]['users'] = '<span class="descriptiveText"> ' . _kt('no users') . '</span>';
234 } else { 234 } else {
235 $aRoles[$key]['users'] = join(', ',$_users); 235 $aRoles[$key]['users'] = join(', ',$_users);
236 } 236 }
@@ -244,7 +244,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -244,7 +244,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
244 } 244 }
245 } 245 }
246 if (empty($_groups)) { 246 if (empty($_groups)) {
247 - $aRoles[$key]['groups'] = '<span class="descriptiveText"> ' . _('no groups') . '</span>'; 247 + $aRoles[$key]['groups'] = '<span class="descriptiveText"> ' . _kt('no groups') . '</span>';
248 } else { 248 } else {
249 $aRoles[$key]['groups'] = join(', ',$_groups); 249 $aRoles[$key]['groups'] = join(', ',$_groups);
250 } 250 }
@@ -263,7 +263,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -263,7 +263,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
263 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null); 263 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
264 $oRole = Role::get($role_id); 264 $oRole = Role::get($role_id);
265 if (PEAR::isError($oRole)) { 265 if (PEAR::isError($oRole)) {
266 - $this->errorRedirectToMain(_('Invalid Role.')); 266 + $this->errorRedirectToMain(_kt('Invalid Role.'));
267 } 267 }
268 // FIXME do we need to check that this role _isn't_ allocated? 268 // FIXME do we need to check that this role _isn't_ allocated?
269 $oRoleAllocation = new RoleAllocation(); 269 $oRoleAllocation = new RoleAllocation();
@@ -280,38 +280,38 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -280,38 +280,38 @@ class KTRoleAllocationPlugin extends KTFolderAction {
280 $res = $oRoleAllocation->create(); 280 $res = $oRoleAllocation->create();
281 281
282 if (PEAR::isError($res) || ($res == false)) { 282 if (PEAR::isError($res) || ($res == false)) {
283 - $this->errorRedirectToMain(_('Failed to create the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId())); 283 + $this->errorRedirectToMain(_kt('Failed to create the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId()));
284 } 284 }
285 285
286 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId()); 286 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId());
287 287
288 - $this->successRedirectToMain(_('Role allocation created.'), sprintf('fFolderId=%d', $this->oFolder->getId())); 288 + $this->successRedirectToMain(_kt('Role allocation created.'), sprintf('fFolderId=%d', $this->oFolder->getId()));
289 } 289 }
290 290
291 function do_useParent() { 291 function do_useParent() {
292 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null); 292 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
293 $oRole = Role::get($role_id); 293 $oRole = Role::get($role_id);
294 if (PEAR::isError($oRole)) { 294 if (PEAR::isError($oRole)) {
295 - $this->errorRedirectToMain(_('Invalid Role.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 295 + $this->errorRedirectToMain(_kt('Invalid Role.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
296 } 296 }
297 $role_id = $oRole->getId(); // numeric, for various testing purposes. 297 $role_id = $oRole->getId(); // numeric, for various testing purposes.
298 298
299 $oRoleAllocation = RoleAllocation::getAllocationsForFolderAndRole($this->oFolder->getId(), $role_id); 299 $oRoleAllocation = RoleAllocation::getAllocationsForFolderAndRole($this->oFolder->getId(), $role_id);
300 300
301 if ($oRoleAllocation->getFolderId() != $this->oFolder->getId()) { 301 if ($oRoleAllocation->getFolderId() != $this->oFolder->getId()) {
302 - $this->errorRedirectToMain(_('Already using a different descriptor.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 302 + $this->errorRedirectToMain(_kt('Already using a different descriptor.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
303 } 303 }
304 $this->startTransaction(); 304 $this->startTransaction();
305 305
306 $res = $oRoleAllocation->delete(); 306 $res = $oRoleAllocation->delete();
307 307
308 if (PEAR::isError($res) || ($res == false)) { 308 if (PEAR::isError($res) || ($res == false)) {
309 - $this->errorRedirectToMain(_('Unable to change role allocation.') . print_r($res, true), sprintf('fFolderId=%d',$this->oFolder->getId())); 309 + $this->errorRedirectToMain(_kt('Unable to change role allocation.') . print_r($res, true), sprintf('fFolderId=%d',$this->oFolder->getId()));
310 exit(0); 310 exit(0);
311 } 311 }
312 312
313 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId()); 313 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId());
314 - $this->successRedirectToMain(_('Role now uses parent.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 314 + $this->successRedirectToMain(_kt('Role now uses parent.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
315 } 315 }
316 316
317 function do_editRoleUsers() { 317 function do_editRoleUsers() {
@@ -319,12 +319,12 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -319,12 +319,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
319 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id'); 319 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id');
320 $oRoleAllocation = RoleAllocation::get($role_allocation_id); 320 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
321 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) { 321 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) {
322 - $this->errorRedirectToMain(_('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 322 + $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
323 } 323 }
324 324
325 325
326 - $this->oPage->setBreadcrumbDetails(_('Manage Users for Role'));  
327 - $this->oPage->setTitle(sprintf(_('Manage Users for Role'))); 326 + $this->oPage->setBreadcrumbDetails(_kt('Manage Users for Role'));
  327 + $this->oPage->setTitle(sprintf(_kt('Manage Users for Role')));
328 328
329 $initJS = 'var optGroup = new OptionTransfer("userSelect","chosenUsers"); ' . 329 $initJS = 'var optGroup = new OptionTransfer("userSelect","chosenUsers"); ' .
330 'function startTrans() { var f = getElement("userroleform"); ' . 330 'function startTrans() { var f = getElement("userroleform"); ' .
@@ -365,12 +365,12 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -365,12 +365,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
365 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id'); 365 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id');
366 $oRoleAllocation = RoleAllocation::get($role_allocation_id); 366 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
367 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) { 367 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) {
368 - $this->errorRedirectToMain(_('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 368 + $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
369 } 369 }
370 370
371 371
372 - $this->oPage->setBreadcrumbDetails(_('Manage Groups for Role'));  
373 - $this->oPage->setTitle(sprintf(_('Manage Groups for Role'))); 372 + $this->oPage->setBreadcrumbDetails(_kt('Manage Groups for Role'));
  373 + $this->oPage->setTitle(sprintf(_kt('Manage Groups for Role')));
374 374
375 $initJS = 'var optGroup = new OptionTransfer("groupSelect","chosenGroups"); ' . 375 $initJS = 'var optGroup = new OptionTransfer("groupSelect","chosenGroups"); ' .
376 'function startTrans() { var f = getElement("grouproleform"); ' . 376 'function startTrans() { var f = getElement("grouproleform"); ' .
@@ -411,7 +411,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -411,7 +411,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
411 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'allocation_id'); 411 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'allocation_id');
412 $oRoleAllocation = RoleAllocation::get($role_allocation_id); 412 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
413 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) { 413 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) {
414 - $this->errorRedirectToMain(_('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 414 + $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
415 } 415 }
416 $users = KTUtil::arrayGet($_REQUEST, 'userFinal', ''); 416 $users = KTUtil::arrayGet($_REQUEST, 'userFinal', '');
417 $aUserIds = explode(',', $users); 417 $aUserIds = explode(',', $users);
@@ -440,12 +440,12 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -440,12 +440,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
440 $res = $oRoleAllocation->update(); 440 $res = $oRoleAllocation->update();
441 441
442 if (PEAR::isError($res) || ($res == false)) { 442 if (PEAR::isError($res) || ($res == false)) {
443 - $this->errorRedirectToMain(_('Failed to change the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId())); 443 + $this->errorRedirectToMain(_kt('Failed to change the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId()));
444 } 444 }
445 445
446 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId()); 446 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId());
447 447
448 - $this->successRedirectToMain(_('Allocation changed.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 448 + $this->successRedirectToMain(_kt('Allocation changed.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
449 } 449 }
450 450
451 function do_setRoleGroups() { 451 function do_setRoleGroups() {
@@ -453,7 +453,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -453,7 +453,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
453 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'allocation_id'); 453 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'allocation_id');
454 $oRoleAllocation = RoleAllocation::get($role_allocation_id); 454 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
455 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) { 455 if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) {
456 - $this->errorRedirectToMain(_('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 456 + $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
457 } 457 }
458 $groups = KTUtil::arrayGet($_REQUEST, 'groupFinal', ''); 458 $groups = KTUtil::arrayGet($_REQUEST, 'groupFinal', '');
459 $aGroupIds = explode(',', $groups); 459 $aGroupIds = explode(',', $groups);
@@ -482,12 +482,12 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -482,12 +482,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
482 $res = $oRoleAllocation->update(); 482 $res = $oRoleAllocation->update();
483 483
484 if (PEAR::isError($res) || ($res == false)) { 484 if (PEAR::isError($res) || ($res == false)) {
485 - $this->errorRedirectToMain(_('Failed to change the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId())); 485 + $this->errorRedirectToMain(_kt('Failed to change the role allocation.') . print_r($res, true), sprintf('fFolderId=%d', $this->oFolder->getId()));
486 } 486 }
487 487
488 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId()); 488 $this->renegeratePermissionsForRole($oRoleAllocation->getRoleId());
489 489
490 - $this->successRedirectToMain(_('Allocation changed.'), sprintf('fFolderId=%d',$this->oFolder->getId())); 490 + $this->successRedirectToMain(_kt('Allocation changed.'), sprintf('fFolderId=%d',$this->oFolder->getId()));
491 } 491 }
492 492
493 function renegeratePermissionsForRole($iRoleId) { 493 function renegeratePermissionsForRole($iRoleId) {
@@ -523,7 +523,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -523,7 +523,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
523 523
524 $aNewFolders = DBUtil::getResultArrayKey(array($sQuery, $aParams), 'id'); 524 $aNewFolders = DBUtil::getResultArrayKey(array($sQuery, $aParams), 'id');
525 if (PEAR::isError($aNewFolders)) { 525 if (PEAR::isError($aNewFolders)) {
526 - $this->errorRedirectToMain(_('Failure to generate folderlisting.')); 526 + $this->errorRedirectToMain(_kt('Failure to generate folderlisting.'));
527 } 527 }
528 $folder_queue = array_merge ($folder_queue, (array) $aNewFolders); // push. 528 $folder_queue = array_merge ($folder_queue, (array) $aNewFolders); // push.
529 529
@@ -531,13 +531,13 @@ class KTRoleAllocationPlugin extends KTFolderAction { @@ -531,13 +531,13 @@ class KTRoleAllocationPlugin extends KTFolderAction {
531 // update the folder. 531 // update the folder.
532 $oFolder =& Folder::get($active_folder); 532 $oFolder =& Folder::get($active_folder);
533 if (PEAR::isError($oFolder) || ($oFolder == false)) { 533 if (PEAR::isError($oFolder) || ($oFolder == false)) {
534 - $this->errorRedirectToMain(_('Unable to locate folder: ') . $active_folder); 534 + $this->errorRedirectToMain(_kt('Unable to locate folder: ') . $active_folder);
535 } 535 }
536 536
537 KTPermissionUtil::updatePermissionLookup($oFolder); 537 KTPermissionUtil::updatePermissionLookup($oFolder);
538 $aDocList =& Document::getList(array('folder_id = ?', $active_folder)); 538 $aDocList =& Document::getList(array('folder_id = ?', $active_folder));
539 if (PEAR::isError($aDocList) || ($aDocList === false)) { 539 if (PEAR::isError($aDocList) || ($aDocList === false)) {
540 - $this->errorRedirectToMain(sprintf(_('Unable to get documents in folder %s: %s'), $active_folder, $aDocList->getMessage())); 540 + $this->errorRedirectToMain(sprintf(_kt('Unable to get documents in folder %s: %s'), $active_folder, $aDocList->getMessage()));
541 } 541 }
542 542
543 foreach ($aDocList as $oDoc) { 543 foreach ($aDocList as $oDoc) {
@@ -555,8 +555,8 @@ class KTDocumentRolesAction extends KTDocumentAction { @@ -555,8 +555,8 @@ class KTDocumentRolesAction extends KTDocumentAction {
555 var $bAutomaticTransaction = true; 555 var $bAutomaticTransaction = true;
556 556
557 function do_main() { 557 function do_main() {
558 - $this->oPage->setTitle(_("View Roles"));  
559 - $this->oPage->setBreadcrumbDetails(_("View Roles")); 558 + $this->oPage->setTitle(_kt("View Roles"));
  559 + $this->oPage->setBreadcrumbDetails(_kt("View Roles"));
560 $oTemplating = new KTTemplating; 560 $oTemplating = new KTTemplating;
561 $oTemplate = $oTemplating->loadTemplate("ktcore/action/view_roles"); 561 $oTemplate = $oTemplating->loadTemplate("ktcore/action/view_roles");
562 562
@@ -610,7 +610,7 @@ class KTDocumentRolesAction extends KTDocumentAction { @@ -610,7 +610,7 @@ class KTDocumentRolesAction extends KTDocumentAction {
610 } 610 }
611 } 611 }
612 if (empty($_users)) { 612 if (empty($_users)) {
613 - $aRoles[$key]['users'] = '<span class="descriptiveText"> ' . _('no users') . '</span>'; 613 + $aRoles[$key]['users'] = '<span class="descriptiveText"> ' . _kt('no users') . '</span>';
614 } else { 614 } else {
615 $aRoles[$key]['users'] = implode(', ',$_users); 615 $aRoles[$key]['users'] = implode(', ',$_users);
616 } 616 }
@@ -623,7 +623,7 @@ class KTDocumentRolesAction extends KTDocumentAction { @@ -623,7 +623,7 @@ class KTDocumentRolesAction extends KTDocumentAction {
623 } 623 }
624 } 624 }
625 if (empty($_groups)) { 625 if (empty($_groups)) {
626 - $aRoles[$key]['groups'] = '<span class="descriptiveText"> ' . _('no groups') . '</span>'; 626 + $aRoles[$key]['groups'] = '<span class="descriptiveText"> ' . _kt('no groups') . '</span>';
627 } else { 627 } else {
628 $aRoles[$key]['groups'] = implode(', ',$_groups); 628 $aRoles[$key]['groups'] = implode(', ',$_groups);
629 } 629 }
plugins/ktcore/KTPortlets.php
@@ -32,7 +32,7 @@ require_once(KT_LIB_DIR . &#39;/widgets/portlet.inc.php&#39;); @@ -32,7 +32,7 @@ require_once(KT_LIB_DIR . &#39;/widgets/portlet.inc.php&#39;);
32 class KTSearchPortlet extends KTPortlet { 32 class KTSearchPortlet extends KTPortlet {
33 33
34 function KTSearchPortlet() { 34 function KTSearchPortlet() {
35 - parent::KTPortlet(_("Search")); 35 + parent::KTPortlet(_kt("Search"));
36 } 36 }
37 function render() { 37 function render() {
38 require_once(KT_LIB_DIR . '/search/savedsearch.inc.php'); 38 require_once(KT_LIB_DIR . '/search/savedsearch.inc.php');
@@ -62,7 +62,7 @@ class KTBrowseModePortlet extends KTPortlet { @@ -62,7 +62,7 @@ class KTBrowseModePortlet extends KTPortlet {
62 function KTBrowseModePortlet($sTitle = null) { 62 function KTBrowseModePortlet($sTitle = null) {
63 // match empty, false. 63 // match empty, false.
64 if ($sTitle == null) { 64 if ($sTitle == null) {
65 - $sTitle = _('Browse Documents By'); 65 + $sTitle = _kt('Browse Documents By');
66 } 66 }
67 parent::KTPortlet($sTitle); 67 parent::KTPortlet($sTitle);
68 } 68 }
@@ -71,9 +71,9 @@ class KTBrowseModePortlet extends KTPortlet { @@ -71,9 +71,9 @@ class KTBrowseModePortlet extends KTPortlet {
71 // this is unfortunate, but such is life. 71 // this is unfortunate, but such is life.
72 $current_action = KTUtil::arrayGet($_REQUEST, 'fBrowseMode', null); 72 $current_action = KTUtil::arrayGet($_REQUEST, 'fBrowseMode', null);
73 $modes = array( 73 $modes = array(
74 - 'folder' => array('name' => _('Folder'), 'target' => "main"),  
75 - 'document_type' => array('name' => _('Document Type'), 'target' => 'selectType'),  
76 - 'lookup_value' => array('name' => _('Lookup Value'), 'target' => 'selectField'), 74 + 'folder' => array('name' => _kt('Folder'), 'target' => "main"),
  75 + 'document_type' => array('name' => _kt('Document Type'), 'target' => 'selectType'),
  76 + 'lookup_value' => array('name' => _kt('Lookup Value'), 'target' => 'selectField'),
77 ); 77 );
78 78
79 $oTemplating =& KTTemplating::getSingleton(); 79 $oTemplating =& KTTemplating::getSingleton();
@@ -92,7 +92,7 @@ class KTBrowseModePortlet extends KTPortlet { @@ -92,7 +92,7 @@ class KTBrowseModePortlet extends KTPortlet {
92 class KTAdminModePortlet extends KTPortlet { 92 class KTAdminModePortlet extends KTPortlet {
93 93
94 function KTAdminModePortlet() { 94 function KTAdminModePortlet() {
95 - parent::KTPortlet(_("Administrator mode")); 95 + parent::KTPortlet(_kt("Administrator mode"));
96 } 96 }
97 function render() { 97 function render() {
98 $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1); 98 $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1);
@@ -139,7 +139,7 @@ class KTAdminModePortlet extends KTPortlet { @@ -139,7 +139,7 @@ class KTAdminModePortlet extends KTPortlet {
139 class KTAdminSectionNavigation extends KTPortlet { 139 class KTAdminSectionNavigation extends KTPortlet {
140 140
141 function KTAdminSectionNavigation() { 141 function KTAdminSectionNavigation() {
142 - parent::KTPortlet(_("Administration")); 142 + parent::KTPortlet(_kt("Administration"));
143 } 143 }
144 144
145 function render() { 145 function render() {
plugins/ktcore/admin/archivedDocuments.php
@@ -58,13 +58,13 @@ class KTArchiveTitle extends TitleColumn { @@ -58,13 +58,13 @@ class KTArchiveTitle extends TitleColumn {
58 class ArchivedDocumentsDispatcher extends KTAdminDispatcher { 58 class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
59 59
60 function do_main () { 60 function do_main () {
61 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Archived Documents')); 61 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Archived Documents'));
62 62
63 - $this->oPage->setBreadcrumbDetails(_('browse')); 63 + $this->oPage->setBreadcrumbDetails(_kt('browse'));
64 64
65 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1)); 65 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1));
66 if (PEAR::isError($oFolder)) { 66 if (PEAR::isError($oFolder)) {
67 - $this->errorRedirectToMain(_('Invalid folder selected.')); 67 + $this->errorRedirectToMain(_kt('Invalid folder selected.'));
68 exit(0); 68 exit(0);
69 } 69 }
70 70
@@ -129,21 +129,21 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher { @@ -129,21 +129,21 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
129 } 129 }
130 130
131 function do_confirm_restore() { 131 function do_confirm_restore() {
132 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Archived Documents')); 132 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Archived Documents'));
133 133
134 $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array()); 134 $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
135 135
136 - $this->oPage->setTitle(sprintf(_('Confirm Restore of %d documents'), count($selected_docs))); 136 + $this->oPage->setTitle(sprintf(_kt('Confirm Restore of %d documents'), count($selected_docs)));
137 137
138 - $this->oPage->setBreadcrumbDetails(sprintf(_('confirm restore of %d documents'), count($selected_docs))); 138 + $this->oPage->setBreadcrumbDetails(sprintf(_kt('confirm restore of %d documents'), count($selected_docs)));
139 139
140 $aDocuments = array(); 140 $aDocuments = array();
141 foreach ($selected_docs as $doc_id) { 141 foreach ($selected_docs as $doc_id) {
142 $oDoc =& Document::get($doc_id); 142 $oDoc =& Document::get($doc_id);
143 if (PEAR::isError($oDoc) || ($oDoc === false)) { 143 if (PEAR::isError($oDoc) || ($oDoc === false)) {
144 - $this->errorRedirectToMain(_('Invalid document id specified. Aborting restore.')); 144 + $this->errorRedirectToMain(_kt('Invalid document id specified. Aborting restore.'));
145 } else if ($oDoc->getStatusId() != ARCHIVED) { 145 } else if ($oDoc->getStatusId() != ARCHIVED) {
146 - $this->errorRedirectToMain(sprintf(_('%s is not an archived document. Aborting restore.'), $oDoc->getName())); 146 + $this->errorRedirectToMain(sprintf(_kt('%s is not an archived document. Aborting restore.'), $oDoc->getName()));
147 } 147 }
148 $aDocuments[] = $oDoc; 148 $aDocuments[] = $oDoc;
149 } 149 }
@@ -167,9 +167,9 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher { @@ -167,9 +167,9 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
167 foreach ($selected_docs as $doc_id) { 167 foreach ($selected_docs as $doc_id) {
168 $oDoc =& Document::get($doc_id); 168 $oDoc =& Document::get($doc_id);
169 if (PEAR::isError($oDoc) || ($oDoc === false)) { 169 if (PEAR::isError($oDoc) || ($oDoc === false)) {
170 - $this->errorRedirectToMain(_('Invalid document id specified. Aborting restore.')); 170 + $this->errorRedirectToMain(_kt('Invalid document id specified. Aborting restore.'));
171 } else if ($oDoc->getStatusId() != ARCHIVED) { 171 } else if ($oDoc->getStatusId() != ARCHIVED) {
172 - $this->errorRedirectToMain(sprintf(_('%s is not an archived document. Aborting restore.'), $oDoc->getName())); 172 + $this->errorRedirectToMain(sprintf(_kt('%s is not an archived document. Aborting restore.'), $oDoc->getName()));
173 } 173 }
174 $aDocuments[] = $oDoc; 174 $aDocuments[] = $oDoc;
175 } 175 }
@@ -183,11 +183,11 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher { @@ -183,11 +183,11 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
183 $oDoc->setStatusId(LIVE); 183 $oDoc->setStatusId(LIVE);
184 $res = $oDoc->update(); 184 $res = $oDoc->update();
185 if (PEAR::isError($res) || ($res == false)) { 185 if (PEAR::isError($res) || ($res == false)) {
186 - $this->errorRedirectToMain(sprintf(_('%s could not be made "live".'), $oDoc->getName)); 186 + $this->errorRedirectToMain(sprintf(_kt('%s could not be made "live".'), $oDoc->getName));
187 } 187 }
188 } 188 }
189 $this->commitTransaction(); 189 $this->commitTransaction();
190 - $msg = sprintf(_('%d documents made active.'), count($aDocuments)); 190 + $msg = sprintf(_kt('%d documents made active.'), count($aDocuments));
191 $this->successRedirectToMain($msg); 191 $this->successRedirectToMain($msg);
192 } 192 }
193 } 193 }
plugins/ktcore/admin/conditions.php
@@ -35,7 +35,7 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -35,7 +35,7 @@ class KTConditionDispatcher extends KTAdminDispatcher {
35 var $bAutomaticTransaction = true; 35 var $bAutomaticTransaction = true;
36 36
37 function check() { 37 function check() {
38 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Conditions Management')); 38 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Conditions Management'));
39 return true; 39 return true;
40 } 40 }
41 41
@@ -48,8 +48,8 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -48,8 +48,8 @@ class KTConditionDispatcher extends KTAdminDispatcher {
48 } 48 }
49 49
50 function do_new() { 50 function do_new() {
51 - $this->oPage->setBreadcrumbDetails(_('Create a new condition'));  
52 - $this->oPage->setTitle(_('Create a new condition')); 51 + $this->oPage->setBreadcrumbDetails(_kt('Create a new condition'));
  52 + $this->oPage->setTitle(_kt('Create a new condition'));
53 53
54 $oTemplating =& KTTemplating::getSingleton(); 54 $oTemplating =& KTTemplating::getSingleton();
55 $oTemplate = $oTemplating->loadTemplate("ktcore/boolean_search"); 55 $oTemplate = $oTemplating->loadTemplate("ktcore/boolean_search");
@@ -57,10 +57,10 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -57,10 +57,10 @@ class KTConditionDispatcher extends KTAdminDispatcher {
57 $aCriteria = Criteria::getAllCriteria(); 57 $aCriteria = Criteria::getAllCriteria();
58 58
59 $aTemplateData = array( 59 $aTemplateData = array(
60 - "title" => _("Create a new condition"),  
61 - "sNameTitle" => _("Name of condition"), 60 + "title" => _kt("Create a new condition"),
  61 + "sNameTitle" => _kt("Name of condition"),
62 "aCriteria" => $aCriteria, 62 "aCriteria" => $aCriteria,
63 - "searchButton" => _("Save"), 63 + "searchButton" => _kt("Save"),
64 "context" => &$this, 64 "context" => &$this,
65 ); 65 );
66 return $oTemplate->render($aTemplateData); 66 return $oTemplate->render($aTemplateData);
@@ -101,14 +101,14 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -101,14 +101,14 @@ class KTConditionDispatcher extends KTAdminDispatcher {
101 101
102 102
103 $aTemplateData = array( 103 $aTemplateData = array(
104 - "title" => _("Edit an existing condition"), 104 + "title" => _kt("Edit an existing condition"),
105 "aCriteria" => $aCriteria, 105 "aCriteria" => $aCriteria,
106 - "searchButton" => _("Update Dynamic Condition"), 106 + "searchButton" => _kt("Update Dynamic Condition"),
107 'aSearch' => $aSearch, 107 'aSearch' => $aSearch,
108 'context' => $this, 108 'context' => $this,
109 'iSearchId' => $oSearch->getId(), 109 'iSearchId' => $oSearch->getId(),
110 'old_name' => $oSearch->getName(), 110 'old_name' => $oSearch->getName(),
111 - 'sNameTitle' => _('Edit Dynamic Condition'), 111 + 'sNameTitle' => _kt('Edit Dynamic Condition'),
112 ); 112 );
113 return $oTemplate->render($aTemplateData); 113 return $oTemplate->render($aTemplateData);
114 } 114 }
@@ -131,7 +131,7 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -131,7 +131,7 @@ class KTConditionDispatcher extends KTAdminDispatcher {
131 } 131 }
132 132
133 if (empty($datavars)) { 133 if (empty($datavars)) {
134 - $this->errorRedirectToMain(_('You need to have at least 1 condition.')); 134 + $this->errorRedirectToMain(_kt('You need to have at least 1 condition.'));
135 } 135 }
136 136
137 //$sName = "Neil's saved search"; 137 //$sName = "Neil's saved search";
@@ -144,9 +144,9 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -144,9 +144,9 @@ class KTConditionDispatcher extends KTAdminDispatcher {
144 144
145 $this->oValidator->notError($res, array( 145 $this->oValidator->notError($res, array(
146 'redirect_to' => 'main', 146 'redirect_to' => 'main',
147 - 'message' => _('Search not saved'), 147 + 'message' => _kt('Search not saved'),
148 )); 148 ));
149 - $this->successRedirectToMain(_('Dynamic condition saved')); 149 + $this->successRedirectToMain(_kt('Dynamic condition saved'));
150 } 150 }
151 151
152 // XXX: Rename to do_save 152 // XXX: Rename to do_save
@@ -157,7 +157,7 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -157,7 +157,7 @@ class KTConditionDispatcher extends KTAdminDispatcher {
157 } 157 }
158 158
159 if (empty($datavars)) { 159 if (empty($datavars)) {
160 - $this->errorRedirectToMain(_('You need to have at least 1 condition.')); 160 + $this->errorRedirectToMain(_kt('You need to have at least 1 condition.'));
161 } 161 }
162 162
163 $sName = $this->oValidator->validateEntityName( 163 $sName = $this->oValidator->validateEntityName(
@@ -179,9 +179,9 @@ class KTConditionDispatcher extends KTAdminDispatcher { @@ -179,9 +179,9 @@ class KTConditionDispatcher extends KTAdminDispatcher {
179 179
180 $this->oValidator->notError($oSearch, array( 180 $this->oValidator->notError($oSearch, array(
181 'redirect_to' => 'main', 181 'redirect_to' => 'main',
182 - 'message' => _('Search not saved'), 182 + 'message' => _kt('Search not saved'),
183 )); 183 ));
184 - $this->successRedirectToMain(_('Dynamic condition saved')); 184 + $this->successRedirectToMain(_kt('Dynamic condition saved'));
185 } 185 }
186 } 186 }
187 187
plugins/ktcore/admin/deletedDocuments.php
@@ -37,9 +37,9 @@ require_once(KT_LIB_DIR . &quot;/templating/kt3template.inc.php&quot;); @@ -37,9 +37,9 @@ require_once(KT_LIB_DIR . &quot;/templating/kt3template.inc.php&quot;);
37 37
38 class DeletedDocumentsDispatcher extends KTAdminDispatcher { 38 class DeletedDocumentsDispatcher extends KTAdminDispatcher {
39 function do_main () { 39 function do_main () {
40 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Deleted Documents')); 40 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Deleted Documents'));
41 41
42 - $this->oPage->setBreadcrumbDetails(_('view')); 42 + $this->oPage->setBreadcrumbDetails(_kt('view'));
43 43
44 $aDocuments =& Document::getList("status_id=" . DELETED); 44 $aDocuments =& Document::getList("status_id=" . DELETED);
45 45
@@ -62,25 +62,25 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher { @@ -62,25 +62,25 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
62 if (array_key_exists('restore', $submit)) { 62 if (array_key_exists('restore', $submit)) {
63 return $this->do_confirm_restore(); 63 return $this->do_confirm_restore();
64 } 64 }
65 - $this->errorRedirectToMain(_('No action specified.')); 65 + $this->errorRedirectToMain(_kt('No action specified.'));
66 } 66 }
67 67
68 function do_confirm_expunge() { 68 function do_confirm_expunge() {
69 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Deleted Documents')); 69 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Deleted Documents'));
70 70
71 $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array()); 71 $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
72 72
73 - $this->oPage->setTitle(sprintf(_('Confirm Expunge of %d documents'), count($selected_docs))); 73 + $this->oPage->setTitle(sprintf(_kt('Confirm Expunge of %d documents'), count($selected_docs)));
74 74
75 - $this->oPage->setBreadcrumbDetails(sprintf(_('confirm expunge of %d documents'), count($selected_docs))); 75 + $this->oPage->setBreadcrumbDetails(sprintf(_kt('confirm expunge of %d documents'), count($selected_docs)));
76 76
77 $aDocuments = array(); 77 $aDocuments = array();
78 foreach ($selected_docs as $doc_id) { 78 foreach ($selected_docs as $doc_id) {
79 $oDoc =& Document::get($doc_id); 79 $oDoc =& Document::get($doc_id);
80 if (PEAR::isError($oDoc) || ($oDoc === false)) { 80 if (PEAR::isError($oDoc) || ($oDoc === false)) {
81 - $this->errorRedirectToMain(_('Invalid document id specified. Aborting expunge')); 81 + $this->errorRedirectToMain(_kt('Invalid document id specified. Aborting expunge'));
82 } else if ($oDoc->getStatusId() != DELETED) { 82 } else if ($oDoc->getStatusId() != DELETED) {
83 - $this->errorRedirectToMain(sprintf(_('%s is not a deleted document. Aborting expunge'), $oDoc->getName())); 83 + $this->errorRedirectToMain(sprintf(_kt('%s is not a deleted document. Aborting expunge'), $oDoc->getName()));
84 } 84 }
85 $aDocuments[] = $oDoc; 85 $aDocuments[] = $oDoc;
86 } 86 }
@@ -104,9 +104,9 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher { @@ -104,9 +104,9 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
104 foreach ($selected_docs as $doc_id) { 104 foreach ($selected_docs as $doc_id) {
105 $oDoc =& Document::get($doc_id); 105 $oDoc =& Document::get($doc_id);
106 if (PEAR::isError($oDoc) || ($oDoc === false)) { 106 if (PEAR::isError($oDoc) || ($oDoc === false)) {
107 - $this->errorRedirectToMain(_('Invalid document id specified. Aborting expunge')); 107 + $this->errorRedirectToMain(_kt('Invalid document id specified. Aborting expunge'));
108 } else if ($oDoc->getStatusId() != DELETED) { 108 } else if ($oDoc->getStatusId() != DELETED) {
109 - $this->errorRedirectToMain(sprintf(_('%s is not a deleted document. Aborting expunge'), $oDoc->getName())); 109 + $this->errorRedirectToMain(sprintf(_kt('%s is not a deleted document. Aborting expunge'), $oDoc->getName()));
110 } 110 }
111 $aDocuments[] = $oDoc; 111 $aDocuments[] = $oDoc;
112 } 112 }
@@ -139,27 +139,27 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher { @@ -139,27 +139,27 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
139 } 139 }
140 } 140 }
141 $this->commitTransaction(); 141 $this->commitTransaction();
142 - $msg = sprintf(_('%d documents expunged.'), count($aSuccessDocuments));  
143 - if (count($aErrorDocuments) != 0) { $msg .= _('Failed to expunge') . ': ' . join(', ', $aErrorDocuments); } 142 + $msg = sprintf(_kt('%d documents expunged.'), count($aSuccessDocuments));
  143 + if (count($aErrorDocuments) != 0) { $msg .= _kt('Failed to expunge') . ': ' . join(', ', $aErrorDocuments); }
144 $this->successRedirectToMain($msg); 144 $this->successRedirectToMain($msg);
145 } 145 }
146 146
147 function do_confirm_restore() { 147 function do_confirm_restore() {
148 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Deleted Documents')); 148 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Deleted Documents'));
149 149
150 $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array()); 150 $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
151 151
152 - $this->oPage->setTitle(sprintf(_('Confirm Restore of %d documents'), count($selected_docs))); 152 + $this->oPage->setTitle(sprintf(_kt('Confirm Restore of %d documents'), count($selected_docs)));
153 153
154 - $this->oPage->setBreadcrumbDetails(sprintf(_('Confirm Restore of %d documents'), count($selected_docs))); 154 + $this->oPage->setBreadcrumbDetails(sprintf(_kt('Confirm Restore of %d documents'), count($selected_docs)));
155 155
156 $aDocuments = array(); 156 $aDocuments = array();
157 foreach ($selected_docs as $doc_id) { 157 foreach ($selected_docs as $doc_id) {
158 $oDoc =& Document::get($doc_id); 158 $oDoc =& Document::get($doc_id);
159 if (PEAR::isError($oDoc) || ($oDoc === false)) { 159 if (PEAR::isError($oDoc) || ($oDoc === false)) {
160 - $this->errorRedirectToMain(_('Invalid document id specified. Aborting expunge')); 160 + $this->errorRedirectToMain(_kt('Invalid document id specified. Aborting expunge'));
161 } else if ($oDoc->getStatusId() != DELETED) { 161 } else if ($oDoc->getStatusId() != DELETED) {
162 - $this->errorRedirectToMain(sprintf(_('%s is not a deleted document. Aborting expunge'), $oDoc->getName())); 162 + $this->errorRedirectToMain(sprintf(_kt('%s is not a deleted document. Aborting expunge'), $oDoc->getName()));
163 } 163 }
164 $aDocuments[] = $oDoc; 164 $aDocuments[] = $oDoc;
165 } 165 }
@@ -181,9 +181,9 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher { @@ -181,9 +181,9 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
181 foreach ($selected_docs as $doc_id) { 181 foreach ($selected_docs as $doc_id) {
182 $oDoc =& Document::get($doc_id); 182 $oDoc =& Document::get($doc_id);
183 if (PEAR::isError($oDoc) || ($oDoc === false)) { 183 if (PEAR::isError($oDoc) || ($oDoc === false)) {
184 - $this->errorRedirectToMain(_('Invalid document id specified. Aborting restore')); 184 + $this->errorRedirectToMain(_kt('Invalid document id specified. Aborting restore'));
185 } else if ($oDoc->getStatusId() != DELETED) { 185 } else if ($oDoc->getStatusId() != DELETED) {
186 - $this->errorRedirectToMain(sprintf(_('%s is not a deleted document. Aborting restore'), $oDoc->getName())); 186 + $this->errorRedirectToMain(sprintf(_kt('%s is not a deleted document. Aborting restore'), $oDoc->getName()));
187 } 187 }
188 $aDocuments[] = $oDoc; 188 $aDocuments[] = $oDoc;
189 } 189 }
@@ -225,8 +225,8 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher { @@ -225,8 +225,8 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
225 } 225 }
226 } 226 }
227 $this->commitTransaction(); 227 $this->commitTransaction();
228 - $msg = sprintf(_('%d documents restored.'), count($aSuccessDocuments));  
229 - if (count($aErrorDocuments) != 0) { $msg .= _('Failed to restore') . ': ' . join(', ', $aErrorDocuments); } 228 + $msg = sprintf(_kt('%d documents restored.'), count($aSuccessDocuments));
  229 + if (count($aErrorDocuments) != 0) { $msg .= _kt('Failed to restore') . ': ' . join(', ', $aErrorDocuments); }
230 $this->successRedirectToMain($msg); 230 $this->successRedirectToMain($msg);
231 } 231 }
232 232
plugins/ktcore/admin/documentCheckout.php
@@ -39,8 +39,8 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher { @@ -39,8 +39,8 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
39 } 39 }
40 40
41 function do_main() { 41 function do_main() {
42 - $this->aBreadcrumbs[] = array('name' => _('Document Checkout'));  
43 - $this->oPage->setBreadcrumbDetails(_("list checked out documents")); 42 + $this->aBreadcrumbs[] = array('name' => _kt('Document Checkout'));
  43 + $this->oPage->setBreadcrumbDetails(_kt("list checked out documents"));
44 44
45 $aDocuments = Document::getList("is_checked_out = 1"); 45 $aDocuments = Document::getList("is_checked_out = 1");
46 46
@@ -55,17 +55,17 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher { @@ -55,17 +55,17 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
55 55
56 56
57 function do_confirm() { 57 function do_confirm() {
58 - $this->aBreadcrumbs[] = array('name' => _('Document Checkout'));  
59 - $this->oPage->setBreadcrumbDetails(_("confirm forced check-in")); 58 + $this->aBreadcrumbs[] = array('name' => _kt('Document Checkout'));
  59 + $this->oPage->setBreadcrumbDetails(_kt("confirm forced check-in"));
60 60
61 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); 61 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
62 if (empty($document_id)) { 62 if (empty($document_id)) {
63 - return $this->errorRedirectToMain(_('You must select a document to check in first.')); 63 + return $this->errorRedirectToMain(_kt('You must select a document to check in first.'));
64 } 64 }
65 65
66 $oDocument = Document::get($document_id); 66 $oDocument = Document::get($document_id);
67 if (PEAR::isError($oDocument)) { 67 if (PEAR::isError($oDocument)) {
68 - return $this->errorRedirectToMain(_('The document you specified appears to be invalid.')); 68 + return $this->errorRedirectToMain(_kt('The document you specified appears to be invalid.'));
69 } 69 }
70 70
71 $oUser = User::get($oDocument->getCheckedOutUserID()); 71 $oUser = User::get($oDocument->getCheckedOutUserID());
@@ -91,12 +91,12 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher { @@ -91,12 +91,12 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
91 91
92 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); 92 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
93 if (empty($document_id)) { 93 if (empty($document_id)) {
94 - return $this->errorRedirectToMain(_('You must select a document to check in first.')); 94 + return $this->errorRedirectToMain(_kt('You must select a document to check in first.'));
95 } 95 }
96 96
97 $oDocument = Document::get($document_id); 97 $oDocument = Document::get($document_id);
98 if (PEAR::isError($oDocument)) { 98 if (PEAR::isError($oDocument)) {
99 - return $this->errorRedirectToMain(_('The document you specified appears to be invalid.')); 99 + return $this->errorRedirectToMain(_kt('The document you specified appears to be invalid.'));
100 } 100 }
101 101
102 $this->startTransaction(); 102 $this->startTransaction();
@@ -105,7 +105,7 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher { @@ -105,7 +105,7 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
105 $oDocument->setCheckedOutUserID(-1); 105 $oDocument->setCheckedOutUserID(-1);
106 if (!$oDocument->update()) { 106 if (!$oDocument->update()) {
107 $this->rollbackTransaction(); 107 $this->rollbackTransaction();
108 - return $this->errorRedirectToMain(_("Failed to force the document's checkin.")); 108 + return $this->errorRedirectToMain(_kt("Failed to force the document's checkin."));
109 } 109 }
110 110
111 // checkout cancelled transaction 111 // checkout cancelled transaction
@@ -113,10 +113,10 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher { @@ -113,10 +113,10 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
113 $res = $oDocumentTransaction->create(); 113 $res = $oDocumentTransaction->create();
114 if (PEAR::isError($res) || ($res == false)) { 114 if (PEAR::isError($res) || ($res == false)) {
115 $this->rollbackTransaction(); 115 $this->rollbackTransaction();
116 - return $this->errorRedirectToMain(_("Failed to force the document's checkin.")); 116 + return $this->errorRedirectToMain(_kt("Failed to force the document's checkin."));
117 } 117 }
118 $this->commitTransaction(); // FIXME do we want to do this if we can't created the document-transaction? 118 $this->commitTransaction(); // FIXME do we want to do this if we can't created the document-transaction?
119 - return $this->successRedirectToMain(sprintf(_('Successfully forced "%s" to be checked in.'), $oDocument->getName())); 119 + return $this->successRedirectToMain(sprintf(_kt('Successfully forced "%s" to be checked in.'), $oDocument->getName()));
120 } 120 }
121 121
122 122
plugins/ktcore/admin/documentFields.php
@@ -43,22 +43,22 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -43,22 +43,22 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
43 var $bAutomaticTransaction = true; 43 var $bAutomaticTransaction = true;
44 44
45 function check() { 45 function check() {
46 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Document Field Management')); 46 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Document Field Management'));
47 return true; 47 return true;
48 } 48 }
49 49
50 // {{{ do_main 50 // {{{ do_main
51 function do_main () { 51 function do_main () {
52 - $this->oPage->setBreadcrumbDetails(_("view fieldsets")); 52 + $this->oPage->setBreadcrumbDetails(_kt("view fieldsets"));
53 53
54 // function KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null) { 54 // function KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null) {
55 // use widgets for the create form. 55 // use widgets for the create form.
56 $createFields = array(); 56 $createFields = array();
57 - $createFields[] = new KTStringWidget('Name', _('A human-readable name, used in add and edit forms.'), 'name', null, $this->oPage, true);  
58 - $createFields[] = new KTTextWidget('Description', _('A brief description of the information stored in this fieldset.'), 'description', null, $this->oPage, true);  
59 - $createFields[] = new KTCheckboxWidget('Generic', _('A generic fieldset is one that is available for every document by default. These fieldsets will be available for users to edit and add for every document in the document management system.'), 'generic', false, $this->oPage, false); 57 + $createFields[] = new KTStringWidget('Name', _kt('A human-readable name, used in add and edit forms.'), 'name', null, $this->oPage, true);
  58 + $createFields[] = new KTTextWidget('Description', _kt('A brief description of the information stored in this fieldset.'), 'description', null, $this->oPage, true);
  59 + $createFields[] = new KTCheckboxWidget('Generic', _kt('A generic fieldset is one that is available for every document by default. These fieldsets will be available for users to edit and add for every document in the document management system.'), 'generic', false, $this->oPage, false);
60 $createFields[] = new KTCheckboxWidget('System', 60 $createFields[] = new KTCheckboxWidget('System',
61 - _('A system fieldset is one that is never displayed to a user, and is used only by the document management system.'), 'system', false, $this->oPage, false); 61 + _kt('A system fieldset is one that is never displayed to a user, and is used only by the document management system.'), 'system', false, $this->oPage, false);
62 62
63 63
64 $oTemplating =& KTTemplating::getSingleton(); 64 $oTemplating =& KTTemplating::getSingleton();
@@ -79,12 +79,12 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -79,12 +79,12 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
79 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']); 79 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
80 80
81 $editFieldset = array(); 81 $editFieldset = array();
82 - $editFieldset[] = new KTStringWidget('Name', _('A human-readable name, used in add and edit forms.'), 'name',$oFieldset->getName(), $this->oPage, true);  
83 - $editFieldset[] = new KTStringWidget('Namespace',_('Every fieldset needs to have a system name (used internally by the document management system). For fieldsets which you create, this is automatically created by the system, but for fieldsets created by plugins, this controls how the fieldset works.'), 'namespace', $oFieldset->getNamespace(), $this->oPage, true);  
84 - $editFieldset[] = new KTTextWidget('Description', _('A brief description of the information stored in this fieldset.'), 'description', $oFieldset->getDescription(), $this->oPage, true); 82 + $editFieldset[] = new KTStringWidget('Name', _kt('A human-readable name, used in add and edit forms.'), 'name',$oFieldset->getName(), $this->oPage, true);
  83 + $editFieldset[] = new KTStringWidget('Namespace', _kt('Every fieldset needs to have a system name (used internally by the document management system). For fieldsets which you create, this is automatically created by the system, but for fieldsets created by plugins, this controls how the fieldset works.'), 'namespace', $oFieldset->getNamespace(), $this->oPage, true);
  84 + $editFieldset[] = new KTTextWidget('Description', _kt('A brief description of the information stored in this fieldset.'), 'description', $oFieldset->getDescription(), $this->oPage, true);
85 $createFields = array(); 85 $createFields = array();
86 - $createFields[] = new KTStringWidget('Name', _('A human-readable name, used in add and edit forms.'), 'name',null, $this->oPage, true);  
87 - $createFields[] = new KTTextWidget('Description', _('A brief description of the information stored in this field.'), 'description', null, $this->oPage, true); 86 + $createFields[] = new KTStringWidget('Name', _kt('A human-readable name, used in add and edit forms.'), 'name',null, $this->oPage, true);
  87 + $createFields[] = new KTTextWidget('Description', _kt('A brief description of the information stored in this field.'), 'description', null, $this->oPage, true);
88 88
89 89
90 // type is a little more complex. 90 // type is a little more complex.
@@ -95,7 +95,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -95,7 +95,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
95 $vocab['lookup'] = 'Lookup'; 95 $vocab['lookup'] = 'Lookup';
96 $vocab['tree'] = 'Tree'; 96 $vocab['tree'] = 'Tree';
97 $typeOptions = array("vocab" => $vocab); 97 $typeOptions = array("vocab" => $vocab);
98 - $createFields[] =& new KTLookupWidget('Type',_('Fields may be of type "Normal", "Lookup", or "Tree". Normal fields are simple text entry fields. Lookups are drop-down controls populated with values by your chosen values. Tree fields provide a rich means of selecting values from tree-like information structures.'), 98 + $createFields[] =& new KTLookupWidget('Type', _kt('Fields may be of type "Normal", "Lookup", or "Tree". Normal fields are simple text entry fields. Lookups are drop-down controls populated with values by your chosen values. Tree fields provide a rich means of selecting values from tree-like information structures.'),
99 'type', null, $this->oPage, true, null, null, $typeOptions); 99 'type', null, $this->oPage, true, null, null, $typeOptions);
100 100
101 101
@@ -122,13 +122,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -122,13 +122,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
122 $aErrorOptions = array( 122 $aErrorOptions = array(
123 'redirect_to' => array('edit', sprintf('fFieldsetId=%d', $oFieldset->getId())), 123 'redirect_to' => array('edit', sprintf('fFieldsetId=%d', $oFieldset->getId())),
124 ); 124 );
125 - $aErrorOptions['empty_message'] = _("No name was given for the fieldset");  
126 - $aErrorOptions['duplicate_message'] = _("A fieldset with that name already exists"); 125 + $aErrorOptions['empty_message'] = _kt("No name was given for the fieldset");
  126 + $aErrorOptions['duplicate_message'] = _kt("A fieldset with that name already exists");
127 $aErrorOptions['rename'] = $oFieldset->getId(); 127 $aErrorOptions['rename'] = $oFieldset->getId();
128 $sName = $this->oValidator->validateEntityName("KTFieldset", $_REQUEST['name'], $aErrorOptions); 128 $sName = $this->oValidator->validateEntityName("KTFieldset", $_REQUEST['name'], $aErrorOptions);
129 - $aErrorOptions['message'] = sprintf(_("The field '%s' is a required field"), _("Namespace")); 129 + $aErrorOptions['message'] = sprintf(_kt("The field '%s' is a required field"), _("Namespace"));
130 $sNamespace = $this->oValidator->validateString($_REQUEST['namespace'], $aErrorOptions); 130 $sNamespace = $this->oValidator->validateString($_REQUEST['namespace'], $aErrorOptions);
131 - $aErrorOptions['message'] = sprintf(_("The field '%s' is a required field"), _("Description")); 131 + $aErrorOptions['message'] = sprintf(_kt("The field '%s' is a required field"), _("Description"));
132 $sDescription = $this->oValidator->validateString($_REQUEST['description'], $aErrorOptions); 132 $sDescription = $this->oValidator->validateString($_REQUEST['description'], $aErrorOptions);
133 133
134 $oFieldset->setName($sName); 134 $oFieldset->setName($sName);
@@ -136,10 +136,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -136,10 +136,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
136 $oFieldset->setDescription($sDescription); 136 $oFieldset->setDescription($sDescription);
137 $res = $oFieldset->update(); 137 $res = $oFieldset->update();
138 if (PEAR::isError($res) || ($res === false)) { 138 if (PEAR::isError($res) || ($res === false)) {
139 - $this->errorRedirectTo('edit', _('Could not save fieldset changes'), 'fFieldsetId=' . $oFieldset->getId()); 139 + $this->errorRedirectTo('edit', _kt('Could not save fieldset changes'), 'fFieldsetId=' . $oFieldset->getId());
140 exit(0); 140 exit(0);
141 } 141 }
142 - $this->successRedirectTo('edit', _('Changes saved'), 'fFieldsetId=' . $oFieldset->getId()); 142 + $this->successRedirectTo('edit', _kt('Changes saved'), 'fFieldsetId=' . $oFieldset->getId());
143 exit(0); 143 exit(0);
144 } 144 }
145 // }}} 145 // }}}
@@ -162,14 +162,14 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -162,14 +162,14 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
162 // Can't be a system fieldset and a generic fieldset... 162 // Can't be a system fieldset and a generic fieldset...
163 if ($bIsGeneric) { 163 if ($bIsGeneric) {
164 $bIsGeneric = false; 164 $bIsGeneric = false;
165 - $this->addInfoMessage(_('System fieldsets cannot be generic. Generic flag removed.')); 165 + $this->addInfoMessage(_kt('System fieldsets cannot be generic. Generic flag removed.'));
166 } 166 }
167 167
168 } 168 }
169 169
170 // basic validation 170 // basic validation
171 - $aErrorOptions['empty_message'] = _("No name was given for the fieldset");  
172 - $aErrorOptions['duplicate_message'] = _("A fieldset with that name already exists"); 171 + $aErrorOptions['empty_message'] = _kt("No name was given for the fieldset");
  172 + $aErrorOptions['duplicate_message'] = _kt("A fieldset with that name already exists");
173 $sName = $this->oValidator->validateEntityName("KTFieldset", $_REQUEST['name'], $aErrorOptions); 173 $sName = $this->oValidator->validateEntityName("KTFieldset", $_REQUEST['name'], $aErrorOptions);
174 174
175 $sDescription = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'description'), 175 $sDescription = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'description'),
@@ -194,7 +194,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -194,7 +194,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
194 $this->errorRedirectToMain('Could not create fieldset'); 194 $this->errorRedirectToMain('Could not create fieldset');
195 exit(0); 195 exit(0);
196 } 196 }
197 - $this->successRedirectTo('edit', _('Fieldset created') . ': '.$sName, 'fFieldsetId=' . $res->getId()); 197 + $this->successRedirectTo('edit', _kt('Fieldset created') . ': '.$sName, 'fFieldsetId=' . $res->getId());
198 exit(0); 198 exit(0);
199 } 199 }
200 // }}} 200 // }}}
@@ -237,13 +237,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -237,13 +237,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
237 'parentfieldset' => $oFieldset->getId(), 237 'parentfieldset' => $oFieldset->getId(),
238 )); 238 ));
239 if (PEAR::isError($res) || ($res === false)) { 239 if (PEAR::isError($res) || ($res === false)) {
240 - $this->errorRedirectTo('edit', _('Could not create field') . ': '.$_REQUEST['name'], 'fFieldsetId=' . $oFieldset->getId()); 240 + $this->errorRedirectTo('edit', _kt('Could not create field') . ': '.$_REQUEST['name'], 'fFieldsetId=' . $oFieldset->getId());
241 exit(0); 241 exit(0);
242 } 242 }
243 if ($is_lookup) { 243 if ($is_lookup) {
244 - $this->successRedirectTo('editField', _('Field created') . ': '.$_REQUEST['name'], 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 244 + $this->successRedirectTo('editField', _kt('Field created') . ': '.$_REQUEST['name'], 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
245 } else { 245 } else {
246 - $this->successRedirectTo('edit', _('Field created') . ': ' . $_REQUEST['name'], 'fFieldsetId=' . $oFieldset->getId()); 246 + $this->successRedirectTo('edit', _kt('Field created') . ': ' . $_REQUEST['name'], 'fFieldsetId=' . $oFieldset->getId());
247 } 247 }
248 exit(0); 248 exit(0);
249 } 249 }
@@ -251,7 +251,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -251,7 +251,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
251 251
252 // {{{ do_editField 252 // {{{ do_editField
253 function do_editField() { 253 function do_editField() {
254 - $this->oPage->setBreadcrumbDetails(_("Edit field")); 254 + $this->oPage->setBreadcrumbDetails(_kt("Edit field"));
255 $oTemplating =& KTTemplating::getSingleton(); 255 $oTemplating =& KTTemplating::getSingleton();
256 $oTemplate =& $oTemplating->loadTemplate('ktcore/metadata/editField'); 256 $oTemplate =& $oTemplating->loadTemplate('ktcore/metadata/editField');
257 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']); 257 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
@@ -265,7 +265,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -265,7 +265,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
265 $this->aBreadcrumbs[] = array( 265 $this->aBreadcrumbs[] = array(
266 'name' => $oField->getName() 266 'name' => $oField->getName()
267 ); 267 );
268 - $this->oPage->setBreadcrumbDetails(_('edit field')); 268 + $this->oPage->setBreadcrumbDetails(_kt('edit field'));
269 269
270 $oTemplate->setData(array( 270 $oTemplate->setData(array(
271 'oFieldset' => $oFieldset, 271 'oFieldset' => $oFieldset,
@@ -303,10 +303,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -303,10 +303,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
303 $oField->setDescription($sDescription); 303 $oField->setDescription($sDescription);
304 $res = $oField->update(); 304 $res = $oField->update();
305 if (PEAR::isError($res) || ($res === false)) { 305 if (PEAR::isError($res) || ($res === false)) {
306 - $this->errorRedirectTo('editField', _('Could not save field changes'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 306 + $this->errorRedirectTo('editField', _kt('Could not save field changes'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
307 exit(0); 307 exit(0);
308 } 308 }
309 - $this->successRedirectTo('editField', _('Changes saved'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 309 + $this->successRedirectTo('editField', _kt('Changes saved'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
310 exit(0); 310 exit(0);
311 } 311 }
312 // }}} 312 // }}}
@@ -316,13 +316,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -316,13 +316,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
316 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']); 316 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
317 $oField =& DocumentField::get($_REQUEST['fFieldId']); 317 $oField =& DocumentField::get($_REQUEST['fFieldId']);
318 if (empty($_REQUEST['value'])) { 318 if (empty($_REQUEST['value'])) {
319 - $this->errorRedirectTo('editField', _('Empty lookup not added'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 319 + $this->errorRedirectTo('editField', _kt('Empty lookup not added'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
320 } 320 }
321 $oMetaData =& MetaData::createFromArray(array( 321 $oMetaData =& MetaData::createFromArray(array(
322 'name' => $_REQUEST['value'], 322 'name' => $_REQUEST['value'],
323 'docfieldid' => $oField->getId(), 323 'docfieldid' => $oField->getId(),
324 )); 324 ));
325 - $this->successRedirectTo('editField', _('Lookup added'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 325 + $this->successRedirectTo('editField', _kt('Lookup added'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
326 exit(0); 326 exit(0);
327 } 327 }
328 // }}} 328 // }}}
@@ -330,13 +330,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -330,13 +330,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
330 // {{{ do_metadataMultiAction 330 // {{{ do_metadataMultiAction
331 function do_metadataMultiAction() { 331 function do_metadataMultiAction() {
332 $subaction = array_keys(KTUtil::arrayGet($_REQUEST, 'submit', array())); 332 $subaction = array_keys(KTUtil::arrayGet($_REQUEST, 'submit', array()));
333 - $this->oValidator->notEmpty($subaction, array("message" => _("No action specified"))); 333 + $this->oValidator->notEmpty($subaction, array("message" => _kt("No action specified")));
334 $subaction = $subaction[0]; 334 $subaction = $subaction[0];
335 $method = null; 335 $method = null;
336 if (method_exists($this, 'lookup_' . $subaction)) { 336 if (method_exists($this, 'lookup_' . $subaction)) {
337 $method = 'lookup_' . $subaction; 337 $method = 'lookup_' . $subaction;
338 } 338 }
339 - $this->oValidator->notEmpty($method, array("message" => _("Unknown action specified"))); 339 + $this->oValidator->notEmpty($method, array("message" => _kt("Unknown action specified")));
340 return $this->$method(); 340 return $this->$method();
341 } 341 }
342 // }}} 342 // }}}
@@ -347,16 +347,16 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -347,16 +347,16 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
347 $oField =& DocumentField::get($_REQUEST['fFieldId']); 347 $oField =& DocumentField::get($_REQUEST['fFieldId']);
348 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata'); 348 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
349 if (empty($aMetadata)) { 349 if (empty($aMetadata)) {
350 - $this->errorRedirectTo('editField', _('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 350 + $this->errorRedirectTo('editField', _kt('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
351 } 351 }
352 foreach ($_REQUEST['metadata'] as $iMetaDataId) { 352 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
353 $oMetaData =& MetaData::get($iMetaDataId); 353 $oMetaData =& MetaData::get($iMetaDataId);
354 if (PEAR::isError($oMetaData)) { 354 if (PEAR::isError($oMetaData)) {
355 - $this->errorRedirectTo('editField', _('Invalid lookup selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 355 + $this->errorRedirectTo('editField', _kt('Invalid lookup selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
356 } 356 }
357 $oMetaData->delete(); 357 $oMetaData->delete();
358 } 358 }
359 - $this->successRedirectTo('editField', _('Lookups removed'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 359 + $this->successRedirectTo('editField', _kt('Lookups removed'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
360 exit(0); 360 exit(0);
361 } 361 }
362 // }}} 362 // }}}
@@ -367,17 +367,17 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -367,17 +367,17 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
367 $oField =& DocumentField::get($_REQUEST['fFieldId']); 367 $oField =& DocumentField::get($_REQUEST['fFieldId']);
368 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata'); 368 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
369 if (empty($aMetadata)) { 369 if (empty($aMetadata)) {
370 - $this->errorRedirectTo('editField', _('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 370 + $this->errorRedirectTo('editField', _kt('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
371 } 371 }
372 foreach ($_REQUEST['metadata'] as $iMetaDataId) { 372 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
373 $oMetaData =& MetaData::get($iMetaDataId); 373 $oMetaData =& MetaData::get($iMetaDataId);
374 if (PEAR::isError($oMetaData)) { 374 if (PEAR::isError($oMetaData)) {
375 - $this->errorRedirectTo('editField', _('Invalid lookup selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 375 + $this->errorRedirectTo('editField', _kt('Invalid lookup selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
376 } 376 }
377 $oMetaData->setDisabled(true); 377 $oMetaData->setDisabled(true);
378 $oMetaData->update(); 378 $oMetaData->update();
379 } 379 }
380 - $this->successRedirectTo('editField', _('Lookups disabled'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 380 + $this->successRedirectTo('editField', _kt('Lookups disabled'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
381 exit(0); 381 exit(0);
382 } 382 }
383 // }}} 383 // }}}
@@ -388,17 +388,17 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -388,17 +388,17 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
388 $oField =& DocumentField::get($_REQUEST['fFieldId']); 388 $oField =& DocumentField::get($_REQUEST['fFieldId']);
389 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata'); 389 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
390 if (empty($aMetadata)) { 390 if (empty($aMetadata)) {
391 - $this->errorRedirectTo('editField', _('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 391 + $this->errorRedirectTo('editField', _kt('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
392 } 392 }
393 foreach ($_REQUEST['metadata'] as $iMetaDataId) { 393 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
394 $oMetaData =& MetaData::get($iMetaDataId); 394 $oMetaData =& MetaData::get($iMetaDataId);
395 if (PEAR::isError($oMetadata)) { 395 if (PEAR::isError($oMetadata)) {
396 - $this->errorRedirectTo('editField', _('Invalid lookup selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 396 + $this->errorRedirectTo('editField', _kt('Invalid lookup selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
397 } 397 }
398 $oMetaData->setDisabled(false); 398 $oMetaData->setDisabled(false);
399 $oMetaData->update(); 399 $oMetaData->update();
400 } 400 }
401 - $this->successRedirectTo('editField', _('Lookups enabled'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 401 + $this->successRedirectTo('editField', _kt('Lookups enabled'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
402 exit(0); 402 exit(0);
403 } 403 }
404 // }}} 404 // }}}
@@ -409,18 +409,18 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -409,18 +409,18 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
409 $oField =& DocumentField::get($_REQUEST['fFieldId']); 409 $oField =& DocumentField::get($_REQUEST['fFieldId']);
410 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata'); 410 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
411 if (empty($aMetadata)) { 411 if (empty($aMetadata)) {
412 - $this->errorRedirectTo('editField', _('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 412 + $this->errorRedirectTo('editField', _kt('No lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
413 } 413 }
414 foreach ($_REQUEST['metadata'] as $iMetaDataId) { 414 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
415 $oMetaData =& MetaData::get($iMetaDataId); 415 $oMetaData =& MetaData::get($iMetaDataId);
416 if (PEAR::isError($oMetaData)) { 416 if (PEAR::isError($oMetaData)) {
417 - $this->errorRedirectTo('editField', _('Invalid lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 417 + $this->errorRedirectTo('editField', _kt('Invalid lookups selected'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
418 } 418 }
419 $bStuck = (boolean)$oMetaData->getIsStuck(); 419 $bStuck = (boolean)$oMetaData->getIsStuck();
420 $oMetaData->setIsStuck(!$bStuck); 420 $oMetaData->setIsStuck(!$bStuck);
421 $oMetaData->update(); 421 $oMetaData->update();
422 } 422 }
423 - $this->successRedirectTo('editField', _('Lookup stickiness toggled'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId()); 423 + $this->successRedirectTo('editField', _kt('Lookup stickiness toggled'), 'fFieldsetId=' . $oFieldset->getId() . '&fFieldId=' . $oField->getId());
424 exit(0); 424 exit(0);
425 } 425 }
426 // }}} 426 // }}}
@@ -432,10 +432,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -432,10 +432,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
432 $oFieldset->setIsComplete(false); 432 $oFieldset->setIsComplete(false);
433 $res = $oFieldset->update(); 433 $res = $oFieldset->update();
434 if (PEAR::isError($res) || ($res === false)) { 434 if (PEAR::isError($res) || ($res === false)) {
435 - $this->errorRedirectTo('edit', _('Could not become conditional'), 'fFieldsetId=' . $oFieldset->getId()); 435 + $this->errorRedirectTo('edit', _kt('Could not become conditional'), 'fFieldsetId=' . $oFieldset->getId());
436 exit(0); 436 exit(0);
437 } 437 }
438 - $this->successRedirectTo('edit', _('Became conditional'), 'fFieldsetId=' . $oFieldset->getId()); 438 + $this->successRedirectTo('edit', _kt('Became conditional'), 'fFieldsetId=' . $oFieldset->getId());
439 exit(0); 439 exit(0);
440 } 440 }
441 // }}} 441 // }}}
@@ -478,10 +478,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -478,10 +478,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
478 478
479 $res = $oFieldset->update(); 479 $res = $oFieldset->update();
480 if (PEAR::isError($res) || ($res === false)) { 480 if (PEAR::isError($res) || ($res === false)) {
481 - $this->errorRedirectTo('edit', _('Could not stop being conditional'), 'fFieldsetId=' . $oFieldset->getId()); 481 + $this->errorRedirectTo('edit', _kt('Could not stop being conditional'), 'fFieldsetId=' . $oFieldset->getId());
482 exit(0); 482 exit(0);
483 } 483 }
484 - $this->successRedirectTo('edit', _('No longer conditional'), 'fFieldsetId=' . $oFieldset->getId()); 484 + $this->successRedirectTo('edit', _kt('No longer conditional'), 'fFieldsetId=' . $oFieldset->getId());
485 exit(0); 485 exit(0);
486 } 486 }
487 // }}} 487 // }}}
@@ -493,7 +493,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -493,7 +493,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
493 $oField =& DocumentField::get($iFieldId); 493 $oField =& DocumentField::get($iFieldId);
494 $oField->delete(); 494 $oField->delete();
495 } 495 }
496 - $this->successRedirectTo('edit', _('Fields removed'), 'fFieldsetId=' . $oFieldset->getId()); 496 + $this->successRedirectTo('edit', _kt('Fields removed'), 'fFieldsetId=' . $oFieldset->getId());
497 exit(0); 497 exit(0);
498 } 498 }
499 // }}} 499 // }}}
@@ -555,7 +555,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -555,7 +555,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
555 $this->aBreadcrumbs[] = array( 555 $this->aBreadcrumbs[] = array(
556 'url' => $_SERVER['PHP_SELF'], 556 'url' => $_SERVER['PHP_SELF'],
557 'query' => 'action=manageConditional&fFieldsetId=' . $_REQUEST['fFieldsetId'], 557 'query' => 'action=manageConditional&fFieldsetId=' . $_REQUEST['fFieldsetId'],
558 - 'name' => _('Manage conditional field'), 558 + 'name' => _kt('Manage conditional field'),
559 ); 559 );
560 $oTemplate->setData(array( 560 $oTemplate->setData(array(
561 'oFieldset' => $oFieldset, 561 'oFieldset' => $oFieldset,
@@ -578,16 +578,16 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -578,16 +578,16 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
578 } 578 }
579 $iParentFieldId = $_REQUEST['fParentFieldId']; 579 $iParentFieldId = $_REQUEST['fParentFieldId'];
580 if (in_array($aParentFieldId, $aFreeFieldIds)) { 580 if (in_array($aParentFieldId, $aFreeFieldIds)) {
581 - $this->errorRedirectTo('manageConditional', _('Field cannot be its own parent field'), 'fFieldsetId=' . $oFieldset->getId()); 581 + $this->errorRedirectTo('manageConditional', _kt('Field cannot be its own parent field'), 'fFieldsetId=' . $oFieldset->getId());
582 } 582 }
583 foreach ($aFreeFieldIds as $iChildFieldId) { 583 foreach ($aFreeFieldIds as $iChildFieldId) {
584 $res = KTMetadataUtil::addFieldOrder($iParentFieldId, $iChildFieldId, $oFieldset); 584 $res = KTMetadataUtil::addFieldOrder($iParentFieldId, $iChildFieldId, $oFieldset);
585 $this->oValidator->notError($res, array( 585 $this->oValidator->notError($res, array(
586 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()), 586 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()),
587 - 'message' => _('Error adding Fields'), 587 + 'message' => _kt('Error adding Fields'),
588 )); 588 ));
589 } 589 }
590 - $this->successRedirectTo('manageConditional', _('Fields ordered'), 'fFieldsetId=' . $oFieldset->getId()); 590 + $this->successRedirectTo('manageConditional', _kt('Fields ordered'), 'fFieldsetId=' . $oFieldset->getId());
591 exit(0); 591 exit(0);
592 } 592 }
593 // }}} 593 // }}}
@@ -603,9 +603,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -603,9 +603,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
603 603
604 $this->oValidator->notError($res, array( 604 $this->oValidator->notError($res, array(
605 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()), 605 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()),
606 - 'message' => _('Error setting master field'), 606 + 'message' => _kt('Error setting master field'),
607 )); 607 ));
608 - $this->successRedirectTo('manageConditional', _('Master field set'), 'fFieldsetId=' . $oFieldset->getId()); 608 + $this->successRedirectTo('manageConditional', _kt('Master field set'), 'fFieldsetId=' . $oFieldset->getId());
609 exit(0); 609 exit(0);
610 } 610 }
611 // }}} 611 // }}}
@@ -623,13 +623,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -623,13 +623,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
623 if ($res === true) { 623 if ($res === true) {
624 $oFieldset->setIsComplete(true); 624 $oFieldset->setIsComplete(true);
625 $oFieldset->update(); 625 $oFieldset->update();
626 - $this->successRedirectTo('manageConditional', _('Set to complete'), 'fFieldsetId=' . $oFieldset->getId()); 626 + $this->successRedirectTo('manageConditional', _kt('Set to complete'), 'fFieldsetId=' . $oFieldset->getId());
627 } 627 }
628 $oFieldset->setIsComplete(false); 628 $oFieldset->setIsComplete(false);
629 $oFieldset->update(); 629 $oFieldset->update();
630 // Success, as we want to save the incompleteness to the 630 // Success, as we want to save the incompleteness to the
631 // database... 631 // database...
632 - $this->successRedirectTo('manageConditional', _('Could not to complete'), 'fFieldsetId=' . $oFieldset->getId()); 632 + $this->successRedirectTo('manageConditional', _kt('Could not to complete'), 'fFieldsetId=' . $oFieldset->getId());
633 } 633 }
634 // }}} 634 // }}}
635 635
@@ -640,9 +640,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -640,9 +640,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
640 $res = $oFieldset->update(); 640 $res = $oFieldset->update();
641 $this->oValidator->notError($res, array( 641 $this->oValidator->notError($res, array(
642 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()), 642 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()),
643 - 'message' => _('Error changing to simple'), 643 + 'message' => _kt('Error changing to simple'),
644 )); 644 ));
645 - $this->successRedirectTo('manageConditional', _('Changed to simple'), 'fFieldsetId=' . $oFieldset->getId()); 645 + $this->successRedirectTo('manageConditional', _kt('Changed to simple'), 'fFieldsetId=' . $oFieldset->getId());
646 } 646 }
647 // }}} 647 // }}}
648 648
@@ -653,9 +653,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -653,9 +653,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
653 $res = $oFieldset->update(); 653 $res = $oFieldset->update();
654 $this->oValidator->notError($res, array( 654 $this->oValidator->notError($res, array(
655 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()), 655 'redirect_to' => array('manageConditional', 'fFieldsetId=' . $oFieldset->getId()),
656 - 'message' => _('Error changing to complex'), 656 + 'message' => _kt('Error changing to complex'),
657 )); 657 ));
658 - $this->successRedirectTo('manageConditional', _('Changed to complex'), 'fFieldsetId=' . $oFieldset->getId()); 658 + $this->successRedirectTo('manageConditional', _kt('Changed to complex'), 'fFieldsetId=' . $oFieldset->getId());
659 } 659 }
660 // }}} 660 // }}}
661 661
@@ -665,9 +665,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -665,9 +665,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
665 $res = $oFieldset->delete(); 665 $res = $oFieldset->delete();
666 $this->oValidator->notErrorFalse($res, array( 666 $this->oValidator->notErrorFalse($res, array(
667 'redirect_to' => array('main', ''), 667 'redirect_to' => array('main', ''),
668 - 'message' => _('Could not delete fieldset'), 668 + 'message' => _kt('Could not delete fieldset'),
669 )); 669 ));
670 - $this->successRedirectToMain(_('Fieldset deleted')); 670 + $this->successRedirectToMain(_kt('Fieldset deleted'));
671 } 671 }
672 // }}} 672 // }}}
673 673
@@ -682,9 +682,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -682,9 +682,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
682 $subaction = KTUtil::arrayGet($_REQUEST, 'subaction'); 682 $subaction = KTUtil::arrayGet($_REQUEST, 'subaction');
683 683
684 // validate 684 // validate
685 - if (empty($field_id)) { return $this->errorRedirectToMain(_("Must select a field to edit.")); } 685 + if (empty($field_id)) { return $this->errorRedirectToMain(_kt("Must select a field to edit.")); }
686 $oField =& DocumentField::get($field_id); 686 $oField =& DocumentField::get($field_id);
687 - if (PEAR::isError($oField)) { return $this->errorRedirectToMain(_("Invalid field.")); } 687 + if (PEAR::isError($oField)) { return $this->errorRedirectToMain(_kt("Invalid field.")); }
688 688
689 $aErrorOptions = array( 689 $aErrorOptions = array(
690 'redirect_to' => array('editTree', sprintf('field_id=%d', $field_id)), 690 'redirect_to' => array('editTree', sprintf('field_id=%d', $field_id)),
@@ -698,30 +698,30 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -698,30 +698,30 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
698 698
699 if ($subaction !== null) { 699 if ($subaction !== null) {
700 $target = 'editTree'; 700 $target = 'editTree';
701 - $msg = _('Changes saved.'); 701 + $msg = _kt('Changes saved.');
702 if ($subaction === "addCategory") { 702 if ($subaction === "addCategory") {
703 $new_category = KTUtil::arrayGet($_REQUEST, 'category_name'); 703 $new_category = KTUtil::arrayGet($_REQUEST, 'category_name');
704 - if (empty($new_category)) { return $this->errorRedirectTo("editTree", _("Must enter a name for the new category."), array("field_id" => $field_id)); } 704 + if (empty($new_category)) { return $this->errorRedirectTo("editTree", _kt("Must enter a name for the new category."), array("field_id" => $field_id)); }
705 else { $this->subact_addCategory($field_id, $current_node, $new_category, $fieldTree);} 705 else { $this->subact_addCategory($field_id, $current_node, $new_category, $fieldTree);}
706 - $msg = _('Category added'). ': ' . $new_category; 706 + $msg = _kt('Category added'). ': ' . $new_category;
707 } 707 }
708 if ($subaction === "deleteCategory") { 708 if ($subaction === "deleteCategory") {
709 $this->subact_deleteCategory($fieldTree, $current_node); 709 $this->subact_deleteCategory($fieldTree, $current_node);
710 $current_node = 0; // clear out, and don't try and render the newly deleted category. 710 $current_node = 0; // clear out, and don't try and render the newly deleted category.
711 - $msg = _('Category removed.'); 711 + $msg = _kt('Category removed.');
712 } 712 }
713 if ($subaction === "linkKeywords") { 713 if ($subaction === "linkKeywords") {
714 $keywords = KTUtil::arrayGet($_REQUEST, 'keywordsToAdd'); 714 $keywords = KTUtil::arrayGet($_REQUEST, 'keywordsToAdd');
715 - $aErrorOptions['message'] = _("No keywords selected"); 715 + $aErrorOptions['message'] = _kt("No keywords selected");
716 $this->oValidator->notEmpty($keywords, $aErrorOptions); 716 $this->oValidator->notEmpty($keywords, $aErrorOptions);
717 $this->subact_linkKeywords($fieldTree, $current_node, $keywords); 717 $this->subact_linkKeywords($fieldTree, $current_node, $keywords);
718 $current_node = 0; // clear out, and don't try and render the newly deleted category. 718 $current_node = 0; // clear out, and don't try and render the newly deleted category.
719 - $msg = _('Keywords added to category.'); 719 + $msg = _kt('Keywords added to category.');
720 } 720 }
721 if ($subaction === "unlinkKeyword") { 721 if ($subaction === "unlinkKeyword") {
722 $keyword = KTUtil::arrayGet($_REQUEST, 'keyword_id'); 722 $keyword = KTUtil::arrayGet($_REQUEST, 'keyword_id');
723 $this->subact_unlinkKeyword($fieldTree, $keyword); 723 $this->subact_unlinkKeyword($fieldTree, $keyword);
724 - $msg = _('Keyword moved to base of tree.'); 724 + $msg = _kt('Keyword moved to base of tree.');
725 } 725 }
726 // now redirect 726 // now redirect
727 $query = 'field_id=' . $field_id; 727 $query = 'field_id=' . $field_id;
@@ -729,7 +729,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -729,7 +729,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
729 } 729 }
730 730
731 if ($fieldTree->root === null) { 731 if ($fieldTree->root === null) {
732 - return $this->errorRedirectToMain(_("Error building tree. Is this a valid tree-lookup field?")); 732 + return $this->errorRedirectToMain(_kt("Error building tree. Is this a valid tree-lookup field?"));
733 } 733 }
734 734
735 // FIXME extract this from MDTree (helper method?) 735 // FIXME extract this from MDTree (helper method?)
@@ -740,7 +740,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher { @@ -740,7 +740,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
740 $oTemplate = $oTemplating->loadTemplate("ktcore/edit_lookuptrees"); 740 $oTemplate = $oTemplating->loadTemplate("ktcore/edit_lookuptrees");
741 $renderedTree = $this->_evilTreeRenderer($fieldTree); 741 $renderedTree = $this->_evilTreeRenderer($fieldTree);
742 742
743 - $this->oPage->setTitle(_('Edit Lookup Tree')); 743 + $this->oPage->setTitle(_kt('Edit Lookup Tree'));
744 744
745 //$this->oPage->requireJSResource('thirdparty/js/MochiKit/Base.js'); 745 //$this->oPage->requireJSResource('thirdparty/js/MochiKit/Base.js');
746 746
plugins/ktcore/admin/documentLinks.php
@@ -38,15 +38,15 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -38,15 +38,15 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
38 } 38 }
39 39
40 function do_main() { 40 function do_main() {
41 - $this->aBreadcrumbs[] = array('name' => _('Document Links'));  
42 - $this->oPage->setBreadcrumbDetails(_("view")); 41 + $this->aBreadcrumbs[] = array('name' => _kt('Document Links'));
  42 + $this->oPage->setBreadcrumbDetails(_kt("view"));
43 43
44 $aLinkTypes =& LinkType::getList('id > 0'); 44 $aLinkTypes =& LinkType::getList('id > 0');
45 45
46 $addLinkForm = array(); 46 $addLinkForm = array();
47 // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null) 47 // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
48 - $addLinkForm[] = new KTStringWidget('Name',_('A short, human-readable name for the link type.'), 'fName', null, $this->oPage, true);  
49 - $addLinkForm[] = new KTStringWidget('Description',_('A short brief description of the relationship implied by this link type.'), 'fDescription', null, $this->oPage, true); 48 + $addLinkForm[] = new KTStringWidget('Name', _kt('A short, human-readable name for the link type.'), 'fName', null, $this->oPage, true);
  49 + $addLinkForm[] = new KTStringWidget('Description', _kt('A short brief description of the relationship implied by this link type.'), 'fDescription', null, $this->oPage, true);
50 50
51 51
52 $oTemplating =& KTTemplating::getSingleton(); 52 $oTemplating =& KTTemplating::getSingleton();
@@ -62,20 +62,20 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -62,20 +62,20 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
62 function do_edit() { 62 function do_edit() {
63 $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false); 63 $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
64 if ($link_id === null) { 64 if ($link_id === null) {
65 - $this->errorRedirectToMain(_("Please specify a link type to edit.")); 65 + $this->errorRedirectToMain(_kt("Please specify a link type to edit."));
66 } 66 }
67 67
68 $oLinkType =& LinkType::get($link_id); 68 $oLinkType =& LinkType::get($link_id);
69 69
70 - $this->aBreadcrumbs[] = array('name' => _('Document Links'));  
71 - $this->oPage->setBreadcrumbDetails(_("view")); 70 + $this->aBreadcrumbs[] = array('name' => _kt('Document Links'));
  71 + $this->oPage->setBreadcrumbDetails(_kt("view"));
72 72
73 $aLinkTypes =& LinkType::getList('id > 0'); 73 $aLinkTypes =& LinkType::getList('id > 0');
74 74
75 $editLinkForm = array(); 75 $editLinkForm = array();
76 // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null) 76 // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
77 - $editLinkForm[] = new KTStringWidget('Name',_('A short, human-readable name for the link type.'), 'fName', $oLinkType->getName(), $this->oPage, true);  
78 - $editLinkForm[] = new KTStringWidget('Description',_('A short brief description of the relationship implied by this link type.'), 'fDescription', $oLinkType->getDescription(), $this->oPage, true); 77 + $editLinkForm[] = new KTStringWidget('Name', _kt('A short, human-readable name for the link type.'), 'fName', $oLinkType->getName(), $this->oPage, true);
  78 + $editLinkForm[] = new KTStringWidget('Description', _kt('A short brief description of the relationship implied by this link type.'), 'fDescription', $oLinkType->getDescription(), $this->oPage, true);
79 79
80 80
81 $oTemplating =& KTTemplating::getSingleton(); 81 $oTemplating =& KTTemplating::getSingleton();
@@ -93,14 +93,14 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -93,14 +93,14 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
93 function do_update() { 93 function do_update() {
94 $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false); 94 $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
95 if ($link_id === null) { 95 if ($link_id === null) {
96 - $this->errorRedirectToMain(_("Please specify a link type to update.")); 96 + $this->errorRedirectToMain(_kt("Please specify a link type to update."));
97 } 97 }
98 98
99 $name = KTUtil::arrayGet($_REQUEST, 'fName'); 99 $name = KTUtil::arrayGet($_REQUEST, 'fName');
100 $description = KTUtil::arrayGet($_REQUEST, 'fDescription'); 100 $description = KTUtil::arrayGet($_REQUEST, 'fDescription');
101 101
102 if (empty($name) || empty($description)) { // for bonus points, make this go to edit, and edit catch it. 102 if (empty($name) || empty($description)) { // for bonus points, make this go to edit, and edit catch it.
103 - $this->errorRedirectToMain(_('Please enter information for all fields.')); 103 + $this->errorRedirectToMain(_kt('Please enter information for all fields.'));
104 } 104 }
105 105
106 $oLinkType =& LinkType::get($link_id); 106 $oLinkType =& LinkType::get($link_id);
@@ -109,7 +109,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -109,7 +109,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
109 $oLinkType->setDescription($description); 109 $oLinkType->setDescription($description);
110 $oLinkType->update(); 110 $oLinkType->update();
111 111
112 - $this->successRedirectToMain(_("Link Type updated.")); 112 + $this->successRedirectToMain(_kt("Link Type updated."));
113 } 113 }
114 114
115 function do_add() { 115 function do_add() {
@@ -117,7 +117,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -117,7 +117,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
117 $description = KTUtil::arrayGet($_REQUEST, 'fDescription'); 117 $description = KTUtil::arrayGet($_REQUEST, 'fDescription');
118 118
119 if (empty($name) || empty($description)) { 119 if (empty($name) || empty($description)) {
120 - $this->errorRedirectToMain(_('Please enter information for all fields.')); 120 + $this->errorRedirectToMain(_kt('Please enter information for all fields.'));
121 } 121 }
122 122
123 $oLinkType = new LinkType($name, $description); 123 $oLinkType = new LinkType($name, $description);
@@ -125,14 +125,14 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -125,14 +125,14 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
125 125
126 //$oLinkType =& LinkType::createFromArray(array("sName" => $name, "sDescription" => $description)); 126 //$oLinkType =& LinkType::createFromArray(array("sName" => $name, "sDescription" => $description));
127 127
128 - $this->successRedirectToMain(_("Link Type created.")); 128 + $this->successRedirectToMain(_kt("Link Type created."));
129 } 129 }
130 130
131 function do_delete() { 131 function do_delete() {
132 $types_to_delete = KTUtil::arrayGet($_REQUEST, 'fLinksToDelete'); // is an array. 132 $types_to_delete = KTUtil::arrayGet($_REQUEST, 'fLinksToDelete'); // is an array.
133 133
134 if (empty($types_to_delete)) { 134 if (empty($types_to_delete)) {
135 - $this->errorRedirectToMain(_('Please select one or more link types to delete.')); 135 + $this->errorRedirectToMain(_kt('Please select one or more link types to delete.'));
136 } 136 }
137 137
138 $count = 0; 138 $count = 0;
@@ -149,7 +149,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher { @@ -149,7 +149,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
149 149
150 //$oLinkType =& LinkType::createFromArray(array("sName" => $name, "sDescription" => $description)); 150 //$oLinkType =& LinkType::createFromArray(array("sName" => $name, "sDescription" => $description));
151 151
152 - $this->successRedirectToMain($count . " " . _("Link types deleted.")); 152 + $this->successRedirectToMain($count . " " . _kt("Link types deleted."));
153 } 153 }
154 154
155 155
plugins/ktcore/admin/documentTypes.php
@@ -41,12 +41,12 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -41,12 +41,12 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
41 // Breadcrumbs base - added to in methods 41 // Breadcrumbs base - added to in methods
42 function do_main () { 42 function do_main () {
43 43
44 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Document Type Management')); 44 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Document Type Management'));
45 45
46 $this->oPage->setBreadcrumbDetails('view types'); 46 $this->oPage->setBreadcrumbDetails('view types');
47 47
48 $addFields = array(); 48 $addFields = array();
49 - $addFields[] = new KTStringWidget(_('Name'),_('A short, human-readable name for the document type.'), 'name', null, $this->oPage, true); 49 + $addFields[] = new KTStringWidget(_kt('Name'), _('A short, human-readable name for the document type.'), 'name', null, $this->oPage, true);
50 50
51 $oTemplating =& KTTemplating::getSingleton(); 51 $oTemplating =& KTTemplating::getSingleton();
52 $oTemplate = $oTemplating->loadTemplate('ktcore/documenttypes/list'); 52 $oTemplate = $oTemplating->loadTemplate('ktcore/documenttypes/list');
@@ -65,26 +65,26 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -65,26 +65,26 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
65 )); 65 ));
66 66
67 if (PEAR::isError($oDocumentType)) { 67 if (PEAR::isError($oDocumentType)) {
68 - $this->errorRedirectToMain(_('Could not create document type')); 68 + $this->errorRedirectToMain(_kt('Could not create document type'));
69 exit(0); 69 exit(0);
70 } 70 }
71 - $this->successRedirectTo('edit', _('Document type created'), 'fDocumentTypeId=' . $oDocumentType->getId()); 71 + $this->successRedirectTo('edit', _kt('Document type created'), 'fDocumentTypeId=' . $oDocumentType->getId());
72 exit(0); 72 exit(0);
73 } 73 }
74 74
75 function do_delete() { 75 function do_delete() {
76 $oDocumentType =& DocumentType::get($_REQUEST['fDocumentTypeId']); 76 $oDocumentType =& DocumentType::get($_REQUEST['fDocumentTypeId']);
77 if ($oDocumentType->isUsed()) { 77 if ($oDocumentType->isUsed()) {
78 - $this->errorRedirectToMain(_('Document type still in use, could not be deleted')); 78 + $this->errorRedirectToMain(_kt('Document type still in use, could not be deleted'));
79 exit(0); 79 exit(0);
80 } 80 }
81 $res = $oDocumentType->delete(); 81 $res = $oDocumentType->delete();
82 if (PEAR::isError($res) || ($res === false)) { 82 if (PEAR::isError($res) || ($res === false)) {
83 - $this->errorRedirectToMain(_('Document type could not be deleted')); 83 + $this->errorRedirectToMain(_kt('Document type could not be deleted'));
84 exit(0); 84 exit(0);
85 } 85 }
86 86
87 - $this->successRedirectToMain(_('Document type deleted')); 87 + $this->successRedirectToMain(_kt('Document type deleted'));
88 exit(0); 88 exit(0);
89 } 89 }
90 90
@@ -95,11 +95,11 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -95,11 +95,11 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
95 $res = $oDocumentType->update(); 95 $res = $oDocumentType->update();
96 96
97 if (PEAR::isError($res) || ($res === false)) { 97 if (PEAR::isError($res) || ($res === false)) {
98 - $this->errorRedirectTo('main', _('Could not disable document type'), 'fDocumentTypeId=' . $oDocumentType->getId()); 98 + $this->errorRedirectTo('main', _kt('Could not disable document type'), 'fDocumentTypeId=' . $oDocumentType->getId());
99 exit(0); 99 exit(0);
100 } 100 }
101 101
102 - $this->successRedirectToMain(_('Document type disabled')); 102 + $this->successRedirectToMain(_kt('Document type disabled'));
103 exit(0); 103 exit(0);
104 } 104 }
105 105
@@ -110,17 +110,17 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -110,17 +110,17 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
110 $res = $oDocumentType->update(); 110 $res = $oDocumentType->update();
111 111
112 if (PEAR::isError($res) || ($res === false)) { 112 if (PEAR::isError($res) || ($res === false)) {
113 - $this->errorRedirectTo('main', _('Could not enable document type'), 'fDocumentTypeId=' . $oDocumentType->getId()); 113 + $this->errorRedirectTo('main', _kt('Could not enable document type'), 'fDocumentTypeId=' . $oDocumentType->getId());
114 exit(0); 114 exit(0);
115 } 115 }
116 116
117 - $this->successRedirectToMain(_('Document type enabled')); 117 + $this->successRedirectToMain(_kt('Document type enabled'));
118 exit(0); 118 exit(0);
119 } 119 }
120 120
121 function do_edit() { 121 function do_edit() {
122 122
123 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Document Type Management')); 123 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Document Type Management'));
124 124
125 $oTemplating =& KTTemplating::getSingleton(); 125 $oTemplating =& KTTemplating::getSingleton();
126 $oTemplate = $oTemplating->loadTemplate('ktcore/documenttypes/edit'); 126 $oTemplate = $oTemplating->loadTemplate('ktcore/documenttypes/edit');
@@ -142,13 +142,13 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -142,13 +142,13 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
142 $aOptions['vocab'] = $vocab; 142 $aOptions['vocab'] = $vocab;
143 $aOptions['multi'] = true; 143 $aOptions['multi'] = true;
144 $aOptions['size'] = 5; 144 $aOptions['size'] = 5;
145 - $availableTypesWidget =& new KTLookupWidget(_('Available Fieldsets'),_('Select the fieldsets which you wish to associate with this document type'), 'fieldsetid[]', null, $this->oPage, true, 145 + $availableTypesWidget =& new KTLookupWidget(_kt('Available Fieldsets'), _('Select the fieldsets which you wish to associate with this document type'), 'fieldsetid[]', null, $this->oPage, true,
146 null, null, $aOptions); 146 null, null, $aOptions);
147 147
148 $this->aBreadcrumbs[] = array( 148 $this->aBreadcrumbs[] = array(
149 'name' => $oDocumentType->getName(), 149 'name' => $oDocumentType->getName(),
150 ); 150 );
151 - $this->oPage->setBreadcrumbDetails(_('edit')); 151 + $this->oPage->setBreadcrumbDetails(_kt('edit'));
152 152
153 $oTemplate->setData(array( 153 $oTemplate->setData(array(
154 'oDocumentType' => $oDocumentType, 154 'oDocumentType' => $oDocumentType,
@@ -173,10 +173,10 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -173,10 +173,10 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
173 $res = $oDocumentType->update(); 173 $res = $oDocumentType->update();
174 174
175 if (PEAR::isError($res) || ($res === false)) { 175 if (PEAR::isError($res) || ($res === false)) {
176 - $this->errorRedirectTo('edit', _('Could not save document type changes'), 'fDocumentTypeId=' . $oDocumentType->getId()); 176 + $this->errorRedirectTo('edit', _kt('Could not save document type changes'), 'fDocumentTypeId=' . $oDocumentType->getId());
177 exit(0); 177 exit(0);
178 } 178 }
179 - $this->successRedirectTo('edit', _('Name changed.'), 'fDocumentTypeId=' . $oDocumentType->getId()); 179 + $this->successRedirectTo('edit', _kt('Name changed.'), 'fDocumentTypeId=' . $oDocumentType->getId());
180 exit(0); 180 exit(0);
181 } 181 }
182 182
@@ -185,10 +185,10 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -185,10 +185,10 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
185 $res = KTMetadataUtil::removeSetsFromDocumentType($oDocumentType, $_REQUEST['fieldsetid']); 185 $res = KTMetadataUtil::removeSetsFromDocumentType($oDocumentType, $_REQUEST['fieldsetid']);
186 if (PEAR::isError($res)) { 186 if (PEAR::isError($res)) {
187 var_dump($res); 187 var_dump($res);
188 - $this->errorRedirectTo('edit', _('Changes not saved'), 'fDocumentTypeId=' . $oDocumentType->getId()); 188 + $this->errorRedirectTo('edit', _kt('Changes not saved'), 'fDocumentTypeId=' . $oDocumentType->getId());
189 exit(0); 189 exit(0);
190 } 190 }
191 - $this->successRedirectTo('edit', _('Fieldsets removed.'), 'fDocumentTypeId=' . $oDocumentType->getId()); 191 + $this->successRedirectTo('edit', _kt('Fieldsets removed.'), 'fDocumentTypeId=' . $oDocumentType->getId());
192 exit(0); 192 exit(0);
193 } 193 }
194 194
@@ -197,17 +197,17 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher { @@ -197,17 +197,17 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
197 $aFieldsetId = $_REQUEST['fieldsetid']; 197 $aFieldsetId = $_REQUEST['fieldsetid'];
198 198
199 if(!count($aFieldsetId)) { 199 if(!count($aFieldsetId)) {
200 - $this->errorRedirectTo('edit', _('You must select at least one fieldset'), 'fDocumentTypeId=' . $oDocumentType->getId()); 200 + $this->errorRedirectTo('edit', _kt('You must select at least one fieldset'), 'fDocumentTypeId=' . $oDocumentType->getId());
201 exit(0); 201 exit(0);
202 } 202 }
203 203
204 $res = KTMetadataUtil::addSetsToDocumentType($oDocumentType, $aFieldsetId); 204 $res = KTMetadataUtil::addSetsToDocumentType($oDocumentType, $aFieldsetId);
205 if (PEAR::isError($res)) { 205 if (PEAR::isError($res)) {
206 var_dump($res); 206 var_dump($res);
207 - $this->errorRedirectTo('edit', _('Changes not saved'), 'fDocumentTypeId=' . $oDocumentType->getId()); 207 + $this->errorRedirectTo('edit', _kt('Changes not saved'), 'fDocumentTypeId=' . $oDocumentType->getId());
208 exit(0); 208 exit(0);
209 } 209 }
210 - $this->successRedirectTo('edit', _('Fieldsets associated.'), 'fDocumentTypeId=' . $oDocumentType->getId()); 210 + $this->successRedirectTo('edit', _kt('Fieldsets associated.'), 'fDocumentTypeId=' . $oDocumentType->getId());
211 exit(0); 211 exit(0);
212 } 212 }
213 } 213 }
plugins/ktcore/admin/groupManagement.php
@@ -43,9 +43,9 @@ require_once(KT_LIB_DIR . &quot;/authentication/builtinauthenticationprovider.inc.php @@ -43,9 +43,9 @@ require_once(KT_LIB_DIR . &quot;/authentication/builtinauthenticationprovider.inc.php
43 class KTGroupAdminDispatcher extends KTAdminDispatcher { 43 class KTGroupAdminDispatcher extends KTAdminDispatcher {
44 // {{{ do_main 44 // {{{ do_main
45 function do_main() { 45 function do_main() {
46 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Group Management'));  
47 - $this->oPage->setBreadcrumbDetails(_('select a group'));  
48 - $this->oPage->setTitle(_("Group Management")); 46 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Group Management'));
  47 + $this->oPage->setBreadcrumbDetails(_kt('select a group'));
  48 + $this->oPage->setTitle(_kt("Group Management"));
49 49
50 $KTConfig =& KTConfig::getSingleton(); 50 $KTConfig =& KTConfig::getSingleton();
51 $alwaysAll = $KTConfig->get("alwaysShowAll"); 51 $alwaysAll = $KTConfig->get("alwaysShowAll");
@@ -61,7 +61,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -61,7 +61,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
61 } 61 }
62 62
63 $search_fields = array(); 63 $search_fields = array();
64 - $search_fields[] = new KTStringWidget(_('Group Name'),_("Enter part of the group's name. e.g. <strong>ad</strong> will match <strong>administrators</strong>."), 'name', $name, $this->oPage, true); 64 + $search_fields[] = new KTStringWidget(_kt('Group Name'), _("Enter part of the group's name. e.g. <strong>ad</strong> will match <strong>administrators</strong>."), 'name', $name, $this->oPage, true);
65 65
66 if (!empty($name)) { 66 if (!empty($name)) {
67 $search_results =& Group::getList('WHERE name LIKE \'%' . DBUtil::escapeSimple($name) . '%\''); 67 $search_results =& Group::getList('WHERE name LIKE \'%' . DBUtil::escapeSimple($name) . '%\'');
@@ -85,21 +85,21 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -85,21 +85,21 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
85 85
86 // {{{ do_editGroup 86 // {{{ do_editGroup
87 function do_editGroup() { 87 function do_editGroup() {
88 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Group Management'));  
89 - $this->oPage->setBreadcrumbDetails(_('edit group')); 88 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Group Management'));
  89 + $this->oPage->setBreadcrumbDetails(_kt('edit group'));
90 90
91 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id'); 91 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
92 $oGroup = Group::get($group_id); 92 $oGroup = Group::get($group_id);
93 if (PEAR::isError($oGroup) || $oGroup == false) { 93 if (PEAR::isError($oGroup) || $oGroup == false) {
94 - $this->errorRedirectToMain(_('Please select a valid group.')); 94 + $this->errorRedirectToMain(_kt('Please select a valid group.'));
95 } 95 }
96 96
97 - $this->oPage->setTitle(sprintf(_("Edit Group (%s)"), $oGroup->getName())); 97 + $this->oPage->setTitle(sprintf(_kt("Edit Group (%s)"), $oGroup->getName()));
98 98
99 $edit_fields = array(); 99 $edit_fields = array();
100 - $edit_fields[] = new KTStringWidget(_('Group Name'),_('A short name for the group. e.g. <strong>administrators</strong>.'), 'group_name', $oGroup->getName(), $this->oPage, true);  
101 - $edit_fields[] = new KTCheckboxWidget(_('Unit Administrators'),_('Should all the members of this group be given <strong>unit</strong> administration privileges?'), 'is_unitadmin', $oGroup->getUnitAdmin(), $this->oPage, false);  
102 - $edit_fields[] = new KTCheckboxWidget(_('System Administrators'),_('Should all the members of this group be given <strong>system</strong> administration privileges?'), 'is_sysadmin', $oGroup->getSysAdmin(), $this->oPage, false); 100 + $edit_fields[] = new KTStringWidget(_kt('Group Name'), _('A short name for the group. e.g. <strong>administrators</strong>.'), 'group_name', $oGroup->getName(), $this->oPage, true);
  101 + $edit_fields[] = new KTCheckboxWidget(_kt('Unit Administrators'), _('Should all the members of this group be given <strong>unit</strong> administration privileges?'), 'is_unitadmin', $oGroup->getUnitAdmin(), $this->oPage, false);
  102 + $edit_fields[] = new KTCheckboxWidget(_kt('System Administrators'), _('Should all the members of this group be given <strong>system</strong> administration privileges?'), 'is_sysadmin', $oGroup->getSysAdmin(), $this->oPage, false);
103 103
104 // grab all units. 104 // grab all units.
105 $unitId = $oGroup->getUnitId(); 105 $unitId = $oGroup->getUnitId();
@@ -107,11 +107,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -107,11 +107,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
107 107
108 $oUnits = Unit::getList(); 108 $oUnits = Unit::getList();
109 $vocab = array(); 109 $vocab = array();
110 - $vocab[0] = _('No Unit'); 110 + $vocab[0] = _kt('No Unit');
111 foreach ($oUnits as $oUnit) { $vocab[$oUnit->getID()] = $oUnit->getName(); } 111 foreach ($oUnits as $oUnit) { $vocab[$oUnit->getID()] = $oUnit->getName(); }
112 $aOptions = array('vocab' => $vocab); 112 $aOptions = array('vocab' => $vocab);
113 113
114 - $edit_fields[] = new KTLookupWidget(_('Unit'),_('Which Unit is this group part of?'), 'unit_id', $unitId, $this->oPage, false, null, null, $aOptions); 114 + $edit_fields[] = new KTLookupWidget(_kt('Unit'), _('Which Unit is this group part of?'), 'unit_id', $unitId, $this->oPage, false, null, null, $aOptions);
115 115
116 $oTemplating =& KTTemplating::getSingleton(); 116 $oTemplating =& KTTemplating::getSingleton();
117 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/editgroup"); 117 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/editgroup");
@@ -129,10 +129,10 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -129,10 +129,10 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
129 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id'); 129 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
130 $oGroup = Group::get($group_id); 130 $oGroup = Group::get($group_id);
131 if (PEAR::isError($oGroup) || $oGroup == false) { 131 if (PEAR::isError($oGroup) || $oGroup == false) {
132 - $this->errorRedirectToMain(_('Please select a valid group.')); 132 + $this->errorRedirectToMain(_kt('Please select a valid group.'));
133 } 133 }
134 $group_name = KTUtil::arrayGet($_REQUEST, 'group_name'); 134 $group_name = KTUtil::arrayGet($_REQUEST, 'group_name');
135 - if (empty($group_name)) { $this->errorRedirectToMain(_('Please specify a name for the group.')); } 135 + if (empty($group_name)) { $this->errorRedirectToMain(_kt('Please specify a name for the group.')); }
136 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false); 136 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false);
137 if ($is_unitadmin !== false) { $is_unitadmin = true; } 137 if ($is_unitadmin !== false) { $is_unitadmin = true; }
138 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false); 138 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false);
@@ -152,10 +152,10 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -152,10 +152,10 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
152 } 152 }
153 153
154 $res = $oGroup->update(); 154 $res = $oGroup->update();
155 - if (($res == false) || (PEAR::isError($res))) { return $this->errorRedirectToMain(_('Failed to set group details.')); } 155 + if (($res == false) || (PEAR::isError($res))) { return $this->errorRedirectToMain(_kt('Failed to set group details.')); }
156 156
157 $this->commitTransaction(); 157 $this->commitTransaction();
158 - $this->successRedirectToMain(_('Group details updated.')); 158 + $this->successRedirectToMain(_kt('Group details updated.'));
159 } 159 }
160 // }}} 160 // }}}
161 161
@@ -186,13 +186,13 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -186,13 +186,13 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
186 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id'); 186 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
187 $oGroup = Group::get($group_id); 187 $oGroup = Group::get($group_id);
188 if ((PEAR::isError($oGroup)) || ($oGroup === false)) { 188 if ((PEAR::isError($oGroup)) || ($oGroup === false)) {
189 - $this->errorRedirectToMain(_('No such group.')); 189 + $this->errorRedirectToMain(_kt('No such group.'));
190 } 190 }
191 191
192 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Group Management')); 192 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Group Management'));
193 $this->aBreadcrumbs[] = array('name' => $oGroup->getName()); 193 $this->aBreadcrumbs[] = array('name' => $oGroup->getName());
194 - $this->oPage->setBreadcrumbDetails(_('manage members'));  
195 - $this->oPage->setTitle(sprintf(_('Manage members of group %s'), $oGroup->getName())); 194 + $this->oPage->setBreadcrumbDetails(_kt('manage members'));
  195 + $this->oPage->setTitle(sprintf(_kt('Manage members of group %s'), $oGroup->getName()));
196 196
197 $iSourceId = $oGroup->getAuthenticationSourceId(); 197 $iSourceId = $oGroup->getAuthenticationSourceId();
198 if (!empty($iSourceId)) { 198 if (!empty($iSourceId)) {
@@ -243,7 +243,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -243,7 +243,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
243 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id'); 243 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
244 $oGroup = Group::get($group_id); 244 $oGroup = Group::get($group_id);
245 if ((PEAR::isError($oGroup)) || ($oGroup === false)) { 245 if ((PEAR::isError($oGroup)) || ($oGroup === false)) {
246 - $this->errorRedirectToMain(_('No such group.')); 246 + $this->errorRedirectToMain(_kt('No such group.'));
247 } 247 }
248 248
249 $userAdded = KTUtil::arrayGet($_REQUEST, 'userAdded',''); 249 $userAdded = KTUtil::arrayGet($_REQUEST, 'userAdded','');
@@ -270,7 +270,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -270,7 +270,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
270 } 270 }
271 $res = $oGroup->addMember($oUser); 271 $res = $oGroup->addMember($oUser);
272 if (PEAR::isError($res) || $res == false) { 272 if (PEAR::isError($res) || $res == false) {
273 - $this->errorRedirectToMain(sprintf(_('Unable to add user "%s" to group "%s"'), $oUser->getName(), $oGroup->getName())); 273 + $this->errorRedirectToMain(sprintf(_kt('Unable to add user "%s" to group "%s"'), $oUser->getName(), $oGroup->getName()));
274 } else { $usersAdded[] = $oUser->getName(); } 274 } else { $usersAdded[] = $oUser->getName(); }
275 } 275 }
276 } 276 }
@@ -281,7 +281,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -281,7 +281,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
281 $oUser = User::get($iUserId); 281 $oUser = User::get($iUserId);
282 $res = $oGroup->removeMember($oUser); 282 $res = $oGroup->removeMember($oUser);
283 if (PEAR::isError($res) || $res == false) { 283 if (PEAR::isError($res) || $res == false) {
284 - $this->errorRedirectToMain(sprintf(_('Unable to remove user "%s" from group "%s"'), $oUser->getName(), $oGroup->getName())); 284 + $this->errorRedirectToMain(sprintf(_kt('Unable to remove user "%s" from group "%s"'), $oUser->getName(), $oGroup->getName()));
285 } else { 285 } else {
286 $usersRemoved[] = $oUser->getName(); 286 $usersRemoved[] = $oUser->getName();
287 $memberReason = GroupUtil::getMembershipReason($oUser, $oGroup); 287 $memberReason = GroupUtil::getMembershipReason($oUser, $oGroup);
@@ -294,20 +294,20 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -294,20 +294,20 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
294 } 294 }
295 295
296 if (!empty($addWarnings)) { 296 if (!empty($addWarnings)) {
297 - $sWarnStr = _('Warning: some users were already members of some subgroups') . ' &mdash; '; 297 + $sWarnStr = _kt('Warning: some users were already members of some subgroups') . ' &mdash; ';
298 $sWarnStr .= implode(', ', $addWarnings); 298 $sWarnStr .= implode(', ', $addWarnings);
299 $_SESSION['KTInfoMessage'][] = $sWarnStr; 299 $_SESSION['KTInfoMessage'][] = $sWarnStr;
300 } 300 }
301 301
302 if (!empty($removeWarnings)) { 302 if (!empty($removeWarnings)) {
303 - $sWarnStr = _('Warning: some users are still members of some subgroups') . ' &mdash; '; 303 + $sWarnStr = _kt('Warning: some users are still members of some subgroups') . ' &mdash; ';
304 $sWarnStr .= implode(', ', $removeWarnings); 304 $sWarnStr .= implode(', ', $removeWarnings);
305 $_SESSION['KTInfoMessage'][] = $sWarnStr; 305 $_SESSION['KTInfoMessage'][] = $sWarnStr;
306 } 306 }
307 307
308 $msg = ''; 308 $msg = '';
309 - if (!empty($usersAdded)) { $msg .= ' ' . _('Added') . ': ' . join(', ', $usersAdded) . ', <br />'; }  
310 - if (!empty($usersRemoved)) { $msg .= ' ' . _('Removed') . ': ' . join(', ',$usersRemoved) . '.'; } 309 + if (!empty($usersAdded)) { $msg .= ' ' . _kt('Added') . ': ' . join(', ', $usersAdded) . ', <br />'; }
  310 + if (!empty($usersRemoved)) { $msg .= ' ' . _kt('Removed') . ': ' . join(', ',$usersRemoved) . '.'; }
311 311
312 $this->commitTransaction(); 312 $this->commitTransaction();
313 $this->successRedirectToMain($msg); 313 $this->successRedirectToMain($msg);
@@ -320,12 +320,12 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -320,12 +320,12 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
320 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id'); 320 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
321 $oGroup = Group::get($group_id); 321 $oGroup = Group::get($group_id);
322 if ((PEAR::isError($oGroup)) || ($oGroup === false)) { 322 if ((PEAR::isError($oGroup)) || ($oGroup === false)) {
323 - $this->errorRedirectToMain(_('No such group.')); 323 + $this->errorRedirectToMain(_kt('No such group.'));
324 } 324 }
325 325
326 $this->aBreadcrumbs[] = array('name' => $oGroup->getName()); 326 $this->aBreadcrumbs[] = array('name' => $oGroup->getName());
327 - $this->oPage->setBreadcrumbDetails(_('manage members'));  
328 - $this->oPage->setTitle(sprintf(_('Manage members of %s'), $oGroup->getName())); 327 + $this->oPage->setBreadcrumbDetails(_kt('manage members'));
  328 + $this->oPage->setTitle(sprintf(_kt('Manage members of %s'), $oGroup->getName()));
329 329
330 330
331 // FIXME replace OptionTransfer.js. me no-likey. 331 // FIXME replace OptionTransfer.js. me no-likey.
@@ -409,7 +409,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -409,7 +409,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
409 $oMemberGroup = Group::get($iMemberGroupID); 409 $oMemberGroup = Group::get($iMemberGroupID);
410 $res = $oGroup->addMemberGroup($oMemberGroup); 410 $res = $oGroup->addMemberGroup($oMemberGroup);
411 if (PEAR::isError($res)) { 411 if (PEAR::isError($res)) {
412 - $this->errorRedirectToMain(sprintf(_("Failed to add %s to %s"), $oMemberGroup->getName(), $oGroup->getName())); 412 + $this->errorRedirectToMain(sprintf(_kt("Failed to add %s to %s"), $oMemberGroup->getName(), $oGroup->getName()));
413 exit(0); 413 exit(0);
414 } else { $groupsAdded[] = $oMemberGroup->getName(); } 414 } else { $groupsAdded[] = $oMemberGroup->getName(); }
415 } 415 }
@@ -420,15 +420,15 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -420,15 +420,15 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
420 $oMemberGroup = Group::get($iMemberGroupID); 420 $oMemberGroup = Group::get($iMemberGroupID);
421 $res = $oGroup->removeMemberGroup($oMemberGroup); 421 $res = $oGroup->removeMemberGroup($oMemberGroup);
422 if (PEAR::isError($res)) { 422 if (PEAR::isError($res)) {
423 - $this->errorRedirectToMain(sprintf(_("Failed to remove %s from %s"), $oMemberGroup->getName(), $oGroup->getName())); 423 + $this->errorRedirectToMain(sprintf(_kt("Failed to remove %s from %s"), $oMemberGroup->getName(), $oGroup->getName()));
424 exit(0); 424 exit(0);
425 } else { $groupsRemoved[] = $oMemberGroup->getName(); } 425 } else { $groupsRemoved[] = $oMemberGroup->getName(); }
426 } 426 }
427 } 427 }
428 428
429 $msg = ''; 429 $msg = '';
430 - if (!empty($groupsAdded)) { $msg .= ' ' . _('Added') . ': ' . join(', ', $groupsAdded) . ', <br />'; }  
431 - if (!empty($groupsRemoved)) { $msg .= ' '. _('Removed'). ': ' . join(', ',$groupsRemoved) . '.'; } 430 + if (!empty($groupsAdded)) { $msg .= ' ' . _kt('Added') . ': ' . join(', ', $groupsAdded) . ', <br />'; }
  431 + if (!empty($groupsRemoved)) { $msg .= ' '. _kt('Removed'). ': ' . join(', ',$groupsRemoved) . '.'; }
432 432
433 $this->commitTransaction(); 433 $this->commitTransaction();
434 434
@@ -438,25 +438,25 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -438,25 +438,25 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
438 438
439 // {{{ do_addGroup 439 // {{{ do_addGroup
440 function do_addGroup() { 440 function do_addGroup() {
441 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Group Management'));  
442 - $this->oPage->setBreadcrumbDetails(_('Add a new group')); 441 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Group Management'));
  442 + $this->oPage->setBreadcrumbDetails(_kt('Add a new group'));
443 443
444 444
445 - $this->oPage->setTitle(_("Add a new group")); 445 + $this->oPage->setTitle(_kt("Add a new group"));
446 446
447 $edit_fields = array(); 447 $edit_fields = array();
448 - $add_fields[] = new KTStringWidget(_('Group Name'),_('A short name for the group. e.g. <strong>administrators</strong>.'), 'group_name', null, $this->oPage, true);  
449 - $add_fields[] = new KTCheckboxWidget(_('Unit Administrators'),_('Should all the members of this group be given <strong>unit</strong> administration privileges?'), 'is_unitadmin', false, $this->oPage, false);  
450 - $add_fields[] = new KTCheckboxWidget(_('System Administrators'),_('Should all the members of this group be given <strong>system</strong> administration privileges?'), 'is_sysadmin', false, $this->oPage, false); 448 + $add_fields[] = new KTStringWidget(_kt('Group Name'), _('A short name for the group. e.g. <strong>administrators</strong>.'), 'group_name', null, $this->oPage, true);
  449 + $add_fields[] = new KTCheckboxWidget(_kt('Unit Administrators'), _('Should all the members of this group be given <strong>unit</strong> administration privileges?'), 'is_unitadmin', false, $this->oPage, false);
  450 + $add_fields[] = new KTCheckboxWidget(_kt('System Administrators'), _('Should all the members of this group be given <strong>system</strong> administration privileges?'), 'is_sysadmin', false, $this->oPage, false);
451 // grab all units. 451 // grab all units.
452 452
453 $oUnits = Unit::getList(); 453 $oUnits = Unit::getList();
454 $vocab = array(); 454 $vocab = array();
455 - $vocab[0] = _('No Unit'); 455 + $vocab[0] = _kt('No Unit');
456 foreach ($oUnits as $oUnit) { $vocab[$oUnit->getID()] = $oUnit->getName(); } 456 foreach ($oUnits as $oUnit) { $vocab[$oUnit->getID()] = $oUnit->getName(); }
457 $aOptions = array('vocab' => $vocab); 457 $aOptions = array('vocab' => $vocab);
458 458
459 - $add_fields[] = new KTLookupWidget(_('Unit'),_('Which Unit is this group part of?'), 'unit_id', 0, $this->oPage, false, null, null, $aOptions); 459 + $add_fields[] = new KTLookupWidget(_kt('Unit'), _('Which Unit is this group part of?'), 'unit_id', 0, $this->oPage, false, null, null, $aOptions);
460 460
461 $aAuthenticationSources = array(); 461 $aAuthenticationSources = array();
462 $aAllAuthenticationSources =& KTAuthenticationSource::getList(); 462 $aAllAuthenticationSources =& KTAuthenticationSource::getList();
@@ -484,7 +484,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -484,7 +484,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
484 function do_createGroup() { 484 function do_createGroup() {
485 485
486 $group_name = KTUtil::arrayGet($_REQUEST, 'group_name'); 486 $group_name = KTUtil::arrayGet($_REQUEST, 'group_name');
487 - if (empty($group_name)) { $this->errorRedirectToMain(_('Please specify a name for the group.')); } 487 + if (empty($group_name)) { $this->errorRedirectToMain(_kt('Please specify a name for the group.')); }
488 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false); 488 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false);
489 if ($is_unitadmin !== false) { $is_unitadmin = true; } 489 if ($is_unitadmin !== false) { $is_unitadmin = true; }
490 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false); 490 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false);
@@ -503,7 +503,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -503,7 +503,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
503 //if (($res == false) || (PEAR::isError($res))) { return $this->errorRedirectToMain('Failed to create group "' . $group_name . '"'); } 503 //if (($res == false) || (PEAR::isError($res))) { return $this->errorRedirectToMain('Failed to create group "' . $group_name . '"'); }
504 // do i need to "create" 504 // do i need to "create"
505 $this->commitTransaction(); 505 $this->commitTransaction();
506 - $this->successRedirectToMain(sprintf(_('Group "%s" created.'), $group_name)); 506 + $this->successRedirectToMain(sprintf(_kt('Group "%s" created.'), $group_name));
507 } 507 }
508 // }}} 508 // }}}
509 509
@@ -516,7 +516,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -516,7 +516,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
516 $sGroupName = $oGroup->getName(); 516 $sGroupName = $oGroup->getName();
517 $res = $oGroup->delete(); 517 $res = $oGroup->delete();
518 $this->oValidator->notError($res, $aErrorOptions); 518 $this->oValidator->notError($res, $aErrorOptions);
519 - $this->successRedirectToMain(sprintf(_('Group "%s" deleted.'), $sGroupName)); 519 + $this->successRedirectToMain(sprintf(_kt('Group "%s" deleted.'), $sGroupName));
520 } 520 }
521 // }}} 521 // }}}
522 522
@@ -529,11 +529,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -529,11 +529,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
529 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); 529 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
530 $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); 530 $oProvider =& $oRegistry->getAuthenticationProvider($sProvider);
531 531
532 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Group Management'));  
533 - $this->aBreadcrumbs[] = array('url' => KTUtil::addQueryStringSelf('action=addGroup'), 'name' => _('add a new group')); 532 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Group Management'));
  533 + $this->aBreadcrumbs[] = array('url' => KTUtil::addQueryStringSelf('action=addGroup'), 'name' => _kt('add a new group'));
534 $oProvider->aBreadcrumbs = $this->aBreadcrumbs; 534 $oProvider->aBreadcrumbs = $this->aBreadcrumbs;
535 $oProvider->oPage->setBreadcrumbDetails($oSource->getName()); 535 $oProvider->oPage->setBreadcrumbDetails($oSource->getName());
536 - $oProvider->oPage->setTitle(_("Modify Group Details")); 536 + $oProvider->oPage->setTitle(_kt("Modify Group Details"));
537 537
538 $oProvider->dispatch(); 538 $oProvider->dispatch();
539 exit(0); 539 exit(0);
@@ -545,7 +545,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher { @@ -545,7 +545,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
545 $aGroups = $oGroup->getMemberGroups(); 545 $aGroups = $oGroup->getMemberGroups();
546 $MAX_GROUPS = 6; 546 $MAX_GROUPS = 6;
547 $add_elipsis = false; 547 $add_elipsis = false;
548 - if (count($aGroups) == 0) { return _('Group currently has no subgroups.'); } 548 + if (count($aGroups) == 0) { return _kt('Group currently has no subgroups.'); }
549 if (count($aGroups) > $MAX_GROUPS) { 549 if (count($aGroups) > $MAX_GROUPS) {
550 $aGroups = array_slice($aGroups, 0, $MAX_GROUPS); 550 $aGroups = array_slice($aGroups, 0, $MAX_GROUPS);
551 $add_elipsis = true; 551 $add_elipsis = true;
plugins/ktcore/admin/manageConditionals.php
@@ -45,8 +45,8 @@ class ManageConditionalDispatcher extends KTAdminDispatcher { @@ -45,8 +45,8 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
45 global $default; 45 global $default;
46 $this->ru = $default->rootUrl; 46 $this->ru = $default->rootUrl;
47 // this is not useful: we _still_ don't chain through the right dispatcher (!) 47 // this is not useful: we _still_ don't chain through the right dispatcher (!)
48 - $this->aBreadcrumbs[] = array('url' => KTUtil::ktLink('/admin.php','documents'), 'name' => _('Document Metadata and Workflow Configuration'));  
49 - $this->aBreadcrumbs[] = array('url' => KTUtil::ktLink('/admin.php','documents/fieldmanagement'), 'name' => _('Document Field Management')); 48 + $this->aBreadcrumbs[] = array('url' => KTUtil::ktLink('/admin.php','documents'), 'name' => _kt('Document Metadata and Workflow Configuration'));
  49 + $this->aBreadcrumbs[] = array('url' => KTUtil::ktLink('/admin.php','documents/fieldmanagement'), 'name' => _kt('Document Field Management'));
50 50
51 51
52 } 52 }
@@ -86,9 +86,9 @@ class ManageConditionalDispatcher extends KTAdminDispatcher { @@ -86,9 +86,9 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
86 ); 86 );
87 $this->aBreadcrumbs[] = array( 87 $this->aBreadcrumbs[] = array(
88 'url' => KTUtil::ktLink('admin.php','documents/fieldmanagement','action=manageConditional&fFieldsetId=' . $oFieldset->getId()), 88 'url' => KTUtil::ktLink('admin.php','documents/fieldmanagement','action=manageConditional&fFieldsetId=' . $oFieldset->getId()),
89 - 'name' => _('Manage conditional fieldset'), 89 + 'name' => _kt('Manage conditional fieldset'),
90 ); 90 );
91 - $this->oPage->setBreadcrumbDetails(_('Manage simple conditional')); 91 + $this->oPage->setBreadcrumbDetails(_kt('Manage simple conditional'));
92 92
93 $aTemplateData = array( 93 $aTemplateData = array(
94 "context" => &$this, 94 "context" => &$this,
@@ -120,9 +120,9 @@ class ManageConditionalDispatcher extends KTAdminDispatcher { @@ -120,9 +120,9 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
120 ); 120 );
121 $this->aBreadcrumbs[] = array( 121 $this->aBreadcrumbs[] = array(
122 'url' => KTUtil::ktLink('admin.php','documents/fieldmanagement','action=manageConditional&fFieldsetId=' . $oFieldset->getId()), 122 'url' => KTUtil::ktLink('admin.php','documents/fieldmanagement','action=manageConditional&fFieldsetId=' . $oFieldset->getId()),
123 - 'name' => _('Manage conditional fieldset'), 123 + 'name' => _kt('Manage conditional fieldset'),
124 ); 124 );
125 - $this->oPage->setBreadcrumbDetails(_('Manage complex conditional')); 125 + $this->oPage->setBreadcrumbDetails(_kt('Manage complex conditional'));
126 $aTemplateData = array( 126 $aTemplateData = array(
127 "context" => &$this, 127 "context" => &$this,
128 "fieldset_id" => $fieldset_id, 128 "fieldset_id" => $fieldset_id,
plugins/ktcore/admin/manageHelp.php
@@ -43,9 +43,9 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -43,9 +43,9 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
43 } 43 }
44 44
45 function getData() { 45 function getData() {
46 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Help Administration'));  
47 - $this->oPage->setBreadcrumbDetails(_('select a section'));  
48 - $this->oPage->setTitle(_('Help Administration')); 46 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Help Administration'));
  47 + $this->oPage->setBreadcrumbDetails(_kt('select a section'));
  48 + $this->oPage->setTitle(_kt('Help Administration'));
49 $oTemplating =& KTTemplating::getSingleton(); 49 $oTemplating =& KTTemplating::getSingleton();
50 $aHelpReplacements =& KTHelpReplacement::getList(); 50 $aHelpReplacements =& KTHelpReplacement::getList();
51 //$aHelps =& KTHelpEntity::getList(); 51 //$aHelps =& KTHelpEntity::getList();
@@ -60,8 +60,8 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -60,8 +60,8 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
60 } 60 }
61 61
62 function getReplacementItemData($oHelpReplacement) { 62 function getReplacementItemData($oHelpReplacement) {
63 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Help Administration'));  
64 - $this->oPage->setTitle(_('Editing: ') . $oHelpReplacement->getTitle()); 63 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Help Administration'));
  64 + $this->oPage->setTitle(_kt('Editing: ') . $oHelpReplacement->getTitle());
65 $oTemplating =& KTTemplating::getSingleton(); 65 $oTemplating =& KTTemplating::getSingleton();
66 $oTemplate = $oTemplating->loadTemplate("ktcore/manage_help_item"); 66 $oTemplate = $oTemplating->loadTemplate("ktcore/manage_help_item");
67 $aTemplateData = array( 67 $aTemplateData = array(
@@ -69,7 +69,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -69,7 +69,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
69 "help" => $oHelpReplacement, 69 "help" => $oHelpReplacement,
70 ); 70 );
71 $this->aBreadcrumbs[] = array( 71 $this->aBreadcrumbs[] = array(
72 - 'name' => _('Edit help item'), 72 + 'name' => _kt('Edit help item'),
73 ); 73 );
74 return $oTemplate->render($aTemplateData); 74 return $oTemplate->render($aTemplateData);
75 } 75 }
@@ -78,7 +78,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -78,7 +78,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
78 $id = KTUtil::arrayGet($_REQUEST, 'id'); 78 $id = KTUtil::arrayGet($_REQUEST, 'id');
79 $oHelpReplacement = KTHelpReplacement::get($id); 79 $oHelpReplacement = KTHelpReplacement::get($id);
80 if (PEAR::isError($oHelpReplacement)) { 80 if (PEAR::isError($oHelpReplacement)) {
81 - return $this->errorRedirectToMain(_("Could not find specified item")); 81 + return $this->errorRedirectToMain(_kt("Could not find specified item"));
82 } 82 }
83 return $this->getReplacementItemData($oHelpReplacement); 83 return $this->getReplacementItemData($oHelpReplacement);
84 } 84 }
@@ -87,38 +87,38 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -87,38 +87,38 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
87 $id = KTUtil::arrayGet($_REQUEST, 'id'); 87 $id = KTUtil::arrayGet($_REQUEST, 'id');
88 $oHelpReplacement = KTHelpReplacement::get($id); 88 $oHelpReplacement = KTHelpReplacement::get($id);
89 if (PEAR::isError($oHelpReplacement)) { 89 if (PEAR::isError($oHelpReplacement)) {
90 - return $this->errorRedirectToMain(_("Could not find specified item")); 90 + return $this->errorRedirectToMain(_kt("Could not find specified item"));
91 } 91 }
92 $res = $oHelpReplacement->delete(); 92 $res = $oHelpReplacement->delete();
93 if (PEAR::isError($res)) { 93 if (PEAR::isError($res)) {
94 - return $this->errorRedirectToMain(_("Could not delete specified item")); 94 + return $this->errorRedirectToMain(_kt("Could not delete specified item"));
95 } 95 }
96 - return $this->successRedirectToMain(_("Item deleted")); 96 + return $this->successRedirectToMain(_kt("Item deleted"));
97 } 97 }
98 98
99 function do_updateReplacement() { 99 function do_updateReplacement() {
100 $id = KTUtil::arrayGet($_REQUEST, 'id'); 100 $id = KTUtil::arrayGet($_REQUEST, 'id');
101 $oHelpReplacement = KTHelpReplacement::get($id); 101 $oHelpReplacement = KTHelpReplacement::get($id);
102 if (PEAR::isError($oHelpReplacement)) { 102 if (PEAR::isError($oHelpReplacement)) {
103 - return $this->errorRedirectToMain(_("Could not find specified item")); 103 + return $this->errorRedirectToMain(_kt("Could not find specified item"));
104 } 104 }
105 $description = KTUtil::arrayGet($_REQUEST, 'description'); 105 $description = KTUtil::arrayGet($_REQUEST, 'description');
106 if (empty($description)) { 106 if (empty($description)) {
107 - return $this->errorRedirectToMain(_("No description given")); 107 + return $this->errorRedirectToMain(_kt("No description given"));
108 } 108 }
109 $oHelpReplacement->setDescription($description); 109 $oHelpReplacement->setDescription($description);
110 110
111 $title = KTUtil::arrayGet($_REQUEST, 'title'); 111 $title = KTUtil::arrayGet($_REQUEST, 'title');
112 if (empty($title)) { 112 if (empty($title)) {
113 - return $this->errorRedirectToMain(_("No title given")); 113 + return $this->errorRedirectToMain(_kt("No title given"));
114 } 114 }
115 $oHelpReplacement->setTitle($title); 115 $oHelpReplacement->setTitle($title);
116 116
117 $res = $oHelpReplacement->update(); 117 $res = $oHelpReplacement->update();
118 if (PEAR::isError($res)) { 118 if (PEAR::isError($res)) {
119 - return $this->errorRedirectToMain(_("Error updating item")); 119 + return $this->errorRedirectToMain(_kt("Error updating item"));
120 } 120 }
121 - return $this->successRedirectToMain(_("Item updated")); 121 + return $this->successRedirectToMain(_kt("Item updated"));
122 } 122 }
123 123
124 function do_customise() { 124 function do_customise() {
@@ -131,13 +131,13 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -131,13 +131,13 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
131 131
132 if (!PEAR::isError($oHelpReplacement)) { 132 if (!PEAR::isError($oHelpReplacement)) {
133 // Already exists... 133 // Already exists...
134 - return $this->errorRedirectTo('editReplacement', _('Replacement already exists.'),'id=' . $oHelpReplacement->getId()); 134 + return $this->errorRedirectTo('editReplacement', _kt('Replacement already exists.'),'id=' . $oHelpReplacement->getId());
135 } 135 }
136 $info = KTHelp::getHelpFromFile($name); 136 $info = KTHelp::getHelpFromFile($name);
137 if ($info === false) { 137 if ($info === false) {
138 $info = array('name' => $name); 138 $info = array('name' => $name);
139 - $info['title'] = _('New Help File');  
140 - $info['body'] = _('New Help File'); 139 + $info['title'] = _kt('New Help File');
  140 + $info['body'] = _kt('New Help File');
141 } 141 }
142 $oHelpReplacement = KTHelpReplacement::createFromArray(array( 142 $oHelpReplacement = KTHelpReplacement::createFromArray(array(
143 'name' => $info['name'], 143 'name' => $info['name'],
@@ -146,9 +146,9 @@ class ManageHelpDispatcher extends KTAdminDispatcher { @@ -146,9 +146,9 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
146 )); 146 ));
147 147
148 if (PEAR::isError($oHelpReplacement)) { 148 if (PEAR::isError($oHelpReplacement)) {
149 - return $this->errorRedirectToMain(_("Unable to create replacement")); 149 + return $this->errorRedirectToMain(_kt("Unable to create replacement"));
150 } 150 }
151 - return $this->successRedirectTo('editReplacement', _('Created replacement.'), 'id=' . $oHelpReplacement->getId()); 151 + return $this->successRedirectTo('editReplacement', _kt('Created replacement.'), 'id=' . $oHelpReplacement->getId());
152 } 152 }
153 } 153 }
154 154
plugins/ktcore/admin/managePermissions.php
@@ -34,12 +34,12 @@ require_once(KT_LIB_DIR . &quot;/widgets/fieldWidgets.php&quot;); @@ -34,12 +34,12 @@ require_once(KT_LIB_DIR . &quot;/widgets/fieldWidgets.php&quot;);
34 34
35 class ManagePermissionsDispatcher extends KTAdminDispatcher { 35 class ManagePermissionsDispatcher extends KTAdminDispatcher {
36 function do_main() { 36 function do_main() {
37 - $this->oPage->setTitle(_('Manage Permissions'));  
38 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Manage Permissions')); 37 + $this->oPage->setTitle(_kt('Manage Permissions'));
  38 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Manage Permissions'));
39 39
40 $add_fields = array(); 40 $add_fields = array();
41 - $add_fields[] = new KTStringWidget(_('System Name'),_('The internal name used for the permission. This should never be changed.'), 'name', null, $this->oPage, true);  
42 - $add_fields[] = new KTStringWidget(_('Display Name'),_('A short name that is shown to users whenever permissions must be assigned.'), 'human_name', null, $this->oPage, true); 41 + $add_fields[] = new KTStringWidget(_kt('System Name'), _('The internal name used for the permission. This should never be changed.'), 'name', null, $this->oPage, true);
  42 + $add_fields[] = new KTStringWidget(_kt('Display Name'), _('A short name that is shown to users whenever permissions must be assigned.'), 'human_name', null, $this->oPage, true);
43 43
44 $oTemplating =& KTTemplating::getSingleton(); 44 $oTemplating =& KTTemplating::getSingleton();
45 $aPermissions =& KTPermission::getList(); 45 $aPermissions =& KTPermission::getList();
@@ -56,35 +56,35 @@ class ManagePermissionsDispatcher extends KTAdminDispatcher { @@ -56,35 +56,35 @@ class ManagePermissionsDispatcher extends KTAdminDispatcher {
56 $name = KTUtil::arrayGet($_REQUEST, 'name'); 56 $name = KTUtil::arrayGet($_REQUEST, 'name');
57 $human_name = KTUtil::arrayGet($_REQUEST, 'human_name'); 57 $human_name = KTUtil::arrayGet($_REQUEST, 'human_name');
58 if (empty($name) || empty($human_name)) { 58 if (empty($name) || empty($human_name)) {
59 - return $this->errorRedirectToMain(_("Both names not given")); 59 + return $this->errorRedirectToMain(_kt("Both names not given"));
60 } 60 }
61 $oPerm = KTPermission::createFromArray(array( 61 $oPerm = KTPermission::createFromArray(array(
62 'name' => $name, 62 'name' => $name,
63 'humanname' => $human_name, 63 'humanname' => $human_name,
64 )); 64 ));
65 if (PEAR::isError($oPerm)) { 65 if (PEAR::isError($oPerm)) {
66 - return $this->errorRedirectToMain(_("Error creating permission")); 66 + return $this->errorRedirectToMain(_kt("Error creating permission"));
67 } 67 }
68 - return $this->successRedirectToMain(_("Permission created")); 68 + return $this->successRedirectToMain(_kt("Permission created"));
69 } 69 }
70 70
71 function do_deletePermission() { 71 function do_deletePermission() {
72 $id = KTUtil::arrayGet($_REQUEST, 'id'); 72 $id = KTUtil::arrayGet($_REQUEST, 'id');
73 if (empty($id)) { 73 if (empty($id)) {
74 - return $this->errorRedirectToMain(_("Both names not given")); 74 + return $this->errorRedirectToMain(_kt("Both names not given"));
75 } 75 }
76 $oPerm = KTPermission::get($id); 76 $oPerm = KTPermission::get($id);
77 if (PEAR::isError($oPerm)) { 77 if (PEAR::isError($oPerm)) {
78 - return $this->errorRedirectToMain(_("Error finding permission")); 78 + return $this->errorRedirectToMain(_kt("Error finding permission"));
79 } 79 }
80 if ($oPerm->getBuiltIn() === true) { 80 if ($oPerm->getBuiltIn() === true) {
81 - return $this->errorRedirectToMain(_("Can't delete built-in permission")); 81 + return $this->errorRedirectToMain(_kt("Can't delete built-in permission"));
82 } 82 }
83 $res = $oPerm->delete(); 83 $res = $oPerm->delete();
84 if (PEAR::isError($res)) { 84 if (PEAR::isError($res)) {
85 - return $this->errorRedirectToMain(_("Error deleting permission")); 85 + return $this->errorRedirectToMain(_kt("Error deleting permission"));
86 } 86 }
87 - return $this->successRedirectToMain(_("Permission deleted")); 87 + return $this->successRedirectToMain(_kt("Permission deleted"));
88 } 88 }
89 } 89 }
90 90
plugins/ktcore/admin/plugins.php
@@ -42,7 +42,7 @@ class KTPluginDispatcher extends KTAdminDispatcher { @@ -42,7 +42,7 @@ class KTPluginDispatcher extends KTAdminDispatcher {
42 function check() { 42 function check() {
43 $this->aBreadcrumbs[] = array( 43 $this->aBreadcrumbs[] = array(
44 'url' => $_SERVER['PHP_SELF'], 44 'url' => $_SERVER['PHP_SELF'],
45 - 'name' => _('Plugins'), 45 + 'name' => _kt('Plugins'),
46 ); 46 );
47 return parent::check(); 47 return parent::check();
48 } 48 }
plugins/ktcore/admin/roleManagement.php
@@ -36,8 +36,8 @@ class RoleAdminDispatcher extends KTAdminDispatcher { @@ -36,8 +36,8 @@ class RoleAdminDispatcher extends KTAdminDispatcher {
36 } 36 }
37 37
38 function do_main() { 38 function do_main() {
39 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Role Management'));  
40 - $this->oPage->setTitle(_('Role Management')); 39 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Role Management'));
  40 + $this->oPage->setTitle(_kt('Role Management'));
41 41
42 $edit_fields = array(); 42 $edit_fields = array();
43 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null); 43 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
@@ -46,13 +46,13 @@ class RoleAdminDispatcher extends KTAdminDispatcher { @@ -46,13 +46,13 @@ class RoleAdminDispatcher extends KTAdminDispatcher {
46 if (PEAR::isError($oRole) || ($oRole == false)) { $for_edit = false; } 46 if (PEAR::isError($oRole) || ($oRole == false)) { $for_edit = false; }
47 else { 47 else {
48 $for_edit = true; 48 $for_edit = true;
49 - $edit_fields[] = new KTStringWidget(_('Name'),_('A short, human-readable name for the role.'), 'name', $oRole->getName(), $this->oPage, true); 49 + $edit_fields[] = new KTStringWidget(_kt('Name'), _('A short, human-readable name for the role.'), 'name', $oRole->getName(), $this->oPage, true);
50 } 50 }
51 51
52 $aRoles =& Role::getList('id > 0'); 52 $aRoles =& Role::getList('id > 0');
53 53
54 $add_fields = array(); 54 $add_fields = array();
55 - $add_fields[] = new KTStringWidget(_('Name'),_('A short, human-readable name for the role.'), 'name', null, $this->oPage, true); 55 + $add_fields[] = new KTStringWidget(_kt('Name'), _('A short, human-readable name for the role.'), 'name', null, $this->oPage, true);
56 56
57 $oTemplating =& KTTemplating::getSingleton(); 57 $oTemplating =& KTTemplating::getSingleton();
58 $oTemplate = $oTemplating->loadTemplate('ktcore/principals/roleadmin'); 58 $oTemplate = $oTemplating->loadTemplate('ktcore/principals/roleadmin');
@@ -70,56 +70,56 @@ class RoleAdminDispatcher extends KTAdminDispatcher { @@ -70,56 +70,56 @@ class RoleAdminDispatcher extends KTAdminDispatcher {
70 function do_createRole() { 70 function do_createRole() {
71 $name = KTUtil::arrayGet($_REQUEST, 'name', null); 71 $name = KTUtil::arrayGet($_REQUEST, 'name', null);
72 if ($name === null) { 72 if ($name === null) {
73 - $this->errorRedirectToMain(_('Please give the role a name.')); 73 + $this->errorRedirectToMain(_kt('Please give the role a name.'));
74 } 74 }
75 75
76 $this->startTransaction(); 76 $this->startTransaction();
77 $oRole = Role::createFromArray(array('name' => $name)); 77 $oRole = Role::createFromArray(array('name' => $name));
78 78
79 if (PEAR::isError($oRole) || ($oRole == false)) { 79 if (PEAR::isError($oRole) || ($oRole == false)) {
80 - $this->errorRedirectToMain(_('Unable to create role.')); 80 + $this->errorRedirectToMain(_kt('Unable to create role.'));
81 } 81 }
82 82
83 - $this->successRedirectToMain(sprintf(_('Role "%s" created.'), $name)); 83 + $this->successRedirectToMain(sprintf(_kt('Role "%s" created.'), $name));
84 } 84 }
85 85
86 function do_updateRole() { 86 function do_updateRole() {
87 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id'); 87 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id');
88 $oRole = Role::get($role_id); 88 $oRole = Role::get($role_id);
89 if (PEAR::isError($oRole) || ($oRole == false)) { 89 if (PEAR::isError($oRole) || ($oRole == false)) {
90 - $this->errorRedirectToMain(_('Please select a valid role first.')); 90 + $this->errorRedirectToMain(_kt('Please select a valid role first.'));
91 } 91 }
92 92
93 $name = KTUtil::arrayGet($_REQUEST, 'name', null); 93 $name = KTUtil::arrayGet($_REQUEST, 'name', null);
94 if ($name === null) { 94 if ($name === null) {
95 - $this->errorRedirectToMain(_('Please give the role a name.')); 95 + $this->errorRedirectToMain(_kt('Please give the role a name.'));
96 } 96 }
97 97
98 $this->startTransaction(); 98 $this->startTransaction();
99 $oRole->setName($name); 99 $oRole->setName($name);
100 $res = $oRole->update(); 100 $res = $oRole->update();
101 if (PEAR::isError($res) || ($res == false)) { 101 if (PEAR::isError($res) || ($res == false)) {
102 - $this->errorRedirectToMain(_('Unable to update role.')); 102 + $this->errorRedirectToMain(_kt('Unable to update role.'));
103 } 103 }
104 104
105 - $this->successRedirectToMain(sprintf(_('Role "%s" updated.'), $name)); 105 + $this->successRedirectToMain(sprintf(_kt('Role "%s" updated.'), $name));
106 } 106 }
107 107
108 function do_deleteRole() { 108 function do_deleteRole() {
109 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id'); 109 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id');
110 $oRole = Role::get($role_id); 110 $oRole = Role::get($role_id);
111 if (PEAR::isError($oRole) || ($oRole == false)) { 111 if (PEAR::isError($oRole) || ($oRole == false)) {
112 - $this->errorRedirectToMain(_('Please select a valid role first.')); 112 + $this->errorRedirectToMain(_kt('Please select a valid role first.'));
113 } 113 }
114 $name = $oRole->getName(); 114 $name = $oRole->getName();
115 115
116 $this->startTransaction(); 116 $this->startTransaction();
117 $res = $oRole->delete(); 117 $res = $oRole->delete();
118 if (PEAR::isError($res) || ($res == false)) { 118 if (PEAR::isError($res) || ($res == false)) {
119 - $this->errorRedirectToMain(_('Unable to delete the role.') . ' ' . _('Possible cause') . ': ' . $_SESSION['errorMessage']); 119 + $this->errorRedirectToMain(_kt('Unable to delete the role.') . ' ' . _('Possible cause') . ': ' . $_SESSION['errorMessage']);
120 } 120 }
121 121
122 - $this->successRedirectToMain(sprintf(_('Role "%s" deleted. '), $name)); 122 + $this->successRedirectToMain(sprintf(_kt('Role "%s" deleted. '), $name));
123 } 123 }
124 124
125 } 125 }
plugins/ktcore/admin/savedSearch.php
@@ -38,7 +38,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -38,7 +38,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
38 function check() { 38 function check() {
39 $this->aBreadcrumbs[] = array( 39 $this->aBreadcrumbs[] = array(
40 'url' => $_SERVER['PHP_SELF'], 40 'url' => $_SERVER['PHP_SELF'],
41 - 'name' => _('Saved Searches'), 41 + 'name' => _kt('Saved Searches'),
42 ); 42 );
43 return true; 43 return true;
44 } 44 }
@@ -59,11 +59,11 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -59,11 +59,11 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
59 $aCriteria = Criteria::getAllCriteria(); 59 $aCriteria = Criteria::getAllCriteria();
60 60
61 $aTemplateData = array( 61 $aTemplateData = array(
62 - "title" => _("Create a new condition"), 62 + "title" => _kt("Create a new condition"),
63 "aCriteria" => $aCriteria, 63 "aCriteria" => $aCriteria,
64 - "searchButton" => _("Save"), 64 + "searchButton" => _kt("Save"),
65 'context' => $this, 65 'context' => $this,
66 - "sNameTitle" => _('New Saved Search'), 66 + "sNameTitle" => _kt('New Saved Search'),
67 ); 67 );
68 return $oTemplate->render($aTemplateData); 68 return $oTemplate->render($aTemplateData);
69 } 69 }
@@ -73,15 +73,15 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -73,15 +73,15 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
73 $oSearch = KTSavedSearch::get($id); 73 $oSearch = KTSavedSearch::get($id);
74 74
75 if (PEAR::isError($oSearch) || ($oSearch == false)) { 75 if (PEAR::isError($oSearch) || ($oSearch == false)) {
76 - $this->errorRedirectToMain(_('No Such search')); 76 + $this->errorRedirectToMain(_kt('No Such search'));
77 } 77 }
78 78
79 $res = $oSearch->delete(); 79 $res = $oSearch->delete();
80 if (PEAR::isError($res) || ($res == false)) { 80 if (PEAR::isError($res) || ($res == false)) {
81 - return $this->errorRedirectToMain(_('Failed to delete search')); 81 + return $this->errorRedirectToMain(_kt('Failed to delete search'));
82 } 82 }
83 83
84 - $this->successRedirectToMain(_('Search Deleted')); 84 + $this->successRedirectToMain(_kt('Search Deleted'));
85 } 85 }
86 86
87 function do_view() { 87 function do_view() {
@@ -123,14 +123,14 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -123,14 +123,14 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
123 //print $s; 123 //print $s;
124 124
125 $aTemplateData = array( 125 $aTemplateData = array(
126 - "title" => _("Edit an existing condition"), 126 + "title" => _kt("Edit an existing condition"),
127 "aCriteria" => $aCriteria, 127 "aCriteria" => $aCriteria,
128 - "searchButton" => _("Update Saved Search"), 128 + "searchButton" => _kt("Update Saved Search"),
129 'aSearch' => $aSearch, 129 'aSearch' => $aSearch,
130 'context' => $this, 130 'context' => $this,
131 'iSearchId' => $oSearch->getId(), 131 'iSearchId' => $oSearch->getId(),
132 'old_name' => $oSearch->getName(), 132 'old_name' => $oSearch->getName(),
133 - 'sNameTitle' => _('Edit Search'), 133 + 'sNameTitle' => _kt('Edit Search'),
134 ); 134 );
135 return $oTemplate->render($aTemplateData); 135 return $oTemplate->render($aTemplateData);
136 136
@@ -154,7 +154,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -154,7 +154,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
154 } 154 }
155 155
156 if (empty($datavars)) { 156 if (empty($datavars)) {
157 - $this->errorRedirectToMain(_('You need to have at least 1 condition.')); 157 + $this->errorRedirectToMain(_kt('You need to have at least 1 condition.'));
158 } 158 }
159 159
160 //$sName = "Neil's saved search"; 160 //$sName = "Neil's saved search";
@@ -167,9 +167,9 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -167,9 +167,9 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
167 167
168 $this->oValidator->notError($res, array( 168 $this->oValidator->notError($res, array(
169 'redirect_to' => 'main', 169 'redirect_to' => 'main',
170 - 'message' => _('Search not saved'), 170 + 'message' => _kt('Search not saved'),
171 )); 171 ));
172 - $this->successRedirectToMain(_('Search saved')); 172 + $this->successRedirectToMain(_kt('Search saved'));
173 } 173 }
174 174
175 // XXX: Rename to do_save 175 // XXX: Rename to do_save
@@ -187,7 +187,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -187,7 +187,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
187 } 187 }
188 188
189 if (empty($datavars)) { 189 if (empty($datavars)) {
190 - $this->errorRedirectToMain(_('You need to have at least 1 condition.')); 190 + $this->errorRedirectToMain(_kt('You need to have at least 1 condition.'));
191 } 191 }
192 192
193 $sNamespace = KTUtil::nameToLocalNamespace('Saved searches', $sName); 193 $sNamespace = KTUtil::nameToLocalNamespace('Saved searches', $sName);
@@ -203,9 +203,9 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher { @@ -203,9 +203,9 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
203 203
204 $this->oValidator->notError($oSearch, array( 204 $this->oValidator->notError($oSearch, array(
205 'redirect_to' => 'main', 205 'redirect_to' => 'main',
206 - 'message' => _('Search not saved'), 206 + 'message' => _kt('Search not saved'),
207 )); 207 ));
208 - $this->successRedirectToMain(_('Search saved')); 208 + $this->successRedirectToMain(_kt('Search saved'));
209 } 209 }
210 } 210 }
211 211
plugins/ktcore/admin/techsupport.php
@@ -35,7 +35,7 @@ class KTSupportDispatcher extends KTAdminDispatcher { @@ -35,7 +35,7 @@ class KTSupportDispatcher extends KTAdminDispatcher {
35 var $bAutomaticTransaction = true; 35 var $bAutomaticTransaction = true;
36 36
37 function check() { 37 function check() {
38 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Support and System information')); 38 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Support and System information'));
39 return true; 39 return true;
40 } 40 }
41 41
plugins/ktcore/admin/unitManagement.php
@@ -44,13 +44,13 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -44,13 +44,13 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
44 var $bAutomaticTransaction = true; 44 var $bAutomaticTransaction = true;
45 45
46 function check() { 46 function check() {
47 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Unit Management')); 47 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Unit Management'));
48 return parent::check(); 48 return parent::check();
49 } 49 }
50 50
51 function do_main() { 51 function do_main() {
52 - $this->oPage->setBreadcrumbDetails(_('select a unit'));  
53 - $this->oPage->setTitle(_("Unit Management")); 52 + $this->oPage->setBreadcrumbDetails(_kt('select a unit'));
  53 + $this->oPage->setTitle(_kt("Unit Management"));
54 54
55 $unit_list =& Unit::getList(); 55 $unit_list =& Unit::getList();
56 56
@@ -64,11 +64,11 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -64,11 +64,11 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
64 } 64 }
65 65
66 function do_addUnit() { 66 function do_addUnit() {
67 - $this->oPage->setBreadcrumbDetails(_('Add a new unit'));  
68 - $this->oPage->setTitle(_("Add a new unit")); 67 + $this->oPage->setBreadcrumbDetails(_kt('Add a new unit'));
  68 + $this->oPage->setTitle(_kt("Add a new unit"));
69 69
70 $add_fields = array(); 70 $add_fields = array();
71 - $add_fields[] = new KTStringWidget(_('Unit Name'),_('A short name for the unit. e.g. <strong>Accounting</strong>.'), 'unit_name', null, $this->oPage, true); 71 + $add_fields[] = new KTStringWidget(_kt('Unit Name'), _('A short name for the unit. e.g. <strong>Accounting</strong>.'), 'unit_name', null, $this->oPage, true);
72 72
73 $oTemplating =& KTTemplating::getSingleton(); 73 $oTemplating =& KTTemplating::getSingleton();
74 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/addunit"); 74 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/addunit");
@@ -80,15 +80,15 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -80,15 +80,15 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
80 } 80 }
81 81
82 function do_addUnit2() { 82 function do_addUnit2() {
83 - $this->oPage->setBreadcrumbDetails(_('Add a new unit'));  
84 - $this->oPage->setTitle(_("Add a new unit")); 83 + $this->oPage->setBreadcrumbDetails(_kt('Add a new unit'));
  84 + $this->oPage->setTitle(_kt("Add a new unit"));
85 85
86 $aOptions = array( 86 $aOptions = array(
87 'redirect_to' => array('addUnit'), 87 'redirect_to' => array('addUnit'),
88 - 'message' => _('No name given'), 88 + 'message' => _kt('No name given'),
89 ); 89 );
90 $sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions); 90 $sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions);
91 - $aOptions['message'] = _('A unit with that name already exists.'); 91 + $aOptions['message'] = _kt('A unit with that name already exists.');
92 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions); 92 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
93 93
94 $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1); 94 $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1);
@@ -130,7 +130,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -130,7 +130,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
130 } 130 }
131 131
132 $add_fields = array(); 132 $add_fields = array();
133 - $add_fields[] = new KTStaticTextWidget(_('Unit Name'),_('A short name for the unit. e.g. <strong>Accounting</strong>.'), 'unit_name', $sName, $this->oPage, true); 133 + $add_fields[] = new KTStaticTextWidget(_kt('Unit Name'), _('A short name for the unit. e.g. <strong>Accounting</strong>.'), 'unit_name', $sName, $this->oPage, true);
134 134
135 $isValid = true; 135 $isValid = true;
136 if (KTFolderUtil::exists($oFolder, $sName)) { 136 if (KTFolderUtil::exists($oFolder, $sName)) {
@@ -154,15 +154,15 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -154,15 +154,15 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
154 function do_createUnit() { 154 function do_createUnit() {
155 $aOptions = array( 155 $aOptions = array(
156 'redirect_to' => array('main'), 156 'redirect_to' => array('main'),
157 - 'message' => _('Invalid folder chosen'), 157 + 'message' => _kt('Invalid folder chosen'),
158 ); 158 );
159 $oParentFolder = $this->oValidator->validateFolder($_REQUEST['fFolderId'], $aOptions); 159 $oParentFolder = $this->oValidator->validateFolder($_REQUEST['fFolderId'], $aOptions);
160 $aOptions = array( 160 $aOptions = array(
161 'redirect_to' => array('addUnit', sprintf('fFolderId=%d', $oParentFolder->getId())), 161 'redirect_to' => array('addUnit', sprintf('fFolderId=%d', $oParentFolder->getId())),
162 - 'message' => _('No name given'), 162 + 'message' => _kt('No name given'),
163 ); 163 );
164 $sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions); 164 $sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions);
165 - $aOptions['message'] = _('A unit with that name already exists.'); 165 + $aOptions['message'] = _kt('A unit with that name already exists.');
166 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions); 166 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
167 167
168 $oFolder = KTFolderUtil::add($oParentFolder, $sName, $this->oUser); 168 $oFolder = KTFolderUtil::add($oParentFolder, $sName, $this->oUser);
@@ -185,7 +185,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -185,7 +185,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
185 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']); 185 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']);
186 186
187 $fields = array(); 187 $fields = array();
188 - $fields[] = new KTStringWidget(_('Unit Name'),_('A short name for the unit. e.g. <strong>Accounting</strong>.'), 'unit_name', $oUnit->getName(), $this->oPage, true); 188 + $fields[] = new KTStringWidget(_kt('Unit Name'), _('A short name for the unit. e.g. <strong>Accounting</strong>.'), 'unit_name', $oUnit->getName(), $this->oPage, true);
189 189
190 $oTemplate =& $this->oValidator->validateTemplate('ktcore/principals/editunit'); 190 $oTemplate =& $this->oValidator->validateTemplate('ktcore/principals/editunit');
191 $aTemplateData = array( 191 $aTemplateData = array(
@@ -200,16 +200,16 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -200,16 +200,16 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
200 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']); 200 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']);
201 $aOptions = array( 201 $aOptions = array(
202 'redirect_to' => array('editUnit', sprintf('unit_id=%d', $oUnit->getId())), 202 'redirect_to' => array('editUnit', sprintf('unit_id=%d', $oUnit->getId())),
203 - 'message' => _('No name given'), 203 + 'message' => _kt('No name given'),
204 ); 204 );
205 $sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions); 205 $sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions);
206 - $aOptions['message'] = _('A unit with that name already exists.'); 206 + $aOptions['message'] = _kt('A unit with that name already exists.');
207 $aOptions['rename'] = $oUnit->getId(); 207 $aOptions['rename'] = $oUnit->getId();
208 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions); 208 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
209 $oUnit->setName($sName); 209 $oUnit->setName($sName);
210 $res = $oUnit->update(); 210 $res = $oUnit->update();
211 if (($res == false) || (PEAR::isError($res))) { 211 if (($res == false) || (PEAR::isError($res))) {
212 - return $this->errorRedirectToMain(_('Failed to set unit details.')); 212 + return $this->errorRedirectToMain(_kt('Failed to set unit details.'));
213 } 213 }
214 $iFolderId = $oUnit->getFolderId(); 214 $iFolderId = $oUnit->getFolderId();
215 $oFolder = Folder::get($iFolderId); 215 $oFolder = Folder::get($iFolderId);
@@ -217,14 +217,14 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -217,14 +217,14 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
217 KTFolderUtil::rename($oFolder, $sName, $this->oUser); 217 KTFolderUtil::rename($oFolder, $sName, $this->oUser);
218 } 218 }
219 219
220 - $this->successRedirectToMain(_("Unit details updated")); 220 + $this->successRedirectToMain(_kt("Unit details updated"));
221 } 221 }
222 222
223 function do_deleteUnit() { 223 function do_deleteUnit() {
224 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']); 224 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']);
225 225
226 $fields = array(); 226 $fields = array();
227 - $fields[] = new KTCheckboxWidget(_('Delete folder'), _('Each unit has an associated folder. While the unit is being deleted, there may be some documents within the associated folder. By unselecting this option, they will not be removed.'), 'delete_folder', true, $this->oPage, true); 227 + $fields[] = new KTCheckboxWidget(_kt('Delete folder'), _('Each unit has an associated folder. While the unit is being deleted, there may be some documents within the associated folder. By unselecting this option, they will not be removed.'), 'delete_folder', true, $this->oPage, true);
228 228
229 $oTemplate =& $this->oValidator->validateTemplate('ktcore/principals/deleteunit'); 229 $oTemplate =& $this->oValidator->validateTemplate('ktcore/principals/deleteunit');
230 $aTemplateData = array( 230 $aTemplateData = array(
@@ -241,7 +241,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher { @@ -241,7 +241,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
241 $res = $oUnit->delete(); 241 $res = $oUnit->delete();
242 $aOptions = array( 242 $aOptions = array(
243 'redirect_to' => array('main'), 243 'redirect_to' => array('main'),
244 - 'message' => _("Could not delete this unit because it has groups assigned to it"), 244 + 'message' => _kt("Could not delete this unit because it has groups assigned to it"),
245 'no_exception' => true, 245 'no_exception' => true,
246 ); 246 );
247 $this->oValidator->notError($res, $aOptions); 247 $this->oValidator->notError($res, $aOptions);
plugins/ktcore/admin/userManagement.php
@@ -43,9 +43,9 @@ require_once(KT_LIB_DIR . &quot;/authentication/builtinauthenticationprovider.inc.php @@ -43,9 +43,9 @@ require_once(KT_LIB_DIR . &quot;/authentication/builtinauthenticationprovider.inc.php
43 43
44 class KTUserAdminDispatcher extends KTAdminDispatcher { 44 class KTUserAdminDispatcher extends KTAdminDispatcher {
45 function do_main() { 45 function do_main() {
46 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management'));  
47 - $this->oPage->setBreadcrumbDetails(_('select a user'));  
48 - $this->oPage->setTitle(_("User Management")); 46 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('User Management'));
  47 + $this->oPage->setBreadcrumbDetails(_kt('select a user'));
  48 + $this->oPage->setTitle(_kt("User Management"));
49 49
50 $KTConfig =& KTConfig::getSingleton(); 50 $KTConfig =& KTConfig::getSingleton();
51 $alwaysAll = $KTConfig->get("alwaysShowAll"); 51 $alwaysAll = $KTConfig->get("alwaysShowAll");
@@ -63,7 +63,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -63,7 +63,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
63 63
64 64
65 $search_fields = array(); 65 $search_fields = array();
66 - $search_fields[] = new KTStringWidget(_('Username'),_("Enter part of the person's username. e.g. <strong>ra</strong> will match <strong>brad</strong>."), 'name', $name, $this->oPage, true); 66 + $search_fields[] = new KTStringWidget(_kt('Username'), _("Enter part of the person's username. e.g. <strong>ra</strong> will match <strong>brad</strong>."), 'name', $name, $this->oPage, true);
67 67
68 // FIXME handle group search stuff. 68 // FIXME handle group search stuff.
69 $search_results = null; 69 $search_results = null;
@@ -87,9 +87,9 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -87,9 +87,9 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
87 87
88 88
89 function do_addUser() { 89 function do_addUser() {
90 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management'));  
91 - $this->oPage->setBreadcrumbDetails(_('add a new user'));  
92 - $this->oPage->setTitle(_("Modify User Details")); 90 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('User Management'));
  91 + $this->oPage->setBreadcrumbDetails(_kt('add a new user'));
  92 + $this->oPage->setTitle(_kt("Modify User Details"));
93 93
94 $name = KTUtil::arrayGet($_REQUEST, 'name'); 94 $name = KTUtil::arrayGet($_REQUEST, 'name');
95 $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false); 95 $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false);
@@ -110,15 +110,15 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -110,15 +110,15 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
110 } 110 }
111 111
112 $add_fields = array(); 112 $add_fields = array();
113 - $add_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to KnowledgeTree. e.g. <strong>jsmith</strong>'), 'username', null, $this->oPage, true, null, null, $aOptions);  
114 - $add_fields[] = new KTStringWidget(_('Name'),_('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', null, $this->oPage, true, null, null, $aOptions);  
115 - $add_fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', null, $this->oPage, false, null, null, $aOptions);  
116 - $add_fields[] = new KTCheckboxWidget(_('Email Notifications'), _("If this is specified then the user will have notifications sent to the email address entered above. If it isn't set, then the user will only see notifications on the <strong>Dashboard</strong>"), 'email_notifications', true, $this->oPage, false, null, null, $aOptions);  
117 - $add_fields[] = new KTPasswordWidget(_('Password'), _('Specify an initial password for the user.') . $passwordAddRequirement, 'password', null, $this->oPage, true, null, null, $aOptions);  
118 - $add_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions); 113 + $add_fields[] = new KTStringWidget(_kt('Username'), _('The username the user will enter to gain access to KnowledgeTree. e.g. <strong>jsmith</strong>'), 'username', null, $this->oPage, true, null, null, $aOptions);
  114 + $add_fields[] = new KTStringWidget(_kt('Name'), _('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', null, $this->oPage, true, null, null, $aOptions);
  115 + $add_fields[] = new KTStringWidget(_kt('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', null, $this->oPage, false, null, null, $aOptions);
  116 + $add_fields[] = new KTCheckboxWidget(_kt('Email Notifications'), _("If this is specified then the user will have notifications sent to the email address entered above. If it isn't set, then the user will only see notifications on the <strong>Dashboard</strong>"), 'email_notifications', true, $this->oPage, false, null, null, $aOptions);
  117 + $add_fields[] = new KTPasswordWidget(_kt('Password'), _('Specify an initial password for the user.') . $passwordAddRequirement, 'password', null, $this->oPage, true, null, null, $aOptions);
  118 + $add_fields[] = new KTPasswordWidget(_kt('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions);
119 // nice, easy bits. 119 // nice, easy bits.
120 - $add_fields[] = new KTStringWidget(_('Mobile Number'), _("The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS'd with notifications. e.g. <strong>999 9999 999</strong>"), 'mobile_number', null, $this->oPage, false, null, null, $aOptions);  
121 - $add_fields[] = new KTStringWidget(_('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true, null, null, $aOptions); 120 + $add_fields[] = new KTStringWidget(_kt('Mobile Number'), _("The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS'd with notifications. e.g. <strong>999 9999 999</strong>"), 'mobile_number', null, $this->oPage, false, null, null, $aOptions);
  121 + $add_fields[] = new KTStringWidget(_kt('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true, null, null, $aOptions);
122 122
123 $aAuthenticationSources =& KTAuthenticationSource::getList(); 123 $aAuthenticationSources =& KTAuthenticationSource::getList();
124 124
@@ -138,38 +138,38 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -138,38 +138,38 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
138 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); 138 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
139 $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); 139 $oProvider =& $oRegistry->getAuthenticationProvider($sProvider);
140 140
141 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management'));  
142 - $this->aBreadcrumbs[] = array('url' => KTUtil::addQueryStringSelf('action=addUser'), 'name' => _('add a new user')); 141 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('User Management'));
  142 + $this->aBreadcrumbs[] = array('url' => KTUtil::addQueryStringSelf('action=addUser'), 'name' => _kt('add a new user'));
143 $oProvider->aBreadcrumbs = $this->aBreadcrumbs; 143 $oProvider->aBreadcrumbs = $this->aBreadcrumbs;
144 $oProvider->oPage->setBreadcrumbDetails($oSource->getName()); 144 $oProvider->oPage->setBreadcrumbDetails($oSource->getName());
145 - $oProvider->oPage->setTitle(_("Modify User Details")); 145 + $oProvider->oPage->setTitle(_kt("Modify User Details"));
146 146
147 $oProvider->dispatch(); 147 $oProvider->dispatch();
148 exit(0); 148 exit(0);
149 } 149 }
150 150
151 function do_editUser() { 151 function do_editUser() {
152 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management'));  
153 - $this->oPage->setBreadcrumbDetails(_('modify user details'));  
154 - $this->oPage->setTitle(_("Modify User Details")); 152 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('User Management'));
  153 + $this->oPage->setBreadcrumbDetails(_kt('modify user details'));
  154 + $this->oPage->setTitle(_kt("Modify User Details"));
155 155
156 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); 156 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
157 $oUser =& User::get($user_id); 157 $oUser =& User::get($user_id);
158 158
159 if (PEAR::isError($oUser) || $oUser == false) { 159 if (PEAR::isError($oUser) || $oUser == false) {
160 - $this->errorRedirectToMain(_('Please select a user first.')); 160 + $this->errorRedirectToMain(_kt('Please select a user first.'));
161 exit(0); 161 exit(0);
162 } 162 }
163 163
164 $this->aBreadcrumbs[] = array('name' => $oUser->getName()); 164 $this->aBreadcrumbs[] = array('name' => $oUser->getName());
165 165
166 $edit_fields = array(); 166 $edit_fields = array();
167 - $edit_fields[] = new KTStringWidget(_('Username'),_('The username the user will enter to gain access to KnowledgeTree. e.g. <strong>jsmith</strong>'), 'username', $oUser->getUsername(), $this->oPage, true);  
168 - $edit_fields[] = new KTStringWidget(_('Name'), _('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $oUser->getName(), $this->oPage, true);  
169 - $edit_fields[] = new KTStringWidget(_('Email Address'),_('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $oUser->getEmail(), $this->oPage, false);  
170 - $edit_fields[] = new KTCheckboxWidget(_('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false);  
171 - $edit_fields[] = new KTStringWidget(_('Mobile Number'),_("The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS'd with notifications. e.g. <strong>999 9999 999</strong>"), 'mobile_number', $oUser->getMobile(), $this->oPage, false);  
172 - $edit_fields[] = new KTStringWidget(_('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', $oUser->getMaxSessions(), $this->oPage, true); 167 + $edit_fields[] = new KTStringWidget(_kt('Username'), _('The username the user will enter to gain access to KnowledgeTree. e.g. <strong>jsmith</strong>'), 'username', $oUser->getUsername(), $this->oPage, true);
  168 + $edit_fields[] = new KTStringWidget(_kt('Name'), _('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $oUser->getName(), $this->oPage, true);
  169 + $edit_fields[] = new KTStringWidget(_kt('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $oUser->getEmail(), $this->oPage, false);
  170 + $edit_fields[] = new KTCheckboxWidget(_kt('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false);
  171 + $edit_fields[] = new KTStringWidget(_kt('Mobile Number'), _("The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS'd with notifications. e.g. <strong>999 9999 999</strong>"), 'mobile_number', $oUser->getMobile(), $this->oPage, false);
  172 + $edit_fields[] = new KTStringWidget(_kt('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', $oUser->getMaxSessions(), $this->oPage, true);
173 173
174 $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser); 174 $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser);
175 if (is_null($oAuthenticationSource)) { 175 if (is_null($oAuthenticationSource)) {
@@ -194,23 +194,23 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -194,23 +194,23 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
194 194
195 195
196 function do_setPassword() { 196 function do_setPassword() {
197 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('User Management'));  
198 - $this->oPage->setBreadcrumbDetails(_('change user password'));  
199 - $this->oPage->setTitle(_("Change User Password")); 197 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('User Management'));
  198 + $this->oPage->setBreadcrumbDetails(_kt('change user password'));
  199 + $this->oPage->setTitle(_kt("Change User Password"));
200 200
201 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); 201 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
202 $oUser =& User::get($user_id); 202 $oUser =& User::get($user_id);
203 203
204 if (PEAR::isError($oUser) || $oUser == false) { 204 if (PEAR::isError($oUser) || $oUser == false) {
205 - $this->errorRedirectToMain(_('Please select a user first.')); 205 + $this->errorRedirectToMain(_kt('Please select a user first.'));
206 exit(0); 206 exit(0);
207 } 207 }
208 208
209 $this->aBreadcrumbs[] = array('name' => $oUser->getName()); 209 $this->aBreadcrumbs[] = array('name' => $oUser->getName());
210 210
211 $edit_fields = array(); 211 $edit_fields = array();
212 - $edit_fields[] = new KTPasswordWidget(_('Password'),_('Specify an initial password for the user.'), 'password', null, $this->oPage, true);  
213 - $edit_fields[] = new KTPasswordWidget(_('Confirm Password'),_('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true); 212 + $edit_fields[] = new KTPasswordWidget(_kt('Password'), _('Specify an initial password for the user.'), 'password', null, $this->oPage, true);
  213 + $edit_fields[] = new KTPasswordWidget(_kt('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true);
214 214
215 $oTemplating =& KTTemplating::getSingleton(); 215 $oTemplating =& KTTemplating::getSingleton();
216 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/updatepassword"); 216 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/updatepassword");
@@ -234,11 +234,11 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -234,11 +234,11 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
234 234
235 235
236 if ($restrictAdmin && (strlen($password) < $minLength)) { 236 if ($restrictAdmin && (strlen($password) < $minLength)) {
237 - $this->errorRedirectToMain(sprintf(_("The password must be at least %d characters long."), $minLength)); 237 + $this->errorRedirectToMain(sprintf(_kt("The password must be at least %d characters long."), $minLength));
238 } else if (empty($password)) { 238 } else if (empty($password)) {
239 - $this->errorRedirectToMain(_("You must specify a password for the user.")); 239 + $this->errorRedirectToMain(_kt("You must specify a password for the user."));
240 } else if ($password !== $confirm_password) { 240 } else if ($password !== $confirm_password) {
241 - $this->errorRedirectToMain(_("The passwords you specified do not match.")); 241 + $this->errorRedirectToMain(_kt("The passwords you specified do not match."));
242 } 242 }
243 // FIXME more validation would be useful. 243 // FIXME more validation would be useful.
244 // validated and ready.. 244 // validated and ready..
@@ -246,7 +246,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -246,7 +246,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
246 246
247 $oUser =& User::get($user_id); 247 $oUser =& User::get($user_id);
248 if (PEAR::isError($oUser) || $oUser == false) { 248 if (PEAR::isError($oUser) || $oUser == false) {
249 - $this->errorRedirectToMain(_("Please select a user to modify first.")); 249 + $this->errorRedirectToMain(_kt("Please select a user to modify first."));
250 } 250 }
251 251
252 252
@@ -258,11 +258,11 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -258,11 +258,11 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
258 258
259 259
260 if (PEAR::isError($res) || ($res == false)) { 260 if (PEAR::isError($res) || ($res == false)) {
261 - $this->errorRedirectoToMain(_('Failed to update user.')); 261 + $this->errorRedirectoToMain(_kt('Failed to update user.'));
262 } 262 }
263 263
264 $this->commitTransaction(); 264 $this->commitTransaction();
265 - $this->successRedirectToMain(_('User information updated.')); 265 + $this->successRedirectToMain(_kt('User information updated.'));
266 266
267 } 267 }
268 268
@@ -288,12 +288,12 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -288,12 +288,12 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
288 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); 288 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
289 $oUser = User::get($user_id); 289 $oUser = User::get($user_id);
290 if ((PEAR::isError($oUser)) || ($oUser === false)) { 290 if ((PEAR::isError($oUser)) || ($oUser === false)) {
291 - $this->errorRedirectToMain(_('No such user.')); 291 + $this->errorRedirectToMain(_kt('No such user.'));
292 } 292 }
293 293
294 $this->aBreadcrumbs[] = array('name' => $oUser->getName()); 294 $this->aBreadcrumbs[] = array('name' => $oUser->getName());
295 - $this->oPage->setBreadcrumbDetails(_('edit groups'));  
296 - $this->oPage->setTitle(sprintf(_("Edit %s's groups"), $oUser->getName())); 295 + $this->oPage->setBreadcrumbDetails(_kt('edit groups'));
  296 + $this->oPage->setTitle(sprintf(_kt("Edit %s's groups"), $oUser->getName()));
297 // generate a list of groups this user is authorised to assign. 297 // generate a list of groups this user is authorised to assign.
298 298
299 /* FIXME there is a nasty side-effect: if a user cannot assign a group 299 /* FIXME there is a nasty side-effect: if a user cannot assign a group
@@ -348,12 +348,12 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -348,12 +348,12 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
348 348
349 $name = $this->oValidator->validateString( 349 $name = $this->oValidator->validateString(
350 KTUtil::arrayGet($_REQUEST, 'name'), 350 KTUtil::arrayGet($_REQUEST, 'name'),
351 - KTUtil::meldOptions($aErrorOptions, array('message' => _("You must provide a name"))) 351 + KTUtil::meldOptions($aErrorOptions, array('message' => _kt("You must provide a name")))
352 ); 352 );
353 353
354 $username = $this->oValidator->validateString( 354 $username = $this->oValidator->validateString(
355 KTUtil::arrayGet($_REQUEST, 'username'), 355 KTUtil::arrayGet($_REQUEST, 'username'),
356 - KTUtil::meldOptions($aErrorOptions, array('message' => _("You must provide a username"))) 356 + KTUtil::meldOptions($aErrorOptions, array('message' => _kt("You must provide a username")))
357 ); 357 );
358 358
359 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address'); 359 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address');
@@ -374,7 +374,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -374,7 +374,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
374 374
375 $oUser =& User::get($user_id); 375 $oUser =& User::get($user_id);
376 if (PEAR::isError($oUser) || $oUser == false) { 376 if (PEAR::isError($oUser) || $oUser == false) {
377 - $this->errorRedirectToMain(_("Please select a user to modify first.")); 377 + $this->errorRedirectToMain(_kt("Please select a user to modify first."));
378 } 378 }
379 379
380 $oUser->setName($name); 380 $oUser->setName($name);
@@ -393,20 +393,20 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -393,20 +393,20 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
393 393
394 394
395 if (PEAR::isError($res) || ($res == false)) { 395 if (PEAR::isError($res) || ($res == false)) {
396 - $this->errorRedirectoToMain(_('Failed to update user.')); 396 + $this->errorRedirectoToMain(_kt('Failed to update user.'));
397 } 397 }
398 398
399 $this->commitTransaction(); 399 $this->commitTransaction();
400 - $this->successRedirectToMain(_('User information updated.')); 400 + $this->successRedirectToMain(_kt('User information updated.'));
401 } 401 }
402 402
403 function do_createUser() { 403 function do_createUser() {
404 // FIXME generate and pass the error stack to adduser. 404 // FIXME generate and pass the error stack to adduser.
405 405
406 $name = KTUtil::arrayGet($_REQUEST, 'name'); 406 $name = KTUtil::arrayGet($_REQUEST, 'name');
407 - if (empty($name)) { $this->errorRedirectTo('addUser', _('You must specify a name for the user.')); } 407 + if (empty($name)) { $this->errorRedirectTo('addUser', _kt('You must specify a name for the user.')); }
408 $username = KTUtil::arrayGet($_REQUEST, 'username'); 408 $username = KTUtil::arrayGet($_REQUEST, 'username');
409 - if (empty($name)) { $this->errorRedirectTo('addUser', _('You must specify a new username.')); } 409 + if (empty($name)) { $this->errorRedirectTo('addUser', _kt('You must specify a new username.')); }
410 // FIXME check for non-clashing usernames. 410 // FIXME check for non-clashing usernames.
411 411
412 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address'); 412 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address');
@@ -424,16 +424,16 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -424,16 +424,16 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
424 424
425 425
426 if ($restrictAdmin && (strlen($password) < $minLength)) { 426 if ($restrictAdmin && (strlen($password) < $minLength)) {
427 - $this->errorRedirectTo('addUser', sprintf(_("The password must be at least %d characters long."), $minLength)); 427 + $this->errorRedirectTo('addUser', sprintf(_kt("The password must be at least %d characters long."), $minLength));
428 } else if (empty($password)) { 428 } else if (empty($password)) {
429 - $this->errorRedirectTo('addUser', _("You must specify a password for the user.")); 429 + $this->errorRedirectTo('addUser', _kt("You must specify a password for the user."));
430 } else if ($password !== $confirm_password) { 430 } else if ($password !== $confirm_password) {
431 - $this->errorRedirectTo('addUser', _("The passwords you specified do not match.")); 431 + $this->errorRedirectTo('addUser', _kt("The passwords you specified do not match."));
432 } 432 }
433 433
434 $dupUser =& User::getByUserName($username); 434 $dupUser =& User::getByUserName($username);
435 if(!PEAR::isError($dupUser)) { 435 if(!PEAR::isError($dupUser)) {
436 - $this->errorRedirectTo('addUser', _("A user with that username already exists")); 436 + $this->errorRedirectTo('addUser', _kt("A user with that username already exists"));
437 } 437 }
438 438
439 $oUser =& User::createFromArray(array( 439 $oUser =& User::createFromArray(array(
@@ -449,31 +449,31 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -449,31 +449,31 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
449 )); 449 ));
450 450
451 if (PEAR::isError($oUser) || ($oUser == false)) { 451 if (PEAR::isError($oUser) || ($oUser == false)) {
452 - $this->errorRedirectToMain(_("failed to create user.")); 452 + $this->errorRedirectToMain(_kt("failed to create user."));
453 exit(0); 453 exit(0);
454 } 454 }
455 455
456 $oUser->create(); 456 $oUser->create();
457 457
458 - $this->successRedirectToMain(_('Created new user') . ': "' . $oUser->getUsername() . '"', 'name=' . $oUser->getUsername()); 458 + $this->successRedirectToMain(_kt('Created new user') . ': "' . $oUser->getUsername() . '"', 'name=' . $oUser->getUsername());
459 } 459 }
460 460
461 function do_deleteUser() { 461 function do_deleteUser() {
462 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); 462 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
463 $oUser = User::get($user_id); 463 $oUser = User::get($user_id);
464 if ((PEAR::isError($oUser)) || ($oUser === false)) { 464 if ((PEAR::isError($oUser)) || ($oUser === false)) {
465 - $this->errorRedirectToMain(_('Please select a user first.')); 465 + $this->errorRedirectToMain(_kt('Please select a user first.'));
466 } 466 }
467 $oUser->delete(); 467 $oUser->delete();
468 468
469 - $this->successRedirectToMain(_('User deleted') . ': ' . $oUser->getName()); 469 + $this->successRedirectToMain(_kt('User deleted') . ': ' . $oUser->getName());
470 } 470 }
471 471
472 function do_updateGroups() { 472 function do_updateGroups() {
473 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); 473 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
474 $oUser = User::get($user_id); 474 $oUser = User::get($user_id);
475 if ((PEAR::isError($oUser)) || ($oUser === false)) { 475 if ((PEAR::isError($oUser)) || ($oUser === false)) {
476 - $this->errorRedirectToMain(_('Please select a user first.')); 476 + $this->errorRedirectToMain(_kt('Please select a user first.'));
477 } 477 }
478 $groupAdded = KTUtil::arrayGet($_REQUEST, 'groupAdded',''); 478 $groupAdded = KTUtil::arrayGet($_REQUEST, 'groupAdded','');
479 $groupRemoved = KTUtil::arrayGet($_REQUEST, 'groupRemoved',''); 479 $groupRemoved = KTUtil::arrayGet($_REQUEST, 'groupRemoved','');
@@ -503,7 +503,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -503,7 +503,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
503 } 503 }
504 $res = $oGroup->addMember($oUser); 504 $res = $oGroup->addMember($oUser);
505 if (PEAR::isError($res) || $res == false) { 505 if (PEAR::isError($res) || $res == false) {
506 - $this->errorRedirectToMain(sprintf(_('Unable to add user to group "%s"'), $oGroup->getName())); 506 + $this->errorRedirectToMain(sprintf(_kt('Unable to add user to group "%s"'), $oGroup->getName()));
507 } else { 507 } else {
508 $groupsAdded[] = $oGroup->getName(); 508 $groupsAdded[] = $oGroup->getName();
509 509
@@ -517,7 +517,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -517,7 +517,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
517 $oGroup = Group::get($iGroupID); 517 $oGroup = Group::get($iGroupID);
518 $res = $oGroup->removeMember($oUser); 518 $res = $oGroup->removeMember($oUser);
519 if (PEAR::isError($res) || $res == false) { 519 if (PEAR::isError($res) || $res == false) {
520 - $this->errorRedirectToMain(sprintf(_('Unable to remove user from group "%s"'), $oGroup->getName())); 520 + $this->errorRedirectToMain(sprintf(_kt('Unable to remove user from group "%s"'), $oGroup->getName()));
521 } else { 521 } else {
522 $groupsRemoved[] = $oGroup->getName(); 522 $groupsRemoved[] = $oGroup->getName();
523 $memberReason = GroupUtil::getMembershipReason($oUser, $oGroup); 523 $memberReason = GroupUtil::getMembershipReason($oUser, $oGroup);
@@ -530,20 +530,20 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -530,20 +530,20 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
530 } 530 }
531 531
532 if (!empty($addWarnings)) { 532 if (!empty($addWarnings)) {
533 - $sWarnStr = _('Warning: the user was already a member of some subgroups') . ' &mdash; '; 533 + $sWarnStr = _kt('Warning: the user was already a member of some subgroups') . ' &mdash; ';
534 $sWarnStr .= implode(', ', $addWarnings); 534 $sWarnStr .= implode(', ', $addWarnings);
535 $_SESSION['KTInfoMessage'][] = $sWarnStr; 535 $_SESSION['KTInfoMessage'][] = $sWarnStr;
536 } 536 }
537 537
538 if (!empty($removeWarnings)) { 538 if (!empty($removeWarnings)) {
539 - $sWarnStr = _('Warning: the user is still a member of some subgroups') . ' &mdash; '; 539 + $sWarnStr = _kt('Warning: the user is still a member of some subgroups') . ' &mdash; ';
540 $sWarnStr .= implode(', ', $removeWarnings); 540 $sWarnStr .= implode(', ', $removeWarnings);
541 $_SESSION['KTInfoMessage'][] = $sWarnStr; 541 $_SESSION['KTInfoMessage'][] = $sWarnStr;
542 } 542 }
543 543
544 $msg = ''; 544 $msg = '';
545 - if (!empty($groupsAdded)) { $msg .= ' ' . _('Added to groups') . ': ' . implode(', ', $groupsAdded) . ' <br />'; }  
546 - if (!empty($groupsRemoved)) { $msg .= ' ' . _('Removed from groups') . ': ' . implode(', ',$groupsRemoved) . '.'; } 545 + if (!empty($groupsAdded)) { $msg .= ' ' . _kt('Added to groups') . ': ' . implode(', ', $groupsAdded) . ' <br />'; }
  546 + if (!empty($groupsRemoved)) { $msg .= ' ' . _kt('Removed from groups') . ': ' . implode(', ',$groupsRemoved) . '.'; }
547 547
548 $this->commitTransaction(); 548 $this->commitTransaction();
549 $this->successRedirectToMain($msg); 549 $this->successRedirectToMain($msg);
@@ -554,7 +554,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher { @@ -554,7 +554,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
554 $aGroups = GroupUtil::listGroupsForUser($oUser); 554 $aGroups = GroupUtil::listGroupsForUser($oUser);
555 $MAX_GROUPS = 6; 555 $MAX_GROUPS = 6;
556 $add_elipsis = false; 556 $add_elipsis = false;
557 - if (count($aGroups) == 0) { return _('User is currently not a member of any groups.'); } 557 + if (count($aGroups) == 0) { return _kt('User is currently not a member of any groups.'); }
558 if (count($aGroups) > $MAX_GROUPS) { 558 if (count($aGroups) > $MAX_GROUPS) {
559 $aGroups = array_slice($aGroups, 0, $MAX_GROUPS); 559 $aGroups = array_slice($aGroups, 0, $MAX_GROUPS);
560 $add_elipsis = true; 560 $add_elipsis = true;
plugins/ktcore/admin/workflows.php
@@ -60,13 +60,13 @@ class WorkflowNavigationPortlet extends KTPortlet { @@ -60,13 +60,13 @@ class WorkflowNavigationPortlet extends KTPortlet {
60 } 60 }
61 61
62 function render() { 62 function render() {
63 - if (is_null($this->oWorkflow)) { return _('No Workflow Selected.'); } 63 + if (is_null($this->oWorkflow)) { return _kt('No Workflow Selected.'); }
64 64
65 $aAdminPages = array(); 65 $aAdminPages = array();
66 - $aAdminPages[] = array('name' => _('Overview'), 'query' => 'action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId());  
67 - $aAdminPages[] = array('name' => _('States'), 'query' => 'action=manageStates&fWorkflowId=' . $this->oWorkflow->getId());  
68 - $aAdminPages[] = array('name' => _('Transitions'), 'query' => 'action=manageTransitions&fWorkflowId=' . $this->oWorkflow->getId());  
69 - $aAdminPages[] = array('name' => _('Actions'), 'query' => 'action=manageActions&fWorkflowId=' . $this->oWorkflow->getId()); 66 + $aAdminPages[] = array('name' => _kt('Overview'), 'query' => 'action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId());
  67 + $aAdminPages[] = array('name' => _kt('States'), 'query' => 'action=manageStates&fWorkflowId=' . $this->oWorkflow->getId());
  68 + $aAdminPages[] = array('name' => _kt('Transitions'), 'query' => 'action=manageTransitions&fWorkflowId=' . $this->oWorkflow->getId());
  69 + $aAdminPages[] = array('name' => _kt('Actions'), 'query' => 'action=manageActions&fWorkflowId=' . $this->oWorkflow->getId());
70 70
71 $oTemplating =& KTTemplating::getSingleton(); 71 $oTemplating =& KTTemplating::getSingleton();
72 $oTemplate = $oTemplating->loadTemplate("ktcore/workflow/admin_portlet"); 72 $oTemplate = $oTemplating->loadTemplate("ktcore/workflow/admin_portlet");
@@ -88,7 +88,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -88,7 +88,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
88 function check() { 88 function check() {
89 $this->aBreadcrumbs[] = array( 89 $this->aBreadcrumbs[] = array(
90 'url' => $_SERVER['PHP_SELF'], 90 'url' => $_SERVER['PHP_SELF'],
91 - 'name' => _('Workflows'), 91 + 'name' => _kt('Workflows'),
92 ); 92 );
93 $this->oWorkflow =& KTWorkflow::get($_REQUEST['fWorkflowId']); 93 $this->oWorkflow =& KTWorkflow::get($_REQUEST['fWorkflowId']);
94 if (!PEAR::isError($this->oWorkflow)) { 94 if (!PEAR::isError($this->oWorkflow)) {
@@ -97,7 +97,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -97,7 +97,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
97 'query' => 'action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId(), 97 'query' => 'action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId(),
98 'name' => $this->oWorkflow->getName(), 98 'name' => $this->oWorkflow->getName(),
99 ); 99 );
100 - $this->oPage->addPortlet(new WorkflowNavigationPortlet(_('Workflow'), $this->oWorkflow)); 100 + $this->oPage->addPortlet(new WorkflowNavigationPortlet(_kt('Workflow'), $this->oWorkflow));
101 } 101 }
102 102
103 return true; 103 return true;
@@ -239,7 +239,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -239,7 +239,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
239 $aInfo = $this->aWorkflowInfo; 239 $aInfo = $this->aWorkflowInfo;
240 240
241 // no controlled actions => all available 241 // no controlled actions => all available
242 - if (empty($aInfo['controlled_actions'])) { return _('All actions available.'); } 242 + if (empty($aInfo['controlled_actions'])) { return _kt('All actions available.'); }
243 243
244 244
245 $aAlways = array(); 245 $aAlways = array();
@@ -258,7 +258,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -258,7 +258,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
258 258
259 $aThese = array_merge($aAlways, $aNamedActions); 259 $aThese = array_merge($aAlways, $aNamedActions);
260 // some controlled. we need to be careful here: list actions that _are always_ available 260 // some controlled. we need to be careful here: list actions that _are always_ available
261 - if (empty($aThese)) { return _('No actions available.'); } 261 + if (empty($aThese)) { return _kt('No actions available.'); }
262 262
263 // else 263 // else
264 $aActions = array(); 264 $aActions = array();
@@ -270,16 +270,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -270,16 +270,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
270 $aInfo = $this->aWorkflowInfo; 270 $aInfo = $this->aWorkflowInfo;
271 //var_dump($aInfo['transitions_to_state'][$oState->getId()]); 271 //var_dump($aInfo['transitions_to_state'][$oState->getId()]);
272 if (($aInfo['workflow']->getStartStateId() != $oState->getId()) && (empty($aInfo['transitions_to_state'][$oState->getId()]))) { 272 if (($aInfo['workflow']->getStartStateId() != $oState->getId()) && (empty($aInfo['transitions_to_state'][$oState->getId()]))) {
273 - return '<strong>' . _('This state is unreachable.') . '</strong>'; 273 + return '<strong>' . _kt('This state is unreachable.') . '</strong>';
274 } 274 }
275 275
276 276
277 if ($aInfo['workflow']->getStartStateId() == $oState->getId() && (empty($aInfo['transitions_to_state'][$oState->getId()]))) { 277 if ($aInfo['workflow']->getStartStateId() == $oState->getId() && (empty($aInfo['transitions_to_state'][$oState->getId()]))) {
278 - return '<strong>' . _('Documents start in this state') . '</strong>'; 278 + return '<strong>' . _kt('Documents start in this state') . '</strong>';
279 } 279 }
280 $aT = array(); 280 $aT = array();
281 if ($aInfo['workflow']->getStartStateId() == $oState->getId()) { 281 if ($aInfo['workflow']->getStartStateId() == $oState->getId()) {
282 - $aT[] = '<strong>' . _('Documents start in this state') . '</strong>'; 282 + $aT[] = '<strong>' . _kt('Documents start in this state') . '</strong>';
283 } 283 }
284 284
285 foreach ($aInfo['transitions_to_state'][$oState->getId()] as $aTransition) { 285 foreach ($aInfo['transitions_to_state'][$oState->getId()] as $aTransition) {
@@ -326,23 +326,23 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -326,23 +326,23 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
326 326
327 $sNotify = ''; 327 $sNotify = '';
328 if (!empty($aUsers)) { 328 if (!empty($aUsers)) {
329 - $sNotify .= '<em>' . _('Users:') . '</em> '; 329 + $sNotify .= '<em>' . _kt('Users:') . '</em> ';
330 $sNotify .= implode(', ', $aUsers); 330 $sNotify .= implode(', ', $aUsers);
331 } 331 }
332 332
333 if (!empty($aGroups)) { 333 if (!empty($aGroups)) {
334 if (!empty($sNotify)) { $sNotify .= ' &mdash; '; } 334 if (!empty($sNotify)) { $sNotify .= ' &mdash; '; }
335 - $sNotify .= '<em>' . _('Groups:') . '</em> '; 335 + $sNotify .= '<em>' . _kt('Groups:') . '</em> ';
336 $sNotify .= implode(', ', $aGroups); 336 $sNotify .= implode(', ', $aGroups);
337 } 337 }
338 338
339 if (!empty($aRoles)) { 339 if (!empty($aRoles)) {
340 if (!empty($sNotify)) { $sNotify .= ' &mdash; '; } 340 if (!empty($sNotify)) { $sNotify .= ' &mdash; '; }
341 - $sNotify .= '<em>' . _('Roles:') . '</em> '; 341 + $sNotify .= '<em>' . _kt('Roles:') . '</em> ';
342 $sNotify .= implode(', ', $aRoles); 342 $sNotify .= implode(', ', $aRoles);
343 } 343 }
344 344
345 - if (empty($sNotify)) { $sNotify = _('No users to be notified.'); } 345 + if (empty($sNotify)) { $sNotify = _kt('No users to be notified.'); }
346 346
347 return $sNotify; 347 return $sNotify;
348 } 348 }
@@ -375,7 +375,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -375,7 +375,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
375 $aInfo = $this->aWorkflowInfo; 375 $aInfo = $this->aWorkflowInfo;
376 376
377 if (empty($aInfo['transitions_from_state'][$oState->getId()])) { 377 if (empty($aInfo['transitions_from_state'][$oState->getId()])) {
378 - return '<strong>' . _('No transitions available') . '</strong>'; 378 + return '<strong>' . _kt('No transitions available') . '</strong>';
379 } 379 }
380 380
381 $aT = array(); 381 $aT = array();
@@ -392,7 +392,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -392,7 +392,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
392 $aPerms = (array) $aInfo['permissions_by_state'][$oState->getId()]; 392 $aPerms = (array) $aInfo['permissions_by_state'][$oState->getId()];
393 393
394 if (empty($aPerms)) { 394 if (empty($aPerms)) {
395 - $aStr = _('No permissions are changed in this state.'); 395 + $aStr = _kt('No permissions are changed in this state.');
396 return $aStr; 396 return $aStr;
397 } 397 }
398 398
@@ -411,7 +411,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -411,7 +411,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
411 function do_main () { 411 function do_main () {
412 412
413 $add_fields = array(); 413 $add_fields = array();
414 - $add_fields[] = new KTStringWidget(_('Name'),_('A human-readable name for the workflow.'), 'fName', null, $this->oPage, true); 414 + $add_fields[] = new KTStringWidget(_kt('Name'), _('A human-readable name for the workflow.'), 'fName', null, $this->oPage, true);
415 415
416 $oTemplating =& KTTemplating::getSingleton(); 416 $oTemplating =& KTTemplating::getSingleton();
417 $oTemplate =& $oTemplating->loadTemplate('ktcore/workflow/listWorkflows'); 417 $oTemplate =& $oTemplating->loadTemplate('ktcore/workflow/listWorkflows');
@@ -438,7 +438,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -438,7 +438,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
438 $aStates = $aInfo['states']; 438 $aStates = $aInfo['states'];
439 439
440 $edit_fields = array(); 440 $edit_fields = array();
441 - $edit_fields[] = new KTStringWidget(_('Name'), _('A human-readable name for the workflow.'), 'fName', $oWorkflow->getName(), $this->oPage, true); 441 + $edit_fields[] = new KTStringWidget(_kt('Name'), _('A human-readable name for the workflow.'), 'fName', $oWorkflow->getName(), $this->oPage, true);
442 $aOptions = array(); 442 $aOptions = array();
443 $vocab = array(); 443 $vocab = array();
444 $vocab[0] = 'None - documents cannot use this workflow.'; 444 $vocab[0] = 'None - documents cannot use this workflow.';
@@ -446,14 +446,14 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -446,14 +446,14 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
446 $vocab[$state->getId()] = $state->getName(); 446 $vocab[$state->getId()] = $state->getName();
447 } 447 }
448 $aOptions['vocab'] = $vocab; 448 $aOptions['vocab'] = $vocab;
449 - $edit_fields[] = new KTLookupWidget(_('Starting State'), _('When a document has this workflow applied to it, to which state should it initially be set. <strong>Note that workflows without a starting state cannot be applied to documents.</strong>'), 'fStartStateId', $oWorkflow->getStartStateId(), $this->oPage, false, null, null, $aOptions); 449 + $edit_fields[] = new KTLookupWidget(_kt('Starting State'), _('When a document has this workflow applied to it, to which state should it initially be set. <strong>Note that workflows without a starting state cannot be applied to documents.</strong>'), 'fStartStateId', $oWorkflow->getStartStateId(), $this->oPage, false, null, null, $aOptions);
450 if (is_null($oWorkflow->getStartStateId())) { 450 if (is_null($oWorkflow->getStartStateId())) {
451 - $this->oPage->addInfo(_('This workflow is currently disabled. To enable it, please assign a starting state in the "Edit workflow properties" box.')); 451 + $this->oPage->addInfo(_kt('This workflow is currently disabled. To enable it, please assign a starting state in the "Edit workflow properties" box.'));
452 } 452 }
453 453
454 /* 454 /*
455 $add_state_fields = array(); 455 $add_state_fields = array();
456 - $add_state_fields[] = new KTStringWidget(_('Name'), _('A human-readable name for the state.'), 'fName', null, $this->oPage, true); 456 + $add_state_fields[] = new KTStringWidget(_kt('Name'), _('A human-readable name for the state.'), 'fName', null, $this->oPage, true);
457 457
458 458
459 */ 459 */
@@ -502,10 +502,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -502,10 +502,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
502 502
503 $this->oValidator->notErrorFalse($res, array( 503 $this->oValidator->notErrorFalse($res, array(
504 'redirect_to' => array('editWorkflow', 'fWorkflowId=' . $oWorkflow->getId()), 504 'redirect_to' => array('editWorkflow', 'fWorkflowId=' . $oWorkflow->getId()),
505 - 'message' => _('Error saving workflow'), 505 + 'message' => _kt('Error saving workflow'),
506 )); 506 ));
507 507
508 - $this->successRedirectTo('editWorkflow', _('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId()); 508 + $this->successRedirectTo('editWorkflow', _kt('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId());
509 exit(0); 509 exit(0);
510 } 510 }
511 // }}} 511 // }}}
@@ -521,7 +521,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -521,7 +521,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
521 521
522 522
523 /* if(!PEAR::isError(KTWorkflow::getByName($sName))) { 523 /* if(!PEAR::isError(KTWorkflow::getByName($sName))) {
524 - $this->errorRedirectToMain(_("A state with that name already exists")); 524 + $this->errorRedirectToMain(_kt("A state with that name already exists"));
525 }*/ 525 }*/
526 526
527 $res = KTWorkflow::createFromArray(array( 527 $res = KTWorkflow::createFromArray(array(
@@ -530,9 +530,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -530,9 +530,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
530 )); 530 ));
531 $this->oValidator->notError($res, array( 531 $this->oValidator->notError($res, array(
532 'redirect_to' => array('main'), 532 'redirect_to' => array('main'),
533 - 'message' => _('Could not create workflow'), 533 + 'message' => _kt('Could not create workflow'),
534 )); 534 ));
535 - $this->successRedirectTo('editWorkflow', _('Workflow created'), 'fWorkflowId=' . $res->getId()); 535 + $this->successRedirectTo('editWorkflow', _kt('Workflow created'), 'fWorkflowId=' . $res->getId());
536 exit(0); 536 exit(0);
537 } 537 }
538 // }}} 538 // }}}
@@ -550,12 +550,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -550,12 +550,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
550 550
551 $this->oValidator->notErrorFalse($res, array( 551 $this->oValidator->notErrorFalse($res, array(
552 'redirect_to' => array('main'), 552 'redirect_to' => array('main'),
553 - 'message' => _('Error saving workflow'), 553 + 'message' => _kt('Error saving workflow'),
554 )); 554 ));
555 555
556 $this->commitTransaction(); 556 $this->commitTransaction();
557 557
558 - $this->successRedirectToMain(_('Changes saved')); 558 + $this->successRedirectToMain(_kt('Changes saved'));
559 exit(0); 559 exit(0);
560 } 560 }
561 // }}} 561 // }}}
@@ -610,7 +610,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -610,7 +610,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
610 $aInfo = $this->buildWorkflowInfo($oWorkflow); 610 $aInfo = $this->buildWorkflowInfo($oWorkflow);
611 611
612 $add_fields = array(); 612 $add_fields = array();
613 - $add_fields[] = new KTStringWidget(_('Name'), _('A human-readable name for the state.'), 'fName', null, $this->oPage, true); 613 + $add_fields[] = new KTStringWidget(_kt('Name'), _('A human-readable name for the state.'), 'fName', null, $this->oPage, true);
614 614
615 615
616 616
@@ -663,21 +663,21 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -663,21 +663,21 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
663 $aConditions = KTSavedSearch::getConditions(); 663 $aConditions = KTSavedSearch::getConditions();
664 664
665 $add_transition_fields = array(); 665 $add_transition_fields = array();
666 - $add_transition_fields[] = new KTStringWidget(_('Name'), _('A human-readable name for the transition.'), 'fName', null, $this->oPage, true); 666 + $add_transition_fields[] = new KTStringWidget(_kt('Name'), _('A human-readable name for the transition.'), 'fName', null, $this->oPage, true);
667 $aOptions = array(); 667 $aOptions = array();
668 $vocab = array(); 668 $vocab = array();
669 foreach($aInfo['states'] as $state) { 669 foreach($aInfo['states'] as $state) {
670 $vocab[$state->getId()] = $state->getName(); 670 $vocab[$state->getId()] = $state->getName();
671 } 671 }
672 $aOptions['vocab'] = $vocab; 672 $aOptions['vocab'] = $vocab;
673 - $add_transition_fields[] = new KTLookupWidget(_('Destination State'), _('Once this transition is complete, which state should the document be in?'), 'fTargetStateId', $oWorkflow->getStartStateId(), $this->oPage, true, null, null, $aOptions); 673 + $add_transition_fields[] = new KTLookupWidget(_kt('Destination State'), _('Once this transition is complete, which state should the document be in?'), 'fTargetStateId', $oWorkflow->getStartStateId(), $this->oPage, true, null, null, $aOptions);
674 $aOptions = array(); 674 $aOptions = array();
675 $vocab = array(); 675 $vocab = array();
676 foreach($aInfo['permissions'] as $permission) { 676 foreach($aInfo['permissions'] as $permission) {
677 $vocab[$permission->getId()] = $permission->getHumanName(); 677 $vocab[$permission->getId()] = $permission->getHumanName();
678 } 678 }
679 $aOptions['vocab'] = $vocab; 679 $aOptions['vocab'] = $vocab;
680 - $add_transition_fields[] = new KTLookupWidget(_('Guard Permission.'), _('Which permission must the user have in order to follow this transition?'), 'fPermissionId', NULL, $this->oPage, true, null, null, $aOptions); 680 + $add_transition_fields[] = new KTLookupWidget(_kt('Guard Permission.'), _('Which permission must the user have in order to follow this transition?'), 'fPermissionId', NULL, $this->oPage, true, null, null, $aOptions);
681 681
682 $aOptions = array(); 682 $aOptions = array();
683 $vocab = array(); 683 $vocab = array();
@@ -686,7 +686,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -686,7 +686,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
686 $vocab[$group->getId()] = $group->getName(); 686 $vocab[$group->getId()] = $group->getName();
687 } 687 }
688 $aOptions['vocab'] = $vocab; 688 $aOptions['vocab'] = $vocab;
689 - $add_transition_fields[] = new KTLookupWidget(_('Guard Group.'), _('Which group must the user belong to in order to follow this transition?'), 'fGroupId', NULL, $this->oPage, false, null, null, $aOptions); 689 + $add_transition_fields[] = new KTLookupWidget(_kt('Guard Group.'), _('Which group must the user belong to in order to follow this transition?'), 'fGroupId', NULL, $this->oPage, false, null, null, $aOptions);
690 $aOptions = array(); 690 $aOptions = array();
691 $vocab = array(); 691 $vocab = array();
692 $vocab[0] = 'None'; 692 $vocab[0] = 'None';
@@ -694,7 +694,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -694,7 +694,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
694 $vocab[$role->getId()] = $role->getName(); 694 $vocab[$role->getId()] = $role->getName();
695 } 695 }
696 $aOptions['vocab'] = $vocab; 696 $aOptions['vocab'] = $vocab;
697 - $add_transition_fields[] = new KTLookupWidget(_('Guard Role.'), _('Which role must the user have in order to follow this transition?'), 'fRoleId', NULL, $this->oPage, false, null, null, $aOptions); 697 + $add_transition_fields[] = new KTLookupWidget(_kt('Guard Role.'), _('Which role must the user have in order to follow this transition?'), 'fRoleId', NULL, $this->oPage, false, null, null, $aOptions);
698 698
699 if (!empty($aConditions)) { 699 if (!empty($aConditions)) {
700 $aOptions = array(); 700 $aOptions = array();
@@ -704,7 +704,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -704,7 +704,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
704 $vocab[$condition->getId()] = $condition->getName(); 704 $vocab[$condition->getId()] = $condition->getName();
705 } 705 }
706 $aOptions['vocab'] = $vocab; 706 $aOptions['vocab'] = $vocab;
707 - $edit_fields[] = new KTLookupWidget(_('Guard Condition.'), _('Which condition (stored search) must be satisfied before the transition can take place?'), 'fConditionId', NULL, $this->oPage, false, null, null, $aOptions); 707 + $edit_fields[] = new KTLookupWidget(_kt('Guard Condition.'), _('Which condition (stored search) must be satisfied before the transition can take place?'), 'fConditionId', NULL, $this->oPage, false, null, null, $aOptions);
708 } 708 }
709 709
710 710
@@ -739,12 +739,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -739,12 +739,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
739 739
740 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $transitions); 740 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $transitions);
741 if (PEAR::isError($res)) { 741 if (PEAR::isError($res)) {
742 - $this->errorRedirectTo('manageTransitions', _('Error updating transitions:') . $res->getMessage(), sprintf('fWorkflowId=%d', $oWorkflow->getId())); 742 + $this->errorRedirectTo('manageTransitions', _kt('Error updating transitions:') . $res->getMessage(), sprintf('fWorkflowId=%d', $oWorkflow->getId()));
743 } 743 }
744 } 744 }
745 $this->commitTransaction(); 745 $this->commitTransaction();
746 746
747 - $this->successRedirectTo('manageTransitions', _('Transition Availability updated.'), sprintf('fWorkflowId=%d', $oWorkflow->getId())); 747 + $this->successRedirectTo('manageTransitions', _kt('Transition Availability updated.'), sprintf('fWorkflowId=%d', $oWorkflow->getId()));
748 } 748 }
749 749
750 750
@@ -765,12 +765,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -765,12 +765,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
765 765
766 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $actions); 766 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $actions);
767 if (PEAR::isError($res)) { 767 if (PEAR::isError($res)) {
768 - $this->errorRedirectTo('manageActions', _('Error updating actions:') . $res->getMessage(), sprintf('fWorkflowId=%d', $oWorkflow->getId())); 768 + $this->errorRedirectTo('manageActions', _kt('Error updating actions:') . $res->getMessage(), sprintf('fWorkflowId=%d', $oWorkflow->getId()));
769 } 769 }
770 } 770 }
771 $this->commitTransaction(); 771 $this->commitTransaction();
772 772
773 - $this->successRedirectTo('manageActions', _('Action availability updated.'), sprintf('fWorkflowId=%d', $oWorkflow->getId())); 773 + $this->successRedirectTo('manageActions', _kt('Action availability updated.'), sprintf('fWorkflowId=%d', $oWorkflow->getId()));
774 } 774 }
775 775
776 // {{{ do_setWorkflowActions 776 // {{{ do_setWorkflowActions
@@ -779,9 +779,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -779,9 +779,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
779 $res = KTWorkflowUtil::setControlledActionsForWorkflow($oWorkflow, $_REQUEST['fActions']); 779 $res = KTWorkflowUtil::setControlledActionsForWorkflow($oWorkflow, $_REQUEST['fActions']);
780 $this->oValidator->notErrorFalse($res, array( 780 $this->oValidator->notErrorFalse($res, array(
781 'redirect_to' => array('editWorkflow', 'fWorkflowId=' . $oWorkflow->getId()), 781 'redirect_to' => array('editWorkflow', 'fWorkflowId=' . $oWorkflow->getId()),
782 - 'message' => _('Error saving workflow controlled actions'), 782 + 'message' => _kt('Error saving workflow controlled actions'),
783 )); 783 ));
784 - $this->successRedirectTo('manageActions', _('Controlled actions changed.'), 'fWorkflowId=' . $oWorkflow->getId()); 784 + $this->successRedirectTo('manageActions', _kt('Controlled actions changed.'), 'fWorkflowId=' . $oWorkflow->getId());
785 exit(0); 785 exit(0);
786 } 786 }
787 // }}} 787 // }}}
@@ -806,7 +806,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -806,7 +806,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
806 // check there are no other states by that name in this workflow 806 // check there are no other states by that name in this workflow
807 $aStates = KTWorkflowState::getList(sprintf("workflow_id = %d and name = '%s'", $iWorkflowId, $sName)); 807 $aStates = KTWorkflowState::getList(sprintf("workflow_id = %d and name = '%s'", $iWorkflowId, $sName));
808 if(count($aStates)) { 808 if(count($aStates)) {
809 - $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _("A state by that name already exists")); 809 + $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _kt("A state by that name already exists"));
810 } 810 }
811 811
812 $oState = KTWorkflowState::createFromArray(array( 812 $oState = KTWorkflowState::createFromArray(array(
@@ -817,16 +817,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -817,16 +817,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
817 817
818 $this->oValidator->notError($oState, array( 818 $this->oValidator->notError($oState, array(
819 'redirect_to' => array('createState', 'fWorkflowId=' . $oWorkflow->getId()), 819 'redirect_to' => array('createState', 'fWorkflowId=' . $oWorkflow->getId()),
820 - 'message' => _('Could not create workflow state'), 820 + 'message' => _kt('Could not create workflow state'),
821 )); 821 ));
822 822
823 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $_REQUEST['fActions']); 823 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $_REQUEST['fActions']);
824 $this->oValidator->notErrorFalse($res, array( 824 $this->oValidator->notErrorFalse($res, array(
825 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId(), '&fStateId=' . $oState->getId()), 825 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId(), '&fStateId=' . $oState->getId()),
826 - 'message' => _('Error saving state enabled actions'), 826 + 'message' => _kt('Error saving state enabled actions'),
827 )); 827 ));
828 828
829 - $this->successRedirectTo('editState', _('Workflow state created'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()); 829 + $this->successRedirectTo('editState', _kt('Workflow state created'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId());
830 exit(0); 830 exit(0);
831 } 831 }
832 // }}} 832 // }}}
@@ -853,12 +853,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -853,12 +853,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
853 } 853 }
854 $aTransitionsSelected = KTWorkflowUtil::getTransitionsFrom($oState, array('ids' => true)); 854 $aTransitionsSelected = KTWorkflowUtil::getTransitionsFrom($oState, array('ids' => true));
855 855
856 - $this->oPage->setBreadcrumbDetails(_('State') . ': ' . $oState->getName()); 856 + $this->oPage->setBreadcrumbDetails(_kt('State') . ': ' . $oState->getName());
857 857
858 $aInformed = KTWorkflowUtil::getInformedForState($oState); 858 $aInformed = KTWorkflowUtil::getInformedForState($oState);
859 859
860 $editForm = array(); 860 $editForm = array();
861 - $editForm[] = new KTStringWidget(_('Name'), _('A human-readable name for this state. This is shown on the "Browse" page, as well as on the users workflow page.'), 'fName', $oState->getName(), $this->oPage, true); 861 + $editForm[] = new KTStringWidget(_kt('Name'), _('A human-readable name for this state. This is shown on the "Browse" page, as well as on the users workflow page.'), 'fName', $oState->getName(), $this->oPage, true);
862 862
863 863
864 $this->getPermissionAssignmentsForState($oState); 864 $this->getPermissionAssignmentsForState($oState);
@@ -894,9 +894,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -894,9 +894,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
894 $res = $oState->update(); 894 $res = $oState->update();
895 $this->oValidator->notErrorFalse($res, array( 895 $this->oValidator->notErrorFalse($res, array(
896 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()), 896 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()),
897 - 'message' => _('Error saving state'), 897 + 'message' => _kt('Error saving state'),
898 )); 898 ));
899 - $this->successRedirectTo('editState', _('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()); 899 + $this->successRedirectTo('editState', _kt('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId());
900 exit(0); 900 exit(0);
901 } 901 }
902 // }}} 902 // }}}
@@ -905,7 +905,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -905,7 +905,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
905 $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']); 905 $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
906 $oState =& $this->oValidator->validateWorkflowState($_REQUEST['fStateId']); 906 $oState =& $this->oValidator->validateWorkflowState($_REQUEST['fStateId']);
907 $aInfo = $this->buildWorkflowInfo($oWorkflow); 907 $aInfo = $this->buildWorkflowInfo($oWorkflow);
908 - if (!$aInfo['can_delete']) { $this->errorRedirectTo('manageStates', _('May not delete items from an active workflow'), 'fWorkflowId=' . $oWorkflow->getId()); } 908 + if (!$aInfo['can_delete']) { $this->errorRedirectTo('manageStates', _kt('May not delete items from an active workflow'), 'fWorkflowId=' . $oWorkflow->getId()); }
909 909
910 $this->startTransaction(); 910 $this->startTransaction();
911 911
@@ -917,7 +917,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -917,7 +917,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
917 array($oState->getId()), 917 array($oState->getId()),
918 ); 918 );
919 $res = DBUtil::runQuery($aQuery); 919 $res = DBUtil::runQuery($aQuery);
920 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _('Unable to clear references to item'), 'fWorkflowId=' . $oWorkflow->getId()); } 920 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _kt('Unable to clear references to item'), 'fWorkflowId=' . $oWorkflow->getId()); }
921 921
922 // transitions ending in that state 922 // transitions ending in that state
923 $aTransitionNames = array(); 923 $aTransitionNames = array();
@@ -929,10 +929,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -929,10 +929,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
929 array($oTransition->getId()), 929 array($oTransition->getId()),
930 ); 930 );
931 $res = DBUtil::runQuery($aQuery); 931 $res = DBUtil::runQuery($aQuery);
932 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _('Unable to remove transition references for: ') . $oTransition->getName(), 'fWorkflowId=' . $oWorkflow->getId()); } 932 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _kt('Unable to remove transition references for: ') . $oTransition->getName(), 'fWorkflowId=' . $oWorkflow->getId()); }
933 933
934 $res = $oTransition->delete(); 934 $res = $oTransition->delete();
935 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _('Unable to remove transition: ') . $oTransition->getName(), 'fWorkflowId=' . $oWorkflow->getId()); } 935 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _kt('Unable to remove transition: ') . $oTransition->getName(), 'fWorkflowId=' . $oWorkflow->getId()); }
936 936
937 $aTransitionNames[] = $oTransition->getName(); 937 $aTransitionNames[] = $oTransition->getName();
938 } 938 }
@@ -941,19 +941,19 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -941,19 +941,19 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
941 if ($oState->getId() == $oWorkflow->getStartStateId()) { 941 if ($oState->getId() == $oWorkflow->getStartStateId()) {
942 $oWorkflow->setStartStateId(null); 942 $oWorkflow->setStartStateId(null);
943 $res = $oWorkflow->update(); 943 $res = $oWorkflow->update();
944 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _('Unable to change workflow starting state: ') . $res->getMessage(), 'fWorkflowId=' . $oWorkflow->getId()); } 944 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _kt('Unable to change workflow starting state: ') . $res->getMessage(), 'fWorkflowId=' . $oWorkflow->getId()); }
945 } 945 }
946 946
947 // finally, delete the state 947 // finally, delete the state
948 $res = $oState->delete(); // does this handle referential integrity? 948 $res = $oState->delete(); // does this handle referential integrity?
949 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _('Unable to delete item: ') . $res->getMessage(), 'fWorkflowId=' . $oWorkflow->getId()); } 949 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageStates', _kt('Unable to delete item: ') . $res->getMessage(), 'fWorkflowId=' . $oWorkflow->getId()); }
950 950
951 $this->commitTransaction(); 951 $this->commitTransaction();
952 if (!empty($aTransitionNames)) { 952 if (!empty($aTransitionNames)) {
953 $sTransitionNames = implode (', ', $aTransitionNames); 953 $sTransitionNames = implode (', ', $aTransitionNames);
954 - $msg = sprintf(_('State deleted. Also deleted transitions ending in that state: %s'), $sTransitionNames); 954 + $msg = sprintf(_kt('State deleted. Also deleted transitions ending in that state: %s'), $sTransitionNames);
955 } else { 955 } else {
956 - $msg = _('State deleted.'); 956 + $msg = _kt('State deleted.');
957 } 957 }
958 958
959 $this->successRedirectTo('manageStates', $msg, 'fWorkflowId=' . $oWorkflow->getId()); 959 $this->successRedirectTo('manageStates', $msg, 'fWorkflowId=' . $oWorkflow->getId());
@@ -987,7 +987,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -987,7 +987,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
987 ); 987 );
988 $res = KTWorkflowStatePermissionAssignment::createFromArray($aOpts); 988 $res = KTWorkflowStatePermissionAssignment::createFromArray($aOpts);
989 if (PEAR::isError($res)) { 989 if (PEAR::isError($res)) {
990 - $this->errorRedirectTo('editState',_('Failed to create permission assignment: ') . $res->getMessage(),sprintf('fStateId=%d&fWorkflowId=%d',$oState->getId(),$oWorkflow->getId())); 990 + $this->errorRedirectTo('editState', _kt('Failed to create permission assignment: ') . $res->getMessage(),sprintf('fStateId=%d&fWorkflowId=%d',$oState->getId(),$oWorkflow->getId()));
991 } 991 }
992 992
993 } else { 993 } else {
@@ -1007,7 +1007,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1007,7 +1007,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1007 1007
1008 KTPermissionUtil::updatePermissionLookupForState($oState); 1008 KTPermissionUtil::updatePermissionLookupForState($oState);
1009 1009
1010 - $this->successRedirectTo('editState', _('Permissions for workflow assigned'),sprintf('fStateId=%d&fWorkflowId=%d',$oState->getId(),$oWorkflow->getId())); 1010 + $this->successRedirectTo('editState', _kt('Permissions for workflow assigned'),sprintf('fStateId=%d&fWorkflowId=%d',$oState->getId(),$oWorkflow->getId()));
1011 } 1011 }
1012 1012
1013 function do_assignStatePermissions() { 1013 function do_assignStatePermissions() {
@@ -1028,16 +1028,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1028,16 +1028,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1028 $oAlloc = KTWorkflowStatePermissionAssignment::get($iAllocId); 1028 $oAlloc = KTWorkflowStatePermissionAssignment::get($iAllocId);
1029 //var_dump($aAllowed); 1029 //var_dump($aAllowed);
1030 $oDescriptor = KTPermissionUtil::getOrCreateDescriptor($aAllowed); 1030 $oDescriptor = KTPermissionUtil::getOrCreateDescriptor($aAllowed);
1031 - if (PEAR::isError($oDescriptor)) { $this->errorRedirectTo('editState', _('Failed to allocate as specified.'), $exitQS); } 1031 + if (PEAR::isError($oDescriptor)) { $this->errorRedirectTo('editState', _kt('Failed to allocate as specified.'), $exitQS); }
1032 1032
1033 $oAlloc->setDescriptorId($oDescriptor->getId()); 1033 $oAlloc->setDescriptorId($oDescriptor->getId());
1034 $res = $oAlloc->update(); 1034 $res = $oAlloc->update();
1035 - if (PEAR::isError($res)) { $this->errorRedirectTo('editState', _('Failed to allocate as specified.'), $exitQS); } 1035 + if (PEAR::isError($res)) { $this->errorRedirectTo('editState', _kt('Failed to allocate as specified.'), $exitQS); }
1036 } 1036 }
1037 1037
1038 KTPermissionUtil::updatePermissionLookupForState($oState); 1038 KTPermissionUtil::updatePermissionLookupForState($oState);
1039 1039
1040 - $this->successRedirectTo('editState', _('Permissions Allocated.'), $exitQS); 1040 + $this->successRedirectTo('editState', _kt('Permissions Allocated.'), $exitQS);
1041 } 1041 }
1042 1042
1043 // {{{ do_saveTransitions 1043 // {{{ do_saveTransitions
@@ -1047,9 +1047,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1047,9 +1047,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1047 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $_REQUEST['fTransitionIds']); 1047 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $_REQUEST['fTransitionIds']);
1048 $this->oValidator->notErrorFalse($res, array( 1048 $this->oValidator->notErrorFalse($res, array(
1049 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()), 1049 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()),
1050 - 'message' => _('Error saving transitions'), 1050 + 'message' => _kt('Error saving transitions'),
1051 )); 1051 ));
1052 - $this->successRedirectTo('editState', _('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()); 1052 + $this->successRedirectTo('editState', _kt('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId());
1053 exit(0); 1053 exit(0);
1054 } 1054 }
1055 // }}} 1055 // }}}
@@ -1058,10 +1058,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1058,10 +1058,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1058 $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']); 1058 $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
1059 $oTransition =& KTWorkflowTransition::get($_REQUEST['fTransitionId']); 1059 $oTransition =& KTWorkflowTransition::get($_REQUEST['fTransitionId']);
1060 if (PEAR::isError($oTransition)) { 1060 if (PEAR::isError($oTransition)) {
1061 - $this->errorRedirectTo('manageTransitions', _('Invalid transition'),'fWorkflowId=' . $oWorkflow->getId()); 1061 + $this->errorRedirectTo('manageTransitions', _kt('Invalid transition'),'fWorkflowId=' . $oWorkflow->getId());
1062 } 1062 }
1063 $aInfo = $this->buildWorkflowInfo($oWorkflow); 1063 $aInfo = $this->buildWorkflowInfo($oWorkflow);
1064 - if (!$aInfo['can_delete']) { $this->errorRedirectTo('manageTransitions', _('May not delete items from an active workflow'), 'fWorkflowId=' . $oWorkflow->getId()); } 1064 + if (!$aInfo['can_delete']) { $this->errorRedirectTo('manageTransitions', _kt('May not delete items from an active workflow'), 'fWorkflowId=' . $oWorkflow->getId()); }
1065 $this->startTransaction(); 1065 $this->startTransaction();
1066 1066
1067 $sTable = KTUtil::getTableName('workflow_state_transitions'); 1067 $sTable = KTUtil::getTableName('workflow_state_transitions');
@@ -1070,12 +1070,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1070,12 +1070,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1070 array($oTransition->getId()), 1070 array($oTransition->getId()),
1071 ); 1071 );
1072 $res = DBUtil::runQuery($aQuery); 1072 $res = DBUtil::runQuery($aQuery);
1073 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageTransitions', _('Unable to remove transition references for: ') . $oTransition->getName(), 'fWorkflowId=' . $oWorkflow->getId()); } 1073 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageTransitions', _kt('Unable to remove transition references for: ') . $oTransition->getName(), 'fWorkflowId=' . $oWorkflow->getId()); }
1074 1074
1075 $res = $oTransition->delete(); // does this handle referential integrity? 1075 $res = $oTransition->delete(); // does this handle referential integrity?
1076 - if (PEAR::isError($res)) { $this->errorRedirectTo('manageTransitions', _('Unable to delete item'), 'fWorkflowId=' . $oWorkflow->getId()); } 1076 + if (PEAR::isError($res)) { $this->errorRedirectTo('manageTransitions', _kt('Unable to delete item'), 'fWorkflowId=' . $oWorkflow->getId()); }
1077 $this->commitTransaction(); 1077 $this->commitTransaction();
1078 - $this->successRedirectTo('manageTransitions', _('Transition deleted.'), 'fWorkflowId=' . $oWorkflow->getId()); 1078 + $this->successRedirectTo('manageTransitions', _kt('Transition deleted.'), 'fWorkflowId=' . $oWorkflow->getId());
1079 } 1079 }
1080 1080
1081 // {{{ do_setStateActions 1081 // {{{ do_setStateActions
@@ -1085,9 +1085,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1085,9 +1085,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1085 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $_REQUEST['fActions']); 1085 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $_REQUEST['fActions']);
1086 $this->oValidator->notErrorFalse($res, array( 1086 $this->oValidator->notErrorFalse($res, array(
1087 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId(), '&fStateId=' . $oState->getId()), 1087 'redirect_to' => array('editState', 'fWorkflowId=' . $oWorkflow->getId(), '&fStateId=' . $oState->getId()),
1088 - 'message' => _('Error saving state enabled actions'), 1088 + 'message' => _kt('Error saving state enabled actions'),
1089 )); 1089 ));
1090 - $this->successRedirectTo('manageActions', _('Controlled Actions changed.'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId()); 1090 + $this->successRedirectTo('manageActions', _kt('Controlled Actions changed.'), 'fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId());
1091 exit(0); 1091 exit(0);
1092 } 1092 }
1093 // }}} 1093 // }}}
@@ -1104,23 +1104,23 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1104,23 +1104,23 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1104 $aNotification['role'] = array(); 1104 $aNotification['role'] = array();
1105 } 1105 }
1106 if (!is_array($aNotification['role'])) { 1106 if (!is_array($aNotification['role'])) {
1107 - $this->errorRedirectTo($sTargetAction, _('Invalid roles specified'), $sTargetParams); 1107 + $this->errorRedirectTo($sTargetAction, _kt('Invalid roles specified'), $sTargetParams);
1108 } 1108 }
1109 1109
1110 if (empty($aNotification['group'])) { 1110 if (empty($aNotification['group'])) {
1111 $aNotification['group'] = array(); 1111 $aNotification['group'] = array();
1112 } 1112 }
1113 if (!is_array($aNotification['group'])) { 1113 if (!is_array($aNotification['group'])) {
1114 - $this->errorRedirectTo($sTargetAction, _('Invalid groups specified'), $sTargetParams); 1114 + $this->errorRedirectTo($sTargetAction, _kt('Invalid groups specified'), $sTargetParams);
1115 } 1115 }
1116 1116
1117 $aNotification['user'] = array(); // force override 1117 $aNotification['user'] = array(); // force override
1118 1118
1119 $res = KTWorkflowUtil::setInformedForState($oState, $aNotification); 1119 $res = KTWorkflowUtil::setInformedForState($oState, $aNotification);
1120 if (PEAR::isError($res)) { 1120 if (PEAR::isError($res)) {
1121 - $this->errorRedirectTo($sTargetAction, sprintf(_('Failed to update the notification lists: %s'),$res->getMessage()), $sTargetParams); 1121 + $this->errorRedirectTo($sTargetAction, sprintf(_kt('Failed to update the notification lists: %s'),$res->getMessage()), $sTargetParams);
1122 } 1122 }
1123 - $this->successRedirectTo($sTargetAction, _('Changes saved'), $sTargetParams); 1123 + $this->successRedirectTo($sTargetAction, _kt('Changes saved'), $sTargetParams);
1124 } 1124 }
1125 // }}} 1125 // }}}
1126 1126
@@ -1152,7 +1152,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1152,7 +1152,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1152 // check there are no other transitions by that name in this workflow 1152 // check there are no other transitions by that name in this workflow
1153 $aTransitions = KTWorkflowTransition::getList(sprintf("workflow_id = %d and name = '%s'", $oWorkflow->getId(), $sName)); 1153 $aTransitions = KTWorkflowTransition::getList(sprintf("workflow_id = %d and name = '%s'", $oWorkflow->getId(), $sName));
1154 if(count($aTransitions)) { 1154 if(count($aTransitions)) {
1155 - $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _("A transition by that name already exists")); 1155 + $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _kt("A transition by that name already exists"));
1156 } 1156 }
1157 1157
1158 1158
@@ -1181,7 +1181,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1181,7 +1181,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1181 )); 1181 ));
1182 $this->oValidator->notError($res, array( 1182 $this->oValidator->notError($res, array(
1183 'redirect_to' => array('editWorkflow', 'fWorkflowId=' . $oWorkflow->getId()), 1183 'redirect_to' => array('editWorkflow', 'fWorkflowId=' . $oWorkflow->getId()),
1184 - 'message' => _('Could not create workflow transition'), 1184 + 'message' => _kt('Could not create workflow transition'),
1185 )); 1185 ));
1186 1186
1187 // now attach it to the appropriate states. 1187 // now attach it to the appropriate states.
@@ -1201,12 +1201,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1201,12 +1201,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1201 } 1201 }
1202 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $aTransitionIds); 1202 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $aTransitionIds);
1203 if (PEAR::isError($res)) { 1203 if (PEAR::isError($res)) {
1204 - $this->errorRedirectTo('manageTransitions',sprintf(_('Unable to assign new transition to state %s'),$oState->getName()), sprintf('fWorkflowId=%d', $oWorkflow->getId())); 1204 + $this->errorRedirectTo('manageTransitions',sprintf(_kt('Unable to assign new transition to state %s'),$oState->getName()), sprintf('fWorkflowId=%d', $oWorkflow->getId()));
1205 } 1205 }
1206 } 1206 }
1207 1207
1208 1208
1209 - $this->successRedirectTo('editTransition', _('Workflow transition created'), sprintf('fWorkflowId=%d&fTransitionId=%d', $oWorkflow->getId(), $newTransition->getId())); 1209 + $this->successRedirectTo('editTransition', _kt('Workflow transition created'), sprintf('fWorkflowId=%d&fTransitionId=%d', $oWorkflow->getId(), $newTransition->getId()));
1210 exit(0); 1210 exit(0);
1211 } 1211 }
1212 // }}} 1212 // }}}
@@ -1224,14 +1224,14 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1224,14 +1224,14 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1224 $aConditions = KTSavedSearch::getConditions(); 1224 $aConditions = KTSavedSearch::getConditions();
1225 1225
1226 $edit_fields = array(); 1226 $edit_fields = array();
1227 - $edit_fields[] = new KTStringWidget(_('Name'), _('A human-readable name for the state.'), 'fName', $oTransition->getName(), $this->oPage, true); 1227 + $edit_fields[] = new KTStringWidget(_kt('Name'), _('A human-readable name for the state.'), 'fName', $oTransition->getName(), $this->oPage, true);
1228 $aOptions = array(); 1228 $aOptions = array();
1229 $vocab = array(); 1229 $vocab = array();
1230 foreach($aStates as $state) { 1230 foreach($aStates as $state) {
1231 $vocab[$state->getId()] = $state->getName(); 1231 $vocab[$state->getId()] = $state->getName();
1232 } 1232 }
1233 $aOptions['vocab'] = $vocab; 1233 $aOptions['vocab'] = $vocab;
1234 - $edit_fields[] = new KTLookupWidget(_('Destination State'), _('Once this transition is complete, which state should the document be in?'), 'fTargetStateId', $oTransition->getTargetStateId(), $this->oPage, true, null, null, $aOptions); 1234 + $edit_fields[] = new KTLookupWidget(_kt('Destination State'), _('Once this transition is complete, which state should the document be in?'), 'fTargetStateId', $oTransition->getTargetStateId(), $this->oPage, true, null, null, $aOptions);
1235 $aOptions = array(); 1235 $aOptions = array();
1236 $vocab = array(); 1236 $vocab = array();
1237 $vocab[0] = 'None'; 1237 $vocab[0] = 'None';
@@ -1239,7 +1239,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1239,7 +1239,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1239 $vocab[$permission->getId()] = $permission->getHumanName(); 1239 $vocab[$permission->getId()] = $permission->getHumanName();
1240 } 1240 }
1241 $aOptions['vocab'] = $vocab; 1241 $aOptions['vocab'] = $vocab;
1242 - $edit_fields[] = new KTLookupWidget(_('Guard Permission.'), _('Which permission must the user have in order to follow this transition?'), 'fPermissionId', $oTransition->getGuardPermissionId(), $this->oPage, true, null, null, $aOptions); 1242 + $edit_fields[] = new KTLookupWidget(_kt('Guard Permission.'), _('Which permission must the user have in order to follow this transition?'), 'fPermissionId', $oTransition->getGuardPermissionId(), $this->oPage, true, null, null, $aOptions);
1243 $aOptions = array(); 1243 $aOptions = array();
1244 $vocab = array(); 1244 $vocab = array();
1245 $vocab[0] = 'None'; 1245 $vocab[0] = 'None';
@@ -1247,7 +1247,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1247,7 +1247,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1247 $vocab[$group->getId()] = $group->getName(); 1247 $vocab[$group->getId()] = $group->getName();
1248 } 1248 }
1249 $aOptions['vocab'] = $vocab; 1249 $aOptions['vocab'] = $vocab;
1250 - $edit_fields[] = new KTLookupWidget(_('Guard Group.'), _('Which group must the user belong to in order to follow this transition?'), 'fGroupId', $oTransition->getGuardGroupId(), $this->oPage, false, null, null, $aOptions); 1250 + $edit_fields[] = new KTLookupWidget(_kt('Guard Group.'), _('Which group must the user belong to in order to follow this transition?'), 'fGroupId', $oTransition->getGuardGroupId(), $this->oPage, false, null, null, $aOptions);
1251 $aOptions = array(); 1251 $aOptions = array();
1252 $vocab = array(); 1252 $vocab = array();
1253 $vocab[0] = 'None'; 1253 $vocab[0] = 'None';
@@ -1255,7 +1255,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1255,7 +1255,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1255 $vocab[$role->getId()] = $role->getName(); 1255 $vocab[$role->getId()] = $role->getName();
1256 } 1256 }
1257 $aOptions['vocab'] = $vocab; 1257 $aOptions['vocab'] = $vocab;
1258 - $edit_fields[] = new KTLookupWidget(_('Guard Role.'), _('Which role must the user have in order to follow this transition?'), 'fRoleId', $oTransition->getGuardRoleId(), $this->oPage, false, null, null, $aOptions); 1258 + $edit_fields[] = new KTLookupWidget(_kt('Guard Role.'), _('Which role must the user have in order to follow this transition?'), 'fRoleId', $oTransition->getGuardRoleId(), $this->oPage, false, null, null, $aOptions);
1259 1259
1260 if (!empty($aConditions)) { 1260 if (!empty($aConditions)) {
1261 $aOptions = array(); 1261 $aOptions = array();
@@ -1265,7 +1265,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1265,7 +1265,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1265 $vocab[$condition->getId()] = $condition->getName(); 1265 $vocab[$condition->getId()] = $condition->getName();
1266 } 1266 }
1267 $aOptions['vocab'] = $vocab; 1267 $aOptions['vocab'] = $vocab;
1268 - $edit_fields[] = new KTLookupWidget(_('Guard Condition.'), _('Which condition (stored search) must be satisfied before the transition can take place?'), 'fConditionId', $oTransition->getGuardConditionId(), $this->oPage, false, null, null, $aOptions); 1268 + $edit_fields[] = new KTLookupWidget(_kt('Guard Condition.'), _('Which condition (stored search) must be satisfied before the transition can take place?'), 'fConditionId', $oTransition->getGuardConditionId(), $this->oPage, false, null, null, $aOptions);
1269 } 1269 }
1270 1270
1271 $this->aBreadcrumbs[] = array( 1271 $this->aBreadcrumbs[] = array(
@@ -1328,9 +1328,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher { @@ -1328,9 +1328,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1328 $res = $oTransition->update(); 1328 $res = $oTransition->update();
1329 $this->oValidator->notErrorFalse($res, array( 1329 $this->oValidator->notErrorFalse($res, array(
1330 'redirect_to' => array('editTransition', 'fWorkflowId=' . $oWorkflow->getId() . '&fTransitionId=' . $oTransition->getId()), 1330 'redirect_to' => array('editTransition', 'fWorkflowId=' . $oWorkflow->getId() . '&fTransitionId=' . $oTransition->getId()),
1331 - 'message' => _('Error saving transition'), 1331 + 'message' => _kt('Error saving transition'),
1332 )); 1332 ));
1333 - $this->successRedirectTo('editTransition', _('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId() . '&fTransitionId=' . $oTransition->getId()); 1333 + $this->successRedirectTo('editTransition', _kt('Changes saved'), 'fWorkflowId=' . $oWorkflow->getId() . '&fTransitionId=' . $oTransition->getId());
1334 exit(0); 1334 exit(0);
1335 } 1335 }
1336 // }}} 1336 // }}}
plugins/ktcore/authentication/authenticationadminpage.inc.php
@@ -37,7 +37,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -37,7 +37,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
37 37
38 function check() { 38 function check() {
39 $res = parent::check(); 39 $res = parent::check();
40 - $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); 40 + $this->aBreadcrumbs[] = array('name' => _kt('Authentication'), 'url' => $_SERVER['PHP_SELF']);
41 return $res; 41 return $res;
42 } 42 }
43 43
@@ -45,7 +45,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -45,7 +45,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
45 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage'); 45 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage');
46 $fields = array(); 46 $fields = array();
47 47
48 - $fields[] = new KTStringWidget(_('Name'), _('A short name which helps identify this source of authentication data.'), 'name', "", $this->oPage, true); 48 + $fields[] = new KTStringWidget(_kt('Name'), _('A short name which helps identify this source of authentication data.'), 'name', "", $this->oPage, true);
49 49
50 $aVocab = array(); 50 $aVocab = array();
51 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); 51 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
@@ -54,7 +54,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -54,7 +54,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
54 $aVocab[$aProvider[2]] = $aProvider[0]; 54 $aVocab[$aProvider[2]] = $aProvider[0];
55 } 55 }
56 $fieldOptions = array("vocab" => $aVocab); 56 $fieldOptions = array("vocab" => $aVocab);
57 - $fields[] = new KTLookupWidget(_('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); 57 + $fields[] = new KTLookupWidget(_kt('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
58 58
59 $aSources = KTAuthenticationSource::getList(); 59 $aSources = KTAuthenticationSource::getList();
60 60
@@ -71,7 +71,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -71,7 +71,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
71 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/addsource'); 71 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/addsource');
72 $fields = array(); 72 $fields = array();
73 73
74 - $fields[] = new KTStringWidget(_('Name'), _('A short name which helps identify this source of authentication data.'), 'name', "", $this->oPage, true); 74 + $fields[] = new KTStringWidget(_kt('Name'), _('A short name which helps identify this source of authentication data.'), 'name', "", $this->oPage, true);
75 75
76 $aVocab = array(); 76 $aVocab = array();
77 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); 77 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
@@ -80,7 +80,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -80,7 +80,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
80 $aVocab[$aProvider[2]] = $aProvider[0]; 80 $aVocab[$aProvider[2]] = $aProvider[0];
81 } 81 }
82 $fieldOptions = array("vocab" => $aVocab); 82 $fieldOptions = array("vocab" => $aVocab);
83 - $fields[] = new KTLookupWidget(_('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); 83 + $fields[] = new KTLookupWidget(_kt('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
84 84
85 $aSources = KTAuthenticationSource::getList(); 85 $aSources = KTAuthenticationSource::getList();
86 86
@@ -97,7 +97,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -97,7 +97,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
97 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/viewsource'); 97 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/viewsource');
98 $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); 98 $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']);
99 $this->aBreadcrumbs[] = array('name' => $oSource->getName()); 99 $this->aBreadcrumbs[] = array('name' => $oSource->getName());
100 - $this->oPage->setTitle(sprintf(_("Authentication source: %s"), $oSource->getName())); 100 + $this->oPage->setTitle(sprintf(_kt("Authentication source: %s"), $oSource->getName()));
101 $this->oPage->setBreadcrumbDetails('viewing'); 101 $this->oPage->setBreadcrumbDetails('viewing');
102 $sProvider = $oSource->getAuthenticationProvider(); 102 $sProvider = $oSource->getAuthenticationProvider();
103 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); 103 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
@@ -119,12 +119,12 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -119,12 +119,12 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
119 'name' => $oSource->getName(), 119 'name' => $oSource->getName(),
120 'query' => sprintf('action=viewsource&source_id=%d', $oSource->getId()), 120 'query' => sprintf('action=viewsource&source_id=%d', $oSource->getId()),
121 ); 121 );
122 - $this->oPage->setTitle(sprintf(_("Editing authentication source: %s"), $oSource->getName())); 122 + $this->oPage->setTitle(sprintf(_kt("Editing authentication source: %s"), $oSource->getName()));
123 $this->oPage->setBreadcrumbDetails('editing'); 123 $this->oPage->setBreadcrumbDetails('editing');
124 124
125 $fields = array(); 125 $fields = array();
126 126
127 - $fields[] = new KTStringWidget(_('Name'), _('A short name which helps identify this source of authentication data.'), 'authentication_name', $oSource->getName(), $this->oPage, true); 127 + $fields[] = new KTStringWidget(_kt('Name'), _('A short name which helps identify this source of authentication data.'), 'authentication_name', $oSource->getName(), $this->oPage, true);
128 128
129 $aVocab = array(); 129 $aVocab = array();
130 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); 130 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
@@ -133,7 +133,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -133,7 +133,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
133 $aVocab[$aProvider[2]] = $aProvider[0]; 133 $aVocab[$aProvider[2]] = $aProvider[0];
134 } 134 }
135 $fieldOptions = array("vocab" => $aVocab); 135 $fieldOptions = array("vocab" => $aVocab);
136 - $fields[] = new KTLookupWidget(_('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', $oSource->getAuthenticationProvider(), $this->oPage, true, null, $fieldErrors, $fieldOptions); 136 + $fields[] = new KTLookupWidget(_kt('Authentication provider'), _('The type of source (e.g. <strong>LDAP</strong>)'), 'authentication_provider', $oSource->getAuthenticationProvider(), $this->oPage, true, null, $fieldErrors, $fieldOptions);
137 137
138 $oTemplate->setData(array( 138 $oTemplate->setData(array(
139 'context' => &$this, 139 'context' => &$this,
@@ -161,13 +161,13 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -161,13 +161,13 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
161 $aErrorOptions = array( 161 $aErrorOptions = array(
162 'redirect_to' => array('main'), 162 'redirect_to' => array('main'),
163 ); 163 );
164 - $aErrorOptions['message'] = _("No name provided"); 164 + $aErrorOptions['message'] = _kt("No name provided");
165 $sName = KTUtil::arrayGet($_REQUEST, 'name'); 165 $sName = KTUtil::arrayGet($_REQUEST, 'name');
166 $sName = $this->oValidator->validateString($sName, $aErrorOptions); 166 $sName = $this->oValidator->validateString($sName, $aErrorOptions);
167 - $aErrorOptions['message'] = _("An authentication source with that name already exists"); 167 + $aErrorOptions['message'] = _kt("An authentication source with that name already exists");
168 $this->oValidator->validateDuplicateName('KTAuthenticationSource', $sName, $aErrorOptions); 168 $this->oValidator->validateDuplicateName('KTAuthenticationSource', $sName, $aErrorOptions);
169 169
170 - $aErrorOptions['message'] = _("No authentication provider chosen"); 170 + $aErrorOptions['message'] = _kt("No authentication provider chosen");
171 $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider'); 171 $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider');
172 $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions); 172 $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions);
173 173
@@ -185,11 +185,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -185,11 +185,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
185 $aErrorOptions = array( 185 $aErrorOptions = array(
186 'redirect_to' => array('main'), 186 'redirect_to' => array('main'),
187 ); 187 );
188 - $aErrorOptions['message'] = _("No name provided"); 188 + $aErrorOptions['message'] = _kt("No name provided");
189 $sName = KTUtil::arrayGet($_REQUEST, 'name'); 189 $sName = KTUtil::arrayGet($_REQUEST, 'name');
190 $sName = $this->oValidator->validateString($sName, $aErrorOptions); 190 $sName = $this->oValidator->validateString($sName, $aErrorOptions);
191 191
192 - $aErrorOptions['message'] = _("No authentication provider chosen"); 192 + $aErrorOptions['message'] = _kt("No authentication provider chosen");
193 $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider'); 193 $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider');
194 $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions); 194 $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions);
195 195
@@ -202,7 +202,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -202,7 +202,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
202 'authenticationprovider' => $sProvider, 202 'authenticationprovider' => $sProvider,
203 )); 203 ));
204 $this->oValidator->notError($oSource); 204 $this->oValidator->notError($oSource);
205 - $this->successRedirectTo('editSourceProvider', _("Source created"), sprintf('source_id=%d', $oSource->getId())); 205 + $this->successRedirectTo('editSourceProvider', _kt("Source created"), sprintf('source_id=%d', $oSource->getId()));
206 } 206 }
207 207
208 function do_deleteSource() { 208 function do_deleteSource() {
@@ -213,10 +213,10 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { @@ -213,10 +213,10 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
213 213
214 if (empty($aUsers) && empty($aGroups)) { 214 if (empty($aUsers) && empty($aGroups)) {
215 $oSource->delete(); 215 $oSource->delete();
216 - $this->successRedirectToMain(_("Authentication source deleted")); 216 + $this->successRedirectToMain(_kt("Authentication source deleted"));
217 } 217 }
218 218
219 - $this->errorRedirectToMain(_("Authentication source is still in use, not deleted")); 219 + $this->errorRedirectToMain(_kt("Authentication source is still in use, not deleted"));
220 } 220 }
221 221
222 function do_editSourceProvider() { 222 function do_editSourceProvider() {
plugins/ktcore/document/Rename.php
@@ -44,7 +44,7 @@ class KTDocumentRenameAction extends KTDocumentAction { @@ -44,7 +44,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
44 var $_sShowPermission = "ktcore.permissions.write"; 44 var $_sShowPermission = "ktcore.permissions.write";
45 45
46 function getDisplayName() { 46 function getDisplayName() {
47 - return _('Rename'); 47 + return _kt('Rename');
48 } 48 }
49 49
50 function getInfo() { 50 function getInfo() {
@@ -60,7 +60,7 @@ class KTDocumentRenameAction extends KTDocumentAction { @@ -60,7 +60,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
60 return $res; 60 return $res;
61 } 61 }
62 if ($this->oDocument->getIsCheckedOut()) { 62 if ($this->oDocument->getIsCheckedOut()) {
63 - $_SESSION["KTErrorMessage"][]= _("This document can't be renamed because it is checked out"); 63 + $_SESSION["KTErrorMessage"][]= _kt("This document can't be renamed because it is checked out");
64 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 64 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
65 exit(0); 65 exit(0);
66 } 66 }
@@ -71,7 +71,7 @@ class KTDocumentRenameAction extends KTDocumentAction { @@ -71,7 +71,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
71 $this->oPage->setBreadcrumbDetails("rename"); 71 $this->oPage->setBreadcrumbDetails("rename");
72 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/rename'); 72 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/rename');
73 $fields = array(); 73 $fields = array();
74 - $fields[] = new KTStringWidget(_('New file name'), _('The name to which the current file should be renamed.'), 'filename', "", $this->oPage, true); 74 + $fields[] = new KTStringWidget(_kt('New file name'), _('The name to which the current file should be renamed.'), 'filename', "", $this->oPage, true);
75 75
76 $oTemplate->setData(array( 76 $oTemplate->setData(array(
77 'context' => &$this, 77 'context' => &$this,
@@ -94,7 +94,7 @@ class KTDocumentRenameAction extends KTDocumentAction { @@ -94,7 +94,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
94 $_SESSION['KTErrorMessage'][] = $res->getMessage(); 94 $_SESSION['KTErrorMessage'][] = $res->getMessage();
95 controllerRedirect('viewDocument',sprintf('fDocumentId=%d', $this->oDocument->getId())); 95 controllerRedirect('viewDocument',sprintf('fDocumentId=%d', $this->oDocument->getId()));
96 } else { 96 } else {
97 - $_SESSION['KTInfoMessage'][] = sprintf(_('Document "%s" renamed.'),$this->oDocument->getName()); 97 + $_SESSION['KTInfoMessage'][] = sprintf(_kt('Document "%s" renamed.'),$this->oDocument->getName());
98 } 98 }
99 99
100 controllerRedirect('viewDocument', sprintf('fDocumentId=%d', $this->oDocument->getId())); 100 controllerRedirect('viewDocument', sprintf('fDocumentId=%d', $this->oDocument->getId()));
plugins/ktcore/folder/BulkImport.php
@@ -45,7 +45,7 @@ class KTBulkImportFolderAction extends KTFolderAction { @@ -45,7 +45,7 @@ class KTBulkImportFolderAction extends KTFolderAction {
45 var $bAutomaticTransaction = true; 45 var $bAutomaticTransaction = true;
46 46
47 function getDisplayName() { 47 function getDisplayName() {
48 - return _('Import from Server Location'); 48 + return _kt('Import from Server Location');
49 } 49 }
50 50
51 function getInfo() { 51 function getInfo() {
@@ -57,12 +57,12 @@ class KTBulkImportFolderAction extends KTFolderAction { @@ -57,12 +57,12 @@ class KTBulkImportFolderAction extends KTFolderAction {
57 } 57 }
58 58
59 function do_main() { 59 function do_main() {
60 - $this->oPage->setBreadcrumbDetails(_("bulk import")); 60 + $this->oPage->setBreadcrumbDetails(_kt("bulk import"));
61 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkImport'); 61 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkImport');
62 $add_fields = array(); 62 $add_fields = array();
63 - $add_fields[] = new KTStringWidget(_('Path'), _('The path containing the documents to be added to the document management system.'), 'path', "", $this->oPage, true); 63 + $add_fields[] = new KTStringWidget(_kt('Path'), _('The path containing the documents to be added to the document management system.'), 'path', "", $this->oPage, true);
64 64
65 - $aVocab = array('' => _('&lt;Please select a document type&gt;')); 65 + $aVocab = array('' => _kt('&lt;Please select a document type&gt;'));
66 foreach (DocumentType::getList() as $oDocumentType) { 66 foreach (DocumentType::getList() as $oDocumentType) {
67 if(!$oDocumentType->getDisabled()) { 67 if(!$oDocumentType->getDisabled()) {
68 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); 68 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
@@ -70,7 +70,7 @@ class KTBulkImportFolderAction extends KTFolderAction { @@ -70,7 +70,7 @@ class KTBulkImportFolderAction extends KTFolderAction {
70 } 70 }
71 71
72 $fieldOptions = array("vocab" => $aVocab); 72 $fieldOptions = array("vocab" => $aVocab);
73 - $add_fields[] = new KTLookupWidget(_('Document Type'), _('Document Types, defined by the administrator, are used to categorise documents. Please select a Document Type from the list below.'), 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); 73 + $add_fields[] = new KTLookupWidget(_kt('Document Type'), _('Document Types, defined by the administrator, are used to categorise documents. Please select a Document Type from the list below.'), 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
74 74
75 $fieldsets = array(); 75 $fieldsets = array();
76 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); 76 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
@@ -93,10 +93,10 @@ class KTBulkImportFolderAction extends KTFolderAction { @@ -93,10 +93,10 @@ class KTBulkImportFolderAction extends KTFolderAction {
93 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), 93 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
94 ); 94 );
95 95
96 - $aErrorOptions['message'] = _('Invalid document type provided'); 96 + $aErrorOptions['message'] = _kt('Invalid document type provided');
97 $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); 97 $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
98 98
99 - $aErrorOptions['message'] = _('Invalid path provided'); 99 + $aErrorOptions['message'] = _kt('Invalid path provided');
100 $sPath = $this->oValidator->validateString($_REQUEST['path'], $aErrorOptions); 100 $sPath = $this->oValidator->validateString($_REQUEST['path'], $aErrorOptions);
101 101
102 $matches = array(); 102 $matches = array();
@@ -123,7 +123,7 @@ class KTBulkImportFolderAction extends KTFolderAction { @@ -123,7 +123,7 @@ class KTBulkImportFolderAction extends KTFolderAction {
123 $res = $bm->import(); 123 $res = $bm->import();
124 if (PEAR::isError($res)) { 124 if (PEAR::isError($res)) {
125 DBUtil::rollback(); 125 DBUtil::rollback();
126 - $_SESSION["KTErrorMessage"][] = _("Bulk import failed") . ": " . $res->getMessage(); 126 + $_SESSION["KTErrorMessage"][] = _kt("Bulk import failed") . ": " . $res->getMessage();
127 } else { 127 } else {
128 DBUtil::commit(); 128 DBUtil::commit();
129 $this->addInfoMessage("Bulk import succeeded"); 129 $this->addInfoMessage("Bulk import succeeded");
plugins/ktcore/folder/BulkUpload.php
@@ -43,7 +43,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { @@ -43,7 +43,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
43 var $bAutomaticTransaction = true; 43 var $bAutomaticTransaction = true;
44 44
45 function getDisplayName() { 45 function getDisplayName() {
46 - return _('Bulk upload'); 46 + return _kt('Bulk upload');
47 } 47 }
48 48
49 function check() { 49 function check() {
@@ -64,19 +64,19 @@ class KTBulkUploadFolderAction extends KTFolderAction { @@ -64,19 +64,19 @@ class KTBulkUploadFolderAction extends KTFolderAction {
64 } 64 }
65 65
66 function do_main() { 66 function do_main() {
67 - $this->oPage->setBreadcrumbDetails(_("bulk upload")); 67 + $this->oPage->setBreadcrumbDetails(_kt("bulk upload"));
68 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkUpload'); 68 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkUpload');
69 $add_fields = array(); 69 $add_fields = array();
70 - $add_fields[] = new KTFileUploadWidget(_('Archive file'), _('The archive file containing the documents you wish to add to the document management system.'), 'file', "", $this->oPage, true); 70 + $add_fields[] = new KTFileUploadWidget(_kt('Archive file'), _('The archive file containing the documents you wish to add to the document management system.'), 'file', "", $this->oPage, true);
71 71
72 - $aVocab = array('' => _('&lt;Please select a document type&gt;')); 72 + $aVocab = array('' => _kt('&lt;Please select a document type&gt;'));
73 foreach (DocumentType::getList() as $oDocumentType) { 73 foreach (DocumentType::getList() as $oDocumentType) {
74 if(!$oDocumentType->getDisabled()) { 74 if(!$oDocumentType->getDisabled()) {
75 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); 75 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
76 } 76 }
77 } 77 }
78 $fieldOptions = array("vocab" => $aVocab); 78 $fieldOptions = array("vocab" => $aVocab);
79 - $add_fields[] = new KTLookupWidget(_('Document Type'), _('Document Types, defined by the administrator, are used to categorise documents. Please select a Document Type from the list below.'), 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); 79 + $add_fields[] = new KTLookupWidget(_kt('Document Type'), _('Document Types, defined by the administrator, are used to categorise documents. Please select a Document Type from the list below.'), 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
80 80
81 $fieldsets = array(); 81 $fieldsets = array();
82 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); 82 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
@@ -99,7 +99,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { @@ -99,7 +99,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
99 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), 99 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
100 ); 100 );
101 101
102 - $aErrorOptions['message'] = _('Invalid document type provided'); 102 + $aErrorOptions['message'] = _kt('Invalid document type provided');
103 $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); 103 $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
104 104
105 unset($aErrorOptions['message']); 105 unset($aErrorOptions['message']);
@@ -122,7 +122,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { @@ -122,7 +122,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
122 $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions); 122 $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions);
123 $this->startTransaction(); 123 $this->startTransaction();
124 $res = $bm->import(); 124 $res = $bm->import();
125 - $aErrorOptions['message'] = _("Bulk upload failed"); 125 + $aErrorOptions['message'] = _kt("Bulk upload failed");
126 $this->oValidator->notError($res, $aErrorOptions); 126 $this->oValidator->notError($res, $aErrorOptions);
127 127
128 $this->addInfoMessage("Bulk upload successful"); 128 $this->addInfoMessage("Bulk upload successful");
plugins/ktcore/folder/Rename.php
@@ -40,7 +40,7 @@ class KTFolderRenameAction extends KTFolderAction { @@ -40,7 +40,7 @@ class KTFolderRenameAction extends KTFolderAction {
40 var $_sShowPermission = "ktcore.permissions.write"; 40 var $_sShowPermission = "ktcore.permissions.write";
41 41
42 function getDisplayName() { 42 function getDisplayName() {
43 - return _('Rename'); 43 + return _kt('Rename');
44 } 44 }
45 45
46 function getInfo() { 46 function getInfo() {
@@ -49,12 +49,12 @@ class KTFolderRenameAction extends KTFolderAction { @@ -49,12 +49,12 @@ class KTFolderRenameAction extends KTFolderAction {
49 } 49 }
50 50
51 function do_main() { 51 function do_main() {
52 - $this->oPage->setBreadcrumbDetails(_("rename"));  
53 - $this->oPage->setTitle(_('Rename folder')); 52 + $this->oPage->setBreadcrumbDetails(_kt("rename"));
  53 + $this->oPage->setTitle(_kt('Rename folder'));
54 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/rename'); 54 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/rename');
55 55
56 $fields = array(); 56 $fields = array();
57 - $fields[] = new KTStringWidget(_('New folder name'), _('The name to which the current folder should be renamed.'), 'foldername', "", $this->oPage, true); 57 + $fields[] = new KTStringWidget(_kt('New folder name'), _('The name to which the current folder should be renamed.'), 'foldername', "", $this->oPage, true);
58 58
59 $oTemplate->setData(array( 59 $oTemplate->setData(array(
60 'context' => &$this, 60 'context' => &$this,
@@ -77,7 +77,7 @@ class KTFolderRenameAction extends KTFolderAction { @@ -77,7 +77,7 @@ class KTFolderRenameAction extends KTFolderAction {
77 redirect(KTBrowseUtil::getUrlForFolder($this->oFolder)); 77 redirect(KTBrowseUtil::getUrlForFolder($this->oFolder));
78 exit(0); 78 exit(0);
79 } else { 79 } else {
80 - $_SESSION['KTInfoMessage'][] = sprintf(_('Folder "%s" renamed to "%s".'), $this->oFolder->getName(), $sName); 80 + $_SESSION['KTInfoMessage'][] = sprintf(_kt('Folder "%s" renamed to "%s".'), $this->oFolder->getName(), $sName);
81 } 81 }
82 82
83 $this->commitTransaction(); 83 $this->commitTransaction();
plugins/ktcore/folder/addDocument.php
@@ -41,7 +41,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { @@ -41,7 +41,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
41 var $oDocumentType = null; 41 var $oDocumentType = null;
42 42
43 function getDisplayName() { 43 function getDisplayName() {
44 - return _('Add Document'); 44 + return _kt('Add Document');
45 } 45 }
46 46
47 function check() { 47 function check() {
@@ -62,15 +62,15 @@ class KTFolderAddDocumentAction extends KTFolderAction { @@ -62,15 +62,15 @@ class KTFolderAddDocumentAction extends KTFolderAction {
62 } 62 }
63 63
64 function do_main() { 64 function do_main() {
65 - $this->oPage->setBreadcrumbDetails(_("add document"));  
66 - $this->oPage->setTitle(_('Add a document')); 65 + $this->oPage->setBreadcrumbDetails(_kt("add document"));
  66 + $this->oPage->setTitle(_kt('Add a document'));
67 $oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add'); 67 $oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add');
68 $add_fields = array(); 68 $add_fields = array();
69 - $add_fields[] = new KTFileUploadWidget(_('File'), _('The contents of the document to be added to the document management system.'), 'file', "", $this->oPage, true);  
70 - $add_fields[] = new KTStringWidget(_('Title'), _('The document title is used as the main name of a document throughout KnowledgeTree.'), 'title', "", $this->oPage, true); 69 + $add_fields[] = new KTFileUploadWidget(_kt('File'), _('The contents of the document to be added to the document management system.'), 'file', "", $this->oPage, true);
  70 + $add_fields[] = new KTStringWidget(_kt('Title'), _('The document title is used as the main name of a document throughout KnowledgeTree.'), 'title', "", $this->oPage, true);
71 71
72 72
73 - $aVocab = array('' => _('&lt;Please select a document type&gt;')); 73 + $aVocab = array('' => _kt('&lt;Please select a document type&gt;'));
74 foreach (DocumentType::getList() as $oDocumentType) { 74 foreach (DocumentType::getList() as $oDocumentType) {
75 if(!$oDocumentType->getDisabled()) { 75 if(!$oDocumentType->getDisabled()) {
76 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); 76 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
@@ -78,7 +78,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { @@ -78,7 +78,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
78 } 78 }
79 79
80 $fieldOptions = array("vocab" => $aVocab); 80 $fieldOptions = array("vocab" => $aVocab);
81 - $add_fields[] = new KTLookupWidget(_('Document Type'), _('Document Types, defined by the administrator, are used to categorise documents. Please select a Document Type from the list below.'), 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); 81 + $add_fields[] = new KTLookupWidget(_kt('Document Type'), _('Document Types, defined by the administrator, are used to categorise documents. Please select a Document Type from the list below.'), 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
82 82
83 $fieldsets = array(); 83 $fieldsets = array();
84 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); 84 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
@@ -97,8 +97,8 @@ class KTFolderAddDocumentAction extends KTFolderAction { @@ -97,8 +97,8 @@ class KTFolderAddDocumentAction extends KTFolderAction {
97 } 97 }
98 98
99 function do_upload() { 99 function do_upload() {
100 - $this->oPage->setBreadcrumbDetails(_("add document"));  
101 - $this->oPage->setTitle(_('Add a document')); 100 + $this->oPage->setBreadcrumbDetails(_kt("add document"));
  101 + $this->oPage->setTitle(_kt('Add a document'));
102 $mpo =& new JavascriptObserver($this); 102 $mpo =& new JavascriptObserver($this);
103 // $mpo =& new KTSinglePageObserver(&$this); 103 // $mpo =& new KTSinglePageObserver(&$this);
104 $oUploadChannel =& KTUploadChannel::getSingleton(); 104 $oUploadChannel =& KTUploadChannel::getSingleton();
@@ -121,12 +121,12 @@ class KTFolderAddDocumentAction extends KTFolderAction { @@ -121,12 +121,12 @@ class KTFolderAddDocumentAction extends KTFolderAction {
121 /* 121 /*
122 // this is now done in ::add 122 // this is now done in ::add
123 if (Document::fileExists(basename($aFile['name']), $iFolderId)) { 123 if (Document::fileExists(basename($aFile['name']), $iFolderId)) {
124 - $this->errorRedirectToMain(_('There is already a file with that filename in this folder.'), sprintf('fFolderId=%d', $this->oFolder->getId())); 124 + $this->errorRedirectToMain(_kt('There is already a file with that filename in this folder.'), sprintf('fFolderId=%d', $this->oFolder->getId()));
125 exit(0); 125 exit(0);
126 } 126 }
127 127
128 if (Document::nameExists($sTitle, $iFolderId)) { 128 if (Document::nameExists($sTitle, $iFolderId)) {
129 - $this->errorRedirectToMain(_('There is already a file with that title in this folder.'), sprintf('fFolderId=%d', $this->oFolder->getId())); 129 + $this->errorRedirectToMain(_kt('There is already a file with that title in this folder.'), sprintf('fFolderId=%d', $this->oFolder->getId()));
130 exit(0); 130 exit(0);
131 } 131 }
132 */ 132 */
@@ -139,7 +139,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { @@ -139,7 +139,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
139 } 139 }
140 } 140 }
141 141
142 - $aErrorOptions['message'] = _("Please select a valid document type"); 142 + $aErrorOptions['message'] = _kt("Please select a valid document type");
143 $this->oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); 143 $this->oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
144 144
145 $aOptions = array( 145 $aOptions = array(
plugins/ktstandard/KTBulkExportPlugin.php
@@ -45,7 +45,7 @@ class KTBulkExportAction extends KTFolderAction { @@ -45,7 +45,7 @@ class KTBulkExportAction extends KTFolderAction {
45 var $sPermissionName = "ktcore.permissions.read"; 45 var $sPermissionName = "ktcore.permissions.read";
46 46
47 function getDisplayName() { 47 function getDisplayName() {
48 - return _('Bulk Export'); 48 + return _kt('Bulk Export');
49 } 49 }
50 50
51 function do_main() { 51 function do_main() {
@@ -55,7 +55,7 @@ class KTBulkExportAction extends KTFolderAction { @@ -55,7 +55,7 @@ class KTBulkExportAction extends KTFolderAction {
55 $aDocumentIds = DBUtil::getResultArrayKey($aQuery, 'id'); 55 $aDocumentIds = DBUtil::getResultArrayKey($aQuery, 'id');
56 56
57 if (empty($aDocumentIds)) { 57 if (empty($aDocumentIds)) {
58 - $this->addErrorMessage(_("No documents found to export")); 58 + $this->addErrorMessage(_kt("No documents found to export"));
59 redirect(KTBrowseUtil::getUrlForFolder($oFolder)); 59 redirect(KTBrowseUtil::getUrlForFolder($oFolder));
60 exit(0); 60 exit(0);
61 } 61 }
plugins/ktstandard/KTDiscussion.php
@@ -91,17 +91,17 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -91,17 +91,17 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
91 var $sName = 'ktcore.actions.document.discussion'; 91 var $sName = 'ktcore.actions.document.discussion';
92 92
93 function getDisplayName() { 93 function getDisplayName() {
94 - return _('Discussion'); 94 + return _kt('Discussion');
95 } 95 }
96 96
97 function do_main() { 97 function do_main() {
98 - $this->oPage->setBreadcrumbDetails(_("discussion")); 98 + $this->oPage->setBreadcrumbDetails(_kt("discussion"));
99 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion'); 99 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion');
100 100
101 // Fields for new thread creation 101 // Fields for new thread creation
102 $fields = array(); 102 $fields = array();
103 - $fields[] = new KTStringWidget(_("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true);  
104 - $fields[] = new KTTextWidget(_("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); 103 + $fields[] = new KTStringWidget(_kt("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true);
  104 + $fields[] = new KTTextWidget(_kt("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10));
105 105
106 $threads = DiscussionThread::getList(array('document_id=?', array($this->oDocument->getId()))); 106 $threads = DiscussionThread::getList(array('document_id=?', array($this->oDocument->getId())));
107 107
@@ -119,11 +119,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -119,11 +119,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
119 'redirect_to' => array('main', sprintf('fDocumentId=%d', $this->oDocument->getId())), 119 'redirect_to' => array('main', sprintf('fDocumentId=%d', $this->oDocument->getId())),
120 ); 120 );
121 121
122 - $aErrorOptions['message'] = _("No subject provided"); 122 + $aErrorOptions['message'] = _kt("No subject provided");
123 $sSubject = KTUtil::arrayGet($_REQUEST, 'subject'); 123 $sSubject = KTUtil::arrayGet($_REQUEST, 'subject');
124 $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions); 124 $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions);
125 125
126 - $aErrorOptions['message'] = _("No body provided"); 126 + $aErrorOptions['message'] = _kt("No body provided");
127 $sBody = KTUtil::arrayGet($_REQUEST, 'body'); 127 $sBody = KTUtil::arrayGet($_REQUEST, 'body');
128 $sBody = $this->oValidator->validateString($sBody, $aErrorOptions); 128 $sBody = $this->oValidator->validateString($sBody, $aErrorOptions);
129 129
@@ -134,7 +134,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -134,7 +134,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
134 'documentid' => $this->oDocument->getId(), 134 'documentid' => $this->oDocument->getId(),
135 'creatorid' => $this->oUser->getId(), 135 'creatorid' => $this->oUser->getId(),
136 )); 136 ));
137 - $aErrorOptions['message'] = _("There was an error creating a new thread"); 137 + $aErrorOptions['message'] = _kt("There was an error creating a new thread");
138 $this->oValidator->notError($oThread, $aErrorOptions); 138 $this->oValidator->notError($oThread, $aErrorOptions);
139 139
140 $oComment = DiscussionComment::createFromArray(array( 140 $oComment = DiscussionComment::createFromArray(array(
@@ -143,19 +143,19 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -143,19 +143,19 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
143 'subject' => $sSubject, 143 'subject' => $sSubject,
144 'body' => KTUtil::formatPlainText($sBody), 144 'body' => KTUtil::formatPlainText($sBody),
145 )); 145 ));
146 - $aErrorOptions['message'] = _("There was an error adding the comment to the thread"); 146 + $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread");
147 $this->oValidator->notError($oComment, $aErrorOptions); 147 $this->oValidator->notError($oComment, $aErrorOptions);
148 148
149 $oThread->setFirstCommentId($oComment->getId()); 149 $oThread->setFirstCommentId($oComment->getId());
150 $oThread->setLastCommentId($oComment->getId()); 150 $oThread->setLastCommentId($oComment->getId());
151 $res = $oThread->update(); 151 $res = $oThread->update();
152 - $aErrorOptions['message'] = _("There was an error updating the thread with the new comment"); 152 + $aErrorOptions['message'] = _kt("There was an error updating the thread with the new comment");
153 $this->oValidator->notError($res, $aErrorOptions); 153 $this->oValidator->notError($res, $aErrorOptions);
154 154
155 // Thread and comment created correctly, commit to database 155 // Thread and comment created correctly, commit to database
156 $this->commitTransaction(); 156 $this->commitTransaction();
157 157
158 - $this->successRedirectToMain(_("New thread created"), sprintf('fDocumentId=%d', $this->oDocument->getId())); 158 + $this->successRedirectToMain(_kt("New thread created"), sprintf('fDocumentId=%d', $this->oDocument->getId()));
159 exit(0); 159 exit(0);
160 } 160 }
161 161
@@ -168,20 +168,20 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -168,20 +168,20 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
168 168
169 // breadcrumbs... 169 // breadcrumbs...
170 $this->aBreadcrumbs[] = array( 170 $this->aBreadcrumbs[] = array(
171 - 'name' => _('discussion'), 171 + 'name' => _kt('discussion'),
172 'query' => sprintf('fDocumentId=%d', $this->oDocument->getId()), 172 'query' => sprintf('fDocumentId=%d', $this->oDocument->getId()),
173 ); 173 );
174 $this->aBreadcrumbs[] = array( 174 $this->aBreadcrumbs[] = array(
175 'name' => $oComment->getSubject(), 175 'name' => $oComment->getSubject(),
176 ); 176 );
177 - $this->oPage->setBreadcrumbDetails(_("viewing comments")); 177 + $this->oPage->setBreadcrumbDetails(_kt("viewing comments"));
178 178
179 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion_thread'); 179 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion_thread');
180 180
181 // Fields for new thread creation 181 // Fields for new thread creation
182 $replyFields = array(); 182 $replyFields = array();
183 - $replyFields[] = new KTStringWidget(_("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true);  
184 - $replyFields[] = new KTTextWidget(_("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); 183 + $replyFields[] = new KTStringWidget(_kt("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true);
  184 + $replyFields[] = new KTTextWidget(_kt("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10));
185 185
186 // Fields for closing thread (if user has write permission) 186 // Fields for closing thread (if user has write permission)
187 $closeFields = array(); 187 $closeFields = array();
@@ -189,7 +189,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -189,7 +189,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
189 $oPermission =& KTPermission::getByName('ktcore.permissions.write'); 189 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
190 if (PEAR::isError($oPermission) || 190 if (PEAR::isError($oPermission) ||
191 KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) { 191 KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) {
192 - $closeFields[] = new KTTextWidget(_("Reason"), _("Describe the reason for closing this thread"), "reason", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 5)); 192 + $closeFields[] = new KTTextWidget(_kt("Reason"), _("Describe the reason for closing this thread"), "reason", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 5));
193 } 193 }
194 194
195 // increment views 195 // increment views
@@ -221,11 +221,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -221,11 +221,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
221 ); 221 );
222 222
223 223
224 - $aErrorOptions['message'] = _("No subject provided"); 224 + $aErrorOptions['message'] = _kt("No subject provided");
225 $sSubject = KTUtil::arrayGet($_REQUEST, 'subject'); 225 $sSubject = KTUtil::arrayGet($_REQUEST, 'subject');
226 $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions); 226 $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions);
227 227
228 - $aErrorOptions['message'] = _("No body provided"); 228 + $aErrorOptions['message'] = _kt("No body provided");
229 $sBody = KTUtil::arrayGet($_REQUEST, 'body'); 229 $sBody = KTUtil::arrayGet($_REQUEST, 'body');
230 $sBody = $this->oValidator->validateString($sBody, $aErrorOptions); 230 $sBody = $this->oValidator->validateString($sBody, $aErrorOptions);
231 231
@@ -239,7 +239,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -239,7 +239,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
239 'subject' => $sSubject, 239 'subject' => $sSubject,
240 'body' => KTUtil::formatPlainText($sBody), 240 'body' => KTUtil::formatPlainText($sBody),
241 )); 241 ));
242 - $aErrorOptions['message'] = _("There was an error adding the comment to the thread"); 242 + $aErrorOptions['message'] = _kt("There was an error adding the comment to the thread");
243 $this->oValidator->notError($oComment, $aErrorOptions); 243 $this->oValidator->notError($oComment, $aErrorOptions);
244 244
245 // Update thread 245 // Update thread
@@ -248,7 +248,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -248,7 +248,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
248 248
249 $res = $oThread->update(); 249 $res = $oThread->update();
250 250
251 - $aErrorOptions['message'] = _("There was an error updating the thread with the new comment"); 251 + $aErrorOptions['message'] = _kt("There was an error updating the thread with the new comment");
252 $this->oValidator->notError($res, $aErrorOptions); 252 $this->oValidator->notError($res, $aErrorOptions);
253 253
254 254
@@ -256,7 +256,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -256,7 +256,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
256 // Thread and comment created correctly, commit to database 256 // Thread and comment created correctly, commit to database
257 $this->commitTransaction(); 257 $this->commitTransaction();
258 258
259 - $this->successRedirectTo('viewThread', _("Reply posted"), sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId())); 259 + $this->successRedirectTo('viewThread', _kt("Reply posted"), sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId()));
260 exit(0); 260 exit(0);
261 } 261 }
262 262
@@ -277,13 +277,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -277,13 +277,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
277 $oPermission =& KTPermission::getByName('ktcore.permissions.write'); 277 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
278 278
279 if (PEAR::isError($oPermission)) { 279 if (PEAR::isError($oPermission)) {
280 - $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _("Error getting permission")); 280 + $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _kt("Error getting permission"));
281 } 281 }
282 if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) { 282 if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) {
283 - $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _("You do not have permission to close this thread")); 283 + $this->errorRedirectTo(implode('&', $aErrorOptions['redirect_to']), _kt("You do not have permission to close this thread"));
284 } 284 }
285 285
286 - $aErrorOptions['message'] = _("No reason provided"); 286 + $aErrorOptions['message'] = _kt("No reason provided");
287 $sReason = KTUtil::arrayGet($_REQUEST, 'reason'); 287 $sReason = KTUtil::arrayGet($_REQUEST, 'reason');
288 $sReason = $this->oValidator->validateString($sReason, $aErrorOptions); 288 $sReason = $this->oValidator->validateString($sReason, $aErrorOptions);
289 289
@@ -295,13 +295,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction { @@ -295,13 +295,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
295 $oThread->setCloseReason($sReason); 295 $oThread->setCloseReason($sReason);
296 $res = $oThread->update(); 296 $res = $oThread->update();
297 297
298 - $aErrorOptions['message'] = _("There was an error updating the thread with the new comment"); 298 + $aErrorOptions['message'] = _kt("There was an error updating the thread with the new comment");
299 $this->oValidator->notError($res, $aErrorOptions); 299 $this->oValidator->notError($res, $aErrorOptions);
300 300
301 // Thread closed correctly, so commit 301 // Thread closed correctly, so commit
302 $this->commitTransaction(); 302 $this->commitTransaction();
303 303
304 - $this->successRedirectTo('viewThread', _("Thread closed"), sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId())); 304 + $this->successRedirectTo('viewThread', _kt("Thread closed"), sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId()));
305 exit(0); 305 exit(0);
306 } 306 }
307 307
plugins/ktstandard/KTDocumentLinks.php
@@ -46,7 +46,7 @@ class KTDocumentLinkTitle extends TitleColumn { @@ -46,7 +46,7 @@ class KTDocumentLinkTitle extends TitleColumn {
46 $outStr .= $aDataRow["document"]->getName(); 46 $outStr .= $aDataRow["document"]->getName();
47 $outStr .= '</a>'; 47 $outStr .= '</a>';
48 } else { 48 } else {
49 - $outStr = $aDataRow["document"]->getName() . ' <span class="descriptiveText">(' . _('you cannot link to the source document') . ')'; 49 + $outStr = $aDataRow["document"]->getName() . ' <span class="descriptiveText">(' . _kt('you cannot link to the source document') . ')';
50 } 50 }
51 return $outStr; 51 return $outStr;
52 } 52 }
@@ -75,14 +75,14 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -75,14 +75,14 @@ class KTDocumentLinkAction extends KTDocumentAction {
75 var $sName = 'ktcore.actions.document.link'; 75 var $sName = 'ktcore.actions.document.link';
76 76
77 function getDisplayName() { 77 function getDisplayName() {
78 - return _('Links'); 78 + return _kt('Links');
79 } 79 }
80 80
81 // display existing links 81 // display existing links
82 function do_main() { 82 function do_main() {
83 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/document_links'); 83 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/document_links');
84 - $this->oPage->setBreadcrumbDetails(_("Links"));  
85 - $this->oPage->setTitle(_("Links")); 84 + $this->oPage->setBreadcrumbDetails(_kt("Links"));
  85 + $this->oPage->setTitle(_kt("Links"));
86 86
87 $oDocument = Document::get( 87 $oDocument = Document::get(
88 KTUtil::arrayGet($_REQUEST, 'fDocumentId', 0) 88 KTUtil::arrayGet($_REQUEST, 'fDocumentId', 0)
@@ -109,26 +109,26 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -109,26 +109,26 @@ class KTDocumentLinkAction extends KTDocumentAction {
109 109
110 // select a target for the link 110 // select a target for the link
111 function do_new() { 111 function do_new() {
112 - $this->oPage->setBreadcrumbDetails(_("New Link"));  
113 - $this->oPage->setTitle(_("New Link")); 112 + $this->oPage->setBreadcrumbDetails(_kt("New Link"));
  113 + $this->oPage->setTitle(_kt("New Link"));
114 114
115 $oPermission =& KTPermission::getByName('ktcore.permissions.write'); 115 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
116 if (PEAR::isError($oPermission) || 116 if (PEAR::isError($oPermission) ||
117 !KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) { 117 !KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) {
118 - $this->errorRedirectToMain(_('You do not have sufficient permissions to add a document link'), sprintf("fDocumentId=%d", $this->oDocument->getId())); 118 + $this->errorRedirectToMain(_kt('You do not have sufficient permissions to add a document link'), sprintf("fDocumentId=%d", $this->oDocument->getId()));
119 exit(0); 119 exit(0);
120 } 120 }
121 121
122 $oParentDocument =& $this->oDocument; 122 $oParentDocument =& $this->oDocument;
123 123
124 if (PEAR::isError($oParentDocument)) { 124 if (PEAR::isError($oParentDocument)) {
125 - $this->errorRedirectToMain(_('Invalid parent document selected.')); 125 + $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
126 exit(0); 126 exit(0);
127 } 127 }
128 128
129 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', $oParentDocument->getFolderID())); 129 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', $oParentDocument->getFolderID()));
130 if (PEAR::isError($oFolder) || ($oFolder == false)) { 130 if (PEAR::isError($oFolder) || ($oFolder == false)) {
131 - $this->errorRedirectToMain(_('Invalid folder selected.')); 131 + $this->errorRedirectToMain(_kt('Invalid folder selected.'));
132 exit(0); 132 exit(0);
133 } 133 }
134 $iFolderId = $oFolder->getId(); 134 $iFolderId = $oFolder->getId();
@@ -187,17 +187,17 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -187,17 +187,17 @@ class KTDocumentLinkAction extends KTDocumentAction {
187 187
188 // select a type for the link 188 // select a type for the link
189 function do_type_select() { 189 function do_type_select() {
190 - $this->oPage->setBreadcrumbDetails(_("link")); 190 + $this->oPage->setBreadcrumbDetails(_kt("link"));
191 191
192 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId')); 192 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
193 if (PEAR::isError($oParentDocument)) { 193 if (PEAR::isError($oParentDocument)) {
194 - $this->errorRedirectToMain(_('Invalid parent document selected.')); 194 + $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
195 exit(0); 195 exit(0);
196 } 196 }
197 197
198 $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId')); 198 $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId'));
199 if (PEAR::isError($oTargetDocument)) { 199 if (PEAR::isError($oTargetDocument)) {
200 - $this->errorRedirectToMain(_('Invalid target document selected.')); 200 + $this->errorRedirectToMain(_kt('Invalid target document selected.'));
201 exit(0); 201 exit(0);
202 } 202 }
203 203
@@ -212,8 +212,8 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -212,8 +212,8 @@ class KTDocumentLinkAction extends KTDocumentAction {
212 212
213 $aOptions = array('vocab' => $aVocab); 213 $aOptions = array('vocab' => $aVocab);
214 $aFields[] = new KTLookupWidget( 214 $aFields[] = new KTLookupWidget(
215 - _('Link Type'),  
216 - _('The type of link you wish to use'), 215 + _kt('Link Type'),
  216 + _kt('The type of link you wish to use'),
217 'fLinkTypeId', 217 'fLinkTypeId',
218 null, 218 null,
219 $this->oPage, 219 $this->oPage,
@@ -239,24 +239,24 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -239,24 +239,24 @@ class KTDocumentLinkAction extends KTDocumentAction {
239 239
240 // make the link 240 // make the link
241 function do_make_link() { 241 function do_make_link() {
242 - $this->oPage->setBreadcrumbDetails(_("link")); 242 + $this->oPage->setBreadcrumbDetails(_kt("link"));
243 243
244 // check validity of things 244 // check validity of things
245 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId')); 245 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
246 if (PEAR::isError($oParentDocument)) { 246 if (PEAR::isError($oParentDocument)) {
247 - $this->errorRedirectToMain(_('Invalid parent document selected.')); 247 + $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
248 exit(0); 248 exit(0);
249 } 249 }
250 250
251 $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId')); 251 $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId'));
252 if (PEAR::isError($oTargetDocument)) { 252 if (PEAR::isError($oTargetDocument)) {
253 - $this->errorRedirectToMain(_('Invalid target document selected.')); 253 + $this->errorRedirectToMain(_kt('Invalid target document selected.'));
254 exit(0); 254 exit(0);
255 } 255 }
256 256
257 $oLinkType = LinkType::get(KTUtil::arrayGet($_REQUEST, 'fLinkTypeId')); 257 $oLinkType = LinkType::get(KTUtil::arrayGet($_REQUEST, 'fLinkTypeId'));
258 if (PEAR::isError($oLinkType)) { 258 if (PEAR::isError($oLinkType)) {
259 - $this->errorRedirectToMain(_('Invalid link type selected.')); 259 + $this->errorRedirectToMain(_kt('Invalid link type selected.'));
260 exit(0); 260 exit(0);
261 } 261 }
262 262
@@ -271,26 +271,26 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -271,26 +271,26 @@ class KTDocumentLinkAction extends KTDocumentAction {
271 )); 271 ));
272 272
273 if (PEAR::isError($oDocumentLink)) { 273 if (PEAR::isError($oDocumentLink)) {
274 - $this->errorRedirectToMain(_('Could not create document link'), sprintf('fDocumentId=%d', $oParentDocument->getId())); 274 + $this->errorRedirectToMain(_kt('Could not create document link'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
275 exit(0); 275 exit(0);
276 } 276 }
277 277
278 $this->commitTransaction(); 278 $this->commitTransaction();
279 279
280 - $this->successRedirectToMain(_('Document link created'), sprintf('fDocumentId=%d', $oParentDocument->getId())); 280 + $this->successRedirectToMain(_kt('Document link created'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
281 exit(0); 281 exit(0);
282 } 282 }
283 283
284 284
285 // delete a link 285 // delete a link
286 function do_delete() { 286 function do_delete() {
287 - $this->oPage->setBreadcrumbDetails(_("link")); 287 + $this->oPage->setBreadcrumbDetails(_kt("link"));
288 288
289 // check security 289 // check security
290 $oPermission =& KTPermission::getByName('ktcore.permissions.write'); 290 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
291 if (PEAR::isError($oPermission) || 291 if (PEAR::isError($oPermission) ||
292 !KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) { 292 !KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) {
293 - $this->errorRedirectToMain(_('You do not have sufficient permissions to delete a link'), sprintf("fDocumentId=%d", $this->oDocument->getId())); 293 + $this->errorRedirectToMain(_kt('You do not have sufficient permissions to delete a link'), sprintf("fDocumentId=%d", $this->oDocument->getId()));
294 exit(0); 294 exit(0);
295 } 295 }
296 296
@@ -298,12 +298,12 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -298,12 +298,12 @@ class KTDocumentLinkAction extends KTDocumentAction {
298 // check validity of things 298 // check validity of things
299 $oDocumentLink = DocumentLink::get(KTUtil::arrayGet($_REQUEST, 'fDocumentLinkId')); 299 $oDocumentLink = DocumentLink::get(KTUtil::arrayGet($_REQUEST, 'fDocumentLinkId'));
300 if (PEAR::isError($oDocumentLink)) { 300 if (PEAR::isError($oDocumentLink)) {
301 - $this->errorRedirectToMain(_('Invalid document link selected.')); 301 + $this->errorRedirectToMain(_kt('Invalid document link selected.'));
302 exit(0); 302 exit(0);
303 } 303 }
304 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId')); 304 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
305 if (PEAR::isError($oParentDocument)) { 305 if (PEAR::isError($oParentDocument)) {
306 - $this->errorRedirectToMain(_('Invalid document selected.')); 306 + $this->errorRedirectToMain(_kt('Invalid document selected.'));
307 exit(0); 307 exit(0);
308 } 308 }
309 309
@@ -313,13 +313,13 @@ class KTDocumentLinkAction extends KTDocumentAction { @@ -313,13 +313,13 @@ class KTDocumentLinkAction extends KTDocumentAction {
313 $res = $oDocumentLink->delete(); 313 $res = $oDocumentLink->delete();
314 314
315 if (PEAR::isError($res)) { 315 if (PEAR::isError($res)) {
316 - $this->errorRedirectToMain(_('Could not delete document link'), sprintf('fDocumentId=%d', $oParentDocument->getId())); 316 + $this->errorRedirectToMain(_kt('Could not delete document link'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
317 exit(0); 317 exit(0);
318 } 318 }
319 319
320 $this->commitTransaction(); 320 $this->commitTransaction();
321 321
322 - $this->successRedirectToMain(_('Document link deleted'), sprintf('fDocumentId=%d', $oParentDocument->getId())); 322 + $this->successRedirectToMain(_kt('Document link deleted'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
323 exit(0); 323 exit(0);
324 } 324 }
325 325
plugins/ktstandard/KTEmail.php
@@ -230,7 +230,7 @@ class KTDocumentEmailAction extends KTDocumentAction { @@ -230,7 +230,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
230 var $sName = 'ktcore.actions.document.email'; 230 var $sName = 'ktcore.actions.document.email';
231 231
232 function getDisplayName() { 232 function getDisplayName() {
233 - return _('Email'); 233 + return _kt('Email');
234 } 234 }
235 235
236 function do_main() { 236 function do_main() {
@@ -240,12 +240,12 @@ class KTDocumentEmailAction extends KTDocumentAction { @@ -240,12 +240,12 @@ class KTDocumentEmailAction extends KTDocumentAction {
240 $bAttachment = $oConfig->get('email/allowAttachment', false); 240 $bAttachment = $oConfig->get('email/allowAttachment', false);
241 $bEmailAddresses = $oConfig->get('email/allowEmailAddresses', false); 241 $bEmailAddresses = $oConfig->get('email/allowEmailAddresses', false);
242 if ($bAttachment) { 242 if ($bAttachment) {
243 - $fields[] = new KTCheckboxWidget(_("Attach document"), _("By default, documents are sent as links into the document management system. Select this option if you want the document contents to be sent as an attachment in the email."), 'fAttachDocument', null, $this->oPage); 243 + $fields[] = new KTCheckboxWidget(_kt("Attach document"), _("By default, documents are sent as links into the document management system. Select this option if you want the document contents to be sent as an attachment in the email."), 'fAttachDocument', null, $this->oPage);
244 } 244 }
245 if ($bEmailAddresses) { 245 if ($bEmailAddresses) {
246 - $fields[] = new KTTextWidget(_("Email addresses"), _("Add extra email addresses here"), 'fEmailAddresses', "", $this->oPage, false, null, null, array('cols' => 60, 'rows' => 5)); 246 + $fields[] = new KTTextWidget(_kt("Email addresses"), _("Add extra email addresses here"), 'fEmailAddresses', "", $this->oPage, false, null, null, array('cols' => 60, 'rows' => 5));
247 } 247 }
248 - $fields[] = new KTTextWidget(_("Comment"), _("A message for those who receive the document"), 'fComment', "", $this->oPage, true, null, null, array('cols' => 60, 'rows' => 5)); 248 + $fields[] = new KTTextWidget(_kt("Comment"), _("A message for those who receive the document"), 'fComment', "", $this->oPage, true, null, null, array('cols' => 60, 'rows' => 5));
249 $aGroups = Group::getList(); 249 $aGroups = Group::getList();
250 $aUsers = User::getEmailUsers(); 250 $aUsers = User::getEmailUsers();
251 $aTemplateData = array( 251 $aTemplateData = array(
@@ -294,7 +294,7 @@ class KTDocumentEmailAction extends KTDocumentAction { @@ -294,7 +294,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
294 294
295 //if we're going to send a mail, first make there is someone to send it to 295 //if we're going to send a mail, first make there is someone to send it to
296 if ((count($aGroupIDs) == 0) && (count($aUserIDs) == 0) && (count($aEmailAddresses) == 0)) { 296 if ((count($aGroupIDs) == 0) && (count($aUserIDs) == 0) && (count($aEmailAddresses) == 0)) {
297 - $this->errorRedirectToMain(_('No recipients set'), sprintf('fDocumentId=%d', $this->oDocument->getId())); 297 + $this->errorRedirectToMain(_kt('No recipients set'), sprintf('fDocumentId=%d', $this->oDocument->getId()));
298 exit(0); 298 exit(0);
299 } 299 }
300 300
@@ -311,7 +311,7 @@ class KTDocumentEmailAction extends KTDocumentAction { @@ -311,7 +311,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
311 $_SESSION['KTErrorMessage'][] = join("<br />\n", $aEmailErrors); 311 $_SESSION['KTErrorMessage'][] = join("<br />\n", $aEmailErrors);
312 } 312 }
313 313
314 - $_SESSION['KTInfoMessage'][] = _("Email sent"); 314 + $_SESSION['KTInfoMessage'][] = _kt("Email sent");
315 //go back to the document view page 315 //go back to the document view page
316 controllerRedirect("viewDocument", sprintf("fDocumentId=%d", $this->oDocument->getId())); 316 controllerRedirect("viewDocument", sprintf("fDocumentId=%d", $this->oDocument->getId()));
317 } 317 }
plugins/ktstandard/KTSubscriptions.php
@@ -73,7 +73,7 @@ $oRegistry-&gt;registerPlugin(&#39;KTSubscriptionPlugin&#39;, &#39;ktstandard.subscriptions.plu @@ -73,7 +73,7 @@ $oRegistry-&gt;registerPlugin(&#39;KTSubscriptionPlugin&#39;, &#39;ktstandard.subscriptions.plu
73 // {{{ KTSubscriptionPortlet 73 // {{{ KTSubscriptionPortlet
74 class KTSubscriptionPortlet extends KTPortlet { 74 class KTSubscriptionPortlet extends KTPortlet {
75 function KTSubscriptionPortlet() { 75 function KTSubscriptionPortlet() {
76 - parent::KTPortlet(_("Subscriptions")); 76 + parent::KTPortlet(_kt("Subscriptions"));
77 } 77 }
78 78
79 function render() { 79 function render() {
@@ -108,7 +108,7 @@ class KTSubscriptionPortlet extends KTPortlet { @@ -108,7 +108,7 @@ class KTSubscriptionPortlet extends KTPortlet {
108 } 108 }
109 } 109 }
110 110
111 - $this->actions[] = array("name" => _("Manage subscriptions"), "url" => $this->oPlugin->getPagePath('manage')); 111 + $this->actions[] = array("name" => _kt("Manage subscriptions"), "url" => $this->oPlugin->getPagePath('manage'));
112 112
113 $oTemplating =& KTTemplating::getSingleton(); 113 $oTemplating =& KTTemplating::getSingleton();
114 $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet"); 114 $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet");
@@ -125,7 +125,7 @@ class KTDocumentSubscriptionAction extends KTDocumentAction { @@ -125,7 +125,7 @@ class KTDocumentSubscriptionAction extends KTDocumentAction {
125 var $sName = 'ktstandard.subscription.documentsubscription'; 125 var $sName = 'ktstandard.subscription.documentsubscription';
126 126
127 function getDisplayName() { 127 function getDisplayName() {
128 - return _('Subscribe to document'); 128 + return _kt('Subscribe to document');
129 } 129 }
130 130
131 function getInfo() { 131 function getInfo() {
@@ -138,14 +138,14 @@ class KTDocumentSubscriptionAction extends KTDocumentAction { @@ -138,14 +138,14 @@ class KTDocumentSubscriptionAction extends KTDocumentAction {
138 function do_main() { 138 function do_main() {
139 $iSubscriptionType = SubscriptionEvent::subTypes('Document'); 139 $iSubscriptionType = SubscriptionEvent::subTypes('Document');
140 if (Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) { 140 if (Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) {
141 - $_SESSION['KTErrorMessage'][] = _("You are already subscribed to that document"); 141 + $_SESSION['KTErrorMessage'][] = _kt("You are already subscribed to that document");
142 } else { 142 } else {
143 $oSubscription = new Subscription($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType); 143 $oSubscription = new Subscription($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType);
144 $res = $oSubscription->create(); 144 $res = $oSubscription->create();
145 if ($res) { 145 if ($res) {
146 - $_SESSION['KTInfoMessage'][] = _("You have been subscribed to this document"); 146 + $_SESSION['KTInfoMessage'][] = _kt("You have been subscribed to this document");
147 } else { 147 } else {
148 - $_SESSION['KTErrorMessage'][] = _("There was a problem subscribing you to this document"); 148 + $_SESSION['KTErrorMessage'][] = _kt("There was a problem subscribing you to this document");
149 } 149 }
150 } 150 }
151 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 151 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
@@ -159,7 +159,7 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction { @@ -159,7 +159,7 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction {
159 var $sName = 'ktstandard.subscription.documentunsubscription'; 159 var $sName = 'ktstandard.subscription.documentunsubscription';
160 160
161 function getDisplayName() { 161 function getDisplayName() {
162 - return _('Unsubscribe from document'); 162 + return _kt('Unsubscribe from document');
163 } 163 }
164 164
165 function getInfo() { 165 function getInfo() {
@@ -172,14 +172,14 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction { @@ -172,14 +172,14 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction {
172 function do_main() { 172 function do_main() {
173 $iSubscriptionType = SubscriptionEvent::subTypes('Document'); 173 $iSubscriptionType = SubscriptionEvent::subTypes('Document');
174 if (!Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) { 174 if (!Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) {
175 - $_SESSION['KTErrorMessage'][] = _("You were not subscribed to that document"); 175 + $_SESSION['KTErrorMessage'][] = _kt("You were not subscribed to that document");
176 } else { 176 } else {
177 $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType); 177 $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType);
178 $res = $oSubscription->delete(); 178 $res = $oSubscription->delete();
179 if ($res) { 179 if ($res) {
180 - $_SESSION['KTInfoMessage'][] = _("You have been unsubscribed from this document"); 180 + $_SESSION['KTInfoMessage'][] = _kt("You have been unsubscribed from this document");
181 } else { 181 } else {
182 - $_SESSION['KTErrorMessage'][] = _("There was a problem unsubscribing you from this document"); 182 + $_SESSION['KTErrorMessage'][] = _kt("There was a problem unsubscribing you from this document");
183 } 183 }
184 } 184 }
185 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); 185 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
@@ -297,7 +297,7 @@ class KTFolderSubscriptionAction extends KTFolderAction { @@ -297,7 +297,7 @@ class KTFolderSubscriptionAction extends KTFolderAction {
297 var $sName = 'ktstandard.subscription.foldersubscription'; 297 var $sName = 'ktstandard.subscription.foldersubscription';
298 298
299 function getDisplayName() { 299 function getDisplayName() {
300 - return _('Subscribe to folder'); 300 + return _kt('Subscribe to folder');
301 } 301 }
302 302
303 function getInfo() { 303 function getInfo() {
@@ -311,14 +311,14 @@ class KTFolderSubscriptionAction extends KTFolderAction { @@ -311,14 +311,14 @@ class KTFolderSubscriptionAction extends KTFolderAction {
311 function do_main() { 311 function do_main() {
312 $iSubscriptionType = SubscriptionEvent::subTypes('Folder'); 312 $iSubscriptionType = SubscriptionEvent::subTypes('Folder');
313 if (Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) { 313 if (Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) {
314 - $_SESSION['KTErrorMessage'][] = _("You are already subscribed to that folder"); 314 + $_SESSION['KTErrorMessage'][] = _kt("You are already subscribed to that folder");
315 } else { 315 } else {
316 $oSubscription = new Subscription($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType); 316 $oSubscription = new Subscription($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType);
317 $res = $oSubscription->create(); 317 $res = $oSubscription->create();
318 if ($res) { 318 if ($res) {
319 - $_SESSION['KTInfoMessage'][] = _("You have been subscribed to this folder"); 319 + $_SESSION['KTInfoMessage'][] = _kt("You have been subscribed to this folder");
320 } else { 320 } else {
321 - $_SESSION['KTErrorMessage'][] = _("There was a problem subscribing you to this folder"); 321 + $_SESSION['KTErrorMessage'][] = _kt("There was a problem subscribing you to this folder");
322 } 322 }
323 } 323 }
324 controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId()); 324 controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId());
@@ -332,7 +332,7 @@ class KTFolderUnsubscriptionAction extends KTFolderAction { @@ -332,7 +332,7 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
332 var $sName = 'ktstandard.subscription.folderunsubscription'; 332 var $sName = 'ktstandard.subscription.folderunsubscription';
333 333
334 function getDisplayName() { 334 function getDisplayName() {
335 - return _('Unsubscribe from folder'); 335 + return _kt('Unsubscribe from folder');
336 } 336 }
337 337
338 function getInfo() { 338 function getInfo() {
@@ -345,14 +345,14 @@ class KTFolderUnsubscriptionAction extends KTFolderAction { @@ -345,14 +345,14 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
345 function do_main() { 345 function do_main() {
346 $iSubscriptionType = SubscriptionEvent::subTypes('Folder'); 346 $iSubscriptionType = SubscriptionEvent::subTypes('Folder');
347 if (!Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) { 347 if (!Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) {
348 - $_SESSION['KTErrorMessage'][] = _("You were not subscribed to that folder"); 348 + $_SESSION['KTErrorMessage'][] = _kt("You were not subscribed to that folder");
349 } else { 349 } else {
350 $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType); 350 $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType);
351 $res = $oSubscription->delete(); 351 $res = $oSubscription->delete();
352 if ($res) { 352 if ($res) {
353 - $_SESSION['KTInfoMessage'][] = _("You have been unsubscribed from this folder"); 353 + $_SESSION['KTInfoMessage'][] = _kt("You have been unsubscribed from this folder");
354 } else { 354 } else {
355 - $_SESSION['KTErrorMessage'][] = _("There was a problem unsubscribing you from this folder"); 355 + $_SESSION['KTErrorMessage'][] = _kt("There was a problem unsubscribing you from this folder");
356 } 356 }
357 } 357 }
358 controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId()); 358 controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId());
@@ -364,7 +364,7 @@ class KTFolderUnsubscriptionAction extends KTFolderAction { @@ -364,7 +364,7 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
364 // {{{ KTSubscriptionManagePage 364 // {{{ KTSubscriptionManagePage
365 class KTSubscriptionManagePage extends KTStandardDispatcher { 365 class KTSubscriptionManagePage extends KTStandardDispatcher {
366 function do_main() { 366 function do_main() {
367 - $this->aBreadcrumbs[] = array("name" => _("Subscription Management")); 367 + $this->aBreadcrumbs[] = array("name" => _kt("Subscription Management"));
368 $aFolderSubscriptions = SubscriptionManager::retrieveUserSubscriptions( 368 $aFolderSubscriptions = SubscriptionManager::retrieveUserSubscriptions(
369 $this->oUser->getId(), SubscriptionEvent::subTypes('Folder')); 369 $this->oUser->getId(), SubscriptionEvent::subTypes('Folder'));
370 $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions( 370 $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions(
@@ -385,7 +385,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher { @@ -385,7 +385,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher {
385 $foldersubscriptions = KTUtil::arrayGet($_REQUEST, 'foldersubscriptions'); 385 $foldersubscriptions = KTUtil::arrayGet($_REQUEST, 'foldersubscriptions');
386 $documentsubscriptions = KTUtil::arrayGet($_REQUEST, 'documentsubscriptions'); 386 $documentsubscriptions = KTUtil::arrayGet($_REQUEST, 'documentsubscriptions');
387 if (empty($foldersubscriptions) && empty($documentsubscriptions)) { 387 if (empty($foldersubscriptions) && empty($documentsubscriptions)) {
388 - $this->errorRedirectToMain(_('No subscriptions were chosen')); 388 + $this->errorRedirectToMain(_kt('No subscriptions were chosen'));
389 } 389 }
390 390
391 $iSuccesses = 0; 391 $iSuccesses = 0;
@@ -415,9 +415,9 @@ class KTSubscriptionManagePage extends KTStandardDispatcher { @@ -415,9 +415,9 @@ class KTSubscriptionManagePage extends KTStandardDispatcher {
415 } 415 }
416 } 416 }
417 417
418 - $sMessage = _("Subscriptions removed") . ": "; 418 + $sMessage = _kt("Subscriptions removed") . ": ";
419 if ($iFailures) { 419 if ($iFailures) {
420 - $sMessage .= sprintf(_('%d successful, %d failures'), $iSuccesses, $iFailures); 420 + $sMessage .= sprintf(_kt('%d successful, %d failures'), $iSuccesses, $iFailures);
421 } else { 421 } else {
422 $sMessage .= sprintf('%d', $iSuccesses); 422 $sMessage .= sprintf('%d', $iSuccesses);
423 } 423 }
plugins/ktstandard/KTWorkflowAssociation.php
@@ -43,8 +43,8 @@ class KTWorkflowAssociationPlugin extends KTPlugin { @@ -43,8 +43,8 @@ class KTWorkflowAssociationPlugin extends KTPlugin {
43 $this->registerTrigger('edit', 'postValidate', 'KTWADEditTrigger', 43 $this->registerTrigger('edit', 'postValidate', 'KTWADEditTrigger',
44 'ktstandard.triggers.workflowassociation.editDocument'); 44 'ktstandard.triggers.workflowassociation.editDocument');
45 $this->registerAdminPage('workflow_allocation', 'WorkflowAllocationSelection', 45 $this->registerAdminPage('workflow_allocation', 'WorkflowAllocationSelection',
46 - 'documents', _('Automatic Workflow Assignments'),  
47 - _('Configure how documents are allocated to workflows.'), 'workflow/adminpage.php'); 46 + 'documents', _kt('Automatic Workflow Assignments'),
  47 + _kt('Configure how documents are allocated to workflows.'), 'workflow/adminpage.php');
48 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n'); 48 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
49 } 49 }
50 } 50 }
plugins/ktstandard/contents/OpenDocumentIndexer.php
@@ -85,7 +85,7 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { @@ -85,7 +85,7 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger {
85 if (empty($sUnzipCommand)) { 85 if (empty($sUnzipCommand)) {
86 return false; 86 return false;
87 } 87 }
88 - return _('Built-in'); 88 + return _kt('Built-in');
89 } 89 }
90 90
91 function findLocalCommand() { 91 function findLocalCommand() {
@@ -98,7 +98,7 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { @@ -98,7 +98,7 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger {
98 98
99 // can't find the local command. 99 // can't find the local command.
100 if (empty($sCommand)) { 100 if (empty($sCommand)) {
101 - return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url); 101 + return sprintf(_kt('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
102 } 102 }
103 103
104 return null; 104 return null;
plugins/ktstandard/contents/PdfIndexer.php
@@ -48,7 +48,7 @@ class KTPdfIndexerTrigger extends KTBaseIndexerTrigger { @@ -48,7 +48,7 @@ class KTPdfIndexerTrigger extends KTBaseIndexerTrigger {
48 48
49 // can't find the local command. 49 // can't find the local command.
50 if (empty($sCommand)) { 50 if (empty($sCommand)) {
51 - return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url); 51 + return sprintf(_kt('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
52 } 52 }
53 53
54 return null; 54 return null;
plugins/ktstandard/contents/PowerpointIndexer.php
@@ -45,7 +45,7 @@ class KTPowerpointIndexerTrigger extends KTBaseIndexerTrigger { @@ -45,7 +45,7 @@ class KTPowerpointIndexerTrigger extends KTBaseIndexerTrigger {
45 45
46 // can't find the local command. 46 // can't find the local command.
47 if (empty($sCommand)) { 47 if (empty($sCommand)) {
48 - return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url); 48 + return sprintf(_kt('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
49 } 49 }
50 50
51 return null; 51 return null;
plugins/ktstandard/contents/PsIndexer.php
@@ -47,7 +47,7 @@ class KTPostscriptIndexerTrigger extends KTBaseIndexerTrigger { @@ -47,7 +47,7 @@ class KTPostscriptIndexerTrigger extends KTBaseIndexerTrigger {
47 47
48 // can't find the local command. 48 // can't find the local command.
49 if (empty($sCommand)) { 49 if (empty($sCommand)) {
50 - return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url); 50 + return sprintf(_kt('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
51 } 51 }
52 52
53 return null; 53 return null;
plugins/ktstandard/contents/WordIndexer.php
@@ -62,7 +62,7 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger { @@ -62,7 +62,7 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger {
62 62
63 // can't find the local command. 63 // can't find the local command.
64 if (empty($sCommand)) { 64 if (empty($sCommand)) {
65 - return sprintf(_('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url); 65 + return sprintf(_kt('Unable to find required command for indexing. Please ensure that <strong>%s</strong> is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please <a href="%s">visit the KTDMS site</a>.'), $this->command, $this->support_url);
66 } 66 }
67 67
68 return null; 68 return null;
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
@@ -39,12 +39,12 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -39,12 +39,12 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
39 function KTLDAPBaseAuthenticationProvider() { 39 function KTLDAPBaseAuthenticationProvider() {
40 parent::KTAuthenticationProvider(); 40 parent::KTAuthenticationProvider();
41 $this->aConfigMap = array( 41 $this->aConfigMap = array(
42 - 'servername' => _('LDAP Server'),  
43 - 'basedn' => _('Base DN'),  
44 - 'searchuser' => _('LDAP Search User'),  
45 - 'searchpassword' => _('LDAP Search Password'),  
46 - 'searchattributes' => _('Search Attributes'),  
47 - 'objectclasses' => _('Object Classes'), 42 + 'servername' => _kt('LDAP Server'),
  43 + 'basedn' => _kt('Base DN'),
  44 + 'searchuser' => _kt('LDAP Search User'),
  45 + 'searchpassword' => _kt('LDAP Search Password'),
  46 + 'searchattributes' => _kt('Search Attributes'),
  47 + 'objectclasses' => _kt('Object Classes'),
48 ); 48 );
49 } 49 }
50 // }}} 50 // }}}
@@ -58,7 +58,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -58,7 +58,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
58 $sRet = "<dl>\n"; 58 $sRet = "<dl>\n";
59 foreach ($this->aConfigMap as $sSettingName => $sName) { 59 foreach ($this->aConfigMap as $sSettingName => $sName) {
60 $sRet .= " <dt>$sName</dt>\n"; 60 $sRet .= " <dt>$sName</dt>\n";
61 - $sValue = KTUtil::arrayGet($aConfig, $sSettingName, _("Unset")); 61 + $sValue = KTUtil::arrayGet($aConfig, $sSettingName, _kt("Unset"));
62 if (is_array($sValue)) { 62 if (is_array($sValue)) {
63 $sRet .= " <dd>" . join("<br />", $sValue) . "</dd>\n"; 63 $sRet .= " <dd>" . join("<br />", $sValue) . "</dd>\n";
64 } else { 64 } else {
@@ -72,7 +72,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -72,7 +72,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
72 72
73 // {{{ showUserSource 73 // {{{ showUserSource
74 function showUserSource($oUser, $oSource) { 74 function showUserSource($oUser, $oSource) {
75 - return '<a href="' . KTUtil::addQueryStringSelf('action=editUserSource&user_id=' . $oUser->getId()) . '">' . _('Edit LDAP info') . '</a>'; 75 + return '<a href="' . KTUtil::addQueryStringSelf('action=editUserSource&user_id=' . $oUser->getId()) . '">' . _kt('Edit LDAP info') . '</a>';
76 } 76 }
77 // }}} 77 // }}}
78 78
@@ -86,7 +86,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -86,7 +86,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
86 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); 86 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
87 $oUser =& $this->oValidator->validateUser($user_id); 87 $oUser =& $this->oValidator->validateUser($user_id);
88 88
89 - $this->oPage->setBreadcrumbDetails(_("editing LDAP details")); 89 + $this->oPage->setBreadcrumbDetails(_kt("editing LDAP details"));
90 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapedituser'); 90 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapedituser');
91 91
92 $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser); 92 $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser);
@@ -94,7 +94,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -94,7 +94,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
94 $dn = $oUser->getAuthenticationDetails(); 94 $dn = $oUser->getAuthenticationDetails();
95 95
96 $fields = array(); 96 $fields = array();
97 - $fields[] = new KTStringWidget(_('Distinguished name'), _('The location of this user in the LDAP tree'), 'dn', $dn, $this->oPage, true); 97 + $fields[] = new KTStringWidget(_kt('Distinguished name'), _('The location of this user in the LDAP tree'), 'dn', $dn, $this->oPage, true);
98 98
99 $aTemplateData = array( 99 $aTemplateData = array(
100 'context' => &$this, 100 'context' => &$this,
@@ -116,7 +116,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -116,7 +116,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
116 } 116 }
117 $oUser->setAuthenticationDetails($dn); 117 $oUser->setAuthenticationDetails($dn);
118 $oUser->update(); 118 $oUser->update();
119 - $this->successRedirectTo("editUser", _("Details updated"), 119 + $this->successRedirectTo("editUser", _kt("Details updated"),
120 sprintf('user_id=%d', $oUser->getId())); 120 sprintf('user_id=%d', $oUser->getId()));
121 } 121 }
122 // }}} 122 // }}}
@@ -124,7 +124,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -124,7 +124,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
124 // {{{ do_editSourceProvider 124 // {{{ do_editSourceProvider
125 function do_editSourceProvider() { 125 function do_editSourceProvider() {
126 require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php'); 126 require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php');
127 - $this->oPage->setBreadcrumbDetails(_("editing LDAP settings")); 127 + $this->oPage->setBreadcrumbDetails(_kt("editing LDAP settings"));
128 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapeditsource'); 128 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapeditsource');
129 $iSourceId = KTUtil::arrayGet($_REQUEST, 'source_id'); 129 $iSourceId = KTUtil::arrayGet($_REQUEST, 'source_id');
130 $oSource = KTAuthenticationSource::get($iSourceId); 130 $oSource = KTAuthenticationSource::get($iSourceId);
@@ -135,16 +135,16 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -135,16 +135,16 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
135 $aConfig['searchattributes'] = KTUtil::arrayGet($aConfig, 'searchattributes', split(',', 'cn,mail,sAMAccountName')); 135 $aConfig['searchattributes'] = KTUtil::arrayGet($aConfig, 'searchattributes', split(',', 'cn,mail,sAMAccountName'));
136 $aConfig['objectclasses'] = KTUtil::arrayGet($aConfig, 'objectclasses', split(',', 'user,inetOrgPerson,posixAccount')); 136 $aConfig['objectclasses'] = KTUtil::arrayGet($aConfig, 'objectclasses', split(',', 'user,inetOrgPerson,posixAccount'));
137 $fields = array(); 137 $fields = array();
138 - $fields[] = new KTStringWidget(_('Server name'), 'The host name or IP address of the LDAP server', 'servername', $aConfig['servername'], $this->oPage, true);  
139 - $fields[] = new KTStringWidget(_('Base DN'), 'The location in the LDAP directory to start searching from (CN=Users,DC=mycorp,DC=com)', 'basedn', $aConfig['basedn'], $this->oPage, true);  
140 - $fields[] = new KTStringWidget(_('Search User'), 'The user account in the LDAP directory to perform searches in the LDAP directory as (such as CN=searchUser,CN=Users,DC=mycorp,DC=com or searchUser@mycorp.com)', 'searchuser', $aConfig['searchuser'], $this->oPage, true);  
141 - $fields[] = new KTStringWidget(_('Search Password'), 'The password for the user account in the LDAP directory that performs searches', 'searchpassword', $aConfig['searchpassword'], $this->oPage, true); 138 + $fields[] = new KTStringWidget(_kt('Server name'), 'The host name or IP address of the LDAP server', 'servername', $aConfig['servername'], $this->oPage, true);
  139 + $fields[] = new KTStringWidget(_kt('Base DN'), 'The location in the LDAP directory to start searching from (CN=Users,DC=mycorp,DC=com)', 'basedn', $aConfig['basedn'], $this->oPage, true);
  140 + $fields[] = new KTStringWidget(_kt('Search User'), 'The user account in the LDAP directory to perform searches in the LDAP directory as (such as CN=searchUser,CN=Users,DC=mycorp,DC=com or searchUser@mycorp.com)', 'searchuser', $aConfig['searchuser'], $this->oPage, true);
  141 + $fields[] = new KTStringWidget(_kt('Search Password'), 'The password for the user account in the LDAP directory that performs searches', 'searchpassword', $aConfig['searchpassword'], $this->oPage, true);
142 $aOptions = array( 142 $aOptions = array(
143 'rows' => 7, 143 'rows' => 7,
144 'cols' => 25, 144 'cols' => 25,
145 ); 145 );
146 - $fields[] = new KTTextWidget(_('Search Attributes'), 'The LDAP attributes to use to search for users when given their name (one per line, examples: <strong>cn</strong>, <strong>mail</strong>)', 'searchattributes_nls', join("\n", $aConfig['searchattributes']), $this->oPage, true, null, null, $aOptions);  
147 - $fields[] = new KTTextWidget(_('Object Classes'), 'The LDAP object classes to search for users (one per line, example: <strong>user</strong>, <strong>inetOrgPerson</strong>, <strong>posixAccount</strong>)', 'objectclasses_nls', join("\n", $aConfig['objectclasses']), $this->oPage, true, null, null, $aOptions); 146 + $fields[] = new KTTextWidget(_kt('Search Attributes'), 'The LDAP attributes to use to search for users when given their name (one per line, examples: <strong>cn</strong>, <strong>mail</strong>)', 'searchattributes_nls', join("\n", $aConfig['searchattributes']), $this->oPage, true, null, null, $aOptions);
  147 + $fields[] = new KTTextWidget(_kt('Object Classes'), 'The LDAP object classes to search for users (one per line, example: <strong>user</strong>, <strong>inetOrgPerson</strong>, <strong>posixAccount</strong>)', 'objectclasses_nls', join("\n", $aConfig['objectclasses']), $this->oPage, true, null, null, $aOptions);
148 $aTemplateData = array( 148 $aTemplateData = array(
149 'context' => &$this, 149 'context' => &$this,
150 'fields' => $fields, 150 'fields' => $fields,
@@ -183,7 +183,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -183,7 +183,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
183 } 183 }
184 $oSource->setConfig(serialize($aConfig)); 184 $oSource->setConfig(serialize($aConfig));
185 $res = $oSource->update(); 185 $res = $oSource->update();
186 - $this->successRedirectTo('viewsource', _("Configuration updated"), 'source_id=' . $oSource->getId()); 186 + $this->successRedirectTo('viewsource', _kt("Configuration updated"), 'source_id=' . $oSource->getId());
187 } 187 }
188 // }}} 188 // }}}
189 189
@@ -204,18 +204,18 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -204,18 +204,18 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
204 $oAuthenticator = $this->getAuthenticator($oSource); 204 $oAuthenticator = $this->getAuthenticator($oSource);
205 $aResults = $oAuthenticator->getUser($id); 205 $aResults = $oAuthenticator->getUser($id);
206 $aErrorOptions = array( 206 $aErrorOptions = array(
207 - 'message' => _('Could not find user in LDAP server'), 207 + 'message' => _kt('Could not find user in LDAP server'),
208 ); 208 );
209 $this->oValidator->notError($aResults); 209 $this->oValidator->notError($aResults);
210 210
211 $fields = array(); 211 $fields = array();
212 - $fields[] = new KTStaticTextWidget(_('LDAP DN'), _('The location of the user within the LDAP directory.'), 'dn', $id, $this->oPage);  
213 - $fields[] = new KTStringWidget(_('Username'), _('The username the user will enter to gain access to KnowledgeTree. e.g. <strong>jsmith</strong>'), 'ldap_username', $aResults[$this->aAttributes[1]], $this->oPage, true);  
214 - $fields[] = new KTStringWidget(_('Name'), _('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $aResults[$this->aAttributes[0]], $this->oPage, true);  
215 - $fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $aResults[$this->aAttributes[4]], $this->oPage, false);  
216 - $fields[] = new KTCheckboxWidget(_('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', true, $this->oPage, false);  
217 - $fields[] = new KTStringWidget(_('Mobile Number'), _('The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will have an SMS delivered to it with notifications. e.g. <strong>999 9999 999</strong>'), 'mobile_number', $aResults[$this->aAttributes[5]], $this->oPage, false);  
218 - $fields[] = new KTStringWidget(_('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true); 212 + $fields[] = new KTStaticTextWidget(_kt('LDAP DN'), _('The location of the user within the LDAP directory.'), 'dn', $id, $this->oPage);
  213 + $fields[] = new KTStringWidget(_kt('Username'), _('The username the user will enter to gain access to KnowledgeTree. e.g. <strong>jsmith</strong>'), 'ldap_username', $aResults[$this->aAttributes[1]], $this->oPage, true);
  214 + $fields[] = new KTStringWidget(_kt('Name'), _('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $aResults[$this->aAttributes[0]], $this->oPage, true);
  215 + $fields[] = new KTStringWidget(_kt('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $aResults[$this->aAttributes[4]], $this->oPage, false);
  216 + $fields[] = new KTCheckboxWidget(_kt('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', true, $this->oPage, false);
  217 + $fields[] = new KTStringWidget(_kt('Mobile Number'), _('The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will have an SMS delivered to it with notifications. e.g. <strong>999 9999 999</strong>'), 'mobile_number', $aResults[$this->aAttributes[5]], $this->oPage, false);
  218 + $fields[] = new KTStringWidget(_kt('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true);
219 219
220 $aTemplateData = array( 220 $aTemplateData = array(
221 'context' => &$this, 221 'context' => &$this,
@@ -235,9 +235,9 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -235,9 +235,9 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
235 $dn = KTUtil::arrayGet($_REQUEST, 'dn'); 235 $dn = KTUtil::arrayGet($_REQUEST, 'dn');
236 $samaccountname = KTUtil::arrayGet($_REQUEST, 'samaccountname'); 236 $samaccountname = KTUtil::arrayGet($_REQUEST, 'samaccountname');
237 $name = KTUtil::arrayGet($_REQUEST, 'name'); 237 $name = KTUtil::arrayGet($_REQUEST, 'name');
238 - if (empty($name)) { $this->errorRedirectToMain(_('You must specify a name for the user.')); } 238 + if (empty($name)) { $this->errorRedirectToMain(_kt('You must specify a name for the user.')); }
239 $username = KTUtil::arrayGet($_REQUEST, 'ldap_username'); 239 $username = KTUtil::arrayGet($_REQUEST, 'ldap_username');
240 - if (empty($name)) { $this->errorRedirectToMain(_('You must specify a new username.')); } 240 + if (empty($name)) { $this->errorRedirectToMain(_kt('You must specify a new username.')); }
241 // FIXME check for non-clashing usernames. 241 // FIXME check for non-clashing usernames.
242 242
243 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address'); 243 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address');
@@ -261,11 +261,11 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -261,11 +261,11 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
261 )); 261 ));
262 262
263 if (PEAR::isError($oUser) || ($oUser == false)) { 263 if (PEAR::isError($oUser) || ($oUser == false)) {
264 - $this->errorRedirectToMain(_("failed to create user.")); 264 + $this->errorRedirectToMain(_kt("failed to create user."));
265 exit(0); 265 exit(0);
266 } 266 }
267 267
268 - $this->successRedirectToMain(_('Created new user') . ': ' . $oUser->getUsername()); 268 + $this->successRedirectToMain(_kt('Created new user') . ': ' . $oUser->getUsername());
269 exit(0); 269 exit(0);
270 } 270 }
271 // }}} 271 // }}}
@@ -298,7 +298,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -298,7 +298,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
298 )); 298 ));
299 $aNames[] = $sName; 299 $aNames[] = $sName;
300 } 300 }
301 - $this->successRedirectToMain(_("Added users") . ": " . join(', ', $aNames)); 301 + $this->successRedirectToMain(_kt("Added users") . ": " . join(', ', $aNames));
302 } 302 }
303 // }}} 303 // }}}
304 304
@@ -318,7 +318,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -318,7 +318,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
318 return $this->_do_editUserFromSource(); 318 return $this->_do_editUserFromSource();
319 } 319 }
320 } else { 320 } else {
321 - $this->oPage->addError(_("No valid LDAP user chosen")); 321 + $this->oPage->addError(_kt("No valid LDAP user chosen"));
322 } 322 }
323 } 323 }
324 if (KTUtil::arrayGet($submit, 'create')) { 324 if (KTUtil::arrayGet($submit, 'create')) {
@@ -328,8 +328,8 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -328,8 +328,8 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
328 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchuser'); 328 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchuser');
329 329
330 $fields = array(); 330 $fields = array();
331 - $fields[] = new KTStringWidget(_("User's name"), _("The user's name, or part thereof, to find the user that you wish to add"), 'ldap_name', '', $this->oPage, true);  
332 - $fields[] = new KTCheckboxWidget(_("Mass import"), _("Allow for multiple users to be selected to be added (will not get to manually verify the details if selected)"), 'massimport', false, $this->oPage, true); 331 + $fields[] = new KTStringWidget(_kt("User's name"), _("The user's name, or part thereof, to find the user that you wish to add"), 'ldap_name', '', $this->oPage, true);
  332 + $fields[] = new KTCheckboxWidget(_kt("Mass import"), _("Allow for multiple users to be selected to be added (will not get to manually verify the details if selected)"), 'massimport', false, $this->oPage, true);
333 333
334 $oAuthenticator = $this->getAuthenticator($oSource); 334 $oAuthenticator = $this->getAuthenticator($oSource);
335 $name = KTUtil::arrayGet($_REQUEST, 'ldap_name'); 335 $name = KTUtil::arrayGet($_REQUEST, 'ldap_name');
@@ -366,7 +366,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -366,7 +366,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
366 if (!empty($id)) { 366 if (!empty($id)) {
367 return $this->_do_editGroupFromSource(); 367 return $this->_do_editGroupFromSource();
368 } else { 368 } else {
369 - $this->oPage->addError(_("No valid LDAP group chosen")); 369 + $this->oPage->addError(_kt("No valid LDAP group chosen"));
370 } 370 }
371 } 371 }
372 if (KTUtil::arrayGet($submit, 'create')) { 372 if (KTUtil::arrayGet($submit, 'create')) {
@@ -376,7 +376,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -376,7 +376,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
376 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchgroup'); 376 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchgroup');
377 377
378 $fields = array(); 378 $fields = array();
379 - $fields[] = new KTStringWidget(_("Group's name"), _("The group's name, or part thereof, to find the group that you wish to add"), 'name', '', $this->oPage, true); 379 + $fields[] = new KTStringWidget(_kt("Group's name"), _("The group's name, or part thereof, to find the group that you wish to add"), 'name', '', $this->oPage, true);
380 380
381 $oAuthenticator = $this->getAuthenticator($oSource); 381 $oAuthenticator = $this->getAuthenticator($oSource);
382 $name = KTUtil::arrayGet($_REQUEST, 'name'); 382 $name = KTUtil::arrayGet($_REQUEST, 'name');
@@ -408,10 +408,10 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -408,10 +408,10 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
408 $aAttributes = $oAuthenticator->getGroup($id); 408 $aAttributes = $oAuthenticator->getGroup($id);
409 409
410 $fields = array(); 410 $fields = array();
411 - $fields[] = new KTStaticTextWidget(_('LDAP DN'), _('The location of the group within the LDAP directory.'), 'dn', $aAttributes['dn'], $this->oPage);  
412 - $fields[] = new KTStringWidget(_('Group Name'), _('The name the group will enter to gain access to KnowledgeTree. e.g. <strong>accountants</strong>'), 'ldap_groupname', $aAttributes['cn'], $this->oPage, true);  
413 - $fields[] = new KTCheckboxWidget(_('Unit Administrators'),_('Should all the members of this group be given <strong>unit</strong> administration privileges?'), 'is_unitadmin', false, $this->oPage, false);  
414 - $fields[] = new KTCheckboxWidget(_('System Administrators'),_('Should all the members of this group be given <strong>system</strong> administration privileges?'), 'is_sysadmin', false, $this->oPage, false); 411 + $fields[] = new KTStaticTextWidget(_kt('LDAP DN'), _('The location of the group within the LDAP directory.'), 'dn', $aAttributes['dn'], $this->oPage);
  412 + $fields[] = new KTStringWidget(_kt('Group Name'), _('The name the group will enter to gain access to KnowledgeTree. e.g. <strong>accountants</strong>'), 'ldap_groupname', $aAttributes['cn'], $this->oPage, true);
  413 + $fields[] = new KTCheckboxWidget(_kt('Unit Administrators'), _('Should all the members of this group be given <strong>unit</strong> administration privileges?'), 'is_unitadmin', false, $this->oPage, false);
  414 + $fields[] = new KTCheckboxWidget(_kt('System Administrators'), _('Should all the members of this group be given <strong>system</strong> administration privileges?'), 'is_sysadmin', false, $this->oPage, false);
415 415
416 $aTemplateData = array( 416 $aTemplateData = array(
417 'context' => &$this, 417 'context' => &$this,
@@ -429,7 +429,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -429,7 +429,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
429 $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); 429 $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']);
430 $dn = KTUtil::arrayGet($_REQUEST, 'dn'); 430 $dn = KTUtil::arrayGet($_REQUEST, 'dn');
431 $name = KTUtil::arrayGet($_REQUEST, 'ldap_groupname'); 431 $name = KTUtil::arrayGet($_REQUEST, 'ldap_groupname');
432 - if (empty($name)) { $this->errorRedirectToMain(_('You must specify a name for the group.')); } 432 + if (empty($name)) { $this->errorRedirectToMain(_kt('You must specify a name for the group.')); }
433 433
434 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false); 434 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false);
435 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false); 435 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false);
@@ -443,14 +443,14 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { @@ -443,14 +443,14 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
443 )); 443 ));
444 444
445 if (PEAR::isError($oGroup) || ($oGroup == false)) { 445 if (PEAR::isError($oGroup) || ($oGroup == false)) {
446 - $this->errorRedirectToMain(_("failed to create group.")); 446 + $this->errorRedirectToMain(_kt("failed to create group."));
447 exit(0); 447 exit(0);
448 } 448 }
449 449
450 $oAuthenticator = $this->getAuthenticator($oSource); 450 $oAuthenticator = $this->getAuthenticator($oSource);
451 $oAuthenticator->synchroniseGroup($oGroup); 451 $oAuthenticator->synchroniseGroup($oGroup);
452 452
453 - $this->successRedirectToMain(_('Created new group') . ': ' . $oGroup->getName()); 453 + $this->successRedirectToMain(_kt('Created new group') . ': ' . $oGroup->getName());
454 exit(0); 454 exit(0);
455 } 455 }
456 // }}} 456 // }}}
plugins/ktstandard/workflow/FolderAssociator.php
@@ -82,18 +82,18 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction { @@ -82,18 +82,18 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
82 var $_sShowPermission = "ktcore.permissions.addFolder"; 82 var $_sShowPermission = "ktcore.permissions.addFolder";
83 83
84 function getDisplayName() { 84 function getDisplayName() {
85 - return _('Configure Workflows'); 85 + return _kt('Configure Workflows');
86 } 86 }
87 87
88 function do_main() { 88 function do_main() {
89 - $this->oPage->setBreadcrumbDetails(_("Configure Workflows for Folder"));  
90 - $this->oPage->setTitle(_("Configure Workflows for Folder")); 89 + $this->oPage->setBreadcrumbDetails(_kt("Configure Workflows for Folder"));
  90 + $this->oPage->setTitle(_kt("Configure Workflows for Folder"));
91 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/workflow/folderconfigure'); 91 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/workflow/folderconfigure');
92 $fields = array(); 92 $fields = array();
93 93
94 $aWorkflows = KTWorkflow::getList('start_state_id IS NOT NULL'); 94 $aWorkflows = KTWorkflow::getList('start_state_id IS NOT NULL');
95 $aVocab = array(); 95 $aVocab = array();
96 - $aVocab[] = _('No automatic workflow.'); 96 + $aVocab[] = _kt('No automatic workflow.');
97 foreach ($aWorkflows as $oWorkflow) { 97 foreach ($aWorkflows as $oWorkflow) {
98 $aVocab[$oWorkflow->getId()] = $oWorkflow->getName(); 98 $aVocab[$oWorkflow->getId()] = $oWorkflow->getName();
99 } 99 }
@@ -107,7 +107,7 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction { @@ -107,7 +107,7 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
107 if (PEAR::isError($res)) { 107 if (PEAR::isError($res)) {
108 $res = null; 108 $res = null;
109 } 109 }
110 - $fields[] = new KTLookupWidget(_('Automatic Workflow'), _('If you specify an automatic workflow, new documents will automatically enter that workflows starting state. Setting this to "No Automatic Workflow" will mean that users can choose the appropriate workflow.'), 'fWorkflowId', $res, $this->oPage, true, null, $fieldErrors, $fieldOptions); 110 + $fields[] = new KTLookupWidget(_kt('Automatic Workflow'), _('If you specify an automatic workflow, new documents will automatically enter that workflows starting state. Setting this to "No Automatic Workflow" will mean that users can choose the appropriate workflow.'), 'fWorkflowId', $res, $this->oPage, true, null, $fieldErrors, $fieldOptions);
111 111
112 112
113 $oTemplate->setData(array( 113 $oTemplate->setData(array(
@@ -128,7 +128,7 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction { @@ -128,7 +128,7 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
128 DBUtil::runQuery(array($sQuery, $aParams)); 128 DBUtil::runQuery(array($sQuery, $aParams));
129 129
130 if (is_null($fWorkflowId)) { 130 if (is_null($fWorkflowId)) {
131 - $this->successRedirectToMain(_('Workflow assignment removed.'), 'fFolderId='.$this->oFolder->getId()); 131 + $this->successRedirectToMain(_kt('Workflow assignment removed.'), 'fFolderId='.$this->oFolder->getId());
132 } 132 }
133 133
134 $aOptions = array('noid' => true); 134 $aOptions = array('noid' => true);
@@ -140,10 +140,10 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction { @@ -140,10 +140,10 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
140 ), $aOptions); 140 ), $aOptions);
141 141
142 if (PEAR::isError($res)) { 142 if (PEAR::isError($res)) {
143 - $this->errorRedirectToMain(_('Error assigning workflow.'), 'fFolderId='.$this->oFolder->getId()); 143 + $this->errorRedirectToMain(_kt('Error assigning workflow.'), 'fFolderId='.$this->oFolder->getId());
144 } 144 }
145 145
146 - $this->successRedirectToMain(_('Workflow assignment updated.'), 'fFolderId='.$this->oFolder->getId()); 146 + $this->successRedirectToMain(_kt('Workflow assignment updated.'), 'fFolderId='.$this->oFolder->getId());
147 } 147 }
148 148
149 } 149 }
plugins/ktstandard/workflow/TypeAssociator.php
@@ -44,8 +44,8 @@ class KTDocTypeWorkflowAssociationPlugin extends KTPlugin { @@ -44,8 +44,8 @@ class KTDocTypeWorkflowAssociationPlugin extends KTPlugin {
44 44
45 if ($res == 'ktstandard.triggers.workflowassociation.documenttype.handler') { 45 if ($res == 'ktstandard.triggers.workflowassociation.documenttype.handler') {
46 $this->registerAdminPage('workflow_type_allocation', 'WorkflowTypeAllocationDispatcher', 46 $this->registerAdminPage('workflow_type_allocation', 'WorkflowTypeAllocationDispatcher',
47 - 'documents', _('Workflow Allocation by Document Types'),  
48 - _('This installation assigns workflows by Document Type. Configure this process here.'), __FILE__); 47 + 'documents', _kt('Workflow Allocation by Document Types'),
  48 + _kt('This installation assigns workflows by Document Type. Configure this process here.'), __FILE__);
49 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n'); 49 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
50 } 50 }
51 51
@@ -83,7 +83,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher { @@ -83,7 +83,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher {
83 $res = parent::check(); 83 $res = parent::check();
84 if (!$res) { return false; } 84 if (!$res) { return false; }
85 85
86 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name'=> _('Workflow Allocation by Document Types')); 86 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name'=> _kt('Workflow Allocation by Document Types'));
87 87
88 return true; 88 return true;
89 } 89 }
@@ -97,7 +97,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher { @@ -97,7 +97,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher {
97 97
98 $aTypeMapping = array(); 98 $aTypeMapping = array();
99 if (PEAR::isError($res)) { 99 if (PEAR::isError($res)) {
100 - $this->oPage->addError(_('Failed to get type mapping: ') . $res->getMessage()); 100 + $this->oPage->addError(_kt('Failed to get type mapping: ') . $res->getMessage());
101 } else { 101 } else {
102 foreach ($res as $aRow) { 102 foreach ($res as $aRow) {
103 $aTypeMapping[$aRow['document_type_id']] = $aRow['workflow_id']; 103 $aTypeMapping[$aRow['document_type_id']] = $aRow['workflow_id'];
@@ -142,7 +142,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher { @@ -142,7 +142,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher {
142 ), $aOptions); 142 ), $aOptions);
143 } 143 }
144 144
145 - $this->successRedirectToMain(_('Type mapping updated.')); 145 + $this->successRedirectToMain(_kt('Type mapping updated.'));
146 } 146 }
147 } 147 }
148 148
plugins/ktstandard/workflow/adminpage.php
@@ -40,7 +40,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher { @@ -40,7 +40,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher {
40 $res = parent::check(); 40 $res = parent::check();
41 if (!$res) { return false; } 41 if (!$res) { return false; }
42 42
43 - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name'=> _('Automatic Workflow Assignments')); 43 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name'=> _kt('Automatic Workflow Assignments'));
44 44
45 return true; 45 return true;
46 } 46 }
@@ -55,7 +55,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher { @@ -55,7 +55,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher {
55 foreach ($aTriggers as $aTrigger) { 55 foreach ($aTriggers as $aTrigger) {
56 $aVocab[$aTrigger[2]] = $aTrigger[0]; 56 $aVocab[$aTrigger[2]] = $aTrigger[0];
57 } 57 }
58 - $aFields[] = new KTLookupWidget(_('Workflow Plugins'), _('Plugins providing workflow allocators.'),'selection_ns', $this->getHandler(), $this->oPage, true, null, null, array('vocab' => $aVocab)); 58 + $aFields[] = new KTLookupWidget(_kt('Workflow Plugins'), _('Plugins providing workflow allocators.'),'selection_ns', $this->getHandler(), $this->oPage, true, null, null, array('vocab' => $aVocab));
59 59
60 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/workflow/allocator_selection'); 60 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/workflow/allocator_selection');
61 $oTemplate->setData(array( 61 $oTemplate->setData(array(
@@ -84,10 +84,10 @@ class WorkflowAllocationSelection extends KTAdminDispatcher { @@ -84,10 +84,10 @@ class WorkflowAllocationSelection extends KTAdminDispatcher {
84 $sQuery .= ' WHERE event_ns = ?'; 84 $sQuery .= ' WHERE event_ns = ?';
85 $aParams = array('ktstandard.workflowassociation.handler'); 85 $aParams = array('ktstandard.workflowassociation.handler');
86 DBUtil::runQuery(array($sQuery, $aParams)); 86 DBUtil::runQuery(array($sQuery, $aParams));
87 - $this->successRedirectToMain(_('Handler removed.')); 87 + $this->successRedirectToMain(_kt('Handler removed.'));
88 } else { 88 } else {
89 if (!array_key_exists($selection_ns, $aTriggers)) { 89 if (!array_key_exists($selection_ns, $aTriggers)) {
90 - $this->errorRedirectToMain(_('Invalid assignment')); 90 + $this->errorRedirectToMain(_kt('Invalid assignment'));
91 } 91 }
92 92
93 93
@@ -103,7 +103,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher { @@ -103,7 +103,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher {
103 $sQuery .= ' VALUES ("ktstandard.workflowassociation.handler",?)'; 103 $sQuery .= ' VALUES ("ktstandard.workflowassociation.handler",?)';
104 $aParams = array($selection_ns); 104 $aParams = array($selection_ns);
105 DBUtil::runQuery(array($sQuery, $aParams)); 105 DBUtil::runQuery(array($sQuery, $aParams));
106 - $this->successRedirectToMain(_('Handler set.')); 106 + $this->successRedirectToMain(_kt('Handler set.'));
107 } 107 }
108 } 108 }
109 } 109 }