<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
- <?php mail_message_listing_beginning($imapConnection, $mailbox, $sort,
+ <?php mail_message_listing_beginning($imapConnection, $mbxresponse, $mailbox, $sort,
$msg_cnt_str, $paginator_str, $start_msg); ?>
</td>
</tr>
* you need to do a "</table></table>";
*
* $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
*/
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;
<tr>
<td align="left">
<small><?php
+
+ // display flag buttons only if supported
+ if ($show_flag_buttons
+ && strpos($mbxresponse['PERMANENTFLAGS'], '\Flagged') !== FALSE) {
+ echo getButton('SUBMIT', 'markFlagged',_("Flag"));
+ echo ' ';
+ echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
+ echo ' ';
+ }
echo getButton('SUBMIT', 'markRead',_("Read"));
echo ' ';
echo getButton('SUBMIT', 'markUnread',_("Unread"));
// user's icon theme, if using icons
$icon_theme = getPref($data_dir, $username, 'icon_theme', 'none' );
+// show (or not) flag and unflag buttons on mailbox list screen
+$show_flag_buttons = getPref($data_dir, $username, 'show_flag_buttons', SMPREF_OFF );
+
$use_javascript_addr_book = getPref($data_dir, $username, 'use_javascript_addr_book', $default_use_javascript_addr_book);
/* Load the user's special folder preferences */
);
}
+ $optvals[SMOPT_GRP_MAILBOX][] = array(
+ 'name' => '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"),
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);