protected function _render()
{
$ret = parent::_render();
- $ret['data'] = $this->_IMPformat($ret['data']);
+ if (!empty($ret)) {
+ reset($ret);
+ $ret[key($ret)]['data'] = $this->_IMPformat($ret[key($ret)]['data']);
+ }
return $ret;
}
protected function _renderInline()
{
$ret = parent::_renderInline();
- $ret['data'] = $this->_IMPformat($ret['data']);
+ if (!empty($ret)) {
+ reset($ret);
+ $ret[key($ret)]['data'] = $this->_IMPformat($ret[key($ret)]['data']);
+ }
return $ret;
}
$render = $this->_IMPrender(false);
return array(
- 'data' => $render['html'],
- 'status' => $render['status'],
- 'type' => $this->_mimepart->getType(true)
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $render['html'],
+ 'status' => $render['status'],
+ 'type' => $this->_mimepart->getType(true)
+ )
);
}
$render = $this->_IMPrender(true);
return array(
- 'data' => $render['html'],
- 'status' => $render['status']
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $render['html'],
+ 'status' => $render['status'],
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
);
}
/* Viewing inline, and the browser can handle the image type
* directly. So output an <img> tag to load the image. */
return array(
- 'data' => Horde::img($this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('img_data' => 1))), $this->_mimepart->getName(true), null, '')
+ $this->_mimepart->getMimeId() => array(
+ 'data' => Horde::img($this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('img_data' => 1))), $this->_mimepart->getName(true), null, ''),
+ 'status' => array(),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
);
} else {
return $this->_renderInfo();
}
return array(
- 'status' => array(
- array(
- 'text' => $status
- )
+ $this->_mimepart->getMimeId() => array(
+ 'data' => '',
+ 'status' => array(
+ array(
+ 'text' => $status
+ )
+ ),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
)
);
}
}
return array(
- 'status' => array(
- array(
- 'icon' => Horde::img('mime/image.png', _("Thumbnail of attached image")),
- 'text' => $status
- )
+ $this->_mimepart->getMimeId() => array(
+ 'data' => '',
+ 'status' => array(
+ array(
+ 'icon' => Horde::img('mime/image.png', _("Thumbnail of attached image")),
+ 'text' => $status
+ )
+ ),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
)
);
}
}
return array(
- 'data' => $str,
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $str,
+ 'status' => array(),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
);
}
}
return array(
- 'data' => $data,
- 'type' => $type
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $data,
+ 'status' => array(),
+ 'type' => $type
+ )
);
}
}
return array(
- 'data' => $data,
- 'type' => $type
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $data,
+ 'status' => array(),
+ 'type' => $type
+ )
);
}
require_once IMP_BASE . '/lib/Crypt/PGP.php';
$imp_pgp = new IMP_PGP();
if (($out = $imp_pgp->parseMessageOutput($this->_mimepart, $this->_params['contents']))) {
- return array('data' => $out);
+ return array(
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $out,
+ 'status' => array(),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
+ );
}
}
$text = ' ' . substr($text, 1);
}
- return array('data' => '<div class="fixed leftAlign">' . "\n" . $text . '</div>');
+ return array(
+ $this->_mimepart->getMimeId() => array(
+ 'data' => '<div class="fixed leftAlign">' . "\n" . $text . '</div>',
+ 'status' => array(),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
+ );
}
}
{
if (!Util::getFormData('tnef_attachment')) {
$ret = $this->_renderInfo();
- $ret['data'] = '<html><body>' . $ret['data'] . '</body></html>';
+ reset($ret);
+ $ret[key($ret)]['data'] = '<html><body>' . $ret[key($ret)]['data'] . '</body></html>';
return $ret;
}
$text = $tnefData[$tnefKey]['stream'];
if (!empty($text)) {
return array(
- 'data' => $text,
- 'name' => $tnefData[$tnefKey]['name'],
- 'type' => $tnefData[$tnefKey]['type'] . '/' . $tnefData[$tnefKey]['subtype']
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $text,
+ 'name' => $tnefData[$tnefKey]['name'],
+ 'status' => array(),
+ 'type' => $tnefData[$tnefKey]['type'] . '/' . $tnefData[$tnefKey]['subtype']
+ )
);
}
}
}
return array(
- 'data' => $data,
- 'status' => array($status),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $data,
+ 'status' => array($status),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
);
}
}
$text = $zip->decompress($data, array('action' => HORDE_COMPRESS_ZIP_DATA, 'info' => &$zipInfo, 'key' => $fileKey));
if (!empty($text)) {
return array(
- 'data' => $text,
- 'name' => basename($zipInfo[$fileKey]['name']),
- 'type' => 'application/octet-stream'
+ $this->_mimepart->getMimeId() => array(
+ 'data' => $text,
+ 'name' => basename($zipInfo[$fileKey]['name']),
+ 'status' => array(),
+ 'type' => 'application/octet-stream'
+ )
);
}
}