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


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

  public function indexAction() {
    $this->forward('lista');
  }
  public function listaAction() {
    
    $this->view->headTitle("Notícias");
    $this->view->classmain = 'interna';
    $Model = new Model_Noticias();
     $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->siteList($filters);
   
  }

  public function verAction() {
    $this->view->headTitle("Notícias");
    $objid = $this->_getParam("id");
    $Model = new Model_Noticias();

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

