]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
Cleanup/refactor time-zone offset preference and relative date
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: userprefs.tmpl,v 1.19 2002-02-08 22:03:04 dairiki Exp $ -->
3 <?php
4
5 $time = time();
6 $offset = $request->getPref('timeOffset') * 3600;
7 $serverTime = $time - $offset;
8
9 $timeOffsetInput = HTML::input(array('type' => "text",
10                                      'size' => 6,
11                                      'name' => "pref[timeOffset]",
12                                      'value' => $request->getPref('timeOffset')));
13
14 $RelativeDatesCB = HTML(HTML::input(array('type' => 'hidden',
15                                           'name' => 'pref[relativeDates][]',
16                                           'value' => '0')),
17                         HTML::input(array('type' => 'checkbox',
18                                           'name' => 'pref[relativeDates][]',
19                                           'value' => '1',
20                                           'checked' => (bool) $request->getPref('relativeDates'))));
21 ?>
22 <form action="<?=WikiURL($page)?>" method="post">
23   <input type="hidden" name="pagename" value="<?=$request->getArg('pagename')?>" />
24   <h2><?=_("Edit Area Size")?></h2>
25   <p><?=_("Height")?>
26      <input type="text" name="pref[editHeight]" size="4" maxlength="4"
27             value="<?=$request->getPref('editHeight')?>" />
28      <?=_("Width")?>
29      <input type="text" name="pref[editWidth]" size="4" maxlength="4"
30             value="<?=$request->getPref('editWidth')?>" />
31   </p>
32   <p><?=_("Note that many browsers will automatically adjust the width of the editing area so that it fills the browser window.  In this case, the width preference will be ignored.")?></p>
33
34   <h2><?=_("Time Zone")?></h2>
35   <p>
36     <?=fmt("Add %s hours to the servers local time, when reporting times.",
37            $timeOffsetInput)?>
38     (<?=fmt("The current time at server is %s.",
39             HTML::strong($Theme->formatDateTime($serverTime)))?>
40     <?=fmt("With the current offset, that would be reported as %s.",
41            HTML::strong($Theme->formatDateTime($time)))?>)
42   </p> 
43
44   <h2><?=_("Date Format")?></h2>
45   <p><?=$RelativeDatesCB?>
46      <?=_("Show relative dates using 'Today' and 'Yesterday'.")?>
47   </p>
48
49   <hr />
50   <p><?=Button("submit:", _("Update Preferences"))?></p>
51 </form>