alecpl
2011-05-21 bc8c2c57880523472b30f475d566a8133e2d2e20
program/include/rcube_html_page.php
@@ -5,7 +5,7 @@
 | program/include/rcube_html_page.php                                   |
 |                                                                       |
 | This file is part of the Roundcube PHP suite                          |
 | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
 | Copyright (C) 2005-2011 The Roundcube Dev Team                       |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | CONTENTS:                                                             |
@@ -33,7 +33,7 @@
    protected $charset = RCMAIL_CHARSET;
    protected $script_tag_file = "<script type=\"text/javascript\" src=\"%s\"></script>\n";
    protected $script_tag  =  "<script type=\"text/javascript\">\n/* <![CDATA[ */\n%s\n/* ]]> */\n</script>";
    protected $script_tag  =  "<script type=\"text/javascript\">\n/* <![CDATA[ */\n%s\n/* ]]> */\n</script>\n";
    protected $link_css_file = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n";
    protected $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>";
@@ -208,6 +208,11 @@
            $page_header .= $this->header;
        }
        // put docready commands into page footer
        if (!empty($this->scripts['docready'])) {
            $this->add_script('$(document).ready(function(){ ' . $this->scripts['docready'] . "\n});", 'foot');
        }
        if (is_array($this->script_files['foot'])) {
            foreach ($this->script_files['foot'] as $file) {
                $page_footer .= sprintf($this->script_tag_file, $file);
@@ -266,19 +271,23 @@
            $output = substr($output, 0, $pos) . $css . substr($output, $pos);
        }
       $this->base_path = $base_path;
        $this->base_path = $base_path;
        // correct absolute paths in images and other tags
       // add timestamp to .js and .css filename
        // add timestamp to .js and .css filename
        $output = preg_replace_callback(
            '!(src|href|background)=(["\']?)([a-z0-9/_.-]+)(["\'\s>])!i',
           array($this, 'file_callback'), $output);
            array($this, 'file_callback'), $output);
        $output = str_replace('$__skin_path', $base_path, $output);
        if ($this->charset != RCMAIL_CHARSET)
           echo rcube_charset_convert($output, RCMAIL_CHARSET, $this->charset);
       else
           echo $output;
        // trigger hook with final HTML content to be sent
        $hook = rcmail::get_instance()->plugins->exec_hook("send_page", array('content' => $output));
        if (!$hook['abort']) {
            if ($this->charset != RCMAIL_CHARSET)
                echo rcube_charset_convert($hook['content'], RCMAIL_CHARSET, $this->charset);
            else
                echo $hook['content'];
        }
    }
    
    /**