X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=8d5409d9f1cd8405a08f4802b91ec60252cb30ba;hb=2b9d3f0b226c885d7d0e3acfc8cb4080303849bd;hp=c60c0fd61478f20e2a36e911501d9b66614f3242;hpb=62c36fb6c78d9e4c3cb61038a107277d3a02cafd;p=squirrelmail.git
diff --git a/src/read_body.php b/src/read_body.php
index c60c0fd6..8d5409d9 100644
--- a/src/read_body.php
+++ b/src/read_body.php
@@ -23,7 +23,6 @@ require_once(SM_PATH . 'functions/date.php');
require_once(SM_PATH . 'functions/url_parser.php');
require_once(SM_PATH . 'functions/html.php');
-
/**
* Given an IMAP message id number, this will look it up in the cached
* and sorted msgs array and return the index. Used for finding the next
@@ -457,12 +456,13 @@ function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message,
}
echo '
'."\n";
- echo ' |
'."\n";
+ echo ' |
|
'."\n";
echo $s;
do_hook("read_body_header");
formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color);
echo ' |
';
- echo ' |
'."\n";
+ echo ' |
'."\n";
echo '';
}
@@ -550,6 +550,32 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
/* 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");
+ $next_link = _("Next");
+ if($entities[$passed_ent_id] > 1) {
+ $prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1];
+ $prev_link = '' . $prev_link . '';
+ }
+ if($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);
@@ -557,6 +583,7 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
$url = set_url_var($PHP_SELF, 'passed_ent_id',$par_ent_id);
$s .= ''._("Up").'';
}
+ $s .= $topbar_delimiter . $next_link;
}
$s .= '' . "\n" . '';
@@ -797,20 +824,24 @@ echo ' ';
echo ' ';
echo ' ';
-echo ' ';
-echo ' '. html_tag( 'td', ' '. $messagebody."\n", 'left').'';
+echo ' ';
+echo ' ' . html_tag( 'td', ' '. $messagebody."\n", 'left')
+ . ' ';
echo ' ';
echo ' ';
echo ' | ';
echo ' ';
echo ' | ';
+echo ' | '."\n";
+
$attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id);
if ($attachmentsdisplay) {
echo ' ';
echo ' ';
echo ' ';
- echo ' ';
+ echo ' ';
echo ' ';
echo ' ' . _("Attachments") . ':';
echo ' | ';
@@ -818,10 +849,11 @@ if ($attachmentsdisplay) {
echo ' ';
echo $attachmentsdisplay;
echo ' | ';
- echo ' ';
- echo ' | ';
- echo ' ';
+ echo ' | ';
+ echo ' | ';
echo ' ';
+ echo ' |
';
}
echo '';