+
+
+ $aProps = array(
+ 'columns' => $aColumns,
+ 'config' => array('alt_index_colors' => $alt_index_colors,
+ 'highlight_list' => $message_highlight_list,
+ 'fancy_index_highlite' => $fancy_index_highlite,
+ 'show_flag_buttons' => (isset($show_flag_buttons)) ? $show_flag_buttons : true,
+ 'lastTargetMailbox' => (isset($lastTargetMailbox)) ? $lastTargetMailbox : '',
+ 'trash_folder' => $trash_folder,
+ 'sent_folder' => $sent_folder,
+ 'draft_folder' => $draft_folder,
+ 'enablesort' => true,
+ 'color' => $color
+ ),
+ 'mailbox' => $mbx,
+ 'account' => (isset($iAccount)) ? $iAccount : 0,
+ 'module' => 'read_body',
+ 'email' => false);
+
+
+ $aMailbox = sqm_api_mailbox_select($imapConnection, $iAccount, $mbx,$aConfig,$aMailboxPref);
+
+ $iError = 0;
+ $aTemplate = showMessagesForMailbox($imapConnection, $aMailbox,$aProps, $iError);
+
+ // in th future we can make use of multiple message sets, now set it to 1 for search.
+ $iSetIndex = 1;
+ if (isset($aMailbox['UIDSET'][$iSetIndex])) {
+ $iMsgCnt += count($aMailbox['UIDSET'][$iSetIndex]);
+ }
+ if ($iError) {
+ // error handling
+ } else {
+ /**
+ * In the future, move this the the initialisation area
+ */
+ sqgetGlobalVar('align',$align,SQ_SESSION);
+
+ /**
+ * TODO: Clean up handling of message list once the template is cleaned up.
+ */
+ if ($aMailbox['EXISTS'] > 0) {
+ if ($iError) {
+ // TODO
+ echo "ERROR occured, errorhandler will be implemented very soon";
+ } else {
+ foreach ($aTemplate as $k => $v) {
+ $oTemplate->assign($k, $v);
+ }
+
+ $mailbox_display = asearch_get_mailbox_display($aMailbox['NAME']);
+ if (strtoupper($mbx) == 'INBOX') {
+ $mailbox_display = _("INBOX");
+ } else {
+ $mailbox_display = imap_utf7_decode_local($mbx);
+ }
+
+ $oTemplate->assign('mailbox_name', htmlspecialchars($mailbox_display));
+ $oTemplate->display('search_result_mailbox.tpl');
+
+ $oTemplate->assign('page_selector', $page_selector);
+ $oTemplate->assign('page_selector_max', $page_selector_max);
+ $oTemplate->assign('compact_paginator', $compact_paginator);
+ $oTemplate->assign('javascript_on', checkForJavascript());
+ $oTemplate->assign('base_uri', sqm_baseuri());
+ $oTemplate->assign('enablesort', (isset($aProps['config']['enablesort'])) ? $aProps['config']['enablesort'] : false);
+ $oTemplate->assign('icon_theme_path', $icon_theme_path);
+ $oTemplate->assign('use_icons', (isset($use_icons)) ? $use_icons : false);
+ $oTemplate->assign('aOrder', array_keys($aColumns));
+ $oTemplate->assign('alt_index_colors', isset($alt_index_colors) ? $alt_index_colors: false);
+ $oTemplate->assign('color', $color);
+ $oTemplate->assign('align', $align);
+ $oTemplate->assign('checkall', $checkall);
+ $oTemplate->assign('preselected', $preselected);
+
+ global $show_personal_names;
+ $oTemplate->assign('show_personal_names', $show_personal_names);
+
+ global $accesskey_mailbox_toggle_selected, $accesskey_mailbox_thread;
+ $oTemplate->assign('accesskey_mailbox_toggle_selected', $accesskey_mailbox_toggle_selected);
+ $oTemplate->assign('accesskey_mailbox_thread', $accesskey_mailbox_thread);
+
+ $oTemplate->display('message_list.tpl');
+ }
+ }