missing sprintf around string
[squirrelmail.git] / functions / page_header.php
index 8014dd2918f9cfbc4082d09ab5360d2e99c87cb5..37d6c7dd1d6128333bb6a05fea058ddfc39168ab 100644 (file)
@@ -264,16 +264,36 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
             break;
 
         case 'src/right_main.php':
-// following code graciously stolen from phpMyAdmin project at:
-// http://www.phpmyadmin.net
-            $js = <<<EOS
+            global $fancy_index_highlite;
+            if (!$fancy_index_highlite) {
+                $js = '';
+            } else //{ putting braces around this block creats strange PHP errors
+                // following code graciously borrowed from 
+                // phpMyAdmin project at:
+                // http://www.phpmyadmin.net
+                $js = <<<EOS
 /**
  * This array is used to remember mark status of rows in browse mode
  */
 var marked_row = new Array;
 
 
-/**
+/* 
+ * (un)Checks checkbox for the row that the current table cell is in
+ * when it gets clicked.
+ *
+ * @param   string   the name of the checkbox that should be (un)checked
+ */
+function row_click(chkboxName) {
+    chkbox = document.getElementById(chkboxName);
+    if (chkbox) { 
+        chkbox.checked = (chkbox.checked ? false : true); 
+    }
+}
+
+
+
+/*
  * Sets/unsets the pointer and marker in browse mode
  *
  * @param   object    the table row
@@ -403,6 +423,7 @@ function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerCol
     return true;
 } // end of the 'setPointer()' function
 EOS;
+            //} putting braces around this block creats strange PHP errors
             $js = "\n".'<script language="JavaScript" type="text/javascript">' .
                         "\n<!--\n" . $js;
             if ($compose_new_win == '1') {
@@ -412,7 +433,7 @@ EOS;
                 if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
                     $compose_height = '550';
                 }
-                $js .= "\nfunction comp_in_new(comp_uri) {\n".
+                $js .= "\n\nfunction comp_in_new(comp_uri) {\n".
                      "       if (!comp_uri) {\n".
                      '           comp_uri = "'.$compose_uri."\";\n".
                      '       }'. "\n".
@@ -422,7 +443,7 @@ EOS;
                      ',scrollbars=yes,resizable=yes,status=yes");'."\n".
                      "}\n\n";
             }
-            $js .= "// -->\n</script>\n";
+            $js .= $xtra . "\n\n// -->\n</script>\n";
             $onload = '';
             displayHtmlHeader ('SquirrelMail', $js);
             break;