2 <!-- $Id: userprefs.tmpl,v 1.11 2002-02-03 17:50:23 carstenklapp Exp $ -->
6 * Variation of stdlib/TimezoneOffset.
8 function hTimezoneOffset ($h, $use_colon = true) {
17 $colon = $use_colon ? ':' : '';
18 $mins = intval(($secs + 30) / 60);
19 return sprintf("%s%02d%s%02d",
20 $sign, $mins / 60, $colon, $mins % 60);
24 * Default to server's timezone if user's pref not chosen yet.
26 if ($PreftimeOffset = $request->getPref('timeOffset'))
27 $defaultOffset = $PreftimeOffset;
29 $defaultOffset = TimezoneOffset(false, true);
31 $yourTime = date('D, j M Y H:i:s ', time() + PrefTimezoneOffset()) . $defaultOffset;
34 * Generate the popup menu.
37 for ($z = -14; $z < 12; $z++) {
38 $tz_val = hTimezoneOffset($z, false);
39 $tz_string = hTimezoneOffset($z);
41 $selected = $defaultOffset == $tz_val ? array('selected' => 'selected') : array();
42 $select->pushContent(HTML::option(array_merge(array('value' => $tz_val),
48 $TimeZoneSelect = HTML("GMT ", HTML::select(array('name' => "pref[timeOffset]"), $select));
52 <form action="<?=WikiURL($page)?>" method="post">
53 <input type="hidden" name="pagename" value="<?=$request->getArg('pagename')?>" />
57 <td colspan="2"><h2><?=_("Edit Area Size")?></h2></td>
59 <td align="right"><?=_("Height")?></td>
61 <input type="text" name="pref[editHeight]" size="4"
62 value="<?=$request->getPref('editHeight')?>" />
66 <td align="right"><?=_("Width")?></td>
68 <input type="text" name="pref[editWidth]" size="4"
69 value="<?=$request->getPref('editWidth')?>" />
74 <td colspan="2"><h2><?=_("Time Zone")?></h2></td>
76 <td align="right"><?=_("Server time:")?></td>
77 <td><?= Rfc2822DateTime() ?></td>
79 <td align="right"><?=_("Your time:")?></td>
80 <td><?= $yourTime ?></td>
84 <?= $TimeZoneSelect ?>
87 <!--until timezone functions have been fully debugged-->
88 <td></td><td><small>Times converted to your zone will be marked with an asterisk (*).</small></td>
93 <?=Button("submit:", _("Update Preferences"))?>