Onclick handler should not be submitted as HTML but only as the onclick contents...
[squirrelmail.git] / templates / default_advanced / read_menubar_buttons.tpl
CommitLineData
505e00aa 1<?php
2/**
3 * read_menubar_buttons.tpl
4 *
5 * Tempalte for displaying the action buttons, e.g. Reply, Reply All, Forward,
6 * etc., while reading a message. When combined with the read_menubar_nav template,
7 * the entire menu bar is displayed.
8 *
9 * The following variables are available in this template:
10 * $nav_on_top - boolean TRUE if the navigation buttons are on top of the
11 * action buttons generated here.
12 * $prev_href - URL to move to the previous message. Empty if not avilable.
13 * $up_href - URL to move up in the message. Empty if not available.
14 * $next_href - URL to move to the next nessage. Empty when N/A.
15 * $del_prev_href - URL to delete this message and move to the next one. Empty if N/A.
16 * $del_next_href - URL to delete this message and move to the next one. Empty if N/A.
17 * $view_msg_href - URL to go back to the main message. Empty if N/A.
18 * $msg_list_href - URL to go to the message list.
19 * $search_href - URL to go back to the serach results. Empty if N/A.
89a067ff 20 * $form_extra - Extra elements that will be added to the <form> tag verbatim
21 * $form_method - The value of the <form>'s method attribute (optional, may be blank)
22 * $form_target - The value of the <form>'s target attribute (optional, may be blank)
23 * $form_onsubmit - The value of the <form>'s onsubmit handler (optional, may be blank)
505e00aa 24 * $compose_href - Base URL to forward, reply, etc. Note that a specific action
25 * must also be given by the form or in this URL.
0be2024f 26 * $button_onclick - Onclick event string for all buttons
505e00aa 27 * $forward_as_attachment_enabled - boolean TRUE if forwarding as attachments
28 * has been enabled.
29 * $can_resume_draft - boolean TRUE if the "resume draft" is legitimate for
30 * this message.
31 * $can_edit_as_new - boolean TRUE if the "reasume as new" action is legitimate
32 * for this message
33 * $mailboxes - array containing list of mailboxes available for move/copy action.
34 * $can_be_deleted - boolean TRUE if this message can be deleted.
35 * $can_be_moved - boolean TRUE if this message can be moved.
36 * $cab_be_copied - boolean TRUE if this message can be copied to another folder.
37 * $move_delete_form_action - the value for the ACTION attribute of forms to
38 * move, copy or delete a message
39 * $delete_form_extra - additional input elements needed by the DELETE form
40 * $move_form_extra - additional input elements needed by the MOVE form.
41 * $last_move_target - the last folder that a message was moved/copied to.
42 *
43 *
44 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
45 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
46 * @version $Id: read_menubar_buttons.tpl 11850 2006-10-06 21:57:26Z stevetruckstuff $
47 * @package squirrelmail
48 * @subpackage templates
49 */
50
51/** add required includes **/
52
53/** extract template variables **/
54extract($t);
55
56
57/*FIXME: This is a place where Marc's idea for putting all the buttons and
58 links and other widgets into an array is sorely needed instead of
59 hard-coding everything. Whomever implements that, PLEASE, PLEASE
60 look at how the preview pane plugin code is used here to change
61 some links and buttons and make sure your implementation can support
62 it (tip: it may or may not be OK to let a plugin do the modification
63 of the widgets, since a template set can turn on the needed plugin,
64 but that might not be the most clear way to solve said issue).*/
65
66
67/** preview pane prep */
68global $data_dir, $username, $base_uri;
69$pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
70$use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
71$show_preview_pane = checkForJavascript() && $use_previewPane;
72$empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php';
73if ($show_preview_pane) { ?>
74 <script>
75 <!--
76 function refresh_message_list()
77 { parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); }
78 // -->
79 </script>
80<?php }
81
82
83/** Begin template **/
84if ($nav_on_top) {
85 $table_class = 'bottom';
86 $plugin_hook = 'read_body_menu_buttons_top';
87} else {
88 $table_class = 'top';
89 $plugin_hook = 'read_body_menu_buttons_bottom';
90}
91?>
92<div class="readMenuBar">
93<table class="<?php echo $table_class; ?>" cellspacing="0">
94 <tr class="buttons">
95 <td class="buttons">
89a067ff 96 <form name="composeForm" action="<?php
97 echo $compose_href . '" '
98 . (!empty($form_method) ? 'method="' . $form_method . '" ' : '')
99 . (!empty($form_target) ? 'target="' . $form_target . '" ' : '')
100 . (!empty($form_onsubmit) ? 'onsubmit="' . $form_onsubmit . '" ' : '')
101 . $form_extra; ?> >
505e00aa 102 <small>
103 <?php
104 if ($can_resume_draft) {
105 ?>
0be2024f 106 <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" onclick="<?php echo $button_onclick; ?>" />&nbsp;
505e00aa 107 <?php
108 } elseif ($can_edit_as_new) {
109 ?>
0be2024f 110 <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" onclick="<?php echo $button_onclick; ?>" />&nbsp;
505e00aa 111 <?php
112 }
113 ?>
0be2024f 114 <input type="submit" name="smaction_reply" value="<?php echo _("Reply"); ?>" onclick="<?php echo $button_onclick; ?>" />&nbsp;
115 <input type="submit" name="smaction_reply_all" value="<?php echo _("Reply All"); ?>" onclick="<?php echo $button_onclick; ?>" />
505e00aa 116 &nbsp;&nbsp;|&nbsp;&nbsp;
0be2024f 117 <input type="submit" name="smaction_forward" value="<?php echo _("Forward"); ?>" onclick="<?php echo $button_onclick; ?>" />
505e00aa 118 <?php
119 if ($forward_as_attachment_enabled) {
120 ?>
121 <input type="checkbox" name="smaction_attache" id="smaction_attache">
122 <label for="smaction_attache"><?php echo _("As Attachment"); ?></label>
123 <?php
124 }
125 ?>
126 </small>
127 </form>
128 &nbsp;&nbsp;|&nbsp;&nbsp;
129 <?php
130 if ($can_be_deleted) {
131 ?>
132 <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST">
133 <?php echo $delete_form_extra; ?>
134 <small>
135 <input type="submit" name="delete" value="<?php
136
137echo _("Delete") .'"';
138
139/** if preview pane turned on with "always refresh message list",
140 refresh message list frame too, but only if we are in the bottom frame! */
141if ($show_preview_pane && $pp_refresh_message_list)
142 echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
143
144echo ' />'; ?>
145
146 <input type="checkbox" name="bypass_trash" id="bypass_trash"><label for="bypass_trash"><?php echo _("Bypass Trash"); ?></label>
147 </small>
148 </form>
149 <?php
150 }
151 ?>
152 <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?>
153 </td>
154 <td class="move">
155 <?php
156 if ($can_be_moved) {
157 ?>
158 <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST">
159 <?php echo $move_form_extra; ?>
160 <small>
161 <?php echo _("Move To"); ?>:
162 <select name="targetMailbox">
163 <?php
164 foreach ($mailboxes as $value=>$option) {
165 echo '<option value="'. $value .'"' . ($value==$last_move_target ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
166 }
167 ?>
168 </select>
169 <input type="submit" name="moveButton" value="<?php
170
171echo _("Move") . '"';
172
173/** if preview pane turned on with "always refresh message list",
174 refresh message list frame too, but only if we are in the bottom frame! */
175if ($show_preview_pane && $pp_refresh_message_list)
176 echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
177
178echo ' />';
179
180
181 if ($can_be_copied) {
182 ?>
183 <input type="submit" name="copyButton" value="<?php echo _("Copy"); ?>" />
184 <?php
185 }
186 ?>
187 </small>
188 </form>
189 <?php
190 }
191 ?>
192 </td>
193 </tr>
194</table>
195</div>