Horde_Mime_Viewer_Rfc822::_renderInfo PHP 메소드

_renderInfo() 보호된 메소드

Return the rendered information about the Horde_Mime_Part object.
protected _renderInfo ( ) : array
리턴 array See parent::render().
    protected function _renderInfo()
    {
        /* Get the text of the part.  Since we need to look for the end of
         * the headers by searching for the CRLFCRLF sequence, use
         * getCanonicalContents() to make sure we are getting the text with
         * CRLF's. */
        $text = $this->_mimepart->getContents(array('canonical' => true));
        if (empty($text)) {
            return array();
        }
        /* Search for the end of the header text (CRLFCRLF). */
        $text = substr($text, 0, strpos($text, "\r\n\r\n"));
        /* Get the list of headers now. */
        $headers = Horde_Mime_Headers::parseHeaders($text);
        $header_array = array('date' => Horde_Mime_Viewer_Translation::t("Date"), 'from' => Horde_Mime_Viewer_Translation::t("From"), 'to' => Horde_Mime_Viewer_Translation::t("To"), 'cc' => Horde_Mime_Viewer_Translation::t("Cc"), 'bcc' => Horde_Mime_Viewer_Translation::t("Bcc"), 'reply-to' => Horde_Mime_Viewer_Translation::t("Reply-To"), 'subject' => Horde_Mime_Viewer_Translation::t("Subject"));
        $header_output = array();
        foreach ($header_array as $key => $val) {
            $hdr = $this->_getHeaderValue($headers, $key);
            if (!empty($hdr)) {
                $header_output[] = '<strong>' . $val . ':</strong> ' . htmlspecialchars($hdr);
            }
        }
        return $this->_renderReturn(empty($header_output) ? '' : '<div class="fixed mimeHeaders">' . $this->_textFilter(implode("<br />\n", $header_output), 'emails') . '</div>', 'text/html; charset=UTF-8');
    }

Usage Example

예제 #1
0
파일: Rfc822.php 프로젝트: horde/horde
 /**
  */
 protected function _renderInfo()
 {
     $ret = parent::_renderInfo();
     if (!empty($ret)) {
         $ret[$this->_mimepart->getMimeId()]['wrap'] = 'mimePartWrap';
     }
     return $ret;
 }