| | |
| | | | program/include/rcube_template.php | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2006-2010, The Roundcube Dev Team | |
| | | | Copyright (C) 2006-2011, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | /** |
| | | * Constructor |
| | | * |
| | | * @todo Use jQuery's $(document).ready() here. |
| | | * @todo Replace $this->config with the real rcube_config object |
| | | */ |
| | | public function __construct($task, $framed = false) |
| | |
| | | $this->set_skin($this->config['skin']); |
| | | |
| | | // add common javascripts |
| | | $javascript = 'var '.JS_OBJECT_NAME.' = new rcube_webmail();'; |
| | | $this->add_script('var '.JS_OBJECT_NAME.' = new rcube_webmail();', 'head_top'); |
| | | |
| | | // don't wait for page onload. Call init at the bottom of the page (delayed) |
| | | $javascript_foot = '$(document).ready(function(){ '.JS_OBJECT_NAME.'.init(); });'; |
| | | $this->add_script(JS_OBJECT_NAME.'.init();', 'docready'); |
| | | |
| | | $this->add_script($javascript, 'head_top'); |
| | | $this->add_script($javascript_foot, 'foot'); |
| | | $this->scripts_path = 'program/js/'; |
| | | $this->include_script('jquery-1.4.min.js'); |
| | | $this->include_script('jquery-1.5.min.js'); |
| | | $this->include_script('common.js'); |
| | | $this->include_script('app.js'); |
| | | |
| | |
| | | { |
| | | if ($override || !$this->message) { |
| | | $this->message = $message; |
| | | $this->command( |
| | | 'display_message', |
| | | rcube_label(array('name' => $message, 'vars' => $vars)), |
| | | $type); |
| | | $msgtext = rcube_label_exists($message) ? rcube_label(array('name' => $message, 'vars' => $vars)) : $message; |
| | | $this->command('display_message', $msgtext, $type); |
| | | } |
| | | } |
| | | |
| | |
| | | // show a label |
| | | case 'label': |
| | | if ($attrib['name'] || $attrib['command']) { |
| | | return Q(rcube_label($attrib + array('vars' => array('product' => $this->config['product_name'])))); |
| | | $label = rcube_label($attrib + array('vars' => array('product' => $this->config['product_name']))); |
| | | return !$attrbi['noshow'] ? Q($label) : ''; |
| | | } |
| | | break; |
| | | |
| | |
| | | // execute object handler function |
| | | else if (function_exists($handler)) { |
| | | $content = call_user_func($handler, $attrib); |
| | | } |
| | | else if ($object == 'logo') { |
| | | $attrib += array('alt' => $this->xml_command(array('', 'object', 'name="productname"'))); |
| | | if ($this->config['skin_logo']) |
| | | $attrib['src'] = $this->config['skin_logo']; |
| | | $content = html::img($attrib); |
| | | } |
| | | else if ($object == 'productname') { |
| | | $name = !empty($this->config['product_name']) ? $this->config['product_name'] : 'Roundcube Webmail'; |
| | |
| | | $attrib['action'] = './'; |
| | | |
| | | // we already have a <form> tag |
| | | if ($attrib['form']) |
| | | if ($attrib['form']) { |
| | | if ($this->framed || !empty($_REQUEST['_framed'])) |
| | | $hidden->add(array('name' => '_framed', 'value' => '1')); |
| | | return $hidden->show() . $content; |
| | | } |
| | | else |
| | | return $this->form_tag($attrib, $hidden->show() . $content); |
| | | } |
| | |
| | | $username = $this->app->user->get_username(); |
| | | } |
| | | |
| | | return idn_to_utf8($username); |
| | | return rcube_idn_to_utf8($username); |
| | | } |
| | | |
| | | |
| | |
| | | if (empty($images) || $this->app->task == 'logout') |
| | | return; |
| | | |
| | | $this->add_script('$(document).ready(function(){ |
| | | var images = ' . json_serialize($images) .'; |
| | | $this->add_script('var images = ' . json_serialize($images) .'; |
| | | for (var i=0; i<images.length; i++) { |
| | | img = new Image(); |
| | | img.src = images[i]; |
| | | }});', 'foot'); |
| | | }', 'docready'); |
| | | } |
| | | |
| | | |
| | |
| | | 'UTF-8' => 'UTF-8 ('.rcube_label('unicode').')', |
| | | 'US-ASCII' => 'ASCII ('.rcube_label('english').')', |
| | | 'ISO-8859-1' => 'ISO-8859-1 ('.rcube_label('westerneuropean').')', |
| | | 'ISO-8859-2' => 'ISO-8895-2 ('.rcube_label('easterneuropean').')', |
| | | 'ISO-8859-4' => 'ISO-8895-4 ('.rcube_label('baltic').')', |
| | | 'ISO-8859-2' => 'ISO-8859-2 ('.rcube_label('easterneuropean').')', |
| | | 'ISO-8859-4' => 'ISO-8859-4 ('.rcube_label('baltic').')', |
| | | 'ISO-8859-5' => 'ISO-8859-5 ('.rcube_label('cyrillic').')', |
| | | 'ISO-8859-6' => 'ISO-8859-6 ('.rcube_label('arabic').')', |
| | | 'ISO-8859-7' => 'ISO-8859-7 ('.rcube_label('greek').')', |