Add preview pane to advanced default template. This serves as an example of how...
[squirrelmail.git] / plugins / preview_pane / setup.php
1 <?php
2
3 /**
4 * SquirrelMail Preview Pane Plugin
5 *
6 * @copyright &copy; 1999-2007 The SquirrelMail Project Team
7 * @author Paul Lesneiwski <paul@squirrelmail.org>
8 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * @version $Id$
10 * @package plugins
11 * @subpackage preview_pane
12 *
13 */
14
15
16 /**
17 * Register this plugin with SquirrelMail
18 *
19 */
20 function squirrelmail_plugin_init_preview_pane()
21 {
22
23 global $squirrelmail_plugin_hooks;
24
25
26 $squirrelmail_plugin_hooks['subject_link']['preview_pane']
27 = 'preview_pane_change_message_target';
28 $squirrelmail_plugin_hooks['optpage_loadhook_display']['preview_pane']
29 = 'preview_pane_show_options';
30 $squirrelmail_plugin_hooks['template_construct_message_list.tpl']['preview_pane']
31 = 'preview_pane_message_list';
32
33 }
34
35
36 if (!defined('SM_PATH'))
37 define('SM_PATH', '../');
38
39
40 /**
41 * Returns info about this plugin
42 *
43 */
44 function preview_pane_info()
45 {
46
47 return array(
48 'english_name' => 'Preview Pane',
49 'version' => '2.0',
50 'required_sm_version' => '1.5.2',
51 'requires_configuration' => 0,
52 'requires_source_patch' => 0,
53 'required_plugins' => array(
54 ),
55 'summary' => 'Provides a third frame below the message list for viewing message bodies.',
56 'details' => 'This plugin allows the user to turn on an extra frame below the mailbox message list where the messages themselves are displayed, very similar to many other popular (typically non-web-based) email clients.',
57 );
58
59 }
60
61
62
63 /**
64 * Returns version info about this plugin
65 *
66 */
67 function preview_pane_version()
68 {
69
70 $info = preview_pane_info();
71 return $info['version'];
72
73 }
74
75
76
77 /**
78 * Build user options for display on "Display Preferences" page
79 *
80 */
81 function preview_pane_show_options()
82 {
83
84 include_once(SM_PATH . 'plugins/preview_pane/functions.php');
85 preview_pane_show_options_do();
86
87 }
88
89
90
91 /**
92 * Construct button that clears out any preview pane
93 * contents and inserts JavaScript function used by
94 * message subject link onclick handler. Also disallows
95 * the message list to be loaded into the bottom frame.
96 *
97 */
98 function preview_pane_message_list()
99 {
100
101 include_once(SM_PATH . 'plugins/preview_pane/functions.php');
102 return preview_pane_message_list_do();
103
104 }
105
106
107
108 /**
109 * Points message targets to open in the preview pane
110 * (and possibly refresh message list as well)
111 *
112 */
113 function preview_pane_change_message_target()
114 {
115
116 include_once(SM_PATH . 'plugins/preview_pane/functions.php');
117 preview_pane_change_message_target_do();
118
119 }
120
121
122