1375cd36 |
1 | <?php |
2 | /** |
3 | * stylelink.tpl |
4 | * |
5 | * Template for rendering the links to css sheets for the page |
6 | * |
7 | * @copyright © 1999-2006 The SquirrelMail Project Team |
8 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
9 | * @version $Id$ |
10 | * @package squirrelmail |
11 | * @subpackage templates |
12 | */ |
13 | |
14 | /** add required includes */ |
343200c7 |
15 | require_once(SM_PATH.'templates/util_css.php'); |
1375cd36 |
16 | |
17 | /** extract variables */ |
18 | extract($t); |
19 | |
20 | //echo SM_PATH; |
21 | $base_css="css"; |
22 | |
23 | $template_css_file="templates/$templateid/$templateid.css"; |
24 | |
25 | /** Add URLs to the $css_files array to have them added as links before any theme css or style.php output **/ |
26 | $css_files=array(); |
27 | |
28 | /** If in existance, add link to template css file named for template **/ |
29 | if (is_file(SM_PATH.$template_css_file)) $css_files[]=$base_uri.$template_css_file; |
30 | |
31 | $base_css_files=list_css_files(SM_PATH.$base_css,$base_uri.$base_css); |
32 | |
33 | if (!$base_css_files) $base_css_files=array(); |
34 | |
35 | /** Add link to default.css in the css directory **/ |
36 | $css_link_html=''; |
37 | $css_url=$base_uri.$base_css."/default.css"; |
38 | $css_link_html=css_link($css_url, null, false, 'all',''); |
39 | |
40 | /** Add links to all css files listed in the css_files collection **/ |
41 | foreach ($css_files as $css_url) { |
42 | $css_link_html.=css_link($css_url, null, false, 'screen', ''); |
43 | } |
44 | |
45 | /** Add links to each of the .css files in the /css/ directory, making them as alternate if they are not named for the current theme **/ |
46 | foreach ($base_css_files as $css_file=>$css_url) { |
47 | $css_file_theme=substr($css_file,0,-4); |
48 | // echo $css_file_theme; |
49 | $css_link_html.=css_link($css_url, $css_file_theme, ($css_file_theme!=$themeid), 'screen', ''); |
50 | } |
51 | |
52 | /** output CSS links **/ |
53 | echo $css_link_html; |
54 | |
1375cd36 |
55 | /** |
56 | * $Log$ |
343200c7 |
57 | * Revision 1.3 2006/07/10 15:48:51 vanmer |
58 | * - added new utils_css file to contain CSS-related functions for use in templates |
59 | * - altered stylelink template to use new util_css.php file for all function definitions |
60 | * |
d9969b1d |
61 | * Revision 1.2 2006/07/09 22:37:35 vanmer |
62 | * - added variable initalization and check on variable |
63 | * |
1375cd36 |
64 | * Revision 1.1 2006/07/09 22:23:03 vanmer |
65 | * - intial revision of a template to display CSS links at the top of the page |
66 | * |
67 | * |
68 | **/ |
69 | ?> |