Summary | hook msglist_format |
Queue | IMP |
Queue Version | HEAD |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | slusarz (at) horde (dot) org |
Requester | rsalmon (at) mbpgroup (dot) com |
Created | 01/26/2009 (5981 days ago) |
Due | |
Updated | 01/12/2010 (5630 days ago) |
Assigned | 01/28/2009 (5979 days ago) |
Resolved | 01/29/2009 (5978 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Bug #7891: Fix some dimp->imp hook conversion issues.create mode 100644 imp/templates/index/index-dimp.inc
delete mode 100644 imp/templates/index/index.inc
http://git.horde.org/diff.php/imp/config/conf.xml?rt=horde-git&r1=6a839412944d9486aceb6da1022209b4576e3a0b&r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/config/hooks.php.dist?rt=horde-git&r1=b8e9f72e5b48e3cd101bfd5263e6ecf3c0dd3d18&r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/index-dimp.php?rt=horde-git&r1=2813aaf25aa91219930609fa899932116e2f0771&r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/mailbox.php?rt=horde-git&r1=d81811acb02d3754c4061e0cf3a6c86c9b851dd8&r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/co.php/imp/templates/index/index-dimp.inc?rt=horde-git&r=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/templates/index/index.inc?rt=horde-git&r1=d9721f070d090c24bfdb2face6ecfa871d853a02&r2=c4120b38445a72b10568e2627c88f6de27ec16e6
State ⇒ Resolved
listed in this ticket aren't correct - I have fixed the issues in Git
master.
Assigned to Michael Slusarz
in configuration tab 'Dynamic View (dimp) Options'
$conf[dimp][hooks][msglist_format] = Should we use a custom function
to provide additional information/custom formatting of messages in the
mailbox message list? If so, make sure you define
_dimp_hook_msglist_format() in config/hooks.php.
Is it using _dimp_hook_msglist_format() or _imp_hook_msglist_format() ? Typo ?
hooks.php file.
more horde/imp/docs/CHANGES
--------
v5.0-git
--------
[mms] Add ability to download attachments in MIMP (
Request #2925).[mms] Revamp JS event handling model.
[mms] ESC in DIMP search box now clears the search (
Request #7196).[mms] Enhancements to status icon view (
Request #7519) (DIMP)....
Here is the msglist_format hook (this is the only hook activated):
if (!function_exists('_imp_hook_msglist_format')) {
function _imp_hook_msglist_format($mbox, $uids, $mode)
{
try {
$imap_res = $GLOBALS['imp_imap']->ob->fetch($mbox, array(
Horde_Imap_Client::FETCH_HEADERS =>
array(array('headers' => array('x-priority'), 'label' => 'hdr_search',
'parse' => true, 'peek' => true)),
Horde_Imap_Client::FETCH_STRUCTURE => array('parse' => true)
), array('ids' => array_values($uids)));
} catch (Horde_Imap_Client_Exception $e) {
return array();
}
$alt_list = IMP_UI_Mailbox::getAttachmentAltList();
$imp_ui = new IMP_UI_Mailbox($mbox);
$imp_msg_ui = new IMP_UI_Message();
$ret = array();
foreach ($uids as $uid) {
$tmp = array();
$res_ptr = &$imap_res[$uid];
$tmp['status'] = '';
// Add attachment information
if (($attachment =
$imp_ui->getAttachmentType($res_ptr['structure']->getType()))) {
switch ($mode) {
case 'imp':
$alt_text = (isset($alt_list[$attachment]))
? $alt_list[$attachment]
: $alt_list['attachment'];
$tmp['status'] = Horde::img($attachment . '.png',
$alt_text, array('title' => $alt_text));
break;
case 'dimp':
$tmp['atc'] = $attachment;
break;
}
}
// Add X-Priority information
switch
($imp_msg_ui->getXpriority($res_ptr['headers']['hdr_search']->getValue('x-priority')))
{
case 'high':
if ($mode == 'imp') {
$tmp['flagbits'] = IMP::FLAG_FLAGGED;
$tmp['status'] .=
Horde::img('mail_priority_high.png', _("High Priority"), array('title'
=> _("High Priority")));
}
$tmp['class'][] = 'important';
break;
case 'low':
if ($mode == 'imp') {
$tmp['status'] .=
Horde::img('mail_priority_low.png', _("Low Priority"), array('title'
=> _("Low Priority")));
}
$tmp['class'][] = 'unimportant';
break;
}
if (!empty($tmp)) {
$ret[$uid] = $tmp;
}
}
return $ret;
}
}
State ⇒ Not A Bug
+++ hooks.php 2009-01-26 12:25:22.000000000 +0100
@@ -220,7 +220,8 @@
foreach ($uids as $uid) {
$tmp = array();
$res_ptr = &$imap_res[$uid];
-
+ $tmp['status'] = '';
+
// Add attachment information
if (($attachment =
$imp_ui->getAttachmentType($res_ptr['structure']->getType()))) {
switch ($mode) {
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ hook msglist_format
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Notice: Undefined index: status in
/var/www/html/horde/imp/config/hooks.php on line 245
Warning: array_merge() [function.array-merge]: Argument
#1is not anarray in /var/www/html/horde/imp/mailbox.php on line 26
patches:
--- hooks.php.org 2009-01-26 12:21:21.000000000 +0100
+++ hooks.php 2009-01-26 12:25:22.000000000 +0100
@@ -220,7 +220,8 @@
foreach ($uids as $uid) {
$tmp = array();
$res_ptr = &$imap_res[$uid];
-
+ $tmp['status'];
+
// Add attachment information
if (($attachment =
$imp_ui->getAttachmentType($res_ptr['structure']->getType()))) {
switch ($mode) {
--- mailbox.php.org 2009-01-26 12:22:58.000000000 +0100
+++ mailbox.php 2009-01-26 12:26:31.000000000 +0100
@@ -23,7 +23,8 @@
$ptr = &$msgs[$uid];
if (!empty($val['class'])) {
- $ptr['bg'] = array_merge($ptr['bg'], $val['class']);
+ $tmp['bg'] = $ptr['bg'];
+ $ptr['bg'] = array_merge($tmp, $val['class']);
}
if (!empty($val['flagbits'])) {