From: Michael M Slusarz Date: Thu, 29 Jan 2009 17:17:16 +0000 (-0700) Subject: Bug #7891: Fix some dimp->imp hook conversion issues. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c4120b38445a72b10568e2627c88f6de27ec16e6;p=horde.git Bug #7891: Fix some dimp->imp hook conversion issues. --- 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-dimp.inc b/imp/templates/index/index-dimp.inc new file mode 100644 index 000000000..2776fca7b --- /dev/null +++ b/imp/templates/index/index-dimp.inc @@ -0,0 +1,469 @@ +getImageDir('horde'); + +// Thread images +$thread_imgs = IMP_IMAP_Thread::getImageUrls(true, true); + +// Attachment images +$imp_ui = new IMP_UI_Mailbox('INBOX'); +$atc_imgs = array(); +foreach ($imp_ui->getAttachmentAltList() as $k => $v) { + $atc_imgs[] = IMP::img($k . '.png', $v, array('id' => 'atc_img_' . $k)); +} + +$usetrash = $prefs->getValue('use_trash'); +$menu_view = $prefs->getValue('menu_view'); +$show_text = ($menu_view == 'text' || $menu_view == 'both'); +$loading_text = _("Loading..."); +$is_ie6 = ($browser->isBrowser('msie') && ($browser->getMajor() < 7)); + +$has_blacklist = $registry->hasMethod('mail/blacklistFrom'); +$has_whitelist = $registry->hasMethod('mail/whitelistFrom'); + +// Sidebar width +$sidebar_width = max((int)$prefs->getValue('sidebar_width') - 50, 150) . 'px'; + +// Quota information +$show_quota = (isset($_SESSION['imp']['quota']) && is_array($_SESSION['imp']['quota'])); + +// Small utility functions to simplify creating dimpactions buttons. +// As of right now, we don't show text only links. +function _createDA($text, $image, $id = null, $class = '', $show_text = true) +{ + $params = array('icon' => $image, 'id' => $id, 'class' => $class); + if ($show_text) { + $params['title'] = $text; + } else { + $params['tooltip'] = $text; + } + echo DIMP::actionButton($params); +} + +function _simpleButton($id, $text, $image, $imagedir = null) +{ + $ak = Horde::getAccessKey($text, true); + return ''; +} +?> +
+