From 50d515a7d690f6017d97017f1370705e1a214c27 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 02 May 2009 16:11:45 -0400
Subject: [PATCH] - some hints to use sqlite db (#1485821)
---
program/include/rcube_json_output.php | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php
index a14f4ae..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;
@@ -130,8 +131,11 @@
*/
public function add_label()
{
- $arg_list = func_get_args();
- foreach ($arg_list as $i => $name) {
+ $args = func_get_args();
+ if (count($args) == 1 && is_array($args[0]))
+ $args = $args[0];
+
+ foreach ($args as $name) {
$this->texts[$name] = rcube_label($name);
}
}
@@ -143,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