]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/userprefs.tmpl
fixed login, theme selection, UserPreferences.
[SourceForge/phpwiki.git] / themes / default / templates / userprefs.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: userprefs.tmpl,v 1.23 2002-08-23 18:29:34 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 $SelectThemes = ''; $SelectLanguages = '';
24 $SelectThemesDesc = ''; $SelectLanguagesDesc = '';
25 $SelectOptions = HTML(); 
26 if (!empty($available_themes) and is_array($available_themes)) {
27   foreach ($available_themes as $theme) {
28     if ($theme == $request->getPref('theme'))
29         $SelectOptions->pushContent(HTML::option(array('value' => $theme,'selected'=>"selected"),$theme));
30     else
31         $SelectOptions->pushContent(HTML::option(array('value' => $theme),$theme));
32   }
33   $SelectThemes = HTML::select(array('name' => "pref[theme]",'id' => 'theme'),
34                                $SelectOptions);
35   $SelectThemesDesc = _("Select your theme");
36 }
37
38 $SelectOptions = HTML();
39 if (!empty($available_languages) and is_array($available_languages)) {
40   foreach ($available_languages as $lang) {
41     if ($theme == $request->getPref('lang'))
42         $SelectOptions->pushContent(HTML::option(array('value' => $lang,'selected'=>"selected"),$lang));
43     else
44         $SelectOptions->pushContent(HTML::option(array('value' => $lang),$lang));
45   }
46   $SelectLanguages = HTML::select(array('name' => "pref[lang]",'id' => 'lang'),
47                                $SelectOptions);
48   $SelectLanguagesDesc = _("Select your language");
49 } else {
50   if ($SelectThemes == '')
51     $appearance = false;
52 }
53
54
55 if (empty($errmsg)) $errmsg = false;
56 else $errmsg = HTML(HTML::h4(array('class' => 'errors'), $errmsg),HTML::hr());
57 ?>
58 <?= $errmsg ?>
59 <form action="<?=$request->getURLtoSelf()?>" method="post">
60
61 <?php if ($changePass) { ?>
62   <h2><?=_("Change Password")?></h2>
63      <input type="password" name="pref[passwd]" size="16" maxlength="16" class="text" value="" /> <?=_("New password")?>.<br />
64      <input type="password" name="pref[passwd2]" size="16" maxlength="16" class="text" value="" /> <?=_("Type it again")?>.
65 <?php } ?>
66
67 <?php if ($email or $notifyPages) { ?>
68   <h2><?=_("Email Notification")?></h2>
69   <p><?=_("Your E-Mail:")?>
70   <?php if ($email) { ?>
71      <input type="text" name="pref[email]" size="30" maxlength="60"
72             value="<?=$request->getPref('email')?>" />
73   <?php } else { ?><?=$request->getPref('email')?><?php } ?>
74   &nbsp;&nbsp;<?= _("Status") ?>:&nbsp;&nbsp;
75   <?php if ($request->getPref('emailVerified')) { ?>
76     <?= _("Email verified.") ?>
77   <?php } else { ?>
78     <?= _("Email not yet verified.") ?>
79   <?php } ?>
80   </p>
81      <p class="hint">(<?=_("Note, that user accounts with bouncing emails will be disabled.")?>)</p>
82   <?php if ($notifyPages) { ?>
83    <p><?=_("Get an email notification at changes of the following pages")?>:<br />
84    &nbsp;<textarea name="pref[notifyPages]" cols="50" rows="5"><?=$request->getPref('notifyPages')?></textarea>
85      <p class="hint">(<?=_("Enter pages seperated by space or comma. Wildcards (fileglobbing) allowed.")?>)</p>
86    </p>
87   <?php } ?>
88 <?php } ?>
89
90 <?php if ($appearance) { ?>
91   <h2><?=_("Appearance")?></h2>
92    <table>
93      <tr><td><?=$SelectThemesDesc?>:</td><td><?=$SelectLanguagesDesc?>:</td></tr>
94      <tr><td><?= $SelectThemes ?></td><td><?= $SelectLanguages ?></td></tr>
95    </table>
96 <?php } ?>
97
98 <?php if ($editAreaSize) { ?>
99   <h2><?=_("Edit Area Size")?></h2>
100   <p><?=_("Height")?>
101      <input type="text" name="pref[editHeight]" size="4" maxlength="4" class="numeric"
102             value="<?=$request->getPref('editHeight')?>" />
103      <?=_("Width")?>
104      <input type="text" name="pref[editWidth]" size="4" maxlength="4" class="numeric"
105             value="<?=$request->getPref('editWidth')?>" />
106   </p>
107   <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>
108 <?php } ?>
109
110 <?php if ($timeOffset) { ?>
111   <h2><?=_("Time Zone")?></h2>
112   <p>
113     <?=fmt("Add %s hours to the server's local time when reporting times.",
114            $timeOffsetInput)?>
115   </p>
116   <p class="hint">
117     <?=fmt("The current time at the server is %s.",
118             HTML::strong($Theme->formatDateTime($serverTime)))?>
119     <?=fmt("With the current offset, this would be reported as %s.",
120            HTML::strong($Theme->formatDateTime($time)))?>
121   </p>
122 <?php } ?>
123
124 <?php if ($relativeDates) { ?>
125   <h2><?=_("Date Format")?></h2>
126   <p><?=$RelativeDatesCB?>
127      <?=_("Show relative dates using 'Today' and 'Yesterday'.")?>
128   </p>
129 <?php } ?>
130 <?php if ($request->isActionPage($request->getArg('pagename'))) { ?>
131   <hr />
132   <p><?=Button("submit:", _("Update Preferences"), 'wikiadmin')?><?=Button("submit:cancel", _("Cancel"), 'button')?></p>
133 <input type="hidden" name="action" value="<?=$request->getArg('pagename')?>">
134 <?= HiddenGets(array('pref')) ?>
135 <?php } ?>
136 </form>