// display flag buttons only if supported
if ($show_flag_buttons && $mbxresponse != NULL &&
strpos($mbxresponse['PERMANENTFLAGS'], '\Flagged') !== FALSE) {
+ echo getButton('SUBMIT', 'markUnflagged',_("Un"));
echo getButton('SUBMIT', 'markFlagged',_("Flag"));
echo ' ';
- echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
- echo ' ';
}
+ echo getButton('SUBMIT', 'markUnread',_("Un"));
echo getButton('SUBMIT', 'markRead',_("Read"));
echo ' ';
- echo getButton('SUBMIT', 'markUnread',_("Unread"));
- echo ' ';
+
echo getButton('SUBMIT', 'attache',_("Forward"));
echo ' ';
echo getButton('SUBMIT', 'delete',_("Delete"));
. '&what=' . urlencode($what);
}
$result .= "\">";
-
- if (isset($checkall) && ($checkall == '1')) {
- $result .= _("Unselect All");
- } else {
- $result .= _("Select All");
- }
+ $result .= _("All");
$result .= "</A>\n";
}
echo ' </SELECT></TT> ';
}
-function getButton($type, $name, $value) {
- return '<INPUT TYPE="'.$type.'" NAME="'.$name.'" VALUE="'.$value . '" style="padding: 0px; margin: 0px">';
+function getButton($type, $name, $value, $enabled = TRUE) {
+ $disabled = ( $enabled ? '' : 'disabled ' );
+ return '<INPUT '.$disabled.
+ 'TYPE="'.$type.
+ '" NAME="'.$name.
+ '" VALUE="'.$value .
+ '" style="padding: 0px; margin: 0px">';
}
function getSmallStringCell($string, $align) {
sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
/** SESSION/POST/GET VARS */
-sqgetGlobalVar('smaction',$action);
sqgetGlobalVar('session',$session);
sqgetGlobalVar('mailbox',$mailbox);
if(!sqgetGlobalVar('identity',$identity)) {
/** GET VARS */
sqgetGlobalVar('attachedmessages', $attachedmessages, SQ_GET);
+/** get smaction */
+if ( !sqgetGlobalVar('smaction',$action) )
+{
+ if ( sqgetGlobalVar('smaction_reply',$tmp) ) $action = 'reply';
+ if ( sqgetGlobalVar('smaction_reply_all',$tmp) ) $action = 'reply_all';
+ if ( sqgetGlobalVar('smaction_forward',$tmp) ) $action = 'forward';
+ if ( sqgetGlobalVar('smaction_attache',$tmp) ) $action = 'forward_as_attachment';
+}
+
/* Location (For HTTP 1.1 Header("Location: ...") redirects) */
$location = get_location();
/* Identities (fetch only once) */
sqgetGlobalVar('key', $key, SQ_COOKIE);
sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
-sqgetGlobalVar('message', $message, SQ_GET);
+sqgetGlobalVar('message', $message, SQ_FORM);
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
-sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_GET);
+sqgetGlobalVar('bypass_trash', $bypass_trash, SQ_FORM);
/* end globals */
-if (isset($_GET['saved_draft'])) {
- $saved_draft = urlencode($_GET['saved_draft']);
+if (sqGetGlobalVar('saved_draft', $tmp, SQ_GET)) {
+ $saved_draft = urlencode($tmp);
}
-if (isset($_GET['mail_sent'])) {
- $mail_sent = urlencode($_GET['mail_sent']);
+if (sqGetGlobalVar('mail_sent', $tmp, SQ_GET)) {
+ $mail_sent = urlencode($tmp);
}
-if (isset($_GET['sort'])) {
- $sort = (int) $_GET['sort'];
+if (sqGetGlobalVar('where', $tmp, SQ_FORM)) {
+ $where = urlencode($tmp);
}
-
-if (isset($_GET['startMessage'])) {
- $startMessage = (int) $_GET['startMessage'];
+if (sqGetGlobalVar('what', $tmp, SQ_FORM)) {
+ $what = urlencode($tmp);
}
-
-if(isset($_GET['where'])) {
- $where = urlencode($_GET['where']);
+if (sqGetGlobalVar('sort', $tmp, SQ_FORM)) {
+ $sort = (int) $tmp;
}
-if(isset($_GET['what'])) {
- $what = urlencode($_GET['what']);
+if (sqGetGlobalVar('startMessage', $tmp, SQ_FORM)) {
+ $startMessage = (int) $tmp;
}
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$double_delimiter = ' ';
$urlMailbox = urlencode($mailbox);
- $comp_uri = 'src/compose.php' .
- '?passed_id=' . $passed_id .
- '&mailbox=' . $urlMailbox .
- '&startMessage=' . $startMessage .
- (isset($passed_ent_id)?'&passed_ent_id='.$passed_ent_id:'');
-
$msgs_url = $base_uri . 'src/';
// BEGIN NAV ROW - PREV/NEXT, DEL PREV/NEXT, LINKS TO INDEX, etc.
// BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc.
$menu_row = '<tr bgcolor="'.$color[9].'"><td><small>';
+ // Start form for reply/reply all/forward..
+ $comp_uri = $base_uri.'src/compose.php' .
+ '?passed_id=' . $passed_id .
+ '&mailbox=' . $urlMailbox .
+ '&startMessage=' . $startMessage .
+ (isset($passed_ent_id) ? '&passed_ent_id='.$passed_ent_id : '');
+ $menu_row .= '<form action="'.$comp_uri.'" method="post"><small>';
+
// If Draft folder - create Resume link
if (($mailbox == $draft_folder) && ($save_as_draft)) {
- $comp_alt_uri = $comp_uri . '&smaction=draft';
+ $new_button = 'draft';
$comp_alt_string = _("Resume Draft");
} else if (handleAsSent($mailbox)) {
// If in Sent folder, edit as new
- $comp_alt_uri = $comp_uri . '&smaction=edit_as_new';
+ $new_button = 'edit_as_new';
$comp_alt_string = _("Edit Message as New");
}
-
// Show Alt URI for Draft/Sent
- if (isset($comp_alt_uri)) {
- $menu_row .= makeComposeLink($comp_alt_uri, $comp_alt_string);
- $menu_row .= $topbar_delimiter . "\n";
- }
+ if (isset($comp_alt_string))
+ $menu_row .= getButton('SUBMIT', $new_button, $comp_alt_string) . "\n";
- $comp_action_uri = $comp_uri . '&smaction=reply';
- $menu_row .= makeComposeLink($comp_action_uri, _("Reply")) . "\n";
+ $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply"));
+ $menu_row .= ' '.getButton('SUBMIT', 'smaction_reply_all', _("Reply All"));
+ $menu_row .= ' '.getButton('SUBMIT', 'smaction_forward', _("Forward"));
- $comp_action_uri = $comp_uri . '&smaction=reply_all';
- $menu_row .= $topbar_delimiter;
- $menu_row .= makeComposeLink($comp_action_uri, _("Reply All")) . "\n";
+ if ($enable_forward_as_attachment)
+ $menu_row .= '<input type="checkbox" name="smaction_attache">' . _("Attachment");
+ $menu_row .= '</form>'.' ';
- $comp_action_uri = $comp_uri . '&smaction=forward';
- $menu_row .= $topbar_delimiter;
- $menu_row .= makeComposeLink($comp_action_uri, _("Forward")) . "\n";
-
- if ($enable_forward_as_attachment) {
- $comp_action_uri = $comp_uri . '&smaction=forward_as_attachment';
- $menu_row .= $topbar_delimiter;
- $menu_row .= makeComposeLink($comp_action_uri, _("Forward as Attachment")) . "\n";
- }
+ // Form for deletion
+ $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox;
+ $menu_row .= '<form action="'.$delete_url.'" method="post" style="display: inline"><small>';
- $delete_link = _("Delete");
if (!(isset($passed_ent_id) && $passed_ent_id)) {
- $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox .
- '&message=' . $passed_id . '&';
+ $menu_row .= '<input type="hidden" name="message" value="'.$passed_id.'" />';
if ($where && $what) {
- $delete_url .= 'where=' . urlencode($where) . '&what=' . urlencode($what);
+ $menu_row .= '<input type="hidden" name="where" value="'.$where.'" />';
+ $menu_row .= '<input type="hidden" name="what" value="'.$what.'" />';
} else {
- $delete_url .= 'sort=' . $sort . '&startMessage=' . $startMessage;
+ $menu_row .= '<input type="hidden" name="sort" value="'.$sort.'" />';
+ $menu_row .= '<input type="hidden" name="startMessage" value="'.$startMessage.'" />';
}
- $delete_link = '<a href="' . $delete_url . '">' . $delete_link . '</a>';
- $delete_link .= ' (<a href="' . $delete_url.'&bypass_trash=1">'
- ._("Bypass Trash").'</a>)';
-
+ $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
+ $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
}
- $menu_row .= $topbar_delimiter.$delete_link . "\n";
+ else
+ $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), FALSE) . "\n"; // delete button is disabled
+
+ $menu_row .= '</form>' . "\n";
// Add top move link