fantu
2008-12-11 d82bfbb24da68aae078927c9b53646995de81d70
Multilanguage improve also in "searchform-system"
2 files modified
42 ■■■■■ changed files
interface/lib/classes/searchform_actions.inc.php 4 ●●●● patch | view | raw | blame | history
interface/lib/classes/searchform_tpl_generator.inc.php 38 ●●●●● patch | view | raw | blame | history
interface/lib/classes/searchform_actions.inc.php
@@ -151,7 +151,11 @@
        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"]);
interface/lib/classes/searchform_tpl_generator.inc.php
@@ -129,46 +129,8 @@
        }
        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);
        }
    }
}
?>