Changeset 637 for trunk/app/controllers/lessons_controller.php
- Timestamp:
- 07/10/08 17:53:04 (5 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/lessons_controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/lessons_controller.php
r632 r637 17 17 18 18 public $components = array('Edublog'); 19 20 public $paginate = array('limit' => 20, 'page' => 1); 19 21 20 22 public function beforeFilter() … … 45 47 public function display($username) 46 48 { 47 $user_id = $this->Lesson->User->field('id', array('User.username'=>$username));49 $user_id = $this->Lesson->User->field('id', array('User.username'=>$username)); 48 50 49 $this->pageTitle = $username .'\'s Lessons';51 $this->pageTitle = $username .'\'s Lessons'; 50 52 51 $conditions = array("Lesson.status"=>1, "Lesson.user_id"=>$user_id); 53 $this->paginate['conditions'] = array('Lesson.status'=>1, 'Lesson.user_id'=>$user_id); 54 55 $this->paginate['fields'] = array("id", "title", "created", "user_id"); 56 57 $this->paginate['order'] = array('Lesson.title' => 'DESC'); 58 59 $data = $this->paginate('Lesson'); 60 61 $this->set(compact('data')); 62 63 $this->layout = $this->Edublog->layout($user_id); 52 64 53 $fields = array("id", "title", "created", "user_id"); 54 55 $order = "Lesson.title"; 56 57 $this->set('data', $this->Lesson->findAll($conditions, $fields, $order)); 58 59 $this->layout = $this->Edublog->layout($user_id); 60 61 $this->Edublog->blog($user_id); // blogger elements 62 } 65 $this->Edublog->blog($user_id); // blogger elements 66 } 63 67 64 68 /*** === ADMIN METHODS ****/
