]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
Fix boolean preference checkbox.
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: userprefs.tmpl,v 1.16 2002-02-07 22:01:33 dairiki Exp $ -->
3 <?php
4
5 /**
6  * Default to server's timezone if user's pref not chosen yet.
7  */
8 if ($PreftimeOffset = $request->getPref('timeOffset'))
9     $defaultOffset = $PreftimeOffset;
10 else
11     $defaultOffset = TimezoneOffset(false, true);
12
13 $yourTime = date('D, j M Y H:i:s ', time() + PrefTimezoneOffset()) . $defaultOffset;
14
15 /**
16  * Generate the popup menu.
17  */
18 $select = HTML();
19 for ($z = -14; $z < 12; $z++) {
20     $tz_val = seconds2zoneOffset($z*60*60, true);
21     $tz_string = seconds2zoneOffset($z*60*60);
22
23     $selected = $defaultOffset == $tz_val ? array('selected' => 'selected') : array();
24     $select->pushContent(HTML::option(array_merge(array('value' => $tz_val),
25                                                   $selected),
26                                       $tz_string));
27     $z = $z-0.5;
28 }
29
30 $TimeZoneSelect = HTML::select(array('name' => "pref[timeOffset]"), $select);
31
32 $RelativeDatesCB = HTML(HTML::input(array('type' => 'hidden',
33                                           'name' => 'pref[relativeDates][]',
34                                           'value' => '0')),
35                         HTML::input(array('type' => 'checkbox',
36                                           'name' => 'pref[relativeDates][]',
37                                           'value' => '1',
38                                           'checked' => (bool) $request->getPref('relativeDates'))));
39 ?>
40 <form action="<?=WikiURL($page)?>" method="post">
41   <input type="hidden" name="pagename" value="<?=$request->getArg('pagename')?>" />
42   <blockquote>
43   <table>
44     <tr>
45       <td colspan="2"><h2><?=_("Edit Area Size")?></h2></td>
46     </tr><tr>
47       <td align="right"><?=_("Height")?></td>
48       <td>
49         <input type="text" name="pref[editHeight]" size="4" maxlength="4"
50                value="<?=$request->getPref('editHeight')?>" />
51       </td>
52     </tr>
53     <tr>
54       <td align="right"><?=_("Width")?></td>
55       <td>
56         <input type="text" name="pref[editWidth]" size="4" maxlength="4"
57                value="<?=$request->getPref('editWidth')?>" />
58       </td>
59     </tr>
60
61     <tr>
62       <td colspan="2"><h2><?=_("Time Zone")?></h2></td>
63     </tr><tr>
64       <td align="right"><?=_("Server time:")?></td>
65       <td><?= Rfc2822DateTime() ?></td>
66     </tr><tr>
67       <td align="right"><?=_("Your time:")?></td>
68       <td><?= $yourTime ?></td>
69     </tr><tr>
70       <td align="right">GMT</td>
71       <td>
72         <?= $TimeZoneSelect ?>
73       </td>
74     </tr>
75       <!--until timezone functions have been fully debugged-->
76       <tr><td></td><td><small>Times converted to your zone will be marked with an asterisk&nbsp;(*) for debugging.</small></td></tr>
77     <tr>
78       <td colspan="2"><h2><?=_("Date Format")?></h2></td>
79     </tr><tr>
80       <td align="right">
81         <?=$RelativeDatesCB?>
82       </td>
83       <td>
84         <?=_("Show relative dates using 'Today' and 'Yesterday'.")?>
85       </td>
86     </tr>
87     <!--tr><td></td><td><small>Not yet implemented.</small></td></tr-->
88   </table>
89   </blockquote>
90   <hr />
91   <?=Button("submit:", _("Update Preferences"))?>
92 </form>