]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/editpage.tmpl
accessibility: label the basic form elements
[SourceForge/phpwiki.git] / themes / default / templates / editpage.tmpl
1 <!-- -*-php-*- -->
2 <!-- $Id: editpage.tmpl,v 1.53 2005-01-22 12:08:44 rurban Exp $ -->
3 <?php
4 $WidthI = HTML::input(array('type' => 'text',
5                             'size' => 3,
6                             'maxlength' => 4,
7                             'class' => "numeric",
8                             'name' => 'pref[editWidth]',
9                             'id'   => 'pref[editWidth]',
10                             'value' => $request->getPref('editWidth'),
11                             'onchange' => 'this.form.submit();'));
12 $HeightI = HTML::input(array('type' => 'text',
13                              'size' => 3,
14                              'maxlength' => 4,
15                              'class' => "numeric",
16                              'name' => 'pref[editHeight]',
17                              'id'   => 'pref[editHeight]',
18                              'value' => $request->getPref('editHeight'),
19                              'onchange' => 'this.form.submit();'));
20 $s = $WikiTheme->getButtonSeparator();
21 ?>
22 <?php if (isset($PREVIEW_CONTENT)) { ?>
23   <p><strong><?=_("Preview only!  Changes not saved.")?></strong>
24 <!-- FIXME: it would be nice to put a link to the #editarea anchor below,
25      but it does not work currently with the <base> declared in top.tmpl.
26      I think we need to do away with using <base> altogether... -->
27      <?= fmt("Please continue editing.  (You'll find your %s at the bottom of the page.)",
28           /* HTML::a(array("href" => "#editarea"), */ _("edit area") /*)  */) ?>
29   </p>
30   <hr class="printer" noshade="noshade" />
31   <?= $PREVIEW_CONTENT ?>
32   <hr class="printer" noshade="noshade" />
33 <?php } ?>
34
35 <?= $PAGE_LOCKED_MESSAGE ?>
36 <?= $CONCURRENT_UPDATE_MESSAGE ?>
37
38 <?php if (! $IS_CURRENT) { ?>
39   <p><strong><?=_("Warning: You are editing an old revision.")?>
40         <?=_("Saving this page will overwrite the current version.")?></strong></p>
41 <?php } ?>
42 <?php /*
43  * FIXME: Hack! 
44  * The funky URL used for the form action parameter is bogus.
45  * This is needed, otherwise the redirect to the real browser
46  * page won't work with some browsers. (NS4 and Mozilla 0.97 won't accept
47  * a redirect from a page to itself.)
48  */ ?>
49 <form method="post" id="editpage" name="editpage"
50       action="<?= $request->getPostURL() ?>"
51       accept-charset="<?=CHARSET?>">
52   <?php if (!empty($_GET['start_debug'])) echo '<input type="hidden" name="start_debug" value="1" >'; ?>
53   <?php /* To clear beyond a larger logo, such as in the Hawaiian theme */ ?>
54   <br clear="all" class="clear-floats" />
55   <table width="100%">
56     <tr><td><?= $EDIT_TOOLBAR ?></td>
57         <td align="right"><div id="editarea-size">
58         <?=_("Size").':'?> <label for="pref[editHeight]"><b><?=_("H")?></b></label> <?=$HeightI?> <label for="pref[editWidth]"><b><?=_("W")?></b></label> <?=$WidthI?>
59     <noscript><?=Button("submit:", _("Adjust"), 'wikiaction')?></noscript>
60   </div></td></tr></table>
61   <a name="editarea"></a><?=$EDIT_TEXTAREA?>
62 <!-- FIXME: fix layout, move CSS to CSS -->
63 <div class="toolbar" style="text-align: center;">
64   <label for="edit[summary]"><?=_("Summary").':'?></label> <?=$SUMMARY_INPUT?>
65 </div>
66 <table summary="Toolbar: Page editing options." class="toolbar" width="100%"
67        cellpadding="0" cellspacing="0" border="0">
68 <tr valign="middle">
69   <td> 
70     <?=$MINOR_EDIT_CB ?> <label for="edit[minor_edit]"><?=_("This is a minor change.")?></label><br />
71     <?=$OLD_MARKUP_CB?>  <label for="edit[markup]"><?=_("Use old markup")?></label> <?=$OLD_MARKUP_CONVERT?>
72   </td>
73   <td align="center">
74     <?= $PREVIEW_B ?>
75     <?php if ($SAVE_B)  { ?> 
76       <?=$s?><?= $SAVE_B ?>
77     <?php } ?>
78   </td>
79   <td>
80     <?= $user->isSignedIn()
81         ? ''
82         : fmt("Author will be logged as %s.", HTML::em($user->getId())) ?>
83     <?php if (0 and !$user->isAuthenticated()) { // disabled ?>
84     <?= Template('signin', array('FORMNAME' => 'editpage')) ?>
85     <?php } ?>
86   </td>
87 </tr>
88 <?php if ($user->isAdmin()) { ?>
89 <tr>
90   <td><?= $LOCKED_CB ?> <?=_("Locked")?></td>
91   <td colspan="2"></td>
92 </tr>
93 <?php } ?>
94 <?php if (0) {
95 // Not yet supported within the same request. 
96 // Better use a button to the external UpLoad page. 
97 // Or fix action=edit to handle the uploaded filename within the same request.
98 ?>
99 <tr>
100   <td colspan="3"><?plugin UpLoad ?></td>
101 </tr>
102 <?php } ?>
103 </table>
104
105 <hr noshade="noshade" />
106
107 <script language="JavaScript1.3" type="text/javascript">
108 <!--
109 function showOldMarkupRules(show) {
110   if (document.getElementById) {
111     if (!show) {
112       document.getElementById('newMarkup').style.display="block";
113       document.getElementById('oldMarkup').style.display="none";
114     } else {
115       document.getElementById('newMarkup').style.display="none";
116       document.getElementById('oldMarkup').style.display="block";
117     }
118   }
119 }
120 // -->
121 </script>
122
123 <div id="oldMarkup" class="wiki-edithelp">
124 <!-- FIXME: do we need this at all?  If so, it could probably be moved to TextFormattingRules -->
125 <p><?= fmt("See %s tips for editing.", WikiLink(_("GoodStyle"))) ?></p>
126 <?plugin IncludePage page=_("OldTextFormattingRules") section=_("Synopsis") quiet=1?>
127 </div>
128 <div id="newMarkup" class="wiki-edithelp">
129 <!-- FIXME: do we need this at all?  If so, it could probably be moved to TextFormattingRules -->
130 <p><?= fmt("See %s tips for editing.", WikiLink(_("GoodStyle"))) ?></p>
131 <?plugin IncludePage page=_("TextFormattingRules") section=_("Synopsis") quiet=1?>
132 </div>
133 <?=$HIDDEN_INPUTS?>
134 </form>
135
136 <script language="JavaScript1.3" type="text/javascript">
137 <!--
138 if (document.getElementById) {
139   showOldMarkupRules(document.getElementById('useOldMarkup').checked);
140 }
141 // -->
142 </script>