hw4mdl-svn Mailing List for Wimba Moodle Integration (Page 2)
Brought to you by:
jhlinder,
trollinger
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(7) |
Jun
|
Jul
(3) |
Aug
(13) |
Sep
(20) |
Oct
(20) |
Nov
(9) |
Dec
(49) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(34) |
Feb
|
Mar
|
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
(39) |
Feb
(14) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(3) |
Nov
(4) |
Dec
|
|
From: <tro...@us...> - 2008-02-11 21:25:55
|
Revision: 241
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=241&view=rev
Author: trollinger
Date: 2008-02-11 13:25:53 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
New management of the logs
Handle error
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
Added Paths:
-----------
branches/team/Thomas/integrations_common/php/vt/VtAction.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-11 21:15:38 UTC (rev 240)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-11 21:25:53 UTC (rev 241)
@@ -160,15 +160,17 @@
function manage_error($errno, $error, $file, $line, $context)
{
-
- if ($errno == E_USER_ERROR or $errno == E_ERROR) {
- wimba_add_log(WIMBA_ERROR,"general",$error);
-
+ global $error_wimba;
+ if ($errno == E_USER_ERROR or $errno == E_ERROR)
+ {
+ wimba_add_log(WIMBA_ERROR,"general",$error ." in ".$file." line ".$line);
+ $error_wimba = true;
}
- else
+ else if ($errno < E_USER_NOTICE)
{
- wimba_add_log(WIMBA_DEBUG,"general",$error);
+ wimba_add_log(WIMBA_DEBUG,"general",$error ." in ".$file." line ".$line);
}
+
}
function txt($string)
@@ -382,7 +384,6 @@
return $preview;
}
-
/**Add logs in moodledata
* param : the level og the log ('info', 'warn','error' or 'debug'), the message to display on the log
* return : void, store the log in MOODLEDATADIR/wimba/logs/LEVEL
@@ -426,4 +427,5 @@
}
}
+
?>
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-02-11 21:15:38 UTC (rev 240)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-02-11 21:25:53 UTC (rev 241)
@@ -512,8 +512,7 @@
elseif ($this->product == "pc")
{
$this->createGeneralInfoPanelStart();
- $this->createPodcasterNameExample();
- $this->createGeneralInfoPanelEnd();
+
$this->createPCInfoPanel();
//Media settings
$this->createPCMediaPanel();
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-11 21:15:38 UTC (rev 240)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-11 21:25:53 UTC (rev 241)
@@ -36,6 +36,7 @@
var $validationElements;
var $Informations;
var $error=NULL;
+ var $finalstring;
function WimbaXml()
{
@@ -48,27 +49,31 @@
*/
function getXml()
{
- $root = $this->xmldoc->create_element("root");
- $windows = $this->xmldoc->create_element("windows");
-
- if($this->error==NULL)
- {
- $root->append_child($this->Informations);
- foreach ($this->part as $key => $value)
+ if(empty($this->finalstring)){
+ $root = $this->xmldoc->create_element("root");
+ $windows = $this->xmldoc->create_element("windows");
+
+ if($this->error==NULL)
{
- $windows->append_child($this->addWindowsElement($key, $value));
- }
+
+ $root->append_child($this->Informations);
+ foreach ($this->part as $key => $value)
+ {
+
+ $windows->append_child($this->addWindowsElement($key, $value));
+ }
+ }
+ else
+ {
+ $windows->append_child($this->addWindowsElement("error",$this->error));
+ }
+
+ $root->append_child($windows);
+ $this->xmldoc->append_child($root);
+ $xmlstring = $this->xmldoc->dump_mem(true); // Xml datas into a string
+ $this->finalstring = str_replace("\n", '', $xmlstring);
}
- else
- {
- $windows->append_child($this->addWindowsElement("error",$this->error));
- }
-
- $root->append_child($windows);
- $this->xmldoc->append_child($root);
- $xmlstring = $this->xmldoc->dump_mem(true); // Xml datas into a string
- $finalstring = str_replace("\n", '', $xmlstring);
- return $finalstring;
+ return $this->finalstring;
}
/*
Added: branches/team/Thomas/integrations_common/php/vt/VtAction.php
===================================================================
--- branches/team/Thomas/integrations_common/php/vt/VtAction.php (rev 0)
+++ branches/team/Thomas/integrations_common/php/vt/VtAction.php 2008-02-11 21:25:53 UTC (rev 241)
@@ -0,0 +1,335 @@
+<?php
+class vtAction{
+
+ var $params;//stack of parameters
+
+ function vtAction($params=null)
+ {
+ $this->params=$params;
+ }
+
+ /**************
+ VOICE BOARD
+ *****************/
+ /*
+ * This function creates a voice board on the vt server
+ * params : elements of the form
+ */
+ function createBoard(){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("board"); //Voice Baord
+
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ if ($this->params["led"] == "student")
+ {
+ $options->setFilter("false");
+ $options->setShowCompose($this->params['show_compose']);
+ }
+ else
+ {
+ $options->setFilter("true");
+ $options->setShowCompose("false");
+ }
+
+ //Media
+ $audio->setName($this->params["audio_format"]);
+ //message length
+ $options->setMaxLength($this->params["max_length"]);
+ //Features
+ //short message titles
+ $options->setShortTitle($this->params["short_title"]);
+ //chronological order
+ $options->setChronoOrder($this->params["chrono_order"]);
+ //forward message
+ $options->setShowForward($this->params["show_forward"]);
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+ //create the resource on the vt server
+
+ $result = voicetools_api_create_resource($ressource->getResource());
+ if (VTAPI_DEBUG)
+ {
+ error_log (__FUNCTION__ ." : Board Created , rid=".$result->getRid(), TRUE);
+ }
+ return $result;
+ }
+
+ /*
+ * This function modifies a voice board on the vt server
+ */
+ function modifyBoard($id){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("board"); //Voice Baord
+
+ if(isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));;
+ }
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ if ($this->params["led"] == "student")
+ {
+ $options->setFilter("false");
+ $options->setShowCompose($this->params["show_compose"]);
+ }
+ else
+ {
+ $options->setFilter("true");
+ $options->setShowCompose("false");
+ }
+ //Media
+ $audio->setName($this->params["audio_format"]);
+ //message length
+ $options->setMaxLength($this->params["max_length"]);
+ //Features
+ //short message titles
+ $options->setShortTitle($this->params["short_title"]);
+ //chronological order
+ $options->setChronoOrder($this->params["chrono_order"]);
+ //forward message
+ $options->setShowForward($this->params["show_forward"]);
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+ //update
+ $ressource->setRid($id);
+
+ //create the resource on the vt server
+ $result = voicetools_api_modify_resource($ressource->getResource());
+ return $result;
+ }
+
+ /****************
+ VOICE PRESENTATION
+ ****************/
+ /*
+ * This function creates a voice presentation the vt server
+ */
+ function createPresentation(){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("presentation"); //Voice Baord
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"])) {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ $options->setFilter($this->params["filter"]);
+ //slides comments private
+ $options->setShowReply($this->params["show_reply"]);
+ $audio->setName($this->params["audio_format"]);
+ $options->setMaxLength($this->params["max_length"]);
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+ return $result;
+ }
+
+ /*
+ * This function modifies a voice presentation the vt server
+ * @param id : id of the resource
+ */
+ function modifyPresentation($id)
+ {
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("presentation"); //Voice Presentation
+
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ $options->setFilter($this->params["filter"]);
+ //slides comments private
+ $options->setShowReply($this->params["show_reply"]);
+ $audio->setName($this->params["audio_format"]);
+ //message length
+ $options->setMaxLength($this->params["max_length"]);
+
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+ $ressource->setRid($id);
+ //create the resource on the vt server
+ $result = voicetools_api_modify_resource($ressource->getResource());
+ return $result;
+ }
+
+ /********
+ Podcaster
+ **********/
+ /*
+ * This function creates a podcaster the vt server
+ */
+ function createPodcaster(){
+
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+
+ // Info
+ $ressource->setType("pc");//Podcaster
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+ $options->setShowCompose($this->params["show_compose"]);
+ //Media
+ $audio->setName($this->params["audio_format"]);
+ $options->setDelay($this->params["delay"]); //no delay
+ //Features
+ $options->setShortTitle($this->params["short_title"]);
+ $options->setShortTitle("false");
+ $options->setMaxLength(1200); //set to 20 min
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+ return $result;
+ }
+
+ /*
+ * This function modifies a podcaster the vt server
+ * @param id : id of the resource
+ */
+ function modifyPodcaster($id){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+
+ // Info
+ $ressource->setType("pc");//Podcaster
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ $options->setShowCompose($this->params["show_compose"]);
+ //Media
+ $audio->setName($this->params["audio_format"]);
+ $options->setDelay($this->params["delay"]); //no delay
+ //Features
+ $options->setShortTitle($this->params["short_title"]);
+
+ $options->setMaxLength(1200); //set to 20 min
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ $ressource->setRid($id);
+ //create the resource on the vt server
+ $result = voicetools_api_modify_resource($ressource->getResource());
+ return $result;
+ }
+
+ /********
+ Recorder
+ **********/
+ /*
+ * This function creates a recorder the vt server
+ * params : blocks' id
+ */
+ function createRecorder(){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+
+ // Info
+ $ressource->setType("recorder");
+
+ $options->setMaxLength(1200); //set to 20 min
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+
+ return $result;
+ }
+
+ function deleteResource($rid)
+ {
+ $result = voicetools_api_delete_resource($rid);
+ return $result;
+ }
+
+ function getResource($rid)
+ {
+ $result=voicetools_api_get_resource ($rid) ;
+ return $result;
+ }
+
+ function createUser($screenName,$email)
+ {
+ $vtUser = new VtUser(NULL);
+ $vtUser->setScreenName($screenName);
+ $vtUser->setEmail ($email);
+ return $vtUser;
+ }
+
+ function createUserRights($product,$role)
+ {
+ $vtUserRigths = new VtRights(NULL);
+ $vtUserRigths->setProfile ( 'moodle.'.$product.'.'.strtolower($role));
+ if($product=="presentation")
+ {
+ $vtUserRigths->add("reply_message");
+ }
+ return $vtUserRigths;
+ }
+
+ function getVtSession($resource,$user,$rights,$message=null)
+ {
+ if($message!=null)
+ {
+ return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights(),$message->getMessage()) ;
+ }
+ else
+ {
+ return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights()) ;
+ }
+ }
+}
+
+
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-02-11 21:15:41
|
Revision: 240
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=240&view=rev
Author: trollinger
Date: 2008-02-11 13:15:38 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
-handle error
-add logs
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/web/js/ajax.js
branches/team/Thomas/integrations_common/web/js/hwCommons.js
branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-05 22:48:13 UTC (rev 239)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-11 21:15:38 UTC (rev 240)
@@ -1,5 +1,10 @@
<?php
+define('WIMBA_INFO', 'info');
+define('WIMBA_WARN', 'warn');
+define('WIMBA_ERROR', 'error');
+define('WIMBA_DEBUG', 'debug');
+define('WIMBA_DIR', $CFG->dataroot . "/wimba");
/**
* Returns the keys of the general parameters passed by GET or POST
*/
@@ -155,13 +160,15 @@
function manage_error($errno, $error, $file, $line, $context)
{
- global $CFG;
- if ($errno < 10) {
- redirection('welcome.php?error=rrr');
+
+ if ($errno == E_USER_ERROR or $errno == E_ERROR) {
+ wimba_add_log(WIMBA_ERROR,"general",$error);
+
}
- if ($errno < 10) {
- // add to log
- }
+ else
+ {
+ wimba_add_log(WIMBA_DEBUG,"general",$error);
+ }
}
function txt($string)
@@ -262,12 +269,15 @@
}
}
-function storeResource($rid, $params)
+function storeResource($rid,$course_id, $params)
{
$voicetools = new Object();
$voicetools->rid = $rid;
- $voicetools->course = $params["course_id"];
- $voicetools->name = $params["name"];
+ $voicetools->course = $course_id;
+ if(isset($params["name"]))
+ {
+ $voicetools->name = $params["name"];
+ }
$voicetools->type = $params["type"];
if ($params != null)
@@ -303,11 +313,11 @@
return voicetools_store_new_element($voicetools);
}
-function updateResource($rid, $params)
+function updateResource($rid,$course_id, $params)
{
$voicetools = new Object();
$voicetools->rid = $rid;
- $voicetools->course = $params["course_id"];
+ $voicetools->course = $course_id;
$voicetools->type = $params["type"];
$voicetools->availability = $params["accessAvailable"];
@@ -372,4 +382,48 @@
return $preview;
}
+
+/**Add logs in moodledata
+ * param : the level og the log ('info', 'warn','error' or 'debug'), the message to display on the log
+ * return : void, store the log in MOODLEDATADIR/wimba/logs/LEVEL
+ */
+function wimba_add_log($level,$product,$message){
+
+//Set the log level values.
+$level_values = array(
+ WIMBA_DEBUG => 1,
+ WIMBA_INFO => 2,
+ WIMBA_WARN => 3,
+ WIMBA_ERROR => 4
+);
+ global $CFG;
+
+ $log_product = $product."_log_level";
+//Write on the logs only if the configured level allows it.
+ if ($product=="general" ||$level_values[$level] >= $CFG->$log_product){
+
+ // Gets the site shortname
+ $site = get_record('course','id',SITEID);
+
+ //Computes the timestamp corresponding to the day (at 00:00:00).
+ $today_timestamp = @mktime(0, 0, 0, date("m"), date("d"), date("Y"));
+
+ //If it doesn't exist, create the log folder'
+ @mkdir(WIMBA_DIR, 0700);
+
+ @mkdir(WIMBA_DIR . "/" . $product, 0700);
+
+ $wimba_logs= WIMBA_DIR . "/" . $product . "/logs";
+ @mkdir($wimba_logs, 0700);
+
+ //Computes the log filename. Space characters are replaced by unerscore, to have a correct filename.
+ $file = $wimba_logs."/".str_replace(' ','_',$site->shortname)."-".$today_timestamp."-wimba.log";
+
+ //Writes the message in the log, and close it
+ $fh = @fopen($file, "a");
+ @fwrite($fh,gmdate("Y-m-d H:i:s")." ".strtoupper($level)." ".$product." - ".$message."\n");
+ @fclose($fh);
+ }
+}
+
?>
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-05 22:48:13 UTC (rev 239)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-11 21:15:38 UTC (rev 240)
@@ -813,7 +813,7 @@
$ephones = $this->xmldoc->create_element("phones");
$ephoneL = $this->xmldoc->create_element("phoneLabel");
$ephoneL->append_child($this->xmldoc->create_text_node($phoneLabel));
- $ephones->append_child(ephoneL);
+ $ephones->append_child($ephoneL);
foreach ($toll as $key => $value)
{
if($key!="" && $value!="")
Modified: branches/team/Thomas/integrations_common/web/js/ajax.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/ajax.js 2008-02-05 22:48:13 UTC (rev 239)
+++ branches/team/Thomas/integrations_common/web/js/ajax.js 2008-02-11 21:15:38 UTC (rev 240)
@@ -161,6 +161,7 @@
if (action != null) {
url += "?action=" + action;
}
+
transform(url,"first",div,nextAction)
}
@@ -224,6 +225,7 @@
url:pathXsl,
mimetype:"application/xml",
load:function (type, data, evt) {
+
xslData = data;
var xml = xsltProcess(xmlSource, xslData);
hidePopup();
@@ -271,7 +273,7 @@
* (Google AJAXSLT) to execute the xslt transformation because it is not supported natively
*/
function transform(urlXml,TypeParams, div,nextAction) {
-
+
if(window.ActiveXObject){//ie
if(TypeParams=="first")
@@ -300,28 +302,28 @@
xsltTransformation(sourceDoc,xslDoc,div,nextAction);
- }else if (window.XSLTProcessor){//firefox
+ }
+ else if (window.XSLTProcessor)
+ {//firefox
if(TypeParams=="first")
params=getURLParametersTab();
else
params=getSessionParameters();
dojo.io.bind({url:urlXml, mimetype:"application/xml", load:function (type, data, evt) {
-
+
if (div == "all" && data.documentElement.getElementsByTagName("type")[0].childNodes[0].nodeValue!="error") {
createSessionByXmlDocument(data);
}
-
xmlSource = data;
+
//get the stylesheet
dojo.io.bind({
url:pathXsl,
mimetype:"application/xml",
load:function (type, data, evt) {
- //do the xslt transformatio
-
+ //do the xslt transformation
xsltTransformation(xmlSource,data,div,nextAction)
-
},
error:BadResult,
content:null,
@@ -371,7 +373,7 @@
* and add the html into the page
*/
function xsltTransformation(xml,xsl,div,nextAction){
-
+
if(window.ActiveXObject)//ie
{
var result = xml.transformNode(xsl);
@@ -394,7 +396,7 @@
var processor = new XSLTProcessor();
processor.setParameter(null, 'pathPictures', pathPictures);
-
+
processor.importStylesheet(xsl);
document.getElementById(div).innerHTML="";
var resultDocument = processor.transformToFragment(xml, document);
@@ -416,10 +418,10 @@
if(nextAction!="")
eval(nextAction);
- }else{
-
+ }
+ else
+ {
var xml = xsltProcess(xml, xsl);
-
//hide the loading page
if (div == "all") {
hidePopup();
Modified: branches/team/Thomas/integrations_common/web/js/hwCommons.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/hwCommons.js 2008-02-05 22:48:13 UTC (rev 239)
+++ branches/team/Thomas/integrations_common/web/js/hwCommons.js 2008-02-11 21:15:38 UTC (rev 240)
@@ -94,7 +94,7 @@
if(archiveMatched>0){//change the pciture
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, pathPictures+"listitem-show.png");
+ changePicture(pictureId, pathPictures+"/items/listitem-show.png");
}
elements[roomLinked].setAttribute("stateSearch", "");//change the status of the element to manage the display
elements[roomLinked].style.display = display;
@@ -136,10 +136,10 @@
//management of the picture to expand the archives
if(archiveMatched>0){
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, pathPictures+"listitem-hide.png");
+ changePicture(pictureId, pathPictures+"/items/listitem-hide.png");
}else{
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, pathPictures+"space-16px.png");
+ changePicture(pictureId, pathPictures+"/items/space-16px.png");
}
}
} else {
@@ -160,7 +160,7 @@
elements[roomLinked].style.display = display;
elements[roomLinked].setAttribute("stateSearch", "");
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, pathPictures+"listitem-hide.png");
+ changePicture(pictureId, pathPictures+"/items/listitem-hide.png");
}else{
elements[roomLinked].style.display = "none";
elements[roomLinked].setAttribute("stateSearch", "ignore");
@@ -189,18 +189,18 @@
if (currentId != "" && currentId != id) {
document.getElementById(currentId).style.backgroundColor = "white";
if(document.getElementById(currentId).getAttribute("typeProduct")=="archive"){
- document.getElementById(currentId+"_archive_subitem").src=pathPictures+"listitem-subitem.jpg";
- document.getElementById(currentId+"_archive_icon").src=pathPictures+"listitem-archiveicon.jpg";
+ document.getElementById(currentId+"_archive_subitem").src=pathPictures+"/items/listitem-subitem.jpg";
+ document.getElementById(currentId+"_archive_icon").src=pathPictures+"/items/listitem-archiveicon.jpg";
}
}
if (lineCurrentId != id) {
document.getElementById(id).style.backgroundColor = "#c3dbf7";
if(type=="archive"){
- document.getElementById(id+"_archive_subitem").src=pathPictures+"listitem-subitem-selected.jpg";
- document.getElementById(id+"_archive_icon").src=pathPictures+"listitem-archiveicon-selected.jpg";
+ document.getElementById(id+"_archive_subitem").src=pathPictures+"/items/listitem-subitem-selected.jpg";
+ document.getElementById(id+"_archive_icon").src=pathPictures+"/items/listitem-archiveicon-selected.jpg";
}
}
-
+
//update the current context
currentId = id;
currentProduct = product;
@@ -234,13 +234,13 @@
}
}
if(archiveAvailable==true){
- changePicture(id + "_ExpandPicture", pathPictures+"listitem-hide.png");
+ changePicture(id + "_ExpandPicture", pathPictures+"/items/listitem-hide.png");
div.style.height="";
document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='RemoveAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>Show Top 5...</label>";
expandState=1;
}
else{
- changePicture(id + "_ExpandPicture", pathPictures+"listitem-show.png");
+ changePicture(id + "_ExpandPicture", pathPictures+"/items/listitem-show.png");
if(expandState!=1)
document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='displayAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>"+(listRoomsArchives.length-numHide-5)+" more...</label>";
else
@@ -345,7 +345,7 @@
elements[i].style.display = "none";
if(elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") == "archive"){//this room contains archives
document.getElementById(elements[linkedRoom].id + "_ExpandPicture").style.visibility="visible";
- changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"listitem-show.png");
+ changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"/items/listitem-show.png");
while (elements[i + 1].getAttribute("typeProduct") == "archive") {
elements[i + 1].className = "archiveHide";
elements[i + 1].setAttribute("stateStudentView", "ignore");
@@ -370,7 +370,7 @@
}
if(archiveMatched==0){//hide the element which allow the expand/collapse
document.getElementById(elements[linkedRoom].id + "_ExpandPicture").style.visibility="hidden";
- changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"listitem-show.png");
+ changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"/items/listitem-show.png");
}
}
@@ -387,7 +387,7 @@
elements[i].style.display = display;
if(elements[i+1]!=null && elements[i+1].getAttribute("typeProduct") == "archive"){
document.getElementById(elements[i].id + "_ExpandPicture").style.visibility="visible";
- changePicture(document.getElementById(elements[i].id + "_ExpandPicture"), pathPictures+"listitem-show.png");
+ changePicture(document.getElementById(elements[i].id + "_ExpandPicture"), pathPictures+"/items/listitem-show.png");
}
} else {
@@ -447,6 +447,7 @@
changeFilterStatus(id, "rollover");
}
}
+
function outFilter(id) {
if (currentFilter == id) {
changeFilterStatus(id, "enabled");
@@ -454,6 +455,7 @@
changeFilterStatus(id, "disabled");
}
}
+
function changeFilterStatus(id, status) {
if (document.getElementById(id) != null) {
document.getElementById(id).className = "filter" + status;
@@ -609,7 +611,7 @@
* Filled the session array thanks to the xmlDocument
*/
function createSessionByXmlDocument(data) {
-
+
objDomTree = data.documentElement;
if (objDomTree.getElementsByTagName("timeOfLoad")[0].hasChildNodes() == true)
@@ -647,7 +649,6 @@
else
session["role"] ="";
-
//preload all the pictures
}
@@ -710,6 +711,7 @@
}
}
}
+
/*
* Launch the LiveClassroom into a popup
*/
@@ -723,6 +725,7 @@
window.open(complete_url, "lc_popup", "scrollbars=no,resizable=yes,width=700,height=500");
}
}
+
/*
* Launch the VoiceTools into a popup
*/
Modified: branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl
===================================================================
--- branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl 2008-02-05 22:48:13 UTC (rev 239)
+++ branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl 2008-02-11 21:15:38 UTC (rev 240)
@@ -41,20 +41,24 @@
<div class="popupDialContainer">
<xsl:if test="popupDial/phones/phone!=''">
<div class="popupDialContent">
- <table cellspacing="0" cellpadding="0" border="0" >
+ <table cellspacing="0" cellpadding="0" border="0" >
+ <tr>
+ <td colspan="2">
+ <label class='nameElement'>
+ <xsl:value-of select="popupDial/phones/phoneLabel" />
+ </label>
+ </td>
+ </tr>
<xsl:for-each select="popupDial/phones/phone">
<xsl:choose>
- <xsl:when test="position()=1">
+ <xsl:when test="position()=1">
<tr>
- <td align="right" style="width:143px;">
- <xsl:value-of select="preceding::phoneLabel[1]" />
- </td>
- <td align="right" style="width:95px;">
- <label class='nameElement'>
- <xsl:value-of select="phoneDesc"/> :
+ <td align="right" colspan="2">
+ <label>
+ <xsl:value-of select="phoneDesc"/> :
</label>
</td>
- <td align="left" style="width:100px;">
+ <td align="left">
<xsl:value-of select="number"/>
</td>
</tr>
@@ -62,8 +66,8 @@
<xsl:otherwise>
<tr>
<td align="right" colspan="2">
- <label class='nameElement'>
- <xsl:value-of select="phoneDesc"/> :
+ <label>
+ <xsl:value-of select="phoneDesc"/> :
</label>
</td>
<td align="left">
@@ -79,12 +83,16 @@
<div class="popupDialContent">
<table cellspacing="0" cellpadding="0" border="0" >
<tr>
- <td align="right" style="width:143px;">
- <xsl:value-of select="popupDial/pin/pinLabel" />
- </td>
- <td align="right" style="width:95px;">
+ <td colspan="2">
+ <label class='nameElement'>
+ <xsl:value-of select="popupDial/pin/pinLabel" />
+ </label>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" colspan="2">
<xsl:if test="popupDial/pin/instructor!=''">
- <label class='nameElement'>
+ <label>
Instructor :
</label>
</xsl:if>
@@ -95,7 +103,7 @@
</tr>
<tr>
<td align="right" colspan="2">
- <label class='nameElement'>
+ <label>
Student :
</label>
</td>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-02-05 22:48:15
|
Revision: 239
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=239&view=rev
Author: trollinger
Date: 2008-02-05 14:48:13 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Code cleaning
Modified Paths:
--------------
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/mod.html
branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
Modified: branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-02-05 22:47:59 UTC (rev 238)
+++ branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-02-05 22:48:13 UTC (rev 239)
@@ -39,6 +39,7 @@
require_once ("lib/php/common/WimbaUI.php");
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');
}
@@ -54,13 +55,19 @@
$courseid = $params["enc_course_id"];
require_login($courseid);
$action = required_param('action', PARAM_ALPHA);
+$createWorkflow = optional_param("createWorkflow", false, PARAM_BOOL); // course
-$session = new WimbaMoodleSession($params, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, $CFG->dataroot);
+$session = new WimbaMoodleSession($params);
$xml = new WimbaXml();
if ($session->error == false && $session != NULL) {
- $api = new LCAction($session, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, $CFG->dataroot);
+ $api = new LCAction($session,
+ $CFG->liveclassroom_servername,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword,
+ $CFG->dataroot);
+
$prefix = $api->getPrefix();
switch ($action) {
@@ -68,99 +75,158 @@
case "launch" :
$roomId = required_param('resource_id', PARAM_SAFEDIR);
- if ($params["studentView"] == "true") {
- $authToken = $api->getAuthokenNormal($session->getCourseId() . "_S", $session->getFirstname(), $session->getLastname());
- } else {
+ if ($params["studentView"] == "true")
+ {
+ $authToken = $api->getAuthokenNormal($session->getCourseId() . "_S",
+ $session->getFirstname(),
+ $session->getLastname());
+ }
+ else
+ {
$authToken = $api->getAuthoken();
}
- header('Location:' . $CFG->liveclassroom_servername . '/main/horizon_ui.pl.epl?channel=' . $roomId . '&hzA=' . $authToken);
+ redirection($CFG->liveclassroom_servername . '/main/horizon_ui.pl.epl?'.
+ 'channel=' . $roomId .
+ '&hzA=' . $authToken);
exit;
break;
+
case "create" :
$id = $api->createRoom(required_param('resource_id', PARAM_SAFEDIR), "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());
+ {
+ $roomId = trimPrefix(required_param('resource_id', PARAM_SAFEDIR), $api->getPrefix());
+ }
else
- $roomId = required_param('resource_id', PARAM_SAFEDIR);
-
+ {
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
+ }
$id = $api->deleteRoom($roomId);
//delte the activity linked to this room
- if (!liveclassroom_delete_all_instance_of_room($roomId)) {
+ if (!liveclassroom_delete_all_instance_of_room($roomId))
+ {
notify("Could not delete the activities for the room: $roomId");
}
$messageAction = "deleted";
$messageProduct = "room";
break;
+
case "openContent" :
$roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
- header('Location:' . $CFG->liveclassroom_servername . '/admin/class/carousels.epl?class_id=' . $roomId . '&hzA=' . $authToken . '&no_sidebar=1');
+ redirection ($CFG->liveclassroom_servername . '/admin/class/carousels.epl?'.
+ 'class_id=' . $roomId .
+ '&hzA=' . $authToken .
+ '&no_sidebar=1');
exit ();
break;
+
case "openReport" :
$roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
- header('Location:reports.php?id=' . $roomId . '&hzA=' . $authToken);
+ redirection ('reports.php?id=' . $roomId . '&hzA=' . $authToken);
exit ();
break;
+
case "openAdvancedMedia" :
$roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
- header('Location:' . $CFG->liveclassroom_servername . '/admin/class/media.pl?class_id=' . $roomId . '&hzA=' . $authToken . '&no_sidebar=1');
+ redirection ($CFG->liveclassroom_servername . '/admin/class/media.pl?'.
+ 'class_id=' . $roomId .
+ '&hzA=' . $authToken .
+ '&no_sidebar=1');
exit ();
break;
+
case "openAdvancedRoom" :
$roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
- header('Location:' . $CFG->liveclassroom_servername . '/admin/class/properties.pl?class_id=' . $roomId . '&hzA=' . $authToken . '&no_sidebar=1');
+ redirection ($CFG->liveclassroom_servername . '/admin/class/properties.pl?'.
+ 'class_id=' . $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)
- $xml->createPopupDialElement(get_string("popup_dial_title", "liveclassroom"), get_string("popup_dial_numbers", "liveclassroom"), get_string("popup_dial_pin", "liveclassroom"), null, $select_room->getParticipantPin(), $api->getPhoneNumbers());
+ {
+ $xml->createPopupDialElement(get_string("popup_dial_title", "liveclassroom"),
+ get_string("popup_dial_numbers", "liveclassroom"),
+ get_string("popup_dial_pin", "liveclassroom"),
+ null,
+ $select_room->getParticipantPin(),
+ $api->getPhoneNumbers());
+ }
else
- $xml->createPopupDialElement(get_string("popup_dial_title", "liveclassroom"), get_string("popup_dial_numbers", "liveclassroom"), get_string("popup_dial_pin", "liveclassroom"), $select_room->getPresenterPin(), $select_room->getParticipantPin(), $api->getPhoneNumbers());
- echo $xml->getXml();
+ {
+ $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());
+ }
+ 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);
+ {
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
+ }
$id = $api->createRoom($roomId, "true");
+ echo "good";
+ exit ();
break;
}
- if ($action == "saveSettings") {
- echo "good";
- exit ();
- }
- if (isset ($params["createWorkflow"]) && $params["createWorkflow"] == "true") {
- ?>
- <script>
- parent.location.href="<?php echo $CFG->wwwroot . '/course/mod.php?section=0&sesskey=' . sesskey() . '&id=' . $session->getCourseId() . '&add=liveclassroom&roomId=' . $api->getPrefix().$id ?>"
- </script>
- <?
- } else if ($action != "getDialInformation") {
+ if ($createWorkflow == true)
+ {
+ parentRedirection($CFG->wwwroot . '/course/mod.php?'.
+ 'section=0'.
+ '&sesskey=' . sesskey() .
+ '&id=' . $session->getCourseId() .
+ '&add=liveclassroom'.
+ '&roomId=' . $api->getPrefix().$id );
+ }
+ else if ($action != "getDialInformation")
+ {
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&messageAction=' . $messageAction . '&messageProduct=' . $messageProduct);
+ redirection ('welcome.php?'.
+ 'id=' . $session->getCourseId() .
+ '&' . $session->url_params .
+ '&time=' . $session->timeOfLoad .
+ '&messageAction=' . $messageAction .
+ '&messageProduct=' . $messageProduct);
}
-} else {
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=session');
}
+else
+{
+ redirection ('welcome.php?'.
+ 'id=' . $session->getCourseId() .
+ '&' . $session->url_params .
+ '&time=' . $session->timeOfLoad .
+ '&error=session');
+}
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-02-05 22:47:59 UTC (rev 238)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-02-05 22:48:13 UTC (rev 239)
@@ -55,35 +55,34 @@
require_login($params["en_course_id"]);
-if(isset($params["error"])){
+if(isset($params["error"]))
+{
$display=$uiManager->setError(get_string ($params["error"], 'liveclassroon'));
}
else
{
-
- $session=new WimbaMoodleSession($params);
-
- if(isset($params["messageProduct"]) && isset($params["messageAction"]))
- $message=get_string("message_" . $params["messageProduct"] . "_start", "liveclassroom")." ".$params["messageProductName"]." ".get_string("message_" . $params["messageAction"] . "_end","liveclassroom");
- $api=new LCAction($session,$CFG->liveclassroom_servername,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword,$CFG->dataroot);
-
- $uiManager=new WimbaUI($session,$api);
- if($session->error==false)//good
- {
-
-
- $display=$uiManager->getLCPrincipalView($message);
-
- }
- else{
- if($session->error=="session")
- $display=$uiManager->setError(get_string ('error_session', 'liveclassroon'));
- else if($session->error=="signature")
- $display=$uiManager->setError(get_string ('error_signature', 'liveclassroon'));
- }
+ $session=new WimbaMoodleSession($params);
+
+ if(isset($params["messageProduct"]) && isset($params["messageAction"]))
+ {
+ $message=get_string("message_" . $params["messageProduct"] . "_start", "liveclassroom").
+ " ".$params["messageProductName"]." ".get_string("message_" .
+ $params["messageAction"] . "_end","liveclassroom");
+ }
+ $api=new LCAction($session,$CFG->liveclassroom_servername,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword,$CFG->dataroot);
+
+ $uiManager=new WimbaUI($params,$api);
+ if($uiManager->getSessionError()==false)//good
+ {
+ $uiManager->getLCPrincipalView($message);
+ }
+ else
+ {
+ $uiManager->setError(get_string ('error_'.$uiManager->getSessionError(), 'liveclassroon'));
+ }
}
-echo $display;
+echo $uiManager->getXmlString();
?>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-02-05 22:47:59 UTC (rev 238)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-02-05 22:48:13 UTC (rev 239)
@@ -51,34 +51,30 @@
$action = optional_param('action', PARAM_ALPHA);
$currentIdtab = optional_param('idtab', null, PARAM_ALPHA);
-$session=new WimbaMoodleSession($params);
-if($session->error==false)//good
+$api=new LCAction($session,$CFG->liveclassroom_servername,
+ $CFG->liveclassroom_adminusername,
+ $CFG->liveclassroom_adminpassword,$CFG->dataroot);
+$uiManager=new WimbaUI($params,$api,$currentIdtab);
+
+if($uiManager->getSessionError()==false)//good
{
- if($action == 'update') {
- $api=new LCAction($session,$CFG->liveclassroom_servername,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword,$CFG->dataroot);
+ if($action == 'update')
+ {
$roomId = required_param('resource_id', PARAM_SAFEDIR );
$room_info = $api->getRoom($roomId);
- if($room_info!=false){
-
- $uiManager=new WimbaUI($session,$api,$currentIdtab);
-
- $uiManager->setCurrentProduct("liveclassroom",$room_info);
+ if($room_info!=false)
+ {
+ $uiManager->setCurrentProduct("liveclassroom",$room_info);
}
- else {
+ else
+ {
//problem to get the vt resource
- $display=$uiManager->setError(get_string ('error_connection_lc', 'liveclassroon'));
-
+ $uiManager->setError(get_string ('error_connection_lc', 'liveclassroon'));
}
- $uiManager=new WimbaUI($session,$api,$currentIdtab);
- $uiManager->setCurrentProduct("liveclassroom",$room_info);
- }else{
- $api=new LCAction($session,$CFG->liveclassroom_servername,
- $CFG->liveclassroom_adminusername,
- $CFG->liveclassroom_adminpassword,$CFG->dataroot);
- $uiManager=new WimbaUI($session,$api);
+ }
+ else
+ {
$uiManager->setCurrentProduct("liveclassroom");
}
@@ -86,19 +82,16 @@
$createWorkflow= "true";
else
$createWorkflow="false";
- $display=$uiManager->getLCSettingsView($action,$createWorkflow);
+
+ $uiManager->getLCSettingsView($action,$createWorkflow);
}
else
{
- $uiManager=new WimbaUI($session);
- if($session->error=="session")
- $display=$uiManager->setError(get_string ('error_session', 'liveclassroon'));
- else if($session->error=="signature")
- $display=$uiManager->setError(get_string ('error_signature', 'liveclassroon'));
+ $uiManager->setError(get_string ('error_'.$uiManager->getSessionError(), 'liveclassroon'));
}
-echo $display;
+echo $uiManager->getXmlString();
?>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-02-05 22:47:59 UTC (rev 238)
+++ branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-02-05 22:48:13 UTC (rev 239)
@@ -39,7 +39,8 @@
//test if the current user can see this page
require_login($course->id);
-if (!isteacher($course->id, $USER->id)) { //to Be sure
+if (!isteacher($course->id, $USER->id))
+{ //to Be sure
error("You need to be a teacher in this course to create an instance");
}
@@ -54,36 +55,46 @@
$CFG->liveclassroom_adminpassword, $CFG->dataroot,$id);
/// First we check that form variables have been initialised
-if (!isset($form->name)) {
+if (!isset($form->name))
+{
$form->name = '';
}
-if (!isset($form->type)) {
+if (!isset($form->type))
+{
$form->type = '';
}
-if (!isset($form->intro)) {
+if (!isset($form->intro))
+{
$form->intro = '';
}
-if (!isset($form->descrption)) {
+if (!isset($form->descrption))
+{
$form->descrption = '';
}
-if (!isset($form->section)) {
+if (!isset($form->section))
+{
$form->section = '';
}
- if (empty($form->timeopen)) {
- $form->timeopen = "";
- $form->timerestrict = 0;
- } else {
- $form->timerestrict = 1;
- }
+ if (empty($form->timeopen))
+{
+ $form->timeopen = "";
+ $form->timerestrict = 0;
+}
+else
+{
+ $form->timerestrict = 1;
+}
$event=false;
$description="";
$stringDate="";
//check if a calendar event exist
-if(isset($update)){ //update
+if(isset($update))
+{ //update
//get the information of the activity
- if (! $cmLiveclass = get_record("course_modules", "id", $update)) {
+ if (! $cmLiveclass = get_record("course_modules", "id", $update))
+ {
return false;
}
$activity = get_record("liveclassroom", "id", $cmLiveclass->instance );
@@ -100,7 +111,6 @@
$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
}
@@ -112,7 +122,8 @@
}
//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 == "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)) ;
@@ -126,13 +137,17 @@
// Visible to students or not
-if ($form->coursemodule) {
+if ($form->coursemodule)
+{
$visible = get_field('course_modules', 'visible', 'id', $form->coursemodule);
-} else {
+}
+else
+{
$visible = true;
}
-if ($form->mode == 'add') { // in this case $form->section is the section number, not the id
+if ($form->mode == 'add')
+{ // in this case $form->section is the section number, not the id
$hiddensection = !get_field('course_sections', 'visible', 'section', $form->section, 'course', $form->course);
}
else
@@ -209,57 +224,97 @@
function LaunchCreateWorkflow(){
//save the form fields
if(document.getElementById("name")!=null)
+ {
createCookie("name",document.getElementById("name").value);
+ }
if(document.getElementById("section")!=null)
+ {
createCookie("section",document.getElementById("section").selectedIndex);
+ }
if(document.getElementById("menuvisible")!=null)
+ {
createCookie("menuvisible",document.getElementById("menuvisible").selectedIndex);
+ }
//calendar
if(document.getElementById("calendar_event")!=null)
+ {
createCookie("calendar_event",document.getElementById("calendar_event").checked);
+ }
if(document.getElementById("start_month")!=null)
+ {
createCookie("start_month",document.getElementById("start_month").selectedIndex);
+ }
if(document.getElementById("start_day")!=null)
+ {
createCookie("start_day",document.getElementById("start_day").selectedIndex);
+ }
if(document.getElementById("start_year")!=null)
+ {
createCookie("start_year",document.getElementById("start_year").selectedIndex);
+ }
if(document.getElementById("start_hr")!=null)
+ {
createCookie("start_hr",document.getElementById("start_hr").selectedIndex);
+ }
if(document.getElementById("start_min")!=null)
+ {
createCookie("start_min",document.getElementById("start_min").selectedIndex);
+ }
if(document.getElementById("duration_hr")!=null)
+ {
createCookie("duration_hr",document.getElementById("duration_hr").selectedIndex);
+ }
if(document.getElementById("duration_min")!=null)
+ {
createCookie("duration_min",document.getElementById("duration_min").selectedIndex);
+ }
if(document.getElementById("description")!=null)
+ {
createCookie("description",document.getElementById("description").value);
+ }
-
//manage the availability of the calendar
if(document.getElementById("calendar_event")!=null)
+ {
createCookie("calendar_event_disabled",document.getElementById("calendar_event").disabled);
+ }
if(document.getElementById("start_month")!=null)
+ {
createCookie("start_month_disabled",document.getElementById("start_month").disabled);
+ }
if(document.getElementById("start_day")!=null)
+ {
createCookie("start_day_disabled",document.getElementById("start_day").disabled);
+ }
if(document.getElementById("start_year")!=null)
+ {
createCookie("start_year_disabled",document.getElementById("start_year").disabled);
+ }
if(document.getElementById("start_hr")!=null)
+ {
createCookie("start_hr_disabled",document.getElementById("start_hr").disabled);
+ }
if(document.getElementById("start_min")!=null)
+ {
createCookie("start_min_disabled",document.getElementById("start_min").disabled);
+ }
if(document.getElementById("duration_hr")!=null)
+ {
createCookie("duration_hr_disabled",document.getElementById("duration_hr").disabled);
+ }
if(document.getElementById("duration_min")!=null)
+ {
createCookie("duration_min_disabled",document.getElementById("duration_min").disabled);
+ }
if(document.getElementById("description")!=null)
+ {
createCookie("description_disabled",document.getElementById("description").disabled);
-
+ }
//launch the workflow
location.href = "<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $id;?>&createWorkflow=true";
}
-
+
function createCookie(name,value,days) {
if (days) {
var date = new Date();
@@ -269,6 +324,7 @@
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
+
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
@@ -300,23 +356,25 @@
document.getElementById("description").disabled=value;
document.getElementById("start_day").disabled=value;
<?php
- if($course->format=="topics" || $course->format == "social" || $course->format=="site" ){
+ if($course->format=="topics" || $course->format == "social" || $course->format=="site" ){
?>
document.getElementById("start_month").disabled=value;
document.getElementById("start_year").disabled=value;
- <? }
- ?>
+ <? } ?>
}
function change(){
- if(document.getElementById("section").value == 0){
+ if(document.getElementById("section").value == 0)
+ {
hideCalendarEvent("disabled");
document.getElementById("calendar_event").disabled="disabled";
if(document.getElementById("comment_date")!=null)
document.getElementById("comment_date").innerHTML="";
- }else{
+ }
+ else
+ {
document.getElementById("calendar_event").disabled="";
if(document.getElementById("calendar_event").checked==false)
hideCalendarEvent("disabled");
@@ -339,70 +397,82 @@
function FillForm(){
- if(document.getElementById("name")!=null && readCookie("name")!=null){
+ if(document.getElementById("name")!=null && readCookie("name")!=null)
+ {
document.getElementById("name").value=[readCookie("name")];
deleteCookie("name");
}
- if(document.getElementById("section")!=null && readCookie("section")!=null){
+ if(document.getElementById("section")!=null && readCookie("section")!=null)
+ {
document.getElementById("section")[readCookie("section")].selected=true;
deleteCookie("section");
}
- if(document.getElementById("menuvisible")!=null && readCookie("menuvisible")!=null){
+ if(document.getElementById("menuvisible")!=null && readCookie("menuvisible")!=null)
+ {
document.getElementById("menuvisible")[readCookie("menuvisible")].selected=true;
deleteCookie("menuvisible");
}
- if(document.getElementById("calendar_event")!=null && readCookie("calendar_event")!=null){
+ if(document.getElementById("calendar_event")!=null && readCookie("calendar_event")!=null)
+ {
document.getElementById("calendar_event").checked=readCookie("calendar_event");
document.getElementById("calendar_event").disabled=booleanValue(readCookie("calendar_event_disabled"));
deleteCookie("calendar_event");
deleteCookie("calendar_event_disabled");
}
- if(document.getElementById("start_month")!=null && readCookie("start_month")!=null){
+ if(document.getElementById("start_month")!=null && readCookie("start_month")!=null)
+ {
document.getElementById("start_month")[readCookie("start_month")].selected=true;
document.getElementById("start_month").disabled=booleanValue(readCookie("start_month_disabled"));
deleteCookie("start_month");
deleteCookie("start_month_disabled");
}
- if(document.getElementById("start_day")!=null && readCookie("start_day")!=null){
+ if(document.getElementById("start_day")!=null && readCookie("start_day")!=null)
+ {
document.getElementById("start_day")[readCookie("start_day")].selected=true;
document.getElementById("start_day").disabled=booleanValue(readCookie("start_day_disabled"));
deleteCookie("start_day");
deleteCookie("start_day_disabled");
}
- if(document.getElementById("start_year")!=null && readCookie("start_year")!=null){
+ if(document.getElementById("start_year")!=null && readCookie("start_year")!=null)
+ {
document.getElementById("start_year")[readCookie("start_year")].selected=true;
document.getElementById("start_year").disabled=booleanValue(readCookie("start_year_disabled"));
deleteCookie("start_year");
deleteCookie("start_year_disabled");
}
- if(document.getElementById("start_hr")!=null && readCookie("start_hr")!=null){
+ if(document.getElementById("start_hr")!=null && readCookie("start_hr")!=null)
+ {
document.getElementById("start_hr")[readCookie("start_hr")].selected=true;
document.getElementById("start_hr").disabled=booleanValue(readCookie("start_hr_disabled"));
deleteCookie("start_hr");
deleteCookie("start_hr_disabled");
}
- if(document.getElementById("duration_hr")!=null && readCookie("duration_hr")!=null){
+ if(document.getElementById("duration_hr")!=null && readCookie("duration_hr")!=null)
+ {
document.getElementById("duration_hr")[readCookie("duration_hr")].selected=true;
document.getElementById("duration_hr").disabled=booleanValue(readCookie("duration_hr_disabled"));
deleteCookie("duration_hr");
deleteCookie("duration_hr_disabled");
}
- if(document.getElementById("duration_min")!=null && readCookie("duration_min")!=null){
+ if(document.getElementById("duration_min")!=null && readCookie("duration_min")!=null)
+ {
document.getElementById("duration_min")[readCookie("duration_min")].selected=true;
document.getElementById("duration_min").disabled=booleanValue(readCookie("duration_min_disabled"));
deleteCookie("duration_min");
deleteCookie("duration_min_disabled");
}
- if(document.getElementById("start_min")!=null && readCookie("start_min")!=null){
+ if(document.getElementById("start_min")!=null && readCookie("start_min")!=null)
+ {
document.getElementById("start_min")[readCookie("start_min")].selected=true;
document.getElementById("start_min").disabled=booleanValue(readCookie("start_min_disabled"));
deleteCookie("start_min");
deleteCookie("start_min_disabled");
}
- if(document.getElementById("description")!=null && readCookie("description")!=null){
+ if(document.getElementById("description")!=null && readCookie("description")!=null)
+ {
document.getElementById("description").value=readCookie("description");
document.getElementById("description").disabled=booleanValue(readCookie("description_disabled"));
deleteCookie("description");
Modified: branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-02-05 22:47:59 UTC (rev 238)
+++ branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-02-05 22:48:13 UTC (rev 239)
@@ -48,19 +48,18 @@
<title>Live ClassRooms</title>
</head>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
-<script language="javascript" src="lib/web/js/constants.js"></script>
-<script language="javascript" src="lib/web/js/dojo/dojo.js"></script>
-<script language="javascript" src="lib/web/js/ajax.js"></script>
-<script language="javascript" src="lib/web/js/verifForm.js"></script>
-
+<script type="text/javascript" src="lib/web/js/dojo/dojo.js"></script>
+<script type="text/javascript" src="lib/web/js/ajax.js"></script>
+<script type="text/javascript" src="lib/web/js/verifForm.js"></script>
+<script type="text/javascript" src="lib/web/js/constants.js"></script>
<script type="text/javascript" src="lib/web/js/ajaxslt/xslt.js"></script>
<script type="text/javascript" src="lib/web/js/pngfix.js"></script>
-<script src="lib/web/js/ajaxslt/util.js" type="text/javascript"></script>
-<script src="lib/web/js/ajaxslt/xmltoken.js" type="text/javascript"></script>
-<script src="lib/web/js/ajaxslt/dom.js" type="text/javascript"></script>
-<script src="lib/web/js/ajaxslt/xpath.js" type="text/javascript"></script>
-<script src="lib/web/js/hwCommons.js" type="text/javascript"></script>
-<script src="lib/web/js/xmldom.js" type="text/javascript"></script>
+<script type="text/javascript" src="lib/web/js/ajaxslt/util.js"></script>
+<script type="text/javascript" src="lib/web/js/ajaxslt/xmltoken.js"></script>
+<script type="text/javascript" src="lib/web/js/ajaxslt/dom.js"></script>
+<script type="text/javascript" src="lib/web/js/ajaxslt/xpath.js"></script>
+<script type="text/javascript" src="lib/web/js/hwCommons.js"></script>
+<script type="text/javascript" src="lib/web/js/xmldom.js" ></script>
<script type="text/javascript">
function doOpenAddActivity(url,param){
@@ -110,15 +109,18 @@
</style>
<?php
-if(isset($_GET["createWorkflow"])){
- $firstPage= "generateSettings.php";
- $createWorkflow="true";
-}else{
- $firstPage="generateListRooms.php";
- $createWorkflow="false";
+if(isset($_GET["createWorkflow"]))
+{
+ $firstPage= "generateSettings.php";
+ $createWorkflow="true";
}
+else
+{
+ $firstPage="generateListRooms.php";
+ $createWorkflow="false";
+}
?>
-<body onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ;?>','all','','','<?php echo $createWorkflow;?>');">
+<body id="body" onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ?>','all','','','<?php echo $createWorkflow;?>');">
<div id="all" style="display:block;border:solid 1px #808080;width:700px;height:400px;"></div>
<div id="dialInfo" style="display:none;"></div>
<div id="loading" style="display:none;border:solid 1px #808080;width:700px;height:400px">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-02-05 22:48:01
|
Revision: 238
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=238&view=rev
Author: trollinger
Date: 2008-02-05 14:47:59 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Code cleaning
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css
branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
branches/team/Thomas/moodle/mod/voicetools/index.php
branches/team/Thomas/moodle/mod/voicetools/lib.php
branches/team/Thomas/moodle/mod/voicetools/manageAction.php
branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php
branches/team/Thomas/moodle/mod/voicetools/mod.html
branches/team/Thomas/moodle/mod/voicetools/view.php
branches/team/Thomas/moodle/mod/voicetools/voicerecorder.php
branches/team/Thomas/moodle/mod/voicetools/welcome.php
Modified: branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css 2008-02-05 22:47:59 UTC (rev 238)
@@ -9,11 +9,6 @@
font-size:8px;
}
-*
-{
- margin:0;
- padding:0;
-}
/*general html element*/
input
@@ -144,7 +139,6 @@
background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
height: 30px;
width: 100%;
- border-bottom: solid 1px #F0F0F0;
}
.contextBarRight
@@ -278,7 +272,7 @@
.list_archive
{
width:16px;
- border-bottom: solid 1px #F3F3F3;
+ border-bottom: solid 1px #F3F3F3;
}
.list_information
@@ -492,7 +486,6 @@
padding-left:5%;
padding-right:5%;
margin-top:7%;
-
display: block;
height: 247px;
}
@@ -535,7 +528,7 @@
}
*>html .choiceVtonly td {
- height:103px;
+ height:105px;
}
product_choice_left
@@ -586,7 +579,7 @@
/*MessageBar*/
#messageBar
{
- width:99%;
+ width:700px;
}
.message
@@ -596,7 +589,7 @@
bottom:4px;
left:1px;
right:1px;
- height: 20px;
+ height: 25px;
display: block;
}
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -28,64 +28,95 @@
******************************************************************************/
/* $Id: getXmlChoicePage.php 52853 2007-08-24 17:55:26Z thomasr $ */
-global $CFG;
-require_once("../../config.php");
-require_once("lib.php");
-require_once("lib/php/common/WimbaXml.php");
-require_once("lib/php/common/WimbaCommons.php");
-require_once("lib/php/common/WimbaLib.php");
-if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/php/common/domxml-php4-php5.php');
-}
-$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
-foreach(getKeysOfGeneralParameters() as $param){
- $value=optional_param($param["value"],$param["default_value"],$param["type"]);
- if($value!=null)
- $params[$param["value"]] = $value;
-}
-
-ini_set('display_errors','off');
-ini_set('log_errors','on');
-require_login($params["enc_course_id"]);
-$xml=new WimbaXml();
-$session=new WimbaMoodleSession($params);
-if($session->error==false)//no error
-{
- /********
- HEADER
- *********/
- $xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
- /********
- SESSION
- *********/
- $xml->CreateInformationElement($session->timeOfLoad,$session->hparams["firstname"],$session->hparams["lastname"],$session->hparams["email"],$session->hparams["role"],$session->hparams["course_id"],$session->signature,"","",$CFG->voicetools_servername);
-
- /************
- INFORMATIONS
- *************/
- $xml->addContextElement(get_string('new_tool','voicetools'));
-
- /***************
- PRODUCTS CHOICE
- ****************/
- $xml->addProductChoice("lib/web/pictures/buttons/new-createvoiceboard.png",get_string('new_board', 'voicetools'),get_string('VoiceBoardDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','board','all','".$createWorkflow."')");
-
- $xml->addProductChoice("lib/web/pictures/buttons/new-createvoicepresentation.png",get_string('new_presentation', 'voicetools'),get_string('VoicePresentationDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','presentation','all','".$createWorkflow."')");
- $xml->addProductChoice("lib/web/pictures/buttons/new-createpodcaster.png",get_string('new_podcaster', 'voicetools'),get_string('PodcasterDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','pc','all','".$createWorkflow."')");//for 3.1
-
- /***************
- VALIDATION BAR
- ****************/
- $actionParameters = array("value"=>get_string('cancel', 'voicetools'),"style"=>"action","action"=>"launchAjaxRequest");
-
- if($createWorkflow=="true")
- $xml->createValidationButtonElement(get_string("validationElement_cancel", "voicetools"), "action", "javascript:redirectToActivity('manageAction.php','redirection','','".$createWorkflow."')", "setting_Cancel");
- else
- $xml->createValidationButtonElement(get_string("validationElement_cancel", "voicetools"), "action", "javascript:launchAjaxRequest('getXmlListPanel.php','',true,'all')", "setting_Cancel");
-
-
-}else{ //bad session
- $xml->setError(get_string ($session->error, 'voicetools'));
-}
-echo $xml->getXml();
+ global $CFG;
+ require_once("../../config.php");
+ require_once("lib.php");
+ require_once("lib/php/common/WimbaXml.php");
+ require_once("lib/php/common/WimbaCommons.php");
+ require_once("lib/php/common/WimbaLib.php");
+ 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["enc_course_id"]);
+ $createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+ $xml=new WimbaXml();
+ $session=new WimbaMoodleSession($params);
+
+ if($session->error==false)//no error
+ {
+ /********
+ HEADER
+ *********/
+ $xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
+ /********
+ SESSION
+ *********/
+ $xml->CreateInformationElement($session->timeOfLoad,
+ $session->hparams["firstname"],
+ $session->hparams["lastname"],
+ $session->hparams["email"],
+ $session->hparams["role"],
+ $session->hparams["course_id"],
+ $session->signature,"");
+ /************
+ INFORMATIONS
+ *************/
+ $xml->addContextBarElement(get_string('new_tool','voicetools'));
+
+ /***************
+ PRODUCTS CHOICE
+ ****************/
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createvoiceboard.png",
+ get_string('new_board', 'voicetools'),
+ get_string('VoiceBoardDescription', 'voicetools'),
+ "javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','board','all','".$createWorkflow."')");
+
+
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createvoicepresentation.png",
+ get_string('new_presentation', 'voicetools'),
+ get_string('VoicePresentationDescription', 'voicetools'),
+ "javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','presentation','all','".$createWorkflow."')");
+
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createpodcaster.png",
+ get_string('new_podcaster', 'voicetools'),
+ get_string('PodcasterDescription', 'voicetools'),
+ "javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','pc','all','".$createWorkflow."')");//for 3.1
+
+ /***************
+ VALIDATION BAR
+ ****************/
+ $actionParameters = array("value"=>get_string('cancel', 'voicetools'),
+ "style"=>"action",
+ "action"=>"launchAjaxRequest");
+
+ if($createWorkflow==true)
+ {
+ $xml->createValidationButtonElement(get_string("validationElement_cancel", "voicetools"),
+ "action",
+ "javascript:redirectToActivity('manageAction.php','redirection','','".$createWorkflow."')",
+ "setting_Cancel");
+ }
+ else
+ {
+ $xml->createValidationButtonElement(get_string("validationElement_cancel", "voicetools"),
+ "action",
+ "javascript:launchAjaxRequest('getXmlListPanel.php','',true,'all')",
+ "setting_Cancel");
+ }
+
+ }else
+ { //bad session
+ $xml->setError(get_string ($session->error, 'voicetools'));
+ }
+ echo $xml->getXml();
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -56,11 +56,8 @@
}
require_login($params["enc_course_id"]);
-$session=new WimbaMoodleSession($params);
-$uiManager=new WimbaUI($session);
+$uiManager=new WimbaUI($params);
-
-
if(isset($params["error"]) )
{
$uiManager->setError(get_string ($params["error"], 'voicetools'));
@@ -68,7 +65,7 @@
else
{
//Session Management
- if($session->error==false)//good
+ if($uiManager->getSessionError()==false)//good
{
$message="";
if(!empty($messageProduct) && !empty($messageAction))
@@ -77,7 +74,7 @@
}
else
{ //bad session
- $uiManager->setError(get_string ('error_'.$session->error, 'voicetools'));
+ $uiManager->setError(get_string ('error_'.$uiManager->getError(), 'voicetools'));
}
}
echo $uiManager->getXmlString();
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -1,109 +1,103 @@
-<?php
+<?php
/******************************************************************************
-* *
-* Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. *
-* *
-* COPYRIGHT: *
-* This software is the property of Horizon Wimba. *
-* You can redistribute it and/or modify it under the terms of *
-* the GNU General Public License as published by the *
-* Free Software Foundation. *
-* *
-* WARRANTIES: *
-* This software is distributed in the hope that it will be useful, *
-* but WITHOUT ANY WARRANTY; without even the implied warranty of *
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
-* GNU General Public License for more details. *
-* *
-* You should have received a copy of the GNU General Public License *
-* along with the Horizon Wimba Moodle Integration; *
-* if not, write to the Free Software Foundation, Inc., *
-* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
-* *
-* Author: Hazan Samy *
-* *
-* Date: October 2006 *
-* *
-******************************************************************************/
+ * *
+ * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. *
+ * *
+ * COPYRIGHT: *
+ * This software is the property of Horizon Wimba. *
+ * You can redistribute it and/or modify it under the terms of *
+ * the GNU General Public License as published by the *
+ * Free Software Foundation. *
+ * *
+ * WARRANTIES: *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with the Horizon Wimba Moodle Integration; *
+ * if not, write to the Free Software Foundation, Inc., *
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
+ * *
+ * Author: Hazan Samy *
+ * *
+ * Date: October 2006 *
+ * *
+ ******************************************************************************/
/* $Id: getXmlNewPanel.php 52710 2007-08-20 19:54:04Z thomasr $ */
/// This page is to generate the list of VT
-global $CFG;
-require_once("../../config.php");
-require_once("lib.php");
-require_once("lib/php/vt/WimbaVoicetoolsAPI.php");
-require_once("lib/php/vt/WimbaVoicetools.php");
-require_once("lib/php/common/WimbaCommons.php");
-require_once("lib/php/common/WimbaXml.php");
-require_once("lib/php/common/WimbaUI.php");
-require_once("lib/php/common/WimbaLib.php");
-if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/php/common/domxml-php4-php5.php');
-}
-
-$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
-foreach(getKeysOfGeneralParameters() as $param)
-{
- $value=optional_param($param["value"],$param["default_value"],$param["type"]);
- if($value!=null)
- $params[$param["value"]] = $value;
-}
-
-require_login($params["enc_course_id"]);
-$session=new WimbaMoodleSession($params);
-$uiManager=new WimbaUI($session);
-
-if($session->error==false)
-{
- /*******************
- GET URL INFORMATIONS
- ********************/
- $action = optional_param('action', ""); // Course Module ID, or
- $typeProduct = $params['type'];
- add_to_log($session->getCourseId(), "voicetools", "xml", "product" , $typeProduct);
-
- if($action == 'update')
- { //get the information of the resource
- $currentBoard = voicetools_api_get_resource($params["resource_id"]);
-
- if($currentBoard==null || $currentBoard->error==true)
+ global $CFG;
+ require_once("../../config.php");
+ require_once("lib.php");
+ require_once("lib/php/vt/WimbaVoicetoolsAPI.php");
+ require_once("lib/php/vt/WimbaVoicetools.php");
+ require_once("lib/php/common/WimbaCommons.php");
+ require_once("lib/php/common/WimbaXml.php");
+ require_once("lib/php/common/WimbaUI.php");
+ require_once("lib/php/common/WimbaLib.php");
+ if (version_compare(PHP_VERSION,'5','>=')) {
+ require_once('lib/php/common/domxml-php4-php5.php');
+ }
+
+ $createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+ foreach(getKeysOfGeneralParameters() as $param)
{
- $uiManager->setError(get_string('problem_vt','voicetools'));
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ {
+ $params[$param["value"]] = $value;
+ }
}
- $currentBoardInformations=voicetools_get_voiceboard_Informations($params["resource_id"]);
+ require_login($params["enc_course_id"]);
+ $uiManager=new WimbaUI($params);
- if($currentBoard->error==true)
+ if($uiManager->getSessionError()==false)
{
- $uiManager->setError(get_string('problem_bd','voicetools'));
+ /*******************
+ GET URL INFORMATIONS
+ ********************/
+ $action = optional_param('action', ""); // Course Module ID, or
+ $typeProduct = $params['type'];
+ add_to_log($uiManager->getSession()->getCourseId(), "voicetools", "xml", "product" , $typeProduct);
+
+ if($action == 'update')
+ { //get the information of the resource
+ $currentBoard = voicetools_api_get_resource($params["resource_id"]);
+
+ if($currentBoard==null || $currentBoard->error==true)
+ {
+ $uiManager->setError(get_string('problem_vt','voicetools'));
+ }
+
+ $currentBoardInformations=voicetools_get_voiceboard_Informations($params["resource_id"]);
+ // print_r($currentBoardInformations);
+ if($currentBoard->error==true)
+ {
+ $uiManager->setError(get_string('problem_bd','voicetools'));
+ }
+
+ $uiManager->setCurrentProduct($typeProduct,$currentBoard,$currentBoardInformations);
+
+ }
+ else
+ {
+ $uiManager->setCurrentProduct($typeProduct);
+ }
+
+ $display= $uiManager->getVTSettingsView($action,$createWorkflow);
+
}
+ else
+ {
+ $uiManager->setError(get_string ($uiManager->getSessionError(), 'voicetools'));
+ }
- $uiManager->setCurrentProduct($typeProduct,$currentBoard,$currentBoardInformations);
-
- }
- else
- {
- $uiManager->setCurrentProduct($typeProduct);
- }
-
- $display= $uiManager->getVTSettingsView($action,$createWorkflow);
-
-}
-else
-{
- if($session->error=="session")
- {
- $uiManager->setError(get_string ('session', 'voicetools'));
- }
- else if($session->error=="signature")
- {
- $uiManager->setError(get_string ('signature', 'voicetools'));
- }
-}
-
-echo $uiManager->getXmlString();
+ echo $uiManager->getXmlString();
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/index.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/index.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -35,7 +35,7 @@
require_once("lib/php/common/WimbaLib.php");
$course_id = optional_param('id', 0, PARAM_INT); // course
-$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+$createWorkflow = optional_param('createWorkflow', "false", PARAM_ALPHA); // course
if (! $course = get_record("course", "id", $course_id)) {
error("Course ID is incorrect");
Modified: branches/team/Thomas/moodle/mod/voicetools/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/lib.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/lib.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -51,40 +51,44 @@
-The api account has to valid
********/
- if(empty($config->servername))
- {
+ if(empty($config->servername))
+ {
error(get_string('wrongconfigurationURLunavailable', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
-
- if(empty($config->adminusername))
- {
+ }
+
+ if(empty($config->adminusername))
+ {
error(get_string('emptyAdminUsername', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
-
- if(empty($config->adminpassword))
- {
+ }
+
+ if(empty($config->adminpassword))
+ {
error(get_string('emptyAdminPassword', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
-
- if ($config->servername{strlen($config->servername)-1} == '/')
- {
+ }
+
+ if ($config->servername{strlen($config->servername)-1} == '/')
+ {
error(get_String('trailingSlash', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
-
- if (!preg_match('/^http:\/\//', $config->servername) && !preg_match('/^https:\/\//', $config->servername))
- {
+ }
+
+ if (!preg_match('/^http:\/\//', $config->servername) && !preg_match('/^https:\/\//', $config->servername))
+ {
error(get_String('trailingHttp', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
-
- //check if the api account filled is correct and allowed
- $result = voicetools_api_check_documentbase ($config->servername, $config->adminusername,$config->adminpassword,$CFG->wwwroot);
-
- if ($result != "ok") {
- if(get_string($result, 'voicetools' ) == "[[]]")//the error description is not in the bundle
- error($result, 'javascript:history.back();');
- else
- error(get_string($result, 'voicetools' ), 'javascript:history.back();');
- }
+ }
+
+ //check if the api account filled is correct and allowed
+ $result = voicetools_api_check_documentbase ($config->servername, $config->adminusername,$config->adminpassword,$CFG->wwwroot);
+
+ if ($result != "ok")
+ {
+ if(get_string($result, 'voicetools' ) == "[[]]")
+ {//the error description is not in the bundle
+ error($result, 'javascript:history.back();');
+ }
+ else{
+ error(get_string($result, 'voicetools' ), 'javascript:history.back();');
+ }
+ }
}
function voicetools_add_instance($voicetool) {
@@ -104,7 +108,8 @@
return false;
}
- if(isset($voicetool->calendar_event) && $voicetool->calendar_event==true) {
+ if(isset($voicetool->calendar_event) && $voicetool->calendar_event==true)
+ {
voicetools_addCalendarEvent($voicetool);
}
@@ -118,27 +123,32 @@
global $USER;
//get the course_module instance linked to the liveclassroom instance
- if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $voicetool->course)) {
+ if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $voicetool->course))
+ {
error("Course Module ID was incorrect");
}
if($voicetool->section != $cm->section)//the scetion has changed
{
//Find the right section in the course_section
- if (!$section = get_record("course_sections", "id", $cm->section)){
+ if (!$section = get_record("course_sections", "id", $cm->section))
+ {
return false;
}
//delete in the course section
- if (! delete_mod_from_section($cm->id, $cm->section)) {
+ if (! delete_mod_from_section($cm->id, $cm->section))
+ {
return false;
}
//update the course module section
- if (! $sectionid = add_mod_to_section($voicetool) ) {
+ if (! $sectionid = add_mod_to_section($voicetool) )
+ {
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)) {
+ if (! set_field("course_modules", "section", $sectionid, "id", $cm->id))
+ {
error("Could not update the course module with the correct section");
}
}
@@ -149,11 +159,13 @@
$voicetool->rid=$rid;
$voicetool->name=get_string("$type","voicetools").$voicetool->name;
- if (!$voicetool->id = update_record('voicetools', $voicetool)) {
+ if (!$voicetool->id = update_record('voicetools', $voicetool))
+ {
return false;
}
- if(isset($voicetool->calendar_event) && $voicetool->calendar_event==true) {//no problem
+ if(isset($voicetool->calendar_event) && $voicetool->calendar_event==true)
+ {//no problem
voicetools_addCalendarEvent($voicetool,$voicetool->id );
}
else
@@ -170,11 +182,13 @@
/// this function will permanently delete the instance
/// and any data that depends on it.
$result = true;
- if (! $voicetool = get_record("voicetools", "id", "$id")) {
+ if (! $voicetool = get_record("voicetools", "id", "$id"))
+ {
return false;
}
# Delete any dependent records here #
- if (! $instanceNumber=delete_records("voicetools", "id", "$voicetool->id")) {
+ if (! $instanceNumber=delete_records("voicetools", "id", "$voicetool->id"))
+ {
add_to_log($voicetool->course, "voicetools", "Delete activity",voicetools_send_logs("errorDeleteInstance","voicetoolsId=".$instanceNumber), "Activity ".$voicetool->name." deletion failed");
$result = false;
}
@@ -457,11 +471,12 @@
$tool = get_record('voicetools_resources','rid',$rid);
- if(empty($tool)){
- return NULL;
-
+ if(empty($tool))
+ {
+ return null;
}
- else if($tool == false) {
+ else if($tool == false)
+ {
error( "Response get_board_list : query to database failed");
return "error_moodleDatabase";
}
Modified: branches/team/Thomas/moodle/mod/voicetools/manageAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -1,6 +1,4 @@
<?php
-
-
/******************************************************************************
* *
* Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. *
@@ -40,13 +38,10 @@
require_once ('lib/php/vt/WimbaVoicetoolsAPI.php');
require_once ('lib/php/vt/VtAction.php');
-
-
-
$messageProduct=optional_param("messageProduct","");
$messageAction=optional_param("messageAction","");
$notool=optional_param("novoicetools","false");
-$createWorkflow = optional_param('createWorkflow', $dddddd, PARAM_BOOL); // course
+$createWorkflow = optional_param("createWorkflow", false, PARAM_BOOL); // course
$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaVoiceForm());
foreach($keys as $param){
@@ -60,12 +55,15 @@
$vtAction = new vtAction($params);
$session = new WimbaMoodleSession($params);
-$redirectionUrl='welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad;
-$urlModuleForm=$CFG->wwwroot.'/course/mod.php?section=0&sesskey='.sesskey().'&id='.$session->getCourseId().'&add=voicetools&rid='.$rid;
+$redirectionUrl='welcome.php?id=' . $session->getCourseId() . '&' .
+ $session->url_params . '&time=' . $session->timeOfLoad;
+$urlModuleForm=$CFG->wwwroot.'/course/mod.php?section=0&sesskey='.sesskey().
+ '&id='.$session->getCourseId().'&add=voicetools&rid=';
+
$messageType = "";
-if ($session->error == false && $session != NULL || $CFG->error==true) {
+if ($session->error == false && $session != NULL ) {
if ($params['action'] == 'launch') {
$session->setCurrentVtUSer($params["type"]);
if ($params["studentView"] == "true") {
@@ -73,10 +71,12 @@
}
$resource = voicetools_api_get_resource($params["resource_id"]);
$result = $vtAction->getVtSession($resource, $session->getVtUser(), $session->getVtUserRigths());
- if ($result != NULL) {
+ if ($result != NULL)
+ {
redirection($CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid());
}
- else {
+ else
+ {
redirection($redirectionUrl.'&error=problem_vt');
}
}
@@ -103,9 +103,10 @@
if ($result != NULL && $result->error != "error")
{
- $params["resource_id"] = storeResource($result->getRid(), $session->getCourseId(), $params['type'],$params["longname"], $params);
-
- if (empty ($params["resource_id"])) {
+ $params["resource_id"] = storeResource($result->getRid(), $params);
+
+ if (empty ($params["resource_id"]))
+ {
error_log(__FUNCTION__ . " : Problem to add the new resource on the database", TRUE);
redirection($redirectionUrl. '&error=problem_bd');
}
@@ -143,7 +144,7 @@
if ($result != NULL)
{
//create the object to store in the db
- $params["resource_id"] = updateResource($result->getRid(), $session->getCourseId(), $param['type'], $param, $params["resource_id"]);
+ $params["resource_id"] = updateResource($result->getRid(), $params);
if (empty ($params["resource_id"]))
{
@@ -161,25 +162,25 @@
}
elseif ($params['action'] == 'delete')
{
- $result = $vtAction->deleteRessource($params["resource_id"]);
+ $result = $vtAction->deleteResource($params["resource_id"]);
if ($result != NULL && $result->error != "error") { //if no error during the creation
if (! voicetools_delete_all_instance_of_resource($params["resource_id"])) {
notify("Could not delete the activities for the vocietools:". $params["resource_id"]);
}
$messageType = 'delete' . $param["type"];
$messageAction = "deleted";
- $messageProduct = $_GET["type"];
+ $messageProduct = $params["type"];
}
}
- if (isset($createWorkflow) && $createWorkflow == true)
+ if ($createWorkflow == true)
{
if(!isset($result) )
$rid="";
else
$rid=$result->getRid();
- parentRedirection($urlModuleForm);
+ parentRedirection($urlModuleForm.$rid);
}
else
{
Modified: branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -37,27 +37,23 @@
require_once('lib/php/vt/WimbaVoicetools.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
global $CFG;
+$action = optional_param("action", "", PARAM_ALPHA); // course
-
-if($_GET['action']=='updateRecorder')
- {
+if($action == 'updateRecorder')
+{
$bId = required_param('block_id', PARAM_SAFEDIR);
- $comment=required_param('comment', PARAM_SAFEDIR);
- $title=required_param('title', PARAM_SAFEDIR);
- $comment=str_replace("\n","<br>",$comment);
-
- $resourceId=voicetools_update_recorder_informations($bId,$comment,$title);
+ $comment = required_param('comment', PARAM_SAFEDIR);
+ $title = required_param('title', PARAM_SAFEDIR);
+ $comment = str_replace("\n","<br>",$comment);
+ $resourceId = voicetools_update_recorder_informations($bId,$comment,$title);
if(empty($resourceId))
{
echo "error.php?error=problem_db";
exit();
}
- print "good";
- exit();
-
+ print "good";
+ exit();
+}
-
-
-
-} ?>
\ No newline at end of file
+?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-02-05 22:47:59 UTC (rev 238)
@@ -51,19 +51,24 @@
$sectionId = optional_param('section', null, PARAM_INT);
/// First we check that form variables have been initialised
-if (!isset($form->name)) {
+if (!isset($form->name))
+{
$form->name = '';
}
-if (!isset($form->type)) {
+if (!isset($form->type))
+{
$form->type = '';
}
-if (!isset($form->intro)) {
+if (!isset($form->intro))
+{
$form->intro = '';
}
-if (!isset($form->descrption)) {
+if (!isset($form->descrption))
+{
$form->descrption = '';
}
-if (!isset($form->section)) {
+if (!isset($form->section))
+{
$form->section = '';
}
$error="";
@@ -74,7 +79,8 @@
if(isset($update)){ //update
//get the information of the activity
- if (! $cmVT = get_record("course_modules", "id", $update)) {
+ if (! $cmVT = get_record("course_modules", "id", $update))
+ {
return false;
}
@@ -114,13 +120,14 @@
$disabledCheckbox="";
$disableAllElements="";
}
-
-
-
+
// Visible to students or not
-if ($form->coursemodule) {
+if ($form->coursemodule)
+{
$visible = get_field('course_modules', 'visible', 'id', $form->coursemodule);
-} else {
+}
+else
+{
$visible = true;
}
@@ -131,7 +138,9 @@
{
$hiddensection = !get_field('course_sections', 'visible', 'id', $form->section);
}
-if ($hiddensection) {
+
+if ($hiddensection)
+{
$visible = false;
}
@@ -145,16 +154,16 @@
?>
-<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/liveclassroom/css/StyleSheet.css"" type="text/css" />
+<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/voicetools/css/StyleSheet.css"" type="text/css" />
<style>
-body{
+body
+{
font-size:14px;
}
.content
{
margin:-5px;
}
-
</style>
<script type="text/javascript">
@@ -168,13 +177,20 @@
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
+
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
- for(var i=0;i < ca.length;i++) {
+ for(var i=0;i < ca.length;i++)
+ {
var c = ca[i];
- while (c.charAt(0)==' ') c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ while (c.charAt(0)==' '){
+ c = c.substring(1,c.length);
+ }
+ if (c.indexOf(nameEQ) == 0)
+ {
+ return c.substring(nameEQ.length,c.length);
+ }
}
return null;
}
@@ -185,35 +201,42 @@
function booleanValue(value){
if(value=="false")
+ {
return false;
- else
+ }
+ else
+ {
return true;
+ }
}
function validate(){
- // name can't be null
- if(document.getElementById("name").value == ""){
- alert("Please a name is required.");
- return false;
- }else if(document.getElementById("name").value.length>=255){
- alert("Please choose an activity name that is less than 255 characters.");
- return false;
- }else if(document.getElementById("resource").value=="empty"){
- alert("Please select a Voice Tools.");
- return false;
-
- }
- document.getElementById("form").submit();
+ // name can't be null
+ if(document.getElementById("name").value == "")
+ {
+ alert("Please a name is required.");
+ return false;
+ }
+ else if(document.getElementById("name").value.length>=255)
+ {
+ alert("Please choose an activity name that is less than 255 characters.");
+ return false;
+ }
+ else if(document.getElementById("resource").value=="empty")
+ {
+ alert("Please select a Voice Tools.");
+ return false;
+ }
+
+ document.getElementById("form").submit();
}
function TestNoTool() {
<?php
$listTools = voicetools_get_voicetools_list($course->id);
if($listTools==NULL) { //no voice tools available
- ?>
-
-
+ ?>
document.getElementById("hiddenDiv").style.height=document.documentElement.clientHeight
document.getElementById("hiddenDiv").style.width=document.documentElement.clientWidth
document.getElementById("popup").style.display="block";
@@ -240,64 +263,127 @@
//save the form fields
if(document.getElementById("name")!=null)
+ {
createCookie("name",document.getElementById("name").value);
+ }
+
if(document.getElementById("section")!=null)
- createCookie("section",document.getElementById("section").selectedIndex);
+ {
+ createCookie("section",document.getElementById("section").selectedIndex);
+ }
+
if(document.getElementById("menuvisible")!=null)
- createCookie("menuvisible",document.getElementById("menuvisible").selectedIndex);
-
+ {
+ createCookie("menuvisible",document.getElementById("menuvisible").selectedIndex);
+ }
//calendar
if(document.getElementById("calendar_event")!=null)
- createCookie("calendar_event",document.getElementById("calendar_event").checked);
+ {
+ createCookie("calendar_event",document.getElementById("calendar_event").checked);
+ }
+
if(document.getElementById("start_month")!=null)
- createCookie("start_month",document.getElementById("start_month").selectedIndex);
+ {
+ createCookie("start_month",document.getElementById("start_month").selectedIndex);
+ }
+
if(document.getElementById("start_day")!=null)
- createCookie("start_day",document.getElementById("start_day").selectedIndex);
+ {
+ createCookie("start_day",document.getElementById("start_day").selectedIndex);
+ }
+
if(document.getElementById("start_year")!=null)
- createCookie("start_year",document.getElementById("start_year").selectedIndex);
+ {
+ createCookie("start_year",document.getElementById("start_year").selectedIndex);
+ }
+
if(document.getElementById("start_hr")!=null)
- createCookie("start_hr",document.getElementById("start_hr").selectedIndex);
+ {
+ createCookie("start_hr",document.getElementById("start_hr").selectedIndex);
+ }
+
if(document.getElementById("start_min")!=null)
- createCookie("start_min",document.getElementById("start_min").selectedIndex);
+ {
+ createCookie("start_min",document.getElementById("start_min").selectedIndex);
+ }
+
if(document.getElementById("duration_hr")!=null)
- createCookie("duration_hr",document.getElementById("duration_hr").selectedIndex);
+ {
+ createCookie("duration_hr",document.getElementById("duration_hr").selectedIndex);
+ }
+
if(document.getElementById("duration_min")!=null)
- createCookie("duration_min",document.getElementById("duration_min").selectedIndex);
+ {
+ createCookie("duration_min",document.getElementById("duration_min").selectedIndex);
+ }
+
if(document.getElementById("description")!=null)
+ {
createCookie("description",document.getElementById("description").value);
+ }
-
//manage the availability of the calendar
if(document.getElementById("calendar_event")!=null)
- createCookie("calendar_event_disabled",document.getElementById("calendar_event").disabled);
+ {
+ createCookie("calendar_event_disabled",document.getElementById("calendar_event").disabled);
+ }
+
if(document.getElementById("start_month")!=null)
- createCookie("start_month_disabled",document.getElementById("start_month").disabled);
+ {
+ createCookie("start_month_disabled",document.getElementById("start_month").disabled);
+ }
+
if(document.getElementById("start_day")!=null)
- createCookie("start_day_disabled",document.getElementById("start_day").disabled);
+ {
+ createCookie("start_day_disabled",document.getElementById("start_day").disabled);
+ }
+
if(document.getElementById("start_year")!=null)
- createCookie("start_year_disabled",document.getElementById("start_year").disabled);
+ {
+ createCookie("start_year_disabled",document.getElementById("start_year").disabled);
+ }
+
if(document.getElementById("start_hr")!=null)
- createCookie("start_hr_disabled",document.getElementById("start_hr").disabled);
+ {
+ createCookie("start_hr_disabled",document.getElementById("start_hr").disabled);
+ }
+
if(document.getElementById("start_min")!=null)
- createCookie("start_min_disabled",document.getElementById("start_min").disabled);
+ {
+ createCookie("start_min_disabled",document.getElementById("start_min").disabled);
+ }
if(document.getElementById("duration_hr")!=null)
- createCookie("duration_hr_disabled",document.getElementById("duration_hr").disabled);
+ {
+ createCookie("duration_hr_disabled",document.getElementById("duration_hr").disabled);
+ }
+
if(document.getElementById("duration_min")!=null)
- createCookie("duration_min_disabled",document.getElementById("duration_min").disabled);
+ {
+ createCookie("duration_min_disabled",document.getElementById("duration_min").disabled);
+ }
+
if(document.getElementById("description")!=null)
+ {
createCookie("description_disabled",document.getElementById("description").disabled);
-
+ }
+
location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $course_id;?>&createWorkflow=true";
}
+
function hideCalendarEvent(value){
- if(value=="check"){
+ if(value=="check")
+ {
if(document.getElementById("calendar_event").checked==true)
+ {
value="";
+ }
else
+ {
value="disabled";
+ }
+ }
- }
document.getElementById("start_hr").disabled=value ;
document.getElementById("start_min").disabled=value ;
document.getElementById("duration_hr").disabled=value ;
@@ -312,18 +398,28 @@
function change(){
- if(document.getElementById("section").value == 0){
+ if(document.getElementById("section").value == 0)
+ {
hideCalendarEvent("disabled");
document.getElementById("calendar_event").disabled="disabled";
document.getElementById("comment_date").innerHTML="";
- }else{
+ }
+ else
+ {
document.getElementById("calendar_event").disabled="";
- if(document.getElementById("calendar_event").checked==false)
+ if(document.getElementById("calendar_event").checked==false)
+ {
hideCalendarEvent("disabled");
+ }
else
- hideCalendarEvent("");
+ {
+ hideCalendarEvent("");
+ }
- var value=parseInt("<?php echo $course->startdate ?>") + parseInt((document.getElementById("section").value -1) * 604800) + parseInt(document.getElementById("start_day").value) + 3600; //add 3600 for ie
+ var value = parseInt("<?php echo $course->startdate ?>") +
+ parseInt((document.getElementById("section").value -1) * 604800) +
+ parseInt(document.getElementById("start_day").value) + 3600; //add 3600 for ie
+
var date = new Date(value*1000);
document.getElementById("calendar_start").value= value;
document.getElementById("comment_date").innerHTML= (date.getMonth()+1)+"/"+ date.getDate()+"/"+date.getFullYear();
@@ -333,70 +429,90 @@
function FillForm(){
- if(document.getElementById("name")!=null && readCookie("name")!=null){
+ if(document.getElementById("name")!=null && readCookie("name")!=null)
+ {
document.getElementById("name").value=[readCookie("name")];
deleteCookie("name");
}
- if(document.getElementById("section")!=null && readCookie("section")!=null){
+
+ if(document.getElementById("section")!=null && readCookie("section")!=null)
+ {
document.getElementById("section")[readCookie("section")].selected=true;
deleteCookie("section");
}
- if(document.getElementById("menuvisible")!=null && readCookie("menuvisible")!=null){
+
+ if(document.getElementById("menuvisible")!=null && readCookie("menuvisible")!=null)
+ {
document.getElementById("menuvisible")[readCookie("menuvisible")].selected=true;
deleteCookie("menuvisible");
}
- if(document.getElementById("calendar_event")!=null && readCookie("calendar_event")!=null){
+
+ if(document.getElementById("calendar_event")!=null && readCookie("calendar_event")!=null)
+ {
document.getElementById("calendar_event").checked=readCookie("calendar_event");
document.getElementById("calendar_event").disabled=booleanValue(readCookie("calendar_event_disabled"));
deleteCookie("calendar_event");
deleteCookie("calendar_event_disabled");
}
- if(document.getElementById("start_month")!=null && readCookie("start_month")!=null){
+
+ if(document.getElementById("start_month")!=null && readCookie("start_month")!=null)
+ {
document.getElementById("start_month")[readCookie("start_month")].selected=true;
document.getElementById("start_month").disabled=booleanValue(readCookie("start_month_disabled"));
deleteCookie("start_month");
deleteCookie("start_month_disabled");
}
- if(document.getElementById("start_day")!=null && readCookie("start_day")!=null){
+
+ if(document.getElementById("start_day")!=null && readCookie("start_day")!=null)
+ {
document.getElementById("start_day")[readCookie("start_day")].selected=true;
document.getElementById("start_day").disabled=booleanValue(readCookie("start_day_disabled"));
deleteCookie("start_day");
deleteCookie("start_day_disabled");
}
- if(document.getElementById("start_year")!=null && readCookie("start_year")!=null){
+
+ if(document.getElementById("start_year")!=null && readCookie("start_year")!=null)
+ {
document.getElementById("start_year")[readCookie("start_year")].selected=true;
document.getElementById("start_year").disabled=booleanValue(readCookie("start_year_disabled"));
deleteCookie("start_year");
deleteCookie("start_year_disabled");
}
- if(document.getElementById("start_hr")!=null && readCookie("start_hr")!=null){
+ if(document.getElementById("start_hr")!=null && readCookie("start_hr")!=null)
+ {
document.getElementById("start_hr")[readCookie("start_hr")].selected=true;
document.getElementById("start_hr").disabled=booleanValue(readCookie("start_hr_disabled"));
deleteCookie("start_hr");
deleteCookie("start_hr_disabled");
}
- if(document.getElementById("duration_hr")!=null && readCookie("duration_hr")!=null){
+ if(document.getElementById("duration_hr")!=null && readCookie("duration_hr")!=null)
+ {
document.getElementById("duration_hr")[readCookie("duration_hr")].selected=true;
document.getElementById("duration_hr").disabled=booleanValue(readCookie("duration_hr_disabled"));
deleteCookie("duration_hr");
deleteCookie("duration_hr_disabled");
}
- if(document.getElementById("duration_min")!=null && readCookie("duration_min")!=null){
+ if(document.getElementById("duration_min")!=null && readCookie("duration_min")!=null)
+ {
document.getElementById("duration_min")[readCookie("duration_min")].selected=true;
document.getElementById("duration_min").disabled=booleanValue(readCookie("duration_min_disabled"));
deleteCookie("duration_min");
deleteCookie("duration_min_disabled");
}
- if(document.getElementById("start_min")!=null && readCookie("start_min")!=null){
+
+ if(document.getElementById("start_min")!=null && readCookie("start_min")!=null)
+ {
document.getElementById("start_min")[readCookie("start_min")].selected=true;
document.getElementById("start_min").disabled=booleanValue(readCookie("start_min_disabled"));
deleteCookie("start_min");
deleteCookie("start_min_disabled");
}
- if(document.getElementById("description")!=null && readCookie("description")!=null){
+
+ if(document.getElementById("description")!=null && readCookie("description")!=null)
+ {
document.getElementById("description").value=readCookie("description");
document.getElementById("description").disabled=booleanValue(readCookie("description_disabled"));
deleteCookie("description");
@@ -410,7 +526,6 @@
}
window.onload=loadPage;
-
</script>
<title>Wimba</title>
@@ -431,7 +546,7 @@
</tr>
</table>
</div>
- <div id="contextBar" width=700px align=center>
+ <div id="contextBar" width=700px align=center style="border-bottom: solid 1px #D9DEE5;">
<table width=700px align=center>
<tbody>
<tr>
@@ -448,7 +563,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', 'voicetools') ?></font>
+ <font color="red">*</font><font class="fontCurrent"><?php print_string('activity_name', 'voicetools') ?></font>
</td>
<td align="left">
<input type="text" id="name" name="name" size="25" value="<?php echo $name ?>">
Modified: branches/team/Thomas/moodle/mod/voicetools/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/view.php 2008-02-05 22:47:38 UTC (rev 237)
+++ branches/team/Thomas/moodle/mod/voicetools/view.php 2008-02-05 22:47:59 UTC (rev 238)
@@ -28,12 +28,10 @@
/* $Id: view.php 52828 2007-08-23 22:12:28Z thomasr $ */
-/// This page prints a particular instance of voicedirect
-/// (Replace voicedirect with the name of your module)
error_reporting(E_ERROR);
require_once('../../config.php');
require_once('lib.php');
-
+//Wimba Library
require_once ("lib/php/common/WimbaLib.php");
require_once('lib/php/vt/WimbaVoicetools.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
@@ -41,89 +39,50 @@
require_once('lib/php/vt/vtAction.php');
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
+$action = optional_param('action', PARAM_ACTION);
-if ((isset($_GET["action"]) && $_GET["action"]!="launchCalendar" ) && $id || !isset($_GET["action"]) ) {
- if (! $cm = get_record("course_modules", "id", $id)) {
- error("Course Module ID was incorrect");
- }
-
- if (! $course = get_record("course", "id", $cm->course)) {
- error("Course is misconfigured");
- }
-
- if (! $voicetool = get_record("voicetools", "id", $cm->instance)) {
- error("Course module is incorrect");
- }
-
+if ((isset($action) && $action!="launchCalendar" ) && $id || !isset($action) ) {
+ if (! $cm = get_record("course_modules", "id", $id)) {
+ error("Course Module ID was incorrect");
+ }
+
+ if (! $course = get_record("course", "id", $cm->course)) {
+ error("Course is misconfigured");
+ }
+
+ if (! $voicetool = get_record("voicetools", "id", $cm->instance)) {
+ error("Course module is incorrect");
+ }
+
} else {
- if (! $voicetool = get_record("voicetools", "id", $id)) {
- error("Course module is incorrect");
- }
- if (! $course = get_record("course", "id", $voicetool->course)) {
- error("Course is misconfigured");
- }
- if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $course->id)) {
- error("Course Module ID was incorrect");
- }
- }
+ if (! $voicetool = get_record("voicetools", "id", $id)) {
+ error("Course module is incorrect");
+ }
+ if (! $course = get_record("course", "id", $voicetool->course)) {
+ error("Course is misconfigured");
+ }
+ if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $course->id)) {
+ error("Course Module ID was incorrect");
+ }
+}
require_login($course->id);
-
add_to_log($course->id, "voicetools", "view", "view.php?id=$cm->id", "$voicetool->id");
-
-$session=new WimbaMoodleSession(NULL);
-
-//check the availability of the resource
-$vt_informations=voicetools_get_voicetool_informations($voicetool->rid);
-if($vt_informations !=null && $vt_informations->availability=="0"){
- $preview = false;
-}
-elseif ($vt_informations !=null && $vt_informations->start_date == -1 && $vt_informations->end_date == -1) {
- $preview = true;
-}
-elseif ($vt_informations !=null && $vt_informations->start_date == -1 && time() <= $vt_informations->end_date) {
- $preview = true;
-}
-elseif ($vt_informations !=null && $vt_informations->start_date < time() && $vt_informations->end_date == -1) {
- $preview = true;
-}
-elseif ($vt_informations !=null && $vt_informations->start_date < time() && time() < $vt_informations->end_date) {
- $preview = true;
-}
-else {
- $preview = false;
-}
-
-
-$resource=voicetools_api_get_resource ($voicetool->rid) ;
-//determinate the role for the wimba tools
-$roleSwitch=isSwitch();//the user have switched his role?
-
-
-
-$role=getRoleForWimbaTools($course->id,$USER->id);
-
-if($resource->error==true){
- error(get_string("problem_vt", "voicetools"), "$CFG->wwwroot/course/view.php?id=$course->id");
-}
-
-$vtAction=new vtAction(NULL);
-$session->setCurrentVtUSer($resource->getType(),$USER->firstname."_".$USER->lastname,$USER->email,$role);
-
-//use a vt user
-
-
-$vtSession=$vtAction->getVtSession($resource,$session->getVtUser(),$session->getVtUserRigths()) ;
-
-
+$servername = $CFG->voicetools_servername;
$strvoicetools = get_string("modulenameplural", "voicetools");
$strvoicetool = get_string("modulename", "voicetools");
-$strname = $voicetool->name;
-
+$sentence1=get_string ('vtpopupshouldappear.1', 'voicetools');
+$sentence2="<a href='javascript:startVoiceBoard ()';>".get_string ('vtpopupshouldappear.2', 'voicetools')."</a>";
+$sentence3=get_string ('vtpopupshouldappear.3', 'voicetools');
+$strLaunchComment=$sentence1.$sentence2.$sentence3;
+
+$completeName=explode(" - ", $voicetool->name);
+$strname=$completeName[1];
+
$navigation = array();
- if ($course->id != SITEID) {
+if ($course->id != SITEID) {
$navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id";
}
$navigation[$strvoicetools] = "$CFG->wwwroot/mod/voicetools/index.php?id=$course->id";
@@ -140,50 +99,55 @@
$breadcrumb = implode(' -> ', $urls);
print_header("$course->shortname: $voicetool->name", "$course->fullname",
-"$breadcrumb",
-"", "", true, update_module_button($cm->id, $course->id, $strvoicetool),
+ $breadcrumb, "", "", true, update_module_button($cm->id, $course->id, $strvoicetool),
navmenu($course, $cm));
-/// Print the main part of the page
+//get the informations related to the Vt resource
+$vtAction=new vtAction();
+$resource=$vtAction->getResource($voicetool->rid) ;
+//check the availability of the resource
+$vtpreview=isVtAvailable($voicetool->rid);
+$roleSwitch=isSwitch();//the user have switched his role?
+//determinate the role for the wimba tools
+$role=getRoleForWimbaTools($course->id,$USER->id);
+
+if($resource->error==true){
+ error(get_string("problem_vt", "voicetools"), "$CFG->wwwroot/course/view.php?id=$course->id");
+}
-$servername = $CFG->voicetools_servername;
+$vtAction=new vtAction(NULL);
+$currentUser=$vtAction->createUser($USER->firstname."_".$USER->lastname,$USER->email);
+$currentUserRights=$vtAction->createUserRights($resource->getType(),$role);
+//get the vt session
+$vtSession=$vtAction->getVtSession($resource,$currentUser,$currentUserRights) ;
+
?>
<script type="text/javascript">
var popup;
function doOpenPopup (url, type)
{
-
popup=window.open (url, type+"_popup", "scrollbars=no,toolbar=no,menubar=no,resizable=yes");
-
}
-
function startVoiceBoard(){
- <?
- if(isset($roleSwitch) && $roleSwitch==true) {
- ?>
- result=window.confirm("<?php echo get_string ('launchstudent', 'voicetools');?>");
- if(result==true) {
- doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
-
- }
- else
- {
- location.href= document.referrer;
- }
-
- <?}else{
- ?>
- doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
- <?}?>
+ <? if(isset($roleSwitch) && $roleSwitch==true) { ?>
+ result=window.confirm("<?php echo get_string ('launchstudent', 'voicetools');?>");
+ if(result==true) {
+ doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
+ }
+ else
+ {
+ location.href= document.referrer;
+ }
+ <? }else{ ?>
+ doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
+ <? } ?>
}
-
-
+
</script>
-
<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/voicetools/css/StyleSheet.css"" type="text/css" />
<style>
body{
@@ -191,17 +155,13 @@
}
.middle_panel{
height:315px;
-
}
html>body .middle_panel{
- height:312px;
-
+ height:319px;
}
-
</style>
-
- <div style="border:solid 1px #808080;width:700px;height:400px;margin-left:20%;margin-top:5%">
+<div style="border:solid 1px #808080;width:700px;height:400px;margin-left:20%;margin-top:5%">
<div class="headerBar" id="headerBar">
<table cellpadding="0" cellspacing="0" width=100%>
<tbody>
@@ -215,65 +175,58 @@
</div>
<div class="contextBar" id="contextBar">
<table>
- <tbody>
- <tr>
- <td class="contextBarLeft" align="left">
- <label class="nameElement">
- <?php
- $completeName=explode(" - ", $voicetool->name);
- $name=$completeName[1];
- echo substr($name,0,25);
-
- ?>
- </label>
-
- </td>
- <td class="contextBarRight" align="right">Voice Tools</td>
- </tr>
- </tbody>
- </table>
+ <tbody>
+ <tr>
+ <td class="contextBarLeft" align="left">
+ <label class="nameElement">
+ <?php echo substr($strname,0,25);?>
+ </label>
+ </td>
+ <td class="contextBarRight" align="right">Voice Tools</td>
+ </tr>
+ </tbody>
+ </table>
</div>
- <div >
+ <div>
<table width=100% class="middle_panel">
<tbody>
<tr valign=middle align=center>
- <td>
- <?php if($preview==false){
- echo get_string ('activity_tools_not_available', 'voicetools');
- }else{
- ?>
- <script>
- startVoiceBoard();
- </script>
- <?php echo get_string ('vtpopupshouldappear.1', 'voicetools');?>
- <a href="javascript:startVoiceBoard ('<?php echo "$CFG->wwwroot/course/view.php?id=$course->id" ?>');">
- <?php echo get_string ('vtpopupshouldappear.2', 'voicetools');?>
- </a>
- <?php echo get_string ('vtpopupshouldappear.3', 'voicetools');?>
- <?php }?>
- </td>
+ <td>
+ <?php if($vtpreview==false)
+ ...
[truncated message content] |
|
From: <tro...@us...> - 2008-02-05 22:47:40
|
Revision: 237
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=237&view=rev
Author: trollinger
Date: 2008-02-05 14:47:38 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Code cleaning
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaCommons.php
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/php/common/XmlArchive.php
branches/team/Thomas/integrations_common/php/common/XmlOrphanedArchive.php
branches/team/Thomas/integrations_common/php/common/XmlResource.php
branches/team/Thomas/integrations_common/php/common/XmlRoom.php
branches/team/Thomas/integrations_common/php/lc/LCAction.php
branches/team/Thomas/integrations_common/php/lc/LCRoom.php
branches/team/Thomas/integrations_common/php/lc/LCUser.php
branches/team/Thomas/integrations_common/php/lc/PrefixUtil.php
branches/team/Thomas/integrations_common/php/lc/lcapi.php
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetools.php
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetoolsAPI.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaCommons.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaCommons.php 2008-01-30 22:36:30 UTC (rev 236)
+++ branches/team/Thomas/integrations_common/php/common/WimbaCommons.php 2008-02-05 22:47:38 UTC (rev 237)
@@ -29,142 +29,146 @@
/* $Id: WimbaVoicetoolsAPI.php 45764 2007-02-28 22:04:25Z thomasr $ */
class WimbaMoodleSession{
- var $hparams=array();
- var $url_params;
- var $signature="";
- var $currentVtUser ;
- var $currentVtUserRigths;
- var $timeOfLoad;
- var $error=false;
- var $request;
+ var $hparams=array();
+ var $url_params;
+ var $signature="";
+ var $currentVtUser ;
+ var $currentVtUserRigths;
+ var $timeOfLoad;
+ var $error=false;
+ var $request;
- function WimbaMoodleSession($parameters=NULL){
-
-
- $this->timeOfLoad = time();
- $signature="";
- $this->request=$parameters;
- if (($this->timeOfLoad - $parameters["time"] <= 1800) && ($this->timeOfLoad - $parameters["time"] >= 0))
- {//30 min
- ksort($parameters);
- foreach ($parameters as $key => $value)
- {
- if (strstr($key, 'enc_'))//param use to signature
- {
- //put this params in a map to use after more easily and to sort
- if( $value=="")
- $this->hparams[substr($key,4)] ="";
- else
- $this->hparams[substr($key,4)] =rawurldecode($value);
- // echo $value."<br>";
- $signature .= rawurldecode($value);
-
- $this->url_params .= "enc_".substr($key,4)."=".rawurlencode($value)."&";
+ function WimbaMoodleSession($parameters=NULL){
+ $this->timeOfLoad = time();
+ $signature="";
+ $this->request=$parameters;
+ if (($this->timeOfLoad - $parameters["time"] <= 1800) && ($this->timeOfLoad - $parameters["time"] >= 0))
+ {//30 min
+ ksort($parameters);
+ foreach ($parameters as $key => $value)
+ {
+ if (strstr($key, 'enc_'))//param use to signature
+ {
+ if( $value=="")
+ {
+ $this->hparams[substr($key,4)] ="";
+ }
+ else
+ {
+ $this->hparams[substr($key,4)] =rawurldecode($value);
+ }
+ $signature .= rawurldecode($value);
+ $this->url_params .= "enc_".substr($key,4)."=".rawurlencode($value)."&";
+ }
+ }
+
+ if ($parameters["signature"] != md5($signature))//good signatureature
+ {
+ $this->error="signature";
+ }
+ $this->signature=md5($signature);
+ $this->url_params .="signature=".rawurlencode($this->signature);
}
- }
-
- if ($parameters["signature"] != md5($signature))//good signatureature
- {
-
- $this->error="signature";
-
- }
- $this->signature=md5($signature);
-
- $this->url_params .="signature=".rawurlencode($this->signature);
+ else//session time out
+ {
+ $this->error="session";
+ }
}
- else//session time out
- {
- $this->error="session";
-
- }
- // / print_r($this->hparams) ;
- }
- function getCourseId(){
-
- if(isset($this->hparams["course_id"]))
- return $this->hparams["course_id"];
- else
+ function getCourseId(){
+
+ if(isset($this->hparams["course_id"]))
+ {
+ return $this->hparams["course_id"];
+ }
return null;
- }
+ }
- function getLcCurrentUser(){
- if($this->isInstructor())
- return $this->getCourseId()."_T";
- else
- return $this->getCourseId()."_S";
- }
+ function getLcCurrentUser(){
+ if($this->isInstructor())
+ {
+ return $this->getCourseId()."_T";
+ }
+ return $this->getCourseId()."_S";
+ }
- function setCurrentVtUSer($product,$screenName="",$email="",$role=""){
- $this->currentVtUser = new VtUser(NULL);
- $this->currentVtUserRigths = new VtRights(NULL);
- if($screenName=="")
- $this->currentVtUser->setScreenName($this->hparams["firstname"]."_".$this->hparams["lastname"]);
- else
- $this->currentVtUser->setScreenName($screenName);
-
- if($email=="")
- $this->currentVtUser->setEmail ($this->hparams["email"]);
- else{
- $this->currentVtUser->setEmail ( $email);
-
- }
+ function setCurrentVtUSer($product,$screenName="",$email="",$role=""){
+ $this->currentVtUser = new VtUser(NULL);
+ $this->currentVtUserRigths = new VtRights(NULL);
+
+ if($screenName=="")
+ {
+ $this->currentVtUser->setScreenName($this->hparams["firstname"]."_".$this->hparams["lastname"]);
+ }
+ else
+ {
+ $this->currentVtUser->setScreenName($screenName);
+ }
+
+ if($email=="")
+ {
+ $this->currentVtUser->setEmail ($this->hparams["email"]);
+ }
+ else
+ {
+ $this->currentVtUser->setEmail ( $email);
+ }
+
+
+ if (($role!="" && $role=="Instructor") || ($role=="" && $this->hparams["role"]=="Instructor"))
+ {
+ $this->setVtUserRigths($product,"instructor");
+ }
+ else
+ {
+ $this->setVtUserRigths($product,"student");
+ }
+
+ }
-
- if (($role!="" && $role=="Instructor") || ($role=="" && $this->hparams["role"]=="Instructor")) {
- $this->setVtUserRigths($product,"instructor");
+
+ function getVtUser(){
+ return $this->currentVtUser;
+ }
+ function getVtUserRigths(){
+ return $this->currentVtUserRigths;
}
- else {
-
- $this->setVtUserRigths($product,"student");
+
+ function setVtUserRigths($product,$role){
+ $this->currentVtUserRigths->setProfile ( 'moodle.'.$product.'.'.$role);
+ if($product=="presentation")
+ {
+ $this->currentVtUserRigths->add("reply_message");
+ }
}
-
- }
- function getVtUser(){
- return $this->currentVtUser;
-
- }
- function getVtUserRigths(){
- return $this->currentVtUserRigths;
-
- }
- function setVtUserRigths($product,$role){
-
- $this->currentVtUserRigths->setProfile ( 'moodle.'.$product.'.'.$role);
- if($product=="presentation")
- $this->currentVtUserRigths->add("reply_message");
- }
- function isInstructor(){
+ function isInstructor(){
+ if($this->hparams["role"]!=null && $this->hparams["role"]=="Instructor")
+ {
+ return true;
+ }
+ return false;
+ }
- if($this->hparams["role"]!=null && $this->hparams["role"]=="Instructor"){
- return true;
- }
- return false;
- }
-
+ function getFirstname(){
+
+ if(isset($this->hparams["firstname"]))
+ {
+ return $this->hparams["firstname"];
+ }
+ return "";
+ }
-
- function getFirstname(){
-
- if(isset($this->hparams["firstname"]) ){
- return $this->hparams["firstname"];
- }
- return "";
-
-}
-
- function getLastname(){
-
- if(isset($this->hparams["lastname"]) ){
- return $this->hparams["lastname"];
- }
- return "";
-
-}
+ function getLastname(){
+
+ if(isset($this->hparams["lastname"]))
+ {
+ return $this->hparams["lastname"];
+ }
+ return "";
+ }
}
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-30 22:36:30 UTC (rev 236)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-02-05 22:47:38 UTC (rev 237)
@@ -1,415 +1,375 @@
<?php
-
-
/**
* Returns the keys of the general parameters passed by GET or POST
*/
-function getKeysOfGeneralParameters(){
-
- return array(
- array("value"=>"enc_course_id","type"=>PARAM_INT,"default_value"=>null),
- array("value"=>"enc_email","type"=>PARAM_CLEAN,"default_value"=>null),
- array("value"=>"enc_firstname","type"=>PARAM_ALPHANUM,"default_value"=>null),
- array("value"=>"enc_lastname","type"=>PARAM_ALPHANUM,"default_value"=>null),
- array("value"=>"enc_role","type"=>PARAM_ALPHA,"default_value"=>null),
- array("value"=>"time","type"=>PARAM_INT,"default_value"=>null),
- array("value"=>"signature","type"=>PARAM_ALPHANUM,"default_value"=>null),
- array("value"=>"product","type"=>PARAM_ALPHA,"default_value"=>null),
- array("value"=>"type","type"=>PARAM_ALPHA,"default_value"=>null),
- array("value"=>"studentView","type"=>PARAM_BOOL,"default_value"=>null),
- array("value"=>"createWorkflow","type"=>PARAM_BOOL,"default_value"=>null),
- array("value"=>"action","type"=>PARAM_ALPHA,"default_value"=>null),
- array("value"=>"resource_id","type"=>PARAM_CLEAN,"default_value"=>"0"),
- array("value"=>"error","type"=>PARAM_CLEAN,"default_value"=>""),
- );
+function getKeysOfGeneralParameters()
+{
+ return array(
+ array("value" => "enc_course_id", "type" => PARAM_INT, "default_value" => null),
+ array("value" => "enc_email", "type" => PARAM_CLEAN, "default_value" => null),
+ array("value" => "enc_firstname", "type" => PARAM_ALPHANUM, "default_value" => null),
+ array("value" => "enc_lastname", "type" => PARAM_ALPHANUM, "default_value" => null),
+ array("value" => "enc_role", "type" => PARAM_ALPHA, "default_value" => null),
+ array("value" => "time", "type" => PARAM_INT, "default_value" => null),
+ array("value" => "signature", "type" => PARAM_ALPHANUM, "default_value" => null),
+ array("value" => "product", "type" => PARAM_ALPHA, "default_value" => null),
+ array("value" => "type", "type" => PARAM_ALPHA, "default_value" => null),
+ array("value" => "studentView", "type" => PARAM_BOOL, "default_value" => null),
+ array("value" => "createWorkflow", "type" => PARAM_BOOL, "default_value" => null),
+ array("value" => "action", "type" => PARAM_ALPHA, "default_value" => null),
+ array("value" => "resource_id", "type" => PARAM_CLEAN, "default_value" => "0"),
+ array("value" => "error", "type" => PARAM_CLEAN, "default_value" => ""),
+ );
+}
-}
+function getKeyWimbaClassroomForm()
+{
+ return array (
+ array("value" => "longname", "type" => PARAM_CLEAN, "default_value" => null),
+ array("value" => "description", "type" => PARAM_CLEAN, "default_value" => ""),
+ 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_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 getKeyWimbaVoiceForm()
+{
+ return array (
+ array("value" => "longname", "type" => PARAM_CLEAN, "default_value" => ""),
+ array("value" => "description", "type" => PARAM_CLEAN, "default_value" => "dd"),
+ array("value" => "led", "type" => PARAM_ALPHA, "default_value" => "instructor"),
-function getKeyWimbaClassroomForm(){
-
-
- return array (
- array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>null),
- array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>""),
- 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_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)
- ) ;
-}
+ array("value" => "audio_format", "type" => PARAM_CLEAN, "default_value" => "medium"),
+ array("value" => "max_length", "type" => PARAM_INT, "default_value" => "0"),
+ array("value" => "delay", "type" => PARAM_INT, "default_value" => "0"),
-function getKeyWimbaVoiceForm(){
-
-
- return array (
- array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>""),
- array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>"dd"),
- array("value"=>"led","type"=>PARAM_ALPHA,"default_value"=>"instructor"),
-
- array("value"=>"audio_format","type"=>PARAM_CLEAN,"default_value"=>"medium"),
- array("value"=>"max_length","type"=>PARAM_INT,"default_value"=>"0"),
- array("value"=>"delay","type"=>PARAM_INT,"default_value"=>"0"),
-
- array("value"=>"short_title","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"chrono_order","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"show_reply","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"show_forward","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"show_compose","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"filter","type"=>PARAM_ALPHA,"default_value"=>"false"),
-
- array("value"=>"accessAvailable","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"start_date","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"start_month","type"=>PARAM_ALPHA,"default_value"=>"0"),
- array("value"=>"start_day","type"=>PARAM_ALPHA,"default_value"=>"0"),
- array("value"=>"start_year","type"=>PARAM_ALPHA,"default_value"=>"0"),
- array("value"=>"start_hr","type"=>PARAM_ALPHA,"default_value"=>-1),
- array("value"=>"start_min","type"=>PARAM_ALPHA,"default_value"=>-1),
- array("value"=>"end_date","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"end_month","type"=>PARAM_ALPHA,"default_value"=>"0"),
- array("value"=>"end_day","type"=>PARAM_ALPHA,"default_value"=>"0"),
- array("value"=>"end_year","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"end_hr","type"=>PARAM_ALPHA,"default_value"=>-1),
- array("value"=>"end_min","type"=>PARAM_ALPHA,"default_value"=>-1),
- );
-}
+ array("value" => "short_title", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "chrono_order", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "show_reply", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "show_forward", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "show_compose", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "filter", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "accessAvailable", "type" => PARAM_BOOL, "default_value" => "0"),
+ array("value" => "start_date", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "start_month", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "start_day", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "start_year", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "start_hr", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "start_min", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "end_date", "type" => PARAM_ALPHA, "default_value" => "false"),
+ array("value" => "end_month", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "end_day", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "end_year", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "end_hr", "type" => PARAM_ALPHA, "default_value" => "0"),
+ array("value" => "end_min", "type" => PARAM_ALPHA, "default_value" => "0"),
+ );
+}
-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>';
+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;
-}
+ 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 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";
+ }
-function redirection($url){
- header('Location:'.$url);
- exit ();
-}
-function parentRedirection($url){
- echo '<script> window.top.location="' . $url . '"; </script>';
- exit ();
-}
+ if ($current == $section)
+ {
+ echo '<OPTION selected value=' . $section . '>' . $section . ". " . $minidesc . '</OPTION>';
+ }
+ else
+ {
+ echo '<OPTION value=' . $section . '>' . $section . ". " . $minidesc . '</OPTION>';
+ }
+ $section++;
+ }
+}
-function manage_error($errno,$error,$file,$line,$context){
- global $CFG;
- if($errno<10)
- {
- redirection('welcome.php?error=rrr');
- }
- if($errno<10){
- //add to log
- }
+function redirection($url)
+{
+ header('Location:' . $url);
+ exit ();
}
+function parentRedirection($url)
+{
+ echo '<script> window.top.location="' . $url . '"; </script>';
+ exit ();
+}
+function manage_error($errno, $error, $file, $line, $context)
+{
+ global $CFG;
+ if ($errno < 10) {
+ redirection('welcome.php?error=rrr');
+ }
+ if ($errno < 10) {
+ // add to log
+ }
+}
-function txt($string){
- $result = str_replace("<br />", "" ,$string);
- $result = str_replace("<p>", "" ,$result);
- $result = str_replace("</p>", "" ,$result);
- return $result;
-}
+function txt($string)
+{
+ $result = str_replace("<br />", "" , $string);
+ $result = str_replace("<p>", "" , $result);
+ $result = str_replace("</p>", "" , $result);
+ return $result;
+}
-function isSwitch(){
- global $USER;
-
- if((isset($USER->studentview) && $USER->studentview==1) || (!empty($USER->switchrole)))
- {
- return true;
- }
- return false;
-
+function isSwitch()
+{
+ global $USER;
-}
+ if ((isset($USER->studentview) && $USER->studentview == 1) || (!empty($USER->switchrole)))
+ {
+ return true;
+ }
+ return false;
+}
-function getRoleForWimbaTools($courseId,$userId){
- global $CFG;
- global $USER;
- $role="";
- if(strstr($CFG->release,"1.7"))
+function getRoleForWimbaTools($courseId, $userId)
+{
+ global $CFG;
+ global $USER;
+ $role = "";
+ if (strstr($CFG->release, "1.7"))
{
- $context = get_context_instance(CONTEXT_COURSE, $courseId) ;
+ $context = get_context_instance(CONTEXT_COURSE, $courseId) ;
}
-
- //the role of the current user is switched
- //the role of the current user is switched
- if((isset($USER->studentview) && $USER->studentview==1)||
- (isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id]>3))
- {
- $role='StudentBis';
+ // the role of the current user is switched
+ if ((isset($USER->studentview) && $USER->studentview == 1) ||
+ (isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id] > 3))
+ {
+ $role = 'StudentBis';
}
- else
+ else
{
- if(isstudent($courseId))
- { //Student
- $role='Student';
- }
- else if (isadmin() || isteacher($courseId, $USER->id))
- { // Admin, Teacher
- $role='Instructor';
- }
-
- if(strstr($CFG->release,"1.7"))
- { // 1.7.* version
+ if (isstudent($courseId))
+ { // Student
+ $role = 'Student';
+ }
+ else if (isadmin() || isteacher($courseId, $USER->id))
+ { // Admin, Teacher
+ $role = 'Instructor';
+ }
+
+ if (strstr($CFG->release, "1.7"))
+ { // 1.7.* version
if (iscreator())
{ // Course Creator
- $role='Instructor';
- }
- else if (!isteacheredit($courseId)) { // Non-editing Teacher
- $role='Student';
- }
- }
-
- }
-
+ $role = 'Instructor';
+ }
+ else if (!isteacheredit($courseId))
+ { // Non-editing Teacher
+ $role = 'Student';
+ }
+ }
+ }
return $role;
-}
+}
/*
-* Give the parameters with the signature md5 to give to the frame
-* @param $courseid : the id of the current course
-* return a string with all the parameters to give to the url
-*/
-function get_url_params($courseid) {
+ * Give the parameters with the signature md5 to give to the frame
+ * @param $courseid : the id of the current course
+ * return a string with all the parameters to give to the url
+ */
+function get_url_params($courseid)
+{
+ global $USER;
+ global $CFG;
- global $USER;
- global $CFG;
-
- $role=getRoleForWimbaTools($courseid,$USER->id);
- $signature = md5($courseid.$USER->email.$USER->firstname.$USER->lastname.$role);
- $url_params = "enc_course_id=".rawurlencode($courseid).
- "&enc_email=".rawurlencode($USER->email).
- "&enc_firstname=".rawurlencode($USER->firstname).
- "&enc_lastname=".rawurlencode($USER->lastname).
- "&enc_role=".rawurlencode($role).
- "&signature=".rawurlencode($signature);
- return $url_params;
+ $role = getRoleForWimbaTools($courseid, $USER->id);
+ $signature = md5($courseid . $USER->email . $USER->firstname . $USER->lastname . $role);
+ $url_params = "enc_course_id=" . rawurlencode($courseid) . "&enc_email=" . rawurlencode($USER->email) . "&enc_firstname=" . rawurlencode($USER->firstname) . "&enc_lastname=" . rawurlencode($USER->lastname) . "&enc_role=" . rawurlencode($role) . "&signature=" . rawurlencode($signature);
+ return $url_params;
}
-
/* list the element of the pictures directory
-* return a String wich contains the pictures separated by a ,
-*/
-function list_dir($name,&$s) {
-
- if ($dir = opendir($name))
+ * return a String wich contains the pictures separated by a ,
+ */
+function list_dir($name, &$s)
+{
+ if ($dir = opendir($name))
{
- while($file = readdir($dir))
+ while ($file = readdir($dir))
{
-
- if(is_dir($name."/".$file) && !in_array($file, array(".","..")))
+ if (is_dir($name . "/" . $file) && !in_array($file, array(".", "..")))
{
- list_dir($name."/".$file,$s);
- }
- else if($file!="." && $file !="..")
+ list_dir($name . "/" . $file, $s);
+ }
+ else if ($file != "." && $file != "..")
{
- $s.=$file.";";
- }
- }
+ $s .= $file . ";";
+ }
+ }
closedir($dir);
- }
-}
+ }
+}
-function storeResource($rid,$courseId,$type,$name,$params=NULL){
- $voicetools=new Object();
- $voicetools->rid=$rid;
- $voicetools->course= $courseId;
- $voicetools->name= $name;
- $voicetools->type=$type;
-
- if ($params!=null) {
- $voicetools->availability=$params["accessAvailable"];
- if ((bool)$params["start_date"]==true) {
- $start_hr=intval($params["start_hr"]);
- $start_min=intval($params["start_min"]);
- $voicetools->start_date= mktime($start_hr, $start_min,0, intval($params["start_month"]),intval($params["start_day"]), intval($params["start_year"]));
- }
- else
+function storeResource($rid, $params)
+{
+ $voicetools = new Object();
+ $voicetools->rid = $rid;
+ $voicetools->course = $params["course_id"];
+ $voicetools->name = $params["name"];
+ $voicetools->type = $params["type"];
+
+ if ($params != null)
+ {
+ $voicetools->availability = $params["accessAvailable"];
+ if ($params["start_date"] == "true")
{
- $voicetools->start_date=-1;
+ $start_hr = intval($params["start_hr"]);
+ $start_min = intval($params["start_min"]);
+ $start_month = intval($params["start_months"]);
+ $start_day = intval($params["start_day"]);
+ $start_year = intval($params["start_year"]);
+ $voicetools->start_date = mktime($start_hr, $start_min, 0, $start_month, $start_day, $start_year);
}
-
- if ((bool)$params["end_date"]==true) {
- $end_hr=intval($params["end_hr"]);
- $end_min=intval($params["start_min"]);
- $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]),intval( $params["end_day"]), intval($params["end_year"]));
- }
- else
+ else
{
- $voicetools->end_date=-1;
- }
- }
- return voicetools_store_new_element($voicetools);
-}
+ $voicetools->start_date = -1;
+ }
-function updateResource($rid,$courseId,$type,$params){
- $voicetools=new Object();
- $voicetools->rid=$rid;
- $voicetools->course= $courseId;
- $voicetools->type=$type;
- $voicetools->availability=$params["accessAvailable"];
-
- if ((bool)$params["start_date"] == true) {
- $start_hr=intval($params["start_hr"]);
- $start_min=intval($params["start_min"]);
- $voicetools->start_date=mktime($start_hr, $start_min,0, intval($params["start_month"]), intval($params["start_day"]), intval($params["start_year"]));
- }
- else
+ if ($params["end_date"] == "true") {
+ $end_hr = intval($params["end_hr"]);
+ $end_min = intval($params["end_min"]);
+ $end_month = intval($params["end_months"]);
+ $end_day = intval($params["end_day"]);
+ $end_year = intval($params["end_year"]);
+ $voicetools->end_date = mktime($end_hr, $end_min, 0, $end_month, $end_day, $end_year);
+ }
+ else
+ {
+ $voicetools->end_date = -1;
+ }
+ }
+ return voicetools_store_new_element($voicetools);
+}
+
+function updateResource($rid, $params)
+{
+ $voicetools = new Object();
+ $voicetools->rid = $rid;
+ $voicetools->course = $params["course_id"];
+ $voicetools->type = $params["type"];
+ $voicetools->availability = $params["accessAvailable"];
+
+ if ($params["start_date"] == "true")
{
- $voicetools->start_date=-1;
+ $start_hr = intval($params["start_hr"]);
+ $start_min = intval($params["start_min"]);
+ $start_month = intval($params["start_months"]);
+ $start_day = intval($params["start_day"]);
+ $start_year = intval($params["start_year"]);
+ $voicetools->start_date = mktime($start_hr, $start_min, 0, $start_month, $start_day, $start_year);
}
- if ((bool)$params["end_date"] == true) {
- $end_hr=intval($params["end_hr"]);
- $end_min=intval($params["start_min"]);
- $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]), intval($params["end_day"]), intval($params["end_year"]));
- }
- else
+ else
{
- $voicetools->end_date=-1;
+ $voicetools->start_date = -1;
+ }
+
+ if ($params["end_date"] == "true") {
+ $end_hr = intval($params["end_hr"]);
+ $end_min = intval($params["end_min"]);
+ $end_month = intval($params["end_months"]);
+ $end_day = intval($params["end_day"]);
+ $end_year = intval($params["end_year"]);
+ $voicetools->end_date = mktime($end_hr, $end_min, 0, $end_month, $end_day, $end_year);
}
- return voicetools_update_element($voicetools);
-}
+ else
+ {
+ $voicetools->end_date = -1;
+ }
+ return voicetools_update_element($voicetools);
+}
-function isVtAvailable($rid){
- $preview=false;
- $vt_informations=voicetools_get_voicetool_informations($rid);
- if($vt_informations !=null && $vt_informations->availability==0){
- $preview = false;
- }
- elseif ($vt_informations !=null && $vt_informations->start_date == -1 && $vt_informations->end_date == -1) {
+function isVtAvailable($rid)
+{
+ $preview = false;
+ $vt_informations = voicetools_get_voicetool_informations($rid);
+
+ if ($vt_informations != null && $vt_informations->availability == 0)
+ {
+ $preview = false;
+ }
+ elseif ($vt_informations != null && $vt_informations->start_date == -1 && $vt_informations->end_date == -1)
+ {
$preview = true;
- }
- elseif ($vt_informations !=null && $vt_informations->start_date == -1 && time() <= $vt_informations->end_date) {
+ }
+ elseif ($vt_informations != null && $vt_informations->start_date == -1 && time() <= $vt_informations->end_date)
+ {
$preview = true;
- }
- elseif ($vt_informations !=null && $vt_informations->start_date < time() && $vt_informations->end_date == -1) {
+ }
+ elseif ($vt_informations != null && $vt_informations->start_date < time() && $vt_informations->end_date == -1)
+ {
$preview = true;
- }
- elseif ($vt_informations !=null && $vt_informations->start_date < time() && time() < $vt_informations->end_date) {
+ }
+ elseif ($vt_informations != null && $vt_informations->start_date < time() && time() < $vt_informations->end_date)
+ {
$preview = true;
- }
+ }
else {
$preview = false;
- }
+ }
+
return $preview;
-
-}
+}
-
-define('PRONTO_INFO', 'info');
-define('PRONTO_WARN', 'warn');
-define('PRONTO_ERROR', 'error');
-define('PRONTO_DEBUG', 'debug');
-
-/**Add logs in moodledata
- * param : the level og the log ('info', 'warn','error' or 'debug'), the message to display on the log
- * return : void, store the log in MOODLEDATADIR/pronto/logs/LEVEL
- */
-function wimba_add_log($level,$message){
-
-//Set the log level values.
-$level_values = array(
- WIMBA_DEBUG => 1,
- WIMBA_INFO => 2,
- WIMBA_WARN => 3,
- WIMBA_ERROR => 4
-);
- global $CFG;
-
-//Write on the logs only if the configured level allows it.
- //if ($level_values[$level] >= intval(1)){
-
- // Gets the site shortname
- $site = get_record('course','id',SITEID);
-
- //Computes the timestamp corresponding to the day (at 00:00:00).
- $today_timestamp = @mktime(0, 0, 0, date("m"), date("d"), date("Y"));
-
- //If it doesn't exist, create the log folder'
- @mkdir(WIMBA_DIR, 0700);
-
- @mkdir(PRODUCT_DIR, 0700);
-
- @mkdir(WIMBA_LOGS_DIR, 0700);
-
- //Computes the log filename. Space characters are replaced by unerscore, to have a correct filename.
- $file = WIMBA_LOGS_DIR."/".str_replace(' ','_',$site->shortname)."-".$today_timestamp."-pronto.log";
-
- //Writes the message in the log, and close it
- $fh = @fopen($file, "a");
- @fwrite($fh,gmdate("Y-m-d H:i:s")." ".strtoupper($level)." pronto - ".$message."\n");
- @fclose($fh);
- //}
-}
-
-
?>
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-30 22:36:30 UTC (rev 236)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-02-05 22:47:38 UTC (rev 237)
@@ -118,9 +118,6 @@
$this->session->hparams["role"],
$this->session->hparams["course_id"],
$this->session->signature,
- "",
- "",
- "",
"");
/********
@@ -238,7 +235,6 @@
//problem to get the vt resource
$this->xml->setError(get_string("error_connection_lc", "liveclassroom"));
}
- return $this->xml->getXml();
}
@@ -258,9 +254,6 @@
$this->session->hparams["role"],
$this->session->hparams["course_id"],
$this->session->signature,
- "",
- "",
- "",
"");
/********
HEADER
@@ -387,9 +380,6 @@
$this->session->hparams["role"],
$this->session->hparams["course_id"],
$this->session->signature,
- "",
- "",
- "",
"");
/********
HEADER
@@ -398,14 +388,14 @@
if($update=="update")
{
- $this->xml->addContextElement(
+ $this->xml->addContextBarElement(
get_string("contextbar_settings", "liveclassroom"),
get_string("general_" . $this->product, "liveclassroom"),
$this->currentObject->getLongname(), "");
}
else
{
- $this->xml->addContextElement(
+ $this->xml->addContextBarElement(
get_string("contextbar_settings", "liveclassroom"),
get_string("general_" . $this->product, "liveclassroom"),
get_string("contextbar_new_" . $this->product, "liveclassroom"), "");
@@ -462,7 +452,6 @@
"javascript:submitForm('doAction.php','update','".$this->currentObject->getRoomId()."')",
"setting_Save");
}
- return $this->xml->getXml();
}
function getVTSettingsView($update, $createWorkflow) {
@@ -478,9 +467,6 @@
$this->session->hparams["role"],
$this->session->hparams["course_id"],
$this->session->signature,
- "",
- "",
- "",
"");
/********
HEADER
@@ -488,7 +474,7 @@
$this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
if($update=="update")
{
- $this->xml->addContextElement(
+ $this->xml->addContextBarElement(
get_string("contextbar_settings", "voicetools"),
get_string("general_" . $this->product, "voicetools"),
$this->currentObject->getTitle(),
@@ -496,7 +482,7 @@
}
else
{
- $this->xml->addContextElement(
+ $this->xml->addContextBarElement(
get_string("contextbar_settings", "voicetools"),
get_string("general_" . $this->product, "voicetools"),
get_string("contextbar_new_" . $this->product, "voicetools"),
@@ -598,7 +584,7 @@
{
$parameters["value"] = $this->currentObject->getLongName();
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->createLinePart();
$this->xml->addSimpleLineElement("label", "*", $parameters = array ("class" => "alert"));
@@ -626,7 +612,7 @@
{
$parameters["value"] = "";
}
- $this->xml->addTextAreaElement("textarea", $parameters);
+ $this->xml->addTextAreaElement($parameters);
$this->xml->createLinePart();
$this->xml->createLine();
@@ -654,7 +640,7 @@
if ($this->currentObject == null || $isStudentAdmin == "false") {
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$parameters = array (
"class" => "top",
@@ -690,7 +676,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$parameters = array (
"class" => "top",
@@ -760,7 +746,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
if ($this->lectureRoom == "hiddenSetting")
{
$parameters = array ("class" => "labelDisabled");
@@ -790,7 +776,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
if ($this->lectureRoom == "hiddenSetting") {
$parameters = array ("class" => "labelDisabled");
}
@@ -820,7 +806,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
if ($this->lectureRoom == "hiddenSetting") {
$parameters = array ("class" => "labelDisabled");
@@ -946,7 +932,7 @@
if ($this->currentObject == null || $this->currentObject->isUserstatusEnabled()) {
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_status", 'liveclassroom'));
@@ -973,7 +959,7 @@
$parameters["checked"] = "true";
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_status_appear", 'liveclassroom'));
@@ -1003,7 +989,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_student_eboard", 'liveclassroom'));
@@ -1035,7 +1021,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_breakoutrooms", 'liveclassroom'));
@@ -1065,7 +1051,7 @@
$parameters["checked"] = "true";
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_students_breakoutrooms", 'liveclassroom'));
@@ -1095,7 +1081,7 @@
$parameters["checked"] = "true";
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_students_mainrooms", 'liveclassroom'));
@@ -1120,7 +1106,7 @@
if ($this->currentObject == null || $this->currentObject->isArchiveEnabled()) {
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_archiving", 'liveclassroom'));
@@ -1140,7 +1126,7 @@
if ($this->currentObject == null || $this->currentObject->isLiveShareEnabled()) {
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_appshare", 'liveclassroom'));
@@ -1159,7 +1145,7 @@
if ($this->currentObject == null || $this->currentObject->isPptImportEnabled()) {
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_onfly_ppt", 'liveclassroom'));
@@ -1221,7 +1207,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_chat_enabled", 'liveclassroom'));
@@ -1246,7 +1232,7 @@
$parameters["checked"] = "true";
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_private_chat_enabled", 'liveclassroom'));
@@ -1313,7 +1299,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$parameters = array ("for" => "accessAvailable_true");
$this->xml->addSimpleLineElement(
@@ -1339,7 +1325,7 @@
{
$parameters["disabled"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->createLinePart(array ("colspan" => 4));
$this->xml->createLine();
@@ -1381,7 +1367,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$parameters = array ("for" => "userlimit_false");
$this->xml->addSimpleLineElement(
@@ -1410,7 +1396,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$parameters = array ("for" => "userlimit_true");
$this->xml->addSimpleLineElement(
"label",
@@ -1432,7 +1418,7 @@
{
$parameters["value"] = $this->currentObject->getUserLimit();
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->createLinePart();
$this->xml->createLine();
@@ -1447,7 +1433,7 @@
if ($this->currentObject != null && $this->api->isGuestAuthorized($this->currentObject->getRoomId())) {
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string("settings_enabled_guest", 'liveclassroom'));
@@ -1476,7 +1462,7 @@
$parameters["value"] = $this->api->getServer() .
"/launcher.cgi?room=" .
$this->id;
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
}
$parameters = array (
@@ -1550,7 +1536,7 @@
"value" => get_string("settings_advanced_room_settings_button",'liveclassroom'),
"onclick" => "openRoomSettings('doAction.php')"
);
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->createLinePart();
$this->xml->createLine();
@@ -1559,7 +1545,7 @@
"value" => get_string("settings_advanced_media_settings_button",'liveclassroom'),
"onclick" => "openMediaSettings('doAction.php')"
);
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->createLinePart();
$this->xml->createLine();
@@ -1614,7 +1600,7 @@
{
$parameters["value"] = "";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->createLinePart();
$this->xml->addSimpleLineElement(
@@ -1647,7 +1633,7 @@
else{
$parameters["value"] = "";
}
- $this->xml->addTextAreaElement("textarea", $parameters);
+ $this->xml->addTextAreaElement($parameters);
$this->xml->createLinePart();
$this->xml->createLine();
@@ -1677,7 +1663,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string('public', 'voicetools'),
@@ -1718,7 +1704,7 @@
$parameters['disabled'] = "true";
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string('start_thread', 'voicetools'));
@@ -1740,7 +1726,7 @@
{
$parameters["checked"] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string('private', 'voicetools'),
@@ -1780,7 +1766,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('comment_slide', 'voicetools'));
$this->xml->createLinePart();
@@ -1799,7 +1785,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('private_slide', 'voicetools'));
$this->xml->addSimpleLineElement("br", NULL);
$this->xml->addSimpleLineElement(
@@ -1835,7 +1821,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('post_podcast', 'voicetools'));
$this->xml->createLinePart();
@@ -1931,7 +1917,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('short_message', 'voicetools'));
$this->xml->createLinePart();
@@ -1947,7 +1933,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('chrono_order', 'voicetools'));
$this->xml->createLinePart();
@@ -1963,7 +1949,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('show_forward', 'voicetools'));
$this->xml->createLinePart();
@@ -1992,7 +1978,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement("label", get_string('short_message', 'voicetools'));
$this->xml->createLinePart();
@@ -2022,7 +2008,7 @@
{
$parameters['checked'] = "true";
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string('available', 'voicetools'),
@@ -2052,7 +2038,7 @@
$parameters['checked'] = "true";
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string('start_date', 'voicetools'),
@@ -2060,7 +2046,7 @@
$this->xml->createLinePart();
$this->xml->createLine();
-
+
if ($this->currentObjectInformations != null)
{
$optionsMonth = $this->createSelectMonth(
@@ -2216,7 +2202,7 @@
$parameters['checked'] = true;
}
}
- $this->xml->addInputElement("input", $parameters);
+ $this->xml->addInputElement($parameters);
$this->xml->addSimpleLineElement(
"label",
get_string('end_date', 'voicetools'),
@@ -2612,12 +2598,12 @@
"display" => "--"
);
$options[] = $option;
- for ($i = 0; $i < 24; $i++) {
+ for ($i = 1; $i < 25; $i++) {
$option = array (
"value" => $i,
- "display" => date("h A",mktime($i,1,1,1,1,2007))
+ "display" => date("h A",mktime($i-1,1,1,1,1,2007))
);
- if (isset ($this->currentObject) && $selected == true && $hr == $i) {
+ if (isset ($this->currentObject) && $selected == true && $hr == $i ) {
$option['selected'] = "true";
}
$options[] = $option;
@@ -2634,10 +2620,10 @@
"display" => "--"
);
$options[] = $option;
- for ($i = 0; $i < 60; $i = $i +5) {
+ for ($i = 1; $i < 61; $i = $i +5) {
$option = array (
"value" => $i,
- "display" => $i
+ "display" => $i-1
);
if (isset ($this->currentObject) && $selected == true && $min == $i) {
$option['selected'] = "true";
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-30 22:36:30 UTC (rev 236)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-02-05 22:47:38 UTC (rev 237)
@@ -41,7 +41,11 @@
{
$this->xmldoc = domxml_new_doc("1.0");
}
-
+
+ /*
+ * This function generate the global xml which will render the html
+ * Each element of $part is grouped in only one xml
+ */
function getXml()
{
$root = $this->xmldoc->create_element("root");
@@ -66,7 +70,45 @@
$finalstring = str_replace("\n", '', $xmlstring);
return $finalstring;
}
-
+
+ /*
+ * Add the headerBar element. This element is the bar at the top of the component.
+ * It composed by a logo and a drop down to switch the display of the component
+ * @param pictureUrl : path of the logo
+ * @param disabled : manage the disabled parameter for the drop down
+ * @param isInstructor : role of the current user( the drop down is never displayed for student)
+ */
+ function addHeaderElement($pictureUrl,$disabled,$isInstructor)
+ {
+ if (!isset($this->part["headerBar"]))
+ {
+ $this->part["headerBar"]=$this->xmldoc->create_element("headerBarInformations");
+ }
+
+ $picture = $this->xmldoc->create_element("pictureUrl");
+ $picture->append_child($this->xmldoc->create_text_node($pictureUrl));
+ $disable = $this->xmldoc->create_element("disabled");
+ $disable->append_child($this->xmldoc->create_text_node($disabled));
+ $hbinstructorview = $this->xmldoc->create_element("instructorView");
+ $hbinstructorview->append_child($this->xmldoc->create_text_node(get_string('instructorview', 'voicetools')));
+ $hbstudentview = $this->xmldoc->create_element("studentView");
+ $hbstudentview->append_child($this->xmldoc->create_text_node(get_string('studentview', 'voicetools')));
+ $isInstructorElement = $this->xmldoc->create_element("isInstructor");
+ $isInstructorElement->append_child($this->xmldoc->create_text_node($isInstructor));
+ $this->part["headerBar"]->append_child($picture);
+ $this->part["headerBar"]->append_child($hbinstructorview);
+ $this->part["headerBar"]->a...
[truncated message content] |
|
From: <tro...@us...> - 2008-01-30 22:36:32
|
Revision: 236
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=236&view=rev
Author: trollinger
Date: 2008-01-30 14:36:30 -0800 (Wed, 30 Jan 2008)
Log Message:
-----------
code cleaning
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-25 22:56:11 UTC (rev 235)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-30 22:36:30 UTC (rev 236)
@@ -70,19 +70,19 @@
array("value"=>"show_compose","type"=>PARAM_ALPHA,"default_value"=>"false"),
array("value"=>"filter","type"=>PARAM_ALPHA,"default_value"=>"false"),
- array("value"=>"accessAvailable","type"=>PARAM_BOOL,"default_value"=>"0"),
- array("value"=>"start_date","type"=>PARAM_BOOL,"default_value"=>"0"),
- array("value"=>"start_month","type"=>PARAM_INT,"default_value"=>"0"),
- array("value"=>"start_day","type"=>PARAM_INT,"default_value"=>"0"),
- array("value"=>"start_year","type"=>PARAM_INT,"default_value"=>"0"),
- array("value"=>"start_hr","type"=>PARAM_INT,"default_value"=>-1),
- array("value"=>"start_min","type"=>PARAM_INT,"default_value"=>-1),
- array("value"=>"end_date","type"=>PARAM_BOOL,"default_value"=>"0"),
- array("value"=>"end_month","type"=>PARAM_INT,"default_value"=>"0"),
- array("value"=>"end_day","type"=>PARAM_INT,"default_value"=>"0"),
- array("value"=>"end_year","type"=>PARAM_INT,"default_value"=>"f"),
- array("value"=>"end_hr","type"=>PARAM_INT,"default_value"=>-1),
- array("value"=>"end_min","type"=>PARAM_INT,"default_value"=>-1),
+ array("value"=>"accessAvailable","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"start_date","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"start_month","type"=>PARAM_ALPHA,"default_value"=>"0"),
+ array("value"=>"start_day","type"=>PARAM_ALPHA,"default_value"=>"0"),
+ array("value"=>"start_year","type"=>PARAM_ALPHA,"default_value"=>"0"),
+ array("value"=>"start_hr","type"=>PARAM_ALPHA,"default_value"=>-1),
+ array("value"=>"start_min","type"=>PARAM_ALPHA,"default_value"=>-1),
+ array("value"=>"end_date","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"end_month","type"=>PARAM_ALPHA,"default_value"=>"0"),
+ array("value"=>"end_day","type"=>PARAM_ALPHA,"default_value"=>"0"),
+ array("value"=>"end_year","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"end_hr","type"=>PARAM_ALPHA,"default_value"=>-1),
+ array("value"=>"end_min","type"=>PARAM_ALPHA,"default_value"=>-1),
);
}
@@ -117,20 +117,25 @@
function getListOfTopics($course,$current){
$section = 0;
- while ($section <= $course->numsections) {
- if (!$thissection = get_record('course_sections', 'course',$course->id, 'section', $section)) {
+ 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) ) {
+ if ( ($thissection->summary != NULL) && (strlen($descTxt)>20) )
+ {
$minidesc .= "...";
}
- else if ($thissection->summary == NULL){
+ else if ($thissection->summary == NULL)
+ {
$minidesc = "Topic";
}
+
if($current==$section)
{
echo '<OPTION selected value='.$section.'>'.$section.". ".$minidesc.'</OPTION>';
@@ -157,8 +162,8 @@
function manage_error($errno,$error,$file,$line,$context){
global $CFG;
- if($errno<10){
-
+ if($errno<10)
+ {
redirection('welcome.php?error=rrr');
}
if($errno<10){
@@ -177,47 +182,56 @@
function isSwitch(){
global $USER;
- if((isset($USER->studentview) && $USER->studentview==1) || (!empty($USER->switchrole)) ) {
+ if((isset($USER->studentview) && $USER->studentview==1) || (!empty($USER->switchrole)))
+ {
return true;
}
return false;
}
+
function getRoleForWimbaTools($courseId,$userId){
- global $CFG;
- global $USER;
- $role="";
- if(strstr($CFG->release,"1.7")) {
- $context = get_context_instance(CONTEXT_COURSE, $courseId) ;
- }
+ global $CFG;
+ global $USER;
+ $role="";
+ if(strstr($CFG->release,"1.7"))
+ {
+ $context = get_context_instance(CONTEXT_COURSE, $courseId) ;
+ }
//the role of the current user is switched
//the role of the current user is switched
- if((isset($USER->studentview) && $USER->studentview==1)||(isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id]>3)) {
+ if((isset($USER->studentview) && $USER->studentview==1)||
+ (isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id]>3))
+ {
$role='StudentBis';
- } else{
+ }
+ else
+ {
+ if(isstudent($courseId))
+ { //Student
+ $role='Student';
+ }
+ else if (isadmin() || isteacher($courseId, $USER->id))
+ { // Admin, Teacher
+ $role='Instructor';
+ }
+ if(strstr($CFG->release,"1.7"))
+ { // 1.7.* version
+ if (iscreator())
+ { // Course Creator
+ $role='Instructor';
+ }
+ else if (!isteacheredit($courseId)) { // Non-editing Teacher
+ $role='Student';
+ }
+ }
- if(isstudent($courseId)) { //Student
- $role='Student';
- }
- else if (isadmin() || isteacher($courseId, $USER->id)) { // Admin, Teacher
- $role='Instructor';
- }
-
- if(strstr($CFG->release,"1.7")) { // 1.7.* version
- if (iscreator()) { // Course Creator
- $role='Instructor';
}
- else if (!isteacheredit($courseId)) { // Non-editing Teacher
- $role='Student';
- }
- }
- }
-
- return $role;
+ return $role;
}
/*
@@ -247,164 +261,110 @@
*/
function list_dir($name,&$s) {
- if ($dir = opendir($name)) {
+ if ($dir = opendir($name))
+ {
+ while($file = readdir($dir))
+ {
- while($file = readdir($dir)) {
-
-
- if(is_dir($name."/".$file) && !in_array($file, array(".",".."))) {
-
- list_dir($name."/".$file,$s);
- }
- else if($file!="." && $file !="..") {
- $s.=$file.";";
- }
-
+ if(is_dir($name."/".$file) && !in_array($file, array(".","..")))
+ {
+ list_dir($name."/".$file,$s);
+ }
+ else if($file!="." && $file !="..")
+ {
+ $s.=$file.";";
+ }
+ }
+ closedir($dir);
}
-
- closedir($dir);
- }
-
-
}
function storeResource($rid,$courseId,$type,$name,$params=NULL){
- $voicetools->rid=$rid;
- $voicetools->course= $courseId;
- $voicetools->name= $name;
- $voicetools->type=$type;
- if($params!=null){
-
- if(isset($params["accessAvailable"]))
- {
- $voicetools->availability=1;
- }
- else
- {
- $voicetools->availability=0;
- }
- if(isset($params["start_date"]) && $params["start_date"]=="true"){
- if($params["start_hr"]=="--")
- {
- $start_hr=0;
- }
- else
- {
+ $voicetools=new Object();
+ $voicetools->rid=$rid;
+ $voicetools->course= $courseId;
+ $voicetools->name= $name;
+ $voicetools->type=$type;
+
+ if ($params!=null) {
+ $voicetools->availability=$params["accessAvailable"];
+ if ((bool)$params["start_date"]==true) {
$start_hr=intval($params["start_hr"]);
- }
- if($params["start_min"]=="--")
- {
- $start_min=0;
- }
- else
- {
$start_min=intval($params["start_min"]);
- }
- $voicetools->start_date= mktime($start_hr, $start_min,0, intval($params["start_month"]),intval($params["start_day"]), intval($params["start_year"]));
-
-
-
-
+ $voicetools->start_date= mktime($start_hr, $start_min,0, intval($params["start_month"]),intval($params["start_day"]), intval($params["start_year"]));
}
else
{
- $voicetools->start_date=-1;
+ $voicetools->start_date=-1;
}
- if(isset($params["end_date"]) && $params["end_date"]=="true"){
- if($params["end_hr"]=="--")
- {
- $end_hr=0;
- }
- else
- {
+
+ if ((bool)$params["end_date"]==true) {
$end_hr=intval($params["end_hr"]);
- }
- if($params["end_min"]=="--")
- {
- $end_min=0;
- }
- else
- {
$end_min=intval($params["start_min"]);
- }
-
- $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]),intval( $params["end_day"]), intval($params["end_year"]));
- }
+ $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]),intval( $params["end_day"]), intval($params["end_year"]));
+ }
else
{
- $voicetools->end_date="-1";
+ $voicetools->end_date=-1;
}
- }
-
- return voicetools_store_new_element($voicetools);
-
+ }
+ return voicetools_store_new_element($voicetools);
}
+
function updateResource($rid,$courseId,$type,$params){
-
- $voicetools->rid=$rid;
- $voicetools->course= $courseId;
- $voicetools->type=$type;
- if(isset($params["accessAvailable"]))
- {
- $voicetools->availability=1;
- }
- else
- {
- $voicetools->availability=0;
- }
-
- if(isset($params["start_date"]) && $params["start_date"]=="true"){
-
- if($params["start_hr"]=="--")
- {
- $start_hr=0;
- }else
- {
- $start_hr=intval($params["start_hr"]);
- }
- if($params["start_min"]=="--")
- {
- $start_min=0;
- }
- else
- {
- $start_min=intval($params["start_min"]);
- }
+ $voicetools=new Object();
+ $voicetools->rid=$rid;
+ $voicetools->course= $courseId;
+ $voicetools->type=$type;
+ $voicetools->availability=$params["accessAvailable"];
+
+ if ((bool)$params["start_date"] == true) {
+ $start_hr=intval($params["start_hr"]);
+ $start_min=intval($params["start_min"]);
$voicetools->start_date=mktime($start_hr, $start_min,0, intval($params["start_month"]), intval($params["start_day"]), intval($params["start_year"]));
- }
- else
- {
+ }
+ else
+ {
$voicetools->start_date=-1;
- }
- if(isset($params["end_date"]) && $params["end_date"]=="true"){
- if($params["end_hr"]=="--")
- {
- $end_hr=0;
- }
- else
- {
- $end_hr=intval($params["end_hr"]);
- }
- if($params["end_min"]=="--")
- {
- $end_min=0;
- }
- else
- {
- $end_min=intval($params["start_min"]);
- }
+ }
+ if ((bool)$params["end_date"] == true) {
+ $end_hr=intval($params["end_hr"]);
+ $end_min=intval($params["start_min"]);
$voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]), intval($params["end_day"]), intval($params["end_year"]));
- }
- else
- {
- $voicetools->end_date="-1";
- }
- // $voicetools->id=$id;
+ }
+ else
+ {
+ $voicetools->end_date=-1;
+ }
+ return voicetools_update_element($voicetools);
+}
- return voicetools_update_element($voicetools);
-
+function isVtAvailable($rid){
+ $preview=false;
+ $vt_informations=voicetools_get_voicetool_informations($rid);
+ if($vt_informations !=null && $vt_informations->availability==0){
+ $preview = false;
+ }
+ elseif ($vt_informations !=null && $vt_informations->start_date == -1 && $vt_informations->end_date == -1) {
+ $preview = true;
+ }
+ elseif ($vt_informations !=null && $vt_informations->start_date == -1 && time() <= $vt_informations->end_date) {
+ $preview = true;
+ }
+ elseif ($vt_informations !=null && $vt_informations->start_date < time() && $vt_informations->end_date == -1) {
+ $preview = true;
+ }
+ elseif ($vt_informations !=null && $vt_informations->start_date < time() && time() < $vt_informations->end_date) {
+ $preview = true;
+ }
+ else {
+ $preview = false;
+ }
+ return $preview;
+
}
+
define('PRONTO_INFO', 'info');
define('PRONTO_WARN', 'warn');
define('PRONTO_ERROR', 'error');
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-25 22:56:11 UTC (rev 235)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-30 22:36:30 UTC (rev 236)
@@ -1,1920 +1,2859 @@
<?php
class WimbaUI {
- var $session;
- var $api;
- var $xml;
- var $currentObject;
- var $isArchive = "false";
- var $lectureRoom;
- var $discussionRoom;
- var $isLectureRoom;
- var $disabledSetting;
- var $currentTab;
- //for vt
- var $currentObjectInformations = NULL;
- var $currentObjectOptions = NULL;
- var $currentObjectAudioFormat = NULL;
- var $startSelect = false;
- var $endSelect = false;
- var $prefix;
- var $id;
-
- function WimbaUI($session, $api = NULL, $currentIdtab = "") {
+
+ var $session;
+ var $api;
+ var $xml;
+ var $currentObject;
+ var $isArchive = "false";
+ var $lectureRoom;
+ var $discussionRoom;
+ var $isLectureRoom;
+ var $disabledSetting;
+ var $currentTab;
+ //for vt
+ var $currentObjectInformations = NULL;
+ var $currentObjectOptions = NULL;
+ var $currentObjectAudioFormat = NULL;
+ var $startSelect = false;
+ var $endSelect = false;
+ var $prefix;
+ var $id;
+
+ function WimbaUI($session_params, $api = NULL, $currentIdtab = "")
+ {
+ $this->session = new WimbaMoodleSession($session_params);
+ $this->api = $api;
+ $this->xml = new WimbaXml();
+ $this->currentTab = $currentIdtab;
+
+ if($api!=null)
+ {
+ $this->prefix=$api->getPrefix();
+ }
+ }
+
+ /**
+ * Configure different parmaters used to generate the xml according to the current product
+ * @param product : the product which will be display (liveclassroom or voicetools)
+ * @param object : contains the informations get from the server
+ * @param objectInformations : contains the informations get from the database
+ */
+ function setCurrentProduct($product, $serverInformations = NULL, $databaseInformations = NULL)
+ {
+ $this->product = $product;
+ $this->currentObject = $serverInformations;
+
+
+ if($this->currentObject == null)
+ {
+ $this->id=$this->session->getCourseId() . rand();
+ }
+
+ if ($product == "liveclassroom")
+ {
+ $roomId=$this->currentObject->getRoomId();
+ if ($this->currentObject != null && $this->currentObject->isArchive())
+ {
+ $this->isArchive = "true";
+ }
+
+ $roomId=$this->currentObject->getRoomId();
+ $courseId=$this->session->getCourseId() . "_S";
+ $isStudentAdmin= $this->api->isStudentAdmin($roomId, $courseId);
+ if ($this->currentObject == null
+ || $this->currentObject != null && $isStudentAdmin == "false")
+ {
+ $this->lectureRoom = "activeSetting";
+ $this->discussionRoom = "hiddenSetting";
+ $this->disabledSetting = "activeSetting";
+ $this->isLectureRoom = true;
+ }
+ else
+ {
+ $this->lectureRoom = "hiddenSetting";
+ $this->discussionRoom = "activeSetting";
+ $this->disabledSetting = "disabledSetting";
+ $this->isLectureRoom = false;
+ }
+ }
+ else
+ {
+ //data of the database
+ $this->currentObjectInformations = $databaseInformations;
+ if ($this->currentObjectInformations != null
+ && $this->currentObjectInformations->start_date != -1)
+ {
+ $this->startSelect = true;
+ }
+
+ if ( $this->currentObjectInformations != null
+ && $this->currentObjectInformations->end_date != -1 )
+ {
+ $this->endSelect = true;
+ }
+
+ if (isset($this->currentObject)
+ && isset($this->currentObjectInformations)) {
+ //for php 4-> object->object doesn't work
+ $this->currentObjectOptions = $this->currentObject->getOptions();
+ $this->currentObjectAudioFormat = $this->currentObjectOptions->getAudioFormat();
+ }
+ }
+ }
+
+ /**
+ * Add the necessary elements to the current xml object to render the principal view of the lc component
+ * @param message : eventual information message displayed at the bottom of the component
+ */
+ function getLCPrincipalView($message) {
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement(
+ $this->session->timeOfLoad,
+ $this->session->hparams["firstname"],
+ $this->session->hparams["lastname"],
+ $this->session->hparams["email"],
+ $this->session->hparams["role"],
+ $this->session->hparams["course_id"],
+ $this->session->signature,
+ "",
+ "",
+ "",
+ "");
+
+ /********
+ HEADER
+ *********/
+ if($this->session->isInstructor())
+ {
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "true");
+ }
+ else
+ {
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "false");
+ }
+ /********
+ MENU
+ *********/
+ $this->xml->addButtonElement(
+ "all",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-launch",
+ get_string('toolbar_launch', 'liveclassroom'),
+ "javascript:LaunchElement('doAction.php','liveclassroom');");
- $this->session = $session;
- $this->api = $api;
+ if($this->session->isInstructor())
+ {
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ 'lib/web/pictures/buttons/toolbar-activities',
+ get_string('toolbar_activity', 'liveclassroom'),
+ "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=liveclassroom')");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "enabled",
+ "lib/web/pictures/buttons/toolbar-new",
+ get_string('toolbar_new', 'liveclassroom'),
+ "javascript:loadNewSettings('generateSettings.php','create','liveclassroom' ,'liveclassroom','all')");
+
+ $this->xml->addSpaceElement("20px", "instructor");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-content",
+ get_string('toolbar_content', 'liveclassroom'),
+ "javascript:openContent('doAction.php');");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-poll",
+ get_string('toolbar_reports', 'liveclassroom'),
+ "javascript:openReport('doAction.php');");
+
+ $this->xml->addSpaceElement("10px", "instructor");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-settings",
+ get_string('toolbar_settings', 'liveclassroom'),
+ "javascript:editSettings('generateSettings.php','all');");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-delete",
+ get_string('toolbar_delete', 'liveclassroom'),
+ "javascript:deleteResource('doAction.php');");
+
+ $this->xml->addSpaceElement("50px", "instructor");
+ }
+ else
+ {
+ $this->xml->addSpaceElement("300px", "instructor");
+ }
+
+ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari'))
+ {
+ $this->xml->addSearchElement("all", "Safari");
+ }
+ else
+ {
+ $this->xml->addSearchElement("all", "other");
+ }
+
+ //MESSAGE BAR
+ if (isset ($message) && $message!="")
+ {
+ $this->xml->addMessage($message);
+ }
+
+ $rooms=$this->getListLiveClassroom();
+
+ if($rooms!=false || $rooms==null)
+ {
+ $this->xml->addProduct(
+ "liveclassroom",
+ "productType",
+ "Live classroom",
+ "liveclassroom",
+ $rooms ,
+ get_string('list_no_liveclassrooms', 'liveclassroom'));
+ }
+ else
+ {
+ //problem to get the vt resource
+ $this->xml->setError(get_string("error_connection_lc", "liveclassroom"));
+ }
+ return $this->xml->getXml();
+ }
+
+
+ /**
+ * Add the necessary elements to the current xml object to render the principal view of the vt component
+ * @param message : eventual information message displayed at the bottom of the component
+ */
+ function getVTPrincipalView($message) {
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement(
+ $this->session->timeOfLoad,
+ $this->session->hparams["firstname"],
+ $this->session->hparams["lastname"],
+ $this->session->hparams["email"],
+ $this->session->hparams["role"],
+ $this->session->hparams["course_id"],
+ $this->session->signature,
+ "",
+ "",
+ "",
+ "");
+ /********
+ HEADER
+ *********/
+ ( $this->session->isInstructor() )
+ ? $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "true")
+ : $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "false")
+ ;
+
+ /********
+ MENU
+ *********/
+ $this->xml->addButtonElement(
+ "all",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-launch",
+ get_string('toolbar_launch', 'voicetools'),
+ "javascript:LaunchElement('manageAction.php','voicetools');");
+
+ if($this->session->isInstructor())
+ {
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ 'lib/web/pictures/buttons/toolbar-activities',
+ get_string('toolbar_activity', 'voicetools'),
+ "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=voicetools')");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "enabled",
+ "lib/web/pictures/buttons/toolbar-new",
+ get_string('toolbar_new', 'voicetools'),
+ "javascript:launchAjaxRequest('getXmlChoicePage.php','create' ,'true','all')");
+
+ $this->xml->addSpaceElement("150px", "instructor");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-settings",
+ get_string('toolbar_settings', 'voicetools'),
+ "javascript:editSettings('getXmlNewPanel.php','all');");
+
+ $this->xml->addButtonElement(
+ "instructor",
+ "all",
+ "disabled",
+ "lib/web/pictures/buttons/toolbar-delete",
+ get_string('toolbar_delete', 'voicetools'),
+ "javascript:deleteResource('manageAction.php');");
+
+ $this->xml->addSpaceElement("50px", "instructor");
+ }
+ else
+ {
+ $this->xml->addSpaceElement("300px", "instructor");
+ }
+
+ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari'))
+ {
+ $this->xml->addSearchElement("all", "Safari");
+ }
+ else
+ {
+ $this->xml->addSearchElement("all", "other");
+ }
+ /********
+ MESSAGE BAR
+ *********/
+ $resources = $this->getListVoiceTools();
+
+ if ($resources != null)
+ {
+ $this->xml->addProduct(
+ "voicetools",
+ "productType",
+ "Voice Board",
+ "board",
+ $resources["board"],
+ get_string('list_no_boards', 'voicetools'));
+
+ $this->xml->addProduct(
+ "voicetools",
+ "productType",
+ "Voice Presentation",
+ "presentation",
+ $resources["presentation"],
+ get_string('list_no_presentations', 'voicetools'));
+
+ $this->xml->addProduct(
+ "voicetools",
+ "productType",
+ "Podcaster",
+ "pc",
+ $resources["pc"],
+ get_string('list_no_pcs', 'voicetools'));
+ }
+ else
+ {//problem to get the vt resource
+ $this->xml->setError(get_string("error_connection_vt", "voicetools"));
+ }
+
+ if (isset ($message) && $message!="")
+ {
+ $this->xml->addMessage($message);
+ }
+
+ }
+
+ function getLCSettingsView($update, $createWorkflow) {
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement(
+ $this->session->timeOfLoad,
+ $this->session->hparams["firstname"],
+ $this->session->hparams["lastname"],
+ $this->session->hparams["email"],
+ $this->session->hparams["role"],
+ $this->session->hparams["course_id"],
+ $this->session->signature,
+ "",
+ "",
+ "",
+ "");
+ /********
+ HEADER
+ *********/
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
+
+ if($update=="update")
+ {
+ $this->xml->addContextElement(
+ get_string("contextbar_settings", "liveclassroom"),
+ get_string("general_" . $this->product, "liveclassroom"),
+ $this->currentObject->getLongname(), "");
+ }
+ else
+ {
+ $this->xml->addContextElement(
+ get_string("contextbar_settings", "liveclassroom"),
+ get_string("general_" . $this->product, "liveclassroom"),
+ get_string("contextbar_new_" . $this->product, "liveclassroom"), "");
+ }
+ /********
+ * Settings tabs
+ */
+ $this->createLcInfoPanel();
+ $this->createLcMediaPanel();
+ $this->createLcFeaturesPanel();
+ $this->createLcChatPanel();
+ $this->createLcAccessPanel();
+
+ if ($update == "update" && $this->currentObject != null && !$this->currentObject->isArchive())
+ {
+ $this->createLcAdvancedPanel();
+ }
+
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_ok", "liveclassroom"),
+ "actionHide",
+ "javascript:launchAjaxRequest('generateListRooms.php','',true,'all')", "advanced_Ok");
+
+ if ($createWorkflow == "true")
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_cancel", "liveclassroom"),
+ "action",
+ "javascript:redirectToActivity('doAction.php','redirection','','" . $createWorkflow . "')",
+ "setting_Cancel");
+ }
+ else
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_cancel", "liveclassroom"),
+ "action",
+ "javascript:launchAjaxRequest('generateListRooms.php','',true,'all')",
+ "setting_Cancel");
+ }
+
+ if ($update != "update")
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_create", "liveclassroom"),
+ "action",
+ "javascript:submitForm('doAction.php','create','".$this->id."','" . $createWorkflow . "')",
+ "setting_Create");
+ }
+ else
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_saveAll", "liveclassroom"),
+ "action",
+ "javascript:submitForm('doAction.php','update','".$this->currentObject->getRoomId()."')",
+ "setting_Save");
+ }
+ return $this->xml->getXml();
+ }
+
+ function getVTSettingsView($update, $createWorkflow) {
+
+ /********
+ SESSION
+ *********/
+ $this->xml->createInformationElement(
+ $this->session->timeOfLoad,
+ $this->session->hparams["firstname"],
+ $this->session->hparams["lastname"],
+ $this->session->hparams["email"],
+ $this->session->hparams["role"],
+ $this->session->hparams["course_id"],
+ $this->session->signature,
+ "",
+ "",
+ "",
+ "");
+ /********
+ HEADER
+ *********/
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
+ if($update=="update")
+ {
+ $this->xml->addContextElement(
+ get_string("contextbar_settings", "voicetools"),
+ get_string("general_" . $this->product, "voicetools"),
+ $this->currentObject->getTitle(),
+ "");
+ }
+ else
+ {
+ $this->xml->addContextElement(
+ get_string("contextbar_settings", "voicetools"),
+ get_string("general_" . $this->product, "voicetools"),
+ get_string("contextbar_new_" . $this->product, "voicetools"),
+ "");
+ }
+
+ /********
+ * Settings tabs
+ */
+ if ($this->product == "board")
+ {
+ $this->createGeneralInfoPanelStart();
+ $this->createVBInfoPanel();
+ //Media settings
+ $this->createVBVPMediaPanel();
+ $this->createVBFeaturesPanel();
+ $this->createVTAccessPanel();
+ }
+ elseif ($this->product == "presentation")
+ {
+ $this->createGeneralInfoPanelStart();
+ $this->createVPInfoPanel();
+ //Media settings
+ $this->createVBVPMediaPanel();
+ $this->createVTAccessPanel();
+ }
+ elseif ($this->product == "pc")
+ {
+ $this->createGeneralInfoPanelStart();
+ $this->createPodcasterNameExample();
+ $this->createGeneralInfoPanelEnd();
+ $this->createPCInfoPanel();
+ //Media settings
+ $this->createPCMediaPanel();
+ $this->createPCFeaturesPanel();
+ $this->createVTAccessPanel();
+ }
+
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_ok", "voicetools"),
+ "actionHide",
+ "javascript:launchAjaxRequest('getXmlListPanel.php','',true,'all')",
+ "advanced_Ok");
+
+ if ($createWorkflow == "true")
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_cancel", "voicetools"),
+ "action",
+ "javascript:redirectToActivity('manageAction.php','redirection','','" . $createWorkflow . "')",
+ "setting_Cancel");
+ }
+ else
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_cancel", "voicetools"),
+ "action",
+ "javascript:launchAjaxRequest('getXmlListPanel.php','',true,'all')",
+ "setting_Cancel");
+ }
+
+ if ($update != "update")
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_create", "voicetools"),
+ "action",
+ "javascript:submitForm('manageAction.php','create','','" . $createWorkflow . "')",
+ "setting_Create");
+ }
+ else
+ {
+ $this->xml->createValidationButtonElement(
+ get_string("validationElement_saveAll", "voicetools"),
+ "action",
+ "javascript:submitForm('manageAction.php','update','" . $this->currentObject->getRid() . "')",
+ "setting_Save");
+ }
+ }
+
+ /**
+ * Add the necessary elements to the current xml object to render the panel information of the lc settings
+ */
+ function createLcInfoPanel() {
+
+ $this->xml->addSimpleLineElement("label", "*", array ( "class" => "alert"));
+ $this->xml->addSimpleLineElement("label", get_string("settings_title", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "top",
+ "align" => "right"));
+
+ $parameters = array (
+ "type" => "input",
+ "name" => "longname",
+ "id" => "longname",
+ "style" => "input",
+ "maxlength" => "50"
+ );
+ if ($this->currentObject != null)
+ {
+ $parameters["value"] = $this->currentObject->getLongName();
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->createLinePart();
+
+ $this->xml->addSimpleLineElement("label", "*", $parameters = array ("class" => "alert"));
+ $this->xml->addSimpleLineElement("label", get_string("settings_required", 'liveclassroom'));
+ $this->xml->createLinePart("italic", 0);
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label", get_string("settings_description", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "topLabel",
+ "align" => "right"));
+
+ $parameters = array (
+ "name" => "description",
+ "id" => "description",
+ "rows" => "4",
+ "cols" => "30"
+ );
+ if ($this->currentObject != null)
+ {
+ $parameters["value"] = $this->currentObject->getDescription();
+ }
+ else
+ {
+ $parameters["value"] = "";
+ }
+ $this->xml->addTextAreaElement("textarea", $parameters);
+ $this->xml->createLinePart();
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label", get_string("settings_type", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "topLabel",
+ "align" => "right"));
+
+ $parameters = array (
+ "type" => "radio",
+ "name" => "led",
+ "value" => "instructor",
+ "id" => "led_instructor",
+ "onclick" => "toggleTypeOfRoom(\"MainLecture\")"
+ );
+ if($this->isArchive == "true")
+ {
+ $parameters["disabled"] = "true";
+ }
- $this->xml = new WimbaXml();
- $this->currentTab = $currentIdtab;
- if($api!=null)
- {
- $this->prefix=$api->getPrefix();
- }
- }
+ $roomId=$this->currentObject->getRoomId();
+ $courseId=$this->session->getCourseId() . "_S";
+ $isStudentAdmin= $this->api->isStudentAdmin($roomId, $courseId);
+ if ($this->currentObject == null || $isStudentAdmin == "false") {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+
+ $parameters = array (
+ "class" => "top",
+ "for" => "led_instructor",
+ );
+ if($this->isArchive=="true")
+ {
+ $parameters["disabled"] ="true";
+ }
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_mainLecture_comment", 'liveclassroom'),
+ $parameters);
+ $this->xml->createLinePart();
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label", " ");
+ $this->xml->createLinePart();
+
+ $parameters = array (
+ "type" => "radio",
+ "name" => "led",
+ "value" => "student",
+ "id" => "led_student",
+ "onclick" => "toggleTypeOfRoom(\"Discussion\")",
+ );
+ if($this->isArchive == "true")
+ {
+ $parameters["disabled"] = "true";
+ }
+ if ($this->currentObject != null && $isStudentAdmin == "true")
+ {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+
+ $parameters = array (
+ "class" => "top",
+ "for" => "led_student",
+ );
+ if($this->isArchive=="true")
+ {
+ $parameters["disabled"] = "true";
+ }
+
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_discussion_comment", 'liveclassroom'),
+ $parameters);
+ $this->xml->createLinePart();
+
+ $this->xml->createLine();
+
+ if ($this->currentTab == "Info" || $this->currentTab == "") {
+ $this->xml->createPanelSettings(
+ get_string("tab_title_roomInfo", 'liveclassroom'),
+ "block",
+ "Info",
+ "tabSelected",
+ "all",
+ "editSettings(\"generateSettings.php\",\"all\")");
+ }
+ else
+ {
+ $this->xml->createPanelSettings(
+ get_string("tab_title_roomInfo", 'liveclassroom'),
+ "none",
+ "Info",
+ "tabNoSelected",
+ "all",
+ "editSettings(\"generateSettings.php\",\"all\")");
+ }
+ }
+
+
+ /**
+ * Add the necessary elements to the current xml object to render the panel medua of the lc settings
+ */
+ function createLcMediaPanel() {
+ $options = array ();
+ //this tab is not available for archives
+ if ($this->currentObject == null || !$this->currentObject->isArchive())
+ {
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_student_privileges", 'liveclassroom'),
+ $parameters);
+ $this->xml->createLinePart(
+ array ("style" => "top","align" => "right"));
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "hms_two_way_enabled",
+ "value" => "true",
+ "id" => "hms_two_way_enabled"
+ );
+ if ($this->lectureRoom == "hiddenSetting")
+ {
+ $parameters["disabled"]= "disabled";
+ }
+ if ($this->currentObject == null || $this->currentObject->isHmsTwoWayEnabled())
+ {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+ if ($this->lectureRoom == "hiddenSetting")
+ {
+ $parameters = array ("class" => "labelDisabled");
+ }
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_hms_two_way_enabled", 'liveclassroom'),
+ $parameters);
+ $this->xml->createLinePart(array ("context" => $this->disabledSetting));
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label");
+ $this->xml->createLinePart();
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "enable_student_video_on_startup",
+ "value" => "true",
+ "id" => "enable_student_video_on_startup"
+ );
+ if ($this->lectureRoom == "hiddenSetting")
+ {
+ $parameters["disabled"]= "disabled";
+ }
+ if ($this->currentObject == null || $this->currentObject->isStudentVideoOnStartupEnabled())
+ {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+ if ($this->lectureRoom == "hiddenSetting") {
+ $parameters = array ("class" => "labelDisabled");
+ }
+
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enable_student_video_on_startup", 'liveclassroom'),
+ $parameters);
+ $this->xml->createLinePart(array ("context" => $this->disabledSetting));
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label");
+ $this->xml->createLinePart();
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "hms_simulcast_restricted",
+ "value" => "25",
+ "id" => "hms_simulcast_restricted"
+ );
+ if ($this->lectureRoom == "hiddenSetting")
+ {
+ $parameters["disabled"]= "disabled";
+ }
+
+ if ($this->currentObject == null || !$this->currentObject->isHmsSimulcastRestricted())
+ {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+
+ if ($this->lectureRoom == "hiddenSetting") {
+ $parameters = array ("class" => "labelDisabled");
+ }
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_hms_simulcast_restricted", 'liveclassroom'),
+ $parameters);
+ $this->xml->createLinePart(array ("context" => $this->disabledSetting));
+
+ $this->xml->createLine();
+
+ $this->xml->createLine("settings_separator");
+
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_video_bandwidth", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "top",
+ "align" => "right"));
+ //select parameter
+ $optionsParamaters = array (
+ "value" => "slow",
+ "display" => get_string("settings_video_bandwidth_small",'liveclassroom')
+ );
+
+ if ($this->currentObject != null && $this->currentObject->getVideoBandwidth() == "slow")
+ {
+ $optionsParamaters["selected"] = "true";
+ }
+ $options[] = $optionsParamaters;
+
+ $optionsParamaters = array (
+ "value" => "medium",
+ "display" => get_string("settings_video_bandwidth_medium",'liveclassroom')
+ );
+ if ($this->currentObject == null || $this->currentObject->getVideoBandwidth() == "medium")
+ {
+ $optionsParamaters["selected"] = "true";
+ }
+ $options[] = $optionsParamaters;
+
+ $optionsParamaters = array (
+ "value" => "fast",
+ "display" => get_string("settings_video_bandwidth_large",'liveclassroom')
+ );
+ if ($this->currentObject != null && $this->currentObject->getVideoBandwidth() == "fast")
+ {
+ $optionsParamaters["selected"] = "true";
+ }
+ $options[] = $optionsParamaters;
+
+ $optionsParamaters = array (
+ "value" => "custom",
+ "display" => get_string("settings_video_bandwidth_custom",'liveclassroom')
+ );
+
+ if ($this->currentObject != null && $this->currentObject->getVideoBandwidth() == "custom")
+ {
+ $optionsParamaters["selected"] = "true";
+ $options[] = $optionsParamaters;
+ }
+ $this->xml->createOptionElement("video_bandwidth", "video_bandwidth", $options);
+ $this->xml->createLinePart();
+
+ $this->xml->createLine();
+ }
+
+ if ($this->currentTab == "Media")
+ {
+ $this->xml->createPanelSettings(
+ get_string("tab_title_media", 'liveclassroom'),
+ "block",
+ "Media",
+ "tabSelected",
+ Util . LC_MAINLECTURE,
+ "editSettings(\"generateSettings.php\",\"all\")");
+ }
+ else
+ {
+ if ($this->currentObject != null && $this->currentObject->isArchive())
+ {
+ $this->xml->createPanelSettings(
+ get_string("tab_title_media", 'liveclassroom'),
+ "none",
+ "Media",
+ "tabDisabled",
+ Util . LC_MAINLECTURE,
+ "editSettings(\"generateSettings.php\",\"all\")");
+ }
+ else
+ {
+ $this->xml->createPanelSettings(
+ get_string("tab_title_media", 'liveclassroom'),
+ "none",
+ "Media",
+ "tabNoSelected",
+ "mainLecture",
+ "editSettings(\"generateSettings.php\",\"all\")");
+ }
+ }
+ }
+
+ /**
+ * Add the necessary elements to the current xml object to render the panel features of the lc settings
+ */
+ function createLcFeaturesPanel() {
+
+ if ($this->currentObject == null || !$this->currentObject->isArchive()) {
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_status_indicators", 'liveclassroom'));
+ $this->xml->createLinePart(
+ array ("style" => "top","align" => "right"));
- function setCurrentProduct($product, $object = NULL, $objectInformations = NULL) {
- $this->product = $product;
- $this->currentObject = $object;
-
- if($this->currentObject == null)
- $this->id=$this->session->getCourseId() . rand();
-
- if ($product == "liveclassroom") {
- if ($this->currentObject != null && $this->currentObject->isArchive()) {
- $this->isArchive = "true";
- }
- if ($this->currentObject == null || $this->currentObject != null && $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getCourseId() . "_S") == "false") {
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "enabled_status",
+ "value" => "true",
+ "id" => "enabled_status",
+ "onclick" => "doStatusEnabled()"
+ );
+ if ($this->currentObject == null || $this->currentObject->isUserstatusEnabled()) {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enabled_status", 'liveclassroom'));
+ $this->xml->createLinePart();
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("br");
+ $this->xml->createLinePart();
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "status_appear",
+ "value" => "true",
+ "id" => "status_appear",
+ );
+ if ($this->currentObject != null && !$this->currentObject->isUserstatusEnabled())
+ {
+ $parameters["disabled"] = "true";
+ }
+ else{
+ if ($this->currentObject == null || $this->currentObject->isSendUserstatusUpdates())
+ {
+ $parameters["checked"] = "true";
+ }
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_status_appear", 'liveclassroom'));
+ $this->xml->createLinePart();
+
+ $this->xml->createLine("subOption");
+
+ $this->xml->createLine("settings_separator");
+
+ $this->xml->addSimpleLineElement("br");
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label", get_string("settings_eboard", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "top",
+ "align" => "right",
+ "context" => $this->lectureRoom));
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "enabled_student_eboard",
+ "value" => "true",
+ "id" => "enabled_student_eboard"
+ );
+ if ($this->currentObject != null && $this->currentObject->isStudentWhiteboardEnabled())
+ {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enabled_student_eboard", 'liveclassroom'));
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("br");
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_breakout", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "top",
+ "align" => "right",
+ "context" => $this->lectureRoom));
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "enabled_breakoutrooms",
+ "value" => "true",
+ "id" => "enabled_breakoutrooms",
+ "onclick" => "doBreakoutEnabled()"
+ );
+ if ($this->currentObject == null || $this->currentObject->isBOREnabled())
+ {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enabled_breakoutrooms", 'liveclassroom'));
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $this->xml->createLine();
+
+ $this->xml->addSimpleLineElement("label");
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "enabled_students_breakoutrooms",
+ "value" => "true",
+ "id" => "enabled_students_breakoutrooms"
+ );
+ if ($this->currentObject != null && !$this->currentObject->isBOREnabled())
+ {
+ $parameters["disabled"] = "true";
+ }
+ else
+ {
+ if ($this->currentObject != null &&
+ $this->currentObject->isChatEnabled() &&
+ $this->currentObject->isBORCarouselsPublic())
+ {
+ $parameters["checked"] = "true";
+ }
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enabled_students_breakoutrooms", 'liveclassroom'));
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $this->xml->createLine("subOption");
+
+ $this->xml->addSimpleLineElement("label");
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "enabled_students_mainrooms",
+ "value" => "true",
+ "id" => "enabled_students_mainrooms"
+ );
+ if ($this->currentObject != null && !$this->currentObject->isBOREnabled())
+ {
+ $parameters["disabled"] = "true";
+ }
+ else
+ {
+ if ($this->currentObject != null &&
+ $this->currentObject->isBOREnabled() &&
+ $this->currentObject->isBORShowRoomCarousels())
+ {
+ $parameters["checked"] = "true";
+ }
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enabled_students_mainrooms", 'liveclassroom'));
+ $this->xml->createLinePart(array ("context" => $this->lectureRoom));
+
+ $this->xml->createLine("subOption");
+
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_presenter_console", 'liveclassroom'));
+ $this->xml->createLinePart(array (
+ "style" => "top",
+ "align" => "right",
+ "context" => $this->discussionRoom));
+
+ $parameters = array (
+ "type" => "checkbox",
+ "name" => "archiveEnabled",
+ "value" => "true",
+ "id" => "enabled_students_mainrooms"
+ );
+ if ($this->currentObject == null || $this->currentObject->isArchiveEnabled()) {
+ $parameters["checked"] = "true";
+ }
+ $this->xml->addInputElement("input", $parameters);
+ $this->xml->addSimpleLineElement(
+ "label",
+ get_string("settings_enabled_archiving", 'liveclassroom'));
+ $this->xml->createLinePart(array ("context" => $this->discussionRoom));
+
+ $this->xml->createLine("",...
[truncated message content] |
|
From: <tro...@us...> - 2008-01-25 22:56:12
|
Revision: 235
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=235&view=rev
Author: trollinger
Date: 2008-01-25 14:56:11 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
code review and cleaning
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/php/common/XmlResource.php
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetoolsAPI.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-25 22:54:52 UTC (rev 234)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-25 22:56:11 UTC (rev 235)
@@ -20,7 +20,8 @@
array("value"=>"studentView","type"=>PARAM_BOOL,"default_value"=>null),
array("value"=>"createWorkflow","type"=>PARAM_BOOL,"default_value"=>null),
array("value"=>"action","type"=>PARAM_ALPHA,"default_value"=>null),
- array("value"=>"resource_id","type"=>PARAM_CLEAN,"default_value"=>"0"),
+ array("value"=>"resource_id","type"=>PARAM_CLEAN,"default_value"=>"0"),
+ array("value"=>"error","type"=>PARAM_CLEAN,"default_value"=>""),
);
}
@@ -54,7 +55,7 @@
return array (
- array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>null),
+ array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>""),
array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>"dd"),
array("value"=>"led","type"=>PARAM_ALPHA,"default_value"=>"instructor"),
@@ -145,6 +146,27 @@
}
+function redirection($url){
+ header('Location:'.$url);
+ exit ();
+}
+function parentRedirection($url){
+ echo '<script> window.top.location="' . $url . '"; </script>';
+ exit ();
+}
+
+function manage_error($errno,$error,$file,$line,$context){
+ global $CFG;
+ if($errno<10){
+
+ redirection('welcome.php?error=rrr');
+ }
+ if($errno<10){
+ //add to log
+ }
+}
+
+
function txt($string){
$result = str_replace("<br />", "" ,$string);
$result = str_replace("<p>", "" ,$result);
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-25 22:54:52 UTC (rev 234)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-25 22:56:11 UTC (rev 235)
@@ -141,9 +141,6 @@
$this->xml->setError(get_string("error_connection_lc", "liveclassroom"));
}
-
-
-
return $this->xml->getXml();
}
@@ -201,13 +198,13 @@
if (isset ($message) && $message!="") {
$this->xml->addMessage($message);
}
- return $this->xml->getXml();
+
}
function setError($error) {
$this->xml->setError($error);
- return $this->xml->getXml();
+
}
function getListVoiceTools() {
@@ -294,7 +291,6 @@
}
-
/********
* Settings tabs
*/
@@ -385,7 +381,7 @@
else {
$this->xml->createValidationButtonElement(get_string("validationElement_saveAll", "voicetools"), "action", "javascript:submitForm('manageAction.php','update','" . $this->currentObject->getRid() . "')", "setting_Save");
}
- return $this->xml->getXml();
+
}
/*
@@ -1914,5 +1910,11 @@
$this->xml->createLine();
$this->xml->createPanelSettings(get_string("tab_title_features", 'voicetools'), "none", "Features", "tabNoSelected", "all");
}
+
+ function getXmlString()
+ {
+ return $this->xml->getXml();
+ }
+
}
?>
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-25 22:54:52 UTC (rev 234)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-25 22:56:11 UTC (rev 235)
@@ -27,832 +27,665 @@
******************************************************************************/
/* $Id: $ */
-
-
class WimbaXml{
-
-
- var $xmldoc;
- var $part=array(); //contains the different part of the UI
- var $linePart=array();
- var $lineElement=array();
- var $panelLines=array();
- var $validationElements;
- var $Informations;
- var $error=NULL;
-
- function WimbaXml()
- {
- $this->xmldoc = domxml_new_doc("1.0");
-
- //XmlElement root = xml.CreateElement("root");
- //xml.AppendChild(root);
- //windows = xml.CreateElement("windows");
-
-
- }
-
-
- function getXml()
- {
- // XmlElement products = xml.CreateElement("products");
- // Boolean listAvailable = false;
- $root = $this->xmldoc->create_element("root");
- $windows = $this->xmldoc->create_element("windows");
- //xml.AppendChild(root);
- //windows = xml.CreateElement("windows");
-
- if($this->error==NULL){
- $root->append_child($this->Informations);
- foreach ($this->part as $key => $value)
- {
-
- $windows->append_child($this->addWindowsElement($key, $value));
- }
- }else{
-
- $windows->append_child($this->addWindowsElement("error",$this->error));
- }
+ var $xmldoc;
+ var $part=array(); //contains the different part of the UI
+ var $linePart=array();
+ var $lineElement=array();
+ var $panelLines=array();
+ var $validationElements;
+ var $Informations;
+ var $error=NULL;
- $root->append_child($windows);
- $this->xmldoc->append_child($root);
+ function WimbaXml()
+ {
+ $this->xmldoc = domxml_new_doc("1.0");
+ }
- $xmlstring = $this->xmldoc->dump_mem(true); // Xml datas into a string
-
- $finalstring = str_replace("\n", '', $xmlstring);
-
- return $finalstring;
-
-
- }
-
-
- function addFilter($value,$name,$action,$availibility)
- {
- if (!isset($this->part["filterBar"]))//first elemet of the filterBar
+ function getXml()
{
- //creation of the filterbar element
- $this->part["filterBar"]= $this->xmldoc->create_element("filters");
-
+ $root = $this->xmldoc->create_element("root");
+ $windows = $this->xmldoc->create_element("windows");
+
+ if($this->error==NULL)
+ {
+ $root->append_child($this->Informations);
+ foreach ($this->part as $key => $value)
+ {
+ $windows->append_child($this->addWindowsElement($key, $value));
+ }
+ }
+ else
+ {
+ $windows->append_child($this->addWindowsElement("error",$this->error));
+ }
+
+ $root->append_child($windows);
+ $this->xmldoc->append_child($root);
+ $xmlstring = $this->xmldoc->dump_mem(true); // Xml datas into a string
+ $finalstring = str_replace("\n", '', $xmlstring);
+ return $finalstring;
}
- $filter = $this->xmldoc->create_element('filter');
- $filterValue = $this->xmldoc->create_element("value");
- $filterValue->append_child($this->xmldoc->create_text_node($value));
- $filter->append_child($filterValue);
-
- $filterName = $this->xmldoc->create_element("name");
- $filterName->append_child($this->xmldoc->create_text_node($name));
- $filter->append_child($filterName);
-
- $filterValue = $this->xmldoc->create_element("value");
- $filterValue->append_child($this->xmldoc->create_text_node($value));
- $filter->append_child($filterValue);
- $filterAvailibility = $this->xmldoc->create_element("availibility");
- $filterAvailibility->append_child($this->xmldoc->create_text_node($availibility));
- $filter->append_child($filterAvailibility);
-
- $filterAction = $this->xmldoc->create_element("action");
- $filterAction->append_child($this->xmldoc->create_text_node($action));
- $filter->append_child($filterAction);
-
-
- $this->part["filterBar"]->append_child($filter);
-
- }
-
- function addHeaderElement($pictureUrl,$disabled,$isInstructor)
- {
- if (!isset($this->part["headerBar"]))
+ function addFilter($value,$name,$action,$availibility)
{
- $this->part["headerBar"]=$this->xmldoc->create_element("headerBarInformations");
-
+ if (!isset($this->part["filterBar"]))//first elemet of the filterBar
+ {
+ //creation of the filterbar element
+ $this->part["filterBar"]= $this->xmldoc->create_element("filters");
+ }
+
+ $filter = $this->xmldoc->create_element('filter');
+ $filterValue = $this->xmldoc->create_element("value");
+ $filterValue->append_child($this->xmldoc->create_text_node($value));
+ $filter->append_child($filterValue);
+ $filterName = $this->xmldoc->create_element("name");
+ $filterName->append_child($this->xmldoc->create_text_node($name));
+ $filter->append_child($filterName);
+ $filterValue = $this->xmldoc->create_element("value");
+ $filterValue->append_child($this->xmldoc->create_text_node($value));
+ $filter->append_child($filterValue);
+ $filterAvailibility = $this->xmldoc->create_element("availibility");
+ $filterAvailibility->append_child($this->xmldoc->create_text_node($availibility));
+ $filter->append_child($filterAvailibility);
+ $filterAction = $this->xmldoc->create_element("action");
+ $filterAction->append_child($this->xmldoc->create_text_node($action));
+ $filter->append_child($filterAction);
+ $this->part["filterBar"]->append_child($filter);
}
- $picture = $this->xmldoc->create_element("pictureUrl");
- $picture->append_child($this->xmldoc->create_text_node($pictureUrl));
-
- $disable = $this->xmldoc->create_element("disabled");
- $disable->append_child($this->xmldoc->create_text_node($disabled));
-
- $hbinstructorview = $this->xmldoc->create_element("instructorView");
- $hbinstructorview->append_child($this->xmldoc->create_text_node(get_string('instructorview', 'voicetools')));
- $hbstudentview = $this->xmldoc->create_element("studentView");
- $hbstudentview->append_child($this->xmldoc->create_text_node(get_string('studentview', 'voicetools')));
-
- $isInstructorElement = $this->xmldoc->create_element("isInstructor");
- $isInstructorElement->append_child($this->xmldoc->create_text_node($isInstructor));
-
- $this->part["headerBar"]->append_child($picture);
- $this->part["headerBar"]->append_child($hbinstructorview);
- $this->part["headerBar"]->append_child($hbstudentview);
- $this->part["headerBar"]->append_child($disable);
- $this->part["headerBar"]->append_child($isInstructorElement);
- }
-
- function addContextElement($context, $product="",$name="",$style="")
- {
- if (!isset($this->part["contextBar"]))
+ function addHeaderElement($pictureUrl,$disabled,$isInstructor)
{
- $this->part["contextBar"] = $this->xmldoc->create_element("contextBarInformations");
-
+ if (!isset($this->part["headerBar"]))
+ {
+ $this->part["headerBar"]=$this->xmldoc->create_element("headerBarInformations");
+ }
+
+ $picture = $this->xmldoc->create_element("pictureUrl");
+ $picture->append_child($this->xmldoc->create_text_node($pictureUrl));
+ $disable = $this->xmldoc->create_element("disabled");
+ $disable->append_child($this->xmldoc->create_text_node($disabled));
+ $hbinstructorview = $this->xmldoc->create_element("instructorView");
+ $hbinstructorview->append_child($this->xmldoc->create_text_node(get_string('instructorview', 'voicetools')));
+ $hbstudentview = $this->xmldoc->create_element("studentView");
+ $hbstudentview->append_child($this->xmldoc->create_text_node(get_string('studentview', 'voicetools')));
+ $isInstructorElement = $this->xmldoc->create_element("isInstructor");
+ $isInstructorElement->append_child($this->xmldoc->create_text_node($isInstructor));
+ $this->part["headerBar"]->append_child($picture);
+ $this->part["headerBar"]->append_child($hbinstructorview);
+ $this->part["headerBar"]->append_child($hbstudentview);
+ $this->part["headerBar"]->append_child($disable);
+ $this->part["headerBar"]->append_child($isInstructorElement);
}
- $contextBarType = $this->xmldoc->create_element("context");
- $contextBarType->append_child($this->xmldoc->create_text_node($context));
- $contextBarStyle = $this->xmldoc->create_element("style");
- $contextBarStyle->append_child($this->xmldoc->create_text_node($style));
-
- $contextBarProduct = $this->xmldoc->create_element("product");
- $contextBarProduct->append_child($this->xmldoc->create_text_node($product));
-
- $contextBarName = $this->xmldoc->create_element("name");
- $contextBarName->append_child($this->xmldoc->create_text_node($name));
-
- $this->part["contextBar"]->append_child($contextBarType);
- $this->part["contextBar"]->append_child($contextBarProduct);
- $this->part["contextBar"]->append_child($contextBarName);
- $this->part["contextBar"]->append_child($contextBarStyle);
- }
-
-
- function addButtonElement($typeOfUser, $typeOfProduct, $availibility="", $pictureUrl="", $value="", $action="")
- {
- if (!isset($this->part["toolBar"]))
+ function addContextElement($context, $product="",$name="",$style="")
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["contextBar"]))
+ {
+ $this->part["contextBar"] = $this->xmldoc->create_element("contextBarInformations");
+ }
+
+ $contextBarType = $this->xmldoc->create_element("context");
+ $contextBarType->append_child($this->xmldoc->create_text_node($context));
+ $contextBarStyle = $this->xmldoc->create_element("style");
+ $contextBarStyle->append_child($this->xmldoc->create_text_node($style));
+ $contextBarProduct = $this->xmldoc->create_element("product");
+ $contextBarProduct->append_child($this->xmldoc->create_text_node($product));
+ $contextBarName = $this->xmldoc->create_element("name");
+ $contextBarName->append_child($this->xmldoc->create_text_node($name));
+ $this->part["contextBar"]->append_child($contextBarType);
+ $this->part["contextBar"]->append_child($contextBarProduct);
+ $this->part["contextBar"]->append_child($contextBarName);
+ $this->part["contextBar"]->append_child($contextBarStyle);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("button"));
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
- $elementTypeOfProduct = $this->xmldoc->create_element("typeOfProduct");//for student and isntructor or just for instructor
- $elementTypeOfProduct->append_child($this->xmldoc->create_text_node($typeOfProduct));
- $elementPictureUrl = $this->xmldoc->create_element("pictureUrl");
- $elementPictureUrl->append_child($this->xmldoc->create_text_node($pictureUrl));
- $elementValue = $this->xmldoc->create_element("value");
- $elementValue->append_child($this->xmldoc->create_text_node($value));
- $elementAvailibility = $this->xmldoc->create_element("availibility");
- $elementAvailibility->append_child($this->xmldoc->create_text_node($availibility));
- $elementAction = $this->xmldoc->create_element("action");
-
- $elementAction->append_child($this->xmldoc->create_text_node($action));
-
- $element->append_child($elementAvailibility);
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
- $element->append_child($elementTypeOfProduct);
- $element->append_child($elementPictureUrl);
- $element->append_child($elementValue);
- $element->append_child($elementAction);
- $this->part["toolBar"]->append_child($element);
- }
-
- function addSpaceElement($width, $typeOfUser)
- {
- if (!isset($this->part["toolBar"]))
+ function addButtonElement($typeOfUser, $typeOfProduct, $availibility="", $pictureUrl="", $value="", $action="")
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("button"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $elementTypeOfProduct = $this->xmldoc->create_element("typeOfProduct");//for student and isntructor or just for instructor
+ $elementTypeOfProduct->append_child($this->xmldoc->create_text_node($typeOfProduct));
+ $elementPictureUrl = $this->xmldoc->create_element("pictureUrl");
+ $elementPictureUrl->append_child($this->xmldoc->create_text_node($pictureUrl));
+ $elementValue = $this->xmldoc->create_element("value");
+ $elementValue->append_child($this->xmldoc->create_text_node($value));
+ $elementAvailibility = $this->xmldoc->create_element("availibility");
+ $elementAvailibility->append_child($this->xmldoc->create_text_node($availibility));
+ $elementAction = $this->xmldoc->create_element("action");
+ $elementAction->append_child($this->xmldoc->create_text_node($action));
+ $element->append_child($elementAvailibility);
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $element->append_child($elementTypeOfProduct);
+ $element->append_child($elementPictureUrl);
+ $element->append_child($elementValue);
+ $element->append_child($elementAction);
+ $this->part["toolBar"]->append_child($element);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("space"));
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
- $elementWidth = $this->xmldoc->create_element("width");//for student and isntructor or just for instructor
- $elementWidth->append_child($this->xmldoc->create_text_node($width));
-
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
- $element->append_child($elementWidth);
-
-
- $this->part["toolBar"]->append_child($element);
- }
- function addSeparatorElement($typeOfUser)
- {
- if (!isset($this->part["toolBar"]))
+ function addSpaceElement($width, $typeOfUser)
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("space"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $elementWidth = $this->xmldoc->create_element("width");//for student and isntructor or just for instructor
+ $elementWidth->append_child($this->xmldoc->create_text_node($width));
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $element->append_child($elementWidth);
+ $this->part["toolBar"]->append_child($element);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("separator"));
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
-
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
-
-
- $this->part["toolBar"]->append_child($element);
- }
- function addSearchElement($typeOfUser,$browser)
- {
- if (!isset($this->part["toolBar"]))
+ function addSeparatorElement($typeOfUser)
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("separator"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $this->part["toolBar"]->append_child($element);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("search"));
-
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
- $elementBrowser = $this->xmldoc->create_element("browser");//for student and isntructor or just for instructor
- $elementBrowser->append_child($this->xmldoc->create_text_node($browser));
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
- $element->append_child($elementBrowser);
-
-
- $this->part["toolBar"]->append_child($element);
- }
-
-
-
- function addProduct($name, $cssStyle, $value,$type,$list,$sentence)
- {
-
- if (!isset($this->part["list"]))
+ function addSearchElement($typeOfUser,$browser)
{
- $this->part["list"]=$this->xmldoc->create_element("products");
- // index$this->part[part), "listProducts");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("search"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $elementBrowser = $this->xmldoc->create_element("browser");//for student and isntructor or just for instructor
+ $elementBrowser->append_child($this->xmldoc->create_text_node($browser));
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $element->append_child($elementBrowser);
+ $this->part["toolBar"]->append_child($element);
}
-
- $product= $this->xmldoc->create_element("product");
-
- $productName= $this->xmldoc->create_element("productName");
- $productName->append_child($this->xmldoc->create_text_node($name));
- $product->append_child($productName);
-
- $productCssStyle = $this->xmldoc->create_element("style");//for student and isntructor or just for instructor
- $productCssStyle->append_child($this->xmldoc->create_text_node($cssStyle));
- $product->append_child($productCssStyle);
-
- $productValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
- $productValue->append_child($this->xmldoc->create_text_node($value));
- $product->append_child($productValue);
-
- $productType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $productType->append_child($this->xmldoc->create_text_node($type));
- $product->append_child($productType);
-
- if(count($list)>0){
-
-
- $listElements = $this->xmldoc->create_element("listElements");
-
- foreach ($list as $key => $value)
+
+ function addProduct($name, $cssStyle, $value,$type,$list,$sentence)
+ {
+ if (!isset($this->part["list"]))
{
- $listElements->append_child($value->getXml($this->xmldoc));
- }
- $product->append_child($listElements);
- }
-
- $productSentence = $this->xmldoc->create_element("NoElementSentence");//for student and isntructor or just for instructor
- $productSentence->append_child($this->xmldoc->create_text_node($sentence));
- $product->append_child($productSentence);
-
- $this->part["list"]->append_child($product);
-
- }
-
- function createMessageElement($type, $value)
- {
-
- $message = $this->xmldoc->create_element("message");
- $messageType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $messageType->append_child($this->xmldoc->create_text_node($type));
- $messageValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
- $messageValue->append_child($this->xmldoc->create_text_node($value));
- $message->append_child($messageType);
- $message->append_child($messageValue);
- return $message;
- }
-
-
-
-
-
- function CreateInformationElement($timeOfLoad, $firstName, $lastName, $email, $role, $courseId, $signature, $authToken,$lc,$vt,$picturesToLoad=null)
- {
-
- $this->Informations = $this->xmldoc->create_element("information");
- $etimeOfLoad = $this->xmldoc->create_element("timeOfLoad");
- $etimeOfLoad->append_child($this->xmldoc->create_text_node($timeOfLoad));
-
- $efirstName = $this->xmldoc->create_element("firstName");
- $efirstName->append_child($this->xmldoc->create_text_node(rawurlencode($firstName)));
- $elastName = $this->xmldoc->create_element("lastName");
- $elastName->append_child($this->xmldoc->create_text_node(rawurlencode($lastName)));
- $eemail = $this->xmldoc->create_element("email");
- $eemail->append_child($this->xmldoc->create_text_node(rawurlencode($email)));
- $erole = $this->xmldoc->create_element("role");
- $erole->append_child($this->xmldoc->create_text_node(rawurlencode($role)));
-
- $ecourseId = $this->xmldoc->create_element("courseId");
- $ecourseId->append_child($this->xmldoc->create_text_node(rawurlencode($courseId)));
- $esignature = $this->xmldoc->create_element("signature");
- $esignature->append_child($this->xmldoc->create_text_node(rawurlencode($signature)));
- $eauthToken = $this->xmldoc->create_element("authToken");
- $eauthToken->append_child($this->xmldoc->create_text_node($authToken));
- $vtUrl = $this->xmldoc->create_element("vtServerUrl");
- $vtUrl->append_child($this->xmldoc->create_text_node($vt));
- $lcUrl = $this->xmldoc->create_element("lcServerUrl");
- $lcUrl->append_child($this->xmldoc->create_text_node($lc));
- if($picturesToLoad!=null){
- $epicturesToLoad = $this->xmldoc->create_element("picturesToLoad");
- $epicturesToLoad->append_child($this->xmldoc->create_text_node($picturesToLoad));
- $this->Informations->append_child($epicturesToLoad);
+ $this->part["list"]=$this->xmldoc->create_element("products");
+ }
+
+ $product= $this->xmldoc->create_element("product");
+ $productName= $this->xmldoc->create_element("productName");
+ $productName->append_child($this->xmldoc->create_text_node($name));
+ $product->append_child($productName);
+ $productCssStyle = $this->xmldoc->create_element("style");//for student and isntructor or just for instructor
+ $productCssStyle->append_child($this->xmldoc->create_text_node($cssStyle));
+ $product->append_child($productCssStyle);
+ $productValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
+ $productValue->append_child($this->xmldoc->create_text_node($value));
+ $product->append_child($productValue);
+ $productType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $productType->append_child($this->xmldoc->create_text_node($type));
+ $product->append_child($productType);
+ if(count($list)>0)
+ {
+ $listElements = $this->xmldoc->create_element("listElements");
+ foreach ($list as $key => $value)
+ {
+ $listElements->append_child($value->getXml($this->xmldoc));
+ }
+ $product->append_child($listElements);
+ }
+ $productSentence = $this->xmldoc->create_element("NoElementSentence");//for student and isntructor or just for instructor
+ $productSentence->append_child($this->xmldoc->create_text_node($sentence));
+ $product->append_child($productSentence);
+ $this->part["list"]->append_child($product);
}
- $this->Informations->append_child($etimeOfLoad);
- $this->Informations->append_child($efirstName);
- $this->Informations->append_child($elastName);
- $this->Informations->append_child($erole);
- $this->Informations->append_child($ecourseId);
- $this->Informations->append_child($esignature);
- $this->Informations->append_child($eauthToken);
- $this->Informations->append_child($eemail);
- $this->Informations->append_child($vtUrl);
- $this->Informations->append_child($lcUrl);
-
- //xml.DocumentElement->append_child(Informations);
- }
-
-
- function addWindowsElement($type, $elementParameters)
- {
-
- $windowsElement = $this->xmldoc->create_element("windowsElement");
- $windowsElementType = $this->xmldoc->create_element("type");
- $windowsElementType->append_child($this->xmldoc->create_text_node($type));
-
- $windowsElement->append_child($windowsElementType);
- $windowsElement->append_child($elementParameters);
-
- return $windowsElement;
-
- }
-
-
-
-
- function addProductChoice($pictureUrl,$value,$description,$action){
-
- if (!isset($this->part["productChoice"]))
+ function createMessageElement($type, $value)
{
- $this->part["productChoice"]=$this->xmldoc->create_element("products");
- // index$this->part[part), "listProducts");
+ $message = $this->xmldoc->create_element("message");
+ $messageType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $messageType->append_child($this->xmldoc->create_text_node($type));
+ $messageValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
+ $messageValue->append_child($this->xmldoc->create_text_node($value));
+ $message->append_child($messageType);
+ $message->append_child($messageValue);
+ return $message;
}
-
- $product = $this->xmldoc->create_element("product");
-
- $productPictureUrl = $this->xmldoc->create_element('pictureUrl');
- $productPictureUrl->append_child( $this->xmldoc->create_text_node($pictureUrl));
- $product->append_child($productPictureUrl);
-
- $productValue = $this->xmldoc->create_element('value');
- $productValue->append_child($this->xmldoc->create_text_node($value));
- $product->append_child($productValue);
-
- $productDescription = $this->xmldoc->create_element('description');
- $productDescription->append_child($this->xmldoc->create_text_node($description));
- $product->append_child($productDescription);
-
- $productAction = $this->xmldoc->create_element("action");
- $productAction->append_child($this->xmldoc->create_text_node($action));
- $product->append_child($productAction);
-
-
- $this->part["productChoice"]->append_child($product);
-
-
- }
- /*
- *
- *Use to create the line corresponding to a TR
- *
- */
- function addInputElement($type,$parameters=NULL)
- {
- $this->addSimpleLineElement($type,"",$parameters);
- }
-function addTextAreaElement($type,$parameters=NULL)
- {
-
-
- $this->addSimpleLineElement($type,"",$parameters);
- }
-
- function addSimpleLineElement($type,$display="",$parameters=NULL)
- {
-
-
- $element = $this->xmldoc->create_element("lineElement");
- $elementType = $this->xmldoc->create_element("type");
- $elementType->append_child($this->xmldoc->create_text_node($type));
- $element->append_child($elementType);
- if($display!=""){
- $elementDisplay = $this->xmldoc->create_element("display");
- $elementDisplay->append_child($this->xmldoc->create_text_node($display));
- $element->append_child( $elementDisplay);
- }
-
-
- if($parameters !=NULL){
- $elementParameters = $this->xmldoc->create_element("parameters");
- foreach ($parameters as $key => $value)
- {
- $parameter = $this->xmldoc->create_element("parameter");
- $parameterName = $this->xmldoc->create_element("name");
- $parameterName->append_child($this->xmldoc->create_text_node($key));
- $parameterValue = $this->xmldoc->create_element("value");
- if (isset($value)){
- $parameterValue->append_child($this->xmldoc->create_text_node($value));
- }
- $parameter->append_child($parameterName);
- $parameter->append_child($parameterValue);
- $elementParameters->append_child($parameter);
-
- }
- $element->append_child($elementParameters);
- }
-
-
- $this->lineElement[]=$element;
-
- }
-
- function addDivLineElement($type, $displayContext,$parameters)
- {
-
- $element = $this->xmldoc->create_element("lineElement");
- $elementType = $this->xmldoc->create_element("type");
- $elementType->append_child($this->xmldoc->create_text_node("div"));
- $elementDisplayContext = $this->xmldoc->create_element("displayContext");
- $elementDisplayContext->append_child($this->xmldoc->create_text_node($displayContext));
- $elementParameters = $this->xmldoc->create_element("parameters");
- for ($i = 0; $i < count($parameters);$i++)
+
+ function CreateInformationElement($timeOfLoad, $firstName, $lastName, $email, $role, $courseId, $signature, $authToken,$lc,$vt,$picturesToLoad=null)
{
- $parameter = $this->xmldoc->create_element("parameter");
- $parameterName = $this->xmldoc->create_element("name");
- $parameterName->append_child($this->xmldoc->create_text_node($parameters[$i]));
- $parameterValue = $this->xmldoc->create_element("value");
- if ($parameters.GetByIndex(i) != NULL){
- $parameterValue->append_child($this->xmldoc->create_text_node($parameters[$i]));
- }
- $parameter->append_child($parameterName);
- $parameter->append_child($parameterValue);
- $elementParameters->append_child($parameter);
-
+ $this->Informations = $this->xmldoc->create_element("information");
+ $etimeOfLoad = $this->xmldoc->create_element("timeOfLoad");
+ $etimeOfLoad->append_child($this->xmldoc->create_text_node($timeOfLoad));
+ $efirstName = $this->xmldoc->create_element("firstName");
+ $efirstName->append_child($this->xmldoc->create_text_node(rawurlencode($firstName)));
+ $elastName = $this->xmldoc->create_element("lastName");
+ $elastName->append_child($this->xmldoc->create_text_node(rawurlencode($lastName)));
+ $eemail = $this->xmldoc->create_element("email");
+ $eemail->append_child($this->xmldoc->create_text_node(rawurlencode($email)));
+ $erole = $this->xmldoc->create_element("role");
+ $erole->append_child($this->xmldoc->create_text_node(rawurlencode($role)));
+ $ecourseId = $this->xmldoc->create_element("courseId");
+ $ecourseId->append_child($this->xmldoc->create_text_node(rawurlencode($courseId)));
+ $esignature = $this->xmldoc->create_element("signature");
+ $esignature->append_child($this->xmldoc->create_text_node(rawurlencode($signature)));
+ $eauthToken = $this->xmldoc->create_element("authToken");
+ $eauthToken->append_child($this->xmldoc->create_text_node($authToken));
+ $vtUrl = $this->xmldoc->create_element("vtServerUrl");
+ $vtUrl->append_child($this->xmldoc->create_text_node($vt));
+ $lcUrl = $this->xmldoc->create_element("lcServerUrl");
+ $lcUrl->append_child($this->xmldoc->create_text_node($lc));
+ if($picturesToLoad!=null)
+ {
+ $epicturesToLoad = $this->xmldoc->create_element("picturesToLoad");
+ $epicturesToLoad->append_child($this->xmldoc->create_text_node($picturesToLoad));
+ $this->Informations->append_child($epicturesToLoad);
+ }
+ $this->Informations->append_child($etimeOfLoad);
+ $this->Informations->append_child($efirstName);
+ $this->Informations->append_child($elastName);
+ $this->Informations->append_child($erole);
+ $this->Informations->append_child($ecourseId);
+ $this->Informations->append_child($esignature);
+ $this->Informations->append_child($eauthToken);
+ $this->Informations->append_child($eemail);
+ $this->Informations->append_child($vtUrl);
+ $this->Informations->append_child($lcUrl);
}
- $element->append_child($elementType);
- $element->append_child($elementDisplayContext);
-
- $element->append_child($elementParameters);
- $lineElement[]=$element;
-
- }
-
-
-
- function createOptionElement($name,$id, $listOptions,$disabled="")
- {
-
- $element = $this->xmldoc->create_element("lineElement");
- $elementType = $this->xmldoc->create_element("type");
- $elementType->append_child($this->xmldoc->create_text_node("select"));
-
- $elementDisplayContext = $this->xmldoc->create_element("displayContext");
- $elementDisplayContext->append_child($this->xmldoc->create_text_node("all"));
-
- $elementName = $this->xmldoc->create_element("name");
- $elementName->append_child($this->xmldoc->create_text_node($name));
- if($disabled!=""){
- $elementDisabled = $this->xmldoc->create_element("disabled");
- $elementDisabled->append_child($this->xmldoc->create_text_node($disabled));
- $element->append_child($elementDisabled);
- }
- $elementId = $this->xmldoc->create_element("id");
- $elementId->append_child($this->xmldoc->create_text_node($id));
-
- $options=$this->xmldoc->create_element("options");
- for ($j = 0; $j < count($listOptions); $j++){
-
-
-
- $parameters=$listOptions[$j];
- $option=$this->xmldoc->create_element("option");
-
- foreach ($parameters as $key=>$value)
- {
- $optionParameter = $this->xmldoc->create_element($key);
- $optionParameter->append_child($this->xmldoc->create_text_node($value));
- $option->append_child($optionParameter);
- }
-
- $options->append_child($option);
-
-
-
- }
- $element->append_child($elementType);
- $element->append_child($elementDisplayContext);
- $element->append_child($elementName);
- $element->append_child($elementId);
- $element->append_child($options);
- $this->lineElement[]=$element;
-
- }
-
-
- function createValidationButtonElement($value,$style,$action,$id)
- {
- if (!isset($this->part["validationBar"]))
+ function addWindowsElement($type, $elementParameters)
{
- $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
- // index$this->part[part), "validationBar");
+ $windowsElement = $this->xmldoc->create_element("windowsElement");
+ $windowsElementType = $this->xmldoc->create_element("type");
+ $windowsElementType->append_child($this->xmldoc->create_text_node($type));
+ $windowsElement->append_child($windowsElementType);
+ $windowsElement->append_child($elementParameters);
+ return $windowsElement;
}
-
- $element=$this->xmldoc->create_element("validationButton");
- $elementaction = $this->xmldoc->create_element("action");
- $elementaction->append_child($this->xmldoc->create_text_node($action));
+ function addProductChoice($pictureUrl,$value,$description,$action){
- $elementstyle = $this->xmldoc->create_element("style");
- $elementstyle->append_child($this->xmldoc->create_text_node($style));
+ if (!isset($this->part["productChoice"]))
+ {
+ $this->part["productChoice"]=$this->xmldoc->create_element("products");
+ }
+
+ $product = $this->xmldoc->create_element("product");
+ $productPictureUrl = $this->xmldoc->create_element('pictureUrl');
+ $productPictureUrl->append_child( $this->xmldoc->create_text_node($pictureUrl));
+ $product->append_child($productPictureUrl);
+ $productValue = $this->xmldoc->create_element('value');
+ $productValue->append_child($this->xmldoc->create_text_node($value));
+ $product->append_child($productValue);
+ $productDescription = $this->xmldoc->create_element('description');
+ $productDescription->append_child($this->xmldoc->create_text_node($description));
+ $product->append_child($productDescription);
+ $productAction = $this->xmldoc->create_element("action");
+ $productAction->append_child($this->xmldoc->create_text_node($action));
+ $product->append_child($productAction);
+ $this->part["productChoice"]->append_child($product);
+ }
- $elementvalue = $this->xmldoc->create_element("value");
- $elementvalue->append_child($this->xmldoc->create_text_node($value));
-
- $elementid = $this->xmldoc->create_element("id");
- $elementid->append_child($this->xmldoc->create_text_node($id));
-
- $element->append_child($elementaction);
- $element->append_child($elementstyle);
- $element->append_child($elementvalue);
- $element->append_child($elementid);
-
- $this->part["validationBar"]->append_child($element);
- }
-
- function createValidationCommentElement($parameters)
- {
- if (!isset($this->part["validationBar"]))
+ /*
+ *
+ *Use to create the line corresponding to a TR
+ *
+ */
+ function addInputElement($type,$parameters=NULL)
{
- $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
- // index$this->part[part), "validationBar");
+ $this->addSimpleLineElement($type,"",$parameters);
}
- $element = $this->xmldoc->create_element("validationElement");
- $name = $this->xmldoc->create_element("type");
- $name->append_child($this->xmldoc->create_text_node("validationComment"));
- foreach ($parameters as $key => $value)
+ function addTextAreaElement($type,$parameters=NULL)
{
- $parameterName = $this->xmldoc->create_element($key);
- $parameterName->append_child($this->xmldoc->create_text_node($value));
- $element->append_child($parameterName);
+ $this->addSimpleLineElement($type,"",$parameters);
}
- $element->append_child($name);
-
- $this->part["validationBar"]->append_child($element);
- }
-
-
- /*
- *
- * Line
- *
- */
- function createLine($style="", $id="")
- {
-
- $line = $this->xmldoc->create_element("panelLine");
-
- $lineStyle = $this->xmldoc->create_element("style");
- $lineStyle->append_child($this->xmldoc->create_text_node($style));
- $line->append_child($lineStyle);
- //necessary for hidden div
- $lineId = $this->xmldoc->create_element("id");
- $lineId->append_child($this->xmldoc->create_text_node($id));
- $line->append_child($lineId);
-
- for ($i = 0; $i < count($this->linePart);$i++)
+
+ function addSimpleLineElement($type,$display="",$parameters=NULL)
{
-
- $line->append_child($this->linePart[$i]);
+ $element = $this->xmldoc->create_element("lineElement");
+ $elementType = $this->xmldoc->create_element("type");
+ $elementType->append_child($this->xmldoc->create_text_node($type));
+ $element->append_child($elementType);
+ if($display!="")
+ {
+ $elementDisplay = $this->xmldoc->create_element("display");
+ $elementDisplay->append_child($this->xmldoc->create_text_node($display));
+ $element->append_child( $elementDisplay);
+ }
+ if($parameters !=NULL)
+ {
+ $elementParameters = $this->xmldoc->create_element("parameters");
+ foreach ($parameters as $key => $value)
+ {
+ $parameter = $this->xmldoc->create_element("parameter");
+ $parameterName = $this->xmldoc->create_element("name");
+ $parameterName->append_child($this->xmldoc->create_text_node($key));
+ $parameterValue = $this->xmldoc->create_element("value");
+ if (isset($value))
+ {
+ $parameterValue->append_child($this->xmldoc->create_text_node($value));
+ }
+ $parameter->append_child($parameterName);
+ $parameter->append_child($parameterValue);
+ $elementParameters->append_child($parameter);
+ }
+ $element->append_child($elementParameters);
+ }
+ $this->lineElement[]=$element;
}
- $this->panelLines[]=$line;
- $this->linePart=array();
- }
-
-
-
-
- function createLinePart($parameters=NULL)
- {
- $panelLinePart = $this->xmldoc->create_element("panelLinePart");
- if(isset($parameters["style"])){
- $elementStyle = $this->xmldoc->create_element("style");
- $elementStyle->append_child($this->xmldoc->create_text_node($parameters["style"]));
- $panelLinePart->append_child($elementStyle);
+
+ function addDivLineElement($type, $displayContext,$parameters)
+ {
+ $element = $this->xmldoc->create_element("lineElement");
+ $elementType = $this->xmldoc->create_element("type");
+ $elementType->append_child($this->xmldoc->create_text_node("div"));
+ $elementDisplayContext = $this->xmldoc->create_element("displayContext");
+ $elementDisplayContext->append_child($this->xmldoc->create_text_node($displayContext));
+ $elementParameters = $this->xmldoc->create_element("parameters");
+ for ($i = 0; $i < count($parameters);$i++)
+ {
+ $parameter = $this->xmldoc->create_element("parameter");
+ $parameterName = $this->xmldoc->create_element("name");
+ $parameterName->append_child($this->xmldoc->create_text_node($parameters[$i]));
+ $parameterValue = $this->xmldoc->create_element("value");
+ if ($parameters.GetByIndex(i) != NULL){
+ $parameterValue->append_child($this->xmldoc->create_text_node($parameters[$i]));
+ }
+ $parameter->append_child($parameterName);
+ $parameter->append_child($parameterValue);
+ $elementParameters->append_child($parameter);
+ }
+ $element->append_child($elementType);
+ $element->append_child($elementDisplayContext);
+ $element->append_child($elementParameters);
+ $lineElement[]=$element;
}
- if(isset($parameters["align"])){
- $elementAlign = $this->xmldoc->create_element("align");
- $elementAlign->append_child($this->xmldoc->create_text_node($parameters["align"]));
- $panelLinePart->append_child($elementAlign);
+
+ function createOptionElement($name,$id, $listOptions,$disabled="")
+ {
+ $element = $this->xmldoc->create_element("lineElement");
+ $elementType = $this->xmldoc->create_element("type");
+ $elementType->append_child($this->xmldoc->create_text_node("select"));
+ $elementDisplayContext = $this->xmldoc->create_element("displayContext");
+ $elementDisplayContext->append_child($this->xmldoc->create_text_node("all"));
+ $elementName = $this->xmldoc->create_element("name");
+ $elementName->append_child($this->xmldoc->create_text_node($name));
+ if($disabled!=""){
+ $elementDisabled = $this->xmldoc->create_element("disabled");
+ $elementDisabled->append_child($this->xmldoc->create_text_node($disabled));
+ $element->append_child($elementDisabled);
+ }
+ $elementId = $this->xmldoc->create_element("id");
+ $elementId->append_child($this->xmldoc->create_text_node($id));
+ $options=$this->xmldoc->create_element("options");
+ for ($j = 0; $j < count($listOptions); $j++){
+ $parameters=$listOptions[$j];
+ $option=$this->xmldoc->create_element("option");
+ foreach ($parameters as $key=>$value)
+ {
+ $optionParameter = $this->xmldoc->create_element($key);
+ $optionParameter->append_child($this->xmldoc->create_text_node($value));
+ $option->append_child($optionParameter);
+ }
+ $options->append_child($option);
+ }
+ $element->append_child($elementType);
+ $element->append_child($elementDisplayContext);
+ $element->append_child($elementName);
+ $element->append_child($elementId);
+ $element->append_child($options);
+ $this->lineElement[]=$element;
}
- if(isset($parameters["colspan"])){
- $elementColpsan = $this->xmldoc->create_element("colspan");
- $elementColpsan->append_child($this->xmldoc->create_text_node($parameters["colspan"]));
- $panelLinePart->append_child($elementColpsan);
+
+
+ function createValidationButtonElement($value,$style,$action,$id)
+ {
+ if (!isset($this->part["validationBar"]))
+ {
+ $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
+ }
+ $element=$this->xmldoc->create_element("validationButton");
+ $elementaction = $this->xmldoc->create_element("action");
+ $elementaction->append_child($this->xmldoc->create_text_node($action));
+ $elementstyle = $this->xmldoc->create_element("style");
+ $elementstyle->append_child($this->xmldoc->create_text_node($style));
+ $elementvalue = $this->xmldoc->create_element("value");
+ $elementvalue->append_child($this->xmldoc->create_text_node($value));
+ $elementid = $this->xmldoc->create_element("id");
+ $elementid->append_child($this->xmldoc->create_text_node($id));
+ $element->append_child($elementaction);
+ $element->append_child($elementstyle);
+ $element->append_child($elementvalue);
+ $element->append_child($elementid);
+ $this->part["validationBar"]->append_child($element);
}
- if(isset($parameters["id"])){
- $elementId = $this->xmldoc->create_element("id");
- $elementId->append_child($this->xmldoc->create_text_node($parameters["id"]));
- $panelLinePart->append_child($elementId);
- }
- if(isset($parameters["context"])){
- $elementContext = $this->xmldoc->create_element("context");
- $elementContext->append_child($this->xmldoc->create_text_node($parameters["context"]));
- $panelLinePart->append_child($elementContext);
- }
- for ($j = 0; $j < count($this->lineElement); $j++)
+
+ function createValidationCommentElement($parameters)
{
- $panelLinePart->append_child($this->lineElement[$j]);
+ if (!isset($this->part["validationBar"]))
+ {
+ $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
+ }
+ $element = $this->xmldoc->create_element("validationElement");
+ $name = $this->xmldoc->create_element("type");
+ $name->append_child($this->xmldoc->create_text_node("validationComment"));
+ foreach ($parameters as $key => $value)
+ {
+ $parameterName = $this->xmldoc->create_element($key);
+ $parameterName->append_child($this->xmldoc->create_text_node($value));
+ $element->append_child($parameterName);
+ }
+ $element->append_child($name);
+ $this->part["validationBar"]->append_child($element);
}
-
- $this->linePart[]=$panelLinePart;
- $this->lineElement=array();//clear the tab lineElement
- }
-
-
-
-
-
- function createPanelSettings($name, $display, $id,$style, $contextDisplay,$additionalFunction="")
- {
- if (!isset($this->part["tabs"]))
+ /*
+ *
+ * Line
+ *
+ */
+ function createLine($style="", $id="")
{
- $this->part["tabs"]=$this->xmldoc->create_element("tabsInformations");
-
+ $line = $this->xmldoc->create_element("panelLine");
+ $lineStyle = $this->xmldoc->create_element("style");
+ $lineStyle->append_child($this->xmldoc->create_text_node($style));
+ $line->append_child($lineStyle);
+ //necessary for hidden div
+ $lineId = $this->xmldoc->create_element("id");
+ $lineId->append_child($this->xmldoc->create_text_node($id));
+ $line->append_child($lineId);
+
+ for ($i = 0; $i < count($this->linePart);$i++)
+ {
+ $line->append_child($this->linePart[$i]);
+ }
+ $this->panelLines[]=$line;
+ $this->linePart=array();
}
- if (!isset($this->part["tabsContent"]))
+
+ function createLinePart($parameters=NULL)
{
- $this->part["tabsContent"]=$this->xmldoc->create_element("tabsContent");
-
+ $panelLinePart = $this->xmldoc->create_element("panelLinePart");
+ if(isset($parameters["style"]))
+ {
+ $elementStyle = $this->xmldoc->create_element("style");
+ $elementStyle->append_child($this->xmldoc->create_text_node($parameters["style"]));
+ $panelLinePart->append_child($elementStyle);
+ }
+ if(isset($parameters["align"]))
+ {
+ $elementAlign = $this->xmldoc->create_element("align");
+ $elementAlign->append_child($this->xmldoc->create_text_node($parameters["align"]));
+ $panelLinePart->append_child($elementAlign);
+ }
+ if(isset($parameters["colspan"]))
+ {
+ $elementColpsan = $this->xmldoc->create_element("colspan");
+ $elementColpsan->append_child($this->xmldoc->create_text_node($parameters["colspan"]));
+ $panelLinePart->append_child($elementColpsan);
+ }
+ if(isset($parameters["id"]))
+ {
+ $elementId = $this->xmldoc->create_element("id");
+ $elementId->append_child($this->xmldoc->create_text_node($parameters["id"]));
+ $panelLinePart->append_child($elementId);
+ }
+ if(isset($parameters["context"]))
+ {
+ $elementContext = $this->xmldoc->create_element("context");
+ $elementContext->append_child($this->xmldoc->create_text_node($parameters["context"]));
+ $panelLinePart->append_child($elementContext);
+ }
+ for ($j = 0; $j < count($this->lineElement); $j++)
+ {
+ $panelLinePart->append_child($this->lineElement[$j]);
+ }
+ $this->linePart[]=$panelLinePart;
+ $this->lineElement=array();//clear the tab lineElement
}
- $panelSettings = $this->xmldoc->create_element("tabInformation");
- $divName = $this->xmldoc->create_element("name");
- $divName->append_child($this->xmldoc->create_text_node($name));
- $divDisplay = $this->xmldoc->create_element("display");
- $divDisplay->append_child($this->xmldoc->create_text_node($display));
- $divId = $this->xmldoc->create_element("id");
- $divId->append_child($this->xmldoc->create_text_node($id));
- $divStyle = $this->xmldoc->create_element("style");
- $divStyle->append_child($this->xmldoc->create_text_node($style));
- $divContextDisplay = $this->xmldoc->create_element("contextDisplay");
- $divContextDisplay->append_child($this->xmldoc->create_text_node($contextDisplay));
- if($additionalFunction!=""){
- $divContextAdditionalFunction = $this->xmldoc->create_element("additionalFunction");
- $divContextAdditionalFunction->append_child($this->xmldoc->create_text_node($additionalFunction));
- $panelSettings->append_child($divContextAdditionalFunction);
-
+ function createPanelSettings($name, $display, $id,$style, $contextDisplay,$additionalFunction="")
+ {
+ if (!isset($this->part["tabs"]))
+ {
+ $this->part["tabs"]=$this->xmldoc->create_element("tabsInformations");
+ }
+ if (!isset($this->part["tabsContent"]))
+ {
+ $this->part["tabsContent"]=$this->xmldoc->create_element("tabsContent");
+ }
+ $panelSettings = $this->xmldoc->create_element("tabInformation");
+ $divName = $this->xmldoc->create_element("name");
+ $divName->append_child($this->xmldoc->create_text_node($name));
+ $divDisplay = $this->xmldoc->create_element("display");
+ $divDisplay->append_child($this->xmldoc->create_text_node($display));
+ $divId = $this->xmldoc->create_element("id");
+ $divId->append_child($this->xmldoc->create_text_node($id));
+ $divStyle = $this->xmldoc->create_element("style");
+ $divStyle->append_child($this->xmldoc->create_text_node($style));
+ $divContextDisplay = $this->xmldoc->create_element("contextDisplay");
+ $divContextDisplay->append_child($this->xmldoc->create_text_node($contextDisplay));
+ if($additionalFunction!=""){
+ $divContextAdditionalFunction = $this->xmldoc->create_element("additionalFunction");
+ $divContextAdditionalFunction->append_child($this->xmldoc->create_text_node($additionalFunction));
+ $panelSettings->append_child($divContextAdditionalFunction);
+ }
+ $panelSettings->append_child($divName);
+ $panelSettings->append_child($divDisplay);
+ $panelSettings->append_child($divStyle);
+ $panelSettings->append_child($divId);
+ $panelSettings->append_child($divContextDisplay);
+ $panelContent = $this->xmldoc->create_element("tabContent");
+ $panelContent->append_child($divDisplay->clone_node(true));
+ $panelContent->append_child($divId->clone_node(true));
+
+ for ($i = 0; $i < count($this->panelLines);$i++)
+ {
+ $panelContent->append_child($this->panelLines[$i]);
+ }
+ $this->panelLines=array();
+ $this->part["tabs"]->append_child($panelSettings);
+ $this->part["tabsContent"]->append_child($panelContent);
}
- $panelSettings->append_child($divName);
- $panelSettings->append_child($divDisplay);
- $panelSettings->append_child($divStyle);
- $panelSettings->append_child($divId);
- $panelSettings->append_child($divContextDisplay);
-
- $panelContent = $this->xmldoc->create_element("tabContent");
- $panelContent->append_child($divDi...
[truncated message content] |
|
From: <tro...@us...> - 2008-01-25 22:54:55
|
Revision: 234
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=234&view=rev
Author: trollinger
Date: 2008-01-25 14:54:52 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
code review and cleaning
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
branches/team/Thomas/moodle/mod/voicetools/lib.php
branches/team/Thomas/moodle/mod/voicetools/manageAction.php
branches/team/Thomas/moodle/mod/voicetools/mod.html
branches/team/Thomas/moodle/mod/voicetools/welcome.php
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-22 23:54:29 UTC (rev 233)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-25 22:54:52 UTC (rev 234)
@@ -28,7 +28,6 @@
******************************************************************************/
/* $Id: getXmlChoicePage.php 52853 2007-08-24 17:55:26Z thomasr $ */
-error_reporting(E_ERROR);
global $CFG;
require_once("../../config.php");
require_once("lib.php");
@@ -45,6 +44,8 @@
$params[$param["value"]] = $value;
}
+ini_set('display_errors','off');
+ini_set('log_errors','on');
require_login($params["enc_course_id"]);
$xml=new WimbaXml();
$session=new WimbaMoodleSession($params);
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-22 23:54:29 UTC (rev 233)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-25 22:54:52 UTC (rev 234)
@@ -30,9 +30,8 @@
/* $Id: getXmlListPanel.php 52853 2007-08-24 17:55:26Z thomasr $ */
/// This page generates the xml of the principal window
-error_reporting(E_ERROR);
+
global $CFG;
-
require_once("../../config.php");
require_once("lib.php");
require_once("lib/php/common/WimbaXml.php");
@@ -59,8 +58,12 @@
require_login($params["enc_course_id"]);
$session=new WimbaMoodleSession($params);
$uiManager=new WimbaUI($session);
-if(isset($params["error"])){
- $display=$uiManager->setError(get_string ($params["error"], 'voicetools'));
+
+
+
+if(isset($params["error"]) )
+{
+ $uiManager->setError(get_string ($params["error"], 'voicetools'));
}
else
{
@@ -70,13 +73,12 @@
$message="";
if(!empty($messageProduct) && !empty($messageAction))
$message=get_string("message_".$messageProduct."_start", "voicetools")." ".get_string("message_".$messageAction."_end","voicetools");
- $display=$uiManager->getVTPrincipalView($message);
+ $uiManager->getVTPrincipalView($message);
}
else
- { //bad session
- $display="";//to make sure that nothing was displayed before
- $display=$uiManager->setError(get_string ('error_'.$session->error, 'voicetools'));
+ { //bad session
+ $uiManager->setError(get_string ('error_'.$session->error, 'voicetools'));
}
}
-echo $display;
+echo $uiManager->getXmlString();
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-22 23:54:29 UTC (rev 233)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-25 22:54:52 UTC (rev 234)
@@ -34,7 +34,6 @@
global $CFG;
require_once("../../config.php");
require_once("lib.php");
-
require_once("lib/php/vt/WimbaVoicetoolsAPI.php");
require_once("lib/php/vt/WimbaVoicetools.php");
require_once("lib/php/common/WimbaCommons.php");
@@ -44,64 +43,67 @@
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
-set_time_limit(30);
$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
-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;
}
require_login($params["enc_course_id"]);
-
$session=new WimbaMoodleSession($params);
$uiManager=new WimbaUI($session);
+
if($session->error==false)
{
-
-
/*******************
GET URL INFORMATIONS
********************/
$action = optional_param('action', ""); // Course Module ID, or
$typeProduct = $params['type'];
-
add_to_log($session->getCourseId(), "voicetools", "xml", "product" , $typeProduct);
- if($action == 'update') { //get the information of the resource
-
+ if($action == 'update')
+ { //get the information of the resource
$currentBoard = voicetools_api_get_resource($params["resource_id"]);
- if($currentBoard==null || $currentBoard->error==true){
- $xml->setError(get_string('problem_vt','voicetools'));
- echo $xml->getXml();
- exit();
+ if($currentBoard==null || $currentBoard->error==true)
+ {
+ $uiManager->setError(get_string('problem_vt','voicetools'));
}
+
$currentBoardInformations=voicetools_get_voiceboard_Informations($params["resource_id"]);
- if($currentBoard->error==true){
- $xml->setError(get_string('problem_bd','voicetools'));
- echo $xml->getXml();
- exit();
+
+ if($currentBoard->error==true)
+ {
+ $uiManager->setError(get_string('problem_bd','voicetools'));
}
+
$uiManager->setCurrentProduct($typeProduct,$currentBoard,$currentBoardInformations);
- }else{
-
+ }
+ else
+ {
+ $uiManager->setCurrentProduct($typeProduct);
+ }
- $uiManager->setCurrentProduct($typeProduct);
- }
$display= $uiManager->getVTSettingsView($action,$createWorkflow);
-
-}else{
+}
+else
+{
if($session->error=="session")
- $xml->setError(get_string ('session', 'voicetools'));
- else if($session->error=="signature")
- $xml->setError(get_string ('signature', 'voicetools'));
-
+ {
+ $uiManager->setError(get_string ('session', 'voicetools'));
+ }
+ else if($session->error=="signature")
+ {
+ $uiManager->setError(get_string ('signature', 'voicetools'));
+ }
}
-echo $display;
+echo $uiManager->getXmlString();
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/lib.php 2008-01-22 23:54:29 UTC (rev 233)
+++ branches/team/Thomas/moodle/mod/voicetools/lib.php 2008-01-25 22:54:52 UTC (rev 234)
@@ -28,7 +28,6 @@
/* $Id: lib.php 56815 2007-12-04 15:08:45Z thomasr $ */
/// Library of functions and constants for module voicetools
-error_reporting(0);
require_once($CFG->libdir.'/datalib.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
@@ -42,38 +41,50 @@
* @param $config - the information from the form mod.html
*/
function voicetools_process_options ($config) {
- global $CFG;
+ global $CFG;
- if(empty($config->servername)){
- error(get_string('wrongconfigurationURLunavailable', 'voicetools'), $_SERVER["HTTP_REFERER"]);
+ /*******
+ 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:// or https://
+ -The api account has to valid
+ ********/
+
+ if(empty($config->servername))
+ {
+ error(get_string('wrongconfigurationURLunavailable', 'voicetools'), $_SERVER["HTTP_REFERER"]);
}
- else if(empty($config->adminusername)){
- error(get_string('emptyAdminUsername', 'voicetools'), $_SERVER["HTTP_REFERER"]);
+
+ if(empty($config->adminusername))
+ {
+ error(get_string('emptyAdminUsername', 'voicetools'), $_SERVER["HTTP_REFERER"]);
}
- else if(empty($config->adminpassword)){
- error(get_string('emptyAdminPassword', 'voicetools'), $_SERVER["HTTP_REFERER"]);
+
+ if(empty($config->adminpassword))
+ {
+ error(get_string('emptyAdminPassword', 'voicetools'), $_SERVER["HTTP_REFERER"]);
}
- $length = strlen($config->servername);
- if ($config->servername{$length-1} == '/') {
- error(get_String('trailingSlash', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
- if (!preg_match('/^http:\/\//', $config->servername)) {
- error(get_String('trailingHttp', 'voicetools'), $_SERVER["HTTP_REFERER"]);
- }
- $result = voicetools_api_check_documentbase ($config->servername, $config->adminusername,$config->adminpassword,$CFG->wwwroot);
+
+ if ($config->servername{strlen($config->servername)-1} == '/')
+ {
+ error(get_String('trailingSlash', 'voicetools'), $_SERVER["HTTP_REFERER"]);
+ }
+
+ if (!preg_match('/^http:\/\//', $config->servername) && !preg_match('/^https:\/\//', $config->servername))
+ {
+ error(get_String('trailingHttp', 'voicetools'), $_SERVER["HTTP_REFERER"]);
+ }
+
+ //check if the api account filled is correct and allowed
+ $result = voicetools_api_check_documentbase ($config->servername, $config->adminusername,$config->adminpassword,$CFG->wwwroot);
- if ($result != 'is_allowed.true') {
- if(get_string($result, 'voicetools' )=="[[]]")
- error(get_string($result, 'voicetools' ), 'javascript:history.back();');
+ if ($result != "ok") {
+ if(get_string($result, 'voicetools' ) == "[[]]")//the error description is not in the bundle
+ error($result, 'javascript:history.back();');
else
- error($result, 'javascript:history.back();');
-
+ error(get_string($result, 'voicetools' ), 'javascript:history.back();');
}
- //get the error string and display it
-
-
-
- return;
}
function voicetools_add_instance($voicetool) {
@@ -82,78 +93,142 @@
/// will create a new instance and return the id number
/// of the new instance.
global $USER;
-
+ //get the resource information(type and id)
+ list($rid, $type) = explode(";", $voicetool->resource);
+
$voicetool->timemodified = time();
-list($rid, $type) = explode(";", $voicetool->resource);
-
$voicetool->rid=$rid;
- $name=get_string("$type","voicetools").$voicetool->name;
+ $voicetool->name=get_string("$type","voicetools").$voicetool->name;
+
+ if (!$voicetool->id = insert_record('voicetools', $voicetool)) {
+ return false;
+ }
- $voicetool->name=$name;
- if(!isset($voicetool->section))
- $voicetool->section=0;
- $instanceNumber=insert_record("voicetools", $voicetool);
- if($instanceNumber!=false ){
- add_to_log($voicetool->course, "voicetools", "Add activity", voicetools_send_logs("addInstance","voicetoolsId=".$instanceNumber), "Activity \"".$voicetool->name."\" added");
- }else{
- add_to_log($voicetool->course, "voicetools", "Add activity",voicetools_send_logs("errorAddInstance","voicetoolsId=".$instanceNumber), "Activity \"".$voicetool->name."\" added");
-
-
+ if(isset($voicetool->calendar_event) && $voicetool->calendar_event==true) {
+ voicetools_addCalendarEvent($voicetool);
}
- if($instanceNumber!=false && isset($voicetool->calendar_event) && $voicetool->calendar_event==true) {//no problem
- voicetools_addCalendarEvent($voicetool,$instanceNumber);
-
- }
- return $instanceNumber;
+ return $voicetool->id;
}
+function voicetools_update_instance($voicetool) {
+ /// 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.
+ global $USER;
+
+ //get the course_module instance linked to the liveclassroom instance
+ if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $voicetool->course)) {
+ error("Course Module ID was incorrect");
+ }
+
+ if($voicetool->section != $cm->section)//the scetion has changed
+ {
+ //Find the right section in the course_section
+ if (!$section = get_record("course_sections", "id", $cm->section)){
+ return false;
+ }
+ //delete in the course section
+ if (! delete_mod_from_section($cm->id, $cm->section)) {
+ return false;
+ }
+
+ //update the course module section
+ if (! $sectionid = add_mod_to_section($voicetool) ) {
+ 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");
+ }
+ }
+
+ list($rid, $type) = explode(";", $voicetool->resource);
+ $voicetool->timemodified = time();
+ $voicetool->id = $voicetool->instance;
+ $voicetool->rid=$rid;
+ $voicetool->name=get_string("$type","voicetools").$voicetool->name;
+
+ if (!$voicetool->id = update_record('voicetools', $voicetool)) {
+ return false;
+ }
+ if(isset($voicetool->calendar_event) && $voicetool->calendar_event==true) {//no problem
+ voicetools_addCalendarEvent($voicetool,$voicetool->id );
+ }
+ else
+ {
+ voicetools_deleteCalendarEvent($voicetool->id );
+ }
+
+ return $voicetool->id ;
+}
-function voicetools_addCalendarEvent($informations,$instanceNumber){
- /// Basic event record for the database.
+function voicetools_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.
+ $result = true;
+ if (! $voicetool = get_record("voicetools", "id", "$id")) {
+ return false;
+ }
+ # Delete any dependent records here #
+ if (! $instanceNumber=delete_records("voicetools", "id", "$voicetool->id")) {
+ add_to_log($voicetool->course, "voicetools", "Delete activity",voicetools_send_logs("errorDeleteInstance","voicetoolsId=".$instanceNumber), "Activity ".$voicetool->name." deletion failed");
+ $result = false;
+ }
+
+ voicetools_deleteCalendarEvent("$voicetool->id");
+ // delete the related calendar event
+
+ return $result;
+}
+
+
+function voicetools_addCalendarEvent($activity_informations){
global $CFG;
+
+ //get some complementary of the resource
+ $resource=get_record('voicetools_resources','rid',$activity_informations->rid);
- $oldEvent=get_record('event','instance',$instanceNumber);
-
- $resource=get_record('voicetools_resources','rid',$informations->rid);
$event = new Object();
- $event->name = $informations->name;
- $event->description = $informations->description."<br><a href=".$CFG->wwwroot."/mod/voicetools/view.php?id=".$instanceNumber."&action=launchCalendar target=_self >".get_string("launch_calendar","voicetools").$resource->type." ...</a>";
-
+ $event->name = $activity_informations->name;
+ $event->description = $activity_informations->description."<br><a href=".$CFG->wwwroot."/mod/voicetools/view.php?id=".$activity_informations->id."&action=launchCalendar target=_self >".get_string("launch_calendar","voicetools").$resource->type." ...</a>";
$event->format = 1;
- $event->userid = 0;
- $event->courseid = $informations->course; //course event
+ $event->userid = 0;
+ $event->courseid = $activity_informations->course; //course event
$event->groupid = 0;
$event->modulename = 'voicetools';
- $event->instance = $instanceNumber;
+ $event->instance = $activity_informations->id;
$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);
- if( $event->timestart < time())
- {
- error(get_string("date_error","voicetools"),$_SERVER["HTTP_REFERER"]);
- }
- }
- 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));
-
- }
-
+ $event->timemodified = time();
- $duration = $informations->duration_hr*3600 + $informations->duration_min*60;
- if ($duration < 0){
+ 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","voicetools"),$_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 {
+ else
+ {
$event->timeduration = $duration;
}
- $event->timemodified = time();
-
- if(!empty($oldEvent) && $oldEvent!=false) //old event exsit
+ if(!$oldEvent=get_record('event','instance',$activity_informations->id)) //old event exsit
{
$event->id = $oldEvent->id ;
$result=update_record('event', $event);
@@ -165,118 +240,34 @@
return $result;
}
+
function voicetools_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);
+ if(!$event=get_record('event','instance',$instanceNumber)){
+ return false;
}
- else
- {
- return false;
- }
- return $result;
-
-}
-
-function voicetools_update_instance($voicetool) {
- /// 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.
-
- global $USER;
- $voicetool->timemodified = time();
- $voicetool->id = $voicetool->instance;
- if(!isset($voicetool->section))
- $voicetool->section=0;
- // Need to update the section
-
- //get the course_module instance linked to the liveclassroom instance
- if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $voicetool->course)) {
- error("Course Module ID was incorrect");
- }
+ $result=delete_records("event", "id", $event->id);
+}
- $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($voicetool) ) {
- 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");
- }
-
-
- list($rid, $type) = explode(";", $voicetool->resource);
- $name=get_string("$type","voicetools").$voicetool->name;
- $voicetool->rid=$rid;
- $voicetool->name=$name;
- $instanceNumber=update_record("voicetools", $voicetool);
- if($instanceNumber!=false && isset($voicetool->calendar_event) && $voicetool->calendar_event==true) {//no problem
- voicetools_addCalendarEvent($voicetool,$voicetool->instance);
- } else{
- voicetools_deleteCalendarEvent($voicetool->instance);
-
- }
- add_to_log($voicetool->course, "voicetools", "Update activity",voicetools_send_logs("updateInstance","voicetoolsId=".$instanceNumber), "Activity ".$voicetool->name." has been updated with success");
-
- return $instanceNumber;
-}
-
-
-function voicetools_delete_instance($id) {
+function voicetools_delete_resource($rid) {
/// Given an ID of an instance of this module,
/// this function will permanently delete the instance
/// and any data that depends on it.
- $result = true;
- if (! $voicetool = get_record("voicetools", "id", "$id")) {
-
+ if (! $voicetool = get_record("voicetools_resources", "rid", $rid)) {
return false;
}
-
# Delete any dependent records here #
- if (! $instanceNumber=delete_records("voicetools", "id", "$voicetool->id")) {
- add_to_log($voicetool->course, "voicetools", "Delete activity",voicetools_send_logs("errorDeleteInstance","voicetoolsId=".$instanceNumber), "Activity ".$voicetool->name." deletion failed");
-
- $result = false;
+ if (! delete_records("voicetools_resources", "id", "$voicetool->id")) {
+ return false;
}
- voicetools_deleteCalendarEvent("$voicetool->id");
- // delete the related calendar event
- return $result;
+ return true;
}
-
-function voicetools_delete_resource($id) {
- /// Given an ID of an instance of this module,
- /// this function will permanently delete the instance
- /// and any data that depends on it.
- $result = true;
- if (! $voicetool = get_record("voicetools_resources", "rid", "$id")) {
- return false;
- }
-
- # Delete any dependent records here #
- if (! delete_records("voicetools_resources", "id", "$voicetool->id")) {
- $result = false;
- }
-
-
- return $result;
-}
-
function voicetools_user_outline($course, $user, $mod, $voicetool) {
/// Return a small object with summary information about what a
/// user has done with a given particular instance of this module
@@ -388,42 +379,39 @@
/// Given an ID of an instance of this module,
/// this function will permanently delete the instance
/// and any data that depends on it.
+
+ //delete the resource of the vt list
voicetools_delete_resource($id);
$result = true;
+
if ($voicetools = get_records("voicetools", "rid", $id)) {
-
+
# Delete any dependent records here #
- foreach($voicetools as $voicetool){
-
- //get the course_module instance linked to the liveclassroom instance
- if (! $cm = get_coursemodule_from_instance("voicetools", $voicetool->rid, $voicetool->course)) {
- error("Course Module ID was incorrect");
- }
- if (! delete_course_module($cm->id)) {
- add_to_log($voicetool->course, "voicetools", voicetools_send_logs("errorDeleteAllcm","rid=".$voicetool->id."&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("voicetools_resources", "rid", $voicetool->rid)) {
- add_to_log($liveclassrooms->course, "voicetools", voicetools_send_logs("errorDeleteAlldb","rid=".$voicetool->id), "Delete all activities", "All activities associated to the vocie tools have not been deleted from the voice tools database");
- $result = false;
- }
- if (! delete_records("voicetools", "rid", $voicetool->rid)) {
- add_to_log($liveclassrooms->course, "voicetools", voicetools_send_logs("errorDeleteAlldb","rid=".$voicetool->id), "Delete all activities", "All activities associated to the vocie tools have not been deleted from the voice tools database");
- $result = false;
- }
- //delete in the course section too
- if (! delete_mod_from_section($cm->id, "$cm->section")) {
- add_to_log($voicetool->course, "voicetools", voicetools_send_logs("errorDeleteAllsection","rid=".$voicetool->id."&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");
- }
+ foreach($voicetools as $voicetool){
+ //get the course_module instance linked to the liveclassroom instance
+ if(! $cm = get_coursemodule_from_instance("voicetools", $voicetool->id, $voicetool->course)) {
+ error("Course Module ID was incorrect");
+ }
+
+ if (! delete_course_module($cm->id)) {
+ add_to_log($voicetool->course, "voicetools", voicetools_send_logs("errorDeleteAllcm","rid=".$voicetool->id."&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)");
+ }
+ //delete the instance
+ if (! delete_records("voicetools", "id", $voicetool->id)) {
+ add_to_log($liveclassrooms->course, "voicetools", voicetools_send_logs("errorDeleteAlldb","id=".$voicetool->id), "Delete all activities", "All activities associated to the vocie tools have not been deleted from the voice tools database");
+ $result = false;
+ }
+ //delete in the course section too
+ if (! delete_mod_from_section($cm->id, "$cm->section")) {
+ add_to_log($voicetool->course, "voicetools", voicetools_send_logs("errorDeleteAllsection","rid=".$voicetool->id."&cm=".$cm->id."§ion=".$cm->section), "Delete all activities", "Could not delete the ".$cm->id." from that section");
+ $result = false;
+ }
+ }
+ }
- }
- }
-
-
return $result;
}
Modified: branches/team/Thomas/moodle/mod/voicetools/manageAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-22 23:54:29 UTC (rev 233)
+++ branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-25 22:54:52 UTC (rev 234)
@@ -31,7 +31,7 @@
/* $Id: manageRoomAction.php 179 2007-01-11 15:25:54Z hugues $ */
/* This page manage the action create, update, delete for a room */
-error_reporting(E_ERROR);
+global $CFG;
require_once ('../../config.php');
require_once ('lib.php');
require_once ("lib/php/common/WimbaLib.php");
@@ -39,11 +39,15 @@
require_once ('lib/php/vt/WimbaVoicetools.php');
require_once ('lib/php/vt/WimbaVoicetoolsAPI.php');
require_once ('lib/php/vt/VtAction.php');
-global $CFG;
+
+
+
$messageProduct=optional_param("messageProduct","");
$messageAction=optional_param("messageAction","");
$notool=optional_param("novoicetools","false");
+$createWorkflow = optional_param('createWorkflow', $dddddd, PARAM_BOOL); // course
+
$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaVoiceForm());
foreach($keys as $param){
$value=optional_param($param["value"],$param["default_value"],$param["type"]);
@@ -54,13 +58,14 @@
require_login($params["enc_course_id"]);
$vtAction = new vtAction($params);
-
$session = new WimbaMoodleSession($params);
-$messageType = "";
-if ($session->error == false && $session != NULL) {
+$redirectionUrl='welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad;
+$urlModuleForm=$CFG->wwwroot.'/course/mod.php?section=0&sesskey='.sesskey().'&id='.$session->getCourseId().'&add=voicetools&rid='.$rid;
+$messageType = "";
+if ($session->error == false && $session != NULL || $CFG->error==true) {
if ($params['action'] == 'launch') {
$session->setCurrentVtUSer($params["type"]);
if ($params["studentView"] == "true") {
@@ -69,105 +74,95 @@
$resource = voicetools_api_get_resource($params["resource_id"]);
$result = $vtAction->getVtSession($resource, $session->getVtUser(), $session->getVtUserRigths());
if ($result != NULL) {
- header('Location:' . $CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid());
+ redirection($CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid());
}
else {
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_vt');
+ redirection($redirectionUrl.'&error=problem_vt');
}
- exit ();
-
}
- elseif ($params['action'] == 'create') {
- if ($params['type'] == "board") {
-
+ elseif ($params['action'] == 'create')
+ {
+ if ($params['type'] == "board")
+ {
$result = $vtAction->createBoard(); //create the resource on the vt
$messageAction = "created";
$messageProduct = "board";
}
- elseif ($params['type'] == "presentation") {
-
+ elseif ($params['type'] == "presentation")
+ {
$result = $vtAction->createPresentation();
$messageAction = "created";
$messageProduct = "presentation";
}
- elseif ($params['type'] == "pc") {
-
+ elseif ($params['type'] == "pc")
+ {
$result = $vtAction->createPodcaster();
$messageAction = "created";
$messageProduct = "pc";
}
- if ($result != NULL && $result->error != "error") {
+ if ($result != NULL && $result->error != "error")
+ {
$params["resource_id"] = storeResource($result->getRid(), $session->getCourseId(), $params['type'],$params["longname"], $params);
if (empty ($params["resource_id"])) {
-
error_log(__FUNCTION__ . " : Problem to add the new resource on the database", TRUE);
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_bd');
- exit ();
+ redirection($redirectionUrl. '&error=problem_bd');
}
- // if(VTAPI_DEBUG) {
- error_log(__FUNCTION__ . " : Board Created and added on the database, rid=" . $result->getRid(), TRUE);
- //}
-
-
+ if(VTAPI_DEBUG) {
+ error_log(__FUNCTION__ . " : Board Created and added on the database, rid=" . $result->getRid(), TRUE);
+ }
}
- else {
+ else
+ {
error_log(__FUNCTION__ . " : Problem to add the new resource on the vt server", TRUE);
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_vt');
-
- exit ();
+ redirection($redirectionUrl . '&error=problem_vt');
}
}
- elseif ($params['action'] == 'update') {
- if ($params['type'] == "board") {
-
+ elseif ($params['action'] == 'update')
+ {
+ if ($params['type'] == "board")
+ {
$result = $vtAction->modifyBoard($params["resource_id"]); //create the resource on the vt
$messageAction = "updated";
$messageProduct = "board";
}
- elseif ($params['type'] == "presentation") {
-
+ elseif ($params['type'] == "presentation")
+ {
$result = $vtAction->modifyPresentation($params["resource_id"]);
$messageAction = "updated";
$messageProduct = "presentation";
}
- elseif ($params['type'] == "pc") {
-
+ elseif ($params['type'] == "pc")
+ {
$result = $vtAction->modifyPodcaster($params["resource_id"]);
$messageAction = "updated";
$messageProduct = "pc";
}
- if ($result != NULL) {
-
-
+ if ($result != NULL)
+ {
//create the object to store in the db
$params["resource_id"] = updateResource($result->getRid(), $session->getCourseId(), $param['type'], $param, $params["resource_id"]);
- if (empty ($params["resource_id"])) {
-
+ if (empty ($params["resource_id"]))
+ {
error_log(__FUNCTION__ . " : Problem to update the resource on the database", TRUE);
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_bd');
- exit ();
+ redirection($redirectionUrl . '&error=problem_bd');
}
- $messageType = $_GET['type'] . 'Updated';
+ $messageType = $params['type'] . 'Updated';
}
else {
error_log(__FUNCTION__ . " : Problem to update the resource on the vt server", TRUE);
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_vt');
- exit ();
+ redirection($redirectionUrl . '&error=problem_vt');
}
}
-
- elseif ($params['action'] == 'delete') {
-
+ elseif ($params['action'] == 'delete')
+ {
$result = $vtAction->deleteRessource($params["resource_id"]);
-
if ($result != NULL && $result->error != "error") { //if no error during the creation
-
if (! voicetools_delete_all_instance_of_resource($params["resource_id"])) {
notify("Could not delete the activities for the vocietools:". $params["resource_id"]);
}
@@ -176,26 +171,23 @@
$messageProduct = $_GET["type"];
}
- }
+ }
- if (isset ($param["createWorkflow"]) && $param["createWorkflow"] == "true") {
-
+ if (isset($createWorkflow) && $createWorkflow == true)
+ {
if(!isset($result) )
$rid="";
else
$rid=$result->getRid();
- ?>
- <script>
- parent.location.href="<?php echo $CFG->wwwroot.'/course/mod.php?section=0&sesskey='.sesskey().'&id='.$session->getCourseId().'&add=voicetools&rid='.$rid; ?>"
- </script>
- <?
-
-
+ parentRedirection($urlModuleForm);
}
else
- header('Location: welcome.php?id='.$session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&messageAction=' . $messageAction. '&messageProduct=' .$messageProduct);
+ {
+ redirection($redirectionUrl . '&messageAction=' . $messageAction. '&messageProduct=' .$messageProduct);
+ }
}
-else {
- header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=session');
+else //bad session
+{
+ redirection($redirectionUrl . '&error=session');
}
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-22 23:54:29 UTC (rev 233)
+++ branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-25 22:54:52 UTC (rev 234)
@@ -29,7 +29,7 @@
******************************************************************************/
/* $Id: mod.html 200 2008-01-09 11:37:50Z trollinger $ */
-error_reporting(E_ERROR);
+
require_once("../config.php");
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
require_once('lib/php/vt/WimbaVoicetools.php');
@@ -43,10 +43,10 @@
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);
+$course_id = optional_param('id', 0, PARAM_INT);
+$resource_id = optional_param('rid',null, PARAM_RAW);
$update = optional_param('update', null, PARAM_INT);
$sectionId = optional_param('section', null, PARAM_INT);
@@ -66,7 +66,7 @@
if (!isset($form->section)) {
$form->section = '';
}
-
+$error="";
$event=false;
$description="";
$stringDate="";
@@ -77,14 +77,14 @@
if (! $cmVT = get_record("course_modules", "id", $update)) {
return false;
}
- $activity = get_record("voicetools", "id", $cmVT->instance );
- $sectionId=$activity->section;
- $action = "update";
+ $activity = get_record("voicetools", "id", $cmVT->instance );
+ $sectionId=$activity->section;
+
+ $resource_id = $activity->rid;
- $id=$cmVT->course;//get the id of the course
- $event=liveclassroom_get_event_calendar($activity->id);
+ $event=voicetools_get_event_calendar($activity->id);
if($event==true)//no event
{
@@ -98,12 +98,12 @@
else
{//new
$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" || $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)) ;
@@ -114,8 +114,9 @@
$disabledCheckbox="";
$disableAllElements="";
}
-
+
+
// Visible to students or not
if ($form->coursemodule) {
$visible = get_field('course_modules', 'visible', 'id', $form->coursemodule);
@@ -133,6 +134,15 @@
if ($hiddensection) {
$visible = false;
}
+
+//get the list of resource available
+$resourcesRid= voicetools_get_voicetools_list($course->id);
+$vtResources=voicetools_api_get_resources($resourcesRid["rid"]);
+if($vtResources==null)
+{
+ $error=true;
+}
+
?>
<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/liveclassroom/css/StyleSheet.css"" type="text/css" />
@@ -145,26 +155,9 @@
margin:-5px;
}
-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;
-
-
-}
</style>
-<script type="text/javascript">
-
+
+<script type="text/javascript">
//cookie management
function createCookie(name,value,days) {
if (days) {
@@ -234,13 +227,13 @@
function popupCancel(){
document.getElementById("popup").style.display="none";
document.getElementById("hiddenDiv").style.display="none";
- location.href = "<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($id)?>";
+ location.href = "<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php p($course_id)?>";
}
function popupOk(){
document.getElementById("popup").style.display="none";
document.getElementById("hiddenDiv").style.display="none";
- location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>&createWorkflow=true";
+ location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $course_id;?>&createWorkflow=true";
}
function LaunchCreateWorkflow(){
@@ -294,12 +287,12 @@
if(document.getElementById("description")!=null)
createCookie("description_disabled",document.getElementById("description").disabled);
- location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>&createWorkflow=true";
+ location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $course_id;?>&createWorkflow=true";
}
function hideCalendarEvent(value){
if(value=="check"){
- if( document.getElementById("calendar_event").checked==true)
+ if(document.getElementById("calendar_event").checked==true)
value="";
else
value="disabled";
@@ -409,7 +402,6 @@
deleteCookie("description");
deleteCookie("description_disabled");
}
- change();
}
function loadPage(){
@@ -423,451 +415,401 @@
<title>Wimba</title>
</head>
- <body>
- <div class="content" id=content width=700px align=center>
- <form name="form" id="form" method="post" action="mod.php">
- <input type="hidden" value="" name="type">
+<body>
+ <div class="content" id=content width=700px align=center>
+ <form name="form" id="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>
+ <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/voicetools/lib/web/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="headerBarLeft" align="left">
- <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/headerbar-logo.png">
- </td>
-
- <td align="right" class="headerBarRight">
+ <td class="contextBarLeft" align="left">
+ <label class= "nameElement"><?php print_string('addactivity', 'voicetools') ?></label>
+ <label class="nameTools">: Voice Tools in <?php echo $course->fullname; ?></label>
</td>
+ <td class="contextBarRight" align="right">Voice Tools</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', 'voicetools') ?></label>
- <label class="nameTools">: Voice Tools in<?php echo $course->fullname; ?></label>
- </td>
-
- <td class="contextBarRight" align="right">Voice Tools</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', 'voicetools') ?></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', 'voicetools')?></font>
- </td>
- </tr>
-
- <tr valign="top">
- <?php
- if($course->format == "weeks" || $course->format == "weekscss"){
- ?>
- <td align="right">
- <font class="fontCurrent"><?php print_string('weeksformat', 'voicetools')?></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" ){
+ </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', 'voicetools') ?></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', 'voicetools')?></font>
+ </td>
+ </tr>
+ <?php if($course->format == "weeks" || $course->format == "weekscss"){ ?>
+ <tr valign="top">
+ <td align="right">
+ <font class="fontCurrent"><?php print_string('weeksformat', 'voicetools')?></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', 'voicetools') ?></font>
+ </td>
+ <td colspan="2" align="left">
+ <select name="section" id="section">
+ <?php echo getListOfTopics($course,$sectionId); ?>
+ </select>
+ </td>
+ </tr>
+ <?php } ?>
+ <tr valign="top">
+ <td align="right">
+ <font color="red">*</font><?php print_string('voicetoolstype', 'voicetools')?>
+ </td>
- ?>
- <tr valign="top">
- <td align="right">
- <font class="fontCurrent"><?php print_string('topicformat', 'voicetools') ?></font>
- </td>
- <td colspan="2" align="left">
- <select name="section" id="section">
- <?php
- echo getListOfTopics($course,$sectionId);
- ?>
- </select>
- </td>
- </tr>
- <?php } ?>
- </tr>
- <tr valign="top">
- <td align="right"><font color="red">*</font><font class="fontCurrent"><?php print_string('voicetoolstype', 'voicetools')?></font></td>
+ <td align="left"><select id="resource" name="resource">
+ <option value="empty">
+ Select...
+ </option>
+ <optgroup label="<?php echo get_string ('voiceboard', 'voicetools') ?>">
+ <?php
+ for($i=0;$vtResources!=null && $i<count($vtResources->getResources()) ;$i++) {
+ $resource = $vtResources->getResource($i);
+ if($resource->getType()=="board"){
+ if (isset($resource_id) && $resource_id == $resource->getRid())
+ {
+ echo "<option value=".$resource->getRid().";".$resource->getType()." selected >".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
+ }
+ else
+ {
+ echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
+ }
+ }
- <td align="left"><select id="resource" name="resource">
- <option value="empty">
- Select...
- </option>
+ }
+ ?>
+ </optgroup>
+ <optgroup label="<?php echo get_string ('voicepresentation', 'voicetools') ?>">
+ <?php
+ for($i=0;$vtResources!=null && $i<count($vtResources->getResources());$i++) {
+ $resource = $vtResources->getResource($i);
+ if($resource->getType()=="presentation"){
- <optgroup label="<?php echo get_string ('voiceboard', 'voicetools') ?>">
- <?php
-
- $resourcesRid= voicetools_get_voicetools_list($course->id);
- $vtResources=voicetools_api_get_resources($resourcesRid["rid"]);
- if($vtResources==null)
- {
- $error=true;
- }
- for($i=0;$vtResources!=null && $i<count($vtResources->getResources()) ;$i++) {
- $resource = $vtResources->getResource($i);
- if($resource->getType()=="board"){
+ if (isset($resource_id) && $resource_id == $resource->getRid())
+ {
+ echo "<option value=".$resource->getRid().";".$resource->getType()." selected >".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
+ }
+ else
+ {
+ echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
+ }
+ }
- if (isset($_GET["rid"]) || (isset($action) && $action=="update"))
- {
- if((isset($_GET["rid"]) && $_GET["rid"] == $resource->getRid()) || (isset($activity) && $activity->rid == $resource->getRid()) ) {
- echo "<option value=".$resource->getRid().";".$resource->getType()." selected >".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- else{
- echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- }
- else
- {
- echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- }
+ }
+ ?>
+ </optgroup>
- }
-
- ?>
- </optgroup>
+ <optgroup label="<?php echo get_string ('podcaster', 'voicetools') ?>">
+ <?php
+ for($i=0;$vtResources!=null && $i<count($vtResources->getResources());$i++) {
+ $resource = $vtResources->getResource($i);
+ if($resource->getType()=="pc"){
- <optgroup label="<?php echo get_string ('voicepresentation', 'voicetools') ?>">
- <?php
- for($i=0;$vtResources!=null && $i<count($vtResources->getResources());$i++) {
- $resource = $vtResources->getResource($i);
- if($resource->getType()=="presentation"){
+ if (isset($resource_id) && $resource_id == $resource->getRid())
+ {
+ echo "<option value=".$resource->getRid().";".$resource->getType()." selected >".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
+ }
+ else
+ {
+ echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
+ }
+ }
- if (isset($_GET["rid"]) || (isset($action) && $action=="update"))
- {
- if((isset($_GET["rid"]) && $_GET["rid"] == $resource->getRid()) || (isset($activity) && $activity->rid == $resource->getRid()) ) {
- echo "<option value=".$resource->getRid().";".$resource->getType()." selected >".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- else{
- echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- }
- else
- {
- echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- }
+ }
+ ?>
+ </optgroup>
+ </select>
+ </td>
- }
- ?>
- </optgroup>
-
- <optgroup label="<?php echo get_string ('podcaster', 'voicetools') ?>">
- <?php
- for($i=0;$vtResources!=null && $i<count($vtResources->getResources());$i++) {
- $resource = $vtResources->getResource($i);
- if($resource->getType()=="pc"){
-
- if (isset($_GET["rid"]) || (isset($action) && $action=="update"))
- {
- if((isset($_GET["rid"]) && $_GET["rid"] == $resource->getRid()) || (isset($activity) && $activity->rid == $resource->getRid()) ) {
- echo "<option value=".$resource->getRid().";".$resource->getType()." selected >".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- else{
- echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- }
- else
- {
- echo "<option value=".$resource->getRid().";".$resource->getType().">".((strlen($resource->getTitle())>25)?substr($resource->getTitle(),0,25)."...":$resource->getTitle())."</option>" ;
- }
- }
-
- }
- ?>
- </optgroup>
- </select>
- </td>
-
- <td width="50px"><?php print_string('or', 'voicetools')?></td>
- <td>
- <input type="button" value="<?php print_string('new', 'voicetools')?>" onclick="javascript:LaunchCreateWorkflow()">
- </td>
- </tr>
- <tr valign="top" >
- <td align="right">
- <font class="fontCurrent"><?php echo get_string('visibletostudents','voicetools'); ?></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=right>
- <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', 'voicetools') ?></font>
- </td>
- </tr>
-
- <tr>
- <td align=right style="width:200px">
- <?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),"voicetools")."</option>";
- else
- echo "<option value=".($i*86400).">".get_string("day".date('w',(($i*86400)+$course->startdate)),"voicetools")."</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,"voicetools")."</option>";
- else
- echo "<option value=".$i.">".get_string("month".$i,"voicetools")."</option>";
- }
- ?>
- </sel...
[truncated message content] |
|
From: Thomas R. <tro...@wi...> - 2008-01-23 00:01:13
|
Hi Ashley, The path of the libraries and the pictures has been updated since the last release. On my branche, I did the changes for the live classroom module but not for the voice tools. I did the necessary changes on rev 232 and 233 for the voice tools Let me know if you have problems. -Thomas On 21 janv. 08, at 00:53, Ashley Holman wrote: > Hi Thomas, > > I installed the module from your branch but noticed that the image > links were broken. I copied the integrations_common directory into > lib/ for both the voicetools and liveclassroom modules. An example > of a broken link is "/mod/voicetools/pictures/buttons/new- > createvoicepresentation.png". The image is actually located at "/ > mod/voicetools/lib/web/pictures/buttons/new- > createvoicepresentation.png" after copying the integrations_common > directory to lib. > > Cheers > Ashley. > > Thomas Rollinger wrote: >> Hi all, >> >> I did some changes on the structure of the Svn repository. >> I separated the generic part(used in all our modules) in a new >> directory named integrations_common. >> >> The content of integrations_common has to be placed in a directory >> named "lib" in the modules(liveclassroom and voice tools). >> >> I started to update the path of the files into the branche "team/ >> Thomas" but trunk is not up to date. >> >> Best >> >> Thomas Rollinger >> Software Engineer >> >> Wimba - People teach People >> tro...@wi... >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Hw4mdl-devel mailing list >> Hw4...@li... >> https://lists.sourceforge.net/lists/listinfo/hw4mdl-devel >> > > > -- > Ashley Holman > Software Engineer > NetSpot Pty Ltd > 183 Melbourne Street, North Adelaide, 5006 > Ph: +618 8361 6800 Fax: +618 8361 6811 > |
|
From: <tro...@us...> - 2008-01-22 23:54:30
|
Revision: 233
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=233&view=rev
Author: trollinger
Date: 2008-01-22 15:54:29 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
Update some stuff related to the changes done in the common library for vt
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/lc/LCAction.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-22 23:54:15 UTC (rev 232)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-22 23:54:29 UTC (rev 233)
@@ -1,4 +1,7 @@
<?php
+
+
+
/**
* Returns the keys of the general parameters passed by GET or POST
*/
@@ -380,4 +383,51 @@
}
+define('PRONTO_INFO', 'info');
+define('PRONTO_WARN', 'warn');
+define('PRONTO_ERROR', 'error');
+define('PRONTO_DEBUG', 'debug');
+
+/**Add logs in moodledata
+ * param : the level og the log ('info', 'warn','error' or 'debug'), the message to display on the log
+ * return : void, store the log in MOODLEDATADIR/pronto/logs/LEVEL
+ */
+function wimba_add_log($level,$message){
+
+//Set the log level values.
+$level_values = array(
+ WIMBA_DEBUG => 1,
+ WIMBA_INFO => 2,
+ WIMBA_WARN => 3,
+ WIMBA_ERROR => 4
+);
+ global $CFG;
+
+//Write on the logs only if the configured level allows it.
+ //if ($level_values[$level] >= intval(1)){
+
+ // Gets the site shortname
+ $site = get_record('course','id',SITEID);
+
+ //Computes the timestamp corresponding to the day (at 00:00:00).
+ $today_timestamp = @mktime(0, 0, 0, date("m"), date("d"), date("Y"));
+
+ //If it doesn't exist, create the log folder'
+ @mkdir(WIMBA_DIR, 0700);
+
+ @mkdir(PRODUCT_DIR, 0700);
+
+ @mkdir(WIMBA_LOGS_DIR, 0700);
+
+ //Computes the log filename. Space characters are replaced by unerscore, to have a correct filename.
+ $file = WIMBA_LOGS_DIR."/".str_replace(' ','_',$site->shortname)."-".$today_timestamp."-pronto.log";
+
+ //Writes the message in the log, and close it
+ $fh = @fopen($file, "a");
+ @fwrite($fh,gmdate("Y-m-d H:i:s")." ".strtoupper($level)." pronto - ".$message."\n");
+ @fclose($fh);
+ //}
+}
+
+
?>
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-22 23:54:15 UTC (rev 232)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-22 23:54:29 UTC (rev 233)
@@ -89,7 +89,8 @@
/********
SESSION
*********/
- $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", "", "");
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["course_id"], $this->session->signature, "", "", "", "");
+
/********
HEADER
*********/
@@ -117,6 +118,7 @@
}else{
$this->xml->addSpaceElement("300px", "instructor");
}
+
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari'))
$this->xml->addSearchElement("all", "Safari");
else
@@ -129,7 +131,7 @@
if (isset ($message) && $message!="") {
$this->xml->addMessage($message);
}
-
+
$rooms=$this->getListLiveClassroom();
if($rooms!=false || $rooms==null)
@@ -277,7 +279,7 @@
/********
SESSION
*********/
- $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", $CFG->voicetools_servername, "");
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["course_id"], $this->session->signature, "", "", $CFG->voicetools_servername, "");
/********
HEADER
*********/
@@ -301,9 +303,11 @@
$this->createLcFeaturesPanel();
$this->createLcChatPanel();
$this->createLcAccessPanel();
+
if ($update == "update" && $this->currentObject != null && !$this->currentObject->isArchive()) {
$this->createLcAdvancedPanel();
}
+
$this->xml->createValidationButtonElement(get_string("validationElement_ok", "liveclassroom"), "actionHide", "javascript:launchAjaxRequest('generateListRooms.php','',true,'all')", "advanced_Ok");
if ($createWorkflow == "true")
@@ -316,6 +320,7 @@
else {
$this->xml->createValidationButtonElement(get_string("validationElement_saveAll", "liveclassroom"), "action", "javascript:submitForm('doAction.php','update','".$this->currentObject->getRoomId()."')", "setting_Save");
}
+
return $this->xml->getXml();
}
@@ -395,7 +400,7 @@
**/
function getListLiveClassroom() {
- $rooms = $this->api->getRooms($this->session->getcourse_id() . "_T");
+ $rooms = $this->api->getRooms($this->session->getcourseId() . "_T");
if($rooms==false){
return false;
@@ -542,7 +547,7 @@
);
if($this->disabled!="")
$parameters["disabled"] = $this->disabled;
- if ($this->currentObject == null || $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getcourse_id() . "_S") == "false")
+ if ($this->currentObject == null || $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getcourseId() . "_S") == "false")
$parameters["checked"] = "true";
$this->xml->addInputElement("input", $parameters);
$parameters = array (
Modified: branches/team/Thomas/integrations_common/php/lc/LCAction.php
===================================================================
--- branches/team/Thomas/integrations_common/php/lc/LCAction.php 2008-01-22 23:54:15 UTC (rev 232)
+++ branches/team/Thomas/integrations_common/php/lc/LCAction.php 2008-01-22 23:54:29 UTC (rev 233)
@@ -19,6 +19,7 @@
var $prefix="";
function LCAction($session, $server, $login, $password, $path, $courseId = "") {
+
$this->session = $session;
$this->api = LCApi :: getInstance($server, $login, $password, $path);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-22 23:54:19
|
Revision: 232
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=232&view=rev
Author: trollinger
Date: 2008-01-22 15:54:15 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
Update some stuff related to the changes done in the common library for vt
Modified Paths:
--------------
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/view.php
branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
Modified: branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -30,7 +30,7 @@
/* $Id: doAction.php 55986 2007-11-13 21:51:00Z thomasr $ */
/* This page manage the action create, update, delete for a room */
-error_reporting(E_ERROR);
+global $CFG;
require_once ("../../config.php");
require_once ("lib.php");
require_once ("lib/php/lc/LCAction.php");
@@ -51,7 +51,7 @@
$params[$param["value"]] = $value;
}
-$courseid = $params["enc_courseId"];
+$courseid = $params["enc_course_id"];
require_login($courseid);
$action = required_param('action', PARAM_ALPHA);
@@ -66,7 +66,7 @@
switch ($action) {
case "launch" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
if ($params["studentView"] == "true") {
$authToken = $api->getAuthokenNormal($session->getCourseId() . "_S", $session->getFirstname(), $session->getLastname());
@@ -77,23 +77,23 @@
exit;
break;
case "create" :
- $id = $api->createRoom(required_param('id', PARAM_SAFEDIR), "false");
+ $id = $api->createRoom(required_param('resource_id', PARAM_SAFEDIR), "false");
$messageAction = "created";
$messageProduct = "room";
break;
case "update" :
- $roomId = required_param('id', PARAM_SAFEDIR);
-
+ $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('id', PARAM_SAFEDIR), $api->getPrefix());
+ $roomId = trimPrefix(required_param('resource_id', PARAM_SAFEDIR), $api->getPrefix());
else
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$id = $api->deleteRoom($roomId);
//delte the activity linked to this room
@@ -104,31 +104,31 @@
$messageProduct = "room";
break;
case "openContent" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
header('Location:' . $CFG->liveclassroom_servername . '/admin/class/carousels.epl?class_id=' . $roomId . '&hzA=' . $authToken . '&no_sidebar=1');
exit ();
break;
case "openReport" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
header('Location:reports.php?id=' . $roomId . '&hzA=' . $authToken);
exit ();
break;
case "openAdvancedMedia" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
header('Location:' . $CFG->liveclassroom_servername . '/admin/class/media.pl?class_id=' . $roomId . '&hzA=' . $authToken . '&no_sidebar=1');
exit ();
break;
case "openAdvancedRoom" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$authToken = $api->getAuthoken();
header('Location:' . $CFG->liveclassroom_servername . '/admin/class/properties.pl?class_id=' . $roomId . '&hzA=' . $authToken . '&no_sidebar=1');
exit ();
break;
case "getDialInformation" :
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$select_room = $api->getRoom($roomId);
if ($params["studentView"] == "true" || $session->isInstructor() == false)
@@ -139,9 +139,9 @@
break;
case "saveSettings" :
if ($api->getPrefix() != "")
- $roomId = trimPrefix(required_param('id', PARAM_SAFEDIR), $api->getPrefix());
+ $roomId = trimPrefix(required_param('resource_id', PARAM_SAFEDIR), $api->getPrefix());
else
- $roomId = required_param('id', PARAM_SAFEDIR);
+ $roomId = required_param('resource_id', PARAM_SAFEDIR);
$id = $api->createRoom($roomId, "true");
break;
}
@@ -161,6 +161,6 @@
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&messageAction=' . $messageAction . '&messageProduct=' . $messageProduct);
}
} else {
-// header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=session');
+ header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=session');
}
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -31,7 +31,6 @@
/// 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/php/lc/LCAction.php");
@@ -49,11 +48,11 @@
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"]);
if(isset($params["error"])){
@@ -62,17 +61,21 @@
else
{
- $session=new WimbaMoodleSession($params);
+ $session=new WimbaMoodleSession($params);
+
if(isset($params["messageProduct"]) && isset($params["messageAction"]))
$message=get_string("message_" . $params["messageProduct"] . "_start", "liveclassroom")." ".$params["messageProductName"]." ".get_string("message_" . $params["messageAction"] . "_end","liveclassroom");
$api=new LCAction($session,$CFG->liveclassroom_servername,
$CFG->liveclassroom_adminusername,
$CFG->liveclassroom_adminpassword,$CFG->dataroot);
-
+
$uiManager=new WimbaUI($session,$api);
if($session->error==false)//good
{
+
+
$display=$uiManager->getLCPrincipalView($message);
+
}
else{
if($session->error=="session")
@@ -81,5 +84,6 @@
$display=$uiManager->setError(get_string ('error_signature', 'liveclassroon'));
}
}
+
echo $display;
?>
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -27,8 +27,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/php/lc/LCAction.php");
@@ -48,7 +47,7 @@
$params[$param["value"]] = $value;
}
-require_login($params["enc_courseId"]);
+require_login($params["enc_course_id"]);
$action = optional_param('action', PARAM_ALPHA);
$currentIdtab = optional_param('idtab', null, PARAM_ALPHA);
@@ -59,12 +58,13 @@
$api=new LCAction($session,$CFG->liveclassroom_servername,
$CFG->liveclassroom_adminusername,
$CFG->liveclassroom_adminpassword,$CFG->dataroot);
- $roomId = required_param('id', PARAM_SAFEDIR );
+ $roomId = required_param('resource_id', PARAM_SAFEDIR );
$room_info = $api->getRoom($roomId);
if($room_info!=false){
-
+
$uiManager=new WimbaUI($session,$api,$currentIdtab);
+
$uiManager->setCurrentProduct("liveclassroom",$room_info);
}
else {
@@ -81,12 +81,13 @@
$uiManager=new WimbaUI($session,$api);
$uiManager->setCurrentProduct("liveclassroom");
}
-
+
if(isset($params["createWorkflow"]) && $params["createWorkflow"]=="true")
$createWorkflow= "true";
else
$createWorkflow="false";
$display=$uiManager->getLCSettingsView($action,$createWorkflow);
+
}
else
{
Modified: branches/team/Thomas/moodle/mod/liveclassroom/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -30,7 +30,7 @@
/// This page lists all the instances of liveclassroom in a particular course
-error_reporting(E_ERROR);
+
require_once("../../config.php");
require_once("lib.php");
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -35,8 +35,11 @@
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");
$LIVECLASSROOM_LOGS = "logs.php"; //file use to the logs
@@ -122,8 +125,8 @@
liveclassroom_deleteCalendarEvent($result);
}
-
- return $result;
+ wimba_add_log(1,"ssss");
+ return true;
}
@@ -462,4 +465,22 @@
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-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-01-22 23:54:15 UTC (rev 232)
@@ -29,12 +29,12 @@
******************************************************************************/
/* $Id: mod.html 200 2008-01-09 11:37:50Z trollinger $ */
-error_reporting(E_ERROR);
+
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');
-include_once($CFG->dirroot.'/mod/liveclassroom/lib/php/common/WimbaLib.php');
+
require_once($CFG->dirroot.'/version.php');
//test if the current user can see this page
@@ -47,7 +47,7 @@
$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);
+$sectionId = optional_param('section', 0, PARAM_INT);
$lcApi=new LCAction(null,$CFG->liveclassroom_servername,
$CFG->liveclassroom_adminusername,
@@ -69,7 +69,13 @@
if (!isset($form->section)) {
$form->section = '';
}
-
+ if (empty($form->timeopen)) {
+ $form->timeopen = "";
+ $form->timerestrict = 0;
+ } else {
+ $form->timerestrict = 1;
+ }
+
$event=false;
$description="";
$stringDate="";
Modified: branches/team/Thomas/moodle/mod/liveclassroom/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/view.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/view.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -132,7 +132,7 @@
<tbody>
<tr>
<td align=left>
- <img src="pictures/items/headerbar-logo.png" height="32" width="80">
+ <img src="lib/web/pictures/items/headerbar-logo.png" height="32" width="80">
</td>
</tr>
</tbody>
@@ -177,7 +177,7 @@
<table width=100% >
<tr style="border-top:1px solid; background-color:#F0F0F0;">
<td align=left >
- <img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/listitem-liveclassroomicon.gif" /><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $cm->course;?>">
+ <img src="lib/web/pictures/items/listitem-liveclassroomicon.gif" /><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/index.php?id=<?php echo $cm->course;?>">
<?php
if(getRoleForWimbaTools($course->id, $USER->id)=="Instructor")
Modified: branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-01-22 23:00:11 UTC (rev 231)
+++ branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-01-22 23:54:15 UTC (rev 232)
@@ -28,7 +28,7 @@
******************************************************************************/
/* $Id: welcome.php 197 2007-08-29 14:30:36Z trollinger $ */
-error_reporting(E_ERROR);
+
require_once("../../config.php");
require_once("lib.php");
global $CFG;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-22 23:00:17
|
Revision: 231
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=231&view=rev
Author: trollinger
Date: 2008-01-22 15:00:11 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
Update the lib and pictures path
Cleaning
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaCommons.php
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetools.php
branches/team/Thomas/integrations_common/web/js/ajax.js
Modified: branches/team/Thomas/integrations_common/php/common/WimbaCommons.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaCommons.php 2008-01-22 22:59:37 UTC (rev 230)
+++ branches/team/Thomas/integrations_common/php/common/WimbaCommons.php 2008-01-22 23:00:11 UTC (rev 231)
@@ -84,8 +84,8 @@
function getCourseId(){
- if(isset($this->hparams["courseId"]))
- return $this->hparams["courseId"];
+ if(isset($this->hparams["course_id"]))
+ return $this->hparams["course_id"];
else
return null;
}
@@ -169,492 +169,7 @@
}
-class vtAction{
- var $params;
- function vtAction($params){
- $this->params=$params;
- }
- /**************
- VOICE BOARD
- *****************/
- /*
- * This function creates a voice board on the vt server
- * params : elements of the form
- */
- function createBoard(){
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
- // Info
- $ressource->setType("board"); //Voice Baord
- if (isset($this->params["description"]))
- {
- $ressource->setDescription(stripslashes($this->params["description"]));
- }
-
- if (isset($this->params["longname"]))
- {
-
- $ressource->setTitle(stripslashes($this->params["longname"]));
- }
-
- if ($this->params["led"] == "student")
- {
-
- $options->setFilter("false");
- if (isset($this->params["show_compose"]))
- {
- $options->setShowCompose("true");
- }
- else{
- $options->setShowCompose("false");
- }
- }
- else
- {
- $options->setFilter("true");
- $options->setShowCompose("false");
- }
-
- //Media
-
- if(isset($this->params["audio_format"]))
- {
- $audio->setName($this->params["audio_format"]);
- }
- //message length
- if(isset($this->params["max_length"]))
- {
- $options->setMaxLength($this->params["max_length"]);
- }
-
- //Features
-
- //short message titles
- if(isset($this->params["short_title"]))
- {
- $options->setShortTitle("true");
- }
- else
- {
- $options->setShortTitle("false");
- }
- //chronological order
- if(isset($this->params["chrono_order"]))
- {
- $options->setChronoOrder("true");
- }
- else
- {
- $options->setChronoOrder("false");
- }
-
- //forward message
- if(isset($this->params["show_forward"]))
- {
- $options->setShowForward("true");
- }
- else
- {
- $options->setShowForward("false");
- }
-
-
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
- //create the resource on the vt server
- $result = voicetools_api_create_resource($ressource->getResource());
- if(VTAPI_DEBUG) {
- error_log (__FUNCTION__ ." : Board Created , rid=".$result->getRid(), TRUE);
- }
-
- return $result;
-
- }
- /*
- * This function modifies a voice board on the vt server
- * params : elements of the form
- */
- function modifyBoard($id){
-
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
- // Info
- $ressource->setType("board"); //Voice Baord
- if (isset($this->params["description"]))
- {
- $ressource->setDescription(stripslashes($this->params["description"]));
- }
-
-
- if (isset($this->params["longname"]))
- {
- $ressource->setTitle(stripslashes($this->params["longname"]));
- }
-
- if ($this->params["led"] == "student")
- {
-
- $options->setFilter("false");
- if (isset($this->params["show_compose"]))
- {
- $options->setShowCompose("true");
- }
- else{
- $options->setShowCompose("false");
- }
- }
- else
- {
- $options->setFilter("true");
- $options->setShowCompose("false");
- }
-
- //Media
-
- if(isset($this->params["audio_format"]))
- {
- $audio->setName($this->params["audio_format"]);
- }
- //message length
- if(isset($this->params["max_length"]))
- {
- $options->setMaxLength($this->params["max_length"]);
- }
-
- //Features
-
- //short message titles
- if(isset($this->params["short_title"]))
- {
- $options->setShortTitle("true");
- }
- else
- {
- $options->setShortTitle("false");
- }
- //chronological order
- if(isset($this->params["chrono_order"]))
- {
- $options->setChronoOrder("true");
- }
- else
- {
- $options->setChronoOrder("false");
- }
-
- //forward message
- if(isset($this->params["show_forward"]))
- {
- $options->setShowForward("true");
- }
- else
- {
- $options->setShowForward("false");
- }
-
-
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
- //update
- $ressource->setRid($id);
-
- //create the resource on the vt server
- $result = voicetools_api_modify_resource($ressource->getResource());
- return $result;
-
- }
-
- /****************
- VOICE PRESENTATION
- ****************/
- /*
- * This function creates a voice presentation the vt server
- * params : elements of the form(constructor)
- */
- function createPresentation(){
-
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
- // Info
- $ressource->setType("presentation"); //Voice Baord
- if (isset($this->params["description"]))
- {
- $ressource->setDescription(stripslashes($this->params["description"]));
- }
-
- if (isset($this->params["longname"]))
- {
- $ressource->setTitle(stripslashes($this->params["longname"]));
- }
-
- if(isset($this->params["filter"]))
- {
- $options->setFilter("true");
- }
- else
- {
- $options->setFilter("false");
- }
- //slides comments private
- if(isset($this->params["show_reply"]))
- {
- $options->setShowReply("true");
- }
- else
- {
- $options->setShowReply("false");
- }
-
- //Media
- if(isset($this->params["audio_format"]))
- {
- $audio->setName($this->params["audio_format"]);
- }
- //message length
- if(isset($this->params["max_length"]))
- {
- $options->setMaxLength($this->params["max_length"]);
- }
-
-
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
-
- //create the resource on the vt server
- $result = voicetools_api_create_resource($ressource->getResource());
- return $result;
- }
-
- /*
- * This function modifies a voice presentation the vt server
- * params : elements of the form(constructor)
- */
- function modifyPresentation($id){
-
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
- // Info
- $ressource->setType("presentation"); //Voice Presentation
- if (isset($this->params["description"]))
- {
- $ressource->setDescription(stripslashes($this->params["description"]));
- }
-
- if (isset($this->params["longname"]))
- {
- $ressource->setTitle(stripslashes($this->params["longname"]));
- }
-
- if(isset($this->params["filter"]))
- {
- $options->setFilter("true");
- }
- else
- {
- $options->setFilter("false");
- }
- //slides comments private
- if(isset($this->params["show_reply"]))
- {
- $options->setShowReply("true");
- }
- else
- {
- $options->setShowReply("false");
- }
-
- //Media
- if(isset($this->params["audio_format"]))
- {
- $audio->setName($this->params["audio_format"]);
- }
- //message length
- if(isset($this->params["max_length"]))
- {
- $options->setMaxLength($this->params["max_length"]);
- }
-
-
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
- $ressource->setRid($id);
- //create the resource on the vt server
- $result = voicetools_api_modify_resource($ressource->getResource());
- return $result;
-
-
- }
-
- /********
- Podcaster
- **********/
- /*
- * This function creates a podcaster the vt server
- * params : elements of the form(constructor)
- */
- function createPodcaster(){
-
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
-
- // Info
- $ressource->setType("pc");//Podcaster
- if (isset($this->params["description"]))
- {
- $ressource->setDescription(stripslashes($this->params["description"]));
- }
-
- if (isset($this->params["longname"]))
- {
- $ressource->setTitle(stripslashes($this->params["longname"]));
- }
- if(isset($this->params["show_compose"]))
- {
- $options->setShowCompose("true");
- }
- else
- {
- $options->setShowCompose("false");
- }
-
- //Media
- if(isset($this->params["audio_format"]))
- {
- $audio->setName($this->params["audio_format"]);
- }
-
- if(isset($this->params["delay"]))
- {
- $options->setDelay($this->params["delay"]); //no delay
- }
-
- //Features
- if(isset($this->params["short_title"]))
- {
- $options->setShortTitle("true");
- }
- else{
- $options->setShortTitle("false");
- }
- $options->setMaxLength(1200); //set to 20 min
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
-
- //create the resource on the vt server
- $result = voicetools_api_create_resource($ressource->getResource());
-
- return $result;
- }
- /*
- * This function modifies a podcaster the vt server
- * params : elements of the form(constructor)
- */
- function modifyPodcaster($id){
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
-
- // Info
- $ressource->setType("pc");//Podcaster
- if (isset($this->params["description"]))
- {
- $ressource->setDescription(stripslashes($this->params["description"]));
- }
-
- if (isset($this->params["longname"]))
- {
- $ressource->setTitle(stripslashes($this->params["longname"]));
- }
- if(isset($this->params["show_compose"]))
- {
- $options->setShowCompose("true");
- }
- else
- {
- $options->setShowCompose("false");
- }
-
- //Media
- if(isset($this->params["audio_format"]))
- {
- $audio->setName($this->params["audio_format"]);
- }
-
- if(isset($this->params["delay"]))
- {
- $options->setDelay($this->params["delay"]); //no delay
- }
-
- //Features
- if(isset($this->params["short_title"]))
- {
- $options->setShortTitle("true");
- }
- else{
- $options->setShortTitle("false");
- }
- $options->setMaxLength(1200); //set to 20 min
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
-
- $ressource->setRid($id);
- //create the resource on the vt server
- $result = voicetools_api_modify_resource($ressource->getResource());
-
- return $result;
- }
- /********
- Recorder
- **********/
- /*
- * This function creates a recorder the vt server
- * params : blocks' id
- */
- function createRecorder(){
-
- $ressource = new vtResource(NULL);
- $audio = new vtAudioFormat(NULL);
- $options = new VtOptions(NULL);
-
- // Info
- $ressource->setType("recorder");
-
-
- $options->setMaxLength(1200); //set to 20 min
- $options->setAudioFormat($audio);
- $ressource->setOptions($options);
-
- //create the resource on the vt server
- $result = voicetools_api_create_resource($ressource->getResource());
-
- return $result;
- }
-
- function deleteRessource($rid)
- {
- $result = voicetools_api_delete_resource($rid);
- return $result;
- }
-
- function getVtSession($resource,$user,$rights,$message=null)
- {
- if($message!=null)
- return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights(),$message->getMessage()) ;
- else
- return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights()) ;
-
- }
-}
-
-
-
-
?>
\ No newline at end of file
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-22 22:59:37 UTC (rev 230)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-22 23:00:11 UTC (rev 231)
@@ -5,7 +5,7 @@
function getKeysOfGeneralParameters(){
return array(
- array("value"=>"enc_courseId","type"=>PARAM_INT,"default_value"=>null),
+ array("value"=>"enc_course_id","type"=>PARAM_INT,"default_value"=>null),
array("value"=>"enc_email","type"=>PARAM_CLEAN,"default_value"=>null),
array("value"=>"enc_firstname","type"=>PARAM_ALPHANUM,"default_value"=>null),
array("value"=>"enc_lastname","type"=>PARAM_ALPHANUM,"default_value"=>null),
@@ -16,7 +16,8 @@
array("value"=>"type","type"=>PARAM_ALPHA,"default_value"=>null),
array("value"=>"studentView","type"=>PARAM_BOOL,"default_value"=>null),
array("value"=>"createWorkflow","type"=>PARAM_BOOL,"default_value"=>null),
-
+ array("value"=>"action","type"=>PARAM_ALPHA,"default_value"=>null),
+ array("value"=>"resource_id","type"=>PARAM_CLEAN,"default_value"=>"0"),
);
}
@@ -27,7 +28,7 @@
return array (
array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>null),
- array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>null),
+ array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>""),
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"),
@@ -46,7 +47,42 @@
) ;
}
+function getKeyWimbaVoiceForm(){
+
+
+ return array (
+ array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>null),
+ array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>"dd"),
+ array("value"=>"led","type"=>PARAM_ALPHA,"default_value"=>"instructor"),
+
+ array("value"=>"audio_format","type"=>PARAM_CLEAN,"default_value"=>"medium"),
+ array("value"=>"max_length","type"=>PARAM_INT,"default_value"=>"0"),
+ array("value"=>"delay","type"=>PARAM_INT,"default_value"=>"0"),
+
+ array("value"=>"short_title","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"chrono_order","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"show_reply","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"show_forward","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"show_compose","type"=>PARAM_ALPHA,"default_value"=>"false"),
+ array("value"=>"filter","type"=>PARAM_ALPHA,"default_value"=>"false"),
+
+ array("value"=>"accessAvailable","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"start_date","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"start_month","type"=>PARAM_INT,"default_value"=>"0"),
+ array("value"=>"start_day","type"=>PARAM_INT,"default_value"=>"0"),
+ array("value"=>"start_year","type"=>PARAM_INT,"default_value"=>"0"),
+ array("value"=>"start_hr","type"=>PARAM_INT,"default_value"=>-1),
+ array("value"=>"start_min","type"=>PARAM_INT,"default_value"=>-1),
+ array("value"=>"end_date","type"=>PARAM_BOOL,"default_value"=>"0"),
+ array("value"=>"end_month","type"=>PARAM_INT,"default_value"=>"0"),
+ array("value"=>"end_day","type"=>PARAM_INT,"default_value"=>"0"),
+ array("value"=>"end_year","type"=>PARAM_INT,"default_value"=>"f"),
+ array("value"=>"end_hr","type"=>PARAM_INT,"default_value"=>-1),
+ array("value"=>"end_min","type"=>PARAM_INT,"default_value"=>-1),
+ );
+}
+
function getListOfWeeks($course,$current){
$i=1;
@@ -171,7 +207,7 @@
$role=getRoleForWimbaTools($courseid,$USER->id);
$signature = md5($courseid.$USER->email.$USER->firstname.$USER->lastname.$role);
- $url_params = "enc_courseId=".rawurlencode($courseid).
+ $url_params = "enc_course_id=".rawurlencode($courseid).
"&enc_email=".rawurlencode($USER->email).
"&enc_firstname=".rawurlencode($USER->firstname).
"&enc_lastname=".rawurlencode($USER->lastname).
@@ -274,7 +310,7 @@
$voicetools->end_date="-1";
}
}
-
+
return voicetools_store_new_element($voicetools);
}
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-22 22:59:37 UTC (rev 230)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-22 23:00:11 UTC (rev 231)
@@ -152,7 +152,7 @@
/********
SESSION
*********/
- $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", "", "");
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["course_id"], $this->session->signature, "", "", "", "");
/********
HEADER
*********/
@@ -210,7 +210,7 @@
function getListVoiceTools() {
//get the list of the boards
- $list = voicetools_get_voicetools_list($this->session->hparams["courseId"]);
+ $list = voicetools_get_voicetools_list($this->session->hparams["course_id"]);
$vtResources = voicetools_api_get_resources($list["rid"]);
@@ -324,7 +324,7 @@
/********
SESSION
*********/
- $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", "", "");
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["course_id"], $this->session->signature, "", "", "", "");
/********
HEADER
*********/
@@ -395,7 +395,7 @@
**/
function getListLiveClassroom() {
- $rooms = $this->api->getRooms($this->session->getCourseId() . "_T");
+ $rooms = $this->api->getRooms($this->session->getcourse_id() . "_T");
if($rooms==false){
return false;
@@ -542,7 +542,7 @@
);
if($this->disabled!="")
$parameters["disabled"] = $this->disabled;
- if ($this->currentObject == null || $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getCourseId() . "_S") == "false")
+ if ($this->currentObject == null || $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getcourse_id() . "_S") == "false")
$parameters["checked"] = "true";
$this->xml->addInputElement("input", $parameters);
$parameters = array (
@@ -567,7 +567,7 @@
);
if($this->disabled!="")
$parameters["disabled"] = $this->disabled;
- if ($this->currentObject != null && $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getCourseId() . "_S") == "true")
+ if ($this->currentObject != null && $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getcourseId() . "_S") == "true")
$parameters["checked"] = "true";
$this->xml->addInputElement("input", $parameters);
$parameters = array (
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-22 22:59:37 UTC (rev 230)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-22 23:00:11 UTC (rev 231)
@@ -346,7 +346,7 @@
- function CreateInformationElement($timeOfLoad, $firstName, $lastName, $email, $role, $courseId, $signature, $authToken,$lc,$vt,$picturesToLoad)
+ function CreateInformationElement($timeOfLoad, $firstName, $lastName, $email, $role, $courseId, $signature, $authToken,$lc,$vt,$picturesToLoad=null)
{
$this->Informations = $this->xmldoc->create_element("information");
@@ -372,9 +372,11 @@
$vtUrl->append_child($this->xmldoc->create_text_node($vt));
$lcUrl = $this->xmldoc->create_element("lcServerUrl");
$lcUrl->append_child($this->xmldoc->create_text_node($lc));
- $epicturesToLoad = $this->xmldoc->create_element("picturesToLoad");
- $epicturesToLoad->append_child($this->xmldoc->create_text_node($picturesToLoad));
-
+ if($picturesToLoad!=null){
+ $epicturesToLoad = $this->xmldoc->create_element("picturesToLoad");
+ $epicturesToLoad->append_child($this->xmldoc->create_text_node($picturesToLoad));
+ $this->Informations->append_child($epicturesToLoad);
+ }
$this->Informations->append_child($etimeOfLoad);
$this->Informations->append_child($efirstName);
$this->Informations->append_child($elastName);
@@ -385,7 +387,7 @@
$this->Informations->append_child($eemail);
$this->Informations->append_child($vtUrl);
$this->Informations->append_child($lcUrl);
- $this->Informations->append_child($epicturesToLoad);
+
//xml.DocumentElement->append_child(Informations);
}
Modified: branches/team/Thomas/integrations_common/php/vt/WimbaVoicetools.php
===================================================================
--- branches/team/Thomas/integrations_common/php/vt/WimbaVoicetools.php 2008-01-22 22:59:37 UTC (rev 230)
+++ branches/team/Thomas/integrations_common/php/vt/WimbaVoicetools.php 2008-01-22 23:00:11 UTC (rev 231)
@@ -99,20 +99,34 @@
}
function getType(){
- return $this->hparams["type"];
+ if(isset($this->hparams["type"]))
+ return $this->hparams["type"];
+ else
+ return "";
}
function getRid(){
- return $this->hparams["rid"];
+ if(isset($this->hparams["rid"]))
+ return $this->hparams["rid"];
+ else
+ return "";
}
function getTitle(){
-
- return $this->hparams["title"];
+ if(isset($this->hparams["title"]))
+ return $this->hparams["title"];
+ else
+ return "";
}
function getDescription(){
- return $this->hparams["description"];
+ if(isset($this->hparams["description"]))
+ return $this->hparams["description"];
+ else
+ return "";
}
function getMail(){
- return $this->hparams["email"];
+ if(isset($this->hparams["email"]))
+ return $this->hparams["email"];
+ else
+ return "";
}
function setType($type)
Modified: branches/team/Thomas/integrations_common/web/js/ajax.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/ajax.js 2008-01-22 22:59:37 UTC (rev 230)
+++ branches/team/Thomas/integrations_common/web/js/ajax.js 2008-01-22 23:00:11 UTC (rev 231)
@@ -86,7 +86,7 @@
function getSessionParameters() {
var params = new Array();
params["signature"] = session["signature"];
- params["enc_courseId"] = session["courseId"];
+ params["enc_course_id"] = session["courseId"];
params["enc_email"] = session["email"];
params["enc_firstname"] = session["firstName"];
params["enc_lastname"] = session["lastName"];
@@ -99,7 +99,7 @@
params["type"] = typeSelect;
}
if (currentId != "") {
- params["id"] = currentId;
+ params["resource_id"] = currentId;
}
if (currentIdtab != "") {
params["idtab"] = currentIdtab;
@@ -119,7 +119,7 @@
function getUrlParameters() {
var url = "";
url += "signature=" + session["signature"];
- url += "&enc_courseId=" + session["courseId"];
+ url += "&enc_course_id=" + session["courseId"];
url += "&enc_email=" + session["email"];
url += "&enc_firstname=" + session["firstName"];
url += "&enc_lastname=" + session["lastName"];
@@ -133,7 +133,7 @@
}
if (currentId != "") {
- url += "&id=" + currentId;
+ url += "&resource_id=" + currentId;
}
if (currentIdtab != "") {
@@ -186,7 +186,7 @@
if (action != "") {
url += "?action=" + action;
}
- if (createWorkflow != "" && action!="") {
+ if (createWorkflow != null && action!=null) {
url += "&createWorkflow=" + createWorkflow;
}
isFilter = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-22 22:59:39
|
Revision: 230
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=230&view=rev
Author: trollinger
Date: 2008-01-22 14:59:37 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
Update lib and pictures path into differents files
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css
branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
branches/team/Thomas/moodle/mod/voicetools/index.php
branches/team/Thomas/moodle/mod/voicetools/manageAction.php
branches/team/Thomas/moodle/mod/voicetools/mod.html
branches/team/Thomas/moodle/mod/voicetools/view.php
branches/team/Thomas/moodle/mod/voicetools/welcome.php
Modified: branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css 2008-01-22 22:59:37 UTC (rev 230)
@@ -126,7 +126,7 @@
height: 32px;
border-bottom: solid 1px Black;
- background:white url( "../pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
+ background:white url( "../lib/web/pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
}
.headerBarRight
@@ -141,7 +141,7 @@
/*contextBar*/
#contextBar table
{
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
height: 30px;
width: 100%;
border-bottom: solid 1px #F0F0F0;
@@ -167,7 +167,7 @@
#filterBar
{
- background-image: url( "../pictures/backgrounds/filterbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/filterbar.png" );
height: 24px;
font-weight: bold;
border-bottom: fine 1px #C7D3E1;
@@ -200,22 +200,22 @@
a.filterenabled span
{
- background:url("../pictures/items/filter-enabled-right.png") no-repeat right top;
+ background:url("../lib/web/pictures/items/filter-enabled-right.png") no-repeat right top;
color:white;
}
a.filterenabled
{
- background:url("../pictures/items/filter-enabled-left.png") no-repeat left top;
+ background:url("../lib/web/pictures/items/filter-enabled-left.png") no-repeat left top;
}
a.filterrollover
{
- background:url("../pictures/items/filter-rollover-left.png") no-repeat left top;
+ background:url("../lib/web/pictures/items/filter-rollover-left.png") no-repeat left top;
}
a.filterrollover span
{
- background:url("../pictures/items/filter-rollover-right.png") no-repeat right top;
+ background:url("../lib/web/pictures/items/filter-rollover-right.png") no-repeat right top;
}
/*list*/
@@ -403,7 +403,7 @@
padding-left: 5px;
width: 100%;
height:40px;
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
border-bottom: solid 1px #999999;
}
@@ -459,12 +459,12 @@
/*tabs*/
#tabs
{
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
}
td.tabSelected,td.tabDisabled,td.tabNoSelected
{
- background-image: url(../pictures/items/tab-selected.gif);
+ background-image: url(../lib/web/pictures/items/tab-selected.gif);
background-repeat: no-repeat;
width: 78px;
font-size: 10px;
@@ -476,12 +476,12 @@
{
color: #CACACA;
z-index:-14;
- background-image: url(../pictures/items/tab-unselected.gif);
+ background-image: url(../lib/web/pictures/items/tab-unselected.gif);
border-bottom: solid 1px #818181;
}
td.tabNoSelected
{
- background-image: url(../pictures/items/tab-unselected.gif);
+ background-image: url(../lib/web/pictures/items/tab-unselected.gif);
border-bottom: solid 1px #818181;
}
@@ -563,7 +563,7 @@
td.action, input.action
{
- background-image: url(../pictures/buttons/general-empty.png);
+ background-image: url(../lib/web/pictures/buttons/general-empty.png);
background-repeat: no-repeat;
background-position: center;
text-decoration: none;
@@ -574,7 +574,7 @@
}
td.action:hover, input.action:hover
{
- background-image: url(../pictures/buttons/general-empty-over.png);
+ background-image: url(../lib/web/pictures/buttons/general-empty-over.png);
}
.action label
@@ -724,7 +724,7 @@
top:0px;
width:10px;
height:150px;
- background-image: url( "../pictures/items/window-left.png" );
+ background-image: url( "../lib/web/pictures/items/window-left.png" );
background-repeat:none;
}
@@ -734,7 +734,7 @@
top:0px;
width:330px;
height:150px;
- background-image: url( "../pictures/items/window-middle.png" );
+ background-image: url( "../lib/web/pictures/items/window-middle.png" );
}
@@ -754,7 +754,7 @@
top:0px;
width:10px;
height:200px;
- background-image: url( "../pictures/items/window200_left.png" );
+ background-image: url( "../lib/web/pictures/items/window200_left.png" );
background-repeat:none;
}
@@ -764,7 +764,7 @@
top:0px;
width:380px;
height:200px;
- background-image: url( "../pictures/items/window200_middle.png" );
+ background-image: url( "../lib/web/pictures/items/window200_middle.png" );
}
@@ -774,7 +774,7 @@
top:0px;
width:10px;
height:200px;
- background-image: url( "../pictures/items/window200_right.png" );
+ background-image: url( "../lib/web/pictures/items/window200_right.png" );
background-repeat:none;
}
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -29,52 +29,35 @@
/* $Id: getXmlChoicePage.php 52853 2007-08-24 17:55:26Z thomasr $ */
error_reporting(E_ERROR);
-
+global $CFG;
require_once("../../config.php");
-// require_once("lib.php");
+require_once("lib.php");
require_once("lib/php/common/WimbaXml.php");
require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaLib.php");
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
-
-// Variables needed
-global $CFG;
-
-$params = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $params[$key] = $val;
- }
-
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $params[$key] = $val;
- }
-
-}
+require_login($params["enc_course_id"]);
$xml=new WimbaXml();
$session=new WimbaMoodleSession($params);
-if($session->error==false)
-{
- if(isset($params["createWorkflow"]) )
- $createWorkflow= $params["createWorkflow"];
- else
- $createWorkflow=false;
-
-
-
-
+if($session->error==false)//no error
+{
/********
HEADER
*********/
- $xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true");
+ $xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
/********
SESSION
*********/
- $xml->CreateInformationElement($session->timeOfLoad,$session->hparams["firstname"],$session->hparams["lastname"],$session->hparams["email"],$session->hparams["role"],$session->hparams["courseId"],$session->signature,"","",$CFG->voicetools_servername,$pictures);
+ $xml->CreateInformationElement($session->timeOfLoad,$session->hparams["firstname"],$session->hparams["lastname"],$session->hparams["email"],$session->hparams["role"],$session->hparams["course_id"],$session->signature,"","",$CFG->voicetools_servername);
/************
INFORMATIONS
@@ -84,10 +67,10 @@
/***************
PRODUCTS CHOICE
****************/
- $xml->addProductChoice("pictures/buttons/new-createvoiceboard.png",get_string('new_board', 'voicetools'),get_string('VoiceBoardDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','board','all','".$createWorkflow."')");
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createvoiceboard.png",get_string('new_board', 'voicetools'),get_string('VoiceBoardDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','board','all','".$createWorkflow."')");
- $xml->addProductChoice("pictures/buttons/new-createvoicepresentation.png",get_string('new_presentation', 'voicetools'),get_string('VoicePresentationDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','presentation','all','".$createWorkflow."')");
- $xml->addProductChoice("pictures/buttons/new-createpodcaster.png",get_string('new_podcaster', 'voicetools'),get_string('PodcasterDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','pc','all','".$createWorkflow."')");//for 3.1
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createvoicepresentation.png",get_string('new_presentation', 'voicetools'),get_string('VoicePresentationDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','presentation','all','".$createWorkflow."')");
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createpodcaster.png",get_string('new_podcaster', 'voicetools'),get_string('PodcasterDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','pc','all','".$createWorkflow."')");//for 3.1
/***************
VALIDATION BAR
@@ -100,15 +83,8 @@
$xml->createValidationButtonElement(get_string("validationElement_cancel", "voicetools"), "action", "javascript:launchAjaxRequest('getXmlListPanel.php','',true,'all')", "setting_Cancel");
-
- }else{ //bad session
-
- if($session->error=="session")
- $xml->setError(get_string ('session', 'voicetools'));
- else if($session->error=="signature")
- $xml->setError(get_string ('signature', 'voicetools'));
- echo $xml->getXml();
- exit();
- }
- echo $xml->getXml();
+}else{ //bad session
+ $xml->setError(get_string ($session->error, 'voicetools'));
+}
+echo $xml->getXml();
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -31,41 +31,32 @@
/// This page generates the xml of the principal window
error_reporting(E_ERROR);
+global $CFG;
+
require_once("../../config.php");
require_once("lib.php");
-
require_once("lib/php/common/WimbaXml.php");
require_once("lib/php/common/WimbaCommons.php");
require_once("lib/php/common/WimbaUI.php");
require_once("lib/php/common/XmlResource.php");
require_once('lib/php/vt/WimbaVoicetools.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once('lib/php/common/WimbaLib.php');
-
-set_time_limit(30);
-
-
-// Variables needed
-global $CFG;
-
-$params = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $params[$key] = $val;
- }
-
+if (version_compare(PHP_VERSION,'5','>=')) {
+ require_once('lib/php/common/domxml-php4-php5.php');
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $params[$key] = $val;
- }
-
-}
+$messageProduct=optional_param("messageProduct","");
+$messageAction=optional_param("messageAction","");
-if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/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["enc_course_id"]);
$session=new WimbaMoodleSession($params);
$uiManager=new WimbaUI($session);
if(isset($params["error"])){
@@ -73,26 +64,19 @@
}
else
{
- //Session Management
-
- $message="";
- if(isset($params["messageProduct"]) && isset($params["messageAction"]))
- $message=get_string("message_" . $params["messageProduct"] . "_start", "voicetools")." ".get_string("message_" . $params["messageAction"] . "_end","voicetools");
-
+ //Session Management
if($session->error==false)//good
{
+ $message="";
+ if(!empty($messageProduct) && !empty($messageAction))
+ $message=get_string("message_".$messageProduct."_start", "voicetools")." ".get_string("message_".$messageAction."_end","voicetools");
$display=$uiManager->getVTPrincipalView($message);
}
else
{ //bad session
- if($session->error=="session")
- $display=$uiManager->setError(get_string ('error_session', 'voicetools'));
- else if($session->error=="signature")
- $display=$uiManager->setError(get_string ('error_signature', 'voicetools'));
- echo $display;
- exit();
+ $display="";//to make sure that nothing was displayed before
+ $display=$uiManager->setError(get_string ('error_'.$session->error, 'voicetools'));
}
}
echo $display;
-
- ?>
\ No newline at end of file
+?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -40,54 +40,45 @@
require_once("lib/php/common/WimbaCommons.php");
require_once("lib/php/common/WimbaXml.php");
require_once("lib/php/common/WimbaUI.php");
-
-set_time_limit(30);
-
+require_once("lib/php/common/WimbaLib.php");
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
+set_time_limit(30);
-
-$list_attributes = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $list_attributes[$key] = $val;
- }
-
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $list_attributes[$key] = $val;
- }
-
-}
-$session=new WimbaMoodleSession($list_attributes);
+
+require_login($params["enc_course_id"]);
+
+$session=new WimbaMoodleSession($params);
$uiManager=new WimbaUI($session);
if($session->error==false)
{
- if(isset($_GET["createWorkflow"]) && $_GET["createWorkflow"]=="true")
- $createWorkflow= "true";
- else
- $createWorkflow="false";
+
/*******************
GET URL INFORMATIONS
********************/
$action = optional_param('action', ""); // Course Module ID, or
- $typeProduct = $list_attributes['type'];
+ $typeProduct = $params['type'];
add_to_log($session->getCourseId(), "voicetools", "xml", "product" , $typeProduct);
if($action == 'update') { //get the information of the resource
- $currentBoard = voicetools_api_get_resource($list_attributes["id"]);
+ $currentBoard = voicetools_api_get_resource($params["resource_id"]);
if($currentBoard==null || $currentBoard->error==true){
$xml->setError(get_string('problem_vt','voicetools'));
echo $xml->getXml();
exit();
}
- $currentBoardInformations=voicetools_get_voiceboard_Informations($list_attributes["id"]);
+ $currentBoardInformations=voicetools_get_voiceboard_Informations($params["resource_id"]);
if($currentBoard->error==true){
$xml->setError(get_string('problem_bd','voicetools'));
echo $xml->getXml();
@@ -111,6 +102,6 @@
}
- echo $display;
- ?>
+echo $display;
+?>
Modified: branches/team/Thomas/moodle/mod/voicetools/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/index.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/index.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -29,18 +29,15 @@
/* $Id: index.php 52852 2007-08-24 17:50:59Z thomasr $ */
/// This page lists all the instances of voicetools in a particular course
-
+error_reporting(E_ERROR);
require_once("../../config.php");
require_once("lib.php");
require_once("lib/php/common/WimbaLib.php");
-$id = optional_param('id', 0, PARAM_INT); // course
-$course = optional_param('course', 0, PARAM_INT);
-$type = optional_param('type');
+$course_id = optional_param('id', 0, PARAM_INT); // course
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
-
-
-if (! $course = get_record("course", "id", $id)) {
+if (! $course = get_record("course", "id", $course_id)) {
error("Course ID is incorrect");
}
@@ -48,22 +45,15 @@
add_to_log($course->id, "voicetool", "view all", "index.php?id=$course->id", "");
-
-$id = optional_param('id', 0, PARAM_INT);
-if (! $course = get_record("course", "id", $id)) {
- error("Course ID is incorrect");
-}
-require_login($course->id);
$strvoicetools = get_string("modulenameplural", "voicetools");
$strvoicetool = get_string("modulename", "voicetools");
$navigation = array();
- if ($course->id != SITEID) {
+if ($course->id != SITEID) {
$navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id";
}
$navigation[$strvoicetools] = "";
-
$urls = array();
foreach($navigation as $text => $href) {
if (empty($href)) {
@@ -75,45 +65,25 @@
$breadcrumb = implode(' -> ', $urls);
print_header("$course->shortname", "$course->fullname",
-"$breadcrumb",
-"", "", true, "",
-"");
-$url = get_url_params($course->id);
+ "$breadcrumb","", "",true,"","");
+$url_params = get_url_params($course->id);
-if(isset($_GET["createWorkflow"]) && $_GET["createWorkflow"]==true)
- $novoicetools="&createWorkflow=true&type=".$type;
-else
- $novoicetools="";
-?>
+//create the url which all the parameters needed
+$url="welcome.php?id=".$course->id."&".$url_params."&time=".time()."&createWorkflow=".$createWorkflow;
- <head>
-
-
- </head>
-<br>
+?>
+<br>
<body>
-<br>
-
-
-<div align="center">
- <table height="95%">
- <iframe src="welcome.php?id=<?php echo $id; ?>&<?php echo $url; ?>&time=<?php echo time() ?><?php echo $novoicetools ?>" width="705px" height="405px" name="frameWidget" style="overflow:hidden;" FRAMEBORDER=0 align="middle">
- <p>Sorry your navigator can't display this iframe
-
- </iframe>
-</table>
-</div>
-
+ <div align="center">
+ <table height="95%">
+ <iframe src="<?=$url?>" width="705px" height="405px" name="frameWidget" style="overflow:hidden;" FRAMEBORDER=0>
+ <p>Sorry your navigator can't display this iframe
+ </iframe>
+ </table>
+ </div>
</body>
-
-
-
-
-
-
<?php
-/// Finish the page
-
+/// Finish the page
print_footer($course);
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/manageAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -38,50 +38,38 @@
require_once ("lib/php/common/WimbaCommons.php");
require_once ('lib/php/vt/WimbaVoicetools.php');
require_once ('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once ('lib/php/vt/VtAction.php');
global $CFG;
-$list_attributes = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $list_attributes[$key] = $val;
- }
-
+$messageProduct=optional_param("messageProduct","");
+$messageAction=optional_param("messageAction","");
+$notool=optional_param("novoicetools","false");
+$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaVoiceForm());
+foreach($keys as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $list_attributes[$key] = $val;
- }
-
-}
+require_login($params["enc_course_id"]);
+$vtAction = new vtAction($params);
-$vtAction = new vtAction($list_attributes);
-
-$session = new WimbaMoodleSession($list_attributes);
-
+$session = new WimbaMoodleSession($params);
$messageType = "";
if ($session->error == false && $session != NULL) {
- if (isset ($list_attributes["novoicetools"]) && $list_attributes["novoicetools"] == "true")
- $notool = "true";
- else
- $notool = "false";
- //if(isteacher($session->getCourseId())) {
- if ($_GET['action'] == 'launch') {
- $session->setCurrentVtUSer($list_attributes["type"]);
- if ($_GET["studentView"] == "true") {
- $session->setVtUserRigths($list_attributes["type"], "student");
+
+ if ($params['action'] == 'launch') {
+ $session->setCurrentVtUSer($params["type"]);
+ if ($params["studentView"] == "true") {
+ $session->setVtUserRigths($params["type"], "student");
}
- $resource = voicetools_api_get_resource($list_attributes["id"]);
-
-
+ $resource = voicetools_api_get_resource($params["resource_id"]);
$result = $vtAction->getVtSession($resource, $session->getVtUser(), $session->getVtUserRigths());
-
-
if ($result != NULL) {
- header('Location:' . $CFG->voicetools_servername . '/' . $list_attributes["type"] . '?action=display_popup&nid=' . $result->getNid());
+ header('Location:' . $CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid());
}
else {
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_vt');
@@ -89,30 +77,30 @@
exit ();
}
- elseif ($list_attributes['action'] == 'create') {
- if ($list_attributes['type'] == "board") {
+ elseif ($params['action'] == 'create') {
+ if ($params['type'] == "board") {
$result = $vtAction->createBoard(); //create the resource on the vt
$messageAction = "created";
$messageProduct = "board";
}
- elseif ($list_attributes['type'] == "presentation") {
+ elseif ($params['type'] == "presentation") {
$result = $vtAction->createPresentation();
$messageAction = "created";
$messageProduct = "presentation";
}
- elseif ($list_attributes['type'] == "pc") {
+ elseif ($params['type'] == "pc") {
$result = $vtAction->createPodcaster();
$messageAction = "created";
$messageProduct = "pc";
}
-
+
if ($result != NULL && $result->error != "error") {
- $resourceId = storeResource($result->getRid(), $session->getCourseId(), $list_attributes['type'],$list_attributes["longname"], $list_attributes);
+ $params["resource_id"] = storeResource($result->getRid(), $session->getCourseId(), $params['type'],$params["longname"], $params);
- if (empty ($resourceId)) {
+ if (empty ($params["resource_id"])) {
error_log(__FUNCTION__ . " : Problem to add the new resource on the database", TRUE);
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_bd');
@@ -131,22 +119,22 @@
exit ();
}
}
- elseif ($list_attributes['action'] == 'update') {
- if ($list_attributes['type'] == "board") {
+ elseif ($params['action'] == 'update') {
+ if ($params['type'] == "board") {
- $result = $vtAction->modifyBoard($list_attributes["id"]); //create the resource on the vt
+ $result = $vtAction->modifyBoard($params["resource_id"]); //create the resource on the vt
$messageAction = "updated";
$messageProduct = "board";
}
- elseif ($list_attributes['type'] == "presentation") {
+ elseif ($params['type'] == "presentation") {
- $result = $vtAction->modifyPresentation($list_attributes["id"]);
+ $result = $vtAction->modifyPresentation($params["resource_id"]);
$messageAction = "updated";
$messageProduct = "presentation";
}
- elseif ($list_attributes['type'] == "pc") {
+ elseif ($params['type'] == "pc") {
- $result = $vtAction->modifyPodcaster($list_attributes["id"]);
+ $result = $vtAction->modifyPodcaster($params["resource_id"]);
$messageAction = "updated";
$messageProduct = "pc";
}
@@ -155,9 +143,9 @@
//create the object to store in the db
- $resourceId = updateResource($result->getRid(), $session->getCourseId(), $list_attributes['type'], $list_attributes, $list_attributes["id"]);
+ $params["resource_id"] = updateResource($result->getRid(), $session->getCourseId(), $param['type'], $param, $params["resource_id"]);
- if (empty ($resourceId)) {
+ if (empty ($params["resource_id"])) {
error_log(__FUNCTION__ . " : Problem to update the resource on the database", TRUE);
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_bd');
@@ -174,23 +162,23 @@
}
- elseif ($list_attributes['action'] == 'delete') {
+ elseif ($params['action'] == 'delete') {
- $result = $vtAction->deleteRessource($list_attributes["id"]);
+ $result = $vtAction->deleteRessource($params["resource_id"]);
if ($result != NULL && $result->error != "error") { //if no error during the creation
- if (! voicetools_delete_all_instance_of_resource($list_attributes["id"])) {
- notify("Could not delete the activities for the vocietools:". $list_attributes["id"]);
+ if (! voicetools_delete_all_instance_of_resource($params["resource_id"])) {
+ notify("Could not delete the activities for the vocietools:". $params["resource_id"]);
}
- $messageType = 'delete' . $list_attributes["type"];
- $messageAction = "deleted";
+ $messageType = 'delete' . $param["type"];
+ $messageAction = "deleted";
$messageProduct = $_GET["type"];
}
}
- if (isset ($list_attributes["createWorkflow"]) && $list_attributes["createWorkflow"] == "true") {
+ if (isset ($param["createWorkflow"]) && $param["createWorkflow"] == "true") {
if(!isset($result) )
$rid="";
Modified: branches/team/Thomas/moodle/mod/voicetools/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-22 22:59:37 UTC (rev 230)
@@ -294,7 +294,7 @@
if(document.getElementById("description")!=null)
createCookie("description_disabled",document.getElementById("description").disabled);
- location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>&createWorkflow=true&type=";
+ location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>&createWorkflow=true";
}
function hideCalendarEvent(value){
@@ -432,7 +432,7 @@
<table cellspacing="0" cellpadding="0" width=700px align=center>
<tr>
<td class="headerBarLeft" align="left">
- <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/items/headerbar-logo.png">
+ <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/headerbar-logo.png">
</td>
<td align="right" class="headerBarRight">
@@ -503,7 +503,7 @@
<tr valign="top">
<td align="right"><font color="red">*</font><font class="fontCurrent"><?php print_string('voicetoolstype', 'voicetools')?></font></td>
- <td align="left"><select id="resource" name="resource" onclick="javascript:LaunchCreateWorkflowBySelect()">
+ <td align="left"><select id="resource" name="resource">
<option value="empty">
Select...
</option>
@@ -745,7 +745,7 @@
<div align=center width=700px>
<table width=700px cellpadding="5" align=center >
<tr style="border-top:1px solid; background-color:#F0F0F0;">
- <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/items/listitem-voicetoolsicon.gif" ><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>">
+ <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/listitem-voicetoolsicon.gif" ><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>">
<?php print_string('activity_manageTools', 'voicetools')?></a>
</td>
Modified: branches/team/Thomas/moodle/mod/voicetools/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/view.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/view.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -30,7 +30,7 @@
/// This page prints a particular instance of voicedirect
/// (Replace voicedirect with the name of your module)
-error_reporting(E_ERROR^E_NOTICE);
+error_reporting(E_ERROR);
require_once('../../config.php');
require_once('lib.php');
@@ -38,7 +38,8 @@
require_once('lib/php/vt/WimbaVoicetools.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
require_once('lib/php/common/WimbaCommons.php');
-global $CFG;
+require_once('lib/php/vt/vtAction.php');
+
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
if ((isset($_GET["action"]) && $_GET["action"]!="launchCalendar" ) && $id || !isset($_GET["action"]) ) {
@@ -71,8 +72,7 @@
add_to_log($course->id, "voicetools", "view", "view.php?id=$cm->id", "$voicetool->id");
$session=new WimbaMoodleSession(NULL);
-
-
+
//check the availability of the resource
$vt_informations=voicetools_get_voicetool_informations($voicetool->rid);
if($vt_informations !=null && $vt_informations->availability=="0"){
@@ -110,6 +110,10 @@
$vtAction=new vtAction(NULL);
$session->setCurrentVtUSer($resource->getType(),$USER->firstname."_".$USER->lastname,$USER->email,$role);
+
+//use a vt user
+
+
$vtSession=$vtAction->getVtSession($resource,$session->getVtUser(),$session->getVtUserRigths()) ;
@@ -157,128 +161,53 @@
}
- function startVoiceBoard(){
- <?
- if(isset($roleSwitch) && $roleSwitch==true) {
- ?>
- result=window.confirm("<?php echo get_string ('launchstudent', 'voicetools');?>");
- if(result==true) {
- doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
-
- }
- else
- {
- location.href= document.referrer;
- }
-
- <?}else{
-
- ?>
- doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
-
- <?}?>
- }
+function startVoiceBoard(){
+ <?
+ if(isset($roleSwitch) && $roleSwitch==true) {
+ ?>
+ result=window.confirm("<?php echo get_string ('launchstudent', 'voicetools');?>");
+ if(result==true) {
+ doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
+
+ }
+ else
+ {
+ location.href= document.referrer;
+ }
+
+ <?}else{
+ ?>
+ doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
+ <?}?>
+}
</script>
-
+<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/voicetools/css/StyleSheet.css"" type="text/css" />
<style>
-
-
-a.list
-{
-
- font-family:Verdana;
- font-size:10px;
- color : #0000FF ;
- text-decoration : underline ;
+body{
+ font-size:14px;
}
-a.list:hover
-{
- color : #0000FF ;
- text-decoration : none ;
-}
-a.list:visited
-{
- color : #0000FF ;
- text-decoration : underline ;
-}
-a.list:active
-{
- color : #0000FF ;
- text-decoration : none ;
-}
-/*headerBar*/
-#headerBar table
-{
- width: 100%;
- background:white url( "<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
-
- height: 32px;
- border-bottom: solid 1px Black;
-}
-
-
-.headerBarRight
-{
- padding-right:10px;
-}
-.headerBarLeft
-{
- padding-left:10px;
-}
-
-/*contextBar*/
-
-
-#contextBar table
-{
- background-image: url( "<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/backgrounds/toolbar.png" );
- height: 30px;
- width: 100%;
- border-bottom: solid 1px #C7D3E1;
-}
-
-
-.contextBarRight
-{
- margin-left:20px;
- font-family: Verdana;
-
- font-size: 12px;
-}
-.contextBarLeft
-{
- margin-left:20px;
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
-}
-
-.roomNameForSettings
-{
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
-}
.middle_panel{
height:315px;
-
+
}
html>body .middle_panel{
- height:312px;
-
+ height:312px;
+
}
+
</style>
+
<div style="border:solid 1px #808080;width:700px;height:400px;margin-left:20%;margin-top:5%">
<div class="headerBar" id="headerBar">
<table cellpadding="0" cellspacing="0" width=100%>
<tbody>
<tr>
<td align=left>
- <img src="pictures/items/headerbar-logo.png" height="32" width="80">
+ <img src="lib/web/pictures/items/headerbar-logo.png" height="32" width="80">
</td>
</tr>
</tbody>
@@ -310,18 +239,17 @@
<tr valign=middle align=center>
<td>
<?php if($preview==false){
-
- echo get_string ('activity_tools_not_available', 'voicetools');
-
+ echo get_string ('activity_tools_not_available', 'voicetools');
}else{
- ?>
- <script>
- startVoiceBoard();</script>
- <?php echo get_string ('vtpopupshouldappear.1', 'voicetools');?>
- <a href="javascript:startVoiceBoard ('<?php echo "$CFG->wwwroot/course/view.php?id=$course->id" ?>');">
- <?php echo get_string ('vtpopupshouldappear.2', 'voicetools');?>
- </a>
- <?php echo get_string ('vtpopupshouldappear.3', 'voicetools');?>
+ ?>
+ <script>
+ startVoiceBoard();
+ </script>
+ <?php echo get_string ('vtpopupshouldappear.1', 'voicetools');?>
+ <a href="javascript:startVoiceBoard ('<?php echo "$CFG->wwwroot/course/view.php?id=$course->id" ?>');">
+ <?php echo get_string ('vtpopupshouldappear.2', 'voicetools');?>
+ </a>
+ <?php echo get_string ('vtpopupshouldappear.3', 'voicetools');?>
<?php }?>
</td>
</tr>
@@ -329,27 +257,23 @@
</table>
</div>
<div>
- <table width=100% >
-
- <tr style="border-top:1px solid; background-color:#F0F0F0;">
- <td align=left >
- <img src="<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/items/listitem-voicetoolsicon.gif" /><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $cm->course;?>"><?php
- if($role=="Instructor")
- print_string('activity_manageTools', 'voicetools');
- else
- echo "Voice Tools";
-
- ?></a>
-
- </td>
- </td>
-
+ <table width=100% >
+ <tr style="border-top:1px solid; background-color:#F0F0F0;">
+ <td align=left >
+ <img src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/listitem-voicetoolsicon.gif" />
+ <a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $cm->course;?>"><?php
+ if($role=="Instructor")
+ print_string('activity_manageTools', 'voicetools');
+ else
+ echo "Voice Tools";
+
+ ?></a>
+ </td>
+ <tr>
</table>
</div>
-</div>
-
-
- <?php
+</div>
+<?php
/// Finish the page
print_footer($course);
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/welcome.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/welcome.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -31,6 +31,8 @@
/// This page creates a link between the CMS and the component
error_reporting(E_ERROR);
+require_once("../../config.php");
+require_once("lib.php");
?>
<html>
<head>
@@ -47,9 +49,7 @@
<script src="lib/web/js/ajaxslt/dom.js" type="text/javascript"></script>
<script src="lib/web/js/ajaxslt/xpath.js" type="text/javascript"></script>
<script src="lib/web/js/hwCommons.js" type="text/javascript"></script>
- <script src="lib/web/js/xmldom.js" type="text/javascript"></script>
-
-
+<script src="lib/web/js/xmldom.js" type="text/javascript"></script>
<script type="text/javascript">
function doOpenAddActivity(url,param){
@@ -68,79 +68,57 @@
}
initPath('lib/web/js/xsl/wimba.xsl','lib/web/pictures');
</script>
+</head>
<?php
-if(isset($_GET["createWorkflow"]) && $_GET["type"]!=""){
- $firstPage= "getXmlNewPanel.php";
- $createWorkflow="true";
- ?>
- <script>
- typeSelect="<?php echo $_GET["type"]?>"
- </script>
- <?php
-
-
-}else if(isset($_GET["createWorkflow"]) && $_GET["type"]==""){
- $createWorkflow="true";
- $firstPage= "getXmlChoicePage.php";
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+if($createWorkflow==true)
+{
+ $firstPage= "getXmlChoicePage.php";
}
-else{
- $firstPage="getXmlListPanel.php";
- $createWorkflow="false";
-
+else
+{
+ $firstPage= "getXmlListPanel.php";
}
-
-
-
-?>
-<body id="body" onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ?>','all','','','<?php echo $createWorkflow;?>');" onkeypress="removeEnterKeyPress()">
-
-<div id="all" style="display:block;overflow:hidden;border:solid 1px #808080;width:700px;height:400px;"></div>
-
-<div id="loading" style="display:none;border:solid 1px #808080;width:700px;height:400px">
- <div class="headerBar" id="headerBar">
- <table cellpadding="0" cellspacing="0" width=100%>
- <tbody>
- <tr>
- <td align=left>
- <img src="pictures/items/headerbar-logo.png" height="32" width="80">
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="contextBar" id="contextBar">
- <table>
- <tbody>
- <tr>
- <td></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div >
- <table width=100% style="height:300px">
- <tbody>
- <tr valign=middle>
- <td align=center><img src="pictures/items/wheel.gif"><br>
- <p><font size="-2" face="Verdana" color="666666"> Loading...</font></p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-
-</div>
-<div class='toolTip' id='Tip'>ToolTip</div>
-
-<div style="display:none" id="pictures" >picture</div>
+?>
+
+<body id="body" onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ?>','all','','','<?php echo $createWorkflow;?>');" onkeypress="removeEnterKeyPress()">
+ <div id="all" style="display:block;overflow:hidden;border:solid 1px #808080;width:700px;height:400px;"></div>
+ <div id="loading" style="display:none;border:solid 1px #808080;width:700px;height:400px">
+ <div class="headerBar" id="headerBar">
+ <table cellpadding="0" cellspacing="0" width=100%>
+ <tbody>
+ <tr>
+ <td align=left>
+ <img src="lib/web/pictures/items/headerbar-logo.png" height="32" width="80">
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="contextBar" id="contextBar">
+ <table>
+ <tbody>
+ <tr>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div >
+ <table width=100% style="height:300px">
+ <tbody>
+ <tr valign=middle>
+ <td align=center><img src="lib/web/pictures/items/wheel.gif"><br>
+ <p><font size="-2" face="Verdana" color="666666"> Loading...</font></p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+ </div>
+ <div class='toolTip' id='Tip'>ToolTip</div>
+ <div style="display:none" id="pictures" >picture</div>
</body>
</html>
-
-
-
-<script>
-
-
-
-</script>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-18 21:50:12
|
Revision: 229
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=229&view=rev
Author: trollinger
Date: 2008-01-18 13:50:05 -0800 (Fri, 18 Jan 2008)
Log Message:
-----------
update the path of the files due to the new structure
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
branches/team/Thomas/moodle/mod/voicetools/index.php
branches/team/Thomas/moodle/mod/voicetools/lib.php
branches/team/Thomas/moodle/mod/voicetools/manageAction.php
branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php
branches/team/Thomas/moodle/mod/voicetools/mod.html
branches/team/Thomas/moodle/mod/voicetools/version.php
branches/team/Thomas/moodle/mod/voicetools/view.php
branches/team/Thomas/moodle/mod/voicetools/voicerecorder.php
branches/team/Thomas/moodle/mod/voicetools/welcome.php
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -32,10 +32,10 @@
require_once("../../config.php");
// require_once("lib.php");
-require_once("lib/common/WimbaXml.php");
-require_once("lib/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaXml.php");
+require_once("lib/php/common/WimbaCommons.php");
if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/common/domxml-php4-php5.php');
+ require_once('lib/php/common/domxml-php4-php5.php');
}
// Variables needed
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -34,12 +34,12 @@
require_once("../../config.php");
require_once("lib.php");
-require_once("lib/common/WimbaXml.php");
-require_once("lib/common/WimbaCommons.php");
-require_once("lib/common/WimbaUI.php");
-require_once("lib/common/XmlResource.php");
-require_once('lib/vt/WimbaVoicetools.php');
-require_once('lib/vt/WimbaVoicetoolsAPI.php');
+require_once("lib/php/common/WimbaXml.php");
+require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaUI.php");
+require_once("lib/php/common/XmlResource.php");
+require_once('lib/php/vt/WimbaVoicetools.php');
+require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
set_time_limit(30);
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -30,21 +30,21 @@
/* $Id: getXmlNewPanel.php 52710 2007-08-20 19:54:04Z thomasr $ */
/// This page is to generate the list of VT
-error_reporting(E_ERROR);
+
global $CFG;
require_once("../../config.php");
require_once("lib.php");
-require_once("lib/vt/WimbaVoicetoolsAPI.php");
-require_once("lib/vt/WimbaVoicetools.php");
-require_once("lib/common/WimbaCommons.php");
-require_once("lib/common/WimbaXml.php");
-require_once("lib/common/WimbaUI.php");
+require_once("lib/php/vt/WimbaVoicetoolsAPI.php");
+require_once("lib/php/vt/WimbaVoicetools.php");
+require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaXml.php");
+require_once("lib/php/common/WimbaUI.php");
set_time_limit(30);
if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/common/domxml-php4-php5.php');
+ require_once('lib/php/common/domxml-php4-php5.php');
}
Modified: branches/team/Thomas/moodle/mod/voicetools/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/index.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/index.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -32,6 +32,7 @@
require_once("../../config.php");
require_once("lib.php");
+require_once("lib/php/common/WimbaLib.php");
$id = optional_param('id', 0, PARAM_INT); // course
$course = optional_param('course', 0, PARAM_INT);
Modified: branches/team/Thomas/moodle/mod/voicetools/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/lib.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/lib.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -31,8 +31,8 @@
error_reporting(0);
require_once($CFG->libdir.'/datalib.php');
require_once($CFG->dirroot.'/course/lib.php');
-require_once('lib/vt/WimbaVoicetoolsAPI.php');
-require_once('lib/common/WimbaCommons.php');
+require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once('lib/php/common/WimbaCommons.php');
define("VOICETOOLS_MODULE_VERSION", "3.1.2");
$VOICETOOLS_LOGS = "logs.php"; //file use to the logs
Modified: branches/team/Thomas/moodle/mod/voicetools/manageAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -34,10 +34,10 @@
error_reporting(E_ERROR);
require_once ('../../config.php');
require_once ('lib.php');
-
-require_once ("lib/common/WimbaCommons.php");
-require_once ('lib/vt/WimbaVoicetools.php');
-require_once ('lib/vt/WimbaVoicetoolsAPI.php');
+require_once ("lib/php/common/WimbaLib.php");
+require_once ("lib/php/common/WimbaCommons.php");
+require_once ('lib/php/vt/WimbaVoicetools.php');
+require_once ('lib/php/vt/WimbaVoicetoolsAPI.php');
global $CFG;
$list_attributes = array ();
Modified: branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/manageActionBlock.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -33,9 +33,9 @@
require_once('lib.php');
-require_once("lib/common/WimbaCommons.php");
-require_once('lib/vt/WimbaVoicetools.php');
-require_once('lib/vt/WimbaVoicetoolsAPI.php');
+require_once("lib/php/common/WimbaCommons.php");
+require_once('lib/php/vt/WimbaVoicetools.php');
+require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
global $CFG;
Modified: branches/team/Thomas/moodle/mod/voicetools/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-18 21:50:05 UTC (rev 229)
@@ -30,162 +30,91 @@
/* $Id: mod.html 200 2008-01-09 11:37:50Z trollinger $ */
error_reporting(E_ERROR);
-require_once('lib/vt/WimbaVoicetoolsAPI.php');
-require_once('lib/vt/WimbaVoicetools.php');
+require_once("../config.php");
+require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once('lib/php/vt/WimbaVoicetools.php');
+require_once('lib/php/common/WimbaLib.php');
require_once($CFG->dirroot.'/calendar/lib.php');
require_once($CFG->dirroot.'/mod/voicetools/lib.php');
-require_once("../config.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);
/// 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 (! $cmVT = get_record("course_modules", "id", $update)) {
return false;
}
$activity = get_record("voicetools", "id", $cmVT->instance );
+
$sectionId=$activity->section;
$action = "update";
- $id=$cmVT->course;
+ $id=$cmVT->course;//get the id of the course
- $event=voicetools_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);
- }
- $name="";
- if(isset($action) && $action=="update") {
- $completeName=explode(" - ", $activity->name);
- $name=$completeName[1];
+ $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,222 +133,35 @@
if ($hiddensection) {
$visible = false;
}
-
-
?>
+<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/voicetools/pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
-
- height: 32px;
- border-bottom: solid 1px Black;
+body{
+ font-size:14px;
}
-
-
-/*contextBar*/
-#contextBar table
-{
- background-image: url( "<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/backgrounds/toolbar.png" );
- height: 30px;
- width: 700px;
- border-bottom: solid 1px #C7D3E1;
-}
-
-
-.contextBarRight
-{
- padding-left:10px;
- 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 ;
+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;
+
+
}
-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/voicetools/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/voicetools/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/voicetools/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;
-}
-td.action, input.action
-{
- background-image: url("<?php echo $CFG->wwwroot;?>/mod/voicetools/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/voicetools/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">
@@ -476,7 +218,9 @@
<?php
$listTools = voicetools_get_voicetools_list($course->id);
if($listTools==NULL) { //no voice tools available
- ?>
+ ?>
+
+
document.getElementById("hiddenDiv").style.height=document.documentElement.clientHeight
document.getElementById("hiddenDiv").style.width=document.documentElement.clientWidth
document.getElementById("popup").style.display="block";
@@ -484,6 +228,7 @@
<?php
}
?>
+
}
function popupCancel(){
@@ -732,16 +477,7 @@
<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>';
- }
- }
+ echo getListOfWeeks($course,$sectionId);
?>
</select>
</td>
@@ -757,32 +493,7 @@
<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++;
- }
+ echo getListOfTopics($course,$sectionId);
?>
</select>
</td>
Modified: branches/team/Thomas/moodle/mod/voicetools/version.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/version.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/version.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -33,7 +33,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006041500; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2009010100; // The current module version (Date: YYYYMMDDXX)
$module->cron = 0; // Period for cron to check this module (secs)
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/view.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/view.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -32,10 +32,12 @@
/// (Replace voicedirect with the name of your module)
error_reporting(E_ERROR^E_NOTICE);
require_once('../../config.php');
-require_once('lib.php');
-require_once('lib/vt/WimbaVoicetools.php');
-require_once('lib/vt/WimbaVoicetoolsAPI.php');
-require_once('lib/common/WimbaCommons.php');
+require_once('lib.php');
+
+require_once ("lib/php/common/WimbaLib.php");
+require_once('lib/php/vt/WimbaVoicetools.php');
+require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once('lib/php/common/WimbaCommons.php');
global $CFG;
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
Modified: branches/team/Thomas/moodle/mod/voicetools/voicerecorder.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/voicerecorder.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/voicerecorder.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -33,15 +33,15 @@
<head id="Head1">
<title>Recorder</title>
-<script language="javascript" src="js/dojo/dojo.js"></script>
-<script language="javascript" src="js/ajax.js"></script>
-<script language="javascript" src="js/constants.js"></script>
-<script language="javascript" src="js/pngfix.js"></script>
+<script language="javascript" src="lib/web/js/dojo/dojo.js"></script>
+<script language="javascript" src="lib/web/js/ajax.js"></script>
+<script language="javascript" src="lib/web/js/constants.js"></script>
+<script language="javascript" src="lib/web/js/pngfix.js"></script>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
- <script language="javascript" src="js/xmldom.js"></script>
+ <script language="javascript" src="lib/web/js/xmldom.js"></script>
@@ -52,8 +52,8 @@
require_once("../../config.php");
require_once("lib.php");
- require_once('lib/vt/WimbaVoicetools.php');
- require_once('lib/vt/WimbaVoicetoolsAPI.php');
+ require_once('lib/php/vt/WimbaVoicetools.php');
+ require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
global $CFG;
$vtAction=new vtAction(null);
Modified: branches/team/Thomas/moodle/mod/voicetools/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/welcome.php 2008-01-17 21:18:29 UTC (rev 228)
+++ branches/team/Thomas/moodle/mod/voicetools/welcome.php 2008-01-18 21:50:05 UTC (rev 229)
@@ -36,18 +36,18 @@
<head>
<title>Voice Tools</title>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
-<script language="javascript" src="js/dojo/dojo.js"></script>
-<script language="javascript" src="js/ajax.js"></script>
-<script language="javascript" src="js/verifForm.js"></script>
-<script language="javascript" src="js/constants.js"></script>
-<script type="text/javascript" src="js/ajaxslt/xslt.js"></script>
-<script type="text/javascript" src="js/pngfix.js"></script>
-<script src="js/ajaxslt/util.js" type="text/javascript"></script>
-<script src="js/ajaxslt/xmltoken.js" type="text/javascript"></script>
-<script src="js/ajaxslt/dom.js" type="text/javascript"></script>
-<script src="js/ajaxslt/xpath.js" type="text/javascript"></script>
-<script src="js/hwCommons.js" type="text/javascript"></script>
- <script src="js/xmldom.js" type="text/javascript"></script>
+<script language="javascript" src="lib/web/js/dojo/dojo.js"></script>
+<script language="javascript" src="lib/web/js/ajax.js"></script>
+<script language="javascript" src="lib/web/js/verifForm.js"></script>
+<script language="javascript" src="lib/web/js/constants.js"></script>
+<script type="text/javascript" src="lib/web/js/ajaxslt/xslt.js"></script>
+<script type="text/javascript" src="lib/web/js/pngfix.js"></script>
+<script src="lib/web/js/ajaxslt/util.js" type="text/javascript"></script>
+<script src="lib/web/js/ajaxslt/xmltoken.js" type="text/javascript"></script>
+<script src="lib/web/js/ajaxslt/dom.js" type="text/javascript"></script>
+<script src="lib/web/js/ajaxslt/xpath.js" type="text/javascript"></script>
+<script src="lib/web/js/hwCommons.js" type="text/javascript"></script>
+ <script src="lib/web/js/xmldom.js" type="text/javascript"></script>
<script type="text/javascript">
@@ -66,7 +66,7 @@
display+= "<td width='130'></td>";
return display;
}
-
+initPath('lib/web/js/xsl/wimba.xsl','lib/web/pictures');
</script>
<?php
if(isset($_GET["createWorkflow"]) && $_GET["type"]!=""){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-17 21:18:31
|
Revision: 228
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=228&view=rev
Author: trollinger
Date: 2008-01-17 13:18:29 -0800 (Thu, 17 Jan 2008)
Log Message:
-----------
the path of the pictures and the xsl is not static anymore
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/web/js/ajax.js
branches/team/Thomas/integrations_common/web/js/constants.js
branches/team/Thomas/integrations_common/web/js/hwCommons.js
branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl
Removed Paths:
-------------
branches/team/Thomas/integrations_common/web/js/manageXml.js
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-17 21:12:04 UTC (rev 227)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-17 21:18:29 UTC (rev 228)
@@ -94,25 +94,25 @@
HEADER
*********/
if($this->session->isInstructor()){
- $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "true");
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "true");
}else{
- $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "false");
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "false");
}
/********
MENU
*********/
- $this->xml->addButtonElement("all", "all", "disabled", "pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'liveclassroom'), "javascript:LaunchElement('doAction.php','liveclassroom');");
+ $this->xml->addButtonElement("all", "all", "disabled", "lib/web/pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'liveclassroom'), "javascript:LaunchElement('doAction.php','liveclassroom');");
if($this->session->isInstructor()){
- $this->xml->addButtonElement("instructor", "all", "disabled", 'pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'liveclassroom'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=liveclassroom')");
+ $this->xml->addButtonElement("instructor", "all", "disabled", 'lib/web/pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'liveclassroom'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=liveclassroom')");
- $this->xml->addButtonElement("instructor", "all", "enabled", "pictures/buttons/toolbar-new", get_string('toolbar_new', 'liveclassroom'), "javascript:loadNewSettings('generateSettings.php','create','liveclassroom' ,'liveclassroom','all')");
+ $this->xml->addButtonElement("instructor", "all", "enabled", "lib/web/pictures/buttons/toolbar-new", get_string('toolbar_new', 'liveclassroom'), "javascript:loadNewSettings('generateSettings.php','create','liveclassroom' ,'liveclassroom','all')");
$this->xml->addSpaceElement("20px", "instructor");
- $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-content", get_string('toolbar_content', 'liveclassroom'), "javascript:openContent('doAction.php');");
- $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-poll", get_string('toolbar_reports', 'liveclassroom'), "javascript:openReport('doAction.php');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-content", get_string('toolbar_content', 'liveclassroom'), "javascript:openContent('doAction.php');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-poll", get_string('toolbar_reports', 'liveclassroom'), "javascript:openReport('doAction.php');");
$this->xml->addSpaceElement("10px", "instructor");
- $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'liveclassroom'), "javascript:editSettings('generateSettings.php','all');");
- $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'liveclassroom'), "javascript:deleteResource('doAction.php');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'liveclassroom'), "javascript:editSettings('generateSettings.php','all');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'liveclassroom'), "javascript:deleteResource('doAction.php');");
$this->xml->addSpaceElement("50px", "instructor");
}else{
$this->xml->addSpaceElement("300px", "instructor");
@@ -157,21 +157,21 @@
HEADER
*********/
if($this->session->isInstructor()){
- $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "true");
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "true");
}else{
- $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "false");
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "false");
}
/********
MENU
*********/
- $this->xml->addButtonElement("all", "all", "disabled", "pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'voicetools'), "javascript:LaunchElement('manageAction.php','voicetools');");
+ $this->xml->addButtonElement("all", "all", "disabled", "lib/web/pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'voicetools'), "javascript:LaunchElement('manageAction.php','voicetools');");
if($this->session->isInstructor()){
- $this->xml->addButtonElement("instructor", "all", "disabled", 'pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'voicetools'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=voicetools')");
- $this->xml->addButtonElement("instructor", "all", "enabled", "pictures/buttons/toolbar-new", get_string('toolbar_new', 'voicetools'), "javascript:launchAjaxRequest('getXmlChoicePage.php','create' ,'true','all')");
+ $this->xml->addButtonElement("instructor", "all", "disabled", 'lib/web/pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'voicetools'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=voicetools')");
+ $this->xml->addButtonElement("instructor", "all", "enabled", "lib/web/pictures/buttons/toolbar-new", get_string('toolbar_new', 'voicetools'), "javascript:launchAjaxRequest('getXmlChoicePage.php','create' ,'true','all')");
$this->xml->addSpaceElement("150px", "instructor");
- $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'voicetools'), "javascript:editSettings('getXmlNewPanel.php','all');");
- $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'voicetools'), "javascript:deleteResource('manageAction.php');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'voicetools'), "javascript:editSettings('getXmlNewPanel.php','all');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'voicetools'), "javascript:deleteResource('manageAction.php');");
$this->xml->addSpaceElement("50px", "instructor");
}else{
$this->xml->addSpaceElement("300px", "instructor");
@@ -281,7 +281,7 @@
/********
HEADER
*********/
- $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true");
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
if($update=="update"){
@@ -320,7 +320,7 @@
}
function getVTSettingsView($update, $createWorkflow) {
- //list_dir("pictures",$pictures);//list the directory
+ //list_dir("lib/web/pictures",$lib/web/pictures);//list the directory
/********
SESSION
*********/
@@ -328,7 +328,7 @@
/********
HEADER
*********/
- $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true");
+ $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
if($update=="update"){
$this->xml->addContextElement(get_string("contextbar_settings", "voicetools"), get_string("general_" . $this->product, "voicetools"), $this->currentObject->getTitle(), "");
Modified: branches/team/Thomas/integrations_common/web/js/ajax.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/ajax.js 2008-01-17 21:12:04 UTC (rev 227)
+++ branches/team/Thomas/integrations_common/web/js/ajax.js 2008-01-17 21:18:29 UTC (rev 228)
@@ -23,7 +23,12 @@
* *
******************************************************************************/
+function initPath(xsl,pictures){
+ pathXsl=xsl;
+ pathPictures=pictures;
+}
+
/*
* Get the parameters passed with the GET Method and put them into a
* javascript array
@@ -156,12 +161,12 @@
if (action != null) {
url += "?action=" + action;
}
-
-
- transform(url,"js/xsl/wimba.xsl","first",div,nextAction)
+ transform(url,"first",div,nextAction)
}
+
+
/*
* Create the context of the Ajax request and execute it
*
@@ -185,7 +190,8 @@
url += "&createWorkflow=" + createWorkflow;
}
isFilter = false;
- transform(url,"js/xsl/wimba.xsl","",div)
+
+ transform(url,"",div)
if (init == true) {
currentId = "";
@@ -215,7 +221,7 @@
xmlSource = dom;
if (xslData == null) { //get the stylesheet
dojo.io.bind({
- url:"js/xsl/wimba.xsl",
+ url:pathXsl,
mimetype:"application/xml",
load:function (type, data, evt) {
xslData = data;
@@ -264,7 +270,7 @@
* For Safari: we used he dojo framework to get the xml,xsl by Ajax and the google library
* (Google AJAXSLT) to execute the xslt transformation because it is not supported natively
*/
-function transform(urlXml, stylesheet,TypeParams, div,nextAction) {
+function transform(urlXml,TypeParams, div,nextAction) {
if(window.ActiveXObject){//ie
@@ -290,7 +296,7 @@
var xslDoc = new ActiveXObject("Microsoft.XMLDOM")
xslDoc.async = false
- xslDoc.load("js/xsl/wimba.xsl");
+ xslDoc.load(pathXsl);
xsltTransformation(sourceDoc,xslDoc,div,nextAction);
@@ -309,10 +315,11 @@
xmlSource = data;
//get the stylesheet
dojo.io.bind({
- url:stylesheet,
+ url:pathXsl,
mimetype:"application/xml",
load:function (type, data, evt) {
//do the xslt transformatio
+
xsltTransformation(xmlSource,data,div,nextAction)
},
@@ -339,7 +346,7 @@
xmlSource = dom;
dojo.io.bind({
- url:"js/xsl/wimba.xsl",
+ url:pathXsl,
mimetype:"application/xml",
load:function (type, data, evt) {
//do the xslt transformatio
@@ -386,6 +393,8 @@
}else if (window.XSLTProcessor){//firefox
var processor = new XSLTProcessor();
+ processor.setParameter(null, 'pathPictures', pathPictures);
+
processor.importStylesheet(xsl);
document.getElementById(div).innerHTML="";
var resultDocument = processor.transformToFragment(xml, document);
@@ -544,3 +553,5 @@
return params;
}
+
+
Modified: branches/team/Thomas/integrations_common/web/js/constants.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/constants.js 2008-01-17 21:12:04 UTC (rev 227)
+++ branches/team/Thomas/integrations_common/web/js/constants.js 2008-01-17 21:18:29 UTC (rev 228)
@@ -50,9 +50,9 @@
// xml
var objDom;
var objDomTree;
-var stylesheet="js/xsl/wimba.xsl";
+var xsl="";
+var pathPictures="";
-
var myDOM;
var xmlDoc;
var xslData=null;
Modified: branches/team/Thomas/integrations_common/web/js/hwCommons.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/hwCommons.js 2008-01-17 21:12:04 UTC (rev 227)
+++ branches/team/Thomas/integrations_common/web/js/hwCommons.js 2008-01-17 21:18:29 UTC (rev 228)
@@ -94,7 +94,7 @@
if(archiveMatched>0){//change the pciture
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, "pictures/items/listitem-show.png");
+ changePicture(pictureId, pathPictures+"listitem-show.png");
}
elements[roomLinked].setAttribute("stateSearch", "");//change the status of the element to manage the display
elements[roomLinked].style.display = display;
@@ -136,10 +136,10 @@
//management of the picture to expand the archives
if(archiveMatched>0){
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, "pictures/items/listitem-hide.png");
+ changePicture(pictureId, pathPictures+"listitem-hide.png");
}else{
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, "pictures/items/space-16px.png");
+ changePicture(pictureId, pathPictures+"space-16px.png");
}
}
} else {
@@ -160,7 +160,7 @@
elements[roomLinked].style.display = display;
elements[roomLinked].setAttribute("stateSearch", "");
var pictureId = elements[roomLinked].id + "_ExpandPicture";
- changePicture(pictureId, "pictures/items/listitem-hide.png");
+ changePicture(pictureId, pathPictures+"listitem-hide.png");
}else{
elements[roomLinked].style.display = "none";
elements[roomLinked].setAttribute("stateSearch", "ignore");
@@ -189,15 +189,15 @@
if (currentId != "" && currentId != id) {
document.getElementById(currentId).style.backgroundColor = "white";
if(document.getElementById(currentId).getAttribute("typeProduct")=="archive"){
- document.getElementById(currentId+"_archive_subitem").src="pictures/items/listitem-subitem.jpg";
- document.getElementById(currentId+"_archive_icon").src="pictures/items/listitem-archiveicon.jpg";
+ document.getElementById(currentId+"_archive_subitem").src=pathPictures+"listitem-subitem.jpg";
+ document.getElementById(currentId+"_archive_icon").src=pathPictures+"listitem-archiveicon.jpg";
}
}
if (lineCurrentId != id) {
document.getElementById(id).style.backgroundColor = "#c3dbf7";
if(type=="archive"){
- document.getElementById(id+"_archive_subitem").src="pictures/items/listitem-subitem-selected.jpg";
- document.getElementById(id+"_archive_icon").src="pictures/items/listitem-archiveicon-selected.jpg";
+ document.getElementById(id+"_archive_subitem").src=pathPictures+"listitem-subitem-selected.jpg";
+ document.getElementById(id+"_archive_icon").src=pathPictures+"listitem-archiveicon-selected.jpg";
}
}
@@ -234,13 +234,13 @@
}
}
if(archiveAvailable==true){
- changePicture(id + "_ExpandPicture", "pictures/items/listitem-hide.png");
+ changePicture(id + "_ExpandPicture", pathPictures+"listitem-hide.png");
div.style.height="";
document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='RemoveAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>Show Top 5...</label>";
expandState=1;
}
else{
- changePicture(id + "_ExpandPicture", "pictures/items/listitem-show.png");
+ changePicture(id + "_ExpandPicture", pathPictures+"listitem-show.png");
if(expandState!=1)
document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='displayAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>"+(listRoomsArchives.length-numHide-5)+" more...</label>";
else
@@ -345,7 +345,7 @@
elements[i].style.display = "none";
if(elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") == "archive"){//this room contains archives
document.getElementById(elements[linkedRoom].id + "_ExpandPicture").style.visibility="visible";
- changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), "pictures/items/listitem-show.png");
+ changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"listitem-show.png");
while (elements[i + 1].getAttribute("typeProduct") == "archive") {
elements[i + 1].className = "archiveHide";
elements[i + 1].setAttribute("stateStudentView", "ignore");
@@ -370,7 +370,7 @@
}
if(archiveMatched==0){//hide the element which allow the expand/collapse
document.getElementById(elements[linkedRoom].id + "_ExpandPicture").style.visibility="hidden";
- changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), "pictures/items/listitem-show.png");
+ changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"listitem-show.png");
}
}
@@ -387,7 +387,7 @@
elements[i].style.display = display;
if(elements[i+1]!=null && elements[i+1].getAttribute("typeProduct") == "archive"){
document.getElementById(elements[i].id + "_ExpandPicture").style.visibility="visible";
- changePicture(document.getElementById(elements[i].id + "_ExpandPicture"), "pictures/items/listitem-show.png");
+ changePicture(document.getElementById(elements[i].id + "_ExpandPicture"), pathPictures+"listitem-show.png");
}
} else {
@@ -480,19 +480,19 @@
if(document.getElementById("collapsePictureliveclassroom")) {
- changePicture("collapsePictureliveclassroom", "pictures/items/category-expanded.png");
+ changePicture("collapsePictureliveclassroom", pathPictures+"/items/category-expanded.png");
document.getElementById("div_liveclassroom").setAttribute("state", "expand");
}
if(document.getElementById("collapsePictureboard")) {
- changePicture("collapsePictureboard", "pictures/items/category-expanded.png");
+ changePicture("collapsePictureboard", pathPictures+"/items/category-expanded.png");
document.getElementById("div_board").setAttribute("state", "expand");
}
if(document.getElementById("collapsePicturepresentation")) {
- changePicture("collapsePicturepresentation", "pictures/items/category-expanded.png");
+ changePicture("collapsePicturepresentation", pathPictures+"/items/category-expanded.png");
document.getElementById("div_presentation").setAttribute("state", "expand");
}
if(document.getElementById("collapsePicturepc")) {
- changePicture("collapsePicturepc", "pictures/items/category-expanded.png");
+ changePicture("collapsePicturepc", pathPictures+"/items/category-expanded.png");
document.getElementById("div_pc").setAttribute("state", "expand");
}
@@ -576,7 +576,7 @@
if (divProduct.getAttribute("state") == "expand") {
divProduct.style.display = "none";
divProductMore.style.display = "none";
- changePicture(pictureId, "pictures/items/category-collapsed.png");
+ changePicture(pictureId, pathPictures+"/items/category-collapsed.png");
divProduct.setAttribute("state", "collapse");
} else {
divProduct.style.display = "block";
@@ -585,7 +585,7 @@
} else {
divProductMore.style.display = "none";
}
- changePicture(pictureId, "pictures/items/category-expanded.png");
+ changePicture(pictureId, pathPictures+"/items/category-expanded.png");
divProduct.setAttribute("state", "expand");
}
}
Deleted: branches/team/Thomas/integrations_common/web/js/manageXml.js
===================================================================
--- branches/team/Thomas/integrations_common/web/js/manageXml.js 2008-01-17 21:12:04 UTC (rev 227)
+++ branches/team/Thomas/integrations_common/web/js/manageXml.js 2008-01-17 21:18:29 UTC (rev 228)
@@ -1,1338 +0,0 @@
-/******************************************************************************
- * *
- * 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. *
- * *
- * WARRANTIES: *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with the Horizon Wimba Moodle Integration; *
- * if not, write to the Free Software Foundation, Inc., *
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
- * *
- * Author: Hugues Pisapia *
- * *
- ******************************************************************************/
-
-function manageXml(search, divToReload, displayMessage)
-{
- var display = "";
- var message = false;
- if(divToReload == "all")
- {
- display += "<form method=post name=myform>"
- display += initDisplay();
-
- }
- // session management
- var information = objDomTree.getElements("information");
-
- if(information != "")
- createSession(information);
-
- // Get windows Element
- var windows = objDomTree.getElements("windows");
- // get the different part of the windows
- var windowsElements = windows[0].getElements("windowsElement");
-
- for(var i = 0; i < windowsElements.length;i ++ )
- {
- var type = windowsElements[i].getElements("type")[0].getText();
-
- switch(type)
- {
- case "headerBar" :
- if(divToReload == "all" )
- {
- display += openDiv("headerBar", "headerBar");
- display += displayHeaderBar(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "headerBar")
- {
-
- display += displayHeaderBar(windowsElements[i].getElements("windowsElementParameters"));
-
- }
- break;
- case "toolBar" :
- if(divToReload == "all")
- {
- display += openDiv("toolBar", "toolBar")
- display += displayToolBar(windowsElements[i].getElements("windowsElementParameters"), search);
- display += closeDiv();
- }
- else if(divToReload == "toolBar")
- {
- display += displayToolBar(windowsElements[i].getElements("windowsElementParameters"), search);
-
- }
-
- break;
- case "filterBar" :
- if(divToReload == "all")
- {
- display += openDiv("filterBar", "filterBar")
- display += displayFilterBar(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "filterBar")
- {
-
- display += displayFilterBar(windowsElements[i].getElements("windowsElementParameters"));
-
- }
-
- break;
- case "message" :
- message = true;
- if(divToReload == "all")
- {
- display += openDiv("messageBar", "messageBar")
- display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "messageBar")
- {
-
- display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters"));
-
- }
-
- break;
- case "error" :
- if(divToReload == "all")
- {
- display += openDiv("messageBar", "messageBar")
- display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "messageBar")
- {
-
- display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters"));
-
- }
- break;
- case "list" ://list of element(room,board,presentation)
- if(divToReload == "all")
- {
- display += openDiv("list", "list")
- display += displayList(windowsElements[i].getElements("windowsElementParameters"), search);
- display += closeDiv();
- }
- else if(divToReload == "list")
- {
-
- display += displayList(windowsElements[i].getElements("windowsElementParameters"), search);
-
- }
-
- break;
- case "settings" :
- if(divToReload == "all" )
- {
- display += openDiv("settings", "settings")
- display += displaySettings(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "settings")
- {
- display += displaySettings(windowsElements[i].getElements("windowsElementParameters"));
-
-
- }
- break;
- case "contextBar" :
- if(divToReload == "all")
- {
- display += openDiv("contextBar", "contextBar")
- display += displayContextBar(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "contextBar")
- {
-
- display += displayContextBar(windowsElements[i].getElements("windowsElementParameters"));
-
- }
- break;
- case "validationBar" :
- if(divToReload == "all" )
- {
- display += openDiv("validationBar", "validationBar")
- display += displayValidationBar(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
-
- display += "</form>"
- }
- else if(divToReload == "validationBar")
- {
- display += displayValidationBar(windowsElements[i].getElements("windowsElementParameters"));
- display += "</form>"
-
- }
- break;
- case "productChoice" :
- if(divToReload == "all")
- {
- display += openDiv("productChoice", "productChoice")
- display += displayProductChoice(windowsElements[i].getElements("windowsElementParameters"));
- display += closeDiv();
- }
- else if(divToReload == "productChoice")
- {
-
- display += displayProductChoice(windowsElements[i].getElements("windowsElementParameters"));
-
- }
- break;
-
- }
-
- }
- display += closeDisplay();
- document.getElementById(divToReload).innerHTML = display;
- if(navigator.appName.indexOf("Explorer") > - 1 && parseFloat(navigator.appVersion) < 5.5)
- {
- correctPNG();
- }
- if(divToReload == "all" || divToReload == "list")
- {
- gestionDisplay();
- document.getElementById("search").focus();
- }
-
- // manage the display of the information message
- if(displayMessage == true && message == true)
- {
- if(document.getElementById("list") != null)
- document.getElementById("list").className="listMinHeigth"
- }
- else if(displayMessage == false)
- {
- if(document.getElementById("list") != null)
- document.getElementById("list").className="list"
- if(document.getElementById("messageBar") != null)
- document.getElementById("messageBar").style.display = "none"
- }
- else
- {
- if(document.getElementById("list") != null)
- document.getElementById("list").className="list"
- if(document.getElementById("messageBar") != null)
- document.getElementById("messageBar").style.display = "none"
- }
-}
-
-
-
-
-function displayMessageBar(elementParameters)
-{
- var display = "";
- var messageInformations = elementParameters[0].getElements("message")
-
- switch(messageInformations[0].getElements("type")[0].getText())
- {
- case "message" :
- display = "<table style='background-color:#ffff99' width=100%><tr><td laign=right><img src='pictures/items/messagelabel-info.png'></td><td>" + messageInformations[0].getElements("value")[0].getText() + "</td></tr></table>"
-
- break;
- case "error" ://display the error windows
-
- display += "<table width='100%' height='32' border='0' align='center' cellpadding='0' cellspacing='0' background='headerbar.png'>"
- display += "<tr><td>"
- display += "<div id='headerBar' class='headerBar'>"
- display += " <table cellpadding='0' cellspacing='0' id='TABLE1' style='padding-left:5px'>"
- display += "<tbody>"
- display += "<tr><td>"
- display += "<img src='pictures/items/headerbar-logo.png'>"
- display += "</td> "
- display += "<td align='right' valign='middle'>"
- display += "<select id='view' onchange='ChangeView()'>"
- display += "<option value='normal'>Instructor View</option>"
- display += "<option value='student'>Student View</option>"
- display += "</select>"
- display += "</td></table></div>"
- display += "</tr><tr><td><div id='contextBar' class='contextBar'>"
- display += "<table cellspacing='0' cellpadding='0'>"
- display += "<tr>"
- display += "<td align=left><label class='roomNameForSettings'>Error</label></td>"
- display += "</tr>"
- display += "</table></div>"
- display += "</td>"
- display += "</tr>";
- display += "</tr><tr><td>"
- display += "<div id='error_frame' align='center'>"
- display += "<table width='100%' border='0' cellpadding='0' height='254px'>"
- display += "<tr>"
- display += "<td width='10%'></td>"
- display += "<td valign='middle'><img src='pictures/items/warning.png' alt='' width='60' height='60' border='0'></td>"
- display += "<td width='20'></td>"
- display += "<td valign='middle' >"
- display += "<div id='error_title'>Error"
- display += "<div id='error_body'>"
- display += "<p>" + messageInformations[0].getElements("value")[0].getText() + "</p>"
- display += "</div>"
- display += "</td>"
- display += "</tr>"
- display += "</table>"
- display += "</div>"
- display += "</td>"
- display += "</tr>";
- display += "</tbody>"
- display += "</table>"
- break;
- }
-
- return display;
-}
-
-function displayHeaderBar(elementParameters)
-{
- var display = "";
- var headerBarInformations = elementParameters[0].getElements("headerBarInformations")
- display = "<table cellspacing=0 cellpadding=0>"
- display += "<tr>"
- display += "<td><img height='32px' width='80px' src='"+headerBarInformations[0].getElements("pictureUrl")[0].getText()+"' /></td>"
- display += "<td align='right' valign='middle'>"
- if(session["role"] == "Instructor")
- {
- display += "<select id='view' onchange='ChangeView()'>"
- display += "<option value='normal'>"+headerBarInformations[0].getElements("instructorView")[0].getText()+"</option>"
-
- if(studentView == true)
- display += "<option value='student' selected>"+headerBarInformations[0].getElements("studentView")[0].getText()+"</option>"
- else
- display += "<option value='student'>"+headerBarInformations[0].getElements("studentView")[0].getText()+"</option>"
- display += "</select>"
- }
- display += "</td>"
- display += "</tr>"
- display += "</table>"
- return display;
-
-}
-
-// Manage The toolBar
-function displayToolBar(elementParameters, search)
-{
- var display = "";
- var toolbar = elementParameters[0].getElements("menuElements");
- var menuElements = toolbar[0].getElements("menuElement");
- display += "<table cellspacing=0 cellpadding=0 >"
- display += "<tr id='menu'>"
- for(var i = 0; i < menuElements.length; i ++ )
- {
- if(menuElements[i].getElements("type")[0].getText() == "button"){
- display += displayToolBarButton(menuElements[i].getElements("typeOfProduct")[0].getText(), menuElements[i].getElements("availibility")[0].getText(), menuElements[i].getElements("typeOfUser")[0].getText(), menuElements[i].getElements("pictureUrl")[0].getText(), menuElements[i].getElements("value")[0].getText(), menuElements[i].getElements("action")) ;
- }
- else if(menuElements[i].getElements("type")[0].getText() == "separator"){
- display += displayToolBarSeparator(search);
- }
- else if(menuElements[i].getElements("type")[0].getText() == "search"){
- display += displayToolBarSearch(search);
- }
- else if(menuElements[i].getElements("type")[0].getText() == "variableSpace"){
- display += displaySearch(search);
- }
- else if(menuElements[i].getElements("type")[0].getText() == "fixSpace"){
- display += displaySpace();
- }
- }
- display += "</tr></table>";
- return display;
-}
-
-function displayToolBarButton(product, availibility, typeOfUser, pictureUrl, value, action)
-{
- var display = "";
- var actionString = ""
- if(session["role"] == "Student")
- studentView = true;
- var actionString = action[0].getElements("name")[0].getText() + "(";
- var actionParam = action[0].getElements("parameters");
- var actionParameters = actionParam[0].getElements("parameter");
- for(var j = 0; j < actionParameters.length;j ++ )
- {
- if(j == (actionParameters.length - 1))//last param
- actionString += "\'"+actionParameters[j].getText()+"\' ";
- else
- actionString += "\'"+ actionParameters[j].getText()+"\',";
- }
- actionString += ")";
- var actionDelete = "";
- if( typeOfUser == "all" || (typeOfUser == "instructor" && studentView == false))//check the context to display
- {
- if(availibility == "true" || currentId != "")
- {
- if(product="all" || currentTool == "all")
- {
- if(value == "Delete")//add a validation for the bouton delete
- {
- actionDelete = "onclick=\"javascript : return confirmDelete(); \""
- }
- display += "<td align='center' class='button_enabled' " + actionDelete + ">"
- display += "<a href=\"javascript:"+actionString+";\">"
- display += "<img src='"+pictureUrl+".png' style='text-decoration:none;height:26px' border=0 id='"+value+"' name='"+value+"_icon' ><br style='text-decoration:none;' />"
- display += value ;
- display += "</a></td> "
- }
- else if(currentTool == product)
- {
- if(value == "Delete")//add a validation for the bouton delete
- {
- actionDelete = "onclick=\"javascript : return confirmDelete(); \""
- }
- display += "<td align='center' class='button_enabled' " + actionDelete + ">"
- display += "<a href=\"javascript:"+actionString+";\">"
- display += "<img src='"+pictureUrl+".png' style='text-decoration:none;height:26px' border=0 id='"+value+"' name='"+value+"_icon' ><br style='text-decoration:none;' />"
- display += value ;
- display += "</a></td> "
- }
- else if(currentTool != product )//button not valid for the tool available
- {
- display += "<td align='center' class='empty_space'> </td>"
- }
- else//bouton available but disabled
- {
- display += "<td align='center' class='button_disabled' " + actionDelete + ">"
- display += "<img src='"+pictureUrl+"-disabled.png' border=0 id='"+value+"' name='"+value+"_icon' height='24' width='24'><br />"
- display += value ;
- display += "</td> "
- }
- }
- else
- {
-
- if(currentTool == product || product == "all" || currentTool == "all")
- {
- display += "<td align='center' class='button_disabled' " + actionDelete + " >"
- display += "<img src='"+pictureUrl+"-disabled.png' border=0 id='"+value+"' name='"+value+"_icon' height='24' width='24'><br />"
- display += value ;
- display += "</td> "
- }
- else
- {
- display += "<td align='center' class='empty_space'> </td>"
- }
- }
-
- }
- else
- {
- // the button is unavalaible for this user
- display += "<td align='center' class='empty_space'> </td>"
- }
- display += "<td class='separator_space'> </td> "
- return display;
-}
-
-
-function displayToolBarSearch(search)
-{
- var display = "";
- if(navigator.userAgent.indexOf("Safari") != - 1 )
- {
- display += "<td align='right' width=120px>"
- display += "<table border=0 class='search' cellspacing=0 cellpadding=0 style=border:none >"
- display += "<tr>"
- display += "<td align='right'>"
- display += "<input name='search' id='search' type='search' style='border:0; width: 105px;' "
- display += "onkeyup='javascript:manageXml(search.value,\"list\",false);' onClick='javascript:initSearch(search.value);' value='"+search+"' />"
- display += "</td>"
- display += "</tr>"
- display += "</table>"
- display += "</td>"
- }
- else
- {
- display += "<td align='right' width=115px>"
- display += "<table border=0 class='search' cellspacing=0 cellpadding=0 style=border:none>"
- display += "<tr>"
- display += "<td align='right' width=26px style='background-image: url(pictures/items/headerbar-searchfield-left.png); background-repeat:no-repeat;'>"
- display += "</td>"
- display += "<td align='right' height=26px style='background-image: url(pictures/items/headerbar-searchfield-middle.png); '>"
- display += "<input name='search' id='search' type='search' style='border:0; width: 50px;' "
- display += "onkeyup='javascript:manageXml(search.value,\"list\",false);' onClick='javascript:initSearch(search.value);' value='"+search+"' />"
- display += "</td>"
- display += "<td align=left width=26px style='background-image: url(pictures/items/headerbar-searchfield-right.png); background-repeat:no-repeat;'>"
- display += "<div id='croix' style='display:none'> "
- display += "<img onmouseover='overCroix(this)' Onclick='clickCroix();launchDisplay();' Onmouseout='overCroix(this)' src='pictures/x_normal.gif' align='middle' style='border:none ' />"
- display += "</div>"
- display += "</td>"
- display += "<td width=5px></td>"
- display += "</tr>"
- display += "</table>"
- display += "</td>"
- }
-
- return display;
-}
-
-function displayToolBarSeparator()
-{
- var display = "";
- display += "<td width='1px'><img src='pictures/items/toolbar-separator.png' height='44px' width='1px' /></td> ";
- display += "<td width='12px'></td> "
- return display;
-}
-
-
-// Manage the filterBar
-
-function displayFilterBar(elementParameters)
-{
- var display = "";
- var filterBar = elementParameters[0].getElements("filters");
- var filterElements = filterBar[0].getElements("filter");
- display += "<table cellspacing='0' cellpadding='0' width=100% >"
- display += "<tr>"
- for(var i = 0; i < filterElements.length; i ++ )
- {
- display += "<td class='filterSpace'>"
- display += displayfilter(filterElements[i].getElements("value")[0].getText(), filterElements[i].getElements("name")[0].getText(), filterElements[i].getElements("action")[0].getText(), filterElements[i].getElements("availibility")[0].getText());
- display += "</td>"
- }
- display += "</tr></table>";
- return display;
-}
-
-function displayfilter(value, name, action, availibility)
-{
- var display = "";
- display += "<table align='center' cellpadding='0' cellspacing='0' heigth='24px'>";
- display += "<tr heigth='24px' class='filter'>";
-
- if(currentFilter == name)//filter enabled
- {
- display += "<td class='filter_left_enabled' width=8px id='"+name+"_left'></td>";
- display += "<td class='filter_middle_enabled' id='"+name+"_center' class='filter_selected' onclick=" + action + " onmouseover=\"onFilter('"+name+"')\" onmouseout=\"outFilter('"+name+"')\">";
- display += value;
- display += "</td>";
- display += "<td class='filter_right_enabled' width=8px id='"+name+"_right'></td>";
-
- }
- else
- {
- display += "<td width=8px id='"+name+"_left' ></td>";
- display += "<td id='"+name+"_center' class='filter_enabled' onclick=" + action + " onmouseover=\"onFilter('"+name+"')\" onmouseout=\"outFilter('"+name+"')\">";
- display += value;
- display += "</td>";
- display += "<td width=8px id='"+name+"_right'></td>";
- }
- display += "</tr>";
- display += "</table>";
- return display;
-}
-
-
-// ManageList
-function displayList(elementParameters, search)
-{
- // clear the global variable
- numberMainLectureRoom = 0;
- numberDiscussionRoom = 0;
- numberVoiceBoard = 0;
- numberVoicePresentation = 0;
-
- var parts = new Array();//one part=one tool
- var numberProducts = new Array();
- var breakout = "";
-
- var numberArchive = 0;
- var number = 0;
- var roomId;
- var mysearch = new String(search);
-
- // get the list of products
- var list = elementParameters[0].getElements("products");
- var listProducts = list[0].getElements("listProducts");
-
- // get the different informations for each product
- var products = listProducts[0].getElements("productInformations");
- var start = 0;
- //creation of the product separator
- for(i = 0; i < products.length; i ++ )
- {
- var positionOfDiv = products[i].getElements("position")[0].getText();
- if(currentFilter == "all" || currentDiv == positionOfDiv)
- {
- var cssStyle = products[i].getElements("style")[0].getText();
- var value = products[i].getElements("value")[0].getText();
- // string display
- parts[eval(parseInt(positionOfDiv))] = openDivProduct(positionOfDiv, cssStyle, value)
- }
- if(start > parseInt(positionOfDiv) || start == 0)//if liveclassroom disabled start=2
- start = parseInt(positionOfDiv);
- }
- var content = list[0].getElements("listElements");
- //add the element to the list
- if(content != "")
- {
- var listElements = content[0].getElements("listElement");
- var positionDiscussionRoom = 0;
- var positionMainLecture = 0;
- var orphanedMainLecture = "";
- var orphanedDiscussion = "";
- if(session["role"] == "Student")
- studentView = true;
- for(i = 0; i < listElements.length; i ++ )
- {
- var parameters = listElements[i].getElements("listElementParameters");
-
- var results = parameters[0].getElements("nameDisplay")[0].getText().toLowerCase().match(mysearch.toLowerCase())
- if(search == null || results != null)
- {
- if(studentView == false || ((studentView == true) && parameters[0].getElements("preview")[0].getText() == "available"))
- {
-
- switch(parameters[0].getElements("typeOfElement")[0].getText())
- {
- case LC_MAINLECTURE :
- if(currentFilter == "all" || currentDiv == parameters[0].getElements("position")[0].getText())
- {
- parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addRoomElement(LC_MAINLECTURE, parameters);
- numberMainLectureRoom ++ ;
- positionMainLecture = parameters[0].getElements("position")[0].getText();
- }
- break;
- case LC_DISCUSSION :
- if(currentFilter == "all" || currentDiv == parameters[0].getElements("position")[0].getText())
- {
- parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addRoomElement("Discussion", parameters);
- numberDiscussionRoom ++ ;
- positionDiscussionRoom = parameters[0].getElements("position")[0].getText();
- }
- break;
- case VB_PRODUCT :
- parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addBoardElement(VB_PRODUCT, parameters);
- numberVoiceBoard ++ ;
-
- break;
- case VP_PRODUCT :
- parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addBoardElement(VP_PRODUCT, parameters);
- numberVoicePresentation ++ ;
-
- break;
- case "orphanedArchive" :
- if(parameters[0].getElements("type")[0].getText() == LC_DISCUSSION)
- {
- orphanedDiscussion = orphanedDiscussion + addOrphanedElement(parameters);
- numberDiscussionRoom ++ ;
- }
- else if(parameters[0].getElements("type")[0].getText() == LC_MAINLECTURE)
- {
- orphanedMainLecture = orphanedMainLecture + addOrphanedElement(parameters);
- numberMainLectureRoom ++ ;
- }
- break;
- }
- }
- }
- }
- }
- var display = "";
- display += "<table border='0' align='center' cellpadding='0' cellspacing='0' width=100% >";
- //create the complete list
- for(i = start; i < parts.length; i ++ )
- {
- if(currentFilter == "all" || currentDiv == i)
- {
- display += "<tr><td>";
- if(positionMainLecture == i)
- parts[i] = parts[i].toString() + orphanedMainLecture;
- if(positionDiscussionRoom == i)
- parts[i] = parts[i].toString() + orphanedDiscussion;
-
- parts[i] = parts[i].toString() + closeDivProduct(i);
- parts[i] += "<div id='div"+i+"More' class='hide'></div>"
- display += parts[i];
- display += "</td></tr>";
- display += "<tr><td><div id='div"+i+"Space'><table><tr><td height=5px></td></tr></table></div></td></tr>"
- }
- }
- display += "</table>";
- return display;
-}
-
-
-function openDivProduct(name, cssStyle, value)
-{
- var display = "";
- display += "<div id='div"+name+"Title' class='separateProduct'>";
- display += "<table cellpadding='0' cellspacing='0' width='100%'>";
- display += "<tr class='productTitle'>";
- display += "<td class='lineTitle' onclick='javascript:hideDiv(\"div"+name+"\",\""+name+"toggleimgorphaned\")'>";
- display += "<img width=16px height=16px src='pictures/items/category-expanded.png' id='"+name+"toggleimgorphaned' border='0'>";
- display += "</td>";
- display += "<td class='shortShift' align=left width=100%>" + value + "</td>";
- display += "</tr>";
- display += "<tr><td colspan=3>"
- display += "<div id='div"+name+"' style='display:block;overflow:hidden'>";
- display += "<table width='100%' cellspacing='0' cellpadding='1' border='0' class='divProduct'>";
- return display
-}
-
-
-function addOrphanedElement(parameters)
-{
- var display = "";
- display += "<tr id=" + parameters[0].getElements("id")[0].getText() + " height=16px Onclick=\"OneClick('"+parameters[0].getElements("id")[0].getText()+"', '"+LC_PRODUCT+"', 'archive')\" Ondblclick=\"javascript : startHorizon('"+parameters[0].getElements("id")[0].getText()+"', null, null, null, null, 'hzA="+session["authToken"]+"')\" class='archive'>"
- display += "<td width=16px align=\"left\"><img src=\"pictures/items/listitem-liveclassroomicon.png\" border=\"0\" /></td>";
- display += "<td width=16px align=\"left\"><img src=\"pictures/items/space-16x16px.png\" border=\"0\" /></td>";
- display += "<td width='300px' <label onmousemove='javascript:ShowToolTip(event,\""+parameters[0].getElements("nameDisplay")[0].getText()+"\",\""+parameters[0].getElements("preview")[0].getText()+"\")' onmouseout='javascript:HideToolTip()'>" + parameters[0].getElements("nameDisplay")[0].getText() + "</label></td>";
- display += "<td class='shiftAvailability' align=right><img width=16px height=16px src=\"pictures/items/listitem-"+parameters[0].getElements("preview")[0].getText()+".png\"/></td>";
- display += "</tr>";
- return display;
-}
-
-
-function addBoardElement(type, parameters)
-{
- var display = "";
- display += displayBoard(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("rid")[0].getText(), parameters[0].getElements("nid")[0].getText());
- return display;
-
-}
-
-function displayBoard(type, availibility, title, rid, nid)
-{
- var display = "";
- display += "<tr id='"+rid+"' height=16px Onclick=\"OneClick('"+rid+"', '"+VT_PRODUCT+"', '"+type+"', '"+nid+"')\" Ondblclick=\"javascript : dclick('"+rid+"')\" class='room'>"
- display += "<td width=16px align=\"left\"><img src=\"pictures/items/listitem-"+type+"icon.png\" border=\"0\" /></td>";
- display += "<td width=16px align=\"left\" Ondblclick=''></td>";
- display += "<td width='300px' ><label onmousemove='javascript:ShowToolTip(event,\""+title+"\",\""+availibility+"\")' onmouseout='javascript:HideToolTip()'>" + title + "</label></td>";
- display += "<td class='shiftAvailability' align=right><img src=\"pictures/items/listitem-"+availibility+".png\"/></td>";
- display += "</tr>";
- return display;
-}
-
-function addRoomElement(type, parameters)
-{
- var display = "";
- var archives;
- if(parameters[0].getElements("archives") != "")
- archives = parameters[0].getElements("archives");
- if(archives != null )
- {
- if(studentView == false || parameters[0].getElements("closedArchive")[0].getText() == "false")
- display = displayRoom(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("id")[0].getText(), "pictures/items/listitem-show.png", archives)
- else
- display = displayRoom(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("id")[0].getText(), "pictures/items/space-16x16px.png", archives)
- }
- else
- {
- display = displayRoom(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("id")[0].getText(), "pictures/items/space-16x16px.png", archives)
-
- }
- return display;
-}
-
-function displayRoom(type, availibility, longname, roomId, archive, archives)
-{
-
- var display = "";
- display += "<tr id=" + roomId + " height=16px class='room'>"
- display += "<td Ondblclick=\"dclick('"+roomId+"')\" Onclick=\"OneClick('"+roomId+"', '"+LC_PRODUCT+"', '"+type+"')\" width=16px align=\"left\"><img width=16px height=16px src=\"pictures/items/listitem-liveclassroomicon.png\" border=\"0\" /></td>";
- display += "<td align=\"left\"Onclick=\"javascript : hideArchive('"+type+"', '"+roomId+"hide', 'toggleimg"+roomId+"hide', '"+roomId+"')\" width=16px><img width=16px height=16px src='"+archive+"' id=\"toggleimg"+roomId+"hide\" border=\"0\" /></td>";
- display += "<td Ondblclick=\"dclick('"+roomId+"')\" Onclick=\"OneClick('"+roomId+"', '"+LC_PRODUCT+"', '"+type+"')\" width=300px ><label onmousemove='javascript:ShowToolTip(event,\""+longname+"\",\""+availibility+"\")' onmouseout='javascript:HideToolTip()'>" + longname + "</label></td>";
- display += "<td Ondblclick=\"dclick('"+roomId+"')\" Onclick=\"OneClick('"+roomId+"', '"+LC_PRODUCT+"', '"+type+"')\" class='shiftAvailability' align=right ><img width=16px height=16px src=\"pictures/items/listitem-"+availibility+".png\"/></td>";
- display += "</tr>";
- if(archives != null)
- {
- display += displayArchive(roomId, archives);
- }
- return display;
-}
-
-function displayArchive(roomId, archives)
-{
- var closeArchive = 0;
- var archive = archives[0].getElements("archive");
- if(archive != "")
- {
- var display = "<tr><td colspan=5 style='padding:0px 0px 0px 0px'><div id='"+roomId+"hide' class='hide' >";
- display += " <table width=100% cellspacing=0 cellpadding=1 border=0>";
- for(var i = 0; i < archive.length; i ++ )
- {
- //closed archive not available for student
- if(studentView == false || (studentView == true && archive[i].getElements("preview")[0].getText() == "available"))
- {
-
- display += "<tr id=" + archive[i].getElements("id")[0].getText() + " height=16px Onclick=\"OneClick('"+archive[i].getElements("id")[0].getText()+"', '"+LC_PRODUCT+"')\" Ondblclick=\"javascript : startHorizon('"+archive[i].getElements("id")[0].getText()+"', null, null, null, null, 'hzA="+session["authToken"]+"')\" class='archive'>"
- display += "<td width=16px align=\"left\"><img width=16px height=16px src=\"pictures/items/listitem-liveclassroomicon.jpg\" border=\"0\" /></td>";
- display += "<td width=16px align=\"left\"><img width=16px height=16px src=\"pictures/items/listitem-subitem.jpg\" border=\"0\" /></td>";
- display += "<td width='300px'><label onmousemove='javascript:ShowToolTip(event,\""+archive[i].getElements("nameDisplay")[0].getText()+"\",\""+archive[i].getElements("preview")[0].getText()+"\")' onmouseout='javascript:HideToolTip()'>" + archive[i].getElements("nameDisplay")[0].getText() + "</label></td>";
- display += "<td class='shiftAvailability' align=right><img width=16px height=16px src=\"pictures/items/listitem-"+archive[i].getElements("preview")[0].getText()+".jpg\"/></td>";
- display += "</tr>";
- }
- else
- {
- closeArchive ++ ;
- }
- }
- display += "</table></div></td></tr>";
- }
- numberArchive[roomId] = archive.length - closeArchive;
- if(closeArchive == archive.length)
- {
- // no open archive for student
- // changePicture("toggleimg" + roomId + "hide", "pictures/items/listitem-subitem.png");
-
- }
- return display;
-
-}
-
-
-function displayProductChoice(elementParameters)
-{
- var display = "";
- var informations = elementParameters[0].getElements("productInformations");
- var action = informations[0].getElements("action");
-
- var actionJavascript = "" + action[0].getElements("name")[0].getText() + "(";
-
- var actionParam = action[0].getElements("parameters");
- var actionParameters = actionParam[0].getElements("parameter");
- for(var j = 0; j < actionParameters.length;j ++ )
- {
- if(j == (actionParameters.length - 1))
- actionJavascript += "\""+ actionParameters[j].getText()+"\" ";
- else
- actionJavascript += "\""+ actionParameters[j].getText()+"\",";
- }
- actionJavascript += ")";
- var height = "75px";
-
-
- if(currentTool == VT_PRODUCT)//change the heigth to have two product
- height = "116px"
- display += "<table cellspacing='0' cellpadding='0' align=center width=100% border='0' height=" + height + " >";
- display += "<tr onclick='"+actionJavascript+"'>";
- display += "<td align=center width=130px><img src='"+informations[0].getElements("pictureUrl")[0].getText()+"' /><br><label>" + informations[0].getElements("value")[0].getText() + "</label></td>"
- display += "<td>" + informations[0].getElements("description")[0].getText() + "</td>";
- display += "</tr>";
- display += "</table>";
- return display;
-
-}
-
-function displaySettings(elementParameters)
-{
-
- var display = "";
- display += "<table cellspacing='0' cellpadding='0' width='100%' border='0' ><tr><td style='padding:0px 0px 0px 0px'>"
- var displayPanelTitle = "";
- var displayPanel = "";
- var panelsSettings = elementParameters[0].getElements("panelsSettings");
- var panelSettings = panelsSettings[0].getElements("panelSettings");
- for(var i = 0; i < panelSettings.length; i ++ )
- {
- var panelInformations = panelSettings[i].getElements("panelInformations");
- var panelContent = panelSettings[i].getElements("panelContent");
- displayPanelTitle += DisplayTab(panelInformations);
- displayPanel += DisplayDivSettings(panelInformations, panelContent);
- }
- display += DisplayTabtitle(displayPanelTitle);
- display += displayPanel;
- return display;
-}
-
-function DisplayTabtitle(alltab)
-{
- var display = "";
- display += "<div cellspacing='0' cellpadding='0' id='' class=tabBackground>";
- display += "<table cellspacing='0' cellpadding='0' border='0' width=100%>";
- display += "<tr>";
- display += "<td width='2px' style='border-bottom: #818181 1px solid; height: 18px;'> </td>";
- display += alltab;
- display += "<td style='border-bottom: #818181 1px solid; height: 18px;' align='center'> </td>";
- display += "</tr>";
- display += "</table>";
- display += "</div>";
- return display;
-}
-
-
-function DisplayTab(panelInformations)
-{
- var display = "";
- var context = new String(panelInformations[0].getElements("contextDisplay")[0].getText());
- if(context.indexOf("all") != - 1 || context.indexOf(typeSelect) != - 1)
- display += "<td onclick='onTab("+panelInformations[0].getElements("position")[0].getText()+")' id='tab"+panelInformations[0].getElements("position")[0].getText()+"' class='"+panelInformations[0].getElements("styleEnabled")[0].getText()+"' ";
- else//the tab is not available for this type of element
- display += "<td class='"+panelInformations[0].getElements("styleDisabled")[0].getText()+"' ";
- display += "align='center'>";
- display += panelInformations[0].getElements("name")[0].getText() + "</td>";
- display += "<td width='2px' style='border-bottom: #818181 1px solid; height: 18px;'> </td>";
- return display;
-}
-
-function DisplayDivSettings(panelInformations, panelContent)
-{
- var display = "";
- display += "<tr><td class=settingsPadding>";
- for(var j = 0; j < panelContent.length; j ++ )
- {
- var line = panelContent[j].getElements("panelLine");
- display += "<div style='display:"+panelInformations[j].getElements("display")[0].getText()+";' id='span"+panelInformations[j].getElements("position")[0].getText()+"' class=tab>";
- display += "<table cellspacing='5px' cellpadding='0px' align='center' border='0' width=100%>";
- for(var i = 0; i < line.length; i ++ )
- {
- if(line[i].getElements("style")[0].getText() == "hide" )
- {
- display +...
[truncated message content] |
|
From: <tro...@us...> - 2008-01-17 21:12:09
|
Revision: 227
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=227&view=rev
Author: trollinger
Date: 2008-01-17 13:12:04 -0800 (Thu, 17 Jan 2008)
Log Message:
-----------
Change the path of the different files due to the structure change
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
Modified: branches/team/Thomas/moodle/mod/liveclassroom/config.html
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/config.html 2008-01-17 21:12:04 UTC (rev 227)
@@ -1,6 +1,6 @@
<?php
-require_once("lib/lc/LCAction.php");
-require_once("lib/lc/lcapi.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-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/css/StyleSheet.css 2008-01-17 21:12:04 UTC (rev 227)
@@ -118,7 +118,7 @@
#headerBar table
{
width: 100%;
- background-image: url( "../pictures/backgrounds/headerbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/headerbar.png" );
height: 32px;
border-bottom: solid 1px Black;
}
@@ -135,7 +135,7 @@
/*contextBar*/
#contextBar table
{
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
height: 30px;
width: 100%;
border-bottom: solid 1px #F0F0F0;
@@ -161,7 +161,7 @@
#filterBar
{
- background-image: url( "../pictures/backgrounds/filterbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/filterbar.png" );
height: 24px;
font-weight: bold;
border-bottom: fine 1px #C7D3E1;
@@ -194,22 +194,22 @@
a.filterenabled span
{
- background:url("../pictures/items/filter-enabled-right.png") no-repeat right top;
+ background:url("../lib/web/pictures/items/filter-enabled-right.png") no-repeat right top;
color:white;
}
a.filterenabled
{
- background:url("../pictures/items/filter-enabled-left.png") no-repeat left top;
+ background:url("../lib/web/pictures/items/filter-enabled-left.png") no-repeat left top;
}
a.filterrollover
{
- background:url("../pictures/items/filter-rollover-left.png") no-repeat left top;
+ background:url("../lib/web/pictures/items/filter-rollover-left.png") no-repeat left top;
}
a.filterrollover span
{
- background:url("../pictures/items/filter-rollover-right.png") no-repeat right top;
+ background:url("../lib/web/pictures/items/filter-rollover-right.png") no-repeat right top;
}
/*list*/
@@ -397,7 +397,7 @@
padding-left: 5px;
width: 100%;
height:50px;
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
border-bottom: solid 1px #999999;
}
@@ -454,12 +454,12 @@
/*tabs*/
#tabs
{
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
}
td.tabSelected,td.tabDisabled,td.tabNoSelected
{
- background-image: url(../pictures/items/tab-selected.gif);
+ background-image: url(../lib/web/pictures/items/tab-selected.gif);
background-repeat: no-repeat;
width: 78px;
font-size: 10px;
@@ -471,12 +471,12 @@
{
color: #CACACA;
z-index:-14;
- background-image: url(../pictures/items/tab-unselected.gif);
+ background-image: url(../lib/web/pictures/items/tab-unselected.gif);
border-bottom: solid 1px #818181;
}
td.tabNoSelected
{
- background-image: url(../pictures/items/tab-unselected.gif);
+ background-image: url(../lib/web/pictures/items/tab-unselected.gif);
border-bottom: solid 1px #818181;
}
@@ -558,7 +558,7 @@
td.action, input.action
{
- background-image: url(../pictures/buttons/general-empty.png);
+ background-image: url(../lib/web/pictures/buttons/general-empty.png);
background-repeat: no-repeat;
background-position: center;
text-decoration: none;
@@ -569,7 +569,7 @@
}
td.action:hover, input.action:hover
{
- background-image: url(../pictures/buttons/general-empty-over.png);
+ background-image: url(../lib/web/pictures/buttons/general-empty-over.png);
}
.action label
@@ -701,7 +701,7 @@
top:0px;
width:10px;
height:150px;
- background-image: url( "../pictures/items/window-left.png" );
+ background-image: url( "../lib/web/pictures/items/window-left.png" );
background-repeat:none;
}
@@ -711,7 +711,7 @@
top:0px;
width:330px;
height:150px;
- background-image: url( "../pictures/items/window-middle.png" );
+ background-image: url( "../lib/web/pictures/items/window-middle.png" );
}
@@ -721,7 +721,7 @@
top:0px;
width:10px;
height:150px;
- background-image: url( "../pictures/items/window-right.png" );
+ background-image: url( "../lib/web/pictures/items/window-right.png" );
background-repeat:none;
}
@@ -731,7 +731,7 @@
top:0px;
width:10px;
height:200px;
- background-image: url( "../pictures/items/window200_left.png" );
+ background-image: url( "../lib/web/pictures/items/window200_left.png" );
background-repeat:none;
}
@@ -741,7 +741,7 @@
top:0px;
width:380px;
height:200px;
- background-image: url( "../pictures/items/window200_middle.png" );
+ background-image: url( "../lib/web/pictures/items/window200_middle.png" );
}
@@ -751,7 +751,7 @@
top:0px;
width:10px;
height:200px;
- background-image: url( "../pictures/items/window200_right.png" );
+ background-image: url( "../lib/web/pictures/items/window200_right.png" );
background-repeat:none;
}
Modified: branches/team/Thomas/moodle/mod/liveclassroom/doAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/doAction.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -33,14 +33,14 @@
error_reporting(E_ERROR);
require_once ("../../config.php");
require_once ("lib.php");
-require_once ("lib/lc/LCAction.php");
-require_once ("lib/common/WimbaCommons.php");
-require_once ("lib/common/WimbaLib.php");
-require_once ("lib/common/WimbaUI.php");
-require_once ("lib/common/XmlRoom.php");
-require_once ("lib/common/WimbaXml.php");
+require_once ("lib/php/lc/LCAction.php");
+require_once ("lib/php/common/WimbaCommons.php");
+require_once ("lib/php/common/WimbaLib.php");
+require_once ("lib/php/common/WimbaUI.php");
+require_once ("lib/php/common/XmlRoom.php");
+require_once ("lib/php/common/WimbaXml.php");
if (version_compare(PHP_VERSION, '5', '>=')) {
- require_once ('lib/common/domxml-php4-php5.php');
+ require_once ('lib/php/common/domxml-php4-php5.php');
}
$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaClassroomForm());
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateListRooms.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -34,17 +34,17 @@
error_reporting(E_ERROR);
require_once("../../config.php");
require_once("lib.php");
-require_once("lib/lc/LCAction.php");
-require_once("lib/common/WimbaCommons.php");
-require_once("lib/common/WimbaUI.php");
-require_once("lib/common/XmlArchive.php");
-require_once("lib/common/XmlOrphanedArchive.php");
-require_once("lib/common/XmlRoom.php");
-require_once("lib/common/WimbaXml.php");
-require_once("lib/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");
if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/common/domxml-php4-php5.php');
+ require_once('lib/php/common/domxml-php4-php5.php');
}
Modified: branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/generateSettings.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -31,14 +31,14 @@
error_reporting(E_ERROR);
require_once("../../config.php");
require_once("lib.php");
-require_once("lib/lc/LCAction.php");
-require_once("lib/common/WimbaXml.php");
-require_once("lib/common/WimbaCommons.php");
-require_once("lib/common/WimbaLib.php");
-require_once("lib/common/WimbaUI.php");
+require_once("lib/php/lc/LCAction.php");
+require_once("lib/php/common/WimbaXml.php");
+require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaLib.php");
+require_once("lib/php/common/WimbaUI.php");
if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/common/domxml-php4-php5.php');
+ require_once('lib/php/common/domxml-php4-php5.php');
}
$params = array ();
Modified: branches/team/Thomas/moodle/mod/liveclassroom/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/index.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -34,8 +34,8 @@
require_once("../../config.php");
require_once("lib.php");
-require_once("lib/common/WimbaCommons.php");
-require_once("lib/common/WimbaLib.php");
+require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaLib.php");
$id = optional_param('id', 0, PARAM_INT);
$roomname = optional_param('idroomname', 0, PARAM_TEXT);
Modified: branches/team/Thomas/moodle/mod/liveclassroom/lib.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/lib.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -32,7 +32,7 @@
require_once($CFG->libdir.'/datalib.php');
-require_once("lib/lc/lcapi.php");
+require_once("lib/php/lc/lcapi.php");
require_once($CFG->dirroot.'/course/lib.php');
@@ -462,30 +462,4 @@
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-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/mod.html 2008-01-17 21:12:04 UTC (rev 227)
@@ -33,8 +33,8 @@
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/lc/LCAction.php');
-include_once($CFG->dirroot.'/mod/liveclassroom/lib/common/WimbaLib.php');
+include_once($CFG->dirroot.'/mod/liveclassroom/lib/php/lc/LCAction.php');
+include_once($CFG->dirroot.'/mod/liveclassroom/lib/php/common/WimbaLib.php');
require_once($CFG->dirroot.'/version.php');
//test if the current user can see this page
Modified: branches/team/Thomas/moodle/mod/liveclassroom/reports.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/reports.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/reports.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -33,8 +33,8 @@
require_once("../../config.php");
require_once("lib.php");
-require_once("lib/lc/lcapi.php");
-require_once("lib/lc/LCAction.php");
+require_once("lib/php/lc/lcapi.php");
+require_once("lib/php/lc/LCAction.php");
$roomId = required_param('id', PARAM_SAFEDIR);
$token = required_param('hzA', PARAM_RAW);
$api=new LCAction($session,$CFG->liveclassroom_servername,
Modified: branches/team/Thomas/moodle/mod/liveclassroom/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/view.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/view.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -31,9 +31,9 @@
/// This page prints a particular instance of the live classroom links
error_reporting(E_ERROR);
require_once("../../config.php");
-require_once("lib/lc/LCAction.php");
-require_once("lib/common/WimbaCommons.php");
-require_once("lib/common/WimbaLib.php");
+require_once("lib/php/lc/LCAction.php");
+require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaLib.php");
require_once("lib.php");
$id = optional_param('id', 0, PARAM_INT);//instance id
Modified: branches/team/Thomas/moodle/mod/liveclassroom/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-01-16 14:49:35 UTC (rev 226)
+++ branches/team/Thomas/moodle/mod/liveclassroom/welcome.php 2008-01-17 21:12:04 UTC (rev 227)
@@ -48,19 +48,20 @@
<title>Live ClassRooms</title>
</head>
<link rel="STYLESHEET" href="css/StyleSheet.css" type="text/css" />
-<script language="javascript" src="js/dojo/dojo.js"></script>
-<script language="javascript" src="js/ajax.js"></script>
-<script language="javascript" src="js/verifForm.js"></script>
-<script language="javascript" src="js/constants.js"></script>
-<script type="text/javascript" src="js/ajaxslt/xslt.js"></script>
-<script type="text/javascript" src="js/pngfix.js"></script>
-<script src="js/ajaxslt/util.js" type="text/javascript"></script>
-<script src="js/ajaxslt/xmltoken.js" type="text/javascript"></script>
-<script src="js/ajaxslt/dom.js" type="text/javascript"></script>
-<script src="js/ajaxslt/xpath.js" type="text/javascript"></script>
-<script src="js/hwCommons.js" type="text/javascript"></script>
-<script src="js/xmldom.js" type="text/javascript"></script>
+<script language="javascript" src="lib/web/js/constants.js"></script>
+<script language="javascript" src="lib/web/js/dojo/dojo.js"></script>
+<script language="javascript" src="lib/web/js/ajax.js"></script>
+<script language="javascript" src="lib/web/js/verifForm.js"></script>
+<script type="text/javascript" src="lib/web/js/ajaxslt/xslt.js"></script>
+<script type="text/javascript" src="lib/web/js/pngfix.js"></script>
+<script src="lib/web/js/ajaxslt/util.js" type="text/javascript"></script>
+<script src="lib/web/js/ajaxslt/xmltoken.js" type="text/javascript"></script>
+<script src="lib/web/js/ajaxslt/dom.js" type="text/javascript"></script>
+<script src="lib/web/js/ajaxslt/xpath.js" type="text/javascript"></script>
+<script src="lib/web/js/hwCommons.js" type="text/javascript"></script>
+<script src="lib/web/js/xmldom.js" type="text/javascript"></script>
+
<script type="text/javascript">
function doOpenAddActivity(url,param){
if(currentId!="") {
@@ -99,7 +100,7 @@
//set the current product
currentProduct="liveclassroom";
-
+initPath('lib/web/js/xsl/wimba.xsl','lib/web/pictures');
</script>
<style>
*{
@@ -126,7 +127,7 @@
<tbody>
<tr>
<td align=left>
- <img src="pictures/items/headerbar-logo.png" height="32" width="80">
+ <img src="lib/web/pictures/items/headerbar-logo.png" height="32" width="80">
</td>
</tr>
</tbody>
@@ -145,7 +146,7 @@
<table width=100% style="height:300px">
<tbody>
<tr valign=middle>
- <td align=center><img src="pictures/items/wheel.gif"><br>
+ <td align=center><img src="lib/web/pictures/items/wheel.gif"><br>
<p><font size="-2" face="Verdana" color="666666"> Loading...</font></p>
</td>
</tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-16 14:49:46
|
Revision: 226
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=226&view=rev
Author: trollinger
Date: 2008-01-16 06:49:35 -0800 (Wed, 16 Jan 2008)
Log Message:
-----------
Change the structure of my branche to be similar to trunk
Added Paths:
-----------
branches/team/Thomas/integrations_common/
branches/team/Thomas/integrations_common/php/
branches/team/Thomas/integrations_common/php/common/
branches/team/Thomas/integrations_common/php/common/WimbaCommons.php
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/php/common/XmlArchive.php
branches/team/Thomas/integrations_common/php/common/XmlOrphanedArchive.php
branches/team/Thomas/integrations_common/php/common/XmlResource.php
branches/team/Thomas/integrations_common/php/common/XmlRoom.php
branches/team/Thomas/integrations_common/php/common/domxml-php4-php5.php
branches/team/Thomas/integrations_common/php/lc/
branches/team/Thomas/integrations_common/php/lc/LCAction.php
branches/team/Thomas/integrations_common/php/lc/LCRoom.php
branches/team/Thomas/integrations_common/php/lc/LCUser.php
branches/team/Thomas/integrations_common/php/lc/PrefixUtil.php
branches/team/Thomas/integrations_common/php/lc/lcapi.php
branches/team/Thomas/integrations_common/php/vt/
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetools.php
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetoolsAPI.php
branches/team/Thomas/integrations_common/web/
branches/team/Thomas/integrations_common/web/js/
branches/team/Thomas/integrations_common/web/js/ajax.js
branches/team/Thomas/integrations_common/web/js/ajaxslt/
branches/team/Thomas/integrations_common/web/js/ajaxslt/AUTHORS
branches/team/Thomas/integrations_common/web/js/ajaxslt/COPYING
branches/team/Thomas/integrations_common/web/js/ajaxslt/README
branches/team/Thomas/integrations_common/web/js/ajaxslt/dom.js
branches/team/Thomas/integrations_common/web/js/ajaxslt/util.js
branches/team/Thomas/integrations_common/web/js/ajaxslt/xmltoken.js
branches/team/Thomas/integrations_common/web/js/ajaxslt/xpath.js
branches/team/Thomas/integrations_common/web/js/ajaxslt/xslt.js
branches/team/Thomas/integrations_common/web/js/constants.js
branches/team/Thomas/integrations_common/web/js/dojo/
branches/team/Thomas/integrations_common/web/js/dojo/LICENSE
branches/team/Thomas/integrations_common/web/js/dojo/README
branches/team/Thomas/integrations_common/web/js/dojo/build.txt
branches/team/Thomas/integrations_common/web/js/dojo/dojo.js
branches/team/Thomas/integrations_common/web/js/dojo/iframe_history.html
branches/team/Thomas/integrations_common/web/js/dojo/src/
branches/team/Thomas/integrations_common/web/js/dojo/src/io/
branches/team/Thomas/integrations_common/web/js/dojo/src/io/BrowserIO.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/IframeIO.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/RepubsubIO.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/RhinoIO.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/ScriptSrcIO.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/XhrIframeProxy.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/__package__.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/cometd.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/common.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/cookie.js
branches/team/Thomas/integrations_common/web/js/dojo/src/io/xip_client.html
branches/team/Thomas/integrations_common/web/js/dojo/src/io/xip_server.html
branches/team/Thomas/integrations_common/web/js/hwCommons.js
branches/team/Thomas/integrations_common/web/js/manageXml.js
branches/team/Thomas/integrations_common/web/js/pngfix.js
branches/team/Thomas/integrations_common/web/js/verifForm.js
branches/team/Thomas/integrations_common/web/js/xmldom.js
branches/team/Thomas/integrations_common/web/js/xsl/
branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl
branches/team/Thomas/integrations_common/web/pictures/
branches/team/Thomas/integrations_common/web/pictures/backgrounds/
branches/team/Thomas/integrations_common/web/pictures/backgrounds/filterbar.png
branches/team/Thomas/integrations_common/web/pictures/backgrounds/headerbar.png
branches/team/Thomas/integrations_common/web/pictures/backgrounds/toolbar.png
branches/team/Thomas/integrations_common/web/pictures/buttons/
branches/team/Thomas/integrations_common/web/pictures/buttons/angel.gif
branches/team/Thomas/integrations_common/web/pictures/buttons/general-cancel.png
branches/team/Thomas/integrations_common/web/pictures/buttons/general-create.png
branches/team/Thomas/integrations_common/web/pictures/buttons/general-empty-over.png
branches/team/Thomas/integrations_common/web/pictures/buttons/general-empty.png
branches/team/Thomas/integrations_common/web/pictures/buttons/general-saveall.png
branches/team/Thomas/integrations_common/web/pictures/buttons/headerbar-logo.png
branches/team/Thomas/integrations_common/web/pictures/buttons/listitem-available.png
branches/team/Thomas/integrations_common/web/pictures/buttons/listitem-hide.png
branches/team/Thomas/integrations_common/web/pictures/buttons/listitem-information-16_12.png
branches/team/Thomas/integrations_common/web/pictures/buttons/listitem-show.png
branches/team/Thomas/integrations_common/web/pictures/buttons/listitem-unavailable.png
branches/team/Thomas/integrations_common/web/pictures/buttons/new-createpodcaster.png
branches/team/Thomas/integrations_common/web/pictures/buttons/new-createroom.png
branches/team/Thomas/integrations_common/web/pictures/buttons/new-createvoiceboard.png
branches/team/Thomas/integrations_common/web/pictures/buttons/new-createvoicepresentation.png
branches/team/Thomas/integrations_common/web/pictures/buttons/searchfield.gif
branches/team/Thomas/integrations_common/web/pictures/buttons/tab.gif
branches/team/Thomas/integrations_common/web/pictures/buttons/tab_disabled.gif
branches/team/Thomas/integrations_common/web/pictures/buttons/tab_over.gif
branches/team/Thomas/integrations_common/web/pictures/buttons/tab_select.gif
branches/team/Thomas/integrations_common/web/pictures/buttons/titlebar-edit.png
branches/team/Thomas/integrations_common/web/pictures/buttons/titlebar-save.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-activities-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-activities-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-activities.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-availability-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-availability.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-content-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-content-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-content.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-delete-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-delete-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-delete.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-launch-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-launch-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-launch.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-new-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-new.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-newboard-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-newboard.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-newroom-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-poll-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-poll-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-poll.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-schedule-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-schedule-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-schedule.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-settings-disabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-settings-enabled.png
branches/team/Thomas/integrations_common/web/pictures/buttons/toolbar-settings.png
branches/team/Thomas/integrations_common/web/pictures/buttons/x_round-16_14.png
branches/team/Thomas/integrations_common/web/pictures/buttons/x_squared.png
branches/team/Thomas/integrations_common/web/pictures/items/
branches/team/Thomas/integrations_common/web/pictures/items/category-collapsed.png
branches/team/Thomas/integrations_common/web/pictures/items/category-expanded.png
branches/team/Thomas/integrations_common/web/pictures/items/filter-enabled-left.png
branches/team/Thomas/integrations_common/web/pictures/items/filter-enabled-middle.png
branches/team/Thomas/integrations_common/web/pictures/items/filter-enabled-right.png
branches/team/Thomas/integrations_common/web/pictures/items/filter-rollover-left.png
branches/team/Thomas/integrations_common/web/pictures/items/filter-rollover-middle.png
branches/team/Thomas/integrations_common/web/pictures/items/filter-rollover-right.png
branches/team/Thomas/integrations_common/web/pictures/items/filterbar-separator.png
branches/team/Thomas/integrations_common/web/pictures/items/filterbar_example.html
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-logo.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-searchfield-left.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-searchfield-middl.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-searchfield-middle.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-searchfield-right.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-voice_recorder_ic.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-voice_recorder_icon.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-wimba_podcaster_i.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-wimba_podcaster_icon.png
branches/team/Thomas/integrations_common/web/pictures/items/headerbar-wimbapodcaster.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-Podcastericon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-VoiceBoardicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-VoicePresentationicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-archiveicon-selected.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-archiveicon.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-available.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-available.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-boardicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-hide.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-liveclassroomicon.gif
branches/team/Thomas/integrations_common/web/pictures/items/listitem-liveclassroomicon.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-liveclassroomicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-orphanedarchiveicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-pcicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-presentationicon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-show.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-subitem-selected.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-subitem.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-subitem.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-unavailable.jpg
branches/team/Thomas/integrations_common/web/pictures/items/listitem-unavailable.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-voicerecordericon.png
branches/team/Thomas/integrations_common/web/pictures/items/listitem-voicetoolsicon.gif
branches/team/Thomas/integrations_common/web/pictures/items/listitem-wimbapodcaster.png
branches/team/Thomas/integrations_common/web/pictures/items/liveclassroom.png
branches/team/Thomas/integrations_common/web/pictures/items/messagelabel-info.png
branches/team/Thomas/integrations_common/web/pictures/items/more-link.png
branches/team/Thomas/integrations_common/web/pictures/items/phone_60.png
branches/team/Thomas/integrations_common/web/pictures/items/space-16px.png
branches/team/Thomas/integrations_common/web/pictures/items/space-16x16px.png
branches/team/Thomas/integrations_common/web/pictures/items/space-18px.png
branches/team/Thomas/integrations_common/web/pictures/items/space-24px.png
branches/team/Thomas/integrations_common/web/pictures/items/space-32px.png
branches/team/Thomas/integrations_common/web/pictures/items/space-44px.png
branches/team/Thomas/integrations_common/web/pictures/items/tab-selected.gif
branches/team/Thomas/integrations_common/web/pictures/items/tab-unselected.gif
branches/team/Thomas/integrations_common/web/pictures/items/toolbar-separator.png
branches/team/Thomas/integrations_common/web/pictures/items/warning.png
branches/team/Thomas/integrations_common/web/pictures/items/wheel-03.gif
branches/team/Thomas/integrations_common/web/pictures/items/wheel.gif
branches/team/Thomas/integrations_common/web/pictures/items/window-left.png
branches/team/Thomas/integrations_common/web/pictures/items/window-middle.png
branches/team/Thomas/integrations_common/web/pictures/items/window-right.png
branches/team/Thomas/integrations_common/web/pictures/items/window200_left.png
branches/team/Thomas/integrations_common/web/pictures/items/window200_middle.png
branches/team/Thomas/integrations_common/web/pictures/items/window200_right.png
branches/team/Thomas/integrations_common/web/pictures/items/x_normal.gif
branches/team/Thomas/integrations_common/web/pictures/items/x_normal.png
branches/team/Thomas/integrations_common/web/pictures/items/x_over.gif
branches/team/Thomas/integrations_common/web/pictures/items/x_over.png
Removed Paths:
-------------
branches/team/Thomas/moodle/mod/liveclassroom/js/
branches/team/Thomas/moodle/mod/liveclassroom/lib/
branches/team/Thomas/moodle/mod/liveclassroom/pictures/
branches/team/Thomas/moodle/mod/voicetools/js/
branches/team/Thomas/moodle/mod/voicetools/lib/
branches/team/Thomas/moodle/mod/voicetools/pictures/
Added: branches/team/Thomas/integrations_common/php/common/WimbaCommons.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaCommons.php (rev 0)
+++ branches/team/Thomas/integrations_common/php/common/WimbaCommons.php 2008-01-16 14:49:35 UTC (rev 226)
@@ -0,0 +1,660 @@
+<?php
+/******************************************************************************
+* *
+* Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. *
+* *
+* COPYRIGHT: *
+* This software is the property of Horizon Wimba. *
+* You can redistribute it and/or mdify it under the terms of *
+* the GNU General Public License as published by the *
+* Free Software Foundation. *
+* *
+* WARRANTIES: *
+* This software is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with the Horizon Wimba Moodle Integration; *
+* if not, write to the Free Software Foundation, Inc., *
+* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
+* *
+* Author: Thomas Rollinger *
+* *
+* Date: 3th March 2007 *
+* *
+******************************************************************************/
+
+/* $Id: WimbaVoicetoolsAPI.php 45764 2007-02-28 22:04:25Z thomasr $ */
+class WimbaMoodleSession{
+
+ var $hparams=array();
+ var $url_params;
+ var $signature="";
+ var $currentVtUser ;
+ var $currentVtUserRigths;
+ var $timeOfLoad;
+ var $error=false;
+ var $request;
+
+
+ function WimbaMoodleSession($parameters=NULL){
+
+
+ $this->timeOfLoad = time();
+ $signature="";
+ $this->request=$parameters;
+ if (($this->timeOfLoad - $parameters["time"] <= 1800) && ($this->timeOfLoad - $parameters["time"] >= 0))
+ {//30 min
+ ksort($parameters);
+ foreach ($parameters as $key => $value)
+ {
+ if (strstr($key, 'enc_'))//param use to signature
+ {
+ //put this params in a map to use after more easily and to sort
+ if( $value=="")
+ $this->hparams[substr($key,4)] ="";
+ else
+ $this->hparams[substr($key,4)] =rawurldecode($value);
+ // echo $value."<br>";
+ $signature .= rawurldecode($value);
+
+ $this->url_params .= "enc_".substr($key,4)."=".rawurlencode($value)."&";
+ }
+ }
+
+ if ($parameters["signature"] != md5($signature))//good signatureature
+ {
+
+ $this->error="signature";
+
+ }
+ $this->signature=md5($signature);
+
+ $this->url_params .="signature=".rawurlencode($this->signature);
+ }
+ else//session time out
+ {
+ $this->error="session";
+
+ }
+ // / print_r($this->hparams) ;
+ }
+
+ function getCourseId(){
+
+ if(isset($this->hparams["courseId"]))
+ return $this->hparams["courseId"];
+ else
+ return null;
+ }
+
+ function getLcCurrentUser(){
+ if($this->isInstructor())
+ return $this->getCourseId()."_T";
+ else
+ return $this->getCourseId()."_S";
+ }
+
+ function setCurrentVtUSer($product,$screenName="",$email="",$role=""){
+ $this->currentVtUser = new VtUser(NULL);
+ $this->currentVtUserRigths = new VtRights(NULL);
+ if($screenName=="")
+ $this->currentVtUser->setScreenName($this->hparams["firstname"]."_".$this->hparams["lastname"]);
+ else
+ $this->currentVtUser->setScreenName($screenName);
+
+ if($email=="")
+ $this->currentVtUser->setEmail ($this->hparams["email"]);
+ else{
+ $this->currentVtUser->setEmail ( $email);
+
+ }
+
+
+ if (($role!="" && $role=="Instructor") || ($role=="" && $this->hparams["role"]=="Instructor")) {
+ $this->setVtUserRigths($product,"instructor");
+
+ }
+ else {
+
+ $this->setVtUserRigths($product,"student");
+ }
+
+ }
+ function getVtUser(){
+ return $this->currentVtUser;
+
+ }
+ function getVtUserRigths(){
+ return $this->currentVtUserRigths;
+
+ }
+ function setVtUserRigths($product,$role){
+
+ $this->currentVtUserRigths->setProfile ( 'moodle.'.$product.'.'.$role);
+ if($product=="presentation")
+ $this->currentVtUserRigths->add("reply_message");
+ }
+
+ function isInstructor(){
+
+ if($this->hparams["role"]!=null && $this->hparams["role"]=="Instructor"){
+ return true;
+ }
+ return false;
+ }
+
+
+
+ function getFirstname(){
+
+ if(isset($this->hparams["firstname"]) ){
+ return $this->hparams["firstname"];
+ }
+ return "";
+
+}
+
+ function getLastname(){
+
+ if(isset($this->hparams["lastname"]) ){
+ return $this->hparams["lastname"];
+ }
+ return "";
+
+}
+
+}
+
+
+class vtAction{
+
+ var $params;
+
+ function vtAction($params){
+ $this->params=$params;
+
+ }
+ /**************
+ VOICE BOARD
+ *****************/
+ /*
+ * This function creates a voice board on the vt server
+ * params : elements of the form
+ */
+ function createBoard(){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("board"); //Voice Baord
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"]))
+ {
+
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ if ($this->params["led"] == "student")
+ {
+
+ $options->setFilter("false");
+ if (isset($this->params["show_compose"]))
+ {
+ $options->setShowCompose("true");
+ }
+ else{
+ $options->setShowCompose("false");
+ }
+ }
+ else
+ {
+ $options->setFilter("true");
+ $options->setShowCompose("false");
+ }
+
+ //Media
+
+ if(isset($this->params["audio_format"]))
+ {
+ $audio->setName($this->params["audio_format"]);
+ }
+ //message length
+ if(isset($this->params["max_length"]))
+ {
+ $options->setMaxLength($this->params["max_length"]);
+ }
+
+ //Features
+
+ //short message titles
+ if(isset($this->params["short_title"]))
+ {
+ $options->setShortTitle("true");
+ }
+ else
+ {
+ $options->setShortTitle("false");
+ }
+ //chronological order
+ if(isset($this->params["chrono_order"]))
+ {
+ $options->setChronoOrder("true");
+ }
+ else
+ {
+ $options->setChronoOrder("false");
+ }
+
+ //forward message
+ if(isset($this->params["show_forward"]))
+ {
+ $options->setShowForward("true");
+ }
+ else
+ {
+ $options->setShowForward("false");
+ }
+
+
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+ if(VTAPI_DEBUG) {
+ error_log (__FUNCTION__ ." : Board Created , rid=".$result->getRid(), TRUE);
+ }
+
+ return $result;
+
+ }
+ /*
+ * This function modifies a voice board on the vt server
+ * params : elements of the form
+ */
+ function modifyBoard($id){
+
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("board"); //Voice Baord
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ if ($this->params["led"] == "student")
+ {
+
+ $options->setFilter("false");
+ if (isset($this->params["show_compose"]))
+ {
+ $options->setShowCompose("true");
+ }
+ else{
+ $options->setShowCompose("false");
+ }
+ }
+ else
+ {
+ $options->setFilter("true");
+ $options->setShowCompose("false");
+ }
+
+ //Media
+
+ if(isset($this->params["audio_format"]))
+ {
+ $audio->setName($this->params["audio_format"]);
+ }
+ //message length
+ if(isset($this->params["max_length"]))
+ {
+ $options->setMaxLength($this->params["max_length"]);
+ }
+
+ //Features
+
+ //short message titles
+ if(isset($this->params["short_title"]))
+ {
+ $options->setShortTitle("true");
+ }
+ else
+ {
+ $options->setShortTitle("false");
+ }
+ //chronological order
+ if(isset($this->params["chrono_order"]))
+ {
+ $options->setChronoOrder("true");
+ }
+ else
+ {
+ $options->setChronoOrder("false");
+ }
+
+ //forward message
+ if(isset($this->params["show_forward"]))
+ {
+ $options->setShowForward("true");
+ }
+ else
+ {
+ $options->setShowForward("false");
+ }
+
+
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+ //update
+ $ressource->setRid($id);
+
+ //create the resource on the vt server
+ $result = voicetools_api_modify_resource($ressource->getResource());
+ return $result;
+
+ }
+
+ /****************
+ VOICE PRESENTATION
+ ****************/
+ /*
+ * This function creates a voice presentation the vt server
+ * params : elements of the form(constructor)
+ */
+ function createPresentation(){
+
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("presentation"); //Voice Baord
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ if(isset($this->params["filter"]))
+ {
+ $options->setFilter("true");
+ }
+ else
+ {
+ $options->setFilter("false");
+ }
+ //slides comments private
+ if(isset($this->params["show_reply"]))
+ {
+ $options->setShowReply("true");
+ }
+ else
+ {
+ $options->setShowReply("false");
+ }
+
+ //Media
+ if(isset($this->params["audio_format"]))
+ {
+ $audio->setName($this->params["audio_format"]);
+ }
+ //message length
+ if(isset($this->params["max_length"]))
+ {
+ $options->setMaxLength($this->params["max_length"]);
+ }
+
+
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+ return $result;
+ }
+
+ /*
+ * This function modifies a voice presentation the vt server
+ * params : elements of the form(constructor)
+ */
+ function modifyPresentation($id){
+
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+ // Info
+ $ressource->setType("presentation"); //Voice Presentation
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+
+ if(isset($this->params["filter"]))
+ {
+ $options->setFilter("true");
+ }
+ else
+ {
+ $options->setFilter("false");
+ }
+ //slides comments private
+ if(isset($this->params["show_reply"]))
+ {
+ $options->setShowReply("true");
+ }
+ else
+ {
+ $options->setShowReply("false");
+ }
+
+ //Media
+ if(isset($this->params["audio_format"]))
+ {
+ $audio->setName($this->params["audio_format"]);
+ }
+ //message length
+ if(isset($this->params["max_length"]))
+ {
+ $options->setMaxLength($this->params["max_length"]);
+ }
+
+
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+ $ressource->setRid($id);
+ //create the resource on the vt server
+ $result = voicetools_api_modify_resource($ressource->getResource());
+ return $result;
+
+
+ }
+
+ /********
+ Podcaster
+ **********/
+ /*
+ * This function creates a podcaster the vt server
+ * params : elements of the form(constructor)
+ */
+ function createPodcaster(){
+
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+
+ // Info
+ $ressource->setType("pc");//Podcaster
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+ if(isset($this->params["show_compose"]))
+ {
+ $options->setShowCompose("true");
+ }
+ else
+ {
+ $options->setShowCompose("false");
+ }
+
+ //Media
+ if(isset($this->params["audio_format"]))
+ {
+ $audio->setName($this->params["audio_format"]);
+ }
+
+ if(isset($this->params["delay"]))
+ {
+ $options->setDelay($this->params["delay"]); //no delay
+ }
+
+ //Features
+ if(isset($this->params["short_title"]))
+ {
+ $options->setShortTitle("true");
+ }
+ else{
+ $options->setShortTitle("false");
+ }
+ $options->setMaxLength(1200); //set to 20 min
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+
+ return $result;
+ }
+ /*
+ * This function modifies a podcaster the vt server
+ * params : elements of the form(constructor)
+ */
+ function modifyPodcaster($id){
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+
+ // Info
+ $ressource->setType("pc");//Podcaster
+ if (isset($this->params["description"]))
+ {
+ $ressource->setDescription(stripslashes($this->params["description"]));
+ }
+
+ if (isset($this->params["longname"]))
+ {
+ $ressource->setTitle(stripslashes($this->params["longname"]));
+ }
+ if(isset($this->params["show_compose"]))
+ {
+ $options->setShowCompose("true");
+ }
+ else
+ {
+ $options->setShowCompose("false");
+ }
+
+ //Media
+ if(isset($this->params["audio_format"]))
+ {
+ $audio->setName($this->params["audio_format"]);
+ }
+
+ if(isset($this->params["delay"]))
+ {
+ $options->setDelay($this->params["delay"]); //no delay
+ }
+
+ //Features
+ if(isset($this->params["short_title"]))
+ {
+ $options->setShortTitle("true");
+ }
+ else{
+ $options->setShortTitle("false");
+ }
+ $options->setMaxLength(1200); //set to 20 min
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ $ressource->setRid($id);
+ //create the resource on the vt server
+ $result = voicetools_api_modify_resource($ressource->getResource());
+
+ return $result;
+ }
+ /********
+ Recorder
+ **********/
+ /*
+ * This function creates a recorder the vt server
+ * params : blocks' id
+ */
+ function createRecorder(){
+
+ $ressource = new vtResource(NULL);
+ $audio = new vtAudioFormat(NULL);
+ $options = new VtOptions(NULL);
+
+ // Info
+ $ressource->setType("recorder");
+
+
+ $options->setMaxLength(1200); //set to 20 min
+ $options->setAudioFormat($audio);
+ $ressource->setOptions($options);
+
+ //create the resource on the vt server
+ $result = voicetools_api_create_resource($ressource->getResource());
+
+ return $result;
+ }
+
+ function deleteRessource($rid)
+ {
+ $result = voicetools_api_delete_resource($rid);
+ return $result;
+ }
+
+ function getVtSession($resource,$user,$rights,$message=null)
+ {
+ if($message!=null)
+ return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights(),$message->getMessage()) ;
+ else
+ return voicetools_api_create_session ($user->getUser(),$resource->getResource(),$rights->getRights()) ;
+
+ }
+}
+
+
+
+
+?>
\ No newline at end of file
Added: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php (rev 0)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-16 14:49:35 UTC (rev 226)
@@ -0,0 +1,347 @@
+<?php
+/**
+ * Returns the keys of the general parameters passed by GET or POST
+ */
+function getKeysOfGeneralParameters(){
+
+ return array(
+ array("value"=>"enc_courseId","type"=>PARAM_INT,"default_value"=>null),
+ array("value"=>"enc_email","type"=>PARAM_CLEAN,"default_value"=>null),
+ array("value"=>"enc_firstname","type"=>PARAM_ALPHANUM,"default_value"=>null),
+ array("value"=>"enc_lastname","type"=>PARAM_ALPHANUM,"default_value"=>null),
+ array("value"=>"enc_role","type"=>PARAM_ALPHA,"default_value"=>null),
+ array("value"=>"time","type"=>PARAM_INT,"default_value"=>null),
+ array("value"=>"signature","type"=>PARAM_ALPHANUM,"default_value"=>null),
+ array("value"=>"product","type"=>PARAM_ALPHA,"default_value"=>null),
+ array("value"=>"type","type"=>PARAM_ALPHA,"default_value"=>null),
+ array("value"=>"studentView","type"=>PARAM_BOOL,"default_value"=>null),
+ array("value"=>"createWorkflow","type"=>PARAM_BOOL,"default_value"=>null),
+
+ );
+
+}
+
+
+function getKeyWimbaClassroomForm(){
+
+
+ return array (
+ 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_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;
+
+ if((isset($USER->studentview) && $USER->studentview==1) || (!empty($USER->switchrole)) ) {
+ return true;
+ }
+ return false;
+
+
+}
+function getRoleForWimbaTools($courseId,$userId){
+ global $CFG;
+ global $USER;
+ $role="";
+ if(strstr($CFG->release,"1.7")) {
+ $context = get_context_instance(CONTEXT_COURSE, $courseId) ;
+ }
+
+ //the role of the current user is switched
+ //the role of the current user is switched
+ if((isset($USER->studentview) && $USER->studentview==1)||(isset($context) && isset($USER->switchrole) && !empty($USER->switchrole) && $USER->switchrole[$context->id]>3)) {
+ $role='StudentBis';
+ } else{
+
+
+ if(isstudent($courseId)) { //Student
+ $role='Student';
+ }
+ else if (isadmin() || isteacher($courseId, $USER->id)) { // Admin, Teacher
+ $role='Instructor';
+ }
+
+ if(strstr($CFG->release,"1.7")) { // 1.7.* version
+ if (iscreator()) { // Course Creator
+ $role='Instructor';
+ }
+ else if (!isteacheredit($courseId)) { // Non-editing Teacher
+ $role='Student';
+ }
+ }
+
+ }
+
+ return $role;
+}
+
+/*
+* Give the parameters with the signature md5 to give to the frame
+* @param $courseid : the id of the current course
+* return a string with all the parameters to give to the url
+*/
+function get_url_params($courseid) {
+
+ global $USER;
+ global $CFG;
+
+ $role=getRoleForWimbaTools($courseid,$USER->id);
+ $signature = md5($courseid.$USER->email.$USER->firstname.$USER->lastname.$role);
+ $url_params = "enc_courseId=".rawurlencode($courseid).
+ "&enc_email=".rawurlencode($USER->email).
+ "&enc_firstname=".rawurlencode($USER->firstname).
+ "&enc_lastname=".rawurlencode($USER->lastname).
+ "&enc_role=".rawurlencode($role).
+ "&signature=".rawurlencode($signature);
+ return $url_params;
+}
+
+
+/* list the element of the pictures directory
+* return a String wich contains the pictures separated by a ,
+*/
+function list_dir($name,&$s) {
+
+ if ($dir = opendir($name)) {
+
+ while($file = readdir($dir)) {
+
+
+ if(is_dir($name."/".$file) && !in_array($file, array(".",".."))) {
+
+ list_dir($name."/".$file,$s);
+ }
+ else if($file!="." && $file !="..") {
+ $s.=$file.";";
+ }
+
+ }
+
+ closedir($dir);
+ }
+
+
+}
+
+function storeResource($rid,$courseId,$type,$name,$params=NULL){
+ $voicetools->rid=$rid;
+ $voicetools->course= $courseId;
+ $voicetools->name= $name;
+ $voicetools->type=$type;
+ if($params!=null){
+
+ if(isset($params["accessAvailable"]))
+ {
+ $voicetools->availability=1;
+ }
+ else
+ {
+ $voicetools->availability=0;
+ }
+ if(isset($params["start_date"]) && $params["start_date"]=="true"){
+ if($params["start_hr"]=="--")
+ {
+ $start_hr=0;
+ }
+ else
+ {
+ $start_hr=intval($params["start_hr"]);
+ }
+ if($params["start_min"]=="--")
+ {
+ $start_min=0;
+ }
+ else
+ {
+ $start_min=intval($params["start_min"]);
+ }
+ $voicetools->start_date= mktime($start_hr, $start_min,0, intval($params["start_month"]),intval($params["start_day"]), intval($params["start_year"]));
+
+
+
+
+ }
+ else
+ {
+ $voicetools->start_date=-1;
+ }
+ if(isset($params["end_date"]) && $params["end_date"]=="true"){
+ if($params["end_hr"]=="--")
+ {
+ $end_hr=0;
+ }
+ else
+ {
+ $end_hr=intval($params["end_hr"]);
+ }
+ if($params["end_min"]=="--")
+ {
+ $end_min=0;
+ }
+ else
+ {
+ $end_min=intval($params["start_min"]);
+ }
+
+ $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]),intval( $params["end_day"]), intval($params["end_year"]));
+ }
+ else
+ {
+ $voicetools->end_date="-1";
+ }
+ }
+
+ return voicetools_store_new_element($voicetools);
+
+}
+function updateResource($rid,$courseId,$type,$params){
+
+ $voicetools->rid=$rid;
+ $voicetools->course= $courseId;
+ $voicetools->type=$type;
+ if(isset($params["accessAvailable"]))
+ {
+ $voicetools->availability=1;
+ }
+ else
+ {
+ $voicetools->availability=0;
+ }
+
+ if(isset($params["start_date"]) && $params["start_date"]=="true"){
+
+ if($params["start_hr"]=="--")
+ {
+ $start_hr=0;
+ }else
+ {
+ $start_hr=intval($params["start_hr"]);
+ }
+ if($params["start_min"]=="--")
+ {
+ $start_min=0;
+ }
+ else
+ {
+ $start_min=intval($params["start_min"]);
+ }
+ $voicetools->start_date=mktime($start_hr, $start_min,0, intval($params["start_month"]), intval($params["start_day"]), intval($params["start_year"]));
+ }
+ else
+ {
+ $voicetools->start_date=-1;
+ }
+ if(isset($params["end_date"]) && $params["end_date"]=="true"){
+ if($params["end_hr"]=="--")
+ {
+ $end_hr=0;
+ }
+ else
+ {
+ $end_hr=intval($params["end_hr"]);
+ }
+ if($params["end_min"]=="--")
+ {
+ $end_min=0;
+ }
+ else
+ {
+ $end_min=intval($params["start_min"]);
+ }
+ $voicetools->end_date=mktime($end_hr, $end_min,0, intval($params["end_month"]), intval($params["end_day"]), intval($params["end_year"]));
+ }
+ else
+ {
+ $voicetools->end_date="-1";
+ }
+ // $voicetools->id=$id;
+
+ return voicetools_update_element($voicetools);
+
+}
+
+?>
Added: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php (rev 0)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-16 14:49:35 UTC (rev 226)
@@ -0,0 +1,1913 @@
+<?php
+class WimbaUI {
+ var $session;
+ var $api;
+ var $xml;
+ var $currentObject;
+ var $isArchive = "false";
+ var $lectureRoom;
+ var $discussionRoom;
+ var $isLectureRoom;
+ var $disabledSetting;
+ var $currentTab;
+ //for vt
+ var $currentObjectInformations = NULL;
+ var $currentObjectOptions = NULL;
+ var $currentObjectAudioFormat = NULL;
+ var $startSelect = false;
+ var $endSelect = false;
+ var $prefix;
+ var $id;
+
+ function WimbaUI($session, $api = NULL, $currentIdtab = "") {
+
+ $this->session = $session;
+ $this->api = $api;
+
+ $this->xml = new WimbaXml();
+ $this->currentTab = $currentIdtab;
+ if($api!=null)
+ {
+ $this->prefix=$api->getPrefix();
+ }
+ }
+
+ function setCurrentProduct($product, $object = NULL, $objectInformations = NULL) {
+ $this->product = $product;
+ $this->currentObject = $object;
+
+ if($this->currentObject == null)
+ $this->id=$this->session->getCourseId() . rand();
+
+ if ($product == "liveclassroom") {
+ if ($this->currentObject != null && $this->currentObject->isArchive()) {
+ $this->isArchive = "true";
+ }
+ if ($this->currentObject == null || $this->currentObject != null && $this->api->isStudentAdmin($this->currentObject->getRoomId(), $this->session->getCourseId() . "_S") == "false") {
+
+ $this->lectureRoom = "activeSetting";
+ $this->discussionRoom = "hiddenSetting";
+ $this->disabledSetting = "activeSetting";
+ $this->isLectureRoom = true;
+ }
+ else {
+
+ $this->lectureRoom = "hiddenSetting";
+ $this->discussionRoom = "activeSetting";
+ $this->disabledSetting = "disabledSetting";
+
+ $this->isLectureRoom = false;
+ }
+ }
+ else {
+
+ //data of the database
+ $this->currentObjectInformations = $objectInformations;
+
+ if ($this->currentObjectInformations != null && $this->currentObjectInformations->start_date != -1) {
+ $this->startSelect = true;
+
+ }
+ if ($this->currentObjectInformations != null && $this->currentObjectInformations->end_date != -1) {
+ $this->endSelect = true;
+
+ }
+
+ if ($object != null && $objectInformations != null) {
+
+ //for php 4-> object->object doesn't work
+ $this->currentObjectOptions = $object->getOptions();
+ $this->currentObjectAudioFormat = $this->currentObjectOptions->getAudioFormat();
+
+ }
+ }
+ }
+
+ //Manage the general display of the different pages
+ function getLCPrincipalView($message) {
+
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", "", "");
+ /********
+ HEADER
+ *********/
+ if($this->session->isInstructor()){
+ $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "true");
+ }else{
+ $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "false");
+
+ }
+ /********
+ MENU
+ *********/
+ $this->xml->addButtonElement("all", "all", "disabled", "pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'liveclassroom'), "javascript:LaunchElement('doAction.php','liveclassroom');");
+ if($this->session->isInstructor()){
+ $this->xml->addButtonElement("instructor", "all", "disabled", 'pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'liveclassroom'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=liveclassroom')");
+
+ $this->xml->addButtonElement("instructor", "all", "enabled", "pictures/buttons/toolbar-new", get_string('toolbar_new', 'liveclassroom'), "javascript:loadNewSettings('generateSettings.php','create','liveclassroom' ,'liveclassroom','all')");
+ $this->xml->addSpaceElement("20px", "instructor");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-content", get_string('toolbar_content', 'liveclassroom'), "javascript:openContent('doAction.php');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-poll", get_string('toolbar_reports', 'liveclassroom'), "javascript:openReport('doAction.php');");
+ $this->xml->addSpaceElement("10px", "instructor");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'liveclassroom'), "javascript:editSettings('generateSettings.php','all');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'liveclassroom'), "javascript:deleteResource('doAction.php');");
+ $this->xml->addSpaceElement("50px", "instructor");
+ }else{
+ $this->xml->addSpaceElement("300px", "instructor");
+ }
+ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari'))
+ $this->xml->addSearchElement("all", "Safari");
+ else
+ $this->xml->addSearchElement("all", "other");
+ /********
+ MESSAGE BAR
+ *********/
+
+
+ if (isset ($message) && $message!="") {
+ $this->xml->addMessage($message);
+ }
+
+ $rooms=$this->getListLiveClassroom();
+ if($rooms!=false || $rooms==null)
+
+ $this->xml->addProduct("liveclassroom", "productType", "Live classroom", "liveclassroom",$rooms , get_string('list_no_liveclassrooms', 'liveclassroom'));
+ else {
+ //problem to get the vt resource
+ $this->xml->setError(get_string("error_connection_lc", "liveclassroom"));
+
+ }
+
+
+
+ return $this->xml->getXml();
+ }
+
+
+
+ function getVTPrincipalView($message) {
+
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", "", "");
+ /********
+ HEADER
+ *********/
+ if($this->session->isInstructor()){
+ $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "true");
+ }else{
+ $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "false");
+
+ }
+ /********
+ MENU
+ *********/
+ $this->xml->addButtonElement("all", "all", "disabled", "pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'voicetools'), "javascript:LaunchElement('manageAction.php','voicetools');");
+ if($this->session->isInstructor()){
+ $this->xml->addButtonElement("instructor", "all", "disabled", 'pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'voicetools'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=voicetools')");
+ $this->xml->addButtonElement("instructor", "all", "enabled", "pictures/buttons/toolbar-new", get_string('toolbar_new', 'voicetools'), "javascript:launchAjaxRequest('getXmlChoicePage.php','create' ,'true','all')");
+ $this->xml->addSpaceElement("150px", "instructor");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'voicetools'), "javascript:editSettings('getXmlNewPanel.php','all');");
+ $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'voicetools'), "javascript:deleteResource('manageAction.php');");
+ $this->xml->addSpaceElement("50px", "instructor");
+ }else{
+ $this->xml->addSpaceElement("300px", "instructor");
+ }
+ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari'))
+ $this->xml->addSearchElement("all", "Safari");
+ else
+ $this->xml->addSearchElement("all", "other");
+ /********
+ MESSAGE BAR
+ *********/
+
+ $resources = $this->getListVoiceTools();
+
+ if ($resources != null) {
+ $this->xml->addProduct("voicetools", "productType", "Voice Board", "board", $resources["board"], get_string('list_no_boards', 'voicetools'));
+ $this->xml->addProduct("voicetools", "productType", "Voice Presentation", "presentation", $resources["presentation"], get_string('list_no_presentations', 'voicetools'));
+ $this->xml->addProduct("voicetools", "productType", "Podcaster", "pc", $resources["pc"], get_string('list_no_pcs', 'voicetools'));
+ }
+ else {
+ //problem to get the vt resource
+ $this->xml->setError(get_string("error_connection_vt", "voicetools"));
+
+ }
+ if (isset ($message) && $message!="") {
+ $this->xml->addMessage($message);
+ }
+ return $this->xml->getXml();
+ }
+
+ function setError($error) {
+
+ $this->xml->setError($error);
+ return $this->xml->getXml();
+ }
+
+ function getListVoiceTools() {
+ //get the list of the boards
+ $list = voicetools_get_voicetools_list($this->session->hparams["courseId"]);
+
+ $vtResources = voicetools_api_get_resources($list["rid"]);
+
+ if ($vtResources == null) {
+
+ return null;
+
+ }
+ $board = array ();
+ $presentation = array ();
+ $podcaster = array ();
+ $allVt = array ();
+ if (isset ($vtResources))
+ $ressources = $vtResources->getResources();
+
+ for ($i = 0; $i < count($ressources); $i++) {
+ $resource = $vtResources->getResource($i);
+
+ $rid = $resource->getRid();
+ if ($list["info"][$rid]->availability == "0") {
+ $preview = false;
+ }
+ elseif ($list["info"][$rid]->start_date == -1 && $list["info"][$rid]->end_date == -1) {
+ $preview = true;
+ }
+ elseif ($list["info"][$rid]->start_date == -1 && time() <= $list["info"][$rid]->end_date) {
+ $preview = true;
+ }
+ elseif ($list["info"][$rid]->start_date < time() && $list["info"][$rid]->end_date == -1) {
+ $preview = true;
+ }
+ elseif ($list["info"][$rid]->start_date < time() && time() < $list["info"][$rid]->end_date) {
+ $preview = true;
+ }
+ else {
+ $preview = false;
+ }
+
+ $xmlResource = new XmlResource($rid, $resource->getTitle(), $preview, "manageAction.php", $this->session->url_params . "&time=" . time() . "&action=launch");
+ $xmlResource->setTooltipAvailability(get_string("tooltipVT_" . $preview . "_student", "voicetools"));
+ if ($this->session->isInstructor() || !$this->session->isInstructor() && $preview == true) {
+ if ($resource->getType() == "board") {
+ $xmlResource->setType("board");
+ $board[$resource->getTitle() . $resource->getRid()] = $xmlResource;
+ }
+ elseif ($resource->getType() == "presentation") {
+ $xmlResource->setType("presentation");
+ $presentation[$resource->getTitle() . $resource->getRid()] = $xmlResource;
+ }
+ elseif ($resource->getType() == "pc") {
+ $xmlResource->setType("pc");
+ $podcaster[$resource->getTitle() . $resource->getRid()] = $xmlResource;
+ }
+ }
+ }
+ $allVt["board"] = $board;
+ $allVt["presentation"] = $presentation;
+ $allVt["pc"] = $podcaster;
+ return $allVt;
+ }
+
+ function getLCSettingsView($update, $createWorkflow) {
+
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", $CFG->voicetools_servername, "");
+ /********
+ HEADER
+ *********/
+ $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true");
+
+ if($update=="update"){
+
+ $this->xml->addContextElement(get_string("contextbar_settings", "liveclassroom"), get_string("general_" . $this->product, "liveclassroom"), $this->currentObject->getLongname(), "");
+ }else{
+
+ $this->xml->addContextElement(get_string("contextbar_settings", "liveclassroom"), get_string("general_" . $this->product, "liveclassroom"), get_string("contextbar_new_" . $this->product, "liveclassroom"), "");
+
+ }
+
+
+ /********
+ * Settings tabs
+ */
+ $this->createLcInfoPanel();
+ $this->createLcMediaPanel();
+ $this->createLcFeaturesPanel();
+ $this->createLcChatPanel();
+ $this->createLcAccessPanel();
+ if ($update == "update" && $this->currentObject != null && !$this->currentObject->isArchive()) {
+ $this->createLcAdvancedPanel();
+ }
+ $this->xml->createValidationButtonElement(get_string("validationElement_ok", "liveclassroom"), "actionHide", "javascript:launchAjaxRequest('generateListRooms.php','',true,'all')", "advanced_Ok");
+
+ if ($createWorkflow == "true")
+ $this->xml->createValidationButtonElement(get_string("validationElement_cancel", "liveclassroom"), "action", "javascript:redirectToActivity('doAction.php','redirection','','" . $createWorkflow . "')", "setting_Cancel");
+ else
+ $this->xml->createValidationButtonElement(get_string("validationElement_cancel", "liveclassroom"), "action", "javascript:launchAjaxRequest('generateListRooms.php','',true,'all')", "setting_Cancel");
+ if ($update != "update") {
+ $this->xml->createValidationButtonElement(get_string("validationElement_create", "liveclassroom"), "action", "javascript:submitForm('doAction.php','create','".$this->id."','" . $createWorkflow . "')", "setting_Create");
+ }
+ else {
+ $this->xml->createValidationButtonElement(get_string("validationElement_saveAll", "liveclassroom"), "action", "javascript:submitForm('doAction.php','update','".$this->currentObject->getRoomId()."')", "setting_Save");
+ }
+ return $this->xml->getXml();
+ }
+
+ function getVTSettingsView($update, $createWorkflow) {
+ //list_dir("pictures",$pictures);//list the directory
+ /********
+ SESSION
+ *********/
+ $this->xml->CreateInformationElement($this->session->timeOfLoad, $this->session->hparams["firstname"], $this->session->hparams["lastname"], $this->session->hparams["email"], $this->session->hparams["role"], $this->session->hparams["courseId"], $this->session->signature, "", "", "", "");
+ /********
+ HEADER
+ *********/
+ $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true");
+ if($update=="update"){
+ $this->xml->addContextElement(get_string("contextbar_settings", "voicetools"), get_string("general_" . $this->product, "voicetools"), $this->currentObject->getTitle(), "");
+
+ }else{
+ $this->xml->addContextElement(get_string("contextbar_settings", "voicetools"), get_string("general_" . $this->product, "voicetools"), get_string("contextbar_new_" . $this->product, "voicetools"), "");
+ }
+
+ /********
+ * Settings tabs
+ */
+ if ($this->product == "board") {
+ $this->createGeneralInfoPanelStart();
+ $this->createGeneralInfoPanelEnd();
+ $this->createVBInfoPanel();
+ //Media settings
+ $this->createVBVPMediaPanel();
+ $this->createVBFeaturesPanel();
+ $this->createVTAccessPanel();
+ }
+ elseif ($this->product == "presentation") {
+ $this->createGeneralInfoPanelStart();
+ $this->createGeneralInfoPanelEnd();
+ $this->createVPInfoPanel();
+ //Media settings
+ $this->createVBVPMediaPanel();
+ $this->createVTAccessPanel();
+ }
+ elseif ($this->product == "pc") {
+ $this->createGeneralInfoPanelStart();
+ $thi...
[truncated message content] |
|
From: <tro...@us...> - 2008-01-15 19:21:19
|
Revision: 225
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=225&view=rev
Author: trollinger
Date: 2008-01-15 11:21:18 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
delete the unused stuff
Removed Paths:
-------------
trunk/moodle/mod/liveclassroom/lib/
trunk/moodle/mod/voicetools/js/
trunk/moodle/mod/voicetools/lib/
trunk/moodle/mod/voicetools/pictures/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 19:11:15
|
Revision: 224
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=224&view=rev
Author: trollinger
Date: 2008-01-15 11:10:51 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
move the vt library into the library directory
Added Paths:
-----------
trunk/integrations_common/php/vt/
Removed Paths:
-------------
trunk/moodle/mod/voicetools/lib/vt/
Copied: trunk/integrations_common/php/vt (from rev 223, trunk/moodle/mod/voicetools/lib/vt)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 19:09:32
|
Revision: 223
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=223&view=rev
Author: trollinger
Date: 2008-01-15 11:09:27 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
move the pictures into the library directory
Added Paths:
-----------
trunk/integrations_common/web/pictures/
Removed Paths:
-------------
trunk/moodle/mod/liveclassroom/pictures/
Copied: trunk/integrations_common/web/pictures (from rev 222, trunk/moodle/mod/liveclassroom/pictures)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 19:09:12
|
Revision: 222
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=222&view=rev
Author: trollinger
Date: 2008-01-15 11:08:22 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
move the js library into the library directory
Added Paths:
-----------
trunk/integrations_common/web/js/
Removed Paths:
-------------
trunk/moodle/mod/liveclassroom/js/
Copied: trunk/integrations_common/web/js (from rev 221, trunk/moodle/mod/liveclassroom/js)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 19:07:42
|
Revision: 221
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=221&view=rev
Author: trollinger
Date: 2008-01-15 11:07:31 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
move the lc library into the library directory
Added Paths:
-----------
trunk/integrations_common/php/lc/
Removed Paths:
-------------
trunk/moodle/mod/liveclassroom/lib/lc/
Copied: trunk/integrations_common/php/lc (from rev 220, trunk/moodle/mod/liveclassroom/lib/lc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 19:05:18
|
Revision: 220
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=220&view=rev
Author: trollinger
Date: 2008-01-15 11:04:21 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
move the common library into the library directory
Added Paths:
-----------
trunk/integrations_common/php/common/
Removed Paths:
-------------
trunk/moodle/mod/liveclassroom/lib/common/
Copied: trunk/integrations_common/php/common (from rev 219, trunk/moodle/mod/liveclassroom/lib/common)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 19:02:05
|
Revision: 219
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=219&view=rev
Author: trollinger
Date: 2008-01-15 11:01:59 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
change the repository structure
Added Paths:
-----------
trunk/integrations_common/php/
trunk/integrations_common/web/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tro...@us...> - 2008-01-15 14:34:56
|
Revision: 218
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=218&view=rev
Author: trollinger
Date: 2008-01-15 06:34:49 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
chnage the svn structure
Added Paths:
-----------
trunk/moodle/blocks/
Removed Paths:
-------------
trunk/blocks/
Copied: trunk/moodle/blocks (from rev 217, trunk/blocks)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|