diff --git a/plugins/ktcore/KTAdminPlugins.php b/plugins/ktcore/KTAdminPlugins.php
index 6d24192..09afe07 100644
--- a/plugins/ktcore/KTAdminPlugins.php
+++ b/plugins/ktcore/KTAdminPlugins.php
@@ -5,12 +5,12 @@ require_once(KT_LIB_DIR . "/plugins/KTAdminNavigation.php");
$oAdminRegistry =& KTAdminNavigationRegistry::getSingleton();
// set up the categories.
-$oAdminRegistry->registerCategory("principals", "Users and Groups", " Control which users can log in, and are part of which groups and organisational units from these management panels.");
-$oAdminRegistry->registerCategory("security", "Security Management", " Assign permissions to users and groups, and specify which permissions are required to interact with various parts of the Document Management System.");
-$oAdminRegistry->registerCategory("storage", "Document Storage", "Manage how and where the actual documents will be stored, work with document archives and deal with other document related problems.");
-$oAdminRegistry->registerCategory("documents", "Document Type Configuration", "Configure the information that needs to be collected about different kinds of documents.");
-$oAdminRegistry->registerCategory("collections", "Collections", "Specify how groups of documents are displayed in browse and search mode.");
-$oAdminRegistry->registerCategory("misc", "Miscellaneous", "Various settings which do not fit into the other categories, including help, etc.");
+$oAdminRegistry->registerCategory("principals", _("Users and Groups"), _("Control which users can log in, and are part of which groups and organisational units from these management panels."));
+$oAdminRegistry->registerCategory("security", _("Security Management"), _("Assign permissions to users and groups, and specify which permissions are required to interact with various parts of the Document Management System."));
+$oAdminRegistry->registerCategory("storage", _("Document Storage"), _("Manage how and where the actual documents will be stored, work with document archives and deal with other document related problems."));
+$oAdminRegistry->registerCategory("documents", _("Document Type Configuration"), _("Configure the information that needs to be collected about different kinds of documents."));
+$oAdminRegistry->registerCategory("collections", _("Collections"), _("Specify how groups of documents are displayed in browse and search mode."));
+$oAdminRegistry->registerCategory("misc", _("Miscellaneous"), _("Various settings which do not fit into the other categories, including help, etc."));
@@ -26,29 +26,29 @@ $oAdminRegistry->registerCategory("misc", "Miscellaneous", "Various settings whi
// FIXME url traversal DOESN'T WORK
// users and groups
-$oAdminRegistry->registerLocation("users",'KTUserAdminDispatcher',"principals", "Manage Users","Add or remove users from the system.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php', null);
-$oAdminRegistry->registerLocation("groups",'KTGroupAdminDispatcher',"principals", "Manage Groups","Add or remove groups from the system.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/groupManagement.php', null);
-$oAdminRegistry->registerLocation("units",'KTUnitAdminDispatcher',"principals", "Control Units","Specify which organisation units are available.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/unitManagement.php', null);
+$oAdminRegistry->registerLocation("users",'KTUserAdminDispatcher',"principals", _("Manage Users"), _("Add or remove users from the system."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php', null);
+$oAdminRegistry->registerLocation("groups",'KTGroupAdminDispatcher',"principals", _("Manage Groups"), _("Add or remove groups from the system."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/groupManagement.php', null);
+$oAdminRegistry->registerLocation("units",'KTUnitAdminDispatcher',"principals", _("Control Units"), _("Specify which organisation units are available."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/unitManagement.php', null);
// disabled until it actually makes sense.
//$oAdminRegistry->registerLocation("orgs",'KTOrgAdminDispatcher',"principals", "Control Organisations","Specify which organisations are available.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/orgManagement.php', null);
// security
-$oAdminRegistry->registerLocation("permissions",'ManagePermissionsDispatcher',"security", "Permissions","Create or Delete permissions.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/permissions/managePermissions.php', null);
-$oAdminRegistry->registerLocation("roles",'RoleAdminDispatcher',"security", "Roles","Create or Delete roles (incomplete).", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/rolemanagement/roleManagement.php', null);
+$oAdminRegistry->registerLocation("permissions",'ManagePermissionsDispatcher',"security", _("Permissions"), _("Create or Delete permissions."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/permissions/managePermissions.php', null);
+$oAdminRegistry->registerLocation("roles",'RoleAdminDispatcher',"security", _("Roles"), _("Create or Delete roles") . " (incomplete).", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/rolemanagement/roleManagement.php', null);
// documents
-$oAdminRegistry->registerLocation("typemanagement",'KTDocumentTypeDispatcher','documents', 'Document Types','Manage the different classes of document which can be added to the system.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/documentTypes.php', null);
-$oAdminRegistry->registerLocation("fieldmanagement",'KTDocumentFieldDispatcher','documents', 'Document Fieldsets','Control which kinds of documents have which sets of information associated with them.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php', null);
-$oAdminRegistry->registerLocation("linkmanagement",'KTDocLinkAdminDispatcher','documents', 'Link Type Management','Specify the different "link types" - ways to relate different documents togeter.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/documentLinks.php', null);
-$oAdminRegistry->registerLocation("workflows",'KTWorkflowDispatcher','documents', 'Workflows','Configure the process documents go through..', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php', null);
+$oAdminRegistry->registerLocation("typemanagement",'KTDocumentTypeDispatcher','documents', _('Document Types'), _('Manage the different classes of document which can be added to the system.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/documentTypes.php', null);
+$oAdminRegistry->registerLocation("fieldmanagement",'KTDocumentFieldDispatcher','documents', _('Document Fieldsets'), _('Control which kinds of documents have which sets of information associated with them.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php', null);
+$oAdminRegistry->registerLocation("linkmanagement",'KTDocLinkAdminDispatcher','documents', _('Link Type Management'), _('Specify the different "link types" - ways to relate different documents togeter.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/documentLinks.php', null);
+$oAdminRegistry->registerLocation("workflows",'KTWorkflowDispatcher','documents', _('Workflows'), _('Configure the process documents go through.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php', null);
// storage
-$oAdminRegistry->registerLocation("checkout",'KTCheckoutAdminDispatcher','storage', 'Checked Out Document Control','Override the checked-out status of documents if a user has failed to do so.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php', null);
-$oAdminRegistry->registerLocation("archived",'ArchivedDocumentsDispatcher','storage', 'Archived Document Restoration','Restore old (archived) documents, usually at a user\'s request.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocuments.php', null);
-$oAdminRegistry->registerLocation("expunge",'DeletedDocumentsDispatcher','storage', 'Expunge Deleted Documents','Permanently expunge deleted documents.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php', null);
+$oAdminRegistry->registerLocation("checkout",'KTCheckoutAdminDispatcher','storage', _('Checked Out Document Control'), _('Override the checked-out status of documents if a user has failed to do so.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php', null);
+$oAdminRegistry->registerLocation("archived",'ArchivedDocumentsDispatcher','storage', _('Archived Document Restoration'), _("Restore old (archived) documents, usually at a user's request."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocuments.php', null);
+$oAdminRegistry->registerLocation("expunge",'DeletedDocumentsDispatcher','storage', _('Expunge Deleted Documents'), _('Permanently expunge deleted documents.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php', null);
// misc
-$oAdminRegistry->registerLocation("helpmanagement",'ManageHelpDispatcher','misc', 'Edit Help files','Change the help files that are displayed to users.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/help/manageHelp.php', null);
+$oAdminRegistry->registerLocation("helpmanagement",'ManageHelpDispatcher','misc', _('Edit Help files'), _('Change the help files that are displayed to users.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/help/manageHelp.php', null);
diff --git a/plugins/ktcore/KTDocumentActions.php b/plugins/ktcore/KTDocumentActions.php
index 6694b13..cb3a21a 100644
--- a/plugins/ktcore/KTDocumentActions.php
+++ b/plugins/ktcore/KTDocumentActions.php
@@ -52,7 +52,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
return $res;
}
if ($this->oDocument->getIsCheckedOut()) {
- $_SESSION['KTErrorMessage'][] = "This document is already checked out";
+ $_SESSION['KTErrorMessage'][] = _("This document is already checked out");
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
exit(0);
}
@@ -63,7 +63,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
$this->oPage->setBreadcrumbDetails("checkout");
$oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout');
$checkout_fields = array();
- $checkout_fields[] = new KTStringWidget('Reason', 'The reason for the checkout of this document for historical purposes, and to inform those who wish to check out this document.', 'reason', "", $this->oPage, true);
+ $checkout_fields[] = new KTStringWidget(_('Reason'), _('The reason for the checkout of this document for historical purposes, and to inform those who wish to check out this document.'), 'reason', "", $this->oPage, true);
$oTemplate->setData(array(
'context' => &$this,
@@ -93,7 +93,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction {
$this->oDocument->setCheckedOutUserID($_SESSION["userID"]);
// update it
if (!$this->oDocument->update()) {
- $_SESSION['KTErrorMessage'][] = "There was a problem checking out the document.";
+ $_SESSION['KTErrorMessage'][] = _("There was a problem checking out the document.");
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
}
@@ -149,12 +149,12 @@ class KTDocumentCheckInAction extends KTDocumentAction {
return $res;
}
if (!$this->oDocument->getIsCheckedOut()) {
- $_SESSION['KTErrorMessage'][] = "This document is not checked out";
+ $_SESSION['KTErrorMessage'][] = _("This document is not checked out");
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
exit(0);
}
if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) {
- $_SESSION['KTErrorMessage'][] = "This document is checked out, but not by you";
+ $_SESSION['KTErrorMessage'][] = _("This document is checked out, but not by you");
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
exit(0);
}
@@ -167,8 +167,8 @@ class KTDocumentCheckInAction extends KTDocumentAction {
$sReason = KTUtil::arrayGet($_REQUEST, 'reason', "");
$checkin_fields = array();
- $checkin_fields[] = new KTFileUploadWidget('File', 'The updated document.', 'file', "", $this->oPage, true);
- $checkin_fields[] = new KTStringWidget('Description', 'Describe the changes made to the document.', 'reason', $sReason, $this->oPage, true);
+ $checkin_fields[] = new KTFileUploadWidget(_('File'), _('The updated document.'), 'file', "", $this->oPage, true);
+ $checkin_fields[] = new KTStringWidget(_('Description'), _('Describe the changes made to the document.'), 'reason', $sReason, $this->oPage, true);
$oTemplate->setData(array(
'context' => &$this,
@@ -183,19 +183,19 @@ class KTDocumentCheckInAction extends KTDocumentAction {
// make sure the user actually selected a file first
if (strlen($_FILES['file']['name']) == 0) {
- $this->errorRedirectToMain("No file was uploaded", 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
+ $this->errorRedirectToMain(_("No file was uploaded"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
}
// and that the filename matches
global $default;
$default->log->info("checkInDocumentBL.php uploaded filename=" . $_FILES['file']['name'] . "; current filename=" . $this->oDocument->getFileName());
if ($this->oDocument->getFileName() != $_FILES['file']['name']) {
- $this->errorRedirectToMain("The file name of the uploaded file does not match the file name of the document in the system", 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
+ $this->errorRedirectToMain(_("The file name of the uploaded file does not match the file name of the document in the system"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
}
$res = KTDocumentUtil::checkin($this->oDocument, $_FILES['file']['tmp_name'], $sReason, $this->oUser);
if (PEAR::isError($res)) {
- $this->errorRedirectToMain("An error occurred while trying to check in the document", 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
+ $this->errorRedirectToMain(_("An error occurred while trying to check in the document"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason);
}
redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID());
}
@@ -247,7 +247,7 @@ class KTDocumentDeleteAction extends KTDocumentAction {
$this->oPage->setBreadcrumbDetails("delete");
$oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete');
$delete_fields = array();
- $delete_fields[] = new KTStringWidget('Reason', 'The reason for this document to be removed.', 'reason', "", $this->oPage, true);
+ $delete_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be removed.'), 'reason', "", $this->oPage, true);
$oTemplate->setData(array(
'context' => &$this,
@@ -364,13 +364,13 @@ class KTDocumentMoveAction extends KTDocumentAction {
}
function do_main() {
- $this->oPage->setBreadcrumbDetails("move");
+ $this->oPage->setBreadcrumbDetails(_("move"));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move');
$move_fields = array();
$aNames = $this->oDocumentFolder->getPathArray();
$aNames[] = $this->oDocument->getName();
$sDocumentName = join(" » ", $aNames);
- $move_fields[] = new KTStaticTextWidget('Document to move', '', 'fDocumentId', $sDocumentName, $this->oPage, false);
+ $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
$collection = new DocumentCollection();
$collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument));
@@ -416,16 +416,16 @@ class KTDocumentMoveAction extends KTDocumentAction {
}
function do_move() {
- $this->oPage->setBreadcrumbDetails("move");
+ $this->oPage->setBreadcrumbDetails(_("move"));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move_final');
$sFolderPath = join(" » ", $this->oFolder->getPathArray());
$aNames = $this->oDocumentFolder->getPathArray();
$aNames[] = $this->oDocument->getName();
$sDocumentName = join(" » ", $aNames);
$move_fields = array();
- $move_fields[] = new KTStaticTextWidget('Document to move', '', 'fDocumentId', $sDocumentName, $this->oPage, false);
- $move_fields[] = new KTStaticTextWidget('Target folder', '', 'fFolderId', $sFolderPath, $this->oPage, false);
- $move_fields[] = new KTStringWidget('Reason', 'The reason for this document to be moved.', 'reason', "", $this->oPage, true);
+ $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false);
+ $move_fields[] = new KTStaticTextWidget(_('Target folder'), '', 'fFolderId', $sFolderPath, $this->oPage, false);
+ $move_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be moved.'), 'reason', "", $this->oPage, true);
$oTemplate->setData(array(
'context' => &$this,
@@ -437,13 +437,13 @@ class KTDocumentMoveAction extends KTDocumentAction {
function do_move_final() {
$sReason = KTUtil::arrayGet($_REQUEST, 'reason');
$aOptions = array(
- 'message' => "No reason given",
+ 'message' => _("No reason given"),
'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())),
);
$this->oValidator->notEmpty($sReason, $aOptions);
if (!Permission::userHasFolderWritePermission($this->oFolder)) {
- $this->errorRedirectTo("main", "You do not have permission to move a document to this location", sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
+ $this->errorRedirectTo("main", _("You do not have permission to move a document to this location"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
exit(0);
}
@@ -452,7 +452,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
//put the document in the new folder
$this->oDocument->setFolderID($this->oFolder->getId());
if (!$this->oDocument->update(true)) {
- $this->errorRedirectTo("main", "There was a problem updating the document's location in the database", sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
+ $this->errorRedirectTo("main", _("There was a problem updating the document's location in the database"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
}
//move the document on the file system
@@ -460,7 +460,7 @@ class KTDocumentMoveAction extends KTDocumentAction {
if (!$oStorage->moveDocument($this->oDocument, $this->oDocumentFolder, $this->oFolder)) {
$this->oDocument->setFolderID($this->oDocumentFolder->getId());
$this->oDocument->update(true);
- errorRedirectTo("move", "There was a problem updating the document's location in the repository storage", sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
+ errorRedirectTo("move", _("There was a problem updating the document's location in the repository storage"), sprintf("fDocumentId=%d&fFolderId=%d", $this->oDocument->getId(), $this->oFolder->getId()));
}
$this->oDocument->update();
@@ -540,10 +540,10 @@ class KTDocumentArchiveAction extends KTDocumentAction {
}
function do_main() {
- $this->oPage->setBreadcrumbDetails("archiving");
+ $this->oPage->setBreadcrumbDetails(_("archiving"));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive');
$fields = array();
- $fields[] = new KTStringWidget('Reason', 'The reason for the archiving of this document. This will be displayed when the archived document is to be displayed.', 'reason', "", $this->oPage, true);
+ $fields[] = new KTStringWidget(_('Reason'), _('The reason for the archiving of this document. This will be displayed when the archived document is to be displayed.'), 'reason', "", $this->oPage, true);
$oTemplate->setData(array(
'context' => &$this,
@@ -556,7 +556,7 @@ class KTDocumentArchiveAction extends KTDocumentAction {
$this->startTransaction();
$this->oDocument->setStatusID(ARCHIVED);
if (!$this->oDocument->update()) {
- $_SESSION['KTErrorMessage'][] = "There was a database error while trying to archive this file";
+ $_SESSION['KTErrorMessage'][] = _("There was a database error while trying to archive this file");
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
exit(0);
}
@@ -593,7 +593,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
var $_sShowPermission = "ktcore.permissions.write";
function do_main() {
- $this->oPage->setBreadcrumbDetails("workflow");
+ $this->oPage->setBreadcrumbDetails(_("workflow"));
$oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow");
$oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']);
@@ -613,8 +613,8 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
$aVocab[$oTransition->getId()] = $oTransition->showDescription();
}
$fieldOptions = array("vocab" => $aVocab);
- $transition_fields[] = new KTLookupWidget('Transition to perform', 'FIXME', 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
- $transition_fields[] = new KTStringWidget('Reason for transition', 'Describe the changes made to the document.', 'fComments', "", $this->oPage, true);
+ $transition_fields[] = new KTLookupWidget(_('Transition to perform'), 'FIXME', 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
+ $transition_fields[] = new KTStringWidget(_('Reason for transition'), _('Describe the changes made to the document.'), 'fComments', "", $this->oPage, true);
}
$aTemplateData = array(
'oDocument' => $oDocument,
@@ -631,7 +631,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
$oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']);
$oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
$res = KTWorkflowUtil::startWorkflowOnDocument($oWorkflow, $oDocument);
- $this->successRedirectToMain('Workflow started',
+ $this->successRedirectToMain(_('Workflow started'),
array('fDocumentId' => $oDocument->getId()));
exit(0);
}
@@ -642,7 +642,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
$sComments =& $this->oValidator->notEmpty($_REQUEST['fComments']);
$oUser =& User::get($_SESSION['userID']);
$res = KTWorkflowUtil::performTransitionOnDocument($oTransition, $oDocument, $oUser, $sComments);
- $this->successRedirectToMain('Transition performed',
+ $this->successRedirectToMain(_('Transition performed'),
array('fDocumentId' => $oDocument->getId()));
}
}
diff --git a/plugins/ktcore/KTFolderActions.php b/plugins/ktcore/KTFolderActions.php
index 72b6cd2..7570215 100644
--- a/plugins/ktcore/KTFolderActions.php
+++ b/plugins/ktcore/KTFolderActions.php
@@ -20,12 +20,12 @@ class KTFolderAddDocumentAction extends KTFolderAction {
var $_sShowPermission = "ktcore.permissions.write";
function do_main() {
- $this->oPage->setBreadcrumbDetails("add document");
- $this->oPage->setTitle('Add a document');
+ $this->oPage->setBreadcrumbDetails(_("add document"));
+ $this->oPage->setTitle(_('Add a document'));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add');
$add_fields = array();
- $add_fields[] = new KTFileUploadWidget('File', 'The contents of the document to be added to the document management system.', 'file', "", $this->oPage, true);
- $add_fields[] = new KTStringWidget('Title', 'Describe the changes made to the document.', 'title', "", $this->oPage, true);
+ $add_fields[] = new KTFileUploadWidget(_('File'), _('The contents of the document to be added to the document management system.'), 'file', "", $this->oPage, true);
+ $add_fields[] = new KTStringWidget(_('Title'), _('Describe the changes made to the document.'), 'title', "", $this->oPage, true);
@@ -34,7 +34,7 @@ class KTFolderAddDocumentAction extends KTFolderAction {
$aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
}
$fieldOptions = array("vocab" => $aVocab);
- $add_fields[] = new KTLookupWidget('Document Type', 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
+ $add_fields[] = new KTLookupWidget(_('Document Type'), 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
$fieldsets = array();
$fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
@@ -122,10 +122,10 @@ class KTFolderAddFolderAction extends KTFolderAction {
var $_sShowPermission = "ktcore.permissions.write";
function do_main() {
- $this->oPage->setBreadcrumbDetails("add folder");
+ $this->oPage->setBreadcrumbDetails(_("add folder"));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/action/addFolder');
$fields = array();
- $fields[] = new KTStringWidget('Folder name', '', 'name', "", $this->oPage, true);
+ $fields[] = new KTStringWidget(_('Folder name'), _('The name for the new folder.'), 'name', "", $this->oPage, true);
$oTemplate->setData(array(
'context' => &$this,
@@ -139,13 +139,13 @@ class KTFolderAddFolderAction extends KTFolderAction {
'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
);
$sFolderName = KTUtil::arrayGet($_REQUEST, 'name');
- $aErrorOptions['defaultmessage'] = "No name given";
+ $aErrorOptions['defaultmessage'] = _("No name given");
$sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions);
$this->startTransaction();
$res = KTFolderUtil::add($this->oFolder, $sFolderName, $this->oUser);
- $aErrorOptions['defaultmessage'] = "Could not create folder in the document management system";
+ $aErrorOptions['defaultmessage'] = _("Could not create folder in the document management system");
$this->oValidator->notError($res, $aErrorOptions);
$this->commitTransaction();
@@ -163,7 +163,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
var $bAutomaticTransaction = true;
function do_main() {
- $this->oPage->setBreadcrumbDetails("viewing permissions");
+ $this->oPage->setBreadcrumbDetails(_("viewing permissions"));
$oTemplating = new KTTemplating;
$oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions");
$oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
@@ -230,19 +230,19 @@ class KTFolderPermissionsAction extends KTFolderAction {
KTPermissionUtil::setPermissionForId($oPermission, $oPO, $aAllowed);
}
KTPermissionUtil::updatePermissionLookupForPO($oPO);
- return $this->successRedirectToMain('Permissions updated',
+ return $this->successRedirectToMain(_('Permissions updated'),
array('fFolderId' => $this->oFolder->getId()));
}
function do_copyPermissions() {
KTPermissionUtil::copyPermissionObject($this->oFolder);
- return $this->successRedirectToMain('Permissions updated',
+ return $this->successRedirectToMain(_('Permissions updated'),
array('fFolderId' => $this->oFolder->getId()));
}
function do_inheritPermissions() {
KTPermissionUtil::inheritPermissionObject($this->oFolder);
- return $this->successRedirectToMain('Permissions updated',
+ return $this->successRedirectToMain(_('Permissions updated'),
array('fFolderId' => $this->oFolder->getId()));
}
@@ -263,7 +263,7 @@ class KTFolderPermissionsAction extends KTFolderAction {
$this->oValidator->notError($oDynamicCondition, $aOptions);
$res = $oDynamicCondition->saveAssignment($aPermissionIds);
$this->oValidator->notError($res, $aOptions);
- $this->successRedirectToMain("Dynamic permission added", "fFolderId=" . $this->oFolder->getId());
+ $this->successRedirectToMain(_("Dynamic permission added"), "fFolderId=" . $this->oFolder->getId());
}
}
$oKTActionRegistry->registerAction('folderaction', 'KTFolderPermissionsAction', 'ktcore.actions.folder.permissions');
diff --git a/plugins/ktcore/KTPortlets.php b/plugins/ktcore/KTPortlets.php
index 72d2b7a..fe930ab 100644
--- a/plugins/ktcore/KTPortlets.php
+++ b/plugins/ktcore/KTPortlets.php
@@ -8,7 +8,7 @@ $oPRegistry =& KTPortletRegistry::getSingleton();
class KTSearchPortlet extends KTPortlet {
function KTSearchPortlet() {
- parent::KTPortlet("Search");
+ parent::KTPortlet(_("Search"));
}
function render() {
$oTemplating = new KTTemplating;
diff --git a/plugins/ktcore/authentication/authenticationadminpage.inc.php b/plugins/ktcore/authentication/authenticationadminpage.inc.php
index 764ca33..92ca6d7 100644
--- a/plugins/ktcore/authentication/authenticationadminpage.inc.php
+++ b/plugins/ktcore/authentication/authenticationadminpage.inc.php
@@ -5,16 +5,12 @@ require_once(KT_LIB_DIR . '/authentication/authenticationproviderregistry.inc.ph
require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php');
class KTAuthenticationAdminPage extends KTAdminDispatcher {
- var $aBreadcrumbs = array(
- array('action' => 'administration', 'name' => 'Administration'),
- );
-
function do_main() {
- $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']);
+ $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']);
$oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage');
$fields = array();
- $fields[] = new KTStringWidget('Name', 'FIXME', 'name', "", $this->oPage, true);
+ $fields[] = new KTStringWidget(_('Name'), 'FIXME', 'name', "", $this->oPage, true);
$aVocab = array();
$oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
@@ -23,7 +19,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
$aVocab[$aProvider[2]] = $aProvider[0];
}
$fieldOptions = array("vocab" => $aVocab);
- $fields[] = new KTLookupWidget('Authentication provider', 'FIXME', 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
+ $fields[] = new KTLookupWidget(_('Authentication provider'), 'FIXME', 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions);
$aSources = KTAuthenticationSource::getList();
@@ -37,7 +33,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
}
function do_viewsource() {
- $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']);
+ $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']);
$oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/viewsource');
$oSource =& KTAuthenticationSource::get($_REQUEST['source_id']);
$this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId());
@@ -58,11 +54,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
$aErrorOptions = array(
'redirect_to' => array('main'),
);
- $aErrorOptions['message'] = "No name provided";
+ $aErrorOptions['message'] = _("No name provided");
$sName = KTUtil::arrayGet($_REQUEST, 'name');
$sName = $this->oValidator->validateString($sName, $aErrorOptions);
- $aErrorOptions['message'] = "No authentication provider chosen";
+ $aErrorOptions['message'] = _("No authentication provider chosen");
$sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider');
$sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions);
@@ -70,7 +66,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
$oProvider =& $oRegistry->getAuthenticationProvider($sProvider);
if (method_exists($oProvider, 'do_newsource')) {
- $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']);
+ $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']);
$oProvider->aBreadcrumbs = $this->aBreadcrumbs;
return $oProvider->dispatch();
@@ -83,11 +79,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
$aErrorOptions = array(
'redirect_to' => array('main'),
);
- $aErrorOptions['message'] = "No name provided";
+ $aErrorOptions['message'] = _("No name provided");
$sName = KTUtil::arrayGet($_REQUEST, 'name');
$sName = $this->oValidator->validateString($sName, $aErrorOptions);
- $aErrorOptions['message'] = "No authentication provider chosen";
+ $aErrorOptions['message'] = _("No authentication provider chosen");
$sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider');
$sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions);
@@ -100,7 +96,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
'authenticationprovider' => $sProvider,
));
$this->oValidator->notError($oSource);
- $this->successRedirectToMain("Source created");
+ $this->successRedirectToMain(_("Source created"));
exit(0);
}
@@ -110,7 +106,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
$oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
$oProvider =& $oRegistry->getAuthenticationProvider($sProvider);
- $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']);
+ $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']);
$this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId());
$oProvider->aBreadcrumbs = $this->aBreadcrumbs;
@@ -124,7 +120,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher {
$oRegistry =& KTAuthenticationProviderRegistry::getSingleton();
$oProvider =& $oRegistry->getAuthenticationProvider($sProvider);
- $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']);
+ $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']);
$this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId());
$oProvider->aBreadcrumbs = $this->aBreadcrumbs;
diff --git a/plugins/ktcore/folder/BulkImport.php b/plugins/ktcore/folder/BulkImport.php
index 600a39f..9317ae7 100644
--- a/plugins/ktcore/folder/BulkImport.php
+++ b/plugins/ktcore/folder/BulkImport.php
@@ -14,17 +14,17 @@ class KTBulkImportFolderAction extends KTFolderAction {
var $bAutomaticTransaction = true;
function do_main() {
- $this->oPage->setBreadcrumbDetails("bulk import");
+ $this->oPage->setBreadcrumbDetails(_("bulk import"));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkImport');
$add_fields = array();
- $add_fields[] = new KTStringWidget('Path', 'The path containing the documents to be added to the document management system.', 'path', "", $this->oPage, true);
+ $add_fields[] = new KTStringWidget(_('Path'), _('The path containing the documents to be added to the document management system.'), 'path', "", $this->oPage, true);
$aVocab = array();
foreach (DocumentType::getList() as $oDocumentType) {
$aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
}
$fieldOptions = array("vocab" => $aVocab);
- $add_fields[] = new KTLookupWidget('Document Type', 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
+ $add_fields[] = new KTLookupWidget(_('Document Type'), 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
$fieldsets = array();
$fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
@@ -47,10 +47,10 @@ class KTBulkImportFolderAction extends KTFolderAction {
'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
);
- $aErrorOptions['message'] = 'Invalid document type provided';
+ $aErrorOptions['message'] = _('Invalid document type provided');
$oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
- $aErrorOptions['message'] = 'Invalid path provided';
+ $aErrorOptions['message'] = _('Invalid path provided');
$sPath = $this->oValidator->validateString($_REQUEST['path'], $aErrorOptions);
$matches = array();
diff --git a/plugins/ktcore/folder/BulkUpload.php b/plugins/ktcore/folder/BulkUpload.php
index 51f3de9..aa270d2 100644
--- a/plugins/ktcore/folder/BulkUpload.php
+++ b/plugins/ktcore/folder/BulkUpload.php
@@ -14,17 +14,17 @@ class KTBulkUploadFolderAction extends KTFolderAction {
var $bAutomaticTransaction = true;
function do_main() {
- $this->oPage->setBreadcrumbDetails("bulk upload");
+ $this->oPage->setBreadcrumbDetails(_("bulk upload"));
$oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkUpload');
$add_fields = array();
- $add_fields[] = new KTFileUploadWidget('Archive file', 'The archive file containing the documents you wish to add to the document management system.', 'file', "", $this->oPage, true);
+ $add_fields[] = new KTFileUploadWidget(_('Archive file'), _('The archive file containing the documents you wish to add to the document management system.'), 'file', "", $this->oPage, true);
$aVocab = array();
foreach (DocumentType::getList() as $oDocumentType) {
$aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
}
$fieldOptions = array("vocab" => $aVocab);
- $add_fields[] = new KTLookupWidget('Document Type', 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
+ $add_fields[] = new KTLookupWidget(_('Document Type'), 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions);
$fieldsets = array();
$fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton();
@@ -47,7 +47,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())),
);
- $aErrorOptions['message'] = 'Invalid document type provided';
+ $aErrorOptions['message'] = _('Invalid document type provided');
$oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions);
unset($aErrorOptions['message']);
@@ -70,7 +70,7 @@ class KTBulkUploadFolderAction extends KTFolderAction {
$bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions);
$this->startTransaction();
$res = $bm->import();
- $aErrorOptions['message'] = "Bulk import failed";
+ $aErrorOptions['message'] = _("Bulk import failed");
$this->oValidator->notError($res, $aErrorOptions);
$this->commitTransaction();
diff --git a/plugins/ktstandard/KTDiscussion.php b/plugins/ktstandard/KTDiscussion.php
index cd3e82b..7a3ce17 100644
--- a/plugins/ktstandard/KTDiscussion.php
+++ b/plugins/ktstandard/KTDiscussion.php
@@ -50,13 +50,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
var $sName = 'ktcore.actions.document.discussion';
function do_main() {
- $this->oPage->setBreadcrumbDetails("discussion");
+ $this->oPage->setBreadcrumbDetails(_("discussion"));
$oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion');
// Fields for new thread creation
$fields = array();
- $fields[] = new KTStringWidget("Subject", "The topic of discussion in this thread", "subject", "", $this->oPage, true);
- $fields[] = new KTTextWidget("Body", "Your contribution to the discussion in this thread", "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10));
+ $fields[] = new KTStringWidget(_("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true);
+ $fields[] = new KTTextWidget(_("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10));
$threads = DiscussionThread::getList();
@@ -74,11 +74,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
'redirect_to' => array('main', sprintf('fDocumentId=%d', $this->oDocument->getId())),
);
- $aErrorOptions['message'] = "No subject provided";
+ $aErrorOptions['message'] = _("No subject provided");
$sSubject = KTUtil::arrayGet($_REQUEST, 'subject');
$sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions);
- $aErrorOptions['message'] = "No body provided";
+ $aErrorOptions['message'] = _("No body provided");
$sBody = KTUtil::arrayGet($_REQUEST, 'body');
$sBody = $this->oValidator->validateString($sBody, $aErrorOptions);
@@ -89,8 +89,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
'documentid' => $this->oDocument->getId(),
'creatorid' => $this->oUser->getId(),
));
- $aErrorOptions['message'] = "There was an error creating a new thread";
- $this->oValidator->notError($oThread);
+ $aErrorOptions['message'] = _("There was an error creating a new thread");
+ $this->oValidator->notError($oThread, $aErrorOptions);
$oComment = DiscussionComment::createFromArray(array(
'threadid' => $oThread->getId(),
@@ -98,19 +98,19 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
'subject' => $sSubject,
'body' => $sBody,
));
- $aErrorOptions['message'] = "There was an error adding the comment to the thread";
- $this->oValidator->notError($oComment);
+ $aErrorOptions['message'] = _("There was an error adding the comment to the thread");
+ $this->oValidator->notError($oComment, $aErrorOptions);
$oThread->setFirstCommentId($oComment->getId());
$oThread->setLastCommentId($oComment->getId());
$res = $oThread->update();
- $aErrorOptions['message'] = "There was an error updating the thread with the new comment";
- $this->oValidator->notError($res);
+ $aErrorOptions['message'] = _("There was an error updating the thread with the new comment");
+ $this->oValidator->notError($res, $aErrorOptions);
// Thread and comment created correctly, commit to database
$this->commitTransaction();
- $this->successRedirectToMain("New thread created", sprintf('fDocumentId=%d', $this->oDocument->getId()));
+ $this->successRedirectToMain(_("New thread created"), sprintf('fDocumentId=%d', $this->oDocument->getId()));
exit(0);
}
@@ -122,18 +122,18 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
$oComment = DiscussionComment::get($iCommentId);
$this->aBreadcrumbs[] = array(
- 'name' => 'discussion',
+ 'name' => _('discussion'),
'url' => $_SERVER['PHP_SELF'] . sprintf('?fDocumentId=%d', $this->oDocument->getId()),
);
$this->aBreadcrumbs[] = array(
'name' => $oComment->getSubject(),
);
- $this->oPage->setBreadcrumbDetails("viewing comments");
+ $this->oPage->setBreadcrumbDetails(_("viewing comments"));
$oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion_thread');
// Fields for new thread creation
$fields = array();
- $fields[] = new KTStringWidget("Subject", "The topic of discussion in this thread", "subject", "", $this->oPage, true);
- $fields[] = new KTTextWidget("Body", "Your contribution to the discussion in this thread", "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10));
+ $fields[] = new KTStringWidget(_("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true);
+ $fields[] = new KTTextWidget(_("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10));
$aTemplateData = array(
'context' => &$this,
@@ -158,11 +158,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
);
- $aErrorOptions['message'] = "No subject provided";
+ $aErrorOptions['message'] = _("No subject provided");
$sSubject = KTUtil::arrayGet($_REQUEST, 'subject');
$sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions);
- $aErrorOptions['message'] = "No body provided";
+ $aErrorOptions['message'] = _("No body provided");
$sBody = KTUtil::arrayGet($_REQUEST, 'body');
$sBody = $this->oValidator->validateString($sBody, $aErrorOptions);
@@ -175,18 +175,18 @@ class KTDocumentDiscussionAction extends KTDocumentAction {
'subject' => $sSubject,
'body' => $sBody,
));
- $aErrorOptions['message'] = "There was an error adding the comment to the thread";
+ $aErrorOptions['message'] = _("There was an error adding the comment to the thread");
$this->oValidator->notError($oComment, $aErrorOptions);
$oThread->setLastCommentId($oComment->getId());
$res = $oThread->update();
- $aErrorOptions['message'] = "There was an error updating the thread with the new comment";
+ $aErrorOptions['message'] = _("There was an error updating the thread with the new comment");
$this->oValidator->notError($res, $aErrorOptions);
// Thread and comment created correctly, commit to database
$this->commitTransaction();
- $this->successRedirectTo('viewThread', "Reply posted", sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId()));
+ $this->successRedirectTo('viewThread', _("Reply posted"), sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId()));
exit(0);
}
}
diff --git a/plugins/ktstandard/KTEmail.php b/plugins/ktstandard/KTEmail.php
index e0fa4ec..628d7c2 100644
--- a/plugins/ktstandard/KTEmail.php
+++ b/plugins/ktstandard/KTEmail.php
@@ -197,9 +197,9 @@ class KTDocumentEmailAction extends KTDocumentAction {
function do_main() {
$oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/email');
$fields = array();
- $fields[] = new KTCheckboxWidget("Attach document", "By default, documents are sent as links into the document management system. Select this option if you want the document contents to be sent as an attachment in the email.", 'fAttachDocument', null, $this->oPage);
- $fields[] = new KTTextWidget("Email addresses", "FIXME: Add extra email addresses here", 'fEmailAddresses', "", $this->oPage);
- $fields[] = new KTTextWidget("Comment", "FIXME", 'fComment', "", $this->oPage, true);
+ $fields[] = new KTCheckboxWidget(_("Attach document"), _("By default, documents are sent as links into the document management system. Select this option if you want the document contents to be sent as an attachment in the email."), 'fAttachDocument', null, $this->oPage);
+ $fields[] = new KTTextWidget(_("Email addresses"), _("Add extra email addresses here"), 'fEmailAddresses', "", $this->oPage);
+ $fields[] = new KTTextWidget(_("Comment"), _("A message for those who receive the document"), 'fComment', "", $this->oPage, true);
$aTemplateData = array(
'context' => &$this,
'fields' => $fields,
@@ -230,7 +230,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
//if we're going to send a mail, first make there is someone to send it to
if ((count($aGroupIDs) == 0) && (count($aUserIDs) == 0) && (count($aEmailAddresses) == 0)) {
- $this->errorRedirectToMain('No recipients set', sprintf('fDocumentId=%d', $this->oDocument->getId()));
+ $this->errorRedirectToMain(_('No recipients set'), sprintf('fDocumentId=%d', $this->oDocument->getId()));
exit(0);
}
@@ -247,7 +247,7 @@ class KTDocumentEmailAction extends KTDocumentAction {
$_SESSION['KTErrorMessage'][] = join("
\n", $aEmailErrors);
}
- $_SESSION['KTInfoMessage'][] = "Email sent";
+ $_SESSION['KTInfoMessage'][] = _("Email sent");
//go back to the document view page
controllerRedirect("viewDocument", sprintf("fDocumentId=%d", $this->oDocument->getId()));
}
diff --git a/plugins/ktstandard/KTSubscriptions.php b/plugins/ktstandard/KTSubscriptions.php
index ae118d4..17e192a 100644
--- a/plugins/ktstandard/KTSubscriptions.php
+++ b/plugins/ktstandard/KTSubscriptions.php
@@ -23,7 +23,7 @@ $oPlugin =& $oPluginRegistry->getPlugin('ktstandard.subscriptions.plugin');
// {{{ KTSubscriptionPortlet
class KTSubscriptionPortlet extends KTPortlet {
function KTSubscriptionPortlet() {
- parent::KTPortlet("Subscriptions");
+ parent::KTPortlet(_("Subscriptions"));
}
function render() {
@@ -58,7 +58,7 @@ class KTSubscriptionPortlet extends KTPortlet {
}
}
- $this->actions[] = array("name" => "Manage subscriptions", "url" => $this->oPlugin->getPagePath('manage'));
+ $this->actions[] = array("name" => _("Manage subscriptions"), "url" => $this->oPlugin->getPagePath('manage'));
$oTemplating = new KTTemplating;
$oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet");
@@ -85,14 +85,14 @@ class KTDocumentSubscriptionAction extends KTDocumentAction {
function do_main() {
$iSubscriptionType = SubscriptionConstants::subscriptionType("DocumentSubscription");
if (Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) {
- $_SESSION['KTErrorMessage'][] = "You are already subscribed to that document";
+ $_SESSION['KTErrorMessage'][] = _("You are already subscribed to that document");
} else {
$oSubscription = new Subscription($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType);
$res = $oSubscription->create();
if ($res) {
- $_SESSION['KTInfoMessage'][] = "You have been subscribed to this document";
+ $_SESSION['KTInfoMessage'][] = _("You have been subscribed to this document");
} else {
- $_SESSION['KTErrorMessage'][] = "There was a problem subscribing you to this document";
+ $_SESSION['KTErrorMessage'][] = _("There was a problem subscribing you to this document");
}
}
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
@@ -116,14 +116,14 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction {
function do_main() {
$iSubscriptionType = SubscriptionConstants::subscriptionType("DocumentSubscription");
if (!Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) {
- $_SESSION['KTErrorMessage'][] = "You were not subscribed to that document";
+ $_SESSION['KTErrorMessage'][] = _("You were not subscribed to that document");
} else {
$oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType);
$res = $oSubscription->delete();
if ($res) {
- $_SESSION['KTInfoMessage'][] = "You have been unsubscribed from this document";
+ $_SESSION['KTInfoMessage'][] = _("You have been unsubscribed from this document");
} else {
- $_SESSION['KTErrorMessage'][] = "There was a problem unsubscribing you from this document";
+ $_SESSION['KTErrorMessage'][] = _("There was a problem unsubscribing you from this document");
}
}
controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId());
@@ -267,14 +267,14 @@ class KTFolderSubscriptionAction extends KTFolderAction {
function do_main() {
$iSubscriptionType = SubscriptionConstants::subscriptionType("FolderSubscription");
if (Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) {
- $_SESSION['KTErrorMessage'][] = "You are already subscribed to that document";
+ $_SESSION['KTErrorMessage'][] = _("You are already subscribed to that document");
} else {
$oSubscription = new Subscription($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType);
$res = $oSubscription->create();
if ($res) {
- $_SESSION['KTInfoMessage'][] = "You have been subscribed to this document";
+ $_SESSION['KTInfoMessage'][] = _("You have been subscribed to this document");
} else {
- $_SESSION['KTErrorMessage'][] = "There was a problem subscribing you to this document";
+ $_SESSION['KTErrorMessage'][] = _("There was a problem subscribing you to this document");
}
}
controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId());
@@ -299,14 +299,14 @@ class KTFolderUnsubscriptionAction extends KTFolderAction {
function do_main() {
$iSubscriptionType = SubscriptionConstants::subscriptionType("FolderSubscription");
if (!Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) {
- $_SESSION['KTErrorMessage'][] = "You were not subscribed to that folder";
+ $_SESSION['KTErrorMessage'][] = _("You were not subscribed to that folder");
} else {
$oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType);
$res = $oSubscription->delete();
if ($res) {
- $_SESSION['KTInfoMessage'][] = "You have been unsubscribed from this folder";
+ $_SESSION['KTInfoMessage'][] = _("You have been unsubscribed from this folder");
} else {
- $_SESSION['KTErrorMessage'][] = "There was a problem unsubscribing you from this folder";
+ $_SESSION['KTErrorMessage'][] = _("There was a problem unsubscribing you from this folder");
}
}
controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId());
@@ -319,7 +319,7 @@ $oPlugin->registerAction('foldersubscriptionaction', 'KTFolderUnsubscriptionActi
// {{{ KTSubscriptionManagePage
class KTSubscriptionManagePage extends KTStandardDispatcher {
function do_main() {
- $this->aBreadcrumbs[] = array("name" => "Subscription Management");
+ $this->aBreadcrumbs[] = array("name" => _("Subscription Management"));
$aFolderSubscriptions = SubscriptionManager::retrieveUserSubscriptions(
$this->oUser->getId(), SubscriptionConstants::subscriptionType("FolderSubscription"));
$aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions(
@@ -340,7 +340,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher {
$foldersubscriptions = KTUtil::arrayGet($_REQUEST, 'foldersubscriptions');
$documentsubscriptions = KTUtil::arrayGet($_REQUEST, 'documentsubscriptions');
if (empty($foldersubscriptions) && empty($documentsubscriptions)) {
- $this->errorRedirectToMain('No subscriptions were chosen');
+ $this->errorRedirectToMain(_('No subscriptions were chosen'));
}
$iSuccesses = 0;
@@ -370,7 +370,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher {
}
}
- $sMessage = "Subscriptions removed: ";
+ $sMessage = _("Subscriptions removed") . ": ";
if ($iFailures) {
$sMessage .= sprintf(_('%d successful, %d failures'), $iSuccesses, $iFailures);
} else {
diff --git a/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php b/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
index fa80b44..9d54a33 100644
--- a/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
+++ b/plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
@@ -8,14 +8,17 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider {
var $sName = "LDAP authentication provider";
var $sNamespace = "ktstandard.authentication.ldapprovider";
- var $aConfigMap = array(
- 'servername' => 'LDAP Server',
- 'basedn' => 'Base DN',
- 'servertype' => 'LDAP Server Type',
- 'domain' => 'LDAP Server Domain',
- 'searchuser' => 'LDAP Search User',
- 'searchpassword' => 'LDAP Search Password',
- );
+ function KTLDAPAuthenticationProvider() {
+ $this->aConfigMap = array(
+ 'servername' => _('LDAP Server'),
+ 'basedn' => _('Base DN'),
+ 'servertype' => _('LDAP Server Type'),
+ 'domain' => _('LDAP Server Domain'),
+ 'searchuser' => _('LDAP Search User'),
+ 'searchpassword' => _('LDAP Search Password'),
+ );
+ return parent::KTAuthenticationProvider();
+ }
function saveConfig(&$oSource, $aRequest) {
return true;
@@ -33,7 +36,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider {
$sRet = "