From 2d4c41eab9518b664fd41c6562a96fc57c8b8a4f Mon Sep 17 00:00:00 2001 From: nbm Date: Mon, 27 Mar 2006 13:18:58 +0000 Subject: [PATCH] Change from gettext's _ to internal i18n infrastructure's _kt --- admin.php | 4 ++-- browse.php | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- dashboard.php | 6 +++--- edit.php | 32 ++++++++++++++++---------------- help.php | 18 +++++++++--------- login.php | 12 ++++++------ notify.php | 8 ++++---- preferences.php | 38 +++++++++++++++++++------------------- search/booleanSearch.php | 24 ++++++++++++------------ search/simpleSearch.php | 14 +++++++------- view.php | 36 ++++++++++++++++++------------------ 11 files changed, 152 insertions(+), 152 deletions(-) diff --git a/admin.php b/admin.php index da61426..cb87760 100644 --- a/admin.php +++ b/admin.php @@ -65,7 +65,7 @@ class AdminSplashDispatcher extends KTAdminDispatcher { } } - $this->oPage->title = _("DMS Administration") . ": "; + $this->oPage->title = _kt("DMS Administration") . ": "; $oTemplating =& KTTemplating::getSingleton(); if ($condensed_admin) { @@ -95,7 +95,7 @@ class AdminSplashDispatcher extends KTAdminDispatcher { $this->aBreadcrumbs[] = array("name" => $aCategory["title"], "url" => KTUtil::ktLink('admin.php',$category)); - $this->oPage->title = _("DMS Administration") . ": " . $aCategory["title"]; + $this->oPage->title = _kt("DMS Administration") . ": " . $aCategory["title"]; $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("kt3/admin_items"); $aTemplateData = array( diff --git a/browse.php b/browse.php index 91c633b..4dcc84c 100755 --- a/browse.php +++ b/browse.php @@ -66,7 +66,7 @@ class KTMassMoveColumn extends TitleColumn { $outStr .= $aDataRow["folder"]->getName(); $outStr .= ''; } else { - $outStr = $aDataRow["folder"]->getName() . ' (' . _('you cannot move folders to themselves') . ')'; + $outStr = $aDataRow["folder"]->getName() . ' (' . _kt('you cannot move folders to themselves') . ')'; } return $outStr; @@ -91,7 +91,7 @@ class BrowseDispatcher extends KTStandardDispatcher { function BrowseDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'browse', 'name' => _('Browse')), + array('action' => 'browse', 'name' => _kt('Browse')), ); return parent::KTStandardDispatcher(); } @@ -139,12 +139,12 @@ class BrowseDispatcher extends KTStandardDispatcher { $this->editable = false; } - $this->oPage->setTitle(_('Browse')); + $this->oPage->setTitle(_kt('Browse')); $this->oPage->setSecondaryTitle($oFolder->getName()); $this->oFolder =& $oFolder; if (PEAR::isError($oFolder)) { - $this->oPage->addError(_("invalid folder")); + $this->oPage->addError(_kt("invalid folder")); $folder_id = 1; $oFolder =& Folder::get($folder_id); } @@ -158,7 +158,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForFolder($oFolder)); - $portlet = new KTActionPortlet(_("Folder Actions")); + $portlet = new KTActionPortlet(_kt("Folder Actions")); $aActions = KTFolderActionUtil::getFolderActionsForFolder($oFolder, $this->oUser); $portlet->setActions($aActions,null); $this->oPage->addPortlet($portlet); @@ -179,7 +179,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } $this->oQuery = new ValueBrowseQuery($oField, $oValue); $this->resultURL = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fBrowseMode=lookup_value&fField=%d&fValue=%d", $field, $value)); - $this->aBreadcrumbs[] = array('name' => _('Lookup Values'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectField')); + $this->aBreadcrumbs[] = array('name' => _kt('Lookup Values'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectField')); $this->aBreadcrumbs[] = array('name' => $oField->getName(), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectLookup&fField=' . $oField->getId())); $this->aBreadcrumbs[] = array('name' => $oValue->getName(), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fBrowseMode=lookup_value&fField=%d&fValue=%d", $field, $value))); } else if ($this->browse_mode == 'document_type') { @@ -195,7 +195,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $this->oQuery = new TypeBrowseQuery($oDocType); // FIXME probably want to redirect to self + action=selectType - $this->aBreadcrumbs[] = array('name' => _('Document Types'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectType')); + $this->aBreadcrumbs[] = array('name' => _kt('Document Types'), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'action=selectType')); $this->aBreadcrumbs[] = array('name' => $oDocType->getName(), 'url' => KTUtil::addQueryString($_SERVER['PHP_SELF'], 'fBrowseMode=document_type&fType=' . $oDocType->getId())); $this->resultURL = KTUtil::addQueryString($_SERVER['PHP_SELF'], sprintf("fType=%s&fBrowseMode=document_type", $doctype));; @@ -214,10 +214,10 @@ class BrowseDispatcher extends KTStandardDispatcher { $collection->addColumn(new SelectionColumn("Browse Selection","selection")); $collection->addColumn(new TitleColumn("Test 1 (title)","title")); $collection->addColumn(new DownloadColumn('','download')); - $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime")); - $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate")); - $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID')); - $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state')); + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime")); + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate")); + $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID')); + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state')); // setup the folderside add actions @@ -261,7 +261,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $aFields = DocumentField::getList('has_lookup = 1'); if (empty($aFields)) { - $this->errorRedirectToMain(_('No lookup fields available.')); + $this->errorRedirectToMain(_kt('No lookup fields available.')); exit(0); } @@ -326,14 +326,14 @@ class BrowseDispatcher extends KTStandardDispatcher { if (!empty($targets)) { $target = $targets[0]; } else { - $this->errorRedirectToMain(_('No action selected.')); + $this->errorRedirectToMain(_kt('No action selected.')); exit(0); } $aFolderSelection = KTUtil::arrayGet($_REQUEST, 'selection_f' , array()); $aDocumentSelection = KTUtil::arrayGet($_REQUEST, 'selection_d' , array()); if (empty($aFolderSelection) && empty($aDocumentSelection)) { - $this->errorRedirectToMain(_('Please select documents or folders first.')); + $this->errorRedirectToMain(_kt('Please select documents or folders first.')); exit(0); } @@ -342,7 +342,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } else if ($target == 'move') { return $this->do_startMove(); } else { - $this->errorRedirectToMain(_('No such action.')); + $this->errorRedirectToMain(_kt('No such action.')); exit(0); } @@ -388,7 +388,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $documentStr = ''; if (!empty($aCantMove['folders'])) { - $folderStr = '' . _('Folders: ') . ''; + $folderStr = '' . _kt('Folders: ') . ''; foreach ($aCantMove['folders'] as $iFolderId) { $oF = Folder::get($iFolderId); $cantMoveItems['folders'][] = $oF->getName(); @@ -397,7 +397,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!empty($aCantMove['documents'])) { - $documentStr = '' . _('Documents: ') . ''; + $documentStr = '' . _kt('Documents: ') . ''; foreach ($aCantMove['documents'] as $iDocId) { $oD = Document::get($iDocId); $cantMoveItems['documents'][] = $oD->getName(); @@ -406,10 +406,10 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!empty($folderStr)) { - $_SESSION["KTErrorMessage"][] = _("The following folders can not be moved") . ": " . $folderStr; + $_SESSION["KTErrorMessage"][] = _kt("The following folders can not be moved") . ": " . $folderStr; } if (!empty($documentStr)) { - $_SESSION["KTErrorMessage"][] = _("The following documents can not be moved") . ": " . $documentStr; + $_SESSION["KTErrorMessage"][] = _kt("The following documents can not be moved") . ": " . $documentStr; } } @@ -417,14 +417,14 @@ class BrowseDispatcher extends KTStandardDispatcher { $oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1)); if (PEAR::isError($oFolder)) { - $this->errorRedirectToMain(_('Invalid folder selected.')); + $this->errorRedirectToMain(_kt('Invalid folder selected.')); exit(0); } $moveSet = $_SESSION['moves'][$sMoveCode]; if (empty($moveSet['folders']) && empty($moveSet['documents'])) { - $this->errorRedirectToMain(_('Please select documents or folders first.'), sprintf('fFolderId=%d', $oFolder->getId())); + $this->errorRedirectToMain(_kt('Please select documents or folders first.'), sprintf('fFolderId=%d', $oFolder->getId())); exit(0); } @@ -475,7 +475,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $documentStr = ''; if (!empty($moveSet['folders'])) { - $folderStr = '' . _('Folders: ') . ''; + $folderStr = '' . _kt('Folders: ') . ''; foreach ($moveSet['folders'] as $iFolderId) { $oF = Folder::get($iFolderId); $moveItems['folders'][] = $oF->getName(); @@ -484,7 +484,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!empty($moveSet['documents'])) { - $documentStr = '' . _('Documents: ') . ''; + $documentStr = '' . _kt('Documents: ') . ''; foreach ($moveSet['documents'] as $iDocId) { $oD = Document::get($iDocId); $moveItems['documents'][] = $oD->getName(); @@ -513,22 +513,22 @@ class BrowseDispatcher extends KTStandardDispatcher { $action_a = (array) KTUtil::arrayGet($_REQUEST, 'submit', null); $actions = array_keys($action_a); if (empty($actions)) { - $this->errorRedirectToMain(_('No action selected.')); + $this->errorRedirectToMain(_kt('No action selected.')); } else { $action = $actions[0]; } if ($action != 'move') { - $this->successRedirectToMain(_('Move cancelled.')); + $this->successRedirectToMain(_kt('Move cancelled.')); } $target_folder = KTUtil::arrayGet($_REQUEST, 'fFolderId'); - if ($target_folder == null ) { $this->errorRedirectToMain(_('No folder selected.')); } + if ($target_folder == null ) { $this->errorRedirectToMain(_kt('No folder selected.')); } $move_code = KTUtil::arrayGet($_REQUEST, 'fMoveCode'); $aFields = array(); - $aFields[] = new KTStaticTextWidget(_('Destination folder'), _('The folder which will contain the previously selected files and folders.'), 'fDocumentId', Folder::getFolderDisplayPath($target_folder), $this->oPage, false); - $aFields[] = new KTStringWidget(_('Reason'), _('The reason for moving these documents and folders, for historical purposes.'), 'sReason', "", $this->oPage, true); + $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); + $aFields[] = new KTStringWidget(_kt('Reason'), _kt('The reason for moving these documents and folders, for historical purposes.'), 'sReason', "", $this->oPage, true); // now show the items... @@ -541,7 +541,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $documentStr = ''; if (!empty($moveSet['folders'])) { - $folderStr = '' . _('Folders: ') . ''; + $folderStr = '' . _kt('Folders: ') . ''; foreach ($moveSet['folders'] as $iFolderId) { $oF = Folder::get($iFolderId); $moveItems['folders'][] = $oF->getName(); @@ -550,7 +550,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!empty($moveSet['documents'])) { - $documentStr = '' . _('Documents: ') . ''; + $documentStr = '' . _kt('Documents: ') . ''; foreach ($moveSet['documents'] as $iDocId) { $oD = Document::get($iDocId); $moveItems['documents'][] = $oD->getName(); @@ -576,7 +576,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $target_folder = KTUtil::arrayGet($_REQUEST, 'fFolderId'); $reason = KTUtil::arrayGet($_REQUEST, 'sReason'); if (empty($reason)) { - $_SESSION['KTErrorMessage'][] = _('You must supply a reason.'); + $_SESSION['KTErrorMessage'][] = _kt('You must supply a reason.'); return $this->do_finaliseMove(); } @@ -594,7 +594,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!Permission::userHasFolderWritePermission($oTargetFolder)) { - $this->errorRedirectTo("main", _("You do not have permission to move items to this location"), sprintf("fFolderId=%d", $oTargetFolder->getId())); + $this->errorRedirectTo("main", _kt("You do not have permission to move items to this location"), sprintf("fFolderId=%d", $oTargetFolder->getId())); exit(0); } @@ -607,7 +607,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $oDoc = Document::get($iDocId); if (PEAR::isError($oDoc)) { - $this->errorRedirectToMain(_('Invalid document.')); + $this->errorRedirectToMain(_kt('Invalid document.')); } $oOriginalFolder = Folder::get($oDoc->getFolderId()); @@ -622,7 +622,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $oDoc->setFolderID($oTargetFolder->getId()); $res = $oDoc->update(true); if (!$res) { - $this->errorRedirectTo("move", _("There was a problem updating the document's location in the database"), sprintf("fDocumentId=%d&fFolderId=%d", $oDoc->getId(), $oTargetFolder->getId())); + $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())); } //move the document on the file system @@ -630,7 +630,7 @@ class BrowseDispatcher extends KTStandardDispatcher { if (!$oStorage->moveDocument($oDoc, $oOriginalFolder, $oTargetFolder)) { $oDoc->setFolderID($oOriginalFolder->getId()); $oDoc->update(true); - $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())); + $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())); } $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s", @@ -672,17 +672,17 @@ class BrowseDispatcher extends KTStandardDispatcher { foreach ($aMoveStack['folders'] as $iFolderId) { $oFolder = Folder::get($iFolderId); - if (PEAR::isError($oFolder)) { $this->errorRedirectToMain(_('Invalid folder.')); } + if (PEAR::isError($oFolder)) { $this->errorRedirectToMain(_kt('Invalid folder.')); } $res = KTFolderUtil::move($oFolder, $oTargetFolder, $this->oUser); if (PEAR::isError($res)) { - $this->errorRedirectToMain(_('Failed to move the folder: ') . $res->getMessage()); + $this->errorRedirectToMain(_kt('Failed to move the folder: ') . $res->getMessage()); } } $this->commitTransaction(); - $this->successRedirectToMain(_('Move completed.'), sprintf('fFolderId=%d', $target_folder)); + $this->successRedirectToMain(_kt('Move completed.'), sprintf('fFolderId=%d', $target_folder)); } function do_startDelete() { @@ -704,11 +704,11 @@ class BrowseDispatcher extends KTStandardDispatcher { $documentStr = ''; if (!empty($aFolderSelection)) { - $folderStr = '' . _('Folders: ') . ''; + $folderStr = '' . _kt('Folders: ') . ''; foreach ($aFolderSelection as $iFolderId) { $oF = Folder::get($iFolderId); if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oF)) { - $this->errorRedirectToMain(_('You do not have permission to delete the folder: ') . $oF->getName()); + $this->errorRedirectToMain(_kt('You do not have permission to delete the folder: ') . $oF->getName()); } $delItems['folders'][] = $oF->getName(); } @@ -716,11 +716,11 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!empty($aDocumentSelection)) { - $documentStr = '' . _('Documents: ') . ''; + $documentStr = '' . _kt('Documents: ') . ''; foreach ($aDocumentSelection as $iDocId) { $oD = Document::get($iDocId); if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oD)) { - $this->errorRedirectToMain(_('You do not have permission to delete the document: ') . $oD->getName()); + $this->errorRedirectToMain(_kt('You do not have permission to delete the document: ') . $oD->getName()); } if (!PEAR::isError($oD)) { $delItems['documents'][] = $oD->getName(); @@ -730,7 +730,7 @@ class BrowseDispatcher extends KTStandardDispatcher { } $aFields = array(); - $aFields[] = new KTStringWidget(_('Reason'), _('The reason for the deletion of these documents and folders for historical purposes.'), 'sReason', "", $this->oPage, true); + $aFields[] = new KTStringWidget(_kt('Reason'), _kt('The reason for the deletion of these documents and folders for historical purposes.'), 'sReason', "", $this->oPage, true); $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/folder/mass_delete"); @@ -757,7 +757,7 @@ class BrowseDispatcher extends KTStandardDispatcher { $res = KTUtil::arrayGet($_REQUEST,'sReason'); $sReason = $res; if (empty($res)) { - $_SESSION['KTErrorMessage'][] = _('You must supply a reason.'); + $_SESSION['KTErrorMessage'][] = _kt('You must supply a reason.'); return $this->do_startDelete(); } @@ -769,9 +769,9 @@ class BrowseDispatcher extends KTStandardDispatcher { foreach ($aFolderSelection as $id) { $oF = Folder::get($id); if (PEAR::isError($oF) || ($oF == false)) { - return $this->errorRedirectToMain(_('Invalid Folder selected.')); + return $this->errorRedirectToMain(_kt('Invalid Folder selected.')); } else if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oF)) { - return $this->errorRedirectToMain(sprintf(_('You do not have permissions to delete the folder: %s'), $oF->getName())); + return $this->errorRedirectToMain(sprintf(_kt('You do not have permissions to delete the folder: %s'), $oF->getName())); } else{ $aFolders[] = $oF; } @@ -780,9 +780,9 @@ class BrowseDispatcher extends KTStandardDispatcher { $oD = Document::get($id); if (PEAR::isError($oD) || ($oD == false)) { - return $this->errorRedirectToMain(_('Invalid Document selected.')); + return $this->errorRedirectToMain(_kt('Invalid Document selected.')); } else if (!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPerm, $oD)) { - return $this->errorRedirectToMain(sprintf(_('You do not have permissions to delete the document: %s'), $oD->getName())); + return $this->errorRedirectToMain(sprintf(_kt('You do not have permissions to delete the document: %s'), $oD->getName())); } else { $aDocuments[] = $oD; } @@ -816,19 +816,19 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!Permission::userIsSystemAdministrator() && !Permission::isUnitAdministratorForFolder($this->oUser, $iFolderId)) { - $this->errorRedirectToMain(_('You are not an administrator')); + $this->errorRedirectToMain(_kt('You are not an administrator')); } $_SESSION['adminmode'] = true; if ($_REQUEST['fDocumentId']) { - $_SESSION['KTInfoMessage'][] = _('Administrator mode enabled'); + $_SESSION['KTInfoMessage'][] = _kt('Administrator mode enabled'); redirect(KTBrowseUtil::getUrlForDocument($iDocumentId)); exit(0); } if ($_REQUEST['fFolderId']) { - $this->successRedirectToMain(_('Administrator mode enabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId'])); + $this->successRedirectToMain(_kt('Administrator mode enabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId'])); } - $this->successRedirectToMain(_('Administrator mode enabled')); + $this->successRedirectToMain(_kt('Administrator mode enabled')); } function do_disableAdminMode() { @@ -843,19 +843,19 @@ class BrowseDispatcher extends KTStandardDispatcher { } if (!Permission::userIsSystemAdministrator() && !Permission::isUnitAdministratorForFolder($this->oUser, $iFolderId)) { - $this->errorRedirectToMain(_('You are not an administrator')); + $this->errorRedirectToMain(_kt('You are not an administrator')); } $_SESSION['adminmode'] = false; if ($_REQUEST['fDocumentId']) { - $_SESSION['KTInfoMessage'][] = _('Administrator mode disabled'); + $_SESSION['KTInfoMessage'][] = _kt('Administrator mode disabled'); redirect(KTBrowseUtil::getUrlForDocument($iDocumentId)); exit(0); } if ($_REQUEST['fFolderId']) { - $this->successRedirectToMain(_('Administrator mode disabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId'])); + $this->successRedirectToMain(_kt('Administrator mode disabled'), sprintf('fFolderId=%d', $_REQUEST['fFolderId'])); } - $this->successRedirectToMain(_('Administrator mode disabled')); + $this->successRedirectToMain(_kt('Administrator mode disabled')); } } diff --git a/dashboard.php b/dashboard.php index f93ac43..db6d983 100644 --- a/dashboard.php +++ b/dashboard.php @@ -48,7 +48,7 @@ class DashboardDispatcher extends KTStandardDispatcher { function DashboardDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'dashboard', 'name' => _('Dashboard')), + array('action' => 'dashboard', 'name' => _kt('Dashboard')), ); return parent::KTStandardDispatcher(); } @@ -62,8 +62,8 @@ class DashboardDispatcher extends KTStandardDispatcher { $aDashlets = $oDashletRegistry->getDashlets($this->oUser); $this->sSection = "dashboard"; - $this->oPage->setBreadcrumbDetails(_("Home")); - $this->oPage->title = _("Dashboard"); + $this->oPage->setBreadcrumbDetails(_kt("Home")); + $this->oPage->title = _kt("Dashboard"); // simplistic improvement over the standard rendering: float half left // and half right. +Involves no JS -can leave lots of white-space at the bottom. diff --git a/edit.php b/edit.php index ea7d72f..0befb16 100644 --- a/edit.php +++ b/edit.php @@ -72,11 +72,11 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); if (empty($document_id)) { - $this->errorPage(_("No document specified for editing.")); + $this->errorPage(_kt("No document specified for editing.")); } $oDocument = Document::get($document_id); if (PEAR::isError($oDocument)) { - $this->errorPage(_("Invalid Document.")); + $this->errorPage(_kt("Invalid Document.")); } $this->oDocument = $oDocument; @@ -94,7 +94,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { function KTEditDocumentDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'browse', 'name' => _('Browse')), + array('action' => 'browse', 'name' => _kt('Browse')), ); return parent::KTStandardDispatcher(); } @@ -102,7 +102,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { // FIXME identify the current location somehow. function addPortlets($currentaction = null) { $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser); - $oPortlet = new KTActionPortlet(_("Document Actions")); + $oPortlet = new KTActionPortlet(_kt("Document Actions")); $oPortlet->setActions($actions, $currentaction); $this->oPage->addPortlet($oPortlet); @@ -132,17 +132,17 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); if (empty($document_id)) { - $this->errorPage(_("No document specified for editing.")); + $this->errorPage(_kt("No document specified for editing.")); } $oDocument = Document::get($document_id); if (PEAR::isError($oDocument)) { - $this->errorPage(_("Invalid Document.")); + $this->errorPage(_kt("Invalid Document.")); } $this->oDocument = $oDocument; $this->addPortlets("Edit"); $this->addBreadcrumbs(); - $this->oPage->setBreadcrumbDetails(_('Change Document Type')); + $this->oPage->setBreadcrumbDetails(_kt('Change Document Type')); $aDocTypes = DocumentType::getList(); @@ -181,10 +181,10 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { $newType = KTUtil::arrayGet($_REQUEST, 'fDocType'); $oType = DocumentType::get($newType); if (PEAR::isError($oType) || ($oType == false)) { - $this->errorRedirectToMain(_("Invalid type selected.")); + $this->errorRedirectToMain(_kt("Invalid type selected.")); } - $_SESSION['KTInfoMessage'][] = _('Document Type Changed. Please review the information below, and update as appropriate.'); + $_SESSION['KTInfoMessage'][] = _kt('Document Type Changed. Please review the information below, and update as appropriate.'); $_REQUEST['setType'] = $newType; @@ -197,11 +197,11 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); if (empty($document_id)) { - $this->errorPage(_("No document specified for editing.")); + $this->errorPage(_kt("No document specified for editing.")); } $oDocument = Document::get($document_id); if (PEAR::isError($oDocument)) { - $this->errorPage(_("Invalid Document.")); + $this->errorPage(_kt("Invalid Document.")); } $this->oDocument = $oDocument; @@ -266,16 +266,16 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { function do_update() { $document_id = KTUtil::arrayGet($_REQUEST, 'fDocumentId'); if (empty($document_id)) { - $this->errorPage(_("No document specified for editing.")); + $this->errorPage(_kt("No document specified for editing.")); } $oDocument = Document::get($document_id); if (PEAR::isError($oDocument)) { - $this->errorPage(_("Invalid Document.")); + $this->errorPage(_kt("Invalid Document.")); } $aErrorOptions = array( 'redirect_to' => array('main', sprintf('fDocumentId=%d', $oDocument->getId())), - 'message' => _('No name given'), + 'message' => _kt('No name given'), ); $title = KTUtil::arrayGet($_REQUEST, 'generic_title'); $title = $this->oValidator->validateString($title, @@ -285,7 +285,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { if ($newType !== null) { $oDT = DocumentType::get($newType); if (PEAR::isError($oDT) || ($oDT == false)) { - $this->errorRedirectToMain(_('Invalid document type specified for change.')); + $this->errorRedirectToMain(_kt('Invalid document type specified for change.')); } } else { $oDT = null; @@ -475,7 +475,7 @@ class KTEditDocumentDispatcher extends KTStandardDispatcher { $document_data['errors'] = $res->aFailed['field']; - $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.')); + $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.')); $oTemplating =& KTTemplating::getSingleton(); $oTemplate =& $oTemplating->loadTemplate("kt3/document/edit"); diff --git a/help.php b/help.php index a99c025..a606bd0 100644 --- a/help.php +++ b/help.php @@ -61,8 +61,8 @@ class HelpDispatcher extends KTStandardDispatcher { var $bIsReplacement = false; function HelpDispatcher() { - $this->aBreadcrumbs[] = array('action' => 'dashboard', 'name' => _('Dashboard')); - $this->aBreadcrumbs[] = array('name' => _('Help')); + $this->aBreadcrumbs[] = array('action' => 'dashboard', 'name' => _kt('Dashboard')); + $this->aBreadcrumbs[] = array('name' => _kt('Help')); parent::KTStandardDispatcher(); } @@ -79,8 +79,8 @@ class HelpDispatcher extends KTStandardDispatcher { $pathinfo = KTUtil::arrayGet($_SERVER, 'PATH_INFO'); if (empty($pathinfo)) { - $this->oPage->setTitle(_('No help page specified.')); - $this->oPage->addError(_('No help page specified.')); + $this->oPage->setTitle(_kt('No help page specified.')); + $this->oPage->addError(_kt('No help page specified.')); return ' '; } @@ -88,8 +88,8 @@ class HelpDispatcher extends KTStandardDispatcher { $help_path = KTHelp::getHelpSubPath($pathinfo); if ($help_path == false) { - $this->oPage->setTitle(_('Invalid help location specified.')); - $this->oPage->addError(_('Invalid help location specified.')); + $this->oPage->setTitle(_kt('Invalid help location specified.')); + $this->oPage->addError(_kt('Invalid help location specified.')); return ' '; } @@ -113,8 +113,8 @@ class HelpDispatcher extends KTStandardDispatcher { $this->oPage->setTitle($aHelpInfo['title']); //return $aHelpInfo['body']; } else { - $this->oPage->setTitle(_('Invalid help location specified.')); - $this->oPage->addError(_('Invalid help location specified.')); + $this->oPage->setTitle(_kt('Invalid help location specified.')); + $this->oPage->addError(_kt('Invalid help location specified.')); return ' '; } } @@ -148,7 +148,7 @@ class HelpDispatcher extends KTStandardDispatcher { redirect($sReferer); exit(0); } else { - $this->errorRedirectToMain(_("Invalid return key from help system.")); + $this->errorRedirectToMain(_kt("Invalid return key from help system.")); } } } diff --git a/login.php b/login.php index 74c3dc0..694c232 100644 --- a/login.php +++ b/login.php @@ -106,7 +106,7 @@ class LoginPageDispatcher extends KTDispatcher { $cookieVerify = KTUtil::arrayGet($_REQUEST, 'cookieverify', null); if (($cookieVerify === null) || ($cookieTest !== $cookieVerify)) { - $this->simpleRedirectToMain(_('You must have cookies enabled to use the document management system.'), $url, $params); + $this->simpleRedirectToMain(_kt('You must have cookies enabled to use the document management system.'), $url, $params); exit(0); } @@ -114,27 +114,27 @@ class LoginPageDispatcher extends KTDispatcher { $password = KTUtil::arrayGet($_REQUEST,'password'); if (empty($username)) { - $this->simpleRedirectToMain(_('Please enter your username.'), $url, $params); + $this->simpleRedirectToMain(_kt('Please enter your username.'), $url, $params); } if (empty($password)) { - $this->simpleRedirectToMain(_('Please enter your password.'), $url, $params); + $this->simpleRedirectToMain(_kt('Please enter your password.'), $url, $params); } $oUser =& User::getByUsername($username); if (PEAR::isError($oUser) || ($oUser === false)) { - $this->simpleRedirectToMain(_('Login failed. Please check your username and password, and try again.'), $url, $params); + $this->simpleRedirectToMain(_kt('Login failed. Please check your username and password, and try again.'), $url, $params); exit(0); } $authenticated = KTAuthenticationUtil::checkPassword($oUser, $password); if (PEAR::isError($authenticated)) { - $this->simpleRedirectToMain(_('Authentication failure. Please try again.'), $url, $params); + $this->simpleRedirectToMain(_kt('Authentication failure. Please try again.'), $url, $params); exit(0); } if ($authenticated !== true) { - $this->simpleRedirectToMain(_('Login failed. Please check your username and password, and try again.'), $url, $params); + $this->simpleRedirectToMain(_kt('Login failed. Please check your username and password, and try again.'), $url, $params); exit(0); } diff --git a/notify.php b/notify.php index 6ff363c..9d05ee1 100644 --- a/notify.php +++ b/notify.php @@ -56,7 +56,7 @@ class KTNotificationDispatcher extends KTStandardDispatcher { $oKTNotification =& KTNotification::get($notification_id); if (PEAR::isError($oKTNotification)) { - $this->addErrorMessage(_('Invalid notification.')); + $this->addErrorMessage(_kt('Invalid notification.')); exit(redirect(generateControllerLink('dashboard'))); } @@ -83,15 +83,15 @@ class KTNotificationDispatcher extends KTStandardDispatcher { $res = $oNotification->delete(); if (PEAR::isError($res)) { $this->rollbackTransaction(); - $this->addErrorMessage(_('Failed to clear notifications.')); + $this->addErrorMessage(_kt('Failed to clear notifications.')); exit(redirect(generateControllerLink('dashboard'))); } } $this->commitTransaction(); - $this->addInfoMessage(_('Notifications cleared.')); + $this->addInfoMessage(_kt('Notifications cleared.')); exit(redirect(generateControllerLink('dashboard'))); } } $dispatcher =& new KTNotificationDispatcher(); -$dispatcher->dispatch(); \ No newline at end of file +$dispatcher->dispatch(); diff --git a/preferences.php b/preferences.php index 8a2acb5..f2dbe05 100644 --- a/preferences.php +++ b/preferences.php @@ -41,14 +41,14 @@ class PreferencesDispatcher extends KTStandardDispatcher { function PreferencesDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'preferences', 'name' => _('Preferences')), + array('action' => 'preferences', 'name' => _kt('Preferences')), ); return parent::KTStandardDispatcher(); } function do_main() { - $this->oPage->setBreadcrumbDetails(_("Your Preferences")); - $this->oPage->title = _("Dashboard"); + $this->oPage->setBreadcrumbDetails(_kt("Your Preferences")); + $this->oPage->title = _kt("Dashboard"); $oUser =& $this->oUser; @@ -56,10 +56,10 @@ class PreferencesDispatcher extends KTStandardDispatcher { $aOptions = array('autocomplete' => false); $edit_fields = array(); - $edit_fields[] = new KTStringWidget(_('Name'),_('Your full name. This is shown in reports and listings. e.g. John Smith'), 'name', $oUser->getName(), $this->oPage, true, null, null, $aOptions); - $edit_fields[] = new KTStringWidget(_('Email Address'),_('Your email address. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', $oUser->getEmail(), $this->oPage, false, null, null, $aOptions); - $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 Dashboard'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false, null, null, $aOptions); - $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. +27 99 999 9999'), 'mobile_number', $oUser->getMobile(), $this->oPage, false, null, null, $aOptions); + $edit_fields[] = new KTStringWidget(_kt('Name'), _kt('Your full name. This is shown in reports and listings. e.g. John Smith'), 'name', $oUser->getName(), $this->oPage, true, null, null, $aOptions); + $edit_fields[] = new KTStringWidget(_kt('Email Address'), _kt('Your email address. Notifications and alerts are mailed to this address if email notifications is set below. e.g. jsmith@acme.com'), 'email_address', $oUser->getEmail(), $this->oPage, false, null, null, $aOptions); + $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 Dashboard'), 'email_notifications', $oUser->getEmailNotification(), $this->oPage, false, null, null, $aOptions); + $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. +27 99 999 9999'), 'mobile_number', $oUser->getMobile(), $this->oPage, false, null, null, $aOptions); $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/principals/preferences"); @@ -77,8 +77,8 @@ class PreferencesDispatcher extends KTStandardDispatcher { } function do_setPassword() { - $this->oPage->setBreadcrumbDetails(_("Your Password")); - $this->oPage->title = _("Dashboard"); + $this->oPage->setBreadcrumbDetails(_kt("Your Password")); + $this->oPage->title = _kt("Dashboard"); $oUser =& $this->oUser; @@ -86,8 +86,8 @@ class PreferencesDispatcher extends KTStandardDispatcher { $aOptions = array('autocomplete' => false); $edit_fields = array(); - $edit_fields[] = new KTPasswordWidget(_('Password'), _('Specify your new password.'), 'password', null, $this->oPage, true, null, null, $aOptions); - $edit_fields[] = new KTPasswordWidget(_('Confirm Password'), _('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions); + $edit_fields[] = new KTPasswordWidget(_kt('Password'), _kt('Specify your new password.'), 'password', null, $this->oPage, true, null, null, $aOptions); + $edit_fields[] = new KTPasswordWidget(_kt('Confirm Password'), _kt('Confirm the password specified above.'), 'confirm_password', null, $this->oPage, true, null, null, $aOptions); $oTemplating =& KTTemplating::getSingleton(); @@ -107,16 +107,16 @@ class PreferencesDispatcher extends KTStandardDispatcher { $confirm_password = KTUtil::arrayGet($_REQUEST, 'confirm_password'); if (empty($password)) { - $this->errorRedirectTo("setPassword", _("You must specify a password.")); + $this->errorRedirectTo("setPassword", _kt("You must specify a password.")); } else if ($password !== $confirm_password) { - $this->errorRedirectTo("setPassword", _("The passwords you specified do not match.")); + $this->errorRedirectTo("setPassword", _kt("The passwords you specified do not match.")); } $KTConfig =& KTConfig::getSingleton(); $minLength = ((int) $KTConfig->get('user_prefs/passwordLength', 6)); if (strlen($password) < $minLength) { - $this->errorRedirectTo("setPassword", sprintf(_("Your password is too short - passwords must be at least %d characters long."), $minLength)); + $this->errorRedirectTo("setPassword", sprintf(_kt("Your password is too short - passwords must be at least %d characters long."), $minLength)); } // FIXME more validation would be useful. @@ -134,11 +134,11 @@ class PreferencesDispatcher extends KTStandardDispatcher { if (PEAR::isError($res) || ($res == false)) { - $this->errorRedirectoToMain(_('Failed to update user.')); + $this->errorRedirectoToMain(_kt('Failed to update user.')); } $this->commitTransaction(); - $this->successRedirectToMain(_('Your password has been changed.')); + $this->successRedirectToMain(_kt('Your password has been changed.')); } @@ -151,7 +151,7 @@ class PreferencesDispatcher extends KTStandardDispatcher { $oUser =& $this->oUser; $name = $this->oValidator->validateString(KTUtil::arrayGet($_REQUEST, 'name'), - KTUtil::meldOptions($aErrorOptions, array('message' => _('You must specify your name.')))); + KTUtil::meldOptions($aErrorOptions, array('message' => _kt('You must specify your name.')))); $email_address = $this->oValidator->validateEmailAddress(KTUtil::arrayGet($_REQUEST, 'email_address'), $aErrorOptions); @@ -176,11 +176,11 @@ class PreferencesDispatcher extends KTStandardDispatcher { $res = $oUser->doLimitedUpdate(); // ignores a fix blacklist of items. if (PEAR::isError($res) || ($res == false)) { - $this->errorRedirectoToMain(_('Failed to update your details.')); + $this->errorRedirectoToMain(_kt('Failed to update your details.')); } $this->commitTransaction(); - $this->successRedirectToMain(_('Your details have been updated.')); + $this->successRedirectToMain(_kt('Your details have been updated.')); } diff --git a/search/booleanSearch.php b/search/booleanSearch.php index 23a2ae0..60a26d4 100755 --- a/search/booleanSearch.php +++ b/search/booleanSearch.php @@ -45,14 +45,14 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { function BooleanSearchDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'browse', 'name' => _('Browse')), + array('action' => 'browse', 'name' => _kt('Browse')), ); return parent::KTStandardDispatcher(); } function do_main() { - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _("Advanced Search")); - $this->oPage->setBreadcrumbDetails(_('defining search')); + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt("Advanced Search")); + $this->oPage->setBreadcrumbDetails(_kt('defining search')); $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/boolean_search"); @@ -88,7 +88,7 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { } if (empty($datavars)) { - $this->errorRedirectToMain(_('You need to have at least 1 condition.')); + $this->errorRedirectToMain(_kt('You need to have at least 1 condition.')); } $res = $this->handleCriteriaSet($datavars, KTUtil::arrayGet($_REQUEST, 'fStartIndex', 1), $title); @@ -99,11 +99,11 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { function handleCriteriaSet($aCriteriaSet, $iStartIndex, $sTitle=null) { if ($sTitle == null) { - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Advanced Search')); - $sTitle = _('Search Results'); + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Advanced Search')); + $sTitle = _kt('Search Results'); } else { - $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _('Saved Search')); - $this->oPage->setTitle(_('Saved Search: ') . $sTitle); + $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Saved Search')); + $this->oPage->setTitle(_kt('Saved Search: ') . $sTitle); } $this->oPage->setBreadcrumbDetails($sTitle); @@ -115,10 +115,10 @@ class BooleanSearchDispatcher extends KTStandardDispatcher { $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php')); $collection->addColumn($t); $collection->addColumn(new DownloadColumn('','download')); - $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime")); - $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate")); - $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID')); - $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state')); + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime")); + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate")); + $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID')); + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state')); $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText"); diff --git a/search/simpleSearch.php b/search/simpleSearch.php index 8cbd9f5..2975760 100644 --- a/search/simpleSearch.php +++ b/search/simpleSearch.php @@ -126,8 +126,8 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { function SimpleSearchDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'browse', 'name' => _('Browse')), - array('name' => _('Simple Search')) + array('action' => 'browse', 'name' => _kt('Browse')), + array('name' => _kt('Simple Search')) ); return parent::KTStandardDispatcher(); } @@ -135,7 +135,7 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { function do_main() { $aErrorOptions = array( - "message" => _("Please provide a search term"), + "message" => _kt("Please provide a search term"), ); $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText"); $this->oValidator->notEmpty($searchable_text, $aErrorOptions); @@ -153,10 +153,10 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { $t->setOptions(array('documenturl' => $GLOBALS['KTRootUrl'] . '/view.php')); $collection->addColumn($t); $collection->addColumn(new DownloadColumn('','download')); - $collection->addColumn(new DateColumn(_("Created"),"created", "getCreatedDateTime")); - $collection->addColumn(new DateColumn(_("Last Modified"),"modified", "getLastModifiedDate")); - $collection->addColumn(new UserColumn(_('Creator'),'creator_id','getCreatorID')); - $collection->addColumn(new WorkflowColumn(_('Workflow State'),'workflow_state')); + $collection->addColumn(new DateColumn(_kt("Created"),"created", "getCreatedDateTime")); + $collection->addColumn(new DateColumn(_kt("Last Modified"),"modified", "getLastModifiedDate")); + $collection->addColumn(new UserColumn(_kt('Creator'),'creator_id','getCreatorID')); + $collection->addColumn(new WorkflowColumn(_kt('Workflow State'),'workflow_state')); $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0); $batchSize = 20; diff --git a/view.php b/view.php index 9a5a74b..910caf6 100755 --- a/view.php +++ b/view.php @@ -58,7 +58,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { function ViewDocumentDispatcher() { $this->aBreadcrumbs = array( - array('action' => 'browse', 'name' => _('Browse')), + array('action' => 'browse', 'name' => _kt('Browse')), ); parent::KTStandardDispatcher(); @@ -75,7 +75,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { // FIXME identify the current location somehow. function addPortlets($currentaction = null) { $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser); - $oPortlet = new KTActionPortlet(_("Document Actions")); + $oPortlet = new KTActionPortlet(_kt("Document Actions")); $oPortlet->setActions($actions, $currentaction); $this->oPage->addPortlet($oPortlet); } @@ -104,21 +104,21 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { if (!KTBrowseUtil::inAdminMode($this->oUser, $oDocument->getFolderId())) { if ($oDocument->getStatusID() == ARCHIVED) { - $this->oPage->addError(_('This document has been archived. Please contact the system administrator to have it restored if it is still needed.')); + $this->oPage->addError(_kt('This document has been archived. Please contact the system administrator to have it restored if it is still needed.')); return $this->do_error(); } else if ($oDocument->getStatusID() == DELETED) { - $this->oPage->addError(_('This document has been deleted. Please contact the system administrator to have it restored if it is still needed.')); + $this->oPage->addError(_kt('This document has been deleted. Please contact the system administrator to have it restored if it is still needed.')); return $this->do_error(); } else if (!Permission::userHasDocumentReadPermission($oDocument)) { - $this->oPage->addError(_('You are not allowed to view this document')); + $this->oPage->addError(_kt('You are not allowed to view this document')); return $this->do_error(); } } if ($oDocument->getStatusID() == ARCHIVED) { - $this->oPage->addError(_('This document has been archived.')); + $this->oPage->addError(_kt('This document has been archived.')); } else if ($oDocument->getStatusID() == DELETED) { - $this->oPage->addError(_('This document has been deleted.')); + $this->oPage->addError(_kt('This document has been deleted.')); } $this->oPage->setSecondaryTitle($oDocument->getName()); @@ -130,7 +130,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { $this->oDocument =& $oDocument; $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); - $this->oPage->setBreadcrumbDetails(_("document details")); + $this->oPage->setBreadcrumbDetails(_kt("document details")); $this->addPortlets("Document Details"); $document_data["document"] = $oDocument; @@ -222,7 +222,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { "folderaction" => "browse", ); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); - $this->oPage->setBreadcrumbDetails(_("history")); + $this->oPage->setBreadcrumbDetails(_kt("history")); $this->addPortlets("History"); $aTransactions = array(); @@ -244,7 +244,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { // render pass. - $this->oPage->title = _("Document History"); + $this->oPage->title = _kt("Document History"); $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("kt3/view_document_history"); $aTemplateData = array( @@ -281,7 +281,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { "folderaction" => "browse", ); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); - $this->oPage->setBreadcrumbDetails(_("history")); + $this->oPage->setBreadcrumbDetails(_kt("history")); $this->addPortlets("History"); $aMetadataVersions = KTDocumentMetadataVersion::getByDocument($oDocument); @@ -291,7 +291,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { } // render pass. - $this->oPage->title = _("Document History"); + $this->oPage->title = _kt("Document History"); $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("kt3/document/metadata_history"); @@ -334,7 +334,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { } if (!Permission::userHasDocumentReadPermission($oDocument)) { // FIXME inconsistent. - $this->oPage->addError(_('You are not allowed to view this document')); + $this->oPage->addError(_kt('You are not allowed to view this document')); return $this->do_error(); } $this->oDocument =& $oDocument; @@ -344,7 +344,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { "folderaction" => "browse", ); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); - $this->oPage->setBreadcrumbDetails(_("compare versions")); + $this->oPage->setBreadcrumbDetails(_kt("compare versions")); $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'); if ($comparison_version=== null) { @@ -354,7 +354,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { $oComparison =& Document::get($oDocument->getId(), $comparison_version); if (PEAR::isError($oComparison)) { - $this->errorRedirectToMain(_('Invalid document to compare against.')); + $this->errorRedirectToMain(_kt('Invalid document to compare against.')); } $comparison_data = array(); $comparison_data['document_id'] = $oComparison->getId(); @@ -471,7 +471,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { } if (!Permission::userHasDocumentReadPermission($oDocument)) { // FIXME inconsistent. - $this->oPage->addError(_('You are not allowed to view this document')); + $this->oPage->addError(_kt('You are not allowed to view this document')); return $this->do_error(); } $this->oDocument =& $oDocument; @@ -481,7 +481,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { "folderaction" => "browse", ); $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions)); - $this->oPage->setBreadcrumbDetails(_("Select Document Version to compare against")); + $this->oPage->setBreadcrumbDetails(_kt("Select Document Version to compare against")); $aMetadataVersions = KTDocumentMetadataVersion::getByDocument($oDocument); $aVersions = array(); @@ -503,7 +503,7 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { function getUserForId($iUserId) { $u = User::get($iUserId); - if (PEAR::isError($u) || ($u == false)) { return _('User no longer exists'); } + if (PEAR::isError($u) || ($u == false)) { return _kt('User no longer exists'); } return $u->getName(); } } -- libgit2 0.21.4