]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
First (unfinished) UserAuth version, storing prefs in page meta-data.
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: userprefs.tmpl,v 1.22 2002-08-22 23:28:32 rurban 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                                      'maxlength' => 6,
12                                      'name' => "pref[timeOffset]",
13                                      'class' => "numeric",
14                                      'value' => $request->getPref('timeOffset')));
15
16 $RelativeDatesCB = HTML(HTML::input(array('type' => 'hidden',
17                                           'name' => 'pref[relativeDates][]',
18                                           'value' => '0')),
19                         HTML::input(array('type' => 'checkbox',
20                                           'name' => 'pref[relativeDates][]',
21                                           'value' => '1',
22                                           'checked' => (bool) $request->getPref('relativeDates'))));
23 $SelectOptions = HTML();
24 if (!empty($available_themes) and is_array($available_themes)) {
25   foreach ($available_themes as $theme) {
26     if ($theme == $request->getPref('theme'))
27         $SelectOptions->pushContent(HTML::option(array('value' => $theme,'selected'=>"selected"),$theme));
28     else
29         $SelectOptions->pushContent(HTML::option(array('value' => $theme),$theme));
30   }
31   $SelectThemes = HTML::select(array('name' => "pref[theme]",'id' => 'theme'),
32                                $SelectOptions);
33 } else {
34   $changeTheme = false;
35 }
36 if (empty($errmsg)) $errmsg = false;
37 else $errmsg = HTML(HTML::h4(array('class' => 'errors'), $errmsg),HTML::hr());
38 ?>
39 <?= $errmsg ?>
40 <form action="<?=$request->getURLtoSelf()?>" method="post">
41
42 <?php if ($changePass) { ?>
43   <h2><?=_("Change Password")?></h2>
44      <input type="password" name="pref[passwd]" size="16" maxlength="16" class="text" value="" /> <?=_("New password")?>.<br />
45      <input type="password" name="pref[passwd2]" size="16" maxlength="16" class="text" value="" /> <?=_("Type it again")?>.
46 <?php } ?>
47
48 <?php if ($email or $notifyPages) { ?>
49   <h2><?=_("Email Notification")?></h2>
50   <p><?=_("Your E-Mail:")?>
51   <?php if ($email) { ?>
52      <input type="text" name="pref[email]" size="30" maxlength="60"
53             value="<?=$request->getPref('email')?>" />
54   <?php } else { ?><?=$request->getPref('email')?><?php } ?>
55   </p>
56      <p class="hint">(<?=_("Note, that user accounts with bouncing emails will be automatically disabled.")?>)</p>
57   <?php if ($notifyPages) { ?>
58    <p><?=_("Get an email notification at changes of the following pages")?>:<br />
59    &nbsp;<textarea name="pref[notifyPages]" cols="50" rows="5"><?=$request->getPref('notifyPages')?></textarea>
60      <p class="hint">(<?=_("Enter pages seperated by space or brackets. Wildcards allowed.")?>)</p>
61    </p>
62   <?php } ?>
63 <?php } ?>
64
65 <?php if ($changeTheme) { ?>
66   <h2><?=_("Change Theme")?></h2>
67    <p><?=_("Select your default theme")?>:<br />
68        <?= $SelectThemes ?>
69 <?php } ?>
70
71 <?php if ($editAreaSize) { ?>
72   <h2><?=_("Edit Area Size")?></h2>
73   <p><?=_("Height")?>
74      <input type="text" name="pref[editHeight]" size="4" maxlength="4" class="numeric"
75             value="<?=$request->getPref('editHeight')?>" />
76      <?=_("Width")?>
77      <input type="text" name="pref[editWidth]" size="4" maxlength="4" class="numeric"
78             value="<?=$request->getPref('editWidth')?>" />
79   </p>
80   <p class="hint"><?=_("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>
81 <?php } ?>
82
83 <?php if ($timeOffset) { ?>
84   <h2><?=_("Time Zone")?></h2>
85   <p>
86     <?=fmt("Add %s hours to the server's local time when reporting times.",
87            $timeOffsetInput)?>
88   </p>
89   <p class="hint">
90     <?=fmt("The current time at the server is %s.",
91             HTML::strong($Theme->formatDateTime($serverTime)))?>
92     <?=fmt("With the current offset, this would be reported as %s.",
93            HTML::strong($Theme->formatDateTime($time)))?>
94   </p>
95 <?php } ?>
96
97 <?php if ($relativeDates) { ?>
98   <h2><?=_("Date Format")?></h2>
99   <p><?=$RelativeDatesCB?>
100      <?=_("Show relative dates using 'Today' and 'Yesterday'.")?>
101   </p>
102 <?php } ?>
103 <?php if ($request->isActionPage($request->getArg('pagename'))) { ?>
104   <hr />
105   <p><?=Button("submit:", _("Update Preferences"), 'wikiadmin')?><?=Button("submit:cancel", _("Cancel"), 'button')?></p>
106 <input type="hidden" name="action" value="<?=$request->getArg('pagename')?>">
107 <?= HiddenGets(array('pref')) ?>
108 <?php } ?>
109 </form>