Commit 67300189 authored by fantu's avatar fantu

multilanguage improve also in "tform-system"

parent d82bfbb2
......@@ -139,6 +139,9 @@ class tform {
include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
}
}
$lng_file = ISPC_WEB_PATH.'/lang/lib/lang/'.$_SESSION['s']['language'].'_tform.lng';
if(!file_exists($lng_file)) $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/en_'.'_tform.lng';
include($lng_file);
$this->wordbook = $wb;
return true;
......
......@@ -171,8 +171,6 @@ class tform_tpl_generator {
</div>
";
$lang['btn_save_txt'] = "Save";
$lang['btn_cancel_txt'] = "Cancel";
// speichere Template
if (!$handle = fopen($formDef['tabs'][$tab]['template'], 'w')) {
......@@ -186,9 +184,6 @@ class tform_tpl_generator {
}
fclose($handle);
// speichere language Datei
$this->lng_add($lang,$formDef);
// berprfe, ob es die Tabelle schon gibt,
// ansonsten wird sie angelegt
$tables = $app->db->getTables();
......@@ -325,30 +320,6 @@ class tform_tpl_generator {
}
}
function lng_add($lang,$formDef) {
global $go_api, $go_info,$conf;
$lng_file = "lib/lang/".$conf["language"]."_".$formDef['name'].".lng";
if(is_file($lng_file)) {
include($lng_file);
} else {
$wb = array();
}
$wb_out = array_merge($lang,$wb);
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
<?php
$wb['btn_save_txt'] = "Save";
$wb['btn_cancel_txt'] = "Cancel";
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment