Update of /cvsroot/squirrelmail/squirrelmail/class/template
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17891/class/template
Modified Files:
template.class.php
Log Message:
Added ability for template authors to include additional stylesheets. This
allows them to add additional CSS defs while maintaining SQM default defintions.
Index: template.class.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/class/template/template.class.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- template.class.php 24 Feb 2006 22:32:11 -0000 1.9
+++ template.class.php 28 Mar 2006 22:17:23 -0000 1.10
@@ -66,6 +66,14 @@
var $provided_js_files = array();
/**
+ * Additional stylesheets provided by the template. This allows template
+ * authors (namely me to begin with :p) to provide additional CSS sheets
+ * to templates while using the default template set stylesheet for other
+ * definitions.
+ */
+ var $additional_css_sheets = array();
+
+ /**
* Constructor
*
* @param string $sTplDir where the template set is located
@@ -78,9 +86,7 @@
$this->templates_provided = is_array($templates_provided) ?
$templates_provided : array();
$this->required_js_files = is_array($required_js_files) ?
$required_js_files : array();
$this->provided_js_files = is_array($provided_js_files) ?
$provided_js_files: array();
-
-# echo 'Template Dir: '.$this->template_dir.': ';
-# var_dump($this->templates_provided);
+ $this->additional_css_sheets = is_array($additional_css_sheets) ?
$additional_css_sheets : array();
}
@@ -236,6 +242,24 @@
return $paths;
}
+
+ /**
+ * Return any additional stylsheets provided by the template. Used when
+ * generating page headers.
+ *
+ * @return array $paths
+ */
+ function getAdditionalStyleSheets () {
+ $paths = array();
+ foreach ($this->additional_css_sheets as $css) {
+ $css = basename($css);
+ if (strtolower($css) == 'stylesheet.tpl') {
+ continue;
+ }
+ $paths[] = $css;
+ }
+ return $paths;
+ }
}
?>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
|