hw4mdl-svn Mailing List for Wimba Moodle Integration (Page 8)
Brought to you by:
jhlinder,
trollinger
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(7) |
Jun
|
Jul
(3) |
Aug
(13) |
Sep
(20) |
Oct
(20) |
Nov
(9) |
Dec
(49) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(34) |
Feb
|
Mar
|
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
(39) |
Feb
(14) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(3) |
Nov
(4) |
Dec
|
|
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] |
|
From: <sh...@us...> - 2006-10-16 13:02:57
|
Revision: 90
http://svn.sourceforge.net/hw4mdl/?rev=90&view=rev
Author: shazan
Date: 2006-10-16 06:02:41 -0700 (Mon, 16 Oct 2006)
Log Message:
-----------
Added Paths:
-----------
trunk/moodle/lang/en_utf8/
trunk/moodle/lang/en_utf8/block_next_liveclassroom.php
Removed Paths:
-------------
trunk/moodle/lang/en/
Copied: trunk/moodle/lang/en_utf8 (from rev 89, trunk/moodle/lang/en)
Added: trunk/moodle/lang/en_utf8/block_next_liveclassroom.php
===================================================================
--- trunk/moodle/lang/en_utf8/block_next_liveclassroom.php (rev 0)
+++ trunk/moodle/lang/en_utf8/block_next_liveclassroom.php 2006-10-16 13:02:41 UTC (rev 90)
@@ -0,0 +1,8 @@
+<?php // $Id$
+
+$string['blocktitle'] = 'Next Live Classroom';
+$string['globalnumbers'] = 'Number of Next Live Classroom display in the global section :';
+$string['coursenumbers'] = 'Number of Next Live Classroom display for each course :';
+$string['jumptocurrentweek'] = 'Jump to current week';
+$string['weeks'] = 'Weeks';
+?>
Property changes on: trunk/moodle/lang/en_utf8/block_next_liveclassroom.php
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-16 12:51:25
|
Revision: 89
http://svn.sourceforge.net/hw4mdl/?rev=89&view=rev
Author: shazan
Date: 2006-10-16 05:51:06 -0700 (Mon, 16 Oct 2006)
Log Message:
-----------
add liveclassroom block
Added Paths:
-----------
trunk/moodle/blocks/
trunk/moodle/blocks/next_liveclassroom/
trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php
trunk/moodle/blocks/next_liveclassroom/config_global.html
Added: trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php
===================================================================
--- trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php (rev 0)
+++ trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php 2006-10-16 12:51:06 UTC (rev 89)
@@ -0,0 +1,151 @@
+<?PHP
+
+require_once($CFG->libdir.'/datalib.php');
+
+class block_next_liveclassroom extends block_base {
+
+ function init() {
+ $this->title = get_string('blocktitle', 'block_next_liveclassroom');
+ $this->version = 2004111200;
+ }
+
+ function applicable_formats() {
+ return array('site' => true, 'course-view' => true, 'course-view-social' => false, 'course-view-topics' => true, 'course-view-weeks' => true);
+ }
+
+ function get_content() {
+
+ global $CFG, $USER, $COURSE;
+ if ($this->content !== NULL) {
+ return $this->content;
+ }
+
+ //guest and not logged user can't have access to the liveclassroom block
+ if(isguest() || !isloggedin()){
+ die;
+ }
+
+ $this->content = new stdClass;
+
+ $this->content->text = '';
+ $this->content->footer = '';
+ //$gnumber =5;
+ //$cnumber= 3;
+ $gnumber = $CFG->block_next_liveclassroom_globalnumber;
+ $cnumber = $CFG->block_next_liveclassroom_coursenumber;
+
+
+
+ //liveclassroom module
+ if(!$lc = get_record("modules", "name", "liveclassroom")) {
+ error("module liveclassroom not exist");
+ }
+
+ if (($COURSE->format == 'site')) { // Global block : displays the 5 next Live Classroom through any course the user is enrolled in (or a teacher for)
+
+ //table with the course module id
+ $result = array();
+ //table with the activities id
+ $result1 = array();
+ $full = false;
+
+ $allcourses = get_my_courses($USER->id);
+
+ $sectionnumber = 1;
+
+ while($full!=true && $sectionnumber<=10){
+
+ foreach($allcourses as $cours) {
+ $sections[$cours->id] = get_record("course_sections", "course", "$cours->id", "section", $sectionnumber);
+
+ }
+ foreach($sections as $section){
+
+ if ($full==true) {break;}
+ else{
+ if(($section->section!=0) && ($section->sequence!=null)){
+ $lines = explode(",",$section->sequence);
+ foreach($lines as $line) {
+ // print $line;
+ $cm = get_record("course_modules", "id", "$line");
+ if($cm->module==$lc->id) {
+ if(sizeof($result1)==$gnumber) {
+ $full=true;
+ break;
+ }
+ else{
+ array_push($result,$line);
+ $liveclassroom = get_record("liveclassroom", "id", "$cm->instance");
+ array_push($result1,$liveclassroom->name);
+ }
+ }
+ }
+ }
+ }
+ }
+ $sectionnumber++;
+ }
+
+
+
+ }
+ else{ // Course Block display the 3 next Live Classroom
+ //table with the course module id
+ $result = array();
+ //table with the activities id
+ $result1 = array();
+ $full = false;
+ //all section in course
+ $sections = get_records_sql("SELECT *
+ FROM {$CFG->prefix}course_sections cs
+ WHERE cs.course = '$COURSE->id'
+ ORDER BY cs.section asc");
+
+ foreach($sections as $section){
+ if ($full==true) break;
+ else{
+ if(($section->section!=0) && ($section->sequence!=null)){
+ $lines = explode(",",$section->sequence);
+ foreach($lines as $line) {
+ //Look just the liveclasssroom instance
+ $cm = get_record("course_modules", "id", "$line");
+ if($cm->module==$lc->id) {
+ if(sizeof($result1)==$cnumber){
+ $full=true;
+ }
+ else {
+ array_push($result,$line);
+ $liveclassroom = get_record("liveclassroom", "id", "$cm->instance");
+ array_push($result1,$liveclassroom->name);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ $this->content->text .= '<table width="100%">';
+ //Display the list
+ for($r=0;$r<sizeof($result);$r++) {
+ // $this->content->text .= '<div style="text-align: left; font-size: 1; padding-top: 5px;">';
+ $this->content->text .= '<tr><td>';
+ $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/liveclassroom/view.php?id='.$result[$r].'" >'.$result1[$r].'</a>';
+ $this->content->text .= '</tr> </td>';
+ // $this->content->text .= '</div>';
+ }
+ $this->content->text .= '</table>';
+
+ return $this->content;
+ }
+
+ function has_config() {
+ return true;
+ }
+
+
+
+}
+
+
+?>
\ No newline at end of file
Property changes on: trunk/moodle/blocks/next_liveclassroom/block_next_liveclassroom.php
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Added: trunk/moodle/blocks/next_liveclassroom/config_global.html
===================================================================
--- trunk/moodle/blocks/next_liveclassroom/config_global.html (rev 0)
+++ trunk/moodle/blocks/next_liveclassroom/config_global.html 2006-10-16 12:51:06 UTC (rev 89)
@@ -0,0 +1,33 @@
+ <table cellpadding="9" cellspacing="0">
+<tr valign="top">
+ <td align="right"><?php print_string('coursenumbers', 'block_next_liveclassroom') ?></td>
+ <td>
+ <input name="block" type="hidden" value="<?php echo intval($_REQUEST['block']); ?>" />
+ <input name="block_next_liveclassroom_coursenumber" type="text" size="5" value="<?php
+ if(isset($CFG->block_next_liveclassroom_coursenumber)) {
+ p($CFG->block_next_liveclassroom_coursenumber);
+ } else {
+ p(3);
+ } ?>" />
+ </td>
+
+</tr>
+<tr>
+<tr valign="top">
+ <td align="right"><?php print_string('globalnumbers', 'block_next_liveclassroom') ?></td>
+
+ <td>
+ <input name="block_next_liveclassroom_globalnumber" type="text" size="5" value="<?php
+ if(isset($CFG->block_next_liveclassroom_globalnumber)) {
+ p($CFG->block_next_liveclassroom_globalnumber);
+ } else {
+ p(5);
+ } ?>" />
+ </td>
+
+</tr>
+
+ <td colspan="2" align="center">
+ <input type="submit" value="<?php print_string('savechanges') ?>" /></td>
+</tr>
+</table>
Property changes on: trunk/moodle/blocks/next_liveclassroom/config_global.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 15:39:15
|
Revision: 87
http://svn.sourceforge.net/hw4mdl/?rev=87&view=rev
Author: shazan
Date: 2006-10-13 08:04:41 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
prefix are managed depending of the admin user name
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-10-13 13:48:08 UTC (rev 86)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-10-13 15:04:41 UTC (rev 87)
@@ -43,7 +43,7 @@
require_once('System.php');
-$LIVECLASSROOM_MOODLE_PREFIX = '_moodle_';
+$LIVECLASSROOM_MOODLE_PREFIX = liveclassroom_api_get_prefix();
$LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?';
$LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP';
@@ -1288,5 +1288,27 @@
return $table_result;
}
+
+/*
+* Get the prefix to use for creating rooms and users.
+*
+* return $prefix : a string which is the prefix to use
+*/
+function liveclassroom_api_get_prefix() {
+ global $CFG;
+
+ //get the admin user name
+ $aun = $CFG->liveclassroom_adminusername;
+ if( (substr($aun, 0,1)=='_') && (substr($aun, -1,1)=='_') ) { //Prefix
+ $prefix = $aun;
+
+ }
+ else {
+ $prefix = '';
+
+ }
+ return $prefix;
+
+}
?>
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 13:48:08 UTC (rev 86)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 15:04:41 UTC (rev 87)
@@ -40,9 +40,6 @@
-
-
-
/**
* Validate the data in passed in the configuration page
* @param $config - the information from the form mod.html
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 15:24:39
|
Revision: 88
http://svn.sourceforge.net/hw4mdl/?rev=88&view=rev
Author: shazan
Date: 2006-10-13 08:24:31 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
fix a bug for prefix
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-10-13 15:04:41 UTC (rev 87)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-10-13 15:24:31 UTC (rev 88)
@@ -204,6 +204,7 @@
error( "Creation user failed, already exist");
return false;
}*/
+
if ( $respcode != 100 && $respcode != 301) {
error( "Response: Account ($userId) Creation Failed: $resp_code");
return false;
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 15:04:41 UTC (rev 87)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 15:24:31 UTC (rev 88)
@@ -198,10 +198,11 @@
global $LIVECLASSROOM_TEACHER_SUFFIX;
global $LIVECLASSROOM_STUDENT_SUFFIX;
global $LIVECLASSROOM_MOODLE_PREFIX;
-
//$userid = $CFG->liveclassroom_settinguniqueid."_".$course->id.$LIVECLASSROOM_TEACHER_SUFFIX;
$userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.$LIVECLASSROOM_TEACHER_SUFFIX;
+
if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Teacher')) {
+
//error("Cannot Create Teacher profile");
return false;
}
@@ -209,6 +210,7 @@
$userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.$LIVECLASSROOM_STUDENT_SUFFIX;
if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Student')) {
//error("Cannot Create Student profile");
+
return false;
}
return true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 13:48:14
|
Revision: 86
http://svn.sourceforge.net/hw4mdl/?rev=86&view=rev
Author: shazan
Date: 2006-10-13 06:48:08 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
authenticate system every 30 minutes
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-10-13 12:41:52 UTC (rev 85)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-10-13 13:48:08 UTC (rev 86)
@@ -64,6 +64,7 @@
$LIVECLASSROOM_API_RECORD_SEPERATOR = "=END RECORD";
+session_start();
/**
@@ -102,17 +103,18 @@
//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
-
-
$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, System::mktemp("lc"));
+ curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
- #print_r $data;
+
if (curl_errno($ch)) {
print curl_error($ch);
return false;
@@ -126,9 +128,56 @@
}
return $ch;
+
}
+ /**
+ * Send a query to the server with the given function and the given attributes
+ * Check if the session cookie exist and get the cookie creation date.
+ * If it's less than 30 minutes, the cookie is got for the request, if not a new authenticate is done.
+ * @param $const : function called
+ * @param $attribute : different list of attributes for the function called
+ * return $data : result query
+ */
+ function liveclassroom_api_send_query($const,$attribute) {
+ global $CFG;
+ global $LIVECLASSROOM_API_ADMIN;
+ $cookie_file_path = $CFG->dirroot.'/mod/liveclassroom/tmp/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;
+ }
+ }
+
+ $url = $CFG->liveclassroom_servername.
+ $LIVECLASSROOM_API_ADMIN.
+ $const.
+ $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_COOKIEFILE, $cookie_file_path);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+
+ $data = curl_exec($ch);
+
+ if (curl_errno($ch)) {
+ print curl_error($ch);
+ return false;
+ }
+
+ return $data;
+ }
+
+
+
+
/**
* Create the Live Classroom User $user with the role $rolename. This function
* actually creates profiles that will further be used for teacher/student
@@ -192,8 +241,6 @@
}
-
-
/**
* Returns a session id (hzA) to be inserted in URLs to access the LC server
@@ -210,29 +257,8 @@
global $LIVECLASSROOM_API_ADMIN;
global $LIVECLASSROOM_API_FUNCTION_GET_TOKEN;
- if (!$ch = liveclassroom_api_authenticate()) {
- return false;
- }
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_TOKEN, "&target=$userid&nickname=$nickname");
- $url = $CFG->liveclassroom_servername.
- $LIVECLASSROOM_API_ADMIN.
- $LIVECLASSROOM_API_FUNCTION_GET_TOKEN.
- "&target=$userid".
- "&nickname=$nickname";
-
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_session", "URL Sent: $url");
-
- curl_setopt($ch, CURLOPT_URL,$url);
- $data = curl_exec($ch);
-
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_session", "DATA: <pre>$data</pre>");
- if (curl_errno($ch)) {
- print curl_error($ch);
- return false;
- }
-
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -306,32 +332,9 @@
$LIVECLASSROOM_API_FUNCTION_CREATE_ROLE;
- // liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_ROLE,"&target=$roomid&user_id=$userid&role_id=$role");
-
- if (!$ch = liveclassroom_api_authenticate()) {
- return false;
- }
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_ROLE, "&target=$roomid&user_id=$userid&role_id=$role");
- $url = $CFG->liveclassroom_servername.
- $LIVECLASSROOM_API_ADMIN.
- $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE.
- "&target=$roomid".
- "&user_id=$userid".
- "&role_id=$role";
-
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_add_user_role", "URL Sent: $url");
-
- curl_setopt($ch, CURLOPT_URL,$url);
- $data = curl_exec($ch);
-
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>");
- if (curl_errno($ch)) {
- print curl_error($ch);
- return false;
- }
-
+
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -350,30 +353,9 @@
$LIVECLASSROOM_API_FUNCTION_DELETE_ROLE;
- if (!$ch = liveclassroom_api_authenticate()) {
- return false;
- }
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_DELETE_ROLE, "&target=$roomid&user_id=$userid&role_id=$role");
- $url = $CFG->liveclassroom_servername.
- $LIVECLASSROOM_API_ADMIN.
- $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE.
- "&target=$roomid".
- "&user_id=$userid".
- "&role_id=$role";
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_user_role", "URL Sent: $url");
-
- curl_setopt($ch, CURLOPT_URL,$url);
- $data = curl_exec($ch);
-
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>");
- if (curl_errno($ch)) {
- print curl_error($ch);
- return false;
- }
-
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -389,30 +371,9 @@
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_DELETE_ROLE;
- if (!$ch = liveclassroom_api_authenticate()) {
- return false;
- }
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_DELETE_ROLE, "&target=$roomid&user_id=$groupid&role_id=$role");
- $url = $CFG->liveclassroom_servername.
- $LIVECLASSROOM_API_ADMIN.
- $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE.
- "&target=$roomid".
- "&group_id=$groupid".
- "&role_id=$role";
- //DEBUG
- // add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_group_role", "URL Sent: $url");
-
- curl_setopt($ch, CURLOPT_URL,$url);
- $data = curl_exec($ch);
-
- //DEBUG
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>");
- if (curl_errno($ch)) {
- print curl_error($ch);
- return false;
- }
-
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -423,96 +384,7 @@
return true;
}
-/**
- * Retrieve list of all rooms from the LC server available to the given user
- * ID.
- *
- * @param userid User ID to filter by, null if none
- * @param role Optional role to filter by
- * @param roomid
- * @return
- */
- function liveclassroom_api_get_room_list($userid,$course) {
-
- global $CFG;
- global $LIVECLASSROOM_API_ADMIN,
- $LIVECLASSROOM_API_RECORD_SEPERATOR,
- $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&filter00=archive&filter00value=0&AccessUser=$userid");
-
- $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
-// $studentuserid = "_moodle_hgh_S";
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "apres get student user id".time());
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- // print $data."<br>";
-
- $line = explode("\n",$data);
- $j=0;
- $k=0;
- // $line = strtok($data,"\n");
- // while (!empty($currentline) ) {
- // $currentline = strtok("\n");
- // }
-
- for($i=1;$i<sizeof($line)-3;$i=$i+4){
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "boucle".time());
- if(liveclassroom_api_role_user_room(liveclassroom_parse_line($line[$i+1],"class_id="), $studentuserid)=='Student') { //lecture room
- // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "boucle".time());
- $table_result[0][$j]= liveclassroom_parse_line($line[$i+1],"class_id=");
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "boucle2".$table_result[0][$j].time());
- $table_result[0][$j+1]= liveclassroom_parse_line($line[$i],"preview=");
- $table_result[0][$j+2]= liveclassroom_parse_line($line[$i+2],"longname=");
- $j = $j+3;
- }
- else {
- $table_result[1][$k]= liveclassroom_parse_line($line[$i+1],"class_id=");
- $table_result[1][$k+1]= liveclassroom_parse_line($line[$i],"preview=");
- $table_result[1][$k+2]= liveclassroom_parse_line($line[$i+2],"longname=");
- $k = $k+3;
- }
-
- }
- /*
- $i=0;
- $j=0;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "avant la boucle".time());
- foreach($tok1 as $tok1value) {
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "1ere boucle".time());
- $line = explode("\n",$tok1value);
- foreach ($line as $line_value) {
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "2eme boucle".time());
- $result = explode("=",$line_value);
- $room_table[$result[0]]=$result[1];
-
- if(liveclassroom_api_role_user_room($room_table['class_id'], $studentuserid)=='Student') { //lecture room
- $table_result[0][$i] = $room_table;
- add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", $room_table['class_id']." ".time());
- $i++;
- }
- else { //breakout room
- $table_result[1][$j] = $room_table;
- add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", $room_table['class_id']." ".time());
- $j++;
- }
- //$table_result[$i]=$result[1];
- // print $table_result[$i];
- // $i++;
- // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_infos_room", $result[0]."=".$room_table[$result[0]] );
- }
- }
- */
- return $table_result;
-
- }
/**
@@ -550,55 +422,8 @@
}
- /**
- * Send a query to the server with the given function and the attributes given
- * @param $ch
- * @param $const : function called
- * @param $attribute : different list of attribute for the function called
- * return $data : list of the result query
- */
- function liveclassroom_api_send_query($const,$attribute) {
- global $CFG;
- global $LIVECLASSROOM_API_ADMIN;
-
- if (!$ch = liveclassroom_api_authenticate()) {
- return false;
- }
- $url = $CFG->liveclassroom_servername.
- $LIVECLASSROOM_API_ADMIN.
- $const.
- $attribute;
-
- curl_setopt($ch, CURLOPT_URL,$url);
- $data = curl_exec($ch);
-
- if (curl_errno($ch)) {
- print curl_error($ch);
- return false;
- }
-
- return $data;
- }
-
- function liveclassroom_api_set_query_attribute($query,$attribute) {
-
- }
-
- function liveclassroom_api_set_query_filter($query) {
-
- }
-
-/**
-* Parses the HTTP response body
-*
-* @param response
-*/
-function liveclassroom_parse_response($response) {
- return true;
-}
-
/**
*
* return a string delimited by the pattern and the end of line
@@ -794,24 +619,7 @@
}
}
- /*
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
- $j=0;
- foreach ($tok1 as $tok1_value) {
- //for($i=0;$i<sizeof($tok1);$i++) {
- // $test = strstr($tok1[$i],$roomid);
- $test = strstr($tok1_value,$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;
}
@@ -960,15 +768,7 @@
return $result;
-/*
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
- $result = liveclassroom_parse_line($tok1[0],"user_id=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- return $response;
-*/
+
}
@@ -1039,90 +839,11 @@
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);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
- if(sizeof($tok1)>1){
- return true;
- }
- else {
- return false;
- }
-}*/
/*
-* List all the orphaned archive on the server
-* NEED TO BE TESTED !!!!
-*/
-
-function liveclassroom_api_get_orphaned_archive_list() {
-
- $tab_archive = liveclassroom_api_get_archive_list() ;
-
-
- //liste des archive
- //si ya une class id on la prend pas
-
- $j=0;
-
- for($i=0;$i<sizeof($tab_archive);$i++) {
- if ($tok[$i]!=null) {
- //tester les room
- $list_return[$j]=$tok[$i];
- }
- }
- print $data;
- return $list_return;
-}
-
-/*
-* Give the description of he room given
-* @param $roomid : the id of the room
-* return a String :description of the room
-*/
-function liveclassroom_api_get_room_description($roomid){
- global $CFG;
- global $LIVECLASSROOM_API_ADMIN;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=description&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($tok2[0],"description=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- return $response;
-
-}
-/*
* Give the nam of the room given
* @param $roomid : the id of the room
* return a String :name of the room
@@ -1190,79 +911,8 @@
}
-/*
-*
-* @param $roomid : the id of the room
-* return a boolean :true if hms two way is enabled, false if not
-*/
-function liveclassroom_api_room_is_hmstwoway_enabled($roomid){
- global $CFG;
- global $LIVECLASSROOM_API_ADMIN;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=hms_two_way_enabled&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"hms_two_way_enabled=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"hms_two_way_enabled=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-}
-/*
-*
-* @param $roomid : the id of the room
-* return a boolean :true if hms Simulcat is restricted, false if not
-*/
-function liveclassroom_api_room_is_hmsSimulcast_restricted($roomid){
- global $CFG;
- global $LIVECLASSROOM_API_ADMIN;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=hms_simulcast_restricted&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"hms_simulcast_restricted=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"hms_simulcast_restricted=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-}
-
/*
* Get the number of user limit of the room given
* @param $roomid : the id of the room
@@ -1296,229 +946,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;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=privatechatenable&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"privatechatenable=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"privatechatenable=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-}
-/*
-* 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;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=can_ppt_import&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"can_ppt_import=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"can_ppt_import=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-}
/*
-* 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;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=can_liveshare&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"can_liveshare=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"can_liveshare=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-
-}
-
-/*
-* 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;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=can_archive&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"can_archive=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"can_archive=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-
-}
-
-/*
-* 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;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=student-wb-liveapp&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"student-wb-liveapp=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"student-wb-liveapp=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- else return false;
-
-}
-
-/*
-* 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;
- global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- global $LIVECLASSROOM_API_RECORD_SEPERATOR;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=student-wb-enabled&filter00=class_id&filter00value=$roomid");
-
- preg_match("(\d*)", $data, $matches);
- $respcode = $matches[0];
-
- if ( $respcode != 100) {
- return false;
- }
- //print $url;
- $tok = split("100 OK",$data);
- $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
-
- $test = strstr($tok1[0],"student-wb-enabled=");
-
- //$tok2 = split("class_id=",$tok1[0]);
- $result = liveclassroom_parse_line($test,"student-wb-enabled=");
- //Remove le " " at the end of the line
- $response = substr($result,0,-1);
-
- if($response==1) {
- return true;
- }
- 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
@@ -1630,27 +1062,32 @@
return true;
}*/
-/*
-function ($roomname) {
- global $CFG;
- global $LIVECLASSROOM_API_ADMIN,
- $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
+function liveclassroom_api_get_room_list($userid,$course) {
+
+ global $CFG;
+ global $LIVECLASSROOM_API_ADMIN,
+ $LIVECLASSROOM_API_RECORD_SEPERATOR,
+ $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=longname&filter00=archive&filter00value=0&AccessUser=$userid");
+
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
if ( $respcode != 100) {
return false;
}
- return $list;
+ $line = explode("\n",$data);
+ $rooms=array();
+ for($i=1;$i<sizeof($line)-2;$i=$i+3){
+ $room[0] = liveclassroom_parse_line($line[$i],"class_id="); //class_id
+ $room[1]= liveclassroom_parse_line($line[$i+1],"longname="); //longname
+ array_push($rooms,$room);
+ }
+ return $rooms;
}
-*/
-
-
-
/*
* List all the rooms and their archives associed + the orphaned archives list
*
@@ -1667,7 +1104,7 @@
global $CFG;
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_RECORD_SEPERATOR,
- $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
+ $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
$data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&attribute=archive&AccessUser=$userid");
@@ -1738,20 +1175,29 @@
return $table_result;
}
-
-function liveclassroom_create_xml() {
-
- global $CFG;
+
+/*
+* List all the rooms and their archives associed + the orphaned archives list
+*
+* @param $userid : the user id of the current user
+* @param $course : the current course
+*
+* Return a table composed of 3 parts:
+* - an xml string who list all the lecture rooms and their archives associed
+* - an xml string who list all the breakout rooms and their archives associed
+**/
+function liveclassroom_create_xml($userid,$course) {
+
+ global $CFG;
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_RECORD_SEPERATOR,
- $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
+ $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avant send data ".time());
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&filter01=archive&filter01value=0&AccessUser=$userid");
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres send data ".time());
- // Cr\xE9ation d'un nouvel objet document
- $doc = new DOMDocument('1.0', 'ISO-8859-1');
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&attribute=archive&AccessUser=$userid");
-
$studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
+
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1759,82 +1205,88 @@
return false;
}
- $line = explode("\n",$data);
+
+ $lecturerooms = '<?xml version=1.0 ?>';
+ $breakoutrooms= '<?xml version=1.0 ?>';
+
+ $lecturerooms .= '<root><rooms>';
+ $breakoutrooms .= '<root><rooms>';
+ $line = explode("\n",$data);
+
$tabarchive = array();
- $orphanedarchives = array();
- $rooms=array(); //lecture rooms table
- $rooms1=array();//breakout rooms table
-
- for($i=1;$i<sizeof($line)-4;$i=$i+5){
- if((liveclassroom_parse_line($line[$i+3],"archive=")!=1)){ // it is a room
+ for($i=1;$i<sizeof($line)-3;$i=$i+4){
- $room[0] = liveclassroom_parse_line($line[$i+1],"class_id="); //class_id
- $room[1]= liveclassroom_parse_line($line[$i+2],"longname="); //longname
- $room[2]= liveclassroom_parse_line($line[$i],"preview="); //preview
- $room[3]= array();
-
- if(liveclassroom_api_role_user_room($room[0], $studentuserid)=='Student') { //lecture room
+ $room[0]= liveclassroom_parse_line($line[$i+1],"class_id="); //class_id
+ $room[1]= liveclassroom_parse_line($line[$i+2],"longname="); //longname
+ $room[2]= liveclassroom_parse_line($line[$i],"preview="); //preview
- $rooms[$room[0]]=$room;
-
- }
- else { //Breakout room
-
- $rooms1[$room[0]]=$room;
- }
-
- }
- else { // it is an archive
+ if(liveclassroom_api_role_user_room($room[0], $studentuserid)=='Student') { //lecture room
+
+ $lecturerooms .='<room>';
+ $lecturerooms .='<id>'.$room[0].'</id>';
+ $lecturerooms .='<longname>'.$room[1].'</longname>';
+ $lecturerooms .='<preview>'.$room[2].'</preview>';
- $archiveid=liveclassroom_parse_line($line[$i+1],"class_id=");// larchive id
- $roomid = substr($archiveid,0,strlen($archiveid)-18);//room id
+ $tabarchive = liveclassroom_api_get_archive_list_for_a_room($room[0],$userid);
+
+ if(sizeof($tabarchive)>0){ //archives
+ add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "archive ".time());
+ $lecturerooms .='<archives>';
+ // for($j=0;$j<sizeof($tabarchive);$j++){
- $archive=array();
- $archive[0]=$archiveid;
- $archive[1]=liveclassroom_parse_line($line[$i+2],"longname="); //longname
- $archive[2]=liveclassroom_parse_line($line[$i],"preview=");
- $archive[3]=$roomid; //preview
- array_push($tabarchive,$archive);
+ foreach ($tabarchive as $archive) {
+ $lecturerooms .='<archive>';
+ $lecturerooms .='<id>'.$archive[1].'</id>';
+ $lecturerooms .='<longname>'.$archive[2].'</longname>';
+ $lecturerooms .='<preview>'.$archive[0].'</preview>';
+ $lecturerooms .='</archive>';
+ }
+ $lecturerooms .='</archives>';
+ }
+ $lecturerooms .='</room>';
}
- }
- foreach($tabarchive as $value) {
- if (array_key_exists($value[3],$rooms)) { //lecture room table
- array_push($rooms[$value[3]][3],$value);
- }
- else if (array_key_exists($value[3],$rooms1)) { //breakout room table
- array_push($rooms1[$value[3]][3],$value);
- }
- else { //orphaned archive
- array_push($orphanedarchives,$value);
- }
- }
+ else { //Breakout room
+
+ $breakoutrooms .='<room>';
+ $breakoutrooms .='<id>'.$room[0].'</id>';
+ $breakoutrooms .='<longname>'.$room[1].'</longname>';
+ $breakoutrooms .='<preview>'.$room[2].'</preview>';
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "before archivze liste ".time());
+ $tabarchive = liveclassroom_api_get_archive_list_for_a_room($room[0],$userid);
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "after archivze liste ".time());
+ if(sizeof($tabarchive)>0){ //archives
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "archive ".time());
+ $breakoutrooms .='<archives>';
+ foreach ($tabarchive as $archive) {
+ $breakoutrooms .='<archive>';
+ $breakoutrooms .='<id>'.$archive[1].'</id>';
+ $breakoutrooms .='<longname>'.$archive[2].'</longname>';
+ $breakoutrooms .='<preview>'.$archive[0].'</preview>';
+ $breakoutrooms .='</archive>';
+ }
+ $breakoutrooms .='</archives>';
+ }
+
+ $breakoutrooms .='</room>';
+ }
- $table_result[0]=$rooms;
- $table_result[1]=$rooms1;
- $table_result[2]=$orphanedarchives;
-
-
-
-
+ }
+ $lecturerooms .= '</rooms></root>';
+ $breakoutrooms .= '</rooms></root>';
- $xml = '<racine><element>texte</element></racine>';
- $doc->loadXML($xml);
- // Cr\xE9ation de l'\xE9l\xE9ment racine
- $root = $dom->createElement($xmlObject->root->name);
- $dom->appendChild($root);
+ add_to_log($course->id, "liveclassroom", "view", "liveclassroom_create_xml", "after");
- // appel d'une fonction r\xE9cursive qui construit l'\xE9l\xE9ment XML
- // \xE0 partir de l'objet, en parcourant tout l'arbre de l'objet.
- setElement($dom, $xmlObject->root, $root);
+ $table_result[0]=$lecturerooms;
+ $table_result[1]=$breakoutrooms;
+
- // Mise \xE0 jour du fichier source original
- $dom->save($xmlObject->source);
- echo $xmlObject->source;
+ return $table_result;
+
}
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 12:41:57
|
Revision: 85
http://svn.sourceforge.net/hw4mdl/?rev=85&view=rev
Author: shazan
Date: 2006-10-13 05:41:52 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/mod.html
Modified: trunk/moodle/mod/liveclassroom/mod.html
===================================================================
--- trunk/moodle/mod/liveclassroom/mod.html 2006-10-13 12:36:54 UTC (rev 84)
+++ trunk/moodle/mod/liveclassroom/mod.html 2006-10-13 12:41:52 UTC (rev 85)
@@ -180,11 +180,9 @@
<td align="left">
<?php
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
- $rooms = liveclassroom_api_get_room_list($_SESSION['teacherid'],$course);
-
-
-
- //$list_type_rooms = liveclassroom_get_list_type_rooms($course);
+ $teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
+ $rooms = liveclassroom_api_get_room_list($teacherid,$course);
+
?>
<SELECT name="type">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 12:37:00
|
Revision: 84
http://svn.sourceforge.net/hw4mdl/?rev=84&view=rev
Author: shazan
Date: 2006-10-13 05:36:54 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
library updated with the new dabatase format.
remove all unused functions
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 12:35:24 UTC (rev 83)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 12:36:54 UTC (rev 84)
@@ -192,10 +192,6 @@
return $return;
}
-//////////////////////////////////////////////////////////////////////////////////////
-/// Any other liveclassroom functions go here. Each of them must have a name that
-/// starts with liveclassroom_
-
/**
* Creates the profiles account for a given course.
*/
@@ -208,14 +204,12 @@
//$userid = $CFG->liveclassroom_settinguniqueid."_".$course->id.$LIVECLASSROOM_TEACHER_SUFFIX;
$userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.$LIVECLASSROOM_TEACHER_SUFFIX;
- //add_to_log($course->id, "liveclassroom", "", "liveclassroom_create_profiles", "Creating $userId as Teacher");
if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Teacher')) {
//error("Cannot Create Teacher profile");
return false;
}
$userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.$LIVECLASSROOM_STUDENT_SUFFIX;
- //add_to_log($course->id, "liveclassroom", "", "", "Creating $userId as Student");
if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Student')) {
//error("Cannot Create Student profile");
return false;
@@ -231,15 +225,12 @@
*/
function liveclassroom_create_rooms ($course) {
- //teacher is the lead of the presentation
- add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "first ".time());
+ //teacher is the lead of the presentation
liveclassroom_create_room($course->id, "Main classroom", true);
- add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "second ".time());
liveclassroom_create_room($course->id, "Other classroom", true);
- add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "third ".time());
+
//teachers and students have the same rights
liveclassroom_create_room($course->id, "Group 1", false);
- add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "4th ".time());
liveclassroom_create_room($course->id, "Group 2", false);
return true;
@@ -326,13 +317,14 @@
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;
}
@@ -366,156 +358,8 @@
return '0';
}
-/**
- * Give the list of type of room available
- * @param $course : an instance of a course
- * @return the list of type of room available
- */
-function liveclassroom_get_list_type_rooms($course) {
-
- if (!($list = get_records('liveclassroom_rooms','course',$course->id) )) {
- error( "Response get list type room : query to database failed");
- }
- $list_name=array();
- //$i=0;
- foreach($list as $liveclassroom_rooms) {
- array_push($list_name,$liveclassroom_rooms->name);
- //$list_name[$i]= $liveclassroom_rooms->name;
- //$i++;
- }
- return $list_name;
-}
-
-/**
- * Give the list of type of room available
- * @return the list of type of room available
- */
-function liveclassroom_get_list_type_rooms_first_time() {
-
- if (!($list = get_records('liveclassroom_type_rooms','course',0) )) {
- error( "Response get list type room : query to database failed");
- }
-
- $i=0;
- foreach($list as $liveclassroom_type_rooms) {
- $list_name[$i]= $liveclassroom_type_rooms->name;
- $i++;
- }
-
- return $list_name;
-}
-
-
-
-
/*
-* Get the list of the rooms per course for a course given
-* @param $course : object course
-* return a list of the type of the room available for this course
-*/
-function liveclassroom_get_list_type_rooms_per_course($course) {
-
- if(!($list = get_records('liveclassroom_rooms','course',$course->id))) {
- error( "Response get list type room per course : query to database failed");
- }
-
- $i=0;
- foreach($list as $liveclassroom_rooms) {
- $list_name[$i] = $liveclassroom_rooms->name;
- $i++;
- }
-
- return $list_name;
-}
-
-/*
-* Create a new instance of liveclassroom Room
-* @param $liveclassroom_rooms : object liveclassroom_rooms
-*/
-function liveclassroom_rooms_add_instance($liveclassroom_rooms) {
-
- $liveclassroom_rooms->timemodified = time();
-
- if(!(insert_record("liveclassroom_rooms", $liveclassroom_rooms))) {
- error( "Response: creation of new instance failed");
- //return false;
- }
- return true;
-}
-
-function liveclassroom_rooms_delete_instance($roomid) {
-/// Given an ID of an instance of this module,
-/// this function will permanently delete the instance
-/// and any data that depends on it.
-
- if (! $liveclassroom_rooms = get_record("liveclassroom_rooms", "room_id", "$roomid")) {
- return false;
- }
-
- $result = true;
-
- # Delete any dependent records here #
-
- if (! delete_records("liveclassroom_rooms", "id", "$liveclassroom_rooms->id")) {
- $result = false;
- }
-
- return $result;
-}
-
-
-function liveclassroom_rooms_update_instance($liveclassroom_room) {
-
-
- if (! $liveclassroom_rooms = get_record("liveclassroom_rooms", "room_id", "$liveclassroom_room->room_id")) {
- return false;
- }
- $liveclassroom_rooms->timemodified = time();
- $liveclassroom_rooms->name = $liveclassroom_room->name;
-
- if(!(update_record("liveclassroom_rooms", $liveclassroom_rooms))) {
- error( "Response: update of instance liveclassroom_rooms failed");
- //return false;
- }
- return true;
-}
-
-/*
-* Create a new type to liveclassroom Room
-* @param $name : the name of the type
-*/
-function liveclassroom_rooms_add_new_type($courseid,$name) {
-
- $liveclassroom_type_room->timemodified = time();
-
- $liveclassroom_type_room->course = $courseid ;
- $liveclassroom_type_room->lc_id = 0 ;
- $liveclassroom_type_room->name = $name ;
-
- if(!(insert_record("liveclassroom_type_rooms", $liveclassroom_type_room))) {
- error( "Response: creation of new type $name failed");
- }
- return true;
-}
-
-
-/*
-* Check if the room exist in the moodle database liveclassroom_rooms
-* @param $liveclassroom : a liveclassroom instance
-* return true if the room exist, false if not.
-*/
-
-function liveclassroom_rooms_exists($liveclassroom) {
-
- if(!get_records('liveclassroom_rooms','lc_id',$liveclassroom->id)) {
- return false;
- }
- else return true;
-
-}
-
-/*
* Give the shortnamefor a courseid given
* @param $courseid : the id of the course
* Return a string : the shortname of the course
@@ -532,71 +376,7 @@
}
}
-
-
-
-function liveclassroom_get_room_id($course,$roomnane){
- if(!($rooms = get_records('liveclassroom_rooms','course',$course->id))) {
- error( "Response get roomid : query to database failed");
- }
- foreach($rooms as $room){
- if (($room->name)==$roomnane){
- $roomid = $room->room_id;
- }
- }
- return $roomid;
-}
-
/*
-* Give the name of the room with it room id
-* @param $roomis : the id of the room on the server
-* Return the name of the room
-*/
-function liveclassroom_get_room_name_from_id($roomid) {
-
- if(!($list = get_record('liveclassroom_rooms','room_id',$roomid))) {
- error( "Response get room name from id : query to database failed");
- }
- return $list->name;
-
-}
-
-/*
-* List the room_id of all the room available for a course
-*
-* @param $course
-* return a table with all the room_id of the room for the course given
-*/
-function liveclassroom_get_roomid_list($course) {
-
- if(!($rooms = get_records('liveclassroom_rooms','course',$course->id))) {
- error( "Response get roomid list : query to database failed");
- }
-
- $i=0;
- foreach ($rooms as $liveclassroom_rooms) {
- if($liveclassroom_rooms->course==$course->id) {
- $list_roomid[$i]=$liveclassroom_rooms->room_id;
- $i++;
- }
- }
- return $list_roomid;
-}
-
-
-function liveclassroom_test_get_room_list($course) {
-
-
-
-// $list_roomid = liveclassroom_get_roomid_list($course);
- $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
- $teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
- liveclassroom_api_get_room_list($teacherid);
-
-}
-
-
-/*
* List all the activities for a course given ans a type of Room
* @param $course : the course
* @param $roomnase = the name of the room
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 12:35:35
|
Revision: 83
http://svn.sourceforge.net/hw4mdl/?rev=83&view=rev
Author: shazan
Date: 2006-10-13 05:35:24 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
mod.html updated with the new database format
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/mod.html
Modified: trunk/moodle/mod/liveclassroom/mod.html
===================================================================
--- trunk/moodle/mod/liveclassroom/mod.html 2006-10-13 12:34:26 UTC (rev 82)
+++ trunk/moodle/mod/liveclassroom/mod.html 2006-10-13 12:35:24 UTC (rev 83)
@@ -2,6 +2,8 @@
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
<?php
+session_start();
+
require_once($CFG->dirroot.'/calendar/lib.php');
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
$id = optional_param('id', 0, PARAM_INT);
@@ -178,16 +180,20 @@
<td align="left">
<?php
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
-
- $list_type_rooms = liveclassroom_get_list_type_rooms($course);
+ $rooms = liveclassroom_api_get_room_list($_SESSION['teacherid'],$course);
+
+
+
+ //$list_type_rooms = liveclassroom_get_list_type_rooms($course);
?>
<SELECT name="type">
<?php
- for($i=0;$i<sizeof($list_type_rooms);$i++) {
+ // for($i=0;$i<sizeof($list_type_rooms);$i++) {
+ foreach($rooms as $room) {
?>
- <OPTION <?php if(($_GET['roomId']!=null)&&(liveclassroom_get_room_name_from_id($_GET['roomId']))==$list_type_rooms[$i]){ echo "selected"; } ?> VALUE="<?php p(liveclassroom_get_room_id($course,$list_type_rooms[$i])) ?>"><?php p($list_type_rooms[$i]) ?></OPTION>
+ <OPTION <?php if(($_GET['roomId']!=null)&&($_GET['roomId']==$room[0])){ echo "selected"; } ?> VALUE="<?php p($room[0]) ?>"><?php p($room[1]) ?></OPTION>
<?php
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-13 12:34:38
|
Revision: 82
http://svn.sourceforge.net/hw4mdl/?rev=82&view=rev
Author: shazan
Date: 2006-10-13 05:34:26 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
only one database now
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/db/mysql.sql
trunk/moodle/mod/liveclassroom/db/postgres7.sql
Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql
===================================================================
--- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-10-10 12:27:07 UTC (rev 81)
+++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-10-13 12:34:26 UTC (rev 82)
@@ -48,22 +48,4 @@
PRIMARY KEY (`id`)
) COMMENT='Defines liveclassroom';
-# --------------------------------------------------------
-#
-# Table structure for table `liveclassroom_rooms`
-#
-
-
-CREATE TABLE `prefix_liveclassroom_rooms` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `course` int(10) unsigned NOT NULL default '0',
- `name` varchar(255) NOT NULL default '',
- `room_id` varchar(255) NOT NULL default '',
- PRIMARY KEY (`id`)
-) COMMENT='Defines liveclassroom rooms';
-
-# --------------------------------------------------------
-
-# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name');
-# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'add', 'liveclassroom', 'name');
Modified: trunk/moodle/mod/liveclassroom/db/postgres7.sql
===================================================================
--- trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-10-10 12:27:07 UTC (rev 81)
+++ trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-10-13 12:34:26 UTC (rev 82)
@@ -50,21 +50,3 @@
CREATE INDEX prefix_liveclassroom_course_idx ON prefix_liveclassroom (course);
-# --------------------------------------------------------
-
-#
-# Table structure for table `liveclassroom_rooms`
-#
-
-CREATE TABLE prefix_liveclassroom_rooms (
- id SERIAL,
- course integer NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- room_id varchar(255) NOT NULL default '',
- PRIMARY KEY (id)
-);
-
-# --------------------------------------------------------
-
-# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name');
-# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'add', 'liveclassroom', 'name');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-10 12:27:14
|
Revision: 81
http://svn.sourceforge.net/hw4mdl/?rev=81&view=rev
Author: shazan
Date: 2006-10-10 05:27:07 -0700 (Tue, 10 Oct 2006)
Log Message:
-----------
library update for update rooms
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-10-10 12:24:19 UTC (rev 80)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-10 12:27:07 UTC (rev 81)
@@ -465,11 +465,15 @@
}
-function liveclassroom_rooms_update_instance($liveclassroom_rooms) {
+function liveclassroom_rooms_update_instance($liveclassroom_room) {
- $liveclassroom_rooms->timemodified = time();
- // $liveclassroom_rooms->id = $liveclassroom_rooms->instance;
+ if (! $liveclassroom_rooms = get_record("liveclassroom_rooms", "room_id", "$liveclassroom_room->room_id")) {
+ return false;
+ }
+ $liveclassroom_rooms->timemodified = time();
+ $liveclassroom_rooms->name = $liveclassroom_room->name;
+
if(!(update_record("liveclassroom_rooms", $liveclassroom_rooms))) {
error( "Response: update of instance liveclassroom_rooms failed");
//return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-10 12:24:25
|
Revision: 80
http://svn.sourceforge.net/hw4mdl/?rev=80&view=rev
Author: shazan
Date: 2006-10-10 05:24:19 -0700 (Tue, 10 Oct 2006)
Log Message:
-----------
database update
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/db/mysql.sql
trunk/moodle/mod/liveclassroom/db/postgres7.sql
Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql
===================================================================
--- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-10-10 12:24:04 UTC (rev 79)
+++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-10-10 12:24:19 UTC (rev 80)
@@ -33,21 +33,32 @@
# It may also contain INSERT statements for particular data
# that may be used, especially new entries in the table log_display
+# --------------------------------------------------------
+
+#
+# Table structure for table `liveclassroom`
+#
+
CREATE TABLE `prefix_liveclassroom` (
`id` int(10) unsigned NOT NULL auto_increment,
`course` int(10) unsigned NOT NULL default '0',
`type` varchar(255) NOT NULL default '',
`name` varchar(255) NOT NULL default '',
- `description` text NOT NULL default '',
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) COMMENT='Defines liveclassroom';
+# --------------------------------------------------------
+
+#
+# Table structure for table `liveclassroom_rooms`
+#
+
+
CREATE TABLE `prefix_liveclassroom_rooms` (
`id` int(10) unsigned NOT NULL auto_increment,
`course` int(10) unsigned NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
- `lc_id` int(10) unsigned NOT NULL default '0',
`room_id` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) COMMENT='Defines liveclassroom rooms';
Modified: trunk/moodle/mod/liveclassroom/db/postgres7.sql
===================================================================
--- trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-10-10 12:24:04 UTC (rev 79)
+++ trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-10-10 12:24:19 UTC (rev 80)
@@ -33,15 +33,38 @@
# It may also contain INSERT statements for particular data
# that may be used, especially new entries in the table log_display
+# --------------------------------------------------------
+
+#
+# Table structure for table `liveclassroom`
+#
+
CREATE TABLE prefix_liveclassroom (
- id SERIAL PRIMARY KEY,
+ id SERIAL,
course integer NOT NULL default '0',
+ type varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
- timemodified integer NOT NULL default '0'
+ timemodified integer NOT NULL default '0',
+ PRIMARY KEY (id)
);
CREATE INDEX prefix_liveclassroom_course_idx ON prefix_liveclassroom (course);
+
# --------------------------------------------------------
+#
+# Table structure for table `liveclassroom_rooms`
+#
+
+CREATE TABLE prefix_liveclassroom_rooms (
+ id SERIAL,
+ course integer NOT NULL default '0',
+ name varchar(255) NOT NULL default '',
+ room_id varchar(255) NOT NULL default '',
+ PRIMARY KEY (id)
+);
+
+# --------------------------------------------------------
+
# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name');
# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'add', 'liveclassroom', 'name');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-10 12:24:13
|
Revision: 79
http://svn.sourceforge.net/hw4mdl/?rev=79&view=rev
Author: shazan
Date: 2006-10-10 05:24:04 -0700 (Tue, 10 Oct 2006)
Log Message:
-----------
add activity form update
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/mod.html
Modified: trunk/moodle/mod/liveclassroom/mod.html
===================================================================
--- trunk/moodle/mod/liveclassroom/mod.html 2006-10-10 12:22:30 UTC (rev 78)
+++ trunk/moodle/mod/liveclassroom/mod.html 2006-10-10 12:24:04 UTC (rev 79)
@@ -81,7 +81,7 @@
<tr valign="top">
<td align="right"><b><font color="red">*</font><?php print_string("name") ?>:</b></td>
- <td>
+ <td align="left">
<input type="text" name="name" size="30" value="">
</td>
</tr>
@@ -90,35 +90,38 @@
<?php
if($course->format == "weeks"){
- //Display the lsit of the weeks
+ //Display the list of the weeks
?>
<td align="right"><b><?php print_string('weeksformat', 'liveclassroom')?>:</b></td>
- <td>
+ <td align="left">
<SELECT name="section">
<?php
-
- $weekdate = $course->startdate; // this should be 0:00 Monday of that week
- $weekdate += 7200; // Add two hours to avoid possible DST problems
- $section = 1;
- // $sectionmenu = array();
- $weekofseconds = 604800;
- $course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
- $k=0;
- while ($weekdate < $course->enddate) {
- $nextweekdate = $weekdate + ($weekofseconds);
- $weekday = userdate($weekdate, '%d %B') ;
- $endweekday = userdate($weekdate+518400, '%d %B');
- $list_weeks[$k] = $weekday.' - '.$endweekday;
- ?>
- <OPTION <?php if($_GET['section']==$k+1) { echo "selected"; }?> VALUE="<?php p($k+1) ?>"><?php p($list_weeks[$k]) ?></OPTION>
- <?php
- $k++;
- $section++;
- $weekdate = $nextweekdate;
- }
-
+
+ $weekdate = $course->startdate; // this should be 0:00 Monday of that week
+ $weekdate += 7200; // Add two hours to avoid possible DST problems
+ $section = 1;
+ // $sectionmenu = array();
+ $weekofseconds = 604800;
+ $course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
+ $list_weeks[0]="Section 0"; //For first section
+ $k=1;
+ while ($weekdate < $course->enddate) {
+ $nextweekdate = $weekdate + ($weekofseconds);
+ $weekday = userdate($weekdate, '%d %B') ;
+ $endweekday = userdate($weekdate+518400, '%d %B');
+ $list_weeks[$k] = $weekday.' - '.$endweekday;
+
+ $k++;
+ $section++;
+ $weekdate = $nextweekdate;
+ }
+ for($l=0;$l<sizeof($list_weeks);$l++){
?>
+ <OPTION <?php if($_GET['section']==$l) { echo "selected"; }?> VALUE="<?php p($l) ?>"><?php p($list_weeks[$l]) ?></OPTION>
+ <?php
+ }
+ ?>
</SELECT>
</td>
<?php
@@ -147,10 +150,10 @@
?>
<tr valign="top">
<td align="right"><b><?php print_string('topicformat', 'liveclassroom') ?>:</b></td>
- <td>
+ <td align="left">
<select name="section">
<?php
- $section = 1;
+ $section = 0;
while ($section <= $course->numsections) {
if (!$thissection = get_record('course_sections', 'course',$course->id, 'section', $section)) {
notify('Error getting course_sections!');
@@ -172,10 +175,10 @@
<tr valign="top">
<td align="right"><b><?php print_string('liveclassroomtype', 'liveclassroom')?>:</b></td>
- <td>
+ <td align="left">
<?php
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
-
+
$list_type_rooms = liveclassroom_get_list_type_rooms($course);
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-10 12:22:44
|
Revision: 78
http://svn.sourceforge.net/hw4mdl/?rev=78&view=rev
Author: shazan
Date: 2006-10-10 05:22:30 -0700 (Tue, 10 Oct 2006)
Log Message:
-----------
lang file
Modified Paths:
--------------
trunk/moodle/lang/en/liveclassroom.php
Modified: trunk/moodle/lang/en/liveclassroom.php
===================================================================
--- trunk/moodle/lang/en/liveclassroom.php 2006-10-03 14:17:12 UTC (rev 77)
+++ trunk/moodle/lang/en/liveclassroom.php 2006-10-10 12:22:30 UTC (rev 78)
@@ -42,13 +42,22 @@
$string['configsettinguniqueid'] = 'A unique prefix id so that multiple moodle instances can share one Live Classroom Server without collision.';
$string['alert.submit'] = 'Are you sure these settings are correct?';
-
+$string['liveclassroomtype'] = 'Room associated';
+//$string['basetype'] = 'Select a Room type';
+$string['lecturehall'] = 'Lecture Hall Room';
+$string['breackout'] = 'BreackOut Room';
$string['linksfor'] = 'Access Live Classrooms for ';
-$string['accessrooms'] = 'Access To Live Classrooms and Archives';
+$string['listroom'] = 'List of Rooms and Archives for ';
+$string['otherroom'] = 'Create Other Room Type...';
+$string['accessroomsteacher'] = 'Access To Live Classroom and Archives - Clik here if the popup didn\'t start';
+$string['accessroomsstudent'] = 'Access To Live Classroom - Clik here if the popup didn\'t start';
$string['managerooms'] = 'Manage Rooms and Archives (Instructors)';
$string['labelcreateroom'] = 'New Room Name: ';
$string['buttoncreateroom'] = 'Create Room';
$string['roomcreated'] = 'Room was successfully created';
+$string['requiredfields'] = 'Required Fields';
+$string['topicformat'] = 'Topic for this activity';
+$string['weeksformat'] = 'Week for this activity';
$string['wizard.text.1'] = 'Note: The first time that you enter the Live Classroom you will need to run the';
$string['wizard.text.2'] = 'setup wizard';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-03 14:17:22
|
Revision: 77
http://svn.sourceforge.net/hw4mdl/?rev=77&view=rev
Author: shazan
Date: 2006-10-03 07:17:12 -0700 (Tue, 03 Oct 2006)
Log Message:
-----------
add functions to delete room and activities linked
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-10-03 14:15:57 UTC (rev 76)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-03 14:17:12 UTC (rev 77)
@@ -33,7 +33,7 @@
require_once($CFG->libdir.'/datalib.php');
require_once("api.php");
-
+require_once($CFG->dirroot.'/course/lib.php');
//Suffixes used when creting the profiles account on the LC server
$LIVECLASSROOM_TEACHER_SUFFIX = "_T"; //Teachers will use the user $CFG->liveclassroom_settinguniqueid + $course->id + $LIVECLASSROOM_TEACHER_SUFFIX
$LIVECLASSROOM_STUDENT_SUFFIX = "_S"; //Students will use the user $CFG->liveclassroom_settinguniqueid + $course->id + $LIVECLASSROOM_STUDENT_SUFFIX
@@ -444,10 +444,31 @@
return true;
}
+function liveclassroom_rooms_delete_instance($roomid) {
+/// Given an ID of an instance of this module,
+/// this function will permanently delete the instance
+/// and any data that depends on it.
+
+ if (! $liveclassroom_rooms = get_record("liveclassroom_rooms", "room_id", "$roomid")) {
+ return false;
+ }
+
+ $result = true;
+
+ # Delete any dependent records here #
+
+ if (! delete_records("liveclassroom_rooms", "id", "$liveclassroom_rooms->id")) {
+ $result = false;
+ }
+
+ return $result;
+}
+
+
function liveclassroom_rooms_update_instance($liveclassroom_rooms) {
$liveclassroom_rooms->timemodified = time();
- $liveclassroom_rooms->id = $liveclassroom_rooms->instance;
+ // $liveclassroom_rooms->id = $liveclassroom_rooms->instance;
if(!(update_record("liveclassroom_rooms", $liveclassroom_rooms))) {
error( "Response: update of instance liveclassroom_rooms failed");
@@ -630,6 +651,39 @@
}
}
+function liveclassroom_delete_all_instance_of_room($roomid) {
+/// Given an ID of an instance of this module,
+/// this function will permanently delete the instance
+/// and any data that depends on it.
+ if (! $liveclassrooms = get_records("liveclassroom", "type", $roomid)) {
+ return false;
+ }
+ $result = true;
+
+ # Delete any dependent records here #
+ foreach($liveclassrooms as $liveclassroom){
+
+ //get the course_module instance linked to the liveclassroom instance
+ if (! $cm = get_coursemodule_from_instance("liveclassroom", $liveclassroom->id, $liveclassroom->course)) {
+ error("Course Module ID was incorrect");
+ }
+ if (! delete_course_module($cm->id)) {
+ notify("Could not delete the $cm->id (coursemodule)");
+ }
+ if (! delete_records("liveclassroom", "id", "$liveclassroom->id")) {
+ $result = false;
+ }
+ //delete in the course section too
+ if (! delete_mod_from_section($cm->id, "$cm->section")) {
+ notify("Could not delete the $mod->modulename from that section");
+ }
+
+ }
+
+ return $result;
+}
+
+
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-10-03 14:16:07
|
Revision: 76
http://svn.sourceforge.net/hw4mdl/?rev=76&view=rev
Author: shazan
Date: 2006-10-03 07:15:57 -0700 (Tue, 03 Oct 2006)
Log Message:
-----------
add session for keep data and option open/close/delete room managed
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/welcome.php
Modified: trunk/moodle/mod/liveclassroom/welcome.php
===================================================================
--- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-29 13:43:45 UTC (rev 75)
+++ trunk/moodle/mod/liveclassroom/welcome.php 2006-10-03 14:15:57 UTC (rev 76)
@@ -53,10 +53,10 @@
require_login($course->id);
- add_to_log($course->id, "liveclassroom", "view all", "index.php?id=$course->id", "");
+ //add_to_log($course->id, "liveclassroom", "view all", "index.php?id=$course->id", "");
+ session_start();
-
/// Get all required strings
$strliveclassrooms = get_string("modulenameplural", "liveclassroom");
@@ -82,9 +82,35 @@
}
//add_to_log("", "liveclassroom", "", "", "avan teacher id ".time());
$teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
+ $studentid = liveclassroom_api_get_student_user_id ($course->shortname);
//add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avan recup liste ".time());
+
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time());
+ $_SESSION['teacherid'] = $teacherid;
+ $_SESSION['studentid'] = $studentid;
+
+ if($_GET['action']=='deleteRoom') {
+
+ //delete the activities linkes to this room
+ if (! liveclassroom_delete_all_instance_of_room($_GET['roomId'])) {
+ notify("Could not delete the instances of the room");
+ }
+ //delete the room in the moodle database
+ liveclassroom_rooms_delete_instance($_GET['roomId']);
+ //delete the room on the server
+ liveclassroom_api_delete_room($_GET['roomId']);
+ }
+ else if ($_GET['action']=='openRoom') {
+ liveclassroom_api_open_room($_GET['roomId']);
+ }
+ else if ($_GET['action']=='closeRoom') {
+ liveclassroom_api_close_room($_GET['roomId']);
+ }
$tab = liveclassroom_api_get_roomandarchive_list($teacherid,$course);
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time());
+
+
+
+
?>
<head>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
@@ -346,7 +372,7 @@
if(current!="")
{
- var complete_url=url+'?roomId='+current+'&?id=<?php p($id) ?>&courseshortname=<?php p($course->shortname) ?>&'+param;
+ var complete_url=url+'?roomId='+current+'&id=<?php p($id) ?>&courseshortname=<?php p($course->shortname) ?>&'+param;
if(popup==false)
{
window.open(complete_url,"_self");
@@ -406,13 +432,9 @@
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php //for($i=0; $i<sizeof($tab[0])-2; $i=$i+3)
- //for($i=0; $i<sizeof($tab[0]); $i=$i+1)
- foreach($tab[0] as $room)
+ <?php
+ foreach($tab[0] as $room)
{
- //$tabroom=$tab[0][$i];
- //$archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid);
- // $archiveOfThisRoomID = $room[3];
?>
myString = new String("<?php p($room[1]) ?>");
@@ -484,13 +506,13 @@
retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
}
- retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>";
+ retour += "<td width=\"485px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- //retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=closeRoom')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
@@ -500,13 +522,13 @@
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=openRoom')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
+ retour +="</td><td width='469px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
<?php
@@ -517,7 +539,7 @@
<?php
?>
- retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
+ retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0 >";
<?php
foreach($room[3] as $archive)
{
@@ -542,16 +564,16 @@
?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>";
- retour += "<td width=310px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">";
+ retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"30px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>";
+ retour += "<td width=495px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">";
retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />";
retour += "<?php p($archive[1]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=closeRoom')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
{
@@ -563,13 +585,13 @@
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=openRoom')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>";
+ retour +="</td><td width='469px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>";
}
<?php
}
@@ -606,7 +628,7 @@
NumberBreakoutRoom=0;
var numberArchive=0;
var number=0;
- retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
+ retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0 >";
<?php foreach($tab[1] as $room)
{
@@ -684,13 +706,13 @@
}
- retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>";
+ retour += "<td width=\"485px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=closeRoom')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
@@ -701,13 +723,13 @@
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- //retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=openRoom')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
+ retour +="</td><td width='469px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
@@ -719,7 +741,7 @@
<?php
?>
- retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
+ retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0 >";
<?php foreach($room[3] as $archive)
{
@@ -744,16 +766,16 @@
?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>";
- retour += "<td width=310px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">";
+ retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"30px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>";
+ retour += "<td width=495px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">";
retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />";
retour += "<?php p($archive[1]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=closeRoom')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
{
@@ -765,13 +787,13 @@
{
if(studentView==false)
{
- // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'welcome.php','action=openRoom')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>";
+ retour +="</td><td width='469px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>";
}
<?php
}
@@ -1201,7 +1223,7 @@
</span>
<?php }else if (isteacher($course->id, $USER->id)) { ?>
<span id="admin_Menu">
- <table style="width: 1000" cellspacing="0" cellpadding="1" align="center">
+ <table style="width: 1000" border="0" cellspacing="0" cellpadding="1" align="center">
<tr class="button_disabled" id="menu_admin" >
<td width="9%" align="center" >
<a href="javascript:Horizon('hzA=<?php p($usersession)?>');">
@@ -1240,9 +1262,9 @@
</td>
<td style="border-right: 1px solid #666666;"> </td>
<td width="9%" align="center" >
- <!-- <a href="javascript:doOpen(false,'AddCalendarEvent.aspx','time=<%=session.getTimeOfLoad() %>&<%=session.url_params %>signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" >
- --> <img src="pictures/schedule_Black.png" border="0" alt="Schedule"
- name="schedule_icon" title="Change Availability Room" id="schedule_icon" height="24" width="24" ><br />
+ <!-- <a href="javascript:doOpen(false,'AddCalendarEvent.aspx','time=<%=session.getTimeOfLoad() %>&<%=session.url_params %>signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" >
+ --> <img src="pictures/schedule_Black.png" border="0" alt="Schedule"
+ name="schedule_icon" title="Clik on the cercle change the availability of the room" id="schedule_icon" height="24" width="24" ><br />
Availability</a>
</td>
<td width="9%" align="center" >
@@ -1255,7 +1277,7 @@
<td width="9%" align="center" >
- <a href="javascript:doOpen(false,'','action=deleteRoom')" onclick=";return confirm('Are you sure to delete this room ?');" >
+ <a href="javascript:doOpen(false,'','action=deleteRoom')" onclick=";return confirm('Are you sure to delete this room ?\n It will delete all the liveclassroom activities linked');" >
<img src="pictures/delete_Black.png" border="0"
alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br />
Delete</a>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-29 13:43:51
|
Revision: 75
http://svn.sourceforge.net/hw4mdl/?rev=75&view=rev
Author: shazan
Date: 2006-09-29 06:43:45 -0700 (Fri, 29 Sep 2006)
Log Message:
-----------
new functions :
get rooms and archives list
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-09-29 13:42:12 UTC (rev 74)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-09-29 13:43:45 UTC (rev 75)
@@ -146,7 +146,7 @@
global $LIVECLASSROOM_API_FUNCTION_CREATE_USER;
global $LIVECLASSROOM_MOODLE_PREFIX;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_USER, "&target=$userid&first_name=$rolename&last_name=$coursename");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_USER, "&target=$userid&first_name=$rolename&last_name=$coursename");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -176,7 +176,7 @@
global $LIVECLASSROOM_API_ADMIN;
global $LIVECLASSROOM_API_FUNCTION_CREATE_GROUP;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_GROUP, "&target=$groupid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_GROUP, "&target=$groupid");
if ( $respcode == 301) {
error( "Response: Authentication Failed: $resp_code");
@@ -270,13 +270,20 @@
* @param $roomid : id of the room created
* @param $roomname : name of the room created
*/
-function liveclassroom_api_create_class ($roomid, $roomname) {
+function liveclassroom_api_create_class ($roomid, $roomname,$bool) {
global $CFG;
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_CREATE_CLASS;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_CLASS,"&target=$roomid&longname=$roomname&preview=0");
-
+ if($bool==true){ //lecture room
+ $attributes = "&target=$roomid&longname=$roomname&preview=0&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1&archive=0&can_archive=1";
+ }
+ else { //discussion room
+ $attributes = "&target=$roomid&longname=$roomname&preview=0&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1&archive=0&can_archive=1&can_liveshare=1&can_ppt_import=1";
+ }
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_CLASS,$attributes);
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "apres query".time());
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -288,7 +295,7 @@
error( "Response: Cannot Create Class with id:$roomid, and name: $roomname.");
return false;
}
-
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "avan retour".time());
return true;
}
@@ -313,7 +320,7 @@
"&role_id=$role";
//DEBUG
- add_to_log("", "liveclassroom", "", "liveclassroom_api_add_user_role", "URL Sent: $url");
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_add_user_role", "URL Sent: $url");
curl_setopt($ch, CURLOPT_URL,$url);
$data = curl_exec($ch);
@@ -355,7 +362,7 @@
"&role_id=$role";
//DEBUG
- add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_user_role", "URL Sent: $url");
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_user_role", "URL Sent: $url");
curl_setopt($ch, CURLOPT_URL,$url);
$data = curl_exec($ch);
@@ -394,7 +401,7 @@
"&role_id=$role";
//DEBUG
- add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_group_role", "URL Sent: $url");
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_group_role", "URL Sent: $url");
curl_setopt($ch, CURLOPT_URL,$url);
$data = curl_exec($ch);
@@ -425,23 +432,86 @@
* @param roomid
* @return
*/
- function liveclassroom_api_get_room_list($userid) {
+ function liveclassroom_api_get_room_list($userid,$course) {
global $CFG;
global $LIVECLASSROOM_API_ADMIN,
+ $LIVECLASSROOM_API_RECORD_SEPERATOR,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=longname");
-
-
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&filter00=archive&filter00value=0&AccessUser=$userid");
+
+ $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
+// $studentuserid = "_moodle_hgh_S";
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "apres get student user id".time());
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
if ( $respcode != 100) {
return false;
}
- print $data;
- return true;
+ // print $data."<br>";
+
+ $line = explode("\n",$data);
+ $j=0;
+ $k=0;
+ // $line = strtok($data,"\n");
+ // while (!empty($currentline) ) {
+ // $currentline = strtok("\n");
+ // }
+
+ for($i=1;$i<sizeof($line)-3;$i=$i+4){
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "boucle".time());
+ if(liveclassroom_api_role_user_room(liveclassroom_parse_line($line[$i+1],"class_id="), $studentuserid)=='Student') { //lecture room
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "boucle".time());
+ $table_result[0][$j]= liveclassroom_parse_line($line[$i+1],"class_id=");
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "boucle2".$table_result[0][$j].time());
+ $table_result[0][$j+1]= liveclassroom_parse_line($line[$i],"preview=");
+ $table_result[0][$j+2]= liveclassroom_parse_line($line[$i+2],"longname=");
+ $j = $j+3;
+ }
+ else {
+ $table_result[1][$k]= liveclassroom_parse_line($line[$i+1],"class_id=");
+ $table_result[1][$k+1]= liveclassroom_parse_line($line[$i],"preview=");
+ $table_result[1][$k+2]= liveclassroom_parse_line($line[$i+2],"longname=");
+ $k = $k+3;
+ }
+
+ }
+ /*
+ $i=0;
+ $j=0;
+ $tok = split("100 OK",$data);
+ $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "avant la boucle".time());
+ foreach($tok1 as $tok1value) {
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "1ere boucle".time());
+ $line = explode("\n",$tok1value);
+ foreach ($line as $line_value) {
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", "2eme boucle".time());
+ $result = explode("=",$line_value);
+ $room_table[$result[0]]=$result[1];
+
+ if(liveclassroom_api_role_user_room($room_table['class_id'], $studentuserid)=='Student') { //lecture room
+ $table_result[0][$i] = $room_table;
+ add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", $room_table['class_id']." ".time());
+ $i++;
+ }
+ else { //breakout room
+ $table_result[1][$j] = $room_table;
+ add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_listp", $room_table['class_id']." ".time());
+ $j++;
+ }
+ //$table_result[$i]=$result[1];
+ // print $table_result[$i];
+ // $i++;
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_infos_room", $result[0]."=".$room_table[$result[0]] );
+ }
+ }
+ */
+ return $table_result;
+
+
}
@@ -458,7 +528,7 @@
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -487,7 +557,7 @@
* @param $attribute : different list of attribute for the function called
* return $data : list of the result query
*/
- function liveclassroom_api_send_query($ch,$const,$attribute) {
+ function liveclassroom_api_send_query($const,$attribute) {
global $CFG;
global $LIVECLASSROOM_API_ADMIN;
@@ -536,6 +606,7 @@
function liveclassroom_parse_line($line,$pattern) {
$response = split($pattern,$line);
+ //$result = substr($response[1],0,-1);
return $response[1];
}
@@ -545,13 +616,14 @@
* @params $roomname
* return the room_id from the server
*/
+
function liveclassroom_api_get_roomid($roomname) {
global $CFG;
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -581,7 +653,7 @@
global $CFG;
global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_DELETE_ROOM;
- liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_DELETE_ROOM,"&target=$roomid");
+ liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_DELETE_ROOM,"&target=$roomid");
if ( $respcode == 302) {
error( "Target not found");
@@ -603,7 +675,7 @@
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM;
- liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=0");
+ liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=0");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -628,7 +700,7 @@
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM;
- liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=1");
+ liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=1");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -650,52 +722,54 @@
*
* TO CHECK !!!!!
*/
-function liveclassroom_api_modify_attribute_room($roomid,$title,$description,$media_type,$student_eboard_enabled,$student_screengrab_enabled,$public_chatenable,$private_chatenable,$userlimit) {
+function liveclassroom_api_modify_room($roomid,$table_attributes) {
global $CFG;
global $LIVECLASSROOM_API_ADMIN;
global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM;
- $list_attributes_info ="&target=$roomid&longname=$title&description=$description" ;
+ //echo sizeof($table_attributes);
+ while (list($key, $val) = each($table_attributes)) {
+ if($key=='class_id'){
+ }
+ else $list_attributes .= "&".$key."=".$val;
+ }
+
+// echo $list_attributes;
+
- $list_attributes_media ="&media_type=$media_type&";
- $list_attributes_features ="&student-wb-enabled=$student_eboard_enabled" ; // GRAB TOOL ?? student-wb-liveapp
- $list_attributes_chat = "&chatenable=$public_chatenable&privatechatenable=$private_chatenable";
- $list_attributes_access = "&userlimit=$userlimit" ;
+ $final_list = "&target=$roomid".$list_attributes;
+ //echo $final_list;
- $final_list = $list_attributes_info.$list_attributes_media.$list_attributes_features.$list_attributes_chat.$list_attributes_access;
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, $final_list);
-
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, $final_list);
-
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
if ( $respcode != 100) {
return false;
}
-
-
- //Add in moodle database the new room
-
+ //modify in the moodle database!
+
return true;
}
+
/*
* 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) {
+function liveclassroom_api_get_archive_list_for_a_room($roomid,$userid) {
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");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -704,13 +778,30 @@
return false;
}
//print $data;
- $tok = split("100 OK",$data);
+
+
+ $line = explode ("\n",$data);
+
+ $j=0;
+
+ for($i=1;$i<sizeof($line)-3;$i=$i+4) {
+ $test = strstr($line[$i+1],$roomid);
+ if($test!=false) {
+ $list_return[$j][0]= liveclassroom_parse_line($line[$i],"preview=");
+ $list_return[$j][1]= liveclassroom_parse_line($line[$i+1],"class_id=");
+ $list_return[$j][2] = liveclassroom_parse_line($line[$i+2],"longname=");
+ $j++;
+ }
+ }
+
+ /*
+ $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);
+ foreach ($tok1 as $tok1_value) {
+ //for($i=0;$i<sizeof($tok1);$i++) {
+ // $test = strstr($tok1[$i],$roomid);
+ $test = strstr($tok1_value,$roomid);
if($test!=false){
// print "yrr";
// $result = liveclassroom_parse_line($tok1[$i],"class_id=");
@@ -719,8 +810,8 @@
$list_return[$j]=$response;
$j++;
}
-
}
+ */
return $list_return;
}
@@ -739,7 +830,7 @@
$name = $course->shortname;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$name");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$name");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -771,7 +862,7 @@
global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$roomid&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$roomid&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -792,7 +883,7 @@
global $LIVECLASSROOM_API_ADMIN;
global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$roomid&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1&can_archive=1&can_liveshare=1&can_ppt_import=1");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$roomid&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1&can_archive=1&can_liveshare=1&can_ppt_import=1");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -819,7 +910,7 @@
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
global $LIVECLASSROOM_API_FUNCTION_LIST_ROLE;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_LIST_ROLE, "&attribute=role_id&filter01=user_id&filter01value=$userid&filter02=object_id&filter02value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_LIST_ROLE, "&attribute=role_id&filter01=user_id&filter01value=$userid&filter02=object_id&filter02value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -849,7 +940,7 @@
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
global $LIVECLASSROOM_API_FUNCTION_LIST_USER;
- $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$lastname&filter01=first_name&filter01value=Student");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$lastname&filter01=first_name&filter01value=Student");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -858,6 +949,18 @@
return false;
}
+ $line = explode("\n",$data);
+
+// $tok = split("100 OK",$data);
+ // $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
+// $result = liveclassroom_parse_line($tok1[0],"user_id=");
+ $result = liveclassroom_parse_line($line[1],"user_id=");
+ //Remove le " " at the end of the line
+ //$response = substr($result,0,-1);
+
+ return $result;
+
+/*
$tok = split("100 OK",$data);
$tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
$result = liveclassroom_parse_line($tok1[0],"user_id=");
@@ -865,7 +968,7 @@
$response = substr($result,0,-1);
return $response;
-
+*/
}
@@ -881,7 +984,7 @@
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=preview&filter01value=0");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&filter00=class_id&filter00value=$roomid&filter01=preview&filter01value=0");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -911,7 +1014,7 @@
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");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=archive&filter01=class_id&filter01value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -999,7 +1102,7 @@
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=description&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=description&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1030,7 +1133,7 @@
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=longname&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=longname&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1064,7 +1167,7 @@
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=media_type&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=media_type&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1098,7 +1201,7 @@
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=hms_two_way_enabled&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=hms_two_way_enabled&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1134,7 +1237,7 @@
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=hms_simulcast_restricted&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=hms_simulcast_restricted&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1171,7 +1274,7 @@
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=userlimit&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=userlimit&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1204,7 +1307,7 @@
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=privatechatenable&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=privatechatenable&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1241,7 +1344,7 @@
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=can_ppt_import&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=can_ppt_import&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1278,7 +1381,7 @@
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=can_liveshare&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=can_liveshare&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1315,7 +1418,7 @@
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=can_archive&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=can_archive&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1352,7 +1455,7 @@
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=student-wb-liveapp&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=student-wb-liveapp&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1389,7 +1492,7 @@
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=student-wb-enabled&filter00=class_id&filter00value=$roomid");
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=student-wb-enabled&filter00=class_id&filter00value=$roomid");
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1427,7 +1530,7 @@
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");
+ $data = liveclassroom_api_send_query($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];
@@ -1438,16 +1541,51 @@
$tok = split("100 OK",$data);
$line = explode("\n",$tok[1]);
- for($i=0;$i<sizeof($line);$i++) {
- $result = explode("=",$line[$i]);
+ foreach ($line as $line_value) {
+ // for($i=0;$i<sizeof($line);$i++) {
+ $result = explode("=",$line_value);
$room_table[$result[0]]=$result[1];
+ // add_to_log("", "liveclassroom", "", "liveclassroom_api_get_infos_room", $result[0]."=".$room_table[$result[0]] );
}
return $room_table;
}
+/*
+* Give the user id for a room -- because of the link between the course->shortname and the user last_name
+*
+* @param $lastname : string user last_name
+* return a string : the id of the student user for a course
+*/
+function liveclassroom_api_get_teacher_user_id ($lastname){
+ global $CFG;
+ global $LIVECLASSROOM_API_ADMIN;
+ global $LIVECLASSROOM_API_RECORD_SEPERATOR;
+ global $LIVECLASSROOM_API_FUNCTION_LIST_USER;
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$lastname&filter01=first_name&filter01value=Teacher");
+
+ preg_match("(\d*)", $data, $matches);
+ $respcode = $matches[0];
+
+ if ( $respcode != 100) {
+ return false;
+ }
+ $line = explode("\n",$data);
+
+// $tok = split("100 OK",$data);
+ // $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]);
+// $result = liveclassroom_parse_line($tok1[0],"user_id=");
+ $result = liveclassroom_parse_line($line[1],"user_id=");
+ //Remove le " " at the end of the line
+ //$response = substr($result,0,-1);
+
+ return $result;
+
+}
+
/**
* Enroll the given user into the group.
*
@@ -1493,7 +1631,7 @@
}*/
/*
-function liveclassroom_api_get_room($roomname) {
+function ($roomname) {
global $CFG;
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
@@ -1510,4 +1648,193 @@
}
*/
+
+
+
+/*
+* List all the rooms and their archives associed + the orphaned archives list
+*
+* @param $userid : the user id of the current user
+* @param $course : the current course
+*
+* Return a table composed of 3 parts:
+* - a table who list all the lecture rooms and their archives associed
+* - a table who list all the breakout rooms and their archives associed
+* - a table who list all the orphaned archives
+**/
+function liveclassroom_api_get_roomandarchive_list($userid,$course) {
+
+ global $CFG;
+ global $LIVECLASSROOM_API_ADMIN,
+ $LIVECLASSROOM_API_RECORD_SEPERATOR,
+ $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&attribute=archive&AccessUser=$userid");
+
+ $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
+ preg_match("(\d*)", $data, $matches);
+ $respcode = $matches[0];
+
+ if ( $respcode != 100) {
+ return false;
+ }
+
+ $line = explode("\n",$data);
+
+ $tabarchive = array();
+ $orphanedarchives = array();
+ $rooms=array(); //lecture rooms table
+ $rooms1=array();//breakout rooms table
+
+ for($i=1;$i<sizeof($line)-4;$i=$i+5){
+
+ if((liveclassroom_parse_line($line[$i+3],"archive=")!=1)){ // it is a room
+
+ $room[0] = liveclassroom_parse_line($line[$i+1],"class_id="); //class_id
+ $room[1]= liveclassroom_parse_line($line[$i+2],"longname="); //longname
+ $room[2]= liveclassroom_parse_line($line[$i],"preview="); //preview
+ $room[3]= array();
+
+ if(liveclassroom_api_role_user_room($room[0], $studentuserid)=='Student') { //lecture room
+
+ $rooms[$room[0]]=$room;
+ }
+ else { //Breakout room
+
+ $rooms1[$room[0]]=$room;
+ }
+
+ }
+ else { // it is an archive
+
+ $archiveid=liveclassroom_parse_line($line[$i+1],"class_id=");// larchive id
+ $roomid = substr($archiveid,0,strlen($archiveid)-18);//room id
+
+ $archive=array();
+ $archive[0]=$archiveid;
+ $archive[1]=liveclassroom_parse_line($line[$i+2],"longname="); //longname
+ $archive[2]=liveclassroom_parse_line($line[$i],"preview=");
+ $archive[3]=$roomid; //preview
+ array_push($tabarchive,$archive);
+
+ }
+ }
+ foreach($tabarchive as $value) {
+ if (array_key_exists($value[3],$rooms)) { //lecture room table
+ array_push($rooms[$value[3]][3],$value);
+ }
+ else if (array_key_exists($value[3],$rooms1)) { //breakout room table
+ array_push($rooms1[$value[3]][3],$value);
+ }
+ else { //orphaned archive
+ array_push($orphanedarchives,$value);
+ }
+ }
+
+ $table_result[0]=$rooms;
+ $table_result[1]=$rooms1;
+ $table_result[2]=$orphanedarchives;
+
+ return $table_result;
+
+}
+
+function liveclassroom_create_xml() {
+
+ global $CFG;
+ global $LIVECLASSROOM_API_ADMIN,
+ $LIVECLASSROOM_API_RECORD_SEPERATOR,
+ $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
+
+ // Cr\xE9ation d'un nouvel objet document
+ $doc = new DOMDocument('1.0', 'ISO-8859-1');
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&attribute=archive&AccessUser=$userid");
+
+ $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
+ preg_match("(\d*)", $data, $matches);
+ $respcode = $matches[0];
+
+ if ( $respcode != 100) {
+ return false;
+ }
+
+ $line = explode("\n",$data);
+
+ $tabarchive = array();
+ $orphanedarchives = array();
+ $rooms=array(); //lecture rooms table
+ $rooms1=array();//breakout rooms table
+
+ for($i=1;$i<sizeof($line)-4;$i=$i+5){
+
+ if((liveclassroom_parse_line($line[$i+3],"archive=")!=1)){ // it is a room
+
+ $room[0] = liveclassroom_parse_line($line[$i+1],"class_id="); //class_id
+ $room[1]= liveclassroom_parse_line($line[$i+2],"longname="); //longname
+ $room[2]= liveclassroom_parse_line($line[$i],"preview="); //preview
+ $room[3]= array();
+
+ if(liveclassroom_api_role_user_room($room[0], $studentuserid)=='Student') { //lecture room
+
+ $rooms[$room[0]]=$room;
+
+ }
+ else { //Breakout room
+
+ $rooms1[$room[0]]=$room;
+ }
+
+ }
+ else { // it is an archive
+
+ $archiveid=liveclassroom_parse_line($line[$i+1],"class_id=");// larchive id
+ $roomid = substr($archiveid,0,strlen($archiveid)-18);//room id
+
+ $archive=array();
+ $archive[0]=$archiveid;
+ $archive[1]=liveclassroom_parse_line($line[$i+2],"longname="); //longname
+ $archive[2]=liveclassroom_parse_line($line[$i],"preview=");
+ $archive[3]=$roomid; //preview
+ array_push($tabarchive,$archive);
+
+ }
+ }
+ foreach($tabarchive as $value) {
+ if (array_key_exists($value[3],$rooms)) { //lecture room table
+ array_push($rooms[$value[3]][3],$value);
+ }
+ else if (array_key_exists($value[3],$rooms1)) { //breakout room table
+ array_push($rooms1[$value[3]][3],$value);
+ }
+ else { //orphaned archive
+ array_push($orphanedarchives,$value);
+ }
+ }
+
+ $table_result[0]=$rooms;
+ $table_result[1]=$rooms1;
+ $table_result[2]=$orphanedarchives;
+
+
+
+
+
+
+ $xml = '<racine><element>texte</element></racine>';
+ $doc->loadXML($xml);
+
+ // Cr\xE9ation de l'\xE9l\xE9ment racine
+ $root = $dom->createElement($xmlObject->root->name);
+ $dom->appendChild($root);
+
+ // appel d'une fonction r\xE9cursive qui construit l'\xE9l\xE9ment XML
+ // \xE0 partir de l'objet, en parcourant tout l'arbre de l'objet.
+ setElement($dom, $xmlObject->root, $root);
+
+ // Mise \xE0 jour du fichier source original
+ $dom->save($xmlObject->source);
+ echo $xmlObject->source;
+}
+
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-29 13:42:17
|
Revision: 74
http://svn.sourceforge.net/hw4mdl/?rev=74&view=rev
Author: shazan
Date: 2006-09-29 06:42:12 -0700 (Fri, 29 Sep 2006)
Log Message:
-----------
functions about instance creation updated
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-09-29 13:38:40 UTC (rev 73)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-09-29 13:42:12 UTC (rev 74)
@@ -232,10 +232,14 @@
function liveclassroom_create_rooms ($course) {
//teacher is the lead of the presentation
+ add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "first ".time());
liveclassroom_create_room($course->id, "Main classroom", true);
+ add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "second ".time());
liveclassroom_create_room($course->id, "Other classroom", true);
+ add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "third ".time());
//teachers and students have the same rights
liveclassroom_create_room($course->id, "Group 1", false);
+ add_to_log("", "liveclassroom", "", "liveclassroom_create_rooms", "4th ".time());
liveclassroom_create_room($course->id, "Group 2", false);
return true;
@@ -276,30 +280,19 @@
$teacherid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.$LIVECLASSROOM_TEACHER_SUFFIX;
$studentid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.$LIVECLASSROOM_STUDENT_SUFFIX;
-
- if (! liveclassroom_api_create_class ($roomid, $roomname)) {
- //error ("liveclassroom_create_room: Cannot create room with id:$roomid and name: $roomname");
- return false;
- }
- //save this room in moodle database
- $liveclassroom_rooms->course = $courseid;
- $liveclassroom_rooms->name = $roomname;
- $liveclassroom_rooms->room_id = $roomid;
- //$liveclassroom_rooms->type = $bool;
-
- liveclassroom_rooms_add_instance($liveclassroom_rooms);
- liveclassroom_rooms_add_new_type($courseid,$roomname);
-
- if (! liveclassroom_api_remove_user_role ($roomid, 'Guest' , 'Student')) {
- //error('liveclassroom_create_room: Cannot remove Participant right to Guest');
- return false;
- }
+
+ /*
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
+
+ if (! liveclassroom_api_create_class ($roomid, $roomname, $bool)) {
+ //error ("liveclassroom_create_room: Cannot create room with id:$roomid and name: $roomname");
+ return false;
+ }
if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) {
//error('liveclassroom_create_room: Cannot add classadminright to Teachers');
@@ -309,11 +302,16 @@
//error('liveclassroom_create_room: Cannot add Participant right to students');
return false;
}
- if(!liveclassroom_api_give_lectureroom_attributes($roomid)) {
- return false;
+ if (! liveclassroom_api_remove_user_role ($roomid, 'Guest' , 'Student')) {
+ //error('liveclassroom_create_room: Cannot remove Participant right to Guest');
+ return false;
}
}
else if($bool==false){ // discussion room
+ if (! liveclassroom_api_create_class ($roomid, $roomname, $bool)) {
+ //error ("liveclassroom_create_room: Cannot create room with id:$roomid and name: $roomname");
+ return false;
+ }
if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) {
//error('liveclassroom_create_room: Cannot add classadminright to Teachers');
@@ -323,11 +321,17 @@
//error('liveclassroom_create_room: Cannot add Participant right to students');
return false;
}
- if(!liveclassroom_api_give_discussionroom_attributes($roomid)) {
- return false;
- }
+ if (! liveclassroom_api_remove_user_role ($roomid, 'Guest' , 'Student')) {
+ //error('liveclassroom_create_room: Cannot remove Participant right to Guest');
+ 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;
}
@@ -369,14 +373,15 @@
*/
function liveclassroom_get_list_type_rooms($course) {
- if (!($list = get_records('liveclassroom_type_rooms','course',$course->id) )) {
+ if (!($list = get_records('liveclassroom_rooms','course',$course->id) )) {
error( "Response get list type room : query to database failed");
}
-
- $i=0;
- foreach($list as $liveclassroom_type_rooms) {
- $list_name[$i]= $liveclassroom_type_rooms->name;
- $i++;
+ $list_name=array();
+ //$i=0;
+ foreach($list as $liveclassroom_rooms) {
+ array_push($list_name,$liveclassroom_rooms->name);
+ //$list_name[$i]= $liveclassroom_rooms->name;
+ //$i++;
}
return $list_name;
@@ -439,7 +444,18 @@
return true;
}
+function liveclassroom_rooms_update_instance($liveclassroom_rooms) {
+ $liveclassroom_rooms->timemodified = time();
+ $liveclassroom_rooms->id = $liveclassroom_rooms->instance;
+
+ if(!(update_record("liveclassroom_rooms", $liveclassroom_rooms))) {
+ error( "Response: update of instance liveclassroom_rooms failed");
+ //return false;
+ }
+ return true;
+}
+
/*
* Create a new type to liveclassroom Room
* @param $name : the name of the type
@@ -492,26 +508,18 @@
}
-function widget_add_instance($roomname,$bool){
-
- //Add new room into the LC server
- liveclassroom_create_room ($courseid, $roomname, $bool) ;
- //Add new room in Moodle database
- liveclassroom_rooms_add_new_type($roomname);
-}
-function widget_delete_instance() {
- //delete the room from the server
- liveclassroom_api_delete_room($roomid);
- //delete the room from the moodle database
-/* if(!(delete_record("liveclassroom_type_rooms", $liveclassroom_type_room))) {
- error( "Response: creation of new type $name failed");
- }
-*/
-}
-function widget_update_instance() {
-
+function liveclassroom_get_room_id($course,$roomnane){
+ if(!($rooms = get_records('liveclassroom_rooms','course',$course->id))) {
+ error( "Response get roomid : query to database failed");
+ }
+ foreach($rooms as $room){
+ if (($room->name)==$roomnane){
+ $roomid = $room->room_id;
+ }
+ }
+ return $roomid;
}
/*
@@ -550,56 +558,16 @@
return $list_roomid;
}
-/*
-* List all the room "Lecture or Main rooms" and all the room "Breackout or Discussion rooms" for a course given
-* @param $course
-* return a table 2 dimensions with all the room name
-*/
-function liveclassroom_get_main_room_list($course) {
-
- $list_roomid = liveclassroom_get_roomid_list($course);
- $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
-
- $j=0;
- $k=0;
- for($i=0;$i<sizeof($list_roomid);$i++) {
- $role = liveclassroom_api_role_user_room($list_roomid[$i], $studentuserid);
- if($role=='Student') {
- //$list_return[0][$j] = liveclassroom_get_room_name_from_id($list_roomid[$i]);
- $list_return[0][$j] = $list_roomid[$i];
- $j++;
- }
- else if($role=='Instructor'){
- // $list_return[1][$k] = liveclassroom_get_room_name_from_id($list_roomid[$i]);
- $list_return[1][$k] = $list_roomid[$i];
- $k++;
- }
- }
- return $list_return;
-}
-
-/*
-* List all the room "Breackout or Discussion rooms" for a course given
-* @param $course
-* Return a table with all the room name considering as a breackout/discussion room
-*/
-function liveclassroom_get_breackout_room_list($course) {
-
- $list_roomid = liveclassroom_get_roomid_list($course);
+function liveclassroom_test_get_room_list($course) {
- $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
- $j=0;
- for($i=0;$i<sizeof($list_roomid);$i++) {
- $role = liveclassroom_api_role_user_room($list_roomid[$i], $studentuserid);
- if($role=='Instructor') {
- $list_return[$j] = liveclassroom_get_room_name_from_id($list_roomid[$i]);
- $j++;
- }
- }
- return $list_return;
+// $list_roomid = liveclassroom_get_roomid_list($course);
+ $studentuserid = liveclassroom_api_get_student_user_id($course->shortname);
+ $teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
+ liveclassroom_api_get_room_list($teacherid);
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-29 13:38:45
|
Revision: 73
http://svn.sourceforge.net/hw4mdl/?rev=73&view=rev
Author: shazan
Date: 2006-09-29 06:38:40 -0700 (Fri, 29 Sep 2006)
Log Message:
-----------
1 table remove
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/db/mysql.sql
Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql
===================================================================
--- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-09-29 13:38:03 UTC (rev 72)
+++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-09-29 13:38:40 UTC (rev 73)
@@ -52,20 +52,6 @@
PRIMARY KEY (`id`)
) COMMENT='Defines liveclassroom rooms';
-CREATE TABLE `prefix_liveclassroom_type_rooms` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `course` int(10) unsigned NOT NULL default '0',
- `name` varchar(255) NOT NULL default '',
- `lc_id` int(10) unsigned NOT NULL default '0',
- `room_id` varchar(255) NOT NULL default '',
- PRIMARY KEY (`id`)
-) COMMENT='Defines liveclassroom rooms';
-
-
-INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'Main classroom', '0','');
-INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'Other classroom', '0','');
-INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'Group 1', '0','');
-INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'Group 2', '0','');
# --------------------------------------------------------
# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-29 13:38:10
|
Revision: 72
http://svn.sourceforge.net/hw4mdl/?rev=72&view=rev
Author: shazan
Date: 2006-09-29 06:38:03 -0700 (Fri, 29 Sep 2006)
Log Message:
-----------
rooms, archives and orphaned archives are now get in one request to the server.
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/index.php
trunk/moodle/mod/liveclassroom/welcome.php
Modified: trunk/moodle/mod/liveclassroom/index.php
===================================================================
--- trunk/moodle/mod/liveclassroom/index.php 2006-09-29 13:34:33 UTC (rev 71)
+++ trunk/moodle/mod/liveclassroom/index.php 2006-09-29 13:38:03 UTC (rev 72)
@@ -45,8 +45,6 @@
error("Course ID is incorrect");
}
- //$id = require_param('id', 0, PARAM_INT);
- //require_variable($id); // course
global $CFG;
if (! $course = get_record("course", "id", $id)) {
@@ -107,18 +105,7 @@
<td align="right"><img src="pictures/logo.gif" /></td>
</tr>
</table>
-
- <?php
- //echo liveclassroom_api_get_room_name('_moodle_1c1_23459_2006_0913_0856_47');
- /*
- $tab = liveclassroom_api_get_archive_list_for_a_room('_moodle_1c1_244459');
- for($j=0;$j<sizeof($tab);$j++){
- echo $tab[$j];
- }
-*/
- ?>
-
</body>
Modified: trunk/moodle/mod/liveclassroom/welcome.php
===================================================================
--- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-29 13:34:33 UTC (rev 71)
+++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-29 13:38:03 UTC (rev 72)
@@ -39,14 +39,12 @@
$course = optional_param('course', 0, PARAM_INT);
$roomname = optional_param('idroomname', 0, PARAM_TEXT);
- //$roomid = optional_param('idroom', 0, PARAM_TEXT);
+
if (! $room = get_record("liveclassroom", "course", $id)) {
error("Course ID is incorrect");
}
-
- //$id = require_param('id', 0, PARAM_INT);
- //require_variable($id); // course
+
global $CFG;
if (! $course = get_record("course", "id", $id)) {
@@ -57,7 +55,8 @@
add_to_log($course->id, "liveclassroom", "view all", "index.php?id=$course->id", "");
-
+
+
/// Get all required strings
$strliveclassrooms = get_string("modulenameplural", "liveclassroom");
@@ -81,11 +80,11 @@
notice("There are no liveclassrooms", "../../course/view.php?id=$course->id");
die;
}
-
+ //add_to_log("", "liveclassroom", "", "", "avan teacher id ".time());
$teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
- add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avan recup liste ".time());
- $tab = liveclassroom_api_get_room_list($teacherid,$course);
- add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time());
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avan recup liste ".time());
+ $tab = liveclassroom_api_get_roomandarchive_list($teacherid,$course);
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time());
?>
<head>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
@@ -298,7 +297,7 @@
}
getMainLectureRoom("");
getBreakoutRoom("");
- //getOrphanedArchive("");
+ getOrphanedArchive("");
if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block")
document.getElementById("info").style.display="none";
current="";
@@ -402,22 +401,21 @@
var NumberOrphanedRoom=0;
function getMainLectureRoom(search)
{
-
-
var retour="";
NumberMainLectureRoom=0;
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php for($i=0; $i<sizeof($tab[0])-2; $i=$i+3)
+ <?php //for($i=0; $i<sizeof($tab[0])-2; $i=$i+3)
+ //for($i=0; $i<sizeof($tab[0]); $i=$i+1)
+ foreach($tab[0] as $room)
{
- // print ($tab[0][$i]);
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avant archive list ".$i.": ".time());
- $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid);
- //$archiveOfThisRoomID=new array[];
- //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres archive list ".$i.": ".time());
+ //$tabroom=$tab[0][$i];
+ //$archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid);
+ // $archiveOfThisRoomID = $room[3];
+
?>
- myString = new String("<?php p($tab[0][$i+2]) ?>");
+ myString = new String("<?php p($room[1]) ?>");
mysearch=new String(search);
// mysearch=mysearch.toLowerCase();
results = myString.match(mysearch)
@@ -425,7 +423,7 @@
{
var preview;
<?php
- if($tab[0][$i+1]==1)
+ if($room[2]==1)
{
?>
preview=true;
@@ -440,27 +438,28 @@
?>
if(studentView==false || ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">"
+ retour += "<tr id='<?php p($room[0]) ?>' Onclick=\"OneClick('<?php p($room[0]) ?>')\">"
if(studentView==false)
{
<?php
- if(sizeof($archiveOfThisRoomID)>0)
- {
+ if(sizeof($room[3])>0)
+
+ {
?>
numberArchive++;
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td>";
- retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[0][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[0][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td>";
+ retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($room[0]) ?>hide')\" name=\"toggleimg<?php p($room[0]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
<?php
}
else
{
?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
<?php
}
?>
@@ -481,11 +480,11 @@
else
{
*/?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
}
- retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><?php p($tab[0][$i+2]) ?></td>";
+ retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>";
if(!preview)
{
if(studentView==false)
@@ -494,7 +493,7 @@
//retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
else
@@ -505,29 +504,30 @@
// retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
<?php
- if(sizeof($archiveOfThisRoomID)>0)
+ if(sizeof($room[3])>0)
{
?>
- retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[0][$i]) ?>hide'>";
+ retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($room[0]) ?>hide'>";
<?php
- //$archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid);
+
?>
retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
- <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++)
+ <?php
+ foreach($room[3] as $archive)
{
/*
if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()))
orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/
?>
var preview;
- <?php if($archiveOfThisRoomID[$j][0]==1)
- //if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j]))
+ <?php if($archive[2]==1)
+
{
?>
preview=true;
@@ -542,10 +542,10 @@
?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($archiveOfThisRoomID[$j][1]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j[1]]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td>";
- retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\">";
+ retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>";
+ retour += "<td width=310px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">";
retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />";
- retour += "<?php p($archiveOfThisRoomID[$j][2]) ?></td>";
+ retour += "<?php p($archive[1]) ?></td>";
if(!preview)
{
if(studentView==false)
@@ -555,7 +555,7 @@
}
else
{
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
}
@@ -567,9 +567,9 @@
// retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td></tr>";
+ retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>";
}
<?php
}
@@ -607,12 +607,13 @@
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php for($i=0; $i<sizeof($tab[1])-2; $i=$i+3)
+ <?php foreach($tab[1] as $room)
+
{
- $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i],$teacherid);
+
?>
- myString = new String("<?php p($tab[1][$i+2]) ?>");
+ myString = new String("<?php p($room[1]) ?>");
mysearch=new String(search);
//mysearch=mysearch.toLowerCase();
results = myString.match(mysearch)
@@ -620,7 +621,7 @@
{
var preview;
<?php
- if($tab[1][$i+1]==1)
+ if($room[2]==1)
{
?>
preview=true;
@@ -635,26 +636,26 @@
?>
if(studentView==false || ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">"
+ retour += "<tr id='<?php p($room[0]) ?>' Onclick=\"OneClick('<?php p($room[0]) ?>')\">"
if(studentView==false)
{
<?php
- if(sizeof($archiveOfThisRoomID)>0)
+ if(sizeof($room[3])>0)
{
?>
numberArchive++;
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td>";
- retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[1][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[1][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td>";
+ retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($room[0]) ?>hide')\" name=\"toggleimg<?php p($room[0]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
<?php
}
else
{
?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
<?php
}
?>
@@ -678,12 +679,12 @@
%>
*/
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>";
}
- retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><?php p($tab[1][$i+2]) ?></td>";
+ retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>";
if(!preview)
{
if(studentView==false)
@@ -692,7 +693,7 @@
// retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
@@ -704,30 +705,31 @@
//retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
<?php
- if(sizeof($archiveOfThisRoomID)>0)
+ if(sizeof($room[3])>0)
{
?>
- retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[1][$i]) ?>hide'>";
+ retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($room[0]) ?>hide'>";
<?php
- // $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i],$teacherid);
+
?>
retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
- <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++)
+ <?php foreach($room[3] as $archive)
+
{
/*
if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()))
orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/
?>
var preview;
- <?php if($archiveOfThisRoomID[$j][0]==1)
- //if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j]))
+ <?php if($archive[2]==1)
+
{
?>
preview=true;
@@ -742,10 +744,10 @@
?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($archiveOfThisRoomID[$j][1]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td>";
- retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\">";
+ retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>";
+ retour += "<td width=310px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">";
retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />";
- retour += "<?php p($archiveOfThisRoomID[$j][2]) ?></td>";
+ retour += "<?php p($archive[1]) ?></td>";
if(!preview)
{
if(studentView==false)
@@ -755,7 +757,7 @@
}
else
{
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
}
@@ -767,9 +769,9 @@
// retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td></tr>";
+ retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>";
}
<?php
}
@@ -802,50 +804,53 @@
}
-/*
+
function getOrphanedArchive(search)
{
NumberOrphanedRoom=0;
var retour="";
- retour += " <table width=460px cellspacing=0 border=0 >";
- <% for(i=0; i<orphanedArchive.Count; i++)
+ retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
+
+ <?php foreach($tab[2] as $room)
+ // for(i=0; i<orphanedArchive.Count; i++)
{
- %>
- myString = new String("<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname().ToLower()%>");
+ ?>
+ myString = new String("<?php p($room[1]) ?>");
mysearch=new String(search);
- mysearch=mysearch.toLowerCase();
+ // mysearch=mysearch.toLowerCase();
results = myString.match(mysearch);
if(search==null || results!=null)
{
var preview;
- <%if(((LCRoom)orphanedArchive.GetByIndex(i)).isPreview())
+ <?php
+ if($room[2]==1)
{
- %>
+ ?>
preview=true;
- <%
+ <?php
}
else
{
- %>
+ ?>
preview=false;
- <%
+ <?php
}
- %>
+ ?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\">";
- retour += "<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" ></td>";
- retour += "<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" ></td>";
+ retour += "<tr id='<?php p($room[0]) ?>' Onclick=\"OneClick('<?php p($room[0]) ?>')\">";
+ retour += "<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\" ></td>";
+ retour += "<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\" ></td>";
- retour += "<td width=300px onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\">";
+ retour += "<td width=300px onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\">";
- retour += "<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname()%></td>";
+ retour += "<?php p($room[1]) ?></td>";
if(!preview)
{
if(studentView==false)
retour +="<td width=\"20px\" align=\"center\" ><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
else
- retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
}
else
{
@@ -855,15 +860,15 @@
retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"20px\" align=\"center\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"20px\" align=\"center\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>";
NumberOrphanedRoom++;
}
}
- <%
+ <?php
}
- %>
+ ?>/*
<% for(i=0; i<orphanedArchiveForStudent.Count; i++)
{
%>
@@ -914,14 +919,14 @@
}
<%
}
- %>
+ %>*/
retour += "</table>";
document.getElementById("orphaned").innerHTML = retour;
- gestionDisplay();
+ //gestionDisplay();
if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5)
correctPNG();
}
-*/
+
function gestionDisplay(type)
{
@@ -1249,8 +1254,7 @@
<td width="9%" align="center" >
- <a href="javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=deleteRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" onclick=";return confirm('Are you sure to delete this room ?');" >
-
+
<a href="javascript:doOpen(false,'','action=deleteRoom')" onclick=";return confirm('Are you sure to delete this room ?');" >
<img src="pictures/delete_Black.png" border="0"
alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br />
@@ -1334,7 +1338,7 @@
getMainLectureRoom();
getBreakoutRoom();
- //getOrphanedArchive();
+ getOrphanedArchive();
if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-29 13:34:41
|
Revision: 71
http://svn.sourceforge.net/hw4mdl/?rev=71&view=rev
Author: shazan
Date: 2006-09-29 06:34:33 -0700 (Fri, 29 Sep 2006)
Log Message:
-----------
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/view.php
Modified: trunk/moodle/mod/liveclassroom/view.php
===================================================================
--- trunk/moodle/mod/liveclassroom/view.php 2006-09-29 13:31:54 UTC (rev 70)
+++ trunk/moodle/mod/liveclassroom/view.php 2006-09-29 13:34:33 UTC (rev 71)
@@ -67,24 +67,7 @@
add_to_log($course->id, "liveclassroom", "view", "view.php?id=$cm->id", "$liveclassroom->id");
-
- // Check if the rooms exist on the server
- if(!(liveclassroom_api_user_exist($course))){
- // make sure the profiles exist
- if (!liveclassroom_create_profiles ($course)) {
- error ("Cannot create liveclassroom profiles");
- }
- liveclassroom_create_rooms ($course);
- }
- else {
- //update le lc with it room id
- /*$name = liveclassroom_get_room_name($course, $liveclassroom->type);
- $lcr = get_record("liveclassroom_rooms", "course", $course->id, "name", $name);
- $liveclassroom->room_id = $lcr->room_id;
- update_record('liveclassroom', $liveclassroom);*/
- }
-
-
+
// Create the session for this user
if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) {
error ("Cannot create session");
@@ -149,8 +132,8 @@
</script>
<?php
//$classid = liveclassroom_api_get_roomid(liveclassroom_get_room_name($course,liveclassroom_get_type($liveclassroom)));
- $classid = $liveclassroom->room_id;
- if (isstudent($course->id)) {
+ $classid = $liveclassroom->type;
+ if ((isstudent($course->id)) or (isteacher($course->id, $USER->id))) {
?>
<body onload="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>' )">
</body>
@@ -172,45 +155,26 @@
</tr>
<tr ><td style="border-bottom: 1px solid #999;"><span class='fnt0'></span>
</td></tr>
- <tr>
+
+
+
+
+<?php
+ if ( (isteacher($course->id, $USER->id))|| (isstudent($course->id)) ) {
+?>
+ <tr>
<td>
<a href="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>')">
- <?php p(get_string("accessrooms", 'liveclassroom')) ?>
+ <?php p(get_string("accessroomsstudent", 'liveclassroom')) ?>
</a>
</td>
</tr>
+
<?php
- if (isteacher($course->id, $USER->id)) {
-
+}
?>
- <tr>
- <td>
- <a href="javascript:doOpenAdmin('<?php p($CFG->liveclassroom_servername)?>/admin/?hzA=<?php p($usersession)?>&closeOnExit=1')">
- <?php p(get_string('managerooms', 'liveclassroom')) ?>
- </a>
- </td>
- <tr>
-
-
- <!-- REMOVE THIS
- <tr>
- <td>
- <form method="get" name="createRoom" action="create.php">
- <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>"
- <label for="createroomname"><?php echo get_string('labelcreateroom', 'liveclassroom') ?></label>
- <input id="createroomname" type="text" size="10" name="roomname">
- <input type="hidden" name="id" value="<?php echo $course->id ?>">
- <input type="submit" value="<?php echo get_string('buttoncreateroom', 'liveclassroom') ?>">
- </form>
- </td>
- </tr>
- -->
-<?php
- }
-?>
-
<tr >
<td>
<em><font size="-1">
@@ -239,7 +203,8 @@
</tr>
</table>
-
+</td>
+ </tr>
<tr style="background-color:#EEEEEE; font-weight:normal; color:black;"><td style="border-right:1px solid #999;"> </td><td> </td></tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-29 13:32:08
|
Revision: 70
http://svn.sourceforge.net/hw4mdl/?rev=70&view=rev
Author: shazan
Date: 2006-09-29 06:31:54 -0700 (Fri, 29 Sep 2006)
Log Message:
-----------
room id add to the instance on creation
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/mod.html
Modified: trunk/moodle/mod/liveclassroom/mod.html
===================================================================
--- trunk/moodle/mod/liveclassroom/mod.html 2006-09-26 13:36:58 UTC (rev 69)
+++ trunk/moodle/mod/liveclassroom/mod.html 2006-09-29 13:31:54 UTC (rev 70)
@@ -5,14 +5,27 @@
require_once($CFG->dirroot.'/calendar/lib.php');
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
$id = optional_param('id', 0, PARAM_INT);
+
+ require_once("../config.php");
+
+ require_login($course->id);
- if ($id) {
-
- if (! $course = get_record("course", "id", $id)) {
- error("Course is misconfigured");
- }
-
- }
+ if (!isteacher($course->id, $USER->id)) { //to Be sure
+ error("You need to be a teacher in this course to c reate an instance");
+ }
+
+ // Check if the rooms exist on the server
+ if(!(liveclassroom_api_user_exist($course))){
+ // make sure the profiles exist
+ if (!liveclassroom_create_profiles ($course)) {
+ error ("Cannot create liveclassroom profiles");
+ }
+ liveclassroom_create_rooms ($course);
+ }
+ else {
+
+ }
+
/// First we check that form variables have been initialised
if (!isset($form->name)) {
$form->name = '';
@@ -29,6 +42,7 @@
if (!isset($form->section)) {
$form->section = '';
}
+
if (empty($form->timeopen)) {
$form->timeopen = "";
$form->timerestrict = 0;
@@ -77,11 +91,17 @@
<?php
if($course->format == "weeks"){
//Display the lsit of the weeks
- $timenow = time();
- $weekdate = $course->startdate; // this should be 0:00 Monday of that week
+
+ ?>
+ <td align="right"><b><?php print_string('weeksformat', 'liveclassroom')?>:</b></td>
+ <td>
+ <SELECT name="section">
+ <?php
+
+ $weekdate = $course->startdate; // this should be 0:00 Monday of that week
$weekdate += 7200; // Add two hours to avoid possible DST problems
$section = 1;
- $sectionmenu = array();
+ // $sectionmenu = array();
$weekofseconds = 604800;
$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
$k=0;
@@ -90,34 +110,58 @@
$weekday = userdate($weekdate, '%d %B') ;
$endweekday = userdate($weekdate+518400, '%d %B');
$list_weeks[$k] = $weekday.' - '.$endweekday;
+ ?>
+ <OPTION <?php if($_GET['section']==$k+1) { echo "selected"; }?> VALUE="<?php p($k+1) ?>"><?php p($list_weeks[$k]) ?></OPTION>
+ <?php
$k++;
$section++;
$weekdate = $nextweekdate;
}
-
- ?>
- <td align="right"><b><?php print_string('weeksformat', 'liveclassroom')?>:</b></td>
- <td>
- <SELECT name="section">
- <?php
- for($i=0;$i<sizeof($list_weeks);$i++) {
+
?>
-
- <OPTION <?php if($_GET['section']==$i+1) { echo "selected"; }?> VALUE="<?php p($i+1) ?>"><?php p($list_weeks[$i]) ?></OPTION>
-
- <?php
- }
- ?>
- </SELECT>
+ </SELECT>
</td>
<?php
}
- else if($course->format == "topics"){ ?>
+ else if($course->format == "topics"){
+ // Delete all the < ...>
+ function supprimer_tags($texte, $rempl = "") {
+ $texte = ereg_replace("< [^>]*>", $rempl, $texte);
+ return $texte;
+ }
+
+ function textebrut($texte) {
+ $texte = ereg_replace("[\n\r]+", " ", $texte);
+ $texte = eregi_replace("< (p|br)([[:space:]][^>]*)?".">", "\n\n", $texte);
+ $texte = ereg_replace("^\n+", "", $texte);
+ $texte = ereg_replace("\n+$", "", $texte);
+ $texte = ereg_replace("\n +", "\n", $texte);
+ $texte = supprimer_tags($texte);
+ $texte = ereg_replace("( | )+", " ", $texte);
+ return $texte;
+ }
+
+ function txt($chaine){
+ return str_replace("<br />", "\n" ,$chaine);
+ }
+ ?>
<tr valign="top">
- <td align="right"><b><?php print_string("topicformat") ?>:</b></td>
+ <td align="right"><b><?php print_string('topicformat', 'liveclassroom') ?>:</b></td>
<td>
- <select>
- <option value="">
+ <select name="section">
+ <?php
+ $section = 1;
+ while ($section <= $course->numsections) {
+ if (!$thissection = get_record('course_sections', 'course',$course->id, 'section', $section)) {
+ notify('Error getting course_sections!');
+ }
+
+ ?>
+ <OPTION <?php if($_GET['section']==$section) { echo "selected"; }?> title="<?php p($thissection->summary) ?>" value="<?php p($section) ?>">Topic <?php p($section) ?></OPTION>
+ <?php
+ $section++;
+ }
+ ?>
</select>
</td>
</tr>
@@ -131,20 +175,16 @@
<td>
<?php
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
- //Get the list of type of rooms available
- if(!(liveclassroom_api_user_exist($course))){
- $list_type_rooms = liveclassroom_get_list_type_rooms_first_time();
- }
- else {
- $list_type_rooms = liveclassroom_get_list_type_rooms($course);
- }?>
+
+ $list_type_rooms = liveclassroom_get_list_type_rooms($course);
+ ?>
<SELECT name="type">
<?php
for($i=0;$i<sizeof($list_type_rooms);$i++) {
?>
- <OPTION <?php if(liveclassroom_get_room_name_from_id($_GET['roomId'])==$list_type_rooms[$i]){ echo "selected"; } ?> VALUE="<?php p($list_type_rooms[$i]) ?>"><?php p($list_type_rooms[$i]) ?></OPTION>
+ <OPTION <?php if(($_GET['roomId']!=null)&&(liveclassroom_get_room_name_from_id($_GET['roomId']))==$list_type_rooms[$i]){ echo "selected"; } ?> VALUE="<?php p(liveclassroom_get_room_id($course,$list_type_rooms[$i])) ?>"><?php p($list_type_rooms[$i]) ?></OPTION>
<?php
}
@@ -152,6 +192,7 @@
?>
</SELECT>
</td>
+
</tr>
@@ -183,26 +224,8 @@
</td>
</tr>
-
-
-<!--
-
-<table width="100%" border="1" bgcolor="#DDDDDD" cellpadding="0">
-<tr border="1">
- <td>
- <font color="red">*</font><?php print_string('requiredfields', 'liveclassroom')?>
- </td>
- <td align="right">
- <input type="reset" value="<?php print_string("cancel") ?>" />
- <input type="submit" value="<?php print_string("add") ?>" />
- </td>
-
-
</table>
-</tr>
--->
-</table>
<!-- These hidden variables are always the same -->
<input type="hidden" name=course value="<?php p($form->course) ?>" />
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
@@ -214,5 +237,4 @@
<input type="hidden" name=mode value="<?php p($form->mode) ?>" />
</center>
-
</form>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sh...@us...> - 2006-09-26 13:37:08
|
Revision: 69
http://svn.sourceforge.net/hw4mdl/?rev=69&view=rev
Author: shazan
Date: 2006-09-26 06:36:58 -0700 (Tue, 26 Sep 2006)
Log Message:
-----------
last version for displaying the list on the widget
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/welcome.php
Modified: trunk/moodle/mod/liveclassroom/welcome.php
===================================================================
--- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-19 09:50:18 UTC (rev 68)
+++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-26 13:36:58 UTC (rev 69)
@@ -82,7 +82,10 @@
die;
}
- $tab = liveclassroom_get_main_room_list($course);
+ $teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
+ add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avan recup liste ".time());
+ $tab = liveclassroom_api_get_room_list($teacherid,$course);
+ add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time());
?>
<head>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
@@ -393,27 +396,28 @@
document.getElementById("croix").style.display="none";
}
-
+<?php add_to_log("", "liveclassroom", "", "getMainLectureRoom", "debut ".time()); ?>
var NumberMainLectureRoom=0;
var NumberBreakoutRoom=0;
var NumberOrphanedRoom=0;
function getMainLectureRoom(search)
{
- <?php
- $tab_main = $tab[0];
- ?>
var retour="";
NumberMainLectureRoom=0;
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php for($i=0; $i<sizeof($tab_main); $i++)
+ <?php for($i=0; $i<sizeof($tab[0])-2; $i=$i+3)
{
// print ($tab[0][$i]);
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avant archive list ".$i.": ".time());
+ $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid);
+ //$archiveOfThisRoomID=new array[];
+ //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres archive list ".$i.": ".time());
?>
- myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab_main[$i])) ?>");
+ myString = new String("<?php p($tab[0][$i+2]) ?>");
mysearch=new String(search);
// mysearch=mysearch.toLowerCase();
results = myString.match(mysearch)
@@ -421,7 +425,7 @@
{
var preview;
<?php
- if(!liveclassroom_api_room_is_preview($tab_main[$i]))
+ if($tab[0][$i+1]==1)
{
?>
preview=true;
@@ -436,27 +440,27 @@
?>
if(studentView==false || ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($tab_main[$i]) ?>' Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\">"
+ retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">"
if(studentView==false)
{
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]))>0)
+ if(sizeof($archiveOfThisRoomID)>0)
{
?>
numberArchive++;
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"></td>";
- retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab_main[$i]) ?>hide')\" name=\"toggleimg<?php p($tab_main[$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td>";
+ retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[0][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[0][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
<?php
}
else
{
?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
<?php
}
?>
@@ -477,42 +481,42 @@
else
{
*/?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
}
- retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab_main[$i])) ?></td>";
+ retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><?php p($tab[0][$i+2]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ //retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
else
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td></tr>";
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]))>0)
+ if(sizeof($archiveOfThisRoomID)>0)
{
?>
- retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab_main[$i]) ?>hide'>";
+ retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[0][$i]) ?>hide'>";
<?php
- $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]);
+ //$archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid);
?>
retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
<?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++)
@@ -522,7 +526,8 @@
orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/
?>
var preview;
- <?php if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j]))
+ <?php if($archiveOfThisRoomID[$j][0]==1)
+ //if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j]))
{
?>
preview=true;
@@ -537,20 +542,20 @@
?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($archiveOfThisRoomID[$j]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"></td>";
- retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\">";
+ retour += "<tr id='<?php p($archiveOfThisRoomID[$j][1]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j[1]]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td>";
+ retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\">";
retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />";
- retour += "<?php p(liveclassroom_api_get_room_name($archiveOfThisRoomID[$j])) ?></td>";
+ retour += "<?php p($archiveOfThisRoomID[$j][2]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
{
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
}
@@ -558,13 +563,13 @@
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"></td></tr>";
+ retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td></tr>";
}
<?php
}
@@ -591,25 +596,23 @@
if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5)
correctPNG();
}
+<?php add_to_log("", "liveclassroom", "", "getMainLectureRoom", "fin ".time()); ?>
-
function getBreakoutRoom(search)
{
-
- <?php
- $tab_breakout = $tab[1];
- ?>
+
var retour="";
NumberBreakoutRoom=0;
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php for($i=0; $i<sizeof($tab_breakout); $i++)
+ <?php for($i=0; $i<sizeof($tab[1])-2; $i=$i+3)
{
+ $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i],$teacherid);
?>
- myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab_breakout[$i])) ?>");
+ myString = new String("<?php p($tab[1][$i+2]) ?>");
mysearch=new String(search);
//mysearch=mysearch.toLowerCase();
results = myString.match(mysearch)
@@ -617,7 +620,7 @@
{
var preview;
<?php
- if(!liveclassroom_api_room_is_preview($tab_breakout[$i]))
+ if($tab[1][$i+1]==1)
{
?>
preview=true;
@@ -632,26 +635,26 @@
?>
if(studentView==false || ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($tab_breakout[$i]) ?>' Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\">"
+ retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">"
if(studentView==false)
{
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]))>0)
+ if(sizeof($archiveOfThisRoomID)>0)
{
?>
numberArchive++;
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"></td>";
- retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab_breakout[$i]) ?>hide')\" name=\"toggleimg<?php p($tab_breakout[$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td>";
+ retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[1][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[1][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
<?php
}
else
{
?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
<?php
}
?>
@@ -675,21 +678,21 @@
%>
*/
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
}
- retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab_breakout[$i])) ?></td>";
+ retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><?php p($tab[1][$i+2]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
@@ -697,23 +700,23 @@
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ //retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td></tr>";
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]))>0)
+ if(sizeof($archiveOfThisRoomID)>0)
{
?>
- retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab_breakout[$i]) ?>hide'>";
+ retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[1][$i]) ?>hide'>";
<?php
- $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]);
+ // $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i],$teacherid);
?>
retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
<?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++)
@@ -723,7 +726,8 @@
orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/
?>
var preview;
- <?php if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j]))
+ <?php if($archiveOfThisRoomID[$j][0]==1)
+ //if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j]))
{
?>
preview=true;
@@ -738,20 +742,20 @@
?>
if(studentView==false|| ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($archiveOfThisRoomID[$j]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"></td>";
- retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\">";
+ retour += "<tr id='<?php p($archiveOfThisRoomID[$j][1]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td>";
+ retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\">";
retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />";
- retour += "<?php p(liveclassroom_api_get_room_name($archiveOfThisRoomID[$j])) ?></td>";
+ retour += "<?php p($archiveOfThisRoomID[$j][2]) ?></td>";
if(!preview)
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
{
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
}
@@ -759,13 +763,13 @@
{
if(studentView==false)
{
- retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
- retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
+ // retour +="<td width=\"16px\" align=\"center\"><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=openRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"";
+ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j]) ?>')\"></td></tr>";
+ retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td></tr>";
}
<?php
}
@@ -793,7 +797,7 @@
if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5)
correctPNG();
}
-
+<?php add_to_log("", "liveclassroom", "", "getBreakoutRoom ", "fin ".time()); ?>
function deleteRoom() {
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <sh...@us...> - 2006-09-19 09:49:08
|
Revision: 67
http://svn.sourceforge.net/hw4mdl/?rev=67&view=rev
Author: shazan
Date: 2006-09-19 02:49:00 -0700 (Tue, 19 Sep 2006)
Log Message:
-----------
widget updated
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/manageRoom.php
trunk/moodle/mod/liveclassroom/welcome.php
Modified: trunk/moodle/mod/liveclassroom/manageRoom.php
===================================================================
--- trunk/moodle/mod/liveclassroom/manageRoom.php 2006-09-19 09:47:52 UTC (rev 66)
+++ trunk/moodle/mod/liveclassroom/manageRoom.php 2006-09-19 09:49:00 UTC (rev 67)
@@ -18,17 +18,32 @@
* *
* Class: *
* *
- * Author: Rollinger Thomas *
+ * Author: Hazan Samy *
* *
- * Date: Mai 2006 *
+ * Date: September 2006 *
* *
******************************************************************************/
+
require_once("../../config.php");
require_once("lib.php");
- global $CFG;
- //$v = $_GET["v"];
- $roomId = $_GET["roomId"];
+
+// $id = optional_param('id', 0, PARAM_INT);
+// optional_variable($id);
+// $course = optional_param('course', 0, PARAM_INT);
+
+
+ global $CFG;
+
+
+ //require_login($course->id);
+ //$v = $_GET["v"];
+ $courseshortname = $_GET['courseshortname'];
+ //$id = $_GET['id'];
+ $roomId = $_GET['roomId'];
+ $action = $_GET['action'];
+ $id = $_GET['id'];
+ $room_info = liveclassroom_api_get_infos_room($roomId);
?>
<head>
@@ -208,22 +223,25 @@
<body>
-<form method="post" action="ManageRoom.aspx" name="entry_info_form" >
+<form method="post" action="" name="entry_info_form" >
- <input type="hidden" value='<%=prefix+roomId %>' name="roomId" />
+ <input type="hidden" value='<?php echo $roomId ?>' name="roomId" />
<input type="hidden" value="<%=session.getTimeOfLoad() %>" name="time" />
- <? if ($_GET['action'] == "editRoom")
- {?>
+ <?
+ if ($action == "editRoom")
+ {?>
<input type="hidden" value="updateRoom" name="action" />
- <?}
- else
- { ?>
+ <?
+ }
+ 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">
@@ -234,27 +252,7 @@
<tr>
<td><img src="pictures/angel.gif" /></td>
<td colspan="3" align="center" valign="middle">
- <!--
- <table border=0 style="background-image: url(pictures/Search.gif); background-repeat:no-repeat;">
- <tr >
- <td align="right" width=10px>
- <img src="pictures/Loupe.gif" align="middle" style="border:none " />
- </td>
- <td align="right" width=125px>
- <input disabled name="search" id="search" type="text" style="border:0; width: 120px;"
- onkeyup="hideCroix(search.value);javascript:getBreakoutRoom(search.value);getMainLectureRoom(search.value);" />
- </td>
- <td align=left width=20px >
- <div id="croix" style="display:none">
- <img onmouseover="overCroix(this)" onclick="clickCroix()" onmouseout="overCroix(this)" src="pictures/x_normal.png" align="middle" style="border:none " />
- </div>
- </td>
- </tr>
- </table>
- <select id="view" onchange="ChangeView()" disabled>
- <option value="normal">Normal View</option>
- <option value="student">Student View</option>
- </select>-->
+
</td>
</tr>
</table>
@@ -277,8 +275,8 @@
background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; height: 18px;"
align="center">
Room Info</td>
- <? if ($roomId == null || !(liveclassroom_api_room_is_archive($roomId)))
- { ?>
+ <? if(!liveclassroom_api_room_is_archive($roomId) || ($roomId == ""))
+ {?>
<td onclick='onTab(2)' onmouseover='onOver(2)' onmouseout='onOut(2)' id="tab2" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat;
width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;"
align="center">
@@ -291,7 +289,7 @@
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;
width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;"
align="center">
@@ -317,33 +315,43 @@
<td>
<span class="alert">*</span> Title :</td>
<td >
- <input type="text" name="longname" value="<?=(action=="editRoom")? p(liveclassroom_get_room_name_from_id($roomId)):""?>" maxlength="50" style="width: 300px" /></td>
+ <input type="text" name="longname" value="<?php if($action=='editRoom') p(liveclassroom_api_get_room_name($roomId))?>" maxlength="50" style="width: 300px" /></td>
</tr>
<tr>
<td>Description :</td>
- <td >
- <textarea rows="4" cols="40" name="description" ><?=(action == "editRoom") ? p(liveclassroom_api_get_room_description($roomId)) : ""?></textarea> </td>
+ <td>
+ <textarea rows="4" cols="40" name="description">
+ <?php if($action=='editRoom'){echo liveclassroom_api_get_room_description($roomId);}?>
+ </textarea>
+ </td>
</tr>
- <? if ($roomId == null || !(liveclassroom_api_room_is_archive($roomId)))
+ <? if (($roomId == "") || (liveclassroom_api_room_is_archive($roomId))==false)
{ ?>
<tr>
<td>Type :</td>
<td>
- <input type="radio" name="led" value="instructor" id="led_instructor" <?=(action=="editRoom")? "checked":"checked"?>
+ <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"; }
+ ?>
onclick='javascript:toggleType();' />
<label for='led_instructor' >
Main rooms<br />
<label for='led_instructor' style="font-style: italic;margin-left:25px">
Instructors lead the presentation </label><br />
<input type="radio" name="led" value="student" id="led_student" onclick='javascript:toggleType();'
- <?=(action=="editRoom" && isStudentAdmin==true)? "checked":""?> />
- <label for='led_student' >
+ <?php
+ if($action=="editRoom" && liveclassroom_is_breakout($roomId,$courseshortname)==true){ echo "checked"; }
+ ?>
+ />
+ <label for='led_student' >
Discussion rooms<br /> </label>
<label for='led_student' style="font-style: italic;margin-left:25px">
Students and Instructors have the same rights </label>
</td>
</tr>
- <?} ?>
+ <?} ?>
</table>
</span>
@@ -351,16 +359,32 @@
<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" <%=(action=="editRoom")?(currentRoom.getMediaType()=="two-way-audio")? "checked":"":"checked"%>
- onclick="doChangeMedia('audio');" />
+ <input type="radio" name="mediaFormat" id="audio" value="two-way-audio" onclick="doChangeMedia('audio');"
+ <?php if($action=='editRoom') {
+ if($room_info['media_type']=="two-way-audio"){ echo "checked";}
+ }
+ else echo "checked";
+ ?>/>
<label for="audio">Audio:</label>
</td>
</tr>
<tr>
<td width=15px></td>
<td>
- <input type="checkbox" name="hmsSimulcastStudent" value="true" id="student_simulcast"
- <%=(action=="editRoom")?((currentRoom.isHmsSimulcastRestricted()==true)? "checked":((currentRoom.getMediaType()!="two-way-audio")?"checked disabled":"")):"checked"%> />
+ <input type="checkbox" name="hmsSimulcastStudent" value="true" id="student_simulcast"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['hms_simulcast_restricted']==1){
+ echo "checked";
+ }
+ else if($room_info['media_type']=="two-way-video"){
+ echo "checked disabled";
+ }
+ else echo "checked";
+ }
+ else echo "checked";
+
+ ?> />
<label for="student_simulcast" >Enable students to use the phone<br /></label>
<label style="font-size: 8pt; font-style: italic">(Instructors can always use the phone)</label>
</td>
@@ -368,16 +392,32 @@
<tr>
<td width=15px></td>
<td>
- <input type="checkbox" name="hmsTwoWayEnabled" value="true" id="two_way_enabled"
- <%=(action=="editRoom")?((currentRoom.isHmsTwoWayEnabled())? "checked":((currentRoom.getMediaType()!="two-way-audio")?"checked disabled":""))):"checked"%> />
+ <input type="checkbox" name="hmsTwoWayEnabled" value="true" id='two_way_enabled'
+ <?php
+ if($action=='editRoom'){
+ if($room_info['hms_two_way_enabled']==1){
+ echo "checked";
+ }
+ else if($room_info['media_type']=="two-way-video"){
+ echo "checked disabled";
+ }
+ else echo "checked";
+ }
+ else echo "checked";
+ ?> />
<label for="two_way_enabled">
Enable students' microphones at presentation start</label></td>
</tr>
<tr>
<td colspan=2>
- <input type="radio" name="mediaFormat" id="video" value="one-way-video" <%=(action=="editRoom")?(currentRoom.getMediaType()=="one-way-video")? "checked":"":""%>
- onclick="doChangeMedia('video');" />
+ <input type="radio" name="mediaFormat" id="video" value='one-way-video'
+ <?php
+ if($action=='editRoom'){
+ if($room_info['media_type']=="one-way-video"){ echo " checked ";}
+ }
+ ?>
+ onclick="doChangeMedia('video');" />
<label for="video">One-way Video</label>
<label style="font-size: 8pt; font-style: italic"> (Presenter uses RealProducer) </label>
</td>
@@ -385,10 +425,19 @@
<tr>
<td colspan=2>
- <span id="roomId_row" style="position: relative; display: <%=(action=="editRoom")?(currentRoom.getMediaType()=="one-way-video")? "block":"none":"none"%>";">
+ <span id="roomId_row" style='position: relative; display:
+ <?php
+ if($action=='editRoom') {
+ if($room_info['media_type']=="one-way-video") echo "block";
+ else echo "none";
+ }
+ else echo "none";
+ ?>';">
+
+
<label for="roomId_field">
Room ID:</label>
- <input type="text" name="roomId_Field" id="roomId_field" value="<%=prefix+roomId %>"
+ <input type="text" name="roomId_Field" id="roomId_field" value='<?php p($roomId)?>'
readonly style="width: 205px" />
</span>
</td>
@@ -397,8 +446,14 @@
<td colspan=2>
<input type="radio" name="mediaFormat" id="none" value="none" onclick="doChangeMedia('none');"
- <%=(action=="editRoom")?(currentRoom.getMediaType()=="none")? "checked":"":""%> />
- <label for="none">
+ <?php
+ if($action=='editRoom') {
+ if($room_info['media_type']=="none") echo "checked";
+ }
+ ?>/>
+
+
+ <label for="none">
Third-party Conference Call</label>
</td>
</tr>
@@ -410,9 +465,13 @@
<tr>
- <td>
+ <td>
<input type="checkbox" name="studentEboardEnabled" value="true" id="enable_eboard"
- <%=(action=="editRoom")?(currentRoom.isStudentWhiteboardEnabled())? "checked":"":""%> />
+ <?php
+ if($action=='editRoom'){
+ if($room_info['student-wb-enabled']==1) echo "checked";
+ }
+ ?>/>
<label for="enable_eboard">
Enable students to use eBoard</label>
</td>
@@ -425,7 +484,11 @@
<tr>
<td>
<input type="checkbox" name="studentLiveappEnabled" value="true" id="enable_liveapp"
- <%=(action=="editRoom")?(currentRoom.isStudentLiveAppEnabled())? "checked":"":""%> />
+ <?php
+ if($action=='editRoom'){
+ if($room_info['student-wb-liveapp']==1) echo "checked";
+ }
+ ?>/>
<label for="enable_liveapp">
Enable students to use the Screen Grab tool</label>
</td>
@@ -438,7 +501,13 @@
<tr>
<td>
- <input type="checkbox" name="archiveEnabled" value="true" id="enable_archive" <%=(action=="editRoom")?(currentRoom.isArchiveEnabled()==true)?"checked":"":"checked"%> />
+ <input type="checkbox" name="archiveEnabled" value="true" id="enable_archive"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['can_archive']==1) echo "checked";
+ }
+ else echo "checked";
+ ?>/>
<label for="enable_archive">
Enable Archiving</label>
</td>
@@ -446,7 +515,13 @@
<tr>
<td>
- <input type="checkbox" name="appshareEnabled" value="true" id="enable_appshare" <%=(action=="editRoom")?(currentRoom.isLiveShareEnabled()==true)? "checked":"":"checked"%> />
+ <input type="checkbox" name="appshareEnabled" value="true" id="enable_appshare"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['can_liveshare']==1) echo "checked";
+ }
+ else echo "checked";
+ ?>/>
<label for="enable_appshare">
Enable Appshare</label>
</td>
@@ -454,7 +529,13 @@
<tr>
<td>
- <input type="checkbox" name="pptEnabled" value="true" id="enable_ppt" <%=(action=="editRoom")? ((currentRoom.isPptImportEnabled()==true)? "checked":""):"checked"%> />
+ <input type="checkbox" name="pptEnabled" value="true" id="enable_ppt"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['can_ppt_import']==1) echo "checked";
+ }
+ else echo "checked";
+ ?>/>
<label for="enable_ppt">
Enable On-The-Fly PPT Import</label>
</td>
@@ -468,8 +549,13 @@
<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" <%=(action=="editRoom")?(currentRoom.isChatEnabled())? "checked":"":"checked"%>
- onclick="doChangeChat();" />
+ <input type="checkbox" name="chatEnabled" value="true" id="chat_enable"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['chatenable']==1) echo "checked";
+ }
+ else echo "checked";
+ ?> onclick="doChangeChat();" />
<label for="enable_chat">
Enable students to use text chat</label>
</td>
@@ -477,7 +563,13 @@
<tr>
<td width="20"> </td>
<td>
- <input type="radio" name="privateChatEnabled" value="true" id="privateenabled" <%=(action=="editRoom")?( currentRoom.isPrivateChatEnabled())? "checked":"":"checked"%> />
+ <input type="radio" name="privateChatEnabled" value="true" id="privateenabled"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['privatechatenable']==1) echo "checked";
+ }
+ else echo "checked";
+ ?>/>
<label for="privateenabled">
Enabled Public and Private text chat</label>
</td>
@@ -486,7 +578,11 @@
<td width="20"> </td>
<td>
<input type="radio" name="privateChatEnabled" value="false" id="privatedisabled"
- <%=(action=="editRoom")?( currentRoom.isPrivateChatEnabled())? "":"checked":""%> />
+ <?php
+ if($action=='editRoom'){
+ if($room_info['privatechatenable']==0) echo "checked";
+ }
+ ?>/>
<label for="privatedisabled">
Enable Public text chat only</label>
</td>
@@ -506,18 +602,32 @@
<tr>
<td >
- <input type="radio" name="userlimit" value="false" id="userlimit_false" <%=(action=="editRoom")?(currentRoom.getUserLimit()==-1)? "checked":"":"checked"%>
- onclick="toggleUserlimit(false);" />
+ <input type="radio" name="userlimit" value="false" id="userlimit_false" onclick="toggleUserlimit(false);"
+ <?php
+ if($action=='editRoom'){
+ if($room_info['userlimit']==-1) echo " checked ";
+ }
+ else echo " checked ";
+ ?>/>
<label for="userlimit_false">
Unlimited</label></td>
</tr>
<tr>
<td >
- <input type="radio" name="userlimit" value="true" id="userlimit_true" onclick="toggleUserlimit(true);"
- <%=(action=="editRoom")?(currentRoom.getUserLimit()!=-1)? "checked":"":""%> />
+ <input type="radio" name="userlimit" value="true" id="userlimit_true" onclick='toggleUserlimit(true);'
+ <?php
+ if($action=='editRoom'){
+ if($room_info['userlimit']=-1) echo "checked";
+ }
+ ?>/>
<label for="userlimit_true">
Limited:</label>
- <input type="text" name="userlimitValue" value="<%=(action=="editRoom" && currentRoom.getUserLimit()!=-1)? currentRoom.getUserLimit().ToString():""%>"
+ <input type="text" name="userlimitValue" value='
+ <?php
+ if(($action=='editRoom')&&($room_info['userlimit']!=-1)){
+ echo $room_info['userlimit'];
+ }
+ ?>'
id="userlimittext" disabled /></td>
</tr>
<tr>
@@ -528,19 +638,32 @@
<tr>
<td >
- <input type="checkbox" name="guests" value="true" onclick="doChangeLink()" id="guestAccess_value" <%=(action=="editRoom" && guestAccess==true)? "checked":""%>/>
+ <input type="checkbox" name="guests" value="true" onclick="doChangeLink()" id="guestAccess_value"
+ <?php
+ if(($action=='editRoom')&&(liveclassroom_api_role_user_room($roomId,'Guest')=='Student')){
+ echo "checked";
+ }
+ ?>
+ />
<label for="guestAccess_value">
Enable guest access</label>
</td>
</tr>
<tr>
<td >
- <div id="launcher_link_row" <%=(action=="editRoom" && guestAccess==true)? "":"style='position: relative; display: none;'"%>>
+ <div id="launcher_link_row"
+ <?php
+ if(($action=='editRoom')&&(liveclassroom_api_role_user_room($roomId,'Guest')=='Student')){
+
+ }
+ else echo "style='position: relative; display: none;'" ;
+ ?>
+ >
<table>
<tr>
<td><label for="launcher_link_field">
Link:</label></td>
- <td> <input type="text" name="link" id="Text1" size="70" value="<%=Setup.getInstance().getLcServerURL()%>/launcher.cgi?room=<%=prefix+roomId %>"
+ <td> <input type="text" name="link" id="Text1" size="70" value="<?php p($CFG->liveclassroom_servername)?>/launcher.cgi?room=<?php p($roomId)?>"
readonly /></td>
</tr>
</table>
@@ -549,8 +672,7 @@
</tr>
</table>
</span>
-
-
+
</td>
</tr>
<tr >
@@ -560,24 +682,26 @@
<td align=left width=70% >
<span class="alert">*</span>Required fields.</td>
<td class=action align=center width=15%>
- <a href=<%=Util.URL_REDIRECT+ "?time=" + session.getTimeOfLoad() + "&" + session.url_params + "signature=" + Util.mD5Crypt(session.signature+Setup.getInstance().getHashKey()) %> >Cancel</a>
+
+ <input type="reset" value="<?php print_string("cancel") ?>" onclick="self.location.href='welcome.php?id=<?php p($id) ?>'">
+
</td>
<td height="25px" class=action align=center width=15%>
- <? if (action == "editRoom")
- {?>
+ <?php if($action=='editRoom')
+ {
+ ?>
<a href="javascript:verifyFormUpdate()" >Update</a>
- <?}
- else
- {?>
+ <?php
+ }else
+ {?>
<a href="javascript:verifyForm()" >Save All</a>
- <?} ?>
+ <?php } ?>
</tr>
</table>
</td>
</tr>
-
-
+
</table>
</form>
</body><script> toggleType()</script>
\ No newline at end of file
Modified: trunk/moodle/mod/liveclassroom/welcome.php
===================================================================
--- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-19 09:47:52 UTC (rev 66)
+++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-19 09:49:00 UTC (rev 67)
@@ -81,6 +81,8 @@
notice("There are no liveclassrooms", "../../course/view.php?id=$course->id");
die;
}
+
+ $tab = liveclassroom_get_main_room_list($course);
?>
<head>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
@@ -115,8 +117,8 @@
if (hidestatus[id]==1)
{
document.getElementById(id).style.display="block";
- //document.images['toggleimg'+id].src="<%=Setup.getInstance().getLcServerURL()%>/images/integration/small_collapse.gif";
- document.images['toggleimg'+id].src="pictures/small_collapse.gif";
+ document.images['toggleimg'+id].src="<?PHP p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif";
+ //document.images['toggleimg'+id].src="pictures/small_collapse.gif";
hidestatus[id]=0;
if(id=='orphaned'){
@@ -134,7 +136,7 @@
else
{
document.getElementById(id).style.display="none";
- document.images['toggleimg'+id].src="pictures/small_expand.gif";
+ document.images['toggleimg'+id].src="<?PHP p($CFG->liveclassroom_servername)?>/images/integration/small_expand.gif";
hidestatus[id]=1;
if(id=='orphaned'){
TampNumberOrphanedRoom=NumberOrphanedRoom;
@@ -306,6 +308,21 @@
var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500');
w.focus();
}
+
+
+
+
+function doOpenAddActivity(url,param){
+
+ if(current!="")
+ {
+ var complete_url=url+'?roomId='+current+'&id=<?php p($id) ?>§ion=0&sesskey=<?php echo sesskey(); ?>&'+param;
+ window.open(complete_url,"_top");
+
+ }
+
+}
+
function doOpenIntern(popup,url){
if(current!="")
{
@@ -384,7 +401,7 @@
{
<?php
- $tab = liveclassroom_get_main_room_list($course);
+ $tab_main = $tab[0];
?>
var retour="";
@@ -392,19 +409,19 @@
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php for($i=0; $i<sizeof($tab[0]); $i++)
+ <?php for($i=0; $i<sizeof($tab_main); $i++)
{
// print ($tab[0][$i]);
?>
- myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?>");
+ myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab_main[$i])) ?>");
mysearch=new String(search);
- mysearch=mysearch.toLowerCase();
+ // mysearch=mysearch.toLowerCase();
results = myString.match(mysearch)
if(search==null || results!=null)
{
var preview;
<?php
- if(!liveclassroom_api_room_is_preview($tab[0][$i]))
+ if(!liveclassroom_api_room_is_preview($tab_main[$i]))
{
?>
preview=true;
@@ -419,27 +436,27 @@
?>
if(studentView==false || ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">"
+ retour += "<tr id='<?php p($tab_main[$i]) ?>' Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\">"
if(studentView==false)
{
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[0][$i]))>0)
+ if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]))>0)
{
?>
numberArchive++;
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td>";
- retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[0][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[0][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"></td>";
+ retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab_main[$i]) ?>hide')\" name=\"toggleimg<?php p($tab_main[$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
<?php
}
else
{
?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
<?php
}
?>
@@ -460,11 +477,11 @@
else
{
*/?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>";
}
- retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?></td>";
+ retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab_main[$i])) ?></td>";
if(!preview)
{
if(studentView==false)
@@ -473,7 +490,7 @@
retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
else
@@ -484,18 +501,18 @@
retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"></td></tr>";
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[0][$i]))>0)
+ if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]))>0)
{
?>
- retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[0][$i]) ?>hide'>";
+ retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab_main[$i]) ?>hide'>";
<?php
- $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i]);
+ $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]);
?>
retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
<?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++)
@@ -570,7 +587,7 @@
retour += "</table>";
document.getElementById("main").innerHTML = retour;
- gestionDisplay();
+ // gestionDisplay();
if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5)
correctPNG();
}
@@ -580,7 +597,7 @@
{
<?php
- $tab = liveclassroom_get_main_room_list($course);
+ $tab_breakout = $tab[1];
?>
var retour="";
@@ -588,19 +605,19 @@
var numberArchive=0;
var number=0;
retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>";
- <?php for($i=0; $i<sizeof($tab[1]); $i++)
+ <?php for($i=0; $i<sizeof($tab_breakout); $i++)
{
?>
- myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?>");
+ myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab_breakout[$i])) ?>");
mysearch=new String(search);
- mysearch=mysearch.toLowerCase();
+ //mysearch=mysearch.toLowerCase();
results = myString.match(mysearch)
if(search==null || results!=null)
{
var preview;
<?php
- if(!liveclassroom_api_room_is_preview($tab[1][$i]))
+ if(!liveclassroom_api_room_is_preview($tab_breakout[$i]))
{
?>
preview=true;
@@ -615,26 +632,26 @@
?>
if(studentView==false || ( studentView==true && !preview))
{
- retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">"
+ retour += "<tr id='<?php p($tab_breakout[$i]) ?>' Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\">"
if(studentView==false)
{
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]))>0)
+ if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]))>0)
{
?>
numberArchive++;
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td>";
- retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[1][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[1][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"></td>";
+ retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab_breakout[$i]) ?>hide')\" name=\"toggleimg<?php p($tab_breakout[$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>";
<?php
}
else
{
?>
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
<?php
}
?>
@@ -658,12 +675,12 @@
%>
*/
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
- retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
+ retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>";
}
- retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?></td>";
+ retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab_breakout[$i])) ?></td>";
if(!preview)
{
if(studentView==false)
@@ -672,7 +689,7 @@
retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
@@ -684,19 +701,19 @@
retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>";
}
else
- retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
+ retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>";
}
- retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td></tr>";
+ retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"></td></tr>";
<?php
- if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]))>0)
+ if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]))>0)
{
?>
- retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[1][$i]) ?>hide'>";
+ retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab_breakout[$i]) ?>hide'>";
<?php
- $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]);
+ $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]);
?>
retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >";
<?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++)
@@ -772,7 +789,7 @@
retour += "</table>";
document.getElementById("breakout").innerHTML = retour;
- gestionDisplay();
+ //gestionDisplay();
if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5)
correctPNG();
}
@@ -1142,7 +1159,7 @@
<table cellspacing="0" cellpadding="0" width="1000" border="0" align="center" id="TABLE1">
<tr style="background-color: #f0f0f0">
<td colspan="6" style="border-top:white 1px solid">
-
+<?php if (isstudent($course->id)){ ?>
<span id="student_Menu">
<table style="width: 1000" cellspacing="0" cellpadding="1" align="center">
<tr class="button_disabled" id="menu_student">
@@ -1173,7 +1190,7 @@
</tr>
</table>
</span>
-
+<?php }else if (isteacher($course->id, $USER->id)) { ?>
<span id="admin_Menu">
<table style="width: 1000" cellspacing="0" cellpadding="1" align="center">
<tr class="button_disabled" id="menu_admin" >
@@ -1184,7 +1201,7 @@
</td>
<td width="9%" align="center" >
- <a href="javascript:window.open('../../course/mod.php?id=<?php p($course->id)?>§ion=0&sesskey=<?php echo sesskey(); ?>&add=liveclassroom','_top')" >
+ <a href="javascript:doOpenAddActivity('../../course/mod.php','add=liveclassroom')" >
<img src="pictures/launch_Black.png" border="0"
alt="Edit RoomSettings" title="Add Activity" id="launch_icon" name="launch_icon" height="24" width="24"><br />
Add Activity</a>
@@ -1228,7 +1245,9 @@
<td width="9%" align="center" >
- <a href="javascript:doOpen(false,'','')" onclick=";return confirm('Are you sure to delete this room ?');" >
+ <a href="javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=deleteRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" onclick=";return confirm('Are you sure to delete this room ?');" >
+
+ <a href="javascript:doOpen(false,'','action=deleteRoom')" onclick=";return confirm('Are you sure to delete this room ?');" >
<img src="pictures/delete_Black.png" border="0"
alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br />
Delete</a>
@@ -1252,7 +1271,7 @@
</tr>
</table>
</span>
-
+<?php } ?>
</td>
</tr>
<tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|