Changeset 621

Show
Ignore:
Timestamp:
07/03/08 12:02:14 (3 months ago)
Author:
aarkerio
Message:

Update news

Location:
trunk/app
Files:
2 modified

Legend:

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

    r620 r621  
    1919   
    2020 public $components       = array('Portal'); 
     21 
     22 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 
    2123   
    2224 public function beforeFilter()  
     
    2628 } 
    2729  
    28  public function display($page=1)  
     30 public function display()  
    2931 {      
    30         $this->layout = 'portal'; 
    31          
    32         $this->pageTitle = 'Karamelo::Home'; 
    33          
    34         $conditions = array("News.status"=>1); 
    35          
    36         $fields     = null; 
    37          
    38         $order      = "News.id DESC"; 
     32   $this->layout = 'portal'; 
     33         
     34   $this->pageTitle = 'Karamelo::Home'; 
     35         
     36   $conditions = array("News.status"=>1); 
     37         
     38   $fields     = null; 
     39         
     40   $order      = "News.id DESC"; 
    3941                     
    40         $limit      = 8; 
    41          
    42         $this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); 
    43          
    44         $this->Portal->statics(); // Charge Portal components aka Sidebars 
     42   $limit      = 8; 
     43         
     44   //$this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); 
     45   $data = $this->paginate('News', array('News.status = 1')); 
     46 
     47   $this->set(compact('data')); 
     48 
     49   $this->Portal->statics(); // Charge Portal components aka Sidebars 
    4550 } 
    4651     
  • trunk/app/views/news/display.ctp

    r620 r621  
    5151  echo '</div>'; 
    5252endforeach; 
     53 
     54$t  = $html->div(null,$paginator->prev('« Previous ',null,null,array('class'=>'disabled')),array('style'=>'width:100px;float:left')); 
     55$t .= $html->div(null, $paginator->next(' Next »', null, null, array('class' => 'disabled')),array('style'=>'width:100px;float:right')); 
     56$t .= $html->div(null,$paginator->counter(), array('style'=>'width:200px;float:center')); 
     57echo  $html->div(null,$t, array('style'=>'font-size:9pt;width:400px;margin:15px auto;')); 
    5358?>