Thread: [Hw4mdl-svn] SF.net SVN: hw4mdl: [5] trunk/moodle/mod
Brought to you by:
jhlinder,
trollinger
From: <hu...@us...> - 2006-04-20 05:55:37
|
Revision: 5 Author: hugues Date: 2006-04-19 22:55:30 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=5&view=rev Log Message: ----------- switched the link to nusoap to the version available from within moodle, Voice Direct is now displayed with an nid Modified Paths: -------------- trunk/moodle/mod/liveclassroom/view.php trunk/moodle/mod/voicedirect/lib.php trunk/moodle/mod/voicedirect/view.php trunk/moodle/mod/voicetoolapi.php Removed Paths: ------------- trunk/moodle/mod/voicetoolnusoap.php Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-04-18 14:40:02 UTC (rev 4) +++ trunk/moodle/mod/liveclassroom/view.php 2006-04-20 05:55:30 UTC (rev 5) @@ -63,12 +63,17 @@ /// Print the main part of the page ?> -<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> +<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch-7892.js'></script> <script type="text/javascript"> function doOpenAdmin(url) { var w = window.open(url, 'lc_admin_popup', 'scrollbars=yes, resizable=yes, width=800, height=500'); w.focus(); } + + function myStartHorizon() { + document.cookie="request_uri=; path=/" + startHorizon(null,null,null,null,null,'hzA=<?php p($usersession)?>'); + } </script> <table style="background-color: #ffffff !important; border-left : 1px solid #999; border-right : 1px solid #999; border-top : 1px solid #999;border-bottom : 1px solid #999;" width="100%" cellspacing="0" cellpadding="0" border="0" align="center" summary="layout"> @@ -86,7 +91,8 @@ </td></tr> <tr> <td> - <a href="javascript:startHorizon(null,null,null,null,null,'hzA=<?php p($usersession)?>')"> + <!--a href="javascript:myStartHorizon()"--> + <a href="javascript:startHorizon()"> <?php p(get_string("accessrooms", 'liveclassroom')) ?> </a> </td> Modified: trunk/moodle/mod/voicedirect/lib.php =================================================================== --- trunk/moodle/mod/voicedirect/lib.php 2006-04-18 14:40:02 UTC (rev 4) +++ trunk/moodle/mod/voicedirect/lib.php 2006-04-20 05:55:30 UTC (rev 5) @@ -31,7 +31,7 @@ error('Data not created correctly'); } - print_r($data); + //print_r($data); if (!$result = voicedirect_create_resource ($data)) { error('Cannot create the resource on the VT server'); @@ -222,7 +222,7 @@ $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); - print_r ($result); + //print_r ($result); if (empty($result)){ error ("Empty result after call to $VT_API_SERVICES"); @@ -246,7 +246,7 @@ add_to_log($voicedirect->course, "voicedirect", "", "", "Creating Data for Voice Direct Session"); $user = new PairSet (); - $user->addNameValuePair ('screen_name', $USER->firstname."_"$USER->lastname); + $user->addNameValuePair ('screen_name', $USER->firstname."_".$USER->lastname); $user->addNameValuePair ('email', $USER->email); $resource = new PairSet (); @@ -267,8 +267,44 @@ 'rights' => $rights->getData() ); } +/** + * Create the session for a voice direct applet. + * @param - the voicedirect information + * @return - the mid to insert into the html + */ +function voicedirect_create_session ($voicedirect) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_SESSION; -function voicedirect_create_session () { + + $sessiondata = voicedirect_create_session_data($voicedirect); + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $sessiondata['user'], + $sessiondata['resource'], + $sessiondata['message'], + $sessiondata['rights']); + + //print_r($resource); + + $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); + + //print_r ($result); + + if (empty($result)){ + error ("Empty result after call to $VT_API_SERVICES"); + return false; + } + + foreach ($result['values'] as $item) { + $values[$item['name']] = $item['value']; + } + + return $values['nid']; } Modified: trunk/moodle/mod/voicedirect/view.php =================================================================== --- trunk/moodle/mod/voicedirect/view.php 2006-04-18 14:40:02 UTC (rev 4) +++ trunk/moodle/mod/voicedirect/view.php 2006-04-20 05:55:30 UTC (rev 5) @@ -38,7 +38,9 @@ add_to_log($course->id, "voicedirect", "view", "view.php?id=$cm->id", "$voicedirect->id"); - $nid = voicedirect_create_session ($voicedirect); + if (!$nid = voicedirect_create_session ($voicedirect)) { + error(get_string ('cannotgetsession', 'voicedirect')); + } @@ -51,16 +53,41 @@ $strvoicedirects = get_string("modulenameplural", "voicedirect"); $strvoicedirect = get_string("modulename", "voicedirect"); + global $CFG; + + $servername = $CFG->voicetool_servername; + print_header("$course->shortname: $voicedirect->name", "$course->fullname", "$navigation <A HREF=index.php?id=$course->id>$strvoicedirects</A> -> $voicedirect->name", "", "", true, update_module_button($cm->id, $course->id, $strvoicedirect), navmenu($course, $cm)); /// Print the main part of the page +?> +<SCRIPT type="text/javascript"> + this.focus(); +</SCRIPT> +<SCRIPT type="text/javascript" SRC="<?php echo $servername ?>/voicedirect/voicedirect.js"></SCRIPT> +<SCRIPT type="text/javascript"> + var w_p = new Object(); + w_p.view_archives_url="<?php echo $servername ?>/board?action=display_popup&language=fr&width=545&height=805"; + w_p.view_archives_target = "wimba_archives"; + w_p.language="fr"; + + w_p.nid="<?php echo $nid?>"; + + if (window.w_voicedirect_tag) w_voicedirect_tag(w_p); + else document.write("Applet should be there, but the Voice Tools server is down"); +</SCRIPT> +<NOSCRIPT> +Your browser does not seem to be configured correctly to be able to use Horizon Wimba +Tools. Please go through the +<a href="<?php echo $servername ?>/wizard/launcher.jsp"> Setup Wizard</a> to configure it correctly. +</NOSCRIPT> - echo "YOUR CODE GOES HERE"; + - +<?php /// Finish the page print_footer($course); Modified: trunk/moodle/mod/voicetoolapi.php =================================================================== --- trunk/moodle/mod/voicetoolapi.php 2006-04-18 14:40:02 UTC (rev 4) +++ trunk/moodle/mod/voicetoolapi.php 2006-04-20 05:55:30 UTC (rev 5) @@ -1,7 +1,7 @@ <?PHP // $Id:$ -require_once("$CFG->dirroot/mod/voicetoolnusoap.php"); +require_once("$CFG->dirroot/lib/nusoap/nusoap.php"); /// Library of functions and constants for the voicetool API @@ -17,12 +17,10 @@ $VT_API_SERVICES = '/services/Broker?wsdl'; $VT_API_CREATE_RESOURCE = 'createResource'; +$VT_API_CREATE_SESSION = 'createSession'; - - - //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// Deleted: trunk/moodle/mod/voicetoolnusoap.php =================================================================== --- trunk/moodle/mod/voicetoolnusoap.php 2006-04-18 14:40:02 UTC (rev 4) +++ trunk/moodle/mod/voicetoolnusoap.php 2006-04-20 05:55:30 UTC (rev 5) @@ -1,6859 +0,0 @@ -<?php - -/* -$Id: nusoap.php,v 1.91 2005/06/06 21:26:55 snichol Exp $ - -NuSOAP - Web Services Toolkit for PHP - -Copyright (c) 2002 NuSphere Corporation - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library 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 -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -If you have any questions or comments, please email: - -Dietrich Ayala -di...@ga... -http://dietrich.ganx4.com/nusoap - -NuSphere Corporation -http://www.nusphere.com - -*/ - -/* load classes - -// necessary classes -require_once('class.soapclient.php'); -require_once('class.soap_val.php'); -require_once('class.soap_parser.php'); -require_once('class.soap_fault.php'); - -// transport classes -require_once('class.soap_transport_http.php'); - -// optional add-on classes -require_once('class.xmlschema.php'); -require_once('class.wsdl.php'); - -// server class -require_once('class.soap_server.php');*/ - -// class variable emulation -// cf. http://www.webkreator.com/php/techniques/php-static-class-variables.html -$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = 9; - -/** -* -* nusoap_base -* -* @author Dietrich Ayala <die...@ga...> -* @version $Id: nusoap.php,v 1.91 2005/06/06 21:26:55 snichol Exp $ -* @access public -*/ -class nusoap_base { - /** - * Identification for HTTP headers. - * - * @var string - * @access private - */ - var $title = 'NuSOAP'; - /** - * Version for HTTP headers. - * - * @var string - * @access private - */ - var $version = '0.7.1'; - /** - * CVS revision for HTTP headers. - * - * @var string - * @access private - */ - var $revision = '$Revision: 1.91 $'; - /** - * Current error string (manipulated by getError/setError) - * - * @var string - * @access private - */ - var $error_str = ''; - /** - * Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment) - * - * @var string - * @access private - */ - var $debug_str = ''; - /** - * toggles automatic encoding of special characters as entities - * (should always be true, I think) - * - * @var boolean - * @access private - */ - var $charencoding = true; - /** - * the debug level for this instance - * - * @var integer - * @access private - */ - var $debugLevel; - - /** - * set schema version - * - * @var string - * @access public - */ - var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'; - - /** - * charset encoding for outgoing messages - * - * @var string - * @access public - */ - var $soap_defencoding = 'ISO-8859-1'; - //var $soap_defencoding = 'UTF-8'; - - /** - * namespaces in an array of prefix => uri - * - * this is "seeded" by a set of constants, but it may be altered by code - * - * @var array - * @access public - */ - var $namespaces = array( - 'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/', - 'xsd' => 'http://www.w3.org/2001/XMLSchema', - 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance', - 'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/', - 'si' => 'http://soapinterop.org/xsd'); - - /** - * namespaces used in the current context - * - * @var array - * @access private - */ - var $usedNamespaces = array(); - - /** - * XML Schema types in an array of uri => (array of xml type => php type) - * is this legacy yet? - * no, this is used by the xmlschema class to verify type => namespace mappings. - * @var array - * @access public - */ - var $typemap = array( - 'http://www.w3.org/2001/XMLSchema' => array( - 'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double', - 'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'', - 'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string', - // abstract "any" types - 'anyType'=>'string','anySimpleType'=>'string', - // derived datatypes - 'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'', - 'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer', - 'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer', - 'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''), - 'http://www.w3.org/2000/10/XMLSchema' => array( - 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', - 'float'=>'double','dateTime'=>'string', - 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), - 'http://www.w3.org/1999/XMLSchema' => array( - 'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', - 'float'=>'double','dateTime'=>'string', - 'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), - 'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'), - 'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'), - 'http://xml.apache.org/xml-soap' => array('Map') - ); - - /** - * XML entities to convert - * - * @var array - * @access public - * @deprecated - * @see expandEntities - */ - var $xmlEntities = array('quot' => '"','amp' => '&', - 'lt' => '<','gt' => '>','apos' => "'"); - - /** - * constructor - * - * @access public - */ - function nusoap_base() { - $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel; - } - - /** - * gets the global debug level, which applies to future instances - * - * @return integer Debug level 0-9, where 0 turns off - * @access public - */ - function getGlobalDebugLevel() { - return $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel; - } - - /** - * sets the global debug level, which applies to future instances - * - * @param int $level Debug level 0-9, where 0 turns off - * @access public - */ - function setGlobalDebugLevel($level) { - $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = $level; - } - - /** - * gets the debug level for this instance - * - * @return int Debug level 0-9, where 0 turns off - * @access public - */ - function getDebugLevel() { - return $this->debugLevel; - } - - /** - * sets the debug level for this instance - * - * @param int $level Debug level 0-9, where 0 turns off - * @access public - */ - function setDebugLevel($level) { - $this->debugLevel = $level; - } - - /** - * adds debug data to the instance debug string with formatting - * - * @param string $string debug data - * @access private - */ - function debug($string){ - if ($this->debugLevel > 0) { - $this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n"); - } - } - - /** - * adds debug data to the instance debug string without formatting - * - * @param string $string debug data - * @access public - */ - function appendDebug($string){ - if ($this->debugLevel > 0) { - // it would be nice to use a memory stream here to use - // memory more efficiently - $this->debug_str .= $string; - } - } - - /** - * clears the current debug data for this instance - * - * @access public - */ - function clearDebug() { - // it would be nice to use a memory stream here to use - // memory more efficiently - $this->debug_str = ''; - } - - /** - * gets the current debug data for this instance - * - * @return debug data - * @access public - */ - function &getDebug() { - // it would be nice to use a memory stream here to use - // memory more efficiently - return $this->debug_str; - } - - /** - * gets the current debug data for this instance as an XML comment - * this may change the contents of the debug data - * - * @return debug data as an XML comment - * @access public - */ - function &getDebugAsXMLComment() { - // it would be nice to use a memory stream here to use - // memory more efficiently - while (strpos($this->debug_str, '--')) { - $this->debug_str = str_replace('--', '- -', $this->debug_str); - } - return "<!--\n" . $this->debug_str . "\n-->"; - } - - /** - * expands entities, e.g. changes '<' to '<'. - * - * @param string $val The string in which to expand entities. - * @access private - */ - function expandEntities($val) { - if ($this->charencoding) { - $val = str_replace('&', '&', $val); - $val = str_replace("'", ''', $val); - $val = str_replace('"', '"', $val); - $val = str_replace('<', '<', $val); - $val = str_replace('>', '>', $val); - } - return $val; - } - - /** - * returns error string if present - * - * @return mixed error string or false - * @access public - */ - function getError(){ - if($this->error_str != ''){ - return $this->error_str; - } - return false; - } - - /** - * sets error string - * - * @return boolean $string error string - * @access private - */ - function setError($str){ - $this->error_str = $str; - } - - /** - * detect if array is a simple array or a struct (associative array) - * - * @param mixed $val The PHP array - * @return string (arraySimple|arrayStruct) - * @access private - */ - function isArraySimpleOrStruct($val) { - $keyList = array_keys($val); - foreach ($keyList as $keyListValue) { - if (!is_int($keyListValue)) { - return 'arrayStruct'; - } - } - return 'arraySimple'; - } - - /** - * serializes PHP values in accordance w/ section 5. Type information is - * not serialized if $use == 'literal'. - * - * @param mixed $val The value to serialize - * @param string $name The name (local part) of the XML element - * @param string $type The XML schema type (local part) for the element - * @param string $name_ns The namespace for the name of the XML element - * @param string $type_ns The namespace for the type of the element - * @param array $attributes The attributes to serialize as name=>value pairs - * @param string $use The WSDL "use" (encoded|literal) - * @return string The serialized element, possibly with child elements - * @access public - */ - function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded'){ - $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use"); - $this->appendDebug('value=' . $this->varDump($val)); - $this->appendDebug('attributes=' . $this->varDump($attributes)); - - if(is_object($val) && get_class($val) == 'soapval'){ - return $val->serialize($use); - } - // force valid name if necessary - if (is_numeric($name)) { - $name = '__numeric_' . $name; - } elseif (! $name) { - $name = 'noname'; - } - // if name has ns, add ns prefix to name - $xmlns = ''; - if($name_ns){ - $prefix = 'nu'.rand(1000,9999); - $name = $prefix.':'.$name; - $xmlns .= " xmlns:$prefix=\"$name_ns\""; - } - // if type is prefixed, create type prefix - if($type_ns != '' && $type_ns == $this->namespaces['xsd']){ - // need to fix this. shouldn't default to xsd if no ns specified - // w/o checking against typemap - $type_prefix = 'xsd'; - } elseif($type_ns){ - $type_prefix = 'ns'.rand(1000,9999); - $xmlns .= " xmlns:$type_prefix=\"$type_ns\""; - } - // serialize attributes if present - $atts = ''; - if($attributes){ - foreach($attributes as $k => $v){ - $atts .= ' $k="'.$this->expandEntities($v).'"'; - } - } - // serialize null value - if (is_null($val)) { - if ($use == 'literal') { - // TODO: depends on minOccurs - return "<$name$xmlns $atts/>"; - } else { - if (isset($type) && isset($type_prefix)) { - $type_str = " xsi:type=\"$type_prefix:$type\""; - } else { - $type_str = ''; - } - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; - } - } - // serialize if an xsd built-in primitive type - if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){ - if (is_bool($val)) { - if ($type == 'boolean') { - $val = $val ? 'true' : 'false'; - } elseif (! $val) { - $val = 0; - } - } else if (is_string($val)) { - $val = $this->expandEntities($val); - } - if ($use == 'literal') { - return "<$name$xmlns $atts>$val</$name>"; - } else { - return "<$name$xmlns $atts xsi:type=\"xsd:$type\">$val</$name>"; - } - } - // detect type and serialize - $xml = ''; - switch(true) { - case (is_bool($val) || $type == 'boolean'): - if ($type == 'boolean') { - $val = $val ? 'true' : 'false'; - } elseif (! $val) { - $val = 0; - } - if ($use == 'literal') { - $xml .= "<$name$xmlns $atts>$val</$name>"; - } else { - $xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>"; - } - break; - case (is_int($val) || is_long($val) || $type == 'int'): - if ($use == 'literal') { - $xml .= "<$name$xmlns $atts>$val</$name>"; - } else { - $xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>"; - } - break; - case (is_float($val)|| is_double($val) || $type == 'float'): - if ($use == 'literal') { - $xml .= "<$name$xmlns $atts>$val</$name>"; - } else { - $xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>"; - } - break; - case (is_string($val) || $type == 'string'): - $val = $this->expandEntities($val); - if ($use == 'literal') { - $xml .= "<$name$xmlns $atts>$val</$name>"; - } else { - $xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>"; - } - break; - case is_object($val): - $name = get_class($val); - foreach(get_object_vars($val) as $k => $v){ - $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use); - } - $xml .= '<'.$name.'>'.$pXml.'</'.$name.'>'; - break; - break; - case (is_array($val) || $type): - // detect if struct or array - $valueType = $this->isArraySimpleOrStruct($val); - if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){ - $i = 0; - if(is_array($val) && count($val)> 0){ - foreach($val as $v){ - if(is_object($v) && get_class($v) == 'soapval'){ - $tt_ns = $v->type_ns; - $tt = $v->type; - } elseif (is_array($v)) { - $tt = $this->isArraySimpleOrStruct($v); - } else { - $tt = gettype($v); - } - $array_types[$tt] = 1; - $xml .= $this->serialize_val($v,'item',false,false,false,false,$use); - ++$i; - } - if(count($array_types) > 1){ - $array_typename = 'xsd:anyType'; - } elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) { - if ($tt == 'integer') { - $tt = 'int'; - } - $array_typename = 'xsd:'.$tt; - } elseif(isset($tt) && $tt == 'arraySimple'){ - $array_typename = 'SOAP-ENC:Array'; - } elseif(isset($tt) && $tt == 'arrayStruct'){ - $array_typename = 'unnamed_struct_use_soapval'; - } else { - // if type is prefixed, create type prefix - if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){ - $array_typename = 'xsd:' . $tt; - } elseif ($tt_ns) { - $tt_prefix = 'ns' . rand(1000, 9999); - $array_typename = "$tt_prefix:$tt"; - $xmlns .= " xmlns:$tt_prefix=\"$tt_ns\""; - } else { - $array_typename = $tt; - } - } - $array_type = $i; - if ($use == 'literal') { - $type_str = ''; - } else if (isset($type) && isset($type_prefix)) { - $type_str = " xsi:type=\"$type_prefix:$type\""; - } else { - $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\""; - } - // empty array - } else { - if ($use == 'literal') { - $type_str = ''; - } else if (isset($type) && isset($type_prefix)) { - $type_str = " xsi:type=\"$type_prefix:$type\""; - } else { - $type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\""; - } - } - $xml = "<$name$xmlns$type_str$atts>".$xml."</$name>"; - } else { - // got a struct - if(isset($type) && isset($type_prefix)){ - $type_str = " xsi:type=\"$type_prefix:$type\""; - } else { - $type_str = ''; - } - if ($use == 'literal') { - $xml .= "<$name$xmlns $atts>"; - } else { - $xml .= "<$name$xmlns$type_str$atts>"; - } - foreach($val as $k => $v){ - // Apache Map - if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') { - $xml .= '<item>'; - $xml .= $this->serialize_val($k,'key',false,false,false,false,$use); - $xml .= $this->serialize_val($v,'value',false,false,false,false,$use); - $xml .= '</item>'; - } else { - $xml .= $this->serialize_val($v,$k,false,false,false,false,$use); - } - } - $xml .= "</$name>"; - } - break; - default: - $xml .= 'not detected, got '.gettype($val).' for '.$val; - break; - } - return $xml; - } - - /** - * serialize message - * - * @param string body - * @param string headers optional - * @param array namespaces optional - * @param string style optional (rpc|document) - * @param string use optional (encoded|literal) - * @param string encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) - * @return string message - * @access public - */ - function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){ - // TODO: add an option to automatically run utf8_encode on $body and $headers - // if $this->soap_defencoding is UTF-8. Not doing this automatically allows - // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1 - - // serialize namespaces - $ns_string = ''; - foreach(array_merge($this->namespaces,$namespaces) as $k => $v){ - $ns_string .= " xmlns:$k=\"$v\""; - } - if($encodingStyle) { - $ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string"; - } - - // serialize headers - if($headers){ - $headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>"; - } - // serialize envelope - return - '<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">". - '<SOAP-ENV:Envelope'.$ns_string.">". - $headers. - "<SOAP-ENV:Body>". - $body. - "</SOAP-ENV:Body>". - "</SOAP-ENV:Envelope>"; - } - - /** - * formats a string to be inserted into an HTML stream - * - * @param string $str The string to format - * @return string The formatted string - * @access public - * @deprecated - */ - function formatDump($str){ - $str = htmlspecialchars($str); - return nl2br($str); - } - - /** - * contracts (changes namespace to prefix) a qualified name - * - * @param string $string qname - * @return string contracted qname - * @access private - */ - function contractQname($qname){ - // get element namespace - //$this->xdebug("Contract $qname"); - if (strrpos($qname, ':')) { - // get unqualified name - $name = substr($qname, strrpos($qname, ':') + 1); - // get ns - $ns = substr($qname, 0, strrpos($qname, ':')); - $p = $this->getPrefixFromNamespace($ns); - if ($p) { - return $p . ':' . $name; - } - return $qname; - } else { - return $qname; - } - } - - /** - * expands (changes prefix to namespace) a qualified name - * - * @param string $string qname - * @return string expanded qname - * @access private - */ - function expandQname($qname){ - // get element prefix - if(strpos($qname,':') && !ereg('^http://',$qname)){ - // get unqualified name - $name = substr(strstr($qname,':'),1); - // get ns prefix - $prefix = substr($qname,0,strpos($qname,':')); - if(isset($this->namespaces[$prefix])){ - return $this->namespaces[$prefix].':'.$name; - } else { - return $qname; - } - } else { - return $qname; - } - } - - /** - * returns the local part of a prefixed string - * returns the original string, if not prefixed - * - * @param string $str The prefixed string - * @return string The local part - * @access public - */ - function getLocalPart($str){ - if($sstr = strrchr($str,':')){ - // get unqualified name - return substr( $sstr, 1 ); - } else { - return $str; - } - } - - /** - * returns the prefix part of a prefixed string - * returns false, if not prefixed - * - * @param string The prefixed string - * @return mixed The prefix or false if there is no prefix - * @access public - */ - function getPrefix($str){ - if($pos = strrpos($str,':')){ - // get prefix - return substr($str,0,$pos); - } - return false; - } - - /** - * pass it a prefix, it returns a namespace - * - * @param string $prefix The prefix - * @return mixed The namespace, false if no namespace has the specified prefix - * @access public - */ - function getNamespaceFromPrefix($prefix){ - if (isset($this->namespaces[$prefix])) { - return $this->namespaces[$prefix]; - } - //$this->setError("No namespace registered for prefix '$prefix'"); - return false; - } - - /** - * returns the prefix for a given namespace (or prefix) - * or false if no prefixes registered for the given namespace - * - * @param string $ns The namespace - * @return mixed The prefix, false if the namespace has no prefixes - * @access public - */ - function getPrefixFromNamespace($ns) { - foreach ($this->namespaces as $p => $n) { - if ($ns == $n || $ns == $p) { - $this->usedNamespaces[$p] = $n; - return $p; - } - } - return false; - } - - /** - * returns the time in ODBC canonical form with microseconds - * - * @return string The time in ODBC canonical form with microseconds - * @access public - */ - function getmicrotime() { - if (function_exists('gettimeofday')) { - $tod = gettimeofday(); - $sec = $tod['sec']; - $usec = $tod['usec']; - } else { - $sec = time(); - $usec = 0; - } - return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec); - } - - /** - * Returns a string with the output of var_dump - * - * @param mixed $data The variable to var_dump - * @return string The output of var_dump - * @access public - */ - function varDump($data) { - ob_start(); - var_dump($data); - $ret_val = ob_get_contents(); - ob_end_clean(); - return $ret_val; - } -} - -// XML Schema Datatype Helper Functions - -//xsd:dateTime helpers - -/** -* convert unix timestamp to ISO 8601 compliant date string -* -* @param string $timestamp Unix time stamp -* @access public -*/ -function timestamp_to_iso8601($timestamp,$utc=true){ - $datestr = date('Y-m-d\TH:i:sO',$timestamp); - if($utc){ - $eregStr = - '([0-9]{4})-'. // centuries & years CCYY- - '([0-9]{2})-'. // months MM- - '([0-9]{2})'. // days DD - 'T'. // separator T - '([0-9]{2}):'. // hours hh: - '([0-9]{2}):'. // minutes mm: - '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss... - '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's - - if(ereg($eregStr,$datestr,$regs)){ - return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]); - } - return false; - } else { - return $datestr; - } -} - -/** -* convert ISO 8601 compliant date string to unix timestamp -* -* @param string $datestr ISO 8601 compliant date string -* @access public -*/ -function iso8601_to_timestamp($datestr){ - $eregStr = - '([0-9]{4})-'. // centuries & years CCYY- - '([0-9]{2})-'. // months MM- - '([0-9]{2})'. // days DD - 'T'. // separator T - '([0-9]{2}):'. // hours hh: - '([0-9]{2}):'. // minutes mm: - '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss... - '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's - if(ereg($eregStr,$datestr,$regs)){ - // not utc - if($regs[8] != 'Z'){ - $op = substr($regs[8],0,1); - $h = substr($regs[8],1,2); - $m = substr($regs[8],strlen($regs[8])-2,2); - if($op == '-'){ - $regs[4] = $regs[4] + $h; - $regs[5] = $regs[5] + $m; - } elseif($op == '+'){ - $regs[4] = $regs[4] - $h; - $regs[5] = $regs[5] - $m; - } - } - return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z"); - } else { - return false; - } -} - -function usleepWindows($usec) -{ - $start = gettimeofday(); - - do - { - $stop = gettimeofday(); - $timePassed = 1000000 * ($stop['sec'] - $start['sec']) - + $stop['usec'] - $start['usec']; - } - while ($timePassed < $usec); -} - -?><?php - - - -/** -* soap_fault class, allows for creation of faults -* mainly used for returning faults from deployed functions -* in a server instance. -* @author Dietrich Ayala <die...@ga...> -* @version $Id: nusoap.php,v 1.91 2005/06/06 21:26:55 snichol Exp $ -* @access public -*/ -class soap_fault extends nusoap_base { - - var $faultcode; - var $faultactor; - var $faultstring; - var $faultdetail; - - /** - * constructor - * - * @param string $faultcode (client | server) - * @param string $faultactor only used when msg routed between multiple actors - * @param string $faultstring human readable error message - * @param mixed $faultdetail detail, typically a string or array of string - */ - function soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ - parent::nusoap_base(); - $this->faultcode = $faultcode; - $this->faultactor = $faultactor; - $this->faultstring = $faultstring; - $this->faultdetail = $faultdetail; - } - - /** - * serialize a fault - * - * @return string The serialization of the fault instance. - * @access public - */ - function serialize(){ - $ns_string = ''; - foreach($this->namespaces as $k => $v){ - $ns_string .= "\n xmlns:$k=\"$v\""; - } - $return_msg = - '<?xml version="1.0" encoding="'.$this->soap_defencoding.'"?>'. - '<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n". - '<SOAP-ENV:Body>'. - '<SOAP-ENV:Fault>'. - $this->serialize_val($this->faultcode, 'faultcode'). - $this->serialize_val($this->faultactor, 'faultactor'). - $this->serialize_val($this->faultstring, 'faultstring'). - $this->serialize_val($this->faultdetail, 'detail'). - '</SOAP-ENV:Fault>'. - '</SOAP-ENV:Body>'. - '</SOAP-ENV:Envelope>'; - return $return_msg; - } -} - - - -?><?php - - - -/** -* parses an XML Schema, allows access to it's data, other utility methods -* no validation... yet. -* very experimental and limited. As is discussed on XML-DEV, I'm one of the people -* that just doesn't have time to read the spec(s) thoroughly, and just have a couple of trusty -* tutorials I refer to :) -* -* @author Dietrich Ayala <die...@ga...> -* @version $Id: nusoap.php,v 1.91 2005/06/06 21:26:55 snichol Exp $ -* @access public -*/ -class XMLSchema extends nusoap_base { - - // files - var $schema = ''; - var $xml = ''; - // namespaces - var $enclosingNamespaces; - // schema info - var $schemaInfo = array(); - var $schemaTargetNamespace = ''; - // types, elements, attributes defined by the schema - var $attributes = array(); - var $complexTypes = array(); - var $complexTypeStack = array(); - var $currentComplexType = null; - var $elements = array(); - var $elementStack = array(); - var $currentElement = null; - var $simpleTypes = array(); - var $simpleTypeStack = array(); - var $currentSimpleType = null; - // imports - var $imports = array(); - // parser vars - var $parser; - var $position = 0; - var $depth = 0; - var $depth_array = array(); - var $message = array(); - var $defaultNamespace = array(); - - /** - * constructor - * - * @param string $schema schema document URI - * @param string $xml xml document URI - * @param string $namespaces namespaces defined in enclosing XML - * @access public - */ - function XMLSchema($schema='',$xml='',$namespaces=array()){ - parent::nusoap_base(); - $this->debug('xmlschema class instantiated, inside constructor'); - // files - $this->schema = $schema; - $this->xml = $xml; - - // namespaces - $this->enclosingNamespaces = $namespaces; - $this->namespaces = array_merge($this->namespaces, $namespaces); - - // parse schema file - if($schema != ''){ - $this->debug('initial schema file: '.$schema); - $this->parseFile($schema, 'schema'); - } - - // parse xml file - if($xml != ''){ - $this->debug('initial xml file: '.$xml); - $this->parseFile($xml, 'xml'); - } - - } - - /** - * parse an XML file - * - * @param string $xml, path/URL to XML file - * @param string $type, (schema | xml) - * @return boolean - * @access public - */ - function parseFile($xml,$type){ - // parse xml file - if($xml != ""){ - $xmlStr = @join("",@file($xml)); - if($xmlStr == ""){ - $msg = 'Error reading XML from '.$xml; - $this->setError($msg); - $this->debug($msg); - return false; - } else { - $this->debug("parsing $xml"); - $this->parseString($xmlStr,$type); - $this->debug("done parsing $xml"); - return true; - } - } - return false; - } - - /** - * parse an XML string - * - * @param string $xml path or URL - * @param string $type, (schema|xml) - * @access private - */ - function parseString($xml,$type){ - // parse xml string - if($xml != ""){ - - // Create an XML parser. - $this->parser = xml_parser_create(); - // Set the options for parsing the XML data. - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); - - // Set the object for the parser. - xml_set_object($this->parser, $this); - - // Set the element handlers for the parser. - if($type == "schema"){ - xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement'); - xml_set_character_data_handler($this->parser,'schemaCharacterData'); - } elseif($type == "xml"){ - xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement'); - xml_set_character_data_handler($this->parser,'xmlCharacterData'); - } - - // Parse the XML file. - if(!xml_parse($this->parser,$xml,true)){ - // Display an error message. - $errstr = sprintf('XML error parsing XML schema on line %d: %s', - xml_get_current_line_number($this->parser), - xml_error_string(xml_get_error_code($this->parser)) - ); - $this->debug($errstr); - $this->debug("XML payload:\n" . $xml); - $this->setError($errstr); - } - - xml_parser_free($this->parser); - } else{ - $this->debug('no xml passed to parseString()!!'); - $this->setError('no xml passed to parseString()!!'); - } - } - - /** - * start-element handler - * - * @param string $parser XML parser object - * @param string $name element name - * @param string $attrs associative array of attributes - * @access private - */ - function schemaStartElement($parser, $name, $attrs) { - - // position in the total number of elements, starting from 0 - $pos = $this->position++; - $depth = $this->depth++; - // set self as current value for this depth - $this->depth_array[$depth] = $pos; - $this->message[$pos] = array('cdata' => ''); - if ($depth > 0) { - $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; - } else { - $this->defaultNamespace[$pos] = false; - } - - // get element prefix - if($prefix = $this->getPrefix($name)){ - // get unqualified name - $name = $this->getLocalPart($name); - } else { - $prefix = ''; - } - - // loop thru attributes, expanding, and registering namespace declarations - if(count($attrs) > 0){ - foreach($attrs as $k => $v){ - // if ns declarations, add to class level array of valid namespaces - if(ereg("^xmlns",$k)){ - //$this->xdebug("$k: $v"); - //$this->xdebug('ns_prefix: '.$this->getPrefix($k)); - if($ns_prefix = substr(strrchr($k,':'),1)){ - //$this->xdebug("Add namespace[$ns_prefix] = $v"); - $this->namespaces[$ns_prefix] = $v; - } else { - $this->defaultNamespace[$pos] = $v; - if (! $this->getPrefixFromNamespace($v)) { - $this->namespaces['ns'.(count($this->namespaces)+1)] = $v; - } - } - if($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema'){ - $this->XMLSchemaVersion = $v; - $this->namespaces['xsi'] = $v.'-instance'; - } - } - } - foreach($attrs as $k => $v){ - // expand each attribute - $k = strpos($k,':') ? $this->expandQname($k) : $k; - $v = strpos($v,':') ? $this->expandQname($v) : $v; - $eAttrs[$k] = $v; - } - $attrs = $eAttrs; - } else { - $attrs = array(); - } - // find status, register data - switch($name){ - case 'all': // (optional) compositor content for a complexType - case 'choice': - case 'group': - case 'sequence': - //$this->xdebug("compositor $name for currentComplexType: $this->currentComplexType and currentElement: $this->currentElement"); - $this->complexTypes[$this->currentComplexType]['compositor'] = $name; - //if($name == 'all' || $name == 'sequence'){ - // $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; - //} - break; - case 'attribute': // complexType attribute - //$this->xdebug("parsing attribute $attrs[name] $attrs[ref] of value: ".$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']); - $this->xdebug("parsing attribute:"); - $this->appendDebug($this->varDump($attrs)); - if (!isset($attrs['form'])) { - $attrs['form'] = $this->schemaInfo['attributeFormDefault']; - } - if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { - $v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; - if (!strpos($v, ':')) { - // no namespace in arrayType attribute value... - if ($this->defaultNamespace[$pos]) { - // ...so use the default - $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'] = $this->defaultNamespace[$pos] . ':' . $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; - } - } - } - if(isset($attrs['name'])){ - $this->attributes[$attrs['name']] = $attrs; - $aname = $attrs['name']; - } elseif(isset($attrs['ref']) && $attrs['ref'] == 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'){ - if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { - $aname = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; - } else { - $aname = ''; - } - } elseif(isset($attrs['ref'])){ - $aname = $attrs['ref']; - $this->attributes[$attrs['ref']] = $attrs; - } - - if($this->currentComplexType){ // This should *always* be - $this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; - } - // arrayType attribute - if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']) || $this->getLocalPart($aname) == 'arrayType'){ - $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; - $prefix = $this->getPrefix($aname); - if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])){ - $v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; - } else { - $v = ''; - } - if(strpos($v,'[,]')){ - $this->complexTypes[$this->currentComplexType]['multidimensional'] = true; - } - $v = substr($v,0,strpos($v,'[')); // clip the [] - if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){ - $v = $this->XMLSchemaVersion.':'.$v; - } - $this->complexTypes[$this->currentComplexType]['arrayType'] = $v; - } - break; - case 'complexContent': // (optional) content for a complexType - break; - case 'complexType': - array_push($this->complexTypeStack, $this->currentComplexType); - if(isset($attrs['name'])){ - $this->xdebug('processing named complexType '.$attrs['name']); - //$this->currentElement = false; - $this->currentComplexType = $attrs['name']; - $this->complexTypes[$this->currentComplexType] = $attrs; - $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; - // This is for constructs like - // <complexType name="ListOfString" base="soap:Array"> - // <sequence> - // <element name="string" type="xsd:string" - // minOccurs="0" maxOccurs="unbounded" /> - // </sequence> - // </complexType> - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){ - $this->xdebug('complexType is unusual array'); - $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; - } else { - $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; - } - }else{ - $this->xdebug('processing unnamed complexType for element '.$this->currentElement); - $this->currentComplexType = $this->currentElement . '_ContainedType'; - //$this->currentElement = false; - $this->complexTypes[$this->currentComplexType] = $attrs; - $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; - // This is for constructs like - // <complexType name="ListOfString" base="soap:Array"> - // <sequence> - // <element name="string" type="xsd:string" - // minOccurs="0" maxOccurs="unbounded" /> - // </sequence> - // </complexType> - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){ - $this->xdebug('complexType is unusual array'); - $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; - } else { - $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; - } - } - break; - case 'element': - array_push($this->elementStack, $this->currentElement); - // elements defined as part of a complex type should - // not really be added to $this->elements, but for some - // reason, they are - if (!isset($attrs['form'])) { - $attrs['form'] = $this->schemaInfo['elementFormDefault']; - } - if(isset($attrs['type'])){ - $this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']); - if (! $this->getPrefix($attrs['type'])) { - if ($this->defaultNamespace[$pos]) { - $attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type']; - $this->xdebug('used default namespace to make type ' . $attrs['type']); - } - } - // This is for constructs like - // <complexType name="ListOfString" base="soap:Array"> - // <sequence> - // <element name="string" type="xsd:string" - // minOccurs="0" maxOccurs="unbounded" /> - // </sequence> - // </complexType> - if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'array') { - $this->xdebug('arrayType for unusual array is ' . $attrs['type']); - $this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type']; - } - $this->currentElement = $attrs['name']; - $this->elements[ $attrs['name'] ] = $attrs; - $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; - $ename = $attrs['name']; - } elseif(isset($attrs['ref'])){ - $this->xdebug("processing element as ref to ".$attrs['ref']); - $this->currentElement = "ref to ".$attrs['ref']; - $ename = $this->getLocalPart($attrs['ref']); - } else { - $this->xdebug("processing untyped element ".$attrs['name']); - $this->currentElement = $attrs['name']; - $this->elements[ $attrs['name'] ] = $attrs; - $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; - $attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['name'] . '_ContainedType'; - $this->elements[ $attrs['name'] ]['type'] = $attrs['type']; - $ename = $attrs['name']; - } - if(isset($ename) && $this->currentComplexType){ - $this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs; - } - break; - case 'enumeration': // restriction value list member - $this->xdebug('enumeration ' . $attrs['value']); - if ($this->currentSimpleType) { - $this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value']; - } elseif ($this->currentComplexType) { - $this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value']; - } - break; - case 'extension': // simpleContent or complexContent type extension - $this->xdebug('extension ' . $attrs['base']); - if ($this->currentComplexType) { - $this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base']; - } - break; - case 'import': - if (isset($attrs['schemaLocation'])) { - //$this->xdebug('import namespace ' . $attrs['namespace'] . ' from ' . $attrs['schemaLocation']); - $this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => false); - } else { - //$this->xdebug('import namespace ' . $attrs['namespace']); - $this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true); - if (! $this->getPrefixFromNamespace($attrs['namespace'])) { - $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace']; - } - } - break; - case 'list': // simpleType value list - break; - case 'restriction': // simpleType, simpleContent or complexContent value restriction - $this->xdebug('restriction ' . $attrs['base']); - if($this->currentSimpleType){ - $this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base']; - } elseif($this->currentComplexType){ - $this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base']; - if(strstr($attrs['base'],':') == ':Array'){ - $this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; - } - } - break; - case 'schema': - $this->schemaInfo = $attrs; - $this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix); - if (isset($attrs['targetNamespace'])) { - $this->schemaTargetNamespace = $attrs['targetNamespace']; - } - if (!isset($attrs['elementFormDefault'])) { - $this->schemaInfo['elementFormDefault'] = 'unqualified'; - } - if (!isset($attrs['attributeFormDefault'])) { - $this->schemaInfo['attributeFormDefault'] = 'unqualified'; - } - break; - case 'simpleContent': // (optional) content for a complexType - break; - case 'simpleType': - array_push($this->simpleTypeStack, $this->currentSimpleType); - if(isset($attrs['name'])){ - $this->xdebug("processing simpleType for name " . $attrs['name']); - $this->currentSimpleType = $attrs['name']; - $this->simpleTypes[ $attrs['name'] ] = $attrs; - $this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType'; - $this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar'; - } else { - $this->xdebug('processing unnamed simpleType for element '.$this->currentElement); - $this->currentSimpleType = $this->currentElement . '_ContainedType'; - //$this->currentElement = false; - $this->simpleTypes[$this->currentSimpleType] = $attrs; - $this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar'; - } - break; - case 'union': // simpleType type list - break; - default: - //$this->xdebug("do not have anything to do for element $name"); - } - } - - /** - * end-element handler - * - * @param string $parser XML parser object - * @param string $name element name - * @access private - */ - function schemaEndElement($parser, $name) { - // bring depth down a notch - $this->depth--; - // position of current element is equal to the last value left in depth_array for my depth - if(isset($this->depth_array[$this->depth])){ - $pos = $this->depth_array[$this->depth]; - } - // get element prefix - if ($prefix = $this->getPrefix($name)){ - // get unqualified name - $name = $this->getLocalPart($name); - } else { - $prefix = ''; - } - // move on... - if($name == 'complexType'){ - $this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)')); - $this->currentComplexType = array_pop($this->complexTypeStack); - //$this->currentElement = false; - } - if($name == 'element'){ - $this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)')); - $this->currentElement = array_pop($this->elementStack); - } - if($name == 'simpleType'){ - $this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)')); - $this->currentSimpleType = array_pop($this->simpleTypeStack); - } - } - - /** - * element content handler - * - * @param string $parser XML parser object - * @param string $data element content - * @access private - */ - function schemaCharacterData($parser, $data){ - $pos = $this->depth_array[$this->depth - 1]; - $this->message[$pos]['cdata'] .= $data; - } - - /** - * serialize the schema - * - * @access public - */ - function serializeSchema(){ - - $schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion); - $xml = ''; - // imports - if (sizeof($this->imports) > 0) { - foreach($this->imports as $ns => $list) { - foreach ($list as $ii) { - if ($ii['location'] != '') { - $xml .= " <$schemaPrefix:import location=\"" . $ii['location'] . '" namespace="' . $ns . "\" />\n"; - } else { - $xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; - } - } - } - } - // complex types - foreach($this->complexTypes as $typeName => $attrs){ - $contentStr = ''; - // serialize child elements - if(isset($attrs['elements']) && (count($attrs['elements']) > 0)){ - foreach($attrs['elements'] as $element => $eParts){ - if(isset($eParts['ref'])){ - $contentStr .= " <$schemaPrefix:element ref=\"$element\"/>\n"; - } else { - $contentStr .= " <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($eParts['type']) . "\""; - foreach ($eParts as $aName => $aValue) { - // handle, e.g., abstract, default, form, minOccurs, maxOccurs, nillable - if ($aName != 'name' && $aName != 'type') { - $contentStr .= " $aName=\"$aValue\""; - } - } - $contentStr .= "/>\n"; - } - } - } - // attributes - if(isset($attrs['attrs']) && (count($attrs['attrs']) >= 1)){ - foreach($attrs['attrs'] as $attr => $aParts){ - $contentStr .= " <$schemaPrefix:attribute ref=\"".$this->contractQName($aParts['ref']).'"'; - if(isset($aParts['http://schemas.xmlsoap.org/wsdl/:arrayType'])){ - $this->usedNamespaces['wsdl'] = $this->namespaces['wsdl']; - $contentStr .= ' wsdl:arrayType="'.$this->contractQName($aParts['http://schemas.xmlsoap.org/wsdl/:arrayType']).'"'; - } - $contentStr .= "/>\n"; - } - } - // if restriction - if( isset($attrs['restrictionBase']) && $attrs['restrictionBase'] != ''){ - $contentStr = " <$schemaPrefix:restriction base=\"".$this->contractQName($attrs['restrictionBase'])."\">\n".$contentStr." </$schemaPrefix:restriction>\n"; - } - // compositor obviates complex/simple content - if(isset($attrs['compositor']) && ($attrs['compositor'] != '')){ - $contentStr = " <$schemaPrefix:$attrs[compositor]>\n".$contentStr." </$schemaPrefix:$attrs[compositor]>\n"; - } - // complex or simple content - elseif((isset($attrs['elements']) && count($attrs['elements']) > 0) || (isset($attrs['attrs']) && count($attrs['attrs']) > 0)){ - $contentStr = " <$schemaPrefix:complexContent>\n".$contentStr." </$schemaPrefix:complexContent>\n"; - } - // finalize complex type - if($contentStr != ''){ - $contentStr = " <$schemaPrefix:complexType name=\"$typeName\">\n".$contentStr." </$schemaPrefix:complexType>\n"; - } else { - $contentStr = " <$schemaPrefix:complexType name=\"$typeName\"/>\n"; - } - $xml .= $contentStr; - } - // simple types - if(isset($this->simpleTypes) && count($this->simpleTypes) > 0){ - foreach($this->simpleTypes as $typeName => $eParts){ - $xml .= " <$schemaPrefix:simpleType name=\"$typeName\">\n <$schemaPrefix:restriction base=\"".$this->contractQName($eParts['type'])."\"/>\n"; - if (isset($eParts['enumeration'])) { - foreach ($eParts['enumeration'] as $e) { - $xml .= " <$schemaPrefix:enumeration value=\"$e\"/>\n"; - } - } - $xml .= " </$schemaPrefix:simpleType>"; - } - } - // elements - if(isset($this->elements) && count($this->elements) > 0){ - foreach($this->elements as $element => $eParts){ - $xml .= " <$schemaPrefix:element name=\"$element\" type=\"".$this->contractQName($eParts['type'])."\"/>\n"; - } - } - // attributes - if(isset($this->attributes) && count($this->attributes) > 0){ - foreach($this->attributes as $attr => $aParts){ - $xml .= " <$schemaPrefix:attribute name=\"$attr\" type=\"".$this->contractQName($aParts['type'])."\"\n/>"; - } - } - // finish 'er up - $el = "<$schemaPrefix:schema targetNamespace=\"$this->schemaTargetNamespace\"\n"; - foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) { - $el .= " xmlns:$nsp=\"$ns\"\n"; - } - $xml = $el . ">\n".$xml."</$schemaPrefix:schema>\n"; - return $xml; - } - - /** - * adds debug data to the clas level debug string - * - * @param string $string debug data - * @access private - */ - function xdebug($string){ - $this->debug('<' . $this->schemaTargetNamespace . '> '.$string); - } - - /** - * get the PHP type of a user defined type in the schema - * PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays - * returns false if no type exists, or not w/ the given namespace - * else returns a string that is either a native php type, or 'struct' - * - * @param string $type, name of defined type - * @param string $ns, namespace of type - * @return mixed - * @access public - */ - function getPHPType($type,$ns){ - if(isset($this->typemap[$ns][$type])){ - //print "found type '$type' and ns $ns in typemap<br>"; - return $this->typemap[$ns][$type]; - } elseif(isset($this->complexTypes[$type])){ - //print "getting type '$type' and ns $ns from complexTypes array<br>"; - return $this->complexTypes[$type]['phpType']; - } - return false; - } - - /** - * returns an array of information about a given type - * returns false if no type exists by the given name - * - * typeDef = array( - * 'elements' => array(), // refs to elements array - * 'restrictionBase' => '', - * 'phpType' => '', - * 'order' => '(sequence|all)', - * 'attrs' => array() // refs to attributes array - * ) - * - * @param string - * @return mixed - * @access public - */ - function getTypeDef($type){ - //$this->debug("in getTypeDef for type $type"); - if(isset($this->complexTypes[$type])){ - $this->xdebug("in getTypeDef, found complexType $type"); - return $this->complexTypes[$type]; - } elseif(isset($this->simpleTypes[$type])){ - $this->xdebug("in getTypeDef, found simpleType $type"); - if (!isset($this->simpleTypes[$type]['phpType'])) { - // get info for type to tack onto the simple type - // TODO: can this ever really apply (i.e. what is a si... [truncated message content] |
From: <hu...@us...> - 2006-04-21 13:42:55
|
Revision: 9 Author: hugues Date: 2006-04-21 06:42:47 -0700 (Fri, 21 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=9&view=rev Log Message: ----------- Voice Direct can now be updated from within moodle. Modified Paths: -------------- trunk/moodle/mod/voicedirect/lib.php trunk/moodle/mod/voicedirect/view.php trunk/moodle/mod/voicetoolapi.php Modified: trunk/moodle/mod/voicedirect/lib.php =================================================================== --- trunk/moodle/mod/voicedirect/lib.php 2006-04-21 08:26:27 UTC (rev 8) +++ trunk/moodle/mod/voicedirect/lib.php 2006-04-21 13:42:47 UTC (rev 9) @@ -33,7 +33,7 @@ //print_r($data); - if (!$result = voicedirect_create_resource ($data)) { + if (!$result = voicetool_create_resource ($data)) { error('Cannot create the resource on the VT server'); } @@ -46,7 +46,7 @@ $voicedirect->rid = $rid; - return insert_record("voicedirect", $voicedirect); + return insert_record('voicedirect', $voicedirect); } @@ -54,13 +54,29 @@ /// 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; $voicedirect->timemodified = time(); $voicedirect->id = $voicedirect->instance; + $data = voicedirect_create_rsc_data ($voicedirect); + + if (empty ($data)) { + error('Data not created correctly'); + } + +///print_r($data); +///error (info); + + if (! $result = voicetool_modify_resource ($data)) { + error('Cannot modify the resource on the VT server'); + } + # May have to add extra stuff in here # - return update_record("voicedirect", $voicedirect); +///print_r($voicedirect); + + return update_record('voicedirect', $voicedirect); } @@ -176,7 +192,7 @@ function voicedirect_create_rsc_data ($voicedirect) { global $VT_API_VDIRECT; - add_to_log($voicedirect->course, "voicedirect", "", "", "Creating Data for Voice Direct"); + //add_to_log($voicedirect->course, "voicedirect", "", "", "Creating Data for Voice Direct"); $result = new PairSet (); @@ -193,47 +209,14 @@ $options = new PairSet (); $options->addPairSet('audio_format', $audioformat); - - if ($voicedirect->type == 'voicedirect') { - $options->addNameValuePair('archive', (($voicedirect->archive == 'on')?'true':'false')); - } + $options->addNameValuePair('archive', (($voicedirect->archive == 'on')?'true':'false')); $result->addPairSet ('options', $options); return $result->getData(); } -/** - * Send an SDK request to the VT server to create the resource. - * @param $resource_data - the resource to create - * @return - the object returned by the call, or false if something goes wrong - */ -function voicedirect_create_resource ($resource_data) { - global $CFG, - $VT_API_SERVICES, - $VT_API_CREATE_RESOURCE; - $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); - - $resource = array ($CFG->voicetool_adminusername, - $CFG->voicetool_adminpassword, - $resource_data); - //print_r($resource); - - $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); - - //print_r ($result); - - if (empty($result)){ - error ("Empty result after call to $VT_API_SERVICES"); - return false; - } - - return $result; -} - - - /** * Create the data structure for a resource * @param $voicedirect - the information incoming from the mod.html form @@ -267,46 +250,4 @@ 'rights' => $rights->getData() ); } -/** - * Create the session for a voice direct applet. - * @param - the voicedirect information - * @return - the mid to insert into the html - */ -function voicedirect_create_session ($voicedirect) { - global $CFG, - $VT_API_SERVICES, - $VT_API_CREATE_SESSION; - - - $sessiondata = voicedirect_create_session_data($voicedirect); - - $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); - - $resource = array ($CFG->voicetool_adminusername, - $CFG->voicetool_adminpassword, - $sessiondata['user'], - $sessiondata['resource'], - $sessiondata['message'], - $sessiondata['rights']); - - //print_r($resource); - - $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); - - //print_r ($result); - - if (empty($result)){ - error ("Empty result after call to $VT_API_SERVICES"); - return false; - } - - foreach ($result['values'] as $item) { - $values[$item['name']] = $item['value']; - } - - return $values['nid']; -} - - - ?> Modified: trunk/moodle/mod/voicedirect/view.php =================================================================== --- trunk/moodle/mod/voicedirect/view.php 2006-04-21 08:26:27 UTC (rev 8) +++ trunk/moodle/mod/voicedirect/view.php 2006-04-21 13:42:47 UTC (rev 9) @@ -3,8 +3,9 @@ /// This page prints a particular instance of voicedirect /// (Replace voicedirect with the name of your module) - require_once("../../config.php"); - require_once("lib.php"); + require_once('../../config.php'); + require_once('lib.php'); + require_once('../voicetoolapi.php'); optional_variable($id); // Course Module ID, or optional_variable($a); // voicedirect ID @@ -38,7 +39,7 @@ add_to_log($course->id, "voicedirect", "view", "view.php?id=$cm->id", "$voicedirect->id"); - if (!$nid = voicedirect_create_session ($voicedirect)) { + if (!$nid = voicetool_create_session ($voicedirect)) { error(get_string ('cannotgetsession', 'voicedirect')); } @@ -53,17 +54,18 @@ $strvoicedirects = get_string("modulenameplural", "voicedirect"); $strvoicedirect = get_string("modulename", "voicedirect"); - global $CFG; - - $servername = $CFG->voicetool_servername; - print_header("$course->shortname: $voicedirect->name", "$course->fullname", "$navigation <A HREF=index.php?id=$course->id>$strvoicedirects</A> -> $voicedirect->name", "", "", true, update_module_button($cm->id, $course->id, $strvoicedirect), navmenu($course, $cm)); /// Print the main part of the page + global $CFG; + + $servername = $CFG->voicetool_servername; + ?> +<p><em><strong><?php p($voicedirect->description) ?></strong></em></p> <SCRIPT type="text/javascript"> this.focus(); </SCRIPT> Modified: trunk/moodle/mod/voicetoolapi.php =================================================================== --- trunk/moodle/mod/voicetoolapi.php 2006-04-21 08:26:27 UTC (rev 8) +++ trunk/moodle/mod/voicetoolapi.php 2006-04-21 13:42:47 UTC (rev 9) @@ -17,10 +17,143 @@ $VT_API_SERVICES = '/services/Broker?wsdl'; $VT_API_CREATE_RESOURCE = 'createResource'; +$VT_API_MODIFY_RESOURCE = 'modifyResource'; $VT_API_CREATE_SESSION = 'createSession'; + +/** + * Send an SDK request to the VT server to create the resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_CREATE_RESOURCE + * @param $resource_data - the resource to create + * @return - the object returned by the call, or false if something goes wrong + */ +function voicetool_create_resource ($resource_data) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_RESOURCE; + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $resource_data); + //print_r($resource); + + $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); + + //print_r ($result); + + if (!voicetool_check_result ($result)) { + return false; + } + + return $result; +} + +/** + * Send an SDK request to the VT server to create the resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_MODIFY_RESOURCE + * @param $resource_data - the resource to create + * @return - the object returned by the call, or false if something goes wrong + */ +function voicetool_modify_resource ($resource_data) { + global $CFG, + $VT_API_SERVICES, + $VT_API_MODIFY_RESOURCE; + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $resource_data); + //print_r($resource); + + $result = $soapclient->call($VT_API_MODIFY_RESOURCE, $resource); + + //print_r ($result); + + if (!voicetool_check_result ($result)) { + return false; + } + + return $result; +} + + + +/** + * Create the session for a voice direct applet. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_CREATE_SESSION + * @param - the voicedirect information + * @return - the mid to insert into the html + */ +function voicetool_create_session ($voicedirect) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_SESSION; + + + $sessiondata = voicedirect_create_session_data($voicedirect); + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $sessiondata['user'], + $sessiondata['resource'], + $sessiondata['message'], + $sessiondata['rights']); + + //print_r($resource); + + $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); + + //print_r ($result); + + if (!voicetool_check_result ($result)) { + return false; + } + + foreach ($result['values'] as $item) { + $values[$item['name']] = $item['value']; + } + + return $values['nid']; +} + + +/** + * Return true if the result does not contain an error code, or false wise. + * @param $result - a pairset resulting from an API call to $soapclient->call() + * @return true f $result does not contain an error code, false otherwise. + */ +function voicetool_check_result ($result) { + if (empty($result)){ + //error ("Empty result after call to $VT_API_SERVICES"); + error_log( "voicetool_check_result: Empty result after call to $VT_API_SERVICES"); + return false; + } + + foreach ($result['values'] as $item) { + if ($item['name'] == 'error_message') { + error_log( "voicetool_check_result: ".$item['name'].': '.$item['value']); + return false; + } + } + + return true; +} + + + //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -56,13 +189,4 @@ } } - - -class NameSetPair { - var $data = array ('name' => false, 'pairSet' => array ()); - -} - - - ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-04-21 19:35:59
|
Revision: 10 Author: hugues Date: 2006-04-21 12:35:50 -0700 (Fri, 21 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=10&view=rev Log Message: ----------- Added the deletion for Voice Direct Modified Paths: -------------- trunk/moodle/mod/voicedirect/lib.php trunk/moodle/mod/voicetoolapi.php Modified: trunk/moodle/mod/voicedirect/lib.php =================================================================== --- trunk/moodle/mod/voicedirect/lib.php 2006-04-21 13:42:47 UTC (rev 9) +++ trunk/moodle/mod/voicedirect/lib.php 2006-04-21 19:35:50 UTC (rev 10) @@ -89,10 +89,12 @@ return false; } + if (! ($result = voicetool_delete_resource ($voicedirect->rid))) { + error('Cannot modify the resource on the VT server'); + } + $result = true; - # Delete any dependent records here # - if (! delete_records("voicedirect", "id", "$voicedirect->id")) { $result = false; } Modified: trunk/moodle/mod/voicetoolapi.php =================================================================== --- trunk/moodle/mod/voicetoolapi.php 2006-04-21 13:42:47 UTC (rev 9) +++ trunk/moodle/mod/voicetoolapi.php 2006-04-21 19:35:50 UTC (rev 10) @@ -18,6 +18,7 @@ $VT_API_SERVICES = '/services/Broker?wsdl'; $VT_API_CREATE_RESOURCE = 'createResource'; $VT_API_MODIFY_RESOURCE = 'modifyResource'; +$VT_API_DELETE_RESOURCE = 'deleteResource'; $VT_API_CREATE_SESSION = 'createSession'; @@ -85,8 +86,36 @@ return $result; } +/** + * Send an SDK request to the VT server to delete a resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_DELETE_RESOURCE + * @param $rid - the rid of the resource to delete + * @return - the object returned by the call, or false if something goes wrong + */ +function voicetool_delete_resource ($rid) { + global $CFG, + $VT_API_SERVICES, + $VT_API_DELETE_RESOURCE; + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $rid); + + $result = $soapclient->call($VT_API_DELETE_RESOURCE, $resource); + + if (!voicetool_check_result ($result)) { + return false; + } + + return $result; +} + + /** * Create the session for a voice direct applet. * @uses CFG @@ -146,6 +175,10 @@ if ($item['name'] == 'error_message') { error_log( "voicetool_check_result: ".$item['name'].': '.$item['value']); return false; + } + + if (($item['name'] == 'status_code') && ($item['value'] == 'ok')) { + return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-05-06 22:32:36
|
Revision: 14 Author: hugues Date: 2006-05-06 15:32:23 -0700 (Sat, 06 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=14&view=rev Log Message: ----------- Adding bakup stuff for the LC & re-organizing VT Modified Paths: -------------- trunk/moodle/mod/voicedirect/config.html trunk/moodle/mod/voicedirect/lib.php trunk/moodle/mod/voicedirect/mod.html trunk/moodle/mod/voicetoolapi.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/backuplib.php Added: trunk/moodle/mod/liveclassroom/backuplib.php =================================================================== --- trunk/moodle/mod/liveclassroom/backuplib.php (rev 0) +++ trunk/moodle/mod/liveclassroom/backuplib.php 2006-05-06 22:32:23 UTC (rev 14) @@ -0,0 +1,74 @@ +<?PHP +/// Library of functions and constants for module liveclassroom + +require_once($CFG->libdir.'/datalib.php'); +require_once("$CFG->dirroot/mod/liveclassroom/api.php"); +require_once("$CFG->dirroot/mod/liveclassroom/lib.php"); + + + +function liveclassroom_backup_mods($bf,$preferences) { + global $CFG; + + $status = true; + + //Iterate over liveclassroom table + $liveclassroomss = get_records ("liveclassroom","course",$preferences->backup_course,"id"); + if ($liveclassrooms) { + foreach ($liveclassrooms as $liveclassroom) { + //Start mod + fwrite ($bf,start_tag("MOD",3,true)); + //Print LC data + fwrite ($bf,full_tag("ID",4,false,$liveclassroom->id)); + fwrite ($bf,full_tag("MODTYPE",4,false,"liveclassroom")); + fwrite ($bf,full_tag("NAME",4,false,$liveclassroom->name)); + + $status =fwrite ($bf,end_tag("MOD",3,true)); + } + } + + //if we've selected to backup users info, then backup files too + if ($status) { + if ($preferences->mods["liveclassroom"]->userinfo) { + //$status = liveclassroom_backup_files($bf,$preferences); + } + } + + + return $status; +} + + + + +////Return an array of info (name,value) reporting what will be backed up +function liveclassroom_check_backup_mods($course,$user_data=false,$backup_unique_code) { + //First the course data + $info[0][0] = get_string("modulenameplural","liveclassroom"); + if ($ids = liveclassroom_ids ($course)) { + $info[0][1] = count($ids); + } else { + $info[0][1] = 0; + } + + + //Now, if requested, the user_data: look for the number of + //rooms/archives available on the server and report + if ($user_data) { + $info[1][0] = get_string("rooms","liveclassroom"); + if ($ids = liveclassroom_count_rooms ($course)) { + $info[1][1] = count($ids); + } else { + $info[1][1] = 0; + } + $info[2][0] = get_string("archives","liveclassroom"); + if ($ids = liveclassroom_count_archives ($course)) { + $info[2][1] = count($ids); + } else { + $info[2][1] = 0; + } + } + return $info; +} + +?> Modified: trunk/moodle/mod/voicedirect/config.html =================================================================== --- trunk/moodle/mod/voicedirect/config.html 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicedirect/config.html 2006-05-06 22:32:23 UTC (rev 14) @@ -1,5 +1,21 @@ +<?php +require_once ("$CFG->dirroot/lib/datalib.php"); + + +if (!$courses = get_records ('course', '', '', 'shortname ASC', 'id, shortname, fullname')) { + error('Cannot retreive Course list'); +} + + + + + +?> + + <form method="post" action="module.php" name="form"> <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"> +<input type="hidden" name="module" value="voicedirect"> <table cellpadding="9" cellspacing="0" > @@ -13,7 +29,7 @@ <tr valign="top"> <td align="right"><?php print_string('servername', 'voicetool')?>:</td> <td> - <input name="voicetool_servername" type="text" size="30" value="<?php p($CFG->voicetool_servername) ?>" /> + <input name="servername" type="text" size="30" value="<?php p($CFG->voicetool_servername) ?>" /> </td> <td> <?php print_string("configservername", "voicetool") ?> @@ -22,7 +38,7 @@ <tr valign="top"> <td align="right"><?php print_string('adminusername', 'voicetool')?>:</td> <td> - <input name="voicetool_adminusername" type="text" size="20" value="<?php p($CFG->voicetool_adminusername) ?>" /> + <input name="adminusername" type="text" size="20" value="<?php p($CFG->voicetool_adminusername) ?>" /> </td> <td> <?php print_string("configadminusername", "voicetool") ?> @@ -31,21 +47,12 @@ <tr valign="top"> <td align="right"><?php print_string('adminpassword', 'voicetool')?>:</td> <td> - <input name="voicetool_adminpassword" type="text" size="20" value="<?php p($CFG->voicetool_adminpassword) ?>" /> + <input name="adminpassword" type="text" size="20" value="<?php p($CFG->voicetool_adminpassword) ?>" /> </td> <td> <?php print_string("configadminpassword", "voicetool") ?> </td> </tr> -<tr valign="top"> - <td align="right"><?php print_string('settinguniqueid', 'voicetool')?>:</td> - <td> - <input name="voicetool_settinguniqueid" type="text" size="20" value="<?php p($CFG->voicetool_settinguniqueid) ?>" /> - </td> - <td> - <?php print_string("configsettinguniqueid", "voicetool") ?> - </td> -</tr> <tr> <td colspan="3" align="center"> <input type="submit" value="<?php print_string("savechanges") ?>" /></td> Modified: trunk/moodle/mod/voicedirect/lib.php =================================================================== --- trunk/moodle/mod/voicedirect/lib.php 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicedirect/lib.php 2006-05-06 22:32:23 UTC (rev 14) @@ -11,7 +11,7 @@ * @param $config - the information from the form mod.html */ function voicedirect_process_options ($config) { - return true; + return; } function voicedirect_add_instance($voicedirect) { @@ -28,24 +28,26 @@ $data = voicedirect_create_rsc_data ($voicedirect); if (empty ($data)) { - error('Data not created correctly'); + error('Data not created correctly', "javascript:back();"); } //print_r($data); if (!$result = voicetool_create_resource ($data)) { - error('Cannot create the resource on the VT server'); + error('Cannot create the resource on the VT server', "javascript:back();"); } - # May have to add extra stuff in here # - foreach ($result['values'] as $item) { - $values[$item['name']] = $item['value']; - } - - $rid = $values['rid']; - - $voicedirect->rid = $rid; + //the function returned correctly, we do not have to care whether + //the rid is in or not: it is + foreach ($result['values'] as $item) { + $values[$item['name']] = $item['value']; + if ($item['name'] == 'rid') { + continue; + } + } + $voicedirect->rid = $values['rid']; + return insert_record('voicedirect', $voicedirect); } Modified: trunk/moodle/mod/voicedirect/mod.html =================================================================== --- trunk/moodle/mod/voicedirect/mod.html 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicedirect/mod.html 2006-05-06 22:32:23 UTC (rev 14) @@ -25,7 +25,6 @@ if (!isset($form->rid)) { $form->rid = ''; } - ?> Modified: trunk/moodle/mod/voicetoolapi.php =================================================================== --- trunk/moodle/mod/voicetoolapi.php 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetoolapi.php 2006-05-06 22:32:23 UTC (rev 14) @@ -23,7 +23,26 @@ +/** + * Voicetool_process_options - proces the informations from the config.html + * forms arriving from the server. We need to update all values that begin + * with $module to make them begin with 'voicetool'. + * + * We also need to update the table of course that have access to the tools. + * + * @param $config - the config object + */ +function voicetool_process_options ($config) { + $module = $config->module; + foreach ($config as $name => $value) { + + } + + +} + + /** * Send an SDK request to the VT server to create the resource. * @uses CFG @@ -44,7 +63,8 @@ $resource_data); //print_r($resource); - $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); + $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); + //print_r ($result); @@ -75,7 +95,8 @@ $resource_data); //print_r($resource); - $result = $soapclient->call($VT_API_MODIFY_RESOURCE, $resource); + $result = $soapclient->call($VT_API_MODIFY_RESOURCE, $resource); + //print_r ($result); @@ -105,7 +126,8 @@ $CFG->voicetool_adminpassword, $rid); - $result = $soapclient->call($VT_API_DELETE_RESOURCE, $resource); + $result = $soapclient->call($VT_API_DELETE_RESOURCE, $resource); + if (!voicetool_check_result ($result)) { return false; @@ -143,7 +165,8 @@ //print_r($resource); - $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); + $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); + //print_r ($result); @@ -151,10 +174,13 @@ return false; } - foreach ($result['values'] as $item) { - $values[$item['name']] = $item['value']; - } + foreach ($result['values'] as $item) { + $values[$item['name']] = $item['value']; + + } + + return $values['nid']; } @@ -171,7 +197,8 @@ return false; } - foreach ($result['values'] as $item) { + foreach ($result['values'] as $item) { + if ($item['name'] == 'error_message') { error_log( "voicetool_check_result: ".$item['name'].': '.$item['value']); return false; @@ -179,9 +206,11 @@ if (($item['name'] == 'status_code') && ($item['value'] == 'ok')) { return true; - } + } + } - + + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-05-12 09:28:28
|
Revision: 15 Author: hugues Date: 2006-05-12 02:27:58 -0700 (Fri, 12 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=15&view=rev Log Message: ----------- moed most of the voice direct into voicetool. Also improved the error cheking in the configuration page Modified Paths: -------------- trunk/moodle/lang/en/voicetool.php trunk/moodle/mod/voicetool/db/mysql.sql Added Paths: ----------- trunk/moodle/mod/voicetool/ trunk/moodle/mod/voicetool/README.txt trunk/moodle/mod/voicetool/config.html trunk/moodle/mod/voicetool/db/ trunk/moodle/mod/voicetool/icon.gif trunk/moodle/mod/voicetool/index.php trunk/moodle/mod/voicetool/lib.php trunk/moodle/mod/voicetool/mod.html trunk/moodle/mod/voicetool/version.php trunk/moodle/mod/voicetool/view.php trunk/moodle/mod/voicetool/voicetoolapi.php Removed Paths: ------------- trunk/moodle/lang/en/voiceboard.php trunk/moodle/lang/en/voicedirect.php trunk/moodle/mod/voicedirect/ trunk/moodle/mod/voicetool/README.txt trunk/moodle/mod/voicetool/config.html trunk/moodle/mod/voicetool/db/ trunk/moodle/mod/voicetool/icon.gif trunk/moodle/mod/voicetool/index.php trunk/moodle/mod/voicetool/lib.php trunk/moodle/mod/voicetool/mod.html trunk/moodle/mod/voicetool/version.php trunk/moodle/mod/voicetool/view.php trunk/moodle/mod/voicetoolapi.php Deleted: trunk/moodle/lang/en/voiceboard.php =================================================================== --- trunk/moodle/lang/en/voiceboard.php 2006-05-06 22:32:23 UTC (rev 14) +++ trunk/moodle/lang/en/voiceboard.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,16 +0,0 @@ -<?PHP - -$string['modulename'] = 'Voice Board'; -$string['modulenameplural'] = 'Voice Boards'; - - -$string['title'] = 'Title'; -$string['description'] = 'Description'; -$string['basicquality'] = 'Basic Quality (Telephone quality) - 8 kbit/s - Modem usage'; -$string['standardquality'] = 'Standard Quality - 12.8 kbit/s - Modem usage'; -$string['goodquality'] = 'Good Quality (FM Radio quality) - 20.8 kbit/s - Broadband usage'; -$string['audioquality'] = 'Audio Quality'; - - - -?> Deleted: trunk/moodle/lang/en/voicedirect.php =================================================================== --- trunk/moodle/lang/en/voicedirect.php 2006-05-06 22:32:23 UTC (rev 14) +++ trunk/moodle/lang/en/voicedirect.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,17 +0,0 @@ -<?PHP - -$string['modulename'] = 'Voice Direct'; -$string['modulenameplural'] = 'Voice Directs'; - - -$string['title'] = 'Title'; -$string['description'] = 'Description'; -$string['basicquality'] = 'Basic Quality (Telephone quality) - 8 kbit/s - Modem usage'; -$string['standardquality'] = 'Standard Quality - 12.8 kbit/s - Modem usage'; -$string['goodquality'] = 'Good Quality (FM Radio quality) - 20.8 kbit/s - Broadband usage'; -$string['audioquality'] = 'Audio Quality'; - -$string['archivesession'] = 'Archive Sessions'; - - -?> Modified: trunk/moodle/lang/en/voicetool.php =================================================================== --- trunk/moodle/lang/en/voicetool.php 2006-05-06 22:32:23 UTC (rev 14) +++ trunk/moodle/lang/en/voicetool.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,5 +1,10 @@ <?PHP +$string['modulename'] = 'Wimba Voice Tool'; +$string['modulenameplural'] = 'Wimba Voice Tools'; + + +// configuration stuff $string['serverconfiguration'] = 'Voice Tools Server Configuration'; $string['explainserverconfiguration'] = 'This is the Voice Tools Server Configuration.'; $string['servername'] = 'Voice Tools Server Name'; @@ -9,4 +14,24 @@ $string['adminpassword'] = 'Voice Tools Admin Password'; $string['configadminpassword'] = 'Enter the admin password'; $string['alert.submit'] = 'Are you sure these settings are correct?'; +$string['is_allowed.false'] = 'The configuration is not correct. The url of this server is not allowed in your Voice Tools Server. Please, click on Continue to go back to the configuration page.'; +$string['Invalid account/secret'] = 'The account/password you entered is not acknowledged by the server. Please, click Continue and verify the values you entered match with the values in the Voice Tools Server.'; + + +// common VT items +$string['title'] = 'Title'; +$string['description'] = 'Description'; +$string['basicquality'] = 'Basic Quality (Telephone quality) - 8 kbit/s - Modem usage'; +$string['standardquality'] = 'Standard Quality - 12.8 kbit/s - Modem usage'; +$string['goodquality'] = 'Good Quality (FM Radio quality) - 20.8 kbit/s - Broadband usage'; +$string['audioquality'] = 'Audio Quality'; + + +// Voice Direct tags +$string['voicedirect'] = 'Voice Direct'; +$string['voicedirects'] = 'Voice Directs'; + +$string['archivesession'] = 'Archive Sessions'; + + ?> Copied: trunk/moodle/mod/voicetool (from rev 13, trunk/moodle/mod/voicedirect) Deleted: trunk/moodle/mod/voicetool/README.txt =================================================================== --- trunk/moodle/mod/voicedirect/README.txt 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/README.txt 2006-05-12 09:27:58 UTC (rev 15) @@ -1,57 +0,0 @@ -USING THE NEW MODULE TEMPLATE ------------------------------ - -1. Unzip the archive and read this file ;-) - -2. Change the name of the directory to your new module name. - This name should be a single english word, if possible, - all lowercase and with only a-z characters. eg widget - -3. Edit all the files in this directory and change all the - instances of NEWMODULE to your new module name (eg widget). - -4. Edit db/mysql.sql and put in the SQL database definitions - for your module. The names of any table definitions you create - there should use the prefix 'prefix_' instead of 'mdl_' - (or whatever you've configured your moodle installation to use - as a table prefix) (optional) - -5. Edit db/mysql.php and change all the instances of NEWMODULE - to your new module name. (optional) - -6. Do the same for db/postgres7.sql and db/postgres7.php as you - did for db/mysql.sql and db/mysql.php (optional) - -7. Create one or more language files for your module in - lang/LANG/NEWMODULE.php where LANG is the language or - languages you are creating the module for use with. (usually - this will be 'en') Use one of the language files for another - module as a template for the file. - -8. Visit the admin page and your module should be noticed and - registered as a new entry in the table "modules". - -Now you can start adding code to the .php and .html files in -this directory to make it do what you want! - -Note about database changes: - - Every time you update the database schema in the db directory, - remember to - - - edit version.php with a higher version number - - edit db/mysql.php with an execute_sql() call that - upgrades the databases to the new format (see core - modules for examples) - - and then visit the admin page to actually upgrade your databases. - - -If you have problems, questions, suggestions etc then visit -the "Activity modules" developers forum in the online -course called "Using Moodle" at http:/* moodle.org */ - -Or email me: ma...@mo... - -Cheers! -Martin Dougiamas Copied: trunk/moodle/mod/voicetool/README.txt (from rev 14, trunk/moodle/mod/voicedirect/README.txt) =================================================================== --- trunk/moodle/mod/voicetool/README.txt (rev 0) +++ trunk/moodle/mod/voicetool/README.txt 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,57 @@ +USING THE NEW MODULE TEMPLATE +----------------------------- + +1. Unzip the archive and read this file ;-) + +2. Change the name of the directory to your new module name. + This name should be a single english word, if possible, + all lowercase and with only a-z characters. eg widget + +3. Edit all the files in this directory and change all the + instances of NEWMODULE to your new module name (eg widget). + +4. Edit db/mysql.sql and put in the SQL database definitions + for your module. The names of any table definitions you create + there should use the prefix 'prefix_' instead of 'mdl_' + (or whatever you've configured your moodle installation to use + as a table prefix) (optional) + +5. Edit db/mysql.php and change all the instances of NEWMODULE + to your new module name. (optional) + +6. Do the same for db/postgres7.sql and db/postgres7.php as you + did for db/mysql.sql and db/mysql.php (optional) + +7. Create one or more language files for your module in + lang/LANG/NEWMODULE.php where LANG is the language or + languages you are creating the module for use with. (usually + this will be 'en') Use one of the language files for another + module as a template for the file. + +8. Visit the admin page and your module should be noticed and + registered as a new entry in the table "modules". + +Now you can start adding code to the .php and .html files in +this directory to make it do what you want! + +Note about database changes: + + Every time you update the database schema in the db directory, + remember to + + - edit version.php with a higher version number + - edit db/mysql.php with an execute_sql() call that + upgrades the databases to the new format (see core + modules for examples) + + and then visit the admin page to actually upgrade your databases. + + +If you have problems, questions, suggestions etc then visit +the "Activity modules" developers forum in the online +course called "Using Moodle" at http:/* moodle.org */ + +Or email me: ma...@mo... + +Cheers! +Martin Dougiamas Deleted: trunk/moodle/mod/voicetool/config.html =================================================================== --- trunk/moodle/mod/voicedirect/config.html 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/config.html 2006-05-12 09:27:58 UTC (rev 15) @@ -1,55 +0,0 @@ -<form method="post" action="module.php" name="form"> -<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"> - -<table cellpadding="9" cellspacing="0" > - -<tr> - <td colspan="3" align="center"> - <div><b><?php print_string('serverconfiguration', 'voicetool')?></b></div> - <div style="font-size: 0.8em;">(<?php print_string('explainserverconfiguration', 'voicetool')?>)</div> - </td> -</tr> - -<tr valign="top"> - <td align="right"><?php print_string('servername', 'voicetool')?>:</td> - <td> - <input name="voicetool_servername" type="text" size="30" value="<?php p($CFG->voicetool_servername) ?>" /> - </td> - <td> - <?php print_string("configservername", "voicetool") ?> - </td> -</tr> -<tr valign="top"> - <td align="right"><?php print_string('adminusername', 'voicetool')?>:</td> - <td> - <input name="voicetool_adminusername" type="text" size="20" value="<?php p($CFG->voicetool_adminusername) ?>" /> - </td> - <td> - <?php print_string("configadminusername", "voicetool") ?> - </td> -</tr> -<tr valign="top"> - <td align="right"><?php print_string('adminpassword', 'voicetool')?>:</td> - <td> - <input name="voicetool_adminpassword" type="text" size="20" value="<?php p($CFG->voicetool_adminpassword) ?>" /> - </td> - <td> - <?php print_string("configadminpassword", "voicetool") ?> - </td> -</tr> -<tr valign="top"> - <td align="right"><?php print_string('settinguniqueid', 'voicetool')?>:</td> - <td> - <input name="voicetool_settinguniqueid" type="text" size="20" value="<?php p($CFG->voicetool_settinguniqueid) ?>" /> - </td> - <td> - <?php print_string("configsettinguniqueid", "voicetool") ?> - </td> -</tr> -<tr> - <td colspan="3" align="center"> - <input type="submit" value="<?php print_string("savechanges") ?>" /></td> -</tr> -</table> - -</form> Copied: trunk/moodle/mod/voicetool/config.html (from rev 14, trunk/moodle/mod/voicedirect/config.html) =================================================================== --- trunk/moodle/mod/voicetool/config.html (rev 0) +++ trunk/moodle/mod/voicetool/config.html 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,60 @@ +<?php +require_once ("$CFG->dirroot/lib/datalib.php"); + + +if (!$courses = get_records ('course', '', '', 'shortname ASC', 'id, shortname, fullname')) { + error('Cannot retreive Course list'); +} + + + +?> + + +<form method="post" action="module.php" name="form"> +<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"> +<input type="hidden" name="module" value="voicetool"> + +<table cellpadding="9" cellspacing="0" > + +<tr> + <td colspan="3" align="center"> + <div><b><?php print_string('serverconfiguration', 'voicetool')?></b></div> + <div style="font-size: 0.8em;">(<?php print_string('explainserverconfiguration', 'voicetool')?>)</div> + </td> +</tr> + +<tr valign="top"> + <td align="right"><?php print_string('servername', 'voicetool')?>:</td> + <td> + <input name="servername" type="text" size="30" value="<?php p($CFG->voicetool_servername) ?>" /> + </td> + <td> + <?php print_string('configservername', 'voicetool') ?> + </td> +</tr> +<tr valign="top"> + <td align="right"><?php print_string('adminusername', 'voicetool')?>:</td> + <td> + <input name="adminusername" type="text" size="20" value="<?php p($CFG->voicetool_adminusername) ?>" /> + </td> + <td> + <?php print_string('configadminusername', 'voicetool') ?> + </td> +</tr> +<tr valign="top"> + <td align="right"><?php print_string('adminpassword', 'voicetool')?>:</td> + <td> + <input name="adminpassword" type="text" size="20" value="<?php p($CFG->voicetool_adminpassword) ?>" /> + </td> + <td> + <?php print_string('configadminpassword', 'voicetool') ?> + </td> +</tr> +<tr> + <td colspan="3" align="center"> + <input type="submit" value="<?php print_string('savechanges') ?>" /></td> +</tr> +</table> + +</form> Copied: trunk/moodle/mod/voicetool/db (from rev 14, trunk/moodle/mod/voicedirect/db) Modified: trunk/moodle/mod/voicetool/db/mysql.sql =================================================================== --- trunk/moodle/mod/voicedirect/db/mysql.sql 2006-05-06 22:32:23 UTC (rev 14) +++ trunk/moodle/mod/voicetool/db/mysql.sql 2006-05-12 09:27:58 UTC (rev 15) @@ -5,18 +5,25 @@ # that may be used, especially new entries in the table log_display -CREATE TABLE `prefix_voicedirect` ( +CREATE TABLE `prefix_voicetool` ( `id` int(10) unsigned NOT NULL auto_increment, `rid` varchar(160) NOT NULL default '', `course` int(10) unsigned NOT NULL default '0', `name` varchar(255) NOT NULL default '', `timemodified` int(10) unsigned NOT NULL default '0', + `type` varchar(15) NOT NULL default '', + PRIMARY KEY (`id`) +) COMMENT='Defines Voice Tool'; +# -------------------------------------------------------- + +CREATE TABLE `prefix_voicedirect`( + `rid` varchar(160) NOT NULL default '', `description` varchar(255) NOT NULL default '', `email` varchar(255) NOT NULL default '', `type` varchar(10) NOT NULL, `quality` varchar(20) NOT NULL default 'basicquality', `archive` varchar(20) NOT NULL default '', - PRIMARY KEY (`id`) + PRIMARY KEY (`rid`) ) COMMENT='Defines Voice Direct'; # -------------------------------------------------------- Deleted: trunk/moodle/mod/voicetool/icon.gif =================================================================== (Binary files differ) Copied: trunk/moodle/mod/voicetool/icon.gif (from rev 14, trunk/moodle/mod/voicedirect/icon.gif) =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/voicetool/index.php =================================================================== --- trunk/moodle/mod/voicedirect/index.php 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/index.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,83 +0,0 @@ -<?PHP // $Id:$ - -/// This page lists all the instances of voicedirects in a particular course -/// Replace voicedirect with the name of your module - - require_once("../../config.php"); - require_once("lib.php"); - - require_variable($id); // course - - if (! $course = get_record("course", "id", $id)) { - error("Course ID is incorrect"); - } - - require_login($course->id); - - add_to_log($course->id, "voicedirect", "view all", "index.php?id=$course->id", ""); - - -/// Get all required strings - - $strvoicedirects = get_string("modulenameplural", "voicedirect"); - $strvoicedirect = get_string("modulename", "voicedirect"); - - -/// Print the header - - if ($course->category) { - $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; - } - - print_header("$course->shortname: $strvoicedirects", "$course->fullname", "$navigation $strvoicedirects", "", "", true, "", navmenu($course)); - -/// Get all the appropriate data - - if (! $voicedirects = get_all_instances_in_course("voicedirect", $course)) { - notice("There are no voicedirects", "../../course/view.php?id=$course->id"); - die; - } - -/// Print the list of instances (your module will probably extend this) - - $timenow = time(); - $strname = get_string("name"); - $strweek = get_string("week"); - $strtopic = get_string("topic"); - - if ($course->format == "weeks") { - $table->head = array ($strweek, $strname); - $table->align = array ("CENTER", "LEFT"); - } else if ($course->format == "topics") { - $table->head = array ($strtopic, $strname); - $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); - } else { - $table->head = array ($strname); - $table->align = array ("LEFT", "LEFT", "LEFT"); - } - - foreach ($voicedirects as $voicedirect) { - if (!$voicedirect->visible) { - //Show dimmed if the mod is hidden - $link = "<A class=\"dimmed\" HREF=\"view.php?id=$voicedirect->coursemodule\">$voicedirect->name</A>"; - } else { - //Show normal if the mod is visible - $link = "<A HREF=\"view.php?id=$voicedirect->coursemodule\">$voicedirect->name</A>"; - } - - if ($course->format == "weeks" or $course->format == "topics") { - $table->data[] = array ($voicedirect->section, $link); - } else { - $table->data[] = array ($link); - } - } - - echo "<BR>"; - - print_table($table); - -/// Finish the page - - print_footer($course); - -?> Copied: trunk/moodle/mod/voicetool/index.php (from rev 14, trunk/moodle/mod/voicedirect/index.php) =================================================================== --- trunk/moodle/mod/voicetool/index.php (rev 0) +++ trunk/moodle/mod/voicetool/index.php 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,83 @@ +<?PHP // $Id:$ + +/// This page lists all the instances of voicedirects in a particular course +/// Replace voicedirect with the name of your module + + require_once("../../config.php"); + require_once("lib.php"); + + require_variable($id); // course + + if (! $course = get_record("course", "id", $id)) { + error("Course ID is incorrect"); + } + + require_login($course->id); + + add_to_log($course->id, "voicetool", "view all", "index.php?id=$course->id", ""); + + +/// Get all required strings + + $strvoicetools = get_string("modulenameplural", "voicetool"); + $strvoicetool = get_string("modulename", "voicetool"); + + +/// Print the header + + if ($course->category) { + $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; + } + + print_header("$course->shortname: $strvoicetoolss", "$course->fullname", "$navigation $strvoicetools", "", "", true, "", navmenu($course)); + +/// Get all the appropriate data + + if (! $voicetools = get_all_instances_in_course("voicedirect", $course)) { + notice("There are no voicetools", "../../course/view.php?id=$course->id"); + die; + } + +/// Print the list of instances (your module will probably extend this) + + $timenow = time(); + $strname = get_string("name"); + $strweek = get_string("week"); + $strtopic = get_string("topic"); + + if ($course->format == "weeks") { + $table->head = array ($strweek, $strname); + $table->align = array ("CENTER", "LEFT"); + } else if ($course->format == "topics") { + $table->head = array ($strtopic, $strname); + $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); + } else { + $table->head = array ($strname); + $table->align = array ("LEFT", "LEFT", "LEFT"); + } + + foreach ($voicetools as $voicetool) { + if (!$voicetool->visible) { + //Show dimmed if the mod is hidden + $link = "<A class=\"dimmed\" HREF=\"view.php?id=$voicetool->coursemodule\">$voicetool->name</A>"; + } else { + //Show normal if the mod is visible + $link = "<A HREF=\"view.php?id=$voicetool->coursemodule\">$voicetool->name</A>"; + } + + if ($course->format == "weeks" or $course->format == "topics") { + $table->data[] = array ($voicedirect->section, $link); + } else { + $table->data[] = array ($link); + } + } + + echo "<BR>"; + + print_table($table); + +/// Finish the page + + print_footer($course); + +?> Deleted: trunk/moodle/mod/voicetool/lib.php =================================================================== --- trunk/moodle/mod/voicedirect/lib.php 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/lib.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,255 +0,0 @@ -<?PHP // $Id:$ - -require_once ("$CFG->dirroot/mod/voicetoolapi.php"); - -/// Library of functions and constants for module voicedirect -/// (replace voicedirect with the name of your module and delete this line) - - -/** - * Validate the data in passed in the configuration page - * @param $config - the information from the form mod.html - */ -function voicedirect_process_options ($config) { - return true; -} - -function voicedirect_add_instance($voicedirect) { -/// Given an object containing all the necessary data, -/// (defined by the form in mod.html) this function -/// will create a new instance and return the id number -/// of the new instance. - global $USER; - - $voicedirect->email = $USER->email; // email of the creator - $voicedirect->timemodified = time(); - - - $data = voicedirect_create_rsc_data ($voicedirect); - - if (empty ($data)) { - error('Data not created correctly'); - } - - //print_r($data); - - if (!$result = voicetool_create_resource ($data)) { - error('Cannot create the resource on the VT server'); - } - - # May have to add extra stuff in here # - foreach ($result['values'] as $item) { - $values[$item['name']] = $item['value']; - } - - $rid = $values['rid']; - - $voicedirect->rid = $rid; - - return insert_record('voicedirect', $voicedirect); -} - - -function voicedirect_update_instance($voicedirect) { -/// 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; - - $voicedirect->timemodified = time(); - $voicedirect->id = $voicedirect->instance; - - $data = voicedirect_create_rsc_data ($voicedirect); - - if (empty ($data)) { - error('Data not created correctly'); - } - -///print_r($data); -///error (info); - - if (! $result = voicetool_modify_resource ($data)) { - error('Cannot modify the resource on the VT server'); - } - - # May have to add extra stuff in here # - -///print_r($voicedirect); - - return update_record('voicedirect', $voicedirect); -} - - -function voicedirect_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. - - if (! $voicedirect = get_record("voicedirect", "id", "$id")) { - return false; - } - - if (! ($result = voicetool_delete_resource ($voicedirect->rid))) { - error('Cannot modify the resource on the VT server'); - } - - $result = true; - # Delete any dependent records here # - if (! delete_records("voicedirect", "id", "$voicedirect->id")) { - $result = false; - } - - return $result; -} - -function voicedirect_user_outline($course, $user, $mod, $voicedirect) { -/// Return a small object with summary information about what a -/// user has done with a given particular instance of this module -/// Used for user activity reports. -/// $return->time = the time they did it -/// $return->info = a short text description - - return $return; -} - -function voicedirect_user_complete($course, $user, $mod, $voicedirect) { -/// Print a detailed representation of what a user has done with -/// a given particular instance of this module, for user activity reports. - - return true; -} - -function voicedirect_print_recent_activity($course, $isteacher, $timestart) { -/// Given a course and a time, this module should find recent activity -/// that has occurred in voicedirect activities and print it out. -/// Return true if there was output, or false is there was none. - - global $CFG; - - return false; // True if anything was printed, otherwise false -} - -function voicedirect_cron () { -/// Function to be run periodically according to the moodle cron -/// This function searches for things that need to be done, such -/// as sending out mail, toggling flags etc ... - - global $CFG; - - return true; -} - -function voicedirect_grades($voicedirectid) { -/// Must return an array of grades for a given instance of this module, -/// indexed by user. It also returns a maximum allowed grade. -/// -/// $return->grades = array of grades; -/// $return->maxgrade = maximum allowed grade; -/// -/// return $return; - - return NULL; -} - -function voicedirect_get_participants($voicedirectid) { -//Must return an array of user records (all data) who are participants -//for a given instance of voicedirect. Must include every user involved -//in the instance, independient of his role (student, teacher, admin...) -//See other modules as example. - - return false; -} - -function voicedirect_scale_used ($voicedirectid,$scaleid) { -//This function returns if a scale is being used by one voicedirect -//it it has support for grading and scales. Commented code should be -//modified if necessary. See forum, glossary or journal modules -//as reference. - - $return = false; - - //$rec = get_record("voicedirect","id","$voicedirectid","scale","-$scaleid"); - // - //if (!empty($rec) && !empty($scaleid)) { - // $return = true; - //} - - return $return; -} - -////////////////////////////////////////////////////////////////////////////////////// -/// Any other voicedirect functions go here. Each of them must have a name that -/// starts with voicedirect_ -/// -/// PairSet : array ('values' => array (), 'groups' => array ()); -/// NameSetPair : array ('name' => false, 'pairSet' => array ()); -/// NalmeValuePair : array ('name' => false, 'value' => false); -/// - -/** - * Create the data structure for a resource - * @param $voicedirect - the information incoming from the mod.html form - * @return the information ready to be sent to the API - */ -function voicedirect_create_rsc_data ($voicedirect) { - global $VT_API_VDIRECT; - - //add_to_log($voicedirect->course, "voicedirect", "", "", "Creating Data for Voice Direct"); - - $result = new PairSet (); - - $result->addNameValuePair ('type', $VT_API_VDIRECT); - $result->addNameValuePair ('title', $voicedirect->name); - $result->addNameValuePair ('description', $voicedirect->description); - $result->addNameValuePair ('email', $voicedirect->email); - if (isset($voicedirect->rid)) { - $result->addNameValuePair ('rid', $voicedirect->rid); - } - - $audioformat = new PairSet (); - $audioformat->addNameValuePair ('name', $voicedirect->audioformat); - - $options = new PairSet (); - $options->addPairSet('audio_format', $audioformat); - $options->addNameValuePair('archive', (($voicedirect->archive == 'on')?'true':'false')); - - $result->addPairSet ('options', $options); - - return $result->getData(); -} - - -/** - * Create the data structure for a resource - * @param $voicedirect - the information incoming from the mod.html form - * @return the information ready to be sent to the API - */ -function voicedirect_create_session_data ($voicedirect) { - global $VT_API_VDIRECT, - $USER; - - add_to_log($voicedirect->course, "voicedirect", "", "", "Creating Data for Voice Direct Session"); - - $user = new PairSet (); - $user->addNameValuePair ('screen_name', $USER->firstname."_".$USER->lastname); - $user->addNameValuePair ('email', $USER->email); - - $resource = new PairSet (); - $resource->addNameValuePair('rid', $voicedirect->rid); - - $rights = new PairSet (); - - if (isteacher($voicedirect->course)) { - $rights->addNameValuePair ('profile', 'blackboard.voicedirect.instructor'); - } - else { - $rights->addNameValuePair ('profile', 'blackboard.voicedirect.student'); - } - - return array ('user' => $user->getData(), - 'resource' => $resource->getData(), - 'message' => array(), - 'rights' => $rights->getData() ); -} - -?> Copied: trunk/moodle/mod/voicetool/lib.php (from rev 14, trunk/moodle/mod/voicedirect/lib.php) =================================================================== --- trunk/moodle/mod/voicetool/lib.php (rev 0) +++ trunk/moodle/mod/voicetool/lib.php 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,271 @@ +<?PHP // $Id:$ + +require_once ('voicetoolapi.php'); + +/// Library of functions and constants for module voicetool + + +/** + * Validate the data in passed in the configuration page + * @param $config - the information from the form mod.html + */ +function voicetool_process_options ($config) { + global $CFG; + + $result = voicetool_api_check_documentbase ($config->servername, + $config->adminusername, + $config->adminpassword, + $CFG->wwwroot); + + if ($result == 'is_allowed.true') { + return; + } + + //get the error string and display it + + error(get_string($result, 'voicetool' ), 'javascript:history.back();'); + + return; +} + +function voicetool_add_instance($voicetool) { +/// Given an object containing all the necessary data, +/// (defined by the form in mod.html) this function +/// will create a new instance and return the id number +/// of the new instance. + global $USER; + + $voicetool->email = $USER->email; // email of the creator + $voicetool->timemodified = time(); + + + $data = voicetool_create_rsc_data ($voicetool); + + if (empty ($data)) { + error('Data not created correctly', "javascript:back();"); + } + + //print_r($data); + + if (!$result = voicetool_api_create_resource ($data)) { + error('Cannot create the resource on the VT server', "javascript:back();"); + } + + //the function returned correctly, we do not have to care whether + //the rid is in or not: it is + foreach ($result['values'] as $item) { + $values[$item['name']] = $item['value']; + if ($item['name'] == 'rid') { + continue; + } + } + + $voicetool->rid = $values['rid']; + + return insert_record('voicetool', $voicetool); +} + + +function voicetool_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; + + $data = voicetool_create_rsc_data ($voicetool); + + if (empty ($data)) { + error('Data not created correctly'); + } + +///print_r($data); +///error (info); + + if (! $result = voicetool_api_modify_resource ($data)) { + error('Cannot modify the resource on the VT server'); + } + + # May have to add extra stuff in here # + +///print_r($voicetool); + + return update_record('voicetool', $voicetool); +} + + +function voicetool_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. + + if (! $voicetool = get_record("voicetool", "id", "$id")) { + return false; + } + + if (! ($result = voicetool_api_delete_resource ($voicetool->rid))) { + error('Cannot modify the resource on the VT server'); + } + + $result = true; + # Delete any dependent records here # + if (! delete_records("voicetool", "id", "$voicetool->id")) { + $result = false; + } + + return $result; +} + +function voicetool_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 +/// Used for user activity reports. +/// $return->time = the time they did it +/// $return->info = a short text description + + return $return; +} + +function voicetool_user_complete($course, $user, $mod, $voicetool) { +/// Print a detailed representation of what a user has done with +/// a given particular instance of this module, for user activity reports. + + return true; +} + +function voicetool_print_recent_activity($course, $isteacher, $timestart) { +/// Given a course and a time, this module should find recent activity +/// that has occurred in voicetool activities and print it out. +/// Return true if there was output, or false is there was none. + + global $CFG; + + return false; // True if anything was printed, otherwise false +} + +function voicetool_cron () { +/// Function to be run periodically according to the moodle cron +/// This function searches for things that need to be done, such +/// as sending out mail, toggling flags etc ... + + global $CFG; + + return true; +} + +function voicetool_grades($voicetoolid) { +/// Must return an array of grades for a given instance of this module, +/// indexed by user. It also returns a maximum allowed grade. +/// +/// $return->grades = array of grades; +/// $return->maxgrade = maximum allowed grade; +/// +/// return $return; + + return NULL; +} + +function voicetool_get_participants($voicetoolid) { +//Must return an array of user records (all data) who are participants +//for a given instance of voicetool. Must include every user involved +//in the instance, independient of his role (student, teacher, admin...) +//See other modules as example. + + return false; +} + +function voicetool_scale_used ($voicetoolid,$scaleid) { +//This function returns if a scale is being used by one voicetool +//it it has support for grading and scales. Commented code should be +//modified if necessary. See forum, glossary or journal modules +//as reference. + + $return = false; + + //$rec = get_record("voicetool","id","$voicetoolid","scale","-$scaleid"); + // + //if (!empty($rec) && !empty($scaleid)) { + // $return = true; + //} + + return $return; +} + +////////////////////////////////////////////////////////////////////////////////////// +/// Any other voicetool functions go here. Each of them must have a name that +/// starts with voicetool_ +/// +/// PairSet : array ('values' => array (), 'groups' => array ()); +/// NameSetPair : array ('name' => false, 'pairSet' => array ()); +/// NalmeValuePair : array ('name' => false, 'value' => false); +/// + +/** + * Create the data structure for a resource + * @param $voicetool - the information incoming from the mod.html form + * @return the information ready to be sent to the API + */ +function voicetool_create_rsc_data ($voicetool) { + global $VT_API_VDIRECT; + + //add_to_log($voicetool->course, "voicetool", "", "", "Creating Data for Voice Direct"); + + $result = new PairSet (); + + $result->addNameValuePair ('type', $VT_API_VDIRECT); + $result->addNameValuePair ('title', $voicetool->name); + $result->addNameValuePair ('description', $voicetool->description); + $result->addNameValuePair ('email', $voicetool->email); + if (isset($voicetool->rid)) { + $result->addNameValuePair ('rid', $voicetool->rid); + } + + $audioformat = new PairSet (); + $audioformat->addNameValuePair ('name', $voicetool->audioformat); + + $options = new PairSet (); + $options->addPairSet('audio_format', $audioformat); + $options->addNameValuePair('archive', (($voicetool->archive == 'on')?'true':'false')); + + $result->addPairSet ('options', $options); + + return $result->getData(); +} + + +/** + * Create the data structure for a resource + * @param $voicetool - the information incoming from the mod.html form + * @return the information ready to be sent to the API + */ +function voicetool_create_session_data ($voicetool) { + global $VT_API_VDIRECT, + $USER; + + add_to_log($voicetool->course, "voicetool", "", "", "Creating Data for Voice Direct Session"); + + $user = new PairSet (); + $user->addNameValuePair ('screen_name', $USER->firstname."_".$USER->lastname); + $user->addNameValuePair ('email', $USER->email); + + $resource = new PairSet (); + $resource->addNameValuePair('rid', $voicetool->rid); + + $rights = new PairSet (); + + if (isteacher($voicetool->course)) { + $rights->addNameValuePair ('profile', 'blackboard.voicetool.instructor'); + } + else { + $rights->addNameValuePair ('profile', 'blackboard.voicetool.student'); + } + + return array ('user' => $user->getData(), + 'resource' => $resource->getData(), + 'message' => array(), + 'rights' => $rights->getData() ); +} + +?> Deleted: trunk/moodle/mod/voicetool/mod.html =================================================================== --- trunk/moodle/mod/voicedirect/mod.html 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/mod.html 2006-05-12 09:27:58 UTC (rev 15) @@ -1,85 +0,0 @@ -<!-- This page defines the form to create or edit an instance of this module --> -<!-- It is used from /course/mod.php. The whole instance is available as $form. --> - -<?php - -require_once ("$CFG->dirroot/mod/voicetoolapi.php"); - -/// First we check that form variables have been initialised -if (!isset($form->name)) { - $form->name = ''; -} - -if (!isset($form->description)) { - $form->description = ''; -} - -if (!isset($form->quality)) { - $form->quality = $VT_API_QUALITY_BASIC; -} - -if (!isset($form->archive)) { - $form->archive = ''; -} - -if (!isset($form->rid)) { - $form->rid = ''; -} - -?> - - -<form name="form" method="post" action="mod.php"> -<center> -<table cellpadding="5"> -<tr valign="top"> - <td align="right"><label for="name"><?php echo get_string('title', 'voicedirect') ?>:</label></td> - <td> - <input type="text" name="name" id="name" size="30" value="<?php p($form->name) ?>"> - </td> -</tr> -<!-- More rows go in here... --> -<tr valign="top"> - <td align="right"><label for="description"><?php echo get_string('description', 'voicedirect') ?>:</label></td> - <td> - <input type="text" name="description" id="description" size="30" value="<?php p($form->description) ?>"> - </td> -</tr> -<tr valign="top"> - <td align="right"><b><label for="quality"><?php echo get_string ('audioquality', 'voicedirect') ?></label>:</b></td> - <td> -<select id="quality" name="quality"> -<option value="spx_8_q3" <?php if ($form->quality == 'spx_8_q3') { echo 'selected';}?>><?php echo get_string ('basicquality', 'voicedirect') ?></option> -<option value="spx_16_q4" <?php if ($form->quality == 'spx_16_q4') { echo 'selected';}?>><?php echo get_string ('standardquality', 'voicedirect') ?></option> -<option value="spx_16_q6" <?php if ($form->quality == 'spx_16_q6') { echo 'selected';}?>><?php echo get_string ('goodquality', 'voicedirect') ?></option> -</select> - </td> -</tr> -<tr valign="top"> - <td align="right"><b><label for='archive'><?php echo get_string('archivesession', 'voicedirect') ?></label>:</b></td> - <td> - <input type="checkbox" name="archive" id="archive" <?php if ($form->archive == 'on'){echo 'checked';} ?>> - </td> -</tr> - -<!-- The following line for Moodle 1.5 prints the visibility setting form element --> -<?php print_visible_setting($form); ?> -<!-- and if your module uses groups you would also have --> -<?php print_groupmode_setting($form); ?> - -</table> - -<input type="hidden" name="rid" value="<?php p($form->rid) ?>" /> -<!-- These hidden variables are always the same --> -<input type="hidden" name="course" value="<?php p($form->course) ?>" /> -<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" /> -<input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" /> -<input type="hidden" name="section" value="<?php p($form->section) ?>" /> -<input type="hidden" name="module" value="<?php p($form->module) ?>" /> -<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" /> -<input type="hidden" name="instance" value="<?php p($form->instance) ?>" /> -<input type="hidden" name="mode" value="<?php p($form->mode) ?>" /> -<input type="submit" value="<?php print_string("savechanges") ?>" /> -</center> - -</form> Copied: trunk/moodle/mod/voicetool/mod.html (from rev 14, trunk/moodle/mod/voicedirect/mod.html) =================================================================== --- trunk/moodle/mod/voicetool/mod.html (rev 0) +++ trunk/moodle/mod/voicetool/mod.html 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,84 @@ +<!-- This page defines the form to create or edit an instance of this module --> +<!-- It is used from /course/mod.php. The whole instance is available as $form. --> + +<?php + +require_once ('voicetoolapi.php'); + +/// First we check that form variables have been initialised +if (!isset($form->name)) { + $form->name = ''; +} + +if (!isset($form->description)) { + $form->description = ''; +} + +if (!isset($form->quality)) { + $form->quality = $VT_API_QUALITY_BASIC; +} + +if (!isset($form->archive)) { + $form->archive = ''; +} + +if (!isset($form->rid)) { + $form->rid = ''; +} +?> + + +<form name="form" method="post" action="mod.php"> +<center> +<table cellpadding="5"> +<tr valign="top"> + <td align="right"><label for="name"><?php echo get_string('title', 'voicetool') ?>:</label></td> + <td> + <input type="text" name="name" id="name" size="30" value="<?php p($form->name) ?>"> + </td> +</tr> +<!-- More rows go in here... --> +<tr valign="top"> + <td align="right"><label for="description"><?php echo get_string('description', 'voicetool') ?>:</label></td> + <td> + <input type="text" name="description" id="description" size="30" value="<?php p($form->description) ?>"> + </td> +</tr> +<tr valign="top"> + <td align="right"><b><label for="quality"><?php echo get_string ('audioquality', 'voicetool') ?></label>:</b></td> + <td> +<select id="quality" name="quality"> +<option value="spx_8_q3" <?php if ($form->quality == 'spx_8_q3') { echo 'selected';}?>><?php echo get_string ('basicquality', 'voicetool') ?></option> +<option value="spx_16_q4" <?php if ($form->quality == 'spx_16_q4') { echo 'selected';}?>><?php echo get_string ('standardquality', 'voicetool') ?></option> +<option value="spx_16_q6" <?php if ($form->quality == 'spx_16_q6') { echo 'selected';}?>><?php echo get_string ('goodquality', 'voicetool') ?></option> +</select> + </td> +</tr> +<tr valign="top"> + <td align="right"><b><label for='archive'><?php echo get_string('archivesession', 'voicetool') ?></label>:</b></td> + <td> + <input type="checkbox" name="archive" id="archive" <?php if ($form->archive == 'on'){echo 'checked';} ?>> + </td> +</tr> + +<!-- The following line for Moodle 1.5 prints the visibility setting form element --> +<?php print_visible_setting($form); ?> +<!-- and if your module uses groups you would also have --> +<?php print_groupmode_setting($form); ?> + +</table> + +<input type="hidden" name="rid" value="<?php p($form->rid) ?>" /> +<!-- These hidden variables are always the same --> +<input type="hidden" name="course" value="<?php p($form->course) ?>" /> +<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" /> +<input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" /> +<input type="hidden" name="section" value="<?php p($form->section) ?>" /> +<input type="hidden" name="module" value="<?php p($form->module) ?>" /> +<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" /> +<input type="hidden" name="instance" value="<?php p($form->instance) ?>" /> +<input type="hidden" name="mode" value="<?php p($form->mode) ?>" /> +<input type="submit" value="<?php print_string("savechanges") ?>" /> +</center> + +</form> Deleted: trunk/moodle/mod/voicetool/version.php =================================================================== --- trunk/moodle/mod/voicedirect/version.php 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/version.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,11 +0,0 @@ -<?PHP // $Id: version.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ - -///////////////////////////////////////////////////////////////////////////////// -/// Code fragment to define the version of NEWMODULE -/// This fragment is called by moodle_needs_upgrading() and /admin/index.php -///////////////////////////////////////////////////////////////////////////////// - -$module->version = 2003092800; // The current module version (Date: YYYYMMDDXX) -$module->cron = 0; // Period for cron to check this module (secs) - -?> Copied: trunk/moodle/mod/voicetool/version.php (from rev 14, trunk/moodle/mod/voicedirect/version.php) =================================================================== --- trunk/moodle/mod/voicetool/version.php (rev 0) +++ trunk/moodle/mod/voicetool/version.php 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,11 @@ +<?PHP // $Id: version.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ + +///////////////////////////////////////////////////////////////////////////////// +/// Code fragment to define the version of NEWMODULE +/// This fragment is called by moodle_needs_upgrading() and /admin/index.php +///////////////////////////////////////////////////////////////////////////////// + +$module->version = 2003092800; // The current module version (Date: YYYYMMDDXX) +$module->cron = 0; // Period for cron to check this module (secs) + +?> Deleted: trunk/moodle/mod/voicetool/view.php =================================================================== --- trunk/moodle/mod/voicedirect/view.php 2006-05-05 08:13:48 UTC (rev 13) +++ trunk/moodle/mod/voicetool/view.php 2006-05-12 09:27:58 UTC (rev 15) @@ -1,96 +0,0 @@ -<?PHP // $Id: view.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ - -/// This page prints a particular instance of voicedirect -/// (Replace voicedirect with the name of your module) - - require_once('../../config.php'); - require_once('lib.php'); - require_once('../voicetoolapi.php'); - - optional_variable($id); // Course Module ID, or - optional_variable($a); // voicedirect ID - - if ($id) { - 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 (! $voicedirect = get_record("voicedirect", "id", $cm->instance)) { - error("Course module is incorrect"); - } - - } else { - if (! $voicedirect = get_record("voicedirect", "id", $a)) { - error("Course module is incorrect"); - } - if (! $course = get_record("course", "id", $voicedirect->course)) { - error("Course is misconfigured"); - } - if (! $cm = get_coursemodule_from_instance("voicedirect", $voicedirect->id, $course->id)) { - error("Course Module ID was incorrect"); - } - } - - require_login($course->id); - - add_to_log($course->id, "voicedirect", "view", "view.php?id=$cm->id", "$voicedirect->id"); - - if (!$nid = voicetool_create_session ($voicedirect)) { - error(get_string ('cannotgetsession', 'voicedirect')); - } - - - -/// Print the page header - - if ($course->category) { - $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; - } - - $strvoicedirects = get_string("modulenameplural", "voicedirect"); - $strvoicedirect = get_string("modulename", "voicedirect"); - - print_header("$course->shortname: $voicedirect->name", "$course->fullname", - "$navigation <A HREF=index.php?id=$course->id>$strvoicedirects</A> -> $voicedirect->name", - "", "", true, update_module_button($cm->id, $course->id, $strvoicedirect), - navmenu($course, $cm)); - -/// Print the main part of the page - global $CFG; - - $servername = $CFG->voicetool_servername; - -?> -<p><em><strong><?php p($voicedirect->description) ?></strong></em></p> -<SCRIPT type="text/javascript"> - this.focus(); -</SCRIPT> -<SCRIPT type="text/javascript" SRC="<?php echo $servername ?>/voicedirect/voicedirect.js"></SCRIPT> -<SCRIPT type="text/javascript"> - var w_p = new Object(); - w_p.view_archives_url="<?php echo $servername ?>/board?action=display_popup&language=fr&width=545&height=805"; - w_p.view_archives_target = "wimba_archives"; - w_p.language="fr"; - - w_p.nid="<?php echo $nid?>"; - - if (window.w_voicedirect_tag) w_voicedirect_tag(w_p); - else document.write("Applet should be there, but the Voice Tools server is down"); -</SCRIPT> -<NOSCRIPT> -Your browser does not seem to be configured correctly to be able to use Horizon Wimba -Tools. Please go through the -<a href="<?php echo $servername ?>/wizard/launcher.jsp"> Setup Wizard</a> to configure it correctly. -</NOSCRIPT> - - - -<?php -/// Finish the page - print_footer($course); - -?> Copied: trunk/moodle/mod/voicetool/view.php (from rev 14, trunk/moodle/mod/voicedirect/view.php) =================================================================== --- trunk/moodle/mod/voicetool/view.php (rev 0) +++ trunk/moodle/mod/voicetool/view.php 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,96 @@ +<?PHP // $Id: view.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ + +/// This page prints a particular instance of voicedirect +/// (Replace voicedirect with the name of your module) + + require_once('../../config.php'); + require_once('lib.php'); + require_once('voicetoolapi.php'); + + optional_variable($id); // Course Module ID, or + optional_variable($a); // voicetool ID + + if ($id) { + 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("voicetool", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + } else { + if (! $voicetool = get_record("voicetool", "id", $a)) { + error("Course module is incorrect"); + } + if (! $course = get_record("course", "id", $voicetool->course)) { + error("Course is misconfigured"); + } + if (! $cm = get_coursemodule_from_instance("voicetool", $voicetool->id, $course->id)) { + error("Course Module ID was incorrect"); + } + } + + require_login($course->id); + + add_to_log($course->id, "voicetool", "view", "view.php?id=$cm->id", "$voicetool->id"); + + if (!$nid = voicetool_api_create_session ($voicetool)) { + error(get_string ('cannotgetsession', 'voicetool')); + } + + + +/// Print the page header + + if ($course->category) { + $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; + } + + $strvoicetools = get_string("modulenameplural", "voicetool"); + $strvoicetool = get_string("modulename", "voicetool"); + + print_header("$course->shortname: $voicetool->name", "$course->fullname", + "$navigation <A HREF=index.php?id=$course->id>$strvoicetools</A> -> $voicetool->name", + "", "", true, update_module_button($cm->id, $course->id, $strvoicetool), + navmenu($course, $cm)); + +/// Print the main part of the page + global $CFG; + + $servername = $CFG->voicetool_servername; + +?> +<p><em><strong><?php p($voicetool->description) ?></strong></em></p> +<SCRIPT type="text/javascript"> + this.focus(); +</SCRIPT> +<SCRIPT type="text/javascript" SRC="<?php echo $servername ?>/voicedirect/voicedirect.js"></SCRIPT> +<SCRIPT type="text/javascript"> + var w_p = new Object(); + w_p.view_archives_url="<?php echo $servername ?>/board?action=display_popup&language=fr&width=545&height=805"; + w_p.view_archives_target = "wimba_archives"; + w_p.language="fr"; + + w_p.nid="<?php echo $nid?>"; + + if (window.w_voicedirect_tag) w_voicedirect_tag(w_p); + else document.write("Applet should be there, but the Voice Tools server is down"); +</SCRIPT> +<NOSCRIPT> +Your browser does not seem to be configured correctly to be able to use Horizon Wimba +Tools. Please go through the +<a href="<?php echo $servername ?>/wizard/launcher.jsp"> Setup Wizard</a> to configure it correctly. +</NOSCRIPT> + + + +<?php +/// Finish the page + print_footer($course); + +?> Copied: trunk/moodle/mod/voicetool/voicetoolapi.php (from rev 14, trunk/moodle/mod/voicetoolapi.php) =================================================================== --- trunk/moodle/mod/voicetool/voicetoolapi.php (rev 0) +++ trunk/moodle/mod/voicetool/voicetoolapi.php 2006-05-12 09:27:58 UTC (rev 15) @@ -0,0 +1,296 @@ +<?PHP // $Id:$ + + +require_once("$CFG->dirroot/lib/nusoap/nusoap.php"); + +/// Library of functions and constants for the voicetool API + +$VT_API_VBOARD = 'board'; +$VT_API_VMAIL = 'vmail'; +$VT_API_VDIRECT = 'voicedirect'; +$VT_API_VRECORDER = 'recorder'; + +$VT_API_QUALITY_BASIC = 'spx_8_q3'; +$VT_API_QUALITY_STANDARD = 'spx_16_q4'; +$VT_API_QUALITY_GOOD = 'spx_16_q6'; + + +$VT_API_SERVICES = '/services/Broker?wsdl'; +$VT_API_CREATE_RESOURCE = 'createResource'; +$VT_API_MODIFY_RESOURCE = 'modifyResource'; +$VT_API_DELETE_RESOURCE = 'deleteResource'; +$VT_API_CREATE_SESSION = 'createSession'; +$VT_API_ALLOWEDDOCBASE = 'isDocumentBaseAllowed'; + + + + +/** + * Send an SDK request to the VT server to create the resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_CREATE_RESOURCE + * @param $resource_data - the resource to create + * @return - the object returned by the call, or false if something goes wrong + */ +function voicetool_api_create_resource ($resource_data) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_RESOURCE; + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $resource_data); + //print_r($resource); + + $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); + + + //print_r ($result); + + if (!voicetool_api_check_result ($result)) { + return false; + } + + return $result; +} + +/** + * Send an SDK request to the VT server to create the resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_MODIFY_RESOURCE + * @param $resource_data - the resource to create + * @return - the object returned by the call, or false if something goes wrong + */ +function voicetool_api_modify_resource ($resource_data) { + global $CFG, + $VT_API_SERVICES, + $VT_API_MODIFY_RESOURCE; + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $resource_data); + //print_r($resource); + + $result = $soapclient->call($VT_API_MODIFY_RESOURCE, $resource); + + + //print_r ($result); + + if (!voicetool_api_check_result ($result)) { + return false; + } + + return $result; +} + +/** + * Send an SDK request to the VT server to delete a resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_DELETE_RESOURCE + * @param $rid - the rid of the resource to delete + * @return - the object returned by the call, or false if something goes wrong + */ +function voicetool_api_delete_resource ($rid) { + global $CFG, + $VT_API_SERVICES, + $VT_API_DELETE_RESOURCE; + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $rid); + + $result = $soapclient->call($VT_API_DELETE_RESOURCE, $resource); + + + if (!voicetool_api_check_result ($result)) { + return false; + } + + return $result; +} + + + +/** + * Create the session for a voice direct applet. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_CREATE_SESSION + * @param - the voicetool information + * @return - the mid to insert into the html + */ +function voicetool_api_create_session ($voicetool) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_SESSION; + + + $sessiondata = voicetool_create_session_data($voicetool); + + $soapclient = new soapclient($CFG->voicetool_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetool_adminusername, + $CFG->voicetool_adminpassword, + $sessiondata['user'], + $sessiondata['resource'], + $sessiondata['message'], + $sessiondata['rights']); + + //print_r($resource); + + $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); + + + //print_r ($result); + + if (!voicetool_api_check_result ($result)) { + return false; + } + + foreach ($result['values'] as $item) { + + $values[$item['name']] = $item['value']; + + } + + + return $values['nid']; +} + +/** + * Checks that the documentabase is allowed on the VT server + * @param string $server the url of the VT server + * @param string $login the API login to use + * @param string $password the API password to use + * @param string the url that need to be checked + * @return string the string 'ok' if the url given is authorized to display voice tools, + * or an error message otherwise + */ +function voicetool_api_check_documentbase($server, $login, $password, $url) { + global $VT_API_SERVICES, + $VT_API_ALLOWEDDOCBASE; + + $soapclient = new soapclient($server.$VT_API_SERVICES,true); + + $resource = array ($login, + $password, + $url); + + $result = $soapclient->call($VT_API_ALLOWEDDOCBASE, $resource); + + //print_r($result); + + if (!voicetool_api_check_result ($result)) { + return voicetool_api_get_error_message ($result); + } + + foreach ($result['values'] as $item) { + if ($item['name'] == 'is_allowed') { + return 'is_allowed.'.$item['value']; + } + } + + error('Return Value not Found'); +} + + + +////////// Helper Function, kind of private + +/** + * Return true if the result does not contain an error code, or false wise. + * @param $result... [truncated message content] |
From: <tro...@us...> - 2007-08-29 14:30:40
|
Revision: 197 http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=197&view=rev Author: trollinger Date: 2007-08-29 07:30:36 -0700 (Wed, 29 Aug 2007) Log Message: ----------- update source after release 3.1.1 Modified Paths: -------------- trunk/moodle/mod/liveclassroom/config.html trunk/moodle/mod/liveclassroom/css/StyleSheet.css trunk/moodle/mod/liveclassroom/doAction.php trunk/moodle/mod/liveclassroom/generateListRooms.php trunk/moodle/mod/liveclassroom/generateSettings.php trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/js/hwCommons.js trunk/moodle/mod/liveclassroom/lang/en/liveclassroom.php trunk/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php trunk/moodle/mod/liveclassroom/lang/fr/liveclassroom.php trunk/moodle/mod/liveclassroom/lang/fr_utf8/liveclassroom.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/view.php trunk/moodle/mod/liveclassroom/welcome.php trunk/moodle/mod/voicetools/config.html trunk/moodle/mod/voicetools/css/StyleSheet.css trunk/moodle/mod/voicetools/getXmlChoicePage.php trunk/moodle/mod/voicetools/getXmlListPanel.php trunk/moodle/mod/voicetools/getXmlNewPanel.php trunk/moodle/mod/voicetools/index.php trunk/moodle/mod/voicetools/js/ajax.js trunk/moodle/mod/voicetools/js/hwCommons.js trunk/moodle/mod/voicetools/lang/en_utf8/voicetools.php trunk/moodle/mod/voicetools/lang/fr/voicetools.php trunk/moodle/mod/voicetools/lang/fr_utf8/voicetools.php trunk/moodle/mod/voicetools/lib.php trunk/moodle/mod/voicetools/manageAction.php trunk/moodle/mod/voicetools/mod.html trunk/moodle/mod/voicetools/view.php trunk/moodle/mod/voicetools/voicerecorder.php trunk/moodle/mod/voicetools/welcome.php Added Paths: ----------- trunk/moodle/mod/liveclassroom/js/ajax.js Modified: trunk/moodle/mod/liveclassroom/config.html =================================================================== --- trunk/moodle/mod/liveclassroom/config.html 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/config.html 2007-08-29 14:30:36 UTC (rev 197) @@ -1,10 +1,4 @@ -<form method="post" action="module.php" name="form"> -<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"> -<input type="hidden" name="module" value="liveclassroom"> - - <?php - require_once("lib/lc/LCAction.php"); require_once("lib/lc/lcapi.php"); $lcApi=new LCApi($CFG->liveclassroom_servername, @@ -12,59 +6,115 @@ $CFG->liveclassroom_adminpassword, $CFG->dataroot); $config = $lcApi->lcapi_get_status(); - ?> - -<table cellpadding="9" cellspacing="0" > - -<tr valign="top"> - <td align="right"><?php print_string('servername', 'liveclassroom')?> :</td> - <td> - <input name="servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> - </td> - <td> - <?php print_string("configservername", "liveclassroom") ?> - </td> -</tr> -<tr valign="top"> - <td align="right"><?php print_string('adminusername', 'liveclassroom')?> :</td> - <td> - <input name="adminusername" type="text" size="30" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> - </td> - <td> - <?php print_string("configadminusername", "liveclassroom") ?> - </td> -</tr> -<tr valign="top"> - <td align="right"><?php print_string('adminpassword', 'liveclassroom')?> :</td> - <td> - <input name="adminpassword" type="text" size="30" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> - </td> - <td> - <?php print_string("configadminpassword", "liveclassroom") ?> - </td> -</tr> -<tr> -<td><br /></td> -</tr> - - -<tr valign="top"> - <td align="right"><?php print_string('lcversion', 'liveclassroom')?> :</td> - <td> - <?php echo $config["horizon_version"]; ?> - </td> -</tr> -<tr valign="top"> - <td align="right"><?php print_string('integrationversion', 'liveclassroom')?> :</td> - <td> - <?php echo LIVECLASSROOM_MODULE_VERSION ?> - </td> -</tr> -<tr> - <td colspan="3" align="center"> - <input type="submit" value="<?php print_string("savechanges") ?>" /></td> -</tr> -</table> - +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> + <title>Voice Tools Server Configuration </title> + +</head> +<style> + .label_settings +{ + font-family: Verdana, Arial, Helvetica, sans-serif; +font-size:12px; + text-align:right; +} + .comment +{ + font-family: Verdana, Arial, Helvetica, sans-serif; +font-size:10px; + text-align:right; +} +.page_title +{ +font-family: Verdana, Arial, Helvetica, sans-serif; +font-size:18px; +font-weight:bold; +color:#3c4b5b; +vertical-align: middle; +} +</style> +<body> +<form method="post" action="module.php" name="form"> +<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>"> +<input type="hidden" name="module" value="liveclassroom"> + <table cellpadding="9" cellspacing="0" width="800px"> + <tr> + <td width="2%"> + <img src="<?php echo $CFG->wwwroot;?>/mod/liveclassroom/pictures/items/liveclassroom.png" border="0" /> + </td> + <td align="left" class="page_title"> + <?php print_string('serverconfiguration', 'liveclassroom')?> + </td> + </tr> + <tr> + <td height=15px></td> + </tr> + <tr> + <td align="center" colspan=2> + <table width="90%" bgcolor="#F1EEF1" cellspacing="3" cellpadding="6" style="border:1px solid #78879A "> + <tr valign="top"> + <td style="width: 35%" align="right"> + <label class="label_settings"><?php print_string('servername', 'liveclassroom')?> :</label> + </td> + <td> + <input name="servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> + </td> + </tr> + <tr> + <td></td> + <td> + <label class="comment"><?php print_string('configservername', 'liveclassroom') ?></label> + </td> + </tr> + <tr> + <tr valign="top"> + <td style="width: 35%" align="right"> + <label class="label_settings"><?php print_string('adminusername', 'liveclassroom')?> :</label> + </td> + <td> + <input name="adminusername" type="text" size="30" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> + </td> + </tr> + <tr valign="top"> + <td style="width: 35%" align="right"> + <label class="label_settings"><?php print_string('adminpassword', 'liveclassroom')?> :</label> + </td> + <td> + <input name="adminpassword" type="text" size="30" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> + </td> + + </tr> + </table> + </td> + </tr> + <tr> + <td align="center" colspan=2> + <table width="90%" bgcolor="#F1EEF1" cellspacing="3" cellpadding="6" style="border:1px solid #78879A "> + <tr valign="top"> + <td style="width: 35%" align="right"> + <label class="label_settings"><?php print_string('lcversion', 'liveclassroom')?> :</label> + </td> + <td> + <?php echo $config["horizon_version"]; ?> + </td> + </tr> + <tr valign="top"> + <td style="width: 35%" align="right"> + <label class="label_settings"><?php print_string('integrationversion', 'liveclassroom')?> :</label> + </td> + <td> + <?php echo LIVECLASSROOM_MODULE_VERSION ?> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td colspan="3" align="center"> + <input type="submit" value="<?php print_string("savechanges") ?>" /> + </td> + </tr> + </table> </form> Modified: trunk/moodle/mod/liveclassroom/css/StyleSheet.css =================================================================== --- trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2007-08-29 14:30:36 UTC (rev 197) @@ -51,6 +51,12 @@ font-size:11px; vertical-align:top; } +* html label +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:11px; + vertical-align:baseline; +} label.labelEnabled { @@ -74,7 +80,11 @@ { font-style:italic; } - +.topLabel +{ + vertical-align:top; + +} .top { vertical-align:top; Modified: trunk/moodle/mod/liveclassroom/doAction.php =================================================================== --- trunk/moodle/mod/liveclassroom/doAction.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/doAction.php 2007-08-29 14:30:36 UTC (rev 197) @@ -1,4 +1,5 @@ <?php + /****************************************************************************** * * * Copyright (c) 1999-2007 Horizon Wimba, All Rights Reserved. * @@ -26,20 +27,20 @@ * * ******************************************************************************/ -/* $Id: doAction.php 51417 2007-07-17 15:06:10Z thomasr $ */ +/* $Id: doAction.php 52708 2007-08-20 19:53:23Z thomasr $ */ /* This page manage the action create, update, delete for a room */ -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/XmlRoom.php"); -require_once("lib/common/WimbaXml.php"); -if (version_compare(PHP_VERSION,'5','>=')) { - require_once('lib/common/domxml-php4-php5.php'); +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/XmlRoom.php"); +require_once ("lib/common/WimbaXml.php"); +if (version_compare(PHP_VERSION, '5', '>=')) { + require_once ('lib/common/domxml-php4-php5.php'); } - $courseid = optional_param('enc_course_id', 0, PARAM_INT); $action = required_param('action', PARAM_ALPHA); @@ -54,118 +55,110 @@ $list_attributes[$key] = $val; } - $session = new WimbaMoodleSession($list_attributes, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, $CFG->dataroot); $xml = new WimbaXml(); if ($session->error == false && $session != NULL) { $api = new LCAction($session, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, $CFG->dataroot); - $prefix=$api->getPrefix(); - + $prefix = $api->getPrefix(); + switch ($action) { case "launch" : $roomId = required_param('id', PARAM_SAFEDIR); if ($list_attributes["studentView"] == "true") { - $authToken = $api->getAuthokenNormal($session->getCourseId()."_S", $session->getFirstname() , $session->getLastname()); - }else{ + $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); exit; break; case "create" : - $id = $api->createRoom($session->getCourseId().rand(), "false"); + $id = $api->createRoom($session->getCourseId() . rand(), "false"); $messageAction = "created"; - $messageProduct = "room"; + $messageProduct = "room"; break; - case "update" : - $roomId = required_param('id', PARAM_SAFEDIR); + case "update" : + $roomId = required_param('id', PARAM_SAFEDIR); $id = $api->createRoom($roomId, "true"); $messageAction = "updated"; - $messageProduct = "room"; + $messageProduct = "room"; break; case "delete" : - if($api->getPrefix()!="") - $roomId = trimPrefix(required_param('id', PARAM_SAFEDIR),$api->getPrefix()); + if ($api->getPrefix() != "") + $roomId = trimPrefix(required_param('id', PARAM_SAFEDIR), $api->getPrefix()); else $roomId = required_param('id', PARAM_SAFEDIR); - + $id = $api->deleteRoom($roomId); //delte the activity linked to this room - if (! liveclassroom_delete_all_instance_of_room($roomId)) { - notify("Could not delete the activities for the room: $roomId"); + if (!liveclassroom_delete_all_instance_of_room($roomId)) { + notify("Could not delete the activities for the room: $roomId"); } $messageAction = "deleted"; - $messageProduct = "room"; + $messageProduct = "room"; break; case "openContent" : $roomId = required_param('id', PARAM_SAFEDIR); $authToken = $api->getAuthoken(); - header('Location:' . $CFG->liveclassroom_servername . '/admin/class/carousels.epl?class_id=' .$roomId . '&hzA=' . $authToken.'&no_sidebar=1'); - exit(); + 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); $authToken = $api->getAuthoken(); header('Location:reports.php?id=' . $roomId . '&hzA=' . $authToken); - exit(); + exit (); break; case "openAdvancedMedia" : $roomId = required_param('id', PARAM_SAFEDIR); $authToken = $api->getAuthoken(); - header('Location:' . $CFG->liveclassroom_servername . '/admin/class/media.pl?class_id=' .$roomId . '&hzA=' . $authToken.'&no_sidebar=1'); - exit(); + 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); $authToken = $api->getAuthoken(); - header('Location:' . $CFG->liveclassroom_servername . '/admin/class/properties.pl?class_id=' .$roomId . '&hzA=' . $authToken.'&no_sidebar=1'); - exit(); + 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); - $select_room = $api->getRoom($roomId); - - - if ($list_attributes["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()); - 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(); - break; - case "saveSettings": - if($api->getPrefix()!="") - $roomId = trimPrefix(required_param('id', PARAM_SAFEDIR),$api->getPrefix()); + case "getDialInformation" : + $roomId = required_param('id', PARAM_SAFEDIR); + $select_room = $api->getRoom($roomId); + + if ($list_attributes["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()); 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(); + break; + case "saveSettings" : + if ($api->getPrefix() != "") + $roomId = trimPrefix(required_param('id', PARAM_SAFEDIR), $api->getPrefix()); + else $roomId = required_param('id', PARAM_SAFEDIR); $id = $api->createRoom($roomId, "true"); - break; + break; } - - if ($action == "saveSettings") - { - echo "good"; - exit(); - } - + if ($action == "saveSettings") { + echo "good"; + exit (); + } + if (isset ($list_attributes["createWorkflow"]) && $list_attributes["createWorkflow"] == "true") { - -?> + ?> <script> - parent.location.href="<?php echo $CFG->wwwroot . '/course/mod.php?section=0&sesskey=' . sesskey() . '&id=' . $session->getCourseId() . '&add=liveclassroom&roomId=' . $id ?>" + 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{ - - - header('Location: welcome.php?id=' .$session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&messageAction=' . $messageAction. '&messageProduct=' . $messageProduct); - } -} -else { + } else if ($action != "getDialInformation") { + + 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'); } ?> \ No newline at end of file Modified: trunk/moodle/mod/liveclassroom/generateListRooms.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateListRooms.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/generateListRooms.php 2007-08-29 14:30:36 UTC (rev 197) @@ -31,8 +31,7 @@ /// 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/lc/LCAction.php"); Modified: trunk/moodle/mod/liveclassroom/generateSettings.php =================================================================== --- trunk/moodle/mod/liveclassroom/generateSettings.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/generateSettings.php 2007-08-29 14:30:36 UTC (rev 197) @@ -28,6 +28,7 @@ /* $Id$ */ /// 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/lc/LCAction.php"); @@ -100,6 +101,7 @@ else if($session->error=="signature") $display=$uiManager->setError(get_string ('error_signature', 'liveclassroon')); } + echo $display; Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/index.php 2007-08-29 14:30:36 UTC (rev 197) @@ -47,23 +47,29 @@ require_login($course->id); - - -/// Get all required strings - $strliveclassrooms = get_string("modulenameplural", "liveclassroom"); $strliveclassroom = get_string("modulename", "liveclassroom"); +$strname = $voicetool->name; + +$navigation = array(); + if ($course->id != SITEID) { + $navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id"; +} +$navigation[$strliveclassrooms] = ""; - -/// Print the header - -if ($course->category) { - $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->"; +$urls = array(); +foreach($navigation as $text => $href) { + if (empty($href)) { + $urls[] = $text; + } else { + $urls[] = '<a href="'.$href.'">'.$text.'</a>'; + } } +$breadcrumb = implode(' -> ', $urls); -print_header("$course->shortname: $strliveclassrooms", "$course->fullname", - "$navigation $strliveclassrooms", "", "", true, "", navmenu($course)); - +print_header("$course->shortname", "$course->fullname", +"$breadcrumb", +"", "", true, "",""); /// Get all the appropriate data $url =get_url_params($course->id); Added: trunk/moodle/mod/liveclassroom/js/ajax.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/ajax.js (rev 0) +++ trunk/moodle/mod/liveclassroom/js/ajax.js 2007-08-29 14:30:36 UTC (rev 197) @@ -0,0 +1,476 @@ +/****************************************************************************** + * * + * Copyright (c) 1999-2007 Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Wimba. * + * It cannot be copied, used, or modified without obtaining an * + * authorization from the authors or a mandated member of Wimba. * + * If such an authorization is provided, any modified version * + * or copy of the software has to contain this header. * + * * + * WARRANTIES: * + * This software is made available by the authors in the hope * + * that it will be useful, but without any warranty. * + * Wimba is not liable for any consequence related to * + * the use of the provided software. * + * * + * Class: ajax.js * + * * + * Author: Thomas Rollinger * + * * + * Date: May 2007 * + * * + ******************************************************************************/ + +/* $Id$ */ + +function getURLParametersTab() { + var sURL = window.document.URL; + + var params = new Array(); + if (sURL.indexOf("?") > 0) { + var arrParams = sURL.split("?"); + var arrURLParams = arrParams[1].split("&"); + var i = 0; + for (i = 0; i < arrURLParams.length; i = i + 1) { + var param = arrURLParams[i].split("="); + params[param[0]] = param[1]; + } + } + return params; +} + + +function getURLParameters() { + var sURL = window.document.URL.toString(); + var params = ""; + if (sURL.indexOf("?") > 0) + { + var arrParams = sURL.split("?"); + + var arrURLParams = arrParams[1].split("&"); + + var arrParamNames = new Array(arrURLParams.length); + var arrParamValues = new Array(arrURLParams.length); + + var i = 0; + for (i = 0; i < arrURLParams.length; i ++ ) + { + var sParam = arrURLParams[i]; + arrParamNames[i] = sParam[0]; + if (sParam[1] != "") + params += "&" + unescape(sParam); + + } + params = params.substring(1, params.length) + } + return params; +} +function getSessionParameters() { + var params = new Array(); + params["signature"] = session["signature"]; + params["enc_courseId"] = session["courseId"]; + params["enc_email"] = session["email"]; + params["enc_firstname"] = session["firstName"]; + params["enc_lastname"] = session["lastName"]; + params["enc_role"] = session["role"]; + params["time"] = session["timeOfLoad"]; + if (currentProduct != "") { + params["product"] = currentProduct; + } + if (typeSelect != "") { + params["type"] = typeSelect; + } + if (currentId != "") { + params["id"] = currentId; + } + if (currentIdtab != "") { + params["idtab"] = currentIdtab; + } + if (currentCourseTab != "") { + params["tab"] = currentCourseTab; + } + params["studentView"] = studentView; + + return params; +} + +function getUrlParameters() { + var url = ""; + url += "signature=" + session["signature"]; + url += "&enc_courseId=" + session["courseId"]; + url += "&enc_email=" + session["email"]; + url += "&enc_firstname=" + session["firstName"]; + url += "&enc_lastname=" + session["lastName"]; + url += "&enc_role=" + session["role"]; + url += "&time=" + session["timeOfLoad"]; + if (currentProduct != "") { + url += "&product=" + currentProduct; + } + if (typeSelect != "") { + url += "&type=" + typeSelect; + } + + if (currentId != "") { + url += "&id=" + currentId; + } + + if (currentIdtab != "") { + url += "&idtab=" + currentIdtab; + } + if (currentCourseTab != "") { + url += "&tab = " + currentCourseTab; + } + url += "&studentView=" + studentView; + + return url; +} +function DisplayFirstPage(url, div, action, nextAction) { + if (div == "all") { + showPopup(); + } + if (action != null) { + url += "?action=" + action; + } + + + transform(url,"js/xsl/wimba.xsl","first",div,nextAction) +} + +function launchAjaxRequest(url, action, init, div,createWorkflow) { + //display the loading page + if (div == "all") { + showPopup(); + } + if (lcPopup != null) { + lcPopup.close(); + } + var parameters = ""; + if (action != "") { + url += "?action=" + action; + } + if (createWorkflow != "" && action!="") { + url += "&createWorkflow=" + createWorkflow; + } + isFilter = false; + transform(url,"js/xsl/wimba.xsl","",div) + if (init == true) { + + currentId = ""; + currentIdtab = "Info"; + advancedSettings = false; + } + +} + +/* +* Function used to dispaly the rss feed into the podcaster nugget +*/ +function launchSimpleAjaxRequest(url, action, init, div) { + //display the loading page + var xml; + var parameters = ""; + if (action != "") { + url += "?action=" + action; + } + + var xmlSource; + dojo.io.bind({ + url:url, mimetype:"text/plain", + load:function (type, data, evt) { + if (data.match("error") == "error") { + dom = xmlParse(data); + xmlSource = dom; + if (xslData == null) { //get the stylesheet + dojo.io.bind({ + url:"js/xsl/wimba.xsl", + mimetype:"application/xml", + load:function (type, data, evt) { + xslData = data; + var xml = xsltProcess(xmlSource, xslData); + hidePopup(); + document.getElementById(div).innerHTML = xml; + }, + error:BadResult, + content:null, + method:"POST"}); + } else { + transform(xml, xslData, 'all'); + } + } else { + displayRssFeed(data, div); + } + }, + error:BadResult, + content:getSessionParameters(), + method:"POST"}); +} + +function getRss(url, id, tab) { + if(id!=""){ + document.getElementById("rss").innerHTML = document.getElementById("loadingPopup").innerHTML; + currentId = id; + currentCourseTab = tab; + launchSimpleAjaxRequest(url, "getRss", true, "rss"); + } +} + +function transform(urlXml, stylesheet,TypeParams, div,nextAction) { + + if(window.ActiveXObject){//ie + + if(TypeParams=="first") + params=getURLParameters(); + else + params=getUrlParameters(); + + var sourceDoc = new ActiveXObject("Microsoft.XMLDOM") + sourceDoc.async = false + if(urlXml.substr((urlXml.length-1),urlXml.length)=="?") + sourceDoc.load(urlXml +params) + else if( urlXml.substr((urlXml.length-1),urlXml.length)=="&") + sourceDoc.load(urlXml+params) + else if( urlXml.indexOf("?") == -1) + sourceDoc.load(urlXml+"?"+params) + else + sourceDoc.load(urlXml+"&"+params) + + if (div == "all" && sourceDoc.documentElement.getElementsByTagName("type")[0].childNodes[0].nodeValue!="error") { + createSessionByXmlDocument(sourceDoc); + } + + var xslDoc = new ActiveXObject("Microsoft.XMLDOM") + xslDoc.async = false + xslDoc.load("js/xsl/wimba.xsl"); + + xsltTransformation(sourceDoc,xslDoc,div,nextAction); + + }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:stylesheet, + mimetype:"application/xml", + load:function (type, data, evt) { + //do the xslt transformatio + xsltTransformation(xmlSource,data,div,nextAction) + + }, + error:BadResult, + content:null, + method:"GET"}); + + }, + error:BadResult, + content:params, + method:"POST"}); + + }else{ + if(TypeParams=="first") + params=getURLParametersTab(); + else + params=getSessionParameters(); + var xmlSource; + dojo.io.bind({url:urlXml, mimetype:"text/plain", load:function (type, data, evt) { + if (div == "all" && data.match("error") != "error") { + createSession(data); + } + dom = xmlParse(data); + xmlSource = dom; + + dojo.io.bind({ + url:"js/xsl/wimba.xsl", + mimetype:"application/xml", + load:function (type, data, evt) { + //do the xslt transformatio + xsltTransformation(xmlSource,xslData,div,nextAction) + + }, + error:BadResult, + content:null, + method:"GET"}); + + + }, + error:BadResult, + content:params, + method:"POST"}); + + } + +} + +function xsltTransformation(xml,xsl,div,nextAction){ + + if(window.ActiveXObject)//ie + { + var result = xml.transformNode(xsl); + + if (div == "all") { + document.getElementById(div).innerHTML = result; + hidePopup(); + gestionDisplay(); + var text=new String(document.getElementById("all").innerHTML); + + } + if (div == "dialInfo") {//click on Info Button + document.getElementById(div).style.display = "block"; + document.getElementById(div).innerHTML = result; + document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup"); + opendDialInformations(); + } + if(nextAction!="") + eval(nextAction); + }else if (window.XSLTProcessor){//firefox + + var processor = new XSLTProcessor(); + processor.importStylesheet(xsl); + document.getElementById(div).innerHTML=""; + var resultDocument = processor.transformToFragment(xml, document); + + if (div == "all") { + hidePopup(); + document.getElementById(div).appendChild(resultDocument); + gestionDisplay(); + + } + if (div == "dialInfo") {//click on Info Button + document.getElementById(div).style.display = "block"; + + document.getElementById(div).appendChild(resultDocument); + document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup"); + opendDialInformations(); + } + + if(nextAction!="") + eval(nextAction); + + }else{ + + var xml = xsltProcess(xml, xsl); + + //hide the loading page + if (div == "all") { + hidePopup(); + document.getElementById(div).innerHTML = xml; + } + if (div == "dialInfo") {//click on Info Button + document.getElementById(div).style.display = "block"; + xml = xml.replace("myform", "myFormPopup"); + document.getElementById(div).innerHTML = xml; + opendDialInformations(); + } + gestionDisplay(); + if(nextAction!="") + eval(nextAction); + } + //manage the display of the accent + var content=new String(document.getElementById("all").innerHTML); + content=content.replace(/&/g,"&"); + document.getElementById("all").innerHTML=content; + var content=new String(document.getElementById("popupDial").innerHTML); + content=content.replace(/&/g,"&"); + document.getElementById("popupDial").innerHTML=content; + +} + + +function Management() +{ + +} + + +function BadResult(type, error) { + +} + +function loadSettings(url, action, div) { + launchAjaxRequest(url, action, false, div); +} + +function loadNewSettings(url, action, product, type, div,createWorkflow) { + currentProduct = product; + typeSelect = type; + launchAjaxRequest(url, action, false, div,createWorkflow); +} + +function saveDatabase(url, title, comment) { + var url = url + "?action=updateRecorder&title=" + title + "&comment=" + comment; + var xml; + dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) { + if (data == "bad") { + alert("problem to save"); + } + }, error:BadResult,content:getURLParametersTab(), method:"POST"}); + +} + +function showInformation(url, id, product) { + currentId = id; + currentProduct = product; + displayBackground(); + launchAjaxRequest(url, "getDialInformation", "false", "dialInfo"); +} + +function saveSettings(url, id) { + + url = url + "?action=saveSettings&id=" + id; + var returnValue = true; + var xml; + dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) { + if (data == "bad") { + alert("problem to save the new Settings"); + returnValue = false; + } + + }, error:BadResult, content:getForm(window.document.myform), method:"POST"}); + return returnValue; +} + +function getForm(obj) { + + var params = getSessionParameters(); + inputForm = obj.getElementsByTagName("input"); + var i=0; + for (i = 0; i < inputForm.length; i++) { + if (inputForm[i].type == "text") { + params[inputForm[i].name] = inputForm[i].value; + } + if (inputForm[i].type == "checkbox") { + if (inputForm[i].checked) { + params[inputForm[i].name] = inputForm[i].value; + } else { + params[inputForm[i].name] = "false"; + } + } + if (inputForm[i].type == "radio") { + if (inputForm[i].checked) { + params[inputForm[i].name] = inputForm[i].value; + } + } + } + inputForm = obj.getElementsByTagName("select"); + for (i = 0; i < inputForm.length; i++) { + var sel = inputForm[i]; + params[sel.name] = sel.options[sel.selectedIndex].value; + } + inputForm = obj.getElementsByTagName("textarea"); + for (i = 0; i < inputForm.length; i++) { + params[inputForm[i].name] = inputForm[i].value; + } + return params; +} + Modified: trunk/moodle/mod/liveclassroom/js/hwCommons.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/hwCommons.js 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/js/hwCommons.js 2007-08-29 14:30:36 UTC (rev 197) @@ -455,9 +455,11 @@ } } + if (isIE6()) { correctPNG(); } + } function displayAllDiv(name, nameMore, number) { if (currentId != "") { Modified: trunk/moodle/mod/liveclassroom/lang/en/liveclassroom.php =================================================================== --- trunk/moodle/mod/liveclassroom/lang/en/liveclassroom.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/lang/en/liveclassroom.php 2007-08-29 14:30:36 UTC (rev 197) @@ -25,7 +25,7 @@ * Date: 15th April 2006 * * * ******************************************************************************/ -/* $Id: liveclassroom.php 51230 2007-07-11 20:25:34Z thomasr $ */ +/* $Id: liveclassroom.php 51390 2007-07-16 21:10:08Z thomasr $ */ // Configuration $string['modulename'] = 'Live Classroom'; $string['modulenameplural'] = 'Live Classrooms'; @@ -82,6 +82,9 @@ $string["activity_tools_not_available"]="The Live Classroom linked to this activity is currently unavailable.<br>Please contact your instructor"; $string["activity_no_associated_tools"]="There are no Live Classroom associated with this course.<br> Click Ok to create one."; $string["activity_welcome_to_wimba"]="Welcome to Live Classroom!"; +$string['or'] = "or"; +$string['visibletostudents'] = "Visible to students:"; +$string['in'] = "in"; $string['new'] = 'New'; $string['content'] = 'Content'; @@ -203,7 +206,7 @@ $string['error_session'] = "The session has timed out due to inactivity. Please reload the page to reconnect."; $string['error_signature'] = "Invalid connection. Please contact your administrator for more information."; $string['error_board'] = "Invalid Voice Board parameters. Please contact your administrator for more information."; -$string['error_connection_vt'] = "Moodle cannot connect to the Voice Board server. Please reload the page or contact your administrator for more information."; +$string['error_connection_lc'] = "Moodle cannot connect to the Live Classroom server. Please reload the page or contact your administrator for more information."; $string['error_bdvt'] = "Moodle cannot connect to the Voice Board database. Please reload the page or contact your administrator for more information."; $string['error_roomNotFound'] = "The room has been deleted and is no longer available.\nPlease contact your instructor for more information"; $string['error_boardNotFound'] = "The ressource has been deleted and is no longer available.\nPlease contact your instructor for more information"; @@ -263,6 +266,7 @@ $string['settings_video_bandwidth_large'] = "Fast - most users have a T1/LAN connection "; $string['settings_video_bandwidth_medium'] = "Medium - most users have a DSL/cable modem"; $string['settings_video_bandwidth_small'] = "Slow - most users have a dial-up modem "; +$string['settings_video_bandwidth_custom'] = "Custom - for advanced video users"; $string['tab_tite_roomInfo'] = "Room Info"; $string['tab_title_chat'] = "Chat"; $string['tab_title_media'] = "Media"; @@ -397,4 +401,6 @@ $string['settings_advanced_comment_2'] = "You must click the 'Save' button in the new window to save your changes."; $string['settings_advanced_media_settings_button'] = "Advanced Media Settings..."; $string['settings_advanced_room_settings_button'] = "Advanced Room Settings..."; + +$string["activity_tools_not_available"]="The Live Classroom linked to this activity is currently unavailable.<br>Please contact your instructor"; ?> Modified: trunk/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php =================================================================== --- trunk/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/lang/en_utf8/liveclassroom.php 2007-08-29 14:30:36 UTC (rev 197) @@ -25,7 +25,7 @@ * Date: 15th April 2006 * * * ******************************************************************************/ -/* $Id: liveclassroom.php 51390 2007-07-16 21:10:08Z thomasr $ */ +/* $Id: liveclassroom.php 52898 2007-08-27 15:57:21Z thomasr $ */ // Configuration $string['modulename'] = 'Live Classroom'; $string['modulenameplural'] = 'Live Classrooms'; @@ -82,6 +82,9 @@ $string["activity_tools_not_available"]="The Live Classroom linked to this activity is currently unavailable.<br>Please contact your instructor"; $string["activity_no_associated_tools"]="There are no Live Classroom associated with this course.<br> Click Ok to create one."; $string["activity_welcome_to_wimba"]="Welcome to Live Classroom!"; +$string['or'] = "or"; +$string['visibletostudents'] = "Visible to students:"; +$string['in'] = "in"; $string['new'] = 'New'; $string['content'] = 'Content'; @@ -263,6 +266,7 @@ $string['settings_video_bandwidth_large'] = "Fast - most users have a T1/LAN connection "; $string['settings_video_bandwidth_medium'] = "Medium - most users have a DSL/cable modem"; $string['settings_video_bandwidth_small'] = "Slow - most users have a dial-up modem "; +$string['settings_video_bandwidth_custom'] = "Custom - for advanced video users"; $string['tab_tite_roomInfo'] = "Room Info"; $string['tab_title_chat'] = "Chat"; $string['tab_title_media'] = "Media"; Modified: trunk/moodle/mod/liveclassroom/lang/fr/liveclassroom.php =================================================================== --- trunk/moodle/mod/liveclassroom/lang/fr/liveclassroom.php 2007-08-01 14:36:16 UTC (rev 196) +++ trunk/moodle/mod/liveclassroom/lang/fr/liveclassroom.php 2007-08-29 14:30:36 UTC (rev 197) @@ -25,17 +25,14 @@ * Date: 15th April 2006 * * * ******************************************************************************/ - -/* $Id: liveclassroom.php 17 2006-05-25 21:50:08Z mgimpel $ */ - -//------ +/* $Id: liveclassroom.php 51390 2007-07-16 21:10:08Z thomasr $ */ // Configuration $string['modulename'] = 'Live Classroom'; $string['modulenameplural'] = 'Live Classrooms'; $string['serverconfiguration'] = 'Configuration du Serveur Live Classroom'; $string['explainserverconfiguration'] = 'Voici la configuration du serveur Live Classroom.'; $string['servername'] = 'URL du Serveur'; -$string['configservername'] = 'Entrez le nom du serveur sous la forme http://AAA.BBB.CCC.DDD'; +$string['configservername'] = 'Exemple: http:///myschool.wimba.com'; $string['adminusername'] = 'Nom d\'Utilisateur Administrateur'; $string['configadminusername'] = 'Entrez le nom d\'utilisateur de l\'administrateur'; $string['adminpassword'] = 'Mot de Passe Administrateur'; @@ -46,8 +43,7 @@ $string['integrationversion'] = 'Version du module d\'Integration'; $string['emptyAdminUsername'] = 'Nom d\'Utilisateur Administrateur vide'; $string['emptyAdminPassword'] = 'Mot de Passe Administrateur vide'; -$string['unlimited'] = 'Unlimited'; - +$string['unlimited'] = 'Unlimited'; $string['wrongconfigurationURLunavailable'] = 'Configuration incorrecte, l\'URL n\'est pas disponible. Plus d\'information est disponible dans les journaux d\'erreurs'; $string['wrongconfigurationURLincorrect'] = 'Configuration incorrecte, l\'URL est incorrecte. Plus d\'information est disponible dans les journaux d\'erreurs'; $string['wrongAdminPassword'] = 'Mot de Passe incorrect'; @@ -61,100 +57,36 @@ $string['weeksformat'] = 'Semaine de l\'activité'; $string['required_fields'] = 'Champs nécessaires'; $string['topicdisplay'] = 'Sujet'; -$string['firstsection'] = 'Section 0'; +$string['firstsection'] = 'Section 0'; +//Add activity form +$string["activity_name"]="Nom de l'activité:"; +$string["duration_calendar"]="Durée:"; +$string['name'] = "Nom de l'activité:"; +$string['liveclassroomtype'] = 'Room associée:'; +$string['topicformat'] = 'Sujet:'; +$string['weeksformat'] = 'Semaine:'; +$string['required_fields'] = 'Champs requis'; +$string['topicdisplay'] = 'Sujet'; +$string['visibletostudents']='Visible pour les étudiants'; -$string['linksfor'] = 'Acces Live Classrooms pour '; -$string['accessrooms'] = 'Acces aux Live Classrooms at aux Archives'; -$string['managerooms'] = 'Gestion des Salles et des Archives (Instructeurs)'; -$string['labelcreateroom'] = 'Nom de la Nouvelle Salle: '; -$string['buttoncreateroom'] = 'Créer la Salle'; -$string['roomcreated'] = 'La Salle a été créée avec succes.'; - - -$string['wizard.text.1'] = 'Note: La première fois que vous entrerez sur le serveur de Live Classroom vous devrez lancer'; -$string['wizard.text.2'] = 'l\'Assistant de Configuration'; -$string['wizard.text.3'] = 'pour être certain que votre ordinateur est prêt.'; - -$string['runwizard'] = 'Lancer l\'Assistant'; - -$string['wizard.text2.1'] = 'Lancer'; -$string['wizard.text2.2'] = 'l\'Assistant de Configuration'; -$string['wizard.text2.3'] = 'pour être certain que votre ordinateur est prêt à utiliser les Live Classrooms'; - -$string['launch'] = 'Lancer'; -$string['addactivity'] = 'Ajouter une Activité'; -$string['new'] = 'Nouv.'; -$string['content'] = 'Contenu'; -$string['reports'] = 'Rapports'; -$string['settings'] = 'Paramètres'; -$string['delete'] = 'Suppr.'; -$string['management'] = 'Gestion'; - -$string['studentview'] = 'Vue Étudiant'; -$string['instructorview'] = 'Vue Instructeur'; - $string['lcpopupshouldappear.1'] = 'La Live Classroom devrait maintenant apparaître.<br/> Dans le cas contraire, cliquez sur '; $string['lcpopupshouldappear.2'] = 'ce lien'; $string['lcpopupshouldappear.3'] = ' pour l\'ouvrir. '; +$string['addactivity'] = 'Ajouter une activité'; +$string['in'] = 'dans'; +$string['or'] = 'ou'; +$string['new'] = 'Nouveau...'; +$string["activity_manageTools"]="Gérer les Live Classrooms"; +$string["activity_tools_not_available"]="La Live Classroom liée à cette activité est actuellement indisponible.<br>Merci de contacter votre professeur"; +$string["activity_no_associated_tools"]="Il n'y pas de live classrom associée à ce cour.<br>Cliquer sur Ok pour en crée une."; +$string["activity_welcome_to_wimba"]="Bienvenue dans la Live Classroom!"; -$string['roomCreated'] = "Votre Live Classroom a été crée avec succès."; -$string['roomUpdated'] = "Votre Live Classroom a été mise à jour avec succès."; -$string['roomDeleted'] = "Votre Live Classroom a été supprimée jour avec succès."; -$string['archiveDeleted'] = "Votre Archive a été supprimée jour avec succès."; - -$string['notfind'] = "Paramètres de Live Classroom invalides. Merci de contacter votre administrateur pour plus d'information."; -$string['room'] = "Paramètres de Live Classroom invalides. Merci de contacter votre administrateur pour plus d'information."; -$string['connection'] = "Moodle ne peut se connecter au serveur de Live Classroom. Paramètres de Live Classroom invalides. Merci de contacter votre administrateur pour plus d'information."; -$string['bd'] = "Moodle cannot connect to the Live Classroom database. Please reload the page or contact your administrator for more information. "; -$string['signature'] = "Connexion invalide à Live Classroom. Merci de contacter votre administrateur pour plus d'information."; - -$string['Settings'] = "Paramètres"; -$string['Live Classroom'] = "Live Classroom"; -$string['Room Info'] = "Informations"; -$string['Title: '] = "Titre : "; -$string['Description: '] = "Description : "; -$string['Type : '] = "Type : "; -$string['Lecture room'] = "Salle de Cours"; -$string['Lecture rooms'] = "Salles de Cours"; -$string['Instructors lead the presentation'] = "Les Instructeurs dirigent la présentation"; -$string['Discussion room'] = "Salle de Discussion"; -$string['Discussion rooms'] = "Salles de Discussion"; -$string['Students and Instructors have the same rigths'] = "Étudiants et Instructeurs ont les mêmes droits."; -$string['Media'] = "Média"; -$string['Audio'] = "Audio"; -$string['Enable Students to use the phone'] = "Permettre aux étudiants d'utiliser le téléphone"; -$string['Note: Instructors can always use the phone'] = "Note: Les Instructeurs peuvent toujours utiliser le téléphone"; -$string['Enable Student\'s microphones at presentation start'] = "Permettre aux étudiants d'utiliser le microphone au démarrage de la présentation."; -$string['One-way Video'] = "Vidéo mono-point"; -$string['Presenter uses RealProducer'] = "Les Presenter utilisent RealProducer"; -$string['Room Id: '] = "Room Id : "; -$string['Third-party Conference Call'] = "Système de Conférence Téléphonique Alternatif"; -$string['Features'] = "Fonctions"; -$string['Enable Students to use eBoard'] = "Permettre aux étudiants d'utiliser le tableau blanc <i>eBoard</i>"; -$string['enableScreenGrab'] = "Permettre aux étudiants d'utiliser l'outil de capture d'écran."; -$string['Enable Archiving'] = "Autoriser l'Archivage"; -$string['Enable Appshare'] = "Autoriser le partage d'application <i>AppShare</i>"; -$string['Enable On-The-Fly PPT Import'] = "Autoriser l'import de fichier PPT à-la-volée"; -$string['Chat'] = "Chat"; -$string['Enable Students to use text chat'] = "Autoriser les étudiants à utiliser le chat textuel"; -$string['Enable Public and Private text chat'] = "Autoriser le chat Public et Privé"; -$string['Enable Public text chat only'] = "Autoriser le chat Public seulement"; -$string['Note: Students are always able to chat with presenters and/or technical help'] = "Note: Les étudiants sont toujours capables de faire du chat avec les <i>Presenter</i> et/ou le support technique."; -$string['Access'] = "Accès"; -$string['Available'] = "Disponible"; -$string['Maximum users: '] = "Nombre d'utilisateurs maximum: "; -$string['Unlimited'] = "Illimité"; -$string['Limited: '] = "Limite : "; -$string['Enable guest access'] = "Autoriser l'accès Invité"; -$string['Room Id: '] = "Room Id : "; -$string['launcherLink'] = "Lien de lancement : "; - - //calendar $string['add_calendar']='Ajouter un évènement au calendrier'; -$string["launch_calendar"]="Lancer Live Classroom"; +$string["launch_calendar"]="Lancer Live Classroom"; +$string["description_calendar"] = "Description: "; //day $string['day1'] = 'Lundi'; $string['day2'] = 'Mardi'; @@ -162,29 +94,250 @@ $string['day4'] = 'Jeudi'; $string['day5'] = 'Vendredi'; $string['day6'] = 'Samedi'; -$string['day0'] = 'Dimanche'; - -$string['cannotretreivelistofrooms'] = "Impossible de retrouver la liste des salles"; - +$string['day0'] = 'Dimanche'; +$string['cannotretreivelistofrooms'] = "Impossible de recupérer la liste de classes;"; $string['month1'] = 'Janvier'; $string['month2'] = 'Février'; $string['month3'] = 'Mars'; $string['month4'] = 'Avril'; $string['month5'] = 'Mai'; $string['month6'] = 'Juin'; -$string['month7'] = 'Jullet'; -$string['month8'] = 'Août'; -$string['month9'] = 'Septembre'; -$string['month10'] = 'Octobre'; -$string['month11'] = 'Novembre'; -$string['month12'] = 'Decembre'; - - - +$string['month7'] = 'Juillet'; +$string['month8'] = 'Aout'; +$string['month9'] = 'Septembre'; +$string['month10'] = 'Octobre'; +$string['month11'] = 'Novembre'; +$string['month12'] = 'Décembre'; //First Time Use - not use yet $string['firstRoom'] = 'Main classroom'; $string['secondRoom'] = 'Group 1'; $string['thirdRoom'] = 'Group 2'; $string['fourthRoom'] = 'Group 3'; +$string['filterbar_all'] = "Tous"; +$string['filterbar_boards'] = "Boards"; +$string['filterbar_discussions'] = "Discussions"; +$string['filterbar_lectures'] = "Lectures"; +$string['filterbar_podcasters'] = "Podcasters"; +$string['filterbar_voicepresentation'] = "Presentations"; +$string['headerbar_instructor_view'] = "Vue Instructeur"; +$string['headerbar_student_view'] = "Vue Étudiant"; +$string['list_title_board'] = "Voice Board"; +$string['list_title_Discussion'] = "Discussions Rooms"; +$string['list_title_MainLecture'] = "Main Lectures Rooms"; +$string['list_title_pc'] = "Wimba Podcaster"; +$string['list_title_presentation'] = "Voice Presentation"; +$string['toolbar_content'] = "Contenu"; +$string['toolbar_schedule'] = 'Schedule' ; +$string['toolbar_delete'] = 'Suppr.' ; +$string['toolbar_activity'] = "Ajouter une Activité"; +$string['toolbar_launch'] = "Lancer"; +$string['toolbar_new'] = "Nouv."; +$string['toolbar_reports'] = "Rapports"; +$string['toolbar_settings'] = "Paramètres"; +$string['error_notfind'] = "Paramètres de Live Classroom invalides. Merci de contacter votre administrateur pour plus d'information."; +$string['error_room'] = "Paramètres de Live Classroom invalides. Merci de contacter votre administrateur pour plus d'information."; +$string['error_connection'] = "Moodle ne peut se connecter \xE5 la base de données. Merci de contacter votre administrateur pour plus d'information."; +$string['error_bd'] = "Moodle ne peut se connecter \xE5 la base de données. Merci de contacter votre administrateur pour plus d'information."; +$string['error_session'] = "En raison d'une inactivitné, votre session a expiré.Veuillez recharger la page.."; +$string['error_signature'] = "Connexion invalide. Merci de contacter votre administrateur pour plus d'information."; +$string['error_board'] = "Paramètres des Voice Tools invalides. Merci de contacter votre administrateur pour plus d'information."; +$string['error_connection_lc'] = "Moodle ne peut se connecter au serveur de Live Classroom.. Merci de contacter votre administrateur pour plus d'information."; +$string['error_bdvt'] = "Moodle ne peut se connecter \xE5 la base de données. Merci de contacter votre administrateur pour plus d'information."; +$string['error_roomNotFound'] = "La classe a été supprimé ou n'est pas disponible. Merci de contacter votre administrateur pour plus d'information."; +$string['error_boardNotFound'] = "La ressource a été supprimé ou n'est pas disponible. Merci de contacter votre administrateur pour plus d'information."; +$string['error_xml'] = "Probl\xE8me pour afficher le composant. Merci de contacter votre administrateur pour plus d'information."; + +$string['choiceElement_description_board'] = "Créer un nouveau Voice Board"; +$string['choiceElement_description_podcaster'] = "Créer une nouveau Podcaster"; +$string['choiceElement_description_presentation'] = "Créer un nouveau Voice Presentation"; +$string['choiceElement_description_room'] = "Créer un nouveau Live Classroom"; +$string['choiceElement_new_board'] = "Nouveau Board"; +$string['choiceElement_new_podcaster'] = "Nouveau Podcaster"; +$string['choiceElement_new_presentation'] = "Nouveau Presentation"; +$string['choiceElement_new_room'] = "Nouveau Room"; +$string['contextbar_new_voicetools'] = "Nouveau Wimba tools"; +$string['contextbar_settings'] = ": Paramètres"; +$string['validationElement_cancel'] = "Annuler"; +$string['validationElement_create'] = "Crée"; +$string['validationElement_saveAll'] = "Sauver"; +$string['general_liveclassroom'] = "Live Classroom"; +$string['general_pc'] = "Wimba Podcaster"; +$string['general_presentation'] = "Voice Presentation"; +$string['settings_available'] = "Disponible"; +$string['settings_chat_enabled'] = "Autoriser les étudiants à utiliser le chat textuel "; +$string['settings_description'] = "Description :"; +$string['settings_discussion'] = "Discussion room"; +$string['settings_discussion_comment'] = "Les outils de présentation sont disponibles aux étudiants et aux professeurs."; +$string['settings_discussion_rooms'] = "Discussion rooms:"; +$string['settings_enable_student_video_on_startup'] = "Autoriser les étudiants à montrer leur vidéo par défaut "; +$string['settings_enabled_appshare'] = "Activer le partage d'écran"; +$string['settings_enabled_archiving'] = " Activer l'archivage"; +$string['settings_enabled_breakoutrooms'] = "Activer les groupes de travail (Breakout Rooms)"; +$string['settings_enabled_guest'] = "Autoriser l'accès public "; +$string['settings_enabled_guest_comment'] = "Note : Ce paramètre n'est effectif que lorsque l'accès public est activé sur le serveur de Live Classroom . +Veuillez contacter votre administrateur pour plus d'informations. "; +$string['settings_enabled_onfly_ppt'] = "Activer l'import à la volée de présentations Powerpoint"; +$string['settings_enabled_status'] = "Activer les icones de statut"; +$string['settings_presenter_console'] = "Console du présenteur:"; +$string['settings_eboard'] = "eBoard:"; +$string['settings_breakout'] = "Groupes de travail :"; +$string['settings_enabled_student_eboard'] = "Autoriser les étudiants à utiliser le eBoard par défaut"; +$string['settings_enabled_students_breakoutrooms'] = "Les étudiants peuvent voir le contenu créé par les autres groupes"; +$string['settings_enabled_students_mainrooms'] = "Les étudiants travaillant en groupe peuvent voir le contenu de la salle principale"; +$string['settings_hms_simulcast_restricted'] = "Autoriser les étudiants à utiliser le téléphone"; +$string['settings_hms_two_way_enabled'] = "Autoriser les étudiants à parler par défaut "; +$string['settings_lectures_rooms'] = "Lecture rooms:"; +$string['settings_mainLecture'] = "Lecture room"; +$string['settings_mainLecture_comment'] = "Les outils de présentation sont disponibles seulement aux professeurs."; +$string['settings_max_user'] = "Nombre d'utilisateurs maximal:"; +$string['settings_max_user_limited'] = "Limité:"; +$string['settings_max_user_unlimited'] = "Illimité "; +$string['settings_private_chat_enabled'] = "Autoriser les étudiants à discuter entre eux en chat privé"; +$string['settings_private_chat_enabled_comment'] = "Note : Les étudiants peuvent toujours discuter avec leurs professeurs"; +$string['settings_status_appear'] = "Les changements de statut apparaissent dans la fenêtre de chat"; +$string['settings_status_indicators'] = "Indicateurs de status:"; +$string['settings_student_privileges'] = "Priviléges des étudiants:"; +$string['settings_title'] = "Titre :"; +$string['settings_type'] = "Type :"; +$string['settings_video_bandwidth'] = "Bande passante vidéo: "; +$string['settings_video_bandwidth_large'] = " Rapide - la plupart utilisent une connexion T1/LAN"; +$string['settings_video_bandwidth_medium'] = "Moyenne - la plupart utilisent un modem ADSL/cable"; +$string['settings_video_bandwidth_small'] = "Lente - la plupart utilisent un modem dial-up"; +$string['settings_video_bandwidth_custom'] = "Custom - pour les utilisateurs avancés"; +$string['tab_tite_roomInfo'] = "Informations"; +$string['tab_title_chat'] = "Chat"; +$string['tab_title_media'] = "Média"; +$string['delay_0'] = "0 s"; +$string['delay_1'] = "1 min"; +$string['delay_10'] = "10 min"; +$string['delay_2'] = "2 min"; +$string['delay_20'] = "20 min"; +$string['delay_3'] = "3 min"; +$string['delay_30'] = "30 min"; +$string['delay_30'] = "60 min"; +$string['delay_5'] = "5 min"; +$string['filterbar_lc'] = "Live Classrooms"; +$string['filterbar_vt'] = "Voice Tools"; +$string['general_board'] = "Voice Board"; +$string['settings_audio'] = "Audio Quality :"; +$string['settings_audio_format_basic'] = "Basic Quality (Telephone quality) - 8 kbit/s - Modem usage"; +$string['settings_audio_format_good'] = "Good Quality (FM Radio quality) - 20.8 kbit/s - Broadband"; +$string['settings_audio_format_standart'] = "Qualit Quality - 12.8 kbit/s - Modem usage"; +$string['settings_audio_format_superior'] = "Superior Quality - 29.6 kbit/s - Broadband usage"; +$string['settings_auto_publish_podcast'] = "Podcast auto-published after:"; +$string['settings_chrono_order'] = "Autoriser les é à répondre aux messages"; +$string['settings_comment_slide'] = "Autoriser les é à répondre aux messages"; +$string['settings_dial_in_informations'] = "Paramètres de Conférence"; +$string['settings_end_date'] = "Date de fin:"; +$string['settings_guest_access_comment'] = "Note : Ce paramètre n'est effectif que lorsque l'accès public est activé sur le serveur de Live Classroom. Veuillez contacter votre administrateur pour plus d'informations."; +$string['settings_max_message'] = "Durée max du message audio:"; +$string['settings_max_message_120'] = "2 min"; +$string['settings_max_message_1200'] = "20 min"; +$string['settings_max_message_15'] = "15 s"; +$string['settings_max_message_30'] = "30 s"; +$string['settings_max_message_300'] = "5 min"; +$string['settings_max_message_60'] = "1 min"; +$string['settings_max_message_600'] = "10 min"; +$string['setting... [truncated message content] |
From: <tro...@us...> - 2008-01-09 14:01:26
|
Revision: 201 http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=201&view=rev Author: trollinger Date: 2008-01-09 06:01:24 -0800 (Wed, 09 Jan 2008) Log Message: ----------- remove not used pictures Removed Paths: ------------- trunk/moodle/mod/liveclassroom/pictures/backgrounds/Thumbs.db trunk/moodle/mod/liveclassroom/pictures/buttons/Thumbs.db trunk/moodle/mod/liveclassroom/pictures/items/Thumbs.db trunk/moodle/mod/liveclassroom/pictures/minus.gif trunk/moodle/mod/liveclassroom/pictures/plus.gif trunk/moodle/mod/voicetools/pictures/backgrounds/Thumbs.db trunk/moodle/mod/voicetools/pictures/buttons/Thumbs.db trunk/moodle/mod/voicetools/pictures/items/Thumbs.db Deleted: trunk/moodle/mod/liveclassroom/pictures/backgrounds/Thumbs.db =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/liveclassroom/pictures/buttons/Thumbs.db =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/liveclassroom/pictures/items/Thumbs.db =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/liveclassroom/pictures/minus.gif =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/liveclassroom/pictures/plus.gif =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/voicetools/pictures/backgrounds/Thumbs.db =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/voicetools/pictures/buttons/Thumbs.db =================================================================== (Binary files differ) Deleted: trunk/moodle/mod/voicetools/pictures/items/Thumbs.db =================================================================== (Binary files differ) 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: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-09 11:42:27
|
Revision: 200 http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=200&view=rev Author: trollinger Date: 2008-01-09 03:37:50 -0800 (Wed, 09 Jan 2008) Log Message: ----------- update the repository after the 3.1.2 release Modified Paths: -------------- trunk/moodle/mod/liveclassroom/doAction.php trunk/moodle/mod/liveclassroom/js/ajax.js trunk/moodle/mod/liveclassroom/js/constants.js trunk/moodle/mod/liveclassroom/js/hwCommons.js trunk/moodle/mod/liveclassroom/js/pngfix.js trunk/moodle/mod/liveclassroom/js/xsl/wimba.xsl trunk/moodle/mod/liveclassroom/lib/common/WimbaCommons.php trunk/moodle/mod/liveclassroom/lib/common/WimbaUI.php trunk/moodle/mod/liveclassroom/lib/common/XmlArchive.php trunk/moodle/mod/liveclassroom/lib/lc/LCAction.php trunk/moodle/mod/liveclassroom/lib/lc/lcapi.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/mod.html trunk/moodle/mod/liveclassroom/pictures/backgrounds/Thumbs.db trunk/moodle/mod/liveclassroom/pictures/buttons/Thumbs.db trunk/moodle/mod/liveclassroom/pictures/items/Thumbs.db trunk/moodle/mod/liveclassroom/pictures/items/filter-enabled-right.png trunk/moodle/mod/liveclassroom/pictures/items/filter-rollover-right.png trunk/moodle/mod/voicetools/css/StyleSheet.css trunk/moodle/mod/voicetools/error.php trunk/moodle/mod/voicetools/js/ajax.js trunk/moodle/mod/voicetools/js/constants.js trunk/moodle/mod/voicetools/js/hwCommons.js trunk/moodle/mod/voicetools/js/pngfix.js trunk/moodle/mod/voicetools/js/xsl/wimba.xsl trunk/moodle/mod/voicetools/lang/en/voicetools.php trunk/moodle/mod/voicetools/lang/en_utf8/voicetools.php trunk/moodle/mod/voicetools/lib/common/WimbaCommons.php trunk/moodle/mod/voicetools/lib/common/WimbaUI.php trunk/moodle/mod/voicetools/lib/common/XmlArchive.php trunk/moodle/mod/voicetools/lib/vt/WimbaVoicetools.php trunk/moodle/mod/voicetools/lib.php trunk/moodle/mod/voicetools/mod.html trunk/moodle/mod/voicetools/pictures/backgrounds/Thumbs.db trunk/moodle/mod/voicetools/pictures/buttons/Thumbs.db trunk/moodle/mod/voicetools/pictures/items/Thumbs.db trunk/moodle/mod/voicetools/pictures/items/filter-enabled-right.png trunk/moodle/mod/voicetools/pictures/items/filter-rollover-right.png trunk/moodle/mod/voicetools/voicerecorder.php Modified: trunk/moodle/mod/liveclassroom/doAction.php =================================================================== --- trunk/moodle/mod/liveclassroom/doAction.php 2008-01-09 10:36:38 UTC (rev 199) +++ trunk/moodle/mod/liveclassroom/doAction.php 2008-01-09 11:37:50 UTC (rev 200) @@ -27,7 +27,7 @@ * * ******************************************************************************/ -/* $Id: doAction.php 52708 2007-08-20 19:53:23Z thomasr $ */ +/* $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); @@ -76,7 +76,7 @@ exit; break; case "create" : - $id = $api->createRoom($session->getCourseId() . rand(), "false"); + $id = $api->createRoom(required_param('id', PARAM_SAFEDIR), "false"); $messageAction = "created"; $messageProduct = "room"; break; Modified: trunk/moodle/mod/liveclassroom/js/ajax.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/ajax.js 2008-01-09 10:36:38 UTC (rev 199) +++ trunk/moodle/mod/liveclassroom/js/ajax.js 2008-01-09 11:37:50 UTC (rev 200) @@ -1,476 +1,546 @@ -/****************************************************************************** - * * - * Copyright (c) 1999-2007 Wimba, All Rights Reserved. * - * * - * COPYRIGHT: * - * This software is the property of Wimba. * - * It cannot be copied, used, or modified without obtaining an * - * authorization from the authors or a mandated member of Wimba. * - * If such an authorization is provided, any modified version * - * or copy of the software has to contain this header. * - * * - * WARRANTIES: * - * This software is made available by the authors in the hope * - * that it will be useful, but without any warranty. * - * Wimba is not liable for any consequence related to * - * the use of the provided software. * - * * - * Class: ajax.js * - * * - * Author: Thomas Rollinger * - * * - * Date: May 2007 * - * * - ******************************************************************************/ - -/* $Id$ */ - -function getURLParametersTab() { - var sURL = window.document.URL; - - var params = new Array(); - if (sURL.indexOf("?") > 0) { - var arrParams = sURL.split("?"); - var arrURLParams = arrParams[1].split("&"); - var i = 0; - for (i = 0; i < arrURLParams.length; i = i + 1) { - var param = arrURLParams[i].split("="); - params[param[0]] = param[1]; - } - } - return params; -} - - -function getURLParameters() { - var sURL = window.document.URL.toString(); - var params = ""; - if (sURL.indexOf("?") > 0) - { - var arrParams = sURL.split("?"); - - var arrURLParams = arrParams[1].split("&"); - - var arrParamNames = new Array(arrURLParams.length); - var arrParamValues = new Array(arrURLParams.length); - - var i = 0; - for (i = 0; i < arrURLParams.length; i ++ ) - { - var sParam = arrURLParams[i]; - arrParamNames[i] = sParam[0]; - if (sParam[1] != "") - params += "&" + unescape(sParam); - - } - params = params.substring(1, params.length) - } - return params; -} -function getSessionParameters() { - var params = new Array(); - params["signature"] = session["signature"]; - params["enc_courseId"] = session["courseId"]; - params["enc_email"] = session["email"]; - params["enc_firstname"] = session["firstName"]; - params["enc_lastname"] = session["lastName"]; - params["enc_role"] = session["role"]; - params["time"] = session["timeOfLoad"]; - if (currentProduct != "") { - params["product"] = currentProduct; - } - if (typeSelect != "") { - params["type"] = typeSelect; - } - if (currentId != "") { - params["id"] = currentId; - } - if (currentIdtab != "") { - params["idtab"] = currentIdtab; - } - if (currentCourseTab != "") { - params["tab"] = currentCourseTab; - } - params["studentView"] = studentView; - - return params; -} - -function getUrlParameters() { - var url = ""; - url += "signature=" + session["signature"]; - url += "&enc_courseId=" + session["courseId"]; - url += "&enc_email=" + session["email"]; - url += "&enc_firstname=" + session["firstName"]; - url += "&enc_lastname=" + session["lastName"]; - url += "&enc_role=" + session["role"]; - url += "&time=" + session["timeOfLoad"]; - if (currentProduct != "") { - url += "&product=" + currentProduct; - } - if (typeSelect != "") { - url += "&type=" + typeSelect; - } - - if (currentId != "") { - url += "&id=" + currentId; - } - - if (currentIdtab != "") { - url += "&idtab=" + currentIdtab; - } - if (currentCourseTab != "") { - url += "&tab = " + currentCourseTab; - } - url += "&studentView=" + studentView; - - return url; -} -function DisplayFirstPage(url, div, action, nextAction) { - if (div == "all") { - showPopup(); - } - if (action != null) { - url += "?action=" + action; - } - - - transform(url,"js/xsl/wimba.xsl","first",div,nextAction) -} - -function launchAjaxRequest(url, action, init, div,createWorkflow) { - //display the loading page - if (div == "all") { - showPopup(); - } - if (lcPopup != null) { - lcPopup.close(); - } - var parameters = ""; - if (action != "") { - url += "?action=" + action; - } - if (createWorkflow != "" && action!="") { - url += "&createWorkflow=" + createWorkflow; - } - isFilter = false; - transform(url,"js/xsl/wimba.xsl","",div) - if (init == true) { - - currentId = ""; - currentIdtab = "Info"; - advancedSettings = false; - } - -} - -/* -* Function used to dispaly the rss feed into the podcaster nugget -*/ -function launchSimpleAjaxRequest(url, action, init, div) { - //display the loading page - var xml; - var parameters = ""; - if (action != "") { - url += "?action=" + action; - } - - var xmlSource; - dojo.io.bind({ - url:url, mimetype:"text/plain", - load:function (type, data, evt) { - if (data.match("error") == "error") { - dom = xmlParse(data); - xmlSource = dom; - if (xslData == null) { //get the stylesheet - dojo.io.bind({ - url:"js/xsl/wimba.xsl", - mimetype:"application/xml", - load:function (type, data, evt) { - xslData = data; - var xml = xsltProcess(xmlSource, xslData); - hidePopup(); - document.getElementById(div).innerHTML = xml; - }, - error:BadResult, - content:null, - method:"POST"}); - } else { - transform(xml, xslData, 'all'); - } - } else { - displayRssFeed(data, div); - } - }, - error:BadResult, - content:getSessionParameters(), - method:"POST"}); -} - -function getRss(url, id, tab) { - if(id!=""){ - document.getElementById("rss").innerHTML = document.getElementById("loadingPopup").innerHTML; - currentId = id; - currentCourseTab = tab; - launchSimpleAjaxRequest(url, "getRss", true, "rss"); - } -} - -function transform(urlXml, stylesheet,TypeParams, div,nextAction) { - - if(window.ActiveXObject){//ie - - if(TypeParams=="first") - params=getURLParameters(); - else - params=getUrlParameters(); - - var sourceDoc = new ActiveXObject("Microsoft.XMLDOM") - sourceDoc.async = false - if(urlXml.substr((urlXml.length-1),urlXml.length)=="?") - sourceDoc.load(urlXml +params) - else if( urlXml.substr((urlXml.length-1),urlXml.length)=="&") - sourceDoc.load(urlXml+params) - else if( urlXml.indexOf("?") == -1) - sourceDoc.load(urlXml+"?"+params) - else - sourceDoc.load(urlXml+"&"+params) - - if (div == "all" && sourceDoc.documentElement.getElementsByTagName("type")[0].childNodes[0].nodeValue!="error") { - createSessionByXmlDocument(sourceDoc); - } - - var xslDoc = new ActiveXObject("Microsoft.XMLDOM") - xslDoc.async = false - xslDoc.load("js/xsl/wimba.xsl"); - - xsltTransformation(sourceDoc,xslDoc,div,nextAction); - - }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:stylesheet, - mimetype:"application/xml", - load:function (type, data, evt) { - //do the xslt transformatio - xsltTransformation(xmlSource,data,div,nextAction) - - }, - error:BadResult, - content:null, - method:"GET"}); - - }, - error:BadResult, - content:params, - method:"POST"}); - - }else{ - if(TypeParams=="first") - params=getURLParametersTab(); - else - params=getSessionParameters(); - var xmlSource; - dojo.io.bind({url:urlXml, mimetype:"text/plain", load:function (type, data, evt) { - if (div == "all" && data.match("error") != "error") { - createSession(data); - } - dom = xmlParse(data); - xmlSource = dom; - - dojo.io.bind({ - url:"js/xsl/wimba.xsl", - mimetype:"application/xml", - load:function (type, data, evt) { - //do the xslt transformatio - xsltTransformation(xmlSource,xslData,div,nextAction) - - }, - error:BadResult, - content:null, - method:"GET"}); - - - }, - error:BadResult, - content:params, - method:"POST"}); - - } - -} - -function xsltTransformation(xml,xsl,div,nextAction){ - - if(window.ActiveXObject)//ie - { - var result = xml.transformNode(xsl); - - if (div == "all") { - document.getElementById(div).innerHTML = result; - hidePopup(); - gestionDisplay(); - var text=new String(document.getElementById("all").innerHTML); - - } - if (div == "dialInfo") {//click on Info Button - document.getElementById(div).style.display = "block"; - document.getElementById(div).innerHTML = result; - document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup"); - opendDialInformations(); - } - if(nextAction!="") - eval(nextAction); - }else if (window.XSLTProcessor){//firefox - - var processor = new XSLTProcessor(); - processor.importStylesheet(xsl); - document.getElementById(div).innerHTML=""; - var resultDocument = processor.transformToFragment(xml, document); - - if (div == "all") { - hidePopup(); - document.getElementById(div).appendChild(resultDocument); - gestionDisplay(); - - } - if (div == "dialInfo") {//click on Info Button - document.getElementById(div).style.display = "block"; - - document.getElementById(div).appendChild(resultDocument); - document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup"); - opendDialInformations(); - } - - if(nextAction!="") - eval(nextAction); - - }else{ - - var xml = xsltProcess(xml, xsl); - - //hide the loading page - if (div == "all") { - hidePopup(); - document.getElementById(div).innerHTML = xml; - } - if (div == "dialInfo") {//click on Info Button - document.getElementById(div).style.display = "block"; - xml = xml.replace("myform", "myFormPopup"); - document.getElementById(div).innerHTML = xml; - opendDialInformations(); - } - gestionDisplay(); - if(nextAction!="") - eval(nextAction); - } - //manage the display of the accent - var content=new String(document.getElementById("all").innerHTML); - content=content.replace(/&/g,"&"); - document.getElementById("all").innerHTML=content; - var content=new String(document.getElementById("popupDial").innerHTML); - content=content.replace(/&/g,"&"); - document.getElementById("popupDial").innerHTML=content; - -} - - -function Management() -{ - -} - - -function BadResult(type, error) { - -} - -function loadSettings(url, action, div) { - launchAjaxRequest(url, action, false, div); -} - -function loadNewSettings(url, action, product, type, div,createWorkflow) { - currentProduct = product; - typeSelect = type; - launchAjaxRequest(url, action, false, div,createWorkflow); -} - -function saveDatabase(url, title, comment) { - var url = url + "?action=updateRecorder&title=" + title + "&comment=" + comment; - var xml; - dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) { - if (data == "bad") { - alert("problem to save"); - } - }, error:BadResult,content:getURLParametersTab(), method:"POST"}); - -} - -function showInformation(url, id, product) { - currentId = id; - currentProduct = product; - displayBackground(); - launchAjaxRequest(url, "getDialInformation", "false", "dialInfo"); -} - -function saveSettings(url, id) { - - url = url + "?action=saveSettings&id=" + id; - var returnValue = true; - var xml; - dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) { - if (data == "bad") { - alert("problem to save the new Settings"); - returnValue = false; - } - - }, error:BadResult, content:getForm(window.document.myform), method:"POST"}); - return returnValue; -} - -function getForm(obj) { - - var params = getSessionParameters(); - inputForm = obj.getElementsByTagName("input"); - var i=0; - for (i = 0; i < inputForm.length; i++) { - if (inputForm[i].type == "text") { - params[inputForm[i].name] = inputForm[i].value; - } - if (inputForm[i].type == "checkbox") { - if (inputForm[i].checked) { - params[inputForm[i].name] = inputForm[i].value; - } else { - params[inputForm[i].name] = "false"; - } - } - if (inputForm[i].type == "radio") { - if (inputForm[i].checked) { - params[inputForm[i].name] = inputForm[i].value; - } - } - } - inputForm = obj.getElementsByTagName("select"); - for (i = 0; i < inputForm.length; i++) { - var sel = inputForm[i]; - params[sel.name] = sel.options[sel.selectedIndex].value; - } - inputForm = obj.getElementsByTagName("textarea"); - for (i = 0; i < inputForm.length; i++) { - params[inputForm[i].name] = inputForm[i].value; - } - return params; -} - +/****************************************************************************** + * * + * Copyright (c) 1999-2007 Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Wimba. * + * It cannot be copied, used, or modified without obtaining an * + * authorization from the authors or a mandated member of Wimba. * + * If such an authorization is provided, any modified version * + * or copy of the software has to contain this header. * + * * + * WARRANTIES: * + * This software is made available by the authors in the hope * + * that it will be useful, but without any warranty. * + * Wimba is not liable for any consequence related to * + * the use of the provided software. * + * * + * Class: ajax.js * + * * + * Author: Thomas Rollinger * + * * + * Date: May 2007 * + * * + ******************************************************************************/ + + +/* + * Get the parameters passed with the GET Method and put them into a + * javascript array + */ +function getURLParametersTab() { + var sURL = window.document.URL; + + var params = new Array(); + if (sURL.indexOf("?") > 0) { + var arrParams = sURL.split("?"); + var arrURLParams = arrParams[1].split("&"); + var i = 0; + for (i = 0; i < arrURLParams.length; i = i + 1) { + var param = arrURLParams[i].split("="); + params[param[0]] = unescape(param[1].replace(/\+/g,"%20")); + } + } + return params; +} + +/* + * Get the parameters passed with the GET Method and + * create a string with them. + */ +function getURLParameters() { + var sURL = window.document.URL.toString(); + var params = ""; + if (sURL.indexOf("?") > 0) + { + var arrParams = sURL.split("?"); + + var arrURLParams = arrParams[1].split("&"); + + var arrParamNames = new Array(arrURLParams.length); + var arrParamValues = new Array(arrURLParams.length); + + var i = 0; + for (i = 0; i < arrURLParams.length; i ++ ) + { + var sParam = arrURLParams[i]; + arrParamNames[i] = sParam[0]; + if (sParam[1] != "") + params += "&" + unescape(sParam); + + } + params = params.substring(1, params.length) + } + return params; +} + +/* + * Create an array which contains different informations + * about the component status and session variable + */ +function getSessionParameters() { + var params = new Array(); + params["signature"] = session["signature"]; + params["enc_courseId"] = session["courseId"]; + params["enc_email"] = session["email"]; + params["enc_firstname"] = session["firstName"]; + params["enc_lastname"] = session["lastName"]; + params["enc_role"] = session["role"]; + params["time"] = session["timeOfLoad"]; + if (currentProduct != "") { + params["product"] = currentProduct; + } + if (typeSelect != "") { + params["type"] = typeSelect; + } + if (currentId != "") { + params["id"] = currentId; + } + if (currentIdtab != "") { + params["idtab"] = currentIdtab; + } + if (currentCourseTab != "") { + params["tab"] = currentCourseTab; + } + params["studentView"] = studentView; + + return params; +} +/* + * Create a string which contains different informations + * about the component status and session variable to be passed + * as a GET parameters + */ +function getUrlParameters() { + var url = ""; + url += "signature=" + session["signature"]; + url += "&enc_courseId=" + session["courseId"]; + url += "&enc_email=" + session["email"]; + url += "&enc_firstname=" + session["firstName"]; + url += "&enc_lastname=" + session["lastName"]; + url += "&enc_role=" + session["role"]; + url += "&time=" + session["timeOfLoad"]; + if (currentProduct != "") { + url += "&product=" + currentProduct; + } + if (typeSelect != "") { + url += "&type=" + typeSelect; + } + + if (currentId != "") { + url += "&id=" + currentId; + } + + if (currentIdtab != "") { + url += "&idtab=" + currentIdtab; + } + if (currentCourseTab != "") { + url += "&tab = " + currentCourseTab; + } + url += "&studentView=" + studentView; + + return url; +} + +/* + * Display the principal page of the component + * url : file which generate the xml + * div : id of the div where the html will be + * action : + * nextAction : + */ +function DisplayFirstPage(url, div, action, nextAction) { + if (div == "all") { + showPopup(); + } + if (action != null) { + url += "?action=" + action; + } + + + transform(url,"js/xsl/wimba.xsl","first",div,nextAction) +} + + +/* + * Create the context of the Ajax request and execute it + * + */ +function launchAjaxRequest(url, action, init, div,createWorkflow) { + //display the loading page + if(currentId == "" && action=="update") { + return false; + } + if (div == "all") { + showPopup(); + } + if (lcPopup != null) { + lcPopup.close(); + } + var parameters = ""; + if (action != "") { + url += "?action=" + action; + } + if (createWorkflow != "" && action!="") { + url += "&createWorkflow=" + createWorkflow; + } + isFilter = false; + transform(url,"js/xsl/wimba.xsl","",div) + if (init == true) { + + currentId = ""; + currentIdtab = "Info"; + advancedSettings = false; + } +} + +/* +* Function used to display the rss feed into the podcaster nugget +*/ +function launchSimpleAjaxRequest(url, action, init, div) { + //display the loading page + var xml; + var parameters = ""; + if (action != "") { + url += "?action=" + action; + } + + var xmlSource; + dojo.io.bind({ + url:url, mimetype:"text/plain", + load:function (type, data, evt) { + //error management + if (data.match("error") == "error") { + dom = xmlParse(data); + xmlSource = dom; + if (xslData == null) { //get the stylesheet + dojo.io.bind({ + url:"js/xsl/wimba.xsl", + mimetype:"application/xml", + load:function (type, data, evt) { + xslData = data; + var xml = xsltProcess(xmlSource, xslData); + hidePopup(); + document.getElementById(div).innerHTML = xml; + }, + error:BadResult, + content:null, + method:"POST"}); + } else { + transform(xml, xslData, 'all'); + } + } else { + //launch the generation of the display + displayRssFeed(data, div); + } + }, + error:BadResult, + content:getSessionParameters(), + method:"POST"}); +} + +/* + * Create the context of the Ajax request and execute it + */ +function getRss(url, id, tab) { + if(id!=""){ + document.getElementById("rss").innerHTML = document.getElementById("loadingPopup").innerHTML; + currentId = id; + currentCourseTab = tab; + launchSimpleAjaxRequest(url, "getRss", true, "rss"); + } +} + +/* + * This function execute the ajax request to get the approppriate xml and + * the xsl. Then, It execute the xslt transformation to generate the html + * + * For IE: we used the native javascript function to get the xml,xsl by Ajax and + * excecute the xslt transformation + * + * For Firefox : we used the dojo framework to get the xml,xsl by Ajax and the native + * function to execute the xslt transformation + * + * 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) { + + if(window.ActiveXObject){//ie + + if(TypeParams=="first") + params=getURLParameters(); + else + params=getUrlParameters(); + + var sourceDoc = new ActiveXObject("Microsoft.XMLDOM") + sourceDoc.async = false + if(urlXml.substr((urlXml.length-1),urlXml.length)=="?") + sourceDoc.load(urlXml +params) + else if( urlXml.substr((urlXml.length-1),urlXml.length)=="&") + sourceDoc.load(urlXml+params) + else if( urlXml.indexOf("?") == -1) + sourceDoc.load(urlXml+"?"+params) + else + sourceDoc.load(urlXml+"&"+params) + + if (div == "all" && sourceDoc.documentElement.getElementsByTagName("type")[0].childNodes[0].nodeValue!="error") { + createSessionByXmlDocument(sourceDoc); + } + + var xslDoc = new ActiveXObject("Microsoft.XMLDOM") + xslDoc.async = false + xslDoc.load("js/xsl/wimba.xsl"); + + xsltTransformation(sourceDoc,xslDoc,div,nextAction); + + }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:stylesheet, + mimetype:"application/xml", + load:function (type, data, evt) { + //do the xslt transformatio + xsltTransformation(xmlSource,data,div,nextAction) + + }, + error:BadResult, + content:null, + method:"GET"}); + + }, + error:BadResult, + content:params, + method:"POST"}); + + }else{ + if(TypeParams=="first") + params=getURLParametersTab(); + else + params=getSessionParameters(); + var xmlSource; + dojo.io.bind({url:urlXml, mimetype:"text/plain", load:function (type, data, evt) { + if (div == "all" && data.match("error") != "error") { + createSession(data); + } + dom = xmlParse(data); + xmlSource = dom; + + dojo.io.bind({ + url:"js/xsl/wimba.xsl", + mimetype:"application/xml", + load:function (type, data, evt) { + //do the xslt transformatio + xsltTransformation(xmlSource,data,div,nextAction) + }, + error:BadResult, + content:null, + method:"GET"}); + + + }, + error:BadResult, + content:params, + method:"POST"}); + + } + +} + +/* + * Call the appropriate function to execute the xslt transformation + * and add the html into the page + */ +function xsltTransformation(xml,xsl,div,nextAction){ + + if(window.ActiveXObject)//ie + { + var result = xml.transformNode(xsl); + if (div == "all") { + document.getElementById(div).innerHTML = result; + hidePopup(); + gestionDisplay(); + var text=new String(document.getElementById("all").innerHTML); + + } + if (div == "dialInfo") {//click on Info Button + document.getElementById(div).style.display = "block"; + document.getElementById(div).innerHTML = result; + document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup"); + opendDialInformations(); + } + if(nextAction!="") + eval(nextAction); + }else if (window.XSLTProcessor){//firefox + + var processor = new XSLTProcessor(); + processor.importStylesheet(xsl); + document.getElementById(div).innerHTML=""; + var resultDocument = processor.transformToFragment(xml, document); + + if (div == "all") { + hidePopup(); + document.getElementById(div).appendChild(resultDocument); + gestionDisplay(); + + } + if (div == "dialInfo") {//click on Info Button + document.getElementById(div).style.display = "block"; + + document.getElementById(div).appendChild(resultDocument); + document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup"); + opendDialInformations(); + } + + if(nextAction!="") + eval(nextAction); + + }else{ + + var xml = xsltProcess(xml, xsl); + + //hide the loading page + if (div == "all") { + hidePopup(); + document.getElementById(div).innerHTML = xml; + } + if (div == "dialInfo") {//click on Info Button + document.getElementById(div).style.display = "block"; + xml = xml.replace("myform", "myFormPopup"); + document.getElementById(div).innerHTML = xml; + opendDialInformations(); + } + gestionDisplay(); + if(nextAction!="") + eval(nextAction); + } + //manage the display of the accent + var content=new String(document.getElementById("all").innerHTML); + content=content.replace(/&/g,"&"); + document.getElementById("all").innerHTML=content; + var content=new String(document.getElementById("popupDial").innerHTML); + content=content.replace(/&/g,"&"); + document.getElementById("popupDial").innerHTML=content; + +} + + +function Management() +{ + +} + + +function BadResult(type, error) { + +} + +/* + * load the setting of the Lc or Vt + */ +function loadSettings(url, action, div) { + launchAjaxRequest(url, action, false, div); +} + +/* + * Load the settings of a existing element(room or voice tools) + */ +function loadNewSettings(url, action, product, type, div,createWorkflow) { + currentProduct = product; + typeSelect = type; + launchAjaxRequest(url, action, false, div,createWorkflow); +} + +/* + * Save the comment and the title of the voice recorder + */ + +function saveDatabase(url, title, comment) { + var url = url + "?action=updateRecorder&title=" + title + "&comment=" + comment; + var xml; + dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) { + if (data == "bad") { + alert("problem to save"); + } + }, error:BadResult,content:getURLParametersTab(), method:"POST"}); + +} + +/* + * Get the dial-in informations fo a specific room + */ +function showInformation(url, id, product) { + currentId = id; + currentProduct = product; + displayBackground(); + launchAjaxRequest(url, "getDialInformation", "false", "dialInfo"); +} + +/* + * Save the settings of a existing room. It used to save the room settings before + * launch the advanced settings + */ +function saveSettings(url, id) { + + url = url + "?action=saveSettings&id=" + id; + var returnValue = true; + var xml; + dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) { + if (data == "bad") { + alert("problem to save the new Settings"); + returnValue = false; + } + + }, error:BadResult, content:getForm(window.document.myform), method:"POST"}); + return returnValue; +} + +/* + * get the value of all the input elements of the form + */ +function getForm(obj) { + + var params = getSessionParameters(); + inputForm = obj.getElementsByTagName("input"); + var i=0; + for (i = 0; i < inputForm.length; i++) { + if (inputForm[i].type == "text") { + params[inputForm[i].name] = inputForm[i].value; + } + if (inputForm[i].type == "checkbox") { + if (inputForm[i].checked) { + params[inputForm[i].name] = inputForm[i].value; + } else { + params[inputForm[i].name] = "false"; + } + } + if (inputForm[i].type == "radio") { + if (inputForm[i].checked) { + params[inputForm[i].name] = inputForm[i].value; + } + } + } + inputForm = obj.getElementsByTagName("select"); + for (i = 0; i < inputForm.length; i++) { + var sel = inputForm[i]; + params[sel.name] = sel.options[sel.selectedIndex].value; + } + inputForm = obj.getElementsByTagName("textarea"); + for (i = 0; i < inputForm.length; i++) { + params[inputForm[i].name] = inputForm[i].value; + } + return params; +} + Modified: trunk/moodle/mod/liveclassroom/js/constants.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/constants.js 2008-01-09 10:36:38 UTC (rev 199) +++ trunk/moodle/mod/liveclassroom/js/constants.js 2008-01-09 11:37:50 UTC (rev 200) @@ -57,4 +57,5 @@ var xmlDoc; var xslData=null; var lcPopup=null; +var expandState=0; Modified: trunk/moodle/mod/liveclassroom/js/hwCommons.js =================================================================== --- trunk/moodle/mod/liveclassroom/js/hwCommons.js 2008-01-09 10:36:38 UTC (rev 199) +++ trunk/moodle/mod/liveclassroom/js/hwCommons.js 2008-01-09 11:37:50 UTC (rev 200) @@ -1,4 +1,4 @@ -/****************************************************************************** +/****************************************************************************** * * * Copyright (c) 1999-2007 Wimba, All Rights Reserved. * * * @@ -30,6 +30,7 @@ } return false; } + function isIE6() { var userAgent = navigator.userAgent; var start = userAgent.indexOf("(", 0); @@ -49,75 +50,123 @@ return false; } } +/* + * Manage the search of a specific element. This function is called every time + * when the user type a letter into the search field + */ function searchResource(searchValue) { activateFilter("all") var display = "table-row"; if (isInternetExplorer()) { display = "block"; - } - //manage the button - if (currentId != "") { + } + if (currentId != "") {//deselect the current element document.getElementById(currentId).style.backgroundColor = "white"; } - currentId = ""; + + searchValueLength=searchValue.length-1; + if(searchValue.indexOf("\"")==0 && searchValue.lastIndexOf("\"")==searchValueLength && searchValue.length>1) { + searchValue=searchValue.substr(1,(searchValueLength-1)); + } + + currentId = "";//init the current id because no element is selected var match = false; - var list = document.getElementById("list"); - var product = list.getElementsByTagName("div"); + var list = document.getElementById("list");//get the part which contains the global list + var product = list.getElementsByTagName("div");//get the products for (var i = 0; i < product.length; i++) { - var elements = product[i].getElementsByTagName("tr"); + var elements = product[i].getElementsByTagName("tr");//get the elements of this product var numMatch = 0; for (var x = 0; x < elements.length; x++) { - if (elements[x].getAttribute("typeProduct") != null && elements[x].getAttribute("stateStudentView") != "ignore") {//list element - + //if the current element is available for search + if (elements[x].getAttribute("typeProduct") != null && elements[x].getAttribute("stateStudentView") != "ignore") { if (searchValue == "") {//init elements[x].style.backgroundColor = "white"; - if (elements[x].getAttribute("typeProduct") == "archive" && elements[x - 1].getAttribute("preview") != "unavalaible") { - elements[x].className = "archiveHide"; - var pictureId = elements[x - 1].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-show.png"); + if (elements[x + 1]!=null && elements[x + 1].getAttribute("typeProduct") == "archive") { + var roomLinked=x; + var archiveMatched=0; + while (elements[x + 1].getAttribute("typeProduct") == "archive" ) { + if(elements[x+1].getAttribute("stateStudentView") != "ignore"){ + elements[x + 1].className = "archiveHide"; + archiveMatched++ + } + x++; + } + + if(archiveMatched>0){//change the pciture + var pictureId = elements[roomLinked].id + "_ExpandPicture"; + changePicture(pictureId, "pictures/items/listitem-show.png"); + } + elements[roomLinked].setAttribute("stateSearch", "");//change the status of the element to manage the display + elements[roomLinked].style.display = display; } else { - if (studentView == true && elements[x].getAttribute("typeProduct") == "orphanedarchivestudent") { - elements[x].style.display = display; - elements[x].setAttribute("stateSearch", ""); - } else { - if (elements[x].getAttribute("stateStudentView") != "ignore" && elements[x].getAttribute("typeProduct") != "orphanedarchivestudent") { + if (studentView == true && elements[x].getAttribute("typeProduct") == "orphanedarchivestudent") { elements[x].style.display = display; elements[x].setAttribute("stateSearch", ""); - } - } + } else { + if (elements[x].getAttribute("stateStudentView") != "ignore" && elements[x].getAttribute("typeProduct") != "orphanedarchivestudent") { + elements[x].style.display = display; + elements[x].setAttribute("stateSearch", ""); + } + } } } else { + //if the element match if (elements[x].getAttribute("name")!=null && elements[x].getAttribute("name").toLowerCase().match(searchValue.toLowerCase())) { numMatch++; - if (numMatch == 1 && match != true) { + if (numMatch == 1 && match != true) {//first of the list will be selected elements[x].style.backgroundColor = "#c3dbf7"; currentId = elements[x].id; match = true; } elements[x].style.display = display; - elements[x].setAttribute("stateSearch", ""); + elements[x].setAttribute("stateSearch", "");//this element is match by the search var pictureId = elements[x].id + "_ExpandPicture"; - if (document.getElementById(pictureId) != null) { - changePicture(pictureId, "pictures/items/listitem-hide.png"); + if (document.getElementById(pictureId) != null) {//if archive available + var roomLinked=x; + var archiveMatched=0; while (elements[x + 1].getAttribute("typeProduct") == "archive") { - elements[x + 1].className = "archive"; - elements[x + 1].setAttribute("stateSearch", ""); - x++; + if(elements[x + 1].getAttribute("name").toLowerCase().match(searchValue.toLowerCase()) && elements[x+1].getAttribute("stateStudentView") != "ignore" ){ + elements[x + 1].className = "archive"; + elements[x + 1].setAttribute("stateSearch", ""); + archiveMatched++; + } + x++; } + //management of the picture to expand the archives + if(archiveMatched>0){ + var pictureId = elements[roomLinked].id + "_ExpandPicture"; + changePicture(pictureId, "pictures/items/listitem-hide.png"); + }else{ + var pictureId = elements[roomLinked].id + "_ExpandPicture"; + changePicture(pictureId, "pictures/items/space-16px.png"); + } } } else { - if (elements[x + 1] != null && elements[x + 1].getAttribute("name")!=null && elements[x + 1].getAttribute("name").match(searchValue) && elements[x + 1].getAttribute("typeProduct") == "archive") { - elements[x].style.display = display; - elements[x].setAttribute("stateSearch", ""); - var pictureId = elements[x].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-hide.png"); - while (elements[x + 1].getAttribute("typeProduct") == "archive") { - elements[x + 1].className = "archive"; - elements[x + 1].setAttribute("stateSearch", ""); - x++; + //if a archive of the element matches the search + //the room will be displayed and the archive expanded + if (elements[x + 1] != null && elements[x + 1].getAttribute("name")!=null && elements[x + 1].getAttribute("typeProduct") == "archive") { + var archiveMatched=0; + var roomLinked=x; + while (elements[x + 1].getAttribute("typeProduct") == "archive") { + if(elements[x + 1].getAttribute("name").toLowerCase().match(searchValue.toLowerCase())&& elements[x+1].getAttribute("stateStudentView") != "ignore"){ + elements[x + 1].className = "archive"; + elements[x + 1].setAttribute("stateSearch", ""); + archiveMatched++; + } + x++; } + if(archiveMatched>0){ + elements[roomLinked].style.display = display; + elements[roomLinked].setAttribute("stateSearch", ""); + var pictureId = elements[roomLinked].id + "_ExpandPicture"; + changePicture(pictureId, "pictures/items/listitem-hide.png"); + }else{ + elements[roomLinked].style.display = "none"; + elements[roomLinked].setAttribute("stateSearch", "ignore"); + } } else { + //if the archive doesn't match, the archive will be hide if (elements[x].getAttribute("typeProduct") == "archive") { elements[x].className = "archiveHide"; } else { @@ -132,6 +181,7 @@ } gestionDisplay(); } + /* * Function called when the user click on a list elements */ @@ -151,7 +201,7 @@ } } - + //update the current context currentId = id; currentProduct = product; typeSelect = type; @@ -159,29 +209,47 @@ EnabledToolBar(); } } + +/* + * Manage the expand/collapse of the archive list + * + */ function hideArchive(id) { var archiveAvailable=false; var div = document.getElementById("div_" + LC_PRODUCT); + var name = "div_" + LC_PRODUCT; + var nameMore = "div_" + LC_PRODUCT +"_More"; var listRoomsArchives = div.getElementsByTagName("tr"); + var numHide=0; for (var i = 0; i < listRoomsArchives.length; i++) { if (listRoomsArchives[i].getAttribute("typeProduct") == "archive" && listRoomsArchives[i].getAttribute("id").match(id)) { + //test if the current is available : not displayed yet and not ignored by the switched to student view if (listRoomsArchives[i].className == "archiveHide" && listRoomsArchives[i].getAttribute("stateStudentView")!="ignore") { - listRoomsArchives[i].className = "archive"; - + listRoomsArchives[i].className = "archive"; //make this archive visible archiveAvailable=true; } else { listRoomsArchives[i].className = "archiveHide"; + numHide=1+numHide; } } } if(archiveAvailable==true){ changePicture(id + "_ExpandPicture", "pictures/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", "pictures/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 + document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='RemoveAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>Show Top 5...</label>"; + } + if (currentId != "") { + document.getElementById(currentId).style.backgroundColor = "white"; + } + currentId = ""; } /* * This function changes the state of the button when the user click on an element @@ -193,9 +261,8 @@ for (var x = 0; x < td.length; x++) { if (td[x].getAttribute("context") == "all" || document.getElementById("view")!=null && document.getElementById("view").value == "normal" || (td[x].getAttribute("context") != "instructor" && document.getElementById("view")!=null && document.getElementById("view").value == "student")) { if (td[x].getAttribute("type") == "button") { - + //test if this button has to be displayed for the current tools selected if (td[x].getAttribute("product") == "all" || td[x].getAttribute("product") == currentProduct) { - td[x].innerHTML = td[x].innerHTML.replace("disabled.png", "enabled.png"); td[x].className = "button_enabled"; } else { @@ -206,8 +273,10 @@ } } } + /* -* This function initializes the toolbar +* This function initializes the toolbar : +* It disables the */ function InitToolBar() { var toolBar = document.getElementById("toolBar"); @@ -223,7 +292,7 @@ } /* * This function manage the studentView : -* Remove the buttons not available for the student and remove the unavaible elements +* Remove the buttons not available for the student and remove the unavailable elements */ function switchView() { var display = "table-row"; @@ -269,17 +338,14 @@ for (var i = 0; i < elements.length; i++) { //show the element not match by search elements[i].setAttribute("stateSearch", ""); - if (elements[i].getAttribute("preview") == "unavailable" && document.getElementById("view").value == "student") { - if (elements[i].getAttribute("typeProduct") == "archive" && elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") != "archive") { - var pictureId = elements[i - 1].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/space-16px.png"); - } else {//room - elements[i].setAttribute("stateStudentView", "ignore"); + // the unavailable elements are not displayed for the student + if (document.getElementById("view").value == "student") { + if(elements[i].getAttribute("preview") == "unavailable"){ + elements[i].setAttribute("stateStudentView", "ignore");//change the status of this element for the search elements[i].style.display = "none"; - var pictureId = elements[i].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-show.png"); - if (elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") == "archive") { - + 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"); while (elements[i + 1].getAttribute("typeProduct") == "archive") { elements[i + 1].className = "archiveHide"; elements[i + 1].setAttribute("stateStudentView", "ignore"); @@ -287,63 +353,64 @@ } } - } - } else { - if ((elements[i].getAttribute("typeProduct") == "orphanedarchivestudent" && document.getElementById("view").value == "student")) { + }else if(elements[i].getAttribute("typeProduct") == "orphanedarchivestudent"){ elements[i].style.display = display; - } else { - if (elements[i].getAttribute("typeProduct") == "orphanedarchivestudent" && document.getElementById("view").value == "normal") { - elements[i].style.display = "none"; - } else { - if (document.getElementById("view").value == "normal") { - elements[i].setAttribute("stateStudentView", ""); - if (elements[i].getAttribute("typeProduct") != "archive") { - var pictureId = elements[i].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-show.png"); - elements[i].style.display = display; - } else { - elements[i].style.display = ""; + }else{ + if(elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") == "archive"){//this room contains archives + var linkedRoom=i; + var archiveMatched=0; + while (elements[i + 1].getAttribute("typeProduct") == "archive") { + if(elements[i+1].getAttribute("preview") == "unavailable"){ + elements[i + 1].className = "archiveHide"; + elements[i + 1].setAttribute("stateStudentView", "ignore"); + }else{ + archiveMatched++; } - }else{ - if (elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") == "archive") { - var isArchiveExist=false; - var pictureId = elements[i].id + "_ExpandPicture"; - while (elements[i + 1].getAttribute("typeProduct") == "archive") { - elements[i + 1].className = "archiveHide"; - if(elements[i + 1].getAttribute("preview")=="unavailable") { - - elements[i + 1].setAttribute("stateStudentView", "ignore"); - - }else{ - - isArchiveExist=true; - } - i++; - } - if(isArchiveExist==false){ - - changePicture(pictureId, "pictures/items/space-16px.png"); - }else{ - changePicture(pictureId, "pictures/items/listitem-show.png"); - } - } - } + i++ + } + 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"); + + } } + } + } else {//normal view + //the available archives linked to a unavailable room are displayed(name orphanedArchiveForStudent) for the student + if (elements[i].getAttribute("typeProduct") == "orphanedarchivestudent" && document.getElementById("view").value == "normal") { + elements[i].style.display = "none"; + } else { + + elements[i].setAttribute("stateStudentView", "");//init the context + if (elements[i].getAttribute("typeProduct") != "archive") { + 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"); + + } + } else { + elements[i].style.display = ""; + } + } } } } gestionDisplay(); } -function getIdParameters(id) { - var tabId = id.split("_"); - //0=type - //1=id - //2=status - return tabId; -} + function activateFilter(product) { var otherProduct = LC_PRODUCT; + if (currentId != "") { + document.getElementById(currentId).style.backgroundColor = "white"; + } + InitToolBar();//the toolbar has to be initialized + currentDiv = product; + currentId = ""; + currentNid = ""; + currentProduct = ""; + isFilter = true; changeFilterStatus(currentFilter, "disabled"); changeFilterStatus("filter_" + product, "enabled"); @@ -351,12 +418,7 @@ if (document.getElementById(currentId) != null) { document.getElementById(currentId).style.background = "white"; } - InitToolBar(); - currentDiv = product; - currentId = ""; - currentNid = ""; - currentProduct = ""; - isFilter = true; + //display only the selected product into the list var list = document.getElementById("list"); var innerList = list.getElementsByTagName("div"); for (var i = 0; i < innerList.length; i++) { @@ -376,6 +438,7 @@ } } } + /* * manage the rollover of the filter */ @@ -396,14 +459,13 @@ document.getElementById(id).className = "filter" + status; } } + function gestionDisplay(product) { var more = "more"; if (navigator.language == "fr") { more = "de plus"; - } - - - //manage the heigth + } + //manage the heigth for the choice panel var productChoice = document.getElementById("productChoice"); if (productChoice != null) { var products = productChoice.getElementsByTagName("tr"); @@ -415,24 +477,43 @@ products[i].className = style; } } + + + if(document.getElementById("collapsePictureliveclassroom")) { + changePicture("collapsePictureliveclassroom", "pictures/items/category-expanded.png"); + document.getElementById("div_liveclassroom").setAttribute("state", "expand"); + } + if(document.getElementById("collapsePictureboard")) { + changePicture("collapsePictureboard", "pictures/items/category-expanded.png"); + document.getElementById("div_board").setAttribute("state", "expand"); + } + if(document.getElementById("collapsePicturepresentation")) { + changePicture("collapsePicturepresentation", "pictures/items/category-expanded.png"); + document.getElementById("div_presentation").setAttribute("state", "expand"); + } + if(document.getElementById("collapsePicturepc")) { + changePicture("collapsePicturepc", "pictures/items/category-expanded.png"); + document.getElementById("div_pc").setAttribute("state", "expand"); + } + + //manage the display of the list var list = document.getElementById('list') if(list!=null){ var products=list.getElementsByTagName("div") for( var i = 0; i < products.length; i++ ) { if(products[i].getAttribute("typeElement")=="productList" && (product==products[i].getAttribute("product") || product==null)){ var divProductMore=document.getElementById('div_'+products[i].getAttribute("typeproduct")+'_More'); - var divProductNoElement=document.getElementById('div_'+products[i].getAttribute("typeproduct")+'_NoElement'); var tr=products[i].getElementsByTagName("tr"); var numElement=0; + //count the number of element available of the current product for(var j=0;j<tr.length;j++){ - if(tr[j].getAttribute("typeProduct")==products[i].getAttribute("typeProduct") || document.getElementById("view")!=null && document.getElementById("view").value == "student" && tr[j].getAttribute("typeProduct")=="orphanedarchivestudent" ) + if(tr[j].getAttribute("typeProduct")==products[i].getAttribute("typeProduct") || document.getElementById("view")!=null && document.getElementById("view").value == "student" && tr[j].getAttribute("typeProduct")=="orphanedarchivestudent" || (products[i].getAttribute("typeProduct") == LC_PRODUCT && tr[j].getAttribute("typeProduct")=="orphanedarchive") ) if(tr[j].getAttribute("stateSearch")!="ignore" && tr[j].getAttribute("stateStudentView")!="ignore") numElement++; } - //4 div per product - + //4 div per product if(numElement > 5 && product==null && products.length>4){ products[i].style.height = 5 * 19 + "px"; divProductMore.style.display = "block"; @@ -441,15 +522,13 @@ divProductNoElement.style.display = "none"; }else if(numElement == 0){ products[i].style.display = "none"; - - divProductNoElement.style.display = "block"; divProductMore.style.display = "none"; }else{ products[i].style.display = "block"; products[i].style.height = ""; divProductMore.style.display = "none"; - divProductNoElement.style.display = "none"; + divProductNoElement.style.display = "none"; } } } @@ -461,22 +540,35 @@ } } + +/* + * Called to display the complete list of element for a product + */ function displayAllDiv(name, nameMore, number) { if (currentId != "") { document.getElementById(currentId).style.backgroundColor = "white"; } currentId = ""; + expandState = 1; document.getElementById(name).style.height = ""; document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='RemoveAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + number + "\")'>Show Top 5...</label>"; } +/* + * Called to hide the complete list of element and display just 5 elements + */ function RemoveAllDiv(name, nameMore, number) { if (currentId != "") { document.getElementById(currentId).style.backgroundColor = "white"; } currentId = ""; + expandState = 0; document.getElementById(name).style.height = 5 * 19 + "px"; document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='displayAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + number + "\")'>" + (number - 5) + " more...</label>"; } + +/* + * Called to hide the complete list of elements + */ function collapseGroupElement(product, pictureId) { var divProduct = document.getElementById("div_" + product); var divProductMore = document.getElementById("div_" + product + "_More"); @@ -488,7 +580,11 @@ divProduct.setAttribute("state", "collapse"); } else { divProduct.style.display = "block"; - divProductMore.style.display = "block"; + if(currentFilter == "filter_all") { + divProductMore.style.display = "block"; + } else { + divProductMore.style.display = "none"; + } changePicture(pictureId, "pictures/items/category-expanded.png"); divProduct.setAttribute("state", "expand"); } @@ -504,10 +600,14 @@ } else { if (document.getElementById(id) != null) { document.getElementById(id).src = pictureUrl; - // alert( document.images[id].src); + } } } + +/* + * Filled the session array thanks to the xmlDocument + */ function createSessionByXmlDocument(data) { objDomTree = data.documentElement; @@ -598,8 +698,9 @@ } - -//element function +/* + * Manage the launch of an element switch the context + */ function LaunchElement(url) { if (currentProduct == LC_PRODUCT) { LaunchLiveClassroom(url); @@ -609,6 +710,9 @@ } } } +/* + * Launch the LiveClassroom into a popup + */ function LaunchLiveClassroom(url, params) { var result = true; if (session["role"] == "StudentBis" || (session["role"] == "Instructor" && studentView == true)) { @@ -619,8 +723,12 @@ window.open(complete_url, "lc_popup", "scrollbars=no,resizable=yes,width=700,height=500"); } } +/* + * Launch the VoiceTools into a popup + */ function LaunchVoiceTools(url, params) { var result = true; + //Student view if (session["role"] == "StudentBis" || (session["role"] == "Instructor" && studentView == true)) { result = window.confirm("You are in Student View.\nYou will not have access to instructor features."); } @@ -631,22 +739,23 @@ } -//settings function +/* + * function called when you click on a tab in the settings + */ function onTab(id, additionalfunction) { - if (advancedSettings == true) { + if (advancedSettings == true && document.getElementById("tab" + id).className != "tabDisabled") { advancedSettings = false; currentIdtab = id;... [truncated message content] |