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 | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php index 19a4543..2f65c19 100644 --- a/program/include/rcube_json_output.php +++ b/program/include/rcube_json_output.php @@ -34,7 +34,6 @@ private $texts = array(); private $commands = array(); - public $task = ''; public $ajax_call = true; @@ -43,7 +42,6 @@ */ public function __construct($task) { - $this->task = $task; $this->config = rcmail::get_instance()->config; } @@ -60,11 +58,14 @@ } /** - * @ignore + * Issue command to set page title + * + * @param string New page title */ public function set_pagetitle($title) { - // ignore + $name = $this->config->get('product_name'); + $this->command('set_pagetitle', JQ(empty($name) ? $title : $name.' :: '.$title)); } /** @@ -162,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. @@ -232,7 +246,7 @@ implode(',', $args) ); } - + return $out; } } -- Gitblit v1.9.1