fix for text box focus on read_body.php. Ryan, adding a simple case block causes...
[squirrelmail.git] / functions / page_header.php
index dc33315c94d9008eb65cf5cd2a33fa69b8d7b2fb..03a71fe76bd58ba1f4d5000973bf9d4a15f738c1 100644 (file)
@@ -60,6 +60,29 @@ function displayPageHeader($color, $mailbox, $xtra='') {
         Locate the first displayable form element
     */
     switch ( $module ) {
+    case 'src/read_body.php':
+            if ($compose_new_win == '1') {
+                if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
+                    $compose_width = '640';
+                }
+                if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
+                    $compose_height = '550';
+                }
+                $js = "\n".'<script language="JavaScript" type="text/javascript">' .
+                    "\n<!--\n";
+                $js .= "function comp_in_new() {\n".
+                     "    var newwin = window.open(\"".$base_uri."src/compose.php\"".
+                     ", \"compose_window\",
+                \"width=".$compose_width.",height=$compose_height".
+                     ",scrollbars=yes,resizable=yes\");\n".
+                     "}\n";
+        $js .= "// -->\n".
+                "</script>\n";
+        displayHtmlHeader ('Squirrelmail', $js);
+            }
+        displayHtmlHeader();
+        $onload = '';
+        break;
     default:
         $js = '<script language="JavaScript" type="text/javascript">' .
              "\n<!--\n" .
@@ -177,9 +200,6 @@ function compose_Header($color, $mailbox) {
         $onload = "onLoad=\"document.forms[$pos].elements[2].focus();\"";
         displayHtmlHeader (_("Compose"));
         break;
-    case 'src/read_body.php':
-        displayHtmlHeader();
-        break;
     default:
         $js = '<script language="JavaScript" type="text/javascript">' .
              "\n<!--\n" .