Changeset 638 for trunk/app/controllers/lessons_controller.php
- Timestamp:
- 07/10/08 18:28:49 (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
r637 r638 66 66 } 67 67 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'; 72 72 73 $this->LessonTitle = 'Lessons';73 $this->PageTitle = __('Lessons', true); 74 74 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')); 85 76 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 { 89 88 $this->layout = 'admin'; 90 89 … … 101 100 $this->data['Lesson']['user_id'] = $this->Auth->user('id');; 102 101 103 if ($this->Lesson->save($this->data ['Lesson'])):102 if ($this->Lesson->save($this->data)): 104 103 $this->msgFlash('Lesson saved', '/admin/lessons/edit/'.$this->Lesson->getLastInsertID()); 105 104 endif;
