Happy New Year
[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 *
353d074a 8 * @copyright 1999-2018 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
91e0dccc 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. */
e84b2496 27// hook isn't in 1.5.x; isn't absolutely necessary to run on the folder list anyway
28// $squirrelmail_plugin_hooks['left_main_before']['sent_subfolders']
29// = 'sent_subfolders_update_sentfolder';
afa916e9 30 $squirrelmail_plugin_hooks['compose_send']['sent_subfolders']
31 = 'sent_subfolders_update_sentfolder';
a3439b27 32
33 /* The hooks to handle sent subfolders options. */
afa916e9 34 $squirrelmail_plugin_hooks['optpage_loadhook_folder']['sent_subfolders']
35 = 'sent_subfolders_optpage_loadhook_folders';
bb58f260 36
37 /* mark base sent folder as special mailbox */
afa916e9 38 $squirrelmail_plugin_hooks['special_mailbox']['sent_subfolders']
39 = 'sent_subfolders_special_mailbox';
a3439b27 40}
41
32a7b3e0 42function sent_subfolders_check_handleAsSent($mailbox) {
e2af439f 43 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
32a7b3e0 44 sent_subfolders_check_handleAsSent_do($mailbox);
a3439b27 45}
46
bb58f260 47/**
bb58f260 48 * Adds sent_subfolders options in folder preferences
49 */
a3439b27 50function sent_subfolders_optpage_loadhook_folders() {
e2af439f 51 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
d21b4338 52 sent_subfolders_optpage_loadhook_folders_do();
a3439b27 53}
54
bb58f260 55/**
56 * Update sent_subfolders settings
57 *
91e0dccc 58 * function updates default sent folder value and
bb58f260 59 * creates required imap folders
60 */
a3439b27 61function sent_subfolders_update_sentfolder() {
e2af439f 62 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
d21b4338 63 sent_subfolders_update_sentfolder_do();
a3439b27 64}
65
bb58f260 66/**
67 * detects if mailbox is part of sent_subfolders
68 *
69 * @param string $mb imap folder name
70 * @return boolean 1 - is part of sent_subfolders, 0 - is not part of sent_subfolders
71 */
72function sent_subfolders_special_mailbox($mb) {
e2af439f 73 include_once(SM_PATH . 'plugins/sent_subfolders/functions.php');
d21b4338 74 return sent_subfolders_special_mailbox_do($mb);
bb58f260 75}