now only shows installed langs

This commit is contained in:
seek3r 2001-01-10 07:50:18 +00:00
parent e18b02cc39
commit 343a673c72

View File

@ -142,27 +142,25 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td><?php echo lang("language"); ?></td> <?php $selected[$phpgw_info["user"]["preferences"]["common"]["lang"]] = " selected"; ?>
<td> <td><?php echo lang("language"); ?></td>
<select name="settings[lang]"> <td>
<?php <select name="settings[lang]">
<?php
$lang_select[$phpgw_info["user"]["preferences"]["common"]["lang"]] = " selected"; $phpgw->db->query("select distinct lang from lang;");
$phpgw->db->query("SELECT lang_id, lang_name FROM languages WHERE available = 'Yes'",__LINE__,__FILE__); while ($phpgw->db->next_record()) {
while ($phpgw->db->next_record()) { $phpgw_info["installed_langs"][$phpgw->db->f("lang")] = $phpgw->db->f("lang");
echo "<option value=\"" . $phpgw->db->f("lang_id") . "\""; }
if ($phpgw_info["user"]["preferences"]["common"]["lang"]) { reset ($phpgw_info["installed_langs"]);
if ($phpgw->db->f("lang_id") == $phpgw_info["user"]["preferences"]["common"]["lang"]) { while (list ($key, $value) = each ($phpgw_info["installed_langs"])) {
echo " selected"; $sql = "select lang_name from languages where lang_id = '".$value."';";
} $phpgw->db->query($sql);
} elseif ($phpgw->db->f("lang_id") == "en") { $phpgw->db->next_record();
echo " selected"; echo '<option value="'.$key.'" '.$selected[$key].'>'.$phpgw->db->f("lang_name").'</option>';
} }
echo ">" . $phpgw->db->f("lang_name") . "</option>"; ?>
} </select>
?> </td>
</select>
</td>
</tr> </tr>
<?php <?php
if ($phpgw_info["user"]["apps"]["admin"]) { if ($phpgw_info["user"]["apps"]["admin"]) {