Commit 5be4c4e1101648e7198b36d975830f7852a3bef2

Authored by rob
1 parent 054219d2

Added i18n


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2756 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/browse/Browser.inc
... ... @@ -58,19 +58,20 @@ class Browser {
58 58 */
59 59 function Browser($sNewSortField, $sNewSortDirection, $aNewSortCriteria = array()) {
60 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 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 66 "lookup" => array ("table" => "users",
66 67 "field" => "name")),
67 68  
68   - "id" => array ("display" => "Date Created",
  69 + "id" => array ("display" => $browse_folder_sort_date_created,
69 70 "lookup" => array("table" => "document_transactions",
70 71 "field" => "datetime",
71 72 "joinColumn" => "document_id",
72 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 75 "lookup" => array ("table" => "document_types_lookup",
75 76 "field" => "name")) );
76 77 }
... ...
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php
... ... @@ -71,8 +71,7 @@ if (checkSession()) {
71 71 $sectionName = $oBrowser->getSectionName();
72 72  
73 73 // instantiate my content pattern
74   - $oContent = new PatternCustom();
75   -
  74 + $oContent = new PatternCustom();
76 75 $aResults = $oBrowser->browse();
77 76 if (($fBrowseType == "folder") && (!isset($fFolderID))) {
78 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 37 * @param string the selected browse by option
38 38 */
39 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 41 // TODO: write function for onChange that checks if the new value
41 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 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 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 51 // <category browse helper methods>
... ... @@ -54,7 +55,7 @@ function renderBrowseTypeSelect($sBrowseType) {
54 55 *
55 56 * @param string the category name to display
56 57 */
57   -function displayCategoryPathLink($aCategories) {
  58 +function displayCategoryPathLink($aCategories) {
58 59 // if the first value in arr["categories"] == Categories then we've got a list of categories
59 60 if ($aCategories[0] == "Categories") {
60 61 return displayCategoryLink($aCategories[0]);
... ... @@ -86,10 +87,11 @@ function displayCategoryLink($sCategoryName) {
86 87 *
87 88 * @param array the category browse results
88 89 */
89   -function renderCategoryResults($aResults) {
  90 +function renderCategoryResults($aResults) {
90 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 95 if ($aResults["categories"][0] == "Categories") {
94 96 // loop through categories and display them
95 97 for ($i=1; $i<count($aResults["categories"]); $i++) {
... ... @@ -191,7 +193,7 @@ function renderDocumentTypeResults($aResults) {
191 193 * @param array the browse result objects
192 194 */
193 195 function renderFolderResults($aResults) {
194   - global $default;
  196 + global $default, $browse_no_sub_folders, $browse_no_documents, $browse_no_document_permission;
195 197 $sToRender = "";
196 198  
197 199 // now loop through the rest of the folders and display links
... ... @@ -215,10 +217,10 @@ function renderFolderResults($aResults) {
215 217 $sToRender .= "</tr>\n";
216 218 }
217 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 225 return $sToRender;
224 226 }
... ... @@ -313,12 +315,12 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa
313 315 * @param string the direction to sort
314 316 */
315 317 function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) {
316   - global $default;
  318 + global $default, $browse_collection_heading;
317 319  
318 320 $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
319 321 $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td");
320 322  
321   - $sToRender = renderHeading("Browse Collection");
  323 + $sToRender = renderHeading($browse_collection_heading);
322 324  
323 325 $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">";
324 326 switch ($sBrowseType) {
... ...