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6~."p5"AYRSl !\pﶩĀE ␍&xPʡ1'6k3pǨF@"C ИLb䀘QtL̰Ii4]oOiXϚLϼЖ}ݥg-(Vz<ĩ"Wrmessage) { if ($this->app->text_exists($message)) { if (!empty($vars)) { $vars = array_map(['rcmail', 'Q'], $vars); } $msgtext = $this->app->gettext(['name' => $message, 'vars' => $vars]); } else { $msgtext = $message; } $this->message = $message; $this->command('display_message', $msgtext, $type, $timeout * 1000); } } /** * Delete all stored env variables and commands */ public function reset() { parent::reset(); $this->texts = []; $this->commands = []; } /** * Redirect to a certain url * * @param mixed $p Either a string with the action or url parameters as key-value pairs * @param int $delay Delay in seconds * * @see rcmail::url() */ public function redirect($p = [], $delay = 1) { $location = $this->app->url($p); $this->remote_response(sprintf("window.setTimeout(function(){ %s.redirect('%s',true); }, %d);", self::JS_OBJECT_NAME, $location, $delay)); exit; } /** * Send an AJAX response to the client. */ public function send() { $this->remote_response(); exit; } /** * Show error page and terminate script execution * * @param int $code Error code * @param string $message Error message */ public function raise_error($code, $message) { if ($code == 403) { $this->header('HTTP/1.1 403 Forbidden'); die("Invalid Request"); } $this->show_message("Application Error ($code): $message", 'error'); $this->remote_response(); exit; } /** * Send an AJAX response with executable JS code * * @param string $add Additional JS code */ protected function remote_response($add = '') { if (!$this->header_sent) { $this->header_sent = true; $this->nocacheing_headers(); $this->header('Content-Type: application/json; charset=' . $this->get_charset()); } // unset default env vars unset($this->env['task'], $this->env['action'], $this->env['comm_path']); $rcmail = rcmail::get_instance(); $response['action'] = $rcmail->action; if ($unlock = rcube_utils::get_input_string('_unlock', rcube_utils::INPUT_GPC)) { $response['unlock'] = $unlock; } 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; } // trigger generic hook where plugins can put additional content to the response $hook = $this->app->plugins->exec_hook("render_response", ['response' => $response]); // save some memory $response = $hook['response']; unset($hook['response']); echo self::json_serialize($response, $this->devel_mode, false); } /** * Return executable javascript code for all registered commands */ protected function get_js_commands() { $out = ''; foreach ($this->commands as $i => $args) { $method = array_shift($args); foreach ($args as $i => $arg) { $args[$i] = self::json_serialize($arg, $this->devel_mode, false); } $out .= sprintf( "this.%s(%s);\n", preg_replace('/^parent\./', '', $method), implode(',', $args) ); } return $out; } }