From 46f7b7096450939fe03c95aa81ce06ae4bfca89d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 28 Mar 2016 06:51:43 -0400
Subject: [PATCH] Enable reply/reply-all/forward buttons also in preview frame of message/rfc822
---
program/steps/mail/show.inc | 3 ++-
skins/classic/templates/messagepreview.html | 2 +-
skins/larry/templates/messagepreview.html | 10 +++++-----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index d890868..8715cd5 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -67,7 +67,7 @@
// set message environment
$OUTPUT->set_env('uid', $msg_id);
$OUTPUT->set_env('safemode', $MESSAGE->is_safe);
- $OUTPUT->set_env('no_preview_controls', $MESSAGE->context !== null);
+ $OUTPUT->set_env('message_context', $MESSAGE->context);
$OUTPUT->set_env('sender', $MESSAGE->sender['string']);
$OUTPUT->set_env('mailbox', $mbox_name);
$OUTPUT->set_env('username', $RCMAIL->get_user_name());
@@ -126,6 +126,7 @@
// check for unset disposition notification
if ($MESSAGE->headers->mdn_to
+ && $MESSAGE->context === null
&& empty($MESSAGE->headers->flags['MDNSENT'])
&& empty($MESSAGE->headers->flags['SEEN'])
&& ($RCMAIL->storage->check_permflag('MDNSENT') || $RCMAIL->storage->check_permflag('*'))
diff --git a/skins/classic/templates/messagepreview.html b/skins/classic/templates/messagepreview.html
index d74c2d6..08c4fda 100644
--- a/skins/classic/templates/messagepreview.html
+++ b/skins/classic/templates/messagepreview.html
@@ -16,7 +16,7 @@
<roundcube:if condition="env:optional_format=='html'" />
<roundcube:button command="change-format" prop="html" image="/images/icons/html.png" width="15" height="15" title="changeformathtml" id="changeformathtml" />
<roundcube:endif />
- <roundcube:if condition="env:no_preview_controls == false">
+ <roundcube:if condition="!env:message_context">
<roundcube:button command="extwin" image="/images/icons/extwin.png" width="15" height="15" title="openinextwin" id="openextwinlink" />
<roundcube:endif />
</div>
diff --git a/skins/larry/templates/messagepreview.html b/skins/larry/templates/messagepreview.html
index e504285..371fb71 100644
--- a/skins/larry/templates/messagepreview.html
+++ b/skins/larry/templates/messagepreview.html
@@ -15,20 +15,20 @@
<span class="buttongroup">
<roundcube:button command="change-format" prop="html" type="link" class="button first changeformat html selected" innerClass="icon" title="changeformathtml" content="HTML" /><roundcube:button command="change-format" prop="text" type="link" class="button last changeformat text" classSel="button changeformat text pressed" innerClass="icon" title="changeformattext" content="Text" />
</span>
-
<roundcube:elseif condition="env:optional_format=='html'" />
+
<span class="buttongroup">
<roundcube:button command="change-format" prop="html" type="link" class="button first changeformat html" classSel="button changeformat html pressed" innerClass="icon" title="changeformathtml" content="HTML" /><roundcube:button command="change-format" prop="text" type="link" class="button last changeformat text selected" innerClass="icon" title="changeformattext" content="Text" />
</span>
-
<roundcube:endif />
-<roundcube:if condition="env:mailbox != config:drafts_mbox and env:no_preview_controls == false">
+<roundcube:if condition="env:mailbox != config:drafts_mbox || env:message_context">
+
<roundcube:button command="reply" type="link" class="button reply" classSel="button reply pressed" innerClass="icon" title="replytomessage" label="replytomessage" />
<roundcube:button command="reply-all" type="link" class="button replyall" classSel="button replyall pressed" innerClass="icon" title="replytoallmessage" label="replytoallmessage" />
<roundcube:button command="forward" type="link" class="button forward" classSel="button forward pressed" innerClass="icon" title="forwardmessage" label="forwardmessage" />
-
<roundcube:endif />
-<roundcube:if condition="env:no_preview_controls == false">
+<roundcube:if condition="!env:message_context">
+
<roundcube:button command="extwin" type="link" class="button extwin" classSel="button extwin pressed" innerClass="icon" title="openinextwin" label="openinextwin" />
<roundcube:endif />
</div>
--
Gitblit v1.9.1