read_menubar_nav.tpl 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. * *
  40. * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  41. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  42. * @version $Id: read_menubar_nav.tpl 11850 2006-10-06 21:57:26Z stevetruckstuff $
  43. * @package squirrelmail
  44. * @subpackage templates
  45. */
  46. /** add required includes **/
  47. /** extract template variables **/
  48. extract($t);
  49. /*FIXME: This is a place where Marc's idea for putting all the buttons and
  50. links and other widgets into an array is sorely needed instead of
  51. hard-coding everything. Whomever implements that, PLEASE, PLEASE
  52. look at how the preview pane plugin code is used here to change
  53. some links and buttons and make sure your implementation can support
  54. it (tip: it may or may not be OK to let a plugin do the modification
  55. of the widgets, since a template set can turn on the needed plugin,
  56. but that might not be the most clear way to solve said issue).*/
  57. /** preview pane prep */
  58. global $data_dir, $username, $base_uri;
  59. $pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_list', 1);
  60. $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
  61. $show_preview_pane = checkForJavascript() && $use_previewPane;
  62. $empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php';
  63. /** Begin template **/
  64. if ($nav_on_top) {
  65. $table_class = 'top';
  66. $plugin_hook = 'read_body_menu_nav_top';
  67. } else {
  68. $table_class = 'bottom';
  69. $plugin_hook = 'read_body_menu_nav_bottom';
  70. }
  71. ?>
  72. <div class="readMenuBar">
  73. <table cellspacing="0" class="<?php echo $table_class; ?>">
  74. <tr class="nav">
  75. <td class="nav">
  76. <small>
  77. [
  78. <?php
  79. if (empty($prev_href)) {
  80. echo _("Previous");
  81. } else {
  82. ?>
  83. <a href="<?php echo $prev_href; ?><?php
  84. /** if preview pane turned on with "always refresh message list",
  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) */
  88. if ($show_preview_pane && $pp_refresh_message_list)
  89. // old code: unconditional refresh
  90. //echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
  91. echo '&amp;pp_rr=1';
  92. echo '">' . _("Previous"); ?></a>
  93. <?php
  94. }
  95. ?> |
  96. <?php
  97. if (empty($up_href)) {
  98. # Do nothing
  99. } else {
  100. ?>
  101. <a href="<?php echo $up_href; ?>"><?php echo _("Up"); ?></a> |
  102. <?php
  103. }
  104. if (empty($next_href)) {
  105. echo _("Next");
  106. } else {
  107. ?>
  108. <a href="<?php echo $next_href; ?><?php
  109. /** if preview pane turned on with "always refresh message list",
  110. refresh message list frame too, but only if we are in the bottom frame!
  111. and make sure the refresh is conditional upon the seen flag of the
  112. message after it is loaded (see read_headers.tpl) */
  113. if ($show_preview_pane && $pp_refresh_message_list)
  114. // old code: unconditional refresh
  115. //echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
  116. echo '&amp;pp_rr=1';
  117. echo '">' . _("Next"); ?></a>
  118. <?php
  119. }
  120. ?>
  121. ]
  122. &nbsp;&nbsp;&nbsp;&nbsp;
  123. <?php
  124. if (!empty($del_prev_href) || !empty($del_next_href)) {
  125. ?>
  126. [
  127. <?php
  128. if (empty($del_prev_href)) {
  129. echo _("Delete &amp; Previous");
  130. } else {
  131. ?>
  132. <a href="<?php echo $del_prev_href; ?>"<?php
  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. echo '>' . _("Delete &amp; Previous"); ?></a>
  138. <?php
  139. }
  140. ?>
  141. |
  142. <?php
  143. if (empty($del_next_href)) {
  144. echo _("Delete &amp; Next");
  145. } else {
  146. ?>
  147. <a href="<?php echo $del_next_href; ?>"<?php
  148. /** if preview pane turned on with "always refresh message list",
  149. refresh message list frame too, but only if we are in the bottom frame! */
  150. if ($show_preview_pane && $pp_refresh_message_list)
  151. echo ' onclick="if (self.name == \'bottom\') { refresh_message_list(); } "';
  152. echo '>' . _("Delete &amp; Next"); ?></a>
  153. <?php
  154. }
  155. ?>
  156. ]
  157. &nbsp;&nbsp;&nbsp;&nbsp;
  158. <?php
  159. }
  160. if (!empty($view_msg_href)) {
  161. ?>
  162. [ <a href="<?php echo $view_msg_href; ?>"><?php echo _("View Message"); ?></a> ]
  163. &nbsp;&nbsp;&nbsp;&nbsp;
  164. <?php
  165. }
  166. ?>
  167. [ <a href="<?php echo $message_list_href; ?>"<?php
  168. /** if preview pane turned on, retarget to message list frame & clear
  169. bottom frame, but only if we are in the bottom frame! */
  170. if ($show_preview_pane)
  171. echo ' onclick="if (self.name == \'bottom\') { parent.right.document.location=\'' . $message_list_href . '\'; document.location=\'' . $empty_frame_uri . '\'; return false; } "';
  172. echo '>' . _("Message List"); ?></a>
  173. <?php
  174. if (!empty($search_href)) {
  175. ?>
  176. | <a href="<?php echo $search_href; ?>"><?php echo _("Search Results"); ?></a>
  177. <?php
  178. }
  179. ?>
  180. ]
  181. </small>
  182. <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?>
  183. </td>
  184. </tr>
  185. </table>
  186. </div>