hw4mdl-svn Mailing List for Wimba Moodle Integration (Page 9)
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-09-19 09:48:05
|
Revision: 66 http://svn.sourceforge.net/hw4mdl/?rev=66&view=rev Author: shazan Date: 2006-09-19 02:47:52 -0700 (Tue, 19 Sep 2006) Log Message: ----------- activity form updated with the weeks and the type directly choose by the widget Modified Paths: -------------- trunk/moodle/mod/liveclassroom/mod.html Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-09-14 15:24:25 UTC (rev 65) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-09-19 09:47:52 UTC (rev 66) @@ -26,6 +26,9 @@ if (!isset($form->descrption)) { $form->descrption = ''; } +if (!isset($form->section)) { + $form->section = ''; +} if (empty($form->timeopen)) { $form->timeopen = ""; $form->timerestrict = 0; @@ -73,13 +76,39 @@ <?php if($course->format == "weeks"){ - $form->timeopen = $course->startdate + (($form->section - 1) * 608400); ?> + //Display the lsit of the weeks + $timenow = time(); + $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; + $k++; + $section++; + $weekdate = $nextweekdate; + } + + ?> <td align="right"><b><?php print_string('weeksformat', 'liveclassroom')?>:</b></td> <td> - <?php - print_date_selector("openday", "openmonth", "openyear", $form->timeopen); - print_time_selector("openhour", "openminute", $form->timeopen); - ?> + <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> </td> <?php } @@ -94,8 +123,6 @@ </tr> <?php } - - ?> </tr> @@ -117,7 +144,7 @@ for($i=0;$i<sizeof($list_type_rooms);$i++) { ?> - <OPTION VALUE="<?php p($list_type_rooms[$i]) ?>"><?php p($list_type_rooms[$i]) ?></OPTION> + <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> <?php } @@ -125,8 +152,6 @@ ?> </SELECT> </td> - - </tr> @@ -182,7 +207,7 @@ <input type="hidden" name=course value="<?php p($form->course) ?>" /> <input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" /> <input type="hidden" name=coursemodule value="<?php p($form->coursemodule) ?>" /> -<input type="hidden" name=section value="<?php p($form->section) ?>" /> + <input type="hidden" name=module value="<?php p($form->module) ?>" /> <input type="hidden" name=modulename value="<?php p($form->modulename) ?>" /> <input type="hidden" name=instance value="<?php p($form->instance) ?>" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-09-14 15:24:39
|
Revision: 65 http://svn.sourceforge.net/hw4mdl/?rev=65&view=rev Author: shazan Date: 2006-09-14 08:24:25 -0700 (Thu, 14 Sep 2006) Log Message: ----------- display of the nugget is better Modified Paths: -------------- trunk/moodle/mod/liveclassroom/welcome.php Modified: trunk/moodle/mod/liveclassroom/welcome.php =================================================================== --- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-14 15:23:34 UTC (rev 64) +++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-14 15:24:25 UTC (rev 65) @@ -21,9 +21,9 @@ * if not, write to the Free Software Foundation, Inc., * * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * * - * Author: Samy Hazan * + * Author: Hazan Samy * * * - * Date: 15th April 2006 * + * Date: September 2006 * * * ******************************************************************************/ @@ -247,8 +247,8 @@ ?> var studentView=false; - //document.getElementById("admin_Menu").style.display="none"; - //document.getElementById("student_Menu").style.display="block"; + document.getElementById("admin_Menu").style.display="none"; + document.getElementById("student_Menu").style.display="block"; <?php } ?> @@ -258,8 +258,8 @@ { studentView=true; - //document.getElementById("admin_Menu").style.display="none"; - //document.getElementById("student_Menu").style.display="block"; + document.getElementById("admin_Menu").style.display="none"; + document.getElementById("student_Menu").style.display="block"; if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) { document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; @@ -272,8 +272,8 @@ else { studentView=false; - //document.getElementById("admin_Menu").style.display="block"; - //document.getElementById("student_Menu").style.display="none"; + document.getElementById("admin_Menu").style.display="block"; + document.getElementById("student_Menu").style.display="none"; if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) { document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule_Black.png', sizingMethod='scale')"; @@ -297,8 +297,8 @@ if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") document.getElementById("info").style.display="none"; current=""; - //document.getElementById("menu_admin").className="button_disabled" - //document.getElementById("menu_student").className="button_disabled"; + document.getElementById("menu_admin").className="button_disabled" + document.getElementById("menu_student").className="button_disabled"; } function LaunchWizard(url) @@ -327,7 +327,7 @@ if(current!="") { - var complete_url=url+'?roomId='+current+'&'+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"); @@ -464,7 +464,7 @@ 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=\"550px\" 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[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>"; if(!preview) { if(studentView==false) @@ -521,7 +521,7 @@ 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=300px 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 += "<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 += "<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>"; if(!preview) @@ -618,18 +618,52 @@ 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[1][$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>"; + + <?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[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 + } + ?> + }else{ + /* + <%if((openArchive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()])!=null) + { + %> + + numberArchive++; - }else{ + retour+="<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide')\" name=\"toggleimg<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + + <% + } + 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=\"550\" 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[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>"; if(!preview) { if(studentView==false) @@ -654,6 +688,77 @@ } 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>"; + + + <?php + if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]))>0) + { + ?> + 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[1][$i]); + ?> + retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >"; + <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++) + { + /* + if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId())) + orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/ + ?> + var preview; + <?php if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + 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 += "<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>"; + 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>"; + } + 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>"; + } + + } + 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>"; + } + 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><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>"; + } + <?php + } + ?> + retour += "</table>"; + retour += " </div></td></tr>"; + <?php + } + ?> + NumberBreakoutRoom++; } } @@ -800,7 +905,231 @@ { - + if(type!='collapse'){ + if(NumberOrphanedRoom==0) + { + document.getElementById("orphaned").style.display="none"; + document.getElementById("orphaned_title").style.display="none"; + } + else + { + document.getElementById("orphaned").style.display="block"; + document.getElementById("orphaned_title").style.display="block"; + } + if(NumberBreakoutRoom==0) + { + document.getElementById("breakout").style.display="none"; + document.getElementById("breakout_title").style.display="none"; + } + else + { + document.getElementById("breakout").style.display="block"; + document.getElementById("breakout_title").style.display="block"; + } + if(NumberMainLectureRoom==0) + { + document.getElementById("main").style.display="none"; + document.getElementById("main_title").style.display="none"; + } + else + { + document.getElementById("main").style.display="block"; + document.getElementById("main_title").style.display="block"; + } + } + if(NumberMainLectureRoom==0) + { + if(NumberBreakoutRoom==0) + { + if(NumberOrphanedRoom<10) + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + else + document.getElementById("orphaned").style.height=10*18.5+"px"; + } + else if(NumberOrphanedRoom==0) + { + if(NumberBreakoutRoom<10) + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + else + document.getElementById("breakout").style.height=10*18.5+"px"; + } + else if(NumberOrphanedRoom>=5 && NumberBreakoutRoom>=5) + { + document.getElementById("breakout").style.height=5*18.5+"px"; + document.getElementById("orphaned").style.height=5*18.5+"px"; + } + else if(NumberOrphanedRoom<5 && NumberBreakoutRoom>=5) + { + document.getElementById("breakout").style.height=NumberOrphanedRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberOrphanedRoom)) + document.getElementById("orphaned").style.height=(10-NumberOrphanedRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom<5 && NumberBreakoutRoom<5) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=5 && NumberBreakoutRoom<5) + { + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberOrphanedRoom>(10-NumberBreakoutRoom)) + document.getElementById("orphaned").style.height=(10-NumberBreakoutRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + } + else if(NumberMainLectureRoom<3) + { + if(NumberBreakoutRoom==0 && NumberOrphanedRoom==0) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberBreakoutRoom==0) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + if(NumberOrphanedRoom>(10-NumberMainLectureRoom)) + document.getElementById("orphaned").style.height=(10-NumberMainLectureRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + else if(NumberOrphanedRoom==0) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberMainLectureRoom) ){ + document.getElementById("breakout").style.height=(10-NumberMainLectureRoom)*18.5+"px"; + //document.getElementById("breakout").style.o="scroll"; + //document.getElementById("breakout").style.overflow="hidden"; + } + else + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom>=3) + { + document.getElementById("breakout").style.height=3*18.5+"px"; + document.getElementById("orphaned").style.height=3*18.5+"px"; + document.getElementById("main").style.height=3*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom>=3) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberOrphanedRoom-NumberMainLectureRoom)) + document.getElementById("breakout").style.height=(10-NumberOrphanedRoom-NumberMainLectureRoom)*18.5+"px"; + else + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom<3) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom<3) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberOrphanedRoom>(10-NumberBreakoutRoom-NumberMainLectureRoom)) + document.getElementById("orphaned").style.height=(10-NumberBreakoutRoom-NumberMainLectureRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + } + else if(NumberMainLectureRoom>=3) + { + if(NumberBreakoutRoom==0 && NumberOrphanedRoom==0) + { + if(NumberMainLectureRoom<10) + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + else + document.getElementById("main").style.height=10*18.5+"px"; + } + else if(NumberBreakoutRoom==0) + { + if(NumberOrphanedRoom<5 && NumberMainLectureRoom<5) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=5 && NumberMainLectureRoom>=5) + { + document.getElementById("orphaned").style.height=5*18.5+"px"; + document.getElementById("main").style.height=5*18.5+"px"; + } + else if(NumberOrphanedRoom<5 && NumberMainLectureRoom>=5) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + if(NumberMainLectureRoom>(10-NumberOrphanedRoom)) + document.getElementById("main").style.height=(10-NumberOrphanedRoom)*18.5+"px"; + else + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + } + else if(NumberOrphanedRoom==0) + { + if(NumberBreakoutRoom<5 && NumberMainLectureRoom<5) + { + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberBreakoutRoom>=5 && NumberMainLectureRoom>=5) + { + document.getElementById("breakout").style.height=5*18.5+"px"; + document.getElementById("main").style.height=5*18.5+"px"; + } + else if(NumberBreakoutRoom<5 && NumberMainLectureRoom>=5) + { + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberMainLectureRoom>(10-NumberBreakoutRoom)) + { + document.getElementById("main").style.height=(10-NumberBreakoutRoom)*18.5+"px"; + } + else + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberBreakoutRoom>=5 && NumberMainLectureRoom<5) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberMainLectureRoom)) + { + document.getElementById("breakout").style.height=(10-NumberMainLectureRoom)*18.5+"px"; + } + else + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom>=3) + { + document.getElementById("breakout").style.height=3*18.5+"px"; + document.getElementById("orphaned").style.height=3*18.5+"px"; + document.getElementById("main").style.height=3*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom>=3) + { + + document.getElementById("main").style.height=3*18.5+"px"; + document.getElementById("breakout").style.height=3*18.5+"px"; + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom<3) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberMainLectureRoom>(10-NumberBreakoutRoom-NumberOrphanedRoom)) + { + document.getElementById("main").style.height=(10-NumberBreakoutRoom-NumberOrphanedRoom)*18.5+"px"; + } + else + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom<3) + { + document.getElementById("main").style.height=3*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + document.getElementById("orphaned").style.height=3*18.5+"px"; + } + } } </script> @@ -813,7 +1142,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"> @@ -844,9 +1173,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" > @@ -925,8 +1252,7 @@ </tr> </table> </span> - <?php - } ?> + </td> </tr> <tr> @@ -987,11 +1313,10 @@ getBreakoutRoom(); //getOrphanedArchive(); - + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) { correctPNG(); - - } + } <?php if (isstudent($course->id)){ ?> document.getElementById("admin_Menu").style.display="none"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-09-14 15:23:49
|
Revision: 64 http://svn.sourceforge.net/hw4mdl/?rev=64&view=rev Author: shazan Date: 2006-09-14 08:23:34 -0700 (Thu, 14 Sep 2006) Log Message: ----------- functions added to get all information to edit a room 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-09-13 16:07:14 UTC (rev 63) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-14 15:23:34 UTC (rev 64) @@ -985,7 +985,7 @@ return $response; } - /* +/* * Give the nam of the room given * @param $roomid : the id of the room * return a String :name of the room @@ -1018,7 +1018,338 @@ return $response; } - + +/* +* Give the media type of the room given +* @param $roomid : the id of the room +* return a String :media type of the room +*/ +function liveclassroom_api_get_media_type($roomid){ + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=media_type&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],"media_type="); + + //$tok2 = split("class_id=",$tok1[0]); + $result = liveclassroom_parse_line($test,"media_type="); + //Remove le " " at the end of the line + $response = substr($result,0,-1); + + return $response; + +} + +/* +* +* @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($ch,$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($ch,$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 +* return a int : number of user limit +*/ +function liveclassroom_api_room_get_user_limit($roomid){ + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=userlimit&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],"userlimit="); + + //$tok2 = split("class_id=",$tok1[0]); + $result = liveclassroom_parse_line($test,"userlimit="); + //Remove le " " at the end of the line + $response = substr($result,0,-1); + return $response; + +} + +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($ch,$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; + +} + +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($ch,$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; + +} + +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($ch,$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; + +} + +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($ch,$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; + +} + +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($ch,$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; + +} + +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($ch,$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; + +} /** * Enroll the given user into the group. * Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-09-13 16:07:14 UTC (rev 63) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-09-14 15:23:34 UTC (rev 64) @@ -313,7 +313,7 @@ return false; } } - else if($bool==false){ // discussion out + else if($bool==false){ // discussion room if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) { //error('liveclassroom_create_room: Cannot add classadminright to Teachers'); @@ -551,9 +551,9 @@ } /* -* List all the room "Lecture or Main rooms" for a course given +* 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 with all the room name considering as a lecture/main room +* return a table 2 dimensions with all the room name */ function liveclassroom_get_main_room_list($course) { @@ -626,61 +626,42 @@ return $list_return; } -/* -function liveclassroom_get_type_room($roomname) { + +/* To know if the room given is a lecture room +* @param $roomid : the id of the room +* return a boolean : true if the room is lecture room, false if not. +*/ +function liveclassroom_is_lecturehall($roomid,$courseshortname) { - if(!($lc = get_record('liveclassroom_type_rooms','name',$roomname))) { - error( "Response get type name: query to database failed2"); - return false; - } - else { - $type = $lc->id-1; - return $type; - } -} -*/ -/* -* Get the type number of liveclassroom -* @param $liveclassroom : the object liveclassroom -* return the type number of the liveclassroom -*/ -/* -function liveclassroom_get_type($liveclassroom) { + $studentuserid = liveclassroom_api_get_student_user_id($courseshortname); - if(!($lc = get_record('liveclassroom','id',$liveclassroom->id))) { - error( "Response get type: query to database failed"); +// $role = liveclassroom_api_role_user_room($roomid, $studentuserid); + if(liveclassroom_api_role_user_room($roomid, $studentuserid)=='Student') { + return true; } - else { - return $lc->type; - } + else{ + return false ; + } + } -*/ -/** -* Give the name of the room for the course and the type given -* @param $course : course -* @param $type : type of the room -* return the name of the room for the course -*//* -function liveclassroom_get_room_name($course,$type) { -/* - global $LIVECLASSROOM_MOODLE_PREFIX; - if($type == 0) {//Main Lecture Hall - return $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname; - } - else if ($type == 1) { //Discussion room - - } +/* To know if the room given is a discussion room +* @param $roomid : the id of the room +* return a boolean : true if the room is breakout room, false if not. +*/ +function liveclassroom_is_breakout($roomid, $courseshortname) { + $studentuserid = liveclassroom_api_get_student_user_id($courseshortname); - if(!($lc = get_record('liveclassroom_type_rooms','id',$type+1))) { - error( "Response get room name: query to database failed"); - } - else { - $name = $lc->name; - return $name; + //$role = liveclassroom_api_role_user_room($roomid, $studentuserid); + if(liveclassroom_api_role_user_room($roomid, $studentuserid)=='Instructor') { + return true; } + else{ + return false; + } } -*/ + + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-09-13 16:07:29
|
Revision: 63 http://svn.sourceforge.net/hw4mdl/?rev=63&view=rev Author: shazan Date: 2006-09-13 09:07:14 -0700 (Wed, 13 Sep 2006) Log Message: ----------- New name for the index page of the iframe Welcome :) + new functions for the archive room Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/welcome.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-13 14:08:54 UTC (rev 62) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-13 16:07:14 UTC (rev 63) @@ -681,36 +681,8 @@ } -/* -* archive=1 ===> room is an archive -* -* NEED TO BE TESTED !!! -*/ -function liveclassroom_api_get_archive_list($course) { - global $CFG; - global $LIVECLASSROOM_API_ADMIN; - global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; - - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=class_id&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]); - - $j=0; - - for($i=0;$i<sizeof($tok1);$i++) { - $list_return[$j]=$tok[$i]; - - } - return $list_return; -} + /* * List all the archive room associated with the room given * @@ -964,9 +936,6 @@ function liveclassroom_api_get_orphaned_archive_list() { - - - $tab_archive = liveclassroom_api_get_archive_list() ; @@ -1016,6 +985,39 @@ return $response; } + /* +* Give the nam of the room given +* @param $roomid : the id of the room +* return a String :name of the room +*/ +function liveclassroom_api_get_room_name($roomid){ + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=longname&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],"longname="); + + //$tok2 = split("class_id=",$tok1[0]); + $result = liveclassroom_parse_line($test,"longname="); + //Remove le " " at the end of the line + $response = substr($result,0,-1); + + return $response; + +} /** * Enroll the given user into the group. Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-09-13 14:08:54 UTC (rev 62) +++ trunk/moodle/mod/liveclassroom/index.php 2006-09-13 16:07:14 UTC (rev 63) @@ -79,6 +79,7 @@ die; } ?> +<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> <head> @@ -88,15 +89,17 @@ <br> <div align="center"> - <iframe src="accueil.php?id=<?php p($id) ?>" width="1000" height="400" name="yo" frameborder="1" align="middle"> - <p>Votre navigateur ne peut malheureusement pas afficher de cadre incorpor\xE9: Vous pouvez appeler la page incorpor\xE9e - par ce lien: <a href="../../../index.htm">SELFHTML</a></p> + <iframe src="welcome.php?id=<?php p($id) ?>" width="1000" height="400" name="yo" frameborder="1" align="middle"> + <p>Sorry your navigator can't display this iframe +<a href="../../../index.htm">SELFHTML</a></p> </iframe> </div> <table width="1000" align="center"> <tr style="background-color: white"> - <td width="55%"></td> + <td width="55%" valign=top style="color: #cccccc; font-family: Verdana; height: 9px;"> + <a href="javascript:startWizard()" target="_self" class="external"><?php echo get_string('wizard.text.2', 'liveclassroom') ?></a> + </td> <td align=right valign=middle style="color: #cccccc; font-style: italic; font-family: Verdana; height: 12px;"> Powered by : @@ -105,13 +108,15 @@ </tr> </table> - <?php - /* - $tab = liveclassroom_api_get_orphaned_archive_list(); + <?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/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-09-13 14:08:54 UTC (rev 62) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-09-13 16:07:14 UTC (rev 63) @@ -522,7 +522,7 @@ function liveclassroom_get_room_name_from_id($roomid) { if(!($list = get_record('liveclassroom_rooms','room_id',$roomid))) { - error( "Response get list type room per course : query to database failed"); + error( "Response get room name from id : query to database failed"); } return $list->name; @@ -537,7 +537,7 @@ function liveclassroom_get_roomid_list($course) { if(!($rooms = get_records('liveclassroom_rooms','course',$course->id))) { - error( "Response get list type room per course : query to database failed"); + error( "Response get roomid list : query to database failed"); } $i=0; Added: trunk/moodle/mod/liveclassroom/welcome.php =================================================================== --- trunk/moodle/mod/liveclassroom/welcome.php (rev 0) +++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-13 16:07:14 UTC (rev 63) @@ -0,0 +1,1003 @@ +<?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: 15th April 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + +/// This page is to display the widget + + + require_once("../../config.php"); + require_once("lib.php"); + + $id = optional_param('id', 0, PARAM_INT); + + $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)) { + error("Course ID is incorrect"); + } + + require_login($course->id); + + add_to_log($course->id, "liveclassroom", "view all", "index.php?id=$course->id", ""); + + +/// Get all required strings + + $strliveclassrooms = get_string("modulenameplural", "liveclassroom"); + $strliveclassroom = get_string("modulename", "liveclassroom"); + + if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { + error ("Cannot create session"); + } + +/// Print the header + + if ($course->category) { + $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; + } + + // print_header("$course->shortname: $strliveclassrooms", "$course->fullname", "$navigation $strliveclassrooms", "", "", true, "", navmenu($course)); + +/// Get all the appropriate data + + if (! $liveclassrooms = get_all_instances_in_course("liveclassroom", $course)) { + notice("There are no liveclassrooms", "../../course/view.php?id=$course->id"); + die; + } +?> + <head> + <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> +<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> + <script type="text/javascript"> +var hidestatus = new Array(); +function hideArchive(id) +{ + if(hidestatus[id]==null)//first use + hidestatus[id]=1; + if (hidestatus[id]==1) + { + document.getElementById(id).style.display="block"; + document.images['toggleimg'+id].src="pictures/minus.gif"; + hidestatus[id]=0; + } + else + { + document.getElementById(id).style.display="none"; + document.images['toggleimg'+id].src="pictures/plus.gif"; + hidestatus[id]=1; + } +} +var TampNumberMainLectureRoom=0; +var TampNumberBreakoutRoom=0; +var TampNumberOrphanedRoom=0; +function hideBloc(id) +{ + + if(hidestatus[id]==null)//first use + hidestatus[id]=0; + 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"; + hidestatus[id]=0; + if(id=='orphaned'){ + + NumberOrphanedRoom=TampNumberOrphanedRoom; + } + else if(id=='breakout'){ + + NumberBreakoutRoom=TampNumberBreakoutRoom; + } + else if(id=='main'){ + + NumberMainLectureRoom=TampNumberMainLectureRoom; + } + } + else + { + document.getElementById(id).style.display="none"; + document.images['toggleimg'+id].src="pictures/small_expand.gif"; + hidestatus[id]=1; + if(id=='orphaned'){ + TampNumberOrphanedRoom=NumberOrphanedRoom; + NumberOrphanedRoom=0; + } + else if(id=='breakout'){ + TampNumberBreakoutRoom=NumberBreakoutRoom; + NumberBreakoutRoom=0; + } + else if(id=='main'){ + TampNumberMainLectureRoom=NumberMainLectureRoom; + NumberMainLectureRoom=0; + } + } + // gestionDisplay('collapse'); +} +function Navigateur() +{ + if (navigator.appName.indexOf("Netscape") > -1) + { + return "Netscape"; + } + if (navigator.appName.indexOf("Explorer") > -1) + { + return "Explorer"; + } + return "Unknown"; +} +var current=""; +function OneClick(id) +{ + if(studentView==false) + { + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule.png', sizingMethod='scale')"; + document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings.png', sizingMethod='scale')"; + document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content.png', sizingMethod='scale')"; + document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon"].src="pictures/launch.png"; + document.images["schedule_icon"].src="pictures/schedule.png"; + document.images["settings_icon"].src="pictures/settings.png"; + document.images["content_icon"].src="pictures/content.png"; + document.images["poll_icon"].src="pictures/poll.png"; + } + document.getElementById("menu_admin").className="button_enabled"; + } + else + { + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon_student"].src="pictures/launch.png"; + } + document.getElementById("menu_student").className="button_enabled"; + } + if(current!="" && current!=id) + document.getElementById(current).style.backgroundColor="white"; + if(current!=id) + { + document.getElementById(id).style.backgroundColor="#c3dbf7"; + } + current=id; + if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") + document.getElementById("info").style.display="none"; +} +function dclick(id) +{ + if(current!="") + document.getElementById(current).style.backgroundColor="white"; + current=id; +} +function onOver(id) +{ + if(current!=id) + { + document.getElementById(id).style.backgroundColor="#f0f3f5"; + document.getElementById(id).style.cursor="pointer"; + } +} +function onOut(id) +{ + if(current!=id) + document.getElementById(id).style.backgroundColor="white"; +} +function Horizon(tok) +{ + if(current!="") + startHorizon(current, null, null, null, null, tok) +} +<?php if(isstudent($course->id)) +{ +?> + + var studentView=true; + document.getElementById("admin_Menu").style.display="block"; + document.getElementById("student_Menu").style.display="none"; +<?php +} +else +{ +?> + + var studentView=false; + //document.getElementById("admin_Menu").style.display="none"; + //document.getElementById("student_Menu").style.display="block"; +<?php +} +?> +function ChangeView() +{ + if( document.getElementById("view").value=="student") + { + studentView=true; + + //document.getElementById("admin_Menu").style.display="none"; + //document.getElementById("student_Menu").style.display="block"; + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon_student"].src="pictures/launch_Black.png"; + } + } + else + { + studentView=false; + //document.getElementById("admin_Menu").style.display="block"; + //document.getElementById("student_Menu").style.display="none"; + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule_Black.png', sizingMethod='scale')"; + document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; + document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings_Black.png', sizingMethod='scale')"; + document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content_Black.png', sizingMethod='scale')"; + document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll_Black.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon"].src="pictures/launch_Black.png"; + document.images["schedule_icon"].src="pictures/schedule_Black.png"; + document.images["settings_icon"].src="pictures/settings_Black.png"; + document.images["content_icon"].src="pictures/content_Black.png"; + document.images["poll_icon"].src="pictures/poll_Black.png"; + } + } + getMainLectureRoom(""); + getBreakoutRoom(""); + //getOrphanedArchive(""); + if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") + document.getElementById("info").style.display="none"; + current=""; + //document.getElementById("menu_admin").className="button_disabled" + //document.getElementById("menu_student").className="button_disabled"; +} + +function LaunchWizard(url) +{ +var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); +w.focus(); +} +function doOpenIntern(popup,url){ + if(current!="") + { + + if(popup==false) + { + window.open(url,"_top"); + } + else + { + var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } + } + +} +function doOpen(popup,url,param) +{ + + if(current!="") + { + var complete_url=url+'?roomId='+current+'&'+param; + if(popup==false) + { + window.open(complete_url,"_self"); + } + else + { + var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } + } +} +function doOpenExtern(url,param) +{ + if(current!="") + { + var complete_url=url+'?class_id='+current+'&'+param; + var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } +} +function hideCroix(v) +{ + if(v.length>0) + document.getElementById("croix").style.display="block"; + else + document.getElementById("croix").style.display="none"; +} +var hiddenCroix=0; +function overCroix(v) +{ + if(hiddenCroix==0) + { + v.src="pictures/x_normal.gif"; + hiddenCroix=1; + } + else + { + v.src="pictures/x_over.gif"; + hiddenCroix=0; + + } +} +function clickCroix() +{ + document.getElementById("search").value=""; + document.getElementById("croix").style.display="none"; +} + + +var NumberMainLectureRoom=0; +var NumberBreakoutRoom=0; +var NumberOrphanedRoom=0; +function getMainLectureRoom(search) +{ + + <?php + $tab = liveclassroom_get_main_room_list($course); + ?> + + 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]); $i++) + { + // print ($tab[0][$i]); + ?> + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch) + if(search==null || results!=null) + { + var preview; + <?php + if(!liveclassroom_api_room_is_preview($tab[0][$i])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + if(studentView==false || ( studentView==true && !preview)) + { + 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[0][$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>"; + + <?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>"; + <?php + } + ?> + }else{ + + <?php /* + if((openArchive[((LCRoom)mainLectureRoom.GetByIndex(i)).getRoomId()])!=null) + { + ?> + + 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>"; + + <?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=\"550px\" 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>"; + 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>"; + } + 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>"; + + } + 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>"; + } + 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><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[0][$i]))>0) + { + ?> + 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[0][$i]); + ?> + retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >"; + <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++) + { + /* + if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId())) + orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/ + ?> + var preview; + <?php if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + 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=300px 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 += "<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>"; + 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>"; + } + 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>"; + } + + } + 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>"; + } + 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><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>"; + } + <?php + } + ?> + retour += "</table>"; + retour += " </div></td></tr>"; + <?php + } + ?> + NumberMainLectureRoom++; + } + } + <?php + } + ?> + if(numberArchive>0){ + + NumberMainLectureRoom++; + } + + retour += "</table>"; + document.getElementById("main").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} + + +function getBreakoutRoom(search) +{ + + <?php + $tab = liveclassroom_get_main_room_list($course); + ?> + + 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[1]); $i++) + { + ?> + + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch) + if(search==null || results!=null) + { + var preview; + <?php + if(!liveclassroom_api_room_is_preview($tab[1][$i])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + if(studentView==false || ( studentView==true && !preview)) + { + retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">" + if(studentView==false) + { + + 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>"; + + }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=\"550\" 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>"; + 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>"; + } + 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>"; + + + } + 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>"; + } + 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><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>"; + + NumberBreakoutRoom++; + } + } + <?php + } + ?> + if(numberArchive>0){ + + NumberBreakoutRoom++; + } + + retour += "</table>"; + document.getElementById("breakout").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} + +function deleteRoom() { + +} + +/* +function getOrphanedArchive(search) +{ + NumberOrphanedRoom=0; + var retour=""; + retour += " <table width=460px cellspacing=0 border=0 >"; + <% for(i=0; i<orphanedArchive.Count; i++) + { + %> + myString = new String("<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname().ToLower()%>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch); + if(search==null || results!=null) + { + var preview; + <%if(((LCRoom)orphanedArchive.GetByIndex(i)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + 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 += "<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 += "<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname()%></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\""; + } + else + { + if(studentView==false) + { + retour +="<td width=\"20px\" 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=\"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><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>"; + NumberOrphanedRoom++; + } + } + <% + } + %> + <% for(i=0; i<orphanedArchiveForStudent.Count; i++) + { + %> + myString = new String("<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname().ToLower()%>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch); + if(search==null || results!=null) + { + var preview; + <%if(((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + if( studentView==true && !preview) + { + retour += "<tr id='<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>'><td width=\"10px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" ></td><td onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\">"; + retour += "<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname()%></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)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; + } + else + { + if(studentView==false) + { + retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><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=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + } + retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"></td></tr>"; + NumberOrphanedRoom++; + } + } + <% + } + %> + retour += "</table>"; + document.getElementById("orphaned").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} +*/ +function gestionDisplay(type) +{ + + + +} + +</script> + + + </head> +<body> + + +<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"> + <td width="5px"></td> + <td align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > + <img src="pictures/launch_Black.png" border="0" alt="Edit RoomSettings" title="Launch Room" id="launch_icon_student" name="launch_icon_student" height="24" width="24"><br /> + Launch + </a> + </td> + <td width=50%></td> + <td colspan="3" align="right" valign="middle" > + <table border=0 style="background-image: url(pictures/searchfield.gif); background-repeat:no-repeat;"> + <tr> + <td align="right" width=15px></td> + <td align="right" width=105px height=25px> + <input name="search" id="search" type="text" style="border:0; width: 105px;" + onkeyup="hideCroix(search.value);javascript:getBreakoutRoom(search.value); getMainLectureRoom(search.value); getOrphanedArchive(search.value);" /> + </td> + <td align=left width=20px > + <div id="croix" style="display:none"> + <img onmouseover="overCroix(this)" Onclick="clickCroix();javascript:getBreakoutRoom(''); getMainLectureRoom(''); getOrphanedArchive('');" Onmouseout="overCroix(this)" src="pictures/x_normal.gif" align="middle" style="border:none " /> + </div> + </td> + </tr> + </table> + </td> + </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" > + <td width="9%" align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');"> + <img src="pictures/launch_Black.png" border="0" alt="Edit RoomSettings" title="Launch Room" id="launch_icon" name="launch_icon" height="24" width="24"><br /> + Launch</a> + + </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')" > + <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> + + </td> + <td style="border-right: 1px solid #666666;"> </td> + <td width="5px"></td> + <td width="9%" align=center class="button_enabled"> + + <a href="javascript:doOpen(false,'manageRoom.php','action=createRoom')" > + <img src="pictures/new.png" border="0" alt="Calendar" title="New Room" id="Img1" height="24" width="24"> + <br />New Room</a> + </td> + <td width="5px"></td> + <td width="9%" align="center" > + <a href="javascript:doOpenExtern('<?php p($CFG->liveclassroom_servername)?>/admin/class/carousels.epl','hzA=<?php p($usersession)?>')" > + <img src="pictures/content_Black.png" border="0" + alt="Manage Content" title="Manage Content" id="content_icon" name="content_icon" height="24" width="24"><br /> + Content + </a> + </td> + <td width="9%" align="center" > + <!-- <a href="javascript:doOpen(true,'View_Report.aspx','hzA=<?php p($usersession)?>')" > + --> <img src="pictures/poll_Black.png" border="0" + alt="View Room Records" title="View Poll Results" id="poll_icon" name="poll_icon" height="24" width="24"><br /> + Poll</a> + </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 /> + Availability</a> + </td> + <td width="9%" align="center" > + <a href="javascript:doOpen(false,'manageRoom.php','action=editRoom')" > + <img src="pictures/settings_Black.png" border="0" + alt="Edit RoomSettings" title="Edit Room Settings" id="settings_icon" name="settings_icon" height="24" width="24"><br /> + Settings</a> + </td> + + + <td width="9%" align="center" > + <a href="javascript:doOpen(false,'','')" 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> + </td> + <td colspan="3" align="right" valign="middle" > + <table border=0 style="background-image: url(pictures/searchfield.gif); background-repeat:no-repeat;"> + <tr> + <td align="right" width=15px></td> + <td align="right" width=105px height=25px> + <input name="search" id="search" type="text" style="border:0; width: 105px;" + onkeyup="hideCroix(search.value);javascript:getBreakoutRoom(search.value); getMainLectureRoom(search.value); getOrphanedArchive(search.value);" /> + </td> + <td align=left width=20px > + <div id="croix" style="display:none"> + <img onmouseover="overCroix(this)" Onclick="clickCroix();javascript:getBreakoutRoom(''); getMainLectureRoom(''); getOrphanedArchive('');" Onmouseout="overCroix(this)" src="pictures/x_normal.gif" align="middle" style="border:none " /> + </div> + </td> + </tr> + </table> + </td> + </tr> + </table> + </span> + <?php + } ?> + </td> + </tr> + <tr> + <td colspan="15" style="background-color: #c9d2df;"> + <div id="main_title"> + <a href="javascript:hideBloc('main')" title="Expand/Collapse Archive List"> + <img src="<?php p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif" name="toggleimgmain" + border="0" alt="Expand/Collapse More Options" /> + <strong style="color: white">Main rooms: + </a></strong> + </div> + </td> + </tr> + <tr> + <td colspan="15" > + <div id="main" style=" overflow-y:auto;overflow-x: hidden;width:100%;" > + </div> + </td> + </tr> + <tr> + <td colspan="15" style="background-color: #c9d2df; " > + <div id="breakout_title"> + <a href="javascript:hideBloc('breakout')" title="Expand/Collapse Archive List"> + <img src="<?php p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif" name="toggleimgbreakout" + border="0" alt="Expand/Collapse More Options" /></a><strong style="color: white"> Discussion rooms: + </strong></div> + </td> + </tr> + <tr> + <td colspan="15" > + <div id="breakout" style=" overflow-y:auto;overflow-x: hidden;width:100%" > + </div> + </td> + </tr> + <tr> + <td colspan="8" style="background-color: #c9d2df; " > + <div id="orphaned_title" > + + <a href="javascript:hideBloc('orphaned')" title="Expand/Collapse Archive List"> + <img src="<?php p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif" name="toggleimgorphaned" + ... [truncated message content] |
From: <sh...@us...> - 2006-09-13 14:09:03
|
Revision: 62 http://svn.sourceforge.net/hw4mdl/?rev=62&view=rev Author: shazan Date: 2006-09-13 07:08:54 -0700 (Wed, 13 Sep 2006) Log Message: ----------- function get archive list for a room is ok Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-13 12:29:20 UTC (rev 61) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-13 14:08:54 UTC (rev 62) @@ -686,12 +686,12 @@ * * NEED TO BE TESTED !!! */ -function liveclassroom_api_get_archive_list() { +function liveclassroom_api_get_archive_list($course) { global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute&filter01=archive&filter01value=1"); + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=class_id&filter01=archive&filter01value=1"); preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -712,6 +712,47 @@ } /* +* List all the archive room associated with the room given +* +* @param $roomid : the id of the room +* return a table with all the archive room id +*/ +function liveclassroom_api_get_archive_list_for_a_room($roomid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=class_id&filter01=archive&filter01value=1"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + //print $data; + $tok = split("100 OK",$data); + $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); + + $j=0; + + for($i=0;$i<sizeof($tok1);$i++) { + $test = strstr($tok1[$i],$roomid); + if($test!=false){ + // print "yrr"; + // $result = liveclassroom_parse_line($tok1[$i],"class_id="); + //Remove le " " at the end of the line + $response = substr($test,0,-1); + $list_return[$j]=$response; + $j++; + } + + } + return $list_return; +} + +/* * Check if a user exist in the course given * link : user last name = course shortname * @param $course : an instance of a course @@ -923,6 +964,9 @@ function liveclassroom_api_get_orphaned_archive_list() { + + + $tab_archive = liveclassroom_api_get_archive_list() ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-09-13 12:29:29
|
Revision: 61 http://svn.sourceforge.net/hw4mdl/?rev=61&view=rev Author: shazan Date: 2006-09-13 05:29:20 -0700 (Wed, 13 Sep 2006) Log Message: ----------- Added Paths: ----------- trunk/moodle/mod/liveclassroom/accueil.php Added: trunk/moodle/mod/liveclassroom/accueil.php =================================================================== --- trunk/moodle/mod/liveclassroom/accueil.php (rev 0) +++ trunk/moodle/mod/liveclassroom/accueil.php 2006-09-13 12:29:20 UTC (rev 61) @@ -0,0 +1,916 @@ +<?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: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + +/// This page lists all the instances of liveclassroom in a particular course + + + require_once("../../config.php"); + require_once("lib.php"); + + $id = optional_param('id', 0, PARAM_INT); + + $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)) { + error("Course ID is incorrect"); + } + + require_login($course->id); + + add_to_log($course->id, "liveclassroom", "view all", "index.php?id=$course->id", ""); + + +/// Get all required strings + + $strliveclassrooms = get_string("modulenameplural", "liveclassroom"); + $strliveclassroom = get_string("modulename", "liveclassroom"); + + if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { + error ("Cannot create session"); + } + +/// Print the header + + if ($course->category) { + $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; + } + + // print_header("$course->shortname: $strliveclassrooms", "$course->fullname", "$navigation $strliveclassrooms", "", "", true, "", navmenu($course)); + +/// Get all the appropriate data + + if (! $liveclassrooms = get_all_instances_in_course("liveclassroom", $course)) { + notice("There are no liveclassrooms", "../../course/view.php?id=$course->id"); + die; + } +?> + <head> + <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> +<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> + <script type="text/javascript"> +var hidestatus = new Array(); +function hideArchive(id) +{ + if(hidestatus[id]==null)//first use + hidestatus[id]=1; + if (hidestatus[id]==1) + { + document.getElementById(id).style.display="block"; + document.images['toggleimg'+id].src="pictures/minus.gif"; + hidestatus[id]=0; + } + else + { + document.getElementById(id).style.display="none"; + document.images['toggleimg'+id].src="pictures/plus.gif"; + hidestatus[id]=1; + } +} +var TampNumberMainLectureRoom=0; +var TampNumberBreakoutRoom=0; +var TampNumberOrphanedRoom=0; +function hideBloc(id) +{ + + if(hidestatus[id]==null)//first use + hidestatus[id]=0; + 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"; + hidestatus[id]=0; + if(id=='orphaned'){ + + NumberOrphanedRoom=TampNumberOrphanedRoom; + } + else if(id=='breakout'){ + + NumberBreakoutRoom=TampNumberBreakoutRoom; + } + else if(id=='main'){ + + NumberMainLectureRoom=TampNumberMainLectureRoom; + } + } + else + { + document.getElementById(id).style.display="none"; + document.images['toggleimg'+id].src="pictures/small_expand.gif"; + hidestatus[id]=1; + if(id=='orphaned'){ + TampNumberOrphanedRoom=NumberOrphanedRoom; + NumberOrphanedRoom=0; + } + else if(id=='breakout'){ + TampNumberBreakoutRoom=NumberBreakoutRoom; + NumberBreakoutRoom=0; + } + else if(id=='main'){ + TampNumberMainLectureRoom=NumberMainLectureRoom; + NumberMainLectureRoom=0; + } + } + // gestionDisplay('collapse'); +} +function Navigateur() +{ + if (navigator.appName.indexOf("Netscape") > -1) + { + return "Netscape"; + } + if (navigator.appName.indexOf("Explorer") > -1) + { + return "Explorer"; + } + return "Unknown"; +} +var current=""; +function OneClick(id) +{ + if(studentView==false) + { + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule.png', sizingMethod='scale')"; + document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings.png', sizingMethod='scale')"; + document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content.png', sizingMethod='scale')"; + document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon"].src="pictures/launch.png"; + document.images["schedule_icon"].src="pictures/schedule.png"; + document.images["settings_icon"].src="pictures/settings.png"; + document.images["content_icon"].src="pictures/content.png"; + document.images["poll_icon"].src="pictures/poll.png"; + } + document.getElementById("menu_admin").className="button_enabled"; + } + else + { + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon_student"].src="pictures/launch.png"; + } + document.getElementById("menu_student").className="button_enabled"; + } + if(current!="" && current!=id) + document.getElementById(current).style.backgroundColor="white"; + if(current!=id) + { + document.getElementById(id).style.backgroundColor="#c3dbf7"; + } + current=id; + if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") + document.getElementById("info").style.display="none"; +} +function dclick(id) +{ + if(current!="") + document.getElementById(current).style.backgroundColor="white"; + current=id; +} +function onOver(id) +{ + if(current!=id) + { + document.getElementById(id).style.backgroundColor="#f0f3f5"; + document.getElementById(id).style.cursor="pointer"; + } +} +function onOut(id) +{ + if(current!=id) + document.getElementById(id).style.backgroundColor="white"; +} +function Horizon(tok) +{ + if(current!="") + startHorizon(current, null, null, null, null, tok) +} +<?php if(isstudent($course->id)) +{ +?> + + var studentView=true; + document.getElementById("admin_Menu").style.display="block"; + document.getElementById("student_Menu").style.display="none"; +<?php +} +else +{ +?> + + var studentView=false; + //document.getElementById("admin_Menu").style.display="none"; + //document.getElementById("student_Menu").style.display="block"; +<?php +} +?> +function ChangeView() +{ + if( document.getElementById("view").value=="student") + { + studentView=true; + + //document.getElementById("admin_Menu").style.display="none"; + //document.getElementById("student_Menu").style.display="block"; + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon_student"].src="pictures/launch_Black.png"; + } + } + else + { + studentView=false; + //document.getElementById("admin_Menu").style.display="block"; + //document.getElementById("student_Menu").style.display="none"; + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule_Black.png', sizingMethod='scale')"; + document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; + document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings_Black.png', sizingMethod='scale')"; + document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content_Black.png', sizingMethod='scale')"; + document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll_Black.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon"].src="pictures/launch_Black.png"; + document.images["schedule_icon"].src="pictures/schedule_Black.png"; + document.images["settings_icon"].src="pictures/settings_Black.png"; + document.images["content_icon"].src="pictures/content_Black.png"; + document.images["poll_icon"].src="pictures/poll_Black.png"; + } + } + getMainLectureRoom(""); + getBreakoutRoom(""); + //getOrphanedArchive(""); + if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") + document.getElementById("info").style.display="none"; + current=""; + //document.getElementById("menu_admin").className="button_disabled" + //document.getElementById("menu_student").className="button_disabled"; +} + +function LaunchWizard(url) +{ +var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); +w.focus(); +} +function doOpenIntern(popup,url){ + if(current!="") + { + + if(popup==false) + { + window.open(url,"_top"); + } + else + { + var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } + } + +} +function doOpen(popup,url,param) +{ + + if(current!="") + { + var complete_url=url+'?roomId='+current+'&'+param; + if(popup==false) + { + window.open(complete_url,"_self"); + } + else + { + var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } + } +} +function doOpenExtern(url,param) +{ + if(current!="") + { + var complete_url=url+'?class_id='+current+'&'+param; + var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } +} +function hideCroix(v) +{ + if(v.length>0) + document.getElementById("croix").style.display="block"; + else + document.getElementById("croix").style.display="none"; +} +var hiddenCroix=0; +function overCroix(v) +{ + if(hiddenCroix==0) + { + v.src="pictures/x_normal.gif"; + hiddenCroix=1; + } + else + { + v.src="pictures/x_over.gif"; + hiddenCroix=0; + + } +} +function clickCroix() +{ + document.getElementById("search").value=""; + document.getElementById("croix").style.display="none"; +} + + +var NumberMainLectureRoom=0; +var NumberBreakoutRoom=0; +var NumberOrphanedRoom=0; +function getMainLectureRoom(search) +{ + + <?php + $tab = liveclassroom_get_main_room_list($course); + ?> + /* + <% + SortedList archiveOfThisRoomID; + %>*/ + var retour=""; + NumberMainLectureRoom=0; + var numberArchive=0; + var number=0; + retour += " <table width=990px cellspacing=0 cellpadding=1 border=0>"; + <?php for($i=0; $i<sizeof($tab[0]); $i++) + { + // print ($tab[0][$i]); + ?> + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch) + if(search==null || results!=null) + { + var preview; + <?php + if(!liveclassroom_api_room_is_preview($tab[0][$i])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + if(studentView==false || ( studentView==true && !preview)) + { + retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">" + + if(studentView==false) + { + 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>"; + + }else{ + + <?php /* + if((openArchive[((LCRoom)mainLectureRoom.GetByIndex(i)).getRoomId()])!=null) + { + ?> + + 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>"; + + <?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=\"550px\" 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>"; + 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>"; + } + 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>"; + + } + 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>"; + } + 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><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>"; + + NumberMainLectureRoom++; + } + } + <?php + } + ?> + if(numberArchive>0){ + + NumberMainLectureRoom++; + } + + retour += "</table>"; + document.getElementById("main").innerHTML = retour; + gestionDisplay(); + //if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + //correctPNG(); +} + + +function getBreakoutRoom(search) +{ + + <?php + $tab = liveclassroom_get_main_room_list($course); + ?> + + var retour=""; + NumberBreakoutRoom=0; + var numberArchive=0; + var number=0; + retour += " <table width=990px cellspacing=0 cellpadding=1 border=0>"; + <?php for($i=0; $i<sizeof($tab[1]); $i++) + { + ?> + + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch) + if(search==null || results!=null) + { + var preview; + <?php + if(!liveclassroom_api_room_is_preview($tab[1][$i])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + if(studentView==false || ( studentView==true && !preview)) + { + retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">" + if(studentView==false) + { + + 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>"; + + }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=\"550\" 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>"; + 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>"; + } + 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>"; + + + } + 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>"; + } + 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><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>"; + + NumberBreakoutRoom++; + } + } + <?php + } + ?> + if(numberArchive>0){ + + NumberBreakoutRoom++; + } + + retour += "</table>"; + document.getElementById("breakout").innerHTML = retour; + gestionDisplay(); + // if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + // correctPNG(); +} + +function deleteRoom() { + +} + +/* +function getOrphanedArchive(search) +{ + NumberOrphanedRoom=0; + var retour=""; + retour += " <table width=460px cellspacing=0 border=0 >"; + <% for(i=0; i<orphanedArchive.Count; i++) + { + %> + myString = new String("<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname().ToLower()%>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch); + if(search==null || results!=null) + { + var preview; + <%if(((LCRoom)orphanedArchive.GetByIndex(i)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + 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 += "<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 += "<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname()%></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\""; + } + else + { + if(studentView==false) + { + retour +="<td width=\"20px\" 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=\"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><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>"; + NumberOrphanedRoom++; + } + } + <% + } + %> + <% for(i=0; i<orphanedArchiveForStudent.Count; i++) + { + %> + myString = new String("<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname().ToLower()%>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch); + if(search==null || results!=null) + { + var preview; + <%if(((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + if( studentView==true && !preview) + { + retour += "<tr id='<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>'><td width=\"10px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" ></td><td onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\">"; + retour += "<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname()%></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)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; + } + else + { + if(studentView==false) + { + retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><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=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + } + retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"></td></tr>"; + NumberOrphanedRoom++; + } + } + <% + } + %> + retour += "</table>"; + document.getElementById("orphaned").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} +*/ +function gestionDisplay(type) +{ + + + +} + +</script> + + + </head> +<body> + + +<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"> + <td width="5px"></td> + <td align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > + <img src="pictures/launch_Black.png" border="0" alt="Edit RoomSettings" title="Launch Room" id="launch_icon_student" name="launch_icon_student" height="24" width="24"><br /> + Launch + </a> + </td> + <td width=50%></td> + <td colspan="3" align="right" valign="middle" > + <table border=0 style="background-image: url(pictures/searchfield.gif); background-repeat:no-repeat;"> + <tr> + <td align="right" width=15px></td> + <td align="right" width=105px height=25px> + <input name="search" id="search" type="text" style="border:0; width: 105px;" + onkeyup="hideCroix(search.value);javascript:getBreakoutRoom(search.value); getMainLectureRoom(search.value); getOrphanedArchive(search.value);" /> + </td> + <td align=left width=20px > + <div id="croix" style="display:none"> + <img onmouseover="overCroix(this)" Onclick="clickCroix();javascript:getBreakoutRoom(''); getMainLectureRoom(''); getOrphanedArchive('');" Onmouseout="overCroix(this)" src="pictures/x_normal.gif" align="middle" style="border:none " /> + </div> + </td> + </tr> + </table> + </td> + </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" > + <td width="9%" align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > + <img src="pictures/launch_Black.png" border="0" alt="Edit RoomSettings" title="Launch Room" id="launch_icon" name="launch_icon" height="24" width="24"><br /> + Launch</a> + + </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')" > + <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> + + </td> + <td style="border-right: 1px solid #666666;"> </td> + <td width="5px"></td> + <td width="9%" align=center class="button_enabled"> + + <a href="javascript:doOpen(false,'manageRoom.php','action=createRoom')" > + <img src="pictures/new.png" border="0" alt="Calendar" title="New Room" id="Img1" height="24" width="24"> + <br />New Room</a> + </td> + <td width="5px"></td> + <td width="9%" align="center" > + <a href="javascript:doOpenExtern('<?php p($CFG->liveclassroom_servername)?>/admin/class/carousels.epl','hzA=<?php p($usersession)?>')" > + <img src="pictures/content_Black.png" border="0" + alt="Manage Content" title="Manage Content" id="content_icon" name="content_icon" height="24" width="24"><br /> + Content + </a> + </td> + <td width="9%" align="center" > + <!-- <a href="javascript:doOpen(true,'View_Report.aspx','hzA=<?php p($usersession)?>')" > + --> <img src="pictures/poll_Black.png" border="0" + alt="View Room Records" title="View Poll Results" id="poll_icon" name="poll_icon" height="24" width="24"><br /> + Poll</a> + </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 /> + Availability</a> + </td> + <td width="9%" align="center" > + <a href="javascript:doOpen(false,'manageRoom.php','action=editRoom')" > + <img src="pictures/settings_Black.png" border="0" + alt="Edit RoomSettings" title="Edit Room Settings" id="settings_icon" name="settings_icon" height="24" width="24"><br /> + Settings</a> + </td> + + + <td width="9%" align="center" > + <a href="javascript:doOpen(false,'','')" 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> + </td> + <td colspan="3" align="right" valign="middle" > + <table border=0 style="background-image: url(pictures/searchfield.gif); background-repeat:no-repeat;"> + <tr> + <td align="right" width=15px></td> + <td align="right" width=105px height=25px> + <input name="search" id="search" type="text" style="border:0; width: 105px;" + onkeyup="hideCroix(search.value);javascript:getBreakoutRoom(search.value); getMainLectureRoom(search.value); getOrphanedArchive(search.value);" /> + </td> + <td align=left width=20px > + <div id="croix" style="display:none"> + <img onmouseover="overCroix(this)" Onclick="clickCroix();javascript:getBreakoutRoom(''); getMainLectureRoom(''); getOrphanedArchive('');" Onmouseout="overCroix(this)" src="pictures/x_normal.gif" align="middle" style="border:none " /> + </div> + </td> + </tr> + </table> + </td> + </tr> + </table> + </span> + <?php + } ?> + </td> + </tr> + <tr> + <td colspan="15" style="background-color: #c9d2df;"> + <div id="main_title"> + <a href="javascript:hideBloc('main')" title="Expand/Collapse Archive List"> + <img src="<?php p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif" name="toggleimgmain" + border="0" alt="Expand/Collapse More Options" /> + <strong style="color: white">Main rooms: + </a></strong> + </div> + </td> + </tr> + <tr> + <td colspan="15" > + <div id="main" style=" overflow-y:auto;overflow-x: hidden;width:100%;" > + </div> + </td> + </tr> + <tr> + <td colspan="15" style="background-color: #c9d2df; " > + <div id="breakout_title"> + <a href="javascript:hideBloc('breakout')" title="Expand/Collapse Archive List"> + <img src="<?php p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif" name="toggleimgbreakout" + border="0" alt="Expand/Collapse More Options" /></a><strong style="color: white"> Discussion rooms: + </strong></div> + </td> + </tr> + <tr> + <td colspan="15" > + <div id="breakout" style=" overflow-y:auto;overflow-x: hidden;width:100%" > + </div> + </td> + </tr> + <tr> + <td colspan="8" style="background-color: #c9d2df; " > + <div id="orphaned_title" > + + <a href="javascript:hideBloc('orphaned')" title="Expand/Collapse Archive List"> + <img src="<?php p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif" name="toggleimgorphaned" + border="0" alt="Expand/Collapse More Options" /></a><strong style="color: white"> Orphaned archives: + </strong> + </div> + </td> + </tr> + <tr> + <td colspan="8" > + <div id="orphaned" style=" overflow-y: auto;overflow-x: hidden;width:100%" > + </div> + </td> + </tr> +</table> + +</body> +<script> + + getMainLectureRoom(); + getBreakoutRoom(); + //getOrphanedArchive(); + + + + <?php if (isstudent($course->id)){ ?>/* + document.getElementById("admin_Menu").style.display="none"; + document.getElementById("student_Menu").style.display="block"; + <?php }else { ?> + document.getElementById("admin_Menu").style.display="block"; + document.getElementById("student_Menu").style.display="none"; + <?php } ?> +</script> Property changes on: trunk/moodle/mod/liveclassroom/accueil.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-09-12 16:06:26
|
Revision: 60 http://svn.sourceforge.net/hw4mdl/?rev=60&view=rev Author: shazan Date: 2006-09-12 09:06:16 -0700 (Tue, 12 Sep 2006) Log Message: ----------- basic version of the nugget Modified Paths: -------------- trunk/moodle/mod/liveclassroom/index.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/manageRoom.php Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-09-12 16:03:20 UTC (rev 59) +++ trunk/moodle/mod/liveclassroom/index.php 2006-09-12 16:06:16 UTC (rev 60) @@ -80,1079 +80,49 @@ } ?> <head> - <script type="text/javascript"> -var hidestatus = new Array(); -function hideArchive(id) -{ - if(hidestatus[id]==null)//first use - hidestatus[id]=1; - if (hidestatus[id]==1) - { - document.getElementById(id).style.display="block"; - document.images['toggleimg'+id].src="pictures/minus.gif"; - hidestatus[id]=0; - } - else - { - document.getElementById(id).style.display="none"; - document.images['toggleimg'+id].src="pictures/plus.gif"; - hidestatus[id]=1; - } -} -var TampNumberMainLectureRoom=0; -var TampNumberBreakoutRoom=0; -var TampNumberOrphanedRoom=0; -function hideBloc(id) -{ - - if(hidestatus[id]==null)//first use - hidestatus[id]=0; - 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"; - hidestatus[id]=0; - if(id=='orphaned'){ - - NumberOrphanedRoom=TampNumberOrphanedRoom; - } - else if(id=='breakout'){ - - NumberBreakoutRoom=TampNumberBreakoutRoom; - } - else if(id=='main'){ - - NumberMainLectureRoom=TampNumberMainLectureRoom; - } - } - else - { - document.getElementById(id).style.display="none"; - document.images['toggleimg'+id].src="pictures/small_expand.gif"; - hidestatus[id]=1; - if(id=='orphaned'){ - TampNumberOrphanedRoom=NumberOrphanedRoom; - NumberOrphanedRoom=0; - } - else if(id=='breakout'){ - TampNumberBreakoutRoom=NumberBreakoutRoom; - NumberBreakoutRoom=0; - } - else if(id=='main'){ - TampNumberMainLectureRoom=NumberMainLectureRoom; - NumberMainLectureRoom=0; - } - } - gestionDisplay('collapse'); -} -function Navigateur() -{ - if (navigator.appName.indexOf("Netscape") > -1) - { - return "Netscape"; - } - if (navigator.appName.indexOf("Explorer") > -1) - { - return "Explorer"; - } - return "Unknown"; -} -var current=""; -function OneClick(id) -{ - if(studentView==false) - { - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - { - document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule.png', sizingMethod='scale')"; - document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; - document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; - document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings.png', sizingMethod='scale')"; - document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content.png', sizingMethod='scale')"; - document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll.png', sizingMethod='scale')"; - } - else - { - document.images["launch_icon"].src="pictures/launch.png"; - document.images["schedule_icon"].src="pictures/schedule.png"; - document.images["settings_icon"].src="pictures/settings.png"; - document.images["content_icon"].src="pictures/content.png"; - document.images["poll_icon"].src="pictures/poll.png"; - } - document.getElementById("menu_admin").className="button_enabled"; - } - else - { - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - { - document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; - } - else - { - document.images["launch_icon_student"].src="pictures/launch.png"; - } - document.getElementById("menu_student").className="button_enabled"; - } - if(current!="" && current!=id) - document.getElementById(current).style.backgroundColor="white"; - if(current!=id) - { - document.getElementById(id).style.backgroundColor="#c3dbf7"; - } - current=id; - if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") - document.getElementById("info").style.display="none"; -} -function dclick(id) -{ - if(current!="") - document.getElementById(current).style.backgroundColor="white"; - current=id; -} -function onOver(id) -{ - if(current!=id) - { - document.getElementById(id).style.backgroundColor="#f0f3f5"; - document.getElementById(id).style.cursor="pointer"; - } -} -function onOut(id) -{ - if(current!=id) - document.getElementById(id).style.backgroundColor="white"; -} -function Horizon(tok) -{ - if(current!="") - startHorizon(current, null, null, null, null, tok) -} -<?php if (isstudent($course->id)) -{ -?> - - var studentView=true; - document.getElementById("admin_Menu").style.display="block"; - document.getElementById("student_Menu").style.display="none"; - -<?php -} -else -{ -?> + + </head> +<br> +<body> +<br> +<div align="center"> - var studentView=false; - document.getElementById("admin_Menu").style.display="none"; - document.getElementById("student_Menu").style.display="block"; - -<?php -} -?> -function ChangeView() -{ - if( document.getElementById("view").value=="student") - { - studentView=true; - - document.getElementById("admin_Menu").style.display="none"; - document.getElementById("student_Menu").style.display="block"; - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - { - document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; - } - else - { - document.images["launch_icon_student"].src="pictures/launch_Black.png"; - } - } - else - { - studentView=false; - document.getElementById("admin_Menu").style.display="block"; - document.getElementById("student_Menu").style.display="none"; - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - { - document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule_Black.png', sizingMethod='scale')"; - document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; - document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings_Black.png', sizingMethod='scale')"; - document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content_Black.png', sizingMethod='scale')"; - document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll_Black.png', sizingMethod='scale')"; - } - else - { - document.images["launch_icon"].src="pictures/launch_Black.png"; - document.images["schedule_icon"].src="pictures/schedule_Black.png"; - document.images["settings_icon"].src="pictures/settings_Black.png"; - document.images["content_icon"].src="pictures/content_Black.png"; - document.images["poll_icon"].src="pictures/poll_Black.png"; - } - } - getMainLectureRoom(""); - getBreakoutRoom(""); - //getOrphanedArchive(""); - if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") - document.getElementById("info").style.display="none"; - current=""; - document.getElementById("menu_admin").className="button_disabled" - document.getElementById("menu_student").className="button_disabled"; -} + <iframe src="accueil.php?id=<?php p($id) ?>" width="1000" height="400" name="yo" frameborder="1" align="middle"> + <p>Votre navigateur ne peut malheureusement pas afficher de cadre incorpor\xE9: Vous pouvez appeler la page incorpor\xE9e + par ce lien: <a href="../../../index.htm">SELFHTML</a></p> + </iframe> -function LaunchWizard(url) -{ -var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); -w.focus(); -} +</div> + <table width="1000" align="center"> + <tr style="background-color: white"> + <td width="55%"></td> + <td align=right valign=middle style="color: #cccccc; font-style: italic; font-family: Verdana; height: 12px;"> + + Powered by : + </td> + <td align="right"><img src="pictures/logo.gif" /></td> + </tr> + </table> + + <?php + /* + $tab = liveclassroom_api_get_orphaned_archive_list(); + for($j=0;$j<sizeof($tab);$j++){ + echo $tab[$j]; + }*/ -function doOpen(popup,url,param) -{ - - if(current!="") - { - var complete_url=url+'?roomId='+current+'&'+param; - if(popup==false) - { - window.open(complete_url,"_self"); - } - else - { - var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); - w.focus(); - } - } -} -function doOpenExtern(url,param) -{ - if(current!="") - { - var complete_url=url+'?class_id='+current+'&'+param; - var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); - w.focus(); - } -} -function hideCroix(v) -{ - if(v.length>0) - document.getElementById("croix").style.display="block"; - else - document.getElementById("croix").style.display="none"; -} -var hiddenCroix=0; -function overCroix(v) -{ - if(hiddenCroix==0) - { - v.src="pictures/x_normal.gif"; - hiddenCroix=1; - } - else - { - v.src="pictures/x_over.gif"; - hiddenCroix=0; - - } -} -function clickCroix() -{ - document.getElementById("search").value=""; - document.getElementById("croix").style.display="none"; -} - - -var NumberMainLectureRoom=0; -var NumberBreakoutRoom=0; -var NumberOrphanedRoom=0; -function getMainLectureRoom(search) -{ - <?php - $tab = liveclassroom_get_main_room_list($course); ?> - /* - <% - SortedList archiveOfThisRoomID; - %>*/ - var retour=""; - NumberMainLectureRoom=0; - var numberArchive=0; - var number=0; - retour += " <table width=460px cellspacing=0 cellpadding=1 border=0>"; - <?php for($i=0; $i<sizeof($tab[0]); $i++) - { - ?> - myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?>"); - mysearch=new String(search); - mysearch=mysearch.toLowerCase(); - results = myString.match(mysearch) - if(search==null || results!=null) - { - var preview; - <?php - if(liveclassroom_api_room_is_preview($tab[0][$i])) - { - ?> - preview=true; - <?php - } - else - { - ?> - preview=false; - <?php - } - ?> - if(studentView==false || ( studentView==true && !preview)) - { - retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">" - - if(studentView==false) - { - 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>"; - - }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=\"300px\" 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>"; - 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>"; - } - 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('<%=prefix+((LCRoom)mainLectureRoom.GetByIndex(i)).getRoomId()%>')\" 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>"; - } - 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><td width='100px' 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>"; - - - NumberMainLectureRoom++; - } - } - <?php - } - ?> - if(numberArchive>0){ - - NumberMainLectureRoom++; - } - - retour += "</table>"; - document.getElementById("main").innerHTML = retour; - gestionDisplay(); - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - correctPNG(); -} +</body> -function getBreakoutRoom(search) -{ - <?php - $tab = liveclassroom_get_main_room_list($course); - ?> - var retour=""; - NumberBreakoutRoom=0; - var numberArchive=0; - var number=0; - retour += " <table width=460px cellspacing=0 cellpadding=1 border=0>"; - <?php for($i=0; $i<sizeof($tab[1]); $i++) - { - ?> - myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?>"); - mysearch=new String(search); - 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(((LCRoom)breakoutRoom.GetByIndex(i)).isPreview()) - { - ?> - preview=true; - <?php - } - else - { - ?> - preview=false; - <?php - } - ?> - if(studentView==false || ( studentView==true && !preview)) - { - retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">" - if(studentView==false) - { - /* - <%if((((SortedList)archive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()]).Count)>0) - { - %> - numberArchive++; - - retour+="<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\"></td>"; - retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide')\" name=\"toggleimg<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; - - <% - } - 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>"; - - }else{ - /* - <%if((openArchive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()])!=null) - { - %> - - numberArchive++; - - retour+="<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\"></td>"; - retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide')\" name=\"toggleimg<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; - - <% - } - 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=\"300px\" 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>"; - 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>"; - } - 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>"; - - - } - 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>"; - } - 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><td width='100px' 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>"; - /* <% if((((SortedList)archive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()]).Count)>0) - { - - %> - - retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide'>"; - <% archiveOfThisRoomID=(SortedList)archive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()]; - %> - retour += " <table width=460px cellspacing=0 cellpadding=1 border=0 >"; - <% for( j=0; j<archiveOfThisRoomID.Count; j++) - { - if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId())) - orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()); - %> - var preview; - <%if(((LCRoom)archiveOfThisRoomID.GetByIndex(j)).isPreview()) - { - %> - preview=true; - <% - } - else - { - %> - preview=false; - <% - } - %> - if(studentView==false|| ( studentView==true && !preview)) - { - retour += "<tr id='<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>' Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"></td>"; - retour += "<td width=300px Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\">"; - retour += "<span ><img src=\"<%=Setup.getInstance().getLcServerURL()%>/images/integration/pointer.gif\" style=\"border:none\" />"; - retour += "<%=((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getLongname()%></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>"; - } - else - { - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"><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>"; - } - else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; - } - retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"></td></tr>"; - } - <% - } - %> - retour += "</table>"; - retour += " </div></td></tr>"; - <% - } - %>*/ - NumberBreakoutRoom++; - } - } - <?php - } - ?> - if(numberArchive>0){ - - NumberBreakoutRoom++; - } - - retour += "</table>"; - document.getElementById("breakout").innerHTML = retour; - gestionDisplay(); - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - correctPNG(); -} -/* -function getOrphanedArchive(search) -{ - NumberOrphanedRoom=0; - var retour=""; - retour += " <table width=460px cellspacing=0 border=0 >"; - <% for(i=0; i<orphanedArchive.Count; i++) - { - %> - myString = new String("<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname().ToLower()%>"); - mysearch=new String(search); - mysearch=mysearch.toLowerCase(); - results = myString.match(mysearch); - if(search==null || results!=null) - { - var preview; - <%if(((LCRoom)orphanedArchive.GetByIndex(i)).isPreview()) - { - %> - preview=true; - <% - } - else - { - %> - preview=false; - <% - } - %> - 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 += "<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 += "<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname()%></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\""; - } - else - { - if(studentView==false) - { - retour +="<td width=\"20px\" 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=\"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><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>"; - NumberOrphanedRoom++; - } - } - <% - } - %> - <% for(i=0; i<orphanedArchiveForStudent.Count; i++) - { - %> - myString = new String("<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname().ToLower()%>"); - mysearch=new String(search); - mysearch=mysearch.toLowerCase(); - results = myString.match(mysearch); - if(search==null || results!=null) - { - var preview; - <%if(((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).isPreview()) - { - %> - preview=true; - <% - } - else - { - %> - preview=false; - <% - } - %> - if( studentView==true && !preview) - { - retour += "<tr id='<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>'><td width=\"10px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" ></td><td onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\">"; - retour += "<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname()%></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)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; - } - else - { - if(studentView==false) - { - retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><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=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; - } - retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"></td></tr>"; - NumberOrphanedRoom++; - } - } - <% - } - %> - retour += "</table>"; - document.getElementById("orphaned").innerHTML = retour; - gestionDisplay(); - if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) - correctPNG(); -} -*/ -function gestionDisplay(type) -{ - if(type!='collapse'){ - if(NumberOrphanedRoom==0) - { - document.getElementById("orphaned").style.display="none"; - document.getElementById("orphaned_title").style.display="none"; - } - else - { - document.getElementById("orphaned").style.display="block"; - document.getElementById("orphaned_title").style.display="block"; - } - if(NumberBreakoutRoom==0) - { - document.getElementById("breakout").style.display="none"; - document.getElementById("breakout_title").style.display="none"; - } - else - { - document.getElementById("breakout").style.display="block"; - document.getElementById("breakout_title").style.display="block"; - } - if(NumberMainLectureRoom==0) - { - document.getElementById("main").style.display="none"; - document.getElementById("main_title").style.display="none"; - } - else - { - document.getElementById("main").style.display="block"; - document.getElementById("main_title").style.display="block"; - } - } - if(NumberMainLectureRoom==0) - { - if(NumberBreakoutRoom==0) - { - if(NumberOrphanedRoom<10) - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - else - document.getElementById("orphaned").style.height=10*18.5+"px"; - } - else if(NumberOrphanedRoom==0) - { - if(NumberBreakoutRoom<10) - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - else - document.getElementById("breakout").style.height=10*18.5+"px"; - } - else if(NumberOrphanedRoom>=5 && NumberBreakoutRoom>=5) - { - document.getElementById("breakout").style.height=5*18.5+"px"; - document.getElementById("orphaned").style.height=5*18.5+"px"; - } - else if(NumberOrphanedRoom<5 && NumberBreakoutRoom>=5) - { - document.getElementById("breakout").style.height=NumberOrphanedRoom*18.5+"px"; - if(NumberBreakoutRoom>(10-NumberOrphanedRoom)) - document.getElementById("orphaned").style.height=(10-NumberOrphanedRoom)*18.5+"px"; - else - document.getElementById("orphaned").style.height=NumberBreakoutRoom*18.5+"px"; - } - else if(NumberOrphanedRoom<5 && NumberBreakoutRoom<5) - { - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - } - else if(NumberOrphanedRoom>=5 && NumberBreakoutRoom<5) - { - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - if(NumberOrphanedRoom>(10-NumberBreakoutRoom)) - document.getElementById("orphaned").style.height=(10-NumberBreakoutRoom)*18.5+"px"; - else - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - } - } - else if(NumberMainLectureRoom<3) - { - if(NumberBreakoutRoom==0 && NumberOrphanedRoom==0) - { - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - else if(NumberBreakoutRoom==0) - { - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - if(NumberOrphanedRoom>(10-NumberMainLectureRoom)) - document.getElementById("orphaned").style.height=(10-NumberMainLectureRoom)*18.5+"px"; - else - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - } - else if(NumberOrphanedRoom==0) - { - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - if(NumberBreakoutRoom>(10-NumberMainLectureRoom) ){ - document.getElementById("breakout").style.height=(10-NumberMainLectureRoom)*18.5+"px"; - //document.getElementById("breakout").style.o="scroll"; - //document.getElementById("breakout").style.overflow="hidden"; - } - else - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - } - else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom>=3) - { - document.getElementById("breakout").style.height=3*18.5+"px"; - document.getElementById("orphaned").style.height=3*18.5+"px"; - document.getElementById("main").style.height=3*18.5+"px"; - } - else if(NumberOrphanedRoom<3 && NumberBreakoutRoom>=3) - { - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - if(NumberBreakoutRoom>(10-NumberOrphanedRoom-NumberMainLectureRoom)) - document.getElementById("breakout").style.height=(10-NumberOrphanedRoom-NumberMainLectureRoom)*18.5+"px"; - else - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - } - else if(NumberOrphanedRoom<3 && NumberBreakoutRoom<3) - { - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom<3) - { - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - if(NumberOrphanedRoom>(10-NumberBreakoutRoom-NumberMainLectureRoom)) - document.getElementById("orphaned").style.height=(10-NumberBreakoutRoom-NumberMainLectureRoom)*18.5+"px"; - else - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - } - } - else if(NumberMainLectureRoom>=3) - { - if(NumberBreakoutRoom==0 && NumberOrphanedRoom==0) - { - if(NumberMainLectureRoom<10) - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - else - document.getElementById("main").style.height=10*18.5+"px"; - } - else if(NumberBreakoutRoom==0) - { - if(NumberOrphanedRoom<5 && NumberMainLectureRoom<5) - { - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - else if(NumberOrphanedRoom>=5 && NumberMainLectureRoom>=5) - { - document.getElementById("orphaned").style.height=5*18.5+"px"; - document.getElementById("main").style.height=5*18.5+"px"; - } - else if(NumberOrphanedRoom<5 && NumberMainLectureRoom>=5) - { - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - if(NumberMainLectureRoom>(10-NumberOrphanedRoom)) - document.getElementById("main").style.height=(10-NumberOrphanedRoom)*18.5+"px"; - else - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - } - else if(NumberOrphanedRoom==0) - { - if(NumberBreakoutRoom<5 && NumberMainLectureRoom<5) - { - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - else if(NumberBreakoutRoom>=5 && NumberMainLectureRoom>=5) - { - document.getElementById("breakout").style.height=5*18.5+"px"; - document.getElementById("main").style.height=5*18.5+"px"; - } - else if(NumberBreakoutRoom<5 && NumberMainLectureRoom>=5) - { - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - if(NumberMainLectureRoom>(10-NumberBreakoutRoom)) - { - document.getElementById("main").style.height=(10-NumberBreakoutRoom)*18.5+"px"; - } - else - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - else if(NumberBreakoutRoom>=5 && NumberMainLectureRoom<5) - { - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - if(NumberBreakoutRoom>(10-NumberMainLectureRoom)) - { - document.getElementById("breakout").style.height=(10-NumberMainLectureRoom)*18.5+"px"; - } - else - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - } - } - else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom>=3) - { - document.getElementById("breakout").style.height=3*18.5+"px"; - document.getElementById("orphaned").style.height=3*18.5+"px"; - document.getElementById("main").style.height=3*18.5+"px"; - } - else if(NumberOrphanedRoom<3 && NumberBreakoutRoom>=3) - { - - document.getElementById("main").style.height=3*18.5+"px"; - document.getElementById("breakout").style.height=3*18.5+"px"; - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - } - else if(NumberOrphanedRoom<3 && NumberBreakoutRoom<3) - { - document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - if(NumberMainLectureRoom>(10-NumberBreakoutRoom-NumberOrphanedRoom)) - { - document.getElementById("main").style.height=(10-NumberBreakoutRoom-NumberOrphanedRoom)*18.5+"px"; - } - else - document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; - } - else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom<3) - { - document.getElementById("main").style.height=3*18.5+"px"; - document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; - document.getElementById("orphaned").style.height=3*18.5+"px"; - } - } -} -</script> - <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> - - </head> - - <br> - - - - <span id="student_Menu"> - <table style="width: 1000" cellspacing="0" cellpadding="1" border="1" align="center"> - <tr class="button_disabled" id="menu_student"> - <td width="5px"></td> - <td align="center" > - <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > - <img src="pictures/launch_Black.png" border="0" - alt="Edit RoomSettings" title="Launch Room" id="launch_icon_student" name="launch_icon_student" height="24" width="24"><br /> - Launch</a> - - </td> - - <td width=77%></td> - </tr> - </table> - </span> - <span id="admin_Menu"> - <table style="width: 1000" cellspacing="0" cellpadding="1" border="1" align="center"> - <tr class="button_disabled" id="menu_admin"> - - <td width="12%" align="center" > - <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > - <img src="pictures/launch_Black.png" border="0" - alt="Edit RoomSettings" title="Launch Room" id="launch_icon" name="launch_icon" height="24" width="24"><br /> - Launch</a> - - </td> - <td width="12%" align="center" > - <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > - <img src="pictures/launch_Black.png" border="0" - alt="Edit RoomSettings" title="Launch Room" id="launch_icon" name="launch_icon" height="24" width="24"><br /> - Add Activity</a> - - </td> - <td style="border-right: 1px solid #666666;"> </td> - <td width="5px"></td> - <td width="10%" align=center class="button_enabled"> - - <!-- a href="<%="ManageRoom.aspx?time="+ session.getTimeOfLoad()+"&"+session.url_params+"signature="+Util.mD5Crypt(session.getSignature()+Setup.getInstance().getHashKey()) %>"> --> - <img src="pictures/new.png" border="0" alt="Calendar" title="Calendar" id="Img1" height="24" width="24"> - <br />New Room</a> - </td> - <td width="5px"></td> - <td width="10%" align="center" > - <!-- <a href="javascript:doOpenExtern('<%=Setup.getInstance().getLcServerURL()%>/admin/class/carousels.epl','hzA=<?php p($usersession)?>')" > - --> <img src="pictures/content_Black.png" border="0" - alt="Manage Content" title="Manage Content" id="content_icon" name="content_icon" height="24" width="24"><br /> - Content</a> - </td> - <td width="10%" align="center" > - <!-- <a href="javascript:doOpen(true,'View_Report.aspx','hzA=<?php p($usersession)?>')" > - --> <img src="pictures/poll_Black.png" border="0" - alt="View Room Records" title="View Poll Results" id="poll_icon" name="poll_icon" height="24" width="24"><br /> - Poll</a> - </td> - <td style="border-right: 1px solid #666666;"> </td> - <td width="10%" 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" id="schedule_icon" height="24" width="24" ><br /> - Availability</a> - </td> - - <td width="10%" align="center" > - <!-- <a href="javascript:doOpen(false,'ManageRoom.aspx','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=editRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" > - --> <img src="pictures/settings_Black.png" border="0" - alt="Edit RoomSettings" title="Edit Room Settings" id="settings_icon" name="settings_icon" height="24" width="24"><br /> - Settings</a> - </td> - - - <td width="10%" 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 ?');" > - --> <img src="pictures/delete_Black.png" border="0" - alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br /> - Delete</a> - </td> - - </tr> - </span> - <!-- message --> - <tr> - <td colspan="12" style... [truncated message content] |
From: <sh...@us...> - 2006-09-12 16:03:43
|
Revision: 59 http://svn.sourceforge.net/hw4mdl/?rev=59&view=rev Author: shazan Date: 2006-09-12 09:03:20 -0700 (Tue, 12 Sep 2006) Log Message: ----------- New functions added Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-08 15:24:47 UTC (rev 58) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-12 16:03:20 UTC (rev 59) @@ -569,6 +569,9 @@ return $response; } + + + /** * delete Room from the server * @@ -681,16 +684,31 @@ /* * archive=1 ===> room is an archive * -* IMPLEMENT ME !!! +* NEED TO BE TESTED !!! */ -function liveclassroom_api_get_archive_list($roomid,$userid,$role) { +function liveclassroom_api_get_archive_list() { global $CFG; global $LIVECLASSROOM_API_ADMIN; - global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&filter00=archive&filter00value=1"); - - + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute&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]); + + $j=0; + + for($i=0;$i<sizeof($tok1);$i++) { + $list_return[$j]=$tok[$i]; + + } + return $list_return; } /* @@ -867,7 +885,94 @@ return false; } } + +/* Check if the room is an archive +* @param $roomid : the id of the room +* return a boolean : true if the room is an archive, false if it's closed +*/ +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($ch,$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; + +} + /** * 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-08 15:25:01
|
Revision: 58 http://svn.sourceforge.net/hw4mdl/?rev=58&view=rev Author: shazan Date: 2006-09-08 08:24:47 -0700 (Fri, 08 Sep 2006) Log Message: ----------- just one function is called to have the different rooms + test display the nugget Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-07 13:19:56 UTC (rev 57) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-08 15:24:47 UTC (rev 58) @@ -837,6 +837,37 @@ } +/* 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; + 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"); + + 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; + } +} + /** * Enroll the given user into the group. * Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-09-07 13:19:56 UTC (rev 57) +++ trunk/moodle/mod/liveclassroom/index.php 2006-09-08 15:24:47 UTC (rev 58) @@ -47,8 +47,8 @@ //$id = require_param('id', 0, PARAM_INT); //require_variable($id); // course + global $CFG; - if (! $course = get_record("course", "id", $id)) { error("Course ID is incorrect"); } @@ -80,16 +80,949 @@ } ?> <head> - <script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> - <SCRIPT language="javascript" src="test.js"></SCRIPT> + <script type="text/javascript"> +var hidestatus = new Array(); +function hideArchive(id) +{ + if(hidestatus[id]==null)//first use + hidestatus[id]=1; + if (hidestatus[id]==1) + { + document.getElementById(id).style.display="block"; + document.images['toggleimg'+id].src="pictures/minus.gif"; + hidestatus[id]=0; + } + else + { + document.getElementById(id).style.display="none"; + document.images['toggleimg'+id].src="pictures/plus.gif"; + hidestatus[id]=1; + } +} +var TampNumberMainLectureRoom=0; +var TampNumberBreakoutRoom=0; +var TampNumberOrphanedRoom=0; +function hideBloc(id) +{ + + if(hidestatus[id]==null)//first use + hidestatus[id]=0; + 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"; + hidestatus[id]=0; + if(id=='orphaned'){ + + NumberOrphanedRoom=TampNumberOrphanedRoom; + } + else if(id=='breakout'){ + + NumberBreakoutRoom=TampNumberBreakoutRoom; + } + else if(id=='main'){ + + NumberMainLectureRoom=TampNumberMainLectureRoom; + } + } + else + { + document.getElementById(id).style.display="none"; + document.images['toggleimg'+id].src="pictures/small_expand.gif"; + hidestatus[id]=1; + if(id=='orphaned'){ + TampNumberOrphanedRoom=NumberOrphanedRoom; + NumberOrphanedRoom=0; + } + else if(id=='breakout'){ + TampNumberBreakoutRoom=NumberBreakoutRoom; + NumberBreakoutRoom=0; + } + else if(id=='main'){ + TampNumberMainLectureRoom=NumberMainLectureRoom; + NumberMainLectureRoom=0; + } + } + gestionDisplay('collapse'); +} +function Navigateur() +{ + if (navigator.appName.indexOf("Netscape") > -1) + { + return "Netscape"; + } + if (navigator.appName.indexOf("Explorer") > -1) + { + return "Explorer"; + } + return "Unknown"; +} +var current=""; +function OneClick(id) +{ + if(studentView==false) + { + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule.png', sizingMethod='scale')"; + document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings.png', sizingMethod='scale')"; + document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content.png', sizingMethod='scale')"; + document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon"].src="pictures/launch.png"; + document.images["schedule_icon"].src="pictures/schedule.png"; + document.images["settings_icon"].src="pictures/settings.png"; + document.images["content_icon"].src="pictures/content.png"; + document.images["poll_icon"].src="pictures/poll.png"; + } + document.getElementById("menu_admin").className="button_enabled"; + } + else + { + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon_student"].src="pictures/launch.png"; + } + document.getElementById("menu_student").className="button_enabled"; + } + if(current!="" && current!=id) + document.getElementById(current).style.backgroundColor="white"; + if(current!=id) + { + document.getElementById(id).style.backgroundColor="#c3dbf7"; + } + current=id; + if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") + document.getElementById("info").style.display="none"; +} +function dclick(id) +{ + if(current!="") + document.getElementById(current).style.backgroundColor="white"; + current=id; +} +function onOver(id) +{ + if(current!=id) + { + document.getElementById(id).style.backgroundColor="#f0f3f5"; + document.getElementById(id).style.cursor="pointer"; + } +} +function onOut(id) +{ + if(current!=id) + document.getElementById(id).style.backgroundColor="white"; +} +function Horizon(tok) +{ + if(current!="") + startHorizon(current, null, null, null, null, tok) +} +<?php if (isstudent($course->id)) +{ +?> + + var studentView=true; + document.getElementById("admin_Menu").style.display="block"; + document.getElementById("student_Menu").style.display="none"; + +<?php +} +else +{ +?> + var studentView=false; + document.getElementById("admin_Menu").style.display="none"; + document.getElementById("student_Menu").style.display="block"; + +<?php +} +?> +function ChangeView() +{ + if( document.getElementById("view").value=="student") + { + studentView=true; + + document.getElementById("admin_Menu").style.display="none"; + document.getElementById("student_Menu").style.display="block"; + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('launch_icon_student').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon_student"].src="pictures/launch_Black.png"; + } + } + else + { + studentView=false; + document.getElementById("admin_Menu").style.display="block"; + document.getElementById("student_Menu").style.display="none"; + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + { + document.getElementById('schedule_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/schedule_Black.png', sizingMethod='scale')"; + document.getElementById('launch_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/launch_Black.png', sizingMethod='scale')"; + document.getElementById('settings_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/settings_Black.png', sizingMethod='scale')"; + document.getElementById('content_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/content_Black.png', sizingMethod='scale')"; + document.getElementById('poll_icon').style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='pictures/poll_Black.png', sizingMethod='scale')"; + } + else + { + document.images["launch_icon"].src="pictures/launch_Black.png"; + document.images["schedule_icon"].src="pictures/schedule_Black.png"; + document.images["settings_icon"].src="pictures/settings_Black.png"; + document.images["content_icon"].src="pictures/content_Black.png"; + document.images["poll_icon"].src="pictures/poll_Black.png"; + } + } + getMainLectureRoom(""); + getBreakoutRoom(""); + //getOrphanedArchive(""); + if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") + document.getElementById("info").style.display="none"; + current=""; + document.getElementById("menu_admin").className="button_disabled" + document.getElementById("menu_student").className="button_disabled"; +} + +function LaunchWizard(url) +{ +var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); +w.focus(); +} + +function doOpen(popup,url,param) +{ + + if(current!="") + { + var complete_url=url+'?roomId='+current+'&'+param; + if(popup==false) + { + window.open(complete_url,"_self"); + } + else + { + var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } + } +} +function doOpenExtern(url,param) +{ + if(current!="") + { + var complete_url=url+'?class_id='+current+'&'+param; + var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); + w.focus(); + } +} +function hideCroix(v) +{ + if(v.length>0) + document.getElementById("croix").style.display="block"; + else + document.getElementById("croix").style.display="none"; +} +var hiddenCroix=0; +function overCroix(v) +{ + if(hiddenCroix==0) + { + v.src="pictures/x_normal.gif"; + hiddenCroix=1; + } + else + { + v.src="pictures/x_over.gif"; + hiddenCroix=0; + + } +} +function clickCroix() +{ + document.getElementById("search").value=""; + document.getElementById("croix").style.display="none"; +} + + +var NumberMainLectureRoom=0; +var NumberBreakoutRoom=0; +var NumberOrphanedRoom=0; +function getMainLectureRoom(search) +{ + <?php + $tab = liveclassroom_get_main_room_list($course); + ?> + /* + <% + SortedList archiveOfThisRoomID; + %>*/ + var retour=""; + NumberMainLectureRoom=0; + var numberArchive=0; + var number=0; + retour += " <table width=460px cellspacing=0 cellpadding=1 border=0>"; + <?php for($i=0; $i<sizeof($tab[0]); $i++) + { + ?> + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch) + if(search==null || results!=null) + { + var preview; + <?php + if(liveclassroom_api_room_is_preview($tab[0][$i])) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + if(studentView==false || ( studentView==true && !preview)) + { + retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">" + + if(studentView==false) + { + + 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>"; + + }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=\"300px\" 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>"; + 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>"; + } + 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('<%=prefix+((LCRoom)mainLectureRoom.GetByIndex(i)).getRoomId()%>')\" 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>"; + } + 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><td width='100px' 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>"; + + + NumberMainLectureRoom++; + } + } + <?php + } + ?> + if(numberArchive>0){ + + NumberMainLectureRoom++; + } + + retour += "</table>"; + document.getElementById("main").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} + +function getBreakoutRoom(search) +{ + <?php + $tab = liveclassroom_get_main_room_list($course); + ?> + + var retour=""; + NumberBreakoutRoom=0; + var numberArchive=0; + var number=0; + retour += " <table width=460px cellspacing=0 cellpadding=1 border=0>"; + <?php for($i=0; $i<sizeof($tab[1]); $i++) + { + ?> + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?>"); + mysearch=new String(search); + 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(((LCRoom)breakoutRoom.GetByIndex(i)).isPreview()) + { + ?> + preview=true; + <?php + } + else + { + ?> + preview=false; + <?php + } + ?> + if(studentView==false || ( studentView==true && !preview)) + { + retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">" + if(studentView==false) + { + /* + <%if((((SortedList)archive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()]).Count)>0) + { + %> + numberArchive++; + + retour+="<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide')\" name=\"toggleimg<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + + <% + } + 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>"; + + }else{ + /* + <%if((openArchive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()])!=null) + { + %> + + numberArchive++; + + retour+="<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide')\" name=\"toggleimg<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + + <% + } + 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=\"300px\" 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>"; + 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>"; + } + 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>"; + + + } + 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>"; + } + 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><td width='100px' 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>"; + /* <% if((((SortedList)archive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()]).Count)>0) + { + + %> + + retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<%=prefix+((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()%>hide'>"; + <% archiveOfThisRoomID=(SortedList)archive[((LCRoom)breakoutRoom.GetByIndex(i)).getRoomId()]; + %> + retour += " <table width=460px cellspacing=0 cellpadding=1 border=0 >"; + <% for( j=0; j<archiveOfThisRoomID.Count; j++) + { + if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId())) + orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()); + %> + var preview; + <%if(((LCRoom)archiveOfThisRoomID.GetByIndex(j)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + if(studentView==false|| ( studentView==true && !preview)) + { + retour += "<tr id='<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>' Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"></td>"; + retour += "<td width=300px Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\">"; + retour += "<span ><img src=\"<%=Setup.getInstance().getLcServerURL()%>/images/integration/pointer.gif\" style=\"border:none\" />"; + retour += "<%=((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getLongname()%></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>"; + } + else + { + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"><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>"; + } + else + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + } + retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId()%>')\"></td></tr>"; + } + <% + } + %> + retour += "</table>"; + retour += " </div></td></tr>"; + <% + } + %>*/ + NumberBreakoutRoom++; + } + } + <?php + } + ?> + if(numberArchive>0){ + + NumberBreakoutRoom++; + } + + retour += "</table>"; + document.getElementById("breakout").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} +/* +function getOrphanedArchive(search) +{ + NumberOrphanedRoom=0; + var retour=""; + retour += " <table width=460px cellspacing=0 border=0 >"; + <% for(i=0; i<orphanedArchive.Count; i++) + { + %> + myString = new String("<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname().ToLower()%>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch); + if(search==null || results!=null) + { + var preview; + <%if(((LCRoom)orphanedArchive.GetByIndex(i)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + 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 += "<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 += "<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname()%></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\""; + } + else + { + if(studentView==false) + { + retour +="<td width=\"20px\" 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=\"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><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>"; + NumberOrphanedRoom++; + } + } + <% + } + %> + <% for(i=0; i<orphanedArchiveForStudent.Count; i++) + { + %> + myString = new String("<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname().ToLower()%>"); + mysearch=new String(search); + mysearch=mysearch.toLowerCase(); + results = myString.match(mysearch); + if(search==null || results!=null) + { + var preview; + <%if(((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).isPreview()) + { + %> + preview=true; + <% + } + else + { + %> + preview=false; + <% + } + %> + if( studentView==true && !preview) + { + retour += "<tr id='<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>'><td width=\"10px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" ></td><td onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\">"; + retour += "<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getLongname()%></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)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; + } + else + { + if(studentView==false) + { + retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><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=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + } + retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchiveForStudent.GetByIndex(i)).getRoomId()%>')\"></td></tr>"; + NumberOrphanedRoom++; + } + } + <% + } + %> + retour += "</table>"; + document.getElementById("orphaned").innerHTML = retour; + gestionDisplay(); + if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) + correctPNG(); +} +*/ +function gestionDisplay(type) +{ + + + if(type!='collapse'){ + if(NumberOrphanedRoom==0) + { + document.getElementById("orphaned").style.display="none"; + document.getElementById("orphaned_title").style.display="none"; + } + else + { + document.getElementById("orphaned").style.display="block"; + document.getElementById("orphaned_title").style.display="block"; + } + if(NumberBreakoutRoom==0) + { + document.getElementById("breakout").style.display="none"; + document.getElementById("breakout_title").style.display="none"; + } + else + { + document.getElementById("breakout").style.display="block"; + document.getElementById("breakout_title").style.display="block"; + } + if(NumberMainLectureRoom==0) + { + document.getElementById("main").style.display="none"; + document.getElementById("main_title").style.display="none"; + } + else + { + document.getElementById("main").style.display="block"; + document.getElementById("main_title").style.display="block"; + } + } + if(NumberMainLectureRoom==0) + { + if(NumberBreakoutRoom==0) + { + if(NumberOrphanedRoom<10) + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + else + document.getElementById("orphaned").style.height=10*18.5+"px"; + } + else if(NumberOrphanedRoom==0) + { + if(NumberBreakoutRoom<10) + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + else + document.getElementById("breakout").style.height=10*18.5+"px"; + } + else if(NumberOrphanedRoom>=5 && NumberBreakoutRoom>=5) + { + document.getElementById("breakout").style.height=5*18.5+"px"; + document.getElementById("orphaned").style.height=5*18.5+"px"; + } + else if(NumberOrphanedRoom<5 && NumberBreakoutRoom>=5) + { + document.getElementById("breakout").style.height=NumberOrphanedRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberOrphanedRoom)) + document.getElementById("orphaned").style.height=(10-NumberOrphanedRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom<5 && NumberBreakoutRoom<5) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=5 && NumberBreakoutRoom<5) + { + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberOrphanedRoom>(10-NumberBreakoutRoom)) + document.getElementById("orphaned").style.height=(10-NumberBreakoutRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + } + else if(NumberMainLectureRoom<3) + { + if(NumberBreakoutRoom==0 && NumberOrphanedRoom==0) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberBreakoutRoom==0) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + if(NumberOrphanedRoom>(10-NumberMainLectureRoom)) + document.getElementById("orphaned").style.height=(10-NumberMainLectureRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + else if(NumberOrphanedRoom==0) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberMainLectureRoom) ){ + document.getElementById("breakout").style.height=(10-NumberMainLectureRoom)*18.5+"px"; + //document.getElementById("breakout").style.o="scroll"; + //document.getElementById("breakout").style.overflow="hidden"; + } + else + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom>=3) + { + document.getElementById("breakout").style.height=3*18.5+"px"; + document.getElementById("orphaned").style.height=3*18.5+"px"; + document.getElementById("main").style.height=3*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom>=3) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberOrphanedRoom-NumberMainLectureRoom)) + document.getElementById("breakout").style.height=(10-NumberOrphanedRoom-NumberMainLectureRoom)*18.5+"px"; + else + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom<3) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom<3) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberOrphanedRoom>(10-NumberBreakoutRoom-NumberMainLectureRoom)) + document.getElementById("orphaned").style.height=(10-NumberBreakoutRoom-NumberMainLectureRoom)*18.5+"px"; + else + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + } + else if(NumberMainLectureRoom>=3) + { + if(NumberBreakoutRoom==0 && NumberOrphanedRoom==0) + { + if(NumberMainLectureRoom<10) + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + else + document.getElementById("main").style.height=10*18.5+"px"; + } + else if(NumberBreakoutRoom==0) + { + if(NumberOrphanedRoom<5 && NumberMainLectureRoom<5) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=5 && NumberMainLectureRoom>=5) + { + document.getElementById("orphaned").style.height=5*18.5+"px"; + document.getElementById("main").style.height=5*18.5+"px"; + } + else if(NumberOrphanedRoom<5 && NumberMainLectureRoom>=5) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + if(NumberMainLectureRoom>(10-NumberOrphanedRoom)) + document.getElementById("main").style.height=(10-NumberOrphanedRoom)*18.5+"px"; + else + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + } + else if(NumberOrphanedRoom==0) + { + if(NumberBreakoutRoom<5 && NumberMainLectureRoom<5) + { + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberBreakoutRoom>=5 && NumberMainLectureRoom>=5) + { + document.getElementById("breakout").style.height=5*18.5+"px"; + document.getElementById("main").style.height=5*18.5+"px"; + } + else if(NumberBreakoutRoom<5 && NumberMainLectureRoom>=5) + { + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberMainLectureRoom>(10-NumberBreakoutRoom)) + { + document.getElementById("main").style.height=(10-NumberBreakoutRoom)*18.5+"px"; + } + else + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberBreakoutRoom>=5 && NumberMainLectureRoom<5) + { + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + if(NumberBreakoutRoom>(10-NumberMainLectureRoom)) + { + document.getElementById("breakout").style.height=(10-NumberMainLectureRoom)*18.5+"px"; + } + else + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + } + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom>=3) + { + document.getElementById("breakout").style.height=3*18.5+"px"; + document.getElementById("orphaned").style.height=3*18.5+"px"; + document.getElementById("main").style.height=3*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom>=3) + { + + document.getElementById("main").style.height=3*18.5+"px"; + document.getElementById("breakout").style.height=3*18.5+"px"; + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + } + else if(NumberOrphanedRoom<3 && NumberBreakoutRoom<3) + { + document.getElementById("orphaned").style.height=NumberOrphanedRoom*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + if(NumberMainLectureRoom>(10-NumberBreakoutRoom-NumberOrphanedRoom)) + { + document.getElementById("main").style.height=(10-NumberBreakoutRoom-NumberOrphanedRoom)*18.5+"px"; + } + else + document.getElementById("main").style.height=NumberMainLectureRoom*18.5+"px"; + } + else if(NumberOrphanedRoom>=3 && NumberBreakoutRoom<3) + { + document.getElementById("main").style.height=3*18.5+"px"; + document.getElementById("breakout").style.height=NumberBreakoutRoom*18.5+"px"; + document.getElementById("orphaned").style.height=3*18.5+"px"; + } + } +} + +</script> + <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> </head> <br> + + + <span id="student_Menu"> + <table style="width: 1000" cellspacing="0" cellpadding="1" border="1" align="center"> + <tr class="button_disabled" id="menu_student"> + <td width="5px"></td> + <td align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > + <img src="pictures/launch_Black.png" border="0" + alt="Edit RoomSettings" title="Launch Room" id="launch_icon_student" name="launch_icon_student" height="24" width="24"><br /> + Launch</a> + + </td> + + <td width=77%></td> + </tr> + </table> + </span> <span id="admin_Menu"> <table style="width: 1000" cellspacing="0" cellpadding="1" border="1" align="center"> <tr class="button_disabled" id="menu_admin"> @@ -110,34 +1043,34 @@ </td> <td style="border-right: 1px solid #666666;"> </td> <td width="5px"></td> - <td width="12%" align=center class="button_enabled"> + <td width="10%" align=center class="button_enabled"> <!-- a href="<%="ManageRoom.aspx?time="+ session.getTimeOfLoad()+"&"+session.url_params+"signature="+Util.mD5Crypt(session.getSignature()+Setup.getInstance().getHashKey()) %>"> --> <img src="pictures/new.png" border="0" alt="Calendar" title="Calendar" id="Img1" height="24" width="24"> <br />New Room</a> </td> <td width="5px"></td> - <td width="12%" align="center" > + <td width="10%" align="center" > <!-- <a href="javascript:doOpenExtern('<%=Setup.getInstance().getLcServerURL()%>/admin/class/carousels.epl','hzA=<?php p($usersession)?>')" > --> <img src="pictures/content_Black.png" border="0" alt="Manage Content" title="Manage Content" id="content_icon" name="content_icon" height="24" width="24"><br /> Content</a> </td> - <td width="12%" align="center" > + <td width="10%" align="center" > <!-- <a href="javascript:doOpen(true,'View_Report.aspx','hzA=<?php p($usersession)?>')" > --> <img src="pictures/poll_Black.png" border="0" alt="View Room Records" title="View Poll Results" id="poll_icon" name="poll_icon" height="24" width="24"><br /> Poll</a> </td> <td style="border-right: 1px solid #666666;"> </td> - <td width="12%" align="center" > + <td width="10%" 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" id="schedule_icon" height="24" width="24" ><br /> Availability</a> </td> - <td width="12%" align="center" > + <td width="10%" align="center" > <!-- <a href="javascript:doOpen(false,'ManageRoom.aspx','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=editRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" > --> <img src="pictures/settings_Black.png" border="0" alt="Edit RoomSettings" title="Edit Room Settings" id="settings_icon" name="settings_icon" height="24" width="24"><br /> @@ -145,28 +1078,33 @@ </td> - <td width="12%" align="center" > + <td width="10%" 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 ?');" > --> <img src="pictures/delete_Black.png" border="0" alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br /> Delete</a> </td> - </tr> + ... [truncated message content] |
From: <sh...@us...> - 2006-09-07 13:20:11
|
Revision: 57 http://svn.sourceforge.net/hw4mdl/?rev=57&view=rev Author: shazan Date: 2006-09-07 06:19:56 -0700 (Thu, 07 Sep 2006) Log Message: ----------- the rooms are crated with their own attributes depending if they are main or discussion room. Mainroom list and discussion list rooms are now available and activities list by room too. Creation of new room is ok and depending of the course. Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/db/mysql.sql trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-09-01 14:08:15 UTC (rev 56) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-07 13:19:56 UTC (rev 57) @@ -56,6 +56,7 @@ $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM = 'function=modifyClass'; $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE = 'function=createRole'; $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; +$LIVECLASSROOM_API_FUNCTION_LIST_ROLE = 'function=listRole'; $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST = 'function=listClass'; $LIVECLASSROOM_API_FUNCTION_CREATE_GROUP = 'function=createGroup'; $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP = 'function=modifyGroup'; @@ -331,8 +332,7 @@ //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); return false; } - print $roomid."<br>". $userid."<br>". $role."<br>"; - print $url."<br>"; + return true; } @@ -421,50 +421,35 @@ * ID. * * @param userid User ID to filter by, null if none - * @param role Optional role to filter by, use ACCESS_PRIV_ constants from ListCommand. + * @param role Optional role to filter by * @param roomid * @return */ - function liveclassroom_api_get_room_list($userid, $role, $roomid) { + function liveclassroom_api_get_room_list($userid) { global $CFG; global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&target=$roomid&longname=$roomname"); + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=longname"); + preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; if ( $respcode != 100) { return false; } - - + print $data; + return true; } -function liveclassroom_api_get_room($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"); - - preg_match("(\d*)", $data, $matches); - $respcode = $matches[0]; - - if ( $respcode != 100) { - return false; - } - return $list; -} - - - /** -* Check if a room exist on the server +* Check if a room exist on the server * * @param roomname +* Return a boolean : true if the room exist, false if not! */ function liveclassroom_api_room_exist($roomname) { @@ -585,7 +570,7 @@ } /** - * deleteRoom on the server + * delete Room from the server * * @param roomid : id of the to delete */ @@ -635,7 +620,7 @@ * * @param roomid : id of the room to close */ - function liveclassroom_api_close_room($roomid) { +function liveclassroom_api_close_room($roomid) { global $CFG; global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; @@ -653,69 +638,44 @@ } return true; - } +} - -/** - * Enroll the given user into the group. - * - * @param userid - * @param groupid - *//* -function liveclassroom_api_add_user_in_group($userid, $groupid) { - - global $CFG; - global $LIVECLASSROOM_API_ADMIN; - global $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP; - - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP, "&target=$groupid&add_user=$user"); - - if ( $respcode != 100 && $respcode != 301) { - error( "Can't add user from group"); - return false; - } - - return true; -}*/ - - /** - * Remove the given user from the group. - * - * @param userif - * @param groupif - *//* -function liveclassroom_api_remove_user_from_group($userid, $groupid) { - global $CFG; - global $LIVECLASSROOM_API_ADMIN; - global $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP; - - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP, "&target=$groupid&delete_user=$user"); - - if ( $respcode != 100 && $respcode != 301) { - error( "Can't remove user from group"); - return false; - } - - return true; - -}*/ - - /* * Modify the settings of a room * @param $roomid : the id of the room * -* IMPLEMENT ME !!! +* TO CHECK !!!!! */ -function liveclassroom_api_modify_room($roomid) { +function liveclassroom_api_modify_attribute_room($roomid,$title,$description,$media_type,$student_eboard_enabled,$student_screengrab_enabled,$public_chatenable,$private_chatenable,$userlimit) { global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$roomid"); + $list_attributes_info ="&target=$roomid&longname=$title&description=$description" ; + + $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 = $list_attributes_info.$list_attributes_media.$list_attributes_features.$list_attributes_chat.$list_attributes_access; + + $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 + + return true; + } /* @@ -730,14 +690,14 @@ $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&filter00=archive&filter00value=1"); - - } /* -* user last name = course shortname -* +* Check if a user exist in the course given +* link : user last name = course shortname +* @param $course : an instance of a course +* Return boolean : true if the user exist, false if not! */ function liveclassroom_api_user_exist($course) { @@ -747,10 +707,8 @@ global $LIVECLASSROOM_API_RECORD_SEPERATOR; $name = $course->shortname; - // print $name; + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$name"); - - //print $data."<br>"; preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -760,22 +718,185 @@ } $tok = split("100 OK",$data); - // print sizeof($tok); - // print $tok[1]."<br>"; $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); - -// print sizeof($tok1); if(sizeof($tok1)>1){ return true; } else { - // print"caca1"; return false; } } +/* +* Give the rights for a lecture room to the room given +* @param $roomid : the id of the room to modifiy the settings +* TO CHECK !!!!! +*/ +function liveclassroom_api_give_lectureroom_attributes($roomid) { + global $CFG; + 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"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + return true; +} +/* +* Give the rights for a breackout room to the room given +* @param $roomid : the id of the room to modifiy the settings +* TO CHECK !!!!! +*/ +function liveclassroom_api_give_discussionroom_attributes($roomid) { + global $CFG; + 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"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + + return true; +} + +/* +* GIVE THE ROLE OF THE USER ON THE ROOM GIVEN +* +* @param $roomid : the id of the room +* @param $userid : the id of the user +* +* return a string : the role of the user +*/ +function liveclassroom_api_role_user_room($roomid, $userid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + 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"); + + 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]); + $result = liveclassroom_parse_line($tok1[0],"role_id="); + //Remove le " " at the end of the line + $response = substr($result,0,-1); + return $response; + +} + +/* +* 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_student_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($ch,$LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$lastname&filter01=first_name&filter01value=Student"); + + 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]); + $result = liveclassroom_parse_line($tok1[0],"user_id="); + //Remove le " " at the end of the line + $response = substr($result,0,-1); + + return $response; + +} + +/** + * Enroll the given user into the group. + * + * @param userid + * @param groupid + *//* +function liveclassroom_api_add_user_in_group($userid, $groupid) { + + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP, "&target=$groupid&add_user=$user"); + + if ( $respcode != 100 && $respcode != 301) { + error( "Can't add user from group"); + return false; + } + + return true; + +}*/ + + /** + * Remove the given user from the group. + * + * @param userif + * @param groupif + *//* +function liveclassroom_api_remove_user_from_group($userid, $groupid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP, "&target=$groupid&delete_user=$user"); + + if ( $respcode != 100 && $respcode != 301) { + error( "Can't remove user from group"); + return false; + } + + return true; + +}*/ +/* +function liveclassroom_api_get_room($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"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + return $list; +} + +*/ ?> Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-09-01 14:08:15 UTC (rev 56) +++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-09-07 13:19:56 UTC (rev 57) @@ -62,10 +62,10 @@ ) COMMENT='Defines liveclassroom rooms'; -INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'Main Lecture Hall', '0',''); +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_liveclassroom_type_rooms VALUES ('', '0', 'Group 3', '0',''); # -------------------------------------------------------- # INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name'); Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-09-01 14:08:15 UTC (rev 56) +++ trunk/moodle/mod/liveclassroom/index.php 2006-09-07 13:19:56 UTC (rev 57) @@ -1,4 +1,5 @@ <?PHP + /****************************************************************************** * * * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * @@ -30,6 +31,7 @@ /// This page lists all the instances of liveclassroom in a particular course + require_once("../../config.php"); require_once("lib.php"); @@ -76,81 +78,117 @@ notice("There are no liveclassrooms", "../../course/view.php?id=$course->id"); die; } +?> + <head> + <script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> + <SCRIPT language="javascript" src="test.js"></SCRIPT> -/// Print the list of instances (your module will probably extend this) - $timenow = time(); - $strname = get_string("name"); - $strweek = get_string("week"); - $strtopic = get_string("topic"); + <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> - $room_type = "Room Type"; - $room_info = "Get Info"; - $room_enter = "Enter Room"; - $room_tracking = "Tracking"; - $room_settings = "Settings"; - $room_delete = "Remove"; + </head> - - $image1 = "<img alt='' src='$CFG->wwwroot/mod/liveclassroom/information.gif'/>"; - $image2 = "<img alt='' src='$CFG->wwwroot/mod/liveclassroom/tracking_small.gif'/>"; - $image3 = "<img alt='' src='$CFG->wwwroot/mod/liveclassroom/modify.gif'/>"; - $image4 = "<a href='$CFG->wwwroot/course/mod.php?delete=$id;&sesskey=sesskey();&sr=0'><img alt='' src='$CFG->wwwroot/mod/liveclassroom/small_delete.gif'/> </a>"; + <br> + + <span id="admin_Menu"> + <table style="width: 1000" cellspacing="0" cellpadding="1" border="1" align="center"> + <tr class="button_disabled" id="menu_admin"> + + <td width="12%" align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > + <img src="pictures/launch_Black.png" border="0" + alt="Edit RoomSettings" title="Launch Room" id="launch_icon" name="launch_icon" height="24" width="24"><br /> + Launch</a> + + </td> + <td width="12%" align="center" > + <a href="javascript:Horizon('hzA=<?php p($usersession)?>');" > + <img src="pictures/launch_Black.png" border="0" + alt="Edit RoomSettings" title="Launch Room" id="launch_icon" name="launch_icon" height="24" width="24"><br /> + Add Activity</a> + + </td> + <td style="border-right: 1px solid #666666;"> </td> + <td width="5px"></td> + <td width="12%" align=center class="button_enabled"> + + <!-- a href="<%="ManageRoom.aspx?time="+ session.getTimeOfLoad()+"&"+session.url_params+"signature="+Util.mD5Crypt(session.getSignature()+Setup.getInstance().getHashKey()) %>"> --> + <img src="pictures/new.png" border="0" alt="Calendar" title="Calendar" id="Img1" height="24" width="24"> + <br />New Room</a> + </td> + <td width="5px"></td> + <td width="12%" align="center" > + <!-- <a href="javascript:doOpenExtern('<%=Setup.getInstance().getLcServerURL()%>/admin/class/carousels.epl','hzA=<?php p($usersession)?>')" > + --> <img src="pictures/content_Black.png" border="0" + alt="Manage Content" title="Manage Content" id="content_icon" name="content_icon" height="24" width="24"><br /> + Content</a> + </td> + <td width="12%" align="center" > + <!-- <a href="javascript:doOpen(true,'View_Report.aspx','hzA=<?php p($usersession)?>')" > + --> <img src="pictures/poll_Black.png" border="0" + alt="View Room Records" title="View Poll Results" id="poll_icon" name="poll_icon" height="24" width="24"><br /> + Poll</a> + </td> + <td style="border-right: 1px solid #666666;"> </td> + <td width="12%" 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" id="schedule_icon" height="24" width="24" ><br /> + Availability</a> + </td> + + <td width="12%" align="center" > + <!-- <a href="javascript:doOpen(false,'ManageRoom.aspx','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=editRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" > + --> <img src="pictures/settings_Black.png" border="0" + alt="Edit RoomSettings" title="Edit Room Settings" id="settings_icon" name="settings_icon" height="24" width="24"><br /> + Settings</a> + </td> + + + <td width="12%" 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 ?');" > + --> <img src="pictures/delete_Black.png" border="0" + alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br /> + Delete</a> + </td> + </tr> + <!-- message --> + <tr> + <td colspan="12" style="background-color: #c9d2df; " > + <div id="main_title"> + <a href="javascript:hideBloc('main')" title="Expand/Collapse Archive List"> + <!-- <img src="<%=Setup.getInstance().getLcServerURL()%>/images/integration/small_collapse.gif" name="toggleimgmain" + border="0" alt="Expand/Collapse More Options" /> + --> <strong style="color: white">Main rooms:</a> + </strong></div></td> + </tr> + + <tr> + <td colspan="12" > + <div id="main" style=" overflow-y:auto;overflow-x: hidden;width:100%;" > + + </div> + </td> + </tr> + + <tr> + <td colspan="12" style="background-color: #c9d2df; " > + <div id="breakout_title"> + <a href="javascript:hideBloc('breakout')" title="Expand/Collapse Archive List"> + <!-- <img src="<%=Setup.getInstance().getLcServerURL()%>/images/integration/small_collapse.gif" name="toggleimgbreakout" + border="0" alt="Expand/Collapse More Options" />--><strong style="color: white">Discussion rooms:</a> + </strong></div></td> + </tr> + <tr> + <td colspan="12" > + <div id="breakout" style=" overflow-y:auto;overflow-x: hidden;width:100%" > + </div> + </td> + </tr> + </table> + </span> - if ($course->format == "weeks") { - if (isteacher($course->id, $USER->id)) { - $table->head = array ($strweek, $strname, $room_type, $room_info, $room_tracking, $room_settings, $room_delete); - $table->align = array ("CENTER", "LEFT", "CENTER", "CENTER", "CENTER", "CENTER", "CENTER"); - } - else { - $table->head = array ($strweek, $strname, $room_type); - $table->align = array ("CENTER", "LEFT", "CENTER"); - } - } else if ($course->format == "topics") { - $table->head = array ($strtopic, $strname); - $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); - } else { - $table->head = array ($strname); - $table->align = array ("LEFT", "LEFT", "LEFT"); - } - - foreach ($liveclassrooms as $liveclassroom) { - if (!$liveclassroom->visible) { - //Show dimmed if the mod is hidden - // $link = "<A class=\"dimmed\" HREF=\"view.php?id=$liveclassroom->coursemodule\">$liveclassroom->name</A>"; - $link = "<A class=\"dimmed\" HREF=\"view.php?id=2\">$liveclassroom->name</A>"; - } else { - //Show normal if the mod is visible - $link = "<A HREF=\"view.php?id=$liveclassroom->coursemodule\">$liveclassroom->name</A>"; - } - - if ($course->format == "weeks" or $course->format == "topics") { - if (isteacher($course->id, $USER->id)) { - $table->data[] = array ($liveclassroom->section, $link, liveclassroom_get_room_name($course,$liveclassroom->type), $image1, $image2, $image3, $image4); - } - else { - $table->data[] = array ($liveclassroom->section, $link, $liveclassroom->type); - } - - } else { - $table->data[] = array ($link); - } - } - - //$list = liveclassroom_api_get_room_list($USER->firstname, $USER->firstname, $id); - //$test = liveclassroom_api_get_room($room->id); - //$list2 = liveclassroom_api_get_list_users($USER->id, $USER->firstname, $room->id); - - $fichier=fopen('C:\wampserver\www\moodle\mod\liveclassroom\user.txt','w+'); - //fputs($fichier,$id); - fputs($fichier,$room->id); - fclose($fichier); // - //print_r($list); - - - - - ?> + <!-- <table cellpadding='2' border='0' align='center' width='100%' valign='top'> <tr style='background-color:#EEEEEE; font-weight:normal; color:black;'> <td valign='top'> @@ -162,14 +200,77 @@ <td style="border-bottom: 2px solid #999;"><span class='fnt0'></span> </td> </tr> - </table> + </table>--> + <table> <?php - echo "<br>"; + echo "<br> Main room"; + if(!$tab = liveclassroom_get_main_room_list($course)){ + // error("gigigigi"); + } + //echo sizeof($tab); + for($i=0;$i<sizeof($tab);$i++) {?> + <tr> + <td> + <?php + echo " ".$tab[$i]; + $table_activities = liveclassroom_get_activities_list_per_room($course,$tab[$i]); + for($j=0;$j<sizeof($table_activities);$j++) { + ?> + <tr> + <td> + <?php + echo " ++".$table_activities[$j]; + ?> + </td> + </tr> + <?php + } + ?> + </td> + </tr> + <?php + } +?> +</table> +<table> +<?php + echo "<br>Breakcout room"; + $tab = liveclassroom_get_breackout_room_list($course); + for($i=0;$i<sizeof($tab);$i++) {?> + <tr> + <td> + <?php + echo " ".$tab[$i]; + $table_activities = liveclassroom_get_activities_list_per_room($course,$tab[$i]); + for($j=0;$j<sizeof($table_activities);$j++) { + ?> + <tr> + <td> + <?php + echo " ++".$table_activities[$j]; + ?> + </td> + </tr> + <?php + } + ?> + </td> + </tr> + <?php + } +?> +</table> + +<form name="forme" method="post" action="edit.php?id=<?php p($course->id)?>"> + <input type="text" name="name" size="30" value=""> + <input type="submit" value="creer room" /> +</form> +<?php print_table($table); /// Finish the page print_footer($course); -?> +?> \ No newline at end of file Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-09-01 14:08:15 UTC (rev 56) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-09-07 13:19:56 UTC (rev 57) @@ -223,6 +223,7 @@ return true; } + /** * Create the different kind of room on this course * call the function create_room for each type of room available for the course given @@ -230,38 +231,13 @@ */ function liveclassroom_create_rooms ($course) { - $coursename = $course->shortname; - //get the list of existing types - $list_type = liveclassroom_get_list_type_rooms(); - - // Check if the rooms exist on the server - //if(!(liveclassroom_api_user_exist($course))){ - // print"room will be created"; //teacher is the lead of the presentation - liveclassroom_create_room($course->id, "Main Lecture Hall"); - //teachers and students have the same rigth - liveclassroom_create_room($course->id, "Group 1"); - liveclassroom_create_room($course->id, "Group 2"); - liveclassroom_create_room($course->id, "Group 3"); + liveclassroom_create_room($course->id, "Main classroom", true); + liveclassroom_create_room($course->id, "Other classroom", true); + //teachers and students have the same rights + liveclassroom_create_room($course->id, "Group 1", false); + liveclassroom_create_room($course->id, "Group 2", false); -// } -// else { //Room already exist -// -// } - - -/* - for($i=0;$i<sizeof($list_type);$i++) { - // $name = $coursename.'_'.$list_type[$i]; - $name = $list_type[$i]; - if(!liveclassroom_api_room_exist($name)){ //Create room - liveclassroom_create_room ($course->id, $name); - } - else { //Room already exist - - } - }*/ - return true; } @@ -288,7 +264,7 @@ * @param $courseid : the id of the course where the room will be created * @param $roomname : the name of the room */ -function liveclassroom_create_room ($courseid, $roomname) { +function liveclassroom_create_room ($courseid, $roomname, $bool) { global $CFG; global $LIVECLASSROOM_TEACHER_SUFFIX, $LIVECLASSROOM_STUDENT_SUFFIX; @@ -309,8 +285,11 @@ $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; @@ -320,16 +299,36 @@ return false; } - if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) { + if($bool==true) { // main lecture hall + if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) { + + //error('liveclassroom_create_room: Cannot add classadminright to Teachers'); + return false; + } + if (! liveclassroom_api_add_user_role ($roomid, $studentid, 'Student')) { + //error('liveclassroom_create_room: Cannot add Participant right to students'); + return false; + } + if(!liveclassroom_api_give_lectureroom_attributes($roomid)) { + return false; + } + } + else if($bool==false){ // discussion out + if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) { //error('liveclassroom_create_room: Cannot add classadminright to Teachers'); return false; + } + if (! liveclassroom_api_add_user_role ($roomid, $studentid, 'Instructor')) { + //error('liveclassroom_create_room: Cannot add Participant right to students'); + return false; + } + if(!liveclassroom_api_give_discussionroom_attributes($roomid)) { + return false; + } } - if (! liveclassroom_api_add_user_role ($roomid, $studentid, 'Student')) { - //error('liveclassroom_create_room: Cannot add Participant right to students'); - return false; - } - + + return true; } @@ -365,22 +364,46 @@ /** * 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() { +function liveclassroom_get_list_type_rooms($course) { + if (!($list = get_records('liveclassroom_type_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++; + } + + 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"); } - - for($i=0;$i<sizeof($list);$i++) { - $list_name[$i] = $list[$i+1]->name; + + $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 @@ -392,10 +415,12 @@ error( "Response get list type room per course : query to database failed"); } - for($i=0;$i<sizeof($list);$i++) { - $list_name[$i] = $list[$i+1]->name; + $i=0; + foreach($list as $liveclassroom_rooms) { + $list_name[$i] = $liveclassroom_rooms->name; + $i++; } - + return $list_name; } @@ -409,7 +434,7 @@ if(!(insert_record("liveclassroom_rooms", $liveclassroom_rooms))) { error( "Response: creation of new instance failed"); - return false; + //return false; } return true; } @@ -419,24 +444,202 @@ * Create a new type to liveclassroom Room * @param $name : the name of the type */ -function liveclassroom_rooms_add_new_type($name) { +function liveclassroom_rooms_add_new_type($courseid,$name) { $liveclassroom_type_room->timemodified = time(); - $liveclassroom_type_room->course = 0 ; + $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 +*/ +function liveclassroom_get_course_shortname($courseid) { + + if(!($course = get_record('course','id',$courseid))) { + //error( "Response get room name: query to database failed"); + return false; + } + else { + $name = $course->shortname; + return $name; + } +} + + +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() { + +} + +/* +* 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 list type room per course : 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 list type room per course : 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; +} + +/* +* List all the room "Lecture or Main rooms" for a course given +* @param $course +* return a table with all the room name considering as a lecture/main room +*/ +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; + + for($i=0;$i<sizeof($list_roomid);$i++) { + $role = liveclassroom_api_role_user_room($list_roomid[$i], $studentuserid); + if($role=='Student') { + $list_return[$j] = liveclassroom_get_room_name_from_id($list_roomid[$i]); + $j++; + } + } + + 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); + + $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 all the activities for a course given ans a type of Room +* @param $course : the course +* @param $roomnase = the name of the room +* Return a table with the activities name +*/ +function liveclassroom_get_activities_list_per_room($course,$roomname) { + + if(!($activity_list = get_records('liveclassroom','course',$course->id))) { + error( "Response get_activities_list : query to database failed"); + } + + $i=0; + foreach($activity_list as $liveclassroom) { + if($liveclassroom->type==$roomname) { + //print "yo"; + $list_return[$i] = $liveclassroom->name; + $i++; + } + } + + return $list_return; +} +/* +function liveclassroom_get_type_room($roomname) { + + if(!($lc = get_record('liveclassroom_type_rooms','name',$roomname))) { + error( "Response get type name: query to database failed2"); + return false; + } + else { + $type = $lc->id-1; + return $type; + } +} +*/ +/* * Get the type number of liveclassroom * @param $liveclassroom : the object liveclassroom * return the type number of the liveclassroom */ +/* function liveclassroom_get_type($liveclassroom) { if(!($lc = get_record('liveclassroom','id',$liveclassroom->id))) { @@ -446,13 +649,13 @@ return $lc->type; } } - +*/ /** * Give the name of the room for the course and the type given * @param $course : course * @param $type : type of the room * return the name of the room for the course -*/ +*//* function liveclassroom_get_room_name($course,$type) { /* global $LIVECLASSROOM_MOODLE_PREFIX; @@ -464,44 +667,15 @@ } -*/ + if(!($lc = get_record('liveclassroom_type_rooms','id',$type+1))) { error( "Response get room name: query to database failed"); } else { $name = $lc->name; - - return $name; } } - -/* -* Check if the room exist in the moodle database liveclassroom_rooms -* 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; - -} - -function liveclassroom_get_course_shortname($courseid) { - - if(!($course = get_record('course','id',$courseid))) { - error( "Response get room name: query to database failed"); - } - else { - $name = $course->shortname; - - - return $name; - } -} - - ?> Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-09-01 14:08:15 UTC (rev 56) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-09-07 13:19:56 UTC (rev 57) @@ -2,8 +2,17 @@ <!-- It is used from /course/mod.php. The whole instance is available as $form. --> <?php + require_once($CFG->dirroot.'/calendar/lib.php'); include_once($CFG->dirroot.'/mod/liveclassroom/lib.php'); - + $id = optional_param('id', 0, PARAM_INT); + + if ($id) { + + if (! $course = get_record("course", "id", $id)) { + error("Course is misconfigured"); + } + + } /// First we check that form variables have been initialised if (!isset($form->name)) { $form->name = ''; @@ -17,48 +26,158 @@ if (!isset($form->descrption)) { $form->descrption = ''; } +if (empty($form->timeopen)) { + $form->timeopen = ""; + $form->timerestrict = 0; + } else { + $form->timerestrict = 1; + } // More similar blocks go here... ?> -<form name="form" method="post" action="mod.php"> +<script type="text/javascript"> + +function validate(){ + // name can't be null + if(document.form.name.value != "") { + return true; + } + else { + alert("You must enter a name"); + return false; + } +} + +</script> + + +<form name="form" method="post" action="mod.php" onsubmit="return validate()"> <center> -<table cellpadding="5"> + + +<table width="800" cellpadding="5"> + +<tr> + <td><br></td> +</tr> + <tr valign="top"> + <td align="right"><b><font color="red">*</font><?php print_string("name") ?>:</b></td> + <td> + <input type="text" name="name" size="30" value=""> + </td> +</tr> + +<tr valign="top"> + +<?php + if($course->format == "weeks"){ + $form->timeopen = $course->startdate + (($form->section - 1) * 608400); ?> + <td align="right"><b><?php print_string('weeksformat', 'liveclassroom')?>:</b></td> + <td> + <?php + print_date_selector("openday", "openmonth", "openyear", $form->timeopen); + print_time_selector("openhour", "openminute", $form->timeopen); + ?> + </td> +<?php + } + else if($course->format == "topics"){ ?> + <tr valign="top"> + <td align="right"><b><?php print_string("topicformat") ?>:</b></td> + <td> + <select> + <option value=""> + </select> + </td> + </tr> +<?php + } + + +?> +</tr> + +<tr valign="top"> <td align="right"><b><?php print_string('liveclassroomtype', 'liveclassroom')?>:</b></td> <td> <?php include_once($CFG->dirroot.'/mod/liveclassroom/lib.php'); - //Get the list of rype of rooms available - $list_type_rooms = liveclassroom_get_list_type_rooms(); - //sort($list_type_rooms); - choose_from_menu($list_type_rooms, 'type', $form->type, ''); - helpbutton('liveclassroomtype', get_string('liveclassroomtype', 'liveclassroom'), 'liveclassroom'); + //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); + }?> + + <SELECT name="type"> + <?php + for($i=0;$i<sizeof($list_type_rooms);$i++) { + ?> + + <OPTION VALUE="<?php p($list_type_rooms[$i]) ?>"><?php p($list_type_rooms[$i]) ?></OPTION> + + <?php + } + ?> + </SELECT> </td> </tr> -<tr valign="top"> - <td align="right"><b><?php print_string("name") ?>:</b></td> - <td> - <input type="text" name="name" size="30" value="<?php p(get_string("modulename", "liveclassroom")) ?>"> - </td> -</tr> + <!-- More rows go in here... --> -<tr valign="top"> - <td align="right"><b><?php print_string("description") ?>:</b></td> - <td> - <TEXTAREA rows="2" name="description" ></TEXTAREA> - </td> -</tr> + <!-- The following line for Moodle 1.5 prints the visibility setting form element --> <?php print_visible_setting($form); ?> <!-- and if your module uses groups you would also have --> <?php print_groupmode_setting($form); ?> +<tr> + <td><br></td> +</tr> + +<tr > + <td colspan=2 > + <table width=100% cellpadding="5" style="border-top:#818181 1px solid; border-bottom:#818181 1px solid"> + <tr> + <td align=left width=70% > + <font color="red">*</font><?php print_string('requiredfields', 'liveclassroom')?> + </td> + <td align=center width=15%> + <input type="reset" value="<?php print_string("cancel") ?>" onclick="self.location.href='view.php?id=<?php p($id)?>'"> + <input type="submit" value="<?php print_string("add") ?>" /> + </td> + + </tr> + </table> + </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) ?>" /> @@ -68,7 +187,7 @@ <input type="hidden" name=modulename value="<?php p($form->modulename) ?>" /> <input type="hidden" name=instance value="<?php p($form->instance) ?>" /> <input type="hidden" name=mode value="<?php p($form->mode) ?>" /> -<input type="submit" value="<?php print_string("savechanges") ?>" /> + </center> </form> Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-09-01 14:08:15 UTC (rev 56) +++ trunk/moodle/mod/liveclassroom/view.php 2006-09-07 13:19:56 UTC (rev 57) @@ -35,15 +35,7 @@ $id = optional_param('id', 0, PARAM_INT); $a = optional_param('a', 0, PARAM_INT);// liveclassroom ID - //optional_variable($id); // Course Module ID, or - // optional_variable($a); // liveclassroom ID - -/* - $fichier=fopen('C:\wampserver\www\moodle\mod\liveclassroom\fichier.txt','w+'); - //fputs($fichier,$id); - fputs($fichier,$a); - fclose($fichier); // ferme le fichier txt - */ + if ($id) { if (! $cm = get_record("course_modules", "id", $id)) { error("Course Module ID was incorrect 1 "); @@ -86,10 +78,10 @@ } else { //update le lc with it room id - $name = liveclassroom_get_room_name($course, $liveclassroom->type); + /*$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); + update_record('liveclassroom', $liveclassroom);*/ } @@ -98,9 +90,6 @@ error ("Cannot create session"); } - - - /// Print the page header if ($course->category) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-09-01 14:08:35
|
Revision: 56 http://svn.sourceforge.net/hw4mdl/?rev=56&view=rev Author: shazan Date: 2006-09-01 07:08:15 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Rooms and users are managed with prefix. It test if the user exist before created the new rooms. The activities in moodle are linked with the room. Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/db/mysql.sql trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-30 12:29:03 UTC (rev 55) +++ trunk/moodle/mod/liveclassroom/api.php 2006-09-01 14:08:15 UTC (rev 56) @@ -43,10 +43,13 @@ require_once('System.php'); +$LIVECLASSROOM_MOODLE_PREFIX = '_moodle_'; $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; $LIVECLASSROOM_API_FUNCTION_CREATE_USER = 'function=createUser'; +$LIVECLASSROOM_API_FUNCTION_MODIFY_USER = 'function=modifyUser'; +$LIVECLASSROOM_API_FUNCTION_LIST_USER = 'function=listUser'; $LIVECLASSROOM_API_FUNCTION_GET_TOKEN = 'function=getAuthToken'; $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS = 'function=createClass'; $LIVECLASSROOM_API_FUNCTION_DELETE_ROOM = 'function=deleteClass'; @@ -60,6 +63,8 @@ $LIVECLASSROOM_API_RECORD_SEPERATOR = "=END RECORD"; + + /** * Creates a CURL session with the Live Classroom server. Upon success, it * returns a CURL Handle authenticated and ready for use. It returns false @@ -138,7 +143,7 @@ global $CFG; global $LIVECLASSROOM_API_ADMIN; 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"); @@ -282,7 +287,7 @@ error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); return false; } - + return true; } @@ -293,6 +298,8 @@ $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; } @@ -324,6 +331,8 @@ //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); return false; } + print $roomid."<br>". $userid."<br>". $role."<br>"; + print $url."<br>"; return true; } @@ -726,6 +735,47 @@ } +/* +* user last name = course shortname +* +*/ +function liveclassroom_api_user_exist($course) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_LIST_USER; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $name = $course->shortname; + // print $name; + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$name"); + + //print $data."<br>"; + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + $tok = split("100 OK",$data); + // print sizeof($tok); + // print $tok[1]."<br>"; + $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); + +// print sizeof($tok1); + + if(sizeof($tok1)>1){ + return true; + } + else { + // print"caca1"; + return false; + } +} + + + + ?> Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-08-30 12:29:03 UTC (rev 55) +++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-09-01 14:08:15 UTC (rev 56) @@ -62,8 +62,10 @@ ) COMMENT='Defines liveclassroom rooms'; -INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'LectureHall', '0',''); -INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'BreackOut', '0',''); +INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'Main Lecture Hall', '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_liveclassroom_type_rooms VALUES ('', '0', 'Group 3', '0',''); # -------------------------------------------------------- # INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name'); Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-08-30 12:29:03 UTC (rev 55) +++ trunk/moodle/mod/liveclassroom/index.php 2006-09-01 14:08:15 UTC (rev 56) @@ -147,6 +147,9 @@ fclose($fichier); // //print_r($list); + + + ?> <table cellpadding='2' border='0' align='center' width='100%' valign='top'> <tr style='background-color:#EEEEEE; font-weight:normal; color:black;'> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-08-30 12:29:03 UTC (rev 55) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-09-01 14:08:15 UTC (rev 56) @@ -204,17 +204,19 @@ global $CFG; global $LIVECLASSROOM_TEACHER_SUFFIX; global $LIVECLASSROOM_STUDENT_SUFFIX; - - $userid = $CFG->liveclassroom_settinguniqueid."_".$course->id.$LIVECLASSROOM_TEACHER_SUFFIX; + global $LIVECLASSROOM_MOODLE_PREFIX; + + //$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->fullname, 'Teacher')) { + if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Teacher')) { //error("Cannot Create Teacher profile"); return false; } - $userid = $CFG->liveclassroom_settinguniqueid.'_'.$course->id.$LIVECLASSROOM_STUDENT_SUFFIX; + $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->fullname, 'Student')) { + if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Student')) { //error("Cannot Create Student profile"); return false; } @@ -232,16 +234,33 @@ //get the list of existing types $list_type = liveclassroom_get_list_type_rooms(); - //For each type, check if the room exist on the server + // Check if the rooms exist on the server + //if(!(liveclassroom_api_user_exist($course))){ + // print"room will be created"; + //teacher is the lead of the presentation + liveclassroom_create_room($course->id, "Main Lecture Hall"); + //teachers and students have the same rigth + liveclassroom_create_room($course->id, "Group 1"); + liveclassroom_create_room($course->id, "Group 2"); + liveclassroom_create_room($course->id, "Group 3"); + +// } +// else { //Room already exist +// +// } + + +/* for($i=0;$i<sizeof($list_type);$i++) { - $name = $coursename.'_'.$list_type[$i]; + // $name = $coursename.'_'.$list_type[$i]; + $name = $list_type[$i]; if(!liveclassroom_api_room_exist($name)){ //Create room liveclassroom_create_room ($course->id, $name); } else { //Room already exist } - } + }*/ return true; @@ -251,8 +270,9 @@ global $CFG, $USER; global $LIVECLASSROOM_TEACHER_SUFFIX; global $LIVECLASSROOM_STUDENT_SUFFIX; + global $LIVECLASSROOM_MOODLE_PREFIX; - $userid = $CFG->liveclassroom_settinguniqueid."_".$course->id. + $userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname. ($isteacher?$LIVECLASSROOM_TEACHER_SUFFIX:$LIVECLASSROOM_STUDENT_SUFFIX); $nickname = fullname ($USER); @@ -272,35 +292,44 @@ global $CFG; global $LIVECLASSROOM_TEACHER_SUFFIX, $LIVECLASSROOM_STUDENT_SUFFIX; - - $roomid = $CFG->liveclassroom_settinguniqueid.'_'.$courseid.'_'.rand(); - $teacherid = $CFG->liveclassroom_settinguniqueid."_".$courseid.$LIVECLASSROOM_TEACHER_SUFFIX; - $studentid = $CFG->liveclassroom_settinguniqueid."_".$courseid.$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_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_add_instance($liveclassroom_rooms); - 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 (! 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 (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) { + + //error('liveclassroom_create_room: Cannot add classadminright to Teachers'); + return false; + } + if (! liveclassroom_api_add_user_role ($roomid, $studentid, 'Student')) { + //error('liveclassroom_create_room: Cannot add Participant right to students'); + return false; + } - if (! liveclassroom_api_add_user_role ($roomid, $teacherid, 'ClassAdmin')) { - //error('liveclassroom_create_room: Cannot add classadminright to Teachers'); - return false; - } - if (! liveclassroom_api_add_user_role ($roomid, $studentid, 'Student')) { - //error('liveclassroom_create_room: Cannot add Participant right to students'); - return false; - } - return true; } @@ -425,15 +454,25 @@ * return the name of the room for the course */ function liveclassroom_get_room_name($course,$type) { +/* + global $LIVECLASSROOM_MOODLE_PREFIX; + if($type == 0) {//Main Lecture Hall + return $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname; + } + else if ($type == 1) { //Discussion room + + } + +*/ if(!($lc = get_record('liveclassroom_type_rooms','id',$type+1))) { error( "Response get room name: query to database failed"); } else { - $name = $course->shortname; - $typename = $lc->name; + $name = $lc->name; + - return $name.'_'.$typename; + return $name; } } @@ -451,5 +490,18 @@ } +function liveclassroom_get_course_shortname($courseid) { + + if(!($course = get_record('course','id',$courseid))) { + error( "Response get room name: query to database failed"); + } + else { + $name = $course->shortname; + + return $name; + } +} + + ?> Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-08-30 12:29:03 UTC (rev 55) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-09-01 14:08:15 UTC (rev 56) @@ -14,6 +14,10 @@ if (!isset($form->intro)) { $form->intro = ''; } +if (!isset($form->descrption)) { + $form->descrption = ''; +} + // More similar blocks go here... ?> @@ -25,17 +29,12 @@ <td> <?php include_once($CFG->dirroot.'/mod/liveclassroom/lib.php'); - //recuperation de la liste des types de rooms + //Get the list of rype of rooms available $list_type_rooms = liveclassroom_get_list_type_rooms(); - //sort($list_type_rooms); - //$list_type_rooms[sizeof($list_type_rooms)] = get_string('otherroom', 'liveclassroom'); - + //sort($list_type_rooms); choose_from_menu($list_type_rooms, 'type', $form->type, ''); helpbutton('liveclassroomtype', get_string('liveclassroomtype', 'liveclassroom'), 'liveclassroom'); - - - - ?> + ?> </td> Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-08-30 12:29:03 UTC (rev 55) +++ trunk/moodle/mod/liveclassroom/view.php 2006-09-01 14:08:15 UTC (rev 56) @@ -73,31 +73,27 @@ require_login($course->id); add_to_log($course->id, "liveclassroom", "view", "view.php?id=$cm->id", "$liveclassroom->id"); - -// make sure the profiles exist - if (!liveclassroom_create_profiles ($course)) { - error ("Cannot create liveclassroom profiles"); - } - liveclassroom_create_rooms ($course); - -//Check if the room is already link in the database with the liveclassroom - if(!liveclassroom_rooms_exists ($liveclassroom)) { - $type = liveclassroom_get_type($liveclassroom); - $name =liveclassroom_get_room_name($course,$type); - //create the liveclassroom_rooms in moodle database - $liveclassroom_rooms->course = $liveclassroom->course; - $liveclassroom_rooms->name = $name; - $liveclassroom_rooms->lc_id = $liveclassroom->id; - $liveclassroom_rooms->room_id = liveclassroom_api_get_roomid($name); - if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { - return false; - } - } - -// Create the session fir this user + // 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"); } @@ -137,6 +133,18 @@ $groupparam = ""; } +*//* + +// if groups are being used, get the groupid and create the LC into moodle linked to this group. + print mygroupid($course->id); + if ($groupmode = groupmode($course, $cm)) { + print $groupmode; + $test = mygroupid($course->id); + $liveclassroom->groupid = mygroupid($course->id); + + update_record("liveclassroom",$liveclassroom); + + } */ /// Print the main part of the page @@ -151,7 +159,8 @@ </script> <?php - $classid = liveclassroom_api_get_roomid(liveclassroom_get_room_name($course,liveclassroom_get_type($liveclassroom))); + //$classid = liveclassroom_api_get_roomid(liveclassroom_get_room_name($course,liveclassroom_get_type($liveclassroom))); + $classid = $liveclassroom->room_id; if (isstudent($course->id)) { ?> <body onload="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>' )"> @@ -184,6 +193,7 @@ </tr> <?php if (isteacher($course->id, $USER->id)) { + ?> <tr> <td> @@ -192,18 +202,10 @@ </a> </td> <tr> - - <tr> - <td> - <form method="get" name="createRoom" action="edit.php"> - <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" - <input type="hidden" name="id" value="<?php echo $course->id ?>"> - <input type="submit" value="Edit Room Type"> - </form> - </td> - </tr> - <!-- - + + + + <!-- REMOVE THIS <tr> <td> <form method="get" name="createRoom" action="create.php"> @@ -250,7 +252,7 @@ </table> - <tr style="background-color:#EEEEEE; font-weight:normal; color:black;"><td style="border-right:1px solid #999;"> </td><td> </td></tr> + <tr style="background-color:#EEEEEE; font-weight:normal; color:black;"><td style="border-right:1px solid #999;"> </td><td> </td></tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-30 12:29:15
|
Revision: 55 Author: shazan Date: 2006-08-30 05:29:03 -0700 (Wed, 30 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=55&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/view.php Removed Paths: ------------- trunk/moodle/mod/liveclassroom/DbException.php trunk/moodle/mod/liveclassroom/LCHttpException.php Deleted: trunk/moodle/mod/liveclassroom/DbException.php =================================================================== --- trunk/moodle/mod/liveclassroom/DbException.php 2006-08-29 15:37:17 UTC (rev 54) +++ trunk/moodle/mod/liveclassroom/DbException.php 2006-08-30 12:29:03 UTC (rev 55) @@ -1,70 +0,0 @@ -<?PHP -/****************************************************************************** - * * - * Copyright (c) 2004-2005 Horizon Wimba Inc., All Rights Reserved. * - * * - * COPYRIGHT: * - * This software is the property of Horizon Wimba Inc. * - * It cannot be copied, used, or modified without obtaining an * - * authorization from the authors or a mandated member of * - * Horizon Wimba Inc. * - * If such an authorization is provided, any modified version * - * or copy of the software has to contain this header. * - * * - * WARRANTIES: * - * This software is made available by the authors in the hope * - * that it will be useful, but without any warranty. * - * Horizon Wimba Inc. is not liable for any consequence related * - * to the use of the provided software. * - * * - * Class: DbException.php * - * * - * Author: * - * * - * Date: 2006 * - * * - ******************************************************************************/ - -class DbException extends Exception { - - public function __construct($message) { - - parent::__construct($message); - } - - - /** - * Builds a Live Classroom HTTP Exception. - * @param message the detail message. - * @param cause the cause (null if there is no cause). - */ - public function DbException($message, $cause) - { - super($message, $cause); - } - - - - public function __toString() { - return __CLASS__ . ": {$this->message}\n"; - } - - /** - * return the error message - */ - public function getError() { - - $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; - - return $return; - } - -} - - - - - -?> - - Deleted: trunk/moodle/mod/liveclassroom/LCHttpException.php =================================================================== --- trunk/moodle/mod/liveclassroom/LCHttpException.php 2006-08-29 15:37:17 UTC (rev 54) +++ trunk/moodle/mod/liveclassroom/LCHttpException.php 2006-08-30 12:29:03 UTC (rev 55) @@ -1,72 +0,0 @@ -<?PHP -/****************************************************************************** - * * - * Copyright (c) 2004-2005 Horizon Wimba Inc., All Rights Reserved. * - * * - * COPYRIGHT: * - * This software is the property of Horizon Wimba Inc. * - * It cannot be copied, used, or modified without obtaining an * - * authorization from the authors or a mandated member of * - * Horizon Wimba Inc. * - * If such an authorization is provided, any modified version * - * or copy of the software has to contain this header. * - * * - * WARRANTIES: * - * This software is made available by the authors in the hope * - * that it will be useful, but without any warranty. * - * Horizon Wimba Inc. is not liable for any consequence related * - * to the use of the provided software. * - * * - * Class: LCHttpException.php * - * * - * Author: * - * * - * Date: 2006 * - * * - ******************************************************************************/ - - - -class LCHttpException extends Exception { - - public function __construct($message) { - - parent::__construct($message); - } - - - /** - * Builds a Live Classroom HTTP Exception. - * @param message the detail message. - * @param cause the cause (null if there is no cause). - */ - public function LCHttpException($message, $cause) - { - super($message, $cause); - } - - - - public function __toString() { - return __CLASS__ . ": {$this->message}\n"; - } - - /** - * return the error message - */ - public function getError() { - - $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; - - return $return; - } - -} - - - - - -?> - - Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-29 15:37:17 UTC (rev 54) +++ trunk/moodle/mod/liveclassroom/api.php 2006-08-30 12:29:03 UTC (rev 55) @@ -421,7 +421,6 @@ global $CFG; global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&target=$roomid&longname=$roomname"); @@ -449,7 +448,6 @@ return false; } return $list; - } @@ -466,31 +464,17 @@ 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"); - //print $data; preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; if ( $respcode != 100) { return false; } - // print($data); + $tok = split("100 OK",$data); - //print $tok[1]; $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); - // print $tok1[1]; - //print (liveclassroom_parse_line($tok1[1],"class_id=")); - - /* - - for($i=0;$i<sizeof($tok1);$i++) { - //print $tok1[$i]."<br>" ; - print (liveclassroom_parse_line($tok1[$i],"class_id="))."<br>"; - } -*/ -// print (liveclassroom_api_get_roomid($roomname))."<br>"; if(sizeof($tok1)>1){ @@ -558,7 +542,6 @@ function liveclassroom_parse_line($line,$pattern) { $response = split($pattern,$line); - //print $response; return $response[1]; } @@ -574,33 +557,22 @@ 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"); - - //print $data; + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname"); + preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; if ( $respcode != 100) { return false; } - // print($data); $tok = split("100 OK",$data); - //print $tok[1]; $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); - // print $tok1[1]; $result = liveclassroom_parse_line($tok1[0],"class_id="); - // return $result; - + //Remove le " " at the end of the line $response = substr($result,0,-1); - // print $response."<br>"; return $response; - - //$response = split(" ",$result); - //print $response; - /* $response = trim($result," "); - return $response;*/ } /** @@ -680,7 +652,7 @@ * * @param userid * @param groupid - */ + *//* function liveclassroom_api_add_user_in_group($userid, $groupid) { global $CFG; @@ -696,14 +668,14 @@ return true; -} +}*/ /** * Remove the given user from the group. * * @param userif * @param groupif - */ + *//* function liveclassroom_api_remove_user_from_group($userid, $groupid) { global $CFG; global $LIVECLASSROOM_API_ADMIN; @@ -718,15 +690,42 @@ return true; -} +}*/ + +/* +* Modify the settings of a room +* @param $roomid : the id of the room +* +* IMPLEMENT ME !!! +*/ function liveclassroom_api_modify_room($roomid) { global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; - $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$groupid&delete_user=$user"); + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$roomid"); + + } +/* +* archive=1 ===> room is an archive +* +* IMPLEMENT ME !!! +*/ +function liveclassroom_api_get_archive_list($roomid,$userid,$role) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&filter00=archive&filter00value=1"); + + + +} + + + ?> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-08-29 15:37:17 UTC (rev 54) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-08-30 12:29:03 UTC (rev 55) @@ -239,15 +239,7 @@ liveclassroom_create_room ($course->id, $name); } else { //Room already exist - //Create in the moodle database - /* $type = liveclassroom_get_type($liveclassroom); - //create the liveclassroom_rooms in moodle database - $liveclassroom_rooms->course = $liveclassroom->course; - $liveclassroom_rooms->name = liveclassroom_get_room_name($course,$type); - $liveclassroom_rooms->lc_id = $liveclassroom->id; - if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { - return false; - }*/ + } } Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-08-29 15:37:17 UTC (rev 54) +++ trunk/moodle/mod/liveclassroom/view.php 2006-08-30 12:29:03 UTC (rev 55) @@ -95,8 +95,8 @@ } } -//probleme !! + // Create the session fir this user if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { error ("Cannot create session"); @@ -104,6 +104,7 @@ + /// Print the page header if ($course->category) { @@ -118,6 +119,26 @@ "", "", true, update_module_button($cm->id, $course->id, $strliveclassroom), navmenu($course, $cm)); + +/* GROUP LATER !!!!!!!!!!!!! + +/// Check to see if groups are being used here + if ($groupmode = groupmode($course, $cm)) { // Groups are being used + $currentgroup = setup_and_print_groups($course, $groupmode, "view.php?id=$cm->id"); + } else { + $currentgroup = 0; + } + + if ($currentgroup) { + $groupselect = " AND groupid = '$currentgroup'"; + $groupparam = "&groupid=$currentgroup"; + } else { + $groupselect = ""; + $groupparam = ""; + } + +*/ + /// Print the main part of the page ?> <!--script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch-7892.js'></script--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-29 15:37:29
|
Revision: 54 Author: shazan Date: 2006-08-29 08:37:17 -0700 (Tue, 29 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=54&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-28 10:02:53 UTC (rev 53) +++ trunk/moodle/mod/liveclassroom/api.php 2006-08-29 15:37:17 UTC (rev 54) @@ -42,8 +42,8 @@ */ require_once('System.php'); -require_once("LCHttpException.php"); + $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; $LIVECLASSROOM_API_FUNCTION_CREATE_USER = 'function=createUser'; @@ -54,7 +54,10 @@ $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE = 'function=createRole'; $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST = 'function=listClass'; +$LIVECLASSROOM_API_FUNCTION_CREATE_GROUP = 'function=createGroup'; +$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP = 'function=modifyGroup'; + $LIVECLASSROOM_API_RECORD_SEPERATOR = "=END RECORD"; /** @@ -136,48 +139,56 @@ global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_CREATE_USER; - if (!$ch = liveclassroom_api_authenticate()) { - return false; - } + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_USER, "&target=$userid&first_name=$rolename&last_name=$coursename"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + /* + if ( $respcode == 301) { + error( "Creation user failed, already exist"); + return false; + }*/ + if ( $respcode != 100 && $respcode != 301) { + error( "Response: Account ($userId) Creation Failed: $resp_code"); + return false; + } + + + return true; - $url = $CFG->liveclassroom_servername. - $LIVECLASSROOM_API_ADMIN. - $LIVECLASSROOM_API_FUNCTION_CREATE_USER. - "&target=$userid". - "&first_name=$rolename". - "&last_name=$coursename"; - - //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_user", "URL Sent: $url"); - - - curl_setopt($ch, CURLOPT_URL,$url); - $data = curl_exec($ch); - #print $data; - if (curl_errno($ch)) { - print curl_error($ch); - return false; - } - - preg_match("(\d*)", $data, $matches); - $respcode = $matches[0]; - - if ( $respcode != 100 && $respcode != 301) { - error( "Response: Account ($userId) Creation Failed: $resp_code"); - return false; - } - - return true; } - - -function liveclassroom_api_create_group() { +/* +* Create a group on the LC server +* @param $groupid : id of the group created +* +*/ +function liveclassroom_api_create_group($groupid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_CREATE_GROUP; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_GROUP, "&target=$groupid"); + + if ( $respcode == 301) { + error( "Response: Authentication Failed: $resp_code"); + return false; + } + if ( $respcode != 100 && $respcode != 301) { + error( "Response: Cannot Create group with id:$groupid"); + return false; + } + + + return true; + + } - - + /** * Returns a session id (hzA) to be inserted in URLs to access the LC server * @uses CFG, USER @@ -248,45 +259,32 @@ return $authtoken; } - +/* +* Create a room on the LC server +* @param $roomid : id of the room created +* @param $roomname : name of the room created +*/ function liveclassroom_api_create_class ($roomid, $roomname) { 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"); -/* - if (!$ch = liveclassroom_api_authenticate()) { - return false; - } + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_CLASS,"&target=$roomid&longname=$roomname&preview=0"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode == 301) { + error( "Class $roomname already exist"); + return false; + } + if ( $respcode != 100) { + error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); + return false; + } + + return true; - $url = $CFG->liveclassroom_servername. - $LIVECLASSROOM_API_ADMIN. - $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS. - "&target=$roomid". - "&longname=$roomname"; - - //DEBUG - //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "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]; - - if ( $respcode != 100) { - //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); - return false; - } - return true; } function liveclassroom_api_add_user_role ($roomid, $userid, $role) { @@ -413,12 +411,10 @@ * 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 userid User ID to filter by, null if none * @param role Optional role to filter by, use ACCESS_PRIV_ constants from ListCommand. - * @param roomId - * @return List A List of LCRoom objects - * @throws - * If an error occurs in querying the server + * @param roomid + * @return */ function liveclassroom_api_get_room_list($userid, $role, $roomid) { @@ -507,8 +503,10 @@ /** - * $param $ch - * $param $const : function called + * 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($ch,$const,$attribute) { @@ -518,7 +516,7 @@ if (!$ch = liveclassroom_api_authenticate()) { return false; } - try { + $url = $CFG->liveclassroom_servername. $LIVECLASSROOM_API_ADMIN. $const. @@ -532,13 +530,7 @@ return false; } - return $data; - - } - catch (LCHttpException $e) { - throw new LCHttpException("Bad URL"); - } - + return $data; } function liveclassroom_api_set_query_attribute($query,$attribute) { @@ -553,7 +545,6 @@ * Parses the HTTP response body * * @param response -* @throws */ function liveclassroom_parse_response($response) { return true; @@ -573,6 +564,7 @@ } /** +* Get the room id from a roomname * @params $roomname * return the room_id from the server */ @@ -597,30 +589,45 @@ $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); // print $tok1[1]; $result = liveclassroom_parse_line($tok1[0],"class_id="); - // print $result; - return $result; + + // return $result; + + $response = substr($result,0,-1); + // print $response."<br>"; + + return $response; + + //$response = split(" ",$result); + //print $response; + /* $response = trim($result," "); + return $response;*/ } /** * deleteRoom on the server * - * @param roomId - * @throws + * @param roomid : id of the to delete */ - function liveclassroom_api_delete_room($roomId) { + function liveclassroom_api_delete_room($roomid) { global $CFG; global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_DELETE_ROOM; liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_DELETE_ROOM,"&target=$roomid"); - + + if ( $respcode == 302) { + error( "Target not found"); + return false; + } + else if ( $respcode != 100) { + return false; + } return true; } /** - * Open Room on the server + * Open Room on the LC server * - * @param roomId - * @throws + * @param roomid : id of the room to open */ function liveclassroom_api_open_room($roomid) { global $CFG; @@ -631,6 +638,10 @@ preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; + if ( $respcode == 302) { + error( "Target not found"); + return false; + } if ( $respcode != 100) { return false; } @@ -639,10 +650,9 @@ } /** - * Close Room on the server + * Close Room on the LC server * - * @param roomId - * @throws + * @param roomid : id of the room to close */ function liveclassroom_api_close_room($roomid) { global $CFG; @@ -653,12 +663,70 @@ preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; + if ( $respcode == 302) { + error( "Target not found"); + return false; + } if ( $respcode != 100) { return false; } return true; } + + +/** + * Enroll the given user into the group. + * + * @param userid + * @param groupid + */ +function liveclassroom_api_add_user_in_group($userid, $groupid) { + + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP, "&target=$groupid&add_user=$user"); + + if ( $respcode != 100 && $respcode != 301) { + error( "Can't add user from group"); + return false; + } + + return true; +} + /** + * Remove the given user from the group. + * + * @param userif + * @param groupif + */ +function liveclassroom_api_remove_user_from_group($userid, $groupid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_GROUP, "&target=$groupid&delete_user=$user"); + + if ( $respcode != 100 && $respcode != 301) { + error( "Can't remove user from group"); + return false; + } + + return true; + +} + +function liveclassroom_api_modify_room($roomid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, "&target=$groupid&delete_user=$user"); +} + + ?> Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-08-28 10:02:53 UTC (rev 53) +++ trunk/moodle/mod/liveclassroom/index.php 2006-08-29 15:37:17 UTC (rev 54) @@ -126,7 +126,7 @@ if ($course->format == "weeks" or $course->format == "topics") { if (isteacher($course->id, $USER->id)) { - $table->data[] = array ($liveclassroom->section, $link, $liveclassroom->type, $image1, $image2, $image3, $image4); + $table->data[] = array ($liveclassroom->section, $link, liveclassroom_get_room_name($course,$liveclassroom->type), $image1, $image2, $image3, $image4); } else { $table->data[] = array ($liveclassroom->section, $link, $liveclassroom->type); Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-08-28 10:02:53 UTC (rev 53) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-08-29 15:37:17 UTC (rev 54) @@ -1,4 +1,4 @@ - <?PHP +<?PHP /****************************************************************************** * * * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * @@ -32,8 +32,8 @@ require_once($CFG->libdir.'/datalib.php'); require_once("api.php"); -require_once("DbException.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 @@ -63,7 +63,10 @@ return; } - +/* +* Create a new instance of liveclassroom +* @param $liveclassroom : object liveclassroom +*/ function liveclassroom_add_instance($liveclassroom) { /// Given an object containing all the necessary data, /// (defined by the form in mod.html) this function @@ -220,6 +223,8 @@ /** * Create the different kind of room on this course + * call the function create_room for each type of room available for the course given + * @param $course : object course */ function liveclassroom_create_rooms ($course) { @@ -265,7 +270,12 @@ return liveclassroom_api_get_session ($userid, $nickname); } - +/* +* Create a room +* call the function create_class to create the room into the server +* @param $courseid : the id of the course where the room will be created +* @param $roomname : the name of the room +*/ function liveclassroom_create_room ($courseid, $roomname) { global $CFG; global $LIVECLASSROOM_TEACHER_SUFFIX, @@ -338,57 +348,56 @@ */ function liveclassroom_get_list_type_rooms() { - try { - if (!($list = get_records('liveclassroom_type_rooms','course',0) )) { - throw new DbException("Connection to db liveclassroom_type_rooms failed"); - } + if (!($list = get_records('liveclassroom_type_rooms','course',0) )) { + error( "Response get list type room : query to database failed"); + } - - for($i=0;$i<sizeof($list);$i++) { - $list_name[$i] = $list[$i+1]->name; - } - - return $list_name; - - }catch(DbException $e) { - echo $e->getError(); + for($i=0;$i<sizeof($list);$i++) { + $list_name[$i] = $list[$i+1]->name; } + + 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) { - try { - if(!($list = get_records('liveclassroom_rooms','course',$course->id))) { - throw new DbException("Connection to db liveclassroom_rooms failed"); - } + if(!($list = get_records('liveclassroom_rooms','course',$course->id))) { + error( "Response get list type room per course : query to database failed"); + } - for($i=0;$i<sizeof($list);$i++) { - $list_name[$i] = $list[$i+1]->name; - } - - return $list_name; - - }catch(DbException $e) { - echo $e->getError(); + for($i=0;$i<sizeof($list);$i++) { + $list_name[$i] = $list[$i+1]->name; } + + 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(); - - try { - - if(!(insert_record("liveclassroom_rooms", $liveclassroom_rooms))) { - throw new DbException("Insertion to liveclassroom_rooms failed"); - } - } - catch(DbException $e) { - $e->getError(); - } - + + if(!(insert_record("liveclassroom_rooms", $liveclassroom_rooms))) { + error( "Response: creation of new instance 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($name) { $liveclassroom_type_room->timemodified = time(); @@ -396,61 +405,49 @@ $liveclassroom_type_room->course = 0 ; $liveclassroom_type_room->lc_id = 0 ; $liveclassroom_type_room->name = $name ; - - try { - if(!(insert_record("liveclassroom_type_rooms", $liveclassroom_type_room))) { - throw new DbException("Insertion to liveclassroom_type_room failed"); - } - } - catch(DbException $e) { - $e->getError(); - } + + if(!(insert_record("liveclassroom_type_rooms", $liveclassroom_type_room))) { + error( "Response: creation of new type $name failed"); + } } /* * Get the type number of liveclassroom +* @param $liveclassroom : the object liveclassroom +* return the type number of the liveclassroom */ function liveclassroom_get_type($liveclassroom) { - - try { - - if(!($lc = get_record('liveclassroom','id',$liveclassroom->id))) { - throw new DbException("Connection to db liveclassroom failed"); - } - else { - return $lc->type; - } - - } - catch(DbException $e) { - echo $e->getError(); + + if(!($lc = get_record('liveclassroom','id',$liveclassroom->id))) { + error( "Response get type: query to database failed"); } - + else { + return $lc->type; + } } /** -* Give the name of the room for the course +* Give the name of the room for the course and the type given +* @param $course : course +* @param $type : type of the room +* return the name of the room for the course */ function liveclassroom_get_room_name($course,$type) { - - try { - if(!($lc = get_record('liveclassroom_type_rooms','id',$type+1))) { - throw new DbException("Connection to db liveclassroom_type_rooms failed"); - } - else { - $name = $course->shortname; - $typename = $lc->name; - - return $name.'_'.$typename; - } - }catch(DbException $e) { - echo $e->getError(); + + if(!($lc = get_record('liveclassroom_type_rooms','id',$type+1))) { + error( "Response get room name: query to database failed"); + } + else { + $name = $course->shortname; + $typename = $lc->name; + + return $name.'_'.$typename; } } /* * Check if the room exist in the moodle database liveclassroom_rooms -* +* return true if the room exist, false if not. */ function liveclassroom_rooms_exists($liveclassroom) { Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-08-28 10:02:53 UTC (rev 53) +++ trunk/moodle/mod/liveclassroom/view.php 2006-08-29 15:37:17 UTC (rev 54) @@ -92,14 +92,18 @@ $liveclassroom_rooms->room_id = liveclassroom_api_get_roomid($name); if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { return false; - } + } } + +//probleme !! // Create the session fir this user if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { error ("Cannot create session"); } + + /// Print the page header if ($course->category) { @@ -125,6 +129,16 @@ } </script> +<?php + $classid = liveclassroom_api_get_roomid(liveclassroom_get_room_name($course,liveclassroom_get_type($liveclassroom))); + if (isstudent($course->id)) { +?> + <body onload="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>' )"> + </body> + +<?php + } + ?> <table style="background-color: #ffffff !important; border-left : 1px solid #999; border-right : 1px solid #999; border-top : 1px solid #999;border-bottom : 1px solid #999;" width="100%" cellspacing="0" cellpadding="0" border="0" align="center" summary="layout"> <tr style="background-color:#EEEEEE; font-weight:normal; color:black;"> @@ -141,7 +155,8 @@ </td></tr> <tr> <td> - <a href="javascript:startHorizon(null,null,null,null,null,'hzA=<?php p($usersession)?>')"> + <a href="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>')"> + <?php p(get_string("accessrooms", 'liveclassroom')) ?> </a> </td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-28 10:02:59
|
Revision: 53 Author: shazan Date: 2006-08-28 03:02:53 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=53&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/DbException.php Modified: trunk/moodle/mod/liveclassroom/DbException.php =================================================================== --- trunk/moodle/mod/liveclassroom/DbException.php 2006-08-28 10:02:35 UTC (rev 52) +++ trunk/moodle/mod/liveclassroom/DbException.php 2006-08-28 10:02:53 UTC (rev 53) @@ -1,6 +1,30 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 2004-2005 Horizon Wimba Inc., All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba Inc. * + * It cannot be copied, used, or modified without obtaining an * + * authorization from the authors or a mandated member of * + * Horizon Wimba Inc. * + * If such an authorization is provided, any modified version * + * or copy of the software has to contain this header. * + * * + * WARRANTIES: * + * This software is made available by the authors in the hope * + * that it will be useful, but without any warranty. * + * Horizon Wimba Inc. is not liable for any consequence related * + * to the use of the provided software. * + * * + * Class: DbException.php * + * * + * Author: * + * * + * Date: 2006 * + * * + ******************************************************************************/ - class DbException extends Exception { public function __construct($message) { @@ -20,21 +44,20 @@ } - // cha\xEEne personnalis\xE9 repr\xE9sentant l'objet + public function __toString() { return __CLASS__ . ": {$this->message}\n"; } - - public function getError() { + /** + * return the error message + */ + public function getError() { - // On retourne un message d'erreur complet pour nos besoins. - // avec le numero de ligne - // $return = 'Une exception a \xE9t\xE9 g\xE9r\xE9e :<br/>'; - $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; + $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; - return $return; - } + return $return; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-28 10:02:41
|
Revision: 52 Author: shazan Date: 2006-08-28 03:02:35 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=52&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/LCHttpException.php Modified: trunk/moodle/mod/liveclassroom/LCHttpException.php =================================================================== --- trunk/moodle/mod/liveclassroom/LCHttpException.php 2006-08-28 09:58:46 UTC (rev 51) +++ trunk/moodle/mod/liveclassroom/LCHttpException.php 2006-08-28 10:02:35 UTC (rev 52) @@ -1,6 +1,32 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 2004-2005 Horizon Wimba Inc., All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba Inc. * + * It cannot be copied, used, or modified without obtaining an * + * authorization from the authors or a mandated member of * + * Horizon Wimba Inc. * + * If such an authorization is provided, any modified version * + * or copy of the software has to contain this header. * + * * + * WARRANTIES: * + * This software is made available by the authors in the hope * + * that it will be useful, but without any warranty. * + * Horizon Wimba Inc. is not liable for any consequence related * + * to the use of the provided software. * + * * + * Class: LCHttpException.php * + * * + * Author: * + * * + * Date: 2006 * + * * + ******************************************************************************/ + class LCHttpException extends Exception { public function __construct($message) { @@ -20,21 +46,20 @@ } - // cha\xEEne personnalis\xE9 repr\xE9sentant l'objet + public function __toString() { return __CLASS__ . ": {$this->message}\n"; } - - public function getError() { + /** + * return the error message + */ + public function getError() { - // On retourne un message d'erreur complet pour nos besoins. - // avec le numero de ligne - $return = 'Une exception a \xE9t\xE9 g\xE9r\xE9e :<br/>'; $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; return $return; - } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-28 09:59:01
|
Revision: 51 Author: shazan Date: 2006-08-28 02:58:46 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=51&view=rev Log Message: ----------- New classes added to manage the exception with the connection to the server and with the database Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/db/mysql.sql trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html Added Paths: ----------- trunk/moodle/mod/liveclassroom/DbException.php trunk/moodle/mod/liveclassroom/LCHttpException.php Added: trunk/moodle/mod/liveclassroom/DbException.php =================================================================== --- trunk/moodle/mod/liveclassroom/DbException.php (rev 0) +++ trunk/moodle/mod/liveclassroom/DbException.php 2006-08-28 09:58:46 UTC (rev 51) @@ -0,0 +1,47 @@ +<?PHP + + +class DbException extends Exception { + + public function __construct($message) { + + parent::__construct($message); + } + + + /** + * Builds a Live Classroom HTTP Exception. + * @param message the detail message. + * @param cause the cause (null if there is no cause). + */ + public function DbException($message, $cause) + { + super($message, $cause); + } + + + // cha\xEEne personnalis\xE9 repr\xE9sentant l'objet + public function __toString() { + return __CLASS__ . ": {$this->message}\n"; + } + + + public function getError() { + + // On retourne un message d'erreur complet pour nos besoins. + // avec le numero de ligne + // $return = 'Une exception a \xE9t\xE9 g\xE9r\xE9e :<br/>'; + $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; + + return $return; + } + +} + + + + + +?> + + Property changes on: trunk/moodle/mod/liveclassroom/DbException.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Added: trunk/moodle/mod/liveclassroom/LCHttpException.php =================================================================== --- trunk/moodle/mod/liveclassroom/LCHttpException.php (rev 0) +++ trunk/moodle/mod/liveclassroom/LCHttpException.php 2006-08-28 09:58:46 UTC (rev 51) @@ -0,0 +1,47 @@ +<?PHP + + +class LCHttpException extends Exception { + + public function __construct($message) { + + parent::__construct($message); + } + + + /** + * Builds a Live Classroom HTTP Exception. + * @param message the detail message. + * @param cause the cause (null if there is no cause). + */ + public function LCHttpException($message, $cause) + { + super($message, $cause); + } + + + // cha\xEEne personnalis\xE9 repr\xE9sentant l'objet + public function __toString() { + return __CLASS__ . ": {$this->message}\n"; + } + + + public function getError() { + + // On retourne un message d'erreur complet pour nos besoins. + // avec le numero de ligne + $return = 'Une exception a \xE9t\xE9 g\xE9r\xE9e :<br/>'; + $return .= '<strong>Message : ' . $this->getMessage() . '</strong><br/>'; + + return $return; + } + +} + + + + + +?> + + Property changes on: trunk/moodle/mod/liveclassroom/LCHttpException.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-25 14:15:36 UTC (rev 50) +++ trunk/moodle/mod/liveclassroom/api.php 2006-08-28 09:58:46 UTC (rev 51) @@ -42,6 +42,7 @@ */ require_once('System.php'); +require_once("LCHttpException.php"); $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; @@ -168,6 +169,15 @@ return true; } + + +function liveclassroom_api_create_group() { + +} + + + + /** * Returns a session id (hzA) to be inserted in URLs to access the LC server * @uses CFG, USER @@ -223,6 +233,7 @@ //error ("Did not find authToken, data=<pre>$data</pre>"); return false; } + $authtoken= substr($currentline, 10); @@ -243,7 +254,8 @@ global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS; - + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_CREATE_CLASS,"&target=$roomid&longname=$roomname"); +/* if (!$ch = liveclassroom_api_authenticate()) { return false; } @@ -266,7 +278,7 @@ print curl_error($ch); return false; } - +*/ preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -505,22 +517,28 @@ 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); + } + try { + $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; + } - if (curl_errno($ch)) { - print curl_error($ch); - return false; - } - - return $data; + return $data; + + } + catch (LCHttpException $e) { + throw new LCHttpException("Bad URL"); + } + } function liveclassroom_api_set_query_attribute($query,$attribute) { Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-08-25 14:15:36 UTC (rev 50) +++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-08-28 09:58:46 UTC (rev 51) @@ -52,8 +52,18 @@ PRIMARY KEY (`id`) ) COMMENT='Defines liveclassroom rooms'; -INSERT INTO prefix_liveclassroom_rooms VALUES ('', '0', 'LectureHall', '0',''); -INSERT INTO prefix_liveclassroom_rooms VALUES ('', '0', 'BreackOut', '0',''); +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', 'LectureHall', '0',''); +INSERT INTO prefix_liveclassroom_type_rooms VALUES ('', '0', 'BreackOut', '0',''); # -------------------------------------------------------- # INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name'); Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-08-25 14:15:36 UTC (rev 50) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-08-28 09:58:46 UTC (rev 51) @@ -32,6 +32,7 @@ require_once($CFG->libdir.'/datalib.php'); require_once("api.php"); +require_once("DbException.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 @@ -337,39 +338,55 @@ */ function liveclassroom_get_list_type_rooms() { - //$sql = "SELECT u.name FROM mdl_liveclassroom_rooms u WHERE u.course=0"; - //$n = count_records_sql($sql); - //$list0 = get_records_sql($sql); + try { + if (!($list = get_records('liveclassroom_type_rooms','course',0) )) { + throw new DbException("Connection to db liveclassroom_type_rooms failed"); + } + + + for($i=0;$i<sizeof($list);$i++) { + $list_name[$i] = $list[$i+1]->name; + } - $list = get_records('liveclassroom_type_rooms','course',0); - - - for($i=0;$i<sizeof($list);$i++) { - $list_name[$i] = $list[$i+1]->name; + return $list_name; + + }catch(DbException $e) { + echo $e->getError(); } - - return $list_name; } function liveclassroom_get_list_type_rooms_per_course($course) { + try { + if(!($list = get_records('liveclassroom_rooms','course',$course->id))) { + throw new DbException("Connection to db liveclassroom_rooms failed"); + } - $list = get_records('liveclassroom_rooms','course',$course->id); + for($i=0;$i<sizeof($list);$i++) { + $list_name[$i] = $list[$i+1]->name; + } - for($i=0;$i<sizeof($list);$i++) { - $list_name[$i] = $list[$i+1]->name; + return $list_name; + + }catch(DbException $e) { + echo $e->getError(); } - - return $list_name; } function liveclassroom_rooms_add_instance($liveclassroom_rooms) { $liveclassroom_rooms->timemodified = time(); - + + try { + + if(!(insert_record("liveclassroom_rooms", $liveclassroom_rooms))) { + throw new DbException("Insertion to liveclassroom_rooms failed"); + } + } + catch(DbException $e) { + $e->getError(); + } - return insert_record("liveclassroom_rooms", $liveclassroom_rooms); - } function liveclassroom_rooms_add_new_type($name) { @@ -380,30 +397,55 @@ $liveclassroom_type_room->lc_id = 0 ; $liveclassroom_type_room->name = $name ; - return insert_record("liveclassroom_type_rooms", $liveclassroom_type_room); - + try { + if(!(insert_record("liveclassroom_type_rooms", $liveclassroom_type_room))) { + throw new DbException("Insertion to liveclassroom_type_room failed"); + } + } + catch(DbException $e) { + $e->getError(); + } } /* * Get the type number of liveclassroom */ function liveclassroom_get_type($liveclassroom) { - if($lc = get_record('liveclassroom','id',$liveclassroom->id)) { - return $lc->type; + + try { + + if(!($lc = get_record('liveclassroom','id',$liveclassroom->id))) { + throw new DbException("Connection to db liveclassroom failed"); + } + else { + return $lc->type; + } + + } + catch(DbException $e) { + echo $e->getError(); } - else return false; + } /** * Give the name of the room for the course */ function liveclassroom_get_room_name($course,$type) { - $lc = get_record('liveclassroom_type_rooms','id',$type+1); - $name = $course->shortname; - $typename = $lc->name; - - return $name.'_'.$typename; + try { + if(!($lc = get_record('liveclassroom_type_rooms','id',$type+1))) { + throw new DbException("Connection to db liveclassroom_type_rooms failed"); + } + else { + $name = $course->shortname; + $typename = $lc->name; + + return $name.'_'.$typename; + } + }catch(DbException $e) { + echo $e->getError(); + } } /* @@ -413,11 +455,10 @@ function liveclassroom_rooms_exists($liveclassroom) { - if(!get_records('liveclassroom_rooms','lc_id',$liveclassroom->id)) { - return false; - } - else return true; - + if(!get_records('liveclassroom_rooms','lc_id',$liveclassroom->id)) { + return false; + } + else return true; } Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-08-25 14:15:36 UTC (rev 50) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-08-28 09:58:46 UTC (rev 51) @@ -27,7 +27,7 @@ include_once($CFG->dirroot.'/mod/liveclassroom/lib.php'); //recuperation de la liste des types de rooms $list_type_rooms = liveclassroom_get_list_type_rooms(); - // asort($LIVECLASSROOM_TYPES); + //sort($list_type_rooms); //$list_type_rooms[sizeof($list_type_rooms)] = get_string('otherroom', 'liveclassroom'); choose_from_menu($list_type_rooms, 'type', $form->type, ''); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-25 14:15:41
|
Revision: 50 Author: shazan Date: 2006-08-25 07:15:36 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=50&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-25 12:36:42 UTC (rev 49) +++ trunk/moodle/mod/liveclassroom/api.php 2006-08-25 14:15:36 UTC (rev 50) @@ -48,6 +48,8 @@ $LIVECLASSROOM_API_FUNCTION_CREATE_USER = 'function=createUser'; $LIVECLASSROOM_API_FUNCTION_GET_TOKEN = 'function=getAuthToken'; $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS = 'function=createClass'; +$LIVECLASSROOM_API_FUNCTION_DELETE_ROOM = 'function=deleteClass'; +$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM = 'function=modifyClass'; $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE = 'function=createRole'; $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST = 'function=listClass'; @@ -581,5 +583,64 @@ return $result; } + /** + * deleteRoom on the server + * + * @param roomId + * @throws + */ + function liveclassroom_api_delete_room($roomId) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_DELETE_ROOM; + + liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_DELETE_ROOM,"&target=$roomid"); + + return true; + } + /** + * Open Room on the server + * + * @param roomId + * @throws + */ + function liveclassroom_api_open_room($roomid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; + + liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=0"); + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + + return true; + } + + /** + * Close Room on the server + * + * @param roomId + * @throws + */ + function liveclassroom_api_close_room($roomid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; + + liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=1"); + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + 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-08-25 12:36:52
|
Revision: 49 Author: shazan Date: 2006-08-25 05:36:42 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=49&view=rev Log Message: ----------- link the LC server to the LC moodle database Modified Paths: -------------- trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-08-25 12:35:45 UTC (rev 48) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-08-25 12:36:42 UTC (rev 49) @@ -315,7 +315,7 @@ /** * Counts the number of rooms available for this course * @param string the courseid - * @return string the numlber of classrooms available for this course + * @return string the number of classrooms available for this course */ function liveclassroom_count_rooms($courseid) { return '0'; @@ -384,8 +384,6 @@ } - - /* * Get the type number of liveclassroom */ @@ -408,7 +406,20 @@ return $name.'_'.$typename; } +/* +* Check if the room exist in the moodle database liveclassroom_rooms +* +*/ +function liveclassroom_rooms_exists($liveclassroom) { + + if(!get_records('liveclassroom_rooms','lc_id',$liveclassroom->id)) { + return false; + } + else return true; + + +} ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-25 12:35:56
|
Revision: 48 Author: shazan Date: 2006-08-25 05:35:45 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=48&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-08-25 10:38:19 UTC (rev 47) +++ trunk/moodle/mod/liveclassroom/view.php 2006-08-25 12:35:45 UTC (rev 48) @@ -78,25 +78,22 @@ if (!liveclassroom_create_profiles ($course)) { error ("Cannot create liveclassroom profiles"); } - - if (!liveclassroom_create_rooms ($course)) { - error ("Cannot create liveclassroom rooms"); - } - //ajouter ds la BD liveclassroom_rooms l'instance correspondant - if($liveclassroom->type==0) { //lecture hall - $name = $course->shortname.'_LectureHall'; - } - else if($liveclassroom->type==1) { // breackout - $name = $course->shortname.'_BreackOut'; - } - $liveclassroom_rooms->course = $liveclassroom->course; - $liveclassroom_rooms->lc_id = $liveclassroom->id; - $liveclassroom_rooms->name = $name; - - if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { - return false; - } + liveclassroom_create_rooms ($course); + +//Check if the room is already link in the database with the liveclassroom + if(!liveclassroom_rooms_exists ($liveclassroom)) { + $type = liveclassroom_get_type($liveclassroom); + $name =liveclassroom_get_room_name($course,$type); + //create the liveclassroom_rooms in moodle database + $liveclassroom_rooms->course = $liveclassroom->course; + $liveclassroom_rooms->name = $name; + $liveclassroom_rooms->lc_id = $liveclassroom->id; + $liveclassroom_rooms->room_id = liveclassroom_api_get_roomid($name); + if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { + return false; + } + } // Create the session fir this user if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-25 10:38:26
|
Revision: 47 Author: shazan Date: 2006-08-25 03:38:19 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=47&view=rev Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-08-25 10:37:42 UTC (rev 46) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-08-25 10:38:19 UTC (rev 47) @@ -1,4 +1,4 @@ -<?PHP + <?PHP /****************************************************************************** * * * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * @@ -40,6 +40,8 @@ + + /** * Validate the data in passed in the configuration page * @param $config - the information from the form mod.html @@ -215,20 +217,34 @@ return true; } - /** * Create the different kind of room on this course */ function liveclassroom_create_rooms ($course) { - // Chek if the rooms doesn't exist for this course - if (sizeof(liveclassroom_get_list_type_rooms_per_course($course))==0) { - //add them - $list_type = liveclassroom_get_list_type_rooms(); - for($i=0;$i<sizeof($list_type);$i++) { - liveclassroom_create_room ($course->id, $list_type->name); + $coursename = $course->shortname; + //get the list of existing types + $list_type = liveclassroom_get_list_type_rooms(); + + //For each type, check if the room exist on the server + for($i=0;$i<sizeof($list_type);$i++) { + $name = $coursename.'_'.$list_type[$i]; + if(!liveclassroom_api_room_exist($name)){ //Create room + liveclassroom_create_room ($course->id, $name); } + else { //Room already exist + //Create in the moodle database + /* $type = liveclassroom_get_type($liveclassroom); + //create the liveclassroom_rooms in moodle database + $liveclassroom_rooms->course = $liveclassroom->course; + $liveclassroom_rooms->name = liveclassroom_get_room_name($course,$type); + $liveclassroom_rooms->lc_id = $liveclassroom->id; + if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { + return false; + }*/ + } } + return true; } @@ -321,9 +337,13 @@ */ function liveclassroom_get_list_type_rooms() { + //$sql = "SELECT u.name FROM mdl_liveclassroom_rooms u WHERE u.course=0"; + //$n = count_records_sql($sql); + //$list0 = get_records_sql($sql); - $list = get_records('liveclassroom_rooms','course',0); + $list = get_records('liveclassroom_type_rooms','course',0); + for($i=0;$i<sizeof($list);$i++) { $list_name[$i] = $list[$i+1]->name; } @@ -344,20 +364,51 @@ } function liveclassroom_rooms_add_instance($liveclassroom_rooms) { - /// Given an object containing all the necessary data, -/// (defined by the form in mod.html) this function -/// will create a new instance and return the id number -/// of the new instance. - $liveclassroom_rooms->timemodified = time(); - # May have to add extra stuff in here # return insert_record("liveclassroom_rooms", $liveclassroom_rooms); } +function liveclassroom_rooms_add_new_type($name) { + + $liveclassroom_type_room->timemodified = time(); + + $liveclassroom_type_room->course = 0 ; + $liveclassroom_type_room->lc_id = 0 ; + $liveclassroom_type_room->name = $name ; + + return insert_record("liveclassroom_type_rooms", $liveclassroom_type_room); + +} + + + +/* +* Get the type number of liveclassroom +*/ +function liveclassroom_get_type($liveclassroom) { + if($lc = get_record('liveclassroom','id',$liveclassroom->id)) { + return $lc->type; + } + else return false; +} + +/** +* Give the name of the room for the course +*/ +function liveclassroom_get_room_name($course,$type) { + $lc = get_record('liveclassroom_type_rooms','id',$type+1); + $name = $course->shortname; + $typename = $lc->name; + + return $name.'_'.$typename; +} + + + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-25 10:37:50
|
Revision: 46 Author: shazan Date: 2006-08-25 03:37:42 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=46&view=rev Log Message: ----------- new functions added to parse the http response and to get the roomId from the server Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-25 09:15:56 UTC (rev 45) +++ trunk/moodle/mod/liveclassroom/api.php 2006-08-25 10:37:42 UTC (rev 46) @@ -52,6 +52,7 @@ $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST = 'function=listClass'; +$LIVECLASSROOM_API_RECORD_SEPERATOR = "=END RECORD"; /** * Creates a CURL session with the Live Classroom server. Upon success, it @@ -451,13 +452,14 @@ function liveclassroom_api_room_exist($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"); - print $data; + //print $data; preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -466,16 +468,20 @@ } // print($data); $tok = split("100 OK",$data); - $tok1 = split("=END RECORD",$tok[1]); - /* while($tok) { - echo $tok."<br>"; - $tok = split("100 OK"); - $number++; + //print $tok[1]; + $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); + // print $tok1[1]; + //print (liveclassroom_parse_line($tok1[1],"class_id=")); + + /* + + for($i=0;$i<sizeof($tok1);$i++) { + //print $tok1[$i]."<br>" ; + print (liveclassroom_parse_line($tok1[$i],"class_id="))."<br>"; } - */ - // echo "number".$number."br"; -// print($tok1); -// echo "number".sizeof($tok1); +*/ +// print (liveclassroom_api_get_roomid($roomname))."<br>"; + if(sizeof($tok1)>1){ return true; @@ -523,5 +529,57 @@ } +/** +* Parses the HTTP response body +* +* @param response +* @throws +*/ +function liveclassroom_parse_response($response) { + return true; +} + +/** +* +* return a string delimited by the pattern and the end of line +*/ +function liveclassroom_parse_line($line,$pattern) { + + $response = split($pattern,$line); + //print $response; + return $response[1]; + +} + +/** +* @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"); + + //print $data; + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + // print($data); + $tok = split("100 OK",$data); + //print $tok[1]; + $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); + // print $tok1[1]; + $result = liveclassroom_parse_line($tok1[0],"class_id="); + // print $result; + return $result; +} + + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-25 09:16:01
|
Revision: 45 Author: shazan Date: 2006-08-25 02:15:56 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=45&view=rev Log Message: ----------- added functions to query the server and to get the room and room list Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-08-24 11:33:11 UTC (rev 44) +++ trunk/moodle/mod/liveclassroom/api.php 2006-08-25 09:15:56 UTC (rev 45) @@ -50,9 +50,9 @@ $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS = 'function=createClass'; $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE = 'function=createRole'; $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; +$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST = 'function=listClass'; - /** * Creates a CURL session with the Live Classroom server. Upon success, it * returns a CURL Handle authenticated and ready for use. It returns false @@ -393,4 +393,135 @@ } 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, use ACCESS_PRIV_ constants from ListCommand. + * @param roomId + * @return List A List of LCRoom objects + * @throws + * If an error occurs in querying the server + */ + function liveclassroom_api_get_room_list($userid, $role, $roomid) { + + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + + + $data = liveclassroom_api_send_query($ch,$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&target=$roomid&longname=$roomname"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + + + } + +function liveclassroom_api_get_room($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"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + return $list; + +} + + + +/** +* Check if a room exist on the server +* +* @param roomname +*/ + + function liveclassroom_api_room_exist($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"); + + print $data; + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + // print($data); + $tok = split("100 OK",$data); + $tok1 = split("=END RECORD",$tok[1]); + /* while($tok) { + echo $tok."<br>"; + $tok = split("100 OK"); + $number++; + } + */ + // echo "number".$number."br"; +// print($tok1); +// echo "number".sizeof($tok1); + if(sizeof($tok1)>1){ + + return true; + } + else { + return false; + } + } + + + /** + * $param $ch + * $param $const : function called + * return $data : list of the result query + */ + function liveclassroom_api_send_query($ch,$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) { + + } + + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-08-24 11:33:19
|
Revision: 44 Author: shazan Date: 2006-08-24 04:33:11 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=44&view=rev Log Message: ----------- new database for moodle module LC 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-08-24 09:29:06 UTC (rev 43) +++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-08-24 11:33:11 UTC (rev 44) @@ -51,6 +51,9 @@ `room_id` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) COMMENT='Defines liveclassroom rooms'; + +INSERT INTO prefix_liveclassroom_rooms VALUES ('', '0', 'LectureHall', '0',''); +INSERT INTO prefix_liveclassroom_rooms VALUES ('', '0', 'BreackOut', '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-08-24 09:29:28
|
Revision: 43 Author: shazan Date: 2006-08-24 02:29:06 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=43&view=rev Log Message: ----------- - Added several functions to the LC API (handles creation of different rooms) Modified Paths: -------------- trunk/moodle/mod/liveclassroom/create.php trunk/moodle/mod/liveclassroom/db/mysql.sql trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/create.php =================================================================== --- trunk/moodle/mod/liveclassroom/create.php 2006-07-05 16:49:45 UTC (rev 42) +++ trunk/moodle/mod/liveclassroom/create.php 2006-08-24 09:29:06 UTC (rev 43) @@ -42,9 +42,13 @@ error("Guests are not allowed to create rooms", $_SERVER["HTTP_REFERER"]); } - $id = required_param('id', PARAM_INT); // Course Module ID - $roomname = required_param('roomname', PARAM_TEXT); // Room name + $id = optional_param('id', 0, PARAM_INT); + // $id = required_param('id', PARAM_INT); // Course Module ID + + $roomname = optional_param('idroomname', 0, PARAM_TEXT); + //$roomname = required_param('roomname', PARAM_TEXT); // Room name + if (! $course = get_record("course", "id", $id)) { error("Course is misconfigured"); } @@ -52,6 +56,9 @@ require_login($id, false); + + + if (isstudent($course->id)) { error("Students are not allowed to create rooms", $_SERVER["HTTP_REFERER"]); } Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-07-05 16:49:45 UTC (rev 42) +++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-08-24 09:29:06 UTC (rev 43) @@ -36,10 +36,21 @@ 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'; + +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'; # -------------------------------------------------------- # INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name'); Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-07-05 16:49:45 UTC (rev 42) +++ trunk/moodle/mod/liveclassroom/index.php 2006-08-24 09:29:06 UTC (rev 43) @@ -32,9 +32,21 @@ require_once("../../config.php"); require_once("lib.php"); + + $id = optional_param('id', 0, PARAM_INT); - require_variable($id); // course + $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 + + if (! $course = get_record("course", "id", $id)) { error("Course ID is incorrect"); } @@ -72,9 +84,28 @@ $strweek = get_string("week"); $strtopic = get_string("topic"); + $room_type = "Room Type"; + $room_info = "Get Info"; + $room_enter = "Enter Room"; + $room_tracking = "Tracking"; + $room_settings = "Settings"; + $room_delete = "Remove"; + + + $image1 = "<img alt='' src='$CFG->wwwroot/mod/liveclassroom/information.gif'/>"; + $image2 = "<img alt='' src='$CFG->wwwroot/mod/liveclassroom/tracking_small.gif'/>"; + $image3 = "<img alt='' src='$CFG->wwwroot/mod/liveclassroom/modify.gif'/>"; + $image4 = "<a href='$CFG->wwwroot/course/mod.php?delete=$id;&sesskey=sesskey();&sr=0'><img alt='' src='$CFG->wwwroot/mod/liveclassroom/small_delete.gif'/> </a>"; + if ($course->format == "weeks") { - $table->head = array ($strweek, $strname); - $table->align = array ("CENTER", "LEFT"); + if (isteacher($course->id, $USER->id)) { + $table->head = array ($strweek, $strname, $room_type, $room_info, $room_tracking, $room_settings, $room_delete); + $table->align = array ("CENTER", "LEFT", "CENTER", "CENTER", "CENTER", "CENTER", "CENTER"); + } + else { + $table->head = array ($strweek, $strname, $room_type); + $table->align = array ("CENTER", "LEFT", "CENTER"); + } } else if ($course->format == "topics") { $table->head = array ($strtopic, $strname); $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); @@ -86,21 +117,52 @@ foreach ($liveclassrooms as $liveclassroom) { if (!$liveclassroom->visible) { //Show dimmed if the mod is hidden - $link = "<A class=\"dimmed\" HREF=\"view.php?id=$liveclassroom->coursemodule\">$liveclassroom->name</A>"; + // $link = "<A class=\"dimmed\" HREF=\"view.php?id=$liveclassroom->coursemodule\">$liveclassroom->name</A>"; + $link = "<A class=\"dimmed\" HREF=\"view.php?id=2\">$liveclassroom->name</A>"; } else { //Show normal if the mod is visible $link = "<A HREF=\"view.php?id=$liveclassroom->coursemodule\">$liveclassroom->name</A>"; } if ($course->format == "weeks" or $course->format == "topics") { - $table->data[] = array ($liveclassroom->section, $link); + if (isteacher($course->id, $USER->id)) { + $table->data[] = array ($liveclassroom->section, $link, $liveclassroom->type, $image1, $image2, $image3, $image4); + } + else { + $table->data[] = array ($liveclassroom->section, $link, $liveclassroom->type); + } + } else { $table->data[] = array ($link); } } + + //$list = liveclassroom_api_get_room_list($USER->firstname, $USER->firstname, $id); + //$test = liveclassroom_api_get_room($room->id); + //$list2 = liveclassroom_api_get_list_users($USER->id, $USER->firstname, $room->id); - echo "<BR>"; + $fichier=fopen('C:\wampserver\www\moodle\mod\liveclassroom\user.txt','w+'); + //fputs($fichier,$id); + fputs($fichier,$room->id); + fclose($fichier); // + //print_r($list); + ?> + <table cellpadding='2' border='0' align='center' width='100%' valign='top'> + <tr style='background-color:#EEEEEE; font-weight:normal; color:black;'> + <td valign='top'> + <strong><font size='+1'><?php p(get_string('listroom', 'liveclassroom'))?> <em><?php p($course->fullname)?></em>.</font> + </strong> + </td> + </tr> + <tr> + <td style="border-bottom: 2px solid #999;"><span class='fnt0'></span> + </td> + </tr> + </table> +<?php + echo "<br>"; + print_table($table); /// Finish the page Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-07-05 16:49:45 UTC (rev 42) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-08-24 09:29:06 UTC (rev 43) @@ -217,11 +217,20 @@ /** - * Create the Lecture Hall room and as many study rooms as groups oin this course + * Create the different kind of room on this course */ function liveclassroom_create_rooms ($course) { - //Implement me! + + // Chek if the rooms doesn't exist for this course + if (sizeof(liveclassroom_get_list_type_rooms_per_course($course))==0) { + //add them + $list_type = liveclassroom_get_list_type_rooms(); + for($i=0;$i<sizeof($list_type);$i++) { + liveclassroom_create_room ($course->id, $list_type->name); + } + } return true; + } function liveclassroom_create_session ($course, $isteacher) { @@ -306,6 +315,49 @@ return '0'; } +/** + * Give the list of type of room available + * @return the list of type of room available + */ +function liveclassroom_get_list_type_rooms() { + + + $list = get_records('liveclassroom_rooms','course',0); + + for($i=0;$i<sizeof($list);$i++) { + $list_name[$i] = $list[$i+1]->name; + } + return $list_name; +} +function liveclassroom_get_list_type_rooms_per_course($course) { + + + $list = get_records('liveclassroom_rooms','course',$course->id); + + for($i=0;$i<sizeof($list);$i++) { + $list_name[$i] = $list[$i+1]->name; + } + + return $list_name; +} + +function liveclassroom_rooms_add_instance($liveclassroom_rooms) { + /// Given an object containing all the necessary data, +/// (defined by the form in mod.html) this function +/// will create a new instance and return the id number +/// of the new instance. + + + $liveclassroom_rooms->timemodified = time(); + + # May have to add extra stuff in here # + + return insert_record("liveclassroom_rooms", $liveclassroom_rooms); + +} + + + ?> Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-07-05 16:49:45 UTC (rev 42) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-08-24 09:29:06 UTC (rev 43) @@ -2,10 +2,18 @@ <!-- It is used from /course/mod.php. The whole instance is available as $form. --> <?php + include_once($CFG->dirroot.'/mod/liveclassroom/lib.php'); + /// First we check that form variables have been initialised if (!isset($form->name)) { $form->name = ''; } +if (!isset($form->type)) { + $form->type = ''; +} +if (!isset($form->intro)) { + $form->intro = ''; +} // More similar blocks go here... ?> @@ -13,13 +21,39 @@ <center> <table cellpadding="5"> <tr valign="top"> + <td align="right"><b><?php print_string('liveclassroomtype', 'liveclassroom')?>:</b></td> + <td> + <?php + include_once($CFG->dirroot.'/mod/liveclassroom/lib.php'); + //recuperation de la liste des types de rooms + $list_type_rooms = liveclassroom_get_list_type_rooms(); + // asort($LIVECLASSROOM_TYPES); + //$list_type_rooms[sizeof($list_type_rooms)] = get_string('otherroom', 'liveclassroom'); + + choose_from_menu($list_type_rooms, 'type', $form->type, ''); + helpbutton('liveclassroomtype', get_string('liveclassroomtype', 'liveclassroom'), 'liveclassroom'); + + + + ?> + </td> + + +</tr> + +<tr valign="top"> <td align="right"><b><?php print_string("name") ?>:</b></td> <td> <input type="text" name="name" size="30" value="<?php p(get_string("modulename", "liveclassroom")) ?>"> </td> </tr> <!-- More rows go in here... --> - +<tr valign="top"> + <td align="right"><b><?php print_string("description") ?>:</b></td> + <td> + <TEXTAREA rows="2" name="description" ></TEXTAREA> + </td> +</tr> <!-- The following line for Moodle 1.5 prints the visibility setting form element --> <?php print_visible_setting($form); ?> <!-- and if your module uses groups you would also have --> Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-07-05 16:49:45 UTC (rev 42) +++ trunk/moodle/mod/liveclassroom/view.php 2006-08-24 09:29:06 UTC (rev 43) @@ -33,12 +33,20 @@ require_once("../../config.php"); require_once("lib.php"); - optional_variable($id); // Course Module ID, or - optional_variable($a); // liveclassroom ID + $id = optional_param('id', 0, PARAM_INT); + $a = optional_param('a', 0, PARAM_INT);// liveclassroom ID + //optional_variable($id); // Course Module ID, or + // optional_variable($a); // liveclassroom ID +/* + $fichier=fopen('C:\wampserver\www\moodle\mod\liveclassroom\fichier.txt','w+'); + //fputs($fichier,$id); + fputs($fichier,$a); + fclose($fichier); // ferme le fichier txt + */ if ($id) { if (! $cm = get_record("course_modules", "id", $id)) { - error("Course Module ID was incorrect"); + error("Course Module ID was incorrect 1 "); } if (! $course = get_record("course", "id", $cm->course)) { @@ -46,12 +54,13 @@ } if (! $liveclassroom = get_record("liveclassroom", "id", $cm->instance)) { - error("Course module is incorrect"); + error("Course module is incorrect1"); } } else { if (! $liveclassroom = get_record("liveclassroom", "id", $a)) { - error("Course module is incorrect"); + + error("Course module is incorrect2"); } if (! $course = get_record("course", "id", $liveclassroom->course)) { error("Course is misconfigured"); @@ -73,8 +82,22 @@ if (!liveclassroom_create_rooms ($course)) { error ("Cannot create liveclassroom rooms"); } + //ajouter ds la BD liveclassroom_rooms l'instance correspondant + if($liveclassroom->type==0) { //lecture hall + $name = $course->shortname.'_LectureHall'; + } + else if($liveclassroom->type==1) { // breackout + $name = $course->shortname.'_BreackOut'; + } + $liveclassroom_rooms->course = $liveclassroom->course; + $liveclassroom_rooms->lc_id = $liveclassroom->id; + $liveclassroom_rooms->name = $name; + + if(!liveclassroom_rooms_add_instance($liveclassroom_rooms)) { + return false; + } + - // Create the session fir this user if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { error ("Cannot create session"); @@ -136,10 +159,22 @@ </a> </td> <tr> + + <tr> + <td> + <form method="get" name="createRoom" action="edit.php"> + <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" + <input type="hidden" name="id" value="<?php echo $course->id ?>"> + <input type="submit" value="Edit Room Type"> + </form> + </td> + </tr> + <!-- + <tr> <td> <form method="get" name="createRoom" action="create.php"> - <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" /> + <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 ?>"> @@ -147,6 +182,7 @@ </form> </td> </tr> + --> <?php } ?> @@ -177,9 +213,16 @@ </table> </td> </tr> + + </table> + + <tr style="background-color:#EEEEEE; font-weight:normal; color:black;"><td style="border-right:1px solid #999;"> </td><td> </td></tr> </table> + + + <?PHP /// Finish the page print_footer($course); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-07-05 16:49:49
|
Revision: 42 Author: hugues Date: 2006-07-05 09:49:45 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=42&view=rev Log Message: ----------- Added structure for Brahim's developments Modified Paths: -------------- trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-07-05 13:38:19 UTC (rev 41) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-07-05 16:49:45 UTC (rev 42) @@ -215,6 +215,15 @@ return true; } + +/** + * Create the Lecture Hall room and as many study rooms as groups oin this course + */ +function liveclassroom_create_rooms ($course) { + //Implement me! + return true; +} + function liveclassroom_create_session ($course, $isteacher) { global $CFG, $USER; global $LIVECLASSROOM_TEACHER_SUFFIX; Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-07-05 13:38:19 UTC (rev 41) +++ trunk/moodle/mod/liveclassroom/view.php 2006-07-05 16:49:45 UTC (rev 42) @@ -70,6 +70,11 @@ error ("Cannot create liveclassroom profiles"); } + if (!liveclassroom_create_rooms ($course)) { + error ("Cannot create liveclassroom rooms"); + } + + // Create the session fir this user if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { error ("Cannot create session"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |