Revision: 213
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=213&view=rev
Author: trollinger
Date: 2008-01-11 08:45:39 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
start cleaning/refactoring
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/liveclassroom/config.html
branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaCommons.php
branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php
branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php
branches/team/Thomas/moodle/mod/liveclassroom/lib.php
branches/team/Thomas/moodle/mod/liveclassroom/mod.html
branches/team/Thomas/moodle/mod/liveclassroom/version.php
branches/team/Thomas/moodle/mod/liveclassroom/view.php
branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
Modified: branches/team/Thomas/moodle/mod/liveclassroom/config.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-01-11 16:45:39 UTC (rev 213)
@@ -10,22 +10,24 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Voice Tools Server Configuration </title>
-
+ <title>Live Classroom Server Configuration </title>
</head>
+
<style>
- .label_settings
+.label_settings
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
text-align:right;
}
- .comment
+
+.comment
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
text-align:right;
}
+
.page_title
{
font-family: Verdana, Arial, Helvetica, sans-serif;
@@ -35,6 +37,7 @@
vertical-align: middle;
}
</style>
+
<body>
<form method="post" action="module.php" name="form">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
Modified: branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -35,6 +35,7 @@
require_once ("lib.php");
require_once ("lib/lc/LCAction.php");
require_once ("lib/common/WimbaCommons.php");
+require_once ("lib/common/WimbaLib.php");
require_once ("lib/common/WimbaUI.php");
require_once ("lib/common/XmlRoom.php");
require_once ("lib/common/WimbaXml.php");
@@ -42,20 +43,19 @@
require_once ('lib/common/domxml-php4-php5.php');
}
-$courseid = optional_param('enc_course_id', 0, PARAM_INT);
-$action = required_param('action', PARAM_ALPHA);
-$time = required_param('time', PARAM_INT);
+$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaClassroomForm());
-if (!empty ($_POST)) {
- while (list ($key, $val) = each($_POST)) {
- $list_attributes[$key] = $val;
- }
+$params=array();
+foreach($keys as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ $params[$param["value"]] = $value;
}
-while (list ($key, $val) = each($_GET)) {
- $list_attributes[$key] = $val;
-}
-$session = new WimbaMoodleSession($list_attributes, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, $CFG->dataroot);
+$courseid = $params["enc_courseId"];
+require_login($courseid);
+$action = required_param('action', PARAM_ALPHA);
+
+$session = new WimbaMoodleSession($params, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, $CFG->dataroot);
$xml = new WimbaXml();
if ($session->error == false && $session != NULL) {
@@ -67,11 +67,12 @@
case "launch" :
$roomId = required_param('id', PARAM_SAFEDIR);
- if ($list_attributes["studentView"] == "true") {
+
+ if ($params["studentView"] == "true") {
$authToken = $api->getAuthokenNormal($session->getCourseId() . "_S", $session->getFirstname(), $session->getLastname());
} else {
$authToken = $api->getAuthoken();
- }
+ }
header('Location:' . $CFG->liveclassroom_servername . '/main/horizon_ui.pl.epl?channel=' . $roomId . '&hzA=' . $authToken);
exit;
break;
@@ -128,7 +129,7 @@
$roomId = required_param('id', PARAM_SAFEDIR);
$select_room = $api->getRoom($roomId);
- if ($list_attributes["studentView"] == "true" || $session->isInstructor() == false)
+ if ($params["studentView"] == "true" || $session->isInstructor() == false)
$xml->createPopupDialElement(get_string("popup_dial_title", "liveclassroom"), get_string("popup_dial_numbers", "liveclassroom"), get_string("popup_dial_pin", "liveclassroom"), null, $select_room->getParticipantPin(), $api->getPhoneNumbers());
else
$xml->createPopupDialElement(get_string("popup_dial_title", "liveclassroom"), get_string("popup_dial_numbers", "liveclassroom"), get_string("popup_dial_pin", "liveclassroom"), $select_room->getPresenterPin(), $select_room->getParticipantPin(), $api->getPhoneNumbers());
@@ -142,13 +143,12 @@
$id = $api->createRoom($roomId, "true");
break;
}
-
if ($action == "saveSettings") {
echo "good";
exit ();
}
- if (isset ($list_attributes["createWorkflow"]) && $list_attributes["createWorkflow"] == "true") {
+ if (isset ($params["createWorkflow"]) && $params["createWorkflow"] == "true") {
?>
<script>
parent.location.href="<?php echo $CFG->wwwroot . '/course/mod.php?section=0&sesskey=' . sesskey() . '&id=' . $session->getCourseId() . '&add=liveclassroom&roomId=' . $api->getPrefix().$id ?>"
@@ -156,9 +156,9 @@
<?
} else if ($action != "getDialInformation") {
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&messageAction=' . $messageAction . '&messageProduct=' . $messageProduct);
- }
+ header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&messageAction=' . $messageAction . '&messageProduct=' . $messageProduct);
+ }
} else {
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=session');
+// header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=session');
}
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -31,7 +31,7 @@
/// This page is to generate the list of rooms and archives
-error_reporting(E_ERROR);
+
require_once("../../config.php");
require_once("lib.php");
require_once("lib/lc/LCAction.php");
@@ -41,25 +41,20 @@
require_once("lib/common/XmlOrphanedArchive.php");
require_once("lib/common/XmlRoom.php");
require_once("lib/common/WimbaXml.php");
+require_once("lib/common/WimbaLib.php");
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/common/domxml-php4-php5.php');
}
-//TODO: Change this to be using (required|optional)_param
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $params[$key] = $val;
- }
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $params[$key] = $val;
- }
-
-}
+require_login($params["en_course_id"]);
if(isset($params["error"])){
$display=$uiManager->setError(get_string ($params["error"], 'liveclassroon'));
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -28,36 +28,30 @@
/* $Id: generateSettings.php 197 2007-08-29 14:30:36Z trollinger $ */
/// This page is to generate the settings of a room or archive
-error_reporting(E_ERROR);
+
require_once("../../config.php");
require_once("lib.php");
require_once("lib/lc/LCAction.php");
require_once("lib/common/WimbaXml.php");
require_once("lib/common/WimbaCommons.php");
+require_once("lib/common/WimbaLib.php");
require_once("lib/common/WimbaUI.php");
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/common/domxml-php4-php5.php');
}
-$action = optional_param('action', PARAM_ALPHA);
-
- $currentIdtab= optional_param('idtab', '',PARAM_ALPHA);
-
$params = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $params[$key] = $val;
- }
-
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $params[$key] = $val;
- }
-
-}
+require_login($params["enc_courseId"]);
+$action = optional_param('action', PARAM_ALPHA);
+$currentIdtab = optional_param('idtab', null, PARAM_ALPHA);
+
$session=new WimbaMoodleSession($params);
if($session->error==false)//good
{
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaCommons.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaCommons.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaCommons.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -50,8 +50,6 @@
ksort($parameters);
foreach ($parameters as $key => $value)
{
-
-
if (strstr($key, 'enc_'))//param use to signature
{
//put this params in a map to use after more easily and to sort
@@ -169,242 +167,8 @@
}
}
-function isSwitch(){
- global $USER;
-
- if((isset($USER->studentview) && $USER->studentview==1) || (!empty($USER->switchrole)) ) {
- return true;
- }
- return false;
-
-}
-function getRoleForWimbaTools($courseId,$userId){
- global $CFG;
- global $USER;
- $role="";
- if(strstr($CFG->release,"1.7")) {
- $context = get_context_instance(CONTEXT_COURSE, $courseId) ;
- }
-
- //the role of the current user is switched
- //the role of the current user is switched
- if((isset($USER->studentview) && $USER->studentview==1)||(isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id]>3)) {
- $role='StudentBis';
- } else{
-
- if(isstudent($courseId)) { //Student
- $role='Student';
- }
- else if (isadmin() || isteacher($courseId, $USER->id)) { // Admin, Teacher
- $role='Instructor';
- }
-
- if(strstr($CFG->release,"1.7")) { // 1.7.* version
- if (iscreator()) { // Course Creator
- $role='Instructor';
- }
- else if (!isteacheredit($courseId)) { // Non-editing Teacher
- $role='Student';
- }
- }
-
- }
-
- return $role;
-}
-
-/*
-* Give the parameters with the signature md5 to give to the frame
-* @param $courseid : the id of the current course
-* return a string with all the parameters to give to the url
-*/
-function get_url_params($courseid) {
-
- global $USER;
- global $CFG;
-
- $role=getRoleForWimbaTools($courseid,$USER->id);
- $signature = md5($courseid.$USER->email.$USER->firstname.$USER->lastname.$role);
- $url_params = "enc_courseId=".rawurlencode($courseid).
- "&enc_email=".rawurlencode($USER->email).
- "&enc_firstname=".rawurlencode($USER->firstname).
- "&enc_lastname=".rawurlencode($USER->lastname).
- "&enc_role=".rawurlencode($role).
- "&signature=".rawurlencode($signature);
- return $url_params;
-}
-
-
-/* list the element of the pictures directory
-* return a String wich contains the pictures separated by a ,
-*/
-function list_dir($name,&$s) {
-
- if ($dir = opendir($name)) {
-
- while($file = readdir($dir)) {
-
-
- if(is_dir($name."/".$file) && !in_array($file, array(".",".."))) {
-
- list_dir($name."/".$file,$s);
- }
- else if($file!="." && $file !="..") {
- $s.=$file.";";
- }
-
- }
-
- closedir($dir);
- }
-
-
-}
-
-function storeResource($rid,$courseId,$type,$name,$params=NULL){
- $voicetools->rid=$rid;
- $voicetools->course= $courseId;
- $voicetools->name= $name;
- $voicetools->type=$type;
- if($params!=null){
-
- if(isset($params["accessAvailable"]))
- {
- $voicetools->availability=1;
- }
- else
- {
- $voicetools->availability=0;
- }
- if(isset($params["start_date"]) && $params["start_date"]=="true"){
- if($params["start_hr"]=="--")
- {
- $start_hr=0;
- }
- else
- {
- $start_hr=intval($params["start_hr"]);
- }
- if($params["start_min"]=="--")
- {
- $start_min=0;
- }
- else
- {
- $start_min=intval($params["start_min"]);
- }
- $voicetools->start_date= mktime($start_hr, $start_min,0, intval($params["start_month"]),intval($params["start_day"]), intval($params["start_year"]));
-
-
-
-
- }
- else
- {
- $voicetools->start_date=-1;
- }
- if(isset($params["end_date"]) && $params["end_date"]=="true"){
- if($params["end_hr"]=="--")
- {
- $end_hr=0;
- }
- else
- {
- $end_hr=intval($params["end_hr"]);
- }
- if($params["end_min"]=="--")
- {
- $end_min=0;
- }
- else
- {
- $end_min=intval($params["start_min"]);
- }
-
- $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]),intval( $params["end_day"]), intval($params["end_year"]));
- }
- else
- {
- $voicetools->end_date="-1";
- }
- }
-
- return voicetools_store_new_element($voicetools);
-
-}
-function updateResource($rid,$courseId,$type,$params){
-
- $voicetools->rid=$rid;
- $voicetools->course= $courseId;
- $voicetools->type=$type;
- if(isset($params["accessAvailable"]))
- {
- $voicetools->availability=1;
- }
- else
- {
- $voicetools->availability=0;
- }
-
- if(isset($params["start_date"]) && $params["start_date"]=="true"){
-
- if($params["start_hr"]=="--")
- {
- $start_hr=0;
- }else
- {
- $start_hr=intval($params["start_hr"]);
- }
- if($params["start_min"]=="--")
- {
- $start_min=0;
- }
- else
- {
- $start_min=intval($params["start_min"]);
- }
- $voicetools->start_date=mktime($start_hr, $start_min,0, intval($params["start_month"]), intval($params["start_day"]), intval($params["start_year"]));
- }
- else
- {
- $voicetools->start_date=-1;
- }
- if(isset($params["end_date"]) && $params["end_date"]=="true"){
- if($params["end_hr"]=="--")
- {
- $end_hr=0;
- }
- else
- {
- $end_hr=intval($params["end_hr"]);
- }
- if($params["end_min"]=="--")
- {
- $end_min=0;
- }
- else
- {
- $end_min=intval($params["start_min"]);
- }
- $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]), intval($params["end_day"]), intval($params["end_year"]));
- }
- else
- {
- $voicetools->end_date="-1";
- }
- // $voicetools->id=$id;
-
- return voicetools_update_element($voicetools);
-
-}
-
-
-
-
-
-
class vtAction{
var $params;
@@ -888,8 +652,9 @@
return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights()) ;
}
+}
-}
+
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -108,69 +108,70 @@
$room->setBORShowRoomCarousels("0");
//discussion features
- if (isset ($this->session->request["archiveEnabled"]))
- $room->setArchiveEnabled("1");
- else
- $room->setArchiveEnabled("0");
+ //if (isset ($this->session->request["archiveEnabled"]))
+ $room->setArchiveEnabled($this->session->request["archiveEnabled"]);
+ // else
+ // $room->setArchiveEnabled("0");
- if (isset ($this->session->request["appshareEnabled"]))
- $room->setLiveShareEnabled("1");
- else
- $room->setLiveShareEnabled("0");
+ //if (isset ($this->session->request["appshareEnabled"]))
+ $room->setLiveShareEnabled($this->session->request["appshareEnabled"]);
+ // else
+ // $room->setLiveShareEnabled("0");
-
- if (isset ($this->session->request["pptEnabled"]))
- $room->setPptImportEnabled("1");
- else
- $room->setPptImportEnabled("0");
+
+ //if (isset ($this->session->request["pptEnabled"]))
+ $room->setPptImportEnabled($this->session->request["pptEnabled"]);
+ //else
+ //$room->setPptImportEnabled("0");
} else {
//media
- if (isset ($this->session->request["hms_two_way_enabled"])) {
- $room->setHmsTwoWayEnabled("1");
- } else {
- $room->setHmsTwoWayEnabled("0");
- }
- if (isset ($this->session->request["enable_student_video_on_startup"]))
- $room->setStudentVideoOnStartupEnabled("1");
- else
- $room->setStudentVideoOnStartupEnabled("0");
- if (isset ($this->session->request["hms_simulcast_restricted"]))
- $room->setHmsSimulcastRestricted("0");
- else
- $room->setHmsSimulcastRestricted("1");
+ //if (isset ($this->session->request["hms_two_way_enabled"])) {
+ $room->setHmsTwoWayEnabled($this->session->request["hms_two_way_enabled"]);
+ //} else {
+ //$room->setHmsTwoWayEnabled("0");
+ // }
+ //if (isset ($this->session->request["enable_student_video_on_startup"]))
+ $room->setStudentVideoOnStartupEnabled($this->session->request["enable_student_video_on_startup"]);
+ //else
+ //$room->setStudentVideoOnStartupEnabled("0");
+ //if (isset ($this->session->request["hms_simulcast_restricted"]))
+ $room->setHmsSimulcastRestricted($this->session->request["hms_simulcast_restricted"]);
+ //else
+ //$room->setHmsSimulcastRestricted("1");
$room->setVideoBandwidth($this->session->request["video_bandwidth"]);
//Chat
- if (isset ($this->session->request["chatEnabled"]))
- $room->setChatEnabled("1");
- else
- $room->setChatEnabled("0");
+ // if (isset ($this->session->request["chatEnabled"]))
+
+ $room->setChatEnabled($this->session->request["chatEnabled"]);
+ //else
+ //$room->setChatEnabled("0");
- if (isset ($this->session->request["privateChatEnabled"]))
- $room->setPrivateChatEnabled("1");
- else
- $room->setPrivateChatEnabled("0");
+// if (isset ($this->session->request["privateChatEnabled"]))
+ $room->setPrivateChatEnabled($this->session->request["privateChatEnabled"]);
+ // else
+ // $room->setPrivateChatEnabled("0");
//eBoard
- if (isset ($this->session->request["enabled_student_eboard"]))
- $room->setStudentWhiteboardEnabled("1");
- else
- $room->setStudentWhiteboardEnabled("0");
+ //if (isset ($this->session->request["enabled_student_eboard"]))
+ $room->setStudentWhiteboardEnabled($this->session->request["enabled_student_eboard"]);
+ // else
+ //$room->setStudentWhiteboardEnabled("0");
- if (isset ($this->session->request["enabled_breakoutrooms"]))
- $room->setBOREnabled("1");
- else
- $room->setBOREnabled("0");
+ //if (isset ($this->session->request["enabled_breakoutrooms"]))
+ $room->setBOREnabled($this->session->request["enabled_breakoutrooms"]);
+ //else
+ //$room->setBOREnabled("0");
- if (isset ($this->session->request["enabled_students_breakoutrooms"]))
- $room->setBORCarouselsPublic("1");
- else
- $room->setBORCarouselsPublic("0");
+ //if (isset ($this->session->request["enabled_students_breakoutrooms"]))
+ $room->setBORCarouselsPublic($this->session->request["enabled_students_breakoutrooms"]);
+ // else
+ //$room->setBORCarouselsPublic("0");
- if (isset ($this->session->request["enabled_students_mainrooms"]))
- $room->setBORShowRoomCarousels("1");
- else
- $room->setBORShowRoomCarousels("0");
+ //if (isset ($this->session->request["enabled_students_mainrooms"]))
+ $room->setBORShowRoomCarousels($this->session->request["enabled_students_mainrooms"]);
+ //else
+ // $room->setBORShowRoomCarousels("0");
//default features
$room->setArchiveEnabled("1");
@@ -179,15 +180,15 @@
}
//common features
- if (isset ($this->session->request["enabled_status"]))
- $room->setUserstatusEnabled("1");
- else
- $room->setUserstatusEnabled("0");
+ //if (isset ($this->session->request["enabled_status"]))
+ $room->setUserstatusEnabled($this->session->request["enabled_status"]);
+ //else
+ //$room->setUserstatusEnabled("0");
- if (isset ($this->session->request["status_appear"]))
- $room->setSendUserstatusUpdates("1");
- else
- $room->setSendUserstatusUpdates("0");
+ //if (isset ($this->session->request["status_appear"]))
+ $room->setSendUserstatusUpdates($this->session->request["status_appear"]);
+ //else
+ // $room->setSendUserstatusUpdates("0");
// $rooms->SEtP
@@ -250,7 +251,7 @@
function createSimpleRoom($longname, $lecture, $courseId) {
//room
- $id = $courseId . rand();
+ $id = $this->prefix.$courseId . rand();
$room = new LCRoom();
$room->setArguments($id, null, $longname, null, "0", "0");
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -407,7 +407,7 @@
}
}
- $params = "&target=".$this->prefix.$roomid . "&longname=$roomname" . $params;
+ $params = "&target=".$roomid . "&longname=$roomname" . $params;
$enc_params = str_replace(" ", "+", $params);
$response = $this->lcapi_send_query( LCAPI_FUNCTION_CREATE_CLASS, $enc_params);
@@ -439,7 +439,7 @@
if($userid!="Guest"){
$userid=$this->prefix.$userid;
}
- $response = $this->lcapi_send_query( LCAPI_FUNCTION_CREATE_ROLE, "&target=".$this->prefix.$roomid."&user_id=".$userid."&role_id=$role");
+ $response = $this->lcapi_send_query( LCAPI_FUNCTION_CREATE_ROLE, "&target=".$roomid."&user_id=".$userid."&role_id=$role");
preg_match("(\d*)", $response, $matches);
$respcode = $matches[0];
if ($respcode != 100) {
@@ -463,12 +463,12 @@
if($userid!="Guest"){
$userid=$this->prefix.$userid;
}
- $response = $this->lcapi_send_query( LCAPI_FUNCTION_DELETE_ROLE, "&target=".$this->prefix.$roomid."&user_id=".$userid."&role_id=$role");
+ $response = $this->lcapi_send_query( LCAPI_FUNCTION_DELETE_ROLE, "&target=".$roomid."&user_id=".$userid."&role_id=$role");
preg_match("(\d*)", $response, $matches);
$respcode = $matches[0];
if ($respcode != 100) {
$this->lcapi_error( LCAPI_ECRUD);
- error_log(__FUNCTION__ . ": Cannot Removed Role $role from userid $this->prefix.$userid in Class with id:".$this->prefix.$roomid);
+ error_log(__FUNCTION__ . ": Cannot Removed Role $role from userid $this->prefix.$userid in Class with id:".$roomid);
return false;
}
if ( LCAPI_DEBUG) {
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -408,105 +408,6 @@
return true;
}
-/**
- * Returns the LC userID of the student profile in the for this course
- *
- * @param $courseid - the id of the course
- * @return string - the LC user id of the student profile
- */
-function liveclassroom_get_student_userid ($courseid) {
- $course = get_record("course", "id", $courseid);
-
- if (empty($course)) {
- error(__FUNCTION__ . ": course not found.");
- }
-
- $enc_coursename = str_replace(" ", "_", $course->shortname);
-
- return LIVECLASSROOM_MOODLE_PREFIX . $enc_coursename . LIVECLASSROOM_STUDENT_SUFFIX;
-}
-
-
-/**
- * Returns the LC userID of the teacher profile in the for this course
- *
- * @param $courseid - the id of the course
- * @return string - the LC user id of the student profile
- */
-function liveclassroom_get_teacher_userid ($courseid){
- $course = get_record("course", "id", $courseid);
-
- if (empty($course)) {
- // error(__FUNCTION__ . ": course id empty");
- }
-
- $enc_coursename = str_replace(" ", "_", $course->shortname);
-
- return LIVECLASSROOM_MOODLE_PREFIX . $enc_coursename . LIVECLASSROOM_TEACHER_SUFFIX;
-}
-
-
-
-/**
- * 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) {
-
- liveclassroom_create_room($course->id, "Main Lecture Hall", true, liveclassroom_lectureroom_attributes());
- liveclassroom_create_room($course->id, "Group 1", false, liveclassroom_discussionroom_attributes());
- liveclassroom_create_room($course->id, "Group 2", false, liveclassroom_discussionroom_attributes());
- liveclassroom_create_room($course->id, "Group 3", false, liveclassroom_discussionroom_attributes());
-
- return true;
-}
-
-function liveclassroom_create_session ($course, $isteacher) {
- global $USER;
-$api=new LCApi();
- if($isteacher) {
- $userid = liveclassroom_get_teacher_userid($course->id);
- }
- else {
- $userid = liveclassroom_get_student_userid($course->id);
- }
-
- $nickname = fullname($USER);
-
- return $api->lcapi_get_session ($userid, $nickname);
-}
-
-
-/**
- * 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 number 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';
- }
-
-
/*
* Give the shortname for a courseid given
* @param $courseid : the id of the course
Modified: branches/team/Thomas/moodle/mod/liveclassroom/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-01-11 16:45:39 UTC (rev 213)
@@ -437,8 +437,7 @@
}
function TestNoRoom()
{
- <?php
- $teacherid = liveclassroom_get_teacher_userid($course->id);
+ <?php
$rooms = $lcApi->getRooms($course->id."_T");
if($rooms==false){
?>
@@ -842,7 +841,7 @@
<tr>
<td align="right" colspan="2" width="500px">
<div id="calendar">
- <table cellpadding=5 cellspacing="5" width="100%" >
+ <table cellpadding=5 cellspacing="5" width="100%">
<tr>
<td align=left colspan=2>
<input type="checkbox" value="true" id="calendar_event" name="calendar_event" onclick=hideCalendarEvent("check") <?php echo $checked." ".$disabledCheckbox ?>>
@@ -851,7 +850,7 @@
</tr>
<tr>
- <td align=right style="width:200px">
+ <td align=right style="width:220px">
<?php
if($course->format == "weeks" || $course->format == "weekscss"){?>
<select style="float:left" id="start_day" name= "start_day" onchange="change()" <?php echo $disableAllElements ?>>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/version.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/version.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/version.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -33,7 +33,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006041500; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2008011800; // The current module version (Date: YYYYMMDDXX)
$module->cron = 0; // Period for cron to check this module (secs)
?>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/view.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/view.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -33,24 +33,24 @@
require_once("../../config.php");
require_once("lib/lc/LCAction.php");
require_once("lib/common/WimbaCommons.php");
+require_once("lib/common/WimbaLib.php");
require_once("lib.php");
-$id = optional_param('id', 0, PARAM_INT);
-$a = optional_param('a', 0, PARAM_INT);// liveclassroom ID
-
-if ((isset($_GET["action"]) && $_GET["action"]!="launchCalendar" ) && $id || !isset($_GET["action"]) ) {
+$id = optional_param('id', 0, PARAM_INT);//instance id
+
+if ((isset($_GET["action"]) && $_GET["action"]!="launchCalendar" && $id) || !isset($_GET["action"]) ) {
if (! $cm = get_record("course_modules", "id", $id)) {
- error("Course Module ID was incorrect 1 ");
+ error("Course Module ID was incorrect");
}
if (! $course = get_record("course", "id", $cm->course)) {
error("Course is misconfigured");
}
if (! $liveclassroom = get_record("liveclassroom", "id", $cm->instance)) {
- error("Course module is incorrect1");
+ error("This Live Classroom instance doesn't exist");
}
} else {
if (! $liveclassroom = get_record("liveclassroom", "id", $id)) {
- error("Course module is incorrect2");
+ error("This Live Classroom instance doesn't exist");
}
if (! $course = get_record("course", "id", $liveclassroom->course)) {
error("Course is misconfigured");
@@ -73,15 +73,17 @@
$classid = $liveclassroom->type;
+//get the room
$room=$api->getRoom($classid);
$strliveclassrooms = get_string("modulenameplural", "liveclassroom");
$strliveclassroom = get_string("modulename", "liveclassroom");
-$strname = $liveclassroom->name;
-
+$strname = $liveclassroom->name;
+
+//create the breadcrump
$navigation = array();
- if ($course->id != SITEID) {
- $navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id";
+if ($course->id != SITEID) {
+ $navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id";
}
$navigation[$strliveclassrooms] = "$CFG->wwwroot/mod/liveclassroom/index.php?id=$course->id";
$navigation[$strname] = '';
@@ -96,27 +98,11 @@
}
$breadcrumb = implode(' -> ', $urls);
-print_header("$course->shortname: liveclassroom->name", "$course->fullname",
-"$breadcrumb",
-"", "", true, update_module_button($cm->id, $course->id, $strliveclassroom),
-navmenu($course, $cm));
+//print the header of the page (breadcrump + update button)
+print_header("$course->shortname: liveclassroom->name", $course->fullname,
+$breadcrumb, "", "", true, update_module_button($cm->id, $course->id, $strliveclassroom), navmenu($course, $cm));
?>
-
-<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script>
-<script type="text/javascript">
-
-function startLiveClassroom(){
- startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($authToken)?>');
-
-
-}
-
-
-</script>
-
-
-
<style>
a.list
{
@@ -203,8 +189,15 @@
}
</style>
+<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script>
+<script type="text/javascript">
+
+function startLiveClassroom(){
+ startHorizon('<?php p($classid) ?>',null,null,null,null,'hzA=<?php p($authToken)?>');
+}
+</script>
- <div style="border:solid 1px #808080;width:690px;height:400px;margin-left:20%;margin-top:5%">
+<div style="border:solid 1px #808080;width:690px;height:400px;margin-left:20%;margin-top:5%">
<div class="headerBar" id="headerBar">
<table cellpadding="0" cellspacing="0" width=100%>
<tbody>
@@ -229,7 +222,7 @@
</tbody>
</table>
</div>
- <div >
+ <div>
<table width=100% class="middle_panel">
<tbody>
<tr valign=middle align=center>
@@ -251,10 +244,9 @@
</tbody>
</table>
</div>
- <div>
- <table width=100% >
-
- <tr style="border-top:1px solid; background-color:#F0F0F0;">
+ <div>
+ <table width=100% >
+ <tr style="border-top:1px solid; background-color:#F0F0F0;">
<td align=left >
<img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.gif" /><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $cm->course;?>">
@@ -266,12 +258,11 @@
?></a>
</td>
- </td>
-
- </table>
+ </tr>
+ </table>
</div>
</div>
<?
-/// Finish the page
-print_footer($course);
+ /// Finish the page
+ rint_footer($course);
?>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-01-10 17:23:50 UTC (rev 212)
+++ branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-01-11 16:45:39 UTC (rev 213)
@@ -29,30 +29,25 @@
/* $Id: welcome.php 197 2007-08-29 14:30:36Z trollinger $ */
error_reporting(E_ERROR);
-/// This page is to display the tyes - Rooms and archives list
require_once("../../config.php");
require_once("lib.php");
+global $CFG;
+
$id = optional_param('id', 0, PARAM_INT);
-// $roomname = optional_param('idroomname', 0, PARAM_TEXT);
-
-global $CFG;
-
if (! $course = get_record("course", "id", $id)) {
error("Course ID is incorrect");
}
require_login($course->id);
-
-
?>
<html>
<head>
<title>Live ClassRooms</title>
</head>
- <link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
+<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
<script language="javascript" src="js/dojo/dojo.js"></script>
<script language="javascript" src="js/ajax.js"></script>
<script language="javascript" src="js/verifForm.js"></script>
@@ -64,10 +59,9 @@
<script src="js/ajaxslt/dom.js" type="text/javascript"></script>
<script src="js/ajaxslt/xpath.js" type="text/javascript"></script>
<script src="js/hwCommons.js" type="text/javascript"></script>
- <script src="js/xmldom.js" type="text/javascript"></script>
+<script src="js/xmldom.js" type="text/javascript"></script>
-
- <script type="text/javascript">
+<script type="text/javascript">
function doOpenAddActivity(url,param){
if(currentId!="") {
@@ -103,9 +97,9 @@
return display;
}
+//set the current product
+currentProduct="liveclassroom";
-
-
</script>
@@ -113,21 +107,14 @@
if(isset($_GET["createWorkflow"])){
$firstPage= "generateSettings.php";
$createWorkflow="true";
- ?>
- <script>
- currentProduct="liveclassroom";
- </script>
- <?php
}else{
$firstPage="generateListRooms.php";
$createWorkflow="false";
}
?>
<body onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ;?>','all','','','<?php echo $createWorkflow;?>');">
-
-
- <div id="all" style="display:block;border:solid 1px #808080;width:700px;height:400px;"></div>
- <div id="dialInfo" style="display:none;"></div>
+<div id="all" style="display:block;border:solid 1px #808080;width:700px;height:400px;"></div>
+<div id="dialInfo" style="display:none;"></div>
<div id="loading" style="display:none;border:solid 1px #808080;width:700px;height:400px">
<div class="headerBar" id="headerBar">
<table cellpadding="0" cellspacing="0" width=100%>
@@ -162,9 +149,9 @@
</div>
</div>
-<div class="tooltip" id="Tip" > ToolTip</div>
-<div style="display:none" id="pictures" >picture</div>
-<div id="hiddenDiv" class="opac"></div>
+<div class="tooltip" id="Tip">ToolTip</div>
+<div style="display:none" id="pictures">picture</div>
+<div id="hiddenDiv" class="opac"></div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|