From fd181f534c2c598516e6f5f50fa7acb636225244 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Wed, 25 Feb 2004 10:43:33 +0000 Subject: [PATCH] Added Flag/Unflag buttons. I have been up for 2 days straight. Please check for mistakes. :) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6660 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 15 +++++++++++++-- include/load_prefs.php | 3 +++ include/options/display.php | 7 +++++++ src/move_messages.php | 7 +++++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index e0486680..00b4679a 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -585,7 +585,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, @@ -753,6 +753,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg, * you need to do a "
-
"; * * $moveURL is the URL to submit the delete/move form to + * $mbxresponse is the array with the results of SELECT against the current mailbox * $mailbox is the current mailbox * $sort is the current sorting method (-1 for no sorting available [searches]) * $Message is a message that is centered on top of the list @@ -760,11 +761,12 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg, */ function mail_message_listing_beginning ($imapConnection, + $mbxresponse, $mailbox = '', $sort = -1, $msg_cnt_str = '', $paginator = ' ', $start_msg = 1) { - global $color, $auto_expunge, $base_uri, + global $color, $auto_expunge, $base_uri, $show_flag_buttons, $allow_server_sort, $server_sort_order, $PHP_SELF, $allow_thread_sort, $thread_sort_messages; @@ -822,6 +824,15 @@ function mail_message_listing_beginning ($imapConnection, 'show_flag_buttons', + 'caption' => _("Show Flag / Unflag Buttons"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + $optvals[SMOPT_GRP_MAILBOX][] = array( 'name' => 'page_selector', 'caption' => _("Enable Page Selector"), diff --git a/src/move_messages.php b/src/move_messages.php index 9ee018bf..008bf1ea 100644 --- a/src/move_messages.php +++ b/src/move_messages.php @@ -173,13 +173,16 @@ if(isset($expungeButton)) { if (count($id)) { $cnt = count($id); if (!isset($attache)) { - $button_action = concat_hook_function('move_messages_button_action'); if (isset($markRead)) { sqimap_toggle_flag($imapConnection, $id, '\\Seen',true,true); } else if (isset($markUnread)) { sqimap_toggle_flag($imapConnection, $id, '\\Seen',false,true); + } else if (isset($markFlagged)) { + sqimap_toggle_flag($imapConnection, $id, '\\Flagged', true, true); + } else if (isset($markUnflagged)) { + sqimap_toggle_flag($imapConnection, $id, '\\Flagged', false, true); } else { - if (!$button_action) { + if (!boolean_hook_function('move_messages_button_action', NULL, 1)) { sqimap_msgs_list_delete($imapConnection, $mailbox, $id,$bypass_trash); if ($auto_expunge) { $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true); -- 2.25.1