Revision: 248
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=248&view=rev
Author: trollinger
Date: 2008-02-19 14:22:47 -0800 (Tue, 19 Feb 2008)
Log Message:
-----------
-Remove a couple of notice/warning error
-make sure using <?php or not just <?
-add popup.php
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/lib.php
branches/team/Thomas/moodle/mod/liveclassroom/mod.html
branches/team/Thomas/moodle/mod/liveclassroom/reports.php
branches/team/Thomas/moodle/mod/liveclassroom/view.php
branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
Added Paths:
-----------
branches/team/Thomas/moodle/mod/liveclassroom/popup.php
Modified: branches/team/Thomas/moodle/mod/liveclassroom/config.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-02-19 22:22:47 UTC (rev 248)
@@ -1,6 +1,7 @@
<?php
require_once("lib/php/lc/LCAction.php");
require_once("lib/php/lc/lcapi.php");
+
$lcApi=new LCApi($CFG->liveclassroom_servername,
$CFG->liveclassroom_adminusername,
$CFG->liveclassroom_adminpassword, $CFG->dataroot);
Modified: branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css 2008-02-19 22:22:47 UTC (rev 248)
@@ -579,9 +579,9 @@
/*MessageBar*/
-#messageBar
+#message
{
- width:99%;
+ width:699px;
}
.message
@@ -591,7 +591,7 @@
bottom:4px;
left:1px;
right:1px;
- height: 20px;
+ height: 25px;
display: block;
}
@@ -680,19 +680,28 @@
font-size: 12px;
}
+div.advancedPopup,div.informationPopup {
+ position:absolute;
+ left:0px;
+ top:0px;
+ width:350px;
+ height:150px;
+ z-index: 50 !important;;
+ font-family:Verdana;
+ padding: 2px;
+ margin: 2px;
+
+ display:none;
+}
+
div.advancedPopup {
- position:absolute;
- left:0px;
- top:0px;
- width:350px;
- height:150px;
- z-index: 50 !important;;
- font-family:Verdana;
- padding: 2px;
- margin: 2px;
left: 15%;
+ top: 20%;
+}
+
+div.informationPopup {
+ left: 40%;
top: 30%;
- display:none;
}
div.window-left {
Modified: branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-02-19 22:22:47 UTC (rev 248)
@@ -40,9 +40,9 @@
require_once ("lib/php/common/XmlRoom.php");
require_once ("lib/php/common/WimbaXml.php");
-if (version_compare(PHP_VERSION, '5', '>=')) {
- require_once ('lib/php/common/domxml-php4-php5.php');
-}
+if (version_compare(PHP_VERSION,'5','>=')) {
+ require_once('lib/php/common/domxml-php4-php5.php');
+}
$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaClassroomForm());
@@ -54,7 +54,8 @@
$courseid = $params["enc_course_id"];
require_login($courseid);
-$action = required_param('action', PARAM_ALPHA);
+$action = $params["action"];
+$roomId = $params["resource_id"];
$createWorkflow = optional_param("createWorkflow", false, PARAM_BOOL); // course
$session = new WimbaMoodleSession($params);
@@ -84,37 +85,27 @@
else
{
$authToken = $api->getAuthoken();
- }
- redirection($CFG->liveclassroom_servername . '/main/horizon_ui.pl.epl?'.
- 'channel=' . $roomId .
- '&hzA=' . $authToken);
- exit;
+ }
+
+ redirection( $CFG->liveclassroom_servername . '/main/horizon_ui.pl.epl?'.
+ 'channel=' . $api->getPrefix().$roomId . '&hzA=' . $authToken);
break;
case "create" :
- $id = $api->createRoom(required_param('resource_id', PARAM_SAFEDIR), "false");
+ $id = $api->createRoom($roomId, "false");
$messageAction = "created";
$messageProduct = "room";
break;
case "update" :
-
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
$id = $api->createRoom($roomId, "true");
$messageAction = "updated";
$messageProduct = "room";
break;
case "delete" :
- if ($api->getPrefix() != "")
- {
- $roomId = trimPrefix(required_param('resource_id', PARAM_SAFEDIR), $api->getPrefix());
- }
- else
- {
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
- }
- $id = $api->deleteRoom($roomId);
+
+ $id = $api->deleteRoom($roomId);
//delte the activity linked to this room
if (!liveclassroom_delete_all_instance_of_room($roomId))
{
@@ -125,44 +116,37 @@
break;
case "openContent" :
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
redirection ($CFG->liveclassroom_servername . '/admin/class/carousels.epl?'.
- 'class_id=' . $roomId .
+ 'class_id=' . $api->getPrefix().$roomId .
'&hzA=' . $authToken .
'&no_sidebar=1');
- exit ();
break;
case "openReport" :
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
- redirection ('reports.php?id=' . $roomId . '&hzA=' . $authToken);
+ redirection ('reports.php?id=' . $api->getPrefix().$roomId . '&hzA=' . $authToken);
exit ();
break;
case "openAdvancedMedia" :
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
redirection ($CFG->liveclassroom_servername . '/admin/class/media.pl?'.
- 'class_id=' . $roomId .
+ 'class_id=' . $api->getPrefix().$roomId .
'&hzA=' . $authToken .
'&no_sidebar=1');
exit ();
break;
case "openAdvancedRoom" :
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
redirection ($CFG->liveclassroom_servername . '/admin/class/properties.pl?'.
- 'class_id=' . $roomId .
+ 'class_id=' . $api->getPrefix().$roomId .
'&hzA=' . $authToken .
'&no_sidebar=1');
- exit ();
break;
case "getDialInformation" :
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
$select_room = $api->getRoom($roomId);
if ($params["studentView"] == "true" || $session->isInstructor() == false)
@@ -177,24 +161,16 @@
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());
+ get_string("popup_dial_numbers", "liveclassroom"),
+ get_string("popup_dial_pin", "liveclassroom"),
+ $select_room->getPresenterPin(),
+ $select_room->getParticipantPin(),
+ $api->getPhoneNumbers());
}
echo $xml->getXml();
break;
case "saveSettings" :
- if ($api->getPrefix() != "")
- {
- $roomId = trimPrefix(required_param('resource_id', PARAM_SAFEDIR), $api->getPrefix());
- }
- else
- {
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
- }
$id = $api->createRoom($roomId, "true");
echo "good";
exit ();
@@ -208,7 +184,7 @@
'&sesskey=' . sesskey() .
'&id=' . $session->getCourseId() .
'&add=liveclassroom'.
- '&roomId=' . $api->getPrefix().$id );
+ '&roomId=' . $id );
}
else if ($action != "getDialInformation")
{
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-02-19 22:22:47 UTC (rev 248)
@@ -33,34 +33,37 @@
require_once("../../config.php");
require_once("lib.php");
+require_once("lib/php/common/WimbaLib.php");
require_once("lib/php/lc/LCAction.php");
+
require_once("lib/php/common/WimbaCommons.php");
require_once("lib/php/common/WimbaUI.php");
require_once("lib/php/common/XmlArchive.php");
require_once("lib/php/common/XmlOrphanedArchive.php");
require_once("lib/php/common/XmlRoom.php");
require_once("lib/php/common/WimbaXml.php");
-require_once("lib/php/common/WimbaLib.php");
+$message="";
+
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
-
foreach(getKeysOfGeneralParameters() as $param){
$value=optional_param($param["value"],$param["default_value"],$param["type"]);
if($value!=null)
$params[$param["value"]] = $value;
}
-require_login($params["en_course_id"]);
+require_login($params["enc_course_id"]);
if(isset($params["error"]))
{
- $display=$uiManager->setError(get_string ($params["error"], 'liveclassroon'));
+ $display=$uiManager->setError(get_string ($params["error"], 'liveclassroon'));
}
else
{
+
$session=new WimbaMoodleSession($params);
if(isset($params["messageProduct"]) && isset($params["messageAction"]))
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-02-19 22:22:47 UTC (rev 248)
@@ -39,17 +39,23 @@
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
-
+
+global $error;
+
$params = array ();
-foreach(getKeysOfGeneralParameters() as $param){
+foreach(getKeysOfGeneralParameters() as $param)
+{
$value=optional_param($param["value"],$param["default_value"],$param["type"]);
if($value!=null)
$params[$param["value"]] = $value;
}
+set_error_handler("manage_error");
+
require_login($params["enc_course_id"]);
$action = optional_param('action', PARAM_ALPHA);
$currentIdtab = optional_param('idtab', null, PARAM_ALPHA);
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
$api=new LCAction($session,$CFG->liveclassroom_servername,
$CFG->liveclassroom_adminusername,
@@ -57,7 +63,7 @@
$uiManager=new WimbaUI($params,$api,$currentIdtab);
if($uiManager->getSessionError()==false)//good
-{
+{
if($action == 'update')
{
$roomId = required_param('resource_id', PARAM_SAFEDIR );
@@ -77,12 +83,7 @@
{
$uiManager->setCurrentProduct("liveclassroom");
}
-
- if(isset($params["createWorkflow"]) && $params["createWorkflow"]=="true")
- $createWorkflow= "true";
- else
- $createWorkflow="false";
-
+
$uiManager->getLCSettingsView($action,$createWorkflow);
}
@@ -91,6 +92,11 @@
$uiManager->setError(get_string ('error_'.$uiManager->getSessionError(), 'liveclassroon'));
}
+if(!empty($error))
+{
+ $uiManager->setError("cla merde");
+}
+
echo $uiManager->getXmlString();
Modified: branches/team/Thomas/moodle/mod/liveclassroom/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-02-19 22:22:47 UTC (rev 248)
@@ -33,7 +33,9 @@
require_once("../../config.php");
+
require_once("lib.php");
+
require_once("lib/php/common/WimbaCommons.php");
require_once("lib/php/common/WimbaLib.php");
@@ -48,7 +50,7 @@
$strliveclassrooms = get_string("modulenameplural", "liveclassroom");
$strliveclassroom = get_string("modulename", "liveclassroom");
-$strname = $voicetool->name;
+
$navigation = array();
if ($course->id != SITEID) {
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-02-19 22:22:47 UTC (rev 248)
@@ -1,486 +1,458 @@
-<?PHP
-/******************************************************************************
- * *
+<?php
+
+/**
* Copyright (c) 1999-2007 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. *
- * *
+ * 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 *
- * *
+ * 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: lib.php 200 2008-01-09 11:37:50Z trollinger $ */
+// / Library of functions and constants for module liveclassroom
+if (!function_exists('getKeysOfGeneralParameters')) {
+ require_once('lib/php/common/WimbaLib.php');
+}
+require_once($CFG->libdir . '/datalib.php');
-/// Library of functions and constants for module liveclassroom
-
-require_once($CFG->libdir.'/datalib.php');
-
require_once("lib/php/lc/lcapi.php");
-require_once($CFG->dirroot.'/course/lib.php');
-require_once("lib/php/common/WimbaLib.php");
-define( 'WIMBA_DIR', $CFG->dataroot."/wimba");
-define( 'PRODUCT_DIR', $CFG->dataroot."/wimba/WC");
-
-define('WIMBA_LOGS_DIR', $CFG->dataroot."/wimba/WC/logs");
define("LIVECLASSROOM_MODULE_VERSION", "3.1.2");
+define("WC", "liveclassroom");
-$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
- * @return nothing, but returns an error if the configuration is wrong
+ *
+ * @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, $USER;
+function liveclassroom_process_options (&$config)
+{
+ global $CFG, $USER;
+ /*******
+ we do the following verfication before submitting the configuration
+ -The parameters sent can not be empty
+ -The url of the server can not finish with a /
+ -The url must start with http://
+ -The api account has to valid
+ ********/
+
+ $config->servername = trim($config->servername);
+ $config->adminusername = trim($config->adminusername);
+ $config->adminpassword = trim($config->adminpassword);
- $config->servername = trim($config->servername);
- $config->adminusername = trim($config->adminusername);
- $config->adminpassword = trim($config->adminpassword);
+ if (! isadmin($USER->id))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_string('wrongconfigurationURLunavailable', 'liveclassroom'));
+ error(get_string('errormustbeadmin', 'liveclassroom'));
+ }
- if (! isadmin($USER->id)) {
- error(get_string('errormustbeadmin', 'liveclassroom'));
- }
-
- if(empty($config->servername)){
- error(get_string('wrongconfigurationURLunavailable', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
- }
- else if(empty($config->adminusername)){
- error(get_string('emptyAdminUsername', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
- }
- else if(empty($config->adminpassword)){
- error(get_string('emptyAdminPassword', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
- }
+ if (empty($config->servername))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_string('wrongconfigurationURLunavailable', 'liveclassroom'));
+ error(get_string('wrongconfigurationURLunavailable', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
+ }
+ else if (empty($config->adminusername))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_string('emptyAdminUsername', 'liveclassroom'));
+ error(get_string('emptyAdminUsername', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
+ }
+ else if (empty($config->adminpassword))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_string('emptyAdminPassword', 'liveclassroom'));
+ error(get_string('emptyAdminPassword', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
+ }
- $length = strlen($config->servername);
- if ($config->servername{$length-1} == '/') {
- error(get_String('trailingSlash', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
- }
- if (!preg_match('/^http:\/\//', $config->servername)) {
- error(get_String('trailingHttp', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
- }
- $api=new LCApi($config->servername,
- $config->adminusername,
- $config->adminpassword);
+ $length = strlen($config->servername);
+ if ($config->servername {$length-1} == '/')
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_String('trailingSlash', 'liveclassroom'));
+ error(get_String('trailingSlash', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
+ }
+
+ if (!preg_match('/^http:\/\//', $config->servername))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_String('trailingHttp', 'liveclassroom'));
+ error(get_String('trailingHttp', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
+ }
- if (! $api->lcapi_authenticate()) {
- error(get_string('wrongadminpass', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
- }
-
- return;
-}
+ $api = new LCApi($config->servername,
+ $config->adminusername,
+ $config->adminpassword);
+ if (! $api->lcapi_authenticate())
+ {
+ wimba_add_log(WIMBA_ERROR,WC,get_string('wrongadminpass', 'liveclassroom'));
+ error(get_string('wrongadminpass', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
+ }
+
+ 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
-/// will create a new instance and return the id number
-/// of the new instance.
+function liveclassroom_add_instance($liveclassroom)
+{
+ // / 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->timemodified = time();
+ $api = new LCApi($CFG->liveclassroom_servername,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword);
+ // May have to add extra stuff in here #
+ $roomname = $api->lcapi_get_room_name($liveclassroom->type);
- $liveclassroom->timemodified = time();
- $api=new LCApi($CFG->liveclassroom_servername,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword);
+ if (!$result = insert_record("liveclassroom", $liveclassroom)) {
+ wimba_add_log(WIMBA_ERROR,WV,"Problem to add a new instance");
+ $result = false;
+ }
+
+ if (!isset($liveclassroom->section))
+ {
+ $liveclassroom->section = 0;
+ }
- # May have to add extra stuff in here #
- $roomname = $api->lcapi_get_room_name($liveclassroom->type);
-
- if($result = insert_record("liveclassroom", $liveclassroom)) {
- add_to_log($liveclassroom->course, "liveclassroom", "Add activity",
- liveclassroom_send_logs("addInstance","liveclassroomId=".$result."&roomname=$roomname"), "Activity \"".$liveclassroom->name."\" added");
- }
- else {
- add_to_log($liveclassroom->course, "liveclassroom", "Add activity",
- liveclassroom_send_logs("errorAddInstance","liveclassroomId=".$result."&roomname=$roomname"), "Activity \"".$liveclassroom->name."\" has not been added");
- $result=false;
- }
- if(!isset($liveclassroom->section))
- $liveclassroom->section=0;
-
- if($result!=false && isset($liveclassroom->calendar_event) && $liveclassroom->calendar_event==true) {//no problem
- liveclassroom_addCalendarEvent($liveclassroom,$result,$roomname);
- } else{
- liveclassroom_deleteCalendarEvent($result);
-
- }
- wimba_add_log(1,"ssss");
- return true;
-}
-
-
-function liveclassroom_update_instance($liveclassroom) {
-/// Given an object containing all the necessary data,
-/// (defined by the form in mod.html) this function
-/// will update an existing instance with new data.
-
- $liveclassroom->timemodified = time();
- $liveclassroom->id = $liveclassroom->instance;
- $api=new LCApi($CFG->liveclassroom_servername,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword);
-
- # May have to add extra stuff in here #
- $roomname = $api->lcapi_get_room_name($liveclassroom->type);
+ if ($result != false && isset($liveclassroom->calendar_event) && $liveclassroom->calendar_event == true)
+ { // no problem
+ liveclassroom_addCalendarEvent($liveclassroom, $result, $roomname);
+ }
+ else
+ {
- // Need to update the section
-
- //get the course_module instance linked to the liveclassroom instance
- if (! $cm = get_coursemodule_from_instance("liveclassroom", $liveclassroom->id, $liveclassroom->course)) {
- error("Course Module ID was incorrect");
- }
- $old_section = $cm->section;
- //Find the right section in the course_section
- $section = get_record("course_sections", "id", $cm->section);
+ liveclassroom_deleteCalendarEvent($result);
+ }
+
+ wimba_add_log(WIMBA_INFO,WC,"Add Instance".$result);
+ //for the debug
+ wimba_add_log(WIMBA_DEBUG,WC,print_r($liveclassroom, true ));
+ return true;
+}
- //delete in the course section
- if (! delete_mod_from_section($cm->id, $cm->section)) {
- $result = false;
- error("Could not delete the $mod->modulename from that section");
- }
- //update the course module section
- if (! $sectionid = add_mod_to_section($liveclassroom) ) {
- error("Could not add the new course module to that section");
- }
- //update the course modules
- if (! set_field("course_modules", "section", $sectionid, "id", $cm->id)) {
- error("Could not update the course module with the correct section");
- }
+function liveclassroom_update_instance($liveclassroom)
+{
+ // / Given an object containing all the necessary data,
+ // / (defined by the form in mod.html) this function
+ // / will update an existing instance with new data.
+ $liveclassroom->timemodified = time();
+ $liveclassroom->id = $liveclassroom->instance;
+ $api = new LCApi($CFG->liveclassroom_servername,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword);
+ // May have to add extra stuff in here #
+ $roomname = $api->lcapi_get_room_name($liveclassroom->type);
+ // Need to update the section
+ // get the course_module instance linked to the liveclassroom instance
+ if (! $cm = get_coursemodule_from_instance("liveclassroom", $liveclassroom->id, $liveclassroom->course))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Problem to update the instance : ".$liveclassroom->id);
+ error("Course Module ID was incorrect");
+ }
+ $old_section = $cm->section;
+ // Find the right section in the course_section
+ $section = get_record("course_sections", "id", $cm->section);
+ // delete in the course section
+ if (! delete_mod_from_section($cm->id, $cm->section))
+ {
+ $result = false;
+ error("Could not delete the $mod->modulename from that section");
+ }
+ // update the course module section
+ if (! $sectionid = add_mod_to_section($liveclassroom))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Problem to update the instance : ".$liveclassroom->id);
+ error("Could not add the new course module to that section");
+ }
+ // update the course modules
+ if (! set_field("course_modules", "section", $sectionid, "id", $cm->id))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Problem to update the instance : ".$liveclassroom->id);
+ error("Could not update the course module with the correct section");
+ }
- add_to_log($liveclassrooms->course, "liveclassroom", "Update activity",
- liveclassroom_send_logs("updateInstance","liveclassroomId=".$liveclassroom->id."&roomname=$roomname"),
- "Activity ".$liveclassroom->name." has been updated with success");
- if(!isset($liveclassroom->section))
- $liveclassroom->section=0;
+ if (!isset($liveclassroom->section))
+ {
+ $liveclassroom->section = 0;
+ }
- $instanceNumber=update_record("liveclassroom", $liveclassroom);
- if($instanceNumber!=false && isset($liveclassroom->calendar_event) && $liveclassroom->calendar_event==true) {//no problem
- liveclassroom_addCalendarEvent($liveclassroom,$liveclassroom->instance,$roomname);
- }
- else
- {
- liveclassroom_deleteCalendarEvent($liveclassroom->instance);
+ $instanceNumber = update_record("liveclassroom", $liveclassroom);
+ if ($instanceNumber != false && isset($liveclassroom->calendar_event) && $liveclassroom->calendar_event == true) { // no problem
+ liveclassroom_addCalendarEvent($liveclassroom, $liveclassroom->instance, $roomname);
+ }
+ else
+ {
+ liveclassroom_deleteCalendarEvent($liveclassroom->instance);
+ }
+ return $instanceNumber;
+}
- }
- return $instanceNumber;
-}
+function liveclassroom_delete_instance($id)
+{
+ // / 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,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword);
-function liveclassroom_delete_instance($id) {
-/// 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,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword);
-
- if (! $liveclassroom = get_record("liveclassroom", "id", "$id")) {
- return false;
- }
- $roomname = $api->lcapi_get_room_name($liveclassroom->type);
- $result = true;
+ if (! $liveclassroom = get_record("liveclassroom", "id", "$id"))
+ {
+ return false;
+ }
+ $roomname = $api->lcapi_get_room_name($liveclassroom->type);
+ $result = true;
+ // Delete any dependent records here #
+ if (! delete_records("liveclassroom", "id", $liveclassroom->id))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Problem to delete the instance : ".$liveclassroom->id);
+ $result = false;
+ }
+
+ liveclassroom_deleteCalendarEvent("$liveclassroom->id");
+ return $result;
+}
- # Delete any dependent records here #
-
- if (! delete_records("liveclassroom", "id", $liveclassroom->id)) {
- add_to_log($liveclassrooms->course, "liveclassroom", "Delete activity", liveclassroom_send_logs("errorDeleteInstance","liveclassroomId=".$liveclassroom->id."&roomname=$roomname"), "Activity ".$liveclassroom->name." deletion failed");
- $result = false;
- }
- add_to_log($liveclassrooms->course, "liveclassroom", "Delete activity", liveclassroom_send_logs("deleteInstance","liveclassroomId=".$liveclassroom->id."&roomname=$roomname"), "Activity ".$liveclassroom->name." has been deleted with success");
-
- liveclassroom_deleteCalendarEvent("$liveclassroom->id");
- return $result;
-}
-
-
-
-
-
-function liveclassroom_user_outline($course, $user, $mod, $liveclassroom) {
-/// Return a small object with summary information about what a
-/// user has done with a given particular instance of this module
-/// Used for user activity reports.
-/// $return->time = the time they did it
-/// $return->info = a short text description
-
+function liveclassroom_user_outline($course, $user, $mod, $liveclassroom)
+{
+ // / Return a small object with summary information about what a
+ // / user has done with a given particular instance of this module
+ // / Used for user activity reports.
+ // / $return->time = the time they did it
+ // / $return->info = a short text description
return false; //$return;
-}
+}
-function liveclassroom_user_complete($course, $user, $mod, $liveclassroom) {
-/// Print a detailed representation of what a user has done with
-/// a given particular instance of this module, for user activity reports.
-
+function liveclassroom_user_complete($course, $user, $mod, $liveclassroom)
+{
+ // / Print a detailed representation of what a user has done with
+ // / a given particular instance of this module, for user activity reports.
return true;
-}
+}
-function liveclassroom_print_recent_activity($course, $isteacher, $timestart) {
-/// Given a course and a time, this module should find recent activity
-/// that has occurred in liveclassroom activities and print it out.
-/// Return true if there was output, or false is there was none.
-
+function liveclassroom_print_recent_activity($course, $isteacher, $timestart)
+{
+ // / Given a course and a time, this module should find recent activity
+ // / that has occurred in liveclassroom activities and print it out.
+ // / Return true if there was output, or false is there was none.
global $CFG;
- return false; // True if anything was printed, otherwise false
-}
+ return false; // True if anything was printed, otherwise false
+}
-function liveclassroom_cron () {
-/// Function to be run periodically according to the moodle cron
-/// This function searches for things that need to be done, such
-/// as sending out mail, toggling flags etc ...
-
+function liveclassroom_cron ()
+{
+ // / Function to be run periodically according to the moodle cron
+ // / This function searches for things that need to be done, such
+ // / as sending out mail, toggling flags etc ...
global $CFG;
return true;
-}
+}
-function liveclassroom_grades($liveclassroomid) {
-/// Must return an array of grades for a given instance of this module,
-/// indexed by user. It also returns a maximum allowed grade.
-///
-/// $return->grades = array of grades;
-/// $return->maxgrade = maximum allowed grade;
-///
-/// return $return;
+function liveclassroom_grades($liveclassroomid)
+{
+ // / Must return an array of grades for a given instance of this module,
+ // / indexed by user. It also returns a maximum allowed grade.
+ // /
+ // / $return->grades = array of grades;
+ // / $return->maxgrade = maximum allowed grade;
+ // /
+ // / return $return;
+ return null;
+}
- return NULL;
-}
-
-function liveclassroom_get_participants($liveclassroomid) {
-//Must return an array of user records (all data) who are participants
-//for a given instance of liveclassroom. Must include every user involved
-//in the instance, independient of his role (student, teacher, admin...)
-//See other modules as example.
-
+function liveclassroom_get_participants($liveclassroomid)
+{
+ // Must return an array of user records (all data) who are participants
+ // for a given instance of liveclassroom. Must include every user involved
+ // in the instance, independient of his role (student, teacher, admin...)
+ // See other modules as example.
return false;
-}
+}
-function liveclassroom_scale_used ($liveclassroomid,$scaleid) {
-//This function returns if a scale is being used by one liveclassroom
-//it it has support for grading and scales. Commented code should be
-//modified if necessary. See forum, glossary or journal modules
-//as reference.
-
- $return = false;
+function liveclassroom_scale_used ($liveclassroomid, $scaleid)
+{
+ // This function returns if a scale is being used by one liveclassroom
+ // it it has support for grading and scales. Commented code should be
+ // modified if necessary. See forum, glossary or journal modules
+ // as reference.
+ $return = false;
- //$rec = get_record("liveclassroom","id","$liveclassroomid","scale","-$scaleid");
- //
- //if (!empty($rec) && !empty($scaleid)) {
- // $return = true;
- //}
-
return $return;
-}
-
-/*******
-CALENDAR
-******/
-function liveclassroom_addCalendarEvent($informations,$instanceNumber,$name){
- /// Basic event record for the database.
- global $CFG;
-
- $oldEvent=get_record('event','instance',$instanceNumber);
-
-
- $event = new Object();
- $event->name = $informations->name;
- $event->description = $informations->description."<br><a href=".$CFG->wwwroot."/mod/liveclassroom/view.php?id=".$instanceNumber."&action=launchCalendar target=_self >".get_string("launch_calendar","liveclassroom")." ...</a>";
- $event->format = 1;
- $event->userid = 0;
- $event->courseid = $informations->course; //course event
- $event->groupid = 0;
- $event->modulename = 'liveclassroom';
- $event->instance = $instanceNumber;
- $event->eventtype = '';
- $event->visible = 1;
- if(isset($informations->start_month) && isset($informations->start_year))//tpics
- $event->timestart = mktime($informations->start_hr,$informations->start_min,0,$informations->start_month,$informations->start_day,$informations->start_year);
-
- else{
- $event->timestart = mktime($informations->start_hr,$informations->start_min,0,date('m',$informations->calendar_start),date('d',$informations->calendar_start),date('Y',$informations->calendar_start));
- }
-
- $duration = $informations->duration_hr*3600 + $informations->duration_min*60;
- if ($duration < 0){
- $event->timeduration = 0;
- }
- else {
- $event->timeduration = $duration;
- }
+}
- $event->timemodified = time();
-
- if(!empty($oldEvent) && $oldEvent!=false) //old event exsit
- {
- $event->id = $oldEvent->id ;
- $result=update_record('event', $event);
-
- }
- else
- {
-
- $result = insert_record('event', $event);
- }
-
- return $result;
-}
+/**
+ * CALENDAR
+ */
+function liveclassroom_addCalendarEvent($informations, $instanceNumber, $name)
+{
+ // / Basic event record for the database.
+ global $CFG;
-function liveclassroom_deleteCalendarEvent($instanceNumber){
- /// Basic event record for the database.
- global $CFG;
- $oldEvent=get_record('event','instance',$instanceNumber);
-
- if(!empty($oldEvent) && $oldEvent!=false){
- $result=delete_records("event", "id", $oldEvent->id);
- }
- else
- {
- return false;
- }
- return $result;
+ $event = new Object();
+ $event->name = $informations->name;
+ $event->description = $informations->description . "<br><a href=" . $CFG->wwwroot . "/mod/liveclassroom/view.php?id=" . $instanceNumber . "&action=launchCalendar target=_self >" . get_string("launch_calendar", "liveclassroom") . " ...</a>";
+ $event->format = 1;
+ $event->userid = 0;
+ $event->courseid = $informations->course; //course event
+ $event->groupid = 0;
+ $event->modulename = 'liveclassroom';
+ $event->instance = $instanceNumber;
+ $event->eventtype = '';
+ $event->visible = 1;
+ $event->timemodified = time();
+
+ if($activity_informations->course_format !="weeks" && $activity_informations->course_format !="weekscss")
+ {//tppics or social
+ $event->timestart = mktime($activity_informations->start_hr,$activity_informations->start_min,0,$activity_informations->start_month,$activity_informations->start_day,$activity_informations->start_year);
+ if( $event->timestart < time())
+ {
+ error(get_string("date_error","liveclassroom"),$_SERVER["HTTP_REFERER"]);
+ }
+ }
+ else
+ {
+ $event->timestart = mktime($activity_informations->start_hr,$activity_informations->start_min,0,date('m',$activity_informations->calendar_start),date('d',$activity_informations->calendar_start),date('Y',$activity_informations->calendar_start));
+ }
+
+ $duration = $informations->duration_hr*3600 + $informations->duration_min*60;
+ if ($duration < 0)
+ {
+ $event->timeduration = 0;
+ }
+ else
+ {
+ $event->timeduration = $duration;
+ }
+
+ wimba_add_log(WIMBA_DEBUG,WC,"Add calendar event\n".print_r($event, true ));
-}
- /**
-* get the calendar event which matches the id
-* @param $id - the voicetool instance
-* @return the calendar event or false
-*/
-function liveclassroom_get_event_calendar($id) {
+ if(!$oldEvent=get_record('event','instance',$activity_informations->id)) //old event exsit
+ {
+ $event->id = $oldEvent->id ;
+ $result=update_record('event', $event);
+ }
+ else
+ {
+ $result = insert_record('event', $event);
+ }
+ return $result;
+}
- $event = get_record('event','instance',$id);
- if($event==false || empty($event)) {
-
- return false;
- }
- return $event;
-}
+function liveclassroom_deleteCalendarEvent($instanceNumber)
+{
+ // / Basic event record for the database.
+ global $CFG;
+ $oldEvent = get_record('event', 'instance', $instanceNumber);
+ if (!empty($oldEvent) && $oldEvent != false) {
+ $result = delete_records("event", "id", $oldEvent->id);
+ } else {
+ return false;
+ }
+ return $result;
+}
+/**
+ * get the calendar event which matches the id
+ *
+ * @param $id - the voicetool instance
+ * @return the calendar event or false
+ */
+function liveclassroom_get_event_calendar($id)
+{
+ $event = get_record('event', 'instance', $id);
+ if ($event == false || empty($event)) {
+ return false;
+ }
+ return $event;
+}
+
/*
* Give the shortname for 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;
- }
-
- // $name = $course->shortname;
+*/
+function liveclassroom_get_course_shortname($courseid)
+{
+ if (!($course = get_record('course', 'id', $courseid)))
+ {
+ // error( "Response get room name: query to database failed");
+ return false;
+ }
+ // $name = $course->shortname;
return $course->shortname;
-
-}
+}
/*
-* 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) {
- $list_return[$i] = $liveclassroom->name;
- $i++;
- }
- }
-
- return $list_return;
-}
-
-
-/*
* Delete all the activities on Moodle database for a room given
* @praram $roomid : the id of the room associated to the activities
* return a boolean true if all is well done
*/
-function liveclassroom_delete_all_instance_of_room($roomid) {
-/// 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,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword);
-
- $result = true;
- if ($liveclassrooms = get_records("liveclassroom", "type", $roomid)) {
- $roomname = $api->lcapi_get_room_name($liveclassroom->type);
+function liveclassroom_delete_all_instance_of_room($roomid)
+{
+ // / 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,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword);
- # Delete any dependent records here #
- foreach($liveclassrooms as $liveclassroom){
-
- //get the course_module instance linked to the liveclassroom instance
- if (! $cm = get_coursemodule_from_instance("liveclassroom", $liveclassroom->id, $liveclassroom->course)) {
- error("Course Module ID was incorrect");
- }
- if (! delete_course_module($cm->id)) {
- add_to_log($liveclassrooms->course, "liveclassroom", liveclassroom_send_logs("errorDeleteAllcm","liveclassroomId=".$liveclassroom->id."&roomname=$roomname&cm=".$cm->id), "Delete all activities", "Could not delete the ".$cm->id." (coursemodule)");
- $result = false;
- //Delete a course module and any associated data at the course level (events)
- // notify("Could not delete the $cm->id (coursemodule)");
- }
- if (! delete_records("liveclassroom", "id", "$liveclassroom->id")) {
- add_to_log($liveclassrooms->course, "liveclassroom", liveclassroom_send_logs("errorDeleteAlldb","liveclassroomId=".$liveclassroom->id."&roomname=$roomname"), "Delete all activities", "All activities associated to the room $roomname have not been deleted from the liveclassroom database");
- $result = false;
+ $result = true;
+ if ($liveclassrooms = get_records("liveclassroom", "type", $roomid))
+ {
+ $roomname = $api->lcapi_get_room_name($liveclassroom->type);
+ // Delete any dependent records here #
+ foreach($liveclassrooms as $liveclassroom)
+ {
+ // get the course_module instance linked to the liveclassroom instance
+ if (! $cm = get_coursemodule_from_instance("liveclassroom", $liveclassroom->id, $liveclassroom->course))
+ {
+ error("Course Module ID was incorrect");
+ }
+ if (! delete_course_module($cm->id))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Problem to delete the course module : ".$cm->id);
+ $result = false;
+ // Delete a course module and any associated data at the course level (events)
+ // notify("Could not delete the $cm->id (coursemodule)");
+ }
+ if (! delete_records("liveclassroom", "id", "$liveclassroom->id"))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Problem to delete all the activities associated to the voice tools");
+ $result = false;
+ }
+ // delete in the course section too
+ if (! delete_mod_from_section($cm->id, "$cm->section"))
+ {
+ wimba_add_log(WIMBA_ERROR,WC,"Could not delete the ".$cm->id." from that section : ".$cm->section);
+ $result = false;
+ // notify("Could not delete the $mod->modulename from that section");
+ }
}
- //delete in the course section too
- if (! delete_mod_from_section($cm->id, "$cm->section")) {
- add_to_log($liveclassrooms->course, "liveclassroom", liveclassroom_send_logs("errorDeleteAllsection","liveclassroomId=".$liveclassroom->id."&roomname=$roomname&cm=".$cm->id."§ion=".$cm->section), "Delete all activities", "Could not delete the ".$cm->id." from that section");
- $result = false;
- //notify("Could not delete the $mod->modulename from that section");
- }
-
- }
- }
-
- add_to_log($liveclassrooms->course, "liveclassroom", liveclassroom_send_logs("deleteAll","liveclassroomId=".$liveclassroom->id."&roomname=$roomname"), "Delete all activities", "All activities associated to the room $roomname have been deleted with success");
-
+ }
+
return $result;
-}
+}
-/*
-* Send info to the logs system
-* @param $type : type of the log
-* @param $parameters : string with the parameters needed
-* return a string which is the link to the logs file
-*/
-function liveclassroom_send_logs($type,$parameters) {
-
- global $LIVECLASSROOM_LOGS;
-
-
- $link = $LIVECLASSROOM_LOGS."?type=$type";
- $link .= "&$parameters";
- $link .= "&time=".time();
-
- return $link;
-}
-
?>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-02-19 22:21:27 UTC (rev 247)
+++ branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-02-19 22:22:47 UTC (rev 248)
@@ -1,6 +1,4 @@
-<!-- This page defines the form to create or edit an instance of this module -->
-<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
-<?PHP
+<?php
/******************************************************************************
* *
* Copyright (c) 1999-2007 Horizon Wimba, All Rights Reserved. *
@@ -32,13 +30,15 @@
require_once("../config.php");
require_once($CFG->dirroot.'/calendar/lib.php');
-include_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
-include_once($CFG->dirroot.'/mod/liveclassroom/lib/php/lc/LCAction.php');
+require_once($CFG->dirroot.'/mod/liveclassroom/lib/php/common/WimbaLib.php');
+require_once($CFG->dirroot.'/mod/liveclassroom/lib.php');
+require_once($CFG->dirroot.'/mod/liveclassroom/lib/php/lc/LCAction.php');
require_once($CFG->dirroot.'/version.php');
//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");
@@ -49,11 +49,12 @@
$roomId = optional_param('roomId',null, PARAM_RAW);
$update = optional_param('update', null, PARAM_INT);
$sectionId = optional_param('section', 0, PARAM_INT);
+$error=false;
-$lcApi=new LCAction(null,$CFG->liveclassroom_servername,
+$api=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))
{
@@ -88,7 +89,10 @@
$event=false;
$description="";
$stringDate="";
-//check if a calendar event exist
+$checked ="";
+$disabledCheckbox="";
+$disableAllElements="disabled";
+
if(isset($update))
{ //update
@@ -106,35 +110,46 @@
$event=liveclassroom_get_event_calendar($activity->id);
- if( $event==true)//no event
+ if( $event==true)
{
- $checked ="checked";
+ $disableAllElements="";
+ $checked ="checked";
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
+else
{//new
- $checked ="checked";
+ $checked ="";
$name="";
-}
-//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)
+ if($course->format == "weeks" && $sectionId == 0)
+ {
+ $disabledCheckbox="disabled";
+ $disableAllElements="disabled";
+
+ }
+ 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);
+ }
+}
+
+if($course->format == "weeks" || $course->format == "weekscss" && $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);
+ $disabledCheckbox="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
{
- $disabledCheckbox="";
- $disableAllElements="";
-}
-
+ $disabledCheckbox="";
+}
// Visible to students or not
if ($form->coursemodule)
@@ -161,13 +176,15 @@
?>
<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/liveclassroom/css/StyleSheet.css"" type="text/css" />
<style>
-body{
- font-size:14px;
+body
+{
+ font-size:14px;
}
.content
{
- margin:-5px;
+ margin:-5px;
}
+
</style>
<script type="text/javascript">
@@ -186,10 +203,11 @@
}
document.getElementById("form").submit();
}
+
function TestNoRoom()
{
<?php
- $rooms = $lcApi->getRooms($course->id."_T");
+ $rooms = $api->getRooms($course->id."_T");
if($rooms==false){
?>
</script>
@@ -310,7 +328,10 @@
if(document.getElementById("description")!=null)
{
createCookie("description_disabled",document.getElementById("description").disabled);
- }
+ }
+ if(document.getElementById("comment_date")!=null){
+ createCookie("comment_date",document.getElementById("comment_date").innerHTML);
+ }
//launch the workflow
location.href = "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $id;?>&createWorkflow=true";
}
@@ -360,7 +381,7 @@
?>
document.getElementById("start_month").disabled=value;
document.getElementById("start_year").disabled=value;
- <? } ?>
+ <?php } ?>
}
@@ -414,7 +435,7 @@
}
if(document.getElementById("calendar_event")!=null && readCookie("calendar_event")!=null)
{
- document.getElementById("calendar_event").checked=readCookie("calendar_event");
+ document.getElementById("calendar_event").checked=booleanValue(readCookie("calendar_event"));
document.getElementById("calendar_event").disabled=booleanValue(readCookie("calendar_event_disabled"));
deleteCookie("calendar_event");
deleteCookie("calendar_event_disabled");
@@ -477,8 +498,13 @@
document.getElementById("description").disabled=booleanValue(readCookie("description_disabled"));
deleteCookie("description");
deleteCookie("description_disabled");
- }
- change();
+ }
+ if(document.getElementById("comment_date")!=null && readCookie("comment_date")!=null)
+ {
+ document.getElementById("comment_date").innerHTML=readCookie("comment_date");
+ deleteCookie("comment_date");
+ }
+
}
function loadPage(){
@@ -495,7 +521,7 @@
<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">
+ <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/lib/web/pictures/items/headerbar-logo.png">
</td>
<td align="right" class="headerBarRight">
@@ -519,7 +545,7 @@
<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>
+ <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 ?>">
@@ -571,16 +597,17 @@
<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))
+ if( ($roomId==$room->getRoomId()) || ($update!=false && $api->getPrefix().$room->getRoomId()==$activity->type))
{
- echo "<OPTION selected VALUE=".$lcApi->getPrefix().$room->getRoomId().">".$name."</OPTION>";
+ echo "<OPTION selected VALUE=".$api->getPrefix().$room->getRoomId().">".$name."</OPTION>";
}
else
{
- echo "<OPTION VALUE=".$lcApi->getPrefix().$room->getRoomId().">".$name."</OPTION>";
+ echo "<OPTION VALUE=".$api->getPrefix().$room->getRoomId().">".$name."</OPTION>";
}
}
}
@@ -620,9 +647,9 @@
</tr>
<tr>
- <td align=right style="width:220px">
<?php
if($course->format == "weeks" || $course->format == "weekscss"){?>
+ <td align=right style="width:180px">
<select style="float:left" id="start_day" name= "start_day" onchange="change()" <?php echo $disableAllElements ?>>
<?php
for($i=0;$i<7;$i++){
@@ -634,8 +661,10 @@
?>
</select>
<label id="comment_date"><?php echo $stringDate;?></label>
+ </td>
<?
}else if($course->format == "topics" || $course->format == "social" || $course->format == "site"){?>
+ <td align=right style="width:240px">
<select id="start_month" name="start_month" <?php echo $disableAllElements ?>>
<?php
for($i=1;$i<=12;$i++){
@@ -666,9 +695,9 @@
}
?>
</select>
- <? }?>
+ </td>
+ <?php }?>
- </td>
<td align=left >
<select id="start_hr" name="start_hr" <?php echo $disableAllElements ?>>
<?php
@@ -723,7 +752,7 @@
</tr>
<tr>
<td align="right">
- <font class="fontCurrent"><? echo get_string('description_calendar', 'liveclassroom')?></font>
+ <font class="fontCurrent"><?php 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>
@@ -738,7 +767,7 @@
<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;?>/mod/liveclassroom/index.php?id=<?php echo $id;?>">
+ <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/lib/web/pictures/items/listitem-liveclassroomicon.gif" ><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $id;?>">
<?php print_string('activity_manageTools', 'liveclassroom')?></a>
</td>
<td id="setting_Create" class="action" align="right" onclick="self.location.href='<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>'">
@@ -773,35 +802,21 @@
<div id="hiddenDiv" class="opac">
<!--[if lte IE 6.5]><iframe></iframe><![endif]-->
</div>
-<div class="advancedPopup" id="popup">
- <div class="window-left">
- </div>
- <div class="window-middle">
- <table width="100%" border="0" cellpadding="5" cellspacing="3" style="padding:0px">
- <tr>
- <td class="popupTitle" colspan="3">
- <?php echo get_string("activity_welcome_to_wimba","liveclassroom") ?></td>
- <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/buttons/x_squared.png" id="IMG1" onclick="javascript:popupCancel()" width="15px"> </td>
- </tr>
-
- <tr>
- <td colspan="3">
- <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/voice_tools.png" id="picture" style="float:left;"...
[truncated message content] |