public function importGlossaries() { global $class_path, $site; include_once $class_path . 'install.inc.php'; ############### # lang file import: importida ainult need keeled, mis saidis aktiivsed # get languages in use $sqlK = "select distinct b.glossary_id as keel_id, b.encoding as encoding from keel as a left join keel as b on a.keel_id = b.glossary_id where b.on_kasutusel = '1'"; $sthK = new SQL($sqlK); ############### # loop over active languages while ($keel = $sthK->fetch()) { # get site encoding, default is UTF-8 if not set $lang_encoding = $keel['encoding'] ? strtoupper($keel['encoding']) : "UTF-8"; # file = admin/updates/language0.csv $file = "admin/updates/" . $lang_encoding . "/language" . $keel['keel_id'] . ".csv"; # kui leidub selle keele keelefail if (file_exists($file)) { $this->str($file . "'..."); $one_lang_error = import_langfile($file, $keel); if (!$one_lang_error) { # import OK $lang_error .= $one_lang_error; } } } # / loop over active languages ############### }
continue; } # get site encoding, default is UTF-8 if not set $lang_encoding = $keel['encoding'] ? strtoupper($keel['encoding']) : "UTF-8"; # file = admin/updates/language0.csv $file = "admin/updates/".$lang_encoding."/language".$keel['keel_id'].".csv"; # kui leidub selle keele keelefail if(file_exists($file)) { echo "Importing file '".$file."'..."; echo "<script>document.getElementById('listing').scrollTop = document.getElementById('listing').scrollHeight - 500;</script>"; flush();usleep(500000); $one_lang_error = import_langfile($file,$keel); if(!$one_lang_error) { # import OK $lang_error .= $one_lang_error; echo " Done.<br>"; } echo "<script>document.getElementById('listing').scrollTop = document.getElementById('listing').scrollHeight - 500;</script>"; flush();usleep(500000); } } # / loop over active languages ############### ?> <br />