]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
Load pref 'timeOffset' from cookie and automatically select it from the popup in...
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*-
2
3 $serverzone = intval( array_pop(explode(" ", Rfc2822DateTime())));
4 $PreftimeOffset = $request->getPref('timeOffset');
5 $select = HTML();
6
7 for ($z = -14; $z < 12; $z++) {
8     // would prefer to actually have the string formatted like: "GMT+0430"
9     if ($PreftimeOffset)
10         $selected = $PreftimeOffset == intval(sprintf("%s00", $z)) ? array('selected' => 'selected') : array();
11     else
12         $selected = $serverzone == intval(sprintf("%s00", $z)) ? array('selected' => 'selected') : array();
13
14     $select->pushContent(HTML::option(
15                          array_merge(array('value' => sprintf("%s00", $z)),
16                                      $selected),
17                          sprintf("GMT%s00",$z)
18                          ));
19
20     $selected = $serverzone == intval(sprintf("%s30", $z)) ? array('selected' => 'selected') : array();
21
22     $select->pushContent(HTML::option(
23                          array_merge(array('value' => sprintf("%s30", $z - 1)),
24                                      $selected),
25                          sprintf("GMT%s30", $z - 1)
26                          ));
27 }
28 $TimeZoneSelect = HTML::select(array('name' => "pref[timeOffset]"), $select);
29
30 ?>
31 <!-- $Id: userprefs.tmpl,v 1.7 2002-02-02 10:36:37 carstenklapp Exp $ -->
32 <form action="<?=WikiURL($page)?>" method="post">
33   <input type="hidden" name="pagename" value="<?=$request->getArg('pagename')?>" />
34   <blockquote>
35   <table>
36     <tr>
37       <td colspan="2"><h2><?=_("Edit Area Size")?></h2></td>
38     </tr><tr>
39       <td align="right"><?=_("Height")?></td>
40       <td>
41         <input type="text" name="pref[editHeight]" size="4"
42                value="<?=$request->getPref('editHeight')?>" />
43       </td>
44     </tr>
45     <tr>
46       <td align="right"><?=_("Width")?></td>
47       <td>
48         <input type="text" name="pref[editWidth]" size="4"
49                value="<?=$request->getPref('editWidth')?>" />
50       </td>
51     </tr>
52
53     <tr>
54       <td colspan="2"><h2><?=_("Time Zone")?></h2></td>
55     </tr><tr>
56       <td align="right"><?=_("Server time:")?></td>
57       <td><?= Rfc2822DateTime() ?></td>
58     </tr><tr>
59       <td align="right"><?=_("Your time:")?></td>
60       <td>
61         <?= $TimeZoneSelect ?> (unimplemented)
62       </td>
63     </tr>
64   </table>
65   </blockquote>
66   <hr />
67   <?=Button("submit:", _("Update Preferences"))?>
68 </form>