Better hook placement
[squirrelmail.git] / src / webmail.php
index c8af2939e7ca39334a479b6cdc98874fa787ebb1..a2bc1c2e670d2454e360ec9c7ab06614331ad0ba 100644 (file)
@@ -31,8 +31,10 @@ if (!sqgetGlobalVar('mailbox', $mailbox)) {
 
 sqgetGlobalVar('right_frame', $right_frame, SQ_GET);
 
-if(!sqgetGlobalVar('mailto', $mailto)) {
-    $mailto = '';
+if(!sqgetGlobalVar('mailtodata', $mailtodata)) {
+    $mailtourl = 'mailtodata='.urlencode($mailtodata);
+} else {
+    $mailtourl = '';
 }
 
 // Determine the size of the left frame
@@ -95,7 +97,7 @@ switch($right_frame) {
         $right_frame_url = 'folders.php';
         break;
     case 'compose.php':
-        $right_frame_url = 'compose.php?' . $mailto;
+        $right_frame_url = 'compose.php?' . $mailtourl;
         break;
     case '':
         $right_frame_url = 'right_main.php';
@@ -105,15 +107,16 @@ switch($right_frame) {
         break;
 }
 
-displayHtmlHeader($org_title, '', false, true);
 $oErrorHandler->setDelayedErrors(true);
 
-do_hook('webmail_top');
-
 $oTemplate->assign('nav_size', $left_size);
 $oTemplate->assign('nav_on_left', $location_of_bar=='left');
 $oTemplate->assign('right_frame_url', $right_frame_url);
 
+do_hook('webmail_top', $null);
+
+displayHtmlHeader($org_title, '', false, true);
+
 $oTemplate->display('webmail.tpl');
 
-$oTemplate->display('footer.tpl');
\ No newline at end of file
+$oTemplate->display('footer.tpl');