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;
8 $plugin = $request->getArg('pagename');
9 if (isActionPage($request->getArg('pagename'))
10 and $isForm and $plugin == _("PreferencesInfo")) {
14 $user =& $request->getUser();
15 $pref =& $request->_prefs;
18 $offset = $pref->get('timeOffset');
19 $serverTime = $time - $offset * 3600;
21 $timeOffsetInput = HTML::input(array('type' => "text",
22 'id' => 'timeOffsetInput',
25 'name' => "pref[timeOffset]",
29 $timeOffsetInput = $pref->get('timeOffset');
31 $OwnModificationsCB = HTML::input(array('type' => 'checkbox',
32 'id' => 'ownModifications',
33 'name' => 'pref[ownModifications]',
35 'checked' => (bool) $pref->get('ownModifications')));
36 $MajorModificationsOnlyCB = HTML::input(array('type' => 'checkbox',
37 'id' => 'majorModificationsOnly',
38 'name' => 'pref[majorModificationsOnly]',
40 'checked' => (bool) $pref->get('majorModificationsOnly')));
41 $DiffMenuItem = HTML::input(array('type' => 'checkbox',
42 'id' => 'diffMenuItem',
43 'name' => 'pref[diffMenuItem]',
45 'checked' => (bool) $pref->get('diffMenuItem')));
46 $PageInfoMenuItem = HTML::input(array('type' => 'checkbox',
47 'id' => 'pageInfoMenuItem',
48 'name' => 'pref[pageInfoMenuItem]',
50 'checked' => (bool) $pref->get('pageInfoMenuItem')));
51 $PDFMenuItem = HTML::input(array('type' => 'checkbox',
52 'id' => 'pdfMenuItem',
53 'name' => 'pref[pdfMenuItem]',
55 'checked' => (bool) $pref->get('pdfMenuItem')));
56 $ChownMenuItem = HTML::input(array('type' => 'checkbox',
57 'id' => 'chownMenuItem',
58 'name' => 'pref[chownMenuItem]',
60 'checked' => (bool) $pref->get('chownMenuItem')));
61 $SetaclMenuItem = HTML::input(array('type' => 'checkbox',
62 'id' => 'setaclMenuItem',
63 'name' => 'pref[setaclMenuItem]',
65 'checked' => (bool) $pref->get('setaclMenuItem')));
66 $RemoveMenuItem = HTML::input(array('type' => 'checkbox',
67 'id' => 'removeMenuItem',
68 'name' => 'pref[removeMenuItem]',
70 'checked' => (bool) $pref->get('removeMenuItem')));
71 $RenameMenuItem = HTML::input(array('type' => 'checkbox',
72 'id' => 'renameMenuItem',
73 'name' => 'pref[renameMenuItem]',
75 'checked' => (bool) $pref->get('renameMenuItem')));
76 $RevertMenuItem = HTML::input(array('type' => 'checkbox',
77 'id' => 'revertMenuItem',
78 'name' => 'pref[revertMenuItem]',
80 'checked' => (bool) $pref->get('revertMenuItem')));
81 $LockMenuItem = HTML::input(array('type' => 'checkbox',
82 'id' => 'lockMenuItem',
83 'name' => 'pref[lockMenuItem]',
85 'checked' => (bool) $pref->get('lockMenuItem')));
86 $BackLinksMenuItem = HTML::input(array('type' => 'checkbox',
87 'id' => 'backLinksMenuItem',
88 'name' => 'pref[backLinksMenuItem]',
90 'checked' => (bool) $pref->get('backLinksMenuItem')));
91 $WatchPageMenuItem = HTML::input(array('type' => 'checkbox',
92 'id' => 'watchPageMenuItem',
93 'name' => 'pref[watchPageMenuItem]',
95 'checked' => (bool) $pref->get('watchPageMenuItem')));
96 $RecentChangesMenuItem = HTML::input(array('type' => 'checkbox',
97 'id' => 'recentChangesMenuItem',
98 'name' => 'pref[recentChangesMenuItem]',
100 'checked' => (bool) $pref->get('recentChangesMenuItem')));
101 $RandomPageMenuItem = HTML::input(array('type' => 'checkbox',
102 'id' => 'randomPageMenuItem',
103 'name' => 'pref[randomPageMenuItem]',
105 'checked' => (bool) $pref->get('randomPageMenuItem')));
106 $LikePagesPageMenuItem = HTML::input(array('type' => 'checkbox',
107 'id' => 'likePagesMenuItem',
108 'name' => 'pref[likePagesMenuItem]',
110 'checked' => (bool) $pref->get('likePagesMenuItem')));
111 $SpecialPagesMenuItem = HTML::input(array('type' => 'checkbox',
112 'id' => 'specialPagesMenuItem',
113 'name' => 'pref[specialPagesMenuItem]',
115 'checked' => (bool) $pref->get('specialPagesMenuItem')));
116 $RelativeDatesCB = HTML::input(array('type' => 'checkbox',
117 'id' => 'relativeDates',
118 'name' => 'pref[relativeDates]',
120 'checked' => (bool) $pref->get('relativeDates')));
121 $PageTrailCB = HTML::input(array('type' => 'checkbox',
123 'name' => 'pref[pageTrail]',
125 'checked' => (bool) $pref->get('pageTrail')));
126 $NoLinkIconsCB = HTML::input(array('type' => 'checkbox',
127 'id' => 'noLinkIcons',
128 'name' => 'pref[noLinkIcons]',
130 'checked' => (bool) $pref->get('noLinkIcons')));
131 $GoogleLinkCB = HTML::input(array('type' => 'checkbox',
132 'id' => 'googleLink',
133 'name' => 'pref[googleLink]',
135 'checked' => (bool) $pref->get('googleLink')));
136 $DoubleClickCB = HTML::input(array('type' => 'checkbox',
137 'id' => 'doubleClickEdit',
138 'name' => 'pref[doubleClickEdit]',
140 'checked' => (bool) $pref->get('doubleClickEdit')));
142 <?php echo $errmsg ?>
145 <?php echo fmt("User preferences for user %s", WikiLink($user->UserName())) ?>
148 <?php if ($isForm) { ?>
149 <form action="<?php echo $request->getPostURL() ?>" method="post">
152 <fieldset style="margin-bottom: 1em;">
153 <legend><strong><?php echo _("User preferences for this project") ?></strong></legend>
154 <table class="fullwidth">
156 <tr><td colspan="2"><h3><?php echo _("E-mail Notification") ?></h3></td></tr>
159 <?php echo _("Get an e-mail notification at changes of the following pages:") ?>
163 <?php if ($isForm) { ?>
165 <label for="notifyPages">
166 <textarea id="notifyPages" name="pref[notifyPages]" cols="40" rows="6"><?php echo $pref->get('notifyPages') ?></textarea>
169 <td><p class="hint"><?php echo _("Enter pages separated by space or comma. Wildcards (fileglobbing) allowed.") ?></p></td>
171 <td colspan="2"><?php echo $pref->get('notifyPages') ?></td>
178 <fieldset style="margin-bottom: 1em;">
179 <legend><strong><?php echo _("Global user preferences (for all projects)") ?></strong></legend>
181 <table class="fullwidth">
184 <td colspan="2"><h3><?php echo _("E-mail Notification") ?></h3></td>
190 <?php echo $OwnModificationsCB ?>
191 <label for="ownModifications">
192 <?php echo _("Do not send my own modifications") ?>
197 <p class="hint"><?php echo _("Check if you do not want to be notified of your own modifications.") ?></p>
204 <?php echo $MajorModificationsOnlyCB ?>
205 <label for="majorModificationsOnly">
206 <?php echo _("Do not send minor modifications") ?>
211 <p class="hint"><?php echo _("Check if you do not want to be notified of minor modifications.") ?></p>
215 <tr><td colspan="2"><h3><?php echo _("Menus") ?></h3></td></tr>
219 <legend><?php echo _("Top Menu") ?></legend>
224 <?php echo $DiffMenuItem ?>
225 <label for="diffMenuItem">
226 <?php echo _("Last Difference") ?>
234 <?php echo $RevertMenuItem ?>
235 <label for="revertMenuItem">
236 <?php echo _("Revert") ?>
241 <?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?>
245 <?php echo $PDFMenuItem ?>
246 <label for="pdfMenuItem">
256 <?php echo $LockMenuItem ?>
257 <label for="lockMenuItem">
258 <?php echo _("Lock") ?>
266 <?php echo $ChownMenuItem ?>
267 <label for="chownMenuItem">
268 <?php echo _("Change Owner") ?>
276 <?php echo $SetaclMenuItem ?>
277 <label for="setaclMenuItem">
278 <?php echo _("Access Rights") ?>
287 <p class="hint"><?php echo _("Check menu items to display.") ?></p>
294 <legend><?php echo _("Left Menu") ?></legend>
299 <?php echo $RandomPageMenuItem ?>
300 <label for="randomPageMenuItem">
301 <?php echo _("Random Page") ?>
309 <?php echo $LikePagesPageMenuItem ?>
310 <label for="likePagesMenuItem">
311 <?php echo _("Like Pages") ?>
323 <tr><td colspan="2"><h3><?php echo _("Appearance") ?></h3></td></tr>
325 <tr><td colspan="2"><?php echo _("Here you can override site-specific default values.") ?></td></tr>
329 <?php echo $PageTrailCB ?>
330 <label for="pageTrail">
331 <?php echo _("Show Page Trail") ?>
335 <td><p class="hint"><?php echo _("Show Page Trail at top of page.") ?></p></td>
340 <?php echo $NoLinkIconsCB ?>
341 <label for="noLinkIcons">
342 <?php echo fmt("Hide %s", WikiLink("Help:LinkIcons")) ?>
346 <td><p class="hint"><?php echo _("Hide or show LinkIcons.") ?></p></td>
351 <?php echo $GoogleLinkCB ?>
352 <label for="googleLink">
353 <?php echo fmt("Add %s", WikiLink("Help:GoogleLink")) ?>
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>
360 <tr><td colspan="2"><h3><?php echo _("Edit Area Size") ?></h3></td></tr>
363 <?php if ($isForm) { ?>
366 <?php echo _("Height") . _(":") ?>
367 <?php if ($isForm) { ?>
369 <input id="height" type="text" name="pref[editHeight]" size="4" maxlength="4" class="numeric"
370 value="<?php echo $pref->get('editHeight') ?>" />
372 <?php echo $pref->get('editHeight') ?>
374 <?php if ($isForm) { ?>
377 <?php echo _("Width") . _(":") ?>
378 <?php if ($isForm) { ?>
380 <input id="width" type="text" name="pref[editWidth]" size="4" maxlength="4" class="numeric"
381 value="<?php echo $pref->get('editWidth') ?>" />
383 <?php echo $pref->get('editWidth') ?>
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>
390 <tr><td colspan="2"><h3><?php echo _("Time Zone") ?></h3></td></tr>
395 <label for="timeOffsetInput">
396 <?php echo fmt("Add %s hours to the server's local time when reporting times.", $timeOffsetInput) ?>
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))) ?>
410 <tr><td colspan="2"><h3><?php echo _("Date Format") ?></h3></td></tr>
414 <?php echo $RelativeDatesCB ?>
415 <label for="relativeDates">
416 <?php echo _("Show relative dates using “Today” and “Yesterday”") ?>
423 <?php if ($isForm) { ?>
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')) ?>