From a0530a6ec0cb464ec6eaa63fd211c2ffbe6db9ad Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 08 Jun 2008 14:17:09 -0400
Subject: [PATCH] - option to disable autocompletion from selected LDAP address books (#1484922

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

diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php
index 04d16bf..a633f85 100644
--- a/program/include/rcube_json_output.php
+++ b/program/include/rcube_json_output.php
@@ -41,10 +41,10 @@
     /**
      * Constructor
      */
-    public function __construct(&$config, $task)
+    public function __construct($task)
     {
         $this->task   = $task;
-        $this->config = $config;
+        $this->config = rcmail::get_instance()->config;
     }
     
     
@@ -64,7 +64,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 +212,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 +233,7 @@
                 implode(',', $args)
             );
         }
-        
+
         return $out;
     }
 }

--
Gitblit v1.9.1