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/lessons_controller.php

    r637 r638  
    6666 } 
    6767     
    68     /***   === ADMIN METHODS   ****/ 
    69     public function admin_listing() 
    70     {    
    71         $this->layout    = 'admin'; 
     68 /***   === ADMIN METHODS   ****/ 
     69 public function admin_listing() 
     70 {    
     71   $this->layout    = 'admin'; 
    7272         
    73         $this->LessonTitle = 'Lessons'; 
     73   $this->PageTitle = __('Lessons', true); 
    7474         
    75         $conditions = array("Lesson.user_id"=>$this->Auth->user('id')); 
    76          
    77         $fields     = array("id", "title", "status", "created"); 
    78          
    79         $order      = null; 
    80          
    81         $data       = $this->Lesson->findAll($conditions, $fields, $order, null, null, 1); 
    82          
    83         $this->set('data', $data); 
    84     } 
     75   $this->paginate['conditions']  = array('Lesson.user_id'=>$this->Auth->user('id')); 
    8576    
    86     
    87    public function admin_add() 
    88    { 
     77   $this->paginate['fields']      = array("id", "title", "created", "user_id", "status"); 
     78             
     79   $this->paginate['order']       = array('Lesson.id' => 'DESC'); 
     80 
     81   $data = $this->paginate('Lesson'); 
     82      
     83   $this->set(compact('data')); 
     84 } 
     85 
     86 public function admin_add() 
     87 { 
    8988    $this->layout    = 'admin'; 
    9089     
     
    101100       $this->data['Lesson']['user_id'] = $this->Auth->user('id');;  
    102101         
    103        if ($this->Lesson->save($this->data['Lesson'])): 
     102       if ($this->Lesson->save($this->data)): 
    104103           $this->msgFlash('Lesson saved', '/admin/lessons/edit/'.$this->Lesson->getLastInsertID()); 
    105104       endif;