protected function output() { if ($this->get('feed_message_content')) { $header_str = '<table class="msg_headers">' . '<col class="header_name_col"><col class="header_val_col"></colgroup>'; foreach ($this->get('feed_message_headers', array()) as $name => $value) { if ($name != 'link' && !strstr($value, ' ') && strlen($value) > 75) { $value = substr($value, 0, 75) . '...'; } if ($name == 'title') { $header_str .= '<tr class="header_subject"><th colspan="2">' . $this->html_safe($value) . '</td></tr>'; } elseif ($name == 'link') { $header_str .= '<tr class="header_' . $name . '"><th>' . $this->trans($name) . '</th><td><a target="_blank" href="' . $this->html_safe($value) . '">' . $this->html_safe($value) . '</a></td></tr>'; } elseif ($name == 'author' || $name == 'dc:creator' || $name == 'name') { $header_str .= '<tr class="header_from"><th>' . $this->trans($name) . '</th><td>' . $this->html_safe($value) . '</td></tr>'; } elseif ($name == 'pubdate' || $name == 'dc:date') { $header_str .= '<tr class="header_date"><th>' . $this->trans($name) . '</th><td>' . $this->html_safe($value) . '</td></tr>'; } else { $header_str .= '<tr><th>' . $this->trans($name) . '</th><td>' . $this->html_safe($value) . '</td></tr>'; } } $header_str .= '<tr><td colspan="2"></td></tr></table>'; $this->out('feed_message_content', str_replace(array('<', '>', '“'), array(' <', '> ', ' “'), $this->get('feed_message_content'))); $txt = '<div class="msg_text_inner">' . format_msg_html($this->get('feed_message_content')) . '</div>'; $this->out('feed_msg_text', $txt); $this->out('feed_msg_headers', $header_str); } }
/** * Format reply text as HTML * @subpackage core/functions * @param string $body message body * @param string $type MIME type * @param string $reply_type type (forward, reply, reply_all) * @param string $lead_in body lead in text * @return string */ function format_reply_as_html($body, $type, $reply_type, $lead_in) { if ($type == 'textplain') { if ($reply_type == 'reply') { $msg = nl2br($lead_in . format_reply_text($body)); } elseif ($reply_type == 'forward') { $msg = nl2br($lead_in . $body); } } elseif ($type == 'texthtml') { $msg = nl2br($lead_in) . '<hr /><blockquote>' . format_msg_html($body) . '</blockquote>'; } return $msg; }
/** * @subpackage wordpress/functions */ function wp_build_notice_text($type, $data) { $res = array(); if ($type == 'comment') { foreach ($data['items'] as $vals) { $res[] = $vals['header_text'] . '<br />' . $vals['html']; } } return '<div class="msg_text_inner">' . format_msg_html(implode('<div class="hr"></div>', $res)) . '</div>'; }
/** * Format html, text, or image content */ protected function output() { $txt = '<div class="msg_text_inner">'; if ($this->get('msg_text')) { $struct = $this->get('msg_struct_current', array()); if (isset($struct['subtype']) && strtolower($struct['subtype']) == 'html') { $txt .= format_msg_html($this->get('msg_text')); } elseif (isset($struct['type']) && strtolower($struct['type']) == 'image') { $txt .= format_msg_image($this->get('msg_text'), strtolower($struct['subtype'])); } else { $txt .= format_msg_text($this->get('msg_text'), $this); } } $txt .= '</div>'; $this->out('msg_text', $txt); }