Commit 5be4c4e1101648e7198b36d975830f7852a3bef2
1 parent
054219d2
Added i18n
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2756 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
21 additions
and
19 deletions
lib/browse/Browser.inc
| @@ -58,19 +58,20 @@ class Browser { | @@ -58,19 +58,20 @@ class Browser { | ||
| 58 | */ | 58 | */ |
| 59 | function Browser($sNewSortField, $sNewSortDirection, $aNewSortCriteria = array()) { | 59 | function Browser($sNewSortField, $sNewSortDirection, $aNewSortCriteria = array()) { |
| 60 | // default sort criteria | 60 | // default sort criteria |
| 61 | + global $browse_folder_sort_title, $browse_folder_sort_description, $browse_folder_sort_creator, $browse_folder_sort_date_created, $browse_folder_sort_document_type; | ||
| 61 | if (count($aNewSortCriteria) == 0) { | 62 | if (count($aNewSortCriteria) == 0) { |
| 62 | - $aNewSortCriteria = array ( "name" => array ("display" => "Title"), | ||
| 63 | - "filename" => array ("display" => "Description"), | ||
| 64 | - "creator_id" => array ("display" => "Creator", | 63 | + $aNewSortCriteria = array ( "name" => array ("display" => $browse_folder_sort_title), |
| 64 | + "filename" => array ("display" => $browse_folder_sort_description), | ||
| 65 | + "creator_id" => array ("display" => $browse_folder_sort_creator, | ||
| 65 | "lookup" => array ("table" => "users", | 66 | "lookup" => array ("table" => "users", |
| 66 | "field" => "name")), | 67 | "field" => "name")), |
| 67 | 68 | ||
| 68 | - "id" => array ("display" => "Date Created", | 69 | + "id" => array ("display" => $browse_folder_sort_date_created, |
| 69 | "lookup" => array("table" => "document_transactions", | 70 | "lookup" => array("table" => "document_transactions", |
| 70 | "field" => "datetime", | 71 | "field" => "datetime", |
| 71 | "joinColumn" => "document_id", | 72 | "joinColumn" => "document_id", |
| 72 | "whereClause" => "transaction_id=1")), | 73 | "whereClause" => "transaction_id=1")), |
| 73 | - "document_type_id" => array ("display" => "Document Type", | 74 | + "document_type_id" => array ("display" => $browse_folder_sort_document_type, |
| 74 | "lookup" => array ("table" => "document_types_lookup", | 75 | "lookup" => array ("table" => "document_types_lookup", |
| 75 | "field" => "name")) ); | 76 | "field" => "name")) ); |
| 76 | } | 77 | } |
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php
| @@ -71,8 +71,7 @@ if (checkSession()) { | @@ -71,8 +71,7 @@ if (checkSession()) { | ||
| 71 | $sectionName = $oBrowser->getSectionName(); | 71 | $sectionName = $oBrowser->getSectionName(); |
| 72 | 72 | ||
| 73 | // instantiate my content pattern | 73 | // instantiate my content pattern |
| 74 | - $oContent = new PatternCustom(); | ||
| 75 | - | 74 | + $oContent = new PatternCustom(); |
| 76 | $aResults = $oBrowser->browse(); | 75 | $aResults = $oBrowser->browse(); |
| 77 | if (($fBrowseType == "folder") && (!isset($fFolderID))) { | 76 | if (($fBrowseType == "folder") && (!isset($fFolderID))) { |
| 78 | controllerRedirect("browse", "fFolderID=" . $aResults["folders"][0]->getID()); | 77 | controllerRedirect("browse", "fFolderID=" . $aResults["folders"][0]->getID()); |
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| @@ -37,14 +37,15 @@ require_once("$default->uiDirectory/foldermanagement/addFolderUI.inc"); | @@ -37,14 +37,15 @@ require_once("$default->uiDirectory/foldermanagement/addFolderUI.inc"); | ||
| 37 | * @param string the selected browse by option | 37 | * @param string the selected browse by option |
| 38 | */ | 38 | */ |
| 39 | function renderBrowseTypeSelect($sBrowseType) { | 39 | function renderBrowseTypeSelect($sBrowseType) { |
| 40 | + global $browse_view_documents_by_heading, $browse_view_documents_by_folder, $browse_view_documents_by_category, $browse_view_documents_by_doctype; | ||
| 40 | // TODO: write function for onChange that checks if the new value | 41 | // TODO: write function for onChange that checks if the new value |
| 41 | return "<span class=\"browseTypeSelect\">\n | 42 | return "<span class=\"browseTypeSelect\">\n |
| 42 | - \tView documents by: <input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"folder\"" . | ||
| 43 | - ((($sBrowseType=="folder") || (strlen($sBrowseType)==0)) ? " checked=\"checked\"" : "") . "/> Folders\n" . | 43 | + \t" . $browse_view_documents_by_heading . ": <input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"folder\"" . |
| 44 | + ((($sBrowseType=="folder") || (strlen($sBrowseType)==0)) ? " checked=\"checked\"" : "") . "/> " . $browse_view_documents_by_folder ."\n" . | ||
| 44 | "<input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"category\"" . | 45 | "<input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"category\"" . |
| 45 | - (($sBrowseType=="category") ? " checked=\"checked\"" : "") . "/> Category\n" . | 46 | + (($sBrowseType=="category") ? " checked=\"checked\"" : "") . "/> " . $browse_view_documents_by_category . "\n" . |
| 46 | "<input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"documentType\"" . | 47 | "<input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"documentType\"" . |
| 47 | - (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> Document Type\n</span>"; | 48 | + (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> " . $browse_view_documents_by_doctype . "\n</span>"; |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | // <category browse helper methods> | 51 | // <category browse helper methods> |
| @@ -54,7 +55,7 @@ function renderBrowseTypeSelect($sBrowseType) { | @@ -54,7 +55,7 @@ function renderBrowseTypeSelect($sBrowseType) { | ||
| 54 | * | 55 | * |
| 55 | * @param string the category name to display | 56 | * @param string the category name to display |
| 56 | */ | 57 | */ |
| 57 | -function displayCategoryPathLink($aCategories) { | 58 | +function displayCategoryPathLink($aCategories) { |
| 58 | // if the first value in arr["categories"] == Categories then we've got a list of categories | 59 | // if the first value in arr["categories"] == Categories then we've got a list of categories |
| 59 | if ($aCategories[0] == "Categories") { | 60 | if ($aCategories[0] == "Categories") { |
| 60 | return displayCategoryLink($aCategories[0]); | 61 | return displayCategoryLink($aCategories[0]); |
| @@ -86,10 +87,11 @@ function displayCategoryLink($sCategoryName) { | @@ -86,10 +87,11 @@ function displayCategoryLink($sCategoryName) { | ||
| 86 | * | 87 | * |
| 87 | * @param array the category browse results | 88 | * @param array the category browse results |
| 88 | */ | 89 | */ |
| 89 | -function renderCategoryResults($aResults) { | 90 | +function renderCategoryResults($aResults) { |
| 90 | $sToRender = ""; | 91 | $sToRender = ""; |
| 91 | 92 | ||
| 92 | - // if the first value in arr["categories"] == Categories then we've got a list of categories | 93 | + //var_dump($aResults["categories"][0]); |
| 94 | + // if the first value in arr["categories"] == Categories then we've got a list of categories | ||
| 93 | if ($aResults["categories"][0] == "Categories") { | 95 | if ($aResults["categories"][0] == "Categories") { |
| 94 | // loop through categories and display them | 96 | // loop through categories and display them |
| 95 | for ($i=1; $i<count($aResults["categories"]); $i++) { | 97 | for ($i=1; $i<count($aResults["categories"]); $i++) { |
| @@ -191,7 +193,7 @@ function renderDocumentTypeResults($aResults) { | @@ -191,7 +193,7 @@ function renderDocumentTypeResults($aResults) { | ||
| 191 | * @param array the browse result objects | 193 | * @param array the browse result objects |
| 192 | */ | 194 | */ |
| 193 | function renderFolderResults($aResults) { | 195 | function renderFolderResults($aResults) { |
| 194 | - global $default; | 196 | + global $default, $browse_no_sub_folders, $browse_no_documents, $browse_no_document_permission; |
| 195 | $sToRender = ""; | 197 | $sToRender = ""; |
| 196 | 198 | ||
| 197 | // now loop through the rest of the folders and display links | 199 | // now loop through the rest of the folders and display links |
| @@ -215,10 +217,10 @@ function renderFolderResults($aResults) { | @@ -215,10 +217,10 @@ function renderFolderResults($aResults) { | ||
| 215 | $sToRender .= "</tr>\n"; | 217 | $sToRender .= "</tr>\n"; |
| 216 | } | 218 | } |
| 217 | } else { | 219 | } else { |
| 218 | - $sToRender .= "<tr><td colspan=\"5\">This folder contains no sub folders</td></tr>"; | 220 | + $sToRender .= "<tr><td colspan=\"5\">" . $browse_no_sub_folders . "</td></tr>"; |
| 219 | } | 221 | } |
| 220 | 222 | ||
| 221 | - $sToRender .= "<tr><td>" . renderDocumentList($aResults, "This folder contains no documents", "You don't have access to the documents in this folder") . "</td></tr>\n"; | 223 | + $sToRender .= "<tr><td>" . renderDocumentList($aResults, $browse_no_documents, $browse_no_document_permission) . "</td></tr>\n"; |
| 222 | 224 | ||
| 223 | return $sToRender; | 225 | return $sToRender; |
| 224 | } | 226 | } |
| @@ -313,12 +315,12 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | @@ -313,12 +315,12 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | ||
| 313 | * @param string the direction to sort | 315 | * @param string the direction to sort |
| 314 | */ | 316 | */ |
| 315 | function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { | 317 | function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { |
| 316 | - global $default; | 318 | + global $default, $browse_collection_heading; |
| 317 | 319 | ||
| 318 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | 320 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); |
| 319 | $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); | 321 | $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); |
| 320 | 322 | ||
| 321 | - $sToRender = renderHeading("Browse Collection"); | 323 | + $sToRender = renderHeading($browse_collection_heading); |
| 322 | 324 | ||
| 323 | $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">"; | 325 | $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">"; |
| 324 | switch ($sBrowseType) { | 326 | switch ($sBrowseType) { |