From 41fa0b909ac1fe80dd103e8d986776ef46a5b50a Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 31 Jul 2006 18:51:23 -0400
Subject: [PATCH] Compose, save and sendmail cleanup

---
 program/include/main.inc |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/program/include/main.inc b/program/include/main.inc
index bbfba07..48e485c 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -712,7 +712,7 @@
     return 'this.'.$command;
   
   else
-    $OUTPUT->add_script(sprintf("%s%s.%s",
+    $OUTPUT->add_script(sprintf("%s%s.%s\n",
                                 $framed ? sprintf('if(parent.%s)parent.', $JS_OBJECT_NAME) : '',
                                 $JS_OBJECT_NAME,
                                 $command));
@@ -789,6 +789,19 @@
   }
 
 
+// send correctly formatted response for a request posted to an iframe
+function rcube_iframe_response($js_code='')
+  {
+  global $OUTPUT, $JS_OBJECT_NAME;
+
+  if (!empty($js_code))
+    $OUTPUT->add_script("if(parent.$JS_OBJECT_NAME){\n" . $js_code . "\n}");
+
+  $OUTPUT->write();
+  exit;
+  }
+
+
 // read directory program/localization/ and return a list of available languages
 function rcube_list_languages()
   {

--
Gitblit v1.9.1