True, "nonavbar" => True, "currentapp" => "home", "noapi" => True); include("../header.inc.php"); // Authorize the user to use setup app and load the database include("./inc/setup_auth.inc.php"); //Does not return unless user is authorized echo "phpGroupWare Setup\n"; echo "\n"; include($phpgw_info["server"]["include_root"]."/phpgwapi/phpgw_common.inc.php"); $common = new common; $sep = $common->filesystem_separator(); } else { $newinstall = True; $lang_selected["en"] = "en"; $submit = True; } 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')"); } } } } } if (! $included) { echo "
Language files have been installed
"; exit; } } else { if (! $included) { setup_header(); ?>

"> >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
'; } }