- echo '<form name="' . $form_name . '" method="post" action="move_messages.php">' ."\n"
- . $moveFields;
-?>
- <table width="100%" cellpadding="1" cellspacing="0" style="border: 1px solid <?php echo $color[0]; ?>">
- <tr>
- <td>
- <table bgcolor="<?php echo $color[4]; ?>" border="0" width="100%" cellpadding="1" cellspacing="0">
- <tr>
- <td align="left"><small><?php echo $paginator . $thread_link_str; ?></small></td>
- <td align="center"></td>
- <td align="right"><small><?php echo $msg_cnt_str; ?></small></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr width="100%" cellpadding="1" cellspacing="0" border="0" bgcolor="<?php echo $color[0]; ?>">
- <td>
- <table border="0" width="100%" cellpadding="1" cellspacing="0">
- <tr>
- <td align="left">
- <small><?php
-
- // display flag buttons only if supported
- if ($show_flag_buttons &&
- array_search('\\flagged',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
- echo getButton('SUBMIT', 'markUnflagged',_("Unflag"));
- echo getButton('SUBMIT', 'markFlagged',_("Flag"));
- echo ' ';
- }
- if (array_search('\\seen',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
- echo getButton('SUBMIT', 'markUnread',_("Unread"));
- echo getButton('SUBMIT', 'markRead',_("Read"));
- echo ' ';
- }
-
- echo getButton('SUBMIT', 'attache',_("Forward"));
- echo ' ';
- if (array_search('\\deleted',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
- echo getButton('SUBMIT', 'delete',_("Delete"));
- echo '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
- echo ' ';
- }
- if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') {
- echo getButton('SUBMIT', 'expungeButton',_("Expunge")) .' ' . _("mailbox") . "\n";
- echo ' ';
- }
- do_hook('mailbox_display_buttons');
- ?></small>
- </td>
- <?php
- if (array_search('\\deleted',$aMailbox['PERMANENTFLAGS'], true) !== FALSE) {
- echo '<td align="right">
- <small>';
- //echo $thread_link_str; //previous behaviour
- getMbxList($imapConnection);
- echo getButton('SUBMIT', 'moveButton',_("Move")) . "\n
- </small>";
- }
- ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
-<?php
- do_hook('mailbox_form_before');
-}
-
-/**
-* Function to add the last row in a message list, it contains the paginator and info about
-* the number of messages.
-*
-* @param integer $num_msgs number of messages in a mailbox
-* @param string $paginator_str Paginator string [Prev | Next] [ 1 2 3 ... 91 92 94 ] [Show all]
-* @param string $msg_cnt_str Message count string Viewing Messages: 21 to 1861 (20 total)
-*/
-function mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str) {
-global $color;
-if ($num_msgs) {
- /* space between list and footer */
-?>
-<tr><td height="5" bgcolor="<?php echo $color[4]; ?>" colspan="1"></td></tr>
-<tr>
- <td>
- <table width="100%" cellpadding="1" cellspacing="0" style="border: 1px solid <?php echo $color[0]; ?>">
- <tr>
- <td>
- <table bgcolor="<?php echo $color[4]; ?>" border="0" width="100%" cellpadding="1" cellspacing="0">
- <tr>
- <td align="left"><small><?php echo $paginator_str; ?></small></td>
- <td align="right"><small><?php echo $msg_cnt_str; ?></small></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
-</tr>
-<?php
-}
- /* End of message-list table */
-
- do_hook('mailbox_index_after');
- echo "</form>\n";
-}
-
-/**
-* Prints the table header for the messages list view
-*
-* @param array $aMailbox
-*/
-function printHeader($aMailbox) {
- global $index_order, $internal_date_sort, $color;
-
- if ($aMailbox['SORT_METHOD'] != 'THREAD') {
- $showsort = true;
- } else {
- $showsort = false;
- }
-
- echo html_tag( 'tr' ,'' , 'center', $color[5] );
-
- /* calculate the width of the subject column based on the
- * widths of the other columns */
- $widths = array(1=>1,2=>25,3=>5,4=>0,5=>1,6=>5);
- $subjectwidth = 100;
- foreach($index_order as $item) {
- $subjectwidth -= $widths[$item];
- }
-
- foreach ($index_order as $item) {
- switch ($item) {
- case 1: /* checkbox */
- echo html_tag( 'td',get_selectall_link($aMailbox) , '', '', 'width="1%"' );
- break;
- case 5: /* flags */
- echo html_tag( 'td','' , '', '', 'width="1%"' );
- break;
- case 2: /* from */
- if (handleAsSent($aMailbox['NAME'])) {
- echo html_tag( 'td' ,'' , 'left', '', 'width="25%"' )
- . '<b>' . _("To") . '</b>';
- if ($showsort) {
- ShowSortButton($aMailbox, SQSORT_TO_ASC, SQSORT_TO_DEC);
- }
- } else {
- echo html_tag( 'td' ,'' , 'left', '', 'width="25%"' )
- . '<b>' . _("From") . '</b>';
- if ($showsort) {
- ShowSortButton($aMailbox, SQSORT_FROM_ASC, SQSORT_FROM_DEC);
- }
- }
- echo "</td>\n";
- break;
- case 3: /* date */
- echo html_tag( 'td' ,'' , 'left', '', 'width="5%" nowrap' )
- . '<b>' . _("Date") . '</b>';
- if ($showsort) {
- if ($internal_date_sort) {
- ShowSortButton($aMailbox, SQSORT_INT_DATE_ASC, SQSORT_INT_DATE_DEC);
- } else {
- ShowSortButton($aMailbox, SQSORT_DATE_ASC, SQSORT_DATE_DEC);
- }
- }
- echo "</td>\n";
- break;
- case 4: /* subject */
- echo html_tag( 'td' ,'' , 'left', '', 'width="'.$subjectwidth.'%"' )
- . '<b>' . _("Subject") . '</b>';
- if ($showsort) {
- ShowSortButton($aMailbox, SQSORT_SUBJ_ASC, SQSORT_SUBJ_DEC);
- }
- echo "</td>\n";
- break;
- case 6: /* size */
- echo html_tag( 'td', '', 'center','','width="5%" nowrap')
- . '<b>' . _("Size") . '</b>';
- if ($showsort) {
- ShowSortButton($aMailbox, SQSORT_SIZE_ASC, SQSORT_SIZE_DEC);
- }
- echo "</td>\n";
- break;
- }
- }
- echo "</tr>\n";
+ //if (!sqgetGlobalVar('align',$align,SQ_SESSION)) {
+ $align = array('left' => 'left', 'right' => 'right');
+ //}
+ //sm_print_r($align);
+
+ /* finally set the template vars */
+
+ // FIX ME, before we support multiple templates we must review the names of the vars
+
+
+ $aTemplate['color'] = $color;
+ $aTemplate['form_name'] = "FormMsgs" . $safe_name;
+ $aTemplate['form_id'] = 'mbx_'.$iFormId;
+ $aTemplate['page_selector'] = $page_selector;
+ $aTemplate['page_selector_max'] = $page_selector_max;
+ $aTemplate['messagesPerPage'] = $aMailbox['LIMIT'];
+ $aTemplate['showall'] = $aMailbox['SHOWALL'][$iSetIndx];
+ $aTemplate['end_msg'] = $iEnd;
+ $aTemplate['align'] = $align;
+ $aTemplate['iNumberOfMessages'] = $iNumberOfMessages;
+ $aTemplate['aOrder'] = $aOrder;
+ $aTemplate['aFormElements'] = $aFormElements;
+ $aTemplate['sort'] = $sort;
+ $aTemplate['pageOffset'] = $aMailbox['PAGEOFFSET'];
+ $aTemplate['baseurl'] = $baseurl;
+ $aTemplate['aMessages'] =& $aMessages;
+ $aTemplate['trash_folder'] = $trash_folder;
+ $aTemplate['sent_folder'] = $sent_folder;
+ $aTemplate['draft_folder'] = $draft_folder;
+ $aTemplate['thread_link_str'] = $thread_link_str;
+ $aTemplate['php_self'] = str_replace('&','&',$php_self);
+ $aTemplate['mailbox'] = $sMailbox;
+ $aTemplate['javascript_on'] = (isset($aProps['config']['javascript_on'])) ? $aProps['config']['javascript_on'] : false;
+ $aTemplate['enablesort'] = (isset($aProps['config']['enablesort'])) ? $aProps['config']['enablesort'] : false;
+ $aTemplate['icon_theme'] = (isset($aProps['config']['icon_theme'])) ? $aProps['config']['icon_theme'] : false;
+ $aTemplate['use_icons'] = (isset($aProps['config']['use_icons'])) ? $aProps['config']['use_icons'] : false;
+ $aTemplate['alt_index_colors'] = (isset($aProps['config']['alt_index_colors'])) ? $aProps['config']['alt_index_colors'] : false;
+ $aTemplate['fancy_index_highlite'] = $fancy_index_highlite;
+
+
+ return $aTemplate;