X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=program%2Finclude%2Frcube_html_page.php;h=e279f1f47d3b4b8ca0140253fd63c3f095ddd5f8;hb=c577559e2be4e41aeb0696baadd6fccfd26834d7;hp=6a197036bf1d8a3a8ca4458473feaf19875b2b8d;hpb=685987db93fe029d5b7059a253b6dfcda976209c;p=roundcube.git
diff --git a/program/include/rcube_html_page.php b/program/include/rcube_html_page.php
index 6a19703..e279f1f 100644
--- a/program/include/rcube_html_page.php
+++ b/program/include/rcube_html_page.php
@@ -4,8 +4,8 @@
+-----------------------------------------------------------------------+
| program/include/rcube_html_page.php |
| |
- | This file is part of the RoundCube PHP suite |
- | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+ | This file is part of the Roundcube PHP suite |
+ | Copyright (C) 2005-2009, Roundcube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| CONTENTS: |
@@ -15,7 +15,7 @@
| Author: Thomas Bruederli |
+-----------------------------------------------------------------------+
- $Id: $
+ $Id: rcube_html_page.php 4469 2011-01-29 14:55:12Z thomasb $
*/
@@ -28,17 +28,20 @@ class rcube_html_page
{
protected $scripts_path = '';
protected $script_files = array();
+ protected $css_files = array();
protected $scripts = array();
protected $charset = RCMAIL_CHARSET;
protected $script_tag_file = "\n";
protected $script_tag = "";
+ protected $link_css_file = "\n";
protected $default_template = "\n\n\n";
protected $title = '';
protected $header = '';
protected $footer = '';
protected $body = '';
+ protected $base_path = '';
/** Constructor */
@@ -55,11 +58,14 @@ class rcube_html_page
static $sa_files = array();
if (!preg_match('|^https?://|i', $file) && $file[0] != '/')
- $file = $this->scripts_path . $file . (($fs = @filemtime($this->scripts_path . $file)) ? '?s='.$fs : '');
+ $file = $this->scripts_path . $file . (($fs = @filemtime($this->scripts_path . $file)) ? '?s='.$fs : '');
if (in_array($file, $sa_files)) {
return;
}
+
+ $sa_files[] = $file;
+
if (!is_array($this->script_files[$position])) {
$this->script_files[$position] = array();
}
@@ -81,8 +87,20 @@ class rcube_html_page
}
}
+ /**
+ * Link an external css file
+ *
+ * @param string File URL
+ */
+ public function include_css($file)
+ {
+ $this->css_files[] = $file;
+ }
+
/**
* Add HTML code to the page header
+ *
+ * @param string $str HTML code
*/
public function add_header($str)
{
@@ -92,6 +110,8 @@ class rcube_html_page
/**
* Add HTML code to the page footer
* To be added right befor
') {
$hpos++;
}
$hpos++;
}
- $__page_header = "\n$__page_title\n$__page_header\n\n";
+ $page_header = "\n$page_title\n$page_header\n\n";
}
// add page hader
if ($hpos) {
- $output = substr($output,0,$hpos) . $__page_header . substr($output,$hpos,strlen($output));
+ $output = substr($output,0,$hpos) . $page_header . substr($output,$hpos,strlen($output));
}
else {
- $output = $__page_header . $output;
+ $output = $page_header . $output;
}
- // find page body
- if ($bpos = strpos(strtolower($output), '') {
- $bpos++;
- }
- $bpos++;
+ // add page footer
+ if (($fpos = strripos($output, '')) || ($fpos = strripos($output, '