'special_mailbox'. As an example I added the spam mailbox. Please,
someone with docs skills at this to the docs 8-)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2324
7612ce4b-ef26-0410-bec9-
ea0150e637f0
( $move_to_sent && isBoxBelow( $box, $sent_folder )) ||
($save_as_draft && $box == $draft_folder ) );
( $move_to_sent && isBoxBelow( $box, $sent_folder )) ||
($save_as_draft && $box == $draft_folder ) );
+ if ( !$ret ) {
+ $ret = do_hook( 'special_mailbox', $box );
+ }
+
}
/* This function executes a hook. */
}
/* This function executes a hook. */
-function do_hook ($name) {
+function do_hook ($name,$parm=NULL) {
global $squirrelmail_plugin_hooks;
$data = func_get_args();
global $squirrelmail_plugin_hooks;
$data = func_get_args();
if (isset($squirrelmail_plugin_hooks[$name])
&& is_array($squirrelmail_plugin_hooks[$name])) {
foreach ($squirrelmail_plugin_hooks[$name] as $function) {
/* Add something to set correct gettext domain for plugin. */
if (function_exists($function)) {
if (isset($squirrelmail_plugin_hooks[$name])
&& is_array($squirrelmail_plugin_hooks[$name])) {
foreach ($squirrelmail_plugin_hooks[$name] as $function) {
/* Add something to set correct gettext domain for plugin. */
if (function_exists($function)) {
+ $ret = $function($data,$parm);
}
}
}
/* Variable-length argument lists have a slight problem when */
/* passing values by reference. Pity. This is a workaround. */
}
}
}
/* Variable-length argument lists have a slight problem when */
/* passing values by reference. Pity. This is a workaround. */
}
/*************************************/
}
/*************************************/
'$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
'type' => SMOPT_TYPE_STRING,
'comment' => _("Use \"detect\" to auto-detect."),
'$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
'type' => SMOPT_TYPE_STRING,
'comment' => _("Use \"detect\" to auto-detect."),
+ 'size' => 10,
+ 'default' => 'detect' ),
'$useSendmail' => array( 'name' => _("Use Sendmail"),
'type' => SMOPT_TYPE_BOOLEAN ),
'$sendmail_path' => array( 'name' => _("Sendmail Path"),
'$useSendmail' => array( 'name' => _("Use Sendmail"),
'type' => SMOPT_TYPE_BOOLEAN ),
'$sendmail_path' => array( 'name' => _("Sendmail Path"),
'size' => 40 ),
'$addrbook_table' => array( 'name' => _("Address book table"),
'type' => SMOPT_TYPE_STRING,
'size' => 40 ),
'$addrbook_table' => array( 'name' => _("Address book table"),
'type' => SMOPT_TYPE_STRING,
+ 'size' => 40,
+ 'default' => 'address' ),
/* --------------------------------------------------------*/
'Group7' => array( 'name' => _("Themes"),
'type' => SMOPT_TYPE_TITLE ),
/* --------------------------------------------------------*/
'Group7' => array( 'name' => _("Themes"),
'type' => SMOPT_TYPE_TITLE ),
global $mailbox, $imap_stream, $imapConnection;
$squirrelmail_plugin_hooks['left_main_before']['filters'] = 'start_filters';
global $mailbox, $imap_stream, $imapConnection;
$squirrelmail_plugin_hooks['left_main_before']['filters'] = 'start_filters';
- if ($mailbox == 'INBOX')
- $squirrelmail_plugin_hooks["right_main_after_header"]['filters'] = 'start_filters';
+ if ($mailbox == 'INBOX') {
+ $squirrelmail_plugin_hooks['right_main_after_header']['filters'] = 'start_filters';
+ }
$squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'squirrelmail_plugin_optpage_register_block';
$squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'squirrelmail_plugin_optpage_register_block';
+ $squirrelmail_plugin_hooks['special_mailbox']['filters'] = 'filters_special_mailbox';
+ }
+
+ function filters_special_mailbox( $data, $mb ) {
+
+ if ( $mb == getPref($data_dir, $username, 'filters_spam_folder', 'na' ) ) {
+ return( TRUE );
+ } else {
+ return( FALSE );
+ }
}
function squirrelmail_plugin_optpage_register_block() {
}
function squirrelmail_plugin_optpage_register_block() {