Thread: [Hw4mdl-svn] SF.net SVN: hw4mdl: [11] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
From: <hu...@us...> - 2006-05-04 20:21:08
|
Revision: 11 Author: hugues Date: 2006-05-04 13:20:58 -0700 (Thu, 04 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=11&view=rev Log Message: ----------- - Fixed the cookie bug (I think) as it's creating it's own temporary file - Fixed a problem when clicking on exit in the admin tools - Implemented a validation of the parameters in the config page Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/config.html 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-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/api.php 2006-05-04 20:20:58 UTC (rev 11) @@ -1,7 +1,18 @@ <?PHP -// This is the API to authenticate and perform transactions with the Live cLassroom server -// All functions here should start with liveclassroom_api_ +/** + * api.php - Sets up sessions, connects to LC server and so on + * + * This is the API to authenticate and perform transactions with the Live cLassroom server + * All functions here should start with liveclassroom_api_ + * + * Normally this is only called by liveclassroom *lib.php files + * @author Hugues Pisapia + * @version $Revision:$ + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License + * @package liveclassroom + */ +require_once('System.php'); $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; @@ -12,34 +23,54 @@ $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; -// Creates a CURL session with the liveclassroom server -// It returns the CURL handle incase of success, false otherwise. -function liveclassroom_api_authenticate () { + +/** + * Creates a CURL session with the Live Classroom server. Upon success, it + * returns a CURL Handle authenticated and ready for use. It returns false + * otherwise. + * + * If the $servername param is the empty string, the function will collect + * the data from $CFG->liveclassroom_* + * + * @param string $servername + * @param string $login + * @param string $password + * @return object - a CURL Handle authenticated and ready for use, false otherwise + * @uses CFG, LIVECLASSROOM_API_ADMIN, LIVECLASSROOM_API_FUNCTION_NOOP + */ +function liveclassroom_api_authenticate ($servername='', $login='', $passwd='') { global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_NOOP; + + if (empty($servername)) { // feed them with $CFG + $servername = $CFG->liveclassroom_servername; + $login = $CFG->liveclassroom_adminusername; + $passwd = $CFG->liveclassroom_adminpassword; + } - $url = $CFG->liveclassroom_servername. + $url = $servername. $LIVECLASSROOM_API_ADMIN. $LIVECLASSROOM_API_FUNCTION_NOOP. "&AuthType=AuthCookieHandler". "&AuthName=Horizon". - "&credential_0=". $CFG->liveclassroom_adminusername. - "&credential_1=". $CFG->liveclassroom_adminpassword; + "&credential_0=". $login. + "&credential_1=". $passwd; //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); + + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); - curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt'); # XXX: cookiejar needs to be configurable? + curl_setopt($ch, CURLOPT_COOKIEJAR, System::mktemp("lc")); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - #curl_setopt($ch, CURLOPT_HEADER, 1); $data = curl_exec($ch); - #print $data; + #print_r $data; if (curl_errno($ch)) { print curl_error($ch); return false; @@ -48,7 +79,7 @@ $resp_code = $matches[0]; if ( $resp_code != 100 && $resp_code != 301) { - error( "Response: Authentication Failed: $resp_code"); + //error( "Response: Authentication Failed: $resp_code"); return false; } @@ -56,10 +87,18 @@ } +/** + * Create the Live Classroom User $user with the role $rolename. This function + * actually creates profiles that will further be used for teacher/student + * roles. + * + * @uses CFG, LIVECLASSROOM_API_ADMIN, LIVECLASSROOM_API_FUNCTION_CREATE_USER + * @param $userid string - LC login for this profile + * @param $coursename string - LC first name for this profile. We use the couse name + * @param $rolename string - LC lastname of this profile. Usually 'Teacher' or 'Student' + * @return bool - true if the user is successfuly created, false otherwise + */ function liveclassroom_api_create_user ($userid, $coursename, $rolename) { -// Creating users as per design recommendations in -// http://wiki.horizonwimba.com/wiki/index.php/LC_Integration_Design_Guidelines#Click_on_Live_Classroom_tool_link -// global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_CREATE_USER; @@ -97,9 +136,16 @@ return true; } +/** + * Returns a session id (hzA) to be inserted in URLs to access the LC server + * @uses CFG, USER + * @uses LIVECLASSROOM_API_ADMIN, LIVECLASSROOM_API_FUNCTION_GET_TOKEN + * @param $userid string - the userid/login of the profile to be used + * @param $nickname string - the name of the user that will be displayed in the LC + * @return string - the session token (hzA) if the request was successful, + * false otherwise. + */ function liveclassroom_api_get_session ($userid, $nickname) { - // Returns a session id (token) for this userId - // global $CFG; global $USER; global $LIVECLASSROOM_API_ADMIN; Modified: trunk/moodle/mod/liveclassroom/config.html =================================================================== --- trunk/moodle/mod/liveclassroom/config.html 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/config.html 2006-05-04 20:20:58 UTC (rev 11) @@ -1,5 +1,6 @@ <form method="post" action="module.php" name="form"> <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"> +<input type="hidden" name="module" value="liveclassroom"> <table cellpadding="9" cellspacing="0" > @@ -13,7 +14,7 @@ <tr valign="top"> <td align="right"><?php print_string('servername', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> + <input name="servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> </td> <td> <?php print_string("configservername", "liveclassroom") ?> @@ -22,7 +23,7 @@ <tr valign="top"> <td align="right"><?php print_string('adminusername', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_adminusername" type="text" size="20" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> + <input name="adminusername" type="text" size="20" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> </td> <td> <?php print_string("configadminusername", "liveclassroom") ?> @@ -31,7 +32,7 @@ <tr valign="top"> <td align="right"><?php print_string('adminpassword', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_adminpassword" type="text" size="20" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> + <input name="adminpassword" type="text" size="20" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> </td> <td> <?php print_string("configadminpassword", "liveclassroom") ?> @@ -40,7 +41,7 @@ <tr valign="top"> <td align="right"><?php print_string('settinguniqueid', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_settinguniqueid" type="text" size="20" value="<?php p($CFG->liveclassroom_settinguniqueid) ?>" /> + <input name="settinguniqueid" type="text" size="20" value="<?php p($CFG->liveclassroom_settinguniqueid) ?>" /> </td> <td> <?php print_string("configsettinguniqueid", "liveclassroom") ?> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-05-04 20:20:58 UTC (rev 11) @@ -10,6 +10,28 @@ + +/** + * Validate the data in passed in the configuration page + * @param $config - the information from the form mod.html + * @return nothing, but returns an error if the configuration is wrong + */ +function liveclassroom_process_options ($config) { + global $CFG; + + if (!liveclassroom_api_authenticate($config->servername, + $config->adminusername, + $config->adminpassword)) { + error (get_string('wrongconfiguration', 'liveclassroom'), + "$CFG->wwwroot/admin/module.php?module=liveclassroom"); + } + + //TODO: check the user is really an admin + + return; +} + + function liveclassroom_add_instance($liveclassroom) { /// Given an object containing all the necessary data, /// (defined by the form in mod.html) this function Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/view.php 2006-05-04 20:20:58 UTC (rev 11) @@ -63,6 +63,7 @@ /// Print the main part of the page ?> +<!--script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch-7892.js'></script--> <script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> <script type="text/javascript"> function doOpenAdmin(url) { @@ -97,7 +98,7 @@ ?> <tr> <td> - <a href="javascript:doOpenAdmin('<?php p($CFG->liveclassroom_servername)?>/admin/?hzA=<?php p($usersession)?>')"> + <a href="javascript:doOpenAdmin('<?php p($CFG->liveclassroom_servername)?>/admin/?hzA=<?php p($usersession)?>&closeOnExit=1')"> <?php p(get_string('managerooms', 'liveclassroom')) ?> </a> </td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-05-05 07:59:56
|
Revision: 12 Author: hugues Date: 2006-05-05 00:59:51 -0700 (Fri, 05 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=12&view=rev Log Message: ----------- Some more fundtion documentation 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-05-04 20:20:58 UTC (rev 11) +++ trunk/moodle/mod/liveclassroom/api.php 2006-05-05 07:59:51 UTC (rev 12) @@ -364,7 +364,4 @@ } return true; } - - - ?> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-05-04 20:20:58 UTC (rev 11) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-05-05 07:59:51 UTC (rev 12) @@ -240,7 +240,34 @@ +/** + * Return the id of liveclassroom activities in this course + * @param string the courseid + * @return array the activity ids of classrooms links available for this course + */ + function liveclassroom_ids($courseid) { + return array (); + } +/** + * Counts the number of rooms available for this course + * @param string the courseid + * @return string the numlber of classrooms available for this course + */ + function liveclassroom_count_rooms($courseid) { + return '0'; + } +/** + * Counts the number of archives available for this course + * @param string the courseid + * @return string the number of archives available for this course + */ + function liveclassroom_count_archives($courseid) { + return '0'; + } + + + ?> 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. |
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: <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-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-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-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-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-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-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-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-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-19 09:49:08
|
Revision: 67 http://svn.sourceforge.net/hw4mdl/?rev=67&view=rev Author: shazan Date: 2006-09-19 02:49:00 -0700 (Tue, 19 Sep 2006) Log Message: ----------- widget updated Modified Paths: -------------- trunk/moodle/mod/liveclassroom/manageRoom.php trunk/moodle/mod/liveclassroom/welcome.php Modified: trunk/moodle/mod/liveclassroom/manageRoom.php =================================================================== --- trunk/moodle/mod/liveclassroom/manageRoom.php 2006-09-19 09:47:52 UTC (rev 66) +++ trunk/moodle/mod/liveclassroom/manageRoom.php 2006-09-19 09:49:00 UTC (rev 67) @@ -18,17 +18,32 @@ * * * Class: * * * - * Author: Rollinger Thomas * + * Author: Hazan Samy * * * - * Date: Mai 2006 * + * Date: September 2006 * * * ******************************************************************************/ + require_once("../../config.php"); require_once("lib.php"); - global $CFG; - //$v = $_GET["v"]; - $roomId = $_GET["roomId"]; + +// $id = optional_param('id', 0, PARAM_INT); +// optional_variable($id); +// $course = optional_param('course', 0, PARAM_INT); + + + global $CFG; + + + //require_login($course->id); + //$v = $_GET["v"]; + $courseshortname = $_GET['courseshortname']; + //$id = $_GET['id']; + $roomId = $_GET['roomId']; + $action = $_GET['action']; + $id = $_GET['id']; + $room_info = liveclassroom_api_get_infos_room($roomId); ?> <head> @@ -208,22 +223,25 @@ <body> -<form method="post" action="ManageRoom.aspx" name="entry_info_form" > +<form method="post" action="" name="entry_info_form" > - <input type="hidden" value='<%=prefix+roomId %>' name="roomId" /> + <input type="hidden" value='<?php echo $roomId ?>' name="roomId" /> <input type="hidden" value="<%=session.getTimeOfLoad() %>" name="time" /> - <? if ($_GET['action'] == "editRoom") - {?> + <? + if ($action == "editRoom") + {?> <input type="hidden" value="updateRoom" name="action" /> - <?} - else - { ?> + <? + } + else + { ?> <input type="hidden" value="createRoom" name="action" /> - <?} ?> + <? + } ?> <table cellspacing="0" cellpadding="0" width="100%" border=0 align="center" id="TABLE1" style="border-right: #818181 1px solid; border-top: #818181 1px solid; border-left: #818181 1px solid; border-bottom: #818181 1px solid"> @@ -234,27 +252,7 @@ <tr> <td><img src="pictures/angel.gif" /></td> <td colspan="3" align="center" valign="middle"> - <!-- - <table border=0 style="background-image: url(pictures/Search.gif); background-repeat:no-repeat;"> - <tr > - <td align="right" width=10px> - <img src="pictures/Loupe.gif" align="middle" style="border:none " /> - </td> - <td align="right" width=125px> - <input disabled name="search" id="search" type="text" style="border:0; width: 120px;" - onkeyup="hideCroix(search.value);javascript:getBreakoutRoom(search.value);getMainLectureRoom(search.value);" /> - </td> - <td align=left width=20px > - <div id="croix" style="display:none"> - <img onmouseover="overCroix(this)" onclick="clickCroix()" onmouseout="overCroix(this)" src="pictures/x_normal.png" align="middle" style="border:none " /> - </div> - </td> - </tr> - </table> - <select id="view" onchange="ChangeView()" disabled> - <option value="normal">Normal View</option> - <option value="student">Student View</option> - </select>--> + </td> </tr> </table> @@ -277,8 +275,8 @@ background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; height: 18px;" align="center"> Room Info</td> - <? if ($roomId == null || !(liveclassroom_api_room_is_archive($roomId))) - { ?> + <? if(!liveclassroom_api_room_is_archive($roomId) || ($roomId == "")) + {?> <td onclick='onTab(2)' onmouseover='onOver(2)' onmouseout='onOut(2)' id="tab2" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> @@ -291,7 +289,7 @@ width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Chat</td> - <?} ?> + <?} ?> <td onclick='onTab(5)' onmouseover='onOver(5)' onmouseout='onOut(5)' id="tab5" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> @@ -317,33 +315,43 @@ <td> <span class="alert">*</span> Title :</td> <td > - <input type="text" name="longname" value="<?=(action=="editRoom")? p(liveclassroom_get_room_name_from_id($roomId)):""?>" maxlength="50" style="width: 300px" /></td> + <input type="text" name="longname" value="<?php if($action=='editRoom') p(liveclassroom_api_get_room_name($roomId))?>" maxlength="50" style="width: 300px" /></td> </tr> <tr> <td>Description :</td> - <td > - <textarea rows="4" cols="40" name="description" ><?=(action == "editRoom") ? p(liveclassroom_api_get_room_description($roomId)) : ""?></textarea> </td> + <td> + <textarea rows="4" cols="40" name="description"> + <?php if($action=='editRoom'){echo liveclassroom_api_get_room_description($roomId);}?> + </textarea> + </td> </tr> - <? if ($roomId == null || !(liveclassroom_api_room_is_archive($roomId))) + <? if (($roomId == "") || (liveclassroom_api_room_is_archive($roomId))==false) { ?> <tr> <td>Type :</td> <td> - <input type="radio" name="led" value="instructor" id="led_instructor" <?=(action=="editRoom")? "checked":"checked"?> + <input type="radio" name="led" value="instructor" id="led_instructor" + <?php if(($action=="editRoom") && (liveclassroom_is_lecturehall($roomId,$courseshortname)==true)) + { echo "checked"; } + else{ echo "checked"; } + ?> onclick='javascript:toggleType();' /> <label for='led_instructor' > Main rooms<br /> <label for='led_instructor' style="font-style: italic;margin-left:25px"> Instructors lead the presentation </label><br /> <input type="radio" name="led" value="student" id="led_student" onclick='javascript:toggleType();' - <?=(action=="editRoom" && isStudentAdmin==true)? "checked":""?> /> - <label for='led_student' > + <?php + if($action=="editRoom" && liveclassroom_is_breakout($roomId,$courseshortname)==true){ echo "checked"; } + ?> + /> + <label for='led_student' > Discussion rooms<br /> </label> <label for='led_student' style="font-style: italic;margin-left:25px"> Students and Instructors have the same rights </label> </td> </tr> - <?} ?> + <?} ?> </table> </span> @@ -351,16 +359,32 @@ <table cellspacing="0" cellpadding="3" align="center" border="0" class="tab"> <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="audio" value="two-way-audio" <%=(action=="editRoom")?(currentRoom.getMediaType()=="two-way-audio")? "checked":"":"checked"%> - onclick="doChangeMedia('audio');" /> + <input type="radio" name="mediaFormat" id="audio" value="two-way-audio" onclick="doChangeMedia('audio');" + <?php if($action=='editRoom') { + if($room_info['media_type']=="two-way-audio"){ echo "checked";} + } + else echo "checked"; + ?>/> <label for="audio">Audio:</label> </td> </tr> <tr> <td width=15px></td> <td> - <input type="checkbox" name="hmsSimulcastStudent" value="true" id="student_simulcast" - <%=(action=="editRoom")?((currentRoom.isHmsSimulcastRestricted()==true)? "checked":((currentRoom.getMediaType()!="two-way-audio")?"checked disabled":"")):"checked"%> /> + <input type="checkbox" name="hmsSimulcastStudent" value="true" id="student_simulcast" + <?php + if($action=='editRoom'){ + if($room_info['hms_simulcast_restricted']==1){ + echo "checked"; + } + else if($room_info['media_type']=="two-way-video"){ + echo "checked disabled"; + } + else echo "checked"; + } + else echo "checked"; + + ?> /> <label for="student_simulcast" >Enable students to use the phone<br /></label> <label style="font-size: 8pt; font-style: italic">(Instructors can always use the phone)</label> </td> @@ -368,16 +392,32 @@ <tr> <td width=15px></td> <td> - <input type="checkbox" name="hmsTwoWayEnabled" value="true" id="two_way_enabled" - <%=(action=="editRoom")?((currentRoom.isHmsTwoWayEnabled())? "checked":((currentRoom.getMediaType()!="two-way-audio")?"checked disabled":""))):"checked"%> /> + <input type="checkbox" name="hmsTwoWayEnabled" value="true" id='two_way_enabled' + <?php + if($action=='editRoom'){ + if($room_info['hms_two_way_enabled']==1){ + echo "checked"; + } + else if($room_info['media_type']=="two-way-video"){ + echo "checked disabled"; + } + else echo "checked"; + } + else echo "checked"; + ?> /> <label for="two_way_enabled"> Enable students' microphones at presentation start</label></td> </tr> <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="video" value="one-way-video" <%=(action=="editRoom")?(currentRoom.getMediaType()=="one-way-video")? "checked":"":""%> - onclick="doChangeMedia('video');" /> + <input type="radio" name="mediaFormat" id="video" value='one-way-video' + <?php + if($action=='editRoom'){ + if($room_info['media_type']=="one-way-video"){ echo " checked ";} + } + ?> + onclick="doChangeMedia('video');" /> <label for="video">One-way Video</label> <label style="font-size: 8pt; font-style: italic"> (Presenter uses RealProducer) </label> </td> @@ -385,10 +425,19 @@ <tr> <td colspan=2> - <span id="roomId_row" style="position: relative; display: <%=(action=="editRoom")?(currentRoom.getMediaType()=="one-way-video")? "block":"none":"none"%>";"> + <span id="roomId_row" style='position: relative; display: + <?php + if($action=='editRoom') { + if($room_info['media_type']=="one-way-video") echo "block"; + else echo "none"; + } + else echo "none"; + ?>';"> + + <label for="roomId_field"> Room ID:</label> - <input type="text" name="roomId_Field" id="roomId_field" value="<%=prefix+roomId %>" + <input type="text" name="roomId_Field" id="roomId_field" value='<?php p($roomId)?>' readonly style="width: 205px" /> </span> </td> @@ -397,8 +446,14 @@ <td colspan=2> <input type="radio" name="mediaFormat" id="none" value="none" onclick="doChangeMedia('none');" - <%=(action=="editRoom")?(currentRoom.getMediaType()=="none")? "checked":"":""%> /> - <label for="none"> + <?php + if($action=='editRoom') { + if($room_info['media_type']=="none") echo "checked"; + } + ?>/> + + + <label for="none"> Third-party Conference Call</label> </td> </tr> @@ -410,9 +465,13 @@ <tr> - <td> + <td> <input type="checkbox" name="studentEboardEnabled" value="true" id="enable_eboard" - <%=(action=="editRoom")?(currentRoom.isStudentWhiteboardEnabled())? "checked":"":""%> /> + <?php + if($action=='editRoom'){ + if($room_info['student-wb-enabled']==1) echo "checked"; + } + ?>/> <label for="enable_eboard"> Enable students to use eBoard</label> </td> @@ -425,7 +484,11 @@ <tr> <td> <input type="checkbox" name="studentLiveappEnabled" value="true" id="enable_liveapp" - <%=(action=="editRoom")?(currentRoom.isStudentLiveAppEnabled())? "checked":"":""%> /> + <?php + if($action=='editRoom'){ + if($room_info['student-wb-liveapp']==1) echo "checked"; + } + ?>/> <label for="enable_liveapp"> Enable students to use the Screen Grab tool</label> </td> @@ -438,7 +501,13 @@ <tr> <td> - <input type="checkbox" name="archiveEnabled" value="true" id="enable_archive" <%=(action=="editRoom")?(currentRoom.isArchiveEnabled()==true)?"checked":"":"checked"%> /> + <input type="checkbox" name="archiveEnabled" value="true" id="enable_archive" + <?php + if($action=='editRoom'){ + if($room_info['can_archive']==1) echo "checked"; + } + else echo "checked"; + ?>/> <label for="enable_archive"> Enable Archiving</label> </td> @@ -446,7 +515,13 @@ <tr> <td> - <input type="checkbox" name="appshareEnabled" value="true" id="enable_appshare" <%=(action=="editRoom")?(currentRoom.isLiveShareEnabled()==true)? "checked":"":"checked"%> /> + <input type="checkbox" name="appshareEnabled" value="true" id="enable_appshare" + <?php + if($action=='editRoom'){ + if($room_info['can_liveshare']==1) echo "checked"; + } + else echo "checked"; + ?>/> <label for="enable_appshare"> Enable Appshare</label> </td> @@ -454,7 +529,13 @@ <tr> <td> - <input type="checkbox" name="pptEnabled" value="true" id="enable_ppt" <%=(action=="editRoom")? ((currentRoom.isPptImportEnabled()==true)? "checked":""):"checked"%> /> + <input type="checkbox" name="pptEnabled" value="true" id="enable_ppt" + <?php + if($action=='editRoom'){ + if($room_info['can_ppt_import']==1) echo "checked"; + } + else echo "checked"; + ?>/> <label for="enable_ppt"> Enable On-The-Fly PPT Import</label> </td> @@ -468,8 +549,13 @@ <table cellspacing="0" cellpadding="3" align="center" border="0" class="tab"> <tr> <td colspan="2"> - <input type="checkbox" name="chatEnabled" value="true" id="chat_enable" <%=(action=="editRoom")?(currentRoom.isChatEnabled())? "checked":"":"checked"%> - onclick="doChangeChat();" /> + <input type="checkbox" name="chatEnabled" value="true" id="chat_enable" + <?php + if($action=='editRoom'){ + if($room_info['chatenable']==1) echo "checked"; + } + else echo "checked"; + ?> onclick="doChangeChat();" /> <label for="enable_chat"> Enable students to use text chat</label> </td> @@ -477,7 +563,13 @@ <tr> <td width="20"> </td> <td> - <input type="radio" name="privateChatEnabled" value="true" id="privateenabled" <%=(action=="editRoom")?( currentRoom.isPrivateChatEnabled())? "checked":"":"checked"%> /> + <input type="radio" name="privateChatEnabled" value="true" id="privateenabled" + <?php + if($action=='editRoom'){ + if($room_info['privatechatenable']==1) echo "checked"; + } + else echo "checked"; + ?>/> <label for="privateenabled"> Enabled Public and Private text chat</label> </td> @@ -486,7 +578,11 @@ <td width="20"> </td> <td> <input type="radio" name="privateChatEnabled" value="false" id="privatedisabled" - <%=(action=="editRoom")?( currentRoom.isPrivateChatEnabled())? "":"checked":""%> /> + <?php + if($action=='editRoom'){ + if($room_info['privatechatenable']==0) echo "checked"; + } + ?>/> <label for="privatedisabled"> Enable Public text chat only</label> </td> @@ -506,18 +602,32 @@ <tr> <td > - <input type="radio" name="userlimit" value="false" id="userlimit_false" <%=(action=="editRoom")?(currentRoom.getUserLimit()==-1)? "checked":"":"checked"%> - onclick="toggleUserlimit(false);" /> + <input type="radio" name="userlimit" value="false" id="userlimit_false" onclick="toggleUserlimit(false);" + <?php + if($action=='editRoom'){ + if($room_info['userlimit']==-1) echo " checked "; + } + else echo " checked "; + ?>/> <label for="userlimit_false"> Unlimited</label></td> </tr> <tr> <td > - <input type="radio" name="userlimit" value="true" id="userlimit_true" onclick="toggleUserlimit(true);" - <%=(action=="editRoom")?(currentRoom.getUserLimit()!=-1)? "checked":"":""%> /> + <input type="radio" name="userlimit" value="true" id="userlimit_true" onclick='toggleUserlimit(true);' + <?php + if($action=='editRoom'){ + if($room_info['userlimit']=-1) echo "checked"; + } + ?>/> <label for="userlimit_true"> Limited:</label> - <input type="text" name="userlimitValue" value="<%=(action=="editRoom" && currentRoom.getUserLimit()!=-1)? currentRoom.getUserLimit().ToString():""%>" + <input type="text" name="userlimitValue" value=' + <?php + if(($action=='editRoom')&&($room_info['userlimit']!=-1)){ + echo $room_info['userlimit']; + } + ?>' id="userlimittext" disabled /></td> </tr> <tr> @@ -528,19 +638,32 @@ <tr> <td > - <input type="checkbox" name="guests" value="true" onclick="doChangeLink()" id="guestAccess_value" <%=(action=="editRoom" && guestAccess==true)? "checked":""%>/> + <input type="checkbox" name="guests" value="true" onclick="doChangeLink()" id="guestAccess_value" + <?php + if(($action=='editRoom')&&(liveclassroom_api_role_user_room($roomId,'Guest')=='Student')){ + echo "checked"; + } + ?> + /> <label for="guestAccess_value"> Enable guest access</label> </td> </tr> <tr> <td > - <div id="launcher_link_row" <%=(action=="editRoom" && guestAccess==true)? "":"style='position: relative; display: none;'"%>> + <div id="launcher_link_row" + <?php + if(($action=='editRoom')&&(liveclassroom_api_role_user_room($roomId,'Guest')=='Student')){ + + } + else echo "style='position: relative; display: none;'" ; + ?> + > <table> <tr> <td><label for="launcher_link_field"> Link:</label></td> - <td> <input type="text" name="link" id="Text1" size="70" value="<%=Setup.getInstance().getLcServerURL()%>/launcher.cgi?room=<%=prefix+roomId %>" + <td> <input type="text" name="link" id="Text1" size="70" value="<?php p($CFG->liveclassroom_servername)?>/launcher.cgi?room=<?php p($roomId)?>" readonly /></td> </tr> </table> @@ -549,8 +672,7 @@ </tr> </table> </span> - - + </td> </tr> <tr > @@ -560,24 +682,26 @@ <td align=left width=70% > <span class="alert">*</span>Required fields.</td> <td class=action align=center width=15%> - <a href=<%=Util.URL_REDIRECT+ "?time=" + session.getTimeOfLoad() + "&" + session.url_params + "signature=" + Util.mD5Crypt(session.signature+Setup.getInstance().getHashKey()) %> >Cancel</a> + + <input type="reset" value="<?php print_string("cancel") ?>" onclick="self.location.href='welcome.php?id=<?php p($id) ?>'"> + </td> <td height="25px" class=action align=center width=15%> - <? if (action == "editRoom") - {?> + <?php if($action=='editRoom') + { + ?> <a href="javascript:verifyFormUpdate()" >Update</a> - <?} - else - {?> + <?php + }else + {?> <a href="javascript:verifyForm()" >Save All</a> - <?} ?> + <?php } ?> </tr> </table> </td> </tr> - - + </table> </form> </body><script> toggleType()</script> \ No newline at end of file Modified: trunk/moodle/mod/liveclassroom/welcome.php =================================================================== --- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-19 09:47:52 UTC (rev 66) +++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-19 09:49:00 UTC (rev 67) @@ -81,6 +81,8 @@ notice("There are no liveclassrooms", "../../course/view.php?id=$course->id"); die; } + + $tab = liveclassroom_get_main_room_list($course); ?> <head> <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> @@ -115,8 +117,8 @@ if (hidestatus[id]==1) { document.getElementById(id).style.display="block"; - //document.images['toggleimg'+id].src="<%=Setup.getInstance().getLcServerURL()%>/images/integration/small_collapse.gif"; - document.images['toggleimg'+id].src="pictures/small_collapse.gif"; + document.images['toggleimg'+id].src="<?PHP p($CFG->liveclassroom_servername)?>/images/integration/small_collapse.gif"; + //document.images['toggleimg'+id].src="pictures/small_collapse.gif"; hidestatus[id]=0; if(id=='orphaned'){ @@ -134,7 +136,7 @@ else { document.getElementById(id).style.display="none"; - document.images['toggleimg'+id].src="pictures/small_expand.gif"; + document.images['toggleimg'+id].src="<?PHP p($CFG->liveclassroom_servername)?>/images/integration/small_expand.gif"; hidestatus[id]=1; if(id=='orphaned'){ TampNumberOrphanedRoom=NumberOrphanedRoom; @@ -306,6 +308,21 @@ var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500'); w.focus(); } + + + + +function doOpenAddActivity(url,param){ + + if(current!="") + { + var complete_url=url+'?roomId='+current+'&id=<?php p($id) ?>§ion=0&sesskey=<?php echo sesskey(); ?>&'+param; + window.open(complete_url,"_top"); + + } + +} + function doOpenIntern(popup,url){ if(current!="") { @@ -384,7 +401,7 @@ { <?php - $tab = liveclassroom_get_main_room_list($course); + $tab_main = $tab[0]; ?> var retour=""; @@ -392,19 +409,19 @@ var numberArchive=0; var number=0; retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>"; - <?php for($i=0; $i<sizeof($tab[0]); $i++) + <?php for($i=0; $i<sizeof($tab_main); $i++) { // print ($tab[0][$i]); ?> - myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?>"); + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab_main[$i])) ?>"); mysearch=new String(search); - mysearch=mysearch.toLowerCase(); + // mysearch=mysearch.toLowerCase(); results = myString.match(mysearch) if(search==null || results!=null) { var preview; <?php - if(!liveclassroom_api_room_is_preview($tab[0][$i])) + if(!liveclassroom_api_room_is_preview($tab_main[$i])) { ?> preview=true; @@ -419,27 +436,27 @@ ?> if(studentView==false || ( studentView==true && !preview)) { - retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">" + retour += "<tr id='<?php p($tab_main[$i]) ?>' Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\">" if(studentView==false) { <?php - if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[0][$i]))>0) + if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]))>0) { ?> numberArchive++; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td>"; - retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[0][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[0][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab_main[$i]) ?>hide')\" name=\"toggleimg<?php p($tab_main[$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; <?php } else { ?> - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>"; <?php } ?> @@ -460,11 +477,11 @@ else { */?> - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"> </td>"; } - retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab[0][$i])) ?></td>"; + retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab_main[$i])) ?></td>"; if(!preview) { if(studentView==false) @@ -473,7 +490,7 @@ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } else @@ -484,18 +501,18 @@ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td></tr>"; + retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab_main[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_main[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_main[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_main[$i]) ?>')\"></td></tr>"; <?php - if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[0][$i]))>0) + if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]))>0) { ?> - retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[0][$i]) ?>hide'>"; + retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab_main[$i]) ?>hide'>"; <?php - $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i]); + $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab_main[$i]); ?> retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >"; <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++) @@ -570,7 +587,7 @@ retour += "</table>"; document.getElementById("main").innerHTML = retour; - gestionDisplay(); + // gestionDisplay(); if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) correctPNG(); } @@ -580,7 +597,7 @@ { <?php - $tab = liveclassroom_get_main_room_list($course); + $tab_breakout = $tab[1]; ?> var retour=""; @@ -588,19 +605,19 @@ var numberArchive=0; var number=0; retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>"; - <?php for($i=0; $i<sizeof($tab[1]); $i++) + <?php for($i=0; $i<sizeof($tab_breakout); $i++) { ?> - myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?>"); + myString = new String("<?php p(liveclassroom_get_room_name_from_id($tab_breakout[$i])) ?>"); mysearch=new String(search); - mysearch=mysearch.toLowerCase(); + //mysearch=mysearch.toLowerCase(); results = myString.match(mysearch) if(search==null || results!=null) { var preview; <?php - if(!liveclassroom_api_room_is_preview($tab[1][$i])) + if(!liveclassroom_api_room_is_preview($tab_breakout[$i])) { ?> preview=true; @@ -615,26 +632,26 @@ ?> if(studentView==false || ( studentView==true && !preview)) { - retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">" + retour += "<tr id='<?php p($tab_breakout[$i]) ?>' Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\">" if(studentView==false) { <?php - if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]))>0) + if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]))>0) { ?> numberArchive++; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td>"; - retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[1][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[1][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab_breakout[$i]) ?>hide')\" name=\"toggleimg<?php p($tab_breakout[$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; <?php } else { ?> - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>"; <?php } ?> @@ -658,12 +675,12 @@ %> */ - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"> </td>"; } - retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab[1][$i])) ?></td>"; + retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><?php p(liveclassroom_get_room_name_from_id($tab_breakout[$i])) ?></td>"; if(!preview) { if(studentView==false) @@ -672,7 +689,7 @@ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } @@ -684,19 +701,19 @@ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td></tr>"; + retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab_breakout[$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab_breakout[$i]) ?>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<?php p($tab_breakout[$i]) ?>')\" onmouseout=\"onOut('<?php p($tab_breakout[$i]) ?>')\"></td></tr>"; <?php - if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]))>0) + if(sizeof(liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]))>0) { ?> - retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[1][$i]) ?>hide'>"; + retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab_breakout[$i]) ?>hide'>"; <?php - $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i]); + $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab_breakout[$i]); ?> retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >"; <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++) @@ -772,7 +789,7 @@ retour += "</table>"; document.getElementById("breakout").innerHTML = retour; - gestionDisplay(); + //gestionDisplay(); if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) correctPNG(); } @@ -1142,7 +1159,7 @@ <table cellspacing="0" cellpadding="0" width="1000" border="0" align="center" id="TABLE1"> <tr style="background-color: #f0f0f0"> <td colspan="6" style="border-top:white 1px solid"> - +<?php if (isstudent($course->id)){ ?> <span id="student_Menu"> <table style="width: 1000" cellspacing="0" cellpadding="1" align="center"> <tr class="button_disabled" id="menu_student"> @@ -1173,7 +1190,7 @@ </tr> </table> </span> - +<?php }else if (isteacher($course->id, $USER->id)) { ?> <span id="admin_Menu"> <table style="width: 1000" cellspacing="0" cellpadding="1" align="center"> <tr class="button_disabled" id="menu_admin" > @@ -1184,7 +1201,7 @@ </td> <td width="9%" align="center" > - <a href="javascript:window.open('../../course/mod.php?id=<?php p($course->id)?>§ion=0&sesskey=<?php echo sesskey(); ?>&add=liveclassroom','_top')" > + <a href="javascript:doOpenAddActivity('../../course/mod.php','add=liveclassroom')" > <img src="pictures/launch_Black.png" border="0" alt="Edit RoomSettings" title="Add Activity" id="launch_icon" name="launch_icon" height="24" width="24"><br /> Add Activity</a> @@ -1228,7 +1245,9 @@ <td width="9%" align="center" > - <a href="javascript:doOpen(false,'','')" onclick=";return confirm('Are you sure to delete this room ?');" > + <a href="javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=deleteRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" onclick=";return confirm('Are you sure to delete this room ?');" > + + <a href="javascript:doOpen(false,'','action=deleteRoom')" onclick=";return confirm('Are you sure to delete this room ?');" > <img src="pictures/delete_Black.png" border="0" alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br /> Delete</a> @@ -1252,7 +1271,7 @@ </tr> </table> </span> - +<?php } ?> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-12-15 15:23:00
|
Revision: 111 http://svn.sourceforge.net/hw4mdl/?rev=111&view=rev Author: shazan Date: 2006-12-15 07:22:58 -0800 (Fri, 15 Dec 2006) Log Message: ----------- add activity & configuration forms prettier Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/config.html trunk/moodle/mod/liveclassroom/generateListRooms.php trunk/moodle/mod/liveclassroom/generateSettings.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/view.php trunk/moodle/mod/liveclassroom/welcome.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/api.php 2006-12-15 15:22:58 UTC (rev 111) @@ -46,7 +46,7 @@ $LIVECLASSROOM_MOODLE_PREFIX = liveclassroom_api_get_prefix(); -$LIVECLASSROOM_API_ADMIN = 'admin/api/api.pl?'; +$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'; Modified: trunk/moodle/mod/liveclassroom/config.html =================================================================== --- trunk/moodle/mod/liveclassroom/config.html 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/config.html 2006-12-15 15:22:58 UTC (rev 111) @@ -12,7 +12,7 @@ </tr> <tr valign="top"> - <td align="right"><?php print_string('servername', 'liveclassroom')?>:</td> + <td align="right"><?php print_string('servername', 'liveclassroom')?> :</td> <td> <input name="servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> </td> @@ -21,25 +21,39 @@ </td> </tr> <tr valign="top"> - <td align="right"><?php print_string('adminusername', 'liveclassroom')?>:</td> + <td align="right"><?php print_string('adminusername', 'liveclassroom')?> :</td> <td> - <input name="adminusername" type="text" size="20" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> + <input name="adminusername" type="text" size="30" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> </td> <td> <?php print_string("configadminusername", "liveclassroom") ?> </td> </tr> <tr valign="top"> - <td align="right"><?php print_string('adminpassword', 'liveclassroom')?>:</td> + <td align="right"><?php print_string('adminpassword', 'liveclassroom')?> :</td> <td> - <input name="adminpassword" type="text" size="20" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> + <input name="adminpassword" type="text" size="30" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> </td> <td> <?php print_string("configadminpassword", "liveclassroom") ?> </td> </tr> - <tr> +<td><br /></td> +</tr> +<tr valign="top"> + <td align="right"><?php print_string('lcversion', 'liveclassroom')?> :</td> + <td> + <?php print_string("lcversionnumber", "liveclassroom") ?> + </td> +</tr> +<tr valign="top"> + <td align="right"><?php print_string('integrationversion', 'liveclassroom')?> :</td> + <td> + <?php print_string("integrationversionnumber", "liveclassroom") ?> + </td> +</tr> +<tr> <td colspan="3" align="center"> <input type="submit" value="<?php print_string("savechanges") ?>" /></td> </tr> Modified: trunk/moodle/mod/liveclassroom/generateListRooms.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateListRooms.php 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/generateListRooms.php 2006-12-15 15:22:58 UTC (rev 111) @@ -30,10 +30,8 @@ /* $Id$ */ /// This page is to generate the list of rooms and archives - error_reporting(E_ALL); - - - + + require_once("../../config.php"); require_once("lib.php"); require_once("api.php"); @@ -72,7 +70,7 @@ } - $xmldoc = domxml_new_doc("1.0");// new DomDocument(); + $xmldoc = domxml_new_doc("1.0"); $root = $xmldoc->create_element('root'); @@ -135,11 +133,9 @@ $products->append_child($listProducts); // PRODUCTS CONTENT -// $productContent = $xmldoc->create_element('productsContent'); + $products->append_child(liveclassroom_list_xml_roomsarchiveslist($xmldoc,$userid,$courseid,$isteacher)); - -// $products->append_child($productContent); $elementParameters->append_child($products); @@ -151,7 +147,7 @@ $xmldoc->append_child($root); - $xmlstring = $xmldoc->dump_mem(true); //saveXML(); // Xml datas into a string + $xmlstring = $xmldoc->dump_mem(true); // Xml datas into a string $finalstring = str_replace("\n", '', $xmlstring); echo $xmlstring; Modified: trunk/moodle/mod/liveclassroom/generateSettings.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateSettings.php 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/generateSettings.php 2006-12-15 15:22:58 UTC (rev 111) @@ -38,7 +38,7 @@ // Variables needed global $CFG; - if (version_compare(PHP_VERSION,'5','>=')) { + if (version_compare(PHP_VERSION,'5','>=')) { require_once($CFG->libdir.'/cas/domxml-php4-php5.php'); } Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-12-15 15:22:58 UTC (rev 111) @@ -36,13 +36,8 @@ //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 -/* - if (version_compare(PHP_VERSION,'5','>=')) { - require_once($CFG->libdir.'/cas/domxml-php4-php5.php'); - } - -*/ + /** * Validate the data in passed in the configuration page * @param $config - the information from the form mod.html @@ -943,7 +938,8 @@ function liveclassroom_get_session_params($xmldoc, $sessionParams) { // General Information - + global $CFG; + $information = $xmldoc->create_element("information"); $firstName = $xmldoc->create_element("firstName"); @@ -959,9 +955,11 @@ $courseId = $xmldoc->create_element("courseId"); $courseId->append_child($xmldoc->create_text_node($sessionParams['enc_course_id'])); if ($sessionParams['authToken'] != null) { - $authToken = $xmldoc->create_element("authToken"); - $authToken->append_child($xmldoc->create_text_node($sessionParams['authToken'])); - } + $authToken = $xmldoc->create_element("authToken"); + $authToken->append_child($xmldoc->create_text_node($sessionParams['authToken'])); + } + $lcServerUrl = $xmldoc->create_element("lcServerUrl"); + $lcServerUrl->append_child($xmldoc->create_text_node($CFG->liveclassroom_servername)); $signature = $xmldoc->create_element("signature"); $signature->append_child($xmldoc->create_text_node($sessionParams['signature'])); @@ -972,6 +970,7 @@ $information->append_child($timeOfLoad); $information->append_child($courseId); $information->append_child($authToken); + $information->append_child($lcServerUrl); $information->append_child($signature); return $information; Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-12-15 15:22:58 UTC (rev 111) @@ -57,7 +57,6 @@ } // $section = get_record("course_sections", "id", $cmLiveclass->section ); - // $sectionId = $section->section; $sectionId = $_GET['sr']; $liveclassroom = get_record("liveclassroom", "id", $cmLiveclass->instance ); $action = "update"; @@ -67,40 +66,47 @@ <style> .headerBar { -padding-left:5px ; +padding-left:50px ; width:100%; +height:32px; +background-image:url("<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/backgrounds/headerbar.png"); -background-image:url("<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/backgrounds/headerbar.png"); -height:32px; border-bottom:solid 1px Black; } + .fontCurrent { font-family:Verdana; font-size:10px; } -a:link + +a.list:link { + color : #0000FF ; text-decoration : underline ; } -a:hover +a.list:hover { color : #0000FF ; - text-decoration : underline ; + text-decoration : none ; } -a:visited +a.list:visited { color : #0000FF ; text-decoration : underline ; } -a:active +a.list:active { color : #0000FF ; text-decoration : none ; } +.content +{ + margin:-5px; +} </style> <script type="text/javascript"> @@ -134,20 +140,26 @@ } </script> +<div class="content"> <form name="form" method="post" action="mod.php"> <center> +<table border="1" width="800"> +<tr><td> +<table border="0" width="100%" cellpadding="0" cellspacing="0" margin="0"> + <tr class="headerBar"> + <td align="left"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/headerbar-logo.png"></td> + <td align='right'></td> + </tr> +</table> + +<table border="0" width="100%" cellpadding="5" cellspacing="0" > -<table width="800" cellpadding="5" cellspacing="0" margin="0"> -<tr class="headerBar"> - <td align="left"><img height="32px" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/headerbar-logo.png"></td> - <td align='right'></td> -</tr> <tr> - <td><br></td> + <td><br></td><td></td> </tr> <tr valign="top"> @@ -165,7 +177,7 @@ //Display the list of the weeks ?> - <td align="right"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/more-link.png"><font class="fontCurrent"><a href="<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>"><?php print_string('weeksformat', 'liveclassroom')?> :</a></font></td> + <td align="right"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/more-link.png"><font class="fontCurrent"><a class="list" href="<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>"><?php print_string('weeksformat', 'liveclassroom')?> :</a></font></td> <td align="left"> <SELECT name="section"> <?php @@ -213,7 +225,7 @@ <tr valign="top"> - <td align="right"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/more-link.png"><font class="fontCurrent"><a href="<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>"><?php print_string('topicformat', 'liveclassroom') ?> :</a></font></td> + <td align="right"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/more-link.png"><font class="fontCurrent"><a class="list" href="<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>"><?php print_string('topicformat', 'liveclassroom') ?> :</a></font></td> <td align="left"> @@ -251,7 +263,7 @@ </tr> <tr valign="top"> - <td align="right"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/more-link.png"><font class="fontCurrent"><a href="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $id;?>"><?php print_string('liveclassroomtype', 'liveclassroom')?> :</a></font></td> + <td align="right"><img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/more-link.png"><font class="fontCurrent"><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $id;?>"><?php print_string('liveclassroomtype', 'liveclassroom')?> :</a></font></td> <td align="left"> @@ -309,33 +321,27 @@ <td><br></td> </tr> -<tr > - <td colspan=2 > - <table width=100% cellpadding="0" style="border-top:#818181 1px solid; border-bottom:#818181 1px solid; background-color:#F0F0F0;"> - <tr> - <td align=left width=70% > +<tr style="border-top:1px solid; background-color:#F0F0F0;"> + <td align=left > <font color="red">*</font><font class="fontCurrent"><?php print_string('requiredfields', 'liveclassroom')?></font> - </td> - <td align=center width=15%> + </td> + <td align=right > <img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/buttons/general-cancel.png" onclick="self.location.href='<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>'"> <?php if(isset($action) && $action=="update") $pictureUrl="$CFG->wwwroot/mod/liveclassroom/pictures/buttons/general-saveall.png"; else $pictureUrl="$CFG->wwwroot/mod/liveclassroom/pictures/buttons/general-create.png"; ?> <input type="image" src="<?php echo $pictureUrl;?>" onclick="return validate()" > - - <!-- <input type="reset" value="<?php print_string("cancel") ?>" onclick="self.location.href='view.php?id=<?php p($id)?>'" > - general-empty.png - <input type="submit" value="<?php print_string("add") ?>" />--> + </td> - - </tr> - </table> - </td> + </tr> + </table> + +</td></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) ?>" /> @@ -347,4 +353,6 @@ </center> </form> + +</div> <script> TestNoRoom(); </script> \ No newline at end of file Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/view.php 2006-12-15 15:22:58 UTC (rev 111) @@ -62,158 +62,41 @@ } } - require_login($course->id); + require_login($course->id); - // add_to_log($course->id, "liveclassroom", "view", "view.php?id=$cm->id", "$liveclassroom->id"); - - // Create the session for this user if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) { error ("Cannot create session"); } -/// Print the page header - if ($course->category) { - $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; - } + $classid = $liveclassroom->type; - $strliveclassrooms = get_string("modulenameplural", "liveclassroom"); - $strliveclassroom = get_string("modulename", "liveclassroom"); - print_header("$course->shortname: $liveclassroom->name", "$course->fullname", - "$navigation <A HREF=index.php?id=$course->id>$strliveclassrooms</A> -> $liveclassroom->name", - "", "", 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 = ""; - } - -*//* - -// 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 ?> <!--script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch-7892.js'></script--> <script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> <script type="text/javascript"> - function doOpenAdmin(url) { - var w = window.open(url, 'lc_admin_popup', 'scrollbars=yes, resizable=yes, width=800, height=500'); - w.focus(); + + function startActivity(){ + + startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>' ) + location.href = "<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php echo $course->id; ?>"; + } </script> <?php - $classid = $liveclassroom->type; + if ((isstudent($course->id)) or (isteacher($course->id, $USER->id))) { ?> - <body onload="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>' )"> - </body> + <?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;"> - <td width="70%"> - <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('linksfor', 'liveclassroom'))?> <em><?php p($course->fullname)?></em>.</font> - </strong> - - </td> - </tr> - <tr ><td style="border-bottom: 1px solid #999;"><span class='fnt0'></span> - </td></tr> - - - - -<?php - if ( (isteacher($course->id, $USER->id))|| (isstudent($course->id)) ) { -?> - <tr> - <td> - <a href="javascript:startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($usersession)?>')"> - - <?php p(get_string("accessroomsstudent", 'liveclassroom')) ?> - </a> - </td> - </tr> - -<?php -} -?> - - <tr > - <td> - <em><font size="-1"> - <?php echo get_string ('wizard.text.1', 'liveclassroom') ?> - <a href="javascript:startWizard()" target="_self" class="external"><?php echo get_string('wizard.text.2', 'liveclassroom') ?></a> - <?php echo get_string ('wizard.text.3', 'liveclassroom') ?> - </font></em> - </td> - </tr> - </table> - </td> - <td align="right" width="30%" valign="top" style="border-left:1px solid #999;"> - <table cellpadding="2" valign="top" align="center" width="100%" border="0"> - <tr style="background-color:#EEEEEE; font-weight:normal; color:black;"> - <td> </td> - <td valign="top"> - <a href="javascript:startWizard()" title="<?php echo get_string('runwizard', 'liveclassroom') ?>" > - <img src="<?php p($CFG->liveclassroom_servername) ?>/images/wizard_logo.gif" border="0" title="<?php echo get_string('runwizard', 'liveclassroom') ?>" alt="<?php echo get_string('runwizard', 'liveclassroom') ?>"></a><br> - <em><font size="-1"> - <?php echo get_string('wizard.text2.1', 'liveclassroom')?> <a href="javascript:startWizard()" target="_self" class="external"><?php echo get_string('wizard.text2.2', 'liveclassroom')?></a> <?php echo get_string('wizard.text2.3', 'liveclassroom')?> - </font></em> - </td> - </tr> - </table> - </td> - </tr> - - </table> -</td> - </tr> - - <tr style="background-color:#EEEEEE; font-weight:normal; color:black;"><td style="border-right:1px solid #999;"> </td><td> </td></tr> - - </table> - - - -<?PHP -/// Finish the page - print_footer($course); - -?> + <script>startActivity();</script> \ No newline at end of file Modified: trunk/moodle/mod/liveclassroom/welcome.php =================================================================== --- trunk/moodle/mod/liveclassroom/welcome.php 2006-12-15 11:04:39 UTC (rev 110) +++ trunk/moodle/mod/liveclassroom/welcome.php 2006-12-15 15:22:58 UTC (rev 111) @@ -48,24 +48,16 @@ } require_login($course->id); - if (!liveclassroom_init_session($_GET)) { error("ExpiredSessionException"); } - - - //session_start(); /// 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) { @@ -161,7 +153,7 @@ <?php if(isset($_GET['addnew'])) { - ?> //alert("yep"); + ?> showPopup() var parameters=""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-12-22 12:45:13
|
Revision: 122 http://svn.sourceforge.net/hw4mdl/?rev=122&view=rev Author: shazan Date: 2006-12-22 04:45:02 -0800 (Fri, 22 Dec 2006) Log Message: ----------- message Bar well displayed Modified Paths: -------------- trunk/moodle/mod/liveclassroom/generateListRooms.php trunk/moodle/mod/liveclassroom/js/manageXml.js trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/welcome.php Modified: trunk/moodle/mod/liveclassroom/generateListRooms.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateListRooms.php 2006-12-22 10:11:12 UTC (rev 121) +++ trunk/moodle/mod/liveclassroom/generateListRooms.php 2006-12-22 12:45:02 UTC (rev 122) @@ -109,7 +109,7 @@ // MESSAGE BAR if (isset($params['messageType'])) { - $windows->append_child(liveclassroom_create_message($xmldoc, 'info', liveclassroom_get_message($params['messageType']))); + $windows->append_child(liveclassroom_create_message($xmldoc, liveclassroom_get_message($params['messageType']))); } // LIST Modified: trunk/moodle/mod/liveclassroom/js/manageXml.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/manageXml.js 2006-12-22 10:11:12 UTC (rev 121) +++ trunk/moodle/mod/liveclassroom/js/manageXml.js 2006-12-22 12:45:02 UTC (rev 122) @@ -208,7 +208,7 @@ display+="<div id='error_frame' align='center'>" display+="<table width='100%' border='0' cellpadding='0' height='254px'>" - display+="<tr>" + display+="<tr >" display+="<td width='10%'></td>" display+="<td valign='middle'><img src='pictures/items/warning.png' alt='' width='60' height='60' border='0'></td>" display+="<td width='20'></td>" Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-12-22 10:11:12 UTC (rev 121) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-12-22 12:45:02 UTC (rev 122) @@ -979,12 +979,12 @@ * @param $value : value of the message * return a DOM Document element with the message element */ -function liveclassroom_create_message($xmldoc, $type, $value) { +function liveclassroom_create_message($xmldoc, $value) { $message = $xmldoc->create_element('windowsElement'); $messagetype = $xmldoc->create_element('type'); - $messagetype->append_child($xmldoc->create_text_node("messageBar")); + $messagetype->append_child($xmldoc->create_text_node("message")); $message->append_child($messagetype); $messageElementParameters = $xmldoc->create_element("windowsElementParameters"); @@ -992,7 +992,7 @@ $m = $xmldoc->create_element("message"); $mtype = $xmldoc->create_element("type"); - $mtype->append_child($xmldoc->create_text_node($type)); + $mtype->append_child($xmldoc->create_text_node("message")); $m->append_child($mtype); $mvalue = $xmldoc->create_element("value"); Modified: trunk/moodle/mod/liveclassroom/welcome.php =================================================================== --- trunk/moodle/mod/liveclassroom/welcome.php 2006-12-22 10:11:12 UTC (rev 121) +++ trunk/moodle/mod/liveclassroom/welcome.php 2006-12-22 12:45:02 UTC (rev 122) @@ -155,8 +155,12 @@ { ?> showPopup() - - var parameters=""; + + + currentProduct = "LiveClassroom"; + typeSelect="MainLecture"; + + var parameters=""; parameters="product=liveclassroom&"; parameters+="action=new&"; parameters+=getURLParameters(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-01-11 21:55:17
|
Revision: 180 http://svn.sourceforge.net/hw4mdl/?rev=180&view=rev Author: hugues Date: 2007-01-11 13:55:02 -0800 (Thu, 11 Jan 2007) Log Message: ----------- http://u.horizonwimba.com/bugzilla/show_bug.cgi?id=10738 - Fixed some variable name typos 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 2007-01-11 15:25:54 UTC (rev 179) +++ trunk/moodle/mod/liveclassroom/api.php 2007-01-11 21:55:02 UTC (rev 180) @@ -417,7 +417,6 @@ $data = liveclassroom_api_send_query(LIVECLASSROOM_API_FUNCTION_DELETE_ROLE, "&target=$roomid&user_id=$userid&role_id=$role"); - preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; @@ -909,27 +908,25 @@ function liveclassroom_api_get_student_user_id ($courseid){ global $CFG; - $course = get_record("course", "id", $courseid); + $course = get_record("course", "id", $courseid); + if (empty($course)) { + error(_FUNCTION_." empty course"); + } $enc_coursename = str_replace(" ", "_", $course->shortname); - $data = liveclassroom_api_send_query(LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter00=last_name&filter00value=$enc_coursename&filter01=first_name&filter01value=Student"); + $data = liveclassroom_api_send_query(LIVECLASSROOM_API_FUNCTION_LIST_USER, "&filter01=last_name&filter01value=$enc_coursename&filter02=first_name&filter02value=Student"); preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; - if ( $respcode != 100) { - return false; - } + if ( $respcode != 100) { + return false; + } $line = explode("\n",$data); -// $tok = split("100 OK",$data); - // $tok1 = split($LIVECLASSROOM_API_RECORD_SEPERATOR,$tok[1]); -// $result = liveclassroom_parse_line($tok1[0],"user_id="); $result = liveclassroom_parse_line($line[1],"user_id="); - //Remove le " " at the end of the line - //$response = substr($result,0,-1); return $result; @@ -946,7 +943,7 @@ function liveclassroom_api_room_is_preview ($roomid){ global $CFG; - $data = liveclassroom_api_send_query(LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&filter00=class_id&filter00value=$roomid&filter01=preview&filter01value=0"); + $data = liveclassroom_api_send_query(LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&filter01=class_id&filter01value=$roomid&filter02=preview&filter02value=0"); preg_match("(\d*)", $data, $matches); $respcode = $matches[0]; Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2007-01-11 15:25:54 UTC (rev 179) +++ trunk/moodle/mod/liveclassroom/lib.php 2007-01-11 21:55:02 UTC (rev 180) @@ -307,11 +307,9 @@ $userid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename. ($isteacher?LIVECLASSROOM_TEACHER_SUFFIX:LIVECLASSROOM_STUDENT_SUFFIX); - $nickname = fullname($USER); - return liveclassroom_api_get_session ($userid, $nickname); } @@ -320,42 +318,54 @@ * Updates the parameters of a room * */ -function liveclassroom_update_room ($course_id, $roomname, $instructor_led, $attributes) { +function liveclassroom_update_room ($courseid, $roomname, $instructor_led, $attributes) { - $student_id = liveclassroom_api_get_student_user_id ($courseid) ; + $roomid = $attributes['roomId_Field']; + unset($attributes['roomId_Field']); + $studentid = liveclassroom_api_get_student_user_id ($courseid) ; + //set media_type and media_format according to the appropriate values according to the media_type attribute $attributes = liveclassroom_check_media($attributes); $attributes = liveclassroom_check_chat($attributes); - //print_r($list_attributes); //Test if the type of room has been changed if($_SESSION['led']!=$attributes['led']) { // Type changed - if($list_attributes['led']=='instructor'){ - liveclassroom_api_remove_user_role ($_GET['id'], $student_id, 'Instructor') ; - liveclassroom_api_add_user_role ($_GET['id'], $student_id, 'Student'); + if($attributes['led']=='instructor'){ + + if (! liveclassroom_api_remove_user_role ($roomid, $studentid, 'Instructor')) { + return false; + } + + if (! liveclassroom_api_add_user_role ($roomid, $studentid, 'Student')) { + return false; + } } else { - liveclassroom_api_remove_user_role ($_GET['id'], $student_id , 'Student') ; - liveclassroom_api_add_user_role ($_GET['id'], $student_id, 'Instructor'); + + if (!liveclassroom_api_remove_user_role ($roomid, $studentid , 'Student')) { + return false; + } + if (!liveclassroom_api_add_user_role ($roomid, $studentid, 'Instructor')) { + return false; + } } } unset($attributes['led']); unset($attributes['link']); - unset($attributes['roomId_Field']); //print_r($list_attributes); - if(!liveclassroom_api_modify_room($_GET['id'],$attributes)) { + if(!liveclassroom_api_modify_room($roomid, $attributes)) { return false; } //Guest enabled? if ($attributes['guests']==1) { - if (! liveclassroom_api_add_user_role ($_GET['id'], 'Guest' , 'Student')) { + if (! liveclassroom_api_add_user_role ($roomid, 'Guest' , 'Student')) { return false; } } else if ($attributes['guest']==0) { - if (! liveclassroom_api_remove_user_role ($_GET['id'], 'Guest' , 'Student')) { + if (! liveclassroom_api_remove_user_role ($roomid, 'Guest' , 'Student')) { 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-29 13:38:10
|
Revision: 72 http://svn.sourceforge.net/hw4mdl/?rev=72&view=rev Author: shazan Date: 2006-09-29 06:38:03 -0700 (Fri, 29 Sep 2006) Log Message: ----------- rooms, archives and orphaned archives are now get in one request to the server. Modified Paths: -------------- trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/welcome.php Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-09-29 13:34:33 UTC (rev 71) +++ trunk/moodle/mod/liveclassroom/index.php 2006-09-29 13:38:03 UTC (rev 72) @@ -45,8 +45,6 @@ error("Course ID is incorrect"); } - //$id = require_param('id', 0, PARAM_INT); - //require_variable($id); // course global $CFG; if (! $course = get_record("course", "id", $id)) { @@ -107,18 +105,7 @@ <td align="right"><img src="pictures/logo.gif" /></td> </tr> </table> - - <?php - //echo liveclassroom_api_get_room_name('_moodle_1c1_23459_2006_0913_0856_47'); - /* - $tab = liveclassroom_api_get_archive_list_for_a_room('_moodle_1c1_244459'); - for($j=0;$j<sizeof($tab);$j++){ - echo $tab[$j]; - } -*/ - ?> - </body> Modified: trunk/moodle/mod/liveclassroom/welcome.php =================================================================== --- trunk/moodle/mod/liveclassroom/welcome.php 2006-09-29 13:34:33 UTC (rev 71) +++ trunk/moodle/mod/liveclassroom/welcome.php 2006-09-29 13:38:03 UTC (rev 72) @@ -39,14 +39,12 @@ $course = optional_param('course', 0, PARAM_INT); $roomname = optional_param('idroomname', 0, PARAM_TEXT); - //$roomid = optional_param('idroom', 0, PARAM_TEXT); + if (! $room = get_record("liveclassroom", "course", $id)) { error("Course ID is incorrect"); } - - //$id = require_param('id', 0, PARAM_INT); - //require_variable($id); // course + global $CFG; if (! $course = get_record("course", "id", $id)) { @@ -57,7 +55,8 @@ add_to_log($course->id, "liveclassroom", "view all", "index.php?id=$course->id", ""); - + + /// Get all required strings $strliveclassrooms = get_string("modulenameplural", "liveclassroom"); @@ -81,11 +80,11 @@ notice("There are no liveclassrooms", "../../course/view.php?id=$course->id"); die; } - + //add_to_log("", "liveclassroom", "", "", "avan teacher id ".time()); $teacherid = liveclassroom_api_get_teacher_user_id($course->shortname); - add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avan recup liste ".time()); - $tab = liveclassroom_api_get_room_list($teacherid,$course); - add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time()); + //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avan recup liste ".time()); + $tab = liveclassroom_api_get_roomandarchive_list($teacherid,$course); + //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres recup liste ".time()); ?> <head> <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" /> @@ -298,7 +297,7 @@ } getMainLectureRoom(""); getBreakoutRoom(""); - //getOrphanedArchive(""); + getOrphanedArchive(""); if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block") document.getElementById("info").style.display="none"; current=""; @@ -402,22 +401,21 @@ var NumberOrphanedRoom=0; function getMainLectureRoom(search) { - - var retour=""; NumberMainLectureRoom=0; var numberArchive=0; var number=0; retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>"; - <?php for($i=0; $i<sizeof($tab[0])-2; $i=$i+3) + <?php //for($i=0; $i<sizeof($tab[0])-2; $i=$i+3) + //for($i=0; $i<sizeof($tab[0]); $i=$i+1) + foreach($tab[0] as $room) { - // print ($tab[0][$i]); - //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "avant archive list ".$i.": ".time()); - $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid); - //$archiveOfThisRoomID=new array[]; - //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_room_list", "apres archive list ".$i.": ".time()); + //$tabroom=$tab[0][$i]; + //$archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid); + // $archiveOfThisRoomID = $room[3]; + ?> - myString = new String("<?php p($tab[0][$i+2]) ?>"); + myString = new String("<?php p($room[1]) ?>"); mysearch=new String(search); // mysearch=mysearch.toLowerCase(); results = myString.match(mysearch) @@ -425,7 +423,7 @@ { var preview; <?php - if($tab[0][$i+1]==1) + if($room[2]==1) { ?> preview=true; @@ -440,27 +438,28 @@ ?> if(studentView==false || ( studentView==true && !preview)) { - retour += "<tr id='<?php p($tab[0][$i]) ?>' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\">" + retour += "<tr id='<?php p($room[0]) ?>' Onclick=\"OneClick('<?php p($room[0]) ?>')\">" if(studentView==false) { <?php - if(sizeof($archiveOfThisRoomID)>0) - { + if(sizeof($room[3])>0) + + { ?> numberArchive++; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td>"; - retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[0][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[0][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($room[0]) ?>hide')\" name=\"toggleimg<?php p($room[0]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; <?php } else { ?> - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; <?php } ?> @@ -481,11 +480,11 @@ else { */?> - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; } - retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><?php p($tab[0][$i+2]) ?></td>"; + retour += "<td width=\"545px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>"; if(!preview) { if(studentView==false) @@ -494,7 +493,7 @@ //retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } else @@ -505,29 +504,30 @@ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[0][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[0][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[0][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[0][$i]) ?>')\"></td></tr>"; + retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>"; <?php - if(sizeof($archiveOfThisRoomID)>0) + if(sizeof($room[3])>0) { ?> - retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[0][$i]) ?>hide'>"; + retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($room[0]) ?>hide'>"; <?php - //$archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[0][$i],$teacherid); + ?> retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >"; - <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++) + <?php + foreach($room[3] as $archive) { /* if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId())) orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/ ?> var preview; - <?php if($archiveOfThisRoomID[$j][0]==1) - //if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j])) + <?php if($archive[2]==1) + { ?> preview=true; @@ -542,10 +542,10 @@ ?> if(studentView==false|| ( studentView==true && !preview)) { - retour += "<tr id='<?php p($archiveOfThisRoomID[$j][1]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j[1]]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td>"; - retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\">"; + retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>"; + retour += "<td width=310px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">"; retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />"; - retour += "<?php p($archiveOfThisRoomID[$j][2]) ?></td>"; + retour += "<?php p($archive[1]) ?></td>"; if(!preview) { if(studentView==false) @@ -555,7 +555,7 @@ } else { - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } } @@ -567,9 +567,9 @@ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td></tr>"; + retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>"; } <?php } @@ -607,12 +607,13 @@ var numberArchive=0; var number=0; retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>"; - <?php for($i=0; $i<sizeof($tab[1])-2; $i=$i+3) + <?php foreach($tab[1] as $room) + { - $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i],$teacherid); + ?> - myString = new String("<?php p($tab[1][$i+2]) ?>"); + myString = new String("<?php p($room[1]) ?>"); mysearch=new String(search); //mysearch=mysearch.toLowerCase(); results = myString.match(mysearch) @@ -620,7 +621,7 @@ { var preview; <?php - if($tab[1][$i+1]==1) + if($room[2]==1) { ?> preview=true; @@ -635,26 +636,26 @@ ?> if(studentView==false || ( studentView==true && !preview)) { - retour += "<tr id='<?php p($tab[1][$i]) ?>' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\">" + retour += "<tr id='<?php p($room[0]) ?>' Onclick=\"OneClick('<?php p($room[0]) ?>')\">" if(studentView==false) { <?php - if(sizeof($archiveOfThisRoomID)>0) + if(sizeof($room[3])>0) { ?> numberArchive++; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td>"; - retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($tab[1][$i]) ?>hide')\" name=\"toggleimg<?php p($tab[1][$i]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td>"; + retour+="<td width=\"20px\" align=\"right\"><img src=\"pictures/plus.gif\" onclick=\"hideArchive('<?php p($room[0]) ?>hide')\" name=\"toggleimg<?php p($room[0]) ?>hide\" border=\"0\" alt=\"Expand/Collapse More Options\" /></td>"; <?php } else { ?> - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; <?php } ?> @@ -678,12 +679,12 @@ %> */ - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; - retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; + retour+="<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"> </td>"; } - retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><?php p($tab[1][$i+2]) ?></td>"; + retour += "<td width=\"545\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><?php p($room[1]) ?></td>"; if(!preview) { if(studentView==false) @@ -692,7 +693,7 @@ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } @@ -704,30 +705,31 @@ //retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($tab[1][$i]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($tab[1][$i]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($tab[1][$i]) ?>')\" onmouseout=\"onOut('<?php p($tab[1][$i]) ?>')\"></td></tr>"; + retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>"; <?php - if(sizeof($archiveOfThisRoomID)>0) + if(sizeof($room[3])>0) { ?> - retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($tab[1][$i]) ?>hide'>"; + retour+="<tr><td colspan=5 style=\"padding:0px 0px 0px 0px\"><div style=\"display:none\" id='<?php p($room[0]) ?>hide'>"; <?php - // $archiveOfThisRoomID=liveclassroom_api_get_archive_list_for_a_room($tab[1][$i],$teacherid); + ?> retour += " <table width=700px cellspacing=0 cellpadding=1 border=0 >"; - <?php for( $j=0; $j<sizeof($archiveOfThisRoomID); $j++) + <?php foreach($room[3] as $archive) + { /* if(orphanedArchive.ContainsKey(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId())) orphanedArchive.Remove(prefix+((LCRoom)archiveOfThisRoomID.GetByIndex(j)).getRoomId());*/ ?> var preview; - <?php if($archiveOfThisRoomID[$j][0]==1) - //if(!liveclassroom_api_room_is_preview($archiveOfThisRoomID[$j])) + <?php if($archive[2]==1) + { ?> preview=true; @@ -742,10 +744,10 @@ ?> if(studentView==false|| ( studentView==true && !preview)) { - retour += "<tr id='<?php p($archiveOfThisRoomID[$j][1]) ?>' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td>"; - retour += "<td width=310px Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\">"; + retour += "<tr id='<?php p($archive[0]) ?>' Onclick=\"OneClick('<?php p($archive[0]) ?>')\"><td width=\"40px\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td>"; + retour += "<td width=310px Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\">"; retour += "<span ><img src=\"<?php p($CFG->liveclassroom_servername)?>/images/integration/pointer.gif\" style=\"border:none\" />"; - retour += "<?php p($archiveOfThisRoomID[$j][2]) ?></td>"; + retour += "<?php p($archive[1]) ?></td>"; if(!preview) { if(studentView==false) @@ -755,7 +757,7 @@ } else { - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[1]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } } @@ -767,9 +769,9 @@ // retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"16px\" align=\"center\" Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archiveOfThisRoomID[$j][1]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archiveOfThisRoomID[$j][1]) ?>')\" onmouseout=\"onOut('<?php p($archiveOfThisRoomID[$j][1]) ?>')\"></td></tr>"; + retour +="</td><td width='100px' Onclick=\"OneClick('<?php p($archive[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($archive[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($archive[0]) ?>')\" onmouseout=\"onOut('<?php p($archive[0]) ?>')\"></td></tr>"; } <?php } @@ -802,50 +804,53 @@ } -/* + function getOrphanedArchive(search) { NumberOrphanedRoom=0; var retour=""; - retour += " <table width=460px cellspacing=0 border=0 >"; - <% for(i=0; i<orphanedArchive.Count; i++) + retour += " <table width=1000px cellspacing=0 cellpadding=1 border=0>"; + + <?php foreach($tab[2] as $room) + // for(i=0; i<orphanedArchive.Count; i++) { - %> - myString = new String("<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname().ToLower()%>"); + ?> + myString = new String("<?php p($room[1]) ?>"); mysearch=new String(search); - mysearch=mysearch.toLowerCase(); + // mysearch=mysearch.toLowerCase(); results = myString.match(mysearch); if(search==null || results!=null) { var preview; - <%if(((LCRoom)orphanedArchive.GetByIndex(i)).isPreview()) + <?php + if($room[2]==1) { - %> + ?> preview=true; - <% + <?php } else { - %> + ?> preview=false; - <% + <?php } - %> + ?> if(studentView==false|| ( studentView==true && !preview)) { - retour += "<tr id='<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\">"; - retour += "<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" ></td>"; - retour += "<td width=\"20px\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" ></td>"; + retour += "<tr id='<?php p($room[0]) ?>' Onclick=\"OneClick('<?php p($room[0]) ?>')\">"; + retour += "<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\" ></td>"; + retour += "<td width=\"20px\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\" ></td>"; - retour += "<td width=300px onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\">"; + retour += "<td width=300px onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\">"; - retour += "<%=((LCRoom)orphanedArchive.GetByIndex(i)).getLongname()%></td>"; + retour += "<?php p($room[1]) ?></td>"; if(!preview) { if(studentView==false) retour +="<td width=\"20px\" align=\"center\" ><a style='cursor:hand;' href=\"javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=closeRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; else - retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; + retour +="<td width=\"20px\" align=\"center\" Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/online.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\""; } else { @@ -855,15 +860,15 @@ retour +="alt=\"Change Availibility\" title=\"Change Availability\"></a>"; } else - retour +="<td width=\"20px\" align=\"center\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; + retour +="<td width=\"20px\" align=\"center\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"><img src=\"pictures/away.png\" style=\"WIDTH: 16px; HEIGHT: 16px\" border=\"0\"></a>"; } - retour +="</td><td width='100px' Onclick=\"OneClick('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" Ondblclick=\"javascript:startHorizon('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>', null, null, null, null, 'hzA=<%=AuthToken%>')\" onmouseover=\"onOver('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\" onmouseout=\"onOut('<%=prefix+((LCRoom)orphanedArchive.GetByIndex(i)).getRoomId()%>')\"></td></tr>"; + retour +="</td><td width='520px' Onclick=\"OneClick('<?php p($room[0]) ?>')\" Ondblclick=\"javascript:startHorizon('<?php p($room[0]) ?>', null, null, null, null, 'hzA=<?php p($usersession)?>')\" onmouseover=\"onOver('<?php p($room[0]) ?>')\" onmouseout=\"onOut('<?php p($room[0]) ?>')\"></td></tr>"; NumberOrphanedRoom++; } } - <% + <?php } - %> + ?>/* <% for(i=0; i<orphanedArchiveForStudent.Count; i++) { %> @@ -914,14 +919,14 @@ } <% } - %> + %>*/ retour += "</table>"; document.getElementById("orphaned").innerHTML = retour; - gestionDisplay(); + //gestionDisplay(); if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) correctPNG(); } -*/ + function gestionDisplay(type) { @@ -1249,8 +1254,7 @@ <td width="9%" align="center" > - <a href="javascript:doOpen(false,'','time=<%=session.getTimeOfLoad()%>&<%=session.url_params %>action=deleteRoom&signature=<%=Util.mD5Crypt(session.getSignature()+ Setup.getInstance().getHashKey())%>')" onclick=";return confirm('Are you sure to delete this room ?');" > - + <a href="javascript:doOpen(false,'','action=deleteRoom')" onclick=";return confirm('Are you sure to delete this room ?');" > <img src="pictures/delete_Black.png" border="0" alt="Delete Room" title="Delete Room" id="delete_icon" height="24" width="24"><br /> @@ -1334,7 +1338,7 @@ getMainLectureRoom(); getBreakoutRoom(); - //getOrphanedArchive(); + getOrphanedArchive(); if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-10-13 15:24:39
|
Revision: 88 http://svn.sourceforge.net/hw4mdl/?rev=88&view=rev Author: shazan Date: 2006-10-13 08:24:31 -0700 (Fri, 13 Oct 2006) Log Message: ----------- fix a bug for prefix Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-10-13 15:04:41 UTC (rev 87) +++ trunk/moodle/mod/liveclassroom/api.php 2006-10-13 15:24:31 UTC (rev 88) @@ -204,6 +204,7 @@ error( "Creation user failed, already exist"); return false; }*/ + if ( $respcode != 100 && $respcode != 301) { error( "Response: Account ($userId) Creation Failed: $resp_code"); return false; Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 15:04:41 UTC (rev 87) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 15:24:31 UTC (rev 88) @@ -198,10 +198,11 @@ global $LIVECLASSROOM_TEACHER_SUFFIX; global $LIVECLASSROOM_STUDENT_SUFFIX; global $LIVECLASSROOM_MOODLE_PREFIX; - //$userid = $CFG->liveclassroom_settinguniqueid."_".$course->id.$LIVECLASSROOM_TEACHER_SUFFIX; $userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.$LIVECLASSROOM_TEACHER_SUFFIX; + if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Teacher')) { + //error("Cannot Create Teacher profile"); return false; } @@ -209,6 +210,7 @@ $userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.$LIVECLASSROOM_STUDENT_SUFFIX; if (! liveclassroom_api_create_user ($userid, $course->shortname, 'Student')) { //error("Cannot Create Student profile"); + return false; } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-10-13 15:39:15
|
Revision: 87 http://svn.sourceforge.net/hw4mdl/?rev=87&view=rev Author: shazan Date: 2006-10-13 08:04:41 -0700 (Fri, 13 Oct 2006) Log Message: ----------- prefix are managed depending of the admin user name Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-10-13 13:48:08 UTC (rev 86) +++ trunk/moodle/mod/liveclassroom/api.php 2006-10-13 15:04:41 UTC (rev 87) @@ -43,7 +43,7 @@ require_once('System.php'); -$LIVECLASSROOM_MOODLE_PREFIX = '_moodle_'; +$LIVECLASSROOM_MOODLE_PREFIX = liveclassroom_api_get_prefix(); $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; @@ -1288,5 +1288,27 @@ return $table_result; } + +/* +* Get the prefix to use for creating rooms and users. +* +* return $prefix : a string which is the prefix to use +*/ +function liveclassroom_api_get_prefix() { + global $CFG; + + //get the admin user name + $aun = $CFG->liveclassroom_adminusername; + if( (substr($aun, 0,1)=='_') && (substr($aun, -1,1)=='_') ) { //Prefix + $prefix = $aun; + + } + else { + $prefix = ''; + + } + return $prefix; + +} ?> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 13:48:08 UTC (rev 86) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-13 15:04:41 UTC (rev 87) @@ -40,9 +40,6 @@ - - - /** * Validate the data in passed in the configuration page * @param $config - the information from the form mod.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-10-20 13:55:38
|
Revision: 92 http://svn.sourceforge.net/hw4mdl/?rev=92&view=rev Author: shazan Date: 2006-10-20 06:55:25 -0700 (Fri, 20 Oct 2006) Log Message: ----------- Added Paths: ----------- trunk/moodle/mod/liveclassroom/css/ trunk/moodle/mod/liveclassroom/css/StyleSheet.css trunk/moodle/mod/liveclassroom/js/ trunk/moodle/mod/liveclassroom/js/xmldom.js Added: trunk/moodle/mod/liveclassroom/css/StyleSheet.css =================================================================== --- trunk/moodle/mod/liveclassroom/css/StyleSheet.css (rev 0) +++ trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2006-10-20 13:55:25 UTC (rev 92) @@ -0,0 +1,241 @@ +body +{ background-color:#ffffff; + margin-top:0px; + margin-bottom:0px; + margin-right:0px; + margin-left:0px; + font-family: Verdana,Arial,Helvetica,sans-serif; + font-size:70%; +} +/* size remaining text relative to baseline */ +/* some indiv classes and elements have different sizes, later in doc */ +body a, +body table, body td, body th, +body p, body div, body li, body li li, +body input, body textarea, body select, body option ,td textarea +{font-size:100%;} + + + + +.page_title +{ +font-family: Verdana, Arial, Helvetica, sans-serif; +font-size:14px; +font-weight:bold; +color:#3c4b5b; +vertical-align: middle; +} +.area_title +{ +font-family: Verdana, Arial, Helvetica, sans-serif; +font-size:12px; +font-weight:bold; +color:#3c4b5b; +vertical-align: middle; +background-color:#c4cedc; + +padding-left:2px; +vertical-align:middle; +} + +table.tab +{ + margin-top:10px; + margin-left:20px; + width:100%; +} + +span.tab +{ + position: relative; + display: none; + height:190px +} +span.current_tab +{ + position: relative; + display: block; + height:190px +} +td.tab_Select +{ +background-image:url(pictures/tab_Select.gif); + background-repeat: no-repeat; + width: 78px; + font-size: 10pt; + font-family: Verdana; + } +h2 +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size:13px; + font-weight:bold; + color:#3c4b5b; + vertical-align: middle; +} + +tr.headcell td, tr.headcell th, .headcell { + border-left:1px solid #fff !important; + border-top:1px solid #fff !important; + color:#394859 !important; + background-color:#c4cedc !important; + font-weight:bold !important; + text-decoration:none !important; + text-align:left; + font-size:10px; +} + +/* color: fixed? */ +tr.subcell td, tr.subcell th, .subcell { + border-left:1px solid #ffffff; + border-top:1px solid #ffffff; + background-color:#e4eaef; + font-weight:normal; + color:black; + text-decoration:none; +} + +/* color: fixed? */ +tr.subcell2 td, tr.subcell2 th, .subcell2 { + border-left:1px solid #ffffff; + border-top:1px solid #ffffff; + background-color:#e4eaef; + font-weight:normal; + color:black; + text-decoration:none; +} +.datatable { + background-color:#ffffff; + border-left:1px solid #999; + border-top:1px solid #999; + border-right:2px solid #888; + border-bottom:2px solid #888; +} + + +/* color: white (fixed) */ +tr.oddRow td, tr.oddRow th, .oddRow { + border-left:1px solid #ffffff; + background-color:#fff; + font-weight:normal; + color:black; + text-decoration:none +} + +/* color: gray (fixed?) */ +tr.evenRow td, tr.evenRow th, .evenRow { + border-left:1px solid #ffffff; + background-color:#f0f0f0; + font-weight:normal; + color:black; + text-decoration:none +} +/* color: fixed */ +tr.divider td, tr.divider th, td.divider, th.divider, .divider { + border-bottom:1px solid #797979; +} +tr.divider2 td, tr.divider2 th, td.divider2, th.divider2, .divider2 { + border-bottom:1px solid #d9d9d9; +} +.clear,table.clear td,tr.clear,tr.clear td,table.clear { + border:none !important; +} + +a { +text-decoration:none; + color:Black; } + +a:hover { + text-decoration:none; + color:Black; } + +td.action,input.action{ + background-image:url(../pictures/general-empty.png); + background-repeat :no-repeat; + background-position:center; + text-decoration:none; + color:Black; +} +td.action:hover,input.action:hover{ + background-image:url(../pictures/general-empty-over.png); + background-repeat :no-repeat; + background-position:center; + text-decoration:none; + color:Black; +} +.alert +{ + color:Red; +} + + + +a.room { color:#889EB3; + +text-decoration:none; +display:block; +width:100%; + +} + +a.room:hover {color:#889EB3; + + + text-decoration:none; + border: none; + + background-position: 3px 4px; + +} + + +.info a{ + position:relative; /*this is the key*/ + z-index:24; + color:#000; + text-decoration:none} + +.info a:hover{z-index:25;text-decoration:underline;} + +.info a span{display: none;font-size:8pt;} + +.info a:hover span{ /*the span will display just on :hover state*/ + font-size:8pt; + display:block; + position:absolute; + top:1.5em; left:5em; width:28em; + border:1px solid #FFF99F; + background-color:#FFF99F; color:#000; + text-align: center} + + + +.button_disabled a{ color:#666666; + + text-decoration:none; + font-size: 9px; + +} +.button_disabled a:hover{ color:#666666; + + text-decoration:none; + font-size: 9px; + + +} + +.button_enabled a{ color:black; + + text-decoration:none; + font-size: 9px; + +} +.button_enabled a:hover{ color:black; + + text-decoration:none; + font-size: 9px; + display:block; + background-color:#d7d8d9; + cursor:hand; +} \ No newline at end of file Property changes on: trunk/moodle/mod/liveclassroom/css/StyleSheet.css ___________________________________________________________________ Name: svn:mime-type + text/css Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Added: trunk/moodle/mod/liveclassroom/js/xmldom.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/xmldom.js (rev 0) +++ trunk/moodle/mod/liveclassroom/js/xmldom.js 2006-10-20 13:55:25 UTC (rev 92) @@ -0,0 +1,1524 @@ +// ========================================================================= +// +// xmldom.js - an XML DOM parser in JavaScript. +// +// This is the classic DOM that has shipped with XML for <SCRIPT> +// since the beginning. For a more standards-compliant DOM, you may +// wish to use the standards-compliant W3C DOM that is included +// with XML for <SCRIPT> versions 3.0 and above +// +// version 3.1 +// +// ========================================================================= +// +// Copyright (C) 2000 - 2002, 2003 Michael Houghton (mi...@id...), Raymond Irving and David Joham (dj...@ya...) +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. + +// This library 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 +// Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +// Visit the XML for <SCRIPT> home page at http://xmljs.sourceforge.net +// + + +// ========================================================================= +// ========================================================================= +// ========================================================================= + +// CONSTANTS + +// ========================================================================= +// ========================================================================= +// ========================================================================= + +//define the characters which constitute whitespace, and quotes +var whitespace = "\n\r\t "; +var quotes = "\"'"; + + +// ========================================================================= +// ========================================================================= +// ========================================================================= + +// CONVENIENCE FUNCTIONS + +// ========================================================================= +// ========================================================================= +// ========================================================================= + + +function convertEscapes(str) { + /******************************************************************************************************************* + function: convertEscapes + + Author: David Joham <dj...@ya...> + + Description: + Characters such as less-than signs, greater-than signs and ampersands are + illegal in XML syntax and must be escaped before being inserted into the DOM. + This function is a convience function to take those escaped characters and + return them to their original values for processing outside the parser + + This XML Parser automagically converts the content of the XML elements to + their non-escaped values when xmlNode.getText() is called for every element + except CDATA. + + EXAMPLES: + + & == & + < == < + > == > + + *********************************************************************************************************************/ + // not all Konqueror installations have regex support for some reason. Here's the original code using regexes + // that is probably a little more efficient if it matters to you + /* + var escAmpRegEx = /&/g; + var escLtRegEx = /</g; + var escGtRegEx = />/g; + + str = str.replace(escAmpRegEx, "&"); + str = str.replace(escLtRegEx, "<"); + str = str.replace(escGtRegEx, ">"); + */ + var gt; + + //< + gt = -1; + while (str.indexOf("<", gt + 1) > -1) { + var gt = str.indexOf("<", gt + 1); + var newStr = str.substr(0, gt); + newStr += "<"; + newStr = newStr + str.substr(gt + 4, str.length); + str = newStr; + } + + //> + gt = -1; + while (str.indexOf(">", gt + 1) > -1) { + var gt = str.indexOf(">", gt + 1); + var newStr = str.substr(0, gt); + newStr += ">"; + newStr = newStr + str.substr(gt + 4, str.length); + str = newStr; + } + + //& + gt = -1; + while (str.indexOf("&", gt + 1) > -1) { + var gt = str.indexOf("&", gt + 1); + var newStr = str.substr(0, gt); + newStr += "&"; + newStr = newStr + str.substr(gt + 5, str.length); + str = newStr; + } + + return str; +} // end function convertEscapes + + +function convertToEscapes(str) { + /******************************************************************************************************************* + function: convertToEscapes + + Author: David Joham dj...@ya... + + Description: + Characters such as less-than signs, greater-than signs and ampersands are + illegal in XML syntax. This function is a convience function to escape those + characters out to there legal values. + + EXAMPLES: + + < == < + > == > + & == & + *********************************************************************************************************************/ + // not all Konqueror installations have regex support for some reason. Here's the original code using regexes + // that is probably a little more efficient if it matters to you + /* + var escAmpRegEx = /&/g; + var escLtRegEx = /</g; + var escGtRegEx = />/g; + str = str.replace(escAmpRegEx, "&"); + str = str.replace(escLtRegEx, "<"); + str = str.replace(escGtRegEx, ">"); + */ + + // start with & + var gt = -1; + while (str.indexOf("&", gt + 1) > -1) { + gt = str.indexOf("&", gt + 1); + var newStr = str.substr(0, gt); + newStr += "&"; + newStr = newStr + str.substr(gt + 1, str.length); + str = newStr; + } + + // now < + gt = -1; + while (str.indexOf("<", gt + 1) > -1) { + var gt = str.indexOf("<", gt + 1); + var newStr = str.substr(0, gt); + newStr += "<"; + newStr = newStr + str.substr(gt + 1, str.length); + str = newStr; + } + + //now > + gt = -1; + while (str.indexOf(">", gt + 1) > -1) { + var gt = str.indexOf(">", gt + 1); + var newStr = str.substr(0, gt); + newStr += ">"; + newStr = newStr + str.substr(gt + 1, str.length); + str = newStr; + } + + + return str; +} // end function convertToEscapes + + +function _displayElement(domElement, strRet) { + /******************************************************************************************************************* + function: _displayElement + + Author: dj...@ya... + + Description: + returns the XML string associated with the DOM element passed in + recursively calls itself if child elements are found + + *********************************************************************************************************************/ + if(domElement==null) { + return; + } + if(!(domElement.nodeType=='ELEMENT')) { + return; + } + + var tagName = domElement.tagName; + var tagInfo = ""; + tagInfo = "<" + tagName; + + // attributes + var attributeList = domElement.getAttributeNames(); + + for(var intLoop = 0; intLoop < attributeList.length; intLoop++) { + var attribute = attributeList[intLoop]; + tagInfo = tagInfo + " " + attribute + "="; + tagInfo = tagInfo + "\"" + domElement.getAttribute(attribute) + "\""; + } + + //close the element name + tagInfo = tagInfo + ">"; + + strRet=strRet+tagInfo; + + // children + if(domElement.children!=null) { + var domElements = domElement.children; + for(var intLoop = 0; intLoop < domElements.length; intLoop++) { + var childNode = domElements[intLoop]; + if(childNode.nodeType=='COMMENT') { + strRet = strRet + "<!--" + childNode.content + "-->"; + } + + else if(childNode.nodeType=='TEXT') { + var cont = trim(childNode.content,true,true); + strRet = strRet + childNode.content; + } + + else if (childNode.nodeType=='CDATA') { + var cont = trim(childNode.content,true,true); + strRet = strRet + "<![CDATA[" + cont + "]]>"; + } + + else { + strRet = _displayElement(childNode, strRet); + } + } // end looping through the DOM elements + } // end checking for domElements.children = null + + //ending tag + strRet = strRet + "</" + tagName + ">"; + return strRet; +} // end function displayElement + + +function firstWhiteChar(str,pos) { + /******************************************************************************************************************* + function: firstWhiteChar + + Author: ma...@ps... ? + + Description: + return the position of the first whitespace character in str after position pos + + *********************************************************************************************************************/ + if (isEmpty(str)) { + return -1; + } + + while(pos < str.length) { + if (whitespace.indexOf(str.charAt(pos))!=-1) { + return pos; + } + else { + pos++; + } + } + return str.length; +} // end function firstWhiteChar + + +function isEmpty(str) { + /******************************************************************************************************************* + function: isEmpty + + Author: mi...@id... + + Description: + convenience function to identify an empty string + + *********************************************************************************************************************/ + return (str==null) || (str.length==0); + +} // end function isEmpty + +function trim(trimString, leftTrim, rightTrim) { + /******************************************************************************************************************* + function: trim + + Author: ma...@ps... + + Description: + helper function to trip a string (trimString) of leading (leftTrim) + and trailing (rightTrim) whitespace + + *********************************************************************************************************************/ + if (isEmpty(trimString)) { + return ""; + } + + // the general focus here is on minimal method calls - hence only one + // substring is done to complete the trim. + + if (leftTrim == null) { + leftTrim = true; + } + + if (rightTrim == null) { + rightTrim = true; + } + + var left=0; + var right=0; + var i=0; + var k=0; + + // modified to properly handle strings that are all whitespace + if (leftTrim == true) { + while ((i<trimString.length) && (whitespace.indexOf(trimString.charAt(i++))!=-1)) { + left++; + } + } + if (rightTrim == true) { + k=trimString.length-1; + while((k>=left) && (whitespace.indexOf(trimString.charAt(k--))!=-1)) { + right++; + } + } + return trimString.substring(left, trimString.length - right); +} // end function trim + + + + + + + + + +// ========================================================================= +// ========================================================================= +// ========================================================================= +// XML DOC FUNCTIONS +// ========================================================================= +// ========================================================================= +// ========================================================================= + +function XMLDoc(source, errFn) { + /******************************************************************************************************************* + function: XMLDoc + + Author: mi...@id... + + Description: + a constructor for an XML document + source: the string containing the document + errFn: the (optional) function used to log errors + *********************************************************************************************************************/ + // stack for document construction + + this.topNode=null; + + // set up the properties and methods for this object + + this.errFn = errFn; // user defined error functions + + this.createXMLNode = _XMLDoc_createXMLNode; + this.error = _XMLDoc_error; + this.getUnderlyingXMLText = _XMLDoc_getUnderlyingXMLText; + this.handleNode = _XMLDoc_handleNode; + this.hasErrors = false; // were errors found during the parse? + this.insertNodeAfter = _XMLDoc_insertNodeAfter; + this.insertNodeInto = _XMLDoc_insertNodeInto; + this.loadXML = _XMLDoc_loadXML; + this.parse = _XMLDoc_parse; + this.parseAttribute = _XMLDoc_parseAttribute; + this.parseDTD = _XMLDoc_parseDTD; + this.parsePI = _XMLDoc_parsePI; + this.parseTag = _XMLDoc_parseTag; + this.removeNodeFromTree = _XMLDoc_removeNodeFromTree; + this.replaceNodeContents = _XMLDoc_replaceNodeContents; + this.selectNode = _XMLDoc_selectNode; + this.selectNodeText = _XMLDoc_selectNodeText; + this.source = source; // the string source of the document + + // parse the document + + if (this.parse()) { + // we've run out of markup - check the stack is now empty + if (this.topNode!=null) { + return this.error("expected close " + this.topNode.tagName); + } + else { + return true; + } + } +} // end function XMLDoc + + +function _XMLDoc_createXMLNode(strXML) { + /******************************************************************************************************************* + function: _XMLDoc_createXMLNode + + Author: dj...@ya... + + Description: + convienience function to create a new node that inherits + the properties of the document object + *********************************************************************************************************************/ + return new XMLDoc(strXML, this.errFn).docNode; + +} // end function _XMLDoc_createXMLNode + + +function _XMLDoc_error(str) { + /******************************************************************************************************************* + function: _XMLDoc_error + + Author: mi...@id... + + Description: + used to log an error in parsing or validating + *********************************************************************************************************************/ + + this.hasErrors=true; + if(this.errFn){ + this.errFn("ERROR: " + str); + }else if(this.onerror){ + this.onerror("ERROR: " + str); + } + return 0; + +} // end function _XMLDoc_error + + +function _XMLDoc_getTagNameParams(tag,obj){ + /******************************************************************************************************************* + function: _XMLDoc_getTagNameParams + + Author: xw...@ya... + + Description: + convienience function for the nodeSearch routines + *********************************************************************************************************************/ + var elm=-1,e,s=tag.indexOf('['); + var attr=[]; + if(s>=0){ + e=tag.indexOf(']'); + if(e>=0)elm=tag.substr(s+1,(e-s)-1); + else obj.error('expected ] near '+tag); + tag=tag.substr(0,s); + if(isNaN(elm) && elm!='*'){ + attr=elm.substr(1,elm.length-1); // remove @ + attr=attr.split('='); + if(attr[1]) { //remove " + s=attr[1].indexOf('"'); + attr[1]=attr[1].substr(s+1,attr[1].length-1); + e=attr[1].indexOf('"'); + if(e>=0) attr[1]=attr[1].substr(0,e); + else obj.error('expected " near '+tag) + };elm=-1; + }else if(elm=='*') elm=-1; + } + return [tag,elm,attr[0],attr[1]] +} // end function _XMLDoc_getTagNameParams + + +function _XMLDoc_getUnderlyingXMLText() { + /******************************************************************************************************************* + function: _XMLDoc_getUnderlyingXMLText + + Author: dj...@ya... + + Description: + kicks off the process that returns the XML text representation of the XML + document inclusive of any changes made by the manipulation of the DOM + *********************************************************************************************************************/ + var strRet = ""; + //for now, hardcode the xml version 1 information. When we handle Processing Instructions later, this + //should be looked at again + strRet = strRet + "<?xml version=\"1.0\"?>"; + if (this.docNode==null) { + return; + } + + strRet = _displayElement(this.docNode, strRet); + return strRet; + +} // end function _XMLDoc_getCurrentXMLText + + + +function _XMLDoc_handleNode(current) { + /******************************************************************************************************************* + function: _XMLDoc_handleNode + + Author: mi...@id... + + Description: + adds a markup element to the document + *********************************************************************************************************************/ + + if ((current.nodeType=='COMMENT') && (this.topNode!=null)) { + return this.topNode.addElement(current); + } + else if ((current.nodeType=='TEXT') || (current.nodeType=='CDATA')) { + + // if the current node is a text node: + + + // if the stack is empty, and this text node isn't just whitespace, we have + // a problem (we're not in a document element) + + if(this.topNode==null) { + if (trim(current.content,true,false)=="") { + return true; + } + else { + return this.error("expected document node, found: " + current); + } + } + else { + // otherwise, append this as child to the element at the top of the stack + return this.topNode.addElement(current); + } + + + } + else if ((current.nodeType=='OPEN') || (current.nodeType=='SINGLE')) { + // if we find an element tag (open or empty) + var success = false; + + // if the stack is empty, this node becomes the document node + + if(this.topNode==null) { + this.docNode = current; + current.parent = null; + success = true; + } + else { + // otherwise, append this as child to the element at the top of the stack + success = this.topNode.addElement(current); + } + + + if (success && (current.nodeType!='SINGLE')) { + this.topNode = current; + } + + // rename it as an element node + + current.nodeType = "ELEMENT"; + + return success; + } + + // if it's a close tag, check the nesting + + else if (current.nodeType=='CLOSE') { + + // if the stack is empty, it's certainly an error + + if (this.topNode==null) { + return this.error("close tag without open: " + current.toString()); + } + else { + + // otherwise, check that this node matches the one on the top of the stack + + if (current.tagName!=this.topNode.tagName) { + return this.error("expected closing " + this.topNode.tagName + ", found closing " + current.tagName); + } + else { + // if it does, pop the element off the top of the stack + this.topNode = this.topNode.getParent(); + } + } + } + return true; +} // end function _XMLDoc_handleNode + + + +function _XMLDoc_insertNodeAfter (referenceNode, newNode) { + /******************************************************************************************************************* + function: _XMLDoc_insertNodeAfter + + Author: dj...@ya... + + Description: + inserts a new XML node after the reference node; + + for example, if we insert the node <tag2>hello</tag2> + after tag1 in the xml <rootnode><tag1></tag1></rootnode> + we will end up with <rootnode><tag1></tag1><tag2>hello</tag2></rootnode> + + NOTE: the return value of this function is a new XMLDoc object!!!! + + *********************************************************************************************************************/ + + var parentXMLText = this.getUnderlyingXMLText(); + var selectedNodeXMLText = referenceNode.getUnderlyingXMLText(); + var originalNodePos = parentXMLText.indexOf(selectedNodeXMLText) + selectedNodeXMLText.length; + var newXML = parentXMLText.substr(0,originalNodePos); + newXML += newNode.getUnderlyingXMLText(); + newXML += parentXMLText.substr(originalNodePos); + var newDoc = new XMLDoc(newXML, this.errFn); + return newDoc; + +} // end function _XMLDoc_insertNodeAfter + + + +function _XMLDoc_insertNodeInto (referenceNode, insertNode) { + /******************************************************************************************************************* + function: _XMLDoc_insertNodeInto + + Author: mi...@id... + + Description: + inserts a new XML node into the reference node; + + for example, if we insert the node <tag2>hello</tag2> + into tag1 in the xml <rootnode><tag1><tag3>foo</tag3></tag1></rootnode> + we will end up with <rootnode><tag1><tag2>hello</tag2><tag3>foo</tag3></tag1></rootnode> + + NOTE: the return value of this function is a new XMLDoc object!!!! + *********************************************************************************************************************/ + + var parentXMLText = this.getUnderlyingXMLText(); + var selectedNodeXMLText = referenceNode.getUnderlyingXMLText(); + var endFirstTag = selectedNodeXMLText.indexOf(">") + 1; + var originalNodePos = parentXMLText.indexOf(selectedNodeXMLText) + endFirstTag; + var newXML = parentXMLText.substr(0,originalNodePos); + newXML += insertNode.getUnderlyingXMLText(); + newXML += parentXMLText.substr(originalNodePos); + var newDoc = new XMLDoc(newXML, this.errFn); + return newDoc; + + +} // end function _XMLDoc_insertNodeInto + +function _XMLDoc_loadXML(source){ + /******************************************************************************************************************* + function: _XMLDoc_insertNodeInto + + Author: xw...@ya... + + Description: + allows an already existing XMLDoc object to load XML + *********************************************************************************************************************/ + this.topNode=null; + this.hasErrors = false; + this.source=source; + // parse the document + return this.parse(); + +} // end function _XMLDoc_loadXML + +function _XMLDoc_parse() { + /******************************************************************************************************************* + function: _XMLDoc_parse + + Author: mi...@id... + + Description: + scans through the source for opening and closing tags + checks that the tags open and close in a sensible order + *********************************************************************************************************************/ + + var pos = 0; + + // set up the arrays used to store positions of < and > characters + + err = false; + + while(!err) { + var closing_tag_prefix = ''; + var chpos = this.source.indexOf('<',pos); + var open_length = 1; + + var open; + var close; + + if (chpos ==-1) { + break; + } + + open = chpos; + + // create a text node + + var str = this.source.substring(pos, open); + + if (str.length!=0) { + err = !this.handleNode(new XMLNode('TEXT',this, str)); + } + + // handle Programming Instructions - they can't reliably be handled as tags + + if (chpos == this.source.indexOf("<?",pos)) { + pos = this.parsePI(this.source, pos + 2); + if (pos==0) { + err=true; + } + continue; + } + + // nobble the document type definition + + if (chpos == this.source.indexOf("<!DOCTYPE",pos)) { + pos = this.parseDTD(this.source, chpos+ 9); + if (pos==0) { + err=true; + } + continue; + } + + // if we found an open comment, we need to ignore angle brackets + // until we find a close comment + + if(chpos == this.source.indexOf('<!--',pos)) { + open_length = 4; + closing_tag_prefix = '--'; + } + + // similarly, if we find an open CDATA, we need to ignore all angle + // brackets until a close CDATA sequence is found + + if (chpos == this.source.indexOf('<![CDATA[',pos)) { + open_length = 9; + closing_tag_prefix = ']]'; + } + + // look for the closing sequence + + chpos = this.source.indexOf(closing_tag_prefix + '>',chpos); + if (chpos ==-1) { + return this.error("expected closing tag sequence: " + closing_tag_prefix + '>'); + } + + close = chpos + closing_tag_prefix.length; + + // create a tag node + + str = this.source.substring(open+1, close); + + var n = this.parseTag(str); + if (n) { + err = !this.handleNode(n); + } + + pos = close +1; + + // and loop + + } + return !err; + +} // end function _XMLDoc_parse + + + +function _XMLDoc_parseAttribute(src,pos,node) { + /******************************************************************************************************************* + function: _XMLDoc_parseAttribute + + Author: mi...@id... + + Description: + parse an attribute out of a tag string + + *********************************************************************************************************************/ + + // chew up the whitespace, if any + + while ((pos<src.length) && (whitespace.indexOf(src.charAt(pos))!=-1)) { + pos++; + } + + // if there's nothing else, we have no (more) attributes - just break out + + if (pos >= src.length) { + return pos; + } + + var p1 = pos; + + while ((pos < src.length) && (src.charAt(pos)!='=')) { + pos++; + } + + var msg = "attributes must have values"; + + // parameters without values aren't allowed. + + if(pos >= src.length) { + return this.error(msg); + } + + // extract the parameter name + + var paramname = trim(src.substring(p1,pos++),false,true); + + // chew up whitespace + + while ((pos < src.length) && (whitespace.indexOf(src.charAt(pos))!=-1)) { + pos++; + } + + // throw an error if we've run out of string + + if (pos >= src.length) { + return this.error(msg); + } + + msg = "attribute values must be in quotes"; + + // check for a quote mark to identify the beginning of the attribute value + + var quote = src.charAt(pos++); + + // throw an error if we didn't find one + + if (quotes.indexOf(quote)==-1) { + return this.error(msg); + } + + p1 = pos; + + while ((pos < src.length) && (src.charAt(pos)!=quote)) { + pos++; + } + + // throw an error if we found no closing quote + + if (pos >= src.length) { + return this.error(msg); + } + + // store the parameter + + if (!node.addAttribute(paramname,trim(src.substring(p1,pos++),false,true))) { + return 0; + } + + return pos; + +} //end function _XMLDoc_parseAttribute + + + +function _XMLDoc_parseDTD(str,pos) { + /******************************************************************************************************************* + function: _XMLDoc_parseDTD + + Author: mi...@id... + + Description: + parse a document type declaration + + NOTE: we're just going to discard the DTD + + *********************************************************************************************************************/ + // we're just going to discard the DTD + + var firstClose = str.indexOf('>',pos); + + if (firstClose==-1) { + return this.error("error in DTD: expected '>'"); + } + + var closing_tag_prefix = ''; + + var firstOpenSquare = str.indexOf('[',pos); + + if ((firstOpenSquare!=-1) && (firstOpenSquare < firstClose)) { + closing_tag_prefix = ']'; + } + + while(true) { + var closepos = str.indexOf(closing_tag_prefix + '>',pos); + + if (closepos ==-1) { + return this.error("expected closing tag sequence: " + closing_tag_prefix + '>'); + } + + pos = closepos + closing_tag_prefix.length +1; + + if (str.substring(closepos-1,closepos+2) != ']]>') { + break; + } + } + return pos; + +} // end function _XMLDoc_ParseDTD + + +function _XMLDoc_parsePI(str,pos) { + /******************************************************************************************************************* + function: _XMLDoc_parsePI + + Author: mi...@id... + + Description: + parse a processing instruction + + NOTE: we just swallow them up at the moment + + *********************************************************************************************************************/ + // we just swallow them up + + var closepos = str.indexOf('?>',pos); + return closepos + 2; + +} // end function _XMLDoc_parsePI + + + +function _XMLDoc_parseTag(src) { + /******************************************************************************************************************* + function: _XMLDoc_parseTag + + Author: mi...@id... + + Description: + parse out a non-text element (incl. CDATA, comments) + handles the parsing of attributes + *********************************************************************************************************************/ + + // if it's a comment, strip off the packaging, mark it a comment node + // and return it + + if (src.indexOf('!--')==0) { + return new XMLNode('COMMENT', this, src.substring(3,src.length-2)); + } + + // if it's CDATA, do similar + + if (src.indexOf('![CDATA[')==0) { + return new XMLNode('CDATA', this, src.substring(8,src.length-2)); + } + + var n = new XMLNode(); + n.doc = this; + + + if (src.charAt(0)=='/') { + n.nodeType = 'CLOSE'; + src = src.substring(1); + } + else { + // otherwise it's an open tag (possibly an empty element) + n.nodeType = 'OPEN'; + } + + // if the last character is a /, check it's not a CLOSE tag + + if (src.charAt(src.length-1)=='/') { + if (n.nodeType=='CLOSE') { + return this.error("singleton close tag"); + } + else { + n.nodeType = 'SINGLE'; + } + + // strip off the last character + + src = src.substring(0,src.length-1); + } + + // set up the properties as appropriate + + if (n.nodeType!='CLOSE') { + n.attributes = new Array(); + } + + if (n.nodeType=='OPEN') { + n.children = new Array(); + } + + // trim the whitespace off the remaining content + + src = trim(src,true,true); + + // chuck out an error if there's nothing left + + if (src.length==0) { + return this.error("empty tag"); + } + + // scan forward until a space... + + var endOfName = firstWhiteChar(src,0); + + // if there is no space, this is just a name (e.g. (<tag>, <tag/> or </tag> + + if (endOfName==-1) { + n.tagName = src; + return n; + } + + // otherwise, we should expect attributes - but store the tag name first + + n.tagName = src.substring(0,endOfName); + + // start from after the tag name + + var pos = endOfName; + + // now we loop: + + while(pos< src.length) { + pos = this.parseAttribute(src, pos, n); + if (this.pos==0) { + return null; + } + + // and loop + + } + return n; + +} // end function _XMLDoc_parseTag + + + +function _XMLDoc_removeNodeFromTree(node) { + /******************************************************************************************************************* + function: _XMLDoc_removeNodeFromTree + + Author: dj...@ya... + + Description: + removes the specified node from the tree + + NOTE: the return value of this function is a new XMLDoc object + + *********************************************************************************************************************/ + + var parentXMLText = this.getUnderlyingXMLText(); + var selectedNodeXMLText = node.getUnderlyingXMLText(); + var originalNodePos = parentXMLText.indexOf(selectedNodeXMLText); + var newXML = parentXMLText.substr(0,originalNodePos); + newXML += parentXMLText.substr(originalNodePos + selectedNodeXMLText.length); + var newDoc = new XMLDoc(newXML, this.errFn); + return newDoc; +} // end function _XMLDoc_removeNodeFromTree + + + +function _XMLDoc_replaceNodeContents(referenceNode, newContents) { + /******************************************************************************************************************* + function: _XMLDoc_replaceNodeContents + + Author: dj...@ya... + + Description: + + make a node object out of the newContents text + coming in ---- + + The "X" node will be thrown away and only the children + used to replace the contents of the reference node + + NOTE: the return value of this function is a new XMLDoc object + + *********************************************************************************************************************/ + + var newNode = this.createXMLNode("<X>" + newContents + "</X>"); + referenceNode.children = newNode.children; + return this; +} // end function _XMLDoc_replaceNodeContents + + +function _XMLDoc_selectNode(tagpath){ + /******************************************************************************************************************* + function: _XMLDoc_selectNode + + Author: xw...@ya... + + Description: + selects a single node using the nodes tag path. + examples: /node1/node2 or /taga/tag1[0]/tag2 + *********************************************************************************************************************/ + + tagpath = trim(tagpath, true, true); + + var srcnode,node,tag,params,elm,rg; + var tags,attrName,attrValue,ok; + srcnode=node=((this.source)?this.docNode:this); + if (!tagpath) return node; + if(tagpath.indexOf('/')==0)tagpath=tagpath.substr(1); + tagpath=tagpath.replace(tag,''); + tags=tagpath.split('/'); + tag=tags[0]; + if(tag){ + if(tagpath.indexOf('/')==0)tagpath=tagpath.substr(1); + tagpath=tagpath.replace(tag,''); + params=_XMLDoc_getTagNameParams(tag,this); + tag=params[0];elm=params[1]; + attrName=params[2];attrValue=params[3]; + node=(tag=='*')? node.getElements():node.getElements(tag); + if (node.length) { + if(elm<0){ + srcnode=node;var i=0; + while(i<srcnode.length){ + if(attrName){ + if (srcnode[i].getAttribute(attrName)!=attrValue) ok=false; + else ok=true; + }else ok=true; + if(ok){ + node=srcnode[i].selectNode(tagpath); + if(node) return node; + } + i++; + } + }else if (elm<node.length){ + node=node[elm].selectNode(tagpath); + if(node) return node; + } + } + } +} // end function _XMLDoc_selectNode + +function _XMLDoc_selectNodeText(tagpath){ + /******************************************************************************************************************* + function: _XMLDoc_selectNodeText + + Author: xw...@ya... + + Description: + selects a single node using the nodes tag path and then returns the node text. + *********************************************************************************************************************/ + + var node=this.selectNode(tagpath); + if (node != null) { + return node.getText(); + } + else { + return null; + } +} // end function _XMLDoc_selectNodeText + + + + + + + + +// ========================================================================= +// ========================================================================= +// ========================================================================= +// XML NODE FUNCTIONS +// ========================================================================= +// ========================================================================= +// ========================================================================= + + +function XMLNode(nodeType,doc, str) { + /******************************************************************************************************************* + function: xmlNode + + Author: mi...@id... + + Description: + + XMLNode() is a constructor for a node of XML (text, comment, cdata, tag, etc) + + nodeType = indicates the node type of the node + doc == contains a reference to the XMLDoc object describing the document + str == contains the text for the tag or text entity + + *********************************************************************************************************************/ + + + // the content of text (also CDATA and COMMENT) nodes + if (nodeType=='TEXT' || nodeType=='CDATA' || nodeType=='COMMENT' ) { + this.content = str; + } + else { + this.content = null; + } + + this.attributes = null; // an array of attributes (used as a hash table) + this.children = null; // an array (list) of the children of this node + this.doc = doc; // a reference to the document + this.nodeType = nodeType; // the type of the node + this.parent = ""; + this.tagName = ""; // the name of the tag (if a tag node) + + // configure the methods + this.addAttribute = _XMLNode_addAttribute; + this.addElement = _XMLNode_addElement; + this.getAttribute = _XMLNode_getAttribute; + this.getAttributeNames = _XMLNode_getAttributeNames; + this.getElementById = _XMLNode_getElementById; + this.getElements = _XMLNode_getElements; + this.getText = _XMLNode_getText; + this.getParent = _XMLNode_getParent; + this.getUnderlyingXMLText = _XMLNode_getUnderlyingXMLText; + this.removeAttribute = _XMLNode_removeAttribute; + this.selectNode = _XMLDoc_selectNode; + this.selectNodeText = _XMLDoc_selectNodeText; + this.toString = _XMLNode_toString; + +} // end function XMLNode + + +function _XMLNode_addAttribute(attributeName,attributeValue) { + /******************************************************************************************************************* + function: _XMLNode_addAttribute + + Author: mi...@id... + + Description: + add an attribute to a node + *********************************************************************************************************************/ + + //if the name is found, the old value is overwritten by the new value + this.attributes['_' + attributeName] = attributeValue; + return true; + +} // end function _XMLNode_addAttribute + + + +function _XMLNode_addElement(node) { + /******************************************************************************************************************* + function: _XMLNode_addElement + + Author: mi...@id... + + Description: + add an element child to a node + *********************************************************************************************************************/ + node.parent = this; + this.children[this.children.length] = node; + return true; + +} // end function _XMLNode_addElement + + +function _XMLNode_getAttribute(name) { + /******************************************************************************************************************* + function: _XMLNode_getAttribute + + Author: mi...@id... + + Description: + get the value of a named attribute from an element node + + NOTE: we prefix with "_" because of the weird 'length' meta-property + + *********************************************************************************************************************/ + if (this.attributes == null) { + return null; + } + return this.attributes['_' + name]; +} // end function _XMLNode_getAttribute + + + +function _XMLNode_getAttributeNames() { + /******************************************************************************************************************* + function: _XMLNode_getAttributeNames + + Author: mi...@id... + + Description: + get a list of attribute names for the node + + NOTE: we prefix with "_" because of the weird 'length' meta-property + + NOTE: Version 1.0 of getAttributeNames breaks backwards compatibility. Previous to 1.0 + getAttributeNames would return null if there were no attributes. 1.0 now returns an + array of length 0. + + + *********************************************************************************************************************/ + if (this.attributes == null) { + var ret = new Array(); + return ret; + } + + var attlist = new Array(); + + for (var a in this.attributes) { + attlist[attlist.length] = a.substring(1); + } + return attlist; +} // end function _XMLNode_getAttributeNames + +function _XMLNode_getElementById(id) { + + /*********************************************************************************** + Function: getElementById + + Author: dj...@ya... + + Description: + Brute force searches through the XML DOM tree + to find the node with the unique ID passed in + + ************************************************************************************/ + var node = this; + var ret; + + //alert("tag name=" + node.tagName); + //alert("id=" + node.getAttribute("id")); + if (node.getAttribute("id") == id) { + return node; + } + else{ + var elements = node.getElements(); + //alert("length=" + rugrats.length); + var intLoop = 0; + //do NOT use a for loop here. For some reason + //it kills some browsers!!! + while (intLoop < elements.length) { + //alert("intLoop=" + intLoop); + var element = elements[intLoop]; + //alert("recursion"); + ret = element.getElementById(id); + if (ret != null) { + //alert("breaking"); + break; + } + intLoop++; + } + } + return ret; +} // end function _XMLNode_getElementById + + +function _XMLNode_getElements(byName) { + /******************************************************************************************************************* + function: _XMLNode_getElements + + Author: mi...@id... + + Description: + get an array of element children of a node + with an optional filter by name + + NOTE: Version 1.0 of getElements breaks backwards compatibility. Previous to 1.0 + getElements would return null if there were no attributes. 1.0 now returns an + array of length 0. + + + *********************************************************************************************************************/ + if (this.children==null) { + var ret = new Array(); + return ret; + } + + var elements = new Array(); + for (var i=0; i<this.children.length; i++) { + if ((this.children[i].nodeType=='ELEMENT') && ((byName==null) || (this.children[i].tagName == byName))) { + elements[elements.length] = this.children[i]; + } + } + return elements; +} // end function _XMLNode_getElements + + + +function _XMLNode_getText() { + /******************************************************************************************************************* + function: _XMLNode_getText + + Author: mi...@id... + + Description: + a method to get the text of a given node (recursively, if it's an element) + *********************************************************************************************************************/ + + if (this.nodeType=='ELEMENT') { + if (this.children==null) { + return null; + } + var str = ""; + for (var i=0; i < this.children.length; i++) { + var t = this.children[i].getText(); + str += (t == null ? "" : t); + } + return str; + } + else if (this.nodeType=='TEXT') { + return convertEscapes(this.content); + } + else { + return this.content; + } +} // end function _XMLNode_getText + + + +function _XMLNode_getParent() { + /******************************************************************************************************************* + function: _XMLNode_getParent + + Author: mi...@id... + + Description: + get the parent of this node + *********************************************************************************************************************/ + return this.parent; + +} // end function _XMLNode_getParent + + +function _XMLNode_getUnderlyingXMLText() { + /******************************************************************************************************************* + function: David Joham + + Author: dj...@ya... + + Description: + returns the underlying XML text for the node + by calling the _displayElement function + *********************************************************************************************************************/ + + var strRet = ""; + strRet = _displayElement(this, strRet); + return strRet; + +} // end function _XMLNode_getUnderlyingXMLText + + + +function _XMLNode_removeAttribute(attributeName) { + /******************************************************************************************************************* + function: _XMLNode_removeAttribute + + Author: dj...@ya... + + Description: + remove an attribute from a node + *********************************************************************************************************************/ + if(attributeName == null) { + return this.doc.error("You must pass an attribute name into the removeAttribute function"); + } + + //now remove the attribute from the list. + // I want to keep the logic for adding attribtues in one place. I'm + // going to get a temp array of attributes and values here and then + // use the addAttribute function to re-add the attributes + var attributes = this.getAttributeNames(); + var intCount = attributes.length; + var tmpAttributeValues = new Array(); + for ( intLoop = 0; intLoop < intCount; intLoop++) { + tmpAttributeValues[intLoop] = this.getAttribute(attributes[intLoop]); + } + + // now blow away the old attribute list + this.attributes = new Array(); + + //now add the attributes back to the array - leaving out the one we're removing + for (intLoop = 0; intLoop < intCount; intLoop++) { + if ( attributes[intLoop] != attributeName) { + this.addAttribute(attributes[intLoop], tmpAttributeValues[intLoop]); + } + } + +return true; + +} // end function _XMLNode_removeAttribute + + + +function _XMLNode_toString() { + /******************************************************************************************************************* + function: _XMLNode_toString + + Author: mi...@id... + + Description: + produces a diagnostic string description of a node + *********************************************************************************************************************/ + return "" + this.nodeType + ":" + (this.nodeType=='TEXT' || this.nodeType=='CDATA' || this.nodeType=='COMMENT' ? this.content : this.tagName); + +} // end function _XMLNode_toString + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: trunk/moodle/mod/liveclassroom/js/xmldom.js ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sh...@us...> - 2006-10-20 13:53:30
|
Revision: 91 http://svn.sourceforge.net/hw4mdl/?rev=91&view=rev Author: shazan Date: 2006-10-20 06:51:51 -0700 (Fri, 20 Oct 2006) Log Message: ----------- Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/config.html trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/manageRoom.php trunk/moodle/mod/liveclassroom/welcome.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/manageRoomAction.php trunk/moodle/mod/liveclassroom/pictures/ trunk/moodle/mod/liveclassroom/pictures/buttons/ trunk/moodle/mod/liveclassroom/pictures/buttons/angel.gif trunk/moodle/mod/liveclassroom/pictures/buttons/general-cancel.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-create.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty-over.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty.png trunk/moodle/mod/liveclassroom/pictures/buttons/general-saveall.png trunk/moodle/mod/liveclassroom/pictures/buttons/headerbar-logo.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-available.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-hide.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-show.png trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-unavailable.png trunk/moodle/mod/liveclassroom/pictures/buttons/new-createroom.png trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoiceboard.png trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoicepresentation.png trunk/moodle/mod/liveclassroom/pictures/buttons/searchfield.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab_disabled.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab_over.gif trunk/moodle/mod/liveclassroom/pictures/buttons/tab_select.gif trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-new.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newroom-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings-disabled.png trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings.png trunk/moodle/mod/liveclassroom/pictures/items/ trunk/moodle/mod/liveclassroom/pictures/items/category-collapsed.png trunk/moodle/mod/liveclassroom/pictures/items/category-expanded.png trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-left.png trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-middle.png trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-left.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-middle.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png trunk/moodle/mod/liveclassroom/pictures/items/filterbar-separator.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-logo.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-left.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-middle.png trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-right.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.png trunk/moodle/mod/liveclassroom/pictures/items/listitem-subitem.png trunk/moodle/mod/liveclassroom/pictures/items/space-16px.png trunk/moodle/mod/liveclassroom/pictures/items/space-16x16px.png trunk/moodle/mod/liveclassroom/pictures/items/space-18px.png trunk/moodle/mod/liveclassroom/pictures/items/space-24px.png trunk/moodle/mod/liveclassroom/pictures/items/space-32px.png trunk/moodle/mod/liveclassroom/pictures/items/space-44px.png trunk/moodle/mod/liveclassroom/pictures/items/toolbar-separator.png trunk/moodle/mod/liveclassroom/pictures/items/x_normal.gif trunk/moodle/mod/liveclassroom/pictures/items/x_normal.png trunk/moodle/mod/liveclassroom/pictures/items/x_over.gif trunk/moodle/mod/liveclassroom/pictures/items/x_over.png Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/api.php 2006-10-20 13:51:51 UTC (rev 91) @@ -99,12 +99,15 @@ "&AuthName=Horizon". "&credential_0=". $login. "&credential_1=". $passwd; + + add_to_log("", "liveclassroom", "", "", "auth ".time()); + - //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); - $cookie_file_path = $CFG->dirroot.'/mod/liveclassroom/tmp/cookie.txt'; // Cookie File path + $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); @@ -112,9 +115,10 @@ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); + // curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); - + $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date if (curl_errno($ch)) { print curl_error($ch); return false; @@ -127,6 +131,8 @@ return false; } + curl_close($ch); + fclose($cook); return $ch; } @@ -140,28 +146,39 @@ * return $data : result query */ function liveclassroom_api_send_query($const,$attribute) { - global $CFG; + global $CFG; global $LIVECLASSROOM_API_ADMIN; - $cookie_file_path = $CFG->dirroot.'/mod/liveclassroom/tmp/cookie.txt'; //Cookie File path + $cook = fopen($CFG->dataroot.'/tmp.txt',"a+"); //Open the temp file to check the last modification date + $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path - $currentTime = time(); - - if( (!file_exists($cookie_file_path)) || ($currentTime > (time(filemtime($cookie_file_path))+1800)) ){ - if (!$ch = liveclassroom_api_authenticate()) { - return false; - } - } + if(file_exists($cook)) { + $lastModifTime = filemtime($cook); + add_to_log("", "liveclassroom", "", "", "last modif time ".$lastModifTime); + } + else { + $lastModifTime = time(); + } + //1800 seconds = 30 minutes + $modif = $lastModifTime+1800; + + + if( (!file_exists($cookie_file_path)) || ((file_exists($cook)) && (time()>$modif)) ){ + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + } $url = $CFG->liveclassroom_servername. $LIVECLASSROOM_API_ADMIN. $const. - $attribute; + $attribute; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); @@ -574,7 +591,7 @@ if ( $respcode != 100) { return false; } - //modify in the moodle database! + return true; Modified: trunk/moodle/mod/liveclassroom/config.html =================================================================== --- trunk/moodle/mod/liveclassroom/config.html 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/config.html 2006-10-20 13:51:51 UTC (rev 91) @@ -38,15 +38,7 @@ <?php print_string("configadminpassword", "liveclassroom") ?> </td> </tr> -<tr valign="top"> - <td align="right"><?php print_string('settinguniqueid', 'liveclassroom')?>:</td> - <td> - <input name="settinguniqueid" type="text" size="20" value="<?php p($CFG->liveclassroom_settinguniqueid) ?>" /> - </td> - <td> - <?php print_string("configsettinguniqueid", "liveclassroom") ?> - </td> -</tr> + <tr> <td colspan="3" align="center"> <input type="submit" value="<?php print_string("savechanges") ?>" /></td> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-10-20 13:51:51 UTC (rev 91) @@ -264,18 +264,14 @@ $LIVECLASSROOM_STUDENT_SUFFIX; global $LIVECLASSROOM_MOODLE_PREFIX; - //Change for PREFIX + $course_name = liveclassroom_get_course_shortname($courseid); $roomid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.'_'.rand(); $teacherid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.$LIVECLASSROOM_TEACHER_SUFFIX; $studentid = $LIVECLASSROOM_MOODLE_PREFIX.$course_name.$LIVECLASSROOM_STUDENT_SUFFIX; - /* - if (! liveclassroom_api_remove_group_role ($roomid, 'RegisteredUser', 'Student')) { - //error('liveclassroom_create_room: Cannot remove Participant right to RegisteredUser'); - return false; - }*/ + if($bool==true) { // main lecture hall @@ -316,14 +312,7 @@ return false; } } - /* - //save this room in moodle database - $liveclassroom_rooms->course = $courseid; - $liveclassroom_rooms->name = $roomname; - $liveclassroom_rooms->room_id = $roomid; - liveclassroom_rooms_add_instance($liveclassroom_rooms); - */ return true; } Modified: trunk/moodle/mod/liveclassroom/manageRoom.php =================================================================== --- trunk/moodle/mod/liveclassroom/manageRoom.php 2006-10-16 13:02:41 UTC (rev 90) +++ trunk/moodle/mod/liveclassroom/manageRoom.php 2006-10-20 13:51:51 UTC (rev 91) @@ -35,15 +35,27 @@ global $CFG; - + //require_login($course->id); //$v = $_GET["v"]; $courseshortname = $_GET['courseshortname']; - //$id = $_GET['id']; $roomId = $_GET['roomId']; $action = $_GET['action']; $id = $_GET['id']; + + if (!isteacher($id)){ //not allowed + + } + + session_start(); + $room_info = liveclassroom_api_get_infos_room($roomId); + + + + // add_to_log("", "liveclassroom", "", "liveclassroom_api_modify_room", "debut ".time()); + // liveclassroom_api_modify_room($roomId,$room_info); + //add_to_log("", "liveclassroom", "", "liveclassroom_api_modify_room", "fin ".time()); ?> <head> @@ -157,21 +169,21 @@ document.getElementById('advanceopen'+hide).style.display="none"; if(show=="student"){ - document.getElementById('tab2').style.backgroundImage="url(pictures/tab_disabled.gif)"; + document.getElementById('tab2').style.backgroundImage="url(pictures/buttons/tab_disabled.gif)"; document.getElementById('tab2').onclick=new Function(); document.getElementById('tab2').onmouseover=new Function(); document.getElementById('tab2').onmouseout=new Function(); - document.getElementById('tab4').style.backgroundImage="url(pictures/tab_disabled.gif)"; + document.getElementById('tab4').style.backgroundImage="url(pictures/buttons/tab_disabled.gif)"; document.getElementById('tab4').onclick=new Function(); document.getElementById('tab4').onmouseover=new Function(); document.getElementById('tab4').onmouseout=new Function(); } else{ - document.getElementById('tab2').style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab2').style.backgroundImage="url(pictures/buttons/tab.gif)"; document.getElementById('tab2').onclick=new Function("onTab(2)"); document.getElementById('tab2').onmouseover=new Function("onOver(2)"); document.getElementById('tab2').onmouseout=new Function("onOut(2)"); - document.getElementById('tab4').style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab4').style.backgroundImage="url(pictures/buttons/tab.gif)"; document.getElementById('tab4').onclick=new Function("onTab(4)"); document.getElementById('tab4').onmouseover=new Function("onOver(4)"); document.getElementById('tab4').onmouseout=new Function("onOut(4)"); @@ -194,9 +206,9 @@ function onTab(id) { - document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab_Select.gif)"; + document.getElementById('tab'+id).style.backgroundImage="url(pictures/buttons/tab_Select.gif)"; document.getElementById('tab'+currenttab).style.borderBottom="#818181 1px solid"; - document.getElementById('tab'+currenttab).style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab'+currenttab).style.backgroundImage="url(pictures/buttons/tab.gif)"; document.getElementById('tab'+id).style.borderBottom="none"; document.getElementById('span'+currenttab).style.display="none"; document.getElementById('span'+id).style.display="block"; @@ -206,13 +218,13 @@ function onOver(id) { if(currenttab!=id) - document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab_over.gif)"; + document.getElementById('tab'+id).style.backgroundImage="url(pictures/buttons/tab_over.gif)"; } function onOut(id) { if(currenttab!=id) - document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab.gif)"; + document.getElementById('tab'+id).style.backgroundImage="url(pictures/buttons/tab.gif)"; } @@ -223,26 +235,9 @@ <body> -<form method="post" action="" name="entry_info_form" > +<form method="post" action="manageRoomAction.php" name="entry_info_form" > - - <input type="hidden" value='<?php echo $roomId ?>' name="roomId" /> - - <input type="hidden" value="<%=session.getTimeOfLoad() %>" name="time" /> - - - <? - if ($action == "editRoom") - {?> - <input type="hidden" value="updateRoom" name="action" /> - <? - } - else - { ?> - <input type="hidden" value="createRoom" name="action" /> - <? - } ?> - + <table cellspacing="0" cellpadding="0" width="100%" border=0 align="center" id="TABLE1" style="border-right: #818181 1px solid; border-top: #818181 1px solid; border-left: #818181 1px solid; border-bottom: #818181 1px solid"> <tr> @@ -250,7 +245,7 @@ <span style="position: relative; display: block;" > <table border="0" cellpadding="0" cellspacing="0" width=100%> <tr> - <td><img src="pictures/angel.gif" /></td> + <td><img src="pictures/buttons/angel.gif" /></td> <td colspan="3" align="center" valign="middle"> </td> @@ -271,26 +266,27 @@ <tr style="cursor:pointer"> <td width="5px" style="border-bottom: #818181 1px solid; height: 18px;"> </td> - <td onclick='onTab(1)' onmouseover='onOver(1)' onmouseout='onOut(1)' id="tab1" style="background-image: url(pictures/tab_Select.gif); + <td onclick='onTab(1)' onmouseover='onOver(1)' onmouseout='onOut(1)' id="tab1" style="background-image: url(pictures/buttons/tab_Select.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; height: 18px;" align="center"> Room Info</td> - <? if(!liveclassroom_api_room_is_archive($roomId) || ($roomId == "")) + <?php + if(($room_info['archive']!=1) || ($roomId == "")) {?> - <td onclick='onTab(2)' onmouseover='onOver(2)' onmouseout='onOut(2)' id="tab2" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <td onclick='onTab(2)' onmouseover='onOver(2)' onmouseout='onOut(2)' id="tab2" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Media</td> - <td onclick='onTab(3)' onmouseover='onOver(3)' onmouseout='onOut(3)' id="tab3" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <td onclick='onTab(3)' onmouseover='onOver(3)' onmouseout='onOut(3)' id="tab3" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Features</td> - <td onclick='onTab(4)' onmouseover='onOver(4)' onmouseout='onOut(4)'id="tab4" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <td onclick='onTab(4)' onmouseover='onOver(4)' onmouseout='onOut(4)'id="tab4" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Chat</td> - <?} ?> - <td onclick='onTab(5)' onmouseover='onOver(5)' onmouseout='onOut(5)' id="tab5" style="background-image: url(pictures/tab.gif); background-repeat: no-repeat; + <?php } ?> + <td onclick='onTab(5)' onmouseover='onOver(5)' onmouseout='onOut(5)' id="tab5" style="background-image: url(pictures/buttons/tab.gif); background-repeat: no-repeat; width: 79px; font-size: 10pt; font-family: Verdana; border-bottom: #818181 1px solid; height: 18px;" align="center"> Access</td> @@ -315,25 +311,28 @@ <td> <span class="alert">*</span> Title :</td> <td > - <input type="text" name="longname" value="<?php if($action=='editRoom') p(liveclassroom_api_get_room_name($roomId))?>" maxlength="50" style="width: 300px" /></td> + <input type="text" name="longname" value="<?php if($action=='editRoom') { p($room_info['longname']); $_SESSION['longname']=$room_info['longname'];}?>" maxlength="50" style="width: 300px" /></td> </tr> <tr> <td>Description :</td> <td> <textarea rows="4" cols="40" name="description"> - <?php if($action=='editRoom'){echo liveclassroom_api_get_room_description($roomId);}?> + <?php if($action=='editRoom'){p($room_info['description']);}?> </textarea> </td> </tr> - <? if (($roomId == "") || (liveclassroom_api_room_is_archive($roomId))==false) - { ?> + <?php + if(($room_info['archive']!=1) || ($roomId == "")) + {?> <tr> <td>Type :</td> <td> <input type="radio" name="led" value="instructor" id="led_instructor" <?php if(($action=="editRoom") && (liveclassroom_is_lecturehall($roomId,$courseshortname)==true)) - { echo "checked"; } - else{ echo "checked"; } + { $_SESSION['led']='instructor'; + echo "checked"; } + else{ + echo "checked"; } ?> onclick='javascript:toggleType();' /> <label for='led_instructor' > @@ -342,7 +341,7 @@ Instructors lead the presentation </label><br /> <input type="radio" name="led" value="student" id="led_student" onclick='javascript:toggleType();' <?php - if($action=="editRoom" && liveclassroom_is_breakout($roomId,$courseshortname)==true){ echo "checked"; } + if($action=="editRoom" && liveclassroom_is_breakout($roomId,$courseshortname)==true){ $_SESSION['led']='student'; echo "checked"; } ?> /> <label for='led_student' > @@ -351,7 +350,7 @@ Students and Instructors have the same rights </label> </td> </tr> - <?} ?> + <?php } ?> </table> </span> @@ -359,7 +358,7 @@ <table cellspacing="0" cellpadding="3" align="center" border="0" class="tab"> <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="audio" value="two-way-audio" onclick="doChangeMedia('audio');" + <input type="radio" name="media_type" id="audio" value="two-way-audio" onclick="doChangeMedia('audio');" <?php if($action=='editRoom') { if($room_info['media_type']=="two-way-audio"){ echo "checked";} } @@ -371,7 +370,7 @@ <tr> <td width=15px></td> <td> - <input type="checkbox" name="hmsSimulcastStudent" value="true" id="student_simulcast" + <input type="checkbox" name="hms_simulcast_restricted" value="1" id="student_simulcast" <?php if($action=='editRoom'){ if($room_info['hms_simulcast_restricted']==1){ @@ -392,7 +391,7 @@ <tr> <td width=15px></td> <td> - <input type="checkbox" name="hmsTwoWayEnabled" value="true" id='two_way_enabled' + <input type="checkbox" name="hms_two_way_enabled" value="1" id='two_way_enabled' <?php if($action=='editRoom'){ if($room_info['hms_two_way_enabled']==1){ @@ -411,7 +410,7 @@ <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="video" value='one-way-video' + <input type="radio" name="media_type" id="video" value='one-way-video' <?php if($action=='editRoom'){ if($room_info['media_type']=="one-way-video"){ echo " checked ";} @@ -445,7 +444,7 @@ <tr> <td colspan=2> - <input type="radio" name="mediaFormat" id="none" value="none" onclick="doChangeMedia('none');" + <input type="radio" name="media_type" id="none" value="none" onclick="doChangeMedia('none');" <?php if($action=='editRoom') { if($room_info['media_type']=="none") echo "checked"; @@ -466,10 +465,10 @@ <tr> <td> - <input type="checkbox" name="studentEboardEnabled" value="true" id="enable_eboard" + <input type="checkbox" name="student_wb_enabled" value="1" id="enable_eboard" <?php if($action=='editRoom'){ - if($room_info['student-wb-enabled']==1) echo "checked"; + if($room_info['student_wb_enabled']==1) echo "checked"; } ?>/> <label for="enable_eboard"> @@ -483,10 +482,10 @@ <tr> <td> - <input type="checkbox" name="studentLiveappEnabled" value="true" id="enable_liveapp" + <input type="checkbox" name="student_wb_liveapp" value="1" id="enable_liveapp" <?php if($action=='editRoom'){ - if($room_info['student-wb-liveapp']==1) echo "checked"; + if($room_info['student_wb_liveapp']==1) echo "checked"; } ?>/> <label for="enable_liveapp"> @@ -501,7 +500,7 @@ <tr> <td> - <input type="checkbox" name="archiveEnabled" value="true" id="enable_archive" + <input type="checkbox" name="can_archive" value="1" id="enable_archive" <?php if($action=='editRoom'){ if($room_info['can_archive']==1) echo "checked"; @@ -515,7 +514,7 @@ <tr> <td> - <input type="checkbox" name="appshareEnabled" value="true" id="enable_appshare" + <input type="checkbox" name="can_liveshare" value="1" id="enable_appshare" <?php if($action=='editRoom'){ if($room_info['can_liveshare']==1) echo "checked"; @@ -529,7 +528,7 @@ <tr> <td> - <input type="checkbox" name="pptEnabled" value="true" id="enable_ppt" + <input type="checkbox" name="can_ppt_import" value="1" id="enable_ppt" <?php if($action=='editRoom'){ if($room_info['can_ppt_import']==1) echo "checked"; @@ -549,7 +548,7 @@ <table cellspacing="0" cellpadding="3" align="center" border="0" class="tab"> <tr> <td colspan="2"> - <input type="checkbox" name="chatEnabled" value="true" id="chat_enable" + <input type="checkbox" name="chatenable" value="1" id="chat_enable" <?php if($action=='editRoom'){ if($room_info['chatenable']==1) echo "checked"; @@ -563,7 +562,7 @@ <tr> <td width="20"> </td> <td> - <input type="radio" name="privateChatEnabled" value="true" id="privateenabled" + <input type="radio" name="privatechatenable" value="1" id="privateenabled" <?php if($action=='editRoom'){ if($room_info['privatechatenable']==1) echo "checked"; @@ -577,7 +576,7 @@ <tr> <td width="20"> </td> <td> - <input type="radio" name="privateChatEnabled" value="false" id="privatedisabled" + <input type="radio" name="privatechatenable" value="0" id="privatedisabled" <?php if($action=='editRoom'){ if($room_info['privatechatenable']==0) echo "checked"; @@ -602,7 +601,7 @@ <tr> <td > - <input type="radio" name="userlimit" value="false" id="userlimit_false" onclick="toggleUserlimit(false);" + <input type="radio" name="userlimit" value="-1" id="userlimit_false" onclick="toggleUserlimit(false);" <?php if($action=='editRoom'){ if($room_info['userlimit']==-1) echo " checked "; @@ -614,15 +613,15 @@ </tr> <tr> <td > - <input type="radio" name="userlimit" value="true" id="userlimit_true" onclick='toggleUserlimit(true);' + <input type="radio" name="userlimitradio" value="true" id="userlimit_true" onclick='toggleUserlimit(true);' <?php if($action=='editRoom'){ - if($room_info['userlimit']=-1) echo "checked"; + if($room_info['userlimit']!=-1) echo "checked"; } ?>/> <label for="userlimit_true"> Limited:</label> - <input type="text" name="userlimitValue" value=' + <input type="text" name="userlimit" value=' <?php if(($action=='editRoom')&&($room_info['userlimit']!=-1)){ echo $room_info['userlimit']; @@ -683,18 +682,18 @@ <span class="alert">*</span>Required fields.</td> <td class=action align=center width=15%> - <input type="reset" value="<?php print_string("cancel") ?>" onclick="self.location.href='welcome.php?id=<?php p($id) ?>'"> - + <a href="welcome.php?id=<?php p($id) ?>" ><img src="pictures/buttons/general-cancel.png"></a> + </td> <td height="25px" class=action align=center width=15%> <?php if($action=='editRoom') { ?> - <a href="javascript:verifyFormUpdate()" >Update</a> + <a href="javascript:verifyFormUpdate()" ><img src="pictures/buttons/general-saveall.png"></a> <?php }else {?> - <a href="javascript:verifyForm()" >Save All</a> + <a href="javascript:verifyForm()" ><img src="pictures/buttons/general-create.png"></a> <?php } ?> </tr> @@ -703,5 +702,22 @@ </tr> </table> + + + <input type="hidden" value='<?php p($roomId) ?>' name="roomId" /> + + <input type="hidden" value='<?php p($id) ?>' name="courseid" /> + + <?php if($action=='editRoom') + { + ?> + <input type="hidden" value="updateRoom" name="action" /> + <?php + }else if($action=='createRoom') + { ?> + <input type="hidden" value="createRoom" name="action" /> + <?php } ?> + + </form> </body><script> toggleType()</script> \ No newline at end of file Added: trunk/moodle/mod/liveclassroom/manageRoomAction.php =================================================================== --- trunk/moodle/mod/liveclassroom/manageRoomAction.php (rev 0) +++ trunk/moodle/mod/liveclassroom/manageRoomAction.php 2006-10-20 13:51:51 UTC (rev 91) @@ -0,0 +1,99 @@ +<?php +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Samy Hazan * + * * + * Date: September 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + + + require_once('../../config.php'); + require_once('lib.php'); + + require_login($_POST['courseid'], false); + + if (isguest()) { + error("Guests are not allowed to create rooms", $_SERVER["HTTP_REFERER"]); + } + + if (isstudent($_POST['courseid'])) { + error("Students are not allowed to create rooms", $_SERVER["HTTP_REFERER"]); + } + + session_start(); + + while (list($key, $val) = each($_POST)) { + $list_attributes[$key] = $val; + } + //course id + $id = $_SESSION['id']; + + if(isteacher($_POST['courseid'])) { + + if($_POST['action']=='createRoom') { + if($list_attributes['led']=='instructor'){ + $bool = true; + } + else $bool = false; + + if (!liveclassroom_create_room ($id, $list_attributes['longname'], $bool)) { + notice(get_string("roomcreationfailed", "liveclassroom"), $_SERVER["HTTP_REFERER"]); + exit; + } + + } + else if($_POST['action']=='updateRoom') { + //Test if the type of room has changed + if($_SESSION['led']!=$list_attributes['led']) { // Type changed + add_to_log("", "liveclassroom", "", "", "change type ".time()); + if($list_attributes['led']=='instructor'){ + liveclassroom_api_remove_user_role ($_POST['roomId'], $_SESSION['studentid'] , 'Instructor') ; + liveclassroom_api_add_user_role ($_POST['roomId'], $_SESSION['studentid'], 'Student'); + } + else { + liveclassroom_api_remove_user_role ($_POST['roomId'], $_SESSION['studentid'] , 'Student') ; + liveclassroom_api_add_user_role ($_POST['roomId'], $_SESSION['studentid'], 'Instructor'); + } + } + + liveclassroom_api_modify_room($_POST['roomId'],$list_attributes); + /* + if($_SESSION['longname']!=$list_attributes['longname']) { //update in the moodle database + $liveclassroom_rooms->room_id = $_POST['roomId']; + $liveclassroom_rooms->course = $id; + $liveclassroom_rooms->name = $list_attributes['longname']; + + liveclassroom_rooms_update_instance($liveclassroom_rooms); + } + + */ + } + + redirect("welcome.php?id=$id"); + } + + + +?> \ No newline at end of file Property changes on: trunk/moodle/mod/liveclassroom/manageRoomAction.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Added: trunk/moodle/mod/liveclassroom/pictures/buttons/angel.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/angel.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-cancel.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-create.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-create.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty-over.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty-over.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-empty.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/general-saveall.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/general-saveall.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/headerbar-logo.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/headerbar-logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-available.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-available.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-hide.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-hide.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-show.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-show.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-unavailable.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/listitem-unavailable.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createroom.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createroom.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoiceboard.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoiceboard.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoicepresentation.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/new-createvoicepresentation.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/searchfield.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/searchfield.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_disabled.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_disabled.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_over.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_over.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_select.gif =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/tab_select.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-activities.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-availability.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-content.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-delete.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-launch.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-new.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-new.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newboard.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newroom-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-newroom-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-poll.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-schedule.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings-disabled.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings-disabled.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/buttons/toolbar-settings.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/category-collapsed.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/category-collapsed.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/category-expanded.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/category-expanded.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-left.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-left.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-middle.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-middle.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-left.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-left.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-middle.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-middle.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/filterbar-separator.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/filterbar-separator.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-logo.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-left.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-left.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-middle.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-middle.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-right.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/headerbar-searchfield-right.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/listitem-subitem.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/listitem-subitem.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-16px.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/space-16px.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-16x16px.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/space-16x16px.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-18px.png =================================================================== (Binary files differ) Property changes on: trunk/moodle/mod/liveclassroom/pictures/items/space-18px.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/moodle/mod/liveclassroom/pictures/items/space-24px.png ===... [truncated message content] |
From: <sh...@us...> - 2006-10-27 15:32:22
|
Revision: 95 http://svn.sourceforge.net/hw4mdl/?rev=95&view=rev Author: shazan Date: 2006-10-27 08:32:12 -0700 (Fri, 27 Oct 2006) Log Message: ----------- remove group possibility Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/mod.html Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-10-20 14:21:24 UTC (rev 94) +++ trunk/moodle/mod/liveclassroom/api.php 2006-10-27 15:32:12 UTC (rev 95) @@ -106,9 +106,10 @@ //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 - - + $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path + $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date + fputs($cook,time()); // Add the current time into the file = last authenticate time + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); @@ -118,7 +119,7 @@ // curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); - $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date + if (curl_errno($ch)) { print curl_error($ch); return false; @@ -132,7 +133,7 @@ } curl_close($ch); - fclose($cook); + //fclose($cook); return $ch; } @@ -149,20 +150,18 @@ global $CFG; global $LIVECLASSROOM_API_ADMIN; - $cook = fopen($CFG->dataroot.'/tmp.txt',"a+"); //Open the temp file to check the last modification date + $cook = $CFG->dataroot.'/tmp.txt'; //Open the temp file to check the last modification date $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path if(file_exists($cook)) { - $lastModifTime = filemtime($cook); - add_to_log("", "liveclassroom", "", "", "last modif time ".$lastModifTime); + $fileContent = file_get_contents($cook); } else { - $lastModifTime = time(); + $lastModifTime = 0; } //1800 seconds = 30 minutes - $modif = $lastModifTime+1800; - - + $modif = $fileContent+1800; + if( (!file_exists($cookie_file_path)) || ((file_exists($cook)) && (time()>$modif)) ){ if (!$ch = liveclassroom_api_authenticate()) { return false; @@ -191,7 +190,6 @@ return $data; } - Modified: trunk/moodle/mod/liveclassroom/mod.html =================================================================== --- trunk/moodle/mod/liveclassroom/mod.html 2006-10-20 14:21:24 UTC (rev 94) +++ trunk/moodle/mod/liveclassroom/mod.html 2006-10-27 15:32:12 UTC (rev 95) @@ -207,9 +207,9 @@ <!-- 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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
From: <sh...@us...> - 2006-11-23 16:31:07
|
Revision: 99 http://svn.sourceforge.net/hw4mdl/?rev=99&view=rev Author: shazan Date: 2006-11-23 08:30:56 -0800 (Thu, 23 Nov 2006) Log Message: ----------- new style for the message added Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/css/StyleSheet.css trunk/moodle/mod/liveclassroom/generateSettings.php trunk/moodle/mod/liveclassroom/js/xml.js Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-11-23 10:23:26 UTC (rev 98) +++ trunk/moodle/mod/liveclassroom/api.php 2006-11-23 16:30:56 UTC (rev 99) @@ -580,7 +580,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 !!!!! +* return true if the room has being modified, false otherwise */ function liveclassroom_api_modify_room($roomid,$table_attributes) { global $CFG; @@ -775,7 +775,7 @@ /* * 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() { @@ -803,7 +803,7 @@ /* * 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() { global $CFG; Modified: trunk/moodle/mod/liveclassroom/css/StyleSheet.css =================================================================== --- trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2006-11-23 10:23:26 UTC (rev 98) +++ trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2006-11-23 16:30:56 UTC (rev 99) @@ -363,4 +363,8 @@ { width:100%; border-bottom: #818181 1px solid; + } + .messageBar + { + background-color:#ffff99; } \ No newline at end of file Modified: trunk/moodle/mod/liveclassroom/generateSettings.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateSettings.php 2006-11-23 10:23:26 UTC (rev 98) +++ trunk/moodle/mod/liveclassroom/generateSettings.php 2006-11-23 16:30:56 UTC (rev 99) @@ -190,10 +190,17 @@ { $parameters['checked']=true; } + $linepart = $xmldoc->createElement('panelLinePart'); - $linepart->appendChild(liveclassroom_create_linepart_element($xmldoc,"all","input", $parameters)); + $linepart->appendChild(liveclassroom_create_linepart_element($xmldoc,"mainLectureRoom","input", $parameters)); $panelLine->appendChild($linepart); + $parameters=array("type" => "radio", "value" => "instructor", "id" => "led_instructor", "name" => "led", "onclick" => "toggleType(\"mainLectureRoom\")") ; + + $linepart->appendChild(liveclassroom_create_linepart_element($xmldoc,"discussionRoom","input", $parameters)); + $panelLine->appendChild($linepart); + + $linepart->appendChild(liveclassroom_create_linepart_element($xmldoc,$contextDisplay,"label", $parameters=array("for" => "led_instructor", "valign" => "top", "value" => "Lecture room" ) )); $panelLine->appendChild($linepart); Modified: trunk/moodle/mod/liveclassroom/js/xml.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/xml.js 2006-11-23 10:23:26 UTC (rev 98) +++ trunk/moodle/mod/liveclassroom/js/xml.js 2006-11-23 16:30:56 UTC (rev 99) @@ -216,8 +216,8 @@ break; } - display="<table cellspacing=0 cellpadding=0 bgcolor='yellow'>" - display+= "<tr >" + display="<table cellspacing=0 cellpadding=0>" + display+= "<tr>" display+= "<td><img src='pictures/items/messagelabel-info.png'></td>" display+= "<td>"+messageInformations[0].getElements("value")[0].getText()+"</td>"; display+= "</tr>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |