Commit ce248037405ceac8be3ff63bb4784aba8d7c9221
1 parent
e53a9ae7
Add i18n functions around translatable text in plugins/
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4350 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
11 changed files
with
165 additions
and
166 deletions
plugins/ktcore/KTAdminPlugins.php
| @@ -5,12 +5,12 @@ require_once(KT_LIB_DIR . "/plugins/KTAdminNavigation.php"); | @@ -5,12 +5,12 @@ require_once(KT_LIB_DIR . "/plugins/KTAdminNavigation.php"); | ||
| 5 | $oAdminRegistry =& KTAdminNavigationRegistry::getSingleton(); | 5 | $oAdminRegistry =& KTAdminNavigationRegistry::getSingleton(); |
| 6 | 6 | ||
| 7 | // set up the categories. | 7 | // set up the categories. |
| 8 | -$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."); | ||
| 9 | -$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."); | ||
| 10 | -$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."); | ||
| 11 | -$oAdminRegistry->registerCategory("documents", "Document Type Configuration", "Configure the information that needs to be collected about different kinds of documents."); | ||
| 12 | -$oAdminRegistry->registerCategory("collections", "Collections", "Specify how groups of documents are displayed in browse and search mode."); | ||
| 13 | -$oAdminRegistry->registerCategory("misc", "Miscellaneous", "Various settings which do not fit into the other categories, including help, etc."); | 8 | +$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.")); |
| 9 | +$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.")); | ||
| 10 | +$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.")); | ||
| 11 | +$oAdminRegistry->registerCategory("documents", _("Document Type Configuration"), _("Configure the information that needs to be collected about different kinds of documents.")); | ||
| 12 | +$oAdminRegistry->registerCategory("collections", _("Collections"), _("Specify how groups of documents are displayed in browse and search mode.")); | ||
| 13 | +$oAdminRegistry->registerCategory("misc", _("Miscellaneous"), _("Various settings which do not fit into the other categories, including help, etc.")); | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -26,29 +26,29 @@ $oAdminRegistry->registerCategory("misc", "Miscellaneous", "Various settings whi | @@ -26,29 +26,29 @@ $oAdminRegistry->registerCategory("misc", "Miscellaneous", "Various settings whi | ||
| 26 | // FIXME url traversal DOESN'T WORK | 26 | // FIXME url traversal DOESN'T WORK |
| 27 | 27 | ||
| 28 | // users and groups | 28 | // users and groups |
| 29 | -$oAdminRegistry->registerLocation("users",'KTUserAdminDispatcher',"principals", "Manage Users","Add or remove users from the system.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php', null); | ||
| 30 | -$oAdminRegistry->registerLocation("groups",'KTGroupAdminDispatcher',"principals", "Manage Groups","Add or remove groups from the system.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/groupManagement.php', null); | ||
| 31 | -$oAdminRegistry->registerLocation("units",'KTUnitAdminDispatcher',"principals", "Control Units","Specify which organisation units are available.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/unitManagement.php', null); | 29 | +$oAdminRegistry->registerLocation("users",'KTUserAdminDispatcher',"principals", _("Manage Users"), _("Add or remove users from the system."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/usermanagement/userManagement.php', null); |
| 30 | +$oAdminRegistry->registerLocation("groups",'KTGroupAdminDispatcher',"principals", _("Manage Groups"), _("Add or remove groups from the system."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/groupmanagement/groupManagement.php', null); | ||
| 31 | +$oAdminRegistry->registerLocation("units",'KTUnitAdminDispatcher',"principals", _("Control Units"), _("Specify which organisation units are available."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/unitmanagement/unitManagement.php', null); | ||
| 32 | // disabled until it actually makes sense. | 32 | // disabled until it actually makes sense. |
| 33 | //$oAdminRegistry->registerLocation("orgs",'KTOrgAdminDispatcher',"principals", "Control Organisations","Specify which organisations are available.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/orgManagement.php', null); | 33 | //$oAdminRegistry->registerLocation("orgs",'KTOrgAdminDispatcher',"principals", "Control Organisations","Specify which organisations are available.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/orgmanagement/orgManagement.php', null); |
| 34 | 34 | ||
| 35 | // security | 35 | // security |
| 36 | -$oAdminRegistry->registerLocation("permissions",'ManagePermissionsDispatcher',"security", "Permissions","Create or Delete permissions.", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/permissions/managePermissions.php', null); | ||
| 37 | -$oAdminRegistry->registerLocation("roles",'RoleAdminDispatcher',"security", "Roles","Create or Delete roles (incomplete).", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/rolemanagement/roleManagement.php', null); | 36 | +$oAdminRegistry->registerLocation("permissions",'ManagePermissionsDispatcher',"security", _("Permissions"), _("Create or Delete permissions."), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/permissions/managePermissions.php', null); |
| 37 | +$oAdminRegistry->registerLocation("roles",'RoleAdminDispatcher',"security", _("Roles"), _("Create or Delete roles") . " (incomplete).", KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/rolemanagement/roleManagement.php', null); | ||
| 38 | 38 | ||
| 39 | // documents | 39 | // documents |
| 40 | -$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); | ||
| 41 | -$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); | ||
| 42 | -$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); | ||
| 43 | -$oAdminRegistry->registerLocation("workflows",'KTWorkflowDispatcher','documents', 'Workflows','Configure the process documents go through..', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php', null); | 40 | +$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); |
| 41 | +$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); | ||
| 42 | +$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); | ||
| 43 | +$oAdminRegistry->registerLocation("workflows",'KTWorkflowDispatcher','documents', _('Workflows'), _('Configure the process documents go through.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php', null); | ||
| 44 | 44 | ||
| 45 | // storage | 45 | // storage |
| 46 | -$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); | ||
| 47 | -$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); | ||
| 48 | -$oAdminRegistry->registerLocation("expunge",'DeletedDocumentsDispatcher','storage', 'Expunge Deleted Documents','Permanently expunge deleted documents.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php', null); | 46 | +$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); |
| 47 | +$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); | ||
| 48 | +$oAdminRegistry->registerLocation("expunge",'DeletedDocumentsDispatcher','storage', _('Expunge Deleted Documents'), _('Permanently expunge deleted documents.'), KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php', null); | ||
| 49 | 49 | ||
| 50 | // misc | 50 | // misc |
| 51 | -$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); | 51 | +$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); |
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | 54 |
plugins/ktcore/KTDocumentActions.php
| @@ -52,7 +52,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { | @@ -52,7 +52,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { | ||
| 52 | return $res; | 52 | return $res; |
| 53 | } | 53 | } |
| 54 | if ($this->oDocument->getIsCheckedOut()) { | 54 | if ($this->oDocument->getIsCheckedOut()) { |
| 55 | - $_SESSION['KTErrorMessage'][] = "This document is already checked out"; | 55 | + $_SESSION['KTErrorMessage'][] = _("This document is already checked out"); |
| 56 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 56 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 57 | exit(0); | 57 | exit(0); |
| 58 | } | 58 | } |
| @@ -63,7 +63,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { | @@ -63,7 +63,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { | ||
| 63 | $this->oPage->setBreadcrumbDetails("checkout"); | 63 | $this->oPage->setBreadcrumbDetails("checkout"); |
| 64 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout'); | 64 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/checkout'); |
| 65 | $checkout_fields = array(); | 65 | $checkout_fields = array(); |
| 66 | - $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); | 66 | + $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); |
| 67 | 67 | ||
| 68 | $oTemplate->setData(array( | 68 | $oTemplate->setData(array( |
| 69 | 'context' => &$this, | 69 | 'context' => &$this, |
| @@ -93,7 +93,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { | @@ -93,7 +93,7 @@ class KTDocumentCheckOutAction extends KTDocumentAction { | ||
| 93 | $this->oDocument->setCheckedOutUserID($_SESSION["userID"]); | 93 | $this->oDocument->setCheckedOutUserID($_SESSION["userID"]); |
| 94 | // update it | 94 | // update it |
| 95 | if (!$this->oDocument->update()) { | 95 | if (!$this->oDocument->update()) { |
| 96 | - $_SESSION['KTErrorMessage'][] = "There was a problem checking out the document."; | 96 | + $_SESSION['KTErrorMessage'][] = _("There was a problem checking out the document."); |
| 97 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 97 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| @@ -149,12 +149,12 @@ class KTDocumentCheckInAction extends KTDocumentAction { | @@ -149,12 +149,12 @@ class KTDocumentCheckInAction extends KTDocumentAction { | ||
| 149 | return $res; | 149 | return $res; |
| 150 | } | 150 | } |
| 151 | if (!$this->oDocument->getIsCheckedOut()) { | 151 | if (!$this->oDocument->getIsCheckedOut()) { |
| 152 | - $_SESSION['KTErrorMessage'][] = "This document is not checked out"; | 152 | + $_SESSION['KTErrorMessage'][] = _("This document is not checked out"); |
| 153 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 153 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 154 | exit(0); | 154 | exit(0); |
| 155 | } | 155 | } |
| 156 | if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) { | 156 | if ($this->oDocument->getCheckedOutUserID() != $this->oUser->getId()) { |
| 157 | - $_SESSION['KTErrorMessage'][] = "This document is checked out, but not by you"; | 157 | + $_SESSION['KTErrorMessage'][] = _("This document is checked out, but not by you"); |
| 158 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 158 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 159 | exit(0); | 159 | exit(0); |
| 160 | } | 160 | } |
| @@ -167,8 +167,8 @@ class KTDocumentCheckInAction extends KTDocumentAction { | @@ -167,8 +167,8 @@ class KTDocumentCheckInAction extends KTDocumentAction { | ||
| 167 | 167 | ||
| 168 | $sReason = KTUtil::arrayGet($_REQUEST, 'reason', ""); | 168 | $sReason = KTUtil::arrayGet($_REQUEST, 'reason', ""); |
| 169 | $checkin_fields = array(); | 169 | $checkin_fields = array(); |
| 170 | - $checkin_fields[] = new KTFileUploadWidget('File', 'The updated document.', 'file', "", $this->oPage, true); | ||
| 171 | - $checkin_fields[] = new KTStringWidget('Description', 'Describe the changes made to the document.', 'reason', $sReason, $this->oPage, true); | 170 | + $checkin_fields[] = new KTFileUploadWidget(_('File'), _('The updated document.'), 'file', "", $this->oPage, true); |
| 171 | + $checkin_fields[] = new KTStringWidget(_('Description'), _('Describe the changes made to the document.'), 'reason', $sReason, $this->oPage, true); | ||
| 172 | 172 | ||
| 173 | $oTemplate->setData(array( | 173 | $oTemplate->setData(array( |
| 174 | 'context' => &$this, | 174 | 'context' => &$this, |
| @@ -183,19 +183,19 @@ class KTDocumentCheckInAction extends KTDocumentAction { | @@ -183,19 +183,19 @@ class KTDocumentCheckInAction extends KTDocumentAction { | ||
| 183 | 183 | ||
| 184 | // make sure the user actually selected a file first | 184 | // make sure the user actually selected a file first |
| 185 | if (strlen($_FILES['file']['name']) == 0) { | 185 | if (strlen($_FILES['file']['name']) == 0) { |
| 186 | - $this->errorRedirectToMain("No file was uploaded", 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); | 186 | + $this->errorRedirectToMain(_("No file was uploaded"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | // and that the filename matches | 189 | // and that the filename matches |
| 190 | global $default; | 190 | global $default; |
| 191 | $default->log->info("checkInDocumentBL.php uploaded filename=" . $_FILES['file']['name'] . "; current filename=" . $this->oDocument->getFileName()); | 191 | $default->log->info("checkInDocumentBL.php uploaded filename=" . $_FILES['file']['name'] . "; current filename=" . $this->oDocument->getFileName()); |
| 192 | if ($this->oDocument->getFileName() != $_FILES['file']['name']) { | 192 | if ($this->oDocument->getFileName() != $_FILES['file']['name']) { |
| 193 | - $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); | 193 | + $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); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | $res = KTDocumentUtil::checkin($this->oDocument, $_FILES['file']['tmp_name'], $sReason, $this->oUser); | 196 | $res = KTDocumentUtil::checkin($this->oDocument, $_FILES['file']['tmp_name'], $sReason, $this->oUser); |
| 197 | if (PEAR::isError($res)) { | 197 | if (PEAR::isError($res)) { |
| 198 | - $this->errorRedirectToMain("An error occurred while trying to check in the document", 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); | 198 | + $this->errorRedirectToMain(_("An error occurred while trying to check in the document"), 'fDocumentId=' . $this->oDocument->getId() . '&reason=' . $sReason); |
| 199 | } | 199 | } |
| 200 | redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID()); | 200 | redirect("$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $this->oDocument->getID()); |
| 201 | } | 201 | } |
| @@ -247,7 +247,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { | @@ -247,7 +247,7 @@ class KTDocumentDeleteAction extends KTDocumentAction { | ||
| 247 | $this->oPage->setBreadcrumbDetails("delete"); | 247 | $this->oPage->setBreadcrumbDetails("delete"); |
| 248 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete'); | 248 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/delete'); |
| 249 | $delete_fields = array(); | 249 | $delete_fields = array(); |
| 250 | - $delete_fields[] = new KTStringWidget('Reason', 'The reason for this document to be removed.', 'reason', "", $this->oPage, true); | 250 | + $delete_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be removed.'), 'reason', "", $this->oPage, true); |
| 251 | 251 | ||
| 252 | $oTemplate->setData(array( | 252 | $oTemplate->setData(array( |
| 253 | 'context' => &$this, | 253 | 'context' => &$this, |
| @@ -364,13 +364,13 @@ class KTDocumentMoveAction extends KTDocumentAction { | @@ -364,13 +364,13 @@ class KTDocumentMoveAction extends KTDocumentAction { | ||
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | function do_main() { | 366 | function do_main() { |
| 367 | - $this->oPage->setBreadcrumbDetails("move"); | 367 | + $this->oPage->setBreadcrumbDetails(_("move")); |
| 368 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move'); | 368 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move'); |
| 369 | $move_fields = array(); | 369 | $move_fields = array(); |
| 370 | $aNames = $this->oDocumentFolder->getPathArray(); | 370 | $aNames = $this->oDocumentFolder->getPathArray(); |
| 371 | $aNames[] = $this->oDocument->getName(); | 371 | $aNames[] = $this->oDocument->getName(); |
| 372 | $sDocumentName = join(" » ", $aNames); | 372 | $sDocumentName = join(" » ", $aNames); |
| 373 | - $move_fields[] = new KTStaticTextWidget('Document to move', '', 'fDocumentId', $sDocumentName, $this->oPage, false); | 373 | + $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false); |
| 374 | 374 | ||
| 375 | $collection = new DocumentCollection(); | 375 | $collection = new DocumentCollection(); |
| 376 | $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument)); | 376 | $collection->addColumn(new KTDocumentMoveColumn("Test 1 (title)","title", $this->oDocument)); |
| @@ -416,16 +416,16 @@ class KTDocumentMoveAction extends KTDocumentAction { | @@ -416,16 +416,16 @@ class KTDocumentMoveAction extends KTDocumentAction { | ||
| 416 | } | 416 | } |
| 417 | 417 | ||
| 418 | function do_move() { | 418 | function do_move() { |
| 419 | - $this->oPage->setBreadcrumbDetails("move"); | 419 | + $this->oPage->setBreadcrumbDetails(_("move")); |
| 420 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move_final'); | 420 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/move_final'); |
| 421 | $sFolderPath = join(" » ", $this->oFolder->getPathArray()); | 421 | $sFolderPath = join(" » ", $this->oFolder->getPathArray()); |
| 422 | $aNames = $this->oDocumentFolder->getPathArray(); | 422 | $aNames = $this->oDocumentFolder->getPathArray(); |
| 423 | $aNames[] = $this->oDocument->getName(); | 423 | $aNames[] = $this->oDocument->getName(); |
| 424 | $sDocumentName = join(" » ", $aNames); | 424 | $sDocumentName = join(" » ", $aNames); |
| 425 | $move_fields = array(); | 425 | $move_fields = array(); |
| 426 | - $move_fields[] = new KTStaticTextWidget('Document to move', '', 'fDocumentId', $sDocumentName, $this->oPage, false); | ||
| 427 | - $move_fields[] = new KTStaticTextWidget('Target folder', '', 'fFolderId', $sFolderPath, $this->oPage, false); | ||
| 428 | - $move_fields[] = new KTStringWidget('Reason', 'The reason for this document to be moved.', 'reason', "", $this->oPage, true); | 426 | + $move_fields[] = new KTStaticTextWidget(_('Document to move'), '', 'fDocumentId', $sDocumentName, $this->oPage, false); |
| 427 | + $move_fields[] = new KTStaticTextWidget(_('Target folder'), '', 'fFolderId', $sFolderPath, $this->oPage, false); | ||
| 428 | + $move_fields[] = new KTStringWidget(_('Reason'), _('The reason for this document to be moved.'), 'reason', "", $this->oPage, true); | ||
| 429 | 429 | ||
| 430 | $oTemplate->setData(array( | 430 | $oTemplate->setData(array( |
| 431 | 'context' => &$this, | 431 | 'context' => &$this, |
| @@ -437,13 +437,13 @@ class KTDocumentMoveAction extends KTDocumentAction { | @@ -437,13 +437,13 @@ class KTDocumentMoveAction extends KTDocumentAction { | ||
| 437 | function do_move_final() { | 437 | function do_move_final() { |
| 438 | $sReason = KTUtil::arrayGet($_REQUEST, 'reason'); | 438 | $sReason = KTUtil::arrayGet($_REQUEST, 'reason'); |
| 439 | $aOptions = array( | 439 | $aOptions = array( |
| 440 | - 'message' => "No reason given", | 440 | + 'message' => _("No reason given"), |
| 441 | 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())), | 441 | 'redirect_to' => array('move', sprintf('fDocumentId=%d&fFolderId=%d', $this->oDocument->getId(), $this->oFolder->getId())), |
| 442 | ); | 442 | ); |
| 443 | $this->oValidator->notEmpty($sReason, $aOptions); | 443 | $this->oValidator->notEmpty($sReason, $aOptions); |
| 444 | 444 | ||
| 445 | if (!Permission::userHasFolderWritePermission($this->oFolder)) { | 445 | if (!Permission::userHasFolderWritePermission($this->oFolder)) { |
| 446 | - $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())); | 446 | + $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())); |
| 447 | exit(0); | 447 | exit(0); |
| 448 | } | 448 | } |
| 449 | 449 | ||
| @@ -452,7 +452,7 @@ class KTDocumentMoveAction extends KTDocumentAction { | @@ -452,7 +452,7 @@ class KTDocumentMoveAction extends KTDocumentAction { | ||
| 452 | //put the document in the new folder | 452 | //put the document in the new folder |
| 453 | $this->oDocument->setFolderID($this->oFolder->getId()); | 453 | $this->oDocument->setFolderID($this->oFolder->getId()); |
| 454 | if (!$this->oDocument->update(true)) { | 454 | if (!$this->oDocument->update(true)) { |
| 455 | - $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())); | 455 | + $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())); |
| 456 | } | 456 | } |
| 457 | 457 | ||
| 458 | //move the document on the file system | 458 | //move the document on the file system |
| @@ -460,7 +460,7 @@ class KTDocumentMoveAction extends KTDocumentAction { | @@ -460,7 +460,7 @@ class KTDocumentMoveAction extends KTDocumentAction { | ||
| 460 | if (!$oStorage->moveDocument($this->oDocument, $this->oDocumentFolder, $this->oFolder)) { | 460 | if (!$oStorage->moveDocument($this->oDocument, $this->oDocumentFolder, $this->oFolder)) { |
| 461 | $this->oDocument->setFolderID($this->oDocumentFolder->getId()); | 461 | $this->oDocument->setFolderID($this->oDocumentFolder->getId()); |
| 462 | $this->oDocument->update(true); | 462 | $this->oDocument->update(true); |
| 463 | - 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())); | 463 | + 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())); |
| 464 | } | 464 | } |
| 465 | $this->oDocument->update(); | 465 | $this->oDocument->update(); |
| 466 | 466 | ||
| @@ -540,10 +540,10 @@ class KTDocumentArchiveAction extends KTDocumentAction { | @@ -540,10 +540,10 @@ class KTDocumentArchiveAction extends KTDocumentAction { | ||
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | function do_main() { | 542 | function do_main() { |
| 543 | - $this->oPage->setBreadcrumbDetails("archiving"); | 543 | + $this->oPage->setBreadcrumbDetails(_("archiving")); |
| 544 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive'); | 544 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/archive'); |
| 545 | $fields = array(); | 545 | $fields = array(); |
| 546 | - $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); | 546 | + $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); |
| 547 | 547 | ||
| 548 | $oTemplate->setData(array( | 548 | $oTemplate->setData(array( |
| 549 | 'context' => &$this, | 549 | 'context' => &$this, |
| @@ -556,7 +556,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { | @@ -556,7 +556,7 @@ class KTDocumentArchiveAction extends KTDocumentAction { | ||
| 556 | $this->startTransaction(); | 556 | $this->startTransaction(); |
| 557 | $this->oDocument->setStatusID(ARCHIVED); | 557 | $this->oDocument->setStatusID(ARCHIVED); |
| 558 | if (!$this->oDocument->update()) { | 558 | if (!$this->oDocument->update()) { |
| 559 | - $_SESSION['KTErrorMessage'][] = "There was a database error while trying to archive this file"; | 559 | + $_SESSION['KTErrorMessage'][] = _("There was a database error while trying to archive this file"); |
| 560 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 560 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| 561 | exit(0); | 561 | exit(0); |
| 562 | } | 562 | } |
| @@ -593,7 +593,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | @@ -593,7 +593,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | ||
| 593 | var $_sShowPermission = "ktcore.permissions.write"; | 593 | var $_sShowPermission = "ktcore.permissions.write"; |
| 594 | 594 | ||
| 595 | function do_main() { | 595 | function do_main() { |
| 596 | - $this->oPage->setBreadcrumbDetails("workflow"); | 596 | + $this->oPage->setBreadcrumbDetails(_("workflow")); |
| 597 | $oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow"); | 597 | $oTemplate =& $this->oValidator->validateTemplate("ktcore/workflow/documentWorkflow"); |
| 598 | $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); | 598 | $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); |
| 599 | 599 | ||
| @@ -613,8 +613,8 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | @@ -613,8 +613,8 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | ||
| 613 | $aVocab[$oTransition->getId()] = $oTransition->showDescription(); | 613 | $aVocab[$oTransition->getId()] = $oTransition->showDescription(); |
| 614 | } | 614 | } |
| 615 | $fieldOptions = array("vocab" => $aVocab); | 615 | $fieldOptions = array("vocab" => $aVocab); |
| 616 | - $transition_fields[] = new KTLookupWidget('Transition to perform', 'FIXME', 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); | ||
| 617 | - $transition_fields[] = new KTStringWidget('Reason for transition', 'Describe the changes made to the document.', 'fComments', "", $this->oPage, true); | 616 | + $transition_fields[] = new KTLookupWidget(_('Transition to perform'), 'FIXME', 'fTransitionId', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); |
| 617 | + $transition_fields[] = new KTStringWidget(_('Reason for transition'), _('Describe the changes made to the document.'), 'fComments', "", $this->oPage, true); | ||
| 618 | } | 618 | } |
| 619 | $aTemplateData = array( | 619 | $aTemplateData = array( |
| 620 | 'oDocument' => $oDocument, | 620 | 'oDocument' => $oDocument, |
| @@ -631,7 +631,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | @@ -631,7 +631,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | ||
| 631 | $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); | 631 | $oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); |
| 632 | $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']); | 632 | $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']); |
| 633 | $res = KTWorkflowUtil::startWorkflowOnDocument($oWorkflow, $oDocument); | 633 | $res = KTWorkflowUtil::startWorkflowOnDocument($oWorkflow, $oDocument); |
| 634 | - $this->successRedirectToMain('Workflow started', | 634 | + $this->successRedirectToMain(_('Workflow started'), |
| 635 | array('fDocumentId' => $oDocument->getId())); | 635 | array('fDocumentId' => $oDocument->getId())); |
| 636 | exit(0); | 636 | exit(0); |
| 637 | } | 637 | } |
| @@ -642,7 +642,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | @@ -642,7 +642,7 @@ class KTDocumentWorkflowAction extends KTDocumentAction { | ||
| 642 | $sComments =& $this->oValidator->notEmpty($_REQUEST['fComments']); | 642 | $sComments =& $this->oValidator->notEmpty($_REQUEST['fComments']); |
| 643 | $oUser =& User::get($_SESSION['userID']); | 643 | $oUser =& User::get($_SESSION['userID']); |
| 644 | $res = KTWorkflowUtil::performTransitionOnDocument($oTransition, $oDocument, $oUser, $sComments); | 644 | $res = KTWorkflowUtil::performTransitionOnDocument($oTransition, $oDocument, $oUser, $sComments); |
| 645 | - $this->successRedirectToMain('Transition performed', | 645 | + $this->successRedirectToMain(_('Transition performed'), |
| 646 | array('fDocumentId' => $oDocument->getId())); | 646 | array('fDocumentId' => $oDocument->getId())); |
| 647 | } | 647 | } |
| 648 | } | 648 | } |
plugins/ktcore/KTFolderActions.php
| @@ -20,12 +20,12 @@ class KTFolderAddDocumentAction extends KTFolderAction { | @@ -20,12 +20,12 @@ class KTFolderAddDocumentAction extends KTFolderAction { | ||
| 20 | var $_sShowPermission = "ktcore.permissions.write"; | 20 | var $_sShowPermission = "ktcore.permissions.write"; |
| 21 | 21 | ||
| 22 | function do_main() { | 22 | function do_main() { |
| 23 | - $this->oPage->setBreadcrumbDetails("add document"); | ||
| 24 | - $this->oPage->setTitle('Add a document'); | 23 | + $this->oPage->setBreadcrumbDetails(_("add document")); |
| 24 | + $this->oPage->setTitle(_('Add a document')); | ||
| 25 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add'); | 25 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add'); |
| 26 | $add_fields = array(); | 26 | $add_fields = array(); |
| 27 | - $add_fields[] = new KTFileUploadWidget('File', 'The contents of the document to be added to the document management system.', 'file', "", $this->oPage, true); | ||
| 28 | - $add_fields[] = new KTStringWidget('Title', 'Describe the changes made to the document.', 'title', "", $this->oPage, true); | 27 | + $add_fields[] = new KTFileUploadWidget(_('File'), _('The contents of the document to be added to the document management system.'), 'file', "", $this->oPage, true); |
| 28 | + $add_fields[] = new KTStringWidget(_('Title'), _('Describe the changes made to the document.'), 'title', "", $this->oPage, true); | ||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | ||
| @@ -34,7 +34,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { | @@ -34,7 +34,7 @@ class KTFolderAddDocumentAction extends KTFolderAction { | ||
| 34 | $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); | 34 | $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); |
| 35 | } | 35 | } |
| 36 | $fieldOptions = array("vocab" => $aVocab); | 36 | $fieldOptions = array("vocab" => $aVocab); |
| 37 | - $add_fields[] = new KTLookupWidget('Document Type', 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); | 37 | + $add_fields[] = new KTLookupWidget(_('Document Type'), 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); |
| 38 | 38 | ||
| 39 | $fieldsets = array(); | 39 | $fieldsets = array(); |
| 40 | $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); | 40 | $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); |
| @@ -122,10 +122,10 @@ class KTFolderAddFolderAction extends KTFolderAction { | @@ -122,10 +122,10 @@ class KTFolderAddFolderAction extends KTFolderAction { | ||
| 122 | var $_sShowPermission = "ktcore.permissions.write"; | 122 | var $_sShowPermission = "ktcore.permissions.write"; |
| 123 | 123 | ||
| 124 | function do_main() { | 124 | function do_main() { |
| 125 | - $this->oPage->setBreadcrumbDetails("add folder"); | 125 | + $this->oPage->setBreadcrumbDetails(_("add folder")); |
| 126 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/addFolder'); | 126 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/action/addFolder'); |
| 127 | $fields = array(); | 127 | $fields = array(); |
| 128 | - $fields[] = new KTStringWidget('Folder name', '', 'name', "", $this->oPage, true); | 128 | + $fields[] = new KTStringWidget(_('Folder name'), _('The name for the new folder.'), 'name', "", $this->oPage, true); |
| 129 | 129 | ||
| 130 | $oTemplate->setData(array( | 130 | $oTemplate->setData(array( |
| 131 | 'context' => &$this, | 131 | 'context' => &$this, |
| @@ -139,13 +139,13 @@ class KTFolderAddFolderAction extends KTFolderAction { | @@ -139,13 +139,13 @@ class KTFolderAddFolderAction extends KTFolderAction { | ||
| 139 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), | 139 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), |
| 140 | ); | 140 | ); |
| 141 | $sFolderName = KTUtil::arrayGet($_REQUEST, 'name'); | 141 | $sFolderName = KTUtil::arrayGet($_REQUEST, 'name'); |
| 142 | - $aErrorOptions['defaultmessage'] = "No name given"; | 142 | + $aErrorOptions['defaultmessage'] = _("No name given"); |
| 143 | $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions); | 143 | $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions); |
| 144 | 144 | ||
| 145 | $this->startTransaction(); | 145 | $this->startTransaction(); |
| 146 | 146 | ||
| 147 | $res = KTFolderUtil::add($this->oFolder, $sFolderName, $this->oUser); | 147 | $res = KTFolderUtil::add($this->oFolder, $sFolderName, $this->oUser); |
| 148 | - $aErrorOptions['defaultmessage'] = "Could not create folder in the document management system"; | 148 | + $aErrorOptions['defaultmessage'] = _("Could not create folder in the document management system"); |
| 149 | $this->oValidator->notError($res, $aErrorOptions); | 149 | $this->oValidator->notError($res, $aErrorOptions); |
| 150 | 150 | ||
| 151 | $this->commitTransaction(); | 151 | $this->commitTransaction(); |
| @@ -163,7 +163,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -163,7 +163,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 163 | var $bAutomaticTransaction = true; | 163 | var $bAutomaticTransaction = true; |
| 164 | 164 | ||
| 165 | function do_main() { | 165 | function do_main() { |
| 166 | - $this->oPage->setBreadcrumbDetails("viewing permissions"); | 166 | + $this->oPage->setBreadcrumbDetails(_("viewing permissions")); |
| 167 | $oTemplating = new KTTemplating; | 167 | $oTemplating = new KTTemplating; |
| 168 | $oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions"); | 168 | $oTemplate = $oTemplating->loadTemplate("ktcore/folder/permissions"); |
| 169 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); | 169 | $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); |
| @@ -230,19 +230,19 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -230,19 +230,19 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 230 | KTPermissionUtil::setPermissionForId($oPermission, $oPO, $aAllowed); | 230 | KTPermissionUtil::setPermissionForId($oPermission, $oPO, $aAllowed); |
| 231 | } | 231 | } |
| 232 | KTPermissionUtil::updatePermissionLookupForPO($oPO); | 232 | KTPermissionUtil::updatePermissionLookupForPO($oPO); |
| 233 | - return $this->successRedirectToMain('Permissions updated', | 233 | + return $this->successRedirectToMain(_('Permissions updated'), |
| 234 | array('fFolderId' => $this->oFolder->getId())); | 234 | array('fFolderId' => $this->oFolder->getId())); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | function do_copyPermissions() { | 237 | function do_copyPermissions() { |
| 238 | KTPermissionUtil::copyPermissionObject($this->oFolder); | 238 | KTPermissionUtil::copyPermissionObject($this->oFolder); |
| 239 | - return $this->successRedirectToMain('Permissions updated', | 239 | + return $this->successRedirectToMain(_('Permissions updated'), |
| 240 | array('fFolderId' => $this->oFolder->getId())); | 240 | array('fFolderId' => $this->oFolder->getId())); |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | function do_inheritPermissions() { | 243 | function do_inheritPermissions() { |
| 244 | KTPermissionUtil::inheritPermissionObject($this->oFolder); | 244 | KTPermissionUtil::inheritPermissionObject($this->oFolder); |
| 245 | - return $this->successRedirectToMain('Permissions updated', | 245 | + return $this->successRedirectToMain(_('Permissions updated'), |
| 246 | array('fFolderId' => $this->oFolder->getId())); | 246 | array('fFolderId' => $this->oFolder->getId())); |
| 247 | } | 247 | } |
| 248 | 248 | ||
| @@ -263,7 +263,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | @@ -263,7 +263,7 @@ class KTFolderPermissionsAction extends KTFolderAction { | ||
| 263 | $this->oValidator->notError($oDynamicCondition, $aOptions); | 263 | $this->oValidator->notError($oDynamicCondition, $aOptions); |
| 264 | $res = $oDynamicCondition->saveAssignment($aPermissionIds); | 264 | $res = $oDynamicCondition->saveAssignment($aPermissionIds); |
| 265 | $this->oValidator->notError($res, $aOptions); | 265 | $this->oValidator->notError($res, $aOptions); |
| 266 | - $this->successRedirectToMain("Dynamic permission added", "fFolderId=" . $this->oFolder->getId()); | 266 | + $this->successRedirectToMain(_("Dynamic permission added"), "fFolderId=" . $this->oFolder->getId()); |
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 269 | $oKTActionRegistry->registerAction('folderaction', 'KTFolderPermissionsAction', 'ktcore.actions.folder.permissions'); | 269 | $oKTActionRegistry->registerAction('folderaction', 'KTFolderPermissionsAction', 'ktcore.actions.folder.permissions'); |
plugins/ktcore/KTPortlets.php
| @@ -8,7 +8,7 @@ $oPRegistry =& KTPortletRegistry::getSingleton(); | @@ -8,7 +8,7 @@ $oPRegistry =& KTPortletRegistry::getSingleton(); | ||
| 8 | class KTSearchPortlet extends KTPortlet { | 8 | class KTSearchPortlet extends KTPortlet { |
| 9 | 9 | ||
| 10 | function KTSearchPortlet() { | 10 | function KTSearchPortlet() { |
| 11 | - parent::KTPortlet("Search"); | 11 | + parent::KTPortlet(_("Search")); |
| 12 | } | 12 | } |
| 13 | function render() { | 13 | function render() { |
| 14 | $oTemplating = new KTTemplating; | 14 | $oTemplating = new KTTemplating; |
plugins/ktcore/authentication/authenticationadminpage.inc.php
| @@ -5,16 +5,12 @@ require_once(KT_LIB_DIR . '/authentication/authenticationproviderregistry.inc.ph | @@ -5,16 +5,12 @@ require_once(KT_LIB_DIR . '/authentication/authenticationproviderregistry.inc.ph | ||
| 5 | require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php'); | 5 | require_once(KT_LIB_DIR . '/authentication/authenticationsource.inc.php'); |
| 6 | 6 | ||
| 7 | class KTAuthenticationAdminPage extends KTAdminDispatcher { | 7 | class KTAuthenticationAdminPage extends KTAdminDispatcher { |
| 8 | - var $aBreadcrumbs = array( | ||
| 9 | - array('action' => 'administration', 'name' => 'Administration'), | ||
| 10 | - ); | ||
| 11 | - | ||
| 12 | function do_main() { | 8 | function do_main() { |
| 13 | - $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']); | 9 | + $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 14 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage'); | 10 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/manage'); |
| 15 | $fields = array(); | 11 | $fields = array(); |
| 16 | 12 | ||
| 17 | - $fields[] = new KTStringWidget('Name', 'FIXME', 'name', "", $this->oPage, true); | 13 | + $fields[] = new KTStringWidget(_('Name'), 'FIXME', 'name', "", $this->oPage, true); |
| 18 | 14 | ||
| 19 | $aVocab = array(); | 15 | $aVocab = array(); |
| 20 | $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); | 16 | $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); |
| @@ -23,7 +19,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -23,7 +19,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 23 | $aVocab[$aProvider[2]] = $aProvider[0]; | 19 | $aVocab[$aProvider[2]] = $aProvider[0]; |
| 24 | } | 20 | } |
| 25 | $fieldOptions = array("vocab" => $aVocab); | 21 | $fieldOptions = array("vocab" => $aVocab); |
| 26 | - $fields[] = new KTLookupWidget('Authentication provider', 'FIXME', 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); | 22 | + $fields[] = new KTLookupWidget(_('Authentication provider'), 'FIXME', 'authentication_provider', null, $this->oPage, true, null, $fieldErrors, $fieldOptions); |
| 27 | 23 | ||
| 28 | $aSources = KTAuthenticationSource::getList(); | 24 | $aSources = KTAuthenticationSource::getList(); |
| 29 | 25 | ||
| @@ -37,7 +33,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -37,7 +33,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 37 | } | 33 | } |
| 38 | 34 | ||
| 39 | function do_viewsource() { | 35 | function do_viewsource() { |
| 40 | - $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']); | 36 | + $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 41 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/viewsource'); | 37 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/authentication/viewsource'); |
| 42 | $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); | 38 | $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); |
| 43 | $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); | 39 | $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); |
| @@ -58,11 +54,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -58,11 +54,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 58 | $aErrorOptions = array( | 54 | $aErrorOptions = array( |
| 59 | 'redirect_to' => array('main'), | 55 | 'redirect_to' => array('main'), |
| 60 | ); | 56 | ); |
| 61 | - $aErrorOptions['message'] = "No name provided"; | 57 | + $aErrorOptions['message'] = _("No name provided"); |
| 62 | $sName = KTUtil::arrayGet($_REQUEST, 'name'); | 58 | $sName = KTUtil::arrayGet($_REQUEST, 'name'); |
| 63 | $sName = $this->oValidator->validateString($sName, $aErrorOptions); | 59 | $sName = $this->oValidator->validateString($sName, $aErrorOptions); |
| 64 | 60 | ||
| 65 | - $aErrorOptions['message'] = "No authentication provider chosen"; | 61 | + $aErrorOptions['message'] = _("No authentication provider chosen"); |
| 66 | $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider'); | 62 | $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider'); |
| 67 | $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions); | 63 | $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions); |
| 68 | 64 | ||
| @@ -70,7 +66,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -70,7 +66,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 70 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); | 66 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); |
| 71 | 67 | ||
| 72 | if (method_exists($oProvider, 'do_newsource')) { | 68 | if (method_exists($oProvider, 'do_newsource')) { |
| 73 | - $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']); | 69 | + $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 74 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; | 70 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; |
| 75 | 71 | ||
| 76 | return $oProvider->dispatch(); | 72 | return $oProvider->dispatch(); |
| @@ -83,11 +79,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -83,11 +79,11 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 83 | $aErrorOptions = array( | 79 | $aErrorOptions = array( |
| 84 | 'redirect_to' => array('main'), | 80 | 'redirect_to' => array('main'), |
| 85 | ); | 81 | ); |
| 86 | - $aErrorOptions['message'] = "No name provided"; | 82 | + $aErrorOptions['message'] = _("No name provided"); |
| 87 | $sName = KTUtil::arrayGet($_REQUEST, 'name'); | 83 | $sName = KTUtil::arrayGet($_REQUEST, 'name'); |
| 88 | $sName = $this->oValidator->validateString($sName, $aErrorOptions); | 84 | $sName = $this->oValidator->validateString($sName, $aErrorOptions); |
| 89 | 85 | ||
| 90 | - $aErrorOptions['message'] = "No authentication provider chosen"; | 86 | + $aErrorOptions['message'] = _("No authentication provider chosen"); |
| 91 | $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider'); | 87 | $sProvider = KTUtil::arrayGet($_REQUEST, 'authentication_provider'); |
| 92 | $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions); | 88 | $sProvider = $this->oValidator->validateString($sProvider, $aErrorOptions); |
| 93 | 89 | ||
| @@ -100,7 +96,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -100,7 +96,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 100 | 'authenticationprovider' => $sProvider, | 96 | 'authenticationprovider' => $sProvider, |
| 101 | )); | 97 | )); |
| 102 | $this->oValidator->notError($oSource); | 98 | $this->oValidator->notError($oSource); |
| 103 | - $this->successRedirectToMain("Source created"); | 99 | + $this->successRedirectToMain(_("Source created")); |
| 104 | exit(0); | 100 | exit(0); |
| 105 | } | 101 | } |
| 106 | 102 | ||
| @@ -110,7 +106,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -110,7 +106,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 110 | $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); | 106 | $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); |
| 111 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); | 107 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); |
| 112 | 108 | ||
| 113 | - $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']); | 109 | + $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 114 | $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); | 110 | $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); |
| 115 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; | 111 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; |
| 116 | 112 | ||
| @@ -124,7 +120,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | @@ -124,7 +120,7 @@ class KTAuthenticationAdminPage extends KTAdminDispatcher { | ||
| 124 | $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); | 120 | $oRegistry =& KTAuthenticationProviderRegistry::getSingleton(); |
| 125 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); | 121 | $oProvider =& $oRegistry->getAuthenticationProvider($sProvider); |
| 126 | 122 | ||
| 127 | - $this->aBreadcrumbs[] = array('name' => 'Authentication', 'url' => $_SERVER['PHP_SELF']); | 123 | + $this->aBreadcrumbs[] = array('name' => _('Authentication'), 'url' => $_SERVER['PHP_SELF']); |
| 128 | $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); | 124 | $this->aBreadcrumbs[] = array('name' => $oSource->getName(), 'url' => $_SERVER['PHP_SELF'] . "?source_id=" . $oSource->getId()); |
| 129 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; | 125 | $oProvider->aBreadcrumbs = $this->aBreadcrumbs; |
| 130 | 126 |
plugins/ktcore/folder/BulkImport.php
| @@ -14,17 +14,17 @@ class KTBulkImportFolderAction extends KTFolderAction { | @@ -14,17 +14,17 @@ class KTBulkImportFolderAction extends KTFolderAction { | ||
| 14 | var $bAutomaticTransaction = true; | 14 | var $bAutomaticTransaction = true; |
| 15 | 15 | ||
| 16 | function do_main() { | 16 | function do_main() { |
| 17 | - $this->oPage->setBreadcrumbDetails("bulk import"); | 17 | + $this->oPage->setBreadcrumbDetails(_("bulk import")); |
| 18 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkImport'); | 18 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkImport'); |
| 19 | $add_fields = array(); | 19 | $add_fields = array(); |
| 20 | - $add_fields[] = new KTStringWidget('Path', 'The path containing the documents to be added to the document management system.', 'path', "", $this->oPage, true); | 20 | + $add_fields[] = new KTStringWidget(_('Path'), _('The path containing the documents to be added to the document management system.'), 'path', "", $this->oPage, true); |
| 21 | 21 | ||
| 22 | $aVocab = array(); | 22 | $aVocab = array(); |
| 23 | foreach (DocumentType::getList() as $oDocumentType) { | 23 | foreach (DocumentType::getList() as $oDocumentType) { |
| 24 | $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); | 24 | $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); |
| 25 | } | 25 | } |
| 26 | $fieldOptions = array("vocab" => $aVocab); | 26 | $fieldOptions = array("vocab" => $aVocab); |
| 27 | - $add_fields[] = new KTLookupWidget('Document Type', 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); | 27 | + $add_fields[] = new KTLookupWidget(_('Document Type'), 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); |
| 28 | 28 | ||
| 29 | $fieldsets = array(); | 29 | $fieldsets = array(); |
| 30 | $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); | 30 | $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); |
| @@ -47,10 +47,10 @@ class KTBulkImportFolderAction extends KTFolderAction { | @@ -47,10 +47,10 @@ class KTBulkImportFolderAction extends KTFolderAction { | ||
| 47 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), | 47 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), |
| 48 | ); | 48 | ); |
| 49 | 49 | ||
| 50 | - $aErrorOptions['message'] = 'Invalid document type provided'; | 50 | + $aErrorOptions['message'] = _('Invalid document type provided'); |
| 51 | $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); | 51 | $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); |
| 52 | 52 | ||
| 53 | - $aErrorOptions['message'] = 'Invalid path provided'; | 53 | + $aErrorOptions['message'] = _('Invalid path provided'); |
| 54 | $sPath = $this->oValidator->validateString($_REQUEST['path'], $aErrorOptions); | 54 | $sPath = $this->oValidator->validateString($_REQUEST['path'], $aErrorOptions); |
| 55 | 55 | ||
| 56 | $matches = array(); | 56 | $matches = array(); |
plugins/ktcore/folder/BulkUpload.php
| @@ -14,17 +14,17 @@ class KTBulkUploadFolderAction extends KTFolderAction { | @@ -14,17 +14,17 @@ class KTBulkUploadFolderAction extends KTFolderAction { | ||
| 14 | var $bAutomaticTransaction = true; | 14 | var $bAutomaticTransaction = true; |
| 15 | 15 | ||
| 16 | function do_main() { | 16 | function do_main() { |
| 17 | - $this->oPage->setBreadcrumbDetails("bulk upload"); | 17 | + $this->oPage->setBreadcrumbDetails(_("bulk upload")); |
| 18 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkUpload'); | 18 | $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/bulkUpload'); |
| 19 | $add_fields = array(); | 19 | $add_fields = array(); |
| 20 | - $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); | 20 | + $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); |
| 21 | 21 | ||
| 22 | $aVocab = array(); | 22 | $aVocab = array(); |
| 23 | foreach (DocumentType::getList() as $oDocumentType) { | 23 | foreach (DocumentType::getList() as $oDocumentType) { |
| 24 | $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); | 24 | $aVocab[$oDocumentType->getId()] = $oDocumentType->getName(); |
| 25 | } | 25 | } |
| 26 | $fieldOptions = array("vocab" => $aVocab); | 26 | $fieldOptions = array("vocab" => $aVocab); |
| 27 | - $add_fields[] = new KTLookupWidget('Document Type', 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); | 27 | + $add_fields[] = new KTLookupWidget(_('Document Type'), 'FIXME', 'fDocumentTypeId', null, $this->oPage, true, "add-document-type", $fieldErrors, $fieldOptions); |
| 28 | 28 | ||
| 29 | $fieldsets = array(); | 29 | $fieldsets = array(); |
| 30 | $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); | 30 | $fieldsetDisplayReg =& KTFieldsetDisplayRegistry::getSingleton(); |
| @@ -47,7 +47,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { | @@ -47,7 +47,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { | ||
| 47 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), | 47 | 'redirect_to' => array('main', sprintf('fFolderId=%d', $this->oFolder->getId())), |
| 48 | ); | 48 | ); |
| 49 | 49 | ||
| 50 | - $aErrorOptions['message'] = 'Invalid document type provided'; | 50 | + $aErrorOptions['message'] = _('Invalid document type provided'); |
| 51 | $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); | 51 | $oDocumentType = $this->oValidator->validateDocumentType($_REQUEST['fDocumentTypeId'], $aErrorOptions); |
| 52 | 52 | ||
| 53 | unset($aErrorOptions['message']); | 53 | unset($aErrorOptions['message']); |
| @@ -70,7 +70,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { | @@ -70,7 +70,7 @@ class KTBulkUploadFolderAction extends KTFolderAction { | ||
| 70 | $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions); | 70 | $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions); |
| 71 | $this->startTransaction(); | 71 | $this->startTransaction(); |
| 72 | $res = $bm->import(); | 72 | $res = $bm->import(); |
| 73 | - $aErrorOptions['message'] = "Bulk import failed"; | 73 | + $aErrorOptions['message'] = _("Bulk import failed"); |
| 74 | $this->oValidator->notError($res, $aErrorOptions); | 74 | $this->oValidator->notError($res, $aErrorOptions); |
| 75 | 75 | ||
| 76 | $this->commitTransaction(); | 76 | $this->commitTransaction(); |
plugins/ktstandard/KTDiscussion.php
| @@ -50,13 +50,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -50,13 +50,13 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 50 | var $sName = 'ktcore.actions.document.discussion'; | 50 | var $sName = 'ktcore.actions.document.discussion'; |
| 51 | 51 | ||
| 52 | function do_main() { | 52 | function do_main() { |
| 53 | - $this->oPage->setBreadcrumbDetails("discussion"); | 53 | + $this->oPage->setBreadcrumbDetails(_("discussion")); |
| 54 | $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion'); | 54 | $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion'); |
| 55 | 55 | ||
| 56 | // Fields for new thread creation | 56 | // Fields for new thread creation |
| 57 | $fields = array(); | 57 | $fields = array(); |
| 58 | - $fields[] = new KTStringWidget("Subject", "The topic of discussion in this thread", "subject", "", $this->oPage, true); | ||
| 59 | - $fields[] = new KTTextWidget("Body", "Your contribution to the discussion in this thread", "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | 58 | + $fields[] = new KTStringWidget(_("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true); |
| 59 | + $fields[] = new KTTextWidget(_("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | ||
| 60 | 60 | ||
| 61 | $threads = DiscussionThread::getList(); | 61 | $threads = DiscussionThread::getList(); |
| 62 | 62 | ||
| @@ -74,11 +74,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -74,11 +74,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 74 | 'redirect_to' => array('main', sprintf('fDocumentId=%d', $this->oDocument->getId())), | 74 | 'redirect_to' => array('main', sprintf('fDocumentId=%d', $this->oDocument->getId())), |
| 75 | ); | 75 | ); |
| 76 | 76 | ||
| 77 | - $aErrorOptions['message'] = "No subject provided"; | 77 | + $aErrorOptions['message'] = _("No subject provided"); |
| 78 | $sSubject = KTUtil::arrayGet($_REQUEST, 'subject'); | 78 | $sSubject = KTUtil::arrayGet($_REQUEST, 'subject'); |
| 79 | $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions); | 79 | $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions); |
| 80 | 80 | ||
| 81 | - $aErrorOptions['message'] = "No body provided"; | 81 | + $aErrorOptions['message'] = _("No body provided"); |
| 82 | $sBody = KTUtil::arrayGet($_REQUEST, 'body'); | 82 | $sBody = KTUtil::arrayGet($_REQUEST, 'body'); |
| 83 | $sBody = $this->oValidator->validateString($sBody, $aErrorOptions); | 83 | $sBody = $this->oValidator->validateString($sBody, $aErrorOptions); |
| 84 | 84 | ||
| @@ -89,8 +89,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -89,8 +89,8 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 89 | 'documentid' => $this->oDocument->getId(), | 89 | 'documentid' => $this->oDocument->getId(), |
| 90 | 'creatorid' => $this->oUser->getId(), | 90 | 'creatorid' => $this->oUser->getId(), |
| 91 | )); | 91 | )); |
| 92 | - $aErrorOptions['message'] = "There was an error creating a new thread"; | ||
| 93 | - $this->oValidator->notError($oThread); | 92 | + $aErrorOptions['message'] = _("There was an error creating a new thread"); |
| 93 | + $this->oValidator->notError($oThread, $aErrorOptions); | ||
| 94 | 94 | ||
| 95 | $oComment = DiscussionComment::createFromArray(array( | 95 | $oComment = DiscussionComment::createFromArray(array( |
| 96 | 'threadid' => $oThread->getId(), | 96 | 'threadid' => $oThread->getId(), |
| @@ -98,19 +98,19 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -98,19 +98,19 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 98 | 'subject' => $sSubject, | 98 | 'subject' => $sSubject, |
| 99 | 'body' => $sBody, | 99 | 'body' => $sBody, |
| 100 | )); | 100 | )); |
| 101 | - $aErrorOptions['message'] = "There was an error adding the comment to the thread"; | ||
| 102 | - $this->oValidator->notError($oComment); | 101 | + $aErrorOptions['message'] = _("There was an error adding the comment to the thread"); |
| 102 | + $this->oValidator->notError($oComment, $aErrorOptions); | ||
| 103 | 103 | ||
| 104 | $oThread->setFirstCommentId($oComment->getId()); | 104 | $oThread->setFirstCommentId($oComment->getId()); |
| 105 | $oThread->setLastCommentId($oComment->getId()); | 105 | $oThread->setLastCommentId($oComment->getId()); |
| 106 | $res = $oThread->update(); | 106 | $res = $oThread->update(); |
| 107 | - $aErrorOptions['message'] = "There was an error updating the thread with the new comment"; | ||
| 108 | - $this->oValidator->notError($res); | 107 | + $aErrorOptions['message'] = _("There was an error updating the thread with the new comment"); |
| 108 | + $this->oValidator->notError($res, $aErrorOptions); | ||
| 109 | 109 | ||
| 110 | // Thread and comment created correctly, commit to database | 110 | // Thread and comment created correctly, commit to database |
| 111 | $this->commitTransaction(); | 111 | $this->commitTransaction(); |
| 112 | 112 | ||
| 113 | - $this->successRedirectToMain("New thread created", sprintf('fDocumentId=%d', $this->oDocument->getId())); | 113 | + $this->successRedirectToMain(_("New thread created"), sprintf('fDocumentId=%d', $this->oDocument->getId())); |
| 114 | exit(0); | 114 | exit(0); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| @@ -122,18 +122,18 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -122,18 +122,18 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 122 | $oComment = DiscussionComment::get($iCommentId); | 122 | $oComment = DiscussionComment::get($iCommentId); |
| 123 | 123 | ||
| 124 | $this->aBreadcrumbs[] = array( | 124 | $this->aBreadcrumbs[] = array( |
| 125 | - 'name' => 'discussion', | 125 | + 'name' => _('discussion'), |
| 126 | 'url' => $_SERVER['PHP_SELF'] . sprintf('?fDocumentId=%d', $this->oDocument->getId()), | 126 | 'url' => $_SERVER['PHP_SELF'] . sprintf('?fDocumentId=%d', $this->oDocument->getId()), |
| 127 | ); | 127 | ); |
| 128 | $this->aBreadcrumbs[] = array( | 128 | $this->aBreadcrumbs[] = array( |
| 129 | 'name' => $oComment->getSubject(), | 129 | 'name' => $oComment->getSubject(), |
| 130 | ); | 130 | ); |
| 131 | - $this->oPage->setBreadcrumbDetails("viewing comments"); | 131 | + $this->oPage->setBreadcrumbDetails(_("viewing comments")); |
| 132 | $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion_thread'); | 132 | $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/discussion_thread'); |
| 133 | // Fields for new thread creation | 133 | // Fields for new thread creation |
| 134 | $fields = array(); | 134 | $fields = array(); |
| 135 | - $fields[] = new KTStringWidget("Subject", "The topic of discussion in this thread", "subject", "", $this->oPage, true); | ||
| 136 | - $fields[] = new KTTextWidget("Body", "Your contribution to the discussion in this thread", "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | 135 | + $fields[] = new KTStringWidget(_("Subject"), _("The topic of discussion in this thread"), "subject", "", $this->oPage, true); |
| 136 | + $fields[] = new KTTextWidget(_("Body"), _("Your contribution to the discussion in this thread"), "body", "", $this->oPage, true, null, null, array("cols" => 50, "rows" => 10)); | ||
| 137 | 137 | ||
| 138 | $aTemplateData = array( | 138 | $aTemplateData = array( |
| 139 | 'context' => &$this, | 139 | 'context' => &$this, |
| @@ -158,11 +158,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -158,11 +158,11 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 158 | ); | 158 | ); |
| 159 | 159 | ||
| 160 | 160 | ||
| 161 | - $aErrorOptions['message'] = "No subject provided"; | 161 | + $aErrorOptions['message'] = _("No subject provided"); |
| 162 | $sSubject = KTUtil::arrayGet($_REQUEST, 'subject'); | 162 | $sSubject = KTUtil::arrayGet($_REQUEST, 'subject'); |
| 163 | $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions); | 163 | $sSubject = $this->oValidator->validateString($sSubject, $aErrorOptions); |
| 164 | 164 | ||
| 165 | - $aErrorOptions['message'] = "No body provided"; | 165 | + $aErrorOptions['message'] = _("No body provided"); |
| 166 | $sBody = KTUtil::arrayGet($_REQUEST, 'body'); | 166 | $sBody = KTUtil::arrayGet($_REQUEST, 'body'); |
| 167 | $sBody = $this->oValidator->validateString($sBody, $aErrorOptions); | 167 | $sBody = $this->oValidator->validateString($sBody, $aErrorOptions); |
| 168 | 168 | ||
| @@ -175,18 +175,18 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | @@ -175,18 +175,18 @@ class KTDocumentDiscussionAction extends KTDocumentAction { | ||
| 175 | 'subject' => $sSubject, | 175 | 'subject' => $sSubject, |
| 176 | 'body' => $sBody, | 176 | 'body' => $sBody, |
| 177 | )); | 177 | )); |
| 178 | - $aErrorOptions['message'] = "There was an error adding the comment to the thread"; | 178 | + $aErrorOptions['message'] = _("There was an error adding the comment to the thread"); |
| 179 | $this->oValidator->notError($oComment, $aErrorOptions); | 179 | $this->oValidator->notError($oComment, $aErrorOptions); |
| 180 | 180 | ||
| 181 | $oThread->setLastCommentId($oComment->getId()); | 181 | $oThread->setLastCommentId($oComment->getId()); |
| 182 | $res = $oThread->update(); | 182 | $res = $oThread->update(); |
| 183 | - $aErrorOptions['message'] = "There was an error updating the thread with the new comment"; | 183 | + $aErrorOptions['message'] = _("There was an error updating the thread with the new comment"); |
| 184 | $this->oValidator->notError($res, $aErrorOptions); | 184 | $this->oValidator->notError($res, $aErrorOptions); |
| 185 | 185 | ||
| 186 | // Thread and comment created correctly, commit to database | 186 | // Thread and comment created correctly, commit to database |
| 187 | $this->commitTransaction(); | 187 | $this->commitTransaction(); |
| 188 | 188 | ||
| 189 | - $this->successRedirectTo('viewThread', "Reply posted", sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId())); | 189 | + $this->successRedirectTo('viewThread', _("Reply posted"), sprintf('fDocumentId=%d&fThreadId=%d', $this->oDocument->getId(), $oThread->getId())); |
| 190 | exit(0); | 190 | exit(0); |
| 191 | } | 191 | } |
| 192 | } | 192 | } |
plugins/ktstandard/KTEmail.php
| @@ -197,9 +197,9 @@ class KTDocumentEmailAction extends KTDocumentAction { | @@ -197,9 +197,9 @@ class KTDocumentEmailAction extends KTDocumentAction { | ||
| 197 | function do_main() { | 197 | function do_main() { |
| 198 | $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/email'); | 198 | $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/email'); |
| 199 | $fields = array(); | 199 | $fields = array(); |
| 200 | - $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); | ||
| 201 | - $fields[] = new KTTextWidget("Email addresses", "FIXME: Add extra email addresses here", 'fEmailAddresses', "", $this->oPage); | ||
| 202 | - $fields[] = new KTTextWidget("Comment", "FIXME", 'fComment', "", $this->oPage, true); | 200 | + $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); |
| 201 | + $fields[] = new KTTextWidget(_("Email addresses"), _("Add extra email addresses here"), 'fEmailAddresses', "", $this->oPage); | ||
| 202 | + $fields[] = new KTTextWidget(_("Comment"), _("A message for those who receive the document"), 'fComment', "", $this->oPage, true); | ||
| 203 | $aTemplateData = array( | 203 | $aTemplateData = array( |
| 204 | 'context' => &$this, | 204 | 'context' => &$this, |
| 205 | 'fields' => $fields, | 205 | 'fields' => $fields, |
| @@ -230,7 +230,7 @@ class KTDocumentEmailAction extends KTDocumentAction { | @@ -230,7 +230,7 @@ class KTDocumentEmailAction extends KTDocumentAction { | ||
| 230 | 230 | ||
| 231 | //if we're going to send a mail, first make there is someone to send it to | 231 | //if we're going to send a mail, first make there is someone to send it to |
| 232 | if ((count($aGroupIDs) == 0) && (count($aUserIDs) == 0) && (count($aEmailAddresses) == 0)) { | 232 | if ((count($aGroupIDs) == 0) && (count($aUserIDs) == 0) && (count($aEmailAddresses) == 0)) { |
| 233 | - $this->errorRedirectToMain('No recipients set', sprintf('fDocumentId=%d', $this->oDocument->getId())); | 233 | + $this->errorRedirectToMain(_('No recipients set'), sprintf('fDocumentId=%d', $this->oDocument->getId())); |
| 234 | exit(0); | 234 | exit(0); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| @@ -247,7 +247,7 @@ class KTDocumentEmailAction extends KTDocumentAction { | @@ -247,7 +247,7 @@ class KTDocumentEmailAction extends KTDocumentAction { | ||
| 247 | $_SESSION['KTErrorMessage'][] = join("<br />\n", $aEmailErrors); | 247 | $_SESSION['KTErrorMessage'][] = join("<br />\n", $aEmailErrors); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | - $_SESSION['KTInfoMessage'][] = "Email sent"; | 250 | + $_SESSION['KTInfoMessage'][] = _("Email sent"); |
| 251 | //go back to the document view page | 251 | //go back to the document view page |
| 252 | controllerRedirect("viewDocument", sprintf("fDocumentId=%d", $this->oDocument->getId())); | 252 | controllerRedirect("viewDocument", sprintf("fDocumentId=%d", $this->oDocument->getId())); |
| 253 | } | 253 | } |
plugins/ktstandard/KTSubscriptions.php
| @@ -23,7 +23,7 @@ $oPlugin =& $oPluginRegistry->getPlugin('ktstandard.subscriptions.plugin'); | @@ -23,7 +23,7 @@ $oPlugin =& $oPluginRegistry->getPlugin('ktstandard.subscriptions.plugin'); | ||
| 23 | // {{{ KTSubscriptionPortlet | 23 | // {{{ KTSubscriptionPortlet |
| 24 | class KTSubscriptionPortlet extends KTPortlet { | 24 | class KTSubscriptionPortlet extends KTPortlet { |
| 25 | function KTSubscriptionPortlet() { | 25 | function KTSubscriptionPortlet() { |
| 26 | - parent::KTPortlet("Subscriptions"); | 26 | + parent::KTPortlet(_("Subscriptions")); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | function render() { | 29 | function render() { |
| @@ -58,7 +58,7 @@ class KTSubscriptionPortlet extends KTPortlet { | @@ -58,7 +58,7 @@ class KTSubscriptionPortlet extends KTPortlet { | ||
| 58 | } | 58 | } |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | - $this->actions[] = array("name" => "Manage subscriptions", "url" => $this->oPlugin->getPagePath('manage')); | 61 | + $this->actions[] = array("name" => _("Manage subscriptions"), "url" => $this->oPlugin->getPagePath('manage')); |
| 62 | 62 | ||
| 63 | $oTemplating = new KTTemplating; | 63 | $oTemplating = new KTTemplating; |
| 64 | $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet"); | 64 | $oTemplate = $oTemplating->loadTemplate("kt3/portlets/actions_portlet"); |
| @@ -85,14 +85,14 @@ class KTDocumentSubscriptionAction extends KTDocumentAction { | @@ -85,14 +85,14 @@ class KTDocumentSubscriptionAction extends KTDocumentAction { | ||
| 85 | function do_main() { | 85 | function do_main() { |
| 86 | $iSubscriptionType = SubscriptionConstants::subscriptionType("DocumentSubscription"); | 86 | $iSubscriptionType = SubscriptionConstants::subscriptionType("DocumentSubscription"); |
| 87 | if (Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) { | 87 | if (Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) { |
| 88 | - $_SESSION['KTErrorMessage'][] = "You are already subscribed to that document"; | 88 | + $_SESSION['KTErrorMessage'][] = _("You are already subscribed to that document"); |
| 89 | } else { | 89 | } else { |
| 90 | $oSubscription = new Subscription($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType); | 90 | $oSubscription = new Subscription($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType); |
| 91 | $res = $oSubscription->create(); | 91 | $res = $oSubscription->create(); |
| 92 | if ($res) { | 92 | if ($res) { |
| 93 | - $_SESSION['KTInfoMessage'][] = "You have been subscribed to this document"; | 93 | + $_SESSION['KTInfoMessage'][] = _("You have been subscribed to this document"); |
| 94 | } else { | 94 | } else { |
| 95 | - $_SESSION['KTErrorMessage'][] = "There was a problem subscribing you to this document"; | 95 | + $_SESSION['KTErrorMessage'][] = _("There was a problem subscribing you to this document"); |
| 96 | } | 96 | } |
| 97 | } | 97 | } |
| 98 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 98 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| @@ -116,14 +116,14 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction { | @@ -116,14 +116,14 @@ class KTDocumentUnsubscriptionAction extends KTDocumentAction { | ||
| 116 | function do_main() { | 116 | function do_main() { |
| 117 | $iSubscriptionType = SubscriptionConstants::subscriptionType("DocumentSubscription"); | 117 | $iSubscriptionType = SubscriptionConstants::subscriptionType("DocumentSubscription"); |
| 118 | if (!Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) { | 118 | if (!Subscription::exists($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType)) { |
| 119 | - $_SESSION['KTErrorMessage'][] = "You were not subscribed to that document"; | 119 | + $_SESSION['KTErrorMessage'][] = _("You were not subscribed to that document"); |
| 120 | } else { | 120 | } else { |
| 121 | $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType); | 121 | $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oDocument->getId(), $iSubscriptionType); |
| 122 | $res = $oSubscription->delete(); | 122 | $res = $oSubscription->delete(); |
| 123 | if ($res) { | 123 | if ($res) { |
| 124 | - $_SESSION['KTInfoMessage'][] = "You have been unsubscribed from this document"; | 124 | + $_SESSION['KTInfoMessage'][] = _("You have been unsubscribed from this document"); |
| 125 | } else { | 125 | } else { |
| 126 | - $_SESSION['KTErrorMessage'][] = "There was a problem unsubscribing you from this document"; | 126 | + $_SESSION['KTErrorMessage'][] = _("There was a problem unsubscribing you from this document"); |
| 127 | } | 127 | } |
| 128 | } | 128 | } |
| 129 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); | 129 | controllerRedirect('viewDocument', 'fDocumentId=' . $this->oDocument->getId()); |
| @@ -267,14 +267,14 @@ class KTFolderSubscriptionAction extends KTFolderAction { | @@ -267,14 +267,14 @@ class KTFolderSubscriptionAction extends KTFolderAction { | ||
| 267 | function do_main() { | 267 | function do_main() { |
| 268 | $iSubscriptionType = SubscriptionConstants::subscriptionType("FolderSubscription"); | 268 | $iSubscriptionType = SubscriptionConstants::subscriptionType("FolderSubscription"); |
| 269 | if (Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) { | 269 | if (Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) { |
| 270 | - $_SESSION['KTErrorMessage'][] = "You are already subscribed to that document"; | 270 | + $_SESSION['KTErrorMessage'][] = _("You are already subscribed to that document"); |
| 271 | } else { | 271 | } else { |
| 272 | $oSubscription = new Subscription($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType); | 272 | $oSubscription = new Subscription($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType); |
| 273 | $res = $oSubscription->create(); | 273 | $res = $oSubscription->create(); |
| 274 | if ($res) { | 274 | if ($res) { |
| 275 | - $_SESSION['KTInfoMessage'][] = "You have been subscribed to this document"; | 275 | + $_SESSION['KTInfoMessage'][] = _("You have been subscribed to this document"); |
| 276 | } else { | 276 | } else { |
| 277 | - $_SESSION['KTErrorMessage'][] = "There was a problem subscribing you to this document"; | 277 | + $_SESSION['KTErrorMessage'][] = _("There was a problem subscribing you to this document"); |
| 278 | } | 278 | } |
| 279 | } | 279 | } |
| 280 | controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId()); | 280 | controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId()); |
| @@ -299,14 +299,14 @@ class KTFolderUnsubscriptionAction extends KTFolderAction { | @@ -299,14 +299,14 @@ class KTFolderUnsubscriptionAction extends KTFolderAction { | ||
| 299 | function do_main() { | 299 | function do_main() { |
| 300 | $iSubscriptionType = SubscriptionConstants::subscriptionType("FolderSubscription"); | 300 | $iSubscriptionType = SubscriptionConstants::subscriptionType("FolderSubscription"); |
| 301 | if (!Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) { | 301 | if (!Subscription::exists($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType)) { |
| 302 | - $_SESSION['KTErrorMessage'][] = "You were not subscribed to that folder"; | 302 | + $_SESSION['KTErrorMessage'][] = _("You were not subscribed to that folder"); |
| 303 | } else { | 303 | } else { |
| 304 | $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType); | 304 | $oSubscription = & Subscription::getByIDs($this->oUser->getId(), $this->oFolder->getId(), $iSubscriptionType); |
| 305 | $res = $oSubscription->delete(); | 305 | $res = $oSubscription->delete(); |
| 306 | if ($res) { | 306 | if ($res) { |
| 307 | - $_SESSION['KTInfoMessage'][] = "You have been unsubscribed from this folder"; | 307 | + $_SESSION['KTInfoMessage'][] = _("You have been unsubscribed from this folder"); |
| 308 | } else { | 308 | } else { |
| 309 | - $_SESSION['KTErrorMessage'][] = "There was a problem unsubscribing you from this folder"; | 309 | + $_SESSION['KTErrorMessage'][] = _("There was a problem unsubscribing you from this folder"); |
| 310 | } | 310 | } |
| 311 | } | 311 | } |
| 312 | controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId()); | 312 | controllerRedirect('browse', 'fFolderId=' . $this->oFolder->getId()); |
| @@ -319,7 +319,7 @@ $oPlugin->registerAction('foldersubscriptionaction', 'KTFolderUnsubscriptionActi | @@ -319,7 +319,7 @@ $oPlugin->registerAction('foldersubscriptionaction', 'KTFolderUnsubscriptionActi | ||
| 319 | // {{{ KTSubscriptionManagePage | 319 | // {{{ KTSubscriptionManagePage |
| 320 | class KTSubscriptionManagePage extends KTStandardDispatcher { | 320 | class KTSubscriptionManagePage extends KTStandardDispatcher { |
| 321 | function do_main() { | 321 | function do_main() { |
| 322 | - $this->aBreadcrumbs[] = array("name" => "Subscription Management"); | 322 | + $this->aBreadcrumbs[] = array("name" => _("Subscription Management")); |
| 323 | $aFolderSubscriptions = SubscriptionManager::retrieveUserSubscriptions( | 323 | $aFolderSubscriptions = SubscriptionManager::retrieveUserSubscriptions( |
| 324 | $this->oUser->getId(), SubscriptionConstants::subscriptionType("FolderSubscription")); | 324 | $this->oUser->getId(), SubscriptionConstants::subscriptionType("FolderSubscription")); |
| 325 | $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions( | 325 | $aDocumentSubscriptions = SubscriptionManager::retrieveUserSubscriptions( |
| @@ -340,7 +340,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher { | @@ -340,7 +340,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher { | ||
| 340 | $foldersubscriptions = KTUtil::arrayGet($_REQUEST, 'foldersubscriptions'); | 340 | $foldersubscriptions = KTUtil::arrayGet($_REQUEST, 'foldersubscriptions'); |
| 341 | $documentsubscriptions = KTUtil::arrayGet($_REQUEST, 'documentsubscriptions'); | 341 | $documentsubscriptions = KTUtil::arrayGet($_REQUEST, 'documentsubscriptions'); |
| 342 | if (empty($foldersubscriptions) && empty($documentsubscriptions)) { | 342 | if (empty($foldersubscriptions) && empty($documentsubscriptions)) { |
| 343 | - $this->errorRedirectToMain('No subscriptions were chosen'); | 343 | + $this->errorRedirectToMain(_('No subscriptions were chosen')); |
| 344 | } | 344 | } |
| 345 | 345 | ||
| 346 | $iSuccesses = 0; | 346 | $iSuccesses = 0; |
| @@ -370,7 +370,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher { | @@ -370,7 +370,7 @@ class KTSubscriptionManagePage extends KTStandardDispatcher { | ||
| 370 | } | 370 | } |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | - $sMessage = "Subscriptions removed: "; | 373 | + $sMessage = _("Subscriptions removed") . ": "; |
| 374 | if ($iFailures) { | 374 | if ($iFailures) { |
| 375 | $sMessage .= sprintf(_('%d successful, %d failures'), $iSuccesses, $iFailures); | 375 | $sMessage .= sprintf(_('%d successful, %d failures'), $iSuccesses, $iFailures); |
| 376 | } else { | 376 | } else { |
plugins/ktstandard/ldap/ldapauthenticationprovider.inc.php
| @@ -8,14 +8,17 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -8,14 +8,17 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 8 | var $sName = "LDAP authentication provider"; | 8 | var $sName = "LDAP authentication provider"; |
| 9 | var $sNamespace = "ktstandard.authentication.ldapprovider"; | 9 | var $sNamespace = "ktstandard.authentication.ldapprovider"; |
| 10 | 10 | ||
| 11 | - var $aConfigMap = array( | ||
| 12 | - 'servername' => 'LDAP Server', | ||
| 13 | - 'basedn' => 'Base DN', | ||
| 14 | - 'servertype' => 'LDAP Server Type', | ||
| 15 | - 'domain' => 'LDAP Server Domain', | ||
| 16 | - 'searchuser' => 'LDAP Search User', | ||
| 17 | - 'searchpassword' => 'LDAP Search Password', | ||
| 18 | - ); | 11 | + function KTLDAPAuthenticationProvider() { |
| 12 | + $this->aConfigMap = array( | ||
| 13 | + 'servername' => _('LDAP Server'), | ||
| 14 | + 'basedn' => _('Base DN'), | ||
| 15 | + 'servertype' => _('LDAP Server Type'), | ||
| 16 | + 'domain' => _('LDAP Server Domain'), | ||
| 17 | + 'searchuser' => _('LDAP Search User'), | ||
| 18 | + 'searchpassword' => _('LDAP Search Password'), | ||
| 19 | + ); | ||
| 20 | + return parent::KTAuthenticationProvider(); | ||
| 21 | + } | ||
| 19 | 22 | ||
| 20 | function saveConfig(&$oSource, $aRequest) { | 23 | function saveConfig(&$oSource, $aRequest) { |
| 21 | return true; | 24 | return true; |
| @@ -33,7 +36,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -33,7 +36,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 33 | $sRet = "<dl>\n"; | 36 | $sRet = "<dl>\n"; |
| 34 | foreach ($this->aConfigMap as $sSettingName => $sName) { | 37 | foreach ($this->aConfigMap as $sSettingName => $sName) { |
| 35 | $sRet .= " <dt>$sName</dt>\n"; | 38 | $sRet .= " <dt>$sName</dt>\n"; |
| 36 | - $sValue = KTUtil::arrayGet($aConfig, $sSettingName, "Unset"); | 39 | + $sValue = KTUtil::arrayGet($aConfig, $sSettingName, _("Unset")); |
| 37 | $sRet .= " <dd>" . $sValue . "</dd>\n"; | 40 | $sRet .= " <dd>" . $sValue . "</dd>\n"; |
| 38 | } | 41 | } |
| 39 | $sRet .= "</dl>\n"; | 42 | $sRet .= "</dl>\n"; |
| @@ -41,7 +44,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -41,7 +44,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 41 | } | 44 | } |
| 42 | 45 | ||
| 43 | function showUserSource($oUser, $oSource) { | 46 | function showUserSource($oUser, $oSource) { |
| 44 | - return '<a href="?action=editUserSource&user_id=' . $oUser->getId() .'">Edit LDAP info</a>'; | 47 | + return '<a href="?action=editUserSource&user_id=' . $oUser->getId() .'">' . _('Edit LDAP info') . '</a>'; |
| 45 | } | 48 | } |
| 46 | 49 | ||
| 47 | function do_editUserSource() { | 50 | function do_editUserSource() { |
| @@ -53,7 +56,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -53,7 +56,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 53 | $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); | 56 | $user_id = KTUtil::arrayGet($_REQUEST, 'user_id'); |
| 54 | $oUser =& $this->oValidator->validateUser($user_id); | 57 | $oUser =& $this->oValidator->validateUser($user_id); |
| 55 | 58 | ||
| 56 | - $this->oPage->setBreadcrumbDetails("editing LDAP details"); | 59 | + $this->oPage->setBreadcrumbDetails(_("editing LDAP details")); |
| 57 | $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapedituser'); | 60 | $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapedituser'); |
| 58 | 61 | ||
| 59 | $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser); | 62 | $oAuthenticationSource = KTAuthenticationSource::getForUser($oUser); |
| @@ -62,7 +65,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -62,7 +65,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 62 | $dn = KTUtil::arrayGet($aDetails, 'dn', ""); | 65 | $dn = KTUtil::arrayGet($aDetails, 'dn', ""); |
| 63 | 66 | ||
| 64 | $fields = array(); | 67 | $fields = array(); |
| 65 | - $fields[] = new KTStringWidget('Distinguished name', 'The location of this user in the LDAP tree', 'dn', $dn, $this->oPage, true); | 68 | + $fields[] = new KTStringWidget(_('Distinguished name'), _('The location of this user in the LDAP tree'), 'dn', $dn, $this->oPage, true); |
| 66 | 69 | ||
| 67 | $aTemplateData = array( | 70 | $aTemplateData = array( |
| 68 | 'context' => &$this, | 71 | 'context' => &$this, |
| @@ -79,24 +82,24 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -79,24 +82,24 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 79 | $aDetails['dn'] = KTUtil::arrayGet($_REQUEST, 'dn', ""); | 82 | $aDetails['dn'] = KTUtil::arrayGet($_REQUEST, 'dn', ""); |
| 80 | $oUser->setAuthenticationDetails(serialize($aDetails)); | 83 | $oUser->setAuthenticationDetails(serialize($aDetails)); |
| 81 | $oUser->update(); | 84 | $oUser->update(); |
| 82 | - $this->successRedirectTo("editUser", "Details updated", | 85 | + $this->successRedirectTo("editUser", _("Details updated"), |
| 83 | sprintf('user_id=%d', $oUser->getId())); | 86 | sprintf('user_id=%d', $oUser->getId())); |
| 84 | } | 87 | } |
| 85 | 88 | ||
| 86 | function do_editSourceProvider() { | 89 | function do_editSourceProvider() { |
| 87 | require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php'); | 90 | require_once(KT_LIB_DIR . '/widgets/fieldWidgets.php'); |
| 88 | - $this->oPage->setBreadcrumbDetails("editing LDAP settings"); | 91 | + $this->oPage->setBreadcrumbDetails(_("editing LDAP settings")); |
| 89 | $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapeditsource'); | 92 | $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapeditsource'); |
| 90 | $iSourceId = KTUtil::arrayGet($_REQUEST, 'source_id'); | 93 | $iSourceId = KTUtil::arrayGet($_REQUEST, 'source_id'); |
| 91 | $oSource = KTAuthenticationSource::get($iSourceId); | 94 | $oSource = KTAuthenticationSource::get($iSourceId); |
| 92 | $aConfig = unserialize($oSource->getConfig()); | 95 | $aConfig = unserialize($oSource->getConfig()); |
| 93 | $fields = array(); | 96 | $fields = array(); |
| 94 | - $fields[] = new KTStringWidget('Server name', 'The host name or IP address of the LDAP server', 'servername', $aConfig['servername'], $this->oPage, true); | ||
| 95 | - $fields[] = new KTStringWidget('Base DN', 'FIXME', 'basedn', $aConfig['basedn'], $this->oPage, true); | ||
| 96 | - $fields[] = new KTStringWidget('Server Type', 'FIXME', 'servertype', $aConfig['servertype'], $this->oPage, true); | ||
| 97 | - $fields[] = new KTStringWidget('Domain', 'FIXME', 'domain', $aConfig['domain'], $this->oPage, true); | ||
| 98 | - $fields[] = new KTStringWidget('Search User', 'FIXME', 'searchuser', $aConfig['searchuser'], $this->oPage, true); | ||
| 99 | - $fields[] = new KTStringWidget('Search Password', 'FIXME', 'searchpassword', $aConfig['searchpassword'], $this->oPage, true); | 97 | + $fields[] = new KTStringWidget(_('Server name'), 'The host name or IP address of the LDAP server', 'servername', $aConfig['servername'], $this->oPage, true); |
| 98 | + $fields[] = new KTStringWidget(_('Base DN'), 'FIXME', 'basedn', $aConfig['basedn'], $this->oPage, true); | ||
| 99 | + $fields[] = new KTStringWidget(_('Server Type'), 'FIXME', 'servertype', $aConfig['servertype'], $this->oPage, true); | ||
| 100 | + $fields[] = new KTStringWidget(_('Domain'), 'FIXME', 'domain', $aConfig['domain'], $this->oPage, true); | ||
| 101 | + $fields[] = new KTStringWidget(_('Search User'), 'FIXME', 'searchuser', $aConfig['searchuser'], $this->oPage, true); | ||
| 102 | + $fields[] = new KTStringWidget(_('Search Password'), 'FIXME', 'searchpassword', $aConfig['searchpassword'], $this->oPage, true); | ||
| 100 | $aTemplateData = array( | 103 | $aTemplateData = array( |
| 101 | 'context' => &$this, | 104 | 'context' => &$this, |
| 102 | 'fields' => $fields, | 105 | 'fields' => $fields, |
| @@ -117,7 +120,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -117,7 +120,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 117 | } | 120 | } |
| 118 | $oSource->setConfig(serialize($aConfig)); | 121 | $oSource->setConfig(serialize($aConfig)); |
| 119 | $oSource->update(); | 122 | $oSource->update(); |
| 120 | - $this->successRedirectTo('viewsource', "Configuration updated", 'source_id=' . $oSource->getId()); | 123 | + $this->successRedirectTo('viewsource', _("Configuration updated"), 'source_id=' . $oSource->getId()); |
| 121 | } | 124 | } |
| 122 | 125 | ||
| 123 | function &getAuthenticator($oSource) { | 126 | function &getAuthenticator($oSource) { |
| @@ -141,13 +144,13 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -141,13 +144,13 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 141 | $aResults = $aResults[$id]; | 144 | $aResults = $aResults[$id]; |
| 142 | 145 | ||
| 143 | $fields = array(); | 146 | $fields = array(); |
| 144 | - $fields[] = new KTStaticTextWidget('LDAP DN','The location of the user within the LDAP directory.', 'dn', $aResults[$aAttributes[0]], $this->oPage); | ||
| 145 | - $fields[] = new KTStringWidget('Username','The username the user will enter to gain access to the KnowledgeTree. e.g. <strong>jsmith</strong>', 'ldap_username', $aResults[$aAttributes[1]], $this->oPage, true); | ||
| 146 | - $fields[] = new KTStringWidget('Name','The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>', 'name', join(" ", array($aResults[$aAttributes[2]], $aResults[$aAttributes[3]])), $this->oPage, true); | ||
| 147 | - $fields[] = new KTStringWidget('Email Address','The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>', 'email_address', $aResults[$aAttributes[4]], $this->oPage, false); | ||
| 148 | - $fields[] = new KTCheckboxWidget('Email Notifications','If this is specified then the user will have notifications sent to the email address entered above. If it isn\'t set, then the user will only see notifications on the <strong>Dashboard</strong>', 'email_notifications', true, $this->oPage, false); | ||
| 149 | - $fields[] = new KTStringWidget('Mobile Number','The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will be SMS\'d with notifications. e.g. <strong>999 9999 999</strong>', 'mobile_number', $aResults[$aAttributes[5]], $this->oPage, false); | ||
| 150 | - $fields[] = new KTStringWidget('Maximum Sessions','As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.', 'max_sessions', '3', $this->oPage, true); | 147 | + $fields[] = new KTStaticTextWidget(_('LDAP DN'), _('The location of the user within the LDAP directory.'), 'dn', $aResults[$aAttributes[0]], $this->oPage); |
| 148 | + $fields[] = new KTStringWidget(_('Username'), _('The username the user will enter to gain access to the KnowledgeTree. e.g. <strong>jsmith</strong>'), 'ldap_username', $aResults[$aAttributes[1]], $this->oPage, true); | ||
| 149 | + $fields[] = new KTStringWidget(_('Name'), _('The full name of the user. This is shown in reports and listings. e.g. <strong>John Smith</strong>'), 'name', join(" ", array($aResults[$aAttributes[2]], $aResults[$aAttributes[3]])), $this->oPage, true); | ||
| 150 | + $fields[] = new KTStringWidget(_('Email Address'), _('The email address of the user. Notifications and alerts are mailed to this address if <strong>email notifications</strong> is set below. e.g. <strong>jsmith@acme.com</strong>'), 'email_address', $aResults[$aAttributes[4]], $this->oPage, false); | ||
| 151 | + $fields[] = new KTCheckboxWidget(_('Email Notifications'), _('If this is specified then the user will have notifications sent to the email address entered above. If it is not set, then the user will only see notifications on the <strong>Dashboard</strong>'), 'email_notifications', true, $this->oPage, false); | ||
| 152 | + $fields[] = new KTStringWidget(_('Mobile Number'), _('The mobile phone number of the user. If the system is configured to send notifications to cellphones, then this number will have an SMS delivered to it with notifications. e.g. <strong>999 9999 999</strong>'), 'mobile_number', $aResults[$aAttributes[5]], $this->oPage, false); | ||
| 153 | + $fields[] = new KTStringWidget(_('Maximum Sessions'), _('As a safety precaution, it is useful to limit the number of times a given account can log in, before logging out. This prevents a single account being used by many different people.'), 'max_sessions', '3', $this->oPage, true); | ||
| 151 | 154 | ||
| 152 | $aTemplateData = array( | 155 | $aTemplateData = array( |
| 153 | 'context' => &$this, | 156 | 'context' => &$this, |
| @@ -163,9 +166,9 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -163,9 +166,9 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 163 | $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); | 166 | $oSource =& KTAuthenticationSource::get($_REQUEST['source_id']); |
| 164 | $dn = KTUtil::arrayGet($_REQUEST, 'dn'); | 167 | $dn = KTUtil::arrayGet($_REQUEST, 'dn'); |
| 165 | $name = KTUtil::arrayGet($_REQUEST, 'name'); | 168 | $name = KTUtil::arrayGet($_REQUEST, 'name'); |
| 166 | - if (empty($name)) { $this->errorRedirectToMain('You must specify a name for the user.'); } | 169 | + if (empty($name)) { $this->errorRedirectToMain(_('You must specify a name for the user.')); } |
| 167 | $username = KTUtil::arrayGet($_REQUEST, 'ldap_username'); | 170 | $username = KTUtil::arrayGet($_REQUEST, 'ldap_username'); |
| 168 | - if (empty($name)) { $this->errorRedirectToMain('You must specify a new username..'); } | 171 | + if (empty($name)) { $this->errorRedirectToMain(_('You must specify a new username.')); } |
| 169 | // FIXME check for non-clashing usernames. | 172 | // FIXME check for non-clashing usernames. |
| 170 | 173 | ||
| 171 | $email_address = KTUtil::arrayGet($_REQUEST, 'email_address'); | 174 | $email_address = KTUtil::arrayGet($_REQUEST, 'email_address'); |
| @@ -188,11 +191,11 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -188,11 +191,11 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 188 | )); | 191 | )); |
| 189 | 192 | ||
| 190 | if (PEAR::isError($oUser) || ($oUser == false)) { | 193 | if (PEAR::isError($oUser) || ($oUser == false)) { |
| 191 | - $this->errorRedirectToMain("failed to create user."); | 194 | + $this->errorRedirectToMain(_("failed to create user.")); |
| 192 | exit(0); | 195 | exit(0); |
| 193 | } | 196 | } |
| 194 | 197 | ||
| 195 | - $this->successRedirectToMain('Created new user "' . $oUser->getUsername() . '"'); | 198 | + $this->successRedirectToMain(_('Created new user') . ': ' . $oUser->getUsername()); |
| 196 | exit(0); | 199 | exit(0); |
| 197 | } | 200 | } |
| 198 | 201 | ||
| @@ -206,7 +209,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -206,7 +209,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 206 | if (!empty($id)) { | 209 | if (!empty($id)) { |
| 207 | return $this->_do_editUserFromSource(); | 210 | return $this->_do_editUserFromSource(); |
| 208 | } else { | 211 | } else { |
| 209 | - $this->oPage->addError("No valid LDAP user chosen"); | 212 | + $this->oPage->addError(_("No valid LDAP user chosen")); |
| 210 | } | 213 | } |
| 211 | } | 214 | } |
| 212 | if (KTUtil::arrayGet($submit, 'create')) { | 215 | if (KTUtil::arrayGet($submit, 'create')) { |
| @@ -216,7 +219,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | @@ -216,7 +219,7 @@ class KTLDAPAuthenticationProvider extends KTAuthenticationProvider { | ||
| 216 | $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchuser'); | 219 | $oTemplate = $this->oValidator->validateTemplate('ktstandard/authentication/ldapsearchuser'); |
| 217 | 220 | ||
| 218 | $fields = array(); | 221 | $fields = array(); |
| 219 | - $fields[] = new KTStringWidget('User\'s name', 'The user\'s name, or part thereof, to find the user that you wish to add', 'name', '', $this->oPage, true); | 222 | + $fields[] = new KTStringWidget(_("User's name"), _("The user's name, or part thereof, to find the user that you wish to add"), 'name', '', $this->oPage, true); |
| 220 | 223 | ||
| 221 | $oAuthenticator = $this->getAuthenticator($oSource); | 224 | $oAuthenticator = $this->getAuthenticator($oSource); |
| 222 | $sIdentifierField = $oAuthenticator->oLdap->getUserIdentifier(); | 225 | $sIdentifierField = $oAuthenticator->oLdap->getUserIdentifier(); |