<?php
if (!isset($id) || !$id) {
    $id = "0";
}
$this->headScript()->appendScript("var baseUrl = '" . $baseUrl . "';\n");
$config = Goweb::registry('config'); ?>
<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php $this->headMeta()->appendHttpEquiv('Content-Type',
                                   'text/html; charset=' . CHARSET)
                 ->appendHttpEquiv('Content-Language', 'pt-PT');

$this->headTitle($config->painel->title);
if (isset($titulo)) $this->headTitle(html_entity_decode($titulo));
// separador
$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');
Goweb::loadCss('/admin/media/js/tafelTree/css/tree.css');
Goweb::loadJavascript('/media/js/prototype.js');
Goweb::loadJavascript('/admin/media/js/scriptaculous/scriptaculous.js');
Goweb::loadJavascript('/admin/media/js/tafelTree/Tree-optimized.js');
?>
<?php foreach ($this->getCss() as $css): ?>
<?php $this->headLink()->appendStylesheet($baseUrl . $css) ?>
<?php endforeach; ?>
<?php foreach ($this->getRss() as $rss): ?>
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $baseUrl . $rss; ?>" />
<?php endforeach; ?>
<?php $this->headScript()->appendFile($baseUrl . '/media/js/go_admin.js')?>
<?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?>
<script type="text/javascript">
TafelTreeInit();
</script>
</body>
</html>