0
function smarty_cms_function_header($params, &$smarty)
0
- $pageinfo =& $gCms->variables['pageinfo'];
0
- $root_url = CmsConfig::get('root_url');
0
+ $result = '<!-- headertag';
0
- if (isset($params['name']) && $params['name'] != '')
0
- $result .= '<link rel="result" type="text/css" ';
0
- if (isset($params['media']) && $params['media'] != '')
0
- $result .= 'media="' . $params['media'] . '" ';
0
- $result .= 'href="'.$root_url.'/stylesheet.php?name='.$params['name'];
0
- $template = cms_orm('cms_template')->find_by_id($pageinfo->template_id);
0
- foreach ($template->get_stylesheet_media_types() as $media)
0
- $result .= '<link rel="result" type="text/css" ';
0
- $result .= 'media="'.$media.'" ';
0
- $result .= "href=\"{$root_url}/stylesheet.php?templateid={$pageinfo->template_id}";
0
- $result .= '&mediatype='.urlencode($media);
0
- $result .= get_site_preference('metadata', '');
0
- if (isset($pageinfo) && $pageinfo !== FALSE)
0
- if (isset($pageinfo->content_metadata) && $pageinfo->content_metadata != '')
0
- $result .= "\n" . $pageinfo->content_metadata;
0
- if ((!strpos($result,$smarty->left_delimiter) === false) and (!strpos($result,$smarty->right_delimiter) === false))
0
+ foreach ($params as $k=>$v)
0
- $smarty->_compile_source('metadata template', $result, $_compiled);
0
- $smarty->_eval('?>' . $_compiled);
0
- $result = @ob_get_contents();
0
+ $v = str_replace('"', 'xxx_double_quote_here_xxx', $v);
0
+ $result .= " $k=\"$v\"";
0
- #Show a base tag unless showbase is false in config.php
0
- #It really can't hinder, only help.
0
- if (isset($params['showbase']))
0
- if ($params['showbase'] == 'false')
0
- $result .= "\n<base href=\"".$root_url."/\" />\n";
0
- if (array_key_exists('assign', $params))
0
- $smarty->assign($params['assign'], $result);
0
function smarty_cms_help_function_header() {
Comments
No one has commented yet.