[Hw4mdl-svn] SF.net SVN: hw4mdl: [97] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
From: <sh...@us...> - 2006-11-23 09:56:33
|
Revision: 97 http://svn.sourceforge.net/hw4mdl/?rev=97&view=rev Author: shazan Date: 2006-11-23 01:56:32 -0800 (Thu, 23 Nov 2006) Log Message: ----------- Code complete commit Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/icon.gif trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/manageRoomAction.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/welcome.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/generateListRooms.php trunk/moodle/mod/liveclassroom/generateSettings.php trunk/moodle/mod/liveclassroom/js/General.js trunk/moodle/mod/liveclassroom/js/verif.js trunk/moodle/mod/liveclassroom/js/xml.js trunk/moodle/mod/liveclassroom/pictures/backgrounds/ trunk/moodle/mod/liveclassroom/pictures/backgrounds/headerbar.png trunk/moodle/mod/liveclassroom/pictures/backgrounds/toolbar.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-available.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-hide.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-show.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-unavailable.png trunk/moodle/mod/liveclassroom/pictures/items/messagelabel-info.png trunk/moodle/mod/liveclassroom/pictures/items/wheel-03.gif trunk/moodle/mod/liveclassroom/pictures/minus.gif trunk/moodle/mod/liveclassroom/pictures/plus.gif trunk/moodle/mod/liveclassroom/pictures/tab.gif trunk/moodle/mod/liveclassroom/pictures/tab_Select.gif trunk/moodle/mod/liveclassroom/pictures/tab_disabled.gif trunk/moodle/mod/liveclassroom/pictures/tab_over.gif trunk/moodle/mod/liveclassroom/reports.php Removed Paths: ------------- trunk/moodle/mod/liveclassroom/accueil.php trunk/moodle/mod/liveclassroom/create.php trunk/moodle/mod/liveclassroom/manageRoom.php Deleted: trunk/moodle/mod/liveclassroom/accueil.php =================================================================== --- trunk/moodle/mod/liveclassroom/accueil.php 2006-11-23 09:50:48 UTC (rev 96) +++ trunk/moodle/mod/liveclassroom/accueil.php 2006-11-23 09:56:32 UTC (rev 97) @@ -1,916 +0,0 @@ -<?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> Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-11-23 09:50:48 UTC (rev 96) +++ trunk/moodle/mod/liveclassroom/api.php 2006-11-23 09:56:32 UTC (rev 97) @@ -42,6 +42,7 @@ */ require_once('System.php'); +require_once('lib.php'); $LIVECLASSROOM_MOODLE_PREFIX = liveclassroom_api_get_prefix(); @@ -64,7 +65,7 @@ $LIVECLASSROOM_API_RECORD_SEPERATOR = "=END RECORD"; -session_start(); +//session_start(); /** @@ -100,11 +101,8 @@ "&credential_0=". $login. "&credential_1=". $passwd; - add_to_log("", "liveclassroom", "", "", "auth ".time()); - + //add_to_log("", "liveclassroom", "", "", "auth ".time()); - //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); - //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date @@ -155,6 +153,7 @@ if(file_exists($cook)) { $fileContent = file_get_contents($cook); + } else { $lastModifTime = 0; @@ -190,6 +189,7 @@ return $data; } + @@ -275,11 +275,13 @@ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_TOKEN, "&target=$userid&nickname=$nickname"); + add_to_log("", "liveclassroom", "", "liveclassroom_api_get_session", "userid: ".$userid." nickname ". $nickname); + preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; if ( $respcode != 100) { - //error( "Response: Cannot Create Session: $resp_code"); + error( "Response: Cannot Create Session: $resp_code"); return false; } @@ -311,21 +313,23 @@ * Create a room on the LC server * @param $roomid : id of the room created * @param $roomname : name of the room created +* return true if the room is created on the server, false otherwise */ -function liveclassroom_api_create_class ($roomid, $roomname,$bool) { +function liveclassroom_api_create_class ($roomid, $roomname, $bool, $attributes) { global $CFG; global $LIVECLASSROOM_API_ADMIN, $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS; - if($bool==true){ //lecture room - $attributes = "&target=$roomid&longname=$roomname&preview=0&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1&archive=0&can_archive=1"; + unset($attributes['longname']); + while (list($key, $val) = each($attributes)) { + if(($key!='class_id')&&(isset($val))&&($val!="")){ + $list_attributes .= "&".$key."=".$val; + } } - else { //discussion room - $attributes = "&target=$roomid&longname=$roomname&preview=0&media_type=two-way-audio&hms_simulcast=public&chatenable=1&privatechatenable=1&hms_two_way_enabled=1&userlimit=-1&archive=0&can_archive=1&can_liveshare=1&can_ppt_import=1"; - } - - $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_CLASS,$attributes); - //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "apres query".time()); + $final_list = "&target=$roomid"."&longname=$roomname".$list_attributes; +// echo $final_list; + $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_CLASS,$final_list); + add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "apres query".$roomname); preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -342,6 +346,13 @@ } +/* +* Add a role to a user for a room given +* @param $roomid : id of the room on the server +* @param $userid : id of the user on the server +* @param $role : role of the user for the room +* return true if the role is added, false otherwise +*/ function liveclassroom_api_add_user_role ($roomid, $userid, $role) { global $CFG; global $LIVECLASSROOM_API_ADMIN, @@ -362,7 +373,13 @@ return true; } - +/* +* Remove a role to a user for a room given +* @param $roomid : id of the room on the server +* @param $userid : id of the user on the server +* @param $role : role of the user for the room +* return true if the role is removed, false otherwise +*/ function liveclassroom_api_remove_user_role ($roomid, $userid, $role) { global $CFG; global $LIVECLASSROOM_API_ADMIN, @@ -405,9 +422,8 @@ /** * Check if a room exist on the server -* -* @param roomname -* Return a boolean : true if the room exist, false if not! +* @param roomname +* return true if the room exist, false otherwise */ function liveclassroom_api_room_exist($roomname) { @@ -454,7 +470,7 @@ /** * Get the room id from a roomname -* @params $roomname +* @param $roomname * return the room_id from the server */ @@ -489,6 +505,7 @@ * delete Room from the server * * @param roomid : id of the to delete + * return true if the room is deleted, false otherwise */ function liveclassroom_api_delete_room($roomid) { global $CFG; @@ -510,6 +527,7 @@ * Open Room on the LC server * * @param roomid : id of the room to open + * return true if the room has being opened, false otherwise */ function liveclassroom_api_open_room($roomid) { global $CFG; @@ -535,6 +553,7 @@ * Close Room on the LC server * * @param roomid : id of the room to close + * return true if the room has being closed, false otherwise */ function liveclassroom_api_close_room($roomid) { global $CFG; @@ -560,7 +579,7 @@ /* * Modify the settings of a room * @param $roomid : the id of the room -* +* return true if the room has being modified, false otherwise * TO CHECK !!!!! */ function liveclassroom_api_modify_room($roomid,$table_attributes) { @@ -568,19 +587,15 @@ global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM; - //echo sizeof($table_attributes); + while (list($key, $val) = each($table_attributes)) { - if($key=='class_id'){ + if(($key!='class_id')&&(isset($val))&&($val!="")){ + $list_attributes .= "&".$key."=".$val; } - else $list_attributes .= "&".$key."=".$val; } -// echo $list_attributes; - + $final_list = "&target=$roomid".$list_attributes; - $final_list = "&target=$roomid".$list_attributes; - //echo $final_list; - $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, $final_list); preg_match("(\d*)", $data, $matches); @@ -602,7 +617,8 @@ * 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 +* @param $userid : the id of the user +* return an array with all the archive room id */ function liveclassroom_api_get_archive_list_for_a_room($roomid,$userid) { global $CFG; @@ -640,6 +656,88 @@ } /* +* List all the open archive room associated with the room given +* +* @param $roomid : the id of the room +* @param $userid : the id of the user +* return an array with all the archive room id +*/ +function liveclassroom_api_get_open_archive_list_for_a_room($roomid,$userid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&filter02=preview&filter02value=1&AccessUser=$userid"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + //print $data; + + + $line = explode ("\n",$data); + + $j=0; + + for($i=1;$i<sizeof($line)-2;$i=$i+3) { + $test = strstr($line[$i+1],$roomid); + if($test!=false) { + // $list_return[$j][0]= liveclassroom_parse_line($line[$i],"preview="); + $list_return[$j][1]= liveclassroom_parse_line($line[$i],"class_id="); + $list_return[$j][2] = liveclassroom_parse_line($line[$i+1],"longname="); + $j++; + } + } + + + return $list_return; +} + +/* +* List all the archive room (used for the orphaned archives) +* +* @param $roomid : the id of the room +* return an array with all the archive room id +*/ +function liveclassroom_api_get_archive_list($userid) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST; + global $LIVECLASSROOM_API_RECORD_SEPERATOR; + + $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid"); + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + return false; + } + //print $data; + + + $line = explode ("\n",$data); + + $j=0; + + for($i=1;$i<sizeof($line)-3;$i=$i+4) { + + $list_return[$line[$i+1]][0]= liveclassroom_parse_line($line[$i],"preview="); + $list_return[$line[$i+1]][1]= liveclassroom_parse_line($line[$i+1],"class_id="); + $list_return[$line[$i+1]][2] = liveclassroom_parse_line($line[$i+2],"longname="); + $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 @@ -680,12 +778,15 @@ * TO CHECK !!!!! */ -function liveclassroom_api_give_lectureroom_attri... [truncated message content] |