From 6267a6ca9bc14d015ec95e64a0f4aa3c853eff76 Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 5 Nov 2000 07:13:27 +0000 Subject: [PATCH] Added missing file --- setup/lang.php | 132 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 setup/lang.php diff --git a/setup/lang.php b/setup/lang.php new file mode 100644 index 0000000000..e806d55685 --- /dev/null +++ b/setup/lang.php @@ -0,0 +1,132 @@ + True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); + include("../header.inc.php"); + + $phpgw_info["server"]["api_dir"] = $phpgw_info["server"]["include_root"]."/phpgwapi"; + + // Authorize the user to use setup app + include("inc/setup_auth.inc.php"); + // Does not return unless user is authorized + + /* Database setup */ + include($phpgw_info["server"]["api_dir"] . "/phpgw_db_".$phpgw_info["server"]["db_type"].".inc.php"); + + $db = new db; + $db->Host = $phpgw_info["server"]["db_host"]; + $db->Type = $phpgw_info["server"]["db_type"]; + $db->Database = $phpgw_info["server"]["db_name"]; + $db->User = $phpgw_info["server"]["db_user"]; + $db->Password = $phpgw_info["server"]["db_pass"]; + //$db->Halt_On_Error = "report"; + //$db->Halt_On_Error = "no"; + + echo "phpGroupWare Setup\n"; + echo "\n"; + + include($phpgw_info["server"]["include_root"]."/phpgwapi/phpgw_common.inc.php"); + $common = new common; + $sep = $common->filesystem_separator(); + + if ($submit) { + if (count($lang_selected)) { + if ($upgrademethod == "dumpold") { + $db->query("delete from lang"); + //echo "
Test: dumpold"; + } + while (list($null,$lang) = each($lang_selected)) { + $addlang = False; + if ($upgrademethod == "addonlynew") { + //echo "
Test: addonlynew - select count(*) from lang where lang='$lang'"; + $db->query("select count(*) from lang where lang='$lang'"); + $db->next_record(); + + if ($db->f(0) == 0) { + //echo "
Test: addonlynew - True"; + $addlang = True; + } + } + if (($addlang && $upgrademethod == "addonlynew") || ($upgrademethod != "addonlynew")) { + //echo '
Test: loop above file()'; + $raw_file = file($phpgw_info["server"]["server_root"] . "/setup/phpgw_" . strtolower($lang) . ".lang"); + while (list($null,$line) = each($raw_file)) { + $addit = False; + list($message_id,$app_name,$db_lang,$content) = explode("\t",$line); + $message_id = addslashes(chop($message_id)); + $app_name = addslashes(chop($app_name)); + $db_lang = addslashes(chop($db_lang)); + $content = addslashes(chop($content)); + if ($upgrademethod == "addmissing") { + //echo "
Test: addmissing"; + $db->query("select count(*) from lang where message_id='$message_id' and lang='$db_lang'"); + $db->next_record(); + + if ($db->f(0) == 0) { + //echo "
Test: addmissing - True - Total: " . $db->f(0); + $addit = True; + } + } + + if ($addit || ($upgrademethod == "dumpold" || $newinstall || $upgrademethod == "addonlynew")) { + //echo "
adding - insert into lang values ('$message_id','$app_name','$db_lang','$content')"; + $db->query("insert into lang values ('$message_id','$app_name','$db_lang','$content')"); + } + } + } + } + } + + echo "
Language files have been installed
"; + exit; + + } else { +?> + "> + + + + + + + + >Select which languages you would like to use. +
+ ':""); ?> + + + Select which method of upgrade you would like to do' + . '
 Delete all old langagues and install new ones' + . '
 Only add new pharses' + . '
 only add languages that are not in the database already.' + . ''; + } + ?> +
+
"> Multi-Language support setup
">This program will help you upgrade or installing different languages for phpGroupWare
+'; + } + + + +