Source for file function.modulestylesheet.php
Documentation is available at function.modulestylesheet.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.modulestylesheet.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* Smarty function to provide easy access to a stylesheet
* This function provides an easy way to include a stylesheet. The function will add the stylesheet
* file to the 'stylesheet' pagevar be default
* - xhtml (obsolete!) if set, the xhtml format of the stylesheet tag will be used
* - modname module name (if not set, the current module is assumed)
* - stylesheet name of the style sheet. If not set, style.css is assumed
* - assign if set, the tag and the style sheet are returned
* - returntag if set to true the plugin returns a tag, if set to false the return is
* the path to css file (default:true)
* Example: <!--[modulestylesheet]-->
* Output: *nothing*, css file gets added to 'stylesheet' pagevar
* Example: <!--[modulestylesheet modname="foobar" stylesheet="mystyle.css" assign="style"]-->
* Will output nothing; and the Smarty variable "style" will be set:
* <!--[$style.tag]--> -- the full tag:
* <link rel="stylesheet" href="http://www.example.com/modules/foobar/pnstyle/mystyle.css" type="text/css">
* <!--[$style.stylesheet]--> -- the path and the name of the stylesheet:
* http://www.example.com/modules/foobar/pnstyle/mystyle.css
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
// default for the module
// now check that the modname is ok
if (!isset ($modname) || empty($modname) || !pnModAvailable($modname)) {
if (!isset ($returntag) || !is_bool($returntag)) {
// if no module stylesheet is present then return no content
// create xhtml specifier
// backwards compatibility
if ($themeinfo['xhtml']) {
$tag = '<link rel="stylesheet" href="' . $cssfile . '" type="text/css"' . $xhtmltag . '>';
$params['stylesheet'] = $csssrc;
$params['cssfile'] = $cssfile;
$smarty->assign($assign, $params);
|