<?php $this->loadCss('/admin/media/css/dtree.css'); ?>
<?php $this->loadJavascript('/admin/media/js/dtree.js'); ?>

<div id="accoes_bg" style="z-index:1;">
    <div id="titulo_accao" style="z-index:1;"><nobr><?php echo translateAdmin('Setup do Model');?> "<?php echo $modulo; ?>"</nobr></div>
</div>

<!--<div id="filtros"><img src="<?php echo $baseUrl; ?>/admin/media/images/maisfiltro.gif" title="Filtros" />Filtros</div>-->

<script type="text/javascript">
<!--
var selection = false;

function invert() {
    if ( selection == false ) {
        selection = true; 
    } else {
        selection = false;
    }

    for (var i=0; i<document.deleteList.elements.length; i++) {
        var e = document.deleteList.elements[i];
        if ( selection == true ) {
            e.checked = true;
        } else {
            e.checked = false; 
        }
    }
}

function clean() {
    selection = false;
    document.deleteList.selectAll.checked = false;
}
-->
</script>


<div id="conteudo">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <?php if (isset($tree)): ?>
    <td width="180" 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>
    <?php endif; ?>
    <td height="320" valign="top" id="manutencaodisplay">
        <div class="acessibilidade"><span>&nbsp;</span></div>
        <br />
        
        <div style="padding:10px;">
        <h2><?php echo translateAdmin('Models detectados em');?> "<?php echo $modulo; ?>"</h2>
        <ul>
        <?php foreach ($models as $model): ?>
            <li><?php echo $model; ?></li>
        <?php endforeach; ?>
        </ul>
        
        <h2><?php echo translateAdmin('Models para instala&ccedil;&atilde;o em');?> "<?php echo $modulo; ?>"</h2>
        <ul>
        <?php foreach ($models_install as $model): ?>
            <li><?php echo $model; ?></li>
        <?php endforeach; ?>
        </ul>
        
        <h2><?php echo translateAdmin('SQL a ser executado');?></h2>        
        <?php foreach ($models_create_table_sql as $model => $sql): ?>
        <label style="color:#666666; font-style:italic;">--- <?php echo $model; ?></label>         
        <?php if (is_array($sql)): ?>
        <?php foreach ($sql as $query): ?>
        <pre><?php echo $query; ?></pre>
        <?php endforeach; ?>
        <?php else: ?>
        <pre><?php echo $sql; ?></pre>
        <?php endif; ?>
        <?php endforeach; ?>
        
		<h2><?php echo translateAdmin('SQL para altera&ccedil;&otilde;es de tabelas');?>[ALPHA 0.1 (n&atilde;o &eacute; executado)]</h2>        
        <?php foreach ($models_alter_table_sql as $model => $sql): ?>
        <label style="color:#666666; font-style:italic;">--- <?php echo $model; ?></label>         
        <?php if (is_array($sql)): ?>
        <?php foreach ($sql as $query): ?>
        <pre><?php echo $query; ?></pre>
        <?php endforeach; ?>
        <?php else: ?>
        <pre><?php echo $sql; ?></pre>
        <?php endif; ?>
        <?php endforeach; ?>
        
        <?php if (count($models_install) > 0 || $register): ?>
        <a href="<?php echo $this->link("/setup/install/modulo/" . $modulo ."/execute/1")?>"><?php echo translateAdmin('Executar');?></a>
        <?php else: ?>
        <a href="<?php echo $this->link("/setup/install/")?>"><?php echo translateAdmin('Voltar');?></a>
        <?php endif; ?>
        </div>
        
    </td>
  </tr>
  <tr>
    <td height="15" valign="top">
        <div class="acessibilidade"><span>&nbsp;</span></div>
        <div id="paginator">&nbsp;</div>
    </td>
  </tr>
</table>
</div>

