[Hw4mdl-svn] SF.net SVN: hw4mdl: [179] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
From: <hu...@us...> - 2007-01-11 15:25:58
|
Revision: 179 http://svn.sourceforge.net/hw4mdl/?rev=179&view=rev Author: hugues Date: 2007-01-11 07:25:54 -0800 (Thu, 11 Jan 2007) Log Message: ----------- http://u.horizonwimba.com/bugzilla/show_bug.cgi?id=10616 http://u.horizonwimba.com/bugzilla/show_bug.cgi?id=10547 - Added a function that handles the chat business logics - Update the fields to reflect the names in the javascript (it was reverted in a previous commit after I fixed it.) Modified Paths: -------------- trunk/moodle/mod/liveclassroom/generateSettings.php trunk/moodle/mod/liveclassroom/js/hwCommons.js trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/manageRoomAction.php Modified: trunk/moodle/mod/liveclassroom/generateSettings.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateSettings.php 2007-01-10 21:13:21 UTC (rev 178) +++ trunk/moodle/mod/liveclassroom/generateSettings.php 2007-01-11 15:25:54 UTC (rev 179) @@ -878,7 +878,7 @@ $linepart->append_child($align); $parameters=array("type" => "radio", "value" => "1", "id" => "privatechatenable", - "name" => "privateChatEnable") ; + "name" => "privateChatEnabled") ; if($action=='update'){ if($room_info['privatechatenable']==1) { $parameters['checked']=true; @@ -916,7 +916,7 @@ $align->append_child($xmldoc->create_text_node("")); $linepart->append_child($align); $parameters=array("type" => "radio", "value" => "0", - "id" => "privatedisabled", "name" => "privateChatEnable") ; + "id" => "privatedisabled", "name" => "privateChatEnabled") ; if($action=='update'){ if($room_info['privatechatenable']==0) { $parameters['checked']=true; Modified: trunk/moodle/mod/liveclassroom/js/hwCommons.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/hwCommons.js 2007-01-10 21:13:21 UTC (rev 178) +++ trunk/moodle/mod/liveclassroom/js/hwCommons.js 2007-01-11 15:25:54 UTC (rev 179) @@ -19,7 +19,6 @@ function doChangeChat() { var radio = document.forms[0].privateChatEnabled; - for (i=0; i<radio.length; i++) { radio[i].disabled = !document.forms[0].chatenable.checked; } Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2007-01-10 21:13:21 UTC (rev 178) +++ trunk/moodle/mod/liveclassroom/lib.php 2007-01-11 15:25:54 UTC (rev 179) @@ -326,6 +326,7 @@ //set media_type and media_format according to the appropriate values according to the media_type attribute $attributes = liveclassroom_check_media($attributes); + $attributes = liveclassroom_check_chat($attributes); //print_r($list_attributes); //Test if the type of room has been changed @@ -341,6 +342,7 @@ } unset($attributes['led']); unset($attributes['link']); + unset($attributes['roomId_Field']); //print_r($list_attributes); if(!liveclassroom_api_modify_room($_GET['id'],$attributes)) { @@ -378,6 +380,7 @@ //set media_type and media_format according to the appropriate values according to the media_type attribute $attributes = liveclassroom_check_media($attributes); + $attributes = liveclassroom_check_chat($attributes); if (! liveclassroom_api_create_class ($roomid, $roomname, $instructor_led, $attributes)) { @@ -399,8 +402,37 @@ return true; } +/** + * Business rules for text chat + * + */ +function liveclassroom_check_chat($attributes) { + if ($attributes['led']=='instructor') { + if (!isset($attributes['chatenable']) || $attributes['chatenable'] == 0) { + $attributes['chatenable'] = '0'; + $attributes['privatechatenable'] = '0'; + //unset($attributes['privateChatEnabled']); + + return $attributes; + } + + $attributes['privatechatenable'] = $attributes['privateChatEnabled']; + unset($attributes['privateChatEnabled']); + + return $attributes; + } + else { + $attributes['chatenable'] = '1'; + $attributes['privatechatenable'] = '1'; + unset($attributes['privateChatEnabled']); + return $attributes; + } +} + + + function liveclassroom_adjust_roles ($roomid, $enc_coursename, $instructor_led) { $teacherid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.LIVECLASSROOM_TEACHER_SUFFIX; Modified: trunk/moodle/mod/liveclassroom/manageRoomAction.php =================================================================== --- trunk/moodle/mod/liveclassroom/manageRoomAction.php 2007-01-10 21:13:21 UTC (rev 178) +++ trunk/moodle/mod/liveclassroom/manageRoomAction.php 2007-01-11 15:25:54 UTC (rev 179) @@ -64,7 +64,6 @@ if($_GET['action']=='createRoom') { if($list_attributes['led']=='instructor'){ $bool = true; - if (!isset($list_attributes['chatenable'])) $list_attributes['chatenable']="0"; if (!isset($list_attributes['student_wb_liveapp'])) $list_attributes['student_wb_liveapp']="0"; if (!isset($list_attributes['hms_two_way_enabled'])) $list_attributes['hms_two_way_enabled']="0"; if (!isset($list_attributes['hms_simulcast_restricted'])) $list_attributes['hms_simulcast_restricted']=1; @@ -90,7 +89,6 @@ $instructor_led = ($list_attributes['led']=='instructor'); if($instructor_led){ - if (!isset($list_attributes['chatenable'])) $list_attributes['chatenable']="0"; if (!isset($list_attributes['student_wb_liveapp'])) $list_attributes['student_wb_liveapp']="0"; if (!isset($list_attributes['hms_two_way_enabled'])) $list_attributes['hms_two_way_enabled']="0"; if (!isset($list_attributes['hms_simulcast_restricted'])) $list_attributes['hms_simulcast_restricted']=1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |