fix for text box focus on read_body.php. Ryan, adding a simple case block causes...
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 14 May 2002 15:13:29 +0000 (15:13 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 14 May 2002 15:13:29 +0000 (15:13 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2821 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/page_header.php

index dc33315..03a71fe 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" .