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