IMP_Compose::_getMsgHeaders PHP Méthode

_getMsgHeaders() protected méthode

Determine the header information to display in the forward/reply.
protected _getMsgHeaders ( Horde_Mime_Headers $h ) : string
$h Horde_Mime_Headers The headers object for the message.
Résultat string The header information for the original message.
    protected function _getMsgHeaders($h)
    {
        $tmp = array();
        if ($ob = $h['date']) {
            $tmp[_("Date")] = $ob->value;
        }
        if ($ob = strval($h['from'])) {
            $tmp[_("From")] = $ob;
        }
        if ($ob = strval($h['reply-to'])) {
            $tmp[_("Reply-To")] = $ob;
        }
        if ($ob = $h['subject']) {
            $tmp[_("Subject")] = $ob->value;
        }
        if ($ob = strval($h['to'])) {
            $tmp[_("To")] = $ob;
        }
        if ($ob = strval($h['cc'])) {
            $tmp[_("Cc")] = $ob;
        }
        $text = '';
        if (!empty($tmp)) {
            $max = max(array_map(array('Horde_String', 'length'), array_keys($tmp))) + 2;
            foreach ($tmp as $key => $val) {
                $text .= Horde_String::pad($key . ': ', $max, ' ', STR_PAD_LEFT) . $val . "\n";
            }
        }
        return $text;
    }