Fix a variable typo.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 16 Apr 2005 14:20:38 +0000 (14:20 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 16 Apr 2005 14:20:38 +0000 (14:20 +0000)
Move the inclusion of default.js to before the extra JS code in page_header,
because the extra code may use functions from default.js (eg Forward as
Attachment, which was broken).

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9313 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/page_header.php

index 6493e63edb1e97312cd9ef85c072060f125d4c55..91b5c9a6140463d94f373eb169b6f190adb9aca5 100644 (file)
@@ -153,14 +153,12 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = 'onloa
     }
 
     if( $javascript_on || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
+        $sJsBlock = '<script src="'. SM_PATH .'templates/default/js/default.js" type="text/javascript" language="JavaScript"></script>' ."\n";
         if ($sHeaderJs) {
-            $sJsBlock = "\n<script language=\"JavaScript\" type=\"text/javascript\">" .
+            $sJsBlock .= "\n<script language=\"JavaScript\" type=\"text/javascript\">" .
                         "\n<!--\n" .
-                        $sJsHeader . "\n\n// -->\n</script>\n";
-        } else {
-           $sJsBlock = '';
+                        $sHeaderJs . "\n\n// -->\n</script>\n";
         }
-        $sJsBlock .= "\n" . '<script src="'. SM_PATH .'templates/default/js/default.js" type="text/javascript" language="JavaScript"></script>' ."\n";
         displayHtmlHeader ('SquirrelMail', $sJsBlock);
    } else {
         /* do not use JavaScript */
@@ -246,7 +244,7 @@ function compose_Header($color, $mailbox, $sHeaderJs='', $sBodyTagJs = 'onload="
         if ($sHeaderJs) {
             $sJsBlock = "\n<script language=\"JavaScript\" type=\"text/javascript\">" .
                         "\n<!--\n" .
-                        $sJsHeader . "\n\n// -->\n</script>\n";
+                        $sHeaderJs . "\n\n// -->\n</script>\n";
         } else {
            $sJsBlock = '';
         }