<?php 
$session = Goweb::registry('session');
$this->loadJavascript('/admin/media/js/utils.js');
$this->loadJavascript('/admin/media/js/prototype.js');
$this->loadJavascript('/admin/media/js/scriptaculous/scriptaculous.js');
$this->loadJavascript('/admin/media/js/scriptaculous/effects.js');
$this->loadCss('/admin/media/css/base.css');
$this->headScript()->appendScript("var baseUrl = '" . $baseUrl . "';\n");
$this->headScript()->appendScript("var langSM = '" . $session->langCode . "';\n");
$config = Goweb::registry('config'); ?>
<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $session->lang; ?>" xml:lang="<?php echo $session->lang; ?>">
<head>
<?php $this->headMeta()->appendHttpEquiv('Content-Type',
                                   'text/html; charset=' . CHARSET)
                 ->appendHttpEquiv('Content-Language', 'pt-PT');
// setting the site in the title; possibly in the layout script:
//$this->headTitle('Goweb - Sitemanager 4.0');
if (isset($title)) $this->headTitle(html_entity_decode($title, ENT_NOQUOTES, CHARSET));
if (isset($section_title)) $this->headTitle(html_entity_decode($section_title, ENT_NOQUOTES, CHARSET));
if (isset($action)) $this->headTitle(html_entity_decode($action, ENT_NOQUOTES, CHARSET));

// setting a separator string for segments:
$this->headTitle()->setSeparator(' | ');
$this->headMeta($config->painel->meta_copyright, 'copyright');
$this->headMeta($config->painel->meta_keywords, 'keywords');
if (isset($keywords)) $this->headMeta($keywords, 'keywords');
$this->headMeta($config->painel->meta_extra , 'keywords');
$this->headMeta($config->painel->meta_description, 'description');
?>
<?php foreach ($this->getCss() as $css): ?>
<?php $this->headLink()->appendStylesheet($baseUrl . $css) ?>
<?php endforeach; ?>
<?php foreach ($this->getJavascripts() as $javascript): ?>
<?php $this->headScript()->appendFile($baseUrl . $javascript)?>
<?php endforeach; ?>
<?php echo $this->headMeta() ?>
<?php echo $this->headTitle() ?>
<?php echo $this->headLink() ?>
<?php echo $this->headScript() ?>
</head>
<body>
<?php echo $output; ?>   
</body>
</html>
