First commit of tag changes. bug-1444
[cacert-devel.git] / pages / account / 41.php
1 <?php /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
20 ?>
21
22 <form method="post" action="account.php">
23 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
24 <tr>
25 <td colspan="2" class="title"><?php echo _("My Language Settings")?></td>
26 </tr>
27 <tr>
28 <td class="DataTD"><?php echo _("My preferred language")?>:</td>
29 <td class="DataTD"><select name="lang">
30 <?php foreach(L10n::$translations as $key => $val)
31 {
32 echo "<option value='$key'";
33 if($key == L10n::get_translation())
34 echo " selected";
35 echo ">$val</option>\n";
36 }
37 ?>
38 </select>
39 </td>
40 </tr>
41 <tr>
42 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?php echo _("Update")?>"></td>
43 </tr>
44 </table>
45 <input type="hidden" name="oldid" value="<?php echo $id?>">
46 <input type="hidden" name="action" value="default">
47 <input type="hidden" name="csrf" value="<?php echo make_csrf('mainlang')?>" />
48 </form>
49 <form method="post" action="account.php">
50 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
51 <tr>
52 <td colspan="2" class="title"><?php echo _("Additional Language Preferences")?></td>
53 </tr>
54 <?php $query = "select * from `addlang` where `userid`='".intval($_SESSION['profile']['id'])."'";
55 $res = mysql_query($query);
56 while($row = mysql_fetch_assoc($res))
57 {
58 $lang = mysql_fetch_assoc(mysql_query("select * from `languages` where `locale`='".mysql_escape_string($row['lang'])."'"));
59 ?>
60 <tr>
61 <td class="DataTD"><?php echo _("Additional Language")?>:</td>
62 <td class="DataTD" align="left"><?php echo "${lang['lang']} - ${lang['country']}"; ?>
63 <a href="account.php?oldid=41&amp;action=dellang&amp;remove=<?php echo $row['lang']?>&amp;csrf=<?php echo make_csrf('seclang')?>"><?php echo _("Delete")?></a></td>
64 </tr>
65 <?php } ?>
66 <tr>
67 <td class="DataTD"><?php echo _("Secondary languages")?>:</td>
68 <td class="DataTD"><select name="addlang">
69 <?php $query = "select * from `languages` order by `locale`";
70 $res = mysql_query($query);
71 while($row = mysql_fetch_assoc($res))
72 {
73 printf("<option value=\"%s\">[%s] %s (%s)</option>\n",
74 sanitizeHTML($row['locale']),
75 sanitizeHTML($row['locale']),
76 $row['lang'],
77 $row['country']
78 );
79 }
80 ?>
81 </select>
82 </td>
83 </tr>
84 <tr>
85 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?php echo _("Add")?>"></td>
86 </tr>
87 </table>
88 <input type="hidden" name="oldid" value="<?php echo $id?>">
89 <input type="hidden" name="action" value="addsec">
90 <input type="hidden" name="csrf" value="<?php echo make_csrf('seclang')?>" />
91 </form>