Changeset 642 for trunk/app/controllers/replies_controller.php
- Timestamp:
- 07/11/08 14:28:03 (4 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/replies_controller.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/replies_controller.php
r562 r642 25 25 public function add() 26 26 { 27 if (!empty($this->data['Reply'])) 28 {27 if (!empty($this->data['Reply'])): 28 29 29 $this->Sanitize = new Sanitize; 30 30 … … 35 35 $this->Reply->create(); 36 36 37 if ($this->Reply->save($this->data['Reply'])) 38 { 39 $this->msgFlash('Reply added', $this->data['Reply']['redirect_to']); 40 } 41 } 37 if ($this->Reply->save($this->data)): 38 $this->msgFlash(__('Reply saved', true), $this->data['Reply']['redirect_to']); 39 endif; 40 endif; 42 41 } 43 42 … … 46 45 public function admin_edit($id = null) 47 46 { 48 if (empty($this->data))49 {47 if (empty($this->data)): 48 50 49 $this->Reply->id = $id; 51 50 52 51 $this->data = $this->Reply->read(); 53 } 54 else 55 { 56 if ($this->Reply->save($this->data['Reply'])) 57 { 58 $this->flash('Reply updated.','/admin/topics/listing/'.$topic_id); 59 } 60 } 52 else: 53 54 if ($this->Reply->save($this->data['Reply'])): 55 $this->flash(__('Reply updated', true),'/admin/topics/listing/'.$this->data['Reply']['topic_id']); 56 endif; 57 endif; 61 58 } 62 59 … … 68 65 $this->data['Reply']['id'] = $reply_id; 69 66 70 if ($this->Reply->save($this->data['Reply'])) 71 { 67 if ($this->Reply->save($this->data['Reply'])): 72 68 $this->msgFlash('Reply status changed', '/admin/topics/listing/'.$topic_id); 73 }69 endif; 74 70 } 75 71 76 72 public function admin_delete($topic_id, $reply_id) 77 73 { 78 if ( $this->Reply->del($reply_id) ) 79 { 80 $this->msgFlash('Reply deleted','/admin/topics/listing/'.$topic_id); 81 } 74 if ( $this->Reply->del($reply_id) ): 75 $this->msgFlash(__('Data deleted', true),'/admin/topics/listing/'.$topic_id); 76 endif; 82 77 } 83 78 }
