0aa6aa6f |
1 | <?php |
2 | |
3 | |
4 | /** |
5 | * SquirrelMail Demo Plugin |
6 | * |
c0d96801 |
7 | * @copyright 2006-2012 The SquirrelMail Project Team |
0aa6aa6f |
8 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
9 | * @version $Id$ |
10 | * @package plugins |
11 | * @subpackage demo |
12 | */ |
13 | |
14 | |
15 | /** |
16 | * Add link to menu at top of content pane |
17 | * |
18 | * @return void |
19 | * |
20 | */ |
21 | function demo_page_header_template_do() |
22 | { |
551c7b53 |
23 | global $oTemplate, $nbsp; |
0aa6aa6f |
24 | |
25 | sq_change_text_domain('demo'); |
0aa6aa6f |
26 | $output = makeInternalLink('plugins/demo/demo.php', _("Demo"), '') |
27 | . $nbsp . $nbsp; |
28 | sq_change_text_domain('squirrelmail'); |
29 | |
30 | return array('menuline' => $output); |
31 | } |
32 | |
33 | |
34 | |
e04de0b9 |
35 | /** |
36 | * Inserts an option block in the main SM options page |
37 | * |
38 | */ |
39 | function demo_option_link_do() |
40 | { |
41 | |
42 | global $optpage_blocks; |
43 | |
44 | sq_change_text_domain('demo'); |
45 | |
46 | $optpage_blocks[] = array( |
47 | 'name' => _("Demo"), |
48 | 'url' => sqm_baseuri() . 'plugins/demo/demo.php', |
49 | 'desc' => _("This is where you would describe what your plugin does."), |
50 | 'js' => FALSE |
51 | ); |
52 | |
53 | sq_change_text_domain('squirrelmail'); |
54 | |
55 | } |
56 | |
57 | |
58 | |
6b5eb340 |
59 | /** |
60 | * Validate that this plugin is configured correctly |
61 | * |
62 | * @return boolean Whether or not there was a |
63 | * configuration error for this plugin. |
64 | * |
65 | */ |
66 | function demo_check_configuration_do() |
67 | { |
68 | |
69 | // test for something that this plugin requires, print error if |
70 | // misconfigured or requirements are missing |
71 | // |
72 | if (FALSE) // put something meaningful here |
73 | { |
74 | do_err('Demo plugin is missing something important', FALSE); |
75 | return TRUE; // return FALSE if you only want to display a non-critical error |
76 | } |
77 | |
78 | return FALSE; |
79 | |
80 | } |
81 | |
82 | |
83 | |