added lang support

This commit is contained in:
seek3r 2001-01-01 11:50:35 +00:00
parent 7bb8355b5e
commit c76e53cc0c
3 changed files with 56 additions and 22 deletions

View File

@ -201,14 +201,14 @@
}
if (isset($phpgw_info["setup"]["oldver"]["phpgwapi"])){
if ($phpgw_info["setup"]["oldver"]["phpgwapi"] == $phpgw_info["server"]["versions"]["phpgwapi"]){
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables Complete)";
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Tables Complete)";
return 10;
}else{
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables need upgrading)";
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Tables need upgrading)";
return 4;
}
}else{
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables appear to be pre-beta)";
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Tables appear to be pre-beta)";
return 2;
}
}else{
@ -223,10 +223,10 @@
if (isset($db_rights)){
//if (isset($isdb)){
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Create tables)";
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Create tables)";
return 3;
}else{
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Create Database)";
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Create Database)";
return 1;
}
}
@ -236,17 +236,44 @@
{
global $phpgw_info;
$this->db->Halt_On_Error = "no";
if ($phpgw_info["setup"]["stage"]["db"] == 10){
if ($phpgw_info["setup"]["stage"]["db"] != 10){return "";}
$this->db->query("select config_value from config where config_name='freshinstall'");
$this->db->next_record();
$configed = $this->db->f("config_value");
if ($configed){
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Needs Configuration)";
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Needs Configuration)";
return 1;
}else{
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Configuration OK)";
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Configuration OK)";
return 10;
}
}
function check_lang()
{
global $phpgw_info;
$this->db->Halt_On_Error = "no";
if ($phpgw_info["setup"]["stage"]["db"] != 10){return "";}
$this->db->query("select distinct lang from lang;");
if ($this->db->num_rows() == 0){
$phpgw_info["setup"]["header_msg"] = "Stage 3 (No languages installed)";
return 1;
}else{
while (@$this->db->next_record()) {
$phpgw_info["setup"]["installed_langs"][$this->db->f("lang")] = $this->db->f("lang");
}
reset ($phpgw_info["setup"]["installed_langs"]);
while (list ($key, $value) = each ($phpgw_info["setup"]["installed_langs"])) {
$sql = "select lang_name from languages where lang_id = '".$value."';";
$this->db->query($sql);
$this->db->next_record();
$phpgw_info["setup"]["installed_langs"][$value] = $this->db->f("lang_name");
}
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Completed)";
return 10;
}
}

View File

@ -192,12 +192,22 @@
}
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - language management</td><td align="right" bgcolor="486591">&nbsp;</td></tr>';
$phpgw_info["setup"]["stage"]["lang"] = $phpgw_setup->check_lang();
switch($phpgw_info["setup"]["stage"]["lang"]){
case 1:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>You are ready for this stage, but this stage is not yet written.<br></td></tr>';
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>You do not have any languages installed. Please install one now<br>';
echo "<form method=\"POST\" action=\"lang.php\"><input type=\"submit\" value=\"Install Language\"></form></td></tr>";
break;
case 10:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td>This stage is completed<br></td></tr>';
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/completed.gif" alt="O" border="0"></td><td>This stage is completed<br>';
echo "Currently installed languages: ";
reset ($phpgw_info["setup"]["installed_langs"]);
while (list ($key, $value) = each ($phpgw_info["setup"]["installed_langs"])) {
if (!$notfirst){ echo $value; }else{ echo ", ".$value; }
$notfirst = True;
}
echo "<br>";
echo "<form method=\"POST\" action=\"lang.php\"><input type=\"submit\" value=\"Manage Languages\"></form></td></tr>";
break;
default:
echo '<tr><td align="center"><img src="'.$phpgw_info["server"]["app_images"].'/incomplete.gif" alt="O" border="0"></td><td>Not ready for this stage yet.</td></tr>';

View File

@ -24,9 +24,6 @@
}
$phpgw_setup->loaddb();
echo "<html><head><title>phpGroupWare Setup</title></head>\n";
echo "<body bgcolor='#ffffff'>\n";
include($phpgw_info["server"]["api_inc"]."/phpgw_common.inc.php");
$common = new common;
$sep = $common->filesystem_separator();
@ -85,7 +82,7 @@
}
if (! $included) {
echo "<center>Language files have been installed</center>";
Header("Location: index.php");
exit;
}