using internal SM functions to create page header.
[squirrelmail.git] / plugins / squirrelspell / sqspell_functions.php
index 4acf28d3395643bdca400e760859ab00222b4991..e931496cd4abd452904350d06e655d4a5d609fd0 100644 (file)
@@ -47,7 +47,7 @@ function sqspell_makePage($title, $scriptsrc, $body){
           html_tag( 'td', '<strong>' . $title .'</strong>', 'center', $color[9] )
       ) . "\n"
     . html_tag( 'tr', "\n" .
-          html_tag( 'td', '<hr>', 'left' )
+          html_tag( 'td', '<hr />', 'left' )
       ) . "\n"
     . html_tag( 'tr', "\n" .
           html_tag( 'td', $body, 'left' )
@@ -58,7 +58,7 @@ function sqspell_makePage($title, $scriptsrc, $body){
    */
   if ($MOD != "options_main"){ 
     echo html_tag( 'tr', "\n" .
-                html_tag( 'td', '<hr>', 'left' )
+                html_tag( 'td', '<hr />', 'left' )
             ) . "\n"
       . html_tag( 'tr', "\n" .
             html_tag( 'td', '<a href="sqspell_options.php">'
@@ -71,7 +71,7 @@ function sqspell_makePage($title, $scriptsrc, $body){
    * Close the table and display the version.
    */
   echo html_tag( 'tr', "\n" .
-              html_tag( 'td', '<hr>', 'left' )
+              html_tag( 'td', '<hr />', 'left' )
           ) . "\n"
     . html_tag( 'tr',
           html_tag( 'td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9] )
@@ -95,47 +95,35 @@ function sqspell_makePage($title, $scriptsrc, $body){
  * @return            void
  */
 function sqspell_makeWindow($onload, $title, $scriptsrc, $body){
-  global $color, $SQSPELL_VERSION, $theme_css;
-  echo "<html>\n"
-    . "<head>\n"
-    . "<title>$title</title>\n";
-  /**
-   * Check if we have a defined css theme to use.
-   */
-  if ($theme_css != "") {
-    echo "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"$theme_css\">\n";
-  }
-  /**
-   * Link in the .js file if needed
-   */         
-  if ($scriptsrc){
-    echo "<script type=\"text/javascript\" src=\"js/$scriptsrc\"></script>\n";
-  }
-  echo "</head>\n"
-    . "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" "
-    . "vlink=\"$color[7]\" alink=\"$color[7]\"";
+  global $color, $SQSPELL_VERSION;
+
+  displayHtmlHeader($title,
+      ($scriptsrc ? "\n<script type=\"text/javascript\" src=\"js/$scriptsrc\"></script>\n" : ''));
+
+  echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" "
+      . "vlink=\"$color[7]\" alink=\"$color[7]\"";
   /**
    * Provide an onload="jsfunction()" if asked to.
    */
   if ($onload) {
-    echo " onload=\"$onload\"";
+      echo " onload=\"$onload\"";
   }
   /**
    * Draw the rest of the page.
    */
-  echo '>'
+  echo ">\n"
     . html_tag( 'table', "\n" .
           html_tag( 'tr', "\n" .
               html_tag( 'td', '<strong>' . $title . '</strong>', 'center', $color[9] )
           ) . "\n" .
           html_tag( 'tr', "\n" .
-              html_tag( 'td', '<hr>', 'left' )
+              html_tag( 'td', '<hr />', 'left' )
           ) . "\n" .
           html_tag( 'tr', "\n" .
               html_tag( 'td', $body, 'left' )
           ) . "\n" .
           html_tag( 'tr', "\n" .
-              html_tag( 'td', '<hr>', 'left' )
+              html_tag( 'td', '<hr />', 'left' )
           ) . "\n" .
           html_tag( 'tr', "\n" .
               html_tag( 'td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9] )
@@ -375,17 +363,17 @@ function sqspell_getWords(){
                  'left' ) .  "\n"
         . '<blockquote>' . "\n"
         . '<form method="post" onsubmit="return AYS()">' . "\n"
-        . '<input type="hidden" name="MOD" value="crypto_badkey">' . "\n"
+        . '<input type="hidden" name="MOD" value="crypto_badkey" />' . "\n"
         . html_tag( 'p',  "\n" .
-              '<input type="checkbox" name="delete_words" value="ON">'
+              '<input type="checkbox" name="delete_words" value="ON" />'
               . _("Delete my dictionary and start a new one") . '<br />'
               . _("Decrypt my dictionary with my old password:")
-              . '<input name="old_key" size=\"10\">' ,
+              . '<input name="old_key" size="10" />' ,
           'left' ) . "\n"
         . '</blockquote>' . "\n"
         . html_tag( 'p', "\n" .
               '<input type="submit" value="' 
-              . _("Proceed") . ' &gt;&gt;">' ,
+              . _("Proceed") . ' &gt;&gt;" />' ,
           'center' ) . "\n"
         . '</form>' . "\n";
       /**
@@ -537,4 +525,4 @@ function sqspell_ckMOD($rMOD){
  * stuff. :)
  */
 $SQSPELL_VERSION="v0.3.8";
-?>
+?>
\ No newline at end of file