| 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 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) |
| 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. |
| 26 | * $on_click - Onclick event string for all buttons |
| 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 © 1999-2006 The SquirrelMail Project Team |
| 45 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
| 46 | * @version $Id$ |
| 47 | * @package squirrelmail |
| 48 | * @subpackage templates |
| 49 | */ |
| 50 | |
| 51 | /** add required includes **/ |
| 52 | |
| 53 | /** extract template variables **/ |
| 54 | extract($t); |
| 55 | |
| 56 | /*FIXME: This is a place where Marc's idea for putting all the buttons and |
| 57 | links and other widgets into an array is sorely needed instead of |
| 58 | hard-coding everything. Whomever implements that, PLEASE, PLEASE |
| 59 | look at how the preview pane plugin code is used in this same template |
| 60 | file for the *default_advanced* set to change some links and buttons |
| 61 | and make sure your implementation can support it (tip: it may or may |
| 62 | not be OK to let a plugin do the modification of the widgets, since |
| 63 | a template set can turn on the needed plugin, but that might not be |
| 64 | the most clear way to solve said issue).*/ |
| 65 | |
| 66 | |
| 67 | /** Begin template **/ |
| 68 | if ($nav_on_top) { |
| 69 | $table_class = 'bottom'; |
| 70 | $plugin_hook = 'read_body_menu_buttons_top'; |
| 71 | } else { |
| 72 | $table_class = 'top'; |
| 73 | $plugin_hook = 'read_body_menu_buttons_bottom'; |
| 74 | } |
| 75 | ?> |
| 76 | <div class="readMenuBar"> |
| 77 | <table class="<?php echo $table_class; ?>" cellspacing="0"> |
| 78 | <tr class="buttons"> |
| 79 | <td class="buttons"> |
| 80 | <form name="composeForm" action="<?php |
| 81 | echo $compose_href . '" ' |
| 82 | . (!empty($form_method) ? 'method="' . $form_method . '" ' : '') |
| 83 | . (!empty($form_target) ? 'target="' . $form_target . '" ' : '') |
| 84 | . (!empty($form_onsubmit) ? 'onsubmit="' . $form_onsubmit . '" ' : '') |
| 85 | . $form_extra; ?> > |
| 86 | <small> |
| 87 | <?php |
| 88 | if ($can_resume_draft) { |
| 89 | ?> |
| 90 | <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" <?php echo $button_onclick; ?> /> |
| 91 | <?php |
| 92 | } elseif ($can_edit_as_new) { |
| 93 | ?> |
| 94 | <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" <?php echo $button_onclick; ?> /> |
| 95 | <?php |
| 96 | } |
| 97 | ?> |
| 98 | <input type="submit" name="smaction_reply" value="<?php echo _("Reply"); ?>" <?php echo $button_onclick; ?> /> |
| 99 | <input type="submit" name="smaction_reply_all" value="<?php echo _("Reply All"); ?>" <?php echo $button_onclick; ?> /> |
| 100 | | |
| 101 | <input type="submit" name="smaction_forward" value="<?php echo _("Forward"); ?>" <?php echo $button_onclick; ?> /> |
| 102 | <?php |
| 103 | if ($forward_as_attachment_enabled) { |
| 104 | ?> |
| 105 | <input type="checkbox" name="smaction_attache" id="smaction_attache"> |
| 106 | <label for="smaction_attache"><?php echo _("As Attachment"); ?></label> |
| 107 | <?php |
| 108 | } |
| 109 | ?> |
| 110 | </small> |
| 111 | </form> |
| 112 | | |
| 113 | <?php |
| 114 | if ($can_be_deleted) { |
| 115 | ?> |
| 116 | <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST"> |
| 117 | <?php echo $delete_form_extra; ?> |
| 118 | <small> |
| 119 | <input type="submit" name="delete" value="<?php echo _("Delete"); ?>" /> |
| 120 | <input type="checkbox" name="bypass_trash" id="bypass_trash"><label for="bypass_trash"><?php echo _("Bypass Trash"); ?></label> |
| 121 | </small> |
| 122 | </form> |
| 123 | <?php |
| 124 | } |
| 125 | ?> |
| 126 | <?php if(!empty($plugin_output[$plugin_hook])) echo $plugin_output[$plugin_hook]; ?> |
| 127 | </td> |
| 128 | <td class="move"> |
| 129 | <?php |
| 130 | if ($can_be_moved) { |
| 131 | ?> |
| 132 | <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST"> |
| 133 | <?php echo $move_form_extra; ?> |
| 134 | <small> |
| 135 | <?php echo _("Move To"); ?>: |
| 136 | <select name="targetMailbox"> |
| 137 | <?php |
| 138 | foreach ($mailboxes as $value=>$option) { |
| 139 | echo '<option value="'. $value .'"' . ($value==$last_move_target ? ' selected="selected"' : '').'>' . $option .'</option>'."\n"; |
| 140 | } |
| 141 | ?> |
| 142 | </select> |
| 143 | <input type="submit" name="moveButton" value="<?php echo _("Move"); ?>" /> |
| 144 | <?php |
| 145 | if ($can_be_copied) { |
| 146 | ?> |
| 147 | <input type="submit" name="copyButton" value="<?php echo _("Copy"); ?>" /> |
| 148 | <?php |
| 149 | } |
| 150 | ?> |
| 151 | </small> |
| 152 | </form> |
| 153 | <?php |
| 154 | } |
| 155 | ?> |
| 156 | </td> |
| 157 | </tr> |
| 158 | </table> |
| 159 | </div> |