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. |
8949acd6 |
42 | * $accesskey_read_msg_reply - The accesskey to be used for the Reply button |
43 | * $accesskey_read_msg_reply_all - The accesskey to be used for the Reply All button |
44 | * $accesskey_read_msg_forward - The accesskey to be used for the Forward button |
45 | * $accesskey_read_msg_as_attach - The accesskey to be used for the As Attachment checkbox |
46 | * $accesskey_read_msg_delete - The accesskey to be used for the Delete button |
47 | * $accesskey_read_msg_bypass_trash - The accesskey to be used for the Bypass Trash checkbox |
48 | * $accesskey_read_msg_move_to - The accesskey to be used for the folder select list |
49 | * $accesskey_read_msg_move - The accesskey to be used for the Move button |
50 | * $accesskey_read_msg_copy - The accesskey to be used for the Copy button |
505e00aa |
51 | * |
52 | * |
30460a05 |
53 | * @copyright 1999-2009 The SquirrelMail Project Team |
505e00aa |
54 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
55 | * @version $Id: read_menubar_buttons.tpl 11850 2006-10-06 21:57:26Z stevetruckstuff $ |
56 | * @package squirrelmail |
57 | * @subpackage templates |
58 | */ |
59 | |
60 | /** add required includes **/ |
61 | |
62 | /** extract template variables **/ |
63 | extract($t); |
64 | |
65 | |
541dedcd |
66 | /*FIXME: This is a place where Marc's idea for putting all the buttons and links and other widgets into an array is sorely needed instead of hard-coding everything. Whomever implements that, PLEASE, PLEASE look at how the preview pane plugin code is used here to change some links and buttons and make sure your implementation can support it (tip: it may or may not be OK to let a plugin do the modification of the widgets, since a template set can turn on the needed plugin, but that might not be the most clear way to solve said issue).*/ |
505e00aa |
67 | |
68 | /** preview pane prep */ |
69 | global $data_dir, $username, $base_uri; |
70 | $pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1); |
71 | $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0); |
72 | $show_preview_pane = checkForJavascript() && $use_previewPane; |
73 | $empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php'; |
505e00aa |
74 | |
75 | |
76 | /** Begin template **/ |
77 | if ($nav_on_top) { |
78 | $table_class = 'bottom'; |
79 | $plugin_hook = 'read_body_menu_buttons_top'; |
80 | } else { |
81 | $table_class = 'top'; |
82 | $plugin_hook = 'read_body_menu_buttons_bottom'; |
83 | } |
84 | ?> |
85 | <div class="readMenuBar"> |
86 | <table class="<?php echo $table_class; ?>" cellspacing="0"> |
87 | <tr class="buttons"> |
88 | <td class="buttons"> |
89a067ff |
89 | <form name="composeForm" action="<?php |
90 | echo $compose_href . '" ' |
91 | . (!empty($form_method) ? 'method="' . $form_method . '" ' : '') |
92 | . (!empty($form_target) ? 'target="' . $form_target . '" ' : '') |
93 | . (!empty($form_onsubmit) ? 'onsubmit="' . $form_onsubmit . '" ' : '') |
94 | . $form_extra; ?> > |
505e00aa |
95 | <small> |
96 | <?php |
97 | if ($can_resume_draft) { |
98 | ?> |
0be2024f |
99 | <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" onclick="<?php echo $button_onclick; ?>" /> |
505e00aa |
100 | <?php |
101 | } elseif ($can_edit_as_new) { |
102 | ?> |
0be2024f |
103 | <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" onclick="<?php echo $button_onclick; ?>" /> |
505e00aa |
104 | <?php |
105 | } |
106 | ?> |
8949acd6 |
107 | <input type="submit" name="smaction_reply" <?php if ($accesskey_read_msg_reply != 'NONE') echo 'accesskey="' . $accesskey_read_msg_reply . '" '; ?>value="<?php echo _("Reply"); ?>" onclick="<?php echo $button_onclick; ?>" /> |
108 | <input type="submit" name="smaction_reply_all" <?php if ($accesskey_read_msg_reply_all != 'NONE') echo 'accesskey="' . $accesskey_read_msg_reply_all . '" '; ?>value="<?php echo _("Reply All"); ?>" onclick="<?php echo $button_onclick; ?>" /> |
505e00aa |
109 | | |
8949acd6 |
110 | <input type="submit" name="smaction_forward" <?php if ($accesskey_read_msg_forward != 'NONE') echo 'accesskey="' . $accesskey_read_msg_forward . '" '; ?>value="<?php echo _("Forward"); ?>" onclick="<?php echo $button_onclick; ?>" /> |
505e00aa |
111 | <?php |
112 | if ($forward_as_attachment_enabled) { |
113 | ?> |
8949acd6 |
114 | <input type="checkbox" name="smaction_attache" id="smaction_attache" <?php if ($accesskey_read_msg_as_attach != 'NONE') echo 'accesskey="' . $accesskey_read_msg_as_attach . '" '; ?>/> |
505e00aa |
115 | <label for="smaction_attache"><?php echo _("As Attachment"); ?></label> |
116 | <?php |
117 | } |
118 | ?> |
119 | </small> |
120 | </form> |
121 | | |
122 | <?php |
123 | if ($can_be_deleted) { |
124 | ?> |
12b5083f |
125 | <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="post"> |
199a9ab8 |
126 | <input type="hidden" name="smtoken" value="<?php echo sm_generate_security_token(); ?>" /> |
505e00aa |
127 | <?php echo $delete_form_extra; ?> |
128 | <small> |
8949acd6 |
129 | <input type="submit" name="delete" <?php if ($accesskey_read_msg_delete != 'NONE') echo 'accesskey="' . $accesskey_read_msg_delete . '" '; ?>value="<?php |
505e00aa |
130 | |
131 | echo _("Delete") .'"'; |
132 | |
133 | /** if preview pane turned on with "always refresh message list", |
134 | refresh message list frame too, but only if we are in the bottom frame! */ |
135 | if ($show_preview_pane && $pp_refresh_message_list) |
136 | echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "'; |
137 | |
138 | echo ' />'; ?> |
139 | |
8949acd6 |
140 | <input type="checkbox" name="bypass_trash" id="bypass_trash" <?php if ($accesskey_read_msg_bypass_trash != 'NONE') echo 'accesskey="' . $accesskey_read_msg_bypass_trash . '" '; ?>/><label for="bypass_trash"><?php echo _("Bypass Trash"); ?></label> |
505e00aa |
141 | </small> |
142 | </form> |
143 | <?php |
144 | } |
145 | ?> |
146 | <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?> |
147 | </td> |
148 | <td class="move"> |
149 | <?php |
150 | if ($can_be_moved) { |
151 | ?> |
12b5083f |
152 | <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="post"> |
199a9ab8 |
153 | <input type="hidden" name="smtoken" value="<?php echo sm_generate_security_token(); ?>" /> |
505e00aa |
154 | <?php echo $move_form_extra; ?> |
155 | <small> |
156 | <?php echo _("Move To"); ?>: |
8949acd6 |
157 | <select <?php if ($accesskey_read_msg_move_to != 'NONE') echo 'accesskey="' . $accesskey_read_msg_move_to . '" '; ?>name="targetMailbox"> |
505e00aa |
158 | <?php |
159 | foreach ($mailboxes as $value=>$option) { |
160 | echo '<option value="'. $value .'"' . ($value==$last_move_target ? ' selected="selected"' : '').'>' . $option .'</option>'."\n"; |
161 | } |
162 | ?> |
163 | </select> |
8949acd6 |
164 | <input type="submit" name="moveButton" <?php if ($accesskey_read_msg_move != 'NONE') echo 'accesskey="' . $accesskey_read_msg_move . '" '; ?>value="<?php |
505e00aa |
165 | |
166 | echo _("Move") . '"'; |
167 | |
168 | /** if preview pane turned on with "always refresh message list", |
169 | refresh message list frame too, but only if we are in the bottom frame! */ |
170 | if ($show_preview_pane && $pp_refresh_message_list) |
171 | echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "'; |
172 | |
173 | echo ' />'; |
174 | |
175 | |
176 | if ($can_be_copied) { |
177 | ?> |
8949acd6 |
178 | <input type="submit" name="copyButton" <?php if ($accesskey_read_msg_copy != 'NONE') echo 'accesskey="' . $accesskey_read_msg_copy . '" '; ?>value="<?php echo _("Copy"); ?>" /> |
505e00aa |
179 | <?php |
180 | } |
181 | ?> |
182 | </small> |
183 | </form> |
184 | <?php |
185 | } |
186 | ?> |
187 | </td> |
188 | </tr> |
189 | </table> |
190 | </div> |