<?php $this->loadCss('/admin/media/css/calendar.css'); ?>
<?php $this->loadJavascript('/admin/media/js/jscalendar/calendar.js'); ?>
<?php $this->loadJavascript('/admin/media/js/jscalendar/calendar-setup.js'); ?>
<?php $this->loadJavascript('/admin/media/js/jscalendar/lang/calendar-pt.js'); ?>
<?php $this->loadCss('/admin/media/css/dtree.css'); ?>
<?php $this->loadJavascript('/admin/media/js/dtree.js'); ?>
<script type="text/javascript">
/* <![CDATA[ */
function showHidePerfis() {
   if ($F('privado') == '1') {
       new Effect.BlindDown('perfis_tr');
   } else {
       new Effect.BlindUp('perfis_tr');
   }
}
function showHidePopUp() {
	   if ($F('menu') == '1') {
	       new Effect.BlindDown('popup_tr');
	       new Effect.BlindDown('semlink_tr');
	   } else {
	       new Effect.BlindUp('popup_tr');
	       new Effect.BlindUp('semlink_tr');
	   }
	}
/* ]]> */
</script>

<div id="accoes_bg">
    <div id="titulo_accao"><?php echo $action; ?> <?php echo translateAdmin('de'); ?> <?php echo $section_singular; ?></div>
</div>

<div id="conteudo">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <?php if (isset($tree)) : ?>
    <td valign="top" id="tr_tree">
        <div id="tree">
            <p><?php echo translateAdmin('P&aacute;ginas');?> | <a href="<?php echo $tree->openAllLink(); ?>"><?php echo translateAdmin('Expandir tudo');?></a> | <a href="<?php echo $tree->closeAllLink(); ?>"><?php echo translateAdmin('Fechar tudo');?></a></p>
            <?php echo $tree->render(); ?>
        </div>
    </td>
    <?php $align = "left"; ?>
    <?php else: ?>
    <?php $align = "center"; ?>
    <?php endif; ?>
    <td align="center" valign="top" id="manutencaodisplay">
        <?php echo $form->start(); ?>
        <div class="acessibilidade">
        <span>
            <?php if (isset($links['delete'])) : ?>
            <input type="button" id="delete_link" name="delete_link" value="<?php echo translateAdmin('Remover');?>" class="form_delete" onclick="if (confirm('<?php echo translateAdmin('Tem a certeza que deseja remover o item seleccionado');?>?')) { location='<?php echo $this->link($links['delete']); ?>'; } "/>
            <?php endif; ?>
            <?php echo $form->submit_and_new->input; ?>
			<?php echo $form->submit_and_continue->input; ?>
			<?php echo $form->submit->input; ?>
        </span>
        </div>
        <div id="rte">
        <table border="0" cellpadding="2">
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->pai_id->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->pai_id->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->pai_id->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->pai_id->input; ?> <?php $element = 'pai_id'; ?>
                        <?php if ($form->elementExists($element . '_tafel')):?>
                        <?php echo $form->{$element. '_tafel'}->input; ?>
                        <?php endif;?>               
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->titulo->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->titulo->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->titulo->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->titulo->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->titulo_site->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->titulo_site->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->titulo_site->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->titulo_site->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->url->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->url->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->url->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->url->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->sem_url->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->sem_url->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->sem_url->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->sem_url->input; ?>
              </td>
           </tr>
           <tr>
              <td colspan="2" align="left">
                 <?php /*if ($id > 0): ?><div style="padding-top:5px; padding-bottom:10px;"><a href="#" class="previsualizar" onclick="windowPopup('<?php echo $baseUrl . goweb::link("/cms/view/id/$id/"); ?>', 'Prever', '750', '500');"><?php echo translateAdmin('Pr&eacute;-visualizar');?></a></div><?php endif; */?>
                 <?php if ($form->texto->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->texto->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->texto->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->keywords->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->keywords->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->keywords->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->keywords->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->ordem->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->ordem->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->ordem->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->ordem->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->redireccionar->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->redireccionar->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->redireccionar->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->redireccionar->input; ?>
                        <?php $element = 'redireccionar'; ?>
                        
                        <?php if ($form->elementExists($element . '_tafel')):?>
                        <?php echo $form->{$element. '_tafel'}->input; ?>
                        <?php endif;?>

              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->canal->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->canal->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->canal->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->canal->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->homepage->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->homepage->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->homepage->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->homepage->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->menu->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->menu->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->menu->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->menu->input; ?>
              </td>
           </tr>
           <tr id="popup_tr"<?php if ($form->menu->value == '0'): ?> style="display:none;"<?php endif; ?>>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->popup->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->popup->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->popup->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->popup->input; ?>
              </td>
           </tr>
           <tr id="semlink_tr"<?php if ($form->menu->value == '0'): ?> style="display:none;"<?php endif; ?>>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->semlink->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->semlink->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->semlink->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->semlink->input; ?>
              </td>
           </tr>
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->privado->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->privado->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->privado->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->privado->input; ?>
              </td>
           </tr>           
           <tr id="perfis_tr"<?php if ($form->privado->value == '0'): ?> style="display:none;"<?php endif; ?>>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->perfis->label; ?></td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->perfis->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->perfis->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->perfis->input; ?>
              </td>
           </tr>           
           <tr>
              <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->activo->label; ?>:</td>
              <td width="90%" bgcolor="#f0f0ee" align="left">
                 <?php if ($form->activo->getErrorMessage()): ?>
                 <div class="error_message"><?php echo $form->activo->getErrorMessage(); ?></div>
                 <?php endif; ?>
                 <?php echo $form->activo->input; ?>
              </td>
           </tr>
        </table>
        <div align="right"></div>
        <br />
        <div class="acessibilidade">
            <span>
                <?php if (isset($links['delete'])) : ?>
                <input type="button" id="delete_link2" name="delete_link" value="<?php echo translateAdmin('Remover');?>" class="form_delete" onclick="if (confirm('<?php echo translateAdmin('Tem a certeza que deseja remover o item seleccionado');?>?')) { location='<?php echo $this->link($links['delete']); ?>'; } "/>
                <?php endif; ?>
                <?php echo $form->submit_and_new->input; ?>
                <?php echo $form->submit_and_continue->input; ?>
                <?php echo $form->submit->input; ?>
            </span>
        </div>    
        </div>
        <?//= $form->getJsValidate()?>
        <?php echo $form->end(); ?>
        
    </td>
  </tr>
</table>
</div>
