6 * This file is intended to contain helper functions for template sets
7 * that would like to use them.
8 FIXME: potentially create a separate directory and separate functions into different files?
10 * @copyright © 1999-2006 The SquirrelMail Project Team
11 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
13 * @package squirrelmail
18 * Create stylesheet links that will work for multiple browsers
20 * @param string $uri The URI to the linked stylesheet.
21 * @param string $name The title of the stylesheet (optional; default empty).
22 * @param boolean $alt Whether or not this is an alternate
23 * stylesheet (optional; default TRUE).
24 * @param string $mtype The target media display type (optional; default "screen").
25 * @param string $xhtml_end The XHTML-compliant close tag syntax to
26 * use (optional; default "/")
28 * @return string The full text of the stylesheet link.
31 function create_css_link($uri, $name='', $alt=TRUE, $mtype='screen', $xhtml_end='/') {
32 // FIXME: Add closing / to link and meta elements only after
33 // switching to xhtml 1.0 Transitional.
34 // It is not compatible with html 4.01 Transitional
41 // set to lower case to avoid errors
43 sqGetGlobalVar('HTTP_USER_AGENT', $browser_user_agent, SQ_SERVER
);
44 $browser_user_agent = strtolower($browser_user_agent);
46 if (stristr($browser_user_agent, "msie 4")) {
50 } elseif (stristr($browser_user_agent, "msie")) {
56 if ((strpos($uri, '-ie')!== false) and !$is_IE) {
57 //not IE, so don't render this sheet
61 if ( strpos($uri, 'print') !== false )
64 $href = 'href="'.$uri.'" ';
65 $media = 'media="'.$mtype.'" ';
69 $rel = 'rel="stylesheet" ';
71 $title = 'title="'.$name.'" ';
72 $rel = 'rel="'.( $alt ?
'alternate ' : '' ).'stylesheet" ';
75 return '<link '.$media.$title.$rel.'type="text/css" '.$href." $xhtml_end>\n";