[Hw4mdl-svn] SF.net SVN: hw4mdl: [62] trunk/moodle/mod/liveclassroom/api.php
Brought to you by:
jhlinder,
trollinger
From: <sh...@us...> - 2006-09-13 14:09:03
|
Revision: 62 http://svn.sourceforge.net/hw4mdl/?rev=62&view=rev Author: shazan Date: 2006-09-13 07:08:54 -0700 (Wed, 13 Sep 2006) Log Message: ----------- function get archive list for a room is ok Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-13 12:29:20 UTC (rev 61) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-13 14:08:54 UTC (rev 62) @@ -686,12 +686,12 @@ * * NEED TO BE TESTED !!! */ -function liveclassroom_api_get_archive_list() { +function liveclassroom_api_get_archive_list($course) { global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute&filter01=archive&filter01value=1"); + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=class_id&filter01=archive&filter01value=1"); preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -712,6 +712,47 @@ } /* +* List all the archive room associated with the room given +* +* @param $roomid : the id of the room +* return a table with all the archive room id +*/ +function liveclassroom_api_get_archive_list_for_a_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, "&attribute=class_id&filter01=archive&filter01value=1"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + //print $data; + $tok = split("100 OK",$data); + $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); + + $j=0; + + for($i=0;$i<sizeof($tok1);$i++) { + $test = strstr($tok1[$i],$roomid); + if($test!=false){ + // print "yrr"; + // $result = liveclassroom_parse_line($tok1[$i],"class_id="); + //Remove le " " at the end of the line + $response = substr($test,0,-1); + $list_return[$j]=$response; + $j++; + } + + } + return $list_return; +} + +/* * Check if a user exist in the course given * link : user last name = course shortname * @param $course : an instance of a course @@ -923,6 +964,9 @@ function liveclassroom_api_get_orphaned_archive_list() { + + + $tab_archive = liveclassroom_api_get_archive_list() ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |