From 83a7636872d58f044d1fac444268dd2e7c7ebaee Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 14 Jun 2008 08:23:08 -0400
Subject: [PATCH] More code cleanup

---
 program/include/rcube_json_output.php |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php
index 04d16bf..678b194 100644
--- a/program/include/rcube_json_output.php
+++ b/program/include/rcube_json_output.php
@@ -34,17 +34,15 @@
     private $texts = array();
     private $commands = array();
 
-    public $task = '';
     public $ajax_call = true;
     
     
     /**
      * Constructor
      */
-    public function __construct(&$config, $task)
+    public function __construct($task)
     {
-        $this->task   = $task;
-        $this->config = $config;
+        $this->config = rcmail::get_instance()->config;
     }
     
     
@@ -64,7 +62,8 @@
      */
     public function set_pagetitle($title)
     {
-        // ignore
+	$name = $this->config->get('product_name');
+	$this->command('set_pagetitle', JQ(empty($name) ? $title : $name.' :: '.$title));
     }
 
     /**
@@ -211,7 +210,10 @@
      */
     private function get_js_commands()
     {
-        $out = 'this.set_env('.json_serialize($this->env).");\n";
+        $out = '';
+	
+	if (sizeof($this->env))
+	    $out .= 'this.set_env('.json_serialize($this->env).");\n";
         
         foreach($this->texts as $name => $text) {
             $out .= sprintf("this.add_label('%s', '%s');\n", $name, JQ($text));
@@ -229,7 +231,7 @@
                 implode(',', $args)
             );
         }
-        
+
         return $out;
     }
 }

--
Gitblit v1.9.1