<?php 
$session = Goweb::registry('session');
$this->loadJavascript('/admin/media/js/tinymce/tiny_mce_popup.js');
$this->loadJavascript('/admin/media/js/dtree.js');
$this->loadCss('/admin/media/css/base.css');
$this->loadCss('/admin/media/css/dtree.css');
$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');
// 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() ?>
<script type="text/javascript">
<!--
var AdvLinkDialogue = {
    init : function () {
        // Here goes your code for setting your custom things onLoad.
    },
    setFilenameAndClose : function (file) {
        //var URL = document.my_form.my_field.value;
        var win = tinyMCEPopup.getWindowArg("window");
        // insert information now
        win.document.getElementById('href').value = file;
        // for image browsers: update image dimensions
        if (win.ImageDialog && win.ImageDialog.getImageData) win.ImageDialog.getImageData();
        if (win.ImageDialog && win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(file);
        // close popup window
        tinyMCEPopup.close();
    }
}
-->
</script>
</head>
<body style="background-color:#FFFFFF;">
<?php if (isset($tree)): ?>
<table align="center">
  <tr>
    <td><h1 style="color:#000000; padding:20px;"><?php echo translateAdmin('Escolha a p&aacute;gina interna');?></h1></td>
  <tr>
  <tr>
    <td rowspan="2" valign="top" id="tr_tree">
        <div id="tree">
            <?php echo $tree->getTitle(); ?> | <a href="<?php echo $tree->openAllLink(); ?>"><?php echo translateAdmin('Expandir tudo');?></a> | <a href="<?php echo $tree->closeAllLink(); ?>"><?php echo translateAdmin('Fechar tudo');?></a><br /><br />
            <?php echo $tree->render(); ?>
        </div>
    </td>
  </tr>
</table>
<?php else:?>
<?php echo translateAdmin('N&atilde;o existem ainda p&aacute;ginas no sistema');?>.
<?php endif; ?>
</body>
</html>