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.
|