Aleksander Machniak
2016-03-25 d125f864ea31cf0b6ecce462f711467fc6441747
Message/rfc822 previewer compatibility with Enigma
4 files modified
23 ■■■■■ changed files
program/js/app.js 4 ●●●● patch | view | raw | blame | history
program/steps/mail/get.inc 11 ●●●● patch | view | raw | blame | history
skins/classic/templates/messagepart.html 4 ●●●● patch | view | raw | blame | history
skins/larry/templates/messagepart.html 4 ●●●● patch | view | raw | blame | history
program/js/app.js
@@ -341,7 +341,7 @@
        }
        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 @@
            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()) {
program/steps/mail/get.inc
@@ -63,9 +63,14 @@
    ));
    $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 @@
{
    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 @@
        ));
    }
    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']);
    }
skins/classic/templates/messagepart.html
@@ -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" />
skins/larry/templates/messagepart.html
@@ -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">