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$ */
|
|
|
|
|
2000-10-23 22:56:29 +02:00
|
|
|
if ($submit) {
|
|
|
|
$phpgw_info["flags"] = array("nonavbar" => True, "noheader" => True);
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
2000-10-23 22:56:29 +02:00
|
|
|
$phpgw_info["flags"]["currentapp"] = "preferences";
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-10-23 22:56:29 +02:00
|
|
|
include("../header.inc.php");
|
2000-08-18 05:24:22 +02:00
|
|
|
|
|
|
|
if (! $submit) {
|
2000-12-18 22:22:02 +01:00
|
|
|
if ($phpgw_info["server"]["useframes"] != "never") {
|
2000-12-11 10:18:09 +01:00
|
|
|
$target = ' target="_top"';
|
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
?>
|
2000-12-11 10:18:09 +01:00
|
|
|
<form method="POST" action="<?php echo $phpgw->link("settings.php"); ?>"<?php echo $target; ?>>
|
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>
|
2000-11-29 01:00:21 +01:00
|
|
|
<input name="settings[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>
|
2001-01-10 01:53:30 +01:00
|
|
|
|
2001-01-10 03:03:16 +01:00
|
|
|
<?php if ($phpgw_info["server"]["usrtplchoice"] == "user_choice"){ ?>
|
2001-01-10 01:53:30 +01:00
|
|
|
<tr>
|
2001-01-10 02:00:32 +01:00
|
|
|
<?php $selected[$phpgw_info["user"]["preferences"]["common"]["template_set"]] = " selected"; ?>
|
2001-01-10 01:53:30 +01:00
|
|
|
<td>Interface/Template Selection:<br></td>
|
|
|
|
<td>
|
2001-01-10 02:00:32 +01:00
|
|
|
<select name="settings[template_set]">
|
2001-01-10 01:53:30 +01:00
|
|
|
<?php
|
|
|
|
$templates = $phpgw->common->list_templates();
|
|
|
|
while (list ($key, $value) = each ($templates)){
|
|
|
|
echo '<option value="'.$key.'" '.$selected[$key].'>'.$templates[$key]["title"].'</option>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2001-01-10 02:16:01 +01:00
|
|
|
<?php } ?>
|
2000-08-18 05:24:22 +02:00
|
|
|
<tr>
|
2000-11-29 01:00:21 +01:00
|
|
|
<td><?php echo lang("Show navigation bar as"); ?>: </td>
|
2000-08-18 05:24:22 +02:00
|
|
|
<td>
|
2000-11-29 01:00:21 +01:00
|
|
|
<?php $selected[$phpgw_info["user"]["preferences"]["common"]["navbar_format"]] = " selected"; ?>
|
|
|
|
<select name="settings[navbar_format]">
|
|
|
|
<option value="icons"<?php echo $selected["icons"] . ">" . lang("icons only"); ?></option>
|
|
|
|
<option value="icons_and_text"<?php echo $selected["icons_and_text"] . ">" . lang("icons and text"); ?></option>
|
|
|
|
<option value="text"<?php echo $selected["text"] . ">" . lang("text only"); ?></option>
|
|
|
|
</select>
|
2000-08-18 05:24:22 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2000-12-11 10:18:09 +01:00
|
|
|
|
|
|
|
<?php
|
|
|
|
if ($phpgw_info["server"]["useframes"] == "allowed") {
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo lang("Show navigation bar in a frame"); ?>: </td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" name="settings[useframes]" value="True"<?php echo ($phpgw_info["user"]["preferences"]["common"]["useframes"]?" checked":""); ?>>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
2000-12-18 22:22:02 +01:00
|
|
|
if ($phpgw_info["server"]["useframes"] != "never") {
|
2000-12-11 11:02:30 +01:00
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo lang("Navigation bar frame location"); ?>: </td>
|
|
|
|
<td>
|
|
|
|
<?php $selected[$phpgw_info["user"]["preferences"]["common"]["frame_navbar_location"]] = " selected"; ?>
|
|
|
|
<select name="settings[frame_navbar_location]">
|
|
|
|
<option value="top"<?php echo $selected["top"] . ">" . lang("Top"); ?></option>
|
|
|
|
<option value="bottom"<?php echo $selected["bottom"] . ">" . lang("bottom"); ?></option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
2000-12-11 10:18:09 +01:00
|
|
|
?>
|
|
|
|
|
2000-08-18 05:24:22 +02:00
|
|
|
<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>
|
2000-11-29 01:00:21 +01:00
|
|
|
<select name="settings[tz_offset]"><?php
|
2000-08-18 05:24:22 +02:00
|
|
|
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-11-29 01:00:21 +01:00
|
|
|
<select name="settings[dateformat]">
|
2000-08-18 05:24:22 +02:00
|
|
|
<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-11-29 01:00:21 +01:00
|
|
|
echo "<select name=\"settings[timeformat]\">"
|
2000-08-18 05:24:22 +02:00
|
|
|
. "<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>
|
2000-11-29 01:00:21 +01:00
|
|
|
<select name="settings[lang]">
|
2000-11-21 03:44:37 +01:00
|
|
|
<?php
|
|
|
|
|
2000-11-18 01:17:17 +01:00
|
|
|
$lang_select[$phpgw_info["user"]["preferences"]["common"]["lang"]] = " selected";
|
2000-12-13 16:19:03 +01:00
|
|
|
$phpgw->db->query("SELECT lang_id, lang_name FROM languages WHERE available = 'Yes'",__LINE__,__FILE__);
|
2000-11-18 01:17:17 +01:00
|
|
|
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";
|
|
|
|
}
|
2000-11-23 21:56:06 +01:00
|
|
|
} elseif ($phpgw->db->f("lang_id") == "en") {
|
2000-11-18 01:17:17 +01:00
|
|
|
echo " selected";
|
|
|
|
}
|
|
|
|
echo ">" . $phpgw->db->f("lang_name") . "</option>";
|
|
|
|
}
|
|
|
|
?>
|
2000-08-18 05:24:22 +02:00
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2000-10-23 22:00:43 +02:00
|
|
|
<?php
|
|
|
|
if ($phpgw_info["user"]["apps"]["admin"]) {
|
|
|
|
echo '<tr><td>' . lang("show current users on navigation bar") . '</td><td>'
|
2000-11-12 11:25:04 +01:00
|
|
|
. '<input type="checkbox" name="show_currentusers" value="True"';
|
2000-10-23 22:00:43 +02:00
|
|
|
if ($phpgw_info["user"]["preferences"]["common"]["show_currentusers"]) {
|
|
|
|
echo " checked";
|
|
|
|
}
|
|
|
|
echo "></td></tr>";
|
|
|
|
}
|
2000-10-12 19:36:47 +02:00
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo lang("Default application"); ?></td>
|
|
|
|
<td>
|
2000-11-29 01:00:21 +01:00
|
|
|
<select name="settings[default_app]">
|
2000-10-12 19:36:47 +02:00
|
|
|
<option value=""> </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-10-12 19:36:47 +02:00
|
|
|
}
|
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>";
|
2000-10-12 19:36:47 +02:00
|
|
|
}
|
|
|
|
}
|
2000-11-23 21:56:06 +01:00
|
|
|
?></select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td><?php echo lang("Currency"); ?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
if (! isset($phpgw_info["user"]["preferences"]["common"]["currency"])) {
|
|
|
|
$phpgw_info["user"]["preferences"]["common"]["currency"] = '$';
|
|
|
|
}
|
|
|
|
?>
|
2000-11-29 01:00:21 +01:00
|
|
|
<input name="settings[currency]" value="<?php echo $phpgw_info["user"]["preferences"]["common"]["currency"]; ?>">
|
2000-11-23 21:56:06 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td colspan="2" align="center">
|
|
|
|
<input type="submit" name="submit" value="<?php echo lang("submit"); ?>">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
2000-08-21 07:47:57 +02:00
|
|
|
|
2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
2000-12-11 10:18:09 +01:00
|
|
|
$phpgw->common->phpgw_footer();
|
2000-08-18 05:24:22 +02:00
|
|
|
} else {
|
|
|
|
|
2000-11-29 01:00:21 +01:00
|
|
|
while ($setting = each($settings)) {
|
2000-12-14 12:39:22 +01:00
|
|
|
$phpgw->preferences->change("common",$setting[0],$setting[1]);
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2000-11-29 01:00:21 +01:00
|
|
|
// This one is specialized, so we do it manually
|
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) {
|
2000-12-14 12:39:22 +01:00
|
|
|
$phpgw->preferences->change("common","show_currentusers");
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-12-14 12:39:22 +01:00
|
|
|
$phpgw->preferences->commit();
|
|
|
|
|
2000-12-11 11:02:30 +01:00
|
|
|
if ($phpgw_info["server"]["useframes"] != "never") {
|
2001-01-07 00:13:02 +01:00
|
|
|
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php"));
|
2000-12-24 01:30:41 +01:00
|
|
|
$phpgw->common->phpgw_exit();
|
2000-12-11 10:18:09 +01:00
|
|
|
}
|
|
|
|
|
2000-10-12 19:36:47 +02:00
|
|
|
Header("Location: " . $phpgw->link("index.php"));
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
2000-09-05 08:05:55 +02:00
|
|
|
?>
|