From c4dcda235cd69f4a5cfab95cec25b128224cda80 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Sat, 29 Sep 2007 21:57:56 +0000 Subject: [PATCH] Make message list refresh work again in default advanced tempate git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12712 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/strings.php | 26 ++++++++++++++++++++++++++ src/read_body.php | 15 +++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/functions/strings.php b/functions/strings.php index 14015cc0..c497ff90 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -545,6 +545,32 @@ function get_location () { } +/** + * Get Message List URI + * + * @param string $mailbox Current mailbox name (unencoded/raw) + * @param string $startMessage The mailbox page offset + * @param string $what Any current search parameters (OPTIONAL; + * default empty string) + * + * @return string The message list URI + * + * @since 1.5.2 + * + */ +function get_message_list_uri($mailbox, $startMessage, $what='') { + + global $base_uri; + + $urlMailbox = urlencode($mailbox); + + $list_xtra = "?where=read_body.php&what=$what&mailbox=" . $urlMailbox. + "&startMessage=$startMessage"; + + return $base_uri .'src/right_main.php'. $list_xtra; +} + + /** * Encrypts password * diff --git a/src/read_body.php b/src/read_body.php index d4746a56..456e9df3 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -431,7 +431,7 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message, /** * Format message toolbar * - * @param string $mailbox Name of current mailbox + * @param array $aMailbox Current mailbox information array * @param int $passed_id UID of current message * @param int $passed_ent_id Id of entity within message * @param object $message Current message object @@ -531,11 +531,11 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed } } - // Start with Search Results or Message List link. - $list_xtra = "?where=read_body.php&what=$what&mailbox=" . $urlMailbox. - "&startMessage=$startMessage"; - $msg_list_href = $base_uri .'src/right_main.php'. $list_xtra; - $search_href = $where=='search.php' ? $base_uri .'src/search.php?'.$list_xtra : ''; + $msg_list_href = get_message_list_uri($aMailbox['NAME'], $startMessage, $what); + if ($where == 'search.php') + $search_href = str_replace('read_body.php', 'search.php', $msg_list_href); + else + $search_href = ''; $comp_uri = $base_uri.'src/compose.php' . '?passed_id=' . $passed_id . @@ -947,6 +947,9 @@ $mailbox_cache[$iAccount.'_'.$aMailbox['NAME']] = $aMailbox; sqsession_register($mailbox_cache,'mailbox_cache'); $_SESSION['mailbox_cache'] = $mailbox_cache; +// message list URI is used in page header when on read_body +$oTemplate->assign('message_list_href', get_message_list_uri($aMailbox['NAME'], $startMessage, $what)); + displayPageHeader($color, $mailbox,'',''); formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,false); formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee); -- 2.25.1