<?php

Goweb::loadClass('Goweb_Admin');
Goweb::loadClass('Goweb_Admin_Section');

/**
 * Goweb Sitemanager 5 Framework
 * @version    5.0.0
 * @category   Frontoffice
 * @package    PainelGoweb
 * @subpackage Admin
 * @author     I&D <dev@goweb.pt>, Pedro Pinto <ppinto@goweb.pt>
 * @copyright  2009 (c) Goweb (http://www.goweb.pt)
 *
 * As classes _Admin sao responsaveis pela criacao automarica do backoffice.
 *
*/
class PainelGoweb_Admin extends Goweb_Admin {
    
    /**
     * Definicao para a montagem dinamica do back-office.
    */
    public function _setup() {        
        $this->_title = translate('Goweb');
   

        $actionSection = new Goweb_Admin_Section();
        $actionSection->setModel(Goweb::getModelInstance('Sistema_Model_Action', 'db'));
        $actionSection->setTitle(translate('Ac&ccedil;&otilde;es dos M&oacute;dulos'));
        $actionSection->setTitleSingular(translate('Ac&ccedil;&atilde;o do M&oacute;dulo'));
        $actionSection->setListCols(array('modulo', 'titulo'));
        $actionSection->setOrdering('modulo_id');
        $actionSection->setSearchCols('titulo');
        $actionSection->setUpdateOnly();
        $this->_addSection('action', $actionSection);
        
        $moduloSection = new Goweb_Admin_Section();
        $moduloSection->setModel(Goweb::getModelInstance('Sistema_Model_Modulo', 'db'));
        $moduloSection->setTitle(translate('M&oacute;dulos'));
        $moduloSection->setTitleSingular(translate('M&oacute;dulo'));
        $moduloSection->setListCols(array('nome', 'titulo'));
        $moduloSection->setOrdering('titulo');
        $moduloSection->setSearchCols('titulo');
        $moduloSection->setUpdateOnly();        
        $this->_addSection('modulo', $moduloSection);
        
    }
}