Show
Ignore:
Timestamp:
07/15/08 14:38:50 (4 months ago)
Author:
aarkerio
Message:

Messages and news imprved

Files:
1 modified

Legend:

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

    r648 r653  
    119119         
    120120      $this->layout = 'admin'; 
    121          
    122       $conditions   = array("News.user_id" => $this->Auth->user('id') );             // only the user's news 
    123       $fields       = array("id", "title", "body", "created", "reference", "status", "theme_id", "user_id"); 
    124       $order        = "News.id DESC"; 
    125       $limit      = 20; 
    126          
    127       $this->set('data', $this->News->findAll($conditions, $fields, $order, $limit));  
     121      $this->News->unbindModel(array('hasMany'=>array('Discussion')));   
     122      $this->paginate['conditions']   = null; 
     123      $this->paginate['fields']       = array('News.id', 'News.title', 'News.created', 'News.status',  'News.user_id', 'User.username'); 
     124      $this->paginate['order']        = 'News.id DESC'; 
     125      $this->paginate['limit']        = 20; 
     126      $data = $this->paginate('News'); 
     127 
     128      $this->set(compact('data')); 
    128129  } 
    129130