Code updates
[squirrelmail.git] / plugins / sent_subfolders / setup.php
CommitLineData
a3439b27 1<?php
2
3/**
4 * setup.php -- Sent Subfolders Setup File
5 *
598294a7 6 * This is a standard SquirrelMail 1.2 API for plugins.
a3439b27 7 *
4b5049de 8 * @copyright &copy; 1999-2007 The SquirrelMail Project Team
4b4abf93 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
4f51df66 10 * @version $Id$
ea5f4b8e 11 * @package plugins
12 * @subpackage sent_subfolders
a3439b27 13 */
14
bb58f260 15/**
598294a7 16 * Adds plugin to SquirrelMail's hooks
bb58f260 17 */
a3439b27 18function squirrelmail_plugin_init_sent_subfolders() {
19 /* Standard initialization API. */
20 global $squirrelmail_plugin_hooks;
21
22 /* The hooks to make the sent subfolders display correctly. */
afa916e9 23 $squirrelmail_plugin_hooks['check_handleAsSent_result']['sent_subfolders']
24 = 'sent_subfolders_check_handleAsSent';
a3439b27 25
26 /* The hooks to automatically update sent subfolders. */
afa916e9 27 $squirrelmail_plugin_hooks['left_main_before']['sent_subfolders']
28 = 'sent_subfolders_update_sentfolder';
29 $squirrelmail_plugin_hooks['compose_send']['sent_subfolders']
30 = 'sent_subfolders_update_sentfolder';
a3439b27 31
32 /* The hooks to handle sent subfolders options. */
afa916e9 33 $squirrelmail_plugin_hooks['optpage_loadhook_folder']['sent_subfolders']
34 = 'sent_subfolders_optpage_loadhook_folders';
bb58f260 35
36 /* mark base sent folder as special mailbox */
afa916e9 37 $squirrelmail_plugin_hooks['special_mailbox']['sent_subfolders']
38 = 'sent_subfolders_special_mailbox';
a3439b27 39}
40
32a7b3e0 41function sent_subfolders_check_handleAsSent($mailbox) {
e2af439f 42 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
32a7b3e0 43 sent_subfolders_check_handleAsSent_do($mailbox);
a3439b27 44}
45
bb58f260 46/**
47 * Adds sent_subfolders options in folder preferences
48 */
a3439b27 49function sent_subfolders_optpage_loadhook_folders() {
e2af439f 50 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
d21b4338 51 sent_subfolders_optpage_loadhook_folders_do();
a3439b27 52}
53
bb58f260 54/**
55 * Update sent_subfolders settings
56 *
91e0dccc 57 * function updates default sent folder value and
bb58f260 58 * creates required imap folders
59 */
a3439b27 60function sent_subfolders_update_sentfolder() {
e2af439f 61 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
d21b4338 62 sent_subfolders_update_sentfolder_do();
a3439b27 63}
64
bb58f260 65/**
66 * detects if mailbox is part of sent_subfolders
67 *
68 * @param string $mb imap folder name
69 * @return boolean 1 - is part of sent_subfolders, 0 - is not part of sent_subfolders
70 */
71function sent_subfolders_special_mailbox($mb) {
e2af439f 72 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
d21b4338 73 return sent_subfolders_special_mailbox_do($mb);
bb58f260 74}