Source for file template.php
Documentation is available at template.php
* This file is intended to contain helper functions for template sets
* that would like to use them.
FIXME: potentially create a separate directory and separate functions into different files?
* @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: template.php,v 1.1 2006/09/28 14:11:32 pdontthink Exp $
* Create stylesheet links that will work for multiple browsers
* @param string $uri The URI to the linked stylesheet.
* @param string $name The title of the stylesheet (optional; default empty).
* @param boolean $alt Whether or not this is an alternate
* stylesheet (optional; default TRUE).
* @param string $mtype The target media display type (optional; default "screen").
* @param string $xhtml_end The XHTML-compliant close tag syntax to
* use (optional; default "/")
* @return string The full text of the stylesheet link.
function create_css_link($uri, $name=
'', $alt=
TRUE, $mtype=
'screen', $xhtml_end=
'/') {
// FIXME: Add closing / to link and meta elements only after
// switching to xhtml 1.0 Transitional.
// It is not compatible with html 4.01 Transitional
// set to lower case to avoid errors
sqGetGlobalVar('HTTP_USER_AGENT', $browser_user_agent, SQ_SERVER);
$browser_user_agent =
strtolower($browser_user_agent);
if (stristr($browser_user_agent, "msie 4")) {
} elseif (stristr($browser_user_agent, "msie")) {
if ((strpos($uri, '-ie')!==
false) and !$is_IE) {
//not IE, so don't render this sheet
if ( strpos($uri, 'print') !==
false )
$href =
'href="'.
$uri.
'" ';
$media =
'media="'.
$mtype.
'" ';
$rel =
'rel="stylesheet" ';
$title =
'title="'.
$name.
'" ';
$rel =
'rel="'.
( $alt ?
'alternate ' :
'' ).
'stylesheet" ';
return '<link '.
$media.
$title.
$rel.
'type="text/css" '.
$href.
" $xhtml_end>\n";
Documentation generated on Sat, 07 Oct 2006 16:13:58 +0300 by phpDocumentor 1.3.0RC6