X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_functions.php;h=4044f23aaf2f555916817e39d0a8e20835ccd36e;hp=22ec47b4256126df0d9473a3f7347ec368f79cd2;hb=5d55011bdf7fe06a1f88c5502f44a4f5a245b4cb;hpb=6c99d1de81366bceab6c9d6cf12179eedc81f9bc;ds=sidebyside diff --git a/plugins/squirrelspell/sqspell_functions.php b/plugins/squirrelspell/sqspell_functions.php index 22ec47b4..4044f23a 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,16 @@ 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. - */ - echo "\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); } } @@ -218,8 +219,10 @@ function sqspell_makeWindow($onload, $title, $scriptsrc, $body){ html_tag( 'tr', "\n" . html_tag( 'td', 'SquirrelSpell ' . squirrelspell_version(), 'center', $color[9] ) ) , - '', '', 'width="100%" border="0" cellpadding="2"' ) - . "\n\n"; + '', '', 'width="100%" border="0" cellpadding="2"' ); + + global $oTemplate; + $oTemplate->display('footer.tpl'); } /** @@ -855,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"