/** * Init output object for GUI and add common scripts. * This will instantiate a rcmail_template object and set * environment vars according to the current session and configuration * * @param boolean True if this request is loaded in a (i)frame * @return rcube_template Reference to HTML output object */ public function load_gui($framed = false) { // init output page if (!$this->output instanceof rcube_template) { $this->output = new rcube_template($this->task, $framed); } // set keep-alive/check-recent interval if ($this->session && ($keep_alive = $this->session->get_keep_alive())) { $this->output->set_env('keep_alive', $keep_alive); } if ($framed) { $this->comm_path .= '&_framed=1'; $this->output->set_env('framed', true); } $this->output->set_env('task', $this->task); $this->output->set_env('action', $this->action); $this->output->set_env('comm_path', $this->comm_path); $this->output->set_charset(RCMAIL_CHARSET); // add some basic label to client $this->output->add_label('loading', 'servererror'); return $this->output; }