removing trailing ?> from function scripts
[squirrelmail.git] / plugins / squirrelspell / modules / check_me.mod
index 14d4e3c2fce66bb7cd91e6c1e6d797819b8c966f..0d9c510cb1ad6490e1ecb422254b8586181ab626 100644 (file)
@@ -10,7 +10,7 @@
  * the interface window.
  *
  * @author Konstantin Riabitsev <icon at duke.edu>
- * @copyright &copy; 1999-2005 The SquirrelMail Project Team
+ * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -100,28 +100,28 @@ if( check_php_version ( 4, 3 ) ) {
     if ( ! is_resource ( $spell_proc ) ) {
         // TODO: replace error_box() with sqspell_makeWindow()
         error_box ( sprintf(_("Could not run the spellchecker command (%s)."),
-            htmlspecialchars($sqspell_command) ) , $color );
-        // close html tags and abort script.
-        echo "</body></html>";
+            htmlspecialchars($sqspell_command) ) );
+        // display footer (closes html tags) and stop script execution
+        $oTemplate->display('footer.tpl');
         exit();
     }
     if ( ! @fwrite($pipes[0], $sqspell_new_text) ) {
         // TODO: replace error_box() with sqspell_makeWindow()
-        error_box ( _("Error while writing to pipe.") , $color );
+        error_box ( _("Error while writing to pipe.") );
         // close all three $pipes here.
         for($i=0; $i<=2; $i++) {
             // disable all fclose error messages
             @fclose($pipes[$i]);
         }
         // close html tags and abort script.
-        echo "</body></html>";
+        $oTemplate->display('footer.tpl');
         exit();
     }
     fclose($pipes[0]);
     $sqspell_output = array();
     for($i=1; $i<=2; $i++) {
         while(!feof($pipes[$i])) {
-           array_push($sqspell_output, rtrim(fgetss($pipes[$i],999),"\n"));
+           array_push($sqspell_output, rtrim(fgetss($pipes[$i],999),"\r\n"));
         }
         fclose($pipes[$i]);
     }
@@ -140,19 +140,19 @@ if( check_php_version ( 4, 3 ) ) {
     if ( ! is_resource ($fp) ) {
         // TODO: replace error_box() with sqspell_makeWindow()
         error_box ( sprintf(_("Could not open temporary file '%s'."),
-            htmlspecialchars($floc) ) , $color );
+            htmlspecialchars($floc) ) );
         // failed to open temp file. abort script.
-        echo "</body></html>";
+        $oTemplate->display('footer.tpl');
         exit();
     }
     if ( ! @fwrite($fp, $sqspell_new_text) ) {
         // TODO: replace error_box() with sqspell_makeWindow()
         error_box ( sprintf(_("Error while writing to temporary file '%s'."),
-            htmlspecialchars($floc) ) , $color );
+            htmlspecialchars($floc) ) );
         // close file descriptor
         fclose($fp);
         // failed writing to temp file. abort script.
-        echo "</body></html>";
+        $oTemplate->display('footer.tpl');
         exit();
     }
     fclose($fp);
@@ -164,7 +164,7 @@ if( check_php_version ( 4, 3 ) ) {
  * Check if the execution was successful. Bail out if it wasn't.
  */
 if ($sqspell_exitcode){
-  $msg= "<div align='center'>"
+  $msg= '<div style="text-align: center;">'
      . sprintf(_("I tried to execute '%s', but it returned:"),
                $sqspell_command) . "<pre>"
      . htmlspecialchars(join("\n", $sqspell_output)) . '</pre>'
@@ -339,7 +339,7 @@ if ($errors){
    <tr>
     <td bgcolor="<?php echo $color[9] ?>" align="center">
      <b>
-      <?php printf( ngettext(_("Found %d error"),_("Found %d errors"),$errors), $errors ) ?>
+      <?php printf( ngettext("Found %d error","Found %d errors",$errors), $errors ) ?>
      </b>
     </td>
    </tr>
@@ -469,7 +469,7 @@ if ($errors){
   /**
    * AREN'T YOU SUCH A KNOW-IT-ALL!
    */
-  $msg='<form onsubmit="return false"><div align="center">' .
+  $msg='<form onsubmit="return false"><div style="text-align: center;">' .
        '<input type="submit" value="  ' . _("Close") .
        '  " onclick="self.close()" /></div></form>';
   sqspell_makeWindow(null, _("No errors found"), null, $msg);
@@ -482,4 +482,3 @@ if ($errors){
  * End:
  * vim: syntax=php et ts=4
  */
-?>
\ No newline at end of file