1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: class IMP_Mime_Viewer_Mdn extends Horde_Mime_Viewer_Base
17: {
18: 19: 20: 21: 22:
23: protected $_capability = array(
24: 'full' => false,
25: 'info' => true,
26: 'inline' => true,
27: 'raw' => false
28: );
29:
30: 31: 32: 33: 34:
35: protected $_metadata = array(
36: 'compressed' => false,
37: 'embedded' => false,
38: 'forceinline' => true
39: );
40:
41: 42: 43: 44: 45:
46: protected function _renderInline()
47: {
48: return $this->_renderInfo();
49: }
50:
51: 52: 53: 54: 55:
56: protected function _renderInfo()
57: {
58: $mdn_id = $this->_mimepart->getMimeId();
59: $parts = array_keys($this->_mimepart->contentTypeMap());
60:
61: $status = new IMP_Mime_Status(_("A message you have sent has resulted in a return notification from the recipient."));
62: $status->icon('info_icon.png', _("Info"));
63:
64: 65: 66: 67: 68:
69:
70:
71: reset($parts);
72: $part1_id = next($parts);
73:
74:
75: $part2_id = Horde_Mime::mimeIdArithmetic($part1_id, 'next');
76: $part = $this->getConfigParam('imp_contents')->getMIMEPart($part2_id);
77: if ($part) {
78: $status->addText(sprintf(_("Technical details can be viewed %s."), $this->getConfigParam('imp_contents')->linkViewJS($part, 'view_attach', _("HERE"), array('jstext' => _("Technical details"), 'params' => array('ctype' => 'text/plain', 'mode' => IMP_Contents::RENDER_FULL)))));
79: }
80: $ret[$part2_id] = null;
81:
82:
83: $part3_id = Horde_Mime::mimeIdArithmetic($part2_id, 'next');
84: $part = $this->getConfigParam('imp_contents')->getMIMEPart($part3_id);
85: if ($part) {
86: $status->addText(sprintf(_("The text of the sent message can be viewed %s."), $this->getConfigParam('imp_contents')->linkViewJS($part, 'view_attach', _("HERE"), array('jstext' => _("The text of the sent message"), 'params' => array('ctype' => 'message/rfc822', 'mode' => IMP_Contents::RENDER_FULL)))));
87: foreach ($part->contentTypeMap() as $key => $val) {
88: $ret[$key] = null;
89: }
90: }
91:
92: $ret[$mdn_id] = array(
93: 'data' => '',
94: 'status' => $status,
95: 'type' => 'text/html; charset=' . $this->getConfigParam('charset'),
96: 'wrap' => 'mimePartWrap'
97: );
98:
99: return $ret;
100: }
101:
102: }
103: