From c719f3c1e06c00fa4723f2f1298b3c94a1bec7e7 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 20 Jun 2008 06:40:01 -0400
Subject: [PATCH] Store compose parameters in session and redirect to a unique URL

---
 program/include/rcube_json_output.php |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php
index 678b194..2f65c19 100644
--- a/program/include/rcube_json_output.php
+++ b/program/include/rcube_json_output.php
@@ -58,12 +58,14 @@
     }
     
     /**
-     * @ignore
+     * Issue command to set page title
+     *
+     * @param string New page title
      */
     public function set_pagetitle($title)
     {
-	$name = $this->config->get('product_name');
-	$this->command('set_pagetitle', JQ(empty($name) ? $title : $name.' :: '.$title));
+        $name = $this->config->get('product_name');
+        $this->command('set_pagetitle', JQ(empty($name) ? $title : $name.' :: '.$title));
     }
 
     /**
@@ -161,6 +163,19 @@
         $this->commands = array();
     }
     
+    /**
+     * Redirect to a certain url
+     *
+     * @param mixed Either a string with the action or url parameters as key-value pairs
+     * @see rcmail::url()
+     */
+    public function redirect($p = array(), $delay = 0)
+    {
+        $location = rcmail::get_instance()->url($p);
+        $this->remote_response("window.setTimeout(\"location.href='{$location}'\", $delay);");
+        exit;
+    }
+    
     
     /**
      * Send an AJAX response to the client.

--
Gitblit v1.9.1