forked from extern/egroupware
added lang support
This commit is contained in:
parent
7bb8355b5e
commit
c76e53cc0c
@ -201,14 +201,14 @@
|
|||||||
}
|
}
|
||||||
if (isset($phpgw_info["setup"]["oldver"]["phpgwapi"])){
|
if (isset($phpgw_info["setup"]["oldver"]["phpgwapi"])){
|
||||||
if ($phpgw_info["setup"]["oldver"]["phpgwapi"] == $phpgw_info["server"]["versions"]["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;
|
return 10;
|
||||||
}else{
|
}else{
|
||||||
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Tables need upgrading)";
|
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Tables need upgrading)";
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
}else{
|
}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;
|
return 2;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@ -223,10 +223,10 @@
|
|||||||
|
|
||||||
if (isset($db_rights)){
|
if (isset($db_rights)){
|
||||||
//if (isset($isdb)){
|
//if (isset($isdb)){
|
||||||
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Create tables)";
|
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Create tables)";
|
||||||
return 3;
|
return 3;
|
||||||
}else{
|
}else{
|
||||||
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Create Database)";
|
$phpgw_info["setup"]["header_msg"] = "Stage 1 (Create Database)";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -236,17 +236,44 @@
|
|||||||
{
|
{
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
$this->db->Halt_On_Error = "no";
|
$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();
|
$this->db->query("select config_value from config where config_name='freshinstall'");
|
||||||
$configed = $this->db->f("config_value");
|
$this->db->next_record();
|
||||||
if ($configed){
|
$configed = $this->db->f("config_value");
|
||||||
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Needs Configuration)";
|
if ($configed){
|
||||||
return 1;
|
$phpgw_info["setup"]["header_msg"] = "Stage 2 (Needs Configuration)";
|
||||||
}else{
|
return 1;
|
||||||
$phpgw_info["setup"]["header_msg"] = "Stage 3 (Configuration OK)";
|
}else{
|
||||||
return 10;
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,12 +192,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - language management</td><td align="right" bgcolor="486591"> </td></tr>';
|
echo ' <tr><td align="left" bgcolor="486591"><font color="fefefe">Step 3 - language management</td><td align="right" bgcolor="486591"> </td></tr>';
|
||||||
|
$phpgw_info["setup"]["stage"]["lang"] = $phpgw_setup->check_lang();
|
||||||
switch($phpgw_info["setup"]["stage"]["lang"]){
|
switch($phpgw_info["setup"]["stage"]["lang"]){
|
||||||
case 1:
|
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;
|
break;
|
||||||
case 10:
|
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;
|
break;
|
||||||
default:
|
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>';
|
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>';
|
||||||
|
@ -24,9 +24,6 @@
|
|||||||
}
|
}
|
||||||
$phpgw_setup->loaddb();
|
$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");
|
include($phpgw_info["server"]["api_inc"]."/phpgw_common.inc.php");
|
||||||
$common = new common;
|
$common = new common;
|
||||||
$sep = $common->filesystem_separator();
|
$sep = $common->filesystem_separator();
|
||||||
@ -85,8 +82,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $included) {
|
if (! $included) {
|
||||||
echo "<center>Language files have been installed</center>";
|
Header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user