' .
html_tag( 'td', '', 'left', '', 'width="33%"' ) . '';
$msgs_url = $base_uri . 'src/';
if (isset($where) && isset($what)) {
$msgs_url .= 'search.php?smtoken=' . sm_generate_security_token() . '&where=' . urlencode($where) .
'&what=' . urlencode($what) . '&mailbox=' . $urlMailbox;
$msgs_str = _("Search Results");
} else {
$msgs_url .= 'right_main.php?sort=' . $sort . '&startMessage=' .
$startMessage . '&mailbox=' . $urlMailbox;
$msgs_str = _("Message List");
}
$s .= '' . $msgs_str . '';
$delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox .
'&message=' . $passed_id . '&smtoken=' . sm_generate_security_token() . '&';
$unread_url = $base_uri . 'src/';
if (!(isset($passed_ent_id) && $passed_ent_id)) {
if ($where && $what) {
$unread_url .= 'search.php?unread_passed_id=' . $passed_id . '&smtoken=' . sm_generate_security_token() . '&where=' . urlencode($where) . '&what=' . urlencode($what) . '&mailbox=' . $urlMailbox;
} else {
$unread_url .= 'right_main.php?unread_passed_id=' . $passed_id . '&sort=' . $sort . '&startMessage=' . $startMessage . '&mailbox=' . $urlMailbox;
}
$s .= $topbar_delimiter;
$s .= '' . _("Unread") . '';
if ($where && $what) {
$delete_url .= 'where=' . urlencode($where) . '&what=' . urlencode($what);
} else {
$delete_url .= 'sort=' . $sort . '&startMessage=' . $startMessage;
}
$s .= $topbar_delimiter;
$s .= '' . _("Delete") . '';
}
$comp_uri = 'src/compose.php' .
'?passed_id=' . $passed_id .
'&mailbox=' . $urlMailbox .
'&startMessage=' . $startMessage .
(isset($passed_ent_id)?'&passed_ent_id='.urlencode($passed_ent_id):'');
if (($mailbox == $draft_folder) && ($save_as_draft)) {
$comp_alt_uri = $comp_uri . '&smaction=draft';
$comp_alt_string = _("Resume Draft");
} else if (handleAsSent($mailbox)) {
$comp_alt_uri = $comp_uri . '&smaction=edit_as_new';
$comp_alt_string = _("Edit Message as New");
}
if (isset($comp_alt_uri)) {
$s .= $topbar_delimiter;
$s .= makeComposeLink($comp_alt_uri, $comp_alt_string);
}
$s .= '| ';
if (!(isset($where) && isset($what)) && !$passed_ent_id) {
$prev = findPreviousMessage($mbx_response['EXISTS'], $passed_id);
$next = findNextMessage($passed_id);
if ($prev != -1) {
$uri = $base_uri . 'src/read_body.php?passed_id='.$prev.
'&mailbox='.$urlMailbox.'&sort='.$sort.
'&startMessage='.$startMessage.'&show_more=0';
$s .= ''._("Previous").'';
} else {
$s .= _("Previous");
}
$s .= $topbar_delimiter;
if ($next != -1) {
$uri = $base_uri . 'src/read_body.php?passed_id='.$next.
'&mailbox='.$urlMailbox.'&sort='.$sort.
'&startMessage='.$startMessage.'&show_more=0';
$s .= ''._("Next").'';
} else {
$s .= _("Next");
}
} else if (isset($passed_ent_id) && $passed_ent_id) {
/* code for navigating through attached message/rfc822 messages */
$url = set_url_var($PHP_SELF, 'passed_ent_id',0);
$s .= ''._("View Message").'';
$entities = array();
$entity_count = array();
$c = 0;
foreach($message->parent->entities as $ent) {
if ($ent->type0 == 'message' && $ent->type1 == 'rfc822') {
$c++;
$entity_count[$c] = $ent->entity_id;
$entities[$ent->entity_id] = $c;
}
}
$prev_link = _("Previous");
if (!empty($entities[$passed_ent_id]) && ($entities[$passed_ent_id] > 1)) {
$prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1];
$prev_link = '' . $prev_link . '';
}
$next_link = _("Next");
if (!empty($entities[$passed_ent_id]) && ($entities[$passed_ent_id] < $c)) {
$next_ent_id = $entity_count[$entities[$passed_ent_id] + 1];
$next_link = '' . $next_link . '';
}
$s .= $topbar_delimiter . $prev_link;
$par_ent_id = $message->parent->entity_id;
if ($par_ent_id) {
$par_ent_id = substr($par_ent_id,0,-2);
$s .= $topbar_delimiter;
$url = set_url_var($PHP_SELF, 'passed_ent_id',$par_ent_id);
$s .= ''._("Up").'';
}
$s .= $topbar_delimiter . $next_link;
}
$s .= ' | ' . "\n" .
html_tag( 'td', '', 'right', '', 'width="33%" nowrap' ) . '';
$comp_action_uri = $comp_uri . '&smaction=forward';
$s .= makeComposeLink($comp_action_uri, _("Forward"));
if ($enable_forward_as_attachment) {
$comp_action_uri = $comp_uri . '&smaction=forward_as_attachment';
$s .= $topbar_delimiter;
$s .= makeComposeLink($comp_action_uri, _("Forward as Attachment"));
}
$comp_action_uri = $comp_uri . '&smaction=reply';
$s .= $topbar_delimiter;
$s .= makeComposeLink($comp_action_uri, _("Reply"));
$comp_action_uri = $comp_uri . '&smaction=reply_all';
$s .= $topbar_delimiter;
$s .= makeComposeLink($comp_action_uri, _("Reply All"));
$s .= '