if 'js' => TRUE, javascript support is checked by src/options.php
[squirrelmail.git] / plugins / squirrelspell / sqspell_interface.php
1 <?php
2 /**
3 * sqspell_interface.php
4 *
5 * Main wrapper for the pop-up.
6 *
7 * Copyright (c) 1999-2005 The SquirrelMail Project Team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 *
10 * This is a main wrapper for the pop-up window interface of
11 * SquirrelSpell.
12 *
13 * @author Konstantin Riabitsev <icon@duke.edu>
14 * @version $Id$
15 * @package plugins
16 * @subpackage squirrelspell
17 */
18
19 /**
20 * Set up a couple of non-negotiable constants and
21 * defaults. Don't change these, * the setuppable stuff is in
22 * sqspell_config.php
23 */
24 $SQSPELL_DIR='plugins/squirrelspell/';
25 $SQSPELL_CRYPTO=FALSE;
26
27 /**
28 * Load the stuff needed from SquirrelMail
29 * @ignore
30 */
31 define('SM_PATH','../../');
32
33 /* SquirrelMail required files. */
34 require_once(SM_PATH . 'include/validate.php');
35 include_once(SM_PATH . 'functions/display_messages.php');
36 include_once(SM_PATH . $SQSPELL_DIR . 'sqspell_config.php');
37 include_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php');
38
39 /**
40 * $MOD is the name of the module to invoke.
41 * If $MOD is unspecified, assign "init" to it. Else check for
42 * security breach attempts.
43 */
44 if(! sqgetGlobalVar('MOD',$MOD,SQ_FORM)) {
45 $MOD = 'init';
46 }
47 sqspell_ckMOD($MOD);
48
49 /* Load the stuff already. */
50 if (file_exists(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod")) {
51 require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod");
52 } else {
53 error_box(_("Invalid SquirrelSpell module."),$color);
54 echo '</body></html>';
55 }
56 ?>