Esempio n. 1
0
function message_digest_message_headers_bottom($tools)
{
    $data = '';
    $msgs = $tools->get_from_store('message_digest_msgs');
    $vals = $tools->get_from_store('message_digest_vals');
    $date_format_2 = false;
    if (isset($_SESSION['user_settings']['mailbox_date_format'])) {
        $date_format = $_SESSION['user_settings']['mailbox_date_format'];
        if ($date_format != 'r' && $date_format != 'h') {
            if (isset($_SESSION['user_settings']['mailbox_date_format_2'])) {
                $date_format_2 = $_SESSION['user_settings']['mailbox_date_format_2'];
            }
        } elseif ($date_format == 'h') {
            $date_format = false;
        }
    } else {
        $date_format = false;
    }
    $trim_len = $tools->get_setting('trim_from_fld');
    if (!$trim_len) {
        $trim_len = 0;
    }
    if ($msgs && $vals) {
        $data = '<tr><td colspan="3"><div class="digest_div"><table class="digest_table" cellpadding="0" cellspacing="0" width="100%">';
        foreach ($msgs as $index => $msg) {
            $data .= '<tr><td width="1%">';
            if ($vals['mpart'] == $index) {
                $data .= '<span>&gt;</span>&#160;</td><td>';
            } else {
                $data .= '<span style="visibility: hidden;">&gt;</span>&#160;</td><td>';
            }
            $data .= '<a href="' . $vals['url'] . '&amp;message_part=' . $index . '">' . $tools->display_safe($msg['subject'], false, true) . '</a></td>';
            $data .= '<td nowrap="nowrap">' . trim_htmlstr($tools->display_safe($msg['from'], false, true), $trim_len) . '</td>';
            $data .= '<td class="dt_cell">' . print_time2($msg['date'], $date_format, $date_format_2) . '</td></tr>';
        }
        $data .= '</table></div></td></tr>';
    }
    return $data;
}
Esempio n. 2
0
 function print_mailbox_list_rows($cols, $rows, $onclick, $mailbox, $n = 1, $ignore_sent = false)
 {
     global $page_id;
     $data = '';
     $search_res = array();
     $date_format_2 = false;
     $c_start = '<complex-' . $page_id . '>';
     $c_end = '</complex-' . $page_id . '>';
     $td_end = $c_start . '</td>' . $c_end;
     $s_start = '<simple-' . $page_id . '>';
     $s_end = '</simple-' . $page_id . '>';
     if (isset($this->pd['settings']['mailbox_date_format'])) {
         $date_format = $this->pd['settings']['mailbox_date_format'];
         if ($date_format != 'r' && $date_format != 'h') {
             if (isset($this->pd['settings']['mailbox_date_format_2'])) {
                 $date_format_2 = $this->pd['settings']['mailbox_date_format_2'];
             }
         } elseif ($date_format == 'h') {
             $date_format = false;
         }
     } else {
         $date_format = false;
     }
     if (!$this->user->use_cookies) {
         $sid = '&amp;PHPSESSID=' . session_id();
     } else {
         $sid = '';
     }
     if ($this->dsp_page != 'search' && isset($this->pd['search_results'][$mailbox])) {
         $search_res = $this->pd['search_results'][$mailbox];
     }
     if (!isset($this->pd['mailbox_page'])) {
         $this->pd['mailbox_page'] = '';
     }
     if (!isset($this->pd['filter_by'])) {
         $this->pd['filter_by'] = '';
     }
     $list_count = count($rows);
     if (isset($_SESSION['toggle_uids'])) {
         $toggle_uids = $_SESSION['toggle_uids'];
     } else {
         $toggle_uids = array();
     }
     if (isset($_SESSION['toggle_all'])) {
         $toggle_all = $_SESSION['toggle_all'];
     } else {
         $toggle_all = false;
     }
     if (isset($_SESSION['toggle_boxes'])) {
         $toggle_boxes = $_SESSION['toggle_boxes'];
     } else {
         $toggle_boxes = array();
     }
     foreach ($rows as $vals) {
         if (isset($this->pd['settings']['hide_deleted_messages']) && $this->pd['settings']['hide_deleted_messages'] && stristr($vals['flags'], 'deleted')) {
             continue;
         }
         $vals['mailbox'] = $mailbox;
         $message_url = '?page=message' . $sid . '&amp;uid=' . $vals['uid'] . '&amp;mailbox_page=' . $this->pd['mailbox_page'] . '&amp;sort_by=' . $this->pd['sort_by'] . '&amp;filter_by=' . $this->pd['filter_by'] . '&amp;mailbox=' . urlencode($mailbox);
         $new_window = '';
         if ($onclick) {
             if (isset($this->pd['settings']['message_window']) && $this->pd['settings']['message_window']) {
                 $js = 'onclick="open_window(\'' . $message_url . '&amp;new_window=1&amp;parent_refresh=1' . $sid . '\', 1024, 900, ' . $vals['uid'] . ');
                    return false;" onmouseover="this.style.cursor=\'pointer\'"';
             } else {
                 $js = 'onclick="document.location.href=\'' . $message_url . '\';" onmouseover="this.style.cursor=\'pointer\'"';
             }
         } else {
             $js = false;
             if (isset($this->pd['settings']['message_window']) && $this->pd['settings']['message_window']) {
                 $new_window = 'onclick="open_window(\'' . $message_url . '&amp;new_window=1&amp;parent_refresh=1' . $sid . '\', 1024, 900, ' . $vals['uid'] . '); return false;"';
             }
         }
         if (!$ignore_sent && (isset($this->pd['settings']['sent_folder']) && $mailbox == $this->pd['settings']['sent_folder'] || isset($this->pd['settings']['draft_folder']) && $mailbox == $this->pd['settings']['draft_folder'])) {
             $from = clean_from($vals['to']);
             $full_from = $vals['to'];
         } else {
             $from = clean_from($vals['from']);
             $full_from = $vals['from'];
         }
         if (isset($this->pd['settings']['trim_subject_fld']) && $this->pd['settings']['trim_subject_fld']) {
             $subject_len = $this->pd['settings']['trim_subject_fld'];
         } else {
             $subject_len = 0;
         }
         if (isset($this->pd['settings']['trim_from_fld']) && $this->pd['settings']['trim_from_fld']) {
             $trim_len = $this->pd['settings']['trim_from_fld'];
         } else {
             $trim_len = 0;
         }
         $xtra_class = '';
         if (!empty($search_res) && in_array($vals['uid'], $search_res)) {
             $xtra_class = 'search_res ';
         }
         if (stristr($vals['flags'], 'seen')) {
             $class_prefix = 'mbx_';
         } else {
             $class_prefix = 'mbx_unseen_';
         }
         if ($n == $list_count) {
             $xtra_class .= ' last_row ';
         }
         if (!trim($vals['subject'])) {
             $vals['subject'] = $this->user->str[524];
         }
         $indicators = '&#160;&#160;';
         if (stristr($vals['content-type'], 'multipart') && !stristr($vals['content-type'], 'alternative')) {
             $indicators .= '<span class="multi_ind">+&#160;</span>';
         }
         if (stristr($vals['flags'], 'answered')) {
             $indicators .= '<span class="reply_ind">r&#160;&#160;</span>';
         }
         if (stristr($vals['flags'], 'flagged')) {
             $indicators .= '<span class="flag_ind">f&#160;&#160;</span>';
             $xtra_class .= ' flagged ';
         }
         if (trim($vals['x-priority']) == '1') {
             $indicators .= '<span class="important_ind">!&#160;&#160;</span>';
         }
         if (!empty($search_res) && in_array($vals['uid'], $search_res)) {
             $indicators .= '<span class="search_ind">*&#160;&#160;</span>';
         }
         if ($indicators) {
             $indicators = '<span class="' . $xtra_class . 'indicators">' . $indicators . '</span>';
         }
         $subj_post = '';
         $subj_pre = '';
         if (isset($this->pd['thread_data'][$vals['uid']])) {
             $ind = $this->pd['thread_data'][$vals['uid']]['level'] - 1;
             $subj_pre = str_repeat('&#160;', 5 * $ind);
             /*if (!$this->pd['thread_data'][$vals['uid']]['parent']) {
                   if (isset($this->pd['thread_data'][$vals['uid']]['reply_count'])) {
                       $subj_post .= ' <span class="reply_count">replies: <b>'.$this->pd['thread_data'][$vals['uid']]['reply_count'].'</b></span>';
                   }
                   else {
                       $subj_post .= ' <span class="reply_count">replies: 0</span>';
                   }
               }*/
         }
         if (stristr($vals['flags'], 'deleted')) {
             $subj_post .= '</div>';
             $subj_pre .= '<div class="deleted_message">';
         }
         $indicators_cell = '';
         $image_cell = '';
         $subject_cell = '';
         $from_cell = '';
         $date_cell = '';
         $size_cell = '';
         $checkbox_cell = '';
         $data .= $c_start . '<tr class="mbx_row">' . $c_end;
         $indicators_cell = $c_start . '<td ' . $js . ' class="' . $xtra_class . $class_prefix . 'indicators">';
         $indicators_cell .= $indicators . $c_end . $td_end;
         $checkbox_cell = $c_start . '<td class="' . $xtra_class . $class_prefix . 'checkbox">';
         $image_cell = $c_start . '<td class="' . $xtra_class . $class_prefix . 'image_cell">';
         if (!isset($this->pd['settings']['disable_list_icons']) || !$this->pd['settings']['disable_list_icons']) {
             $image_cell .= '<div></div>';
         }
         if (!isset($this->pd['settings']['message_window']) || !$this->pd['settings']['message_window']) {
             if (isset($this->pd['settings']['new_window_icon']) && $this->pd['settings']['new_window_icon']) {
                 $image_cell .= '<a href="' . $message_url . '" onclick="open_window(\'' . $message_url . '&amp;new_window=1&amp;parent_refresh=1\', 1024, 900, ' . $vals['uid'] . '); return false;" ' . 'title="' . $this->user->str[530] . '"><span class="new_window_icon"></span></a> ';
             }
         }
         $image_cell .= '</td>' . $c_end;
         if (isset($this->pd['last_message_read'][$mailbox]) && $this->pd['last_message_read'][$mailbox] == $vals['uid']) {
             $checkbox_cell .= '<span class="last_read">&gt;</span>';
         } else {
             $checkbox_cell .= '<span class="last_read_hidden">&gt;</span>';
         }
         $checkbox_cell .= $c_end . '<input type="hidden" id="mailboxes-' . $vals['uid'] . '" name="mailboxes[' . $vals['uid'] . ']" value="' . $this->user->htmlsafe($mailbox, false, false, true) . '" /><input type="checkbox" ';
         if ($toggle_all && !in_array($vals['uid'], $toggle_uids) && isset($toggle_boxes[$vals['uid']]) && $toggle_boxes[$vals['uid']] == $mailbox) {
             $checkbox_cell .= 'checked="checked" ';
         } elseif (isset($_GET['toggle_folder']) && $_GET['toggle_folder'] == $mailbox) {
             $checkbox_cell .= 'checked="checked" ';
         }
         $checkbox_cell .= 'id="message_' . $n . '" name="uids[]" value="' . $vals['uid'] . '" onclick="save_checked_state(' . $n . ');" /><input type="hidden" name="mailboxes[' . $vals['uid'] . ']" value="' . $this->user->htmlsafe($mailbox, false, false, true) . '" />' . $td_end;
         $subject_cell = $c_start . '<td class="' . $xtra_class . $class_prefix . 'subject">';
         $subject_cell .= '<div ' . $js . ' class="sub_div">' . $c_end . $subj_pre . '<a title="' . $this->user->htmlsafe($vals['subject'], $vals['charset'], true) . '" ' . $new_window . ' href="' . $message_url . '">' . trim_htmlstr($this->user->htmlsafe($vals['subject'], $vals['charset'], true), $subject_len) . '</a>' . $subj_post . $c_start . '</div>' . $c_end . $td_end . $s_start . '<br />' . $s_end;
         $plugin_cell = $c_start . '<td class="' . $xtra_class . $class_prefix . 'plugin_cell">' . $c_end . '<div>' . do_display_hook('msglist_after_subject', $vals) . '</div>' . $c_start . '</td>' . $c_end;
         $from_cell = $c_start . '<td ' . $js . ' class="' . $xtra_class . $class_prefix . 'from">' . $c_end . '<div title="' . $this->user->htmlsafe($full_from, $vals['charset'], true, false, false, false, true) . '" class="from_inner">' . trim_htmlstr($this->user->htmlsafe($from, $vals['charset'], true, false, false, false, true), $trim_len) . '</div>' . $td_end . $s_start . '<br />' . $s_end;
         $date_cell = $c_start . '<td ' . $js . ' class="' . $xtra_class . $class_prefix . 'date" >' . $c_end . print_time2($vals['date'], $date_format, $date_format_2) . $td_end . $s_start . '<br /><br />' . $s_end;
         $size_cell = $c_start . '<td ' . $js . ' class="' . $xtra_class . $class_prefix . 'size">' . format_size($vals['size'] / 1024) . '</td>' . $c_end;
         $folder_cell = $c_start . '<td ' . $js . ' class="' . $xtra_class . $class_prefix . 'folder">' . $this->user->htmlsafe($mailbox) . '</td>' . $c_end;
         foreach ($cols as $v) {
             if (isset(${$v})) {
                 $data .= ${$v};
             }
         }
         $data .= $c_start . '</tr>' . $c_end;
         $n++;
     }
     return $data;
 }
