Update copyright
[squirrelmail.git] / templates / default_advanced / read_menubar_buttons.tpl
index 59bd60294bce0f4c86155a0ab6df4834b9530329..667f72b8d3619e9f73ab2ab9ab1c83a721572c2d 100644 (file)
  *    $view_msg_href - URL to go back to the main message.  Empty if N/A.
  *    $msg_list_href - URL to go to the message list.
  *    $search_href   - URL to go back to the serach results.  Empty if N/A.
- *    $form_extra    - Extra elements required by the forms to delete, move or copy
+ *    $form_extra    - Extra elements that will be added to the <form> tag verbatim
+ *    $form_method   - The value of the <form>'s method attribute (optional, may be blank)
+ *    $form_target   - The value of the <form>'s target attribute (optional, may be blank)
+ *    $form_onsubmit - The value of the <form>'s onsubmit handler (optional, may be blank)
  *    $compose_href  - Base URL to forward, reply, etc.  Note that a specific action
  *                     must also be given by the form or in this URL.
- *    $on_click      - Onclick event string for all buttons
+ *    $button_onclick - Onclick event string for all buttons
  *    $forward_as_attachment_enabled - boolean TRUE if forwarding as attachments
  *                     has been enabled.
  *    $can_resume_draft - boolean TRUE if the "resume draft" is legitimate for
  *    $delete_form_extra - additional input elements needed by the DELETE form
  *    $move_form_extra - additional input elements needed by the MOVE form.
  *    $last_move_target - the last folder that a message was moved/copied to. 
+ *    $accesskey_read_msg_reply        - The accesskey to be used for the Reply button
+ *    $accesskey_read_msg_reply_all    - The accesskey to be used for the Reply All button
+ *    $accesskey_read_msg_forward      - The accesskey to be used for the Forward button
+ *    $accesskey_read_msg_as_attach    - The accesskey to be used for the As Attachment checkbox
+ *    $accesskey_read_msg_delete       - The accesskey to be used for the Delete button
+ *    $accesskey_read_msg_bypass_trash - The accesskey to be used for the Bypass Trash checkbox
+ *    $accesskey_read_msg_move_to      - The accesskey to be used for the folder select list
+ *    $accesskey_read_msg_move         - The accesskey to be used for the Move button
+ *    $accesskey_read_msg_copy         - The accesskey to be used for the Copy button
  *    
  *
- * @copyright &copy; 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2013 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @version $Id: read_menubar_buttons.tpl 11850 2006-10-06 21:57:26Z stevetruckstuff $
+ * @version $Id$
  * @package squirrelmail
  * @subpackage templates
  */
 extract($t);
 
 
-/*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).*/
-
+/*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).*/
 
 /** preview pane prep */
 global $data_dir, $username, $base_uri;
