Fix setting 'opposite' flags in message view
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 28 May 2009 12:02:04 +0000 (06:02 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 28 May 2009 12:02:04 +0000 (06:02 -0600)
imp/message.php
imp/templates/message/navbar_navigate.html

index f2a68ef..87a6d3f 100644 (file)
@@ -384,6 +384,8 @@ $mailbox_url = Util::addParameter(IMP::generateIMPUrl('mailbox.php', $imp_mbox['
 /* Generate the view link. */
 $view_link = IMP::generateIMPUrl('view.php', $imp_mbox['mailbox'], $index, $mailbox_name);
 
+$imp_flags = &IMP_Imap_Flags::singleton();
+
 /* Everything below here is related to preparing the output. */
 if (!IMP::$printMode) {
     /* Set the status information of the message. */
@@ -396,7 +398,6 @@ if (!IMP::$printMode) {
         }
     }
 
-    $imp_flags = &IMP_Imap_Flags::singleton();
     $flag_parse = $imp_flags->parse(array(
         'div' => true,
         'flags' => $flags,
@@ -441,7 +442,10 @@ if (!IMP::$printMode) {
 
     if (!$use_pop) {
         $n_template->set('mailbox', $imp_mbox['mailbox']);
-        $n_template->set('flaglist', $imp_flags->getList(array('imap' => true, 'mailbox' => $imp_mbox['mailbox'])));
+
+        $tmp = $imp_flags->getFlagList($imp_mbox['mailbox']);
+        $n_template->set('flaglist_set', $tmp['set']);
+        $n_template->set('flaglist_unset', $tmp['unset']);
 
         if ($conf['user']['allow_folders']) {
             $n_template->set('move', Horde::widget('#', _("Move to folder"), 'widget moveAction', '', '', _("Move"), true));
index c3429c1..72a9c60 100644 (file)
      <option value="" selected="selected"><gettext>Mark Messages</gettext></option>
      <option value="" disabled="disabled">- - - - - - - -</option>
      <option value=""><gettext>Mark as:</gettext></option>
-<loop:flaglist>
-     <option value="<tag:flaglist.flag />">&nbsp;&nbsp;<tag:flaglist.l /></option>
-</loop:flaglist>
+<loop:flaglist_set>
+     <option value="<tag:flaglist_set.f />">&nbsp;&nbsp;<tag:flaglist_set.l /></option>
+</loop:flaglist_set>
      <option value="" disabled="disabled">- - - - - - - -</option>
      <option value=""><gettext>Unmark as:</gettext></option>
-<loop:flaglist>
-     <option value="0<tag:flaglist.flag />">&nbsp;&nbsp;<tag:flaglist.l /></option>
-</loop:flaglist>
+<loop:flaglist_unset>
+     <option value="<tag:flaglist_unset.f />">&nbsp;&nbsp;<tag:flaglist_unset.l /></option>
+</loop:flaglist_unset>
     </select>
     </form>
    </div>