summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring/libcalendaring.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/libcalendaring/libcalendaring.php')
-rw-r--r--plugins/libcalendaring/libcalendaring.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 49ef40a..0384ba0 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -1217,6 +1217,8 @@ class libcalendaring extends rcube_plugin
$attrib['src'] = './?' . str_replace('_frame=', ($ctype_primary == 'text' ? '_show=' : '_preload='), $_SERVER['QUERY_STRING']);
+ $this->rc->output->add_gui_object('attachmentframe', $attrib['id']);
+
return html::iframe($attrib);
}
@@ -1225,12 +1227,23 @@ class libcalendaring extends rcube_plugin
*/
public function attachment_header($attrib = array())
{
- $table = new html_table(array('cols' => 3));
+ $rcmail = rcmail::get_instance();
+ $dl_link = strtolower($attrib['downloadlink']) == 'true';
+ $dl_url = $this->rc->url(array('_frame' => null, '_download' => 1) + $_GET);
+
+ $table = new html_table(array('cols' => $dl_link ? 3 : 2));
if (!empty($this->attachment['name'])) {
$table->add('title', Q($this->rc->gettext('filename')));
$table->add('header', Q($this->attachment['name']));
- $table->add('download-link', html::a('?'.str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING']), Q($this->rc->gettext('download'))));
+ if ($dl_link) {
+ $table->add('download-link', html::a($dl_url, Q($this->rc->gettext('download'))));
+ }
+ }
+
+ if (!empty($this->attachment['mimetype'])) {
+ $table->add('title', Q($this->rc->gettext('type')));
+ $table->add('header', Q($this->attachment['mimetype']));
}
if (!empty($this->attachment['size'])) {
@@ -1238,6 +1251,8 @@ class libcalendaring extends rcube_plugin
$table->add('header', Q(show_bytes($this->attachment['size'])));
}
+ $this->rc->output->set_env('attachment_download_url', $dl_url);
+
return $table->show($attrib);
}