<?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'); ?>

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

<div id="conteudo">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top" id="manutencaodisplay">
        <?php echo $form->start(); ?>
        <div class="acessibilidade">
        	<span>
            <?php echo $form->submit->input; ?>
            </span>
        </div>
        <div id="rte">
        <table border="0" cellpadding="2" width="98%">
            <?php foreach ($form->getElementsNames() as $element): ?>
                <?php if ($form->{$element}->type != 'submit' && $form->{$element}->type != 'button'): ?>
                <tr>
                    <?php if ($form->{$element}->type == 'rte'): ?>
                    <td colspan="2" align="left"><?php if ($form->{$element}->getErrorMessage()): ?>
                        <div class="error_message">
                        <?php echo $form->{$element}->getErrorMessage(); ?>
                        </div>
                        <?php endif; ?>
                        <?php echo $form->{$element}->input; ?>
                    </td>
                    <?php else: ?>
                    <td width="10%" nowrap="nowrap" bgcolor="#f0f0ee"><?php echo $form->{$element}->label; ?>:</td>
                    <td width="90%" bgcolor="#f0f0ee" align="left">
                        <?php if ($form->{$element}->getErrorMessage()): ?>
                        <div class="error_message">
                            <?php echo $form->{$element}->getErrorMessage(); ?>
                        </div>
                        <?php endif; ?>
                        <div id="update_<?php echo $element?>">
                        <?php if (is_array($form->{$element}->input)) : ?>
                            <?php foreach ($form->{$element}->input as $label => $input) : ?>
                            <?php echo $input; ?>&nbsp;<?php echo $label; ?><?php echo $this->br(); ?>
                            <?php endforeach; ?>
                        <?php else: ?>
                            <?php echo $form->{$element}->input; ?>
                        <?php endif; ?>
                        </div>
                        <?php if ($form->{$element}->help): ?>
                        <?php echo $this->br(); ?><label class="helper"><?php echo $form->{$element}->help; ?></label>
                        <?php endif; ?>
                    </td>
                    <?php endif; ?>
                </tr>
                <?php endif; ?>
            <?php endforeach; ?>
        </table>
        
        <div align="right"></div>

        <div class="acessibilidade">
        	<span>
            <?php echo $form->submit->input; ?>
            </span>
        </div>
        
        </div>
        <?php echo $form->end(); ?>
        
    </td>
  </tr>
</table>
</div>
<?php if (isset($links['update'])):?>
<script type="text/javascript">
/* <![CDATA[ */
function updateFileContents(ficheiro){
	var pars = 'ficheiro=' + ficheiro;
	var myAjax = new Ajax.Updater('update_edit',
        '<?php echo $this->link($links['update']);?>',
        {
            method: 'post',
            parameters: pars
        }
        );
}
/* ]]> */
</script>
<?php endif;?>