From 9a9aa2c600726403851bbf08d8a6c46a12d664c0 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 2 Apr 2009 08:58:27 -0600 Subject: [PATCH] Implement user flags for mimp --- imp/mailbox-mimp.php | 23 +++++++++++++++-------- imp/message-mimp.php | 8 +++++++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/imp/mailbox-mimp.php b/imp/mailbox-mimp.php index fbaa6866e..bfcd6db5a 100644 --- a/imp/mailbox-mimp.php +++ b/imp/mailbox-mimp.php @@ -109,14 +109,6 @@ while (list(,$ob) = each($mbox_info['overview'])) { $msg['from'] = String::substr($msg['from'], 0, $conf['mimp']['mailbox']['max_from_chars']) . '...'; } - if (!is_null($threadob) && ($threadob->getThreadIndent($ob['uid']))) { - $msg['subject'] = '>> ' . ltrim($msg['subject']); - } - - if (String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) { - $msg['subject'] = String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...'; - } - /* Get flag information. */ $imp_flags = &IMP_Imap_Flags::singleton(); $flag_parse = $imp_flags->parse(array( @@ -128,9 +120,24 @@ while (list(,$ob) = each($mbox_info['overview'])) { foreach ($flag_parse as $val) { if (isset($val['abbrev'])) { $msg['status'] .= $val['abbrev']; + } elseif ($val['type'] == 'imapp') { + $msg['subject'] = '*' . + ((String::length($val['label']) > 8) + ? String::substr($val['label'], 0, 5) . '...' + : $val['label'] + ) . + '* ' . $msg['subject']; } } + if (!is_null($threadob) && ($threadob->getThreadIndent($ob['uid']))) { + $msg['subject'] = '>> ' . ltrim($msg['subject']); + } + + if (String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) { + $msg['subject'] = String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...'; + } + /* Generate the target link. */ $msg['target'] = in_array('\\draft', $ob['flags']) ? IMP::composeLink(array(), array('a' => 'd', 'thismailbox' => $imp_mbox['mailbox'], 'index' => $ob['uid'], 'bodypart' => 1)) diff --git a/imp/message-mimp.php b/imp/message-mimp.php index beedafafb..1405f0bb8 100644 --- a/imp/message-mimp.php +++ b/imp/message-mimp.php @@ -224,6 +224,12 @@ $flag_parse = $imp_flags->parse(array( foreach ($flag_parse as $val) { if (isset($val['abbrev'])) { $status .= $val['abbrev']; + } elseif ($val['type'] == 'imapp') { + if (String::length($val['label']) > 8) { + $status .= ' *' . String::substr($val['label'], 0, 5) . '...*'; + } else { + $status .= ' *' . $val['label'] . '*'; + } } } @@ -339,7 +345,7 @@ MIMP::addMIMPMenu($mset, 'message'); $mimp_render->set('title', $display_headers['subject']); -$c = &$mimp_render->add(new Horde_Mobile_card('m', $status . ' ' . $display_headers['subject'] . ' ' . sprintf(_("(%d of %d)"), $msgindex, $msgcount))); +$c = &$mimp_render->add(new Horde_Mobile_card('m', ($status ? $status . ' | ' : '') . $display_headers['subject'] . ' ' . sprintf(_("(%d of %d)"), $msgindex, $msgcount))); $c->softkey('#o', _("Menu")); $imp_notify->setMobileObject($c); -- 2.11.0