Changeset 740
- Timestamp:
- 08/27/08 13:00:26 (3 months ago)
- Location:
- trunk/app/controllers
- Files:
-
- 2 modified
-
reports_controller.php (modified) (1 diff)
-
webquests_controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/reports_controller.php
r733 r740 112 112 endif; 113 113 } 114 /*=== ADMIN METHODS ===*/114 /*=== ADMIN METHODS ===*/ 115 115 public function admin_points($participation_id, $sense) 116 116 { -
trunk/app/controllers/webquests_controller.php
r728 r740 78 78 { 79 79 // adds new blog entries 80 if ( !empty($this->data['ResultWebquest']) ) 81 { 80 if ( !empty($this->data['ResultWebquest']) ) : 82 81 $this->Sanitize = new Sanitize; 83 82 … … 85 84 86 85 $this->data['ResultWebquest']['user_id'] = $this->Auth->user('id'); 87 88 $this->Webquest->ResultWebquest->create(); 89 90 if ($this->Webquest->ResultWebquest->save($this->data['ResultWebquest'])) 91 { 92 $this->msgFlash('Webquest saved', 86 87 if ($this->Webquest->ResultWebquest->save($this->data['ResultWebquest'])): 88 $this->msgFlash(__('Data saved', true), 93 89 '/vclassrooms/show/'.$this->data['ResultWebquest']['blogger_id'].'/'.$this->data['ResultWebquest']['vclassroom_id']); 94 } 95 else 96 { 97 $this->msgFlash('Database error!', '/admin/webquests/listing'); 98 } 99 } 100 } 101 /** ADMIN METHODS**/ 90 endif; 91 endif; 92 } 93 /**== ADMIN METHODS ==**/ 94 public function admin_points($resultwebquest_id, $sense) 95 { 96 $points = $this->Webquest->ResultWebquest->field('points', array('ResultWebquest.id'=>$resultwebquest_id)); 97 98 $points = ($sense == 'up' ) ? ($points + 1) : ($points - 1); 99 100 $this->data['Participation']['id'] = $participation_id; 101 102 $this->data['Participation']['points'] = $points; 103 104 if ($this->Webquest->ResultWebquest->save($this->data['Participation'])): 105 $this->set('points', $points); 106 $this->render('points', 'ajax'); 107 endif; 108 } 109 102 110 public function admin_listing() 103 111 {
