[Hw4mdl-svn] SF.net SVN: hw4mdl: [91] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
From: <sh...@us...> - 2006-10-20 13:53:30
|
Revision: 91 http://svn.sourceforge.net/hw4mdl/?rev=91&view=rev Author: shazan Date: 2006-10-20 06:51:51 -0700 (Fri, 20 Oct 2006) Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/config.html trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/manageRoom.php trunk/moodle/mod/liveclassroom/welcome.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/manageRoomAction.php trunk/moodle/mod/liveclassroom/pictures/ trunk/moodle/mod/liveclassroom/pictures/buttons/ trunk/moodle/mod/liveclassroom/pictures/buttons/angel.gif trunk/moodle/mod/liveclassroom/pictures/buttons/general-cancel.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-create.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty-over.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-saveall.png trunk/moodle/mod/liveclassroom/pictures/buttons/headerbar-logo.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-available.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-hide.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-show.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-unavailable.png trunk/moodle/mod/liveclassroom/pictures/buttons/new-createroom.png trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoiceboard.png trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoicepresentation.png trunk/moodle/mod/liveclassroom/pictures/buttons/searchfield.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab_disabled.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab_over.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab_select.gif trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-new.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newroom-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings.png trunk/moodle/mod/liveclassroom/pictures/items/ trunk/moodle/mod/liveclassroom/pictures/items/category-collapsed.png trunk/moodle/mod/liveclassroom/pictures/items/category-expanded.png trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-left.png trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-middle.png trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-left.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-middle.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png trunk/moodle/mod/liveclassroom/pictures/items/filterbar-separator.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-logo.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-left.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-middle.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-right.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-subitem.png trunk/moodle/mod/liveclassroom/pictures/items/space-16px.png trunk/moodle/mod/liveclassroom/pictures/items/space-16x16px.png trunk/moodle/mod/liveclassroom/pictures/items/space-18px.png trunk/moodle/mod/liveclassroom/pictures/items/space-24px.png trunk/moodle/mod/liveclassroom/pictures/items/space-32px.png trunk/moodle/mod/liveclassroom/pictures/items/space-44px.png trunk/moodle/mod/liveclassroom/pictures/items/toolbar-separator.png trunk/moodle/mod/liveclassroom/pictures/items/x_normal.gif trunk/moodle/mod/liveclassroom/pictures/items/x_normal.png trunk/moodle/mod/liveclassroom/pictures/items/x_over.gif trunk/moodle/mod/liveclassroom/pictures/items/x_over.png Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/api.php 2006-10-20 13:51:51 UTC (rev 91) @@ -99,12 +99,15 @@ "&AuthName=Horizon". "&credential_0=". $login. "&credential_1=". $passwd; + + add_to_log("", "liveclassroom", "", "", "auth ".time()); + - //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); - $cookie_file_path = $CFG->dirroot.'/mod/liveclassroom/tmp/cookie.txt'; // Cookie File path + $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); @@ -112,9 +115,10 @@ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); + // curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); - + $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date if (curl_errno($ch)) { print curl_error($ch); return false; @@ -127,6 +131,8 @@ return false; } + curl_close($ch); + fclose($cook); return $ch; } @@ -140,28 +146,39 @@ * return $data : result query */ function liveclassroom_api_send_query($const,$attribute) { - global $CFG; + global $CFG; global $LIVECLASSROOM_API_ADMIN; - $cookie_file_path = $CFG->dirroot.'/mod/liveclassroom/tmp/cookie.txt'; //Cookie File path + $cook = fopen($CFG->dataroot.'/tmp.txt',"a+"); //Open the temp file to check the last modification date + $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path - $currentTime = time(); - - if( (!file_exists($cookie_file_path)) || ($currentTime > (time(filemtime($cookie_file_path))+1800)) ){ - if (!$ch = liveclassroom_api_authenticate()) { - return false; - } - } + if(file_exists($cook)) { + $lastModifTime = filemtime($cook); + add_to_log("", "liveclassroom", "", "", "last modif time ".$lastModifTime); + } + else { + $lastModifTime = time(); + } + //1800 seconds = 30 minutes + $modif = $lastModifTime+1800; + + + if( (!file_exists($cookie_file_path)) || ((file_exists($cook)) && (time()>$modif)) ){ + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + } $url = $CFG->liveclassroom_servername. $LIVECLASSROOM_API_ADMIN. $const. - $attribute; + $attribute; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); @@ -574,7 +591,7 @@ if ( $respcode != 100) { return false; } - //modify in the moodle database! + return true; Modified: trunk/moodle/mod/liveclassroom/config.html =================================================================== --- trunk/moodle/mod/liveclassroom/config.html 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/config.html 2006-10-20 13:51:51 UTC (rev 91) @@ -38,15 +38,7 @@ <?php print_string("configadminpassword", "liveclassroom") ?> </td> </tr> -<tr valign="top"> - <td align="right"><?php print_string('settinguniqueid', 'liveclassroom')?>:</td> - <td> - <input name="settinguniqueid" type="text" size="20" value="<?php p($CFG->liveclassroom_settinguniqueid) ?>" /> - </td> - <td> - <?php print_string("configsettinguniqueid", "liveclassroom") ?> - </td> -</tr> + <tr> <td colspan="3" align="center"> <input type="submit" value="<?php print_string("savechanges") ?>" /></td> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-20 13:51:51 UTC (rev 91) @@ -264,18 +264,14 @@ $LIVECLASSROOM_STUDENT_SUFFIX; global $LIVECLASSROOM_MOODLE_PREFIX; - //Change for PREFIX + $course_name = liveclassroom_get_course_shortname($courseid); $roomid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.'_'.rand(); $teacherid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.$LIVECLASSROOM_TEACHER_SUFFIX; $studentid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.$LIVECLASSROOM_STUDENT_SUFFIX; - /* - if (! liveclassroom_api_remove_group_role ($roomid, 'RegisteredUser', 'Student')) { - //error('liveclassroom_create_room: Cannot remove Participant right to RegisteredUser'); - return false; - }*/ + if($bool==true) { // main lecture hall @@ -316,14 +312,7 @@ return false; } } - /* - //save this room in moodle database - $liveclassroom_rooms->course = $courseid; - $liveclassroom_rooms->name = $roomname; - $liveclassroom_rooms->room_id = $roomid; - liveclassroom_rooms_add_instance($liveclassroom_rooms); - */ return true; } Modified: trunk/moodle/mod/liveclassroom/manageRoom.php =================================================================== --- trunk/moodle/mod/liveclassroom/manageRoom.php 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/manageRoom.php 2006-10-20 13:51:51 UTC (rev 91) @@ -35,15 +35,27 @@ global $CFG; - + //require_login($course->id); //$v = $_GET["v"]; $courseshortname = $_GET['courseshortname']; - //$id = $_GET['id']; $roomId = $_GET['roomId']; $action = $_GET['action']; $id = $_GET['id']; + + if (!isteacher($id)){ //not allowed + + } + + session_start(); + $room_info = liveclassroom_api_get_infos_room($roomId); + + + + // add_to_log("", "liveclassroom", "", "liveclassroom_api_modify_room", "debut ".time()); + // liveclassroom_api_modify_room($roomId,$room_info); + //add_to_log("", "liveclassroom", "", "liveclassroom_api_modify_room", "fin ".time()); ?> <head> @@ -157,21 +169,21 @@ document.getElementById('advanceopen'+hide).style.display="none"; if(show=="student"){ - document.getElementById('tab2').style.backgroundImage="url(pictures/tab_disabled.gif)"; + document.getElementById('tab2').style.backgroundImage="url(pictures/buttons/tab_disabled.gif)"; document.getElementById('tab2').onclick=new Function(); document.getElementById('tab2').onmouseover=new Function(); document.getElementById('tab2').onmouseout=new Function(); - document.getElementById('tab4').style.backgroundImage="url(pictures/tab_disabled.gif)"; + document.getElementById('tab4').style.backgroundImage="url(pictures/buttons/tab_disabled.gif)"; document.getElementById('tab4').onclick=new Function(); document.getElementById('tab4').onmouseover=new Function(); document.getElementById('tab4').onmouseout=new Function(); } else{ - document.getElementById('tab2').style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab2').style.backgroundImage="url(pictures/buttons/tab.gif)"; document.getElementById('tab2').onclick=new Function("onTab(2)"); document.getElementById('tab2').onmouseover=new Function("onOver(2)"); document.getElementById('tab2').onmouseout=new Function("onOut(2)"); - document.getElementById('tab4').style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab4').style.backgroundImage="url(pictures/buttons/tab.gif)"; document.getElementById('tab4').onclick=new Function("onTab(4)"); document.getElementById('tab4').onmouseover=new Function("onOver(4)"); document.getElementById('tab4').onmouseout=new Function("onOut(4)"); @@ -194,9 +206,9 @@ function onTab(id) { - document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab_Select.gif)"; + document.getElementById('tab'+id).style.backgroundImage="url(pictures/buttons/tab_Select.gif)"; document.getElementById('tab'+currenttab).style.borderBottom="#818181 1px solid"; - document.getElementById('tab'+currenttab).style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab'+currenttab).style.backgroundImage="url(pictures/buttons/tab.gif)"; document.getElementById('tab'+id).style.borderBottom="none"; document.getElementById('span'+currenttab).style.display="none"; document.getElementById('span'+id).style.display="block"; @@ -206,13 +218,13 @@ function onOver(id) { if(currenttab!=id) - document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab_over.gif)"; + document.getElementById('tab'+id).style.backgroundImage="url(pictures/buttons/tab_over.gif)"; } function onOut(id) { if(currenttab!=id) - document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab'+id).style.backgroundImage="url(pictures/buttons/tab.gif)"; } @@ -223,26 +235,9 @@ <body> -<form method="post" action="" name="entry_info_form" > +<form method="post" action="manageRoomAction.php" name="entry_info_form" > - - <input type="hidden" value='<?php echo $roomId ?>' name="roomId" /> - - <input type="hidden" value="<%=session.getTimeOfLoad() %>" name="time" /> - - - <? - if ($action == "editRoom") - {?> - <input type="hidden" value="updateRoom" name="action" /> - <? - } - else - { ?> - <input type="hidden" value="createRoom" name="action" /> - <? - } ?> - + <table cellspacing="0" cellpadding="0" width="100%" border=0 align="center" id="TABLE1" style="border-right: #818181 1px solid; border-top: #818181 1px solid; border-left: #818181 1px solid; border-bottom: #818181 1px solid"> <tr> @@ -250,7 +245,7 @@ <span style="position: relative; display: block;" > <table border="0" cellpadding="0" cellspacing="0" width=100%> <tr> - <td><img src="pictures/angel.gif" /></td> + <td><img src="pictures/buttons/angel.gif" /></td> <td colspan="3" align="center" valign="middle"> </td> @@ -271,26 +266,27 @@ <tr style="cursor:pointer"> <td width="5px" style="border-bottom: #818181 1px solid; height: 18px;"> </td> - <td onclick='onTab(1)' onmouseover='onOver(1)' onmouseout='onOut(1)' id="tab1" style="background-image: url(pictures/tab_Select.gif); + <td onclick='onTab(1)' onmouseover='onOver(1)' onmouseout='onOut(1)' id="tab1" style="background-image: url(pictures/buttons/tab_Select.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; height: 18px;" align="center"> Room Info</td> - <? if(!liveclassroom_api_room_is_archive($roomId) || ($roomId == "")) + <?php + if(($room_info['archive']!=1) || ($roomId == "")) {?> - <td onclick='onTab(2)' onmouseover='onOver(2)' onmouseout='onOut(2)' id="tab2" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <td onclick='onTab(2)' onmouseover='onOver(2)' onmouseout='onOut(2)' id="tab2" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Media</td> - <td onclick='onTab(3)' onmouseover='onOver(3)' onmouseout='onOut(3)' id="tab3" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <td onclick='onTab(3)' onmouseover='onOver(3)' onmouseout='onOut(3)' id="tab3" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Features</td> - <td onclick='onTab(4)' onmouseover='onOver(4)' onmouseout='onOut(4)'id="tab4" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <td onclick='onTab(4)' onmouseover='onOver(4)' onmouseout='onOut(4)'id="tab4" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Chat</td> - <?} ?> - <td onclick='onTab(5)' onmouseover='onOver(5)' onmouseout='onOut(5)' id="tab5" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <?php } ?> + <td onclick='onTab(5)' onmouseover='onOver(5)' onmouseout='onOut(5)' id="tab5" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Access</td> @@ -315,25 +311,28 @@ <td> <span class="alert">*</span> Title :</td> <td > - <input type="text" name="longname" value="<?php if($action=='editRoom') p(liveclassroom_api_get_room_name($roomId))?>" maxlength="50" style="width: 300px" /></td> + <input type="text" name="longname" value="<?php if($action=='editRoom') { p($room_info['longname']); $_SESSION['longname']=$room_info['longname'];}?>" maxlength="50" style="width: 300px" /></td> </tr> <tr> <td>Description :</td> <td> <textarea rows="4" cols="40" name="description"> - <?php if($action=='editRoom'){echo liveclassroom_api_get_room_description($roomId);}?> + <?php if($action=='editRoom'){p($room_info['description']);}?> </textarea> </td> </tr> - <? if (($roomId == "") || (liveclassroom_api_room_is_archive($roomId))==false) - { ?> + <?php + if(($room_info['archive']!=1) || ($roomId == "")) + {?> <tr> <td>Type :</td> <td> <input type="radio" name="led" value="instructor" id="led_instructor" <?php if(($action=="editRoom") && (liveclassroom_is_lecturehall($roomId,$courseshortname)==true)) - { echo "checked"; } - else{ echo "checked"; } + { $_SESSION['led']='instructor'; + echo "checked"; } + else{ + echo "checked"; } ?> onclick='javascript:toggleType();' /> <label for='led_instructor' > @@ -342,7 +341,7 @@ Instructors lead the presentation </label><br /> <input type="radio" name="led" value="student" id="led_student" onclick='javascript:toggleType();' <?php - if($action=="editRoom" && liveclassroom_is_breakout($roomId,$courseshortname)==true){ echo "checked"; } + if($action=="editRoom" && liveclassroom_is_breakout($roomId,$courseshortname)==true){ $_SESSION['led']='student'; echo "checked"; } ?> /> <label for='led_student' > @@ -351,7 +350,7 @@ Students and Instructors have the same rights </label> </td> </tr> - <?} ?> + <?php } ?> </table> </span> @@ -359,7 +358,7 @@ <table cellspacing="0" cellpadding="3" align="center" border="0" class="tab"> <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="audio" value="two-way-audio" onclick="doChangeMedia('audio');" + <input type="radio" name="media_type" id="audio" value="two-way-audio" onclick="doChangeMedia('audio');" <?php if($action=='editRoom') { if($room_info['media_type']=="two-way-audio"){ echo "checked";} } @@ -371,7 +370,7 @@ <tr> <td width=15px></td> <td> - <input type="checkbox" name="hmsSimulcastStudent" value="true" id="student_simulcast" + <input type="checkbox" name="hms_simulcast_restricted" value="1" id="student_simulcast" <?php if($action=='editRoom'){ if($room_info['hms_simulcast_restricted']==1){ @@ -392,7 +391,7 @@ <tr> <td width=15px></td> <td> - <input type="checkbox" name="hmsTwoWayEnabled" value="true" id='two_way_enabled' + <input type="checkbox" name="hms_two_way_enabled" value="1" id='two_way_enabled' <?php if($action=='editRoom'){ if($room_info['hms_two_way_enabled']==1){ @@ -411,7 +410,7 @@ <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="video" value='one-way-video' + <input type="radio" name="media_type" id="video" value='one-way-video' <?php if($action=='editRoom'){ if($room_info['media_type']=="one-way-video"){ echo " checked ";} @@ -445,7 +444,7 @@ <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="none" value="none" onclick="doChangeMedia('none');" + <input type="radio" name="media_type" id="none" value="none" onclick="doChangeMedia('none');" <?php if($action=='editRoom') { if($room_info['media_type']=="none") echo "checked"; @@ -466,10 +465,10 @@ <tr> <td> - <input type="checkbox" name="studentEboardEnabled" value="true" id="enable_eboard" + <input type="checkbox" name="student_wb_enabled" value="1" id="enable_eboard" <?php if($action=='editRoom'){ - if($room_info['student-wb-enabled']==1) echo "checked"; + if($room_info['student_wb_enabled']==1) echo "checked"; } ?>/> <label for="enable_eboard"> @@ -483,10 +482,10 @@ <tr> <td> - <input type="checkbox" name="studentLiveappEnabled" value="true" id="enable_liveapp" + <input type="checkbox" name="student_wb_liveapp" value="1" id="enable_liveapp" <?php if($action=='editRoom'){ - if($room_info['student-wb-liveapp']==1) echo "checked"; + if($room_info['student_wb_liveapp']==1) echo "checked"; } ?>/> <label for="enable_liveapp"> @@ -501,7 +500,7 @@ <tr> <td> - <input type="checkbox" name="archiveEnabled" value="true" id="enable_archive" + <input type="checkbox" name="can_archive" value="1" id="enable_archive" <?php if($action=='editRoom'){ if($room_info['can_archive']==1) echo "checked"; @@ -515,7 +514,7 @@ <tr> <td> - <input type="checkbox" name="appshareEnabled" value="true" id="enable_appshare" + <input type="checkbox" name="can_liveshare" value="1" id="enable_appshare" <?php if($action=='editRoom'){ if($room_info['can_liveshare']==1) echo "checked"; @@ -529,7 +528,7 @@ <tr> <td> - <input type="checkbox" name="pptEnabled" value="true" id="enable_ppt" + <input type="checkbox" name="can_ppt_import" value="1" id="enable_ppt" <?php if($action=='editRoom'){ if($room_info['can_ppt_import']==1) echo "checked"; @@ -549,7 +548,7 @@ <table cellspacing="0" cellpadding="3" align="center" border="0" class="tab"> <tr> <td colspan="2"> - <input type="checkbox" name="chatEnabled" value="true" id="chat_enable" + <input type="checkbox" name="chatenable" value="1" id="chat_enable" <?php if($action=='editRoom'){ if($room_info['chatenable']==1) echo "checked"; @@ -563,7 +562,7 @@ <tr> <td width="20"> </td> <td> - <input type="radio" name="privateChatEnabled" value="true" id="privateenabled" + <input type="radio" name="privatechatenable" value="1" id="privateenabled" <?php if($action=='editRoom'){ if($room_info['privatechatenable']==1) echo "checked"; @@ -577,7 +576,7 @@ <tr> <td width="20"> </td> <td> - <input type="radio" name="privateChatEnabled" value="false" id="privatedisabled" + <input type="radio" name="privatechatenable" value="0" id="privatedisabled" <?php if($action=='editRoom'){ if($room_info['privatechatenable']==0) echo "checked"; @@ -602,7 +601,7 @@ <tr> <td > - <input type="radio" name="userlimit" value="false" id="userlimit_false" onclick="toggleUserlimit(false);" + <input type="radio" name="userlimit" value="-1" id="userlimit_false" onclick="toggleUserlimit(false);" <?php if($action=='editRoom'){ if($room_info['userlimit']==-1) echo " checked "; @@ -614,15 +613,15 @@ </tr> <tr> <td > - <input type="radio" name="userlimit" value="true" id="userlimit_true" onclick='toggleUserlimit(true);' + <input type="radio" name="userlimitradio" value="true" id="userlimit_true" onclick='toggleUserlimit(true);' <?php if($action=='editRoom'){ - if($room_info['userlimit']=-1) echo "checked"; + if($room_info['userlimit']!=-1) echo "checked"; } ?>/> <label for="userlimit_true"> Limited:</label> - <input type="text" name="userlimitValue" value=' + <input type="text" name="userlimit" value=' <?php if(($action=='editRoom')&&($room_info['userlimit']!=-1)){ echo $room_info['userlimit']; @@ -683,18 +682,18 @@ <span class="alert">*</span>Required fields.</td> <td class=action align=center width=15%> - <input type="reset" value="<?php print_string("cancel") ?>" onclick="self.location.href='welcome.php?id=<?php p($id) ?>'"> - + <a href="welcome.php?id=<?php p($id) ?>" ><img src="pictures/buttons/general-cancel.png"></a> + </td> <td height="25px" class=action align=center width=15%> <?php if($action=='editRoom') { ?> - <a href="javascript:verifyFormUpdate()" >Update</a> + <a href="javascript:verifyFormUpdate()" ><img src="pictures/buttons/general-saveall.png"></a> <?php }else {?> - <a href="javascript:verifyForm()" >Save All</a> + <a href="javascript:verifyForm()" ><img src="pictures/buttons/general-create.png"></a> <?php } ?> </tr> @@ -703,5 +702,22 @@ </tr> </table> + + + <input type="hidden" value='<?php p($roomId) ?>' name="roomId" /> + + <input type="hidden" value='<?php p($id) ?>' name="courseid" /> + + <?php if($action=='editRoom') + { + ?> + <input type="hidden" value="updateRoom" name="action" /> + <?php + }else if($action=='createRoom') + { ?> + <input type="hidden" value="createRoom" name="action" /> + <?php } ?> + + </form> </body><script> toggleType()</script> \ No newline at end of file Added: trunk/moodle/mod/liveclassroom/manageRoomAction.php =================================================================== --- trunk/moodle/mod/liveclassroom/manageRoomAction.php (rev 0) +++ trunk/moodle/mod/liveclassroom/manageRoomAction.php 2006-10-20 13:51:51 UTC (rev 91) @@ -0,0 +1,99 @@ +<?php +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Samy Hazan * + * * + * Date: September 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + + + require_once('../../config.php'); + require_once('lib.php'); + + require_login($_POST['courseid'], false); + + if (isguest()) { + error("Guests are not allowed to create rooms", $_SERVER["HTTP_REFERER"]); + } + + if (isstudent($_POST['courseid'])) { + error("Students are not allowed to create rooms", $_SERVER["HTTP_REFERER"]); + } + + session_start(); + + while (list($key, $val) = each($_POST)) { + $list_attributes[$key] = $val; + } + //course id + $id = $_SESSION['id']; + + if(isteacher($_POST['courseid'])) { + + if($_POST['action']=='createRoom') { + if($list_attributes['led']=='instructor'){ + $bool = true; + } + else $bool = false; + + if (!liveclassroom_create_room ($id, $list_attributes['longname'], $bool)) { + notice(get_string("roomcreationfailed", "liveclassroom"), $_SERVER["HTTP_REFERER"]); + exit; + } + + } + else if($_POST['action']=='updateRoom') { + //Test if the type of room has changed + if($_SESSION['led']!=$list_attributes['led']) { // Type changed + add_to_log("", "liveclassroom", "", "", "change type ".time()); + if($list_attributes['led']=='instructor'){ + liveclassroom_api_remove_user_role ($_POST['roomId'], $_SESSION['studentid'] , 'Instructor') ; + liveclassroom_api_add_user_role ($_POST['roomId'], $_SESSION['studentid'], 'Student'); + } + else { + liveclassroom_api_remove_user_role ($_POST['roomId'], $_SESSION['studentid'] , 'Student') ; + liveclassroom_api_add_user_role ($_POST['roomId'], $_SESSION['studentid'], 'Instructor'); + } + } + + liveclassroom_api_modify_room($_POST['roomId'],$list_attributes); + /* + if($_SESSION['longname']!=$list_attributes['longname']) { //update in the moodle database + $liveclassroom_rooms->room_id = $_POST['roomId']; + $liveclassroom_rooms->course = $id; + $liveclassroom_rooms->name = $list_attributes['longname']; + + liveclassroom_rooms_update_instance($liveclassroom_rooms); + } + + */ + } + + redirect("welcome.php?id=$id"); + } + + + +?> \ No newline at end of file Property changes on: trunk/moodle/mod/liveclassroom/manageRoomAction.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Added: trunk/moodle/mod/liveclassroom/pictures/buttons/angel.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/angel.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-cancel.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-create.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-create.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty-over.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty-over.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-saveall.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-saveall.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/headerbar-logo.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/headerbar-logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-available.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-available.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-hide.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-hide.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-show.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-show.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-unavailable.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-unavailable.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createroom.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createroom.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoiceboard.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoiceboard.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoicepresentation.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoicepresentation.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/searchfield.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/searchfield.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_disabled.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_disabled.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_over.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_over.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_select.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_select.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-new.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-new.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newroom-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newroom-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/category-collapsed.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/category-collapsed.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/category-expanded.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/category-expanded.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-left.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-left.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-middle.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-middle.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-left.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-left.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-middle.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-middle.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filterbar-separator.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filterbar-separator.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-logo.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-left.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-left.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-middle.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-middle.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-right.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-right.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/listitem-subitem.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/listitem-subitem.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-16px.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/space-16px.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-16x16px.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/space-16x16px.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-18px.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/space-18px.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-24px.png ===... [truncated message content] |