849bdf42 |
1 | <?php |
2 | |
9804bcde |
3 | /** |
4 | ** setup.php -- Squirrelspell setup file |
5 | ** |
15e6162e |
6 | ** Copyright (c) 1999-2002 The SquirrelMail development team |
9804bcde |
7 | ** Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | ** |
9 | ** This is a standard Squirrelmail-1.2 API for plugins. |
10 | ** |
11 | ** $Id$ |
12 | **/ |
849bdf42 |
13 | |
9804bcde |
14 | function squirrelmail_plugin_init_squirrelspell() { |
15 | /* Standard initialization API. */ |
16 | global $squirrelmail_plugin_hooks; |
849bdf42 |
17 | |
9804bcde |
18 | $squirrelmail_plugin_hooks['compose_button_row']['squirrelspell'] = 'squirrelspell_setup'; |
cbe5423b |
19 | $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'] = 'squirrelspell_optpage_register_block'; |
9804bcde |
20 | $squirrelmail_plugin_hooks['options_link_and_description']['squirrelspell'] = 'squirrelspell_options'; |
21 | } |
849bdf42 |
22 | |
cbe5423b |
23 | function squirrelspell_optpage_register_block() { |
9804bcde |
24 | // Gets added to the user's OPTIONS page. |
cbe5423b |
25 | global $optpage_blocks; |
849bdf42 |
26 | |
9804bcde |
27 | if ( !soupNazi() ) { |
849bdf42 |
28 | |
9804bcde |
29 | /* Register Squirrelspell with the $optionpages array. */ |
cbe5423b |
30 | $optpage_blocks[] = array( |
9804bcde |
31 | 'name' => _("SpellChecker Options"), |
32 | 'url' => '../plugins/squirrelspell/sqspell_options.php', |
33 | 'desc' => _("Here you may set up how your personal dictionary is stored, edit it, or choose which languages should be available to you when spell-checking."), |
34 | 'js' => TRUE |
35 | ); |
36 | } |
37 | } |
849bdf42 |
38 | |
9804bcde |
39 | function squirrelspell_setup() { |
40 | /* Gets added to the COMPOSE buttons row. */ |
41 | if ( !soupNazi() ) { |
42 | /* |
43 | ** using document.write to hide this functionality from people |
44 | ** with JavaScript turned off. |
45 | */ |
46 | echo "<script type=\"text/javascript\">\n". |
47 | "<!--\n". |
48 | 'document.write("<input type=\"button\" value=\"' . |
49 | _("Check Spelling") . '\" onclick=\"window.open(\'../plugins/squirrelspell/sqspell_interface.php\', \'sqspell\', \'status=yes,width=550,height=370,resizable=yes\')\">");'. "\n" . |
50 | "//-->\n". |
51 | "</script>\n"; |
52 | } |
53 | } |
849bdf42 |
54 | |
2a15152a |
55 | ?> |