<?php
@session_start();
class TransparenciaController extends Pampa_Controller_Action_Site {


  public function init() {
    parent::init();
    $this->view->menu = 'transparencia';
  }

  public function indexAction() {
    $this->forward('lista');
  }
  public function listaAction() {
    // if(empty($_SESSION[NOME_SESSAO]['usuario'])){
    //    $this->redirect('usuarios/login');
    // }else{
    $this->view->headTitle("Transparência");
    $this->view->classmain = 'interna';
    $Model = new Model_Transparencias();
     $filters = array(
            "t" => $this->_getParam("t", 12),
            "p" => $this->_getParam("p", 1),
            "s" => $this->_getParam("s")
    );

    $this->view->filters = $filters;

    // retrieves the items list
    $this->view->items = $Model->getAll();
  // }
   
  }

  public function verAction() {
    $this->view->headTitle("Transparência");
    $objid = $this->_getParam("id");
    $Model = new Model_Transparencias();

    $obj = $Model->find($objid)->current();
    $this->view->headTitle($obj->titulo);
    $this->view->obj = $obj;
    $this->view->classmain = 'interna noticias';
  }
 
}

