Message/rfc822 previewer compatibility with Enigma

pull/5241/head
Aleksander Machniak 8 years ago
parent 640e5e265d
commit d125f864ea

@ -341,7 +341,7 @@ function rcube_webmail()
}
else if (this.env.action == 'get') {
this.enable_command('download', 'print', true);
if (this.env.mimetype == 'message/rfc822') {
if (this.env.is_message) {
this.enable_command('reply', 'reply-all', 'forward', 'forward-inline', 'forward-attachment', true);
if (this.env.list_post)
this.enable_command('reply-list', true);
@ -1217,7 +1217,7 @@ function rcube_webmail()
this.open_window(this.env.comm_path + url, true, true);
}
}
else if (this.env.action == 'get' && this.env.mimetype != 'message/rfc822') {
else if (this.env.action == 'get' && !this.env.is_message) {
this.gui_objects.messagepartframe.contentWindow.print();
}
else if (uid = this.get_single_uid()) {

@ -63,9 +63,14 @@ if (!empty($_GET['_frame'])) {
));
$mimetype = $part ? rcmail_fix_mimetype($part->mimetype) : '';
if ($part_id && $mimetype == 'message/rfc822') {
// message/rfc822 preview (Note: handle also multipart/ parts, they can
// come from Enigma, which replaces message/rfc822 with real mimetype)
if ($part_id && ($mimetype == 'message/rfc822' || strpos($mimetype, 'multipart/') === 0)) {
$uid = preg_replace('/\.[0-9.]+/', '', $uid);
$uid .= '.' . $part_id;
$OUTPUT->set_env('is_message', true);
}
$OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
@ -458,9 +463,8 @@ function rcmail_message_part_frame($attrib)
{
global $RCMAIL;
$mimetype = $RCMAIL->output->get_env('mimetype');
if ($mimetype == 'message/rfc822') {
if ($RCMAIL->output->get_env('is_message')) {
$attrib['src'] = $RCMAIL->url(array(
'task' => 'mail',
'action' => 'preview',
@ -470,6 +474,7 @@ function rcmail_message_part_frame($attrib)
));
}
else {
$mimetype = $RCMAIL->output->get_env('mimetype');
$frame_replace = strpos($mimetype, 'text/') === 0 ? '_embed=' : '_preload=';
$attrib['src'] = './?' . str_replace('_frame=', $frame_replace, $_SERVER['QUERY_STRING']);
}

@ -17,7 +17,7 @@
<roundcube:button command="download" type="link" class="button download" classAct="button download" classSel="button downloadSel" title="download" content=" " />
<roundcube:button command="print" type="link" class="button print" classAct="button print" classSel="button printSel" title="print" content=" " />
<roundcube:container name="toolbar" id="messagetoolbar" />
<roundcube:if condition="env:mimetype == 'message/rfc822'" />
<roundcube:if condition="env:is_message" />
<span class="toolbarseparator">&nbsp;</span>
<roundcube:button command="reply" type="link" class="buttonPas reply" classAct="button reply" classSel="button replySel" title="replytomessage" content=" " />
<span class="dropbutton">
@ -43,7 +43,7 @@
</div>
</div>
<roundcube:if condition="env:mimetype == 'message/rfc822'" />
<roundcube:if condition="env:is_message" />
<div id="forwardmenu" class="popupmenu">
<ul id="forwardmenumenu">
<roundcube:button type="link-menuitem" command="forward-inline" label="forwardinline" prop="sub" classAct="forwardlink active" class="forwardlink" />

@ -17,7 +17,7 @@
<roundcube:button command="download" type="link" class="button download disabled" classAct="button download" classSel="button download pressed" label="download" title="download" />
<roundcube:button command="print" type="link" class="button print disabled" classAct="button print" classSel="button print pressed" label="print" title="print" />
<roundcube:container name="toolbar" id="messagetoolbar" />
<roundcube:if condition="env:mimetype == 'message/rfc822'" />
<roundcube:if condition="env:is_message" />
<span class="spacer"></span>
<roundcube:button command="reply" type="link" class="button reply disabled" classAct="button reply" classSel="button reply pressed" label="reply" title="replytomessage" />
<span class="dropbutton">
@ -50,7 +50,7 @@
</div>
</div>
<roundcube:if condition="env:mimetype == 'message/rfc822'" />
<roundcube:if condition="env:is_message" />
<div id="forwardmenu" class="popupmenu" aria-hidden="true">
<h3 id="aria-label-forwardmenu" class="voice"><roundcube:label name="arialabelforwardingoptions" /></h3>
<ul id="forwardmenu-menu" class="toolbarmenu" role="menu" aria-labelledby="aria-label-forwardmenu">

Loading…
Cancel
Save