From 70bdc74030f9bc8bd890eeab99cb8cffa96d2770 Mon Sep 17 00:00:00 2001 From: indiri69 Date: Fri, 18 Oct 2002 22:07:20 +0000 Subject: [PATCH] Added Previous and Next for digest parts. Let me know if it works okay. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3918 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/read_body.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/read_body.php b/src/read_body.php index 41ae3d5f..a880bc29 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -551,6 +551,29 @@ 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) { + $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); @@ -558,6 +581,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" . ''; -- 2.25.1