Esempio n. 3
0
 function print_part_headers()
 {
     global $page_id;
     global $max_header_length;
     global $sticky_url;
     $data = '<simple-' . $page_id . '><tr><td><br /></td></tr></simple-' . $page_id . '>' . do_display_hook('message_part_headers_top') . '<complex-' . $page_id . '>';
     $rows = '';
     foreach ($this->pd['message_part_headers'] as $i => $vals) {
         $name = $this->user->htmlsafe($vals[0], $this->pd['charset'], true);
         $val = $this->user->htmlsafe($vals[1], $this->pd['charset'], true);
         if ($this->pd['full_part_header'] == $i) {
             $val .= ' &#160;<a href="' . preg_replace('/\\&amp;full_part_header\\=\\d+/', '', $sticky_url) . '">' . $this->user->str[522] . '</a>';
         } elseif (htmlstrlen($val) > $max_header_length) {
             $val = trim_htmlstr($val, $max_header_length) . ' &#160;<a href="' . preg_replace('/\\&amp;full_part_header\\=\\d+/', '', $sticky_url) . '&amp;full_part_header=' . $i . '">' . $this->user->str[521] . '</a>';
         }
         $rows .= '<tr><th>' . $name . ': </th><td ';
         if (strtolower($vals[0]) == 'subject') {
             $rows .= 'class="subject_cell" ';
         }
         if (strtolower($vals[0]) == 'date' && $vals[1] && !$this->pd['show_full_headers']) {
             $rows .= '>' . date('r', strtotime(trim($val)));
             $rows .= ' &#160;&#160; (' . print_time(strtotime($vals[1]), $vals[1]) . ')';
         } else {
             $rows .= '>' . $val;
         }
         $rows .= '<br /></td></tr>';
     }
     if ($rows) {
         $data .= '<table width="100%" cellpadding="0" cellspacing="0">' . $rows . '</table>';
     }
     if (isset($this->pd['part_nav_list']) && count($this->pd['part_nav_list']) > 1) {
         $data .= '<div id="prev_next_part">' . $this->print_message_prev_next_part() . '</div>';
     }
     $data .= do_display_hook('message_part_headers_bottom') . '</complex-' . $page_id . '>';
     return $data;
 }