]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/fusionforge/templates/userprefs.tmpl
No need to translate PDF
[SourceForge/phpwiki.git] / themes / fusionforge / templates / userprefs.tmpl
1 <?php
2 // Todo: Move the logic and code to the plugin
3 // This is very experimental and the read-only part an ugly hack so far.
4 foreach (explode(',','errmsg,isForm') as $var) {
5     if (empty($$var)) $$var = false;
6 }
7
8 $plugin = $request->getArg('pagename');
9 if (isActionPage($request->getArg('pagename'))
10     and $isForm and $plugin == _("PreferencesInfo")) {
11     $isForm = false;
12 }
13 $time = time();
14 $user =& $request->getUser();
15 $pref =& $request->_prefs;
16
17 if (!$pref) return;
18 $offset = $pref->get('timeOffset');
19 $serverTime = $time - $offset * 3600;
20 if ($isForm)
21     $timeOffsetInput = HTML::input(array('type' => "text",
22                                          'id' => 'timeOffsetInput',
23                                          'size' => 6,
24                                          'maxlength' => 6,
25                                          'name' => "pref[timeOffset]",
26                                          'class' => "numeric",
27                                          'value' => $offset));
28 else
29     $timeOffsetInput = $pref->get('timeOffset');
30
31 $OwnModificationsCB = HTML::input(array('type' => 'checkbox',
32                                      'id' => 'ownModifications',
33                                      'name' => 'pref[ownModifications]',
34                                      'value' => '1',
35                                      'checked' => (bool) $pref->get('ownModifications')));
36 $MajorModificationsOnlyCB = HTML::input(array('type' => 'checkbox',
37                                      'id' => 'majorModificationsOnly',
38                                      'name' => 'pref[majorModificationsOnly]',
39                                      'value' => '1',
40                                      'checked' => (bool) $pref->get('majorModificationsOnly')));
41 $DiffMenuItem = HTML::input(array('type' => 'checkbox',
42                                      'id' => 'diffMenuItem',
43                                      'name' => 'pref[diffMenuItem]',
44                                      'value' => '1',
45                                      'checked' => (bool) $pref->get('diffMenuItem')));
46 $PageInfoMenuItem = HTML::input(array('type' => 'checkbox',
47                                      'id' => 'pageInfoMenuItem',
48                                      'name' => 'pref[pageInfoMenuItem]',
49                                      'value' => '1',
50                                      'checked' => (bool) $pref->get('pageInfoMenuItem')));
51 $PDFMenuItem = HTML::input(array('type' => 'checkbox',
52                                      'id' => 'pdfMenuItem',
53                                      'name' => 'pref[pdfMenuItem]',
54                                      'value' => '1',
55                                      'checked' => (bool) $pref->get('pdfMenuItem')));
56 $ChownMenuItem = HTML::input(array('type' => 'checkbox',
57                                      'id' => 'chownMenuItem',
58                                      'name' => 'pref[chownMenuItem]',
59                                      'value' => '1',
60                                      'checked' => (bool) $pref->get('chownMenuItem')));
61 $SetaclMenuItem = HTML::input(array('type' => 'checkbox',
62                                      'id' => 'setaclMenuItem',
63                                      'name' => 'pref[setaclMenuItem]',
64                                      'value' => '1',
65                                      'checked' => (bool) $pref->get('setaclMenuItem')));
66 $RemoveMenuItem = HTML::input(array('type' => 'checkbox',
67                                      'id' => 'removeMenuItem',
68                                      'name' => 'pref[removeMenuItem]',
69                                      'value' => '1',
70                                      'checked' => (bool) $pref->get('removeMenuItem')));
71 $RenameMenuItem = HTML::input(array('type' => 'checkbox',
72                                      'id' => 'renameMenuItem',
73                                      'name' => 'pref[renameMenuItem]',
74                                      'value' => '1',
75                                      'checked' => (bool) $pref->get('renameMenuItem')));
76 $RevertMenuItem = HTML::input(array('type' => 'checkbox',
77                                      'id' => 'revertMenuItem',
78                                      'name' => 'pref[revertMenuItem]',
79                                      'value' => '1',
80                                      'checked' => (bool) $pref->get('revertMenuItem')));
81 $LockMenuItem = HTML::input(array('type' => 'checkbox',
82                                      'id' => 'lockMenuItem',
83                                      'name' => 'pref[lockMenuItem]',
84                                      'value' => '1',
85                                      'checked' => (bool) $pref->get('lockMenuItem')));
86 $BackLinksMenuItem = HTML::input(array('type' => 'checkbox',
87                                      'id' => 'backLinksMenuItem',
88                                      'name' => 'pref[backLinksMenuItem]',
89                                      'value' => '1',
90                                      'checked' => (bool) $pref->get('backLinksMenuItem')));
91 $WatchPageMenuItem = HTML::input(array('type' => 'checkbox',
92                                      'id' => 'watchPageMenuItem',
93                                      'name' => 'pref[watchPageMenuItem]',
94                                      'value' => '1',
95                                      'checked' => (bool) $pref->get('watchPageMenuItem')));
96 $RecentChangesMenuItem = HTML::input(array('type' => 'checkbox',
97                                      'id' => 'recentChangesMenuItem',
98                                      'name' => 'pref[recentChangesMenuItem]',
99                                      'value' => '1',
100                                      'checked' => (bool) $pref->get('recentChangesMenuItem')));
101 $RandomPageMenuItem = HTML::input(array('type' => 'checkbox',
102                                      'id' => 'randomPageMenuItem',
103                                      'name' => 'pref[randomPageMenuItem]',
104                                      'value' => '1',
105                                      'checked' => (bool) $pref->get('randomPageMenuItem')));
106 $LikePagesPageMenuItem = HTML::input(array('type' => 'checkbox',
107                                      'id' => 'likePagesMenuItem',
108                                      'name' => 'pref[likePagesMenuItem]',
109                                      'value' => '1',
110                                      'checked' => (bool) $pref->get('likePagesMenuItem')));
111 $SpecialPagesMenuItem = HTML::input(array('type' => 'checkbox',
112                                      'id' => 'specialPagesMenuItem',
113                                      'name' => 'pref[specialPagesMenuItem]',
114                                      'value' => '1',
115                                      'checked' => (bool) $pref->get('specialPagesMenuItem')));
116 $RelativeDatesCB = HTML::input(array('type' => 'checkbox',
117                                      'id' => 'relativeDates',
118                                      'name' => 'pref[relativeDates]',
119                                      'value' => '1',
120                                      'checked' => (bool) $pref->get('relativeDates')));
121 $PageTrailCB = HTML::input(array('type' => 'checkbox',
122                                      'id' => 'pageTrail',
123                                      'name' => 'pref[pageTrail]',
124                                      'value' => '1',
125                                      'checked' => (bool) $pref->get('pageTrail')));
126 $NoLinkIconsCB = HTML::input(array('type' => 'checkbox',
127                                      'id' => 'noLinkIcons',
128                                      'name' => 'pref[noLinkIcons]',
129                                      'value' => '1',
130                                      'checked' => (bool) $pref->get('noLinkIcons')));
131 $GoogleLinkCB = HTML::input(array('type' => 'checkbox',
132                                      'id' => 'googleLink',
133                                      'name' => 'pref[googleLink]',
134                                      'value' => '1',
135                                      'checked' => (bool) $pref->get('googleLink')));
136 $DoubleClickCB = HTML::input(array('type' => 'checkbox',
137                                      'id' => 'doubleClickEdit',
138                                      'name' => 'pref[doubleClickEdit]',
139                                      'value' => '1',
140                                      'checked' => (bool) $pref->get('doubleClickEdit')));
141 ?>
142 <?php echo $errmsg ?>
143
144 <h2>
145 <?php echo fmt("User preferences for user %s", WikiLink($user->UserName())) ?>
146 </h2>
147
148 <?php if ($isForm) { ?>
149 <form action="<?php echo $request->getPostURL() ?>" method="post">
150 <?php } ?>
151
152 <fieldset style="margin-bottom: 1em;">
153 <legend><strong><?php echo _("User preferences for this project") ?></strong></legend>
154 <table class="fullwidth">
155
156   <tr><td colspan="2"><h3><?php echo _("E-mail Notification") ?></h3></td></tr>
157
158   <tr><td colspan="2">
159     <?php echo _("Get an e-mail notification at changes of the following pages:") ?>
160   </td></tr>
161
162   <tr>
163     <?php if ($isForm) { ?>
164       <td>
165         <label for="notifyPages">
166         <textarea id="notifyPages" name="pref[notifyPages]" cols="40" rows="6"><?php echo $pref->get('notifyPages') ?></textarea>
167         </label>
168       </td>
169       <td><p class="hint"><?php echo _("Enter pages separated by space or comma. Wildcards (fileglobbing) allowed.") ?></p></td>
170     <?php } else { ?>
171       <td colspan="2"><?php echo $pref->get('notifyPages') ?></td>
172     <?php } ?>
173    </tr>
174
175 </table>
176 </fieldset>
177
178 <fieldset style="margin-bottom: 1em;">
179 <legend><strong><?php echo _("Global user preferences (for all projects)") ?></strong></legend>
180
181 <table class="fullwidth">
182
183   <tr>
184        <td colspan="2"><h3><?php echo _("E-mail Notification") ?></h3></td>
185   </tr>
186
187   <tr>
188       <td>
189          <p class="nowrap">
190              <?php echo $OwnModificationsCB ?>
191              <label for="ownModifications">
192              <?php echo _("Do not send my own modifications") ?>
193              </label>
194          </p>
195       </td>
196       <td>
197          <p class="hint"><?php echo _("Check if you do not want to be notified of your own modifications.") ?></p>
198       </td>
199   </tr>
200
201   <tr>
202       <td>
203          <p class="nowrap">
204              <?php echo $MajorModificationsOnlyCB ?>
205              <label for="majorModificationsOnly">
206              <?php echo _("Do not send minor modifications") ?>
207              </label>
208          </p>
209       </td>
210       <td>
211          <p class="hint"><?php echo _("Check if you do not want to be notified of minor modifications.") ?></p>
212       </td>
213   </tr>
214
215   <tr><td colspan="2"><h3><?php echo _("Menus") ?></h3></td></tr>
216   <tr>
217      <td>
218        <fieldset>
219        <legend><?php echo _("Top Menu") ?></legend>
220        <table>
221          <tr>
222             <td>
223                <p class="nowrap">
224                   <?php echo $DiffMenuItem ?>
225                   <label for="diffMenuItem">
226                   <?php echo _("Last Difference") ?>
227                   </label>
228                </p>
229             </td>
230          </tr>
231          <tr>
232             <td>
233                <p class="nowrap">
234                   <?php echo $RevertMenuItem ?>
235                   <label for="revertMenuItem">
236                   <?php echo _("Revert") ?>
237                   </label>
238                </p>
239             </td>
240          </tr>
241          <?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?>
242            <tr>
243              <td>
244                 <p class="nowrap">
245                   <?php echo $PDFMenuItem ?>
246                   <label for="pdfMenuItem">
247                   <?php echo "PDF" ?>
248                   </label>
249                </p>
250              </td>
251            </tr>
252          <?php } ?>
253          <tr>
254             <td>
255                <p class="nowrap">
256                   <?php echo $LockMenuItem ?>
257                   <label for="lockMenuItem">
258                   <?php echo _("Lock") ?>
259                   </label>
260                </p>
261             </td>
262          </tr>
263          <tr>
264             <td>
265                <p class="nowrap">
266                   <?php echo $ChownMenuItem ?>
267                   <label for="chownMenuItem">
268                   <?php echo _("Change Owner") ?>
269                   </label>
270                </p>
271             </td>
272          </tr>
273          <tr>
274             <td>
275                <p class="nowrap">
276                   <?php echo $SetaclMenuItem ?>
277                   <label for="setaclMenuItem">
278                   <?php echo _("Access Rights") ?>
279                   </label>
280                </p>
281             </td>
282          </tr>
283        </table>
284        </fieldset>
285     </td>
286     <td class="top">
287       <p class="hint"><?php echo _("Check menu items to display.") ?></p>
288     </td>
289     </tr>
290
291     <tr>
292     <td class="top">
293        <fieldset>
294        <legend><?php echo _("Left Menu") ?></legend>
295        <table>
296          <tr>
297             <td>
298                <p class="nowrap">
299                   <?php echo $RandomPageMenuItem ?>
300                   <label for="randomPageMenuItem">
301                   <?php echo _("Random Page") ?>
302                   </label>
303                </p>
304             </td>
305          </tr>
306          <tr>
307             <td>
308                <p class="nowrap">
309                   <?php echo $LikePagesPageMenuItem ?>
310                   <label for="likePagesMenuItem">
311                   <?php echo _("Like Pages") ?>
312                   </label>
313                </p>
314             </td>
315          </tr>
316        </table>
317        </fieldset>
318     </td>
319     <td>
320     </td>
321   </tr>
322
323   <tr><td colspan="2"><h3><?php echo _("Appearance") ?></h3></td></tr>
324
325   <tr><td colspan="2"><?php echo _("Here you can override site-specific default values.") ?></td></tr>
326       <tr>
327           <td>
328              <p class="nowrap">
329                <?php echo $PageTrailCB ?>
330                <label for="pageTrail">
331                <?php echo _("Show Page Trail") ?>
332                </label>
333              </p>
334           </td>
335           <td><p class="hint"><?php echo _("Show Page Trail at top of page.") ?></p></td>
336       </tr>
337       <tr>
338           <td>
339              <p class="nowrap">
340                <?php echo $NoLinkIconsCB ?>
341                <label for="noLinkIcons">
342                <?php echo fmt("Hide %s", WikiLink("Help:LinkIcons")) ?>
343                </label>
344              </p>
345           </td>
346           <td><p class="hint"><?php echo _("Hide or show LinkIcons.") ?></p></td>
347       </tr>
348       <tr>
349           <td>
350              <p class="nowrap">
351                <?php echo $GoogleLinkCB ?>
352                <label for="googleLink">
353                <?php echo fmt("Add %s", WikiLink("Help:GoogleLink")) ?>
354                </label>
355              </p>
356           </td>
357           <td><p class="hint"><?php echo fmt("Add Google links to unknown pages behind the '?', and the create action behind the pagename instead. See %s.", WikiLink("MeatBall:GooglePrompt")) ?></p></td>
358       </tr>
359
360   <tr><td colspan="2"><h3><?php echo _("Edit Area Size") ?></h3></td></tr>
361
362   <tr><td>
363     <?php if ($isForm) { ?>
364     <label for="height">
365     <?php } ?>
366     <?php echo _("Height") . _(":") ?>
367     <?php if ($isForm) { ?>
368     </label>
369      <input id="height" type="text" name="pref[editHeight]" size="4" maxlength="4" class="numeric"
370             value="<?php echo $pref->get('editHeight') ?>" />
371     <?php } else { ?>
372       <?php echo $pref->get('editHeight') ?>
373     <?php } ?>
374     <?php if ($isForm) { ?>
375     <label for="width">
376     <?php } ?>
377     <?php echo _("Width") . _(":") ?>
378     <?php if ($isForm) { ?>
379     </label>
380      <input id="width" type="text" name="pref[editWidth]" size="4" maxlength="4" class="numeric"
381             value="<?php echo $pref->get('editWidth') ?>" />
382     <?php } else { ?>
383       <?php echo $pref->get('editWidth') ?>
384     <?php } ?>
385     </td>
386     <td><p class="hint">
387       <?php echo _("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>
388     </td></tr>
389
390   <tr><td colspan="2"><h3><?php echo _("Time Zone") ?></h3></td></tr>
391
392   <tr>
393     <td>
394       <p>
395         <label for="timeOffsetInput">
396         <?php echo fmt("Add %s hours to the server's local time when reporting times.", $timeOffsetInput) ?>
397         </label>
398       </p>
399     </td>
400     <td>
401       <p class="hint">
402         <?php echo fmt("The current time at the server is %s.",
403                 HTML::strong($WikiTheme->formatDateTime($serverTime))) ?>
404         <?php echo fmt("With the current offset, this would be reported as %s.",
405                HTML::strong($WikiTheme->formatDateTime($time))) ?>
406       </p>
407     </td>
408   </tr>
409
410   <tr><td colspan="2"><h3><?php echo _("Date Format") ?></h3></td></tr>
411
412   <tr><td colspan="2">
413     <p>
414       <?php echo $RelativeDatesCB ?>
415       <label for="relativeDates">
416       <?php echo _("Show relative dates using “Today” and “Yesterday”") ?>
417       </label>
418     </p>
419   </td></tr>
420 </table>
421 </fieldset>
422
423 <?php if ($isForm) { ?>
424 <p>
425   <?php echo Button("submit:", _("Update Preferences"), 'wikiadmin') ?>
426   <?php echo Button("submit:delete", _("Reset Preferences"), 'wikiadmin') ?>
427   <?php echo Button("submit:cancel", _("Cancel"), 'button') ?>
428   <?php echo HiddenInputs($request->getArgs(), false, array('pref')) ?>
429 </p>
430 </form>
431 <?php } ?>