@@ -67,14 +71,6 @@ $pp_refresh_message_list = getPref($data_dir, $username, 'pp_refresh_message_lis
 $use_previewPane = getPref($data_dir, $username, 'use_previewPane', 0);
 $show_preview_pane = checkForJavascript() && $use_previewPane;
 $empty_frame_uri = $base_uri . 'plugins/preview_pane/empty_frame.php';
-if ($show_preview_pane) { ?>
-   <script>
-   <!--
-      function refresh_message_list()
-      { parent.right.delayed_page_load("<?php echo $message_list_href; ?>"); }
-   // -->
-   </script>
-<?php }
 
 
 /** Begin template **/
@@ -90,27 +86,32 @@ if ($nav_on_top) {
 <table class="<?php echo $table_class; ?>" cellspacing="0">
  <tr class="buttons">
   <td class="buttons">
-   <form name="composeForm" action="<?php echo $compose_href; ?>" <?php echo $form_extra; ?> >
+   <form name="composeForm" action="<?php
+                  echo $compose_href . '" '
+                     . (!empty($form_method) ? 'method="' . $form_method . '" ' : '')
+                     . (!empty($form_target) ? 'target="' . $form_target . '" ' : '')
+                     . (!empty($form_onsubmit) ? 'onsubmit="' . $form_onsubmit . '" ' : '')
+                     . $form_extra; ?> >
    <small>
     <?php
         if ($can_resume_draft) {
             ?>
-    <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" <?php echo $button_onclick; ?> />&nbsp;
+    <input type="submit" name="smaction_draft" value="<?php echo _("Resume Draft"); ?>" onclick="<?php echo $button_onclick; ?>" />&nbsp;
             <?php
         } elseif ($can_edit_as_new) {
             ?>
-    <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" <?php echo $button_onclick; ?> />&nbsp;
+    <input type="submit" name="smaction_edit_new" value="<?php echo _("Edit Message as New"); ?>" onclick="<?php echo $button_onclick; ?>" />&nbsp;
             <?php
         }
     ?>
-    <input type="submit" name="smaction_reply" value="<?php echo _("Reply"); ?>" <?php echo $button_onclick; ?> />&nbsp;
-    <input type="submit" name="smaction_reply_all" value="<?php echo _("Reply All"); ?>" <?php echo $button_onclick; ?> />
+    <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; ?>" />&nbsp;
+    <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; ?>" />
     &nbsp;&nbsp;|&nbsp;&nbsp;
-    <input type="submit" name="smaction_forward" value="<?php echo _("Forward"); ?>" <?php echo $button_onclick; ?> />
+    <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; ?>" />
     <?php
     if ($forward_as_attachment_enabled) {
         ?>
-    <input type="checkbox" name="smaction_attache" id="smaction_attache">
+    <input type="checkbox" name="smaction_attache" id="smaction_attache" <?php if ($accesskey_read_msg_as_attach != 'NONE') echo 'accesskey="' . $accesskey_read_msg_as_attach . '" '; ?>/>
     <label for="smaction_attache"><?php echo _("As Attachment"); ?></label>
         <?php
     }
@@ -121,10 +122,11 @@ if ($nav_on_top) {
     <?php
     if ($can_be_deleted) {
         ?>
-    <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST">
+    <form name="deleteMessageForm" action="<?php echo $move_delete_form_action; ?>" method="post">
+     <input type="hidden" name="smtoken" value="<?php echo sm_generate_security_token(); ?>" />
      <?php echo $delete_form_extra; ?>
      <small>
-     <input type="submit" name="delete" value="<?php 
+     <input type="submit" name="delete" <?php if ($accesskey_read_msg_delete != 'NONE') echo 'accesskey="' . $accesskey_read_msg_delete . '" '; ?>value="<?php 
 
 echo _("Delete") .'"';
 
@@ -135,7 +137,7 @@ if ($show_preview_pane && $pp_refresh_message_list)
 
 echo ' />'; ?>
 
-     <input type="checkbox" name="bypass_trash" id="bypass_trash"><label for="bypass_trash"><?php echo _("Bypass Trash"); ?></label>
+     <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>
      </small>
     </form>
         <?php
@@ -147,18 +149,19 @@ echo ' />'; ?>
    <?php
     if ($can_be_moved) {
         ?>
-    <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="POST">
+    <form name="moveMessageForm" action="<?php echo $move_delete_form_action; ?>" method="post">
+     <input type="hidden" name="smtoken" value="<?php echo sm_generate_security_token(); ?>" />
      <?php echo $move_form_extra; ?>
      <small>
      <?php echo _("Move To"); ?>:
-     <select name="targetMailbox">
+     <select <?php if ($accesskey_read_msg_move_to != 'NONE') echo 'accesskey="' . $accesskey_read_msg_move_to . '" '; ?>name="targetMailbox">
      <?php
         foreach ($mailboxes as $value=>$option) {
             echo '<option value="'. $value .'"' . ($value==$last_move_target ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
         }
      ?>
      </select>
-     <input type="submit" name="moveButton" value="<?php 
+     <input type="submit" name="moveButton" <?php if ($accesskey_read_msg_move != 'NONE') echo 'accesskey="' . $accesskey_read_msg_move . '" '; ?>value="<?php 
 
 echo _("Move") . '"'; 
 
@@ -172,7 +175,7 @@ echo ' />';
 
         if ($can_be_copied) {
             ?>
-     <input type="submit" name="copyButton" value="<?php echo _("Copy"); ?>" />
+     <input type="submit" name="copyButton" <?php if ($accesskey_read_msg_copy != 'NONE') echo 'accesskey="' . $accesskey_read_msg_copy . '" '; ?>value="<?php echo _("Copy"); ?>" />
             <?php
         }
      ?>