Make useless hook useful (and rename to eliminate confusion)
[squirrelmail.git] / src / read_body.php
index 7078c95ef0035cedf731a965e6540234bbcfde93..2f653e681d78f82e0ef5fcb66faf4f19fba88ae7 100644 (file)
@@ -6,7 +6,7 @@
  * This file is used for reading the msgs array and displaying
  * the resulting emails in the right frame.
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -388,10 +388,10 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
         if ($mdn_user_support) {
             if ($header->dnt) {
                 $mdn_url = $PHP_SELF;
-                $mdn_url = set_url_var($PHP_SELF, 'mailbox', urlencode($mailbox));
-                $mdn_url = set_url_var($PHP_SELF, 'passed_id', $passed_id);
-                $mdn_url = set_url_var($PHP_SELF, 'passed_ent_id', $passed_ent_id);
-                $mdn_url = set_url_var($PHP_SELF, 'sendreceipt', 1);
+                $mdn_url = set_url_var($mdn_url, 'mailbox', urlencode($mailbox));
+                $mdn_url = set_url_var($mdn_url, 'passed_id', $passed_id);
+                $mdn_url = set_url_var($mdn_url, 'passed_ent_id', $passed_ent_id);
+                $mdn_url = set_url_var($mdn_url, 'sendreceipt', 1);
 
                 $oTemplate->assign('read_receipt_sent', $message->is_mdnsent);
                 $oTemplate->assign('first_time_reading', $FirstTimeSee);
@@ -553,7 +553,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
     // Start form for reply/reply all/forward..
     $target = '';
     $on_click='';
-    $method='method="post" ';
+    $method='post';
     $onsubmit='';
     if ($compose_new_win == '1') {
         if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
@@ -565,10 +565,10 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
         if ( checkForJavascript() ) {
           $on_click=' onclick="comp_in_new_form(\''.$comp_uri.'\', this, this.form,'. $compose_width .',' . $compose_height .')"';
           $comp_uri = 'javascript:void(0)';
-          $method='method="get" ';
-          $onsubmit = 'onsubmit="return false" ';
+          $method='get';
+          $onsubmit = 'return false';
         } else {
-          $target = 'target="_blank"';
+          $target = '_blank';
         }
     }
 
@@ -584,7 +584,10 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
     $oTemplate->assign('message_list_href', $msg_list_href);
     $oTemplate->assign('search_href', $search_href);
 
-    $oTemplate->assign('form_extra', $method . $target . $onsubmit);
+    $oTemplate->assign('form_extra', '');
+    $oTemplate->assign('form_method', $method);
+    $oTemplate->assign('form_target', $target);
+    $oTemplate->assign('form_onsubmit', $onsubmit);
     $oTemplate->assign('compose_href', $comp_uri);
     $oTemplate->assign('button_onclick', $on_click);
     $oTemplate->assign('forward_as_attachment_enabled', $enable_forward_as_attachment==1);
@@ -634,6 +637,9 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
         $oTemplate->assign('can_be_copied', false);
     }
 
+    global $null;
+    do_hook('read_body_menu', $null);
+
     if ($nav_on_top) {
         $oTemplate->display('read_menubar_nav.tpl');
         $oTemplate->display('read_menubar_buttons.tpl');
@@ -642,8 +648,6 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
         $oTemplate->display('read_menubar_nav.tpl');
     }
 
-    global $null;
-    do_hook('read_body_menu_bottom', $null);
 }
 
 function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {