egroupware_official/preferences/settings.php

189 lines
7.5 KiB
PHP
Raw Normal View History

2000-08-18 05:24:22 +02:00
<?php
/**************************************************************************\
* phpGroupWare - preferences *
* http://www.phpgroupware.org *
* This file written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
if ($submit) {
$phpgw_info["flags"] = array("nonavbar" => True, "noheader" => True);
2000-08-18 05:24:22 +02:00
}
$phpgw_info["flags"]["currentapp"] = "preferences";
2000-08-18 05:24:22 +02:00
include("../header.inc.php");
2000-08-18 05:24:22 +02:00
if (! $submit) {
2000-08-18 05:24:22 +02:00
?>
2000-09-05 04:45:44 +02:00
<form method="POST" action="<?php echo $phpgw->link("settings.php"); ?>">
2000-08-18 05:24:22 +02:00
<table border=0>
<tr>
2000-09-07 23:35:30 +02:00
<td><?php echo lang("max matchs per page"); ?>: </td>
2000-08-18 05:24:22 +02:00
<td>
<input name="maxmatchs" value="<?php
2000-10-12 19:56:44 +02:00
echo $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]; ?>" size="2">
2000-08-18 05:24:22 +02:00
</td>
</tr>
<tr>
2000-09-07 23:35:30 +02:00
<td><?php echo lang("Show text on navigation icons"); ?>: </td>
2000-08-18 05:24:22 +02:00
<td>
<input type="checkbox" name="navbar_text"<?php
2000-10-12 19:56:44 +02:00
if ($phpgw_info["user"]["preferences"]["common"]["navbar_text"])
2000-08-18 05:24:22 +02:00
echo " checked";
; ?>>
</td>
</tr>
<tr>
2000-09-07 23:35:30 +02:00
<td><?php echo lang("time zone offset"); ?>: </td>
2000-08-18 05:24:22 +02:00
<td>
<select name="tz_offset"><?php
for ($i = -23; $i<24; $i++) {
echo "<option value=\"$i\"";
2000-10-12 19:56:44 +02:00
if ($i == $phpgw_info["user"]["preferences"]["common"]["tz_offset"])
2000-08-18 05:24:22 +02:00
echo " selected";
if ($i < 1)
echo ">$i</option>\n";
else
echo ">+$i</option>\n";
}
?></select>
2000-09-07 23:35:30 +02:00
<?php echo lang("This server is located in the x timezone",strftime("%Z")); ?>
2000-08-18 05:24:22 +02:00
</td>
</tr>
<tr>
2000-09-07 23:35:30 +02:00
<td><?php echo lang("date format"); ?>:</td>
2000-08-18 05:24:22 +02:00
<td>
2000-10-12 19:56:44 +02:00
<?php $df[$phpgw_info["user"]["preferences"]["common"]["dateformat"]] = " selected"; ?>
2000-08-18 05:24:22 +02:00
<select name="dateformat">
<option value="m/d/Y"<?php echo $df["m/d/Y"]; ?>>m/d/y</option>
<option value="m-d-Y"<?php echo $df["m-d-Y"]; ?>>m-d-y</option>
<option value="m.d.Y"<?php echo $df["m.d.Y"]; ?>>m.d.y</option>
<option value="Y/d/m"<?php echo $df["Y/d/m"]; ?>>y/d/m</option>
<option value="Y-d-m"<?php echo $df["Y-d-m"]; ?>>y-d-m</option>
<option value="Y.d.m"<?php echo $df["Y.d.m"]; ?>>y.d.m</option>
<option value="Y/m/d"<?php echo $df["Y/m/d"]; ?>>y/m/d</option>
<option value="Y-m-d"<?php echo $df["Y-m-d"]; ?>>y-m-d</option>
<option value="Y.m.d"<?php echo $df["Y.m.d"]; ?>>y.m.d</option>
<option value="d/m/Y"<?php echo $df["d/m/Y"]; ?>>d/m/y</option>
2000-11-17 22:16:49 +01:00
<option value="d-m-Y"<?php echo $df["d-m-Y"]; ?>>d-m-y</option>
<option value="d.m.Y"<?php echo $df["d.m.Y"]; ?>>d.m.y</option>
2000-08-18 05:24:22 +02:00
</select>
</td>
</tr>
<tr>
2000-09-07 23:35:30 +02:00
<td><?php echo lang("time format"); ?>:</td>
2000-08-18 05:24:22 +02:00
<td><?php
2000-10-12 19:56:44 +02:00
$timeformat_select[$phpgw_info["user"]["preferences"]["common"]["timeformat"]] = " selected";
2000-08-18 05:24:22 +02:00
echo "<select name=\"timeformat\">"
. "<option value=\"12\"$timeformat_select[12]>12 Hour</option>"
. "<option value=\"24\"$timeformat_select[24]>24 Hour</option>"
. "</select>\n";
?>
</td>
</tr>
<tr>
2000-09-07 23:35:30 +02:00
<td><?php echo lang("language"); ?></td>
2000-08-18 05:24:22 +02:00
<td>
<select name="lang">
2000-11-03 22:49:55 +01:00
<?php
if (! $phpgw_info["user"]["preferences"]["common"]["lang"]) {
$phpgw_info["user"]["preferences"]["common"]["lang"] = "en";
}
$lang_select[$phpgw_info["user"]["preferences"]["common"]["lang"]] = " selected";
$strSql = "SELECT lang_id, lang_name FROM languages WHERE available = 'Yes'";
$phpgw->db->query($strSql);
while ($phpgw->db->next_record()) {
echo "<option value=\"" . $phpgw->db->f("lang_id") . "\"";
if ($phpgw_info["user"]["preferences"]["common"]["lang"]) {
if ($phpgw->db->f("lang_id") == $phpgw_info["user"]["preferences"]["common"]["lang"]) {
echo " selected";
}
} elseif ($phpgw->db->f("lang_id") == "EN") {
echo " selected";
}
echo ">" . $phpgw->db->f("lang_name") . "</option>";
}
?>
2000-08-18 05:24:22 +02:00
</select>
</td>
</tr>
<?php
if ($phpgw_info["user"]["apps"]["admin"]) {
echo '<tr><td>' . lang("show current users on navigation bar") . '</td><td>'
. '<input type="checkbox" name="show_currentusers" value="True"';
if ($phpgw_info["user"]["preferences"]["common"]["show_currentusers"]) {
echo " checked";
}
echo "></td></tr>";
}
?>
<tr>
<td><?php echo lang("Default application"); ?></td>
<td>
<select name="default_app">
<option value="">&nbsp;</option>
<?php
$db_perms = $phpgw->accounts->read_apps($phpgw_info["user"]["userid"]);
while ($permission = each($db_perms)) {
if ($phpgw_info["apps"][$permission[0]]["enabled"]) {
2000-08-18 05:24:22 +02:00
echo "<option value=\"" . $permission[0] . "\"";
2000-10-12 19:56:44 +02:00
if ($phpgw_info["user"]["preferences"]["common"]["default_app"] == $permission[0]) {
2000-08-18 05:24:22 +02:00
echo " selected";
}
2000-09-07 23:35:30 +02:00
echo ">" . lang($phpgw_info["apps"][$permission[0]]["title"])
2000-08-18 05:24:22 +02:00
. "</option>";
}
}
?></select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="<?php echo lang("submit"); ?>">
</td>
</tr>
2000-08-18 05:24:22 +02:00
</table>
</form>
2000-08-21 07:47:57 +02:00
2000-08-18 05:24:22 +02:00
<?php
} else {
$phpgw->preferences->preferences_delete("byappnotheme",$phpgw_info["user"]["account_id"],"common");
2000-08-18 05:24:22 +02:00
$phpgw->db->lock("preferences");
2000-08-18 05:24:22 +02:00
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"maxmatchs","common");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"tz_offset","common");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"dateformat","common");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"timeformat","common");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"lang","common");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"default_app","common");
2000-08-18 05:24:22 +02:00
if ($navbar_text) {
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"navbar_text","common");
2000-08-18 05:24:22 +02:00
}
2000-09-07 00:00:41 +02:00
if ($phpgw_info["user"]["apps"]["admin"]) {
2000-08-18 05:24:22 +02:00
if ($show_currentusers) {
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"show_currentusers","common");
2000-08-18 05:24:22 +02:00
}
}
$phpgw->db->unlock();
Header("Location: " . $phpgw->link("index.php"));
2000-08-18 05:24:22 +02:00
}
$phpgw->common->phpgw_footer();
2000-09-05 08:05:55 +02:00
?>