summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-10-27 16:12:37 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-10-27 16:12:37 +0200
commitddafe4e4109a8d6d412c3c138412ee2ca3d58dbf (patch)
tree25bf6c599459a00b75c2ce95b59520d1e7ede7ec /program/include
parentf2d3fc1b5d66013c265d82891b8526389303eff3 (diff)
parent033cb2105aebf06d46ba13471de5dc5dc547e7bd (diff)
Merge branch 'dev-compose-newwindow'
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_message.php20
-rw-r--r--program/include/rcube_output_html.php11
2 files changed, 15 insertions, 16 deletions
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index d15cc7577..38d18171c 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -210,26 +210,16 @@ class rcube_message
if (!$recursive) {
$level = explode('.', $part->mime_id);
- // Level too high
- if (count($level) > 2) {
+ // Skip if level too deep or part has a file name
+ if (count($level) > 2 || $part->filename) {
continue;
}
// HTML part can be on the lower level, if not...
if (count($level) > 1) {
- // It can be an alternative or related message part
- // find parent part
- $parent = null;
- foreach ($this->mime_parts as $part) {
- if ($part->mime_id == $level[0]) {
- $parent = $part;
- }
- }
-
- if (!$parent) {
- continue;
- }
-
+ array_pop($level);
+ $parent = $this->mime_parts[join('.', $level)];
+ // ... parent isn't multipart/alternative or related
if ($parent->mimetype != 'multipart/alternative' && $parent->mimetype != 'multipart/related') {
continue;
}
diff --git a/program/include/rcube_output_html.php b/program/include/rcube_output_html.php
index 2e3cd506d..d42171869 100644
--- a/program/include/rcube_output_html.php
+++ b/program/include/rcube_output_html.php
@@ -77,6 +77,9 @@ class rcube_output_html extends rcube_output
$this->set_skin($skin);
$this->set_env('skin', $skin);
+ if (!empty($_REQUEST['_extwin']))
+ $this->set_env('extwin', 1);
+
// add common javascripts
$this->add_script('var '.rcmail::JS_OBJECT_NAME.' = new rcube_webmail();', 'head_top');
@@ -298,6 +301,8 @@ class rcube_output_html extends rcube_output
*/
public function redirect($p = array(), $delay = 1)
{
+ if ($this->env['extwin'])
+ $p['extwin'] = 1;
$location = $this->app->url($p);
header('Location: ' . $location);
exit;
@@ -1068,7 +1073,7 @@ class rcube_output_html extends rcube_output
else if (in_array($attrib['command'], $a_static_commands)) {
$attrib['href'] = $this->app->url(array('action' => $attrib['command']));
}
- else if ($attrib['command'] == 'permaurl' && !empty($this->env['permaurl'])) {
+ else if (($attrib['command'] == 'permaurl' || $attrib['command'] == 'extwin') && !empty($this->env['permaurl'])) {
$attrib['href'] = $this->env['permaurl'];
}
}
@@ -1380,6 +1385,10 @@ class rcube_output_html extends rcube_output
$hiddenfield = new html_hiddenfield(array('name' => '_framed', 'value' => '1'));
$hidden = $hiddenfield->show();
}
+ if ($this->env['extwin']) {
+ $hiddenfield = new html_hiddenfield(array('name' => '_extwin', 'value' => '1'));
+ $hidden = $hiddenfield->show();
+ }
if (!$content)
$attrib['noclose'] = true;