Make message list refresh work again in default advanced tempate
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 29 Sep 2007 21:57:56 +0000 (21:57 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 29 Sep 2007 21:57:56 +0000 (21:57 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12712 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/strings.php
src/read_body.php

index 14015cc0c6716af5d22bfb861cbf27bcea9c6a73..c497ff9033c0565593ebac14ffc8419f4c40e79e 100644 (file)
@@ -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
  *
index d4746a56bc29ca6a25286e9b00640df68e67fc99..456e9df3797839bd3ac949354f4021d6321c1890 100644 (file)
@@ -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&amp;what=$what&amp;mailbox=" . $urlMailbox.
-                 "&amp;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);