Commit 2d4c41eab9518b664fd41c6562a96fc57c8b8a4f

Authored by nbm
1 parent f4e24e90

Change from gettext's _ to internal i18n infrastructure's _kt


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5147 c91229c3-7414-0410-bfa2-8a42b809f60b
admin.php
... ... @@ -65,7 +65,7 @@ class AdminSplashDispatcher extends KTAdminDispatcher {
65 65 }
66 66 }
67 67  
68   - $this->oPage->title = _("DMS Administration") . ": ";
  68 + $this->oPage->title = _kt("DMS Administration") . ": ";
69 69 $oTemplating =& KTTemplating::getSingleton();
70 70  
71 71 if ($condensed_admin) {
... ... @@ -95,7 +95,7 @@ class AdminSplashDispatcher extends KTAdminDispatcher {
95 95 $this->aBreadcrumbs[] = array("name" => $aCategory["title"], "url" => KTUtil::ktLink('admin.php',$category));
96 96  
97 97  
98   - $this->oPage->title = _("DMS Administration") . ": " . $aCategory["title"];
  98 + $this->oPage->title = _kt("DMS Administration") . ": " . $aCategory["title"];
99 99 $oTemplating =& KTTemplating::getSingleton();
100 100 $oTemplate = $oTemplating->loadTemplate("kt3/admin_items");
101 101 $aTemplateData = array(
... ...
browse.php
... ... @@ -66,7 +66,7 @@ class KTMassMoveColumn extends TitleColumn {
66 66 $outStr .= $aDataRow["folder"]->getName();
67 67 $outStr .= '</a>';
68 68 } else {
69   - $outStr = $aDataRow["folder"]->getName() . ' <span class="descriptiveText">(' . _('you cannot move folders to themselves') . ')';
  69 + $outStr = $aDataRow["folder"]->getName() . ' <span class="descriptiveText">(' . _kt('you cannot move folders to themselves') . ')';
70 70 }
71 71 return $outStr;
72 72  
... ... @@ -91,7 +91,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
91 91  
92 92 function BrowseDispatcher() {
93 93 $this->aBreadcrumbs = array(
94   - array('action' => 'browse', 'name' => _('Browse')),
  94 + array('action' => 'browse', 'name' => _kt('Browse')),
95 95 );
96 96 return parent::KTStandardDispatcher();
97 97 }
... ... @@ -139,12 +139,12 @@ class BrowseDispatcher extends KTStandardDispatcher {
139 139 $this->editable = false;
140 140 }
141 141  
142   - $this->oPage->setTitle(_('Browse'));
  142 + $this->oPage->setTitle(_kt('Browse'));
143 143 $this->oPage->setSecondaryTitle($oFolder->getName());
144 144  
145 145 $this->oFolder =& $oFolder;
146 146 if (PEAR::isError($oFolder)) {
147   - $this->oPage->addError(_("invalid folder"));
  147 + $this->oPage->addError(_kt("invalid folder"));
148 148 $folder_id = 1;
149 149 $oFolder =& Folder::get($folder_id);
150 150 }
... ... @@ -158,7 +158,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
158 158 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs,
159 159 KTBrowseUtil::breadcrumbsForFolder($oFolder));
160 160  
161   - $portlet = new KTActionPortlet(_("Folder Actions"));
  161 + $portlet = new KTActionPortlet(_kt("Folder Actions"));
162 162 $aActions = KTFolderActionUtil::getFolderActionsForFolder($oFolder, $this->oUser);
163 163 $portlet->setActions($aActions,null);
164 164 $this->oPage->addPortlet($portlet);
... ... @@ -179,7 +179,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
179 179 }
180 180 $this->oQuery = new ValueBrowseQuery($oField, $oValue);
181 181 $this->resultURL = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fBrowseMode=lookup_value&fField=%d&fValue=%d", $field, $value));
182   - $this->aBreadcrumbs[] = array('name' => _('Lookup Values'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectField'));
  182 + $this->aBreadcrumbs[] = array('name' => _kt('Lookup Values'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectField'));
183 183 $this->aBreadcrumbs[] = array('name' => $oField->getName(), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectLookup&fField=' . $oField->getId()));
184 184 $this->aBreadcrumbs[] = array('name' => $oValue->getName(), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fBrowseMode=lookup_value&fField=%d&fValue=%d", $field, $value)));
185 185 } else if ($this->browse_mode == 'document_type') {
... ... @@ -195,7 +195,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
195 195 $this->oQuery = new TypeBrowseQuery($oDocType);
196 196  
197 197 // FIXME probably want to redirect to self + action=selectType
198   - $this->aBreadcrumbs[] = array('name' => _('Document Types'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectType'));
  198 + $this->aBreadcrumbs[] = array('name' => _kt('Document Types'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectType'));
199 199 $this->aBreadcrumbs[] = array('name' => $oDocType->getName(), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'fBrowseMode=document_type&fType=' . $oDocType->getId()));
200 200  
201 201 $this->resultURL = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fType=%s&fBrowseMode=document_type", $doctype));;
... ... @@ -214,10 +214,10 @@ class BrowseDispatcher extends KTStandardDispatcher {
214 214 $collection->addColumn(new SelectionColumn("Browse Selection","selection"));
215 215 $collection->addColumn(new TitleColumn("Test 1 (title)","title"));
216 216 $collection->addColumn(new DownloadColumn('','download'));
217   - $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime"));
218   - $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate"));
219   - $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID'));
220   - $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state'));
  217 + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime"));
  218 + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate"));
  219 + $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID'));
  220 + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state'));
221 221  
222 222  
223 223 // setup the folderside add actions
... ... @@ -261,7 +261,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
261 261 $aFields = DocumentField::getList('has_lookup = 1');
262 262  
263 263 if (empty($aFields)) {
264   - $this->errorRedirectToMain(_('No lookup fields available.'));
  264 + $this->errorRedirectToMain(_kt('No lookup fields available.'));
265 265 exit(0);
266 266 }
267 267  
... ... @@ -326,14 +326,14 @@ class BrowseDispatcher extends KTStandardDispatcher {
326 326 if (!empty($targets)) {
327 327 $target = $targets[0];
328 328 } else {
329   - $this->errorRedirectToMain(_('No action selected.'));
  329 + $this->errorRedirectToMain(_kt('No action selected.'));
330 330 exit(0);
331 331 }
332 332  
333 333 $aFolderSelection = KTUtil::arrayGet($_REQUEST, 'selection_f' , array());
334 334 $aDocumentSelection = KTUtil::arrayGet($_REQUEST, 'selection_d' , array());
335 335 if (empty($aFolderSelection) && empty($aDocumentSelection)) {
336   - $this->errorRedirectToMain(_('Please select documents or folders first.'));
  336 + $this->errorRedirectToMain(_kt('Please select documents or folders first.'));
337 337 exit(0);
338 338 }
339 339  
... ... @@ -342,7 +342,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
342 342 } else if ($target == 'move') {
343 343 return $this->do_startMove();
344 344 } else {
345   - $this->errorRedirectToMain(_('No such action.'));
  345 + $this->errorRedirectToMain(_kt('No such action.'));
346 346 exit(0);
347 347 }
348 348  
... ... @@ -388,7 +388,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
388 388 $documentStr = '';
389 389  
390 390 if (!empty($aCantMove['folders'])) {
391   - $folderStr = '<strong>' . _('Folders: ') . '</strong>';
  391 + $folderStr = '<strong>' . _kt('Folders: ') . '</strong>';
392 392 foreach ($aCantMove['folders'] as $iFolderId) {
393 393 $oF = Folder::get($iFolderId);
394 394 $cantMoveItems['folders'][] = $oF->getName();
... ... @@ -397,7 +397,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
397 397 }
398 398  
399 399 if (!empty($aCantMove['documents'])) {
400   - $documentStr = '<strong>' . _('Documents: ') . '</strong>';
  400 + $documentStr = '<strong>' . _kt('Documents: ') . '</strong>';
401 401 foreach ($aCantMove['documents'] as $iDocId) {
402 402 $oD = Document::get($iDocId);
403 403 $cantMoveItems['documents'][] = $oD->getName();
... ... @@ -406,10 +406,10 @@ class BrowseDispatcher extends KTStandardDispatcher {
406 406 }
407 407  
408 408 if (!empty($folderStr)) {
409   - $_SESSION["KTErrorMessage"][] = _("The following folders can not be moved") . ": " . $folderStr;
  409 + $_SESSION["KTErrorMessage"][] = _kt("The following folders can not be moved") . ": " . $folderStr;
410 410 }
411 411 if (!empty($documentStr)) {
412   - $_SESSION["KTErrorMessage"][] = _("The following documents can not be moved") . ": " . $documentStr;
  412 + $_SESSION["KTErrorMessage"][] = _kt("The following documents can not be moved") . ": " . $documentStr;
413 413 }
414 414 }
415 415  
... ... @@ -417,14 +417,14 @@ class BrowseDispatcher extends KTStandardDispatcher {
417 417  
418 418 $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1));
419 419 if (PEAR::isError($oFolder)) {
420   - $this->errorRedirectToMain(_('Invalid folder selected.'));
  420 + $this->errorRedirectToMain(_kt('Invalid folder selected.'));
421 421 exit(0);
422 422 }
423 423  
424 424 $moveSet = $_SESSION['moves'][$sMoveCode];
425 425  
426 426 if (empty($moveSet['folders']) && empty($moveSet['documents'])) {
427   - $this->errorRedirectToMain(_('Please select documents or folders first.'), sprintf('fFolderId=%d', $oFolder->getId()));
  427 + $this->errorRedirectToMain(_kt('Please select documents or folders first.'), sprintf('fFolderId=%d', $oFolder->getId()));
428 428 exit(0);
429 429 }
430 430  
... ... @@ -475,7 +475,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
475 475 $documentStr = '';
476 476  
477 477 if (!empty($moveSet['folders'])) {
478   - $folderStr = '<strong>' . _('Folders: ') . '</strong>';
  478 + $folderStr = '<strong>' . _kt('Folders: ') . '</strong>';
479 479 foreach ($moveSet['folders'] as $iFolderId) {
480 480 $oF = Folder::get($iFolderId);
481 481 $moveItems['folders'][] = $oF->getName();
... ... @@ -484,7 +484,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
484 484 }
485 485  
486 486 if (!empty($moveSet['documents'])) {
487   - $documentStr = '<strong>' . _('Documents: ') . '</strong>';
  487 + $documentStr = '<strong>' . _kt('Documents: ') . '</strong>';
488 488 foreach ($moveSet['documents'] as $iDocId) {
489 489 $oD = Document::get($iDocId);
490 490 $moveItems['documents'][] = $oD->getName();
... ... @@ -513,22 +513,22 @@ class BrowseDispatcher extends KTStandardDispatcher {
513 513 $action_a = (array) KTUtil::arrayGet($_REQUEST, 'submit', null);
514 514 $actions = array_keys($action_a);
515 515 if (empty($actions)) {
516   - $this->errorRedirectToMain(_('No action selected.'));
  516 + $this->errorRedirectToMain(_kt('No action selected.'));
517 517 } else {
518 518 $action = $actions[0];
519 519 }
520 520 if ($action != 'move') {
521   - $this->successRedirectToMain(_('Move cancelled.'));
  521 + $this->successRedirectToMain(_kt('Move cancelled.'));
522 522 }
523 523  
524 524 $target_folder = KTUtil::arrayGet($_REQUEST, 'fFolderId');
525   - if ($target_folder == null ) { $this->errorRedirectToMain(_('No folder selected.')); }
  525 + if ($target_folder == null ) { $this->errorRedirectToMain(_kt('No folder selected.')); }
526 526  
527 527 $move_code = KTUtil::arrayGet($_REQUEST, 'fMoveCode');
528 528  
529 529 $aFields = array();
530   - $aFields[] = new KTStaticTextWidget(_('Destination folder'), _('The folder which will contain the previously selected files and folders.'), 'fDocumentId', Folder::getFolderDisplayPath($target_folder), $this->oPage, false);
531   - $aFields[] = new KTStringWidget(_('Reason'), _('The reason for moving these documents and folders, for historical purposes.'), 'sReason', "", $this->oPage, true);
  530 + $aFields[] = new KTStaticTextWidget(_kt('Destination folder'), _kt('The folder which will contain the previously selected files and folders.'), 'fDocumentId', Folder::getFolderDisplayPath($target_folder), $this->oPage, false);
  531 + $aFields[] = new KTStringWidget(_kt('Reason'), _kt('The reason for moving these documents and folders, for historical purposes.'), 'sReason', "", $this->oPage, true);
532 532  
533 533  
534 534 // now show the items...
... ... @@ -541,7 +541,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
541 541 $documentStr = '';
542 542  
543 543 if (!empty($moveSet['folders'])) {
544   - $folderStr = '<strong>' . _('Folders: ') . '</strong>';
  544 + $folderStr = '<strong>' . _kt('Folders: ') . '</strong>';
545 545 foreach ($moveSet['folders'] as $iFolderId) {
546 546 $oF = Folder::get($iFolderId);
547 547 $moveItems['folders'][] = $oF->getName();
... ... @@ -550,7 +550,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
550 550 }
551 551  
552 552 if (!empty($moveSet['documents'])) {
553   - $documentStr = '<strong>' . _('Documents: ') . '</strong>';
  553 + $documentStr = '<strong>' . _kt('Documents: ') . '</strong>';
554 554 foreach ($moveSet['documents'] as $iDocId) {
555 555 $oD = Document::get($iDocId);
556 556 $moveItems['documents'][] = $oD->getName();
... ... @@ -576,7 +576,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
576 576 $target_folder = KTUtil::arrayGet($_REQUEST, 'fFolderId');
577 577 $reason = KTUtil::arrayGet($_REQUEST, 'sReason');
578 578 if (empty($reason)) {
579   - $_SESSION['KTErrorMessage'][] = _('You must supply a reason.');
  579 + $_SESSION['KTErrorMessage'][] = _kt('You must supply a reason.');
580 580 return $this->do_finaliseMove();
581 581 }
582 582  
... ... @@ -594,7 +594,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
594 594 }
595 595  
596 596 if (!Permission::userHasFolderWritePermission($oTargetFolder)) {
597   - $this->errorRedirectTo("main", _("You do not have permission to move items to this location"), sprintf("fFolderId=%d", $oTargetFolder->getId()));
  597 + $this->errorRedirectTo("main", _kt("You do not have permission to move items to this location"), sprintf("fFolderId=%d", $oTargetFolder->getId()));
598 598 exit(0);
599 599 }
600 600  
... ... @@ -607,7 +607,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
607 607  
608 608 $oDoc = Document::get($iDocId);
609 609 if (PEAR::isError($oDoc)) {
610   - $this->errorRedirectToMain(_('Invalid document.'));
  610 + $this->errorRedirectToMain(_kt('Invalid document.'));
611 611 }
612 612  
613 613 $oOriginalFolder = Folder::get($oDoc->getFolderId());
... ... @@ -622,7 +622,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
622 622 $oDoc->setFolderID($oTargetFolder->getId());
623 623 $res = $oDoc->update(true);
624 624 if (!$res) {
625   - $this->errorRedirectTo("move", _("There was a problem updating the document's location in the database"), sprintf("fDocumentId=%d&fFolderId=%d", $oDoc->getId(), $oTargetFolder->getId()));
  625 + $this->errorRedirectTo("move", _kt("There was a problem updating the document's location in the database"), sprintf("fDocumentId=%d&fFolderId=%d", $oDoc->getId(), $oTargetFolder->getId()));
626 626 }
627 627  
628 628 //move the document on the file system
... ... @@ -630,7 +630,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
630 630 if (!$oStorage->moveDocument($oDoc, $oOriginalFolder, $oTargetFolder)) {
631 631 $oDoc->setFolderID($oOriginalFolder->getId());
632 632 $oDoc->update(true);
633   - $this->errorRedirectTo("move", _("There was a problem updating the document's location in the repository storage"), sprintf("fDocumentId=%d&fFolderId=%d", $oDoc->getId(), $oTargetFolder->getId()));
  633 + $this->errorRedirectTo("move", _kt("There was a problem updating the document's location in the repository storage"), sprintf("fDocumentId=%d&fFolderId=%d", $oDoc->getId(), $oTargetFolder->getId()));
634 634 }
635 635  
636 636 $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s",
... ... @@ -672,17 +672,17 @@ class BrowseDispatcher extends KTStandardDispatcher {
672 672  
673 673 foreach ($aMoveStack['folders'] as $iFolderId) {
674 674 $oFolder = Folder::get($iFolderId);
675   - if (PEAR::isError($oFolder)) { $this->errorRedirectToMain(_('Invalid folder.')); }
  675 + if (PEAR::isError($oFolder)) { $this->errorRedirectToMain(_kt('Invalid folder.')); }
676 676  
677 677 $res = KTFolderUtil::move($oFolder, $oTargetFolder, $this->oUser);
678 678 if (PEAR::isError($res)) {
679   - $this->errorRedirectToMain(_('Failed to move the folder: ') . $res->getMessage());
  679 + $this->errorRedirectToMain(_kt('Failed to move the folder: ') . $res->getMessage());
680 680 }
681 681 }
682 682 $this->commitTransaction();
683 683  
684 684  
685   - $this->successRedirectToMain(_('Move completed.'), sprintf('fFolderId=%d', $target_folder));
  685 + $this->successRedirectToMain(_kt('Move completed.'), sprintf('fFolderId=%d', $target_folder));
686 686 }
687 687  
688 688 function do_startDelete() {
... ... @@ -704,11 +704,11 @@ class BrowseDispatcher extends KTStandardDispatcher {
704 704 $documentStr = '';
705 705  
706 706 if (!empty($aFolderSelection)) {
707   - $folderStr = '<strong>' . _('Folders: ') . '</strong>';
  707 + $folderStr = '<strong>' . _kt('Folders: ') . '</strong>';
708 708 foreach ($aFolderSelection as $iFolderId) {
709 709 $oF = Folder::get($iFolderId);
710 710 if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oF)) {
711   - $this->errorRedirectToMain(_('You do not have permission to delete the folder: ') . $oF->getName());
  711 + $this->errorRedirectToMain(_kt('You do not have permission to delete the folder: ') . $oF->getName());
712 712 }
713 713 $delItems['folders'][] = $oF->getName();
714 714 }
... ... @@ -716,11 +716,11 @@ class BrowseDispatcher extends KTStandardDispatcher {
716 716 }
717 717  
718 718 if (!empty($aDocumentSelection)) {
719   - $documentStr = '<strong>' . _('Documents: ') . '</strong>';
  719 + $documentStr = '<strong>' . _kt('Documents: ') . '</strong>';
720 720 foreach ($aDocumentSelection as $iDocId) {
721 721 $oD = Document::get($iDocId);
722 722 if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oD)) {
723   - $this->errorRedirectToMain(_('You do not have permission to delete the document: ') . $oD->getName());
  723 + $this->errorRedirectToMain(_kt('You do not have permission to delete the document: ') . $oD->getName());
724 724 }
725 725 if (!PEAR::isError($oD)) {
726 726 $delItems['documents'][] = $oD->getName();
... ... @@ -730,7 +730,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
730 730 }
731 731  
732 732 $aFields = array();
733   - $aFields[] = new KTStringWidget(_('Reason'), _('The reason for the deletion of these documents and folders for historical purposes.'), 'sReason', "", $this->oPage, true);
  733 + $aFields[] = new KTStringWidget(_kt('Reason'), _kt('The reason for the deletion of these documents and folders for historical purposes.'), 'sReason', "", $this->oPage, true);
734 734  
735 735 $oTemplating =& KTTemplating::getSingleton();
736 736 $oTemplate = $oTemplating->loadTemplate("ktcore/folder/mass_delete");
... ... @@ -757,7 +757,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
757 757 $res = KTUtil::arrayGet($_REQUEST,'sReason');
758 758 $sReason = $res;
759 759 if (empty($res)) {
760   - $_SESSION['KTErrorMessage'][] = _('You must supply a reason.');
  760 + $_SESSION['KTErrorMessage'][] = _kt('You must supply a reason.');
761 761 return $this->do_startDelete();
762 762 }
763 763  
... ... @@ -769,9 +769,9 @@ class BrowseDispatcher extends KTStandardDispatcher {
769 769 foreach ($aFolderSelection as $id) {
770 770 $oF = Folder::get($id);
771 771 if (PEAR::isError($oF) || ($oF == false)) {
772   - return $this->errorRedirectToMain(_('Invalid Folder selected.'));
  772 + return $this->errorRedirectToMain(_kt('Invalid Folder selected.'));
773 773 } else if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oF)) {
774   - return $this->errorRedirectToMain(sprintf(_('You do not have permissions to delete the folder: %s'), $oF->getName()));
  774 + return $this->errorRedirectToMain(sprintf(_kt('You do not have permissions to delete the folder: %s'), $oF->getName()));
775 775 } else{
776 776 $aFolders[] = $oF;
777 777 }
... ... @@ -780,9 +780,9 @@ class BrowseDispatcher extends KTStandardDispatcher {
780 780 $oD = Document::get($id);
781 781  
782 782 if (PEAR::isError($oD) || ($oD == false)) {
783   - return $this->errorRedirectToMain(_('Invalid Document selected.'));
  783 + return $this->errorRedirectToMain(_kt('Invalid Document selected.'));
784 784 } else if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oD)) {
785   - return $this->errorRedirectToMain(sprintf(_('You do not have permissions to delete the document: %s'), $oD->getName()));
  785 + return $this->errorRedirectToMain(sprintf(_kt('You do not have permissions to delete the document: %s'), $oD->getName()));
786 786 } else {
787 787 $aDocuments[] = $oD;
788 788 }
... ... @@ -816,19 +816,19 @@ class BrowseDispatcher extends KTStandardDispatcher {
816 816 }
817 817  
818 818 if (!Permission::userIsSystemAdministrator() && !Permission::isUnitAdministratorForFolder($this->oUser, $iFolderId)) {
819   - $this->errorRedirectToMain(_('You are not an administrator'));
  819 + $this->errorRedirectToMain(_kt('You are not an administrator'));
820 820 }
821 821  
822 822 $_SESSION['adminmode'] = true;
823 823 if ($_REQUEST['fDocumentId']) {
824   - $_SESSION['KTInfoMessage'][] = _('Administrator mode enabled');
  824 + $_SESSION['KTInfoMessage'][] = _kt('Administrator mode enabled');
825 825 redirect(KTBrowseUtil::getUrlForDocument($iDocumentId));
826 826 exit(0);
827 827 }
828 828 if ($_REQUEST['fFolderId']) {
829   - $this->successRedirectToMain(_('Administrator mode enabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId']));
  829 + $this->successRedirectToMain(_kt('Administrator mode enabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId']));
830 830 }
831   - $this->successRedirectToMain(_('Administrator mode enabled'));
  831 + $this->successRedirectToMain(_kt('Administrator mode enabled'));
832 832 }
833 833  
834 834 function do_disableAdminMode() {
... ... @@ -843,19 +843,19 @@ class BrowseDispatcher extends KTStandardDispatcher {
843 843 }
844 844  
845 845 if (!Permission::userIsSystemAdministrator() && !Permission::isUnitAdministratorForFolder($this->oUser, $iFolderId)) {
846   - $this->errorRedirectToMain(_('You are not an administrator'));
  846 + $this->errorRedirectToMain(_kt('You are not an administrator'));
847 847 }
848 848  
849 849 $_SESSION['adminmode'] = false;
850 850 if ($_REQUEST['fDocumentId']) {
851   - $_SESSION['KTInfoMessage'][] = _('Administrator mode disabled');
  851 + $_SESSION['KTInfoMessage'][] = _kt('Administrator mode disabled');
852 852 redirect(KTBrowseUtil::getUrlForDocument($iDocumentId));
853 853 exit(0);
854 854 }
855 855 if ($_REQUEST['fFolderId']) {
856   - $this->successRedirectToMain(_('Administrator mode disabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId']));
  856 + $this->successRedirectToMain(_kt('Administrator mode disabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId']));
857 857 }
858   - $this->successRedirectToMain(_('Administrator mode disabled'));
  858 + $this->successRedirectToMain(_kt('Administrator mode disabled'));
859 859 }
860 860 }
861 861  
... ...
dashboard.php
... ... @@ -48,7 +48,7 @@ class DashboardDispatcher extends KTStandardDispatcher {
48 48  
49 49 function DashboardDispatcher() {
50 50 $this->aBreadcrumbs = array(
51   - array('action' => 'dashboard', 'name' => _('Dashboard')),
  51 + array('action' => 'dashboard', 'name' => _kt('Dashboard')),
52 52 );
53 53 return parent::KTStandardDispatcher();
54 54 }
... ... @@ -62,8 +62,8 @@ class DashboardDispatcher extends KTStandardDispatcher {
62 62 $aDashlets = $oDashletRegistry->getDashlets($this->oUser);
63 63  
64 64 $this->sSection = "dashboard";
65   - $this->oPage->setBreadcrumbDetails(_("Home"));
66   - $this->oPage->title = _("Dashboard");
  65 + $this->oPage->setBreadcrumbDetails(_kt("Home"));
  66 + $this->oPage->title = _kt("Dashboard");
67 67  
68 68 // simplistic improvement over the standard rendering: float half left
69 69 // and half right. +Involves no JS -can leave lots of white-space at the bottom.
... ...
edit.php
... ... @@ -72,11 +72,11 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
72 72  
73 73 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
74 74 if (empty($document_id)) {
75   - $this->errorPage(_("No document specified for editing."));
  75 + $this->errorPage(_kt("No document specified for editing."));
76 76 }
77 77 $oDocument = Document::get($document_id);
78 78 if (PEAR::isError($oDocument)) {
79   - $this->errorPage(_("Invalid Document."));
  79 + $this->errorPage(_kt("Invalid Document."));
80 80 }
81 81  
82 82 $this->oDocument = $oDocument;
... ... @@ -94,7 +94,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
94 94  
95 95 function KTEditDocumentDispatcher() {
96 96 $this->aBreadcrumbs = array(
97   - array('action' => 'browse', 'name' => _('Browse')),
  97 + array('action' => 'browse', 'name' => _kt('Browse')),
98 98 );
99 99 return parent::KTStandardDispatcher();
100 100 }
... ... @@ -102,7 +102,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
102 102 // FIXME identify the current location somehow.
103 103 function addPortlets($currentaction = null) {
104 104 $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser);
105   - $oPortlet = new KTActionPortlet(_("Document Actions"));
  105 + $oPortlet = new KTActionPortlet(_kt("Document Actions"));
106 106 $oPortlet->setActions($actions, $currentaction);
107 107  
108 108 $this->oPage->addPortlet($oPortlet);
... ... @@ -132,17 +132,17 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
132 132  
133 133 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
134 134 if (empty($document_id)) {
135   - $this->errorPage(_("No document specified for editing."));
  135 + $this->errorPage(_kt("No document specified for editing."));
136 136 }
137 137 $oDocument = Document::get($document_id);
138 138 if (PEAR::isError($oDocument)) {
139   - $this->errorPage(_("Invalid Document."));
  139 + $this->errorPage(_kt("Invalid Document."));
140 140 }
141 141  
142 142 $this->oDocument = $oDocument;
143 143 $this->addPortlets("Edit");
144 144 $this->addBreadcrumbs();
145   - $this->oPage->setBreadcrumbDetails(_('Change Document Type'));
  145 + $this->oPage->setBreadcrumbDetails(_kt('Change Document Type'));
146 146  
147 147 $aDocTypes = DocumentType::getList();
148 148  
... ... @@ -181,10 +181,10 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
181 181 $newType = KTUtil::arrayGet($_REQUEST, 'fDocType');
182 182 $oType = DocumentType::get($newType);
183 183 if (PEAR::isError($oType) || ($oType == false)) {
184   - $this->errorRedirectToMain(_("Invalid type selected."));
  184 + $this->errorRedirectToMain(_kt("Invalid type selected."));
185 185 }
186 186  
187   - $_SESSION['KTInfoMessage'][] = _('Document Type Changed. Please review the information below, and update as appropriate.');
  187 + $_SESSION['KTInfoMessage'][] = _kt('Document Type Changed. Please review the information below, and update as appropriate.');
188 188  
189 189 $_REQUEST['setType'] = $newType;
190 190  
... ... @@ -197,11 +197,11 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
197 197  
198 198 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
199 199 if (empty($document_id)) {
200   - $this->errorPage(_("No document specified for editing."));
  200 + $this->errorPage(_kt("No document specified for editing."));
201 201 }
202 202 $oDocument = Document::get($document_id);
203 203 if (PEAR::isError($oDocument)) {
204   - $this->errorPage(_("Invalid Document."));
  204 + $this->errorPage(_kt("Invalid Document."));
205 205 }
206 206  
207 207 $this->oDocument = $oDocument;
... ... @@ -266,16 +266,16 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
266 266 function do_update() {
267 267 $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId');
268 268 if (empty($document_id)) {
269   - $this->errorPage(_("No document specified for editing."));
  269 + $this->errorPage(_kt("No document specified for editing."));
270 270 }
271 271 $oDocument = Document::get($document_id);
272 272 if (PEAR::isError($oDocument)) {
273   - $this->errorPage(_("Invalid Document."));
  273 + $this->errorPage(_kt("Invalid Document."));
274 274 }
275 275  
276 276 $aErrorOptions = array(
277 277 'redirect_to' => array('main', sprintf('fDocumentId=%d', $oDocument->getId())),
278   - 'message' => _('No name given'),
  278 + 'message' => _kt('No name given'),
279 279 );
280 280 $title = KTUtil::arrayGet($_REQUEST, 'generic_title');
281 281 $title = $this->oValidator->validateString($title,
... ... @@ -285,7 +285,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
285 285 if ($newType !== null) {
286 286 $oDT = DocumentType::get($newType);
287 287 if (PEAR::isError($oDT) || ($oDT == false)) {
288   - $this->errorRedirectToMain(_('Invalid document type specified for change.'));
  288 + $this->errorRedirectToMain(_kt('Invalid document type specified for change.'));
289 289 }
290 290 } else {
291 291 $oDT = null;
... ... @@ -475,7 +475,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher {
475 475  
476 476 $document_data['errors'] = $res->aFailed['field'];
477 477  
478   - $this->addErrorMessage(_('Validation failed. The values below correspond to your attempt to change the metadata on this item, and are not necessarily the values saved for the document. The validation errors are shown next to the metadata that failed validation. Select Cancel to return to the saved values.'));
  478 + $this->addErrorMessage(_kt('Validation failed. The values below correspond to your attempt to change the metadata on this item, and are not necessarily the values saved for the document. The validation errors are shown next to the metadata that failed validation. Select Cancel to return to the saved values.'));
479 479  
480 480 $oTemplating =& KTTemplating::getSingleton();
481 481 $oTemplate =& $oTemplating->loadTemplate("kt3/document/edit");
... ...
help.php
... ... @@ -61,8 +61,8 @@ class HelpDispatcher extends KTStandardDispatcher {
61 61 var $bIsReplacement = false;
62 62  
63 63 function HelpDispatcher() {
64   - $this->aBreadcrumbs[] = array('action' => 'dashboard', 'name' => _('Dashboard'));
65   - $this->aBreadcrumbs[] = array('name' => _('Help'));
  64 + $this->aBreadcrumbs[] = array('action' => 'dashboard', 'name' => _kt('Dashboard'));
  65 + $this->aBreadcrumbs[] = array('name' => _kt('Help'));
66 66 parent::KTStandardDispatcher();
67 67 }
68 68  
... ... @@ -79,8 +79,8 @@ class HelpDispatcher extends KTStandardDispatcher {
79 79  
80 80 $pathinfo = KTUtil::arrayGet($_SERVER, 'PATH_INFO');
81 81 if (empty($pathinfo)) {
82   - $this->oPage->setTitle(_('No help page specified.'));
83   - $this->oPage->addError(_('No help page specified.'));
  82 + $this->oPage->setTitle(_kt('No help page specified.'));
  83 + $this->oPage->addError(_kt('No help page specified.'));
84 84 return '&nbsp;';
85 85 }
86 86  
... ... @@ -88,8 +88,8 @@ class HelpDispatcher extends KTStandardDispatcher {
88 88  
89 89 $help_path = KTHelp::getHelpSubPath($pathinfo);
90 90 if ($help_path == false) {
91   - $this->oPage->setTitle(_('Invalid help location specified.'));
92   - $this->oPage->addError(_('Invalid help location specified.'));
  91 + $this->oPage->setTitle(_kt('Invalid help location specified.'));
  92 + $this->oPage->addError(_kt('Invalid help location specified.'));
93 93 return '&nbsp';
94 94 }
95 95  
... ... @@ -113,8 +113,8 @@ class HelpDispatcher extends KTStandardDispatcher {
113 113 $this->oPage->setTitle($aHelpInfo['title']);
114 114 //return $aHelpInfo['body'];
115 115 } else {
116   - $this->oPage->setTitle(_('Invalid help location specified.'));
117   - $this->oPage->addError(_('Invalid help location specified.'));
  116 + $this->oPage->setTitle(_kt('Invalid help location specified.'));
  117 + $this->oPage->addError(_kt('Invalid help location specified.'));
118 118 return '&nbsp';
119 119 }
120 120 }
... ... @@ -148,7 +148,7 @@ class HelpDispatcher extends KTStandardDispatcher {
148 148 redirect($sReferer);
149 149 exit(0);
150 150 } else {
151   - $this->errorRedirectToMain(_("Invalid return key from help system."));
  151 + $this->errorRedirectToMain(_kt("Invalid return key from help system."));
152 152 }
153 153 }
154 154 }
... ...
login.php
... ... @@ -106,7 +106,7 @@ class LoginPageDispatcher extends KTDispatcher {
106 106 $cookieVerify = KTUtil::arrayGet($_REQUEST, 'cookieverify', null);
107 107  
108 108 if (($cookieVerify === null) || ($cookieTest !== $cookieVerify)) {
109   - $this->simpleRedirectToMain(_('You must have cookies enabled to use the document management system.'), $url, $params);
  109 + $this->simpleRedirectToMain(_kt('You must have cookies enabled to use the document management system.'), $url, $params);
110 110 exit(0);
111 111 }
112 112  
... ... @@ -114,27 +114,27 @@ class LoginPageDispatcher extends KTDispatcher {
114 114 $password = KTUtil::arrayGet($_REQUEST,'password');
115 115  
116 116 if (empty($username)) {
117   - $this->simpleRedirectToMain(_('Please enter your username.'), $url, $params);
  117 + $this->simpleRedirectToMain(_kt('Please enter your username.'), $url, $params);
118 118 }
119 119  
120 120 if (empty($password)) {
121   - $this->simpleRedirectToMain(_('Please enter your password.'), $url, $params);
  121 + $this->simpleRedirectToMain(_kt('Please enter your password.'), $url, $params);
122 122 }
123 123  
124 124 $oUser =& User::getByUsername($username);
125 125 if (PEAR::isError($oUser) || ($oUser === false)) {
126   - $this->simpleRedirectToMain(_('Login failed. Please check your username and password, and try again.'), $url, $params);
  126 + $this->simpleRedirectToMain(_kt('Login failed. Please check your username and password, and try again.'), $url, $params);
127 127 exit(0);
128 128 }
129 129 $authenticated = KTAuthenticationUtil::checkPassword($oUser, $password);
130 130  
131 131 if (PEAR::isError($authenticated)) {
132   - $this->simpleRedirectToMain(_('Authentication failure. Please try again.'), $url, $params);
  132 + $this->simpleRedirectToMain(_kt('Authentication failure. Please try again.'), $url, $params);
133 133 exit(0);
134 134 }
135 135  
136 136 if ($authenticated !== true) {
137   - $this->simpleRedirectToMain(_('Login failed. Please check your username and password, and try again.'), $url, $params);
  137 + $this->simpleRedirectToMain(_kt('Login failed. Please check your username and password, and try again.'), $url, $params);
138 138 exit(0);
139 139 }
140 140  
... ...
notify.php
... ... @@ -56,7 +56,7 @@ class KTNotificationDispatcher extends KTStandardDispatcher {
56 56 $oKTNotification =& KTNotification::get($notification_id);
57 57  
58 58 if (PEAR::isError($oKTNotification)) {
59   - $this->addErrorMessage(_('Invalid notification.'));
  59 + $this->addErrorMessage(_kt('Invalid notification.'));
60 60 exit(redirect(generateControllerLink('dashboard')));
61 61 }
62 62  
... ... @@ -83,15 +83,15 @@ class KTNotificationDispatcher extends KTStandardDispatcher {
83 83 $res = $oNotification->delete();
84 84 if (PEAR::isError($res)) {
85 85 $this->rollbackTransaction();
86   - $this->addErrorMessage(_('Failed to clear notifications.'));
  86 + $this->addErrorMessage(_kt('Failed to clear notifications.'));
87 87 exit(redirect(generateControllerLink('dashboard')));
88 88 }
89 89 }
90 90 $this->commitTransaction();
91   - $this->addInfoMessage(_('Notifications cleared.'));
  91 + $this->addInfoMessage(_kt('Notifications cleared.'));
92 92 exit(redirect(generateControllerLink('dashboard')));
93 93 }
94 94 }
95 95  
96 96 $dispatcher =& new KTNotificationDispatcher();
97   -$dispatcher->dispatch();
98 97 \ No newline at end of file
  98 +$dispatcher->dispatch();
... ...
preferences.php
... ... @@ -41,14 +41,14 @@ class PreferencesDispatcher extends KTStandardDispatcher {
41 41  
42 42 function PreferencesDispatcher() {
43 43 $this->aBreadcrumbs = array(
44   - array('action' => 'preferences', 'name' => _('Preferences')),
  44 + array('action' => 'preferences', 'name' => _kt('Preferences')),
45 45 );
46 46 return parent::KTStandardDispatcher();
47 47 }
48 48  
49 49 function do_main() {
50   - $this->oPage->setBreadcrumbDetails(_("Your Preferences"));
51   - $this->oPage->title = _("Dashboard");
  50 + $this->oPage->setBreadcrumbDetails(_kt("Your Preferences"));
  51 + $this->oPage->title = _kt("Dashboard");
52 52  
53 53  
54 54 $oUser =& $this->oUser;
... ... @@ -56,10 +56,10 @@ class PreferencesDispatcher extends KTStandardDispatcher {
56 56 $aOptions = array('autocomplete' => false);
57 57  
58 58 $edit_fields = array();
59   - $edit_fields[] = new KTStringWidget(_('Name'),_('Your full name. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $oUser->getName(), $this->oPage, true, null, null, $aOptions);
60   - $edit_fields[] = new KTStringWidget(_('Email Address'),_('Your email address. 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, null, null, $aOptions);
61   - $edit_fields[] = new KTCheckboxWidget(_('Email Notifications'),_('If this is specified then the you will receive certain notifications. If it is not set, then you will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false, null, null, $aOptions);
62   - $edit_fields[] = new KTStringWidget(_('Mobile Number'), _('Your mobile phone number. If the system is configured to send notifications to cellphones, then this number will be sent an SMS with notifications. e.g. <strong>+27 99 999 9999</strong>'), 'mobile_number', $oUser->getMobile(), $this->oPage, false, null, null, $aOptions);
  59 + $edit_fields[] = new KTStringWidget(_kt('Name'), _kt('Your full name. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', $oUser->getName(), $this->oPage, true, null, null, $aOptions);
  60 + $edit_fields[] = new KTStringWidget(_kt('Email Address'), _kt('Your email address. 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, null, null, $aOptions);
  61 + $edit_fields[] = new KTCheckboxWidget(_kt('Email Notifications'), _kt('If this is specified then the you will receive certain notifications. If it is not set, then you will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false, null, null, $aOptions);
  62 + $edit_fields[] = new KTStringWidget(_kt('Mobile Number'), _kt('Your mobile phone number. If the system is configured to send notifications to cellphones, then this number will be sent an SMS with notifications. e.g. <strong>+27 99 999 9999</strong>'), 'mobile_number', $oUser->getMobile(), $this->oPage, false, null, null, $aOptions);
63 63  
64 64 $oTemplating =& KTTemplating::getSingleton();
65 65 $oTemplate = $oTemplating->loadTemplate("ktcore/principals/preferences");
... ... @@ -77,8 +77,8 @@ class PreferencesDispatcher extends KTStandardDispatcher {
77 77 }
78 78  
79 79 function do_setPassword() {
80   - $this->oPage->setBreadcrumbDetails(_("Your Password"));
81   - $this->oPage->title = _("Dashboard");
  80 + $this->oPage->setBreadcrumbDetails(_kt("Your Password"));
  81 + $this->oPage->title = _kt("Dashboard");
82 82  
83 83  
84 84 $oUser =& $this->oUser;
... ... @@ -86,8 +86,8 @@ class PreferencesDispatcher extends KTStandardDispatcher {
86 86 $aOptions = array('autocomplete' => false);
87 87  
88 88 $edit_fields = array();
89   - $edit_fields[] = new KTPasswordWidget(_('Password'), _('Specify your new password.'), 'password', null, $this->oPage, true, null, null, $aOptions);
90   - $edit_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions);
  89 + $edit_fields[] = new KTPasswordWidget(_kt('Password'), _kt('Specify your new password.'), 'password', null, $this->oPage, true, null, null, $aOptions);
  90 + $edit_fields[] = new KTPasswordWidget(_kt('Confirm Password'), _kt('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions);
91 91  
92 92  
93 93 $oTemplating =& KTTemplating::getSingleton();
... ... @@ -107,16 +107,16 @@ class PreferencesDispatcher extends KTStandardDispatcher {
107 107 $confirm_password = KTUtil::arrayGet($_REQUEST, 'confirm_password');
108 108  
109 109 if (empty($password)) {
110   - $this->errorRedirectTo("setPassword", _("You must specify a password."));
  110 + $this->errorRedirectTo("setPassword", _kt("You must specify a password."));
111 111 } else if ($password !== $confirm_password) {
112   - $this->errorRedirectTo("setPassword", _("The passwords you specified do not match."));
  112 + $this->errorRedirectTo("setPassword", _kt("The passwords you specified do not match."));
113 113 }
114 114  
115 115 $KTConfig =& KTConfig::getSingleton();
116 116 $minLength = ((int) $KTConfig->get('user_prefs/passwordLength', 6));
117 117  
118 118 if (strlen($password) < $minLength) {
119   - $this->errorRedirectTo("setPassword", sprintf(_("Your password is too short - passwords must be at least %d characters long."), $minLength));
  119 + $this->errorRedirectTo("setPassword", sprintf(_kt("Your password is too short - passwords must be at least %d characters long."), $minLength));
120 120 }
121 121  
122 122 // FIXME more validation would be useful.
... ... @@ -134,11 +134,11 @@ class PreferencesDispatcher extends KTStandardDispatcher {
134 134  
135 135  
136 136 if (PEAR::isError($res) || ($res == false)) {
137   - $this->errorRedirectoToMain(_('Failed to update user.'));
  137 + $this->errorRedirectoToMain(_kt('Failed to update user.'));
138 138 }
139 139  
140 140 $this->commitTransaction();
141   - $this->successRedirectToMain(_('Your password has been changed.'));
  141 + $this->successRedirectToMain(_kt('Your password has been changed.'));
142 142  
143 143 }
144 144  
... ... @@ -151,7 +151,7 @@ class PreferencesDispatcher extends KTStandardDispatcher {
151 151 $oUser =& $this->oUser;
152 152  
153 153 $name = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'name'),
154   - KTUtil::meldOptions($aErrorOptions, array('message' => _('You must specify your name.'))));
  154 + KTUtil::meldOptions($aErrorOptions, array('message' => _kt('You must specify your name.'))));
155 155  
156 156 $email_address = $this->oValidator->validateEmailAddress(KTUtil::arrayGet($_REQUEST, 'email_address'),
157 157 $aErrorOptions);
... ... @@ -176,11 +176,11 @@ class PreferencesDispatcher extends KTStandardDispatcher {
176 176 $res = $oUser->doLimitedUpdate(); // ignores a fix blacklist of items.
177 177  
178 178 if (PEAR::isError($res) || ($res == false)) {
179   - $this->errorRedirectoToMain(_('Failed to update your details.'));
  179 + $this->errorRedirectoToMain(_kt('Failed to update your details.'));
180 180 }
181 181  
182 182 $this->commitTransaction();
183   - $this->successRedirectToMain(_('Your details have been updated.'));
  183 + $this->successRedirectToMain(_kt('Your details have been updated.'));
184 184  
185 185 }
186 186  
... ...
search/booleanSearch.php
... ... @@ -45,14 +45,14 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
45 45  
46 46 function BooleanSearchDispatcher() {
47 47 $this->aBreadcrumbs = array(
48   - array('action' => 'browse', 'name' => _('Browse')),
  48 + array('action' => 'browse', 'name' => _kt('Browse')),
49 49 );
50 50 return parent::KTStandardDispatcher();
51 51 }
52 52  
53 53 function do_main() {
54   - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Advanced Search"));
55   - $this->oPage->setBreadcrumbDetails(_('defining search'));
  54 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt("Advanced Search"));
  55 + $this->oPage->setBreadcrumbDetails(_kt('defining search'));
56 56 $oTemplating =& KTTemplating::getSingleton();
57 57 $oTemplate = $oTemplating->loadTemplate("ktcore/boolean_search");
58 58  
... ... @@ -88,7 +88,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
88 88 }
89 89  
90 90 if (empty($datavars)) {
91   - $this->errorRedirectToMain(_('You need to have at least 1 condition.'));
  91 + $this->errorRedirectToMain(_kt('You need to have at least 1 condition.'));
92 92 }
93 93  
94 94 $res = $this->handleCriteriaSet($datavars, KTUtil::arrayGet($_REQUEST, 'fStartIndex', 1), $title);
... ... @@ -99,11 +99,11 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
99 99 function handleCriteriaSet($aCriteriaSet, $iStartIndex, $sTitle=null) {
100 100  
101 101 if ($sTitle == null) {
102   - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Advanced Search'));
103   - $sTitle = _('Search Results');
  102 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Advanced Search'));
  103 + $sTitle = _kt('Search Results');
104 104 } else {
105   - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Saved Search'));
106   - $this->oPage->setTitle(_('Saved Search: ') . $sTitle);
  105 + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Saved Search'));
  106 + $this->oPage->setTitle(_kt('Saved Search: ') . $sTitle);
107 107 }
108 108 $this->oPage->setBreadcrumbDetails($sTitle);
109 109  
... ... @@ -115,10 +115,10 @@ class BooleanSearchDispatcher extends KTStandardDispatcher {
115 115 $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php'));
116 116 $collection->addColumn($t);
117 117 $collection->addColumn(new DownloadColumn('','download'));
118   - $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime"));
119   - $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate"));
120   - $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID'));
121   - $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state'));
  118 + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime"));
  119 + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate"));
  120 + $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID'));
  121 + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state'));
122 122  
123 123 $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText");
124 124  
... ...
search/simpleSearch.php
... ... @@ -126,8 +126,8 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
126 126  
127 127 function SimpleSearchDispatcher() {
128 128 $this->aBreadcrumbs = array(
129   - array('action' => 'browse', 'name' => _('Browse')),
130   - array('name' => _('Simple Search'))
  129 + array('action' => 'browse', 'name' => _kt('Browse')),
  130 + array('name' => _kt('Simple Search'))
131 131 );
132 132 return parent::KTStandardDispatcher();
133 133 }
... ... @@ -135,7 +135,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
135 135  
136 136 function do_main() {
137 137 $aErrorOptions = array(
138   - "message" => _("Please provide a search term"),
  138 + "message" => _kt("Please provide a search term"),
139 139 );
140 140 $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText");
141 141 $this->oValidator->notEmpty($searchable_text, $aErrorOptions);
... ... @@ -153,10 +153,10 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
153 153 $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php'));
154 154 $collection->addColumn($t);
155 155 $collection->addColumn(new DownloadColumn('','download'));
156   - $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime"));
157   - $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate"));
158   - $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID'));
159   - $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state'));
  156 + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime"));
  157 + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate"));
  158 + $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID'));
  159 + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state'));
160 160  
161 161 $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0);
162 162 $batchSize = 20;
... ...
view.php
... ... @@ -58,7 +58,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
58 58  
59 59 function ViewDocumentDispatcher() {
60 60 $this->aBreadcrumbs = array(
61   - array('action' => 'browse', 'name' => _('Browse')),
  61 + array('action' => 'browse', 'name' => _kt('Browse')),
62 62 );
63 63  
64 64 parent::KTStandardDispatcher();
... ... @@ -75,7 +75,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
75 75 // FIXME identify the current location somehow.
76 76 function addPortlets($currentaction = null) {
77 77 $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser);
78   - $oPortlet = new KTActionPortlet(_("Document Actions"));
  78 + $oPortlet = new KTActionPortlet(_kt("Document Actions"));
79 79 $oPortlet->setActions($actions, $currentaction);
80 80 $this->oPage->addPortlet($oPortlet);
81 81 }
... ... @@ -104,21 +104,21 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
104 104  
105 105 if (!KTBrowseUtil::inAdminMode($this->oUser, $oDocument->getFolderId())) {
106 106 if ($oDocument->getStatusID() == ARCHIVED) {
107   - $this->oPage->addError(_('This document has been archived. Please contact the system administrator to have it restored if it is still needed.'));
  107 + $this->oPage->addError(_kt('This document has been archived. Please contact the system administrator to have it restored if it is still needed.'));
108 108 return $this->do_error();
109 109 } else if ($oDocument->getStatusID() == DELETED) {
110   - $this->oPage->addError(_('This document has been deleted. Please contact the system administrator to have it restored if it is still needed.'));
  110 + $this->oPage->addError(_kt('This document has been deleted. Please contact the system administrator to have it restored if it is still needed.'));
111 111 return $this->do_error();
112 112 } else if (!Permission::userHasDocumentReadPermission($oDocument)) {
113   - $this->oPage->addError(_('You are not allowed to view this document'));
  113 + $this->oPage->addError(_kt('You are not allowed to view this document'));
114 114 return $this->do_error();
115 115 }
116 116 }
117 117  
118 118 if ($oDocument->getStatusID() == ARCHIVED) {
119   - $this->oPage->addError(_('This document has been archived.'));
  119 + $this->oPage->addError(_kt('This document has been archived.'));
120 120 } else if ($oDocument->getStatusID() == DELETED) {
121   - $this->oPage->addError(_('This document has been deleted.'));
  121 + $this->oPage->addError(_kt('This document has been deleted.'));
122 122 }
123 123  
124 124 $this->oPage->setSecondaryTitle($oDocument->getName());
... ... @@ -130,7 +130,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
130 130  
131 131 $this->oDocument =& $oDocument;
132 132 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
133   - $this->oPage->setBreadcrumbDetails(_("document details"));
  133 + $this->oPage->setBreadcrumbDetails(_kt("document details"));
134 134 $this->addPortlets("Document Details");
135 135  
136 136 $document_data["document"] = $oDocument;
... ... @@ -222,7 +222,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
222 222 "folderaction" => "browse",
223 223 );
224 224 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
225   - $this->oPage->setBreadcrumbDetails(_("history"));
  225 + $this->oPage->setBreadcrumbDetails(_kt("history"));
226 226 $this->addPortlets("History");
227 227  
228 228 $aTransactions = array();
... ... @@ -244,7 +244,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
244 244  
245 245  
246 246 // render pass.
247   - $this->oPage->title = _("Document History");
  247 + $this->oPage->title = _kt("Document History");
248 248 $oTemplating =& KTTemplating::getSingleton();
249 249 $oTemplate = $oTemplating->loadTemplate("kt3/view_document_history");
250 250 $aTemplateData = array(
... ... @@ -281,7 +281,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
281 281 "folderaction" => "browse",
282 282 );
283 283 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
284   - $this->oPage->setBreadcrumbDetails(_("history"));
  284 + $this->oPage->setBreadcrumbDetails(_kt("history"));
285 285 $this->addPortlets("History");
286 286  
287 287 $aMetadataVersions = KTDocumentMetadataVersion::getByDocument($oDocument);
... ... @@ -291,7 +291,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
291 291 }
292 292  
293 293 // render pass.
294   - $this->oPage->title = _("Document History");
  294 + $this->oPage->title = _kt("Document History");
295 295 $oTemplating =& KTTemplating::getSingleton();
296 296 $oTemplate = $oTemplating->loadTemplate("kt3/document/metadata_history");
297 297  
... ... @@ -334,7 +334,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
334 334 }
335 335 if (!Permission::userHasDocumentReadPermission($oDocument)) {
336 336 // FIXME inconsistent.
337   - $this->oPage->addError(_('You are not allowed to view this document'));
  337 + $this->oPage->addError(_kt('You are not allowed to view this document'));
338 338 return $this->do_error();
339 339 }
340 340 $this->oDocument =& $oDocument;
... ... @@ -344,7 +344,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
344 344 "folderaction" => "browse",
345 345 );
346 346 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
347   - $this->oPage->setBreadcrumbDetails(_("compare versions"));
  347 + $this->oPage->setBreadcrumbDetails(_kt("compare versions"));
348 348  
349 349 $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion');
350 350 if ($comparison_version=== null) {
... ... @@ -354,7 +354,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
354 354  
355 355 $oComparison =& Document::get($oDocument->getId(), $comparison_version);
356 356 if (PEAR::isError($oComparison)) {
357   - $this->errorRedirectToMain(_('Invalid document to compare against.'));
  357 + $this->errorRedirectToMain(_kt('Invalid document to compare against.'));
358 358 }
359 359 $comparison_data = array();
360 360 $comparison_data['document_id'] = $oComparison->getId();
... ... @@ -471,7 +471,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
471 471 }
472 472 if (!Permission::userHasDocumentReadPermission($oDocument)) {
473 473 // FIXME inconsistent.
474   - $this->oPage->addError(_('You are not allowed to view this document'));
  474 + $this->oPage->addError(_kt('You are not allowed to view this document'));
475 475 return $this->do_error();
476 476 }
477 477 $this->oDocument =& $oDocument;
... ... @@ -481,7 +481,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
481 481 "folderaction" => "browse",
482 482 );
483 483 $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
484   - $this->oPage->setBreadcrumbDetails(_("Select Document Version to compare against"));
  484 + $this->oPage->setBreadcrumbDetails(_kt("Select Document Version to compare against"));
485 485  
486 486 $aMetadataVersions = KTDocumentMetadataVersion::getByDocument($oDocument);
487 487 $aVersions = array();
... ... @@ -503,7 +503,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
503 503  
504 504 function getUserForId($iUserId) {
505 505 $u = User::get($iUserId);
506   - if (PEAR::isError($u) || ($u == false)) { return _('User no longer exists'); }
  506 + if (PEAR::isError($u) || ($u == false)) { return _kt('User no longer exists'); }
507 507 return $u->getName();
508 508 }
509 509 }
... ...