From d82bfbb24da68aae078927c9b53646995de81d70 Mon Sep 17 00:00:00 2001
From: fantu <fantu@ispconfig3>
Date: Thu, 11 Dec 2008 12:05:48 +0000
Subject: [PATCH] Multilanguage improve also in "searchform-system"

---
 .../lib/classes/searchform_actions.inc.php    |  4 ++
 .../classes/searchform_tpl_generator.inc.php  | 38 -------------------
 2 files changed, 4 insertions(+), 38 deletions(-)

diff --git a/interface/lib/classes/searchform_actions.inc.php b/interface/lib/classes/searchform_actions.inc.php
index edba2b9f6..a451f4a85 100644
--- a/interface/lib/classes/searchform_actions.inc.php
+++ b/interface/lib/classes/searchform_actions.inc.php
@@ -151,7 +151,11 @@ class searchform_actions {
 		global $app;
 		
 		// Language File setzen
+		$lng_file = ISPC_WEB_PATH.'/lang/lib/lang/'.$_SESSION['s']['language'].'_list.lng';
+		if(!file_exists($lng_file)) $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/en_'.'_list.lng';
+		include($lng_file);
 		$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$app->searchform->listDef['name']."_search.lng";
+		if(!file_exists($lng_file)) $lng_file = 'lib/lang/en_'.$app->searchform->listDef['name']."_search.lng";
 		include($lng_file);
 		$app->tpl->setVar($wb);
 		$app->tpl->setVar("form_action",$app->searchform->listDef["file"]);
diff --git a/interface/lib/classes/searchform_tpl_generator.inc.php b/interface/lib/classes/searchform_tpl_generator.inc.php
index 77e1aa8e2..30b048048 100644
--- a/interface/lib/classes/searchform_tpl_generator.inc.php
+++ b/interface/lib/classes/searchform_tpl_generator.inc.php
@@ -129,46 +129,8 @@ Suche speichern unter: <input type="text" name="search_save_as" /> <input type="
 		}
 		fclose($handle);
 		
-		$lang["page_txt"] = 'Page';
-		$lang["page_of_txt"] = 'of';
-		$lang["page_next_txt"] = 'Next';
-		$lang["page_back_txt"] = 'Back';
-		$lang["delete_txt"] = 'Delete';
-		$lang["filter_txt"] = 'Filter';
-		
-		// speichere language Datei
-		$this->lng_add($lang,$listDef,$module);
     }
 	
-	function lng_add($lang,$listDef,$module = '') {
-		global $go_api, $go_info,$conf;
-		
-		if($module == '') {
-			$lng_file = "lib/lang/".$conf["language"]."_".$listDef['name']."_search.lng";
-		} else {
-			$lng_file = '../'.$module."/lib/lang/en_".$listDef['name']."_search.lng";
-		}
-		
-		if(is_file($lng_file)) {
-			include_once($lng_file);
-		} else {
-			$wb = array();
-		}
-		
-		$wb_out = array_merge($wb,$lang);
-		
-		if(is_array($wb_out)) {
-			$fp = fopen ($lng_file, "w");
-			fwrite($fp,"<?php\r\n");
-			foreach($wb_out as $key => $val) {
-				$new_line = '$wb["'.$key.'"] = '."'$val';\r\n";
-				fwrite($fp,$new_line);
-				
-			}
-			fwrite($fp,"?>");
-			fclose($fp);
-		}
-	}
 }
 
 ?>
\ No newline at end of file
-- 
GitLab