From 69f18a09aec6e352ff021cd9c5db806f341b7e48 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 01 May 2009 15:04:26 -0400
Subject: [PATCH] Add plugin hooks for creating/saving/deleting identities and contacts

---
 program/include/rcube_json_output.php |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php
index 7c79157..2fbf9c0 100644
--- a/program/include/rcube_json_output.php
+++ b/program/include/rcube_json_output.php
@@ -33,6 +33,7 @@
     private $env = array();
     private $texts = array();
     private $commands = array();
+    private $message = null;
 
     public $type = 'js';
     public $ajax_call = true;
@@ -146,15 +147,19 @@
      * @param string Message to display
      * @param string Message type [notice|confirm|error]
      * @param array Key-value pairs to be replaced in localized text
+     * @param boolean Override last set message
      * @uses self::command()
      */
-    public function show_message($message, $type='notice', $vars=null)
+    public function show_message($message, $type='notice', $vars=null, $override=true)
     {
-        $this->command(
-            'display_message',
-            rcube_label(array('name' => $message, 'vars' => $vars)),
-            $type
-        );
+        if ($override || !$this->message) {
+            $this->message = $message;
+            $this->command(
+                'display_message',
+                rcube_label(array('name' => $message, 'vars' => $vars)),
+                $type
+            );
+        }
     }
     
     /**

--
Gitblit v1.9.1