From c4120b38445a72b10568e2627c88f6de27ec16e6 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 29 Jan 2009 10:17:16 -0700 Subject: [PATCH] Bug #7891: Fix some dimp->imp hook conversion issues. --- imp/config/conf.xml | 16 ++++++---------- imp/config/hooks.php.dist | 16 ++++++++-------- imp/index-dimp.php | 2 +- imp/mailbox.php | 2 +- imp/templates/index/{index.inc => index-dimp.inc} | 0 5 files changed, 16 insertions(+), 20 deletions(-) rename imp/templates/index/{index.inc => index-dimp.inc} (100%) diff --git a/imp/config/conf.xml b/imp/config/conf.xml index 09c486c6f..8a8284d57 100644 --- a/imp/config/conf.xml +++ b/imp/config/conf.xml @@ -470,32 +470,28 @@ run a custom function in which array elements can be added to use in the template file, while processing the message lists? If so, make sure you define _imp_hook_dimp_mailboxarray() in config/hooks.php. The elements - will be available as template tags in the dimp/templates/imp/mailbox.html + will be available as template tags in the imp/templates/imp/mailbox.html template file.">false false false false - false + files to load from the imp/themes/ directory."/> JavaScript Settings diff --git a/imp/config/hooks.php.dist b/imp/config/hooks.php.dist index 0f0e92cf6..ea1b78613 100644 --- a/imp/config/hooks.php.dist +++ b/imp/config/hooks.php.dist @@ -218,7 +218,7 @@ // $ret = array(); // // foreach ($uids as $uid) { -// $tmp = array(); +// $tmp = array('status' => ''); // $res_ptr = &$imap_res[$uid]; // // // Add attachment information @@ -516,11 +516,11 @@ if (!function_exists('_imp_hook_quota')) { // This is an example hook function for the dynamic (dimp) mailbox view. This // function is allows additional information to be added to the array that is // is passed to the mailbox display template - -// dimp/templates/javascript/mailbox.js. The current entry array is passed -// in, the value returned should be the altered array to use in the +// imp/templates/javascript/mailbox-dimp.js. The current entry array is +// passed in, the value returned should be the altered array to use in the // template. If you are going to add new columns, you also have to update -// dimp/templates/index/index.inc to contain the new field in the header and -// dimp/themes/screen.css to specify the column width. +// imp/templates/index/dimp.inc to contain the new field in the header and +// imp/themes/screen-dimp.css to specify the column width. // if (!function_exists('_imp_hook_dimp_mailboxarray')) { // function _imp_hook_dimp_mailboxarray($msgs) { @@ -535,7 +535,7 @@ if (!function_exists('_imp_hook_quota')) { // This is an example hook function for the dynamic (dimp) message view. This // function allows additional information to be added to the array that is // passed to the message text display template - -// dimp/templates/chunks/message.html. The current entry array is passed in +// imp/templates/chunks/message.php. The current entry array is passed in // (see the showMessage() function in lib/Views/ShowMessage.php for the // format). The value returned should be the altered array to use in the // template. @@ -550,8 +550,8 @@ if (!function_exists('_imp_hook_quota')) { // This is an example hook function for the dynamic (dimp) preview view. This // function allows additional information to be added to the preview view and -// its corresponding template - dimp/templates/index/index.inc. The current -// entry array is passed in (see the showMessage() function in +// its corresponding template - imp/templates/index/index-dimp.inc. The +// current entry array is passed in (see the showMessage() function in // lib/Views/ShowMessage.php for the format). Since the preview pane is // dynamically updated via javascript, all updates other than the base // entries must be provided in javascript code to be run at update time. The diff --git a/imp/index-dimp.php b/imp/index-dimp.php index 98f00d545..b634bc58a 100644 --- a/imp/index-dimp.php +++ b/imp/index-dimp.php @@ -62,7 +62,7 @@ foreach (DIMP::menuList() as $app) { } echo "\n"; -require IMP_TEMPLATES . '/index/index.inc'; +require IMP_TEMPLATES . '/index/index-dimp.inc'; IMP::includeScriptFiles(); IMP::outputInlineScript(); $notification->notify(array('listeners' => array('javascript'))); diff --git a/imp/mailbox.php b/imp/mailbox.php index 55a784e95..12fe5c96a 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -23,7 +23,7 @@ function _outputSummaries($msgs, $mbox, &$ids) $ptr = &$msgs[$uid]; if (!empty($val['class'])) { - $ptr['bg'] = array_merge($ptr['bg'], $val['class']); + $ptr['bg'] = implode(' ', array_keys(array_flip(array_merge(explode(' ', $ptr['bg']), $val['class'])))); } if (!empty($val['flagbits'])) { diff --git a/imp/templates/index/index.inc b/imp/templates/index/index-dimp.inc similarity index 100% rename from imp/templates/index/index.inc rename to imp/templates/index/index-dimp.inc -- 2.11.0