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