Revision: 215
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=215&view=rev
Author: trollinger
Date: 2008-01-15 05:28:37 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
Continue the refactoring:
-clean some not used code
-review the management of the $POST and $GET variable
-add pictures
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/liveclassroom/config.html
branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css
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/index.php
branches/team/Thomas/moodle/mod/liveclassroom/lang/en/liveclassroom.php
branches/team/Thomas/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php
branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaLib.php
branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaUI.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/view.php
branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
Added Paths:
-----------
branches/team/Thomas/moodle/mod/liveclassroom/pictures/items/window-left.png
branches/team/Thomas/moodle/mod/liveclassroom/pictures/items/window-middle.png
branches/team/Thomas/moodle/mod/liveclassroom/pictures/items/window-right.png
branches/team/Thomas/moodle/mod/liveclassroom/pictures/items/window200_left.png
branches/team/Thomas/moodle/mod/liveclassroom/pictures/items/window200_middle.png
branches/team/Thomas/moodle/mod/liveclassroom/pictures/items/window200_right.png
Modified: branches/team/Thomas/moodle/mod/liveclassroom/config.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-01-15 13:28:37 UTC (rev 215)
@@ -7,12 +7,6 @@
$config = $lcApi->lcapi_get_status();
?>
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Live Classroom Server Configuration </title>
-</head>
-
<style>
.label_settings
{
@@ -38,7 +32,7 @@
}
</style>
-<body>
+
<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">
Modified: branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css 2008-01-15 13:28:37 UTC (rev 215)
@@ -9,12 +9,8 @@
font-size:8px;
}
-*
-{
- margin:0;
- padding:0;
-}
+
/*general html element*/
input
{
Modified: branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -82,7 +82,9 @@
$messageProduct = "room";
break;
case "update" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('id', PARAM_SAFEDIR);
+
+
$id = $api->createRoom($roomId, "true");
$messageAction = "updated";
$messageProduct = "room";
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -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");
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -28,7 +28,7 @@
/* $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");
@@ -60,6 +60,7 @@
$CFG->liveclassroom_adminusername,
$CFG->liveclassroom_adminpassword,$CFG->dataroot);
$roomId = required_param('id', PARAM_SAFEDIR );
+
$room_info = $api->getRoom($roomId);
if($room_info!=false){
Modified: branches/team/Thomas/moodle/mod/liveclassroom/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -30,14 +30,13 @@
/// This page lists all the instances of liveclassroom in a particular course
-
+error_reporting(E_ERROR);
require_once("../../config.php");
-
require_once("lib.php");
-
require_once("lib/common/WimbaCommons.php");
require_once("lib/common/WimbaLib.php");
+
$id = optional_param('id', 0, PARAM_INT);
$roomname = optional_param('idroomname', 0, PARAM_TEXT);
@@ -67,9 +66,7 @@
}
$breadcrumb = implode(' -> ', $urls);
-print_header("$course->shortname", "$course->fullname",
-"$breadcrumb",
-"", "", true, "","");
+print_header("$course->shortname", "$course->fullname","$breadcrumb", "", "", true, "","");
/// Get all the appropriate data
$url =get_url_params($course->id);
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lang/en/liveclassroom.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lang/en/liveclassroom.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lang/en/liveclassroom.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -54,11 +54,11 @@
$string['trailingHttp'] = 'The Live Classroom Server Name doesn\'t start with \'http://\'. Please add it and submit the configuration again.';
//Add activity form
$string["activity_name"]="Activity Name:";
-$string["duration_calendar"]="Duration";
-$string['name'] = 'Activity Name';
-$string['liveclassroomtype'] = 'Associated Room';
-$string['topicformat'] = 'Topic';
-$string['weeksformat'] = 'Week';
+$string["duration_calendar"]="Duration:";
+$string['name'] = 'Activity Name:';
+$string['liveclassroomtype'] = 'Associated Room:';
+$string['topicformat'] = 'Topic:';
+$string['weeksformat'] = 'Week:';
$string['required_fields'] = 'Required Fields';
$string['topicdisplay'] = 'Topic';
$string['firstsection'] = 'Section 0';
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -54,11 +54,11 @@
$string['trailingHttp'] = 'The Live Classroom Server Name doesn\'t start with \'http://\'. Please add it and submit the configuration again.';
//Add activity form
$string["activity_name"]="Activity Name:";
-$string["duration_calendar"]="Duration";
-$string['name'] = 'Activity Name';
-$string['liveclassroomtype'] = 'Associated Room';
-$string['topicformat'] = 'Topic';
-$string['weeksformat'] = 'Week';
+$string["duration_calendar"]="Duration:";
+$string['name'] = 'Activity Name:';
+$string['liveclassroomtype'] = 'Associated Room:';
+$string['topicformat'] = 'Topic:';
+$string['weeksformat'] = 'Week:';
$string['required_fields'] = 'Required Fields';
$string['topicdisplay'] = 'Topic';
$string['firstsection'] = 'Section 0';
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaLib.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaLib.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -29,24 +29,90 @@
array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>null),
array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>null),
array("value"=>"led","type"=>PARAM_ALPHA,"default_value"=>"instructor"),
- array("value"=>"hms_two_way_enabled","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"enable_student_video_on_startup","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"hms_simulcast_restricted","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"video_bandwidth","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"status_appear","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"enabled_breakoutrooms","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"archiveEnabled","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"appshareEnabled","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"pptEnabled","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"chatEnabled","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"privateChatEnabled","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"accessAvailable","type"=>PARAM_BOOL,"default_value"=>0),
- array("value"=>"privateChatEnabled","type"=>PARAM_BOOL,"default_value"=>0),
+ array("value"=>"hms_two_way_enabled","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"enable_student_video_on_startup","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"hms_simulcast_restricted","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"video_bandwidth","type"=>PARAM_CLEAN,"default_value"=>"medium"),
+ array("value"=>"status_appear","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"enabled_breakoutrooms","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"archiveEnabled","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"appshareEnabled","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"pptEnabled","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"chatEnabled","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"privateChatEnabled","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"accessAvailable","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"privateChatEnabled","type"=>PARAM_BOOL,"default_value"=>"0"),
array("value"=>"userlimit","type"=>PARAM_INT,"default_value"=>-1)
) ;
}
+function getListOfWeeks($course,$current){
+
+ $i=1;
+ $weekdate = $course->startdate; // this should be 0:00 Monday of that week
+ $weekdate += 7200; // Add two hours to avoid possible DST problems
+
+ $weekofseconds = 604800;
+ $course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
+ $string= '<OPTION selected value=0>Week 0 : Introduction section</OPTION>';
+
+ while ($weekdate < $course->enddate) {
+ $nextweekdate = $weekdate + ($weekofseconds);
+ $weekday = userdate($weekdate, '%d %b') ;
+ $endweekday = userdate($weekdate+518400, '%d %b');
+ if($current==$i)
+ {
+ $string.= '<OPTION selected value='.$i.'>'."Week ".$i." : ".$weekday.' - '.$endweekday.'</OPTION>';
+ }
+ else
+ {
+ $string .= '<OPTION value='.$i.'>'."Week ".$i." : ".$weekday.' - '.$endweekday.'</OPTION>';
+ }
+ $i++;
+ $weekdate = $nextweekdate;
+ }
+ return $string;
+}
+
+function getListOfTopics($course,$current){
+ $section = 0;
+ while ($section <= $course->numsections) {
+ if (!$thissection = get_record('course_sections', 'course',$course->id, 'section', $section)) {
+ notify('Error getting course_sections!');
+ }
+ $desc = format_text($thissection->summary, FORMAT_MOODLE, NULL, $course->id);
+ $descTxt = txt($desc);
+ $minidesc = substr($descTxt, 0, 20);
+
+ if ( ($thissection->summary != NULL) && (strlen($descTxt)>20) ) {
+ $minidesc .= "...";
+ }
+ else if ($thissection->summary == NULL){
+ $minidesc = "Topic";
+ }
+ if($current==$section)
+ {
+ echo '<OPTION selected value='.$section.'>'.$section.". ".$minidesc.'</OPTION>';
+ }
+ else
+ {
+ echo '<OPTION value='.$section.'>'.$section.". ".$minidesc.'</OPTION>';
+ }
+ $section++;
+ }
+
+
+
+}
+
+function txt($string){
+ $result = str_replace("<br />", "" ,$string);
+ $result = str_replace("<p>", "" ,$result);
+ $result = str_replace("</p>", "" ,$result);
+ return $result;
+}
+
function isSwitch(){
global $USER;
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaUI.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/common/WimbaUI.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -37,7 +37,7 @@
$this->currentObject = $object;
if($this->currentObject == null)
- $this->id=$this->prefix.$this->session->getCourseId() . rand();
+ $this->id=$this->session->getCourseId() . rand();
if ($product == "liveclassroom") {
if ($this->currentObject != null && $this->currentObject->isArchive()) {
@@ -410,24 +410,24 @@
$preview = $room->isPreview();
if ($room->isArchive() == 1) {
- $archive = new XmlArchive($this->prefix.$id, $name, $preview, "doAction.php", $this->session->url_params . "&time=" . time() . "&action=launch");
+ $archive = new XmlArchive($id, $name, $preview, "doAction.php", $this->session->url_params . "&time=" . time() . "&action=launch");
$archive->setTooltipAvailability(get_string("tooltipLC_".$preview."_student","liveclassroom"));
$archive->setTooltipDial(get_string("tooltip_dial","liveclassroom"));
list ($roomId, $other) = split('_', $id);
- $archives[$this->prefix.$roomId][] = $archive;
+ $archives[$roomId][] = $archive;
}
else {
if ($this->session->isInstructor() || !$this->session->isInstructor() && !$preview == 1) {
- $xmlRoom = new XmlRoom($this->prefix.$id, $name, true, $preview, null, "doAction.php", $this->session->url_params . "&time=" . time() . "&action=launch");
+ $xmlRoom = new XmlRoom($id, $name, true, $preview, null, "doAction.php", $this->session->url_params . "&time=" . time() . "&action=launch");
$xmlRoom->setTooltipAvailability(get_string("tooltipLC_".$preview."_student","liveclassroom"));
$xmlRoom->setTooltipDial(get_string("tooltip_dial","liveclassroom"));
- $liveclassroom[$this->prefix.$id] = $xmlRoom;
+ $liveclassroom[$id] = $xmlRoom;
}
}
}
@@ -651,7 +651,7 @@
$parameters = array (
"type" => "checkbox",
"name" => "hms_simulcast_restricted",
- "value" => "true",
+ "value" => "25",
"id" => "hms_simulcast_restricted"
);
if ($this->lectureRoom == "hiddenSetting")
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/LCAction.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -107,91 +107,41 @@
$room->setBORCarouselsPublic("0");
$room->setBORShowRoomCarousels("0");
- //discussion features
- //if (isset ($this->session->request["archiveEnabled"]))
- $room->setArchiveEnabled($this->session->request["archiveEnabled"]);
- // else
- // $room->setArchiveEnabled("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($this->session->request["pptEnabled"]);
- //else
- //$room->setPptImportEnabled("0");
+
+ $room->setArchiveEnabled($this->session->request["archiveEnabled"]);
+ $room->setLiveShareEnabled($this->session->request["appshareEnabled"]);
+ $room->setPptImportEnabled($this->session->request["pptEnabled"]);
+
} else {
//media
- //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->setHmsTwoWayEnabled($this->session->request["hms_two_way_enabled"]);
+ $room->setStudentVideoOnStartupEnabled($this->session->request["enable_student_video_on_startup"]);
+ if($this->session->request["hms_simulcast_restricted"]=="0")
+ $room->setHmsSimulcastRestricted("1");
+ else
+ $room->setHmsSimulcastRestricted("0");
$room->setVideoBandwidth($this->session->request["video_bandwidth"]);
//Chat
- // if (isset ($this->session->request["chatEnabled"]))
-
- $room->setChatEnabled($this->session->request["chatEnabled"]);
- //else
- //$room->setChatEnabled("0");
+
+ $room->setChatEnabled($this->session->request["chatEnabled"]);
+ $room->setPrivateChatEnabled($this->session->request["privateChatEnabled"]);
-// 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($this->session->request["enabled_student_eboard"]);
- // else
- //$room->setStudentWhiteboardEnabled("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($this->session->request["enabled_students_breakoutrooms"]);
- // else
- //$room->setBORCarouselsPublic("0");
-
- //if (isset ($this->session->request["enabled_students_mainrooms"]))
- $room->setBORShowRoomCarousels($this->session->request["enabled_students_mainrooms"]);
- //else
- // $room->setBORShowRoomCarousels("0");
-
- //default features
+ $room->setStudentWhiteboardEnabled($this->session->request["enabled_student_eboard"]);
+
+ $room->setBOREnabled($this->session->request["enabled_breakoutrooms"]);
+ $room->setBORCarouselsPublic($this->session->request["enabled_students_breakoutrooms"]);
+ $room->setBORShowRoomCarousels($this->session->request["enabled_students_mainrooms"]);
+
$room->setArchiveEnabled("1");
$room->setLiveShareEnabled("1");
$room->setPptImportEnabled("1");
}
//common features
- //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($this->session->request["status_appear"]);
- //else
- // $room->setSendUserstatusUpdates("0");
-
- // $rooms->SEtP
-
+ $room->setUserstatusEnabled($this->session->request["enabled_status"]);
+ $room->setSendUserstatusUpdates($this->session->request["status_appear"]);
//Maximum Users
if ($this->session->request["userlimit"] == "true")
@@ -224,9 +174,9 @@
}
} else {
-
+
$this->api->lcapi_create_class($roomId, $room->getLongname(), $room->getAttributes());
-
+
if ($this->session->request["led"] == "student") //student have same rights than teacher
$this->api->lcapi_add_user_role($roomId, $user_Student->getUserId(), "Instructor");
else
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib/lc/lcapi.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -160,27 +160,9 @@
global $_lcapi_errno;
return $_lcapi_errno;
}
+
+
/**
- * Initializes the lcapi package
- * @param $server = a string containing the url to the LC server
- * @param $login = the LC user ID of an administrator account
- * @param $password = the password for the $login account
- * @param $tmppath = a writeable, temporary folder
- * @return nothing
- */
- function lcapi_init($server, $login, $password, $tmppath = "") {
- global $_lcapi_config;
- if ( LCAPI_DEBUG) {
- error_log(__FUNCTION__ . " Initializing with ($server, $login, $password, $tmppath)");
- }
- $_lcapi_config->server = $server;
- $_lcapi_config->login = $login;
- $_lcapi_config->password = $password;
- $_lcapi_config->tmppath = $tmppath;
-
- return;
- }
- /**
* 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.
@@ -407,7 +389,7 @@
}
}
- $params = "&target=".$roomid . "&longname=$roomname" . $params;
+ $params = "&target=".$this->prefix.$roomid . "&longname=$roomname" . $params;
$enc_params = str_replace(" ", "+", $params);
$response = $this->lcapi_send_query( LCAPI_FUNCTION_CREATE_CLASS, $enc_params);
@@ -439,7 +421,7 @@
if($userid!="Guest"){
$userid=$this->prefix.$userid;
}
- $response = $this->lcapi_send_query( LCAPI_FUNCTION_CREATE_ROLE, "&target=".$roomid."&user_id=".$userid."&role_id=$role");
+ $response = $this->lcapi_send_query( LCAPI_FUNCTION_CREATE_ROLE, "&target=".$this->prefix.$roomid."&user_id=".$userid."&role_id=$role");
preg_match("(\d*)", $response, $matches);
$respcode = $matches[0];
if ($respcode != 100) {
@@ -463,7 +445,7 @@
if($userid!="Guest"){
$userid=$this->prefix.$userid;
}
- $response = $this->lcapi_send_query( LCAPI_FUNCTION_DELETE_ROLE, "&target=".$roomid."&user_id=".$userid."&role_id=$role");
+ $response = $this->lcapi_send_query( LCAPI_FUNCTION_DELETE_ROLE, "&target=".$this->prefix.$roomid."&user_id=".$userid."&role_id=$role");
preg_match("(\d*)", $response, $matches);
$respcode = $matches[0];
if ($respcode != 100) {
@@ -784,7 +766,7 @@
* and the value as the value of the attribute
*/
function lcapi_get_room_info($roomid) {
- $params = "&filter00=" . LCAPI_ATTR_CLASSID . "&filter00value=".$roomid."&attribute=" . LCAPI_ATTR_ARCHIVE . "&attribute=" . LCAPI_ATTR_CANARCH . "&attribute=" . LCAPI_ATTR_CANEBRD . "&attribute=" . LCAPI_ATTR_CANAPPSHR . "&attribute=" . LCAPI_ATTR_CANPPTIMPRT . "&attribute=" . LCAPI_ATTR_CHTNBL . "&attribute=" . LCAPI_ATTR_PRVTCHTNBL . "&attribute=" . LCAPI_ATTR_DESCR . "&attribute=" . LCAPI_ATTR_HMSSIMCAST . "&attribute=" . LCAPI_ATTR_HMSSIMCAST_RSTRD . "&attribute=" . LCAPI_ATTR_HMS_2WYENBLD . "&attribute=" . LCAPI_ATTR_MEDIATYPE . "&attribute=" . LCAPI_ATTR_PREVIEW . "&attribute=" . LCAPI_ATTR_STDNT_WBENBLD . "&attribute=" . LCAPI_ATTR_STDNT_WBLVAPP . "&attribute=" . LCAPI_ATTR_USRLIMT . "&attribute=" . LCAPI_ATTR_LONGNAME. "&attribute=" . LCAPI_ATTR_VIDEO_BANDWIDTH. "&attribute=" .LCAPI_ATTR_ENABLE_STUDENT_VIDEO_ON_STARTUP. "&attribute=" .LCAPI_ATTR_USERSTATUS_ENABLED. "&attribute=" .LCAPI_ATTR_SEND_USERSTATUS_UPDATES. "&attribute=" .LCAPI_ATTR_ENABLED. "&attribute=" .LCAPI_ATTR_CAROUSELS_PUBLIC. "&attribute=" .LCAPI_ATTR_SHOW_ROOM_CAROUSELS. "&attribute=" .LCAPI_ATTR_PARTICIPANT_PIN."&attribute=" .LCAPI_ATTR_PRESENTER_PIN;
+ $params = "&filter00=" . LCAPI_ATTR_CLASSID . "&filter00value=".$this->prefix.$roomid."&attribute=" . LCAPI_ATTR_ARCHIVE . "&attribute=" . LCAPI_ATTR_CANARCH . "&attribute=" . LCAPI_ATTR_CANEBRD . "&attribute=" . LCAPI_ATTR_CANAPPSHR . "&attribute=" . LCAPI_ATTR_CANPPTIMPRT . "&attribute=" . LCAPI_ATTR_CHTNBL . "&attribute=" . LCAPI_ATTR_PRVTCHTNBL . "&attribute=" . LCAPI_ATTR_DESCR . "&attribute=" . LCAPI_ATTR_HMSSIMCAST . "&attribute=" . LCAPI_ATTR_HMSSIMCAST_RSTRD . "&attribute=" . LCAPI_ATTR_HMS_2WYENBLD . "&attribute=" . LCAPI_ATTR_MEDIATYPE . "&attribute=" . LCAPI_ATTR_PREVIEW . "&attribute=" . LCAPI_ATTR_STDNT_WBENBLD . "&attribute=" . LCAPI_ATTR_STDNT_WBLVAPP . "&attribute=" . LCAPI_ATTR_USRLIMT . "&attribute=" . LCAPI_ATTR_LONGNAME. "&attribute=" . LCAPI_ATTR_VIDEO_BANDWIDTH. "&attribute=" .LCAPI_ATTR_ENABLE_STUDENT_VIDEO_ON_STARTUP. "&attribute=" .LCAPI_ATTR_USERSTATUS_ENABLED. "&attribute=" .LCAPI_ATTR_SEND_USERSTATUS_UPDATES. "&attribute=" .LCAPI_ATTR_ENABLED. "&attribute=" .LCAPI_ATTR_CAROUSELS_PUBLIC. "&attribute=" .LCAPI_ATTR_SHOW_ROOM_CAROUSELS. "&attribute=" .LCAPI_ATTR_PARTICIPANT_PIN."&attribute=" .LCAPI_ATTR_PRESENTER_PIN;
$response = $this->lcapi_send_query( LCAPI_FUNCTION_GET_ROOM_LIST, $params);
preg_match("(\d*)", $response, $matches);
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-15 13:28:37 UTC (rev 215)
@@ -38,20 +38,10 @@
define("LIVECLASSROOM_MODULE_VERSION", "3.1.2");
-//define("LIVECLASSROOM_MOODLE_PREFIX", liveclassroom_get_prefix());
-//Suffixes used when creting the profiles account on the LC server
-//Teachers will use LIVECLASSROOM_MOODLE_PREFIX + $course->id + LIVECLASSROOM_TEACHER_SUFFIX
-define ("LIVECLASSROOM_TEACHER_SUFFIX", "_T");
-//Students will use LIVECLASSROOM_MOODLE_PREFIX + $course->id + LIVECLASSROOM_STUDENT_SUFFIX
-define ("LIVECLASSROOM_STUDENT_SUFFIX", "_S");
-
-
$LIVECLASSROOM_LOGS = "logs.php"; //file use to the logs
-
-
/**
* Validate the data in passed in the configuration page
* @param $config - the information from the form mod.html
@@ -88,11 +78,6 @@
$api=new LCApi($config->servername,
$config->adminusername,
$config->adminpassword);
- $api->lcapi_init($config->servername,
- $config->adminusername,
- $config->adminpassword,
- $CFG->dataroot);
-
if (! $api->lcapi_authenticate()) {
error(get_string('wrongadminpass', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
@@ -202,7 +187,7 @@
/// Given an ID of an instance of this module,
/// this function will permanently delete the instance
/// and any data that depends on it.
- $api=new LCApi($CFG->liveclassroom_servername,
+ $api=new LCApi($CFG->liveclassroom_servername,
$CFG->liveclassroom_adminusername,
$CFG->liveclassroom_adminpassword);
@@ -387,27 +372,6 @@
return $event;
}
-
-/**
- * Creates the profiles account for a given course.
- */
-function liveclassroom_create_profiles ($course) {
- $enc_coursename = str_replace(" ", "_", $course->shortname);
-
- $userid = liveclassroom_get_teacher_userid($course->id);
- if (! $api->lcapi_create_user ($userid, $enc_coursename, 'Teacher')) {
- //error("Cannot Create Teacher profile");
- return false;
- }
-
- $userid = liveclassroom_get_student_userid($course->id);
- if (! $api->lcapi_create_user ($userid, $enc_coursename, 'Student')) {
- //error("Cannot Create Student profile");
- return false;
- }
- return true;
-}
-
/*
* Give the shortname for a courseid given
* @param $courseid : the id of the course
@@ -501,29 +465,6 @@
-/**
- * list the element of the pictures directory
- * @param $name : the name of a folder to look into
- * @param &$s : a reference to the string to fill up
- * @return a String wich contains the pictures separated by a comma (',')
- */
-function liveclassroom_list_dir($name, &$s) {
-
- if ($dir = opendir($name)) {
-
- while($file = readdir($dir)) {
- if(is_dir($name."/".$file) && $file[0] != ".") {
- liveclassroom_list_dir($name."/".$file,$s);
- }
- else if($file[0] != ".") {
- $s .= $name."/".$file.";";
- }
- }
- closedir($dir);
- }
-}
-
-
/*
* Send info to the logs system
* @param $type : type of the log
Modified: branches/team/Thomas/moodle/mod/liveclassroom/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-01-11 16:47:18 UTC (rev 214)
+++ branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-01-15 13:28:37 UTC (rev 215)
@@ -34,66 +34,47 @@
require_once($CFG->dirroot.'/calendar/lib.php');
include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
include_once($CFG->dirroot.'/mod/liveclassroom/lib/lc/LCAction.php');
+include_once($CFG->dirroot.'/mod/liveclassroom/lib/common/WimbaLib.php');
require_once($CFG->dirroot.'/version.php');
-
-
-$id = optional_param('id', 0, PARAM_INT);
-$roomId = optional_param('roomId',null, PARAM_RAW);
-$update = optional_param('update', false, PARAM_INT);
-require_login($course->id);
-
-function txt($string){
- $result = str_replace("<br />", "" ,$string);
- $result = str_replace("<p>", "" ,$result);
- $result = str_replace("</p>", "" ,$result);
- return $result;
-}
-
+//test if the current user can see this page
+require_login($course->id);
if (!isteacher($course->id, $USER->id)) { //to Be sure
error("You need to be a teacher in this course to create an instance");
}
+//get the required parameters
+$id = optional_param('id', 0, PARAM_INT);
+$roomId = optional_param('roomId',null, PARAM_RAW);
+$update = optional_param('update', null, PARAM_INT);
+$sectionId = optional_param('section', null, PARAM_INT);
+$lcApi=new LCAction(null,$CFG->liveclassroom_servername,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword, $CFG->dataroot,$id);
/// First we check that form variables have been initialised
if (!isset($form->name)) {
$form->name = '';
}
if (!isset($form->type)) {
- $form->type = '';
+ $form->type = '';
}
if (!isset($form->intro)) {
- $form->intro = '';
+ $form->intro = '';
}
if (!isset($form->descrption)) {
- $form->descrption = '';
+ $form->descrption = '';
}
if (!isset($form->section)) {
$form->section = '';
}
-if (empty($form->timeopen)) {
- $form->timeopen = "";
- $form->timerestrict = 0;
-} else {
- $form->timerestrict = 1;
-}
-
-//get the number of the section
-if ($update!=false) { // update instance
-
-}
-else
-{
- $sectionId = optional_param('section', 0, PARAM_INT);
-}
-
-
$event=false;
$description="";
+$stringDate="";
//check if a calendar event exist
-if($update!=false){ //update
+if(isset($update)){ //update
//get the information of the activity
if (! $cmLiveclass = get_record("course_modules", "id", $update)) {
@@ -104,88 +85,39 @@
$sectionId=$activity->section;
$action = "update";
- $id=$cmLiveclass->course;
+ $id=$cmLiveclass->course;//get the id of the course
- $event=liveclassroom_get_event_calendar($activity->id) ;
+ $event=liveclassroom_get_event_calendar($activity->id);
- if(empty($event) || $event==false)//no event
+ if( $event==true)//no event
{
- $checked= "";
- if($course->format == "social" || $course->format == "topics" || $sectionId != 0){
- $disableAllElements="disabled";
- $disabledCheckbox="";
- }else{
- $disabledCheckbox="disabled";
- $disableAllElements="disabled";
- }
-
- }
- else
- {//there is a event
$checked ="checked";
- if($course->format == "social" || $course->format == "topics" || $sectionId != 0){
- $disabledCheckbox="";
- $disableAllElements="";
- }
- else
- {
- $disabledCheckbox="disabled";
- $disableAllElements="disabled";
- }
list($description,$link)=split("<br>",$event->description);
- }
-
+ $stringDate=date('m',$event->timestart)."/".date('d',$event->timestart)."/".date('Y',$event->timestart);
+
+ }
$name= $activity->name; //get the name
-
}
else
{//new
$checked ="checked";
- if($course->format == "social" || $course->format == "topics" || $sectionId != 0){
- $disabledCheckbox="";
- $disableAllElements="";
- }
- else
- {
- $disabledCheckbox="disabled";
- $disableAllElements="disabled";
- }
+
$name="";
}
-
-
-
-$weekdate = $course->startdate; // this should be 0:00 Monday of that week
-$weekdate += 7200; // Add two hours to avoid possible DST problems
- $section = 0;
-// $sectionmenu = array();
-$weekofseconds = 604800;
-$course->enddate = $course->startdate + ($weekofseconds * $course->numsections);
-$list_weeks[0]= "Introduction section"; //For first section
-$k=1;
-while ($weekdate < $course->enddate) {
- $nextweekdate = $weekdate + ($weekofseconds);
- $weekday = userdate($weekdate, '%d %b') ;
- $endweekday = userdate($weekdate+518400, '%d %b');
- $list_weeks[$k] = $weekday.' - '.$endweekday;
- $k++;
- $section++;
- $weekdate = $nextweekdate;
-}
-
-$stringDate="";
-if($course->format == "topics" || $course->format == "social"){
-
+//manage the state of the calendar form
+//it is disabled for the Introduction section (week 0) of a weekly course
+if($course->format == "week" && $sectionId != 0){
+ $disabledCheckbox="disabled";
+ $disableAllElements="disabled";
+ $eventDate=mktime(0,0,0,1,date('z',$course->startdate)+($sectionId-1)*7+1,date('y',$course->startdate)) ;
+ $stringDate=date('m',$eventDate)."/".date('d',$eventDate)."/".date('Y',$eventDate);
}
-else if(isset($event) && $event!=false)
+else
{
- $stringDate=date('m',$event->timestart)."/".date('d',$event->timestart)."/".date('Y',$event->timestart);
-}
-else if($sectionId != 0)
-{
- $eventDate=mktime(0,0,0,1,date('z',$course->startdate)+($sectionId-1)*7+1,date('y',$course->startdate)) ;
- $stringDate=date('m',$eventDate)."/".date('d',$eventDate)."/".date('Y',$eventDate);
-}
+ $disabledCheckbox="";
+ $disableAllElements="";
+}
+
// Visible to students or not
if ($form->coursemodule) {
@@ -204,220 +136,18 @@
if ($hiddensection) {
$visible = false;
}
-
-$lcApi=new LCAction(null,$CFG->liveclassroom_servername,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword, $CFG->dataroot,$id);
?>
+<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/liveclassroom/css/StyleSheet.css"" type="text/css" />
<style>
-
-#headerBar table
-{
- width: 700px;
- background:white url( "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
- height: 32px;
- border-bottom: solid 1px Black;
+body{
+ font-size:14px;
}
-
-
-/*contextBar*/
-#contextBar table
-{
- height: 40px;
- background: url( "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/backgrounds/toolbar.png" );
- border-bottom: solid 1px #C7D3E1;
-}
-
-.contextBarRight
-{
- font-family: Verdana;
- font-size: 12px;
-}
-
-.roomNameForSettings
-{
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
-}
-
-.fontCurrent
-{
- font-family:Verdana;
- font-size:10px;
-
-}
-.nameElement {
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
-}
-.nameTools {
- font-family: Verdana;
-
- font-size: 12px;
-}
-
.content
{
- margin:-5px;
+ margin:-5px;
}
-
-a.list
-{
-
- font-family:Verdana;
- font-size:10px;
- color : #0000FF ;
- text-decoration : underline ;
-}
-a.list:hover
-{
- color : #0000FF ;
- text-decoration : none ;
-}
-a.list:visited
-{
- color : #0000FF ;
- text-decoration : underline ;
-}
-a.list:active
-{
- color : #0000FF ;
- text-decoration : none ;
-}
-
-.opac
-{
- width: 100%;
- z-index:5;
- filter:alpha(opacity=33);-moz-opacity:.33;opacity:.33;
- height:100%;
- left: 0px;
- top: 0px;
- position:absolute;
- background-color:black;
- display:none;
-}
-
-.opac iframe
-{
- display:none;/*sorry for IE5*/
- display/**/:block;/*sorry for IE5*/
- position:absolute;/*must have*/
- top:0;/*must have*/
- left:0;/*must have*/
- z-index:5;/*must have*/
- filter:mask();/*must have*/
- width: 100%;/*must have for any big value*/
- height: 100%;/*must have for any big value*/;
-}
-
-div.Table_01 {
- position:absolute;
- left:0px;
- top:0px;
- width:350px;
- height:150px;
- z-index: 50;
- font-family:Verdana;
- padding: 2px;
- margin: 2px;
- left: 40%;
- top: 30%;
- font-size:9px;
- display:none;
-}
-
-div.window-left {
- position:absolute;
- left:0px;
- top:0px;
- width:10px;
- height:150px;
- background-image: url( "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/window-left.png" );
- background-repeat:none;
-}
-
-div.window-middle {
- position:absolute;
- left:10px;
- top:0px;
- width:330px;
- height:150px;
- background-image: url( "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/window-middle.png" );
-
-}
-
-div.window-right {
- position:absolute;
- left:340px;
- top:0px;
- width:10px;
- height:150px;
- background-image: url( "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/window-right.png" );
- background-repeat:none;
-}
-
-.popupText
-{
- font-size:12px;
- font-family: helvetica;
-}
-
-.popupTitle
-{
- font-size:14px;
- font-weight:bold;
- text-decoration:underline;
- font-family: helvetica;
-}
-
-.label_settings
-{
-
- text-align:right;
-}
-
-.page_title
-{
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size:18px;
- font-weight:bold;
- color:#3c4b5b;
- vertical-align: middle;
-}
-#calendar
-{
- padding-left:25px;
-}
-td.action, input.action
-{
- background-image: url("<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/buttons/general-empty.png");
- background-repeat: no-repeat;
-
- background-position: center;
- text-decoration: none;
- color: Black;
- text-align: center;
- cursor: pointer;
- width:75px;
-}
-td.action:hover, input.action:hover
-{
- background-image: url("<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/buttons/general-empty-over.png");
-}
-
-.action label
-{
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size:12px;
- cursor: pointer;
-}
-
</style>
-
<script type="text/javascript">
function validate(){
@@ -578,7 +308,8 @@
if(document.getElementById("section").value == 0){
hideCalendarEvent("disabled");
document.getElementById("calendar_event").disabled="disabled";
- document.getElementById("comment_date").innerHTML="";
+ if(document.getElementById("comment_date")!=null)
+ document.getElementById("comment_date").innerHTML="";
}else{
document.getElementById("calendar_event").disabled="";
if(document.getElementById("calendar_event").checked==false)
@@ -679,361 +410,322 @@
FillForm();
}
-
window.onload=loadPage;
</script>
-<title>Wimba</title>
-</head>
- <body>
- <div class="content" id=content width="700px" align=center>
- <form id="form" name="form" method="post" action="mod.php">
- <input type="hidden" value="" name="type">
- <div id="headerBar" width="700px" align=center>
- <table cellspacing="0" cellpadding="0" width="700px" align=center>
- <tr>
- <td class="headerBarLeft" align="left">
- <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/headerbar-logo.png">
- </td>
+<div class="content" id=content width="700px" align=center>
+ <form id="form" name="form" method="post" action="mod.php">
+ <input type="hidden" value="" name="type">
+ <div id="headerBar" width="700px" align=center>
+ <table cellspacing="0" cellpadding="0" width="700px" align=center>
+ <tr>
+ <td class="headerBarLeft" align="left">
+ <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/headerbar-logo.png">
+ </td>
- <td align="right" class="headerBarRight">
- </td>
- </tr>
- </table>
- </div>
- <div id="contextBar" width="700px" align=center>
- <table width="700px" align=center>
- <tbody>
- <tr>
- <td class="contextBarLeft" align="left"><label class="nameElement"><?php print_string('addactivity', 'liveclassroom') ?></label>
- <label class="nameTools">: Live Classroom <?php echo print_string('in', 'liveclassroom').' '.$course->fullname; ?></label>
- </td>
- <td class="contextBarRight" align="right">Live Classroom</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="activity" width="700px" align=center>
- <table border="0" width="700px" align=center cellpadding="5" cellspacing="0">
- <tr valign="top">
- <td align="right">
- <font color="red">*</font> <font class="fontCurrent"><?php print_string('activity_name', 'liveclassroom') ?></font>
- </td>
- <td align="left">
- <input type="text" id="name" name="name" size="25" value="<?php echo $name ?>">
- </td>
- <td colspan="2">
- <font color="red">*</font><font class="fontCurrent"><?php print_string('required_fields', 'liveclassroom')?></font>
- </td>
- </tr>
+ <td align="right" class="headerBarRight">
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div id="contextBar" width="700px" align=center>
+ <table width="700px" align=center>
+ <tbody>
+ <tr>
+ <td class="contextBarLeft" align="left"><label class="nameElement"><?php print_string('addactivity', 'liveclassroom') ?></label>
+ <label class="nameTools">: Live Classroom <?php echo print_string('in', 'liveclassroom').' '.$course->fullname; ?></label>
+ </td>
+ <td class="contextBarRight" align="right">Live Classroom</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="activity" width="700px" align=center>
+ <table border="0" width="700px" align=center cellpadding="5" cellspacing="0">
+ <tr valign="top">
+ <td align="right">
+ <font color="red">*</font> <font class="fontCurrent"><?php print_string('activity_name', 'liveclassroom') ?></font>
+ </td>
+ <td align="left">
+ <input type="text" id="name" name="name" size="25" value="<?php echo $name ?>">
+ </td>
+ <td colspan="2">
+ <font color="red">*</font><font class="fontCurrent"><?php print_string('required_fields', 'liveclassroom')?></font>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <?php
+ if($course->format == "weeks" || $course->format == "weekscss"){
+ ?>
+ <td align="right">
+ <font class="fontCurrent"><?php print_string('weeksformat', 'liveclassroom')?></font>
+ </td>
+ <td align="left">
+ <select name="section" id="section" onchange="change()">
+ <?php
+ echo getListOfWeeks($course,$sectionId);
+ ?>
+ </select>
+ </td>
+ </tr>
+ <?php
+ }else if($course->format == "topics" ){
+
+ ?>
+ <tr valign="top">
+ <td align="right">
+ <font class="fontCurrent"><?php print_string('topicformat', 'liveclassroom') ?></font>
+ </td>
- <tr valign="top">
- <?php
- if($course->format == "weeks" || $course->format == "weekscss"){
+ <td colspan="2" align="left">
+ <select name="section" id="section">
+ <?php
+ echo getListOfTopics($course,$sectionId);
?>
- <td align="right">
- <font class="fontCurrent"><?php print_string('weeksformat', 'liveclassroom')?></font>
- </td>
- <td align="left">
- <select name="section" id="section" onchange="change()">
- <?php
- for($l=0;$l<sizeof($list_weeks);$l++){
- if($sectionId==$l)
- {
- echo '<OPTION selected value='.$l.'>'."Week ".$l." : ".$list_weeks[$l].'</OPTION>';
- }
- else
- {
- echo '<OPTION value='.$l.'>'."Week ".$l." : ".$list_weeks[$l].'</OPTION>';
- }
+ </select>
+ </td>
+ </tr>
+ <?php } ?>
+ </tr>
+ <tr valign="top">
+ <td align="right">
+ <font color="red">*</font><font class="fontCurrent"><?php print_string('liveclassroomtype', 'liveclassroom')?></font>
+ </td>
+ <td align="left">
+ <SELECT name="type" id="type">
+ <option value="empty">Select... </option>
+ <?php
+ foreach($rooms as $room) {
+ if($room->isArchive()==false){
+ $name=(strlen($room->getLongname())>25)?substr($room->getLongname(),0,25)."...":$room->getLongname();
+ if( ($roomId==$lcApi->getPrefix().$room->getRoomId()) || ($update!=false && $lcApi->getPrefix().$room->getRoomId()==$activity->type))
+ {
+ echo "<OPTION selected VALUE=".$lcApi->getPrefix().$room->getRoomId().">".$name."</OPTION>";
}
- ?>
- </select>
- </td>
- </tr>
+ else
+ {
+ echo "<OPTION VALUE=".$lcApi->getPrefix().$room->getRoomId().">".$name."</OPTION>";
+ }
+ }
+ }
+ ?>
+ </SELECT>
+ </td>
+ <td width="50px"><font class="fontCurrent"><?php print_string('or', 'liveclassroom')?></font></td>
+ <td>
+ <input type="button" value="<?php print_string('new', 'liveclassroom')?>" onclick="javascript:LaunchCreateWorkflow()">
+ </td>
+ </tr>
+ <tr valign="top" >
+ <td align="right">
+ <font class="fontCurrent"><?php echo get_string('visibletostudents','liveclassroom'); ?></font>
+ </td>
+ <td align="left" >
<?php
- }else if($course->format == "topics" ){
-
+ unset($choices);
+ $choices[1] = get_string('show');
+ $choices[0] = get_string('hide');
+ choose_from_menu($choices, 'visible', $visible, '', '', 0, false, $hiddensection);
?>
- <tr valign="top">
- <td align="right">
- <font class="fontCurrent"><?php print_string('topicformat', 'liveclassroom') ?></font>
- </td>
-
- <td colspan="2" align="left">
- <select name="section" id="section">
- <?php
- $section = 0;
- while ($section <= $course->numsections) {
- if (!$thissection = get_record('course_sections', 'course',$course->id, 'section', $section)) {
- notify('Error getting course_sections!');
- }
- $desc = format_text($thissection->summary, FORMAT_MOODLE, NULL, $course->id);
- $descTxt = txt($desc);
- $minidesc = substr($descTxt, 0, 20);
-
- if ( ($thissection->summary != NULL) && (strlen($descTxt)>20) ) {
- $minidesc .= "...";
- }
- else if ($thissection->summary == NULL){
- $minidesc = "Topic";
- }
- if($sectionId==$section)
- {
- echo '<OPTION selected value='.$section.'>'.$section.". ".$minidesc.'</OPTION>';
- }
- else
- {
- echo '<OPTION value='.$section.'>'.$section.". ".$minidesc.'</OPTION>';
- }
- $section++;
- }
- ?>
- </select>
- </td>
- </tr>
- <?php } ?>
- </tr>
- <tr valign="top">
- <td align="right">
- <font color="red">*</font><font class="fontCurrent"><?php print_string('liveclassroomtype', 'liveclassroom')?></font>
- </td>
- <td align="left">
- <SELECT name="type" id="type">
- <option value="empty">Select... </option>
- <?php
- foreach($rooms as $room) {
- if($room->isArchive()==false){
- $name=(strlen($room->getLongname())>25)?substr($room->getLongname(),0,25)."...":$room->getLongname();
- if( ($roomId==$lcApi->getPrefix().$room->getRoomId()) || ($update!=false && $lcApi->getPrefix().$room->getRoomId()==$activity->type))
- {
- echo "<OPTION selected VALUE=".$lcApi->getPrefix().$room->getRoomId().">".$name."</OPTION>";
- }
- else
- {
- echo "<OPTION VALUE=".$lcApi->getPrefix().$room->getRoomId().">".$name."</OPTION>";
- }
- }
- }
- ?>
- </SELECT>
- </td>
- <td width="50px"><font class="fontCurrent"><?php print_string('or', 'liveclassroom')?></font></td>
- <td>
- <input type="button" value="<?php print_string('new', 'liveclassroom')?>" onclick="javascript:LaunchCreateWorkflow()">
- </td>
- </tr>
- <tr valign="top" >
- <td align="right">
- <font class="fontCurrent"><?php echo get_string('visibletostudents','liveclassroom'); ?></font>
- </td>
- <td align="left" >
- <?php
- unset($choices);
- $choices[1] = get_string('show');
- $choices[0] = get_string('hide');
- choose_from_menu($choices, 'visible', $visible, '', '', 0, false, $hiddensection);
- ?>
- </td>
- </tr>
- <tr>
- <td height="30px"></td>
- </tr>
- <tr>
- <td align="right" colspan="2" width="500px">
- <div id="calendar">
- <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 ?>>
- <font class="fontCurrent"><?php echo get_string ('add_calendar', 'liveclassroom') ?></font>
- </td>
- </tr>
-
- <tr>
- <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 ?>>
- <?php
- for($i=0;$i<7;$i++){
- if($event==false && $i==0 || $event!=false && date('w',$event->timestart)==date('w',$i*86400+$course->startdate))
- echo "<option value=".($i*86400)." selected>".get_string("day".date('w',$i*86400+$course->startdate),"liveclassroom")."</option>";
- else
- echo "<option value=".($i*86400).">".get_string("day".date('w',(($i*86400)+$course->startdate)),"liveclassroom")."</option>";
- }
- ?>
- </select>
- <label id="comment_date"><?php echo $stringDate;?></label>
- <?
- }else if($course->format == "topics" || $course->format == "social" || $course->format == "site"){?>
- <select id="start_month" name="start_month" <?php echo $disableAllElements ?>>
- <?php
- for($i=1;$i<=12;$i++){
- if($event==false && $i==date('m') || $event!=false && date('m',$event->timestart)==$i)
- echo "<option value=".$i." selected>".get_string("month".$i,"liveclassroom")."</option>";
- else
- echo "<option value=".$i.">".get_string("month".$i,"liveclassroom")."</option>";
- }
- ?>
- </select>
- <select id="start_day" name="start_day" <?php echo $disableAllElements ?>>
- <?php
- for($i=1;$i<=31;$i++){
- if($event==false && $i==date('d') || $event!=false && date('d',$event->timestart)==$i)
- echo "<option value=".$i." selected>".$i."</option>";
- else
- echo "<option value=".$i.">".$i."</option>";
- }
- ?>
- </select>
- <select id="start_year" name="start_year" <?php echo $disableAllElements ?>>
- <?php
- for($i=date('Y');$i<=date('Y')+10;$i++){
- if($event==false && $i==date('Y') || $event!=false && date('Y',$event->timestart)==$i)
- echo "<option value=".$i." selected>".$i."</option>";
- else
- echo "<option value=".$i.">".$i."</option>";
- }
- ?>
- </select>
- <? }?>
-
- </td>
- <td align=left >
- <select id="start_hr" name="start_hr" <?php echo $disableAllElements ?>>
+ </td>
+ </tr>
+ <tr>
+ <td height="30px"></td>
+ </tr>
+ <tr>
+ <td align="right" colspan="2" width="500px">
+ <div id="calendar">
+ <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 ?>>
+ <font class="fontCurrent"><?php echo get_string ('add_calendar', 'liveclassroom') ?></font>
+ </td>
+ </tr>
+
+ <tr>
+ <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 ?>>
<?php
- for($i=1;$i<=24;$i++){
- if($event==false && $i==8 || $event!=false && date('G',$event->timestart)==$i)
- echo "<option value=".$i." selected>".date("h A",mktime($i, 1, 1, 1, 1,2007))."</option>";
- else
- echo "<option value=".$i.">".date("h A",mktime($i, 1, 1, 1, 1,2007))."</option>";
- }
- ?>
- </select>
- <select id="start_min" name="start_min" <?php echo $disableAllElements ?>>
+ for($i=0;$i<7;$i++){
+ if($event==false && $i==0 || $event!=false && date('w',$event->timestart)==date('w',$i*86400+$course->startdate))
+ echo "<option value=".($i*86400)." selected>".get_string("day".date('w',$i*86400+$course->startdate),"liveclassroom")."</option>";
+ else
+ echo "<option value=".($i*86400).">".get_string("day".date('w',(($i*86400)+$course->startdate)),"liveclassroom")."</option>";
+ }
+ ?>
+ </select>
+ <label id="comment_date"><?php echo $stringDate;?></label>
+ <?
+ }else if($course->format == "topics" || $course->format == "social" || $course->format == "site"){?>
+ <select id="start_month" name="start_month" <?php echo $disableAllElements ?>>
<?php
- for($i=0;$i<60;$i=$i+5){
- if($event!=false && date('i',$event->timestart)==$i)
- echo "<option value=".$i." selected>".$i."</option>";
- else
- echo "<option value=".$i.">".$i."</option>";
- }
+ for($i=1;$i<=12;$i++){
+ if($event==false && $i==date('m') || $event!=false && date('m',$event->timestart)==$i)
+ echo "<option value=".$i." selected>".get_string("month".$i,"liveclassroom")."</option>";
+ else
+ echo "<option value=".$i.">".get_string("month".$i,"liveclassroom")."</option>";
+ }
+ ?>
+ </select>
+ <select id="start_day" name="start_day" <?php echo $disableAllElements ?>>
+ <?php
+ for($i=1;$i<=31;$i++){
+ if($event==false && $i==date('d') || $event!=false && date('d',$event->timestart)==$i)
+ echo "<option value=".$i." selected>".$i."</option>";
+ else
+ echo "<option value=".$i.">".$i."</option>";
+ }
+ ?>
+ </select>
+ <select id="start_year" name="start_year" <?php echo $disableAllElements ?>>
+ <?php
+ for($i=date('Y');$i<=date('Y')+10;$i++){
+ if($event==false && $i==date('Y') || $event!=false && date('Y',$event->timestart)==$i)
+ echo "<option value=".$i." selected>".$i."</option>";
+ else
+ echo "<option value=".$i.">".$i."</option>";
+ }
?>
- </select>
- </td>
- </tr>
- <tr>
- <td align="right">
- <font class="fontCurrent"><?echo get_string('duration_calendar','liveclassroom')?></font>
- </td>
- <td align=left >
- <select id="duration_hr" name="duration_hr" <?php echo $disableAllElements ?>>
- <?php
- for($i=0;$i<=24;$i++){
- if($event!=false && intval(abs($event->timeduration/3600))==$i)
- echo "<option value=".$i." selected>".$i."</option>";
- else
- echo "<option value=".$i.">".$i."</option>";
- }
- ?>
- </select>
- <font class="fontCurrent">hr</font>
- <select id="duration_min" name="duration_min" <?php echo $disableAllElements ?>>
- <?php
- for($i=0;$i<=60;$i=$i+10){
- if($event!=false && (($event->timeduration%3600)/60)==$i)
- echo "<option value=".$i." selected>".$i."</option>";
- else
- echo "<option value=".$i.">".$i."</option>";
- }
- ?>
- </select>
- <font class="fontCurrent">min</font>
- </td>
- </tr>
- <tr>
- <td align="right">
- <font class="fontCurrent"><? echo get_string('description_calendar', 'liveclassroom')?></font>
- </td>
- <td align=left >
- <textarea id="description" name="description" <?php echo $disableAllElements ?> rows="4" cols="30"><?php echo $description; ?></textarea>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- </table>
- </div>
- <div width="700px" align=center>
- <table width="700px" align=center cellpadding="5" >
- <tr style="border-top:1px solid; background-color:#F0F0F0;">
- <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.gif" ><a class="list" href="<?php echo $CFG->wwwroot;...
[truncated message content] |