]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
Relative time display preference works now. There is still a small bug due to the...
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: userprefs.tmpl,v 1.15 2002-02-07 20:20:24 carstenklapp 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::input(array('type' => 'checkbox',
33                                      'name' => 'pref[relativeDates]'//,
34 //                                     'disabled' => false,
35 //                                     'checked' => false,
36 //                                     'value' => 0
37                                ));
38
39 if ($request->getPref('relativeDates')) {
40   $val = $request->getPref('relativeDates');
41   $RelativeDatesCB->setAttr('checked', (bool)$val);
42   $RelativeDatesCB->setAttr('value', !$val ? 1 : 0);
43 }
44 ?>
45 <form action="<?=WikiURL($page)?>" method="post">
46   <input type="hidden" name="pagename" value="<?=$request->getArg('pagename')?>" />
47   <blockquote>
48   <table>
49     <tr>
50       <td colspan="2"><h2><?=_("Edit Area Size")?></h2></td>
51     </tr><tr>
52       <td align="right"><?=_("Height")?></td>
53       <td>
54         <input type="text" name="pref[editHeight]" size="4" maxlength="4"
55                value="<?=$request->getPref('editHeight')?>" />
56       </td>
57     </tr>
58     <tr>
59       <td align="right"><?=_("Width")?></td>
60       <td>
61         <input type="text" name="pref[editWidth]" size="4" maxlength="4"
62                value="<?=$request->getPref('editWidth')?>" />
63       </td>
64     </tr>
65
66     <tr>
67       <td colspan="2"><h2><?=_("Time Zone")?></h2></td>
68     </tr><tr>
69       <td align="right"><?=_("Server time:")?></td>
70       <td><?= Rfc2822DateTime() ?></td>
71     </tr><tr>
72       <td align="right"><?=_("Your time:")?></td>
73       <td><?= $yourTime ?></td>
74     </tr><tr>
75       <td align="right">GMT</td>
76       <td>
77         <?= $TimeZoneSelect ?>
78       </td>
79     </tr>
80       <!--until timezone functions have been fully debugged-->
81       <tr><td></td><td><small>Times converted to your zone will be marked with an asterisk&nbsp;(*) for debugging.</small></td></tr>
82     <tr>
83       <td colspan="2"><h2><?=_("Date Format")?></h2></td>
84     </tr><tr>
85       <td align="right">
86         <?=$RelativeDatesCB?>
87       </td>
88       <td>
89         <?=_("Show relative dates using 'Today' and 'Yesterday'.")?>
90       </td>
91     </tr>
92     <!--tr><td></td><td><small>Not yet implemented.</small></td></tr-->
93   </table>
94   </blockquote>
95   <hr />
96   <?=Button("submit:", _("Update Preferences"))?>
97 </form>