summaryrefslogtreecommitdiff
path: root/plugins/odfviewer
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-03-16 20:25:45 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2012-03-16 20:25:45 (GMT)
commitc65695b1da77042d6aa7fb7bc6c043033cfbe237 (patch)
tree6dfa3476e95611e34cff5c02a2fa137b825d8d94 /plugins/odfviewer
parent57dad2d92deda5752bc9325ff3dcf5e861996cfe (diff)
downloadroundcubemail-plugins-kolab-c65695b1da77042d6aa7fb7bc6c043033cfbe237.tar.gz
Fix odfviewer plugin to work with latest Roundcube version
Diffstat (limited to 'plugins/odfviewer')
-rw-r--r--plugins/odfviewer/odfviewer.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/odfviewer/odfviewer.php b/plugins/odfviewer/odfviewer.php
index a64cf85..40cf522 100644
--- a/plugins/odfviewer/odfviewer.php
+++ b/plugins/odfviewer/odfviewer.php
@@ -75,20 +75,19 @@ class odfviewer extends rcube_plugin
*/
function get_part($args)
{
- global $IMAP, $MESSAGE;
-
if (!$args['download'] && $args['mimetype'] && in_array($args['mimetype'], $this->odf_mimetypes)) {
if (empty($_GET['_load'])) {
$suffix = preg_match('/(\.\w+)$/', $args['part']->filename, $m) ? $m[1] : '.odt';
$fn = md5(session_id() . $_SERVER['REQUEST_URI']) . $suffix;
-
+
// FIXME: copy file to disk because only apache can send the file correctly
$tempfn = $this->tempdir . $fn;
if (!file_exists($tempfn)) {
$fp = fopen($tempfn, 'w');
- $IMAP->get_message_part($MESSAGE->uid, $args['part']->mime_id, $args['part'], false, $fp);
+ $imap = rcmail::get_instance()->get_storage();
+ $imap->get_message_part($args['uid'], $args['id'], $args['part'], false, $fp);
fclose($fp);
-
+
// remember tempfiles in session to clean up on logout
$_SESSION['odfviewer']['tempfiles'][] = $fn;
}