<?php if (!headers_sent()) { header('Content-Type:text/html; charset=' . CHARSET); } ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-pt" xml:lang="pt-pt" >
<head>
<title><?php echo $title; ?> | <?php if (isset($section_title)) : ?><?php echo $section_title; ?> : <?php endif; ?><?php echo $action; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php foreach ($this->getJavascripts() as $javascript): ?>
<script type="text/javascript" src="<?php echo $javascript; ?>"></script>
<?php endforeach; ?>
<?php foreach ($this->getCss() as $css): ?>
<link rel="stylesheet" type="text/css" href="<?php echo $css; ?>" />
<?php endforeach; ?>
<link rel="stylesheet" type="text/css" href="/admin/media/css/base.css" />
<script type="text/javascript" src="/admin/media/js/utils.js"></script>
<script type="text/javascript" src="/admin/media/js/prototype.js"></script>
<script type="text/javascript" src="/admin/media/js/scriptaculous/scriptaculous.js"></script>
<script type="text/javascript" src="/admin/media/js/scriptaculous/effects.js"></script>
</head>
<body>
<?php $session = Goweb::registry('session'); ?>
<div id="cabecalho" style="z-index:100;">
   <table border="0" cellspacing="0" cellpadding="0" width="100%" id="imgtopo">
      <tr>
         <td width="20%">&nbsp;</td>
         <td width="60%" valign="top" align="center">
            <div id="menus">
               <table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                     <td width="6"><div id="imgesq" class="imgleft">&nbsp;</div></td>
                     <td class="menutopbg">
                        <div class="label" onClick="location='/admin/cms/dashboard';" onMouseOver="this.className='label_hover'; $('imgesq').className='imglefthover';" onMouseOut="this.className='label'; $('imgesq').className='imgleft'"><img src="/admin/media/images/ico_inicio.gif" title="In&iacute;cio" border="0" /><br />In&iacute;cio</div>
                     </td>
                     <td class="menutopbg">
                        <div class="label" onClick="location='/admin/cms/';" onMouseOver="this.className='label_hover'" onMouseOut="this.className='label'"><img src="/admin/media/images/ico_site.gif" title="Site"  border="0"/><br />Site</div>
                     </td>
                     <td class="menutopbg">
                        <div id="modulos_menu" class="label" onMouseOver="$('submenu').style.left='-12px';$('submenu').style.visibility='visible';$('submenu').style.overflow='visible';this.className='label_hover';" onMouseOut="this.className='label';$('submenu').style.visibility='hidden';">
                           <div id="interno_relativo" style="position:relative;left:0px;top:0px;z-index:101;">
                              <div style="z-index:102;">
                                 <table cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                       <td align="center"><img src="/admin/media/images/ico_modulos.gif" title="M&oacute;dulos"  border="0"/></td>
                                    </tr>
                                    <tr>
                                       <td align="center">M&oacute;dulos</td>
                                    </tr>
                                 </table>
                              </div>
                              <div id="submenu" style="position:absolute;left:0px;width:1px;height:1px;top:38px;visibility:hidden;overflow:hidden;z-index:110;">
                                 <table cellspacing="0" cellspacing="0" border="0">
                                    <tr>
                                       <td onMouseOver="$('submenu').style.visibility='visible'" onMouseOut="$('submenu').style.visibility='hidden'" height="2"></td>
                                    </tr>
                                    <?php if ($session->modulos_menu): ?>
                                    <?php foreach ((array) $session->modulos_menu as $modulo => $titulo) : ?>
                                    <tr>
                                       <td class="menu" onClick="location='<?php echo $this->link("/admin/{$modulo}/list/section/{$modulo}/"); ?>';" onMouseOver="$('modulos_menu').className='label_hover';this.className='menu_hover';$('submenu').style.visibility='visible'" onMouseOut="$('modulos_menu').className='label';this.className='menu';$('submenu').style.visibility='hidden'">
                                          <table cellpadding="0" cellspacing="5" border="0">
                                             <tr>
                                                <td><img src="/admin/media/images/<?php echo $modulo; ?>.gif" border="0"></td>
                                                <td>&nbsp;</td>
                                                <td><nobr><?php echo $titulo; ?></nobr></td>
                                                <td>&nbsp;</td>
                                             </tr>
                                          </table>
                                       </td>
                                    </tr>
                                    <?php endforeach; ?>
                                    <?php endif; ?>
                                 </table>
                              </div>
                           </div>
                        </div>
                     </td>
                     <td class="menutopbg" align="center">
                        <div class="label" onClick="location='<?php echo $this->link('/admin/painel/edit/'); ?>';" onMouseOver="this.className='label_hover'" onMouseOut="this.className='label'"><img src="/admin/media/images/ico_pcontrol.gif" title="Sair" border="0"/><br />Painel</div>
                     </td>
                     <td class="menutopbg">
                        <div class="labeldir" onClick="location='<?php echo $this->link('/admin/auth/logout/'); ?>';" onMouseOver="this.className='label_hover_dir'; $('imgdir').className='imgrighthover'" onMouseOut="this.className='labeldir'; $('imgdir').className='imgright'"><img src="/admin/media/images/ico_sair.gif" title="Sair" border="0"/><br />Sair</div>
                     </td>
                     <td width="6"><div id="imgdir" class="imgright">&nbsp;</div></td>
                  </tr>
               </table>
            </div>
         </td>
         <td width="20%" id="txttopo">Bem-Vindo <?php echo $session->utilizador['nome']; ?></td>
      </tr>
   </table>
</div>


<div id="sublinks" style="z-index:1;">
 	<div id="linksdomodulobg" style="z-index:1;">
        <div id="modulos" style="z-index:1;"><div id="imgmodulos" style="z-index:1;"></div>
        </div>
        <div id="links_modulo_palavras" style="z-index:1;">
        </div>

        <div id="flags" style="z-index:1;">
            <?php if (is_array($session->langs)): ?>
                <?php 
                    $redirect_url = '/admin/';
                    if (array_key_exists('REDIRECT_URL', $_SERVER)) { 
                        $redirect_url = str_replace('save', 'edit', $_SERVER['REDIRECT_URL']);
                    } 
                ?>
                <?php foreach ((array) $session->langs as $l): ?>
                <?php if ($l == $session->lang): ?>
                <div style="padding-right:10px; float:left;z-index:1;"><a href="<?php echo $this->link($redirect_url, 'lang=' . $l); ?>"><img src="/admin/media/images/flag-<?php echo strtoupper($l); ?>.gif" width="16" border="0" style="padding:1px; margin:0; border:1px solid #000;" /></a></div>
                <?php else: ?>
                <div style="padding-right:10px; float:left;z-index:1;"><a href="<?php echo $this->link($redirect_url, 'lang=' . $l); ?>"><img src="/admin/media/images/flag-<?php echo strtoupper($l); ?>.gif" width="16" height="11" border="0" /></a></div>
                <?php endif; ?>
                <?php endforeach; ?>
            <?php endif; ?>
        </div>

	</div>
</div>

<div id="messages" style="z-index:1;">
    <?php if (isset($error)): ?>
    <div id="error"><?php echo $error; ?></div>
    <script type="text/javascript">new Effect.Pulsate("error");</script>
    <?php endif?>
    
    <?php if (isset($message)): ?>
    <div id="message" style="display:none;"><?php echo $message; ?></div>
    <script type="text/javascript">new Effect.toggle("message", "appear");</script>
    <?php endif; ?>
</div>

<!-- Content -->
<div id="content" style="z-index:1;"><?php echo $output; ?></div>
<!-- END Content -->				

<!--<div id="footer"></div>-->
</body>
</html>
