- Timestamp:
- 08/26/08 00:41:38 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 3 added
- 6 modified
-
config/sql/postgresql/vclassrooms.sql (modified) (1 diff)
-
controllers/vclassrooms_controller.php (modified) (3 diffs)
-
views/entries/admin_start.ctp (modified) (1 diff)
-
views/layouts/popup.ctp (modified) (2 diffs)
-
views/vclassrooms/admin_members.ctp (modified) (1 diff)
-
views/vclassrooms/chat.ctp (added)
-
views/vclassrooms/show.ctp (modified) (1 diff)
-
webroot/img/static/chat_dis.png (added)
-
webroot/img/static/chat_ena.png (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/postgresql/vclassrooms.sql
r624 r739 10 10 "sdate" date NOT NULL DEFAULT now(), --starting date 11 11 "fdate" date NOT NULL DEFAULT now(), -- finish date 12 "access" smallint NOT NULL DEFAULT 0 -- public / only with code 12 "access" smallint NOT NULL DEFAULT 0, -- public / only with code 13 "chat" smallint NOT NULL DEFAULT 0 -- active / desactive chat 13 14 ); 14 15 -
trunk/app/controllers/vclassrooms_controller.php
r730 r739 21 21 { 22 22 parent::beforeFilter(); 23 $this->Auth->allow(array('show', 'jointoclass', 'aboutme', 'display', 'participation', 'upload', 'description' ));23 $this->Auth->allow(array('show', 'jointoclass', 'aboutme', 'display', 'participation', 'upload', 'description', 'chat', 'savemessage')); 24 24 } 25 25 … … 41 41 $this->Edublog->setSession($user_id); 42 42 endif; 43 } 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 public function chat($user_id, $vclassroom_id) 55 { 56 $this->pageTitle = 'Virtual Group Chat'; 57 $this->layout = 'popup'; 58 $this->Edublog->blog($user_id); 59 60 // student belongs to this class? 61 if ( $this->Auth->user()): 62 $this->set('belongs', $this->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id)); 63 else: 64 $this->set('belongs', false); 65 endif; 66 $this->Vclassroom->unbindAll(); 67 68 $this->Vclassroom->bindModel(array('hasMany'=>array( 69 'Chat' => 70 array('className' => 'Chat', 71 'conditions' => null, 72 'order' => null, 73 'limit' => 15, 74 'foreignKey' => 'vclassroom_id' 75 )))); 76 77 $conditions = array('Vclassroom.id'=>$vclassroom_id, 'Vclassroom.user_id'=>$user_id, 'Vclassroom.status'=>1); 78 $fields = array('id', 'name', 'user_id'); 79 $this->set('data', $this->Vclassroom->find($conditions, $fields)); 43 80 } 44 81 … … 329 366 endif; 330 367 } 368 369 public function admin_chat($vclassroom_id, $chat) 370 { 371 $this->data['Vclassroom']['chat'] = ($chat == 0 ) ? 1 : 0; 372 373 $this->data['Vclassroom']['id'] = (int) $vclassroom_id; 374 375 if ($this->Vclassroom->save($this->data, array('validate'=>false))): 376 $this->msgFlash(__('Status modified', true), '/admin/vclassrooms/members/'.$vclassroom_id); 377 endif; 378 } 331 379 332 380 public function admin_delete($vclassroom_id, $ecourse_id) -
trunk/app/views/entries/admin_start.ctp
r738 r739 69 69 echo $html->div('main-item', $tmp, array('title'=>__('Tests', true), 'onclick'=>"document.location.href='/admin/tests/listing'")); 70 70 71 $tmp = $html->link($html->image('static/chat_icon.png',array('title'=>'Chats','alt'=>'Chats')),'/admin/chats/listing',null,null,false);72 $tmp .= $html->link('Chats','/admin/chats/listing', array('title'=>'Chats', 'class'=>'main-item-caption'));73 echo $html->div('main-item', $tmp, array('title'=>'Chats', 'onclick'=>"document.location.href='/admin/chats/listing'"));71 // $tmp = $html->link($html->image('static/chat_icon.png',array('title'=>'Chats','alt'=>'Chats')),'/admin/chats/listing',null,null,false); 72 // $tmp .= $html->link('Chats','/admin/chats/listing', array('title'=>'Chats', 'class'=>'main-item-caption')); 73 // echo $html->div('main-item', $tmp, array('title'=>'Chats', 'onclick'=>"document.location.href='/admin/chats/listing'")); 74 74 ?> 75 75 </div> -
trunk/app/views/layouts/popup.ctp
r682 r739 43 43 44 44 <div id="container"> 45 <?php echo $content_for_layout; ?>45 <?php echo $content_for_layout; ?> 46 46 </div> 47 47 … … 49 49 50 50 <div id="footer">Powered by <a href="http://www.chipotle-software.com/" rel="external">Karamelo Project</a></div> 51 52 51 </body> 53 52 </html> -
trunk/app/views/vclassrooms/admin_members.ctp
r729 r739 34 34 $html->image('static/feedback_icon.png', array('alt'=>__('Ask for feedback', true), 'title'=>__('Ask for feedback', true), "style"=>"margin-right:12px") 35 35 ), '/admin/vclassrooms/export/'.$data['Vclassroom']['id'], null, null, false); */ 36 37 if ($data['Vclassroom']['chat'] == 1): 38 $img = 'static/chat_ena.png'; 39 $tit = __('Disable chat', true); 40 else: 41 $img = 'static/chat_dis.png'; 42 $tit = __('Active chat', true); 43 endif; 44 45 echo $html->link( 46 $html->image($img, array('alt'=>$tit, 'title'=>$tit, 'style'=>'margin-right:12px')), '/admin/vclassrooms/chat/'.$data['Vclassroom']['id'].'/'.$data['Vclassroom']['chat'], null, null, false); 36 47 37 48 echo $html->link( -
trunk/app/views/vclassrooms/show.ctp
r729 r739 15 15 echo $ajax->div('qn', array("style"=>"padding:3px")).$ajax->divEnd('qn'); 16 16 17 if ( $data['Vclassroom']['chat'] == 1 ): 18 //popup window for chat 19 $t="javascript:window.open('/vclassrooms/chat/".$blog['User']['id']."/".$data['Vclassroom']['id']."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=400')"; 20 echo $html->link( 21 $html->image('static/icon_webquest.jpg', array('alt'=>'Chat','title'=>'Chat','style'=>'margin-right:12px') 22 ), '#', array("onclick"=>$t), null, null, false); 23 24 25 endif; 17 26 // Forums 18 27 if ( isset($data['Forum']) && count($data['Forum']) > 0):
