Happy New Year
[squirrelmail.git] / templates / default_advanced / read_menubar_nav.tpl
CommitLineData
505e00aa 1<?php
2/**
3 * read_menubar_nav.tpl
4 *
5 * Template to generate the nav buttons while reading a message, e.g. "Previous",
6 * "Next", "Delete & Previous", etc. When used in conjunction with the
7 * read_menubar_nav tempalte, the entire menubar is generated.
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.
20 * $form_extra - Extra elements required by the forms to delete, move or copy
21 * $compose_href - Base URL to forward, reply, etc. Note that a specific action
22 * must also be given by the form or in this URL.
23 * $on_click - Onclick event string for all buttons
24 * $forward_as_attachment_enabled - boolean TRUE if forwarding as attachments
25 * has been enabled.
26 * $can_resume_draft - boolean TRUE if the "resume draft" is legitimate for
27 * this message.
28 * $can_edit_as_new - boolean TRUE if the "reasume as new" action is legitimate
29 * for this message
30 * $mailboxes - array containing list of mailboxes available for move/copy action.
31 * $can_be_deleted - boolean TRUE if this message can be deleted.
32 * $can_be_moved - boolean TRUE if this message can be moved.
33 * $cab_be_copied - boolean TRUE if this message can be copied to another folder.
34 * $move_delete_form_action - the value for the ACTION attribute of forms to
35 * move, copy or delete a message
36 * $delete_form_extra - additional input elements needed by the DELETE form
37 * $move_form_extra - additional input elements needed by the MOVE form.
38 * $last_move_target - the last folder that a message was moved/copied to.
39 * *
c4faef33 40 * @copyright 1999-2020 The SquirrelMail Project Team
505e00aa 41 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
01144ffd 42 * @version $Id$
505e00aa 43 * @package squirrelmail
44 * @subpackage templates
45 */
46
47/** add required includes **/
48
49/** extract template variables **/
50extract($t);
51
52
541dedcd 53/*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 54
55/** preview pane prep */
56global $data_dir, $username, $base_uri;
57$pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
58$use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
59$show_preview_pane = checkForJavascript() && $use_previewPane;
60$empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php';
505e00aa 61
62
63/** Begin template **/
64
65if ($nav_on_top) {
66 $table_class = 'top';
67 $plugin_hook = 'read_body_menu_nav_top';
68} else {
69 $table_class = 'bottom';
70 $plugin_hook = 'read_body_menu_nav_bottom';
71}
72?>
73<div class="readMenuBar">
74<table cellspacing="0" class="<?php echo $table_class; ?>">
75 <tr class="nav">
76 <td class="nav">
77 <small>
dcc5e0d3 78 [&nbsp;<?php
505e00aa 79 if (empty($prev_href)) {
80 echo _("Previous");
81 } else {
dcc5e0d3 82 ?><a href="<?php echo $prev_href; ?><?php
505e00aa 83
84/** if preview pane turned on with "always refresh message list",
010ff205 85 refresh message list frame too, but only if we are in the bottom frame!
86 and make sure the refresh is conditional upon the seen flag of the
87 message after it is loaded (see read_headers.tpl) */
505e00aa 88if ($show_preview_pane && $pp_refresh_message_list)
010ff205 89 // old code: unconditional refresh
90 //echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
91 echo '&amp;pp_rr=1';
505e00aa 92
93
010ff205 94echo '">' . _("Previous"); ?></a>
505e00aa 95 <?php
96 }
97 ?> |
98 <?php
99 if (empty($up_href)) {
100 # Do nothing
101 } else {
102 ?>
103 <a href="<?php echo $up_href; ?>"><?php echo _("Up"); ?></a> |
104 <?php
105 }
106
107 if (empty($next_href)) {
108 echo _("Next");
109 } else {
110 ?>
010ff205 111 <a href="<?php echo $next_href; ?><?php
505e00aa 112
113/** if preview pane turned on with "always refresh message list",
010ff205 114 refresh message list frame too, but only if we are in the bottom frame!
115 and make sure the refresh is conditional upon the seen flag of the
116 message after it is loaded (see read_headers.tpl) */
505e00aa 117if ($show_preview_pane && $pp_refresh_message_list)
010ff205 118 // old code: unconditional refresh
119 //echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
120 echo '&amp;pp_rr=1';
505e00aa 121
122
dcc5e0d3 123echo '">' . _("Next"); ?></a><?php
505e00aa 124 }
dcc5e0d3 125 ?>&nbsp;]
505e00aa 126 &nbsp;&nbsp;&nbsp;&nbsp;
127 <?php
128 if (!empty($del_prev_href) || !empty($del_next_href)) {
129 ?>
dcc5e0d3 130 [&nbsp;<?php
505e00aa 131 if (empty($del_prev_href)) {
dcc5e0d3 132 echo '<span style="white-space: nowrap;">' . _("Delete &amp; Previous") . '</span>';
505e00aa 133 } else {
dcc5e0d3 134 ?><a href="<?php echo $del_prev_href; ?>"<?php
505e00aa 135
136/** if preview pane turned on with "always refresh message list",
137 refresh message list frame too, but only if we are in the bottom frame! */
138if ($show_preview_pane && $pp_refresh_message_list)
139 echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
140
141
dcc5e0d3 142echo ' style="white-space: nowrap;">' . _("Delete &amp; Previous"); ?></a>
505e00aa 143 <?php
144 }
145 ?>
146 |
147 <?php
148 if (empty($del_next_href)) {
dcc5e0d3 149 echo '<span style="white-space: nowrap;">' . _("Delete &amp; Next") . '</span>';
505e00aa 150 } else {
151 ?>
152 <a href="<?php echo $del_next_href; ?>"<?php
153
154/** if preview pane turned on with "always refresh message list",
155 refresh message list frame too, but only if we are in the bottom frame! */
156if ($show_preview_pane && $pp_refresh_message_list)
157 echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
158
159
dcc5e0d3 160echo ' style="white-space: nowrap;">' . _("Delete &amp; Next"); ?></a><?php
505e00aa 161 }
dcc5e0d3 162 ?>&nbsp;]
505e00aa 163 &nbsp;&nbsp;&nbsp;&nbsp;
164 <?php
165 }
166
167 if (!empty($view_msg_href)) {
168 ?>
dcc5e0d3 169 [&nbsp;<a href="<?php echo $view_msg_href; ?>" style="white-space: nowrap;"><?php echo _("View Message"); ?></a>&nbsp;]
505e00aa 170 &nbsp;&nbsp;&nbsp;&nbsp;
171 <?php
172 }
173 ?>
dcc5e0d3 174 [&nbsp;<a href="<?php echo $message_list_href; ?>"<?php
505e00aa 175
176/** if preview pane turned on, retarget to message list frame & clear
177 bottom frame, but only if we are in the bottom frame! */
178if ($show_preview_pane)
179 echo ' onclick="if (self.name == \'bottom\') { parent.right.document.location=\'' . $message_list_href . '\'; document.location=\'' . $empty_frame_uri . '\'; return false; } "';
180
181
dcc5e0d3 182echo ' style="white-space: nowrap;">' . _("Message List"); ?></a><?php
505e00aa 183 if (!empty($search_href)) {
184 ?>
dcc5e0d3 185 | <a href="<?php echo $search_href; ?>" style="white-space: nowrap;"><?php echo _("Search Results"); ?></a><?php
505e00aa 186 }
dcc5e0d3 187 ?>&nbsp;]
505e00aa 188 </small>
189 <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?>
190 </td>
191 </tr>
192</table>
193</div>