Skip to content

Commit d82bfbb

Browse files
author
fantu
committed
Multilanguage improve also in "searchform-system"
1 parent 97b4729 commit d82bfbb

File tree

2 files changed

+4
-38
lines changed

2 files changed

+4
-38
lines changed

interface/lib/classes/searchform_actions.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ function onShow() {
151151
global $app;
152152

153153
// Language File setzen
154+
$lng_file = ISPC_WEB_PATH.'/lang/lib/lang/'.$_SESSION['s']['language'].'_list.lng';
155+
if(!file_exists($lng_file)) $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/en_'.'_list.lng';
156+
include($lng_file);
154157
$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$app->searchform->listDef['name']."_search.lng";
158+
if(!file_exists($lng_file)) $lng_file = 'lib/lang/en_'.$app->searchform->listDef['name']."_search.lng";
155159
include($lng_file);
156160
$app->tpl->setVar($wb);
157161
$app->tpl->setVar("form_action",$app->searchform->listDef["file"]);

interface/lib/classes/searchform_tpl_generator.inc.php

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -129,46 +129,8 @@ function buildHTML($listDef,$module = '') {
129129
}
130130
fclose($handle);
131131

132-
$lang["page_txt"] = 'Page';
133-
$lang["page_of_txt"] = 'of';
134-
$lang["page_next_txt"] = 'Next';
135-
$lang["page_back_txt"] = 'Back';
136-
$lang["delete_txt"] = 'Delete';
137-
$lang["filter_txt"] = 'Filter';
138-
139-
// speichere language Datei
140-
$this->lng_add($lang,$listDef,$module);
141132
}
142133

143-
function lng_add($lang,$listDef,$module = '') {
144-
global $go_api, $go_info,$conf;
145-
146-
if($module == '') {
147-
$lng_file = "lib/lang/".$conf["language"]."_".$listDef['name']."_search.lng";
148-
} else {
149-
$lng_file = '../'.$module."/lib/lang/en_".$listDef['name']."_search.lng";
150-
}
151-
152-
if(is_file($lng_file)) {
153-
include_once($lng_file);
154-
} else {
155-
$wb = array();
156-
}
157-
158-
$wb_out = array_merge($wb,$lang);
159-
160-
if(is_array($wb_out)) {
161-
$fp = fopen ($lng_file, "w");
162-
fwrite($fp,"<?php\r\n");
163-
foreach($wb_out as $key => $val) {
164-
$new_line = '$wb["'.$key.'"] = '."'$val';\r\n";
165-
fwrite($fp,$new_line);
166-
167-
}
168-
fwrite($fp,"?>");
169-
fclose($fp);
170-
}
171-
}
172134
}
173135

174136
?>

0 commit comments

Comments
 (0)