Browse Source

fix for text box focus on read_body.php. Ryan, adding a simple case block causes errors with E_ALL and breaks the 'compose in new window' option when launched from read_body.php. This fix disables the text box focus without warnings or breakage :)

jmunro 23 năm trước cách đây
mục cha
commit
9338de7027
1 tập tin đã thay đổi với 23 bổ sung3 xóa
  1. 23 3
      functions/page_header.php

+ 23 - 3
functions/page_header.php

@@ -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" .