Changeset 809 for trunk/app/controllers

Show
Ignore:
Timestamp:
10/11/08 22:19:40 (7 weeks ago)
Author:
aarkerio
Message:

Little changes

Location:
trunk/app/controllers
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/news_controller.php

    r792 r809  
    1515 
    1616 public $name = 'News'; 
    17   
    18  public $helpers          = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 
    19    
     17 public $helpers          = array('Ajax', 'Fck', 'News', 'Time', 'Gags');   
    2018 public $components       = array('Portal'); 
    21  
    2219 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 
    2320   
  • trunk/app/controllers/newsletters_controller.php

    r785 r809  
    1212class NewslettersController extends AppController{ 
    1313 
    14   public $helpers          = array('Ajax', 'Fck', 'Gags'); 
     14  public $name       = 'Newsletters'; 
     15  public $helpers    = array('Ajax', 'Fck', 'Gags'); 
     16  public $components = array('Portal', 'Email'); 
    1517   
    16   public $components       = array('Portal', 'Email'); 
    17    
    18   public function beforeFiler() 
     18  public function beforeFilter() 
    1919  { 
    20     parent::beforeFilter();    
    21     $this->Auth->allow(array('subscribe', 'display', 'view')); 
     20    parent::beforeFilter(); 
     21    $this->Auth->allow(array('view', 'display', 'subscribe')); 
    2222  } 
    2323  
    2424  public function subscribe() 
    2525  { 
    26          $this->layout = 'portal'; 
    27          $this->Portal->statics(); // Charge Portal components aka Sidebars 
     26    $this->pageTitle = __('Newsletters', true); 
     27    $this->layout    = 'portal'; 
     28    $this->Portal->statics(); // Charge Portal components aka Sidebars 
    2829  } 
    2930 
    30   public function display($page=1) 
     31  public function display() 
    3132  {   
    32      $this->layout = 'portal'; 
     33    $this->pageTitle = __('Newsletters', true); 
     34    $this->layout = 'portal'; 
     35    $conditions   = array('Newsletter.status'=>1); 
     36    $fields       = array('Newsletter.id', 'Newsletter.title', 'Newsletter.body', 'Newsletter.created', 'Newsletter.user_id'); 
     37    $order        = 'Newsletter.id DESC'; 
     38    $limit        = 20; 
    3339      
    34      $conditions   = array("Newsletter.status"=>1); 
    35      $fields       = array("Newsletter.id", "Newsletter.title", "Newsletter.body", "Newsletter.created", "Newsletter.user_id"); 
    36      $order        = "Newsletter.id DESC"; 
    37      $limit        = 20; 
    38       
    39      $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit)); 
    40       
    41      $this->Portal->statics(); // Using Portal component 
     40    $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit));  
     41    $this->Portal->statics(); // Using Portal component 
    4242  } 
    4343       
    4444  public function view($id) 
    4545  { 
    46        $conditions = array("estado"=>1, "id"=>$id); 
    47        $fields     = array("id", "title", "body", "fecha", "referencia", "subject_id", "iduser"); 
    48        $order      = "id DESC"; 
    49        $limit      = 10; 
    50          
    51        $this->pageTitle = 'Noticias'; 
    52        $this->set('data', $this->Newsletter->findAll($conditions, $fields)); 
    53          
    54        $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 
     46   $this->pageTitle = __('Newsletter', true); 
     47   $conditions = array('status'=>1, 'id'=>$id); 
     48   $fields     = array('id', 'title', 'body', 'created'); 
     49   $this->set('data', $this->Newsletter->find($conditions, $fields));      
     50   $this->Portal->statics(); // Charge Portal components aka Sidebars 
    5551  } 
    5652