Commit 9cfb1dee0d2cf726d69e36d04845cefa5c531e44

Authored by Neil Blakey-Milner
1 parent b37c493e

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 65 $this->registerDashlet('KTCheckoutDashlet', 'ktcore.dashlet.checkout', 'KTDashlets.php');
66 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 70 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
71 71  
... ... @@ -88,83 +88,83 @@ class KTCorePlugin extends KTPlugin {
88 88  
89 89 function setupAdmin() {
90 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 104 // users and groups
105 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 107 'admin/userManagement.php', null);
108 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 110 'admin/groupManagement.php', null);
111 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 113 'admin/unitManagement.php', null);
114 114  
115 115 // security
116 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 118 $this->registerAdminPage("roles", 'RoleAdminDispatcher', "security",
119   - _("Roles"), _("Create or delete roles"),
  119 + _kt("Roles"), _("Create or delete roles"),
120 120 'admin/roleManagement.php', null);
121 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 124 'admin/conditions.php', null);
125 125  
126 126 // documents
127 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 130 'admin/documentTypes.php', null);
131 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 134 'admin/documentFields.php', null);
135 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 138 'admin/documentLinks.php', null);
139 139 $this->registerAdminPage("workflows", 'KTWorkflowDispatcher', 'documents',
140   - _('Workflows'), _('Configure the process documents go through.'),
  140 + _kt('Workflows'), _('Configure the process documents go through.'),
141 141 'admin/workflows.php', null);
142 142  
143 143 // storage
144 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 147 'admin/documentCheckout.php', null);
148 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 150 'admin/archivedDocuments.php', null);
151 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 153 'admin/deletedDocuments.php', null);
154 154  
155 155 // misc
156 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 158 'admin/manageHelp.php', null);
159 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 162 'admin/savedSearch.php', null);
163 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 165 'admin/plugins.php', null);
166 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 168 'admin/techsupport.php', null);
169 169 // plugins
170 170  
... ...
plugins/ktcore/KTDocumentActions.php
... ... @@ -42,12 +42,12 @@ class KTDocumentDetailsAction extends KTDocumentAction {
42 42 var $sName = 'ktcore.actions.document.displaydetails';
43 43  
44 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 46 exit(0);
47 47 }
48 48  
49 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 57 var $sName = 'ktcore.actions.document.view';
58 58  
59 59 function getDisplayName() {
60   - return _('Download');
  60 + return _kt('Download');
61 61 }
62 62  
63 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 65 return $aInfo;
66 66 }
67 67  
... ... @@ -90,7 +90,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
90 90 var $_sShowPermission = "ktcore.permissions.write";
91 91  
92 92 function getDisplayName() {
93   - return _('Checkout');
  93 + return _kt('Checkout');
94 94 }
95 95  
96 96 function getInfo() {
... ... @@ -112,7 +112,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
112 112  
113 113 // "normal".
114 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 116 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
117 117 exit(0);
118 118 }
... ... @@ -123,7 +123,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
123 123 $this->oPage->setBreadcrumbDetails("checkout");
124 124 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout');
125 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 128 $oTemplate->setData(array(
129 129 'context' => &$this,
... ... @@ -144,7 +144,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
144 144 $this->startTransaction();
145 145 $res = KTDocumentUtil::checkout($this->oDocument, $sReason, $this->oUser);
146 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 150 $this->commitTransaction();
... ... @@ -174,7 +174,7 @@ class KTDocumentCheckInAction extends KTDocumentAction {
174 174 var $_sShowPermission = "ktcore.permissions.write";
175 175  
176 176 function getDisplayName() {
177   - return _('Checkin');
  177 + return _kt('Checkin');
178 178 }
179 179  
180 180 function getInfo() {
... ... @@ -194,12 +194,12 @@ class KTDocumentCheckInAction extends KTDocumentAction {
194 194 return $res;
195 195 }
196 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 198 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
199 199 exit(0);
200 200 }
201 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 203 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
204 204 exit(0);
205 205 }
... ... @@ -212,8 +212,8 @@ class KTDocumentCheckInAction extends KTDocumentAction {
212 212  
213 213 $sReason = KTUtil::arrayGet($_REQUEST, 'reason', "");
214 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 218 $oTemplate->setData(array(
219 219 'context' => &$this,
... ... @@ -228,19 +228,19 @@ class KTDocumentCheckInAction extends KTDocumentAction {
228 228  
229 229 // make sure the user actually selected a file first
230 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 234 // and that the filename matches
235 235 global $default;
236 236 $default->log->info("checkInDocumentBL.php uploaded filename=" . $_FILES['file']['name'] . "; current filename=" . $this->oDocument->getFileName());
237 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 241 $res = KTDocumentUtil::checkin($this->oDocument, $_FILES['file']['tmp_name'], $sReason, $this->oUser);
242 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 245 redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID());
246 246 }
... ... @@ -255,7 +255,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
255 255 var $_sShowPermission = "ktcore.permissions.write";
256 256  
257 257 function getDisplayName() {
258   - return _('Cancel Checkout');
  258 + return _kt('Cancel Checkout');
259 259 }
260 260  
261 261 function getInfo() {
... ... @@ -275,12 +275,12 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
275 275 return $res;
276 276 }
277 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 279 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
280 280 exit(0);
281 281 }
282 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 284 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
285 285 exit(0);
286 286 }
... ... @@ -293,7 +293,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
293 293  
294 294 $sReason = KTUtil::arrayGet($_REQUEST, 'reason', "");
295 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 298 $oTemplate->setData(array(
299 299 'context' => &$this,
... ... @@ -315,7 +315,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
315 315 $this->oDocument->setCheckedOutUserID(-1);
316 316 if (!$this->oDocument->update()) {
317 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 321 // checkout cancelled transaction
... ... @@ -323,7 +323,7 @@ class KTDocumentCancelCheckOutAction extends KTDocumentAction {
323 323 $res = $oDocumentTransaction->create();
324 324 if (PEAR::isError($res) || ($res == false)) {
325 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 328 $this->commitTransaction(); // FIXME do we want to do this if we can't created the document-transaction?
329 329 redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID());
... ... @@ -346,7 +346,7 @@ class KTDocumentEditAction extends KTDocumentAction {
346 346 }
347 347  
348 348 function getDisplayName() {
349   - return _('Edit metadata');
  349 + return _kt('Edit metadata');
350 350 }
351 351  
352 352 function getURL() {
... ... @@ -362,7 +362,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
362 362 var $_sShowPermission = "ktcore.permissions.delete";
363 363  
364 364 function getDisplayName() {
365   - return _('Delete');
  365 + return _kt('Delete');
366 366 }
367 367  
368 368 function getInfo() {
... ... @@ -378,7 +378,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
378 378 return $res;
379 379 }
380 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 382 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
383 383 exit(0);
384 384 }
... ... @@ -389,7 +389,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
389 389 $this->oPage->setBreadcrumbDetails("delete");
390 390 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete');
391 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 394 $oTemplate->setData(array(
395 395 'context' => &$this,
... ... @@ -410,7 +410,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
410 410 $_SESSION['KTErrorMessage'][] = $res->getMessage();
411 411 controllerRedirect('viewDocument',sprintf('fDocumentId=%d', $this->oDocument->getId()));
412 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 438 var $_sShowPermission = "ktcore.permissions.write";
439 439  
440 440 function getDisplayName() {
441   - return _('Move');
  441 + return _kt('Move');
442 442 }
443 443  
444 444 function getInfo() {
... ... @@ -454,7 +454,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
454 454 return $res;
455 455 }
456 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 458 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
459 459 exit(0);
460 460 }
... ... @@ -465,13 +465,13 @@ class KTDocumentMoveAction extends KTDocumentAction {
465 465 }
466 466  
467 467 function do_main() {
468   - $this->oPage->setBreadcrumbDetails(_("move"));
  468 + $this->oPage->setBreadcrumbDetails(_kt("move"));
469 469 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move');
470 470 $move_fields = array();
471 471 $aNames = $this->oDocumentFolder->getPathArray();
472 472 $aNames[] = $this->oDocument->getName();
473 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 476 $collection = new DocumentCollection();
477 477 $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument));
... ... @@ -518,16 +518,16 @@ class KTDocumentMoveAction extends KTDocumentAction {
518 518 }
519 519  
520 520 function do_move() {
521   - $this->oPage->setBreadcrumbDetails(_("move"));
  521 + $this->oPage->setBreadcrumbDetails(_kt("move"));
522 522 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move_final');
523 523 $sFolderPath = join(" &raquo; ", $this->oFolder->getPathArray());
524 524 $aNames = $this->oDocumentFolder->getPathArray();
525 525 $aNames[] = $this->oDocument->getName();
526 526 $sDocumentName = join(" &raquo; ", $aNames);
527 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 532 $oTemplate->setData(array(
533 533 'context' => &$this,
... ... @@ -539,13 +539,13 @@ class KTDocumentMoveAction extends KTDocumentAction {
539 539 function do_move_final() {
540 540 $sReason = KTUtil::arrayGet($_REQUEST, 'reason');
541 541 $aOptions = array(
542   - 'message' => _("No reason given"),
  542 + 'message' => _kt("No reason given"),
543 543 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())),
544 544 );
545 545 $this->oValidator->notEmpty($sReason, $aOptions);
546 546  
547 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 549 exit(0);
550 550 }
551 551  
... ... @@ -562,7 +562,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
562 562 //put the document in the new folder
563 563 $this->oDocument->setFolderID($this->oFolder->getId());
564 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 571 if (!$oStorage->moveDocument($this->oDocument, $this->oDocumentFolder, $this->oFolder)) {
572 572 $this->oDocument->setFolderID($this->oDocumentFolder->getId());
573 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 577 $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s",
... ... @@ -630,7 +630,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
630 630 var $_sShowPermission = "ktcore.permissions.read";
631 631  
632 632 function getDisplayName() {
633   - return _('Copy');
  633 + return _kt('Copy');
634 634 }
635 635  
636 636 function getInfo() {
... ... @@ -649,7 +649,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
649 649 return $res;
650 650 }
651 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 653 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
654 654 exit(0);
655 655 }
... ... @@ -660,13 +660,13 @@ class KTDocumentCopyAction extends KTDocumentAction {
660 660 }
661 661  
662 662 function do_main() {
663   - $this->oPage->setBreadcrumbDetails(_("Copy"));
  663 + $this->oPage->setBreadcrumbDetails(_kt("Copy"));
664 664 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/copy');
665 665 $move_fields = array();
666 666 $aNames = $this->oDocumentFolder->getPathArray();
667 667 $aNames[] = $this->oDocument->getName();
668 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 671 $collection = new DocumentCollection();
672 672 $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument));
... ... @@ -713,16 +713,16 @@ class KTDocumentCopyAction extends KTDocumentAction {
713 713 }
714 714  
715 715 function do_copy() {
716   - $this->oPage->setBreadcrumbDetails(_("Copy"));
  716 + $this->oPage->setBreadcrumbDetails(_kt("Copy"));
717 717 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/copy_final');
718 718 $sFolderPath = join(" &raquo; ", $this->oFolder->getPathArray());
719 719 $aNames = $this->oDocumentFolder->getPathArray();
720 720 $aNames[] = $this->oDocument->getName();
721 721 $sDocumentName = join(" &raquo; ", $aNames);
722 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 727 $oTemplate->setData(array(
728 728 'context' => &$this,
... ... @@ -734,13 +734,13 @@ class KTDocumentCopyAction extends KTDocumentAction {
734 734 function do_copy_final() {
735 735 $sReason = KTUtil::arrayGet($_REQUEST, 'reason');
736 736 $aOptions = array(
737   - 'message' => _("No reason given"),
  737 + 'message' => _kt("No reason given"),
738 738 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())),
739 739 );
740 740 $this->oValidator->notEmpty($sReason, $aOptions);
741 741  
742 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 744 exit(0);
745 745 }
746 746  
... ... @@ -750,7 +750,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
750 750  
751 751 $oNewDoc = KTDocumentUtil::copy($this->oDocument, $this->oFolder);
752 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 754 exit(0);
755 755 }
756 756  
... ... @@ -776,7 +776,7 @@ class KTDocumentCopyAction extends KTDocumentAction {
776 776 $oDocumentTransaction = & new DocumentTransaction($oNewDoc, "Document copied from old version.", 'ktcore.transactions.create', $aOptions);
777 777 $res = $oDocumentTransaction->create();
778 778  
779   - $_SESSION['KTInfoMessage'][] = _('Document copied.');
  779 + $_SESSION['KTInfoMessage'][] = _kt('Document copied.');
780 780  
781 781 controllerRedirect('viewDocument', 'fDocumentId=' . $oNewDoc->getId());
782 782 exit(0);
... ... @@ -789,7 +789,7 @@ class KTDocumentTransactionHistoryAction extends KTDocumentAction {
789 789 var $sName = 'ktcore.actions.document.transactionhistory';
790 790  
791 791 function getDisplayName() {
792   - return _('Transaction History');
  792 + return _kt('Transaction History');
793 793 }
794 794  
795 795 function getURL() {
... ... @@ -803,7 +803,7 @@ class KTDocumentVersionHistoryAction extends KTDocumentAction {
803 803 var $sName = 'ktcore.actions.document.versionhistory';
804 804  
805 805 function getDisplayName() {
806   - return _('Version History');
  806 + return _kt('Version History');
807 807 }
808 808  
809 809 function getURL() {
... ... @@ -818,7 +818,7 @@ class KTDocumentArchiveAction extends KTDocumentAction {
818 818 var $_sShowPermission = "ktcore.permissions.write";
819 819  
820 820 function getDisplayName() {
821   - return _('Archive');
  821 + return _kt('Archive');
822 822 }
823 823  
824 824 function getInfo() {
... ... @@ -829,10 +829,10 @@ class KTDocumentArchiveAction extends KTDocumentAction {
829 829 }
830 830  
831 831 function do_main() {
832   - $this->oPage->setBreadcrumbDetails(_("archiving"));
  832 + $this->oPage->setBreadcrumbDetails(_kt("archiving"));
833 833 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive');
834 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 837 $oTemplate->setData(array(
838 838 'context' => &$this,
... ... @@ -854,11 +854,11 @@ class KTDocumentArchiveAction extends KTDocumentAction {
854 854 $this->startTransaction();
855 855 $this->oDocument->setStatusID(ARCHIVED);
856 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 858 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
859 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 862 $oDocumentTransaction->create();
863 863  
864 864 $this->commitTransaction();
... ... @@ -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 883 controllerRedirect('browse', 'fFolderId=' . $this->oDocument->getFolderID());
884 884 exit(0);
885 885 }
... ... @@ -894,11 +894,11 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
894 894 var $sHelpPage = 'ktcore/workflow.html';
895 895  
896 896 function getDisplayName() {
897   - return _('Workflow');
  897 + return _kt('Workflow');
898 898 }
899 899  
900 900 function do_main() {
901   - $this->oPage->setBreadcrumbDetails(_("workflow"));
  901 + $this->oPage->setBreadcrumbDetails(_kt("workflow"));
902 902 $oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow");
903 903 $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']);
904 904  
... ... @@ -918,9 +918,9 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
918 918 $aVocab[$oTransition->getId()] = $oTransition->showDescription();
919 919 }
920 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 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 924 'fComments', "",
925 925 $this->oPage, true, null, null,
926 926 array('cols' => 80, 'rows' => 4));
... ... @@ -943,7 +943,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
943 943 if (PEAR::isError($res)) {
944 944 $this->errorRedirectToMain($res->message, sprintf('fDocumentId=%s',$oDocument->getId()));
945 945 }
946   - $this->successRedirectToMain(_('Workflow started'),
  946 + $this->successRedirectToMain(_kt('Workflow started'),
947 947 array('fDocumentId' => $oDocument->getId()));
948 948 exit(0);
949 949 }
... ... @@ -961,7 +961,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
961 961  
962 962 $oUser =& User::get($_SESSION['userID']);
963 963 $res = KTWorkflowUtil::performTransitionOnDocument($oTransition, $oDocument, $oUser, $sComments);
964   - $this->successRedirectToMain(_('Transition performed'),
  964 + $this->successRedirectToMain(_kt('Transition performed'),
965 965 array('fDocumentId' => $oDocument->getId()));
966 966 }
967 967 }
... ...
plugins/ktcore/KTFolderActions.php
... ... @@ -46,14 +46,14 @@ class KTFolderAddFolderAction extends KTFolderAction {
46 46 var $_sShowPermission = "ktcore.permissions.addFolder";
47 47  
48 48 function getDisplayName() {
49   - return _('Add a Folder');
  49 + return _kt('Add a Folder');
50 50 }
51 51  
52 52 function do_main() {
53   - $this->oPage->setBreadcrumbDetails(_("add folder"));
  53 + $this->oPage->setBreadcrumbDetails(_kt("add folder"));
54 54 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/addFolder');
55 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 58 $oTemplate->setData(array(
59 59 'context' => &$this,
... ... @@ -67,13 +67,13 @@ class KTFolderAddFolderAction extends KTFolderAction {
67 67 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
68 68 );
69 69 $sFolderName = KTUtil::arrayGet($_REQUEST, 'name');
70   - $aErrorOptions['defaultmessage'] = _("No name given");
  70 + $aErrorOptions['defaultmessage'] = _kt("No name given");
71 71 $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions);
72 72  
73 73 $this->startTransaction();
74 74  
75 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 77 $this->oValidator->notError($res, $aErrorOptions);
78 78  
79 79 $this->commitTransaction();
... ... @@ -90,11 +90,11 @@ class KTFolderPermissionsAction extends KTFolderAction {
90 90 var $bAutomaticTransaction = true;
91 91  
92 92 function getDisplayName() {
93   - return _('Permissions');
  93 + return _kt('Permissions');
94 94 }
95 95  
96 96 function do_main() {
97   - $this->oPage->setBreadcrumbDetails(_("viewing permissions"));
  97 + $this->oPage->setBreadcrumbDetails(_kt("viewing permissions"));
98 98 $oTemplating =& KTTemplating::getSingleton();
99 99 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions");
100 100 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
... ... @@ -177,13 +177,13 @@ class KTFolderPermissionsAction extends KTFolderAction {
177 177  
178 178 function do_copyPermissions() {
179 179 KTPermissionUtil::copyPermissionObject($this->oFolder);
180   - return $this->successRedirectToMain(_('Permissions updated'),
  180 + return $this->successRedirectToMain(_kt('Permissions updated'),
181 181 array('fFolderId' => $this->oFolder->getId()));
182 182 }
183 183  
184 184 function do_inheritPermissions() {
185 185 KTPermissionUtil::inheritPermissionObject($this->oFolder);
186   - return $this->successRedirectToMain(_('Permissions updated'),
  186 + return $this->successRedirectToMain(_kt('Permissions updated'),
187 187 array('fFolderId' => $this->oFolder->getId()));
188 188 }
189 189  
... ... @@ -194,7 +194,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
194 194 $oGroup =& $this->oValidator->validateGroup($_REQUEST['fGroupId'], $aOptions);
195 195 $oCondition =& $this->oValidator->validateCondition($_REQUEST['fConditionId'], $aOptions);
196 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 198 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
199 199  
200 200 $oDynamicCondition = KTPermissionDynamicCondition::createFromArray(array(
... ... @@ -206,7 +206,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
206 206 $res = $oDynamicCondition->saveAssignment($aPermissionIds);
207 207 $this->oValidator->notError($res, $aOptions);
208 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 212 function do_removeDynamicCondition() {
... ... @@ -218,7 +218,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
218 218 $this->oValidator->notError($res, $aOptions);
219 219 $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
220 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 50 var $_bAdminAlwaysAvailable = true;
51 51  
52 52 function getDisplayName() {
53   - return _('Permissions');
  53 + return _kt('Permissions');
54 54 }
55 55  
56 56 function do_main() {
... ... @@ -150,12 +150,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
150 150 var $_bAdminAlwaysAvailable = true;
151 151  
152 152 function getDisplayName() {
153   - return _('Allocate Roles');
  153 + return _kt('Allocate Roles');
154 154 }
155 155  
156 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 159 $oTemplating =& KTTemplating::getSingleton();
160 160 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/roles");
161 161  
... ... @@ -230,7 +230,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
230 230 }
231 231 }
232 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 234 } else {
235 235 $aRoles[$key]['users'] = join(', ',$_users);
236 236 }
... ... @@ -244,7 +244,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
244 244 }
245 245 }
246 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 248 } else {
249 249 $aRoles[$key]['groups'] = join(', ',$_groups);
250 250 }
... ... @@ -263,7 +263,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
263 263 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
264 264 $oRole = Role::get($role_id);
265 265 if (PEAR::isError($oRole)) {
266   - $this->errorRedirectToMain(_('Invalid Role.'));
  266 + $this->errorRedirectToMain(_kt('Invalid Role.'));
267 267 }
268 268 // FIXME do we need to check that this role _isn't_ allocated?
269 269 $oRoleAllocation = new RoleAllocation();
... ... @@ -280,38 +280,38 @@ class KTRoleAllocationPlugin extends KTFolderAction {
280 280 $res = $oRoleAllocation->create();
281 281  
282 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 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 291 function do_useParent() {
292 292 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
293 293 $oRole = Role::get($role_id);
294 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 297 $role_id = $oRole->getId(); // numeric, for various testing purposes.
298 298  
299 299 $oRoleAllocation = RoleAllocation::getAllocationsForFolderAndRole($this->oFolder->getId(), $role_id);
300 300  
301 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 304 $this->startTransaction();
305 305  
306 306 $res = $oRoleAllocation->delete();
307 307  
308 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 310 exit(0);
311 311 }
312 312  
313 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 317 function do_editRoleUsers() {
... ... @@ -319,12 +319,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
319 319 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id');
320 320 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
321 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 329 $initJS = 'var optGroup = new OptionTransfer("userSelect","chosenUsers"); ' .
330 330 'function startTrans() { var f = getElement("userroleform"); ' .
... ... @@ -365,12 +365,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
365 365 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id');
366 366 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
367 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 375 $initJS = 'var optGroup = new OptionTransfer("groupSelect","chosenGroups"); ' .
376 376 'function startTrans() { var f = getElement("grouproleform"); ' .
... ... @@ -411,7 +411,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
411 411 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'allocation_id');
412 412 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
413 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 416 $users = KTUtil::arrayGet($_REQUEST, 'userFinal', '');
417 417 $aUserIds = explode(',', $users);
... ... @@ -440,12 +440,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
440 440 $res = $oRoleAllocation->update();
441 441  
442 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 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 451 function do_setRoleGroups() {
... ... @@ -453,7 +453,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
453 453 $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'allocation_id');
454 454 $oRoleAllocation = RoleAllocation::get($role_allocation_id);
455 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 458 $groups = KTUtil::arrayGet($_REQUEST, 'groupFinal', '');
459 459 $aGroupIds = explode(',', $groups);
... ... @@ -482,12 +482,12 @@ class KTRoleAllocationPlugin extends KTFolderAction {
482 482 $res = $oRoleAllocation->update();
483 483  
484 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 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 493 function renegeratePermissionsForRole($iRoleId) {
... ... @@ -523,7 +523,7 @@ class KTRoleAllocationPlugin extends KTFolderAction {
523 523  
524 524 $aNewFolders = DBUtil::getResultArrayKey(array($sQuery, $aParams), 'id');
525 525 if (PEAR::isError($aNewFolders)) {
526   - $this->errorRedirectToMain(_('Failure to generate folderlisting.'));
  526 + $this->errorRedirectToMain(_kt('Failure to generate folderlisting.'));
527 527 }
528 528 $folder_queue = array_merge ($folder_queue, (array) $aNewFolders); // push.
529 529  
... ... @@ -531,13 +531,13 @@ class KTRoleAllocationPlugin extends KTFolderAction {
531 531 // update the folder.
532 532 $oFolder =& Folder::get($active_folder);
533 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 537 KTPermissionUtil::updatePermissionLookup($oFolder);
538 538 $aDocList =& Document::getList(array('folder_id = ?', $active_folder));
539 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 543 foreach ($aDocList as $oDoc) {
... ... @@ -555,8 +555,8 @@ class KTDocumentRolesAction extends KTDocumentAction {
555 555 var $bAutomaticTransaction = true;
556 556  
557 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 560 $oTemplating = new KTTemplating;
561 561 $oTemplate = $oTemplating->loadTemplate("ktcore/action/view_roles");
562 562  
... ... @@ -610,7 +610,7 @@ class KTDocumentRolesAction extends KTDocumentAction {
610 610 }
611 611 }
612 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 614 } else {
615 615 $aRoles[$key]['users'] = implode(', ',$_users);
616 616 }
... ... @@ -623,7 +623,7 @@ class KTDocumentRolesAction extends KTDocumentAction {
623 623 }
624 624 }
625 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 627 } else {
628 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 32 class KTSearchPortlet extends KTPortlet {
33 33  
34 34 function KTSearchPortlet() {
35   - parent::KTPortlet(_("Search"));
  35 + parent::KTPortlet(_kt("Search"));
36 36 }
37 37 function render() {
38 38 require_once(KT_LIB_DIR . '/search/savedsearch.inc.php');
... ... @@ -62,7 +62,7 @@ class KTBrowseModePortlet extends KTPortlet {
62 62 function KTBrowseModePortlet($sTitle = null) {
63 63 // match empty, false.
64 64 if ($sTitle == null) {
65   - $sTitle = _('Browse Documents By');
  65 + $sTitle = _kt('Browse Documents By');
66 66 }
67 67 parent::KTPortlet($sTitle);
68 68 }
... ... @@ -71,9 +71,9 @@ class KTBrowseModePortlet extends KTPortlet {
71 71 // this is unfortunate, but such is life.
72 72 $current_action = KTUtil::arrayGet($_REQUEST, 'fBrowseMode', null);
73 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 79 $oTemplating =& KTTemplating::getSingleton();
... ... @@ -92,7 +92,7 @@ class KTBrowseModePortlet extends KTPortlet {
92 92 class KTAdminModePortlet extends KTPortlet {
93 93  
94 94 function KTAdminModePortlet() {
95   - parent::KTPortlet(_("Administrator mode"));
  95 + parent::KTPortlet(_kt("Administrator mode"));
96 96 }
97 97 function render() {
98 98 $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1);
... ... @@ -139,7 +139,7 @@ class KTAdminModePortlet extends KTPortlet {
139 139 class KTAdminSectionNavigation extends KTPortlet {
140 140  
141 141 function KTAdminSectionNavigation() {
142   - parent::KTPortlet(_("Administration"));
  142 + parent::KTPortlet(_kt("Administration"));
143 143 }
144 144  
145 145 function render() {
... ...
plugins/ktcore/admin/archivedDocuments.php
... ... @@ -58,13 +58,13 @@ class KTArchiveTitle extends TitleColumn {
58 58 class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
59 59  
60 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 65 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1));
66 66 if (PEAR::isError($oFolder)) {
67   - $this->errorRedirectToMain(_('Invalid folder selected.'));
  67 + $this->errorRedirectToMain(_kt('Invalid folder selected.'));
68 68 exit(0);
69 69 }
70 70  
... ... @@ -129,21 +129,21 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
129 129 }
130 130  
131 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 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 140 $aDocuments = array();
141 141 foreach ($selected_docs as $doc_id) {
142 142 $oDoc =& Document::get($doc_id);
143 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 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 148 $aDocuments[] = $oDoc;
149 149 }
... ... @@ -167,9 +167,9 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
167 167 foreach ($selected_docs as $doc_id) {
168 168 $oDoc =& Document::get($doc_id);
169 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 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 174 $aDocuments[] = $oDoc;
175 175 }
... ... @@ -183,11 +183,11 @@ class ArchivedDocumentsDispatcher extends KTAdminDispatcher {
183 183 $oDoc->setStatusId(LIVE);
184 184 $res = $oDoc->update();
185 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 189 $this->commitTransaction();
190   - $msg = sprintf(_('%d documents made active.'), count($aDocuments));
  190 + $msg = sprintf(_kt('%d documents made active.'), count($aDocuments));
191 191 $this->successRedirectToMain($msg);
192 192 }
193 193 }
... ...
plugins/ktcore/admin/conditions.php
... ... @@ -35,7 +35,7 @@ class KTConditionDispatcher extends KTAdminDispatcher {
35 35 var $bAutomaticTransaction = true;
36 36  
37 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 39 return true;
40 40 }
41 41  
... ... @@ -48,8 +48,8 @@ class KTConditionDispatcher extends KTAdminDispatcher {
48 48 }
49 49  
50 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 54 $oTemplating =& KTTemplating::getSingleton();
55 55 $oTemplate = $oTemplating->loadTemplate("ktcore/boolean_search");
... ... @@ -57,10 +57,10 @@ class KTConditionDispatcher extends KTAdminDispatcher {
57 57 $aCriteria = Criteria::getAllCriteria();
58 58  
59 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 62 "aCriteria" => $aCriteria,
63   - "searchButton" => _("Save"),
  63 + "searchButton" => _kt("Save"),
64 64 "context" => &$this,
65 65 );
66 66 return $oTemplate->render($aTemplateData);
... ... @@ -101,14 +101,14 @@ class KTConditionDispatcher extends KTAdminDispatcher {
101 101  
102 102  
103 103 $aTemplateData = array(
104   - "title" => _("Edit an existing condition"),
  104 + "title" => _kt("Edit an existing condition"),
105 105 "aCriteria" => $aCriteria,
106   - "searchButton" => _("Update Dynamic Condition"),
  106 + "searchButton" => _kt("Update Dynamic Condition"),
107 107 'aSearch' => $aSearch,
108 108 'context' => $this,
109 109 'iSearchId' => $oSearch->getId(),
110 110 'old_name' => $oSearch->getName(),
111   - 'sNameTitle' => _('Edit Dynamic Condition'),
  111 + 'sNameTitle' => _kt('Edit Dynamic Condition'),
112 112 );
113 113 return $oTemplate->render($aTemplateData);
114 114 }
... ... @@ -131,7 +131,7 @@ class KTConditionDispatcher extends KTAdminDispatcher {
131 131 }
132 132  
133 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 137 //$sName = "Neil's saved search";
... ... @@ -144,9 +144,9 @@ class KTConditionDispatcher extends KTAdminDispatcher {
144 144  
145 145 $this->oValidator->notError($res, array(
146 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 152 // XXX: Rename to do_save
... ... @@ -157,7 +157,7 @@ class KTConditionDispatcher extends KTAdminDispatcher {
157 157 }
158 158  
159 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 163 $sName = $this->oValidator->validateEntityName(
... ... @@ -179,9 +179,9 @@ class KTConditionDispatcher extends KTAdminDispatcher {
179 179  
180 180 $this->oValidator->notError($oSearch, array(
181 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 37  
38 38 class DeletedDocumentsDispatcher extends KTAdminDispatcher {
39 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 44 $aDocuments =& Document::getList("status_id=" . DELETED);
45 45  
... ... @@ -62,25 +62,25 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
62 62 if (array_key_exists('restore', $submit)) {
63 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 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 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 77 $aDocuments = array();
78 78 foreach ($selected_docs as $doc_id) {
79 79 $oDoc =& Document::get($doc_id);
80 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 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 85 $aDocuments[] = $oDoc;
86 86 }
... ... @@ -104,9 +104,9 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
104 104 foreach ($selected_docs as $doc_id) {
105 105 $oDoc =& Document::get($doc_id);
106 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 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 111 $aDocuments[] = $oDoc;
112 112 }
... ... @@ -139,27 +139,27 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
139 139 }
140 140 }
141 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 144 $this->successRedirectToMain($msg);
145 145 }
146 146  
147 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 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 156 $aDocuments = array();
157 157 foreach ($selected_docs as $doc_id) {
158 158 $oDoc =& Document::get($doc_id);
159 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 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 164 $aDocuments[] = $oDoc;
165 165 }
... ... @@ -181,9 +181,9 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
181 181 foreach ($selected_docs as $doc_id) {
182 182 $oDoc =& Document::get($doc_id);
183 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 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 188 $aDocuments[] = $oDoc;
189 189 }
... ... @@ -225,8 +225,8 @@ class DeletedDocumentsDispatcher extends KTAdminDispatcher {
225 225 }
226 226 }
227 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 230 $this->successRedirectToMain($msg);
231 231 }
232 232  
... ...
plugins/ktcore/admin/documentCheckout.php
... ... @@ -39,8 +39,8 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
39 39 }
40 40  
41 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 45 $aDocuments = Document::getList("is_checked_out = 1");
46 46  
... ... @@ -55,17 +55,17 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
55 55  
56 56  
57 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 61 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
62 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 66 $oDocument = Document::get($document_id);
67 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 71 $oUser = User::get($oDocument->getCheckedOutUserID());
... ... @@ -91,12 +91,12 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
91 91  
92 92 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
93 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 97 $oDocument = Document::get($document_id);
98 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 102 $this->startTransaction();
... ... @@ -105,7 +105,7 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
105 105 $oDocument->setCheckedOutUserID(-1);
106 106 if (!$oDocument->update()) {
107 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 111 // checkout cancelled transaction
... ... @@ -113,10 +113,10 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher {
113 113 $res = $oDocumentTransaction->create();
114 114 if (PEAR::isError($res) || ($res == false)) {
115 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 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 43 var $bAutomaticTransaction = true;
44 44  
45 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 47 return true;
48 48 }
49 49  
50 50 // {{{ do_main
51 51 function do_main () {
52   - $this->oPage->setBreadcrumbDetails(_("view fieldsets"));
  52 + $this->oPage->setBreadcrumbDetails(_kt("view fieldsets"));
53 53  
54 54 // function KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null) {
55 55 // use widgets for the create form.
56 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 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 64 $oTemplating =& KTTemplating::getSingleton();
... ... @@ -79,12 +79,12 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
79 79 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
80 80  
81 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 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 90 // type is a little more complex.
... ... @@ -95,7 +95,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
95 95 $vocab['lookup'] = 'Lookup';
96 96 $vocab['tree'] = 'Tree';
97 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 99 'type', null, $this->oPage, true, null, null, $typeOptions);
100 100  
101 101  
... ... @@ -122,13 +122,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
122 122 $aErrorOptions = array(
123 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 127 $aErrorOptions['rename'] = $oFieldset->getId();
128 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 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 132 $sDescription = $this->oValidator->validateString($_REQUEST['description'], $aErrorOptions);
133 133  
134 134 $oFieldset->setName($sName);
... ... @@ -136,10 +136,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
136 136 $oFieldset->setDescription($sDescription);
137 137 $res = $oFieldset->update();
138 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 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 143 exit(0);
144 144 }
145 145 // }}}
... ... @@ -162,14 +162,14 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
162 162 // Can't be a system fieldset and a generic fieldset...
163 163 if ($bIsGeneric) {
164 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 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 173 $sName = $this->oValidator->validateEntityName("KTFieldset", $_REQUEST['name'], $aErrorOptions);
174 174  
175 175 $sDescription = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'description'),
... ... @@ -194,7 +194,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
194 194 $this->errorRedirectToMain('Could not create fieldset');
195 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 198 exit(0);
199 199 }
200 200 // }}}
... ... @@ -237,13 +237,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
237 237 'parentfieldset' => $oFieldset->getId(),
238 238 ));
239 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 241 exit(0);
242 242 }
243 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 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 248 exit(0);
249 249 }
... ... @@ -251,7 +251,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
251 251  
252 252 // {{{ do_editField
253 253 function do_editField() {
254   - $this->oPage->setBreadcrumbDetails(_("Edit field"));
  254 + $this->oPage->setBreadcrumbDetails(_kt("Edit field"));
255 255 $oTemplating =& KTTemplating::getSingleton();
256 256 $oTemplate =& $oTemplating->loadTemplate('ktcore/metadata/editField');
257 257 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
... ... @@ -265,7 +265,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
265 265 $this->aBreadcrumbs[] = array(
266 266 'name' => $oField->getName()
267 267 );
268   - $this->oPage->setBreadcrumbDetails(_('edit field'));
  268 + $this->oPage->setBreadcrumbDetails(_kt('edit field'));
269 269  
270 270 $oTemplate->setData(array(
271 271 'oFieldset' => $oFieldset,
... ... @@ -303,10 +303,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
303 303 $oField->setDescription($sDescription);
304 304 $res = $oField->update();
305 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 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 310 exit(0);
311 311 }
312 312 // }}}
... ... @@ -316,13 +316,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
316 316 $oFieldset =& KTFieldset::get($_REQUEST['fFieldsetId']);
317 317 $oField =& DocumentField::get($_REQUEST['fFieldId']);
318 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 321 $oMetaData =& MetaData::createFromArray(array(
322 322 'name' => $_REQUEST['value'],
323 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 326 exit(0);
327 327 }
328 328 // }}}
... ... @@ -330,13 +330,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
330 330 // {{{ do_metadataMultiAction
331 331 function do_metadataMultiAction() {
332 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 334 $subaction = $subaction[0];
335 335 $method = null;
336 336 if (method_exists($this, 'lookup_' . $subaction)) {
337 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 340 return $this->$method();
341 341 }
342 342 // }}}
... ... @@ -347,16 +347,16 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
347 347 $oField =& DocumentField::get($_REQUEST['fFieldId']);
348 348 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
349 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 352 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
353 353 $oMetaData =& MetaData::get($iMetaDataId);
354 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 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 360 exit(0);
361 361 }
362 362 // }}}
... ... @@ -367,17 +367,17 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
367 367 $oField =& DocumentField::get($_REQUEST['fFieldId']);
368 368 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
369 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 372 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
373 373 $oMetaData =& MetaData::get($iMetaDataId);
374 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 377 $oMetaData->setDisabled(true);
378 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 381 exit(0);
382 382 }
383 383 // }}}
... ... @@ -388,17 +388,17 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
388 388 $oField =& DocumentField::get($_REQUEST['fFieldId']);
389 389 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
390 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 393 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
394 394 $oMetaData =& MetaData::get($iMetaDataId);
395 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 398 $oMetaData->setDisabled(false);
399 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 402 exit(0);
403 403 }
404 404 // }}}
... ... @@ -409,18 +409,18 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
409 409 $oField =& DocumentField::get($_REQUEST['fFieldId']);
410 410 $aMetadata = KTUtil::arrayGet($_REQUEST, 'metadata');
411 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 414 foreach ($_REQUEST['metadata'] as $iMetaDataId) {
415 415 $oMetaData =& MetaData::get($iMetaDataId);
416 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 419 $bStuck = (boolean)$oMetaData->getIsStuck();
420 420 $oMetaData->setIsStuck(!$bStuck);
421 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 424 exit(0);
425 425 }
426 426 // }}}
... ... @@ -432,10 +432,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
432 432 $oFieldset->setIsComplete(false);
433 433 $res = $oFieldset->update();
434 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 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 439 exit(0);
440 440 }
441 441 // }}}
... ... @@ -478,10 +478,10 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
478 478  
479 479 $res = $oFieldset->update();
480 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 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 485 exit(0);
486 486 }
487 487 // }}}
... ... @@ -493,7 +493,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
493 493 $oField =& DocumentField::get($iFieldId);
494 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 497 exit(0);
498 498 }
499 499 // }}}
... ... @@ -555,7 +555,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
555 555 $this->aBreadcrumbs[] = array(
556 556 'url' => $_SERVER['PHP_SELF'],
557 557 'query' => 'action=manageConditional&fFieldsetId=' . $_REQUEST['fFieldsetId'],
558   - 'name' => _('Manage conditional field'),
  558 + 'name' => _kt('Manage conditional field'),
559 559 );
560 560 $oTemplate->setData(array(
561 561 'oFieldset' => $oFieldset,
... ... @@ -578,16 +578,16 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
578 578 }
579 579 $iParentFieldId = $_REQUEST['fParentFieldId'];
580 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 583 foreach ($aFreeFieldIds as $iChildFieldId) {
584 584 $res = KTMetadataUtil::addFieldOrder($iParentFieldId, $iChildFieldId, $oFieldset);
585 585 $this->oValidator->notError($res, array(
586 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 591 exit(0);
592 592 }
593 593 // }}}
... ... @@ -603,9 +603,9 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
603 603  
604 604 $this->oValidator->notError($res, array(
605 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 609 exit(0);
610 610 }
611 611 // }}}
... ... @@ -623,13 +623,13 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
623 623 if ($res === true) {
624 624 $oFieldset->setIsComplete(true);
625 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 628 $oFieldset->setIsComplete(false);
629 629 $oFieldset->update();
630 630 // Success, as we want to save the incompleteness to the
631 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 640 $res = $oFieldset->update();
641 641 $this->oValidator->notError($res, array(
642 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 653 $res = $oFieldset->update();
654 654 $this->oValidator->notError($res, array(
655 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 665 $res = $oFieldset->delete();
666 666 $this->oValidator->notErrorFalse($res, array(
667 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 682 $subaction = KTUtil::arrayGet($_REQUEST, 'subaction');
683 683  
684 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 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 689 $aErrorOptions = array(
690 690 'redirect_to' => array('editTree', sprintf('field_id=%d', $field_id)),
... ... @@ -698,30 +698,30 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
698 698  
699 699 if ($subaction !== null) {
700 700 $target = 'editTree';
701   - $msg = _('Changes saved.');
  701 + $msg = _kt('Changes saved.');
702 702 if ($subaction === "addCategory") {
703 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 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 708 if ($subaction === "deleteCategory") {
709 709 $this->subact_deleteCategory($fieldTree, $current_node);
710 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 713 if ($subaction === "linkKeywords") {
714 714 $keywords = KTUtil::arrayGet($_REQUEST, 'keywordsToAdd');
715   - $aErrorOptions['message'] = _("No keywords selected");
  715 + $aErrorOptions['message'] = _kt("No keywords selected");
716 716 $this->oValidator->notEmpty($keywords, $aErrorOptions);
717 717 $this->subact_linkKeywords($fieldTree, $current_node, $keywords);
718 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 721 if ($subaction === "unlinkKeyword") {
722 722 $keyword = KTUtil::arrayGet($_REQUEST, 'keyword_id');
723 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 726 // now redirect
727 727 $query = 'field_id=' . $field_id;
... ... @@ -729,7 +729,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
729 729 }
730 730  
731 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 735 // FIXME extract this from MDTree (helper method?)
... ... @@ -740,7 +740,7 @@ class KTDocumentFieldDispatcher extends KTAdminDispatcher {
740 740 $oTemplate = $oTemplating->loadTemplate("ktcore/edit_lookuptrees");
741 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 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 38 }
39 39  
40 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 44 $aLinkTypes =& LinkType::getList('id > 0');
45 45  
46 46 $addLinkForm = array();
47 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 52 $oTemplating =& KTTemplating::getSingleton();
... ... @@ -62,20 +62,20 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
62 62 function do_edit() {
63 63 $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
64 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 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 73 $aLinkTypes =& LinkType::getList('id > 0');
74 74  
75 75 $editLinkForm = array();
76 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 81 $oTemplating =& KTTemplating::getSingleton();
... ... @@ -93,14 +93,14 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
93 93 function do_update() {
94 94 $link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
95 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 99 $name = KTUtil::arrayGet($_REQUEST, 'fName');
100 100 $description = KTUtil::arrayGet($_REQUEST, 'fDescription');
101 101  
102 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 106 $oLinkType =& LinkType::get($link_id);
... ... @@ -109,7 +109,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
109 109 $oLinkType->setDescription($description);
110 110 $oLinkType->update();
111 111  
112   - $this->successRedirectToMain(_("Link Type updated."));
  112 + $this->successRedirectToMain(_kt("Link Type updated."));
113 113 }
114 114  
115 115 function do_add() {
... ... @@ -117,7 +117,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
117 117 $description = KTUtil::arrayGet($_REQUEST, 'fDescription');
118 118  
119 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 123 $oLinkType = new LinkType($name, $description);
... ... @@ -125,14 +125,14 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
125 125  
126 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 131 function do_delete() {
132 132 $types_to_delete = KTUtil::arrayGet($_REQUEST, 'fLinksToDelete'); // is an array.
133 133  
134 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 138 $count = 0;
... ... @@ -149,7 +149,7 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
149 149  
150 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 41 // Breadcrumbs base - added to in methods
42 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 46 $this->oPage->setBreadcrumbDetails('view types');
47 47  
48 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 51 $oTemplating =& KTTemplating::getSingleton();
52 52 $oTemplate = $oTemplating->loadTemplate('ktcore/documenttypes/list');
... ... @@ -65,26 +65,26 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
65 65 ));
66 66  
67 67 if (PEAR::isError($oDocumentType)) {
68   - $this->errorRedirectToMain(_('Could not create document type'));
  68 + $this->errorRedirectToMain(_kt('Could not create document type'));
69 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 72 exit(0);
73 73 }
74 74  
75 75 function do_delete() {
76 76 $oDocumentType =& DocumentType::get($_REQUEST['fDocumentTypeId']);
77 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 79 exit(0);
80 80 }
81 81 $res = $oDocumentType->delete();
82 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 84 exit(0);
85 85 }
86 86  
87   - $this->successRedirectToMain(_('Document type deleted'));
  87 + $this->successRedirectToMain(_kt('Document type deleted'));
88 88 exit(0);
89 89 }
90 90  
... ... @@ -95,11 +95,11 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
95 95 $res = $oDocumentType->update();
96 96  
97 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 99 exit(0);
100 100 }
101 101  
102   - $this->successRedirectToMain(_('Document type disabled'));
  102 + $this->successRedirectToMain(_kt('Document type disabled'));
103 103 exit(0);
104 104 }
105 105  
... ... @@ -110,17 +110,17 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
110 110 $res = $oDocumentType->update();
111 111  
112 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 114 exit(0);
115 115 }
116 116  
117   - $this->successRedirectToMain(_('Document type enabled'));
  117 + $this->successRedirectToMain(_kt('Document type enabled'));
118 118 exit(0);
119 119 }
120 120  
121 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 125 $oTemplating =& KTTemplating::getSingleton();
126 126 $oTemplate = $oTemplating->loadTemplate('ktcore/documenttypes/edit');
... ... @@ -142,13 +142,13 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
142 142 $aOptions['vocab'] = $vocab;
143 143 $aOptions['multi'] = true;
144 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 146 null, null, $aOptions);
147 147  
148 148 $this->aBreadcrumbs[] = array(
149 149 'name' => $oDocumentType->getName(),
150 150 );
151   - $this->oPage->setBreadcrumbDetails(_('edit'));
  151 + $this->oPage->setBreadcrumbDetails(_kt('edit'));
152 152  
153 153 $oTemplate->setData(array(
154 154 'oDocumentType' => $oDocumentType,
... ... @@ -173,10 +173,10 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
173 173 $res = $oDocumentType->update();
174 174  
175 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 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 180 exit(0);
181 181 }
182 182  
... ... @@ -185,10 +185,10 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
185 185 $res = KTMetadataUtil::removeSetsFromDocumentType($oDocumentType, $_REQUEST['fieldsetid']);
186 186 if (PEAR::isError($res)) {
187 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 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 192 exit(0);
193 193 }
194 194  
... ... @@ -197,17 +197,17 @@ class KTDocumentTypeDispatcher extends KTAdminDispatcher {
197 197 $aFieldsetId = $_REQUEST['fieldsetid'];
198 198  
199 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 201 exit(0);
202 202 }
203 203  
204 204 $res = KTMetadataUtil::addSetsToDocumentType($oDocumentType, $aFieldsetId);
205 205 if (PEAR::isError($res)) {
206 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 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 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 43 class KTGroupAdminDispatcher extends KTAdminDispatcher {
44 44 // {{{ do_main
45 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 50 $KTConfig =& KTConfig::getSingleton();
51 51 $alwaysAll = $KTConfig->get("alwaysShowAll");
... ... @@ -61,7 +61,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
61 61 }
62 62  
63 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 66 if (!empty($name)) {
67 67 $search_results =& Group::getList('WHERE name LIKE \'%' . DBUtil::escapeSimple($name) . '%\'');
... ... @@ -85,21 +85,21 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
85 85  
86 86 // {{{ do_editGroup
87 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 91 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
92 92 $oGroup = Group::get($group_id);
93 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 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 104 // grab all units.
105 105 $unitId = $oGroup->getUnitId();
... ... @@ -107,11 +107,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
107 107  
108 108 $oUnits = Unit::getList();
109 109 $vocab = array();
110   - $vocab[0] = _('No Unit');
  110 + $vocab[0] = _kt('No Unit');
111 111 foreach ($oUnits as $oUnit) { $vocab[$oUnit->getID()] = $oUnit->getName(); }
112 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 116 $oTemplating =& KTTemplating::getSingleton();
117 117 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/editgroup");
... ... @@ -129,10 +129,10 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
129 129 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
130 130 $oGroup = Group::get($group_id);
131 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 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 136 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false);
137 137 if ($is_unitadmin !== false) { $is_unitadmin = true; }
138 138 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false);
... ... @@ -152,10 +152,10 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
152 152 }
153 153  
154 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 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 186 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
187 187 $oGroup = Group::get($group_id);
188 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 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 197 $iSourceId = $oGroup->getAuthenticationSourceId();
198 198 if (!empty($iSourceId)) {
... ... @@ -243,7 +243,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
243 243 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
244 244 $oGroup = Group::get($group_id);
245 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 249 $userAdded = KTUtil::arrayGet($_REQUEST, 'userAdded','');
... ... @@ -270,7 +270,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
270 270 }
271 271 $res = $oGroup->addMember($oUser);
272 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 274 } else { $usersAdded[] = $oUser->getName(); }
275 275 }
276 276 }
... ... @@ -281,7 +281,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
281 281 $oUser = User::get($iUserId);
282 282 $res = $oGroup->removeMember($oUser);
283 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 285 } else {
286 286 $usersRemoved[] = $oUser->getName();
287 287 $memberReason = GroupUtil::getMembershipReason($oUser, $oGroup);
... ... @@ -294,20 +294,20 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
294 294 }
295 295  
296 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 298 $sWarnStr .= implode(', ', $addWarnings);
299 299 $_SESSION['KTInfoMessage'][] = $sWarnStr;
300 300 }
301 301  
302 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 304 $sWarnStr .= implode(', ', $removeWarnings);
305 305 $_SESSION['KTInfoMessage'][] = $sWarnStr;
306 306 }
307 307  
308 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 312 $this->commitTransaction();
313 313 $this->successRedirectToMain($msg);
... ... @@ -320,12 +320,12 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
320 320 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
321 321 $oGroup = Group::get($group_id);
322 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 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 331 // FIXME replace OptionTransfer.js. me no-likey.
... ... @@ -409,7 +409,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
409 409 $oMemberGroup = Group::get($iMemberGroupID);
410 410 $res = $oGroup->addMemberGroup($oMemberGroup);
411 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 413 exit(0);
414 414 } else { $groupsAdded[] = $oMemberGroup->getName(); }
415 415 }
... ... @@ -420,15 +420,15 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
420 420 $oMemberGroup = Group::get($iMemberGroupID);
421 421 $res = $oGroup->removeMemberGroup($oMemberGroup);
422 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 424 exit(0);
425 425 } else { $groupsRemoved[] = $oMemberGroup->getName(); }
426 426 }
427 427 }
428 428  
429 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 433 $this->commitTransaction();
434 434  
... ... @@ -438,25 +438,25 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
438 438  
439 439 // {{{ do_addGroup
440 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 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 451 // grab all units.
452 452  
453 453 $oUnits = Unit::getList();
454 454 $vocab = array();
455   - $vocab[0] = _('No Unit');
  455 + $vocab[0] = _kt('No Unit');
456 456 foreach ($oUnits as $oUnit) { $vocab[$oUnit->getID()] = $oUnit->getName(); }
457 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 461 $aAuthenticationSources = array();
462 462 $aAllAuthenticationSources =& KTAuthenticationSource::getList();
... ... @@ -484,7 +484,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
484 484 function do_createGroup() {
485 485  
486 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 488 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false);
489 489 if ($is_unitadmin !== false) { $is_unitadmin = true; }
490 490 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false);
... ... @@ -503,7 +503,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
503 503 //if (($res == false) || (PEAR::isError($res))) { return $this->errorRedirectToMain('Failed to create group "' . $group_name . '"'); }
504 504 // do i need to "create"
505 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 516 $sGroupName = $oGroup->getName();
517 517 $res = $oGroup->delete();
518 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 529 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
530 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 534 $oProvider->aBreadcrumbs = $this->aBreadcrumbs;
535 535 $oProvider->oPage->setBreadcrumbDetails($oSource->getName());
536   - $oProvider->oPage->setTitle(_("Modify Group Details"));
  536 + $oProvider->oPage->setTitle(_kt("Modify Group Details"));
537 537  
538 538 $oProvider->dispatch();
539 539 exit(0);
... ... @@ -545,7 +545,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
545 545 $aGroups = $oGroup->getMemberGroups();
546 546 $MAX_GROUPS = 6;
547 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 549 if (count($aGroups) > $MAX_GROUPS) {
550 550 $aGroups = array_slice($aGroups, 0, $MAX_GROUPS);
551 551 $add_elipsis = true;
... ...
plugins/ktcore/admin/manageConditionals.php
... ... @@ -45,8 +45,8 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
45 45 global $default;
46 46 $this->ru = $default->rootUrl;
47 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 86 );
87 87 $this->aBreadcrumbs[] = array(
88 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 93 $aTemplateData = array(
94 94 "context" => &$this,
... ... @@ -120,9 +120,9 @@ class ManageConditionalDispatcher extends KTAdminDispatcher {
120 120 );
121 121 $this->aBreadcrumbs[] = array(
122 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 126 $aTemplateData = array(
127 127 "context" => &$this,
128 128 "fieldset_id" => $fieldset_id,
... ...
plugins/ktcore/admin/manageHelp.php
... ... @@ -43,9 +43,9 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
43 43 }
44 44  
45 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 49 $oTemplating =& KTTemplating::getSingleton();
50 50 $aHelpReplacements =& KTHelpReplacement::getList();
51 51 //$aHelps =& KTHelpEntity::getList();
... ... @@ -60,8 +60,8 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
60 60 }
61 61  
62 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 65 $oTemplating =& KTTemplating::getSingleton();
66 66 $oTemplate = $oTemplating->loadTemplate("ktcore/manage_help_item");
67 67 $aTemplateData = array(
... ... @@ -69,7 +69,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
69 69 "help" => $oHelpReplacement,
70 70 );
71 71 $this->aBreadcrumbs[] = array(
72   - 'name' => _('Edit help item'),
  72 + 'name' => _kt('Edit help item'),
73 73 );
74 74 return $oTemplate->render($aTemplateData);
75 75 }
... ... @@ -78,7 +78,7 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
78 78 $id = KTUtil::arrayGet($_REQUEST, 'id');
79 79 $oHelpReplacement = KTHelpReplacement::get($id);
80 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 83 return $this->getReplacementItemData($oHelpReplacement);
84 84 }
... ... @@ -87,38 +87,38 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
87 87 $id = KTUtil::arrayGet($_REQUEST, 'id');
88 88 $oHelpReplacement = KTHelpReplacement::get($id);
89 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 92 $res = $oHelpReplacement->delete();
93 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 99 function do_updateReplacement() {
100 100 $id = KTUtil::arrayGet($_REQUEST, 'id');
101 101 $oHelpReplacement = KTHelpReplacement::get($id);
102 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 105 $description = KTUtil::arrayGet($_REQUEST, 'description');
106 106 if (empty($description)) {
107   - return $this->errorRedirectToMain(_("No description given"));
  107 + return $this->errorRedirectToMain(_kt("No description given"));
108 108 }
109 109 $oHelpReplacement->setDescription($description);
110 110  
111 111 $title = KTUtil::arrayGet($_REQUEST, 'title');
112 112 if (empty($title)) {
113   - return $this->errorRedirectToMain(_("No title given"));
  113 + return $this->errorRedirectToMain(_kt("No title given"));
114 114 }
115 115 $oHelpReplacement->setTitle($title);
116 116  
117 117 $res = $oHelpReplacement->update();
118 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 124 function do_customise() {
... ... @@ -131,13 +131,13 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
131 131  
132 132 if (!PEAR::isError($oHelpReplacement)) {
133 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 136 $info = KTHelp::getHelpFromFile($name);
137 137 if ($info === false) {
138 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 142 $oHelpReplacement = KTHelpReplacement::createFromArray(array(
143 143 'name' => $info['name'],
... ... @@ -146,9 +146,9 @@ class ManageHelpDispatcher extends KTAdminDispatcher {
146 146 ));
147 147  
148 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 34  
35 35 class ManagePermissionsDispatcher extends KTAdminDispatcher {
36 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 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 44 $oTemplating =& KTTemplating::getSingleton();
45 45 $aPermissions =& KTPermission::getList();
... ... @@ -56,35 +56,35 @@ class ManagePermissionsDispatcher extends KTAdminDispatcher {
56 56 $name = KTUtil::arrayGet($_REQUEST, 'name');
57 57 $human_name = KTUtil::arrayGet($_REQUEST, 'human_name');
58 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 61 $oPerm = KTPermission::createFromArray(array(
62 62 'name' => $name,
63 63 'humanname' => $human_name,
64 64 ));
65 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 71 function do_deletePermission() {
72 72 $id = KTUtil::arrayGet($_REQUEST, 'id');
73 73 if (empty($id)) {
74   - return $this->errorRedirectToMain(_("Both names not given"));
  74 + return $this->errorRedirectToMain(_kt("Both names not given"));
75 75 }
76 76 $oPerm = KTPermission::get($id);
77 77 if (PEAR::isError($oPerm)) {
78   - return $this->errorRedirectToMain(_("Error finding permission"));
  78 + return $this->errorRedirectToMain(_kt("Error finding permission"));
79 79 }
80 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 83 $res = $oPerm->delete();
84 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 42 function check() {
43 43 $this->aBreadcrumbs[] = array(
44 44 'url' => $_SERVER['PHP_SELF'],
45   - 'name' => _('Plugins'),
  45 + 'name' => _kt('Plugins'),
46 46 );
47 47 return parent::check();
48 48 }
... ...
plugins/ktcore/admin/roleManagement.php
... ... @@ -36,8 +36,8 @@ class RoleAdminDispatcher extends KTAdminDispatcher {
36 36 }
37 37  
38 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 42 $edit_fields = array();
43 43 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
... ... @@ -46,13 +46,13 @@ class RoleAdminDispatcher extends KTAdminDispatcher {
46 46 if (PEAR::isError($oRole) || ($oRole == false)) { $for_edit = false; }
47 47 else {
48 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 52 $aRoles =& Role::getList('id > 0');
53 53  
54 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 57 $oTemplating =& KTTemplating::getSingleton();
58 58 $oTemplate = $oTemplating->loadTemplate('ktcore/principals/roleadmin');
... ... @@ -70,56 +70,56 @@ class RoleAdminDispatcher extends KTAdminDispatcher {
70 70 function do_createRole() {
71 71 $name = KTUtil::arrayGet($_REQUEST, 'name', null);
72 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 76 $this->startTransaction();
77 77 $oRole = Role::createFromArray(array('name' => $name));
78 78  
79 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 86 function do_updateRole() {
87 87 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id');
88 88 $oRole = Role::get($role_id);
89 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 93 $name = KTUtil::arrayGet($_REQUEST, 'name', null);
94 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 98 $this->startTransaction();
99 99 $oRole->setName($name);
100 100 $res = $oRole->update();
101 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 108 function do_deleteRole() {
109 109 $role_id = KTUtil::arrayGet($_REQUEST, 'role_id');
110 110 $oRole = Role::get($role_id);
111 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 114 $name = $oRole->getName();
115 115  
116 116 $this->startTransaction();
117 117 $res = $oRole->delete();
118 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 38 function check() {
39 39 $this->aBreadcrumbs[] = array(
40 40 'url' => $_SERVER['PHP_SELF'],
41   - 'name' => _('Saved Searches'),
  41 + 'name' => _kt('Saved Searches'),
42 42 );
43 43 return true;
44 44 }
... ... @@ -59,11 +59,11 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
59 59 $aCriteria = Criteria::getAllCriteria();
60 60  
61 61 $aTemplateData = array(
62   - "title" => _("Create a new condition"),
  62 + "title" => _kt("Create a new condition"),
63 63 "aCriteria" => $aCriteria,
64   - "searchButton" => _("Save"),
  64 + "searchButton" => _kt("Save"),
65 65 'context' => $this,
66   - "sNameTitle" => _('New Saved Search'),
  66 + "sNameTitle" => _kt('New Saved Search'),
67 67 );
68 68 return $oTemplate->render($aTemplateData);
69 69 }
... ... @@ -73,15 +73,15 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
73 73 $oSearch = KTSavedSearch::get($id);
74 74  
75 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 79 $res = $oSearch->delete();
80 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 87 function do_view() {
... ... @@ -123,14 +123,14 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
123 123 //print $s;
124 124  
125 125 $aTemplateData = array(
126   - "title" => _("Edit an existing condition"),
  126 + "title" => _kt("Edit an existing condition"),
127 127 "aCriteria" => $aCriteria,
128   - "searchButton" => _("Update Saved Search"),
  128 + "searchButton" => _kt("Update Saved Search"),
129 129 'aSearch' => $aSearch,
130 130 'context' => $this,
131 131 'iSearchId' => $oSearch->getId(),
132 132 'old_name' => $oSearch->getName(),
133   - 'sNameTitle' => _('Edit Search'),
  133 + 'sNameTitle' => _kt('Edit Search'),
134 134 );
135 135 return $oTemplate->render($aTemplateData);
136 136  
... ... @@ -154,7 +154,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
154 154 }
155 155  
156 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 160 //$sName = "Neil's saved search";
... ... @@ -167,9 +167,9 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
167 167  
168 168 $this->oValidator->notError($res, array(
169 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 175 // XXX: Rename to do_save
... ... @@ -187,7 +187,7 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
187 187 }
188 188  
189 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 193 $sNamespace = KTUtil::nameToLocalNamespace('Saved searches', $sName);
... ... @@ -203,9 +203,9 @@ class KTSavedSearchDispatcher extends KTAdminDispatcher {
203 203  
204 204 $this->oValidator->notError($oSearch, array(
205 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 35 var $bAutomaticTransaction = true;
36 36  
37 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 39 return true;
40 40 }
41 41  
... ...
plugins/ktcore/admin/unitManagement.php
... ... @@ -44,13 +44,13 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
44 44 var $bAutomaticTransaction = true;
45 45  
46 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 48 return parent::check();
49 49 }
50 50  
51 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 55 $unit_list =& Unit::getList();
56 56  
... ... @@ -64,11 +64,11 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
64 64 }
65 65  
66 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 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 73 $oTemplating =& KTTemplating::getSingleton();
74 74 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/addunit");
... ... @@ -80,15 +80,15 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
80 80 }
81 81  
82 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 86 $aOptions = array(
87 87 'redirect_to' => array('addUnit'),
88   - 'message' => _('No name given'),
  88 + 'message' => _kt('No name given'),
89 89 );
90 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 92 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
93 93  
94 94 $iFolderId = KTUtil::arrayGet($_REQUEST, 'fFolderId', 1);
... ... @@ -130,7 +130,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
130 130 }
131 131  
132 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 135 $isValid = true;
136 136 if (KTFolderUtil::exists($oFolder, $sName)) {
... ... @@ -154,15 +154,15 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
154 154 function do_createUnit() {
155 155 $aOptions = array(
156 156 'redirect_to' => array('main'),
157   - 'message' => _('Invalid folder chosen'),
  157 + 'message' => _kt('Invalid folder chosen'),
158 158 );
159 159 $oParentFolder = $this->oValidator->validateFolder($_REQUEST['fFolderId'], $aOptions);
160 160 $aOptions = array(
161 161 'redirect_to' => array('addUnit', sprintf('fFolderId=%d', $oParentFolder->getId())),
162   - 'message' => _('No name given'),
  162 + 'message' => _kt('No name given'),
163 163 );
164 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 166 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
167 167  
168 168 $oFolder = KTFolderUtil::add($oParentFolder, $sName, $this->oUser);
... ... @@ -185,7 +185,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
185 185 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']);
186 186  
187 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 190 $oTemplate =& $this->oValidator->validateTemplate('ktcore/principals/editunit');
191 191 $aTemplateData = array(
... ... @@ -200,16 +200,16 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
200 200 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']);
201 201 $aOptions = array(
202 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 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 207 $aOptions['rename'] = $oUnit->getId();
208 208 $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
209 209 $oUnit->setName($sName);
210 210 $res = $oUnit->update();
211 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 214 $iFolderId = $oUnit->getFolderId();
215 215 $oFolder = Folder::get($iFolderId);
... ... @@ -217,14 +217,14 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
217 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 223 function do_deleteUnit() {
224 224 $oUnit =& $this->oValidator->validateUnit($_REQUEST['unit_id']);
225 225  
226 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 229 $oTemplate =& $this->oValidator->validateTemplate('ktcore/principals/deleteunit');
230 230 $aTemplateData = array(
... ... @@ -241,7 +241,7 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
241 241 $res = $oUnit->delete();
242 242 $aOptions = array(
243 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 245 'no_exception' => true,
246 246 );
247 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 43  
44 44 class KTUserAdminDispatcher extends KTAdminDispatcher {
45 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 50 $KTConfig =& KTConfig::getSingleton();
51 51 $alwaysAll = $KTConfig->get("alwaysShowAll");
... ... @@ -63,7 +63,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
63 63  
64 64  
65 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 68 // FIXME handle group search stuff.
69 69 $search_results = null;
... ... @@ -87,9 +87,9 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
87 87  
88 88  
89 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 94 $name = KTUtil::arrayGet($_REQUEST, 'name');
95 95 $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false);
... ... @@ -110,15 +110,15 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
110 110 }
111 111  
112 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 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 123 $aAuthenticationSources =& KTAuthenticationSource::getList();
124 124  
... ... @@ -138,38 +138,38 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
138 138 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
139 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 143 $oProvider->aBreadcrumbs = $this->aBreadcrumbs;
144 144 $oProvider->oPage->setBreadcrumbDetails($oSource->getName());
145   - $oProvider->oPage->setTitle(_("Modify User Details"));
  145 + $oProvider->oPage->setTitle(_kt("Modify User Details"));
146 146  
147 147 $oProvider->dispatch();
148 148 exit(0);
149 149 }
150 150  
151 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 156 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
157 157 $oUser =& User::get($user_id);
158 158  
159 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 161 exit(0);
162 162 }
163 163  
164 164 $this->aBreadcrumbs[] = array('name' => $oUser->getName());
165 165  
166 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 174 $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser);
175 175 if (is_null($oAuthenticationSource)) {
... ... @@ -194,23 +194,23 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
194 194  
195 195  
196 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 201 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
202 202 $oUser =& User::get($user_id);
203 203  
204 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 206 exit(0);
207 207 }
208 208  
209 209 $this->aBreadcrumbs[] = array('name' => $oUser->getName());
210 210  
211 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 215 $oTemplating =& KTTemplating::getSingleton();
216 216 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/updatepassword");
... ... @@ -234,11 +234,11 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
234 234  
235 235  
236 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 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 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 243 // FIXME more validation would be useful.
244 244 // validated and ready..
... ... @@ -246,7 +246,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
246 246  
247 247 $oUser =& User::get($user_id);
248 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 258  
259 259  
260 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 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 288 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
289 289 $oUser = User::get($user_id);
290 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 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 297 // generate a list of groups this user is authorised to assign.
298 298  
299 299 /* FIXME there is a nasty side-effect: if a user cannot assign a group
... ... @@ -348,12 +348,12 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
348 348  
349 349 $name = $this->oValidator->validateString(
350 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 354 $username = $this->oValidator->validateString(
355 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 359 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address');
... ... @@ -374,7 +374,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
374 374  
375 375 $oUser =& User::get($user_id);
376 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 380 $oUser->setName($name);
... ... @@ -393,20 +393,20 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
393 393  
394 394  
395 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 399 $this->commitTransaction();
400   - $this->successRedirectToMain(_('User information updated.'));
  400 + $this->successRedirectToMain(_kt('User information updated.'));
401 401 }
402 402  
403 403 function do_createUser() {
404 404 // FIXME generate and pass the error stack to adduser.
405 405  
406 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 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 410 // FIXME check for non-clashing usernames.
411 411  
412 412 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address');
... ... @@ -424,16 +424,16 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
424 424  
425 425  
426 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 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 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 434 $dupUser =& User::getByUserName($username);
435 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 439 $oUser =& User::createFromArray(array(
... ... @@ -449,31 +449,31 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
449 449 ));
450 450  
451 451 if (PEAR::isError($oUser) || ($oUser == false)) {
452   - $this->errorRedirectToMain(_("failed to create user."));
  452 + $this->errorRedirectToMain(_kt("failed to create user."));
453 453 exit(0);
454 454 }
455 455  
456 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 461 function do_deleteUser() {
462 462 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
463 463 $oUser = User::get($user_id);
464 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 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 472 function do_updateGroups() {
473 473 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
474 474 $oUser = User::get($user_id);
475 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 478 $groupAdded = KTUtil::arrayGet($_REQUEST, 'groupAdded','');
479 479 $groupRemoved = KTUtil::arrayGet($_REQUEST, 'groupRemoved','');
... ... @@ -503,7 +503,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
503 503 }
504 504 $res = $oGroup->addMember($oUser);
505 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 507 } else {
508 508 $groupsAdded[] = $oGroup->getName();
509 509  
... ... @@ -517,7 +517,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
517 517 $oGroup = Group::get($iGroupID);
518 518 $res = $oGroup->removeMember($oUser);
519 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 521 } else {
522 522 $groupsRemoved[] = $oGroup->getName();
523 523 $memberReason = GroupUtil::getMembershipReason($oUser, $oGroup);
... ... @@ -530,20 +530,20 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
530 530 }
531 531  
532 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 534 $sWarnStr .= implode(', ', $addWarnings);
535 535 $_SESSION['KTInfoMessage'][] = $sWarnStr;
536 536 }
537 537  
538 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 540 $sWarnStr .= implode(', ', $removeWarnings);
541 541 $_SESSION['KTInfoMessage'][] = $sWarnStr;
542 542 }
543 543  
544 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 548 $this->commitTransaction();
549 549 $this->successRedirectToMain($msg);
... ... @@ -554,7 +554,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
554 554 $aGroups = GroupUtil::listGroupsForUser($oUser);
555 555 $MAX_GROUPS = 6;
556 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 558 if (count($aGroups) > $MAX_GROUPS) {
559 559 $aGroups = array_slice($aGroups, 0, $MAX_GROUPS);
560 560 $add_elipsis = true;
... ...
plugins/ktcore/admin/workflows.php
... ... @@ -60,13 +60,13 @@ class WorkflowNavigationPortlet extends KTPortlet {
60 60 }
61 61  
62 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 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 71 $oTemplating =& KTTemplating::getSingleton();
72 72 $oTemplate = $oTemplating->loadTemplate("ktcore/workflow/admin_portlet");
... ... @@ -88,7 +88,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
88 88 function check() {
89 89 $this->aBreadcrumbs[] = array(
90 90 'url' => $_SERVER['PHP_SELF'],
91   - 'name' => _('Workflows'),
  91 + 'name' => _kt('Workflows'),
92 92 );
93 93 $this->oWorkflow =& KTWorkflow::get($_REQUEST['fWorkflowId']);
94 94 if (!PEAR::isError($this->oWorkflow)) {
... ... @@ -97,7 +97,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
97 97 'query' => 'action=editWorkflow&fWorkflowId=' . $this->oWorkflow->getId(),
98 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 103 return true;
... ... @@ -239,7 +239,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
239 239 $aInfo = $this->aWorkflowInfo;
240 240  
241 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 245 $aAlways = array();
... ... @@ -258,7 +258,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
258 258  
259 259 $aThese = array_merge($aAlways, $aNamedActions);
260 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 263 // else
264 264 $aActions = array();
... ... @@ -270,16 +270,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
270 270 $aInfo = $this->aWorkflowInfo;
271 271 //var_dump($aInfo['transitions_to_state'][$oState->getId()]);
272 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 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 280 $aT = array();
281 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 285 foreach ($aInfo['transitions_to_state'][$oState->getId()] as $aTransition) {
... ... @@ -326,23 +326,23 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
326 326  
327 327 $sNotify = '';
328 328 if (!empty($aUsers)) {
329   - $sNotify .= '<em>' . _('Users:') . '</em> ';
  329 + $sNotify .= '<em>' . _kt('Users:') . '</em> ';
330 330 $sNotify .= implode(', ', $aUsers);
331 331 }
332 332  
333 333 if (!empty($aGroups)) {
334 334 if (!empty($sNotify)) { $sNotify .= ' &mdash; '; }
335   - $sNotify .= '<em>' . _('Groups:') . '</em> ';
  335 + $sNotify .= '<em>' . _kt('Groups:') . '</em> ';
336 336 $sNotify .= implode(', ', $aGroups);
337 337 }
338 338  
339 339 if (!empty($aRoles)) {
340 340 if (!empty($sNotify)) { $sNotify .= ' &mdash; '; }
341   - $sNotify .= '<em>' . _('Roles:') . '</em> ';
  341 + $sNotify .= '<em>' . _kt('Roles:') . '</em> ';
342 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 347 return $sNotify;
348 348 }
... ... @@ -375,7 +375,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
375 375 $aInfo = $this->aWorkflowInfo;
376 376  
377 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 381 $aT = array();
... ... @@ -392,7 +392,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
392 392 $aPerms = (array) $aInfo['permissions_by_state'][$oState->getId()];
393 393  
394 394 if (empty($aPerms)) {
395   - $aStr = _('No permissions are changed in this state.');
  395 + $aStr = _kt('No permissions are changed in this state.');
396 396 return $aStr;
397 397 }
398 398  
... ... @@ -411,7 +411,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
411 411 function do_main () {
412 412  
413 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 416 $oTemplating =& KTTemplating::getSingleton();
417 417 $oTemplate =& $oTemplating->loadTemplate('ktcore/workflow/listWorkflows');
... ... @@ -438,7 +438,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
438 438 $aStates = $aInfo['states'];
439 439  
440 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 442 $aOptions = array();
443 443 $vocab = array();
444 444 $vocab[0] = 'None - documents cannot use this workflow.';
... ... @@ -446,14 +446,14 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
446 446 $vocab[$state->getId()] = $state->getName();
447 447 }
448 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 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 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 502  
503 503 $this->oValidator->notErrorFalse($res, array(
504 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 509 exit(0);
510 510 }
511 511 // }}}
... ... @@ -521,7 +521,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
521 521  
522 522  
523 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 527 $res = KTWorkflow::createFromArray(array(
... ... @@ -530,9 +530,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
530 530 ));
531 531 $this->oValidator->notError($res, array(
532 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 536 exit(0);
537 537 }
538 538 // }}}
... ... @@ -550,12 +550,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
550 550  
551 551 $this->oValidator->notErrorFalse($res, array(
552 552 'redirect_to' => array('main'),
553   - 'message' => _('Error saving workflow'),
  553 + 'message' => _kt('Error saving workflow'),
554 554 ));
555 555  
556 556 $this->commitTransaction();
557 557  
558   - $this->successRedirectToMain(_('Changes saved'));
  558 + $this->successRedirectToMain(_kt('Changes saved'));
559 559 exit(0);
560 560 }
561 561 // }}}
... ... @@ -610,7 +610,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
610 610 $aInfo = $this->buildWorkflowInfo($oWorkflow);
611 611  
612 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 663 $aConditions = KTSavedSearch::getConditions();
664 664  
665 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 667 $aOptions = array();
668 668 $vocab = array();
669 669 foreach($aInfo['states'] as $state) {
670 670 $vocab[$state->getId()] = $state->getName();
671 671 }
672 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 674 $aOptions = array();
675 675 $vocab = array();
676 676 foreach($aInfo['permissions'] as $permission) {
677 677 $vocab[$permission->getId()] = $permission->getHumanName();
678 678 }
679 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 682 $aOptions = array();
683 683 $vocab = array();
... ... @@ -686,7 +686,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
686 686 $vocab[$group->getId()] = $group->getName();
687 687 }
688 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 690 $aOptions = array();
691 691 $vocab = array();
692 692 $vocab[0] = 'None';
... ... @@ -694,7 +694,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
694 694 $vocab[$role->getId()] = $role->getName();
695 695 }
696 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 699 if (!empty($aConditions)) {
700 700 $aOptions = array();
... ... @@ -704,7 +704,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
704 704 $vocab[$condition->getId()] = $condition->getName();
705 705 }
706 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 739  
740 740 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $transitions);
741 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 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 765  
766 766 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $actions);
767 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 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 776 // {{{ do_setWorkflowActions
... ... @@ -779,9 +779,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
779 779 $res = KTWorkflowUtil::setControlledActionsForWorkflow($oWorkflow, $_REQUEST['fActions']);
780 780 $this->oValidator->notErrorFalse($res, array(
781 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 785 exit(0);
786 786 }
787 787 // }}}
... ... @@ -806,7 +806,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
806 806 // check there are no other states by that name in this workflow
807 807 $aStates = KTWorkflowState::getList(sprintf("workflow_id = %d and name = '%s'", $iWorkflowId, $sName));
808 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 812 $oState = KTWorkflowState::createFromArray(array(
... ... @@ -817,16 +817,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
817 817  
818 818 $this->oValidator->notError($oState, array(
819 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 823 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $_REQUEST['fActions']);
824 824 $this->oValidator->notErrorFalse($res, array(
825 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 830 exit(0);
831 831 }
832 832 // }}}
... ... @@ -853,12 +853,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
853 853 }
854 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 858 $aInformed = KTWorkflowUtil::getInformedForState($oState);
859 859  
860 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 864 $this->getPermissionAssignmentsForState($oState);
... ... @@ -894,9 +894,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
894 894 $res = $oState->update();
895 895 $this->oValidator->notErrorFalse($res, array(
896 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 900 exit(0);
901 901 }
902 902 // }}}
... ... @@ -905,7 +905,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
905 905 $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
906 906 $oState =& $this->oValidator->validateWorkflowState($_REQUEST['fStateId']);
907 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 910 $this->startTransaction();
911 911  
... ... @@ -917,7 +917,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
917 917 array($oState->getId()),
918 918 );
919 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 922 // transitions ending in that state
923 923 $aTransitionNames = array();
... ... @@ -929,10 +929,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
929 929 array($oTransition->getId()),
930 930 );
931 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 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 937 $aTransitionNames[] = $oTransition->getName();
938 938 }
... ... @@ -941,19 +941,19 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
941 941 if ($oState->getId() == $oWorkflow->getStartStateId()) {
942 942 $oWorkflow->setStartStateId(null);
943 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 947 // finally, delete the state
948 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 951 $this->commitTransaction();
952 952 if (!empty($aTransitionNames)) {
953 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 955 } else {
956   - $msg = _('State deleted.');
  956 + $msg = _kt('State deleted.');
957 957 }
958 958  
959 959 $this->successRedirectTo('manageStates', $msg, 'fWorkflowId=' . $oWorkflow->getId());
... ... @@ -987,7 +987,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
987 987 );
988 988 $res = KTWorkflowStatePermissionAssignment::createFromArray($aOpts);
989 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 993 } else {
... ... @@ -1007,7 +1007,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1007 1007  
1008 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 1013 function do_assignStatePermissions() {
... ... @@ -1028,16 +1028,16 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1028 1028 $oAlloc = KTWorkflowStatePermissionAssignment::get($iAllocId);
1029 1029 //var_dump($aAllowed);
1030 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 1033 $oAlloc->setDescriptorId($oDescriptor->getId());
1034 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 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 1043 // {{{ do_saveTransitions
... ... @@ -1047,9 +1047,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1047 1047 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $_REQUEST['fTransitionIds']);
1048 1048 $this->oValidator->notErrorFalse($res, array(
1049 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 1053 exit(0);
1054 1054 }
1055 1055 // }}}
... ... @@ -1058,10 +1058,10 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1058 1058 $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
1059 1059 $oTransition =& KTWorkflowTransition::get($_REQUEST['fTransitionId']);
1060 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 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 1065 $this->startTransaction();
1066 1066  
1067 1067 $sTable = KTUtil::getTableName('workflow_state_transitions');
... ... @@ -1070,12 +1070,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1070 1070 array($oTransition->getId()),
1071 1071 );
1072 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 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 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 1081 // {{{ do_setStateActions
... ... @@ -1085,9 +1085,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1085 1085 $res = KTWorkflowUtil::setEnabledActionsForState($oState, $_REQUEST['fActions']);
1086 1086 $this->oValidator->notErrorFalse($res, array(
1087 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 1091 exit(0);
1092 1092 }
1093 1093 // }}}
... ... @@ -1104,23 +1104,23 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1104 1104 $aNotification['role'] = array();
1105 1105 }
1106 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 1110 if (empty($aNotification['group'])) {
1111 1111 $aNotification['group'] = array();
1112 1112 }
1113 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 1117 $aNotification['user'] = array(); // force override
1118 1118  
1119 1119 $res = KTWorkflowUtil::setInformedForState($oState, $aNotification);
1120 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 1152 // check there are no other transitions by that name in this workflow
1153 1153 $aTransitions = KTWorkflowTransition::getList(sprintf("workflow_id = %d and name = '%s'", $oWorkflow->getId(), $sName));
1154 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 1181 ));
1182 1182 $this->oValidator->notError($res, array(
1183 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 1187 // now attach it to the appropriate states.
... ... @@ -1201,12 +1201,12 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1201 1201 }
1202 1202 $res = KTWorkflowUtil::saveTransitionsFrom($oState, $aTransitionIds);
1203 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 1210 exit(0);
1211 1211 }
1212 1212 // }}}
... ... @@ -1224,14 +1224,14 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1224 1224 $aConditions = KTSavedSearch::getConditions();
1225 1225  
1226 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 1228 $aOptions = array();
1229 1229 $vocab = array();
1230 1230 foreach($aStates as $state) {
1231 1231 $vocab[$state->getId()] = $state->getName();
1232 1232 }
1233 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 1235 $aOptions = array();
1236 1236 $vocab = array();
1237 1237 $vocab[0] = 'None';
... ... @@ -1239,7 +1239,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1239 1239 $vocab[$permission->getId()] = $permission->getHumanName();
1240 1240 }
1241 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 1243 $aOptions = array();
1244 1244 $vocab = array();
1245 1245 $vocab[0] = 'None';
... ... @@ -1247,7 +1247,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1247 1247 $vocab[$group->getId()] = $group->getName();
1248 1248 }
1249 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 1251 $aOptions = array();
1252 1252 $vocab = array();
1253 1253 $vocab[0] = 'None';
... ... @@ -1255,7 +1255,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1255 1255 $vocab[$role->getId()] = $role->getName();
1256 1256 }
1257 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 1260 if (!empty($aConditions)) {
1261 1261 $aOptions = array();
... ... @@ -1265,7 +1265,7 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1265 1265 $vocab[$condition->getId()] = $condition->getName();
1266 1266 }
1267 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 1271 $this->aBreadcrumbs[] = array(
... ... @@ -1328,9 +1328,9 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
1328 1328 $res = $oTransition->update();
1329 1329 $this->oValidator->notErrorFalse($res, array(
1330 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 1334 exit(0);
1335 1335 }
1336 1336 // }}}
... ...
plugins/ktcore/authentication/authenticationadminpage.inc.php
... ... @@ -37,7 +37,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
37 37  
38 38 function check() {
39 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 41 return $res;
42 42 }
43 43  
... ... @@ -45,7 +45,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
45 45 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage');
46 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 50 $aVocab = array();
51 51 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
... ... @@ -54,7 +54,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
54 54 $aVocab[$aProvider[2]] = $aProvider[0];
55 55 }
56 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 59 $aSources = KTAuthenticationSource::getList();
60 60  
... ... @@ -71,7 +71,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
71 71 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/addsource');
72 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 76 $aVocab = array();
77 77 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
... ... @@ -80,7 +80,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
80 80 $aVocab[$aProvider[2]] = $aProvider[0];
81 81 }
82 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 85 $aSources = KTAuthenticationSource::getList();
86 86  
... ... @@ -97,7 +97,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
97 97 $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/viewsource');
98 98 $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']);
99 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 101 $this->oPage->setBreadcrumbDetails('viewing');
102 102 $sProvider = $oSource->getAuthenticationProvider();
103 103 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
... ... @@ -119,12 +119,12 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
119 119 'name' => $oSource->getName(),
120 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 123 $this->oPage->setBreadcrumbDetails('editing');
124 124  
125 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 129 $aVocab = array();
130 130 $oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
... ... @@ -133,7 +133,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
133 133 $aVocab[$aProvider[2]] = $aProvider[0];
134 134 }
135 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 138 $oTemplate->setData(array(
139 139 'context' => &$this,
... ... @@ -161,13 +161,13 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
161 161 $aErrorOptions = array(
162 162 'redirect_to' => array('main'),
163 163 );
164   - $aErrorOptions['message'] = _("No name provided");
  164 + $aErrorOptions['message'] = _kt("No name provided");
165 165 $sName = KTUtil::arrayGet($_REQUEST, 'name');
166 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 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 171 $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider');
172 172 $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions);
173 173  
... ... @@ -185,11 +185,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
185 185 $aErrorOptions = array(
186 186 'redirect_to' => array('main'),
187 187 );
188   - $aErrorOptions['message'] = _("No name provided");
  188 + $aErrorOptions['message'] = _kt("No name provided");
189 189 $sName = KTUtil::arrayGet($_REQUEST, 'name');
190 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 193 $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider');
194 194 $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions);
195 195  
... ... @@ -202,7 +202,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
202 202 'authenticationprovider' => $sProvider,
203 203 ));
204 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 208 function do_deleteSource() {
... ... @@ -213,10 +213,10 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
213 213  
214 214 if (empty($aUsers) && empty($aGroups)) {
215 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 222 function do_editSourceProvider() {
... ...
plugins/ktcore/document/Rename.php
... ... @@ -44,7 +44,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
44 44 var $_sShowPermission = "ktcore.permissions.write";
45 45  
46 46 function getDisplayName() {
47   - return _('Rename');
  47 + return _kt('Rename');
48 48 }
49 49  
50 50 function getInfo() {
... ... @@ -60,7 +60,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
60 60 return $res;
61 61 }
62 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 64 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
65 65 exit(0);
66 66 }
... ... @@ -71,7 +71,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
71 71 $this->oPage->setBreadcrumbDetails("rename");
72 72 $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/rename');
73 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 76 $oTemplate->setData(array(
77 77 'context' => &$this,
... ... @@ -94,7 +94,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
94 94 $_SESSION['KTErrorMessage'][] = $res->getMessage();
95 95 controllerRedirect('viewDocument',sprintf('fDocumentId=%d', $this->oDocument->getId()));
96 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 100 controllerRedirect('viewDocument', sprintf('fDocumentId=%d', $this->oDocument->getId()));
... ...
plugins/ktcore/folder/BulkImport.php
... ... @@ -45,7 +45,7 @@ class KTBulkImportFolderAction extends KTFolderAction {
45 45 var $bAutomaticTransaction = true;
46 46  
47 47 function getDisplayName() {
48   - return _('Import from Server Location');
  48 + return _kt('Import from Server Location');
49 49 }
50 50  
51 51 function getInfo() {
... ... @@ -57,12 +57,12 @@ class KTBulkImportFolderAction extends KTFolderAction {
57 57 }
58 58  
59 59 function do_main() {
60   - $this->oPage->setBreadcrumbDetails(_("bulk import"));
  60 + $this->oPage->setBreadcrumbDetails(_kt("bulk import"));
61 61 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkImport');
62 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 66 foreach (DocumentType::getList() as $oDocumentType) {
67 67 if(!$oDocumentType->getDisabled()) {
68 68 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
... ... @@ -70,7 +70,7 @@ class KTBulkImportFolderAction extends KTFolderAction {
70 70 }
71 71  
72 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 75 $fieldsets = array();
76 76 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
... ... @@ -93,10 +93,10 @@ class KTBulkImportFolderAction extends KTFolderAction {
93 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 97 $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
98 98  
99   - $aErrorOptions['message'] = _('Invalid path provided');
  99 + $aErrorOptions['message'] = _kt('Invalid path provided');
100 100 $sPath = $this->oValidator->validateString($_REQUEST['path'], $aErrorOptions);
101 101  
102 102 $matches = array();
... ... @@ -123,7 +123,7 @@ class KTBulkImportFolderAction extends KTFolderAction {
123 123 $res = $bm->import();
124 124 if (PEAR::isError($res)) {
125 125 DBUtil::rollback();
126   - $_SESSION["KTErrorMessage"][] = _("Bulk import failed") . ": " . $res->getMessage();
  126 + $_SESSION["KTErrorMessage"][] = _kt("Bulk import failed") . ": " . $res->getMessage();
127 127 } else {
128 128 DBUtil::commit();
129 129 $this->addInfoMessage("Bulk import succeeded");
... ...
plugins/ktcore/folder/BulkUpload.php
... ... @@ -43,7 +43,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
43 43 var $bAutomaticTransaction = true;
44 44  
45 45 function getDisplayName() {
46   - return _('Bulk upload');
  46 + return _kt('Bulk upload');
47 47 }
48 48  
49 49 function check() {
... ... @@ -64,19 +64,19 @@ class KTBulkUploadFolderAction extends KTFolderAction {
64 64 }
65 65  
66 66 function do_main() {
67   - $this->oPage->setBreadcrumbDetails(_("bulk upload"));
  67 + $this->oPage->setBreadcrumbDetails(_kt("bulk upload"));
68 68 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkUpload');
69 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 73 foreach (DocumentType::getList() as $oDocumentType) {
74 74 if(!$oDocumentType->getDisabled()) {
75 75 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
76 76 }
77 77 }
78 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 81 $fieldsets = array();
82 82 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
... ... @@ -99,7 +99,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
99 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 103 $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
104 104  
105 105 unset($aErrorOptions['message']);
... ... @@ -122,7 +122,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
122 122 $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions);
123 123 $this->startTransaction();
124 124 $res = $bm->import();
125   - $aErrorOptions['message'] = _("Bulk upload failed");
  125 + $aErrorOptions['message'] = _kt("Bulk upload failed");
126 126 $this->oValidator->notError($res, $aErrorOptions);
127 127  
128 128 $this->addInfoMessage("Bulk upload successful");
... ...
plugins/ktcore/folder/Rename.php
... ... @@ -40,7 +40,7 @@ class KTFolderRenameAction extends KTFolderAction {
40 40 var $_sShowPermission = "ktcore.permissions.write";
41 41  
42 42 function getDisplayName() {
43   - return _('Rename');
  43 + return _kt('Rename');
44 44 }
45 45  
46 46 function getInfo() {
... ... @@ -49,12 +49,12 @@ class KTFolderRenameAction extends KTFolderAction {
49 49 }
50 50  
51 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 54 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/rename');
55 55  
56 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 59 $oTemplate->setData(array(
60 60 'context' => &$this,
... ... @@ -77,7 +77,7 @@ class KTFolderRenameAction extends KTFolderAction {
77 77 redirect(KTBrowseUtil::getUrlForFolder($this->oFolder));
78 78 exit(0);
79 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 83 $this->commitTransaction();
... ...
plugins/ktcore/folder/addDocument.php
... ... @@ -41,7 +41,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
41 41 var $oDocumentType = null;
42 42  
43 43 function getDisplayName() {
44   - return _('Add Document');
  44 + return _kt('Add Document');
45 45 }
46 46  
47 47 function check() {
... ... @@ -62,15 +62,15 @@ class KTFolderAddDocumentAction extends KTFolderAction {
62 62 }
63 63  
64 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 67 $oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add');
68 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 74 foreach (DocumentType::getList() as $oDocumentType) {
75 75 if(!$oDocumentType->getDisabled()) {
76 76 $aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
... ... @@ -78,7 +78,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
78 78 }
79 79  
80 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 83 $fieldsets = array();
84 84 $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
... ... @@ -97,8 +97,8 @@ class KTFolderAddDocumentAction extends KTFolderAction {
97 97 }
98 98  
99 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 102 $mpo =& new JavascriptObserver($this);
103 103 // $mpo =& new KTSinglePageObserver(&$this);
104 104 $oUploadChannel =& KTUploadChannel::getSingleton();
... ... @@ -121,12 +121,12 @@ class KTFolderAddDocumentAction extends KTFolderAction {
121 121 /*
122 122 // this is now done in ::add
123 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 125 exit(0);
126 126 }
127 127  
128 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 130 exit(0);
131 131 }
132 132 */
... ... @@ -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 143 $this->oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
144 144  
145 145 $aOptions = array(
... ...
plugins/ktstandard/KTBulkExportPlugin.php
... ... @@ -45,7 +45,7 @@ class KTBulkExportAction extends KTFolderAction {
45 45 var $sPermissionName = "ktcore.permissions.read";
46 46  
47 47 function getDisplayName() {
48   - return _('Bulk Export');
  48 + return _kt('Bulk Export');
49 49 }
50 50  
51 51 function do_main() {
... ... @@ -55,7 +55,7 @@ class KTBulkExportAction extends KTFolderAction {
55 55 $aDocumentIds = DBUtil::getResultArrayKey($aQuery, 'id');
56 56  
57 57 if (empty($aDocumentIds)) {
58   - $this->addErrorMessage(_("No documents found to export"));
  58 + $this->addErrorMessage(_kt("No documents found to export"));
59 59 redirect(KTBrowseUtil::getUrlForFolder($oFolder));
60 60 exit(0);
61 61 }
... ...
plugins/ktstandard/KTDiscussion.php
... ... @@ -91,17 +91,17 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
91 91 var $sName = 'ktcore.actions.document.discussion';
92 92  
93 93 function getDisplayName() {
94   - return _('Discussion');
  94 + return _kt('Discussion');
95 95 }
96 96  
97 97 function do_main() {
98   - $this->oPage->setBreadcrumbDetails(_("discussion"));
  98 + $this->oPage->setBreadcrumbDetails(_kt("discussion"));
99 99 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion');
100 100  
101 101 // Fields for new thread creation
102 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 106 $threads = DiscussionThread::getList(array('document_id=?', array($this->oDocument->getId())));
107 107  
... ... @@ -119,11 +119,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
119 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 123 $sSubject = KTUtil::arrayGet($_REQUEST, 'subject');
124 124 $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions);
125 125  
126   - $aErrorOptions['message'] = _("No body provided");
  126 + $aErrorOptions['message'] = _kt("No body provided");
127 127 $sBody = KTUtil::arrayGet($_REQUEST, 'body');
128 128 $sBody = $this->oValidator->validateString($sBody, $aErrorOptions);
129 129  
... ... @@ -134,7 +134,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
134 134 'documentid' => $this->oDocument->getId(),
135 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 138 $this->oValidator->notError($oThread, $aErrorOptions);
139 139  
140 140 $oComment = DiscussionComment::createFromArray(array(
... ... @@ -143,19 +143,19 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
143 143 'subject' => $sSubject,
144 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 147 $this->oValidator->notError($oComment, $aErrorOptions);
148 148  
149 149 $oThread->setFirstCommentId($oComment->getId());
150 150 $oThread->setLastCommentId($oComment->getId());
151 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 153 $this->oValidator->notError($res, $aErrorOptions);
154 154  
155 155 // Thread and comment created correctly, commit to database
156 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 159 exit(0);
160 160 }
161 161  
... ... @@ -168,20 +168,20 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
168 168  
169 169 // breadcrumbs...
170 170 $this->aBreadcrumbs[] = array(
171   - 'name' => _('discussion'),
  171 + 'name' => _kt('discussion'),
172 172 'query' => sprintf('fDocumentId=%d', $this->oDocument->getId()),
173 173 );
174 174 $this->aBreadcrumbs[] = array(
175 175 'name' => $oComment->getSubject(),
176 176 );
177   - $this->oPage->setBreadcrumbDetails(_("viewing comments"));
  177 + $this->oPage->setBreadcrumbDetails(_kt("viewing comments"));
178 178  
179 179 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion_thread');
180 180  
181 181 // Fields for new thread creation
182 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 186 // Fields for closing thread (if user has write permission)
187 187 $closeFields = array();
... ... @@ -189,7 +189,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
189 189 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
190 190 if (PEAR::isError($oPermission) ||
191 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 195 // increment views
... ... @@ -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 225 $sSubject = KTUtil::arrayGet($_REQUEST, 'subject');
226 226 $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions);
227 227  
228   - $aErrorOptions['message'] = _("No body provided");
  228 + $aErrorOptions['message'] = _kt("No body provided");
229 229 $sBody = KTUtil::arrayGet($_REQUEST, 'body');
230 230 $sBody = $this->oValidator->validateString($sBody, $aErrorOptions);
231 231  
... ... @@ -239,7 +239,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
239 239 'subject' => $sSubject,
240 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 243 $this->oValidator->notError($oComment, $aErrorOptions);
244 244  
245 245 // Update thread
... ... @@ -248,7 +248,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
248 248  
249 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 252 $this->oValidator->notError($res, $aErrorOptions);
253 253  
254 254  
... ... @@ -256,7 +256,7 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
256 256 // Thread and comment created correctly, commit to database
257 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 260 exit(0);
261 261 }
262 262  
... ... @@ -277,13 +277,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
277 277 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
278 278  
279 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 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 287 $sReason = KTUtil::arrayGet($_REQUEST, 'reason');
288 288 $sReason = $this->oValidator->validateString($sReason, $aErrorOptions);
289 289  
... ... @@ -295,13 +295,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
295 295 $oThread->setCloseReason($sReason);
296 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 299 $this->oValidator->notError($res, $aErrorOptions);
300 300  
301 301 // Thread closed correctly, so commit
302 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 305 exit(0);
306 306 }
307 307  
... ...
plugins/ktstandard/KTDocumentLinks.php
... ... @@ -46,7 +46,7 @@ class KTDocumentLinkTitle extends TitleColumn {
46 46 $outStr .= $aDataRow["document"]->getName();
47 47 $outStr .= '</a>';
48 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 51 return $outStr;
52 52 }
... ... @@ -75,14 +75,14 @@ class KTDocumentLinkAction extends KTDocumentAction {
75 75 var $sName = 'ktcore.actions.document.link';
76 76  
77 77 function getDisplayName() {
78   - return _('Links');
  78 + return _kt('Links');
79 79 }
80 80  
81 81 // display existing links
82 82 function do_main() {
83 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 87 $oDocument = Document::get(
88 88 KTUtil::arrayGet($_REQUEST, 'fDocumentId', 0)
... ... @@ -109,26 +109,26 @@ class KTDocumentLinkAction extends KTDocumentAction {
109 109  
110 110 // select a target for the link
111 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 115 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
116 116 if (PEAR::isError($oPermission) ||
117 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 119 exit(0);
120 120 }
121 121  
122 122 $oParentDocument =& $this->oDocument;
123 123  
124 124 if (PEAR::isError($oParentDocument)) {
125   - $this->errorRedirectToMain(_('Invalid parent document selected.'));
  125 + $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
126 126 exit(0);
127 127 }
128 128  
129 129 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', $oParentDocument->getFolderID()));
130 130 if (PEAR::isError($oFolder) || ($oFolder == false)) {
131   - $this->errorRedirectToMain(_('Invalid folder selected.'));
  131 + $this->errorRedirectToMain(_kt('Invalid folder selected.'));
132 132 exit(0);
133 133 }
134 134 $iFolderId = $oFolder->getId();
... ... @@ -187,17 +187,17 @@ class KTDocumentLinkAction extends KTDocumentAction {
187 187  
188 188 // select a type for the link
189 189 function do_type_select() {
190   - $this->oPage->setBreadcrumbDetails(_("link"));
  190 + $this->oPage->setBreadcrumbDetails(_kt("link"));
191 191  
192 192 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
193 193 if (PEAR::isError($oParentDocument)) {
194   - $this->errorRedirectToMain(_('Invalid parent document selected.'));
  194 + $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
195 195 exit(0);
196 196 }
197 197  
198 198 $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId'));
199 199 if (PEAR::isError($oTargetDocument)) {
200   - $this->errorRedirectToMain(_('Invalid target document selected.'));
  200 + $this->errorRedirectToMain(_kt('Invalid target document selected.'));
201 201 exit(0);
202 202 }
203 203  
... ... @@ -212,8 +212,8 @@ class KTDocumentLinkAction extends KTDocumentAction {
212 212  
213 213 $aOptions = array('vocab' => $aVocab);
214 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 217 'fLinkTypeId',
218 218 null,
219 219 $this->oPage,
... ... @@ -239,24 +239,24 @@ class KTDocumentLinkAction extends KTDocumentAction {
239 239  
240 240 // make the link
241 241 function do_make_link() {
242   - $this->oPage->setBreadcrumbDetails(_("link"));
  242 + $this->oPage->setBreadcrumbDetails(_kt("link"));
243 243  
244 244 // check validity of things
245 245 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
246 246 if (PEAR::isError($oParentDocument)) {
247   - $this->errorRedirectToMain(_('Invalid parent document selected.'));
  247 + $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
248 248 exit(0);
249 249 }
250 250  
251 251 $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId'));
252 252 if (PEAR::isError($oTargetDocument)) {
253   - $this->errorRedirectToMain(_('Invalid target document selected.'));
  253 + $this->errorRedirectToMain(_kt('Invalid target document selected.'));
254 254 exit(0);
255 255 }
256 256  
257 257 $oLinkType = LinkType::get(KTUtil::arrayGet($_REQUEST, 'fLinkTypeId'));
258 258 if (PEAR::isError($oLinkType)) {
259   - $this->errorRedirectToMain(_('Invalid link type selected.'));
  259 + $this->errorRedirectToMain(_kt('Invalid link type selected.'));
260 260 exit(0);
261 261 }
262 262  
... ... @@ -271,26 +271,26 @@ class KTDocumentLinkAction extends KTDocumentAction {
271 271 ));
272 272  
273 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 275 exit(0);
276 276 }
277 277  
278 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 281 exit(0);
282 282 }
283 283  
284 284  
285 285 // delete a link
286 286 function do_delete() {
287   - $this->oPage->setBreadcrumbDetails(_("link"));
  287 + $this->oPage->setBreadcrumbDetails(_kt("link"));
288 288  
289 289 // check security
290 290 $oPermission =& KTPermission::getByName('ktcore.permissions.write');
291 291 if (PEAR::isError($oPermission) ||
292 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 294 exit(0);
295 295 }
296 296  
... ... @@ -298,12 +298,12 @@ class KTDocumentLinkAction extends KTDocumentAction {
298 298 // check validity of things
299 299 $oDocumentLink = DocumentLink::get(KTUtil::arrayGet($_REQUEST, 'fDocumentLinkId'));
300 300 if (PEAR::isError($oDocumentLink)) {
301   - $this->errorRedirectToMain(_('Invalid document link selected.'));
  301 + $this->errorRedirectToMain(_kt('Invalid document link selected.'));
302 302 exit(0);
303 303 }
304 304 $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
305 305 if (PEAR::isError($oParentDocument)) {
306   - $this->errorRedirectToMain(_('Invalid document selected.'));
  306 + $this->errorRedirectToMain(_kt('Invalid document selected.'));
307 307 exit(0);
308 308 }
309 309  
... ... @@ -313,13 +313,13 @@ class KTDocumentLinkAction extends KTDocumentAction {
313 313 $res = $oDocumentLink->delete();
314 314  
315 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 317 exit(0);
318 318 }
319 319  
320 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 323 exit(0);
324 324 }
325 325  
... ...
plugins/ktstandard/KTEmail.php
... ... @@ -230,7 +230,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
230 230 var $sName = 'ktcore.actions.document.email';
231 231  
232 232 function getDisplayName() {
233   - return _('Email');
  233 + return _kt('Email');
234 234 }
235 235  
236 236 function do_main() {
... ... @@ -240,12 +240,12 @@ class KTDocumentEmailAction extends KTDocumentAction {
240 240 $bAttachment = $oConfig->get('email/allowAttachment', false);
241 241 $bEmailAddresses = $oConfig->get('email/allowEmailAddresses', false);
242 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 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 249 $aGroups = Group::getList();
250 250 $aUsers = User::getEmailUsers();
251 251 $aTemplateData = array(
... ... @@ -294,7 +294,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
294 294  
295 295 //if we're going to send a mail, first make there is someone to send it to
296 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 298 exit(0);
299 299 }
300 300  
... ... @@ -311,7 +311,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
311 311 $_SESSION['KTErrorMessage'][] = join("<br />\n", $aEmailErrors);
312 312 }
313 313  
314   - $_SESSION['KTInfoMessage'][] = _("Email sent");
  314 + $_SESSION['KTInfoMessage'][] = _kt("Email sent");
315 315 //go back to the document view page
316 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 73 // {{{ KTSubscriptionPortlet
74 74 class KTSubscriptionPortlet extends KTPortlet {
75 75 function KTSubscriptionPortlet() {
76   - parent::KTPortlet(_("Subscriptions"));
  76 + parent::KTPortlet(_kt("Subscriptions"));
77 77 }
78 78  
79 79 function render() {
... ... @@ -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 113 $oTemplating =& KTTemplating::getSingleton();
114 114 $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet");
... ... @@ -125,7 +125,7 @@ class KTDocumentSubscriptionAction extends KTDocumentAction {
125 125 var $sName = 'ktstandard.subscription.documentsubscription';
126 126  
127 127 function getDisplayName() {
128   - return _('Subscribe to document');
  128 + return _kt('Subscribe to document');
129 129 }
130 130  
131 131 function getInfo() {
... ... @@ -138,14 +138,14 @@ class KTDocumentSubscriptionAction extends KTDocumentAction {
138 138 function do_main() {
139 139 $iSubscriptionType = SubscriptionEvent::subTypes('Document');
140 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 142 } else {
143 143 $oSubscription = new Subscription($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType);
144 144 $res = $oSubscription->create();
145 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 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 151 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
... ... @@ -159,7 +159,7 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction {
159 159 var $sName = 'ktstandard.subscription.documentunsubscription';
160 160  
161 161 function getDisplayName() {
162   - return _('Unsubscribe from document');
  162 + return _kt('Unsubscribe from document');
163 163 }
164 164  
165 165 function getInfo() {
... ... @@ -172,14 +172,14 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction {
172 172 function do_main() {
173 173 $iSubscriptionType = SubscriptionEvent::subTypes('Document');
174 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 176 } else {
177 177 $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType);
178 178 $res = $oSubscription->delete();
179 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 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 185 controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
... ... @@ -297,7 +297,7 @@ class KTFolderSubscriptionAction extends KTFolderAction {
297 297 var $sName = 'ktstandard.subscription.foldersubscription';
298 298  
299 299 function getDisplayName() {
300   - return _('Subscribe to folder');
  300 + return _kt('Subscribe to folder');
301 301 }
302 302  
303 303 function getInfo() {
... ... @@ -311,14 +311,14 @@ class KTFolderSubscriptionAction extends KTFolderAction {
311 311 function do_main() {
312 312 $iSubscriptionType = SubscriptionEvent::subTypes('Folder');
313 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 315 } else {
316 316 $oSubscription = new Subscription($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType);
317 317 $res = $oSubscription->create();
318 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 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 324 controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId());
... ... @@ -332,7 +332,7 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
332 332 var $sName = 'ktstandard.subscription.folderunsubscription';
333 333  
334 334 function getDisplayName() {
335   - return _('Unsubscribe from folder');
  335 + return _kt('Unsubscribe from folder');
336 336 }
337 337  
338 338 function getInfo() {
... ... @@ -345,14 +345,14 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
345 345 function do_main() {
346 346 $iSubscriptionType = SubscriptionEvent::subTypes('Folder');
347 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 349 } else {
350 350 $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType);
351 351 $res = $oSubscription->delete();
352 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 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 358 controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId());
... ... @@ -364,7 +364,7 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
364 364 // {{{ KTSubscriptionManagePage
365 365 class KTSubscriptionManagePage extends KTStandardDispatcher {
366 366 function do_main() {
367   - $this->aBreadcrumbs[] = array("name" => _("Subscription Management"));
  367 + $this->aBreadcrumbs[] = array("name" => _kt("Subscription Management"));
368 368 $aFolderSubscriptions = SubscriptionManager::retrieveUserSubscriptions(
369 369 $this->oUser->getId(), SubscriptionEvent::subTypes('Folder'));
370 370 $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions(
... ... @@ -385,7 +385,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher {
385 385 $foldersubscriptions = KTUtil::arrayGet($_REQUEST, 'foldersubscriptions');
386 386 $documentsubscriptions = KTUtil::arrayGet($_REQUEST, 'documentsubscriptions');
387 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 391 $iSuccesses = 0;
... ... @@ -415,9 +415,9 @@ class KTSubscriptionManagePage extends KTStandardDispatcher {
415 415 }
416 416 }
417 417  
418   - $sMessage = _("Subscriptions removed") . ": ";
  418 + $sMessage = _kt("Subscriptions removed") . ": ";
419 419 if ($iFailures) {
420   - $sMessage .= sprintf(_('%d successful, %d failures'), $iSuccesses, $iFailures);
  420 + $sMessage .= sprintf(_kt('%d successful, %d failures'), $iSuccesses, $iFailures);
421 421 } else {
422 422 $sMessage .= sprintf('%d', $iSuccesses);
423 423 }
... ...
plugins/ktstandard/KTWorkflowAssociation.php
... ... @@ -43,8 +43,8 @@ class KTWorkflowAssociationPlugin extends KTPlugin {
43 43 $this->registerTrigger('edit', 'postValidate', 'KTWADEditTrigger',
44 44 'ktstandard.triggers.workflowassociation.editDocument');
45 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 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 85 if (empty($sUnzipCommand)) {
86 86 return false;
87 87 }
88   - return _('Built-in');
  88 + return _kt('Built-in');
89 89 }
90 90  
91 91 function findLocalCommand() {
... ... @@ -98,7 +98,7 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger {
98 98  
99 99 // can't find the local command.
100 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 104 return null;
... ...
plugins/ktstandard/contents/PdfIndexer.php
... ... @@ -48,7 +48,7 @@ class KTPdfIndexerTrigger extends KTBaseIndexerTrigger {
48 48  
49 49 // can't find the local command.
50 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 54 return null;
... ...
plugins/ktstandard/contents/PowerpointIndexer.php
... ... @@ -45,7 +45,7 @@ class KTPowerpointIndexerTrigger extends KTBaseIndexerTrigger {
45 45  
46 46 // can't find the local command.
47 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 51 return null;
... ...
plugins/ktstandard/contents/PsIndexer.php
... ... @@ -47,7 +47,7 @@ class KTPostscriptIndexerTrigger extends KTBaseIndexerTrigger {
47 47  
48 48 // can't find the local command.
49 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 53 return null;
... ...
plugins/ktstandard/contents/WordIndexer.php
... ... @@ -62,7 +62,7 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger {
62 62  
63 63 // can't find the local command.
64 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 68 return null;
... ...
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
... ... @@ -39,12 +39,12 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
39 39 function KTLDAPBaseAuthenticationProvider() {
40 40 parent::KTAuthenticationProvider();
41 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 58 $sRet = "<dl>\n";
59 59 foreach ($this->aConfigMap as $sSettingName => $sName) {
60 60 $sRet .= " <dt>$sName</dt>\n";
61   - $sValue = KTUtil::arrayGet($aConfig, $sSettingName, _("Unset"));
  61 + $sValue = KTUtil::arrayGet($aConfig, $sSettingName, _kt("Unset"));
62 62 if (is_array($sValue)) {
63 63 $sRet .= " <dd>" . join("<br />", $sValue) . "</dd>\n";
64 64 } else {
... ... @@ -72,7 +72,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
72 72  
73 73 // {{{ showUserSource
74 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 86 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
87 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 90 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapedituser');
91 91  
92 92 $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser);
... ... @@ -94,7 +94,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
94 94 $dn = $oUser->getAuthenticationDetails();
95 95  
96 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 99 $aTemplateData = array(
100 100 'context' => &$this,
... ... @@ -116,7 +116,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
116 116 }
117 117 $oUser->setAuthenticationDetails($dn);
118 118 $oUser->update();
119   - $this->successRedirectTo("editUser", _("Details updated"),
  119 + $this->successRedirectTo("editUser", _kt("Details updated"),
120 120 sprintf('user_id=%d', $oUser->getId()));
121 121 }
122 122 // }}}
... ... @@ -124,7 +124,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
124 124 // {{{ do_editSourceProvider
125 125 function do_editSourceProvider() {
126 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 128 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapeditsource');
129 129 $iSourceId = KTUtil::arrayGet($_REQUEST, 'source_id');
130 130 $oSource = KTAuthenticationSource::get($iSourceId);
... ... @@ -135,16 +135,16 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
135 135 $aConfig['searchattributes'] = KTUtil::arrayGet($aConfig, 'searchattributes', split(',', 'cn,mail,sAMAccountName'));
136 136 $aConfig['objectclasses'] = KTUtil::arrayGet($aConfig, 'objectclasses', split(',', 'user,inetOrgPerson,posixAccount'));
137 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 142 $aOptions = array(
143 143 'rows' => 7,
144 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 148 $aTemplateData = array(
149 149 'context' => &$this,
150 150 'fields' => $fields,
... ... @@ -183,7 +183,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
183 183 }
184 184 $oSource->setConfig(serialize($aConfig));
185 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 204 $oAuthenticator = $this->getAuthenticator($oSource);
205 205 $aResults = $oAuthenticator->getUser($id);
206 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 209 $this->oValidator->notError($aResults);
210 210  
211 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 220 $aTemplateData = array(
221 221 'context' => &$this,
... ... @@ -235,9 +235,9 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
235 235 $dn = KTUtil::arrayGet($_REQUEST, 'dn');
236 236 $samaccountname = KTUtil::arrayGet($_REQUEST, 'samaccountname');
237 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 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 241 // FIXME check for non-clashing usernames.
242 242  
243 243 $email_address = KTUtil::arrayGet($_REQUEST, 'email_address');
... ... @@ -261,11 +261,11 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
261 261 ));
262 262  
263 263 if (PEAR::isError($oUser) || ($oUser == false)) {
264   - $this->errorRedirectToMain(_("failed to create user."));
  264 + $this->errorRedirectToMain(_kt("failed to create user."));
265 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 269 exit(0);
270 270 }
271 271 // }}}
... ... @@ -298,7 +298,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
298 298 ));
299 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 318 return $this->_do_editUserFromSource();
319 319 }
320 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 324 if (KTUtil::arrayGet($submit, 'create')) {
... ... @@ -328,8 +328,8 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
328 328 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchuser');
329 329  
330 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 334 $oAuthenticator = $this->getAuthenticator($oSource);
335 335 $name = KTUtil::arrayGet($_REQUEST, 'ldap_name');
... ... @@ -366,7 +366,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
366 366 if (!empty($id)) {
367 367 return $this->_do_editGroupFromSource();
368 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 372 if (KTUtil::arrayGet($submit, 'create')) {
... ... @@ -376,7 +376,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
376 376 $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchgroup');
377 377  
378 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 381 $oAuthenticator = $this->getAuthenticator($oSource);
382 382 $name = KTUtil::arrayGet($_REQUEST, 'name');
... ... @@ -408,10 +408,10 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
408 408 $aAttributes = $oAuthenticator->getGroup($id);
409 409  
410 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 416 $aTemplateData = array(
417 417 'context' => &$this,
... ... @@ -429,7 +429,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
429 429 $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']);
430 430 $dn = KTUtil::arrayGet($_REQUEST, 'dn');
431 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 434 $is_unitadmin = KTUtil::arrayGet($_REQUEST, 'is_unitadmin', false);
435 435 $is_sysadmin = KTUtil::arrayGet($_REQUEST, 'is_sysadmin', false);
... ... @@ -443,14 +443,14 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
443 443 ));
444 444  
445 445 if (PEAR::isError($oGroup) || ($oGroup == false)) {
446   - $this->errorRedirectToMain(_("failed to create group."));
  446 + $this->errorRedirectToMain(_kt("failed to create group."));
447 447 exit(0);
448 448 }
449 449  
450 450 $oAuthenticator = $this->getAuthenticator($oSource);
451 451 $oAuthenticator->synchroniseGroup($oGroup);
452 452  
453   - $this->successRedirectToMain(_('Created new group') . ': ' . $oGroup->getName());
  453 + $this->successRedirectToMain(_kt('Created new group') . ': ' . $oGroup->getName());
454 454 exit(0);
455 455 }
456 456 // }}}
... ...
plugins/ktstandard/workflow/FolderAssociator.php
... ... @@ -82,18 +82,18 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
82 82 var $_sShowPermission = "ktcore.permissions.addFolder";
83 83  
84 84 function getDisplayName() {
85   - return _('Configure Workflows');
  85 + return _kt('Configure Workflows');
86 86 }
87 87  
88 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 91 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/workflow/folderconfigure');
92 92 $fields = array();
93 93  
94 94 $aWorkflows = KTWorkflow::getList('start_state_id IS NOT NULL');
95 95 $aVocab = array();
96   - $aVocab[] = _('No automatic workflow.');
  96 + $aVocab[] = _kt('No automatic workflow.');
97 97 foreach ($aWorkflows as $oWorkflow) {
98 98 $aVocab[$oWorkflow->getId()] = $oWorkflow->getName();
99 99 }
... ... @@ -107,7 +107,7 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
107 107 if (PEAR::isError($res)) {
108 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 113 $oTemplate->setData(array(
... ... @@ -128,7 +128,7 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
128 128 DBUtil::runQuery(array($sQuery, $aParams));
129 129  
130 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 134 $aOptions = array('noid' => true);
... ... @@ -140,10 +140,10 @@ class FolderWorkflowAssignmentFolderAction extends KTFolderAction {
140 140 ), $aOptions);
141 141  
142 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 44  
45 45 if ($res == 'ktstandard.triggers.workflowassociation.documenttype.handler') {
46 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 49 $this->registeri18n('knowledgeTree', KT_DIR . '/i18n');
50 50 }
51 51  
... ... @@ -83,7 +83,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher {
83 83 $res = parent::check();
84 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 88 return true;
89 89 }
... ... @@ -97,7 +97,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher {
97 97  
98 98 $aTypeMapping = array();
99 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 101 } else {
102 102 foreach ($res as $aRow) {
103 103 $aTypeMapping[$aRow['document_type_id']] = $aRow['workflow_id'];
... ... @@ -142,7 +142,7 @@ class WorkflowTypeAllocationDispatcher extends KTAdminDispatcher {
142 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 40 $res = parent::check();
41 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 45 return true;
46 46 }
... ... @@ -55,7 +55,7 @@ class WorkflowAllocationSelection extends KTAdminDispatcher {
55 55 foreach ($aTriggers as $aTrigger) {
56 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 60 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/workflow/allocator_selection');
61 61 $oTemplate->setData(array(
... ... @@ -84,10 +84,10 @@ class WorkflowAllocationSelection extends KTAdminDispatcher {
84 84 $sQuery .= ' WHERE event_ns = ?';
85 85 $aParams = array('ktstandard.workflowassociation.handler');
86 86 DBUtil::runQuery(array($sQuery, $aParams));
87   - $this->successRedirectToMain(_('Handler removed.'));
  87 + $this->successRedirectToMain(_kt('Handler removed.'));
88 88 } else {
89 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 103 $sQuery .= ' VALUES ("ktstandard.workflowassociation.handler",?)';
104 104 $aParams = array($selection_ns);
105 105 DBUtil::runQuery(array($sQuery, $aParams));
106   - $this->successRedirectToMain(_('Handler set.'));
  106 + $this->successRedirectToMain(_kt('Handler set.'));
107 107 }
108 108 }
109 109 }
... ...