Account for extra fields in address book more correctly. Also account for no global...
[squirrelmail.git] / templates / default / stylelink.tpl
CommitLineData
1375cd36 1<?php
2/**
3 * stylelink.tpl
4 *
5 * Template for rendering the links to css sheets for the page
6 *
7 * @copyright &copy; 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 15require_once(SM_PATH.'templates/util_css.php');
1375cd36 16
17/** extract variables */
18extract($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 **/
29if (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
33if (!$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 **/
41foreach ($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 **/
46foreach ($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 **/
53echo $css_link_html;
54