diff --git a/CHANGELOG b/CHANGELOG index 9f3c383b3..32631c4e9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -27,6 +27,7 @@ CHANGELOG Roundcube Webmail - Prevent from inserting empty link when composing HTML message (#1486944) - Add caching support in id2uid and uid2id functions (#1487019) - Add SASL proxy authentication for SMTP (#1486693) +- Improve displaying of UI messages (#1486977) RELEASE 0.4.2 ------------- diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php index 3b95a4928..337a82b6e 100644 --- a/program/include/rcube_json_output.php +++ b/program/include/rcube_json_output.php @@ -134,14 +134,14 @@ class rcube_json_output public function command() { $cmd = func_get_args(); - + if (strpos($cmd[0], 'plugin.') === 0) $this->callbacks[] = $cmd; else $this->commands[] = $cmd; } - - + + /** * Add a localized label to the client environment */ @@ -150,7 +150,7 @@ class rcube_json_output $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); } @@ -203,8 +203,8 @@ class rcube_json_output $this->remote_response("window.setTimeout(\"location.href='{$location}'\", $delay);"); exit; } - - + + /** * Send an AJAX response to the client. */ @@ -213,8 +213,8 @@ class rcube_json_output $this->remote_response(); exit; } - - + + /** * Send an AJAX response with executable JS code * @@ -237,17 +237,17 @@ class rcube_json_output unset($this->env['task'], $this->env['action'], $this->env['comm_path']); $rcmail = rcmail::get_instance(); - $response = array('action' => $rcmail->action, 'unlock' => (bool)$_REQUEST['_unlock']); - + $response = array('action' => $rcmail->action, 'unlock' => get_input_value('_unlock', RCUBE_INPUT_GPC)); + if (!empty($this->env)) $response['env'] = $this->env; - + if (!empty($this->texts)) $response['texts'] = $this->texts; // send function calls $response['exec'] = $this->get_js_commands() . $add; - + if (!empty($this->callbacks)) $response['callbacks'] = $this->callbacks; diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index d923c6478..e9b2b2118 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -57,7 +57,7 @@ class rcube_template extends rcube_html_page $this->app = rcmail::get_instance(); $this->config = $this->app->config->all(); $this->browser = new rcube_browser(); - + //$this->framed = $framed; $this->set_env('task', $task); $this->set_env('request_token', $this->app->get_request_token()); @@ -129,7 +129,7 @@ class rcube_template extends rcube_html_page else { $title = ucfirst($this->env['task']); } - + return $title; } @@ -140,7 +140,7 @@ class rcube_template extends rcube_html_page public function set_skin($skin) { $valid = false; - + if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin)) { $skin_path = 'skins/'.$skin; $valid = true; @@ -152,7 +152,7 @@ class rcube_template extends rcube_html_page $this->app->config->set('skin_path', $skin_path); $this->config['skin_path'] = $skin_path; - + return $valid; } @@ -226,7 +226,7 @@ class rcube_template extends rcube_html_page $args = func_get_args(); if (count($args) == 1 && is_array($args[0])) $args = $args[0]; - + foreach ($args as $name) { $this->command('add_label', $name, rcube_label($name)); } @@ -315,7 +315,7 @@ class rcube_template extends rcube_html_page // set output asap ob_flush(); flush(); - + if ($exit) { exit; } @@ -331,14 +331,18 @@ class rcube_template extends rcube_html_page public function write($template = '') { // unlock interface after iframe load + $unlock = preg_replace('/[^a-z0-9]/i', '', $_GET['_unlock']); if ($this->framed) { - array_unshift($this->js_commands, array('set_busy', false)); + array_unshift($this->js_commands, array('set_busy', false, null, $unlock)); + } + else if ($unlock) { + array_unshift($this->js_commands, array('hide_message', $unlock)); } // write all env variables to client $js = $this->framed ? "if(window.parent) {\n" : ''; $js .= $this->get_js_commands() . ($this->framed ? ' }' : ''); $this->add_script($js, 'head_top'); - + // make sure all