<?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->loadJavascript('/admin/media/js/tinymce/tiny_mce_popup.js');
$this->loadJavascript('/admin/media/js/tinymce/plugins/component/js/functions.js');
$this->loadCss('/admin/media/css/component.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(html_entity_decode(translateAdmin('Inser&ccedil;&atilde;o de componentes'), ENT_NOQUOTES, CHARSET));
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()->appendScript("ComponentDialog.insert('$onload');"); ?>
</head>
<body>

<div id="geral">

    <div id="container">
        <div id="topo"><img src="<?php echo $baseUrl?>/admin/media/images/component.gif" width="49" height="49" align="absmiddle" /> <?php echo translateAdmin('Inserir Componente Din&acirc;mico');?> </div>
        <div id="wrapper">
            <?php if ($output) : ?>
            <?php echo $output; ?>
            <?php else : ?>
            <div id="content">
                <div id="componente" style="padding-top:40px;padding-bottom:50px;">
                    <strong><?php echo translateAdmin('Da lista ao lado, escolha qual dos m&oacute;dulos existentes pretende explorar para a inser&ccedil;&atilde;o de componentes din&acirc;micos');?>.</strong>
                </div>
            </div>
            <?php endif; ?>
        </div>

        <div id="navigation">
            <?php if ($modulos): ?>
            <?php foreach ($modulos as $modulo): ?>
            <?php if (isset($controller)) : ?>
                <?php if ($controller == strtolower($modulo->nome)) : ?>
                <div id="modulo_activo"><a href="<?php echo $this->link('/cms/component/component_controller/' . strtolower($modulo->nome) .'/'); ?>"><?php echo translateAdmin($modulo->titulo); ?></a></div>
                <?php else : ?>
                <div id="modulo"><a href="<?php echo $this->link('/cms/component/component_controller/' . strtolower($modulo->nome) .'/'); ?>"><?php echo translateAdmin($modulo->titulo); ?></a></div>
                <?php endif; ?>
            <?php else : ?>
                <div id="modulo"><a href="<?php echo $this->link('/cms/component/component_controller/' . strtolower($modulo->nome) .'/'); ?>"><?php echo translateAdmin($modulo->titulo); ?></a></div>
            <?php endif; ?>
            <?php endforeach; ?>
            <?php endif; ?>
        </div>
    </div>

</div>

<br clear="all" />
</body>
</html>