[Hw4mdl-svn] SF.net SVN: hw4mdl: [231] branches/team/Thomas/integrations_common
Brought to you by:
jhlinder,
trollinger
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. |