Fix mixed use of message ID list (#2859)
[squirrelmail.git] / plugins / squirrelspell / setup.php
CommitLineData
849bdf42 1<?php
4b4abf93 2
d112ed5a 3/**
4 * setup.php
91e0dccc 5 *
4b4abf93 6 * Squirrelspell setup file, as defined by the SquirrelMail-1.2 API.
d112ed5a 7 *
4b4abf93 8 * @author Konstantin Riabitsev <icon at duke.edu>
c997cbe6 9 * @copyright 1999-2021 The SquirrelMail Project Team
4b4abf93 10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7996c920 11 * @version $Id$
ea5f4b8e 12 * @package plugins
13 * @subpackage squirrelspell
e5af0839 14 * @todo remove sqspell_ prefix from main php scripts.
d112ed5a 15 */
849bdf42 16
7996c920 17
d112ed5a 18/**
598294a7 19 * Standard SquirrelMail plugin initialization API.
90ad8cd1 20 *
d112ed5a 21 * @return void
22 */
23function squirrelmail_plugin_init_squirrelspell() {
7996c920 24 global $squirrelmail_plugin_hooks;
7ffb780f 25 $squirrelmail_plugin_hooks['template_construct_compose_buttons.tpl']['squirrelspell'] =
90ad8cd1 26 'squirrelspell_setup';
7996c920 27 $squirrelmail_plugin_hooks['optpage_register_block']['squirrelspell'] =
90ad8cd1 28 'squirrelspell_optpage_register_block';
7996c920 29 $squirrelmail_plugin_hooks['right_main_after_header']['squirrelspell'] =
90ad8cd1 30 'squirrelspell_upgrade';
d112ed5a 31}
849bdf42 32
d112ed5a 33/**
e5af0839 34 * Register option block
90ad8cd1 35 *
e5af0839 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.
d112ed5a 39 * @return void
40 */
41function squirrelspell_optpage_register_block() {
e5af0839 42 include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
43 squirrelspell_optpage_block_function();
d112ed5a 44}
849bdf42 45
d112ed5a 46/**
e5af0839 47 * Add spell check button in compose.
48 *
d112ed5a 49 * This function adds a "Check Spelling" link to the "Compose" row
50 * during message composition.
d112ed5a 51 * @return void
52 */
53function squirrelspell_setup() {
e5af0839 54 include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
7ffb780f 55 return squirrelspell_setup_function();
7996c920 56}
57
58/**
e5af0839 59 * Upgrade dictionaries
60 *
7996c920 61 * Transparently upgrades user's dictionaries when message listing is loaded
62 * @since 1.5.1 (sqspell 0.5)
63 */
64function squirrelspell_upgrade() {
7996c920 65 include_once(SM_PATH . 'plugins/squirrelspell/sqspell_functions.php');
e5af0839 66 squirrelspell_upgrade_function();
7996c920 67}
68
69/**
e5af0839 70 * Display SquirrelSpell version
7996c920 71 * @since 1.5.1 (sqspell 0.5)
72 * @return string plugin's version
7996c920 73 */
74function squirrelspell_version() {
e5af0839 75 return '0.5';
d112ed5a 76}