]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
New checkbox form for the relative dates preference--does not work yet though. (I...
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: userprefs.tmpl,v 1.14 2002-02-07 05:11:33 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("GMT ", HTML::select(array('name' => "pref[timeOffset]"), $select));
31
32 $RelativeDatesCB = HTML::input(array('type' => 'checkbox',
33                                      'name' => 'pref[relativeDates]',
34 // these doesn't work yet              'value'  => $request->getPref('relativeDates')?1:0,
35 //                                     'checked'  => $request->getPref('relativeDates')
36                                      'disabled'  => true,
37                                      'checked'  => false
38                                ));
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></td>
71       <td>
72         <?= $TimeZoneSelect ?>
73       </td>
74     </tr><tr>
75       <!--until timezone functions have been fully debugged-->
76       <td></td><td><small>Times converted to your zone will be marked with an asterisk&nbsp;(*).</small></td>
77     <tr>
78       <td colspan="2"><h2><?=_("Date Format")?></h2></td>
79     </tr><tr>
80       <td></td>
81       <td>
82         <?= $RelativeDatesCB ?><?=_("Show relative dates using 'Today' and 'Yesterday'.")?>
83       </td>
84     </tr>
85     <tr><td colspan="2" align="center"><em>(Not yet implemented).</em></td></tr>
86   </table>
87   </blockquote>
88   <hr />
89   <?=Button("submit:", _("Update Preferences"))?>
90 </form>