Changeset 753 for trunk/app/views
- Timestamp:
- 09/03/08 21:34:40 (3 months ago)
- Location:
- trunk/app/views/vclassrooms
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/views/vclassrooms/chat.ctp
r739 r753 1 1 <?php 2 // debug($data);2 // debug($data); 3 3 4 4 if ( $belongs === true ): 5 6 echo $ajax->div('updater') . $ajax->divEnd('updater'); 7 echo $html->para(null, $session->read('Auth.User.username')); 8 echo $ajax->div('charging', array('style'=>'display:none')); 9 echo $html->image('static/loading.gif', array('alt'=>'Loading')); 10 echo $ajax->divEnd('charging'); 5 echo $html->div(null, 'Chat Room '. $data['Vclassroom']['name'], array('style'=>'font-size:12pt;')); 6 echo $ajax->div('updater'); 7 $M = array_reverse($msgs); 8 //foreach ($M as $m): 9 //e($html->div(null, 10 // '<span style="color:orange;font-size:6pt;">'.$m['Chat']['created']. ' '.$m['User']['username'].'</span>: '.$m['Chat']['message'], array('style'=>'font-size:8pt;'))); 11 //endforeach; 12 echo $ajax->divEnd('updater'); 13 echo $html->div(null, $session->read('Auth.User.username') .' '. __('writes', true)); 14 echo $ajax->div('charging',array('style'=>'display:none')).$html->image('static/loading.gif', array('alt'=>'Loading')).$ajax->divEnd('charging'); 11 15 12 16 echo $ajax->form(); 13 17 echo $form->hidden('Chat.vclassroom_id', array('value'=>$data['Vclassroom']['id'])); 14 18 echo $form->hidden('Chat.teacher_id', array('value'=>$blog['User']['id'])); 15 echo $form->hidden('Chat.sender_id', array('value'=>$session->read('Auth.User.username'))); 16 echo $form->input('Chat.message', array('size' => 60, 'maxlength'=>60, 'title'=>__('Message', true), 'between'=>': ')); 17 echo $ajax->submit(__('Send', true)), array("url" => "/vclassrooms/savemessage/", 18 "update"=>"updater", 19 echo $form->hidden('Chat.student_id', array('value'=>$session->read('Auth.User.id'))); 20 echo $form->input('Chat.message', array('size' => 60, 'maxlength'=>95, 'title'=>__('Message', true), 'between'=>':<br /> ', 'value'=>'')); 21 echo $ajax->submit(__('Send', true), array("url" => "/vclassrooms/savemessage/", 22 "update" => "updater", 23 "after" => "clean()", 19 24 "loading" => "Element.show('charging');Element.hide('updater')", 20 "complete" => "Element.hide('charging');Effect.Appear('updater')" 25 "complete"=> "Element.hide('charging');Effect.Appear('updater')") 21 26 ); 22 27 endif; 23 28 ?> 29 <script type="text/javascript"> 30 //<![CDATA[ 31 function clean() 32 { 33 var message = document.getElementById('ChatMessage'); 34 message.value = ''; 35 return true; 36 } 37 38 function ping() { 39 // Send ping, to let the server know I'm still here 40 var url = base_url + 'ping.php'; 41 var pars = creds(); 42 43 var ajax = new Ajax.Request(url, {method: 'post', parameters: pars, onComplete: handle_ping}); 44 45 Logger.info("Sent Ping: " + pars); 46 } 47 //]]> 48 </script> -
trunk/app/views/vclassrooms/show.ctp
r739 r753 19 19 $t="javascript:window.open('/vclassrooms/chat/".$blog['User']['id']."/".$data['Vclassroom']['id']."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=400')"; 20 20 echo $html->link( 21 $html->image('static/ icon_webquest.jpg', array('alt'=>'Chat','title'=>'Chat','style'=>'margin-right:12px')21 $html->image('static/feature_chatroom.jpg', array('alt'=>'Chatroom','title'=>'Chatroom','style'=>'margin-right:12px') 22 22 ), '#', array("onclick"=>$t), null, null, false); 23 23
