while ($cur && $prev != $lang) { $prev = $cur['value']; $cur = each($lang_arr); } $next_lang = $cur ? $cur['value'] : false; $next_platform = $pl_arr[0]; } else { $next_lang = $lang; } $fn = _base_ . '/xml_language/lang[' . $lang . '].xml'; /* $overwrite =true; if ($upgrade == 1) { $overwrite =false; } */ // we always overwrite, also on upgrade // cause there are too many changes if (file_exists($fn)) { $LangAdm = new LangAdm(); $LangAdm->importTranslation($fn, true, false); } $res = array(); $res['current_lang'] = $lang; $res['current_platform'] = $platform_code; $res['next_lang'] = $next_lang; $res['next_platform'] = $next_platform; require_once _base_ . '/lib/lib.json.php'; $json = new Services_JSON(); ob_clean(); echo $json->encode($res); mysql_close($db); die;
public function doimportTask() { if (!isset($_FILES['lang_file'])) { Util::jump_to('index.php?r=adm/lang/import&error=1'); } if ($_FILES['lang_file']['error'] != UPLOAD_ERR_OK) { Util::jump_to('index.php?r=adm/lang/import&error=2'); } $lang_file = $_FILES['lang_file']['tmp_name']; $overwrite = Get::req('overwrite', DOTY_INT, 0); $noadd_miss = Get::req('noadd_miss', DOTY_INT, 0); $model = new LangAdm(); $re = $model->importTranslation($lang_file, $overwrite, $noadd_miss); Util::jump_to('index.php?r=adm/lang/show'); }