Show
Ignore:
Timestamp:
07/10/08 18:28:49 (5 months ago)
Author:
aarkerio
Message:

Litle changes

Files:
1 modified

Legend:

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

    r632 r638  
    1414class AnnotationsController extends AppController { 
    1515 
     16 public $paginate = array('limit' => 20, 'page' => 1); 
     17 
    1618 public function add() 
    1719 { 
     
    2628    $this->Annotation->create(); 
    2729 
    28     if ($this->Annotation->save($this->data['Annotation'])): 
     30    if ($this->Annotation->save($this->data)): 
    2931          $this->msgFlash(__('Comment added', true), $this->data['Annotation']['redirect_to'].'/#comments'); 
    3032    endif; 
     
    3234 }   
    3335 
    34   /**    ===== ADMIN METHODS ====== **/ 
     36 /**    ===== ADMIN METHODS ====== **/ 
     37 public function admin_listing() 
     38 {    
     39   $this->layout                  = 'admin'; 
     40         
     41   $this->PageTitle               = __('Comments', true); 
     42         
     43   $this->paginate['conditions']  = array('Lesson.user_id'=>$this->Auth->user('id')); 
     44    
     45   $this->paginate['fields']      = array("id", "comment", "created", "user_id", "status"); 
     46             
     47   $this->paginate['order']       = array('Annotation.id' => 'DESC'); 
     48 
     49   $data = $this->paginate('Annotation'); 
     50      
     51   $this->set(compact('data')); 
     52 } 
    3553  
    3654  // change status enabled/disabled actived