| | |
| | | if ($this->framed || !empty($_REQUEST['_framed'])) |
| | | $this->set_env('framed', 1); |
| | | |
| | | $lic = <<<EOF |
| | | /* |
| | | @licstart The following is the entire license notice for the |
| | | JavaScript code in this page. |
| | | |
| | | Copyright (C) 2005-2014 The Roundcube Dev Team |
| | | |
| | | The JavaScript code in this page is free software: you can redistribute |
| | | it and/or modify it under the terms of the GNU General Public License |
| | | as published by the Free Software Foundation, either version 3 of |
| | | the License, or (at your option) any later version. |
| | | |
| | | The code is distributed WITHOUT ANY WARRANTY; without even the implied |
| | | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| | | See the GNU GPL for more details. |
| | | |
| | | @licend The above is the entire license notice |
| | | for the JavaScript code in this page. |
| | | */ |
| | | EOF; |
| | | // add common javascripts |
| | | $this->add_script($lic, 'head_top'); |
| | | $this->add_script('var '.self::JS_OBJECT_NAME.' = new rcube_webmail();', 'head_top'); |
| | | |
| | | // don't wait for page onload. Call init at the bottom of the page (delayed) |
| | |
| | | $output = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $output); |
| | | $this->footer = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $this->footer); |
| | | |
| | | if ($write) { |
| | | // add debug console |
| | | if ($realname != 'error' && ($this->config->get('debug_level') & 8)) { |
| | | $this->add_footer('<div id="console" style="position:absolute;top:5px;left:5px;width:405px;padding:2px;background:white;z-index:9000;display:none"> |
| | | <a href="#toggle" onclick="con=$(\'#dbgconsole\');con[con.is(\':visible\')?\'hide\':\'show\']();return false">console</a> |
| | | <textarea name="console" id="dbgconsole" rows="20" cols="40" style="display:none;width:400px;border:none;font-size:10px" spellcheck="false"></textarea></div>' |
| | | ); |
| | | $this->add_script( |
| | | "if (!window.console || !window.console.log) {\n". |
| | | " window.console = new rcube_console();\n". |
| | | " $('#console').show();\n". |
| | | "}", 'foot'); |
| | | } |
| | | $this->write(trim($output)); |
| | | } |
| | | else { |
| | | if (!$write) { |
| | | return $output; |
| | | } |
| | | |
| | | $this->write(trim($output)); |
| | | |
| | | if ($exit) { |
| | | exit; |
| | |
| | | |
| | | // generate html code for button |
| | | if ($btn_content) { |
| | | $attrib_str = html::attrib_string($attrib, $link_attrib); |
| | | $attrib_str = html::attrib_string($attrib, array_merge($link_attrib, array('data-*'))); |
| | | $out = sprintf('<a%s>%s</a>', $attrib_str, $btn_content); |
| | | } |
| | | |
| | |
| | | $out .= $input_host->show(); |
| | | } |
| | | |
| | | if (rcube_utils::get_boolean($attrib['submit'])) { |
| | | $submit = new html_inputfield(array('type' => 'submit', 'id' => 'rcmloginsubmit', |
| | | 'class' => 'button mainaction', 'value' => $this->app->gettext('login'))); |
| | | $out .= html::p('formbuttons', $submit->show()); |
| | | } |
| | | |
| | | // surround html output with a form tag |
| | | if (empty($attrib['form'])) { |
| | | $out = $this->form_tag(array('name' => $form_name, 'method' => 'post'), $out); |
| | |
| | | // add form tag around text field |
| | | if (empty($attrib['form'])) { |
| | | $out = $this->form_tag(array( |
| | | 'name' => "rcmqsearchform", |
| | | 'name' => "rcmqsearchform", |
| | | 'onsubmit' => self::JS_OBJECT_NAME . ".command('search'); return false", |
| | | 'style' => "display:inline"), |
| | | 'style' => "display:inline"), |
| | | $out); |
| | | } |
| | | |