fsf changes, meant to be rebased on upstream
[squirrelmail.git] / plugins / squirrelspell / setup.php
1 <?php
2
3 /**
4 * setup.php
5 *
6 * Squirrelspell setup file, as defined by the SquirrelMail-1.2 API.
7 *
8 * @author Konstantin Riabitsev <icon at duke.edu>
9 * @copyright 1999-2022 The SquirrelMail Project Team
10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @version $Id$
12 * @package plugins
13 * @subpackage squirrelspell
14 * @todo remove sqspell_ prefix from main php scripts.
15 */
16
17
18 /**
19 * Standard SquirrelMail plugin initialization API.
20 *
21 * @return void
22 */
23 function squirrelmail_plugin_init_squirrelspell() {
24 global $squirrelmail_plugin_hooks;
25 $squirrelmail_plugin_hooks['template_construct_compose_buttons.tpl']['squirrelspell'] =
26 'squirrelspell_setup';
27 $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'] =
28 'squirrelspell_optpage_register_block';
29 $squirrelmail_plugin_hooks['right_main_after_header']['squirrelspell'] =
30 'squirrelspell_upgrade';
31 }
32
33 /**
34 * Register option block
35 *
36 * This function formats and adds the plugin and its description to the
37 * Options screen. Code moved to internal function in order to reduce
38 * setup.php size.
39 * @return void
40 */
41 function squirrelspell_optpage_register_block() {
42 include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
43 squirrelspell_optpage_block_function();
44 }
45
46 /**
47 * Add spell check button in compose.
48 *
49 * This function adds a "Check Spelling" link to the "Compose" row
50 * during message composition.
51 * @return void
52 */
53 function squirrelspell_setup() {
54 include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
55 return squirrelspell_setup_function();
56 }
57
58 /**
59 * Upgrade dictionaries
60 *
61 * Transparently upgrades user's dictionaries when message listing is loaded
62 * @since 1.5.1 (sqspell 0.5)
63 */
64 function squirrelspell_upgrade() {
65 include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
66 squirrelspell_upgrade_function();
67 }
68
69 /**
70 * Display SquirrelSpell version
71 * @since 1.5.1 (sqspell 0.5)
72 * @return string plugin's version
73 */
74 function squirrelspell_version() {
75 return '0.5';
76 }