Changeset 753 for trunk/app/controllers
- Timestamp:
- 09/03/08 21:34:40 (3 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/vclassrooms_controller.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/vclassrooms_controller.php
r745 r753 43 43 } 44 44 45 public function savemessage()46 {47 if ($this->data['Chat']):48 $this->Sanitize = new Sanitize;49 $this->Sanitize->clear($this->data['Chat']);50 $this->save($this->data);51 $this->render('oldmessages', 'ajax');52 endif;53 }54 45 public function chat($user_id, $vclassroom_id) 55 46 { … … 76 67 77 68 $conditions = array('Vclassroom.id'=>$vclassroom_id, 'Vclassroom.user_id'=>$user_id, 'Vclassroom.status'=>1); 78 $fields = array('id', 'name', 'user_id'); 69 $fields = array('id', 'name', 'user_id'); 79 70 $this->set('data', $this->Vclassroom->find($conditions, $fields)); 71 72 $conditions = array('Chat.vclassroom_id'=>$vclassroom_id); 73 $fields = array('Chat.message', 'Chat.created', 'User.username');; 74 $order = 'Chat.id DESC'; 75 $limit = 15; 76 $this->set('msgs', $this->Vclassroom->Chat->findAll($conditions, $fields, $order, $limit)); 77 } 78 public function savemessage() 79 { 80 $this->layout = 'ajax'; 81 82 if ( !empty($this->data['Chat'])): 83 $this->Sanitize = new Sanitize; 84 $this->Sanitize->clean($this->data['Chat']); 85 86 $this->Vclassroom->Chat->save($this->data); 87 88 $conditions = array('Chat.vclassroom_id'=>$this->data['Chat']['vclassroom_id']); 89 $fields = array('Chat.message', 'Chat.created', 'User.username');; 90 $order = 'Chat.id DESC'; 91 $limit = 15; 92 93 $this->set('data', $this->Vclassroom->Chat->findAll($conditions, $fields, $order, $limit)); 94 $this->render('messages', 'ajax'); 95 endif; 80 96 } 81 97 … … 103 119 public function show($user_id, $vclassroom_id) 104 120 { 105 $this->pageTitle = 'Virtual Group';121 $this->pageTitle = __('Virtual Class', true); 106 122 $this->layout = $this->Edublog->layout($user_id); 107 123 $this->Edublog->blog($user_id); … … 116 132 $this->set('data', $this->Vclassroom->classElements($vclassroom_id)); 117 133 } 118 134 119 135 public function participation() 120 136 { … … 227 243 public function admin_linktest() 228 244 { 229 if (!empty($this->data[ "TestsVclassroom"])):245 if (!empty($this->data['TestsVclassroom'])): 230 246 $this->Sanitize = new Sanitize; 231 247 232 $this->Sanitize->clean($this->data["TestsVclassroom"]); 233 234 $this->Vclassroom->TestsVclassroom->create(); 248 $this->Sanitize->clean($this->data['TestsVclassroom']); 235 249 236 250 unset($this->Vclassroom->TestsVclassroom->id); 237 251 238 if ( $this->Vclassroom->TestsVclassroom->save($this->data[ "TestsVclassroom"])):239 $this->msgFlash( 'Test linked', '/admin/vclassrooms/tests/'.$this->data["TestsVclassroom"]["vclassroom_id"]);252 if ( $this->Vclassroom->TestsVclassroom->save($this->data['TestsVclassroom'])): 253 $this->msgFlash(__('Test linked', true), '/admin/vclassrooms/tests/'.$this->data["TestsVclassroom"]["vclassroom_id"]); 240 254 endif; 241 255 endif;
