[Hw4mdl-svn] SF.net SVN: hw4mdl: [68] trunk/moodle/mod/liveclassroom/api.php
Brought to you by:
jhlinder,
trollinger
From: <sh...@us...> - 2006-09-19 09:50:24
|
Revision: 68 http://svn.sourceforge.net/hw4mdl/?rev=68&view=rev Author: shazan Date: 2006-09-19 02:50:18 -0700 (Tue, 19 Sep 2006) Log Message: ----------- api function Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-19 09:49:00 UTC (rev 67) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-19 09:50:18 UTC (rev 68) @@ -868,11 +868,13 @@ } + + + /* Check if the room is open or not (preview=0 => room is open) * @param $roomid : the id of the room * return a boolean : true if the room is open, false if it's closed -*/ - +*/ function liveclassroom_api_room_is_preview ($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -909,6 +911,38 @@ global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; global $LIVECLASSROOM_API_RECORD_SEPERATOR; + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=archive&filter01=class_id&filter01value=$roomid"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + + $tok = split("100 OK",$data); + $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); + + $test = strstr($tok1[0],"archive="); + + //$tok2 = split("class_id=",$tok1[0]); + $result = liveclassroom_parse_line($test,"archive="); + //Remove le " " at the end of the line + $response = substr($result,0,-1); + + if($response==1) { + return true; + } + else return false; + +} +/* +function liveclassroom_api_room_is_archive ($roomid){ + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&filter00=class_id&filter00value=$roomid&filter01=archive&filter01value=1"); preg_match("(\d*)", $data, $matches); @@ -927,7 +961,7 @@ else { return false; } -} +}*/ /* * List all the orphaned archive on the server @@ -1159,6 +1193,11 @@ } +/* +* To know if a room enable private chat +* @param $roomid : the id of the room +* return a boolean : true is private chat is enabled, false if not +*/ function liveclassroom_api_is_private_chat_enabled($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -1191,6 +1230,11 @@ } +/* +* To know if a room enable powerpoint import +* @param $roomid : the id of the room +* return a boolean : true is powerpoint import is enabled, false if not +*/ function liveclassroom_api_is_ppt_import_enabled($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -1223,6 +1267,11 @@ } +/* +* To know if a room enable Application Sharing +* @param $roomid : the id of the room +* return a boolean : true is Application Sharing is enabled, false if not +*/ function liveclassroom_api_is_liveshare_enabled($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -1255,6 +1304,11 @@ } +/* +* To know if a room enable archive +* @param $roomid : the id of the room +* return a boolean : true is archive is enabled, false if not +*/ function liveclassroom_api_is_archive_enabled($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -1287,6 +1341,11 @@ } +/* +* To know if a room allow students to use the liveApp plugin tool on the whiteboard +* @param $roomid : the id of the room +* return a boolean : true is students can use theliveApp plugin tool, false if not +*/ function liveclassroom_api_is_student_liveApp_enabled($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -1319,6 +1378,11 @@ } +/* +* To know if a room enable all students to use the whiteboard tools +* @param $roomid : the id of the room +* return a boolean : true is students can use the whiteboard tools, false if not +*/ function liveclassroom_api_is_student_whiteBoard_enabled($roomid){ global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -1350,6 +1414,40 @@ else return false; } + +/* +* Give the information about a room given +* @param $roomid : the id of the room +* return a table with the key as the name of the attribute +* and the value as the value of the attribute +*/ +function liveclassroom_api_get_infos_room($roomid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&filter00=class_id&filter00value=$roomid&attribute=archive&attribute=can_archive&attribute=can_eboard&attribute=can_liveshare&attribute=can_ppt_import&attribute=chatenable&attribute=privatechatenable&attribute=description&attribute=hms_simulcast&attribute=hms_simulcast_restricted&attribute=hms_two_way_enabled&attribute=media_type&attribute=preview&attribute=student_wb_enabled&attribute=student_wb_liveapp&attribute=userlimit&attribute=longname"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + $tok = split("100 OK",$data); + $line = explode("\n",$tok[1]); + + for($i=0;$i<sizeof($line);$i++) { + $result = explode("=",$line[$i]); + + $room_table[$result[0]]=$result[1]; + } + + return $room_table; +} + + /** * Enroll the given user into the group. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |