X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_functions.php;h=c9a738894b16c78e7add67160fcf22ae97ad93f7;hp=08e55e8fd94e1183dfcb130a2560010cdba4fd4d;hb=6fe8a0dbeb36818b4eb0222574a47c20eb1b4043;hpb=7ffb780fc4b55993168e83a944203ae08c0cdda3 diff --git a/plugins/squirrelspell/sqspell_functions.php b/plugins/squirrelspell/sqspell_functions.php index 08e55e8f..c9a73889 100644 --- a/plugins/squirrelspell/sqspell_functions.php +++ b/plugins/squirrelspell/sqspell_functions.php @@ -6,7 +6,7 @@ * All SquirrelSpell-wide functions are in this file. * * @author Konstantin Riabitsev - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins @@ -22,6 +22,12 @@ global $SQSPELL_APP, $SQSPELL_APP_DEFAULT, $SQSPELL_WORDS_FILE, $SQSPELL_CRYPTO; */ include_once(SM_PATH . 'plugins/squirrelspell/sqspell_config.php'); +/** + * Workaround for including function squirrelspell_version() in SM 1.5 CVS, + * where plugins' setup.php is not included by default. + */ +include_once(SM_PATH . 'plugins/squirrelspell/setup.php'); + /** Hooked functions **/ /** @@ -56,21 +62,15 @@ function squirrelspell_setup_function() { * correctly. */ if (checkForJavascript()) { - /** - * Some people may choose to disable javascript even though their - * browser is capable of using it. So these freaks don't complain, - * use document.write() so the "Check Spelling" button is not - * displayed if js is off in the browser. - */ - $output = "\n"; + + global $oTemplate, $base_uri; + $nbsp = $oTemplate->fetch('non_breaking_space.tpl'); + + $output = addButton(_("Check Spelling"), + 'check_spelling', + array('onclick' => 'window.open(\'' . $base_uri + . '/plugins/squirrelspell/sqspell_interface.php\', \'sqspell\', \'status=yes,width=550,height=370,resizable=yes\')')) . $nbsp; + return array('compose_button_row' => $output); } } @@ -119,13 +119,13 @@ function squirrelspell_upgrade_function() { * @return void */ function sqspell_makePage($title, $scriptsrc, $body){ - global $color, $SQSPELL_VERSION; + global $color; if (! sqgetGlobalVar('MOD', $MOD, SQ_GET) ) { $MOD = 'options_main'; } - displayPageHeader($color, 'None'); + displayPageHeader($color); echo " 
\n"; /** * Check if we need to link in a script. @@ -186,7 +186,7 @@ function sqspell_makePage($title, $scriptsrc, $body){ * @return void */ function sqspell_makeWindow($onload, $title, $scriptsrc, $body){ - global $color, $SQSPELL_VERSION; + global $color; displayHtmlHeader($title, ($scriptsrc ? "\n\n" : '')); @@ -799,7 +799,7 @@ function sqspell_ckMOD($rMOD){ || strstr($rMOD, '/') || strstr($rMOD, '%') || strstr($rMOD, "\\")){ - echo _("Cute."); + echo _("Invalid URL"); exit; } } @@ -858,10 +858,12 @@ function sqspell_handle_crypt_panic($lang=false) { '' : '') . html_tag( 'p', "\n" . - '' - . _("Delete my dictionary and start a new one") . '
' + '' + . '
' , 'left' ) . "\n" . '' . "\n" . html_tag( 'p', "\n"