| 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. |
| 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 | * |
| 41 | * @copyright © 1999-2006 The SquirrelMail Project Team |
| 42 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
| 43 | * @version $Id$ |
| 44 | * @package squirrelmail |
| 45 | * @subpackage templates |
| 46 | */ |
| 47 | |
| 48 | /** add required includes **/ |
| 49 | |
| 50 | /** extract template variables **/ |
| 51 | extract($t); |
| 52 | |
| 53 | /** Begin template **/ |
| 54 | if ($nav_on_top) { |
| 55 | $table_class = 'bottom'; |
| 56 | $plugin_hook = 'read_body_menu_buttons_top'; |
| 57 | } else { |
| 58 | $table_class = 'top'; |
| 59 | $plugin_hook = 'read_body_menu_buttons_bottom'; |
| 60 | } |
| 61 | ?> |
| 62 | <div class="readMenuBar"> |
| 63 | <table class="<?php echo $table_class; ?>" cellspacing="0"> |
| 64 | <tr class="buttons"> |
| 65 | <td class="buttons"> |
| 66 | <form name="composeForm" action="<?php echo $compose_href; ?>" <?php echo $form_extra; ?> > |
| 67 | <small> |
| 68 | <?php |
| 69 | if ($can_resume_draft) { |
| 70 | ?> |
| 71 | <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" <?php echo $button_onclick; ?> /> |
| 72 | <?php |
| 73 | } elseif ($can_edit_as_new) { |
| 74 | ?> |
| 75 | <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" <?php echo $button_onclick; ?> /> |
| 76 | <?php |
| 77 | } |
| 78 | ?> |
| 79 | <input type="submit" name="smaction_reply" value="<?php echo _("Reply"); ?>" <?php echo $button_onclick; ?> /> |
| 80 | <input type="submit" name="smaction_reply_all" value="<?php echo _("Reply All"); ?>" <?php echo $button_onclick; ?> /> |
| 81 | | |
| 82 | <input type="submit" name="smaction_forward" value="<?php echo _("Forward"); ?>" <?php echo $button_onclick; ?> /> |
| 83 | <?php |
| 84 | if ($forward_as_attachment_enabled) { |
| 85 | ?> |
| 86 | <input type="checkbox" name="smaction_attache" id="smaction_attache"> |
| 87 | <label for="smaction_attache"><?php echo _("As Attachment"); ?></label> |
| 88 | <?php |
| 89 | } |
| 90 | ?> |
| 91 | </small> |
| 92 | </form> |
| 93 | | |
| 94 | <?php |
| 95 | if ($can_be_deleted) { |
| 96 | ?> |
| 97 | <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST"> |
| 98 | <?php echo $delete_form_extra; ?> |
| 99 | <small> |
| 100 | <input type="submit" name="delete" value="<?php echo _("Delete"); ?>" /> |
| 101 | <input type="checkbox" name="bypass_trash" id="bypass_trash"><label for="bypass_trash"><?php echo _("Bypass Trash"); ?></label> |
| 102 | </small> |
| 103 | </form> |
| 104 | <?php |
| 105 | } |
| 106 | ?> |
| 107 | <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?> |
| 108 | </td> |
| 109 | <td class="move"> |
| 110 | <?php |
| 111 | if ($can_be_moved) { |
| 112 | ?> |
| 113 | <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST"> |
| 114 | <?php echo $move_form_extra; ?> |
| 115 | <small> |
| 116 | <?php echo _("Move To"); ?>: |
| 117 | <select name="targetMailbox"> |
| 118 | <?php |
| 119 | foreach ($mailboxes as $value=>$option) { |
| 120 | echo '<option value="'. $value .'"' . ($value==$last_move_target ? ' selected="selected"' : '').'>' . $option .'</option>'."\n"; |
| 121 | } |
| 122 | ?> |
| 123 | </select> |
| 124 | <input type="submit" name="moveButton" value="<?php echo _("Move"); ?>" /> |
| 125 | <?php |
| 126 | if ($can_be_copied) { |
| 127 | ?> |
| 128 | <input type="submit" name="copyButton" value="<?php echo _("Copy"); ?>" /> |
| 129 | <?php |
| 130 | } |
| 131 | ?> |
| 132 | </small> |
| 133 | </form> |
| 134 | <?php |
| 135 | } |
| 136 | ?> |
| 137 | </td> |
| 138 | </tr> |
| 139 | </table> |
| 140 | </div> |