hw4mdl-svn Mailing List for Wimba Moodle Integration (Page 10)
Brought to you by:
jhlinder,
trollinger
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(7) |
Jun
|
Jul
(3) |
Aug
(13) |
Sep
(20) |
Oct
(20) |
Nov
(9) |
Dec
(49) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(34) |
Feb
|
Mar
|
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(39) |
Feb
(14) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(3) |
Nov
(4) |
Dec
|
From: Hugues P. <hpi...@ho...> - 2006-07-05 13:50:46
|
This is a test, please disregard this email |
From: <hu...@us...> - 2006-07-05 13:38:28
|
Revision: 41 Author: hugues Date: 2006-07-05 06:38:19 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=41&view=rev Log Message: ----------- reverting to version 18 Modified Paths: -------------- trunk/moodle/README.txt trunk/moodle/mod/liveclassroom/README.txt trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php Removed Paths: ------------- trunk/moodle/mod/liveclassroom/PEAR.php trunk/moodle/mod/liveclassroom/System.php Modified: trunk/moodle/README.txt =================================================================== --- trunk/moodle/README.txt 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/README.txt 2006-07-05 13:38:19 UTC (rev 41) @@ -1 +1 @@ - Horizon Wimba Moodle Integration aims at providing to the Moodle community integrations of the products developed by Horizon Wimba into Moodle. At this time, we plan to have quickly support for Live Classroom and Voice Tools Activity Modules. \ No newline at end of file +Horizon Wimba Moodle Integration aims at providing to the Moodle community integrations of the products developed by Horizon Wimba into Moodle. At this time, we plan to have quickly support for Live Classroom and Voice Tools Activity Modules. \ No newline at end of file Deleted: trunk/moodle/mod/liveclassroom/PEAR.php =================================================================== --- trunk/moodle/mod/liveclassroom/PEAR.php 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/mod/liveclassroom/PEAR.php 2006-07-05 13:38:19 UTC (rev 41) @@ -1,1101 +0,0 @@ -<?php -/** - * PEAR, the PHP Extension and Application Repository - * - * PEAR class and PEAR_Error class - * - * PHP versions 4 and 5 - * - * LICENSE: This source file is subject to version 3.0 of the PHP license - * that is available through the world-wide-web at the following URI: - * http://www.php.net/license/3_0.txt. If you did not receive a copy of - * the PHP License and are unable to obtain it through the web, please - * send a note to li...@ph... so we can mail you a copy immediately. - * - * @category pear - * @package PEAR - * @author Sterling Hughes <ste...@ph...> - * @author Stig Bakken <ss...@ph...> - * @author Tomas V.V.Cox <co...@id...> - * @author Greg Beaver <ce...@ph...> - * @copyright 1997-2006 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id$ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 0.1 - */ - -/**#@+ - * ERROR constants - */ -define('PEAR_ERROR_RETURN', 1); -define('PEAR_ERROR_PRINT', 2); -define('PEAR_ERROR_TRIGGER', 4); -define('PEAR_ERROR_DIE', 8); -define('PEAR_ERROR_CALLBACK', 16); -/** - * WARNING: obsolete - * @deprecated - */ -define('PEAR_ERROR_EXCEPTION', 32); -/**#@-*/ -define('PEAR_ZE2', (function_exists('version_compare') && - version_compare(zend_version(), "2-dev", "ge"))); - -if (substr(PHP_OS, 0, 3) == 'WIN') { - define('OS_WINDOWS', true); - define('OS_UNIX', false); - define('PEAR_OS', 'Windows'); -} else { - define('OS_WINDOWS', false); - define('OS_UNIX', true); - define('PEAR_OS', 'Unix'); // blatant assumption -} - -// instant backwards compatibility -if (!defined('PATH_SEPARATOR')) { - if (OS_WINDOWS) { - define('PATH_SEPARATOR', ';'); - } else { - define('PATH_SEPARATOR', ':'); - } -} - -$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; -$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; -$GLOBALS['_PEAR_destructor_object_list'] = array(); -$GLOBALS['_PEAR_shutdown_funcs'] = array(); -$GLOBALS['_PEAR_error_handler_stack'] = array(); - -@ini_set('track_errors', true); - -/** - * Base class for other PEAR classes. Provides rudimentary - * emulation of destructors. - * - * If you want a destructor in your class, inherit PEAR and make a - * destructor method called _yourclassname (same name as the - * constructor, but with a "_" prefix). Also, in your constructor you - * have to call the PEAR constructor: $this->PEAR();. - * The destructor method will be called without parameters. Note that - * at in some SAPI implementations (such as Apache), any output during - * the request shutdown (in which destructors are called) seems to be - * discarded. If you need to get any debug information from your - * destructor, use error_log(), syslog() or something similar. - * - * IMPORTANT! To use the emulated destructors you need to create the - * objects by reference: $obj =& new PEAR_child; - * - * @category pear - * @package PEAR - * @author Stig Bakken <ss...@ph...> - * @author Tomas V.V. Cox <co...@id...> - * @author Greg Beaver <ce...@ph...> - * @copyright 1997-2006 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.4.9 - * @link http://pear.php.net/package/PEAR - * @see PEAR_Error - * @since Class available since PHP 4.0.2 - * @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear - */ -class PEAR -{ - // {{{ properties - - /** - * Whether to enable internal debug messages. - * - * @var bool - * @access private - */ - var $_debug = false; - - /** - * Default error mode for this object. - * - * @var int - * @access private - */ - var $_default_error_mode = null; - - /** - * Default error options used for this object when error mode - * is PEAR_ERROR_TRIGGER. - * - * @var int - * @access private - */ - var $_default_error_options = null; - - /** - * Default error handler (callback) for this object, if error mode is - * PEAR_ERROR_CALLBACK. - * - * @var string - * @access private - */ - var $_default_error_handler = ''; - - /** - * Which class to use for error objects. - * - * @var string - * @access private - */ - var $_error_class = 'PEAR_Error'; - - /** - * An array of expected errors. - * - * @var array - * @access private - */ - var $_expected_errors = array(); - - // }}} - - // {{{ constructor - - /** - * Constructor. Registers this object in - * $_PEAR_destructor_object_list for destructor emulation if a - * destructor object exists. - * - * @param string $error_class (optional) which class to use for - * error objects, defaults to PEAR_Error. - * @access public - * @return void - */ - function PEAR($error_class = null) - { - $classname = strtolower(get_class($this)); - if ($this->_debug) { - print "PEAR constructor called, class=$classname\n"; - } - if ($error_class !== null) { - $this->_error_class = $error_class; - } - while ($classname && strcasecmp($classname, "pear")) { - $destructor = "_$classname"; - if (method_exists($this, $destructor)) { - global $_PEAR_destructor_object_list; - $_PEAR_destructor_object_list[] = &$this; - if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { - register_shutdown_function("_PEAR_call_destructors"); - $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; - } - break; - } else { - $classname = get_parent_class($classname); - } - } - } - - // }}} - // {{{ destructor - - /** - * Destructor (the emulated type of...). Does nothing right now, - * but is included for forward compatibility, so subclass - * destructors should always call it. - * - * See the note in the class desciption about output from - * destructors. - * - * @access public - * @return void - */ - function _PEAR() { - if ($this->_debug) { - printf("PEAR destructor called, class=%s\n", strtolower(get_class($this))); - } - } - - // }}} - // {{{ getStaticProperty() - - /** - * If you have a class that's mostly/entirely static, and you need static - * properties, you can use this method to simulate them. Eg. in your method(s) - * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); - * You MUST use a reference, or they will not persist! - * - * @access public - * @param string $class The calling classname, to prevent clashes - * @param string $var The variable to retrieve. - * @return mixed A reference to the variable. If not set it will be - * auto initialised to NULL. - */ - function &getStaticProperty($class, $var) - { - static $properties; - return $properties[$class][$var]; - } - - // }}} - // {{{ registerShutdownFunc() - - /** - * Use this function to register a shutdown method for static - * classes. - * - * @access public - * @param mixed $func The function name (or array of class/method) to call - * @param mixed $args The arguments to pass to the function - * @return void - */ - function registerShutdownFunc($func, $args = array()) - { - // if we are called statically, there is a potential - // that no shutdown func is registered. Bug #6445 - if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { - register_shutdown_function("_PEAR_call_destructors"); - $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; - } - $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); - } - - // }}} - // {{{ isError() - - /** - * Tell whether a value is a PEAR error. - * - * @param mixed $data the value to test - * @param int $code if $data is an error object, return true - * only if $code is a string and - * $obj->getMessage() == $code or - * $code is an integer and $obj->getCode() == $code - * @access public - * @return bool true if parameter is an error - */ - function isError($data, $code = null) - { - if (is_a($data, 'PEAR_Error')) { - if (is_null($code)) { - return true; - } elseif (is_string($code)) { - return $data->getMessage() == $code; - } else { - return $data->getCode() == $code; - } - } - return false; - } - - // }}} - // {{{ setErrorHandling() - - /** - * Sets how errors generated by this object should be handled. - * Can be invoked both in objects and statically. If called - * statically, setErrorHandling sets the default behaviour for all - * PEAR objects. If called in an object, setErrorHandling sets - * the default behaviour for that object. - * - * @param int $mode - * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, - * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, - * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. - * - * @param mixed $options - * When $mode is PEAR_ERROR_TRIGGER, this is the error level (one - * of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). - * - * When $mode is PEAR_ERROR_CALLBACK, this parameter is expected - * to be the callback function or method. A callback - * function is a string with the name of the function, a - * callback method is an array of two elements: the element - * at index 0 is the object, and the element at index 1 is - * the name of the method to call in the object. - * - * When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is - * a printf format string used when printing the error - * message. - * - * @access public - * @return void - * @see PEAR_ERROR_RETURN - * @see PEAR_ERROR_PRINT - * @see PEAR_ERROR_TRIGGER - * @see PEAR_ERROR_DIE - * @see PEAR_ERROR_CALLBACK - * @see PEAR_ERROR_EXCEPTION - * - * @since PHP 4.0.5 - */ - - function setErrorHandling($mode = null, $options = null) - { - if (isset($this) && is_a($this, 'PEAR')) { - $setmode = &$this->_default_error_mode; - $setoptions = &$this->_default_error_options; - } else { - $setmode = &$GLOBALS['_PEAR_default_error_mode']; - $setoptions = &$GLOBALS['_PEAR_default_error_options']; - } - - switch ($mode) { - case PEAR_ERROR_EXCEPTION: - case PEAR_ERROR_RETURN: - case PEAR_ERROR_PRINT: - case PEAR_ERROR_TRIGGER: - case PEAR_ERROR_DIE: - case null: - $setmode = $mode; - $setoptions = $options; - break; - - case PEAR_ERROR_CALLBACK: - $setmode = $mode; - // class/object method callback - if (is_callable($options)) { - $setoptions = $options; - } else { - trigger_error("invalid error callback", E_USER_WARNING); - } - break; - - default: - trigger_error("invalid error mode", E_USER_WARNING); - break; - } - } - - // }}} - // {{{ expectError() - - /** - * This method is used to tell which errors you expect to get. - * Expected errors are always returned with error mode - * PEAR_ERROR_RETURN. Expected error codes are stored in a stack, - * and this method pushes a new element onto it. The list of - * expected errors are in effect until they are popped off the - * stack with the popExpect() method. - * - * Note that this method can not be called statically - * - * @param mixed $code a single error code or an array of error codes to expect - * - * @return int the new depth of the "expected errors" stack - * @access public - */ - function expectError($code = '*') - { - if (is_array($code)) { - array_push($this->_expected_errors, $code); - } else { - array_push($this->_expected_errors, array($code)); - } - return sizeof($this->_expected_errors); - } - - // }}} - // {{{ popExpect() - - /** - * This method pops one element off the expected error codes - * stack. - * - * @return array the list of error codes that were popped - */ - function popExpect() - { - return array_pop($this->_expected_errors); - } - - // }}} - // {{{ _checkDelExpect() - - /** - * This method checks unsets an error code if available - * - * @param mixed error code - * @return bool true if the error code was unset, false otherwise - * @access private - * @since PHP 4.3.0 - */ - function _checkDelExpect($error_code) - { - $deleted = false; - - foreach ($this->_expected_errors AS $key => $error_array) { - if (in_array($error_code, $error_array)) { - unset($this->_expected_errors[$key][array_search($error_code, $error_array)]); - $deleted = true; - } - - // clean up empty arrays - if (0 == count($this->_expected_errors[$key])) { - unset($this->_expected_errors[$key]); - } - } - return $deleted; - } - - // }}} - // {{{ delExpect() - - /** - * This method deletes all occurences of the specified element from - * the expected error codes stack. - * - * @param mixed $error_code error code that should be deleted - * @return mixed list of error codes that were deleted or error - * @access public - * @since PHP 4.3.0 - */ - function delExpect($error_code) - { - $deleted = false; - - if ((is_array($error_code) && (0 != count($error_code)))) { - // $error_code is a non-empty array here; - // we walk through it trying to unset all - // values - foreach($error_code as $key => $error) { - if ($this->_checkDelExpect($error)) { - $deleted = true; - } else { - $deleted = false; - } - } - return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME - } elseif (!empty($error_code)) { - // $error_code comes alone, trying to unset it - if ($this->_checkDelExpect($error_code)) { - return true; - } else { - return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME - } - } else { - // $error_code is empty - return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME - } - } - - // }}} - // {{{ raiseError() - - /** - * This method is a wrapper that returns an instance of the - * configured error class with this object's default error - * handling applied. If the $mode and $options parameters are not - * specified, the object's defaults are used. - * - * @param mixed $message a text error message or a PEAR error object - * - * @param int $code a numeric error code (it is up to your class - * to define these if you want to use codes) - * - * @param int $mode One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, - * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, - * PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. - * - * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter - * specifies the PHP-internal error level (one of - * E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). - * If $mode is PEAR_ERROR_CALLBACK, this - * parameter specifies the callback function or - * method. In other error modes this parameter - * is ignored. - * - * @param string $userinfo If you need to pass along for example debug - * information, this parameter is meant for that. - * - * @param string $error_class The returned error object will be - * instantiated from this class, if specified. - * - * @param bool $skipmsg If true, raiseError will only pass error codes, - * the error message parameter will be dropped. - * - * @access public - * @return object a PEAR error object - * @see PEAR::setErrorHandling - * @since PHP 4.0.5 - */ - function &raiseError($message = null, - $code = null, - $mode = null, - $options = null, - $userinfo = null, - $error_class = null, - $skipmsg = false) - { - // The error is yet a PEAR error object - if (is_object($message)) { - $code = $message->getCode(); - $userinfo = $message->getUserInfo(); - $error_class = $message->getType(); - $message->error_message_prefix = ''; - $message = $message->getMessage(); - } - - if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) { - if ($exp[0] == "*" || - (is_int(reset($exp)) && in_array($code, $exp)) || - (is_string(reset($exp)) && in_array($message, $exp))) { - $mode = PEAR_ERROR_RETURN; - } - } - // No mode given, try global ones - if ($mode === null) { - // Class error handler - if (isset($this) && isset($this->_default_error_mode)) { - $mode = $this->_default_error_mode; - $options = $this->_default_error_options; - // Global error handler - } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { - $mode = $GLOBALS['_PEAR_default_error_mode']; - $options = $GLOBALS['_PEAR_default_error_options']; - } - } - - if ($error_class !== null) { - $ec = $error_class; - } elseif (isset($this) && isset($this->_error_class)) { - $ec = $this->_error_class; - } else { - $ec = 'PEAR_Error'; - } - if ($skipmsg) { - $a = &new $ec($code, $mode, $options, $userinfo); - return $a; - } else { - $a = &new $ec($message, $code, $mode, $options, $userinfo); - return $a; - } - } - - // }}} - // {{{ throwError() - - /** - * Simpler form of raiseError with fewer options. In most cases - * message, code and userinfo are enough. - * - * @param string $message - * - */ - function &throwError($message = null, - $code = null, - $userinfo = null) - { - if (isset($this) && is_a($this, 'PEAR')) { - $a = &$this->raiseError($message, $code, null, null, $userinfo); - return $a; - } else { - $a = &PEAR::raiseError($message, $code, null, null, $userinfo); - return $a; - } - } - - // }}} - function staticPushErrorHandling($mode, $options = null) - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - $def_mode = &$GLOBALS['_PEAR_default_error_mode']; - $def_options = &$GLOBALS['_PEAR_default_error_options']; - $stack[] = array($def_mode, $def_options); - switch ($mode) { - case PEAR_ERROR_EXCEPTION: - case PEAR_ERROR_RETURN: - case PEAR_ERROR_PRINT: - case PEAR_ERROR_TRIGGER: - case PEAR_ERROR_DIE: - case null: - $def_mode = $mode; - $def_options = $options; - break; - - case PEAR_ERROR_CALLBACK: - $def_mode = $mode; - // class/object method callback - if (is_callable($options)) { - $def_options = $options; - } else { - trigger_error("invalid error callback", E_USER_WARNING); - } - break; - - default: - trigger_error("invalid error mode", E_USER_WARNING); - break; - } - $stack[] = array($mode, $options); - return true; - } - - function staticPopErrorHandling() - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - $setmode = &$GLOBALS['_PEAR_default_error_mode']; - $setoptions = &$GLOBALS['_PEAR_default_error_options']; - array_pop($stack); - list($mode, $options) = $stack[sizeof($stack) - 1]; - array_pop($stack); - switch ($mode) { - case PEAR_ERROR_EXCEPTION: - case PEAR_ERROR_RETURN: - case PEAR_ERROR_PRINT: - case PEAR_ERROR_TRIGGER: - case PEAR_ERROR_DIE: - case null: - $setmode = $mode; - $setoptions = $options; - break; - - case PEAR_ERROR_CALLBACK: - $setmode = $mode; - // class/object method callback - if (is_callable($options)) { - $setoptions = $options; - } else { - trigger_error("invalid error callback", E_USER_WARNING); - } - break; - - default: - trigger_error("invalid error mode", E_USER_WARNING); - break; - } - return true; - } - - // {{{ pushErrorHandling() - - /** - * Push a new error handler on top of the error handler options stack. With this - * you can easily override the actual error handler for some code and restore - * it later with popErrorHandling. - * - * @param mixed $mode (same as setErrorHandling) - * @param mixed $options (same as setErrorHandling) - * - * @return bool Always true - * - * @see PEAR::setErrorHandling - */ - function pushErrorHandling($mode, $options = null) - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - if (isset($this) && is_a($this, 'PEAR')) { - $def_mode = &$this->_default_error_mode; - $def_options = &$this->_default_error_options; - } else { - $def_mode = &$GLOBALS['_PEAR_default_error_mode']; - $def_options = &$GLOBALS['_PEAR_default_error_options']; - } - $stack[] = array($def_mode, $def_options); - - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); - } else { - PEAR::setErrorHandling($mode, $options); - } - $stack[] = array($mode, $options); - return true; - } - - // }}} - // {{{ popErrorHandling() - - /** - * Pop the last error handler used - * - * @return bool Always true - * - * @see PEAR::pushErrorHandling - */ - function popErrorHandling() - { - $stack = &$GLOBALS['_PEAR_error_handler_stack']; - array_pop($stack); - list($mode, $options) = $stack[sizeof($stack) - 1]; - array_pop($stack); - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); - } else { - PEAR::setErrorHandling($mode, $options); - } - return true; - } - - // }}} - // {{{ loadExtension() - - /** - * OS independant PHP extension load. Remember to take care - * on the correct extension name for case sensitive OSes. - * - * @param string $ext The extension name - * @return bool Success or not on the dl() call - */ - function loadExtension($ext) - { - if (!extension_loaded($ext)) { - // if either returns true dl() will produce a FATAL error, stop that - if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { - return false; - } - if (OS_WINDOWS) { - $suffix = '.dll'; - } elseif (PHP_OS == 'HP-UX') { - $suffix = '.sl'; - } elseif (PHP_OS == 'AIX') { - $suffix = '.a'; - } elseif (PHP_OS == 'OSX') { - $suffix = '.bundle'; - } else { - $suffix = '.so'; - } - return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); - } - return true; - } - - // }}} -} - -// {{{ _PEAR_call_destructors() - -function _PEAR_call_destructors() -{ - global $_PEAR_destructor_object_list; - if (is_array($_PEAR_destructor_object_list) && - sizeof($_PEAR_destructor_object_list)) - { - reset($_PEAR_destructor_object_list); - if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) { - $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); - } - while (list($k, $objref) = each($_PEAR_destructor_object_list)) { - $classname = get_class($objref); - while ($classname) { - $destructor = "_$classname"; - if (method_exists($objref, $destructor)) { - $objref->$destructor(); - break; - } else { - $classname = get_parent_class($classname); - } - } - } - // Empty the object list to ensure that destructors are - // not called more than once. - $_PEAR_destructor_object_list = array(); - } - - // Now call the shutdown functions - if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) { - foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) { - call_user_func_array($value[0], $value[1]); - } - } -} - -// }}} -/** - * Standard PEAR error class for PHP 4 - * - * This class is supserseded by {@link PEAR_Exception} in PHP 5 - * - * @category pear - * @package PEAR - * @author Stig Bakken <ss...@ph...> - * @author Tomas V.V. Cox <co...@id...> - * @author Gregory Beaver <ce...@ph...> - * @copyright 1997-2006 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.4.9 - * @link http://pear.php.net/manual/en/core.pear.pear-error.php - * @see PEAR::raiseError(), PEAR::throwError() - * @since Class available since PHP 4.0.2 - */ -class PEAR_Error -{ - // {{{ properties - - var $error_message_prefix = ''; - var $mode = PEAR_ERROR_RETURN; - var $level = E_USER_NOTICE; - var $code = -1; - var $message = ''; - var $userinfo = ''; - var $backtrace = null; - - // }}} - // {{{ constructor - - /** - * PEAR_Error constructor - * - * @param string $message message - * - * @param int $code (optional) error code - * - * @param int $mode (optional) error mode, one of: PEAR_ERROR_RETURN, - * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER, - * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION - * - * @param mixed $options (optional) error level, _OR_ in the case of - * PEAR_ERROR_CALLBACK, the callback function or object/method - * tuple. - * - * @param string $userinfo (optional) additional user/debug info - * - * @access public - * - */ - function PEAR_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - if ($mode === null) { - $mode = PEAR_ERROR_RETURN; - } - $this->message = $message; - $this->code = $code; - $this->mode = $mode; - $this->userinfo = $userinfo; - if (function_exists("debug_backtrace")) { - if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) { - $this->backtrace = debug_backtrace(); - } - } - if ($mode & PEAR_ERROR_CALLBACK) { - $this->level = E_USER_NOTICE; - $this->callback = $options; - } else { - if ($options === null) { - $options = E_USER_NOTICE; - } - $this->level = $options; - $this->callback = null; - } - if ($this->mode & PEAR_ERROR_PRINT) { - if (is_null($options) || is_int($options)) { - $format = "%s"; - } else { - $format = $options; - } - printf($format, $this->getMessage()); - } - if ($this->mode & PEAR_ERROR_TRIGGER) { - trigger_error($this->getMessage(), $this->level); - } - if ($this->mode & PEAR_ERROR_DIE) { - $msg = $this->getMessage(); - if (is_null($options) || is_int($options)) { - $format = "%s"; - if (substr($msg, -1) != "\n") { - $msg .= "\n"; - } - } else { - $format = $options; - } - die(sprintf($format, $msg)); - } - if ($this->mode & PEAR_ERROR_CALLBACK) { - if (is_callable($this->callback)) { - call_user_func($this->callback, $this); - } - } - if ($this->mode & PEAR_ERROR_EXCEPTION) { - trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING); - eval('$e = new Exception($this->message, $this->code);throw($e);'); - } - } - - // }}} - // {{{ getMode() - - /** - * Get the error mode from an error object. - * - * @return int error mode - * @access public - */ - function getMode() { - return $this->mode; - } - - // }}} - // {{{ getCallback() - - /** - * Get the callback function/method from an error object. - * - * @return mixed callback function or object/method array - * @access public - */ - function getCallback() { - return $this->callback; - } - - // }}} - // {{{ getMessage() - - - /** - * Get the error message from an error object. - * - * @return string full error message - * @access public - */ - function getMessage() - { - return ($this->error_message_prefix . $this->message); - } - - - // }}} - // {{{ getCode() - - /** - * Get error code from an error object - * - * @return int error code - * @access public - */ - function getCode() - { - return $this->code; - } - - // }}} - // {{{ getType() - - /** - * Get the name of this error/exception. - * - * @return string error/exception name (type) - * @access public - */ - function getType() - { - return get_class($this); - } - - // }}} - // {{{ getUserInfo() - - /** - * Get additional user-supplied information. - * - * @return string user-supplied information - * @access public - */ - function getUserInfo() - { - return $this->userinfo; - } - - // }}} - // {{{ getDebugInfo() - - /** - * Get additional debug information supplied by the application. - * - * @return string debug information - * @access public - */ - function getDebugInfo() - { - return $this->getUserInfo(); - } - - // }}} - // {{{ getBacktrace() - - /** - * Get the call backtrace from where the error was generated. - * Supported with PHP 4.3.0 or newer. - * - * @param int $frame (optional) what frame to fetch - * @return array Backtrace, or NULL if not available. - * @access public - */ - function getBacktrace($frame = null) - { - if (defined('PEAR_IGNORE_BACKTRACE')) { - return null; - } - if ($frame === null) { - return $this->backtrace; - } - return $this->backtrace[$frame]; - } - - // }}} - // {{{ addUserInfo() - - function addUserInfo($info) - { - if (empty($this->userinfo)) { - $this->userinfo = $info; - } else { - $this->userinfo .= " ** $info"; - } - } - - // }}} - // {{{ toString() - - /** - * Make a string representation of this object. - * - * @return string a string with an object summary - * @access public - */ - function toString() { - $modes = array(); - $levels = array(E_USER_NOTICE => 'notice', - E_USER_WARNING => 'warning', - E_USER_ERROR => 'error'); - if ($this->mode & PEAR_ERROR_CALLBACK) { - if (is_array($this->callback)) { - $callback = (is_object($this->callback[0]) ? - strtolower(get_class($this->callback[0])) : - $this->callback[0]) . '::' . - $this->callback[1]; - } else { - $callback = $this->callback; - } - return sprintf('[%s: message="%s" code=%d mode=callback '. - 'callback=%s prefix="%s" info="%s"]', - strtolower(get_class($this)), $this->message, $this->code, - $callback, $this->error_message_prefix, - $this->userinfo); - } - if ($this->mode & PEAR_ERROR_PRINT) { - $modes[] = 'print'; - } - if ($this->mode & PEAR_ERROR_TRIGGER) { - $modes[] = 'trigger'; - } - if ($this->mode & PEAR_ERROR_DIE) { - $modes[] = 'die'; - } - if ($this->mode & PEAR_ERROR_RETURN) { - $modes[] = 'return'; - } - return sprintf('[%s: message="%s" code=%d mode=%s level=%s '. - 'prefix="%s" info="%s"]', - strtolower(get_class($this)), $this->message, $this->code, - implode("|", $modes), $levels[$this->level], - $this->error_message_prefix, - $this->userinfo); - } - - // }}} -} - -/* - * Local Variables: - * mode: php - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ -?> Modified: trunk/moodle/mod/liveclassroom/README.txt =================================================================== --- trunk/moodle/mod/liveclassroom/README.txt 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/mod/liveclassroom/README.txt 2006-07-05 13:38:19 UTC (rev 41) @@ -1,4 +1,4 @@ -TODO bis: updqte this README file to make it hw4mdl specific. +TODO: updqte this README file to make it hw4mdl specific. USING THE NEW MODULE TEMPLATE ----------------------------- Deleted: trunk/moodle/mod/liveclassroom/System.php =================================================================== --- trunk/moodle/mod/liveclassroom/System.php 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/mod/liveclassroom/System.php 2006-07-05 13:38:19 UTC (rev 41) @@ -1,587 +0,0 @@ -<?php -/** - * File/Directory manipulation - * - * PHP versions 4 and 5 - * - * LICENSE: This source file is subject to version 3.0 of the PHP license - * that is available through the world-wide-web at the following URI: - * http://www.php.net/license/3_0.txt. If you did not receive a copy of - * the PHP License and are unable to obtain it through the web, please - * send a note to li...@ph... so we can mail you a copy immediately. - * - * @category pear - * @package System - * @author Tomas V.V.Cox <co...@id...> - * @copyright 1997-2006 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id$ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 0.1 - */ - -/** - * base class - */ -require_once 'PEAR.php'; -require_once 'Console/Getopt.php'; - -$GLOBALS['_System_temp_files'] = array(); - -/** -* System offers cross plattform compatible system functions -* -* Static functions for different operations. Should work under -* Unix and Windows. The names and usage has been taken from its respectively -* GNU commands. The functions will return (bool) false on error and will -* trigger the error with the PHP trigger_error() function (you can silence -* the error by prefixing a '@' sign after the function call). -* -* Documentation on this class you can find in: -* http://pear.php.net/manual/ -* -* Example usage: -* if (!@System::rm('-r file1 dir1')) { -* print "could not delete file1 or dir1"; -* } -* -* In case you need to to pass file names with spaces, -* pass the params as an array: -* -* System::rm(array('-r', $file1, $dir1)); -* -* @category pear -* @package System -* @author Tomas V.V. Cox <co...@id...> -* @copyright 1997-2006 The PHP Group -* @license http://www.php.net/license/3_0.txt PHP License 3.0 -* @version Release: 1.4.9 -* @link http://pear.php.net/package/PEAR -* @since Class available since Release 0.1 -*/ -class System -{ - /** - * returns the commandline arguments of a function - * - * @param string $argv the commandline - * @param string $short_options the allowed option short-tags - * @param string $long_options the allowed option long-tags - * @return array the given options and there values - * @access private - */ - function _parseArgs($argv, $short_options, $long_options = null) - { - if (!is_array($argv) && $argv !== null) { - $argv = preg_split('/\s+/', $argv, -1, PREG_SPLIT_NO_EMPTY); - } - return Console_Getopt::getopt2($argv, $short_options); - } - - /** - * Output errors with PHP trigger_error(). You can silence the errors - * with prefixing a "@" sign to the function call: @System::mkdir(..); - * - * @param mixed $error a PEAR error or a string with the error message - * @return bool false - * @access private - */ - function raiseError($error) - { - if (PEAR::isError($error)) { - $error = $error->getMessage(); - } - trigger_error($error, E_USER_WARNING); - return false; - } - - /** - * Creates a nested array representing the structure of a directory - * - * System::_dirToStruct('dir1', 0) => - * Array - * ( - * [dirs] => Array - * ( - * [0] => dir1 - * ) - * - * [files] => Array - * ( - * [0] => dir1/file2 - * [1] => dir1/file3 - * ) - * ) - * @param string $sPath Name of the directory - * @param integer $maxinst max. deep of the lookup - * @param integer $aktinst starting deep of the lookup - * @return array the structure of the dir - * @access private - */ - - function _dirToStruct($sPath, $maxinst, $aktinst = 0) - { - $struct = array('dirs' => array(), 'files' => array()); - if (($dir = @opendir($sPath)) === false) { - System::raiseError("Could not open dir $sPath"); - return $struct; // XXX could not open error - } - $struct['dirs'][] = $sPath = realpath($sPath); // XXX don't add if '.' or '..' ? - $list = array(); - while (false !== ($file = readdir($dir))) { - if ($file != '.' && $file != '..') { - $list[] = $file; - } - } - closedir($dir); - sort($list); - if ($aktinst < $maxinst || $maxinst == 0) { - foreach($list as $val) { - $path = $sPath . DIRECTORY_SEPARATOR . $val; - if (is_dir($path) && !is_link($path)) { - $tmp = System::_dirToStruct($path, $maxinst, $aktinst+1); - $struct = array_merge_recursive($tmp, $struct); - } else { - $struct['files'][] = $path; - } - } - } - return $struct; - } - - /** - * Creates a nested array representing the structure of a directory and files - * - * @param array $files Array listing files and dirs - * @return array - * @see System::_dirToStruct() - */ - function _multipleToStruct($files) - { - $struct = array('dirs' => array(), 'files' => array()); - settype($files, 'array'); - foreach ($files as $file) { - if (is_dir($file) && !is_link($file)) { - $tmp = System::_dirToStruct($file, 0); - $struct = array_merge_recursive($tmp, $struct); - } else { - $struct['files'][] = $file; - } - } - return $struct; - } - - /** - * The rm command for removing files. - * Supports multiple files and dirs and also recursive deletes - * - * @param string $args the arguments for rm - * @return mixed PEAR_Error or true for success - * @access public - */ - function rm($args) - { - $opts = System::_parseArgs($args, 'rf'); // "f" do nothing but like it :-) - if (PEAR::isError($opts)) { - return System::raiseError($opts); - } - foreach($opts[0] as $opt) { - if ($opt[0] == 'r') { - $do_recursive = true; - } - } - $ret = true; - if (isset($do_recursive)) { - $struct = System::_multipleToStruct($opts[1]); - foreach($struct['files'] as $file) { - if (!@unlink($file)) { - $ret = false; - } - } - foreach($struct['dirs'] as $dir) { - if (!@rmdir($dir)) { - $ret = false; - } - } - } else { - foreach ($opts[1] as $file) { - $delete = (is_dir($file)) ? 'rmdir' : 'unlink'; - if (!@$delete($file)) { - $ret = false; - } - } - } - return $ret; - } - - /** - * Make directories. - * - * The -p option will create parent directories - * @param string $args the name of the director(y|ies) to create - * @return bool True for success - * @access public - */ - function mkDir($args) - { - $opts = System::_parseArgs($args, 'pm:'); - if (PEAR::isError($opts)) { - return System::raiseError($opts); - } - $mode = 0777; // default mode - foreach($opts[0] as $opt) { - if ($opt[0] == 'p') { - $create_parents = true; - } elseif($opt[0] == 'm') { - // if the mode is clearly an octal number (starts with 0) - // convert it to decimal - if (strlen($opt[1]) && $opt[1]{0} == '0') { - $opt[1] = octdec($opt[1]); - } else { - // convert to int - $opt[1] += 0; - } - $mode = $opt[1]; - } - } - $ret = true; - if (isset($create_parents)) { - foreach($opts[1] as $dir) { - $dirstack = array(); - while (!@is_dir($dir) && $dir != DIRECTORY_SEPARATOR) { - array_unshift($dirstack, $dir); - $dir = dirname($dir); - } - while ($newdir = array_shift($dirstack)) { - if (!is_writeable(dirname($newdir))) { - $ret = false; - break; - } - if (!mkdir($newdir, $mode)) { - $ret = false; - } - } - } - } else { - foreach($opts[1] as $dir) { - if (!@is_dir($dir) && !mkdir($dir, $mode)) { - $ret = false; - } - } - } - return $ret; - } - - /** - * Concatenate files - * - * Usage: - * 1) $var = System::cat('sample.txt test.txt'); - * 2) System::cat('sample.txt test.txt > final.txt'); - * 3) System::cat('sample.txt test.txt >> final.txt'); - * - * Note: as the class use fopen, urls should work also (test that) - * - * @param string $args the arguments - * @return boolean true on success - * @access public - */ - function &cat($args) - { - $ret = null; - $files = array(); - if (!is_array($args)) { - $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); - } - for($i=0; $i < count($args); $i++) { - if ($args[$i] == '>') { - $mode = 'wb'; - $outputfile = $args[$i+1]; - break; - } elseif ($args[$i] == '>>') { - $mode = 'ab+'; - $outputfile = $args[$i+1]; - break; - } else { - $files[] = $args[$i]; - } - } - if (isset($mode)) { - if (!$outputfd = fopen($outputfile, $mode)) { - $err = System::raiseError("Could not open $outputfile"); - return $err; - } - $ret = true; - } - foreach ($files as $file) { - if (!$fd = fopen($file, 'r')) { - System::raiseError("Could not open $file"); - continue; - } - while ($cont = fread($fd, 2048)) { - if (isset($outputfd)) { - fwrite($outputfd, $cont); - } else { - $ret .= $cont; - } - } - fclose($fd); - } - if (@is_resource($outputfd)) { - fclose($outputfd); - } - return $ret; - } - - /** - * Creates temporary files or directories. This function will remove - * the created files when the scripts finish its execution. - * - * Usage: - * 1) $tempfile = System::mktemp("prefix"); - * 2) $tempdir = System::mktemp("-d prefix"); - * 3) $tempfile = System::mktemp(); - * 4) $tempfile = System::mktemp("-t /var/tmp prefix"); - * - * prefix -> The string that will be prepended to the temp name - * (defaults to "tmp"). - * -d -> A temporary dir will be created instead of a file. - * -t -> The target dir where the temporary (file|dir) will be created. If - * this param is missing by default the env vars TMP on Windows or - * TMPDIR in Unix will be used. If these vars are also missing - * c:\windows\temp or /tmp will be used. - * - * @param string $args The arguments - * @return mixed the full path of the created (file|dir) or false - * @see System::tmpdir() - * @access public - */ - function mktemp($args = null) - { - static $first_time = true; - $opts = System::_parseArgs($args, 't:d'); - if (PEAR::isError($opts)) { - return System::raiseError($opts); - } - foreach($opts[0] as $opt) { - if($opt[0] == 'd') { - $tmp_is_dir = true; - } elseif($opt[0] == 't') { - $tmpdir = $opt[1]; - } - } - $prefix = (isset($opts[1][0])) ? $opts[1][0] : 'tmp'; - if (!isset($tmpdir)) { - $tmpdir = System::tmpdir(); - } - if (!System::mkDir(array('-p', $tmpdir))) { - return false; - } - $tmp = tempnam($tmpdir, $prefix); - if (isset($tmp_is_dir)) { - unlink($tmp); // be careful possible race condition here - if (!mkdir($tmp, 0700)) { - return System::raiseError("Unable to create temporary directory $tmpdir"); - } - } - $GLOBALS['_System_temp_files'][] = $tmp; - if ($first_time) { - PEAR::registerShutdownFunc(array('System', '_removeTmpFiles')); - $first_time = false; - } - return $tmp; - } - - /** - * Remove temporary files created my mkTemp. This function is executed - * at script shutdown time - * - * @access private - */ - function _removeTmpFiles() - { - if (count($GLOBALS['_System_temp_files'])) { - $delete = $GLOBALS['_System_temp_files']; - array_unshift($delete, '-r'); - System::rm($delete); - $GLOBALS['_System_temp_files'] = array(); - } - } - - /** - * Get the path of the temporal directory set in the system - * by looking in its environments variables. - * Note: php.ini-recommended removes the "E" from the variables_order setting, - * making unavaible the $_ENV array, that s why we do tests with _ENV - * - * @return string The temporal directory on the system - */ - function tmpdir() - { - if (OS_WINDOWS) { - if ($var = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : getenv('TEMP')) { - return $var; - } - if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { - return $var; - } - if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) { - return $var; - } - return getenv('SystemRoot') . '\temp'; - } - if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) { - return $var; - } - return '/tmp'; - } - - /** - * The "which" command (show the full path of a command) - * - * @param string $program The command to search for - * @param mixed $fallback Value to return if $program is not found - * - * @return mixed A string with the full path or false if not found - * @author Stig Bakken <ss...@ph...> - */ - function which($program, $fallback = false) - { - // enforce API - if (!is_string($program) || '' == $program) { - return $fallback; - } - - // available since 4.3.0RC2 - if (defined('PATH_SEPARATOR')) { - $path_delim = PATH_SEPARATOR; - } else { - $path_delim = OS_WINDOWS ? ';' : ':'; - } - // full path given - if (basename($program) != $program) { - $path_elements[] = dirname($program); - $program = basename($program); - } else { - // Honor safe mode - if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) { - $path = getenv('PATH'); - if (!$path) { - $path = getenv('Path'); // some OSes are just stupid enough to do this - } - } - $path_elements = explode($path_delim, $path); - } - - if (OS_WINDOWS) { - $exe_suffixes = getenv('PATHEXT') - ? explode($path_delim, getenv('PATHEXT')) - : array('.exe','.bat','.cmd','.com'); - // allow passing a command.exe param - if (strpos($program, '.') !== false) { - array_unshift($exe_suffixes, ''); - } - // is_executable() is not available on windows for PHP4 - $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file'; - } else { - $exe_suffixes = array(''); - $pear_is_executable = 'is_executable'; - } - - foreach ($exe_suffixes as $suff) { - foreach ($path_elements as $dir) { - $file = $dir . DIRECTORY_SEPARATOR . $program . $suff; - if ($pear_is_executable($file)) { - return $file; - } - } - } - return $fallback; - } - - /** - * The "find" command - * - * Usage: - * - * System::find($dir); - * System::find("$dir -type d"); - * System::find("$dir -type f"); - * System::find("$dir -name *.php"); - * System::find("$dir -name *.php -name *.htm*"); - * System::find("$dir -maxdepth 1"); - * - * Params implmented: - * $dir -> Start the search at this directory - * -type d -> return only directories - * -type f -> return only files - * -maxdepth <n> -> max depth of recursion - * -name <pattern> -> search pattern (bash style). Multiple -name param allowed - * - * @param mixed Either array or string with the command line - * @return array Array of found files - * - */ - function find($args) - { - if (!is_array($args)) { - $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); - } - $dir = array_shift($args); - $patterns = array(); - $depth = 0; - $do_files = $do_dirs = true; - for ($i = 0; $i < count($args); $i++) { - switch ($args[$i]) { - case '-type': - if (in_array($args[$i+1], array('d', 'f'))) { - if ($args[$i+1] == 'd') { - $do_files = false; - } else { - $do_dirs = false; - } - } - $i++; - break; - case '-name': - if (OS_WINDOWS) { - if ($args[$i+1]{0} == '\\') { - // prepend drive - $args[$i+1] = addslashes(substr(getcwd(), 0, 2) . $args[$i + 1]); - } - // escape path separators to avoid PCRE problems - $args[$i+1] = str_replace('\\', '\\\\', $args[$i+1]); - } - $patterns[] = "(" . preg_replace(array('/\./', '/\*/'), - array('\.', '.*', ), - $args[$i+1]) - . ")"; - $i++; - break; - case '-maxdepth': - $depth = $args[$i+1]; - break; - } - } - $path = System::_dirToStruct($dir, $depth); - if ($do_files && $do_dirs) { - $files = array_merge($path['files'], $path['dirs']); - } elseif ($do_dirs) { - $files = $path['dirs']; - } else { - $files = $path['files']; - } - if (count($patterns)) { - $patterns = implode('|', $patterns); - $ret = array(); - for ($i = 0; $i < count($files); $i++) { - if (preg_match("#^$patterns\$#", $files[$i])) { - $ret[] = $files[$i]; - } - } - return $ret; - } - return $files; - } -} -?> Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/mod/liveclassroom/api.php 2006-07-05 13:38:19 UTC (rev 41) @@ -43,7 +43,6 @@ require_once('System.php'); - $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; $LIVECLASSROOM_API_FUNCTION_CREATE_USER = 'function=createUser'; @@ -89,7 +88,7 @@ //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); - //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in:".dirname(__FILE__).'/cookie.txt'); + //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/mod/liveclassroom/index.php 2006-07-05 13:38:19 UTC (rev 41) @@ -28,7 +28,6 @@ /* $Id$ */ - /// This page lists all the instances of liveclassroom in a particular course require_once("../../config.php"); Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-06-30 10:00:33 UTC (rev 40) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-07-05 13:38:19 UTC (rev 41) @@ -1,4 +1,3 @@ -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ICI lib.php!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <?PHP /****************************************************************************** * * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2006-05-25 21:50:45
|
Revision: 17 Author: mgimpel Date: 2006-05-25 14:50:08 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=17&view=rev Log Message: ----------- Added copyright and GPL notice to all source code files. Modified Paths: -------------- trunk/moodle/lang/en/liveclassroom.php trunk/moodle/lang/en/voicetool.php trunk/moodle/lang/fr/liveclassroom.php trunk/moodle/lang/fr/voiceboard.php trunk/moodle/lang/fr/voicedirect.php trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/backuplib.php trunk/moodle/mod/liveclassroom/create.php trunk/moodle/mod/liveclassroom/db/mysql.php trunk/moodle/mod/liveclassroom/db/mysql.sql trunk/moodle/mod/liveclassroom/db/postgres7.php trunk/moodle/mod/liveclassroom/db/postgres7.sql trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/version.php trunk/moodle/mod/liveclassroom/view.php trunk/moodle/mod/voicetool/db/mysql.php trunk/moodle/mod/voicetool/db/mysql.sql trunk/moodle/mod/voicetool/index.php trunk/moodle/mod/voicetool/lib.php trunk/moodle/mod/voicetool/version.php trunk/moodle/mod/voicetool/view.php trunk/moodle/mod/voicetool/voicetoolapi.php Added Paths: ----------- trunk/moodle/LICENSE.txt trunk/moodle/README.txt Added: trunk/moodle/LICENSE.txt =================================================================== --- trunk/moodle/LICENSE.txt (rev 0) +++ trunk/moodle/LICENSE.txt 2006-05-25 21:50:08 UTC (rev 17) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Property changes on: trunk/moodle/LICENSE.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/moodle/README.txt =================================================================== --- trunk/moodle/README.txt (rev 0) +++ trunk/moodle/README.txt 2006-05-25 21:50:08 UTC (rev 17) @@ -0,0 +1 @@ +Horizon Wimba Moodle Integration aims at providing to the Moodle community integrations of the products developed by Horizon Wimba into Moodle. At this time, we plan to have quickly support for Live Classroom and Voice Tools Activity Modules. \ No newline at end of file Property changes on: trunk/moodle/README.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/moodle/lang/en/liveclassroom.php =================================================================== --- trunk/moodle/lang/en/liveclassroom.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/lang/en/liveclassroom.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,5 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + $string['modulename'] = 'Live Classroom'; $string['modulenameplural'] = 'Live Classrooms'; $string['serverconfiguration'] = 'Live Classroom Server Configuration'; @@ -22,7 +50,6 @@ $string['buttoncreateroom'] = 'Create Room'; $string['roomcreated'] = 'Room was successfully created'; - $string['wizard.text.1'] = 'Note: The first time that you enter the Live Classroom you will need to run the'; $string['wizard.text.2'] = 'setup wizard'; $string['wizard.text.3'] = 'in order to make sure your computer is ready.'; Modified: trunk/moodle/lang/en/voicetool.php =================================================================== --- trunk/moodle/lang/en/voicetool.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/lang/en/voicetool.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,9 +1,36 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + $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.'; @@ -17,7 +44,6 @@ $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'; @@ -26,12 +52,10 @@ $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'; - ?> Modified: trunk/moodle/lang/fr/liveclassroom.php =================================================================== --- trunk/moodle/lang/fr/liveclassroom.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/lang/fr/liveclassroom.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,5 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + $string['modulename'] = 'Live Classroom'; $string['modulenameplural'] = 'Live Classrooms'; $string['serverconfiguration'] = 'Configuration du Serveur Live Classroom'; Modified: trunk/moodle/lang/fr/voiceboard.php =================================================================== --- trunk/moodle/lang/fr/voiceboard.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/lang/fr/voiceboard.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,5 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + $string['modulename'] = 'Forum vocal'; $string['modulenameplural'] = 'Forums vocaux'; Modified: trunk/moodle/lang/fr/voicedirect.php =================================================================== --- trunk/moodle/lang/fr/voicedirect.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/lang/fr/voicedirect.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,5 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + $string['modulename'] = 'Voice Direct'; $string['modulenameplural'] = 'Voice Directs'; Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/api.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,4 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + /** * api.php - Sets up sessions, connects to LC server and so on * @@ -7,7 +36,7 @@ * * Normally this is only called by liveclassroom *lib.php files * @author Hugues Pisapia - * @version $Revision:$ + * @version $Revision$ * @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @package liveclassroom */ Modified: trunk/moodle/mod/liveclassroom/backuplib.php =================================================================== --- trunk/moodle/mod/liveclassroom/backuplib.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/backuplib.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,4 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + /// Library of functions and constants for module liveclassroom require_once($CFG->libdir.'/datalib.php'); Modified: trunk/moodle/mod/liveclassroom/create.php =================================================================== --- trunk/moodle/mod/liveclassroom/create.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/create.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,5 +1,33 @@ <?php +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + require_once('../../config.php'); require_once('lib.php'); Modified: trunk/moodle/mod/liveclassroom/db/mysql.php =================================================================== --- trunk/moodle/mod/liveclassroom/db/mysql.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/db/mysql.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,12 +1,40 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + function liveclassroom_upgrade($oldversion) { /// This function does anything necessary to upgrade /// older versions to match current functionality global $CFG; - if ($oldversion < 2003092800) { + if ($oldversion < 2006041500) { # Do something ... Modified: trunk/moodle/mod/liveclassroom/db/mysql.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/db/mysql.sql 2006-05-25 21:50:08 UTC (rev 17) @@ -1,3 +1,32 @@ +#****************************************************************************** +#* * +#* Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * +#* * +#* COPYRIGHT: * +#* This software is the property of Horizon Wimba. * +#* You can redistribute it and/or modify it under the terms of * +#* the GNU General Public License as published by the * +#* Free Software Foundation. * +#* * +#* WARRANTIES: * +#* This software is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU General Public License for more details. * +#* * +#* You should have received a copy of the GNU General Public License * +#* along with the Horizon Wimba Moodle Integration; * +#* if not, write to the Free Software Foundation, Inc., * +#* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * +#* * +#* Author: Hugues Pisapia * +#* * +#* Date: 15th April 2006 * +#* * +#****************************************************************************** + +# $Id$ + # This file contains a complete database schema for all the # tables used by this module, written in SQL Modified: trunk/moodle/mod/liveclassroom/db/postgres7.php =================================================================== --- trunk/moodle/mod/liveclassroom/db/postgres7.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/db/postgres7.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,12 +1,40 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ +/* $Id$ */ + function liveclassroom_upgrade($oldversion) { /// This function does anything necessary to upgrade /// older versions to match current functionality global $CFG; - if ($oldversion < 2003092800) { + if ($oldversion < 2006041500) { # Do something ... Modified: trunk/moodle/mod/liveclassroom/db/postgres7.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-05-25 21:50:08 UTC (rev 17) @@ -1,3 +1,32 @@ +#****************************************************************************** +#* * +#* Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * +#* * +#* COPYRIGHT: * +#* This software is the property of Horizon Wimba. * +#* You can redistribute it and/or modify it under the terms of * +#* the GNU General Public License as published by the * +#* Free Software Foundation. * +#* * +#* WARRANTIES: * +#* This software is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU General Public License for more details. * +#* * +#* You should have received a copy of the GNU General Public License * +#* along with the Horizon Wimba Moodle Integration; * +#* if not, write to the Free Software Foundation, Inc., * +#* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * +#* * +#* Author: Hugues Pisapia * +#* * +#* Date: 15th April 2006 * +#* * +#****************************************************************************** + +# $Id$ + # This file contains a complete database schema for all the # tables used by this module, written in SQL Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/index.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,8 +1,35 @@ -<?PHP // $Id$ +<?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ -/// This page lists all the instances of NEWMODULE in a particular course -/// Replace NEWMODULE with the name of your module +/* $Id$ */ +/// This page lists all the instances of liveclassroom in a particular course + require_once("../../config.php"); require_once("lib.php"); Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,4 +1,33 @@ <?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * * + ******************************************************************************/ + +/* $Id$ */ + /// Library of functions and constants for module liveclassroom require_once($CFG->libdir.'/datalib.php'); Modified: trunk/moodle/mod/liveclassroom/version.php =================================================================== --- trunk/moodle/mod/liveclassroom/version.php 2006-05-25 21:27:11 UTC (rev 16) +++ trunk/moodle/mod/liveclassroom/version.php 2006-05-25 21:50:08 UTC (rev 17) @@ -1,11 +1,39 @@ -<?PHP // $Id$ +<?PHP +/****************************************************************************** + * * + * Copyright (c) 1999-2006 Horizon Wimba, All Rights Reserved. * + * * + * COPYRIGHT: * + * This software is the property of Horizon Wimba. * + * You can redistribute it and/or modify it under the terms of * + * the GNU General Public License as published by the * + * Free Software Foundation. * + * * + * WARRANTIES: * + * This software is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with the Horizon Wimba Moodle Integration; * + * if not, write to the Free Software Foundation, Inc., * + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * + * * + * Author: Hugues Pisapia * + * * + * Date: 15th April 2006 * + * ... [truncated message content] |
From: <mg...@us...> - 2006-05-25 21:27:41
|
Revision: 16 Author: mgimpel Date: 2006-05-25 14:27:11 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=16&view=rev Log Message: ----------- Set subversion properties (keywords, mime-types, ...) Modified Paths: -------------- trunk/moodle/lang/fr/voiceboard.php trunk/moodle/lang/fr/voicedirect.php trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/version.php trunk/moodle/mod/voicetool/version.php trunk/moodle/mod/voicetool/view.php Property Changed: ---------------- trunk/moodle/lang/en/liveclassroom.php trunk/moodle/lang/en/voicetool.php trunk/moodle/lang/fr/liveclassroom.php trunk/moodle/lang/fr/voiceboard.php trunk/moodle/lang/fr/voicedirect.php trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/backuplib.php trunk/moodle/mod/liveclassroom/create.php trunk/moodle/mod/liveclassroom/db/mysql.php trunk/moodle/mod/liveclassroom/db/mysql.sql trunk/moodle/mod/liveclassroom/db/postgres7.php trunk/moodle/mod/liveclassroom/db/postgres7.sql trunk/moodle/mod/liveclassroom/index.php trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/version.php trunk/moodle/mod/liveclassroom/view.php trunk/moodle/mod/voicetool/db/mysql.php trunk/moodle/mod/voicetool/index.php trunk/moodle/mod/voicetool/lib.php trunk/moodle/mod/voicetool/version.php trunk/moodle/mod/voicetool/view.php trunk/moodle/mod/voicetool/voicetoolapi.php Property changes on: trunk/moodle/lang/en/liveclassroom.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/lang/en/voicetool.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/lang/fr/liveclassroom.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/lang/fr/voiceboard.php =================================================================== --- trunk/moodle/lang/fr/voiceboard.php 2006-05-12 09:27:58 UTC (rev 15) +++ trunk/moodle/lang/fr/voiceboard.php 2006-05-25 21:27:11 UTC (rev 16) @@ -1,13 +1,13 @@ -<?PHP - -$string['modulename'] = 'Forum vocal'; -$string['modulenameplural'] = 'Forums vocaux'; - -$string['title'] = 'Titre'; -$string['description'] = 'Description'; -$string['basicquality'] = 'Qualité de base (qualité telephonique) - 8 kbit/s - Usage bas-débit/modem'; -$string['standardquality'] = 'Qualité Standard - 12.8 kbit/s - Usage bas-débit/modem'; -$string['goodquality'] = 'Bonne Qualité (qualité Radio) - 20.8 kbit/s - Usage haut-débit/ADSL'; -$string['audioquality'] = 'Qualité Audio'; - -?> +<?PHP + +$string['modulename'] = 'Forum vocal'; +$string['modulenameplural'] = 'Forums vocaux'; + +$string['title'] = 'Titre'; +$string['description'] = 'Description'; +$string['basicquality'] = 'Qualité de base (qualité telephonique) - 8 kbit/s - Usage bas-débit/modem'; +$string['standardquality'] = 'Qualité Standard - 12.8 kbit/s - Usage bas-débit/modem'; +$string['goodquality'] = 'Bonne Qualité (qualité Radio) - 20.8 kbit/s - Usage haut-débit/ADSL'; +$string['audioquality'] = 'Qualité Audio'; + +?> Property changes on: trunk/moodle/lang/fr/voiceboard.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/lang/fr/voicedirect.php =================================================================== --- trunk/moodle/lang/fr/voicedirect.php 2006-05-12 09:27:58 UTC (rev 15) +++ trunk/moodle/lang/fr/voicedirect.php 2006-05-25 21:27:11 UTC (rev 16) @@ -1,15 +1,15 @@ -<?PHP - -$string['modulename'] = 'Voice Direct'; -$string['modulenameplural'] = 'Voice Directs'; - -$string['title'] = 'Titre'; -$string['description'] = 'Description'; -$string['basicquality'] = 'Qualité de base (qualité telephonique) - 8 kbit/s - Usage bas-débit/modem'; -$string['standardquality'] = 'Qualité Standard - 12.8 kbit/s - Usage bas-débit/modem'; -$string['goodquality'] = 'Bonne Qualité (qualité Radio) - 20.8 kbit/s - Usage haut-débit/ADSL'; -$string['audioquality'] = 'Qualité Audio'; - -$string['archivesession'] = 'Sessions Archivé'; - -?> +<?PHP + +$string['modulename'] = 'Voice Direct'; +$string['modulenameplural'] = 'Voice Directs'; + +$string['title'] = 'Titre'; +$string['description'] = 'Description'; +$string['basicquality'] = 'Qualité de base (qualité telephonique) - 8 kbit/s - Usage bas-débit/modem'; +$string['standardquality'] = 'Qualité Standard - 12.8 kbit/s - Usage bas-débit/modem'; +$string['goodquality'] = 'Bonne Qualité (qualité Radio) - 20.8 kbit/s - Usage haut-débit/ADSL'; +$string['audioquality'] = 'Qualité Audio'; + +$string['archivesession'] = 'Sessions Archivé'; + +?> Property changes on: trunk/moodle/lang/fr/voicedirect.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/api.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/backuplib.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/create.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/db/mysql.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/db/mysql.sql ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/db/postgres7.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/db/postgres7.sql ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/mod/liveclassroom/index.php =================================================================== --- trunk/moodle/mod/liveclassroom/index.php 2006-05-12 09:27:58 UTC (rev 15) +++ trunk/moodle/mod/liveclassroom/index.php 2006-05-25 21:27:11 UTC (rev 16) @@ -1,4 +1,4 @@ -<?PHP // $Id: index.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ +<?PHP // $Id$ /// This page lists all the instances of NEWMODULE in a particular course /// Replace NEWMODULE with the name of your module Property changes on: trunk/moodle/mod/liveclassroom/index.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/lib.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/mod/liveclassroom/version.php =================================================================== --- trunk/moodle/mod/liveclassroom/version.php 2006-05-12 09:27:58 UTC (rev 15) +++ trunk/moodle/mod/liveclassroom/version.php 2006-05-25 21:27:11 UTC (rev 16) @@ -1,4 +1,4 @@ -<?PHP // $Id: version.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ +<?PHP // $Id$ ///////////////////////////////////////////////////////////////////////////////// /// Code fragment to define the version of NEWMODULE Property changes on: trunk/moodle/mod/liveclassroom/version.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/liveclassroom/view.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/voicetool/db/mysql.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/voicetool/index.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/voicetool/lib.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/mod/voicetool/version.php =================================================================== --- trunk/moodle/mod/voicetool/version.php 2006-05-12 09:27:58 UTC (rev 15) +++ trunk/moodle/mod/voicetool/version.php 2006-05-25 21:27:11 UTC (rev 16) @@ -1,4 +1,4 @@ -<?PHP // $Id: version.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ +<?PHP // $Id$ ///////////////////////////////////////////////////////////////////////////////// /// Code fragment to define the version of NEWMODULE Property changes on: trunk/moodle/mod/voicetool/version.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/mod/voicetool/view.php =================================================================== --- trunk/moodle/mod/voicetool/view.php 2006-05-12 09:27:58 UTC (rev 15) +++ trunk/moodle/mod/voicetool/view.php 2006-05-25 21:27:11 UTC (rev 16) @@ -1,4 +1,4 @@ -<?PHP // $Id: view.php,v 1.1 2003/09/30 02:45:19 moodler Exp $ +<?PHP // $Id$ /// This page prints a particular instance of voicedirect /// (Replace voicedirect with the name of your module) Property changes on: trunk/moodle/mod/voicetool/view.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Property changes on: trunk/moodle/mod/voicetool/voicetoolapi.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native 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: <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-05 08:13:52
|
Revision: 13 Author: hugues Date: 2006-05-05 01:13:48 -0700 (Fri, 05 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=13&view=rev Log Message: ----------- reorganization of the Voice Tools Removed Paths: ------------- trunk/moodle/mod/voiceboard/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-05-05 07:59:56
|
Revision: 12 Author: hugues Date: 2006-05-05 00:59:51 -0700 (Fri, 05 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=12&view=rev Log Message: ----------- Some more fundtion documentation Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-05-04 20:20:58 UTC (rev 11) +++ trunk/moodle/mod/liveclassroom/api.php 2006-05-05 07:59:51 UTC (rev 12) @@ -364,7 +364,4 @@ } return true; } - - - ?> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-05-04 20:20:58 UTC (rev 11) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-05-05 07:59:51 UTC (rev 12) @@ -240,7 +240,34 @@ +/** + * Return the id of liveclassroom activities in this course + * @param string the courseid + * @return array the activity ids of classrooms links available for this course + */ + function liveclassroom_ids($courseid) { + return array (); + } +/** + * Counts the number of rooms available for this course + * @param string the courseid + * @return string the numlber of classrooms available for this course + */ + function liveclassroom_count_rooms($courseid) { + return '0'; + } +/** + * Counts the number of archives available for this course + * @param string the courseid + * @return string the number of archives available for this course + */ + function liveclassroom_count_archives($courseid) { + return '0'; + } + + + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-05-04 20:21:08
|
Revision: 11 Author: hugues Date: 2006-05-04 13:20:58 -0700 (Thu, 04 May 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=11&view=rev Log Message: ----------- - Fixed the cookie bug (I think) as it's creating it's own temporary file - Fixed a problem when clicking on exit in the admin tools - Implemented a validation of the parameters in the config page Modified Paths: -------------- trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/config.html trunk/moodle/mod/liveclassroom/lib.php trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/api.php 2006-05-04 20:20:58 UTC (rev 11) @@ -1,7 +1,18 @@ <?PHP -// This is the API to authenticate and perform transactions with the Live cLassroom server -// All functions here should start with liveclassroom_api_ +/** + * api.php - Sets up sessions, connects to LC server and so on + * + * This is the API to authenticate and perform transactions with the Live cLassroom server + * All functions here should start with liveclassroom_api_ + * + * Normally this is only called by liveclassroom *lib.php files + * @author Hugues Pisapia + * @version $Revision:$ + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License + * @package liveclassroom + */ +require_once('System.php'); $LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; $LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; @@ -12,34 +23,54 @@ $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; -// Creates a CURL session with the liveclassroom server -// It returns the CURL handle incase of success, false otherwise. -function liveclassroom_api_authenticate () { + +/** + * Creates a CURL session with the Live Classroom server. Upon success, it + * returns a CURL Handle authenticated and ready for use. It returns false + * otherwise. + * + * If the $servername param is the empty string, the function will collect + * the data from $CFG->liveclassroom_* + * + * @param string $servername + * @param string $login + * @param string $password + * @return object - a CURL Handle authenticated and ready for use, false otherwise + * @uses CFG, LIVECLASSROOM_API_ADMIN, LIVECLASSROOM_API_FUNCTION_NOOP + */ +function liveclassroom_api_authenticate ($servername='', $login='', $passwd='') { global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_NOOP; + + if (empty($servername)) { // feed them with $CFG + $servername = $CFG->liveclassroom_servername; + $login = $CFG->liveclassroom_adminusername; + $passwd = $CFG->liveclassroom_adminpassword; + } - $url = $CFG->liveclassroom_servername. + $url = $servername. $LIVECLASSROOM_API_ADMIN. $LIVECLASSROOM_API_FUNCTION_NOOP. "&AuthType=AuthCookieHandler". "&AuthName=Horizon". - "&credential_0=". $CFG->liveclassroom_adminusername. - "&credential_1=". $CFG->liveclassroom_adminpassword; + "&credential_0=". $login. + "&credential_1=". $passwd; //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); + + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); - curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt'); # XXX: cookiejar needs to be configurable? + curl_setopt($ch, CURLOPT_COOKIEJAR, System::mktemp("lc")); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - #curl_setopt($ch, CURLOPT_HEADER, 1); $data = curl_exec($ch); - #print $data; + #print_r $data; if (curl_errno($ch)) { print curl_error($ch); return false; @@ -48,7 +79,7 @@ $resp_code = $matches[0]; if ( $resp_code != 100 && $resp_code != 301) { - error( "Response: Authentication Failed: $resp_code"); + //error( "Response: Authentication Failed: $resp_code"); return false; } @@ -56,10 +87,18 @@ } +/** + * Create the Live Classroom User $user with the role $rolename. This function + * actually creates profiles that will further be used for teacher/student + * roles. + * + * @uses CFG, LIVECLASSROOM_API_ADMIN, LIVECLASSROOM_API_FUNCTION_CREATE_USER + * @param $userid string - LC login for this profile + * @param $coursename string - LC first name for this profile. We use the couse name + * @param $rolename string - LC lastname of this profile. Usually 'Teacher' or 'Student' + * @return bool - true if the user is successfuly created, false otherwise + */ function liveclassroom_api_create_user ($userid, $coursename, $rolename) { -// Creating users as per design recommendations in -// http://wiki.horizonwimba.com/wiki/index.php/LC_Integration_Design_Guidelines#Click_on_Live_Classroom_tool_link -// global $CFG; global $LIVECLASSROOM_API_ADMIN; global $LIVECLASSROOM_API_FUNCTION_CREATE_USER; @@ -97,9 +136,16 @@ return true; } +/** + * Returns a session id (hzA) to be inserted in URLs to access the LC server + * @uses CFG, USER + * @uses LIVECLASSROOM_API_ADMIN, LIVECLASSROOM_API_FUNCTION_GET_TOKEN + * @param $userid string - the userid/login of the profile to be used + * @param $nickname string - the name of the user that will be displayed in the LC + * @return string - the session token (hzA) if the request was successful, + * false otherwise. + */ function liveclassroom_api_get_session ($userid, $nickname) { - // Returns a session id (token) for this userId - // global $CFG; global $USER; global $LIVECLASSROOM_API_ADMIN; Modified: trunk/moodle/mod/liveclassroom/config.html =================================================================== --- trunk/moodle/mod/liveclassroom/config.html 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/config.html 2006-05-04 20:20:58 UTC (rev 11) @@ -1,5 +1,6 @@ <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" > @@ -13,7 +14,7 @@ <tr valign="top"> <td align="right"><?php print_string('servername', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> + <input name="servername" type="text" size="30" value="<?php p($CFG->liveclassroom_servername) ?>" /> </td> <td> <?php print_string("configservername", "liveclassroom") ?> @@ -22,7 +23,7 @@ <tr valign="top"> <td align="right"><?php print_string('adminusername', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_adminusername" type="text" size="20" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> + <input name="adminusername" type="text" size="20" value="<?php p($CFG->liveclassroom_adminusername) ?>" /> </td> <td> <?php print_string("configadminusername", "liveclassroom") ?> @@ -31,7 +32,7 @@ <tr valign="top"> <td align="right"><?php print_string('adminpassword', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_adminpassword" type="text" size="20" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> + <input name="adminpassword" type="text" size="20" value="<?php p($CFG->liveclassroom_adminpassword) ?>" /> </td> <td> <?php print_string("configadminpassword", "liveclassroom") ?> @@ -40,7 +41,7 @@ <tr valign="top"> <td align="right"><?php print_string('settinguniqueid', 'liveclassroom')?>:</td> <td> - <input name="liveclassroom_settinguniqueid" type="text" size="20" value="<?php p($CFG->liveclassroom_settinguniqueid) ?>" /> + <input name="settinguniqueid" type="text" size="20" value="<?php p($CFG->liveclassroom_settinguniqueid) ?>" /> </td> <td> <?php print_string("configsettinguniqueid", "liveclassroom") ?> Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-05-04 20:20:58 UTC (rev 11) @@ -10,6 +10,28 @@ + +/** + * Validate the data in passed in the configuration page + * @param $config - the information from the form mod.html + * @return nothing, but returns an error if the configuration is wrong + */ +function liveclassroom_process_options ($config) { + global $CFG; + + if (!liveclassroom_api_authenticate($config->servername, + $config->adminusername, + $config->adminpassword)) { + error (get_string('wrongconfiguration', 'liveclassroom'), + "$CFG->wwwroot/admin/module.php?module=liveclassroom"); + } + + //TODO: check the user is really an admin + + return; +} + + function liveclassroom_add_instance($liveclassroom) { /// Given an object containing all the necessary data, /// (defined by the form in mod.html) this function Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-04-21 19:35:50 UTC (rev 10) +++ trunk/moodle/mod/liveclassroom/view.php 2006-05-04 20:20:58 UTC (rev 11) @@ -63,6 +63,7 @@ /// Print the main part of the page ?> +<!--script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch-7892.js'></script--> <script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.js'></script> <script type="text/javascript"> function doOpenAdmin(url) { @@ -97,7 +98,7 @@ ?> <tr> <td> - <a href="javascript:doOpenAdmin('<?php p($CFG->liveclassroom_servername)?>/admin/?hzA=<?php p($usersession)?>')"> + <a href="javascript:doOpenAdmin('<?php p($CFG->liveclassroom_servername)?>/admin/?hzA=<?php p($usersession)?>&closeOnExit=1')"> <?php p(get_string('managerooms', 'liveclassroom')) ?> </a> </td> 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-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 08:26:32
|
Revision: 8 Author: hugues Date: 2006-04-21 01:26:27 -0700 (Fri, 21 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=8&view=rev Log Message: ----------- removing debugging stuff Modified Paths: -------------- trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-04-20 14:50:17 UTC (rev 7) +++ trunk/moodle/mod/liveclassroom/view.php 2006-04-21 08:26:27 UTC (rev 8) @@ -63,16 +63,13 @@ /// Print the main part of the page ?> -<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch-7892.js'></script> +<script type="text/javascript" src='<?PHP p($CFG->liveclassroom_servername)?>/js/launch.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() { - 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"> @@ -90,8 +87,7 @@ </td></tr> <tr> <td> - <!--a href="javascript:myStartHorizon()"--> - <a href="javascript:startHorizon()"> + <a href="javascript:startHorizon(null,null,null,null,null,'hzA=<?php p($usersession)?>')"> <?php p(get_string("accessrooms", 'liveclassroom')) ?> </a> </td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-04-20 14:50:23
|
Revision: 7 Author: hugues Date: 2006-04-20 07:50:17 -0700 (Thu, 20 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=7&view=rev Log Message: ----------- Postgresql stuff for the LC Added Paths: ----------- trunk/moodle/mod/liveclassroom/db/postgres7.php trunk/moodle/mod/liveclassroom/db/postgres7.sql Added: trunk/moodle/mod/liveclassroom/db/postgres7.php =================================================================== --- trunk/moodle/mod/liveclassroom/db/postgres7.php (rev 0) +++ trunk/moodle/mod/liveclassroom/db/postgres7.php 2006-04-20 14:50:17 UTC (rev 7) @@ -0,0 +1,18 @@ +<?PHP + +function liveclassroom_upgrade($oldversion) { +/// This function does anything necessary to upgrade +/// older versions to match current functionality + + global $CFG; + + if ($oldversion < 2003092800) { + + # Do something ... + + } + + return true; +} + +?> Added: trunk/moodle/mod/liveclassroom/db/postgres7.sql =================================================================== --- trunk/moodle/mod/liveclassroom/db/postgres7.sql (rev 0) +++ trunk/moodle/mod/liveclassroom/db/postgres7.sql 2006-04-20 14:50:17 UTC (rev 7) @@ -0,0 +1,18 @@ +# This file contains a complete database schema for all the +# tables used by this module, written in SQL + +# It may also contain INSERT statements for particular data +# that may be used, especially new entries in the table log_display + +CREATE TABLE prefix_liveclassroom ( + id SERIAL PRIMARY KEY, + course integer NOT NULL default '0', + name varchar(255) NOT NULL default '', + timemodified integer NOT NULL default '0' +); + +CREATE INDEX prefix_liveclassroom_course_idx ON prefix_liveclassroom (course); +# -------------------------------------------------------- + +# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'view', 'liveclassroom', 'name'); +# INSERT INTO prefix_log_display VALUES ('liveclassroom', 'add', 'liveclassroom', 'name'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2006-04-20 05:56:43
|
Revision: 6 Author: hugues Date: 2006-04-19 22:56:39 -0700 (Wed, 19 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=6&view=rev Log Message: ----------- reverted the LC view to the previous version Modified Paths: -------------- trunk/moodle/mod/liveclassroom/view.php Modified: trunk/moodle/mod/liveclassroom/view.php =================================================================== --- trunk/moodle/mod/liveclassroom/view.php 2006-04-20 05:55:30 UTC (rev 5) +++ trunk/moodle/mod/liveclassroom/view.php 2006-04-20 05:56:39 UTC (rev 6) @@ -71,7 +71,6 @@ } function myStartHorizon() { - document.cookie="request_uri=; path=/" startHorizon(null,null,null,null,null,'hzA=<?php p($usersession)?>'); } </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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-18 14:40:14
|
Revision: 4 Author: hugues Date: 2006-04-18 07:40:02 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=4&view=rev Log Message: ----------- I missed this file :] Added Paths: ----------- trunk/moodle/mod/liveclassroom/api.php Added: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php (rev 0) +++ trunk/moodle/mod/liveclassroom/api.php 2006-04-18 14:40:02 UTC (rev 4) @@ -0,0 +1,324 @@ +<?PHP +// This is the API to authenticate and perform transactions with the Live cLassroom server +// All functions here should start with liveclassroom_api_ + + +$LIVECLASSROOM_API_ADMIN = '/admin/api/api.pl?'; +$LIVECLASSROOM_API_FUNCTION_NOOP = 'function=NOOP'; +$LIVECLASSROOM_API_FUNCTION_CREATE_USER = 'function=createUser'; +$LIVECLASSROOM_API_FUNCTION_GET_TOKEN = 'function=getAuthToken'; +$LIVECLASSROOM_API_FUNCTION_CREATE_CLASS = 'function=createClass'; +$LIVECLASSROOM_API_FUNCTION_CREATE_ROLE = 'function=createRole'; +$LIVECLASSROOM_API_FUNCTION_DELETE_ROLE = 'function=deleteRole'; + + +// Creates a CURL session with the liveclassroom server +// It returns the CURL handle incase of success, false otherwise. +function liveclassroom_api_authenticate () { + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_NOOP; + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_NOOP. + "&AuthType=AuthCookieHandler". + "&AuthName=Horizon". + "&credential_0=". $CFG->liveclassroom_adminusername. + "&credential_1=". $CFG->liveclassroom_adminpassword; + + + //add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url"); + //add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt'); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL,$url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_TIMEOUT, 4); + curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt'); # XXX: cookiejar needs to be configurable? + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); + #curl_setopt($ch, CURLOPT_HEADER, 1); + $data = curl_exec($ch); + #print $data; + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + preg_match("(\d*)", $data, $matches); + $resp_code = $matches[0]; + + if ( $resp_code != 100 && $resp_code != 301) { + error( "Response: Authentication Failed: $resp_code"); + return false; + } + + return $ch; +} + + +function liveclassroom_api_create_user ($userid, $coursename, $rolename) { +// Creating users as per design recommendations in +// http://wiki.horizonwimba.com/wiki/index.php/LC_Integration_Design_Guidelines#Click_on_Live_Classroom_tool_link +// + global $CFG; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_CREATE_USER; + + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_CREATE_USER. + "&target=$userid". + "&first_name=$rolename". + "&last_name=$coursename"; + + //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_user", "URL Sent: $url"); + + + curl_setopt($ch, CURLOPT_URL,$url); + $data = curl_exec($ch); + #print $data; + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100 && $respcode != 301) { + error( "Response: Account ($userId) Creation Failed: $resp_code"); + return false; + } + + return true; +} + +function liveclassroom_api_get_session ($userid, $nickname) { + // Returns a session id (token) for this userId + // + global $CFG; + global $USER; + global $LIVECLASSROOM_API_ADMIN; + global $LIVECLASSROOM_API_FUNCTION_GET_TOKEN; + + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_GET_TOKEN. + "&target=$userid". + "&nickname=$nickname"; + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_session", "URL Sent: $url"); + + curl_setopt($ch, CURLOPT_URL,$url); + $data = curl_exec($ch); + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_session", "DATA: <pre>$data</pre>"); + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + //error( "Response: Cannot Create Session: $resp_code"); + return false; + } + + $currentline = strtok($data,"\n"); + while (!empty($currentline) && !preg_match("/authToken=/", $currentline, $matches)) { + $currentline = strtok("\n"); + } + + if (empty($currentline)) { + //error ("Did not find authToken, data=<pre>$data</pre>"); + return false; + } + + $authtoken= substr($currentline, 10); + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_get_session", "AuthToken: '$authtoken'"); + + if (empty($authtoken)) { + //error ("Token empty, data=<pre>$data</pre>"); + return false; + } + + return $authtoken; +} + + +function liveclassroom_api_create_class ($roomid, $roomname) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS; + + + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_CREATE_CLASS. + "&target=$roomid". + "&longname=$roomname"; + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "URL Sent: $url"); + + curl_setopt($ch, CURLOPT_URL,$url); + $data = curl_exec($ch); + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>"); + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); + return false; + } + return true; +} + +function liveclassroom_api_add_user_role ($roomid, $userid, $role) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE; + + + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_CREATE_ROLE. + "&target=$roomid". + "&user_id=$userid". + "&role_id=$role"; + + //DEBUG + add_to_log("", "liveclassroom", "", "liveclassroom_api_add_user_role", "URL Sent: $url"); + + curl_setopt($ch, CURLOPT_URL,$url); + $data = curl_exec($ch); + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>"); + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); + return false; + } + return true; +} + + +function liveclassroom_api_remove_user_role ($roomid, $userid, $role) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE; + + + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE. + "&target=$roomid". + "&user_id=$userid". + "&role_id=$role"; + + //DEBUG + add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_user_role", "URL Sent: $url"); + + curl_setopt($ch, CURLOPT_URL,$url); + $data = curl_exec($ch); + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>"); + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); + return false; + } + return true; +} + +function liveclassroom_api_remove_group_role ($roomid, $groupid, $role) { + global $CFG; + global $LIVECLASSROOM_API_ADMIN, + $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE; + + if (!$ch = liveclassroom_api_authenticate()) { + return false; + } + + $url = $CFG->liveclassroom_servername. + $LIVECLASSROOM_API_ADMIN. + $LIVECLASSROOM_API_FUNCTION_DELETE_ROLE. + "&target=$roomid". + "&group_id=$groupid". + "&role_id=$role"; + + //DEBUG + add_to_log("", "liveclassroom", "", "liveclassroom_api_remove_group_role", "URL Sent: $url"); + + curl_setopt($ch, CURLOPT_URL,$url); + $data = curl_exec($ch); + + //DEBUG + //add_to_log("", "liveclassroom", "", "liveclassroom_api_create_class", "DATA: <pre>$data</pre>"); + if (curl_errno($ch)) { + print curl_error($ch); + return false; + } + + preg_match("(\d*)", $data, $matches); + $respcode = $matches[0]; + + if ( $respcode != 100) { + //error( "Response: Cannot Create Class with id:$roomid, and name: $roomname."); + return false; + } + return true; +} + + + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2006-04-18 14:05:03
|
Revision: 3 Author: mgimpel Date: 2006-04-18 07:04:54 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=3&view=rev Log Message: ----------- Added french translation for Voice Direct Added Paths: ----------- trunk/moodle/lang/fr/voicedirect.php Added: trunk/moodle/lang/fr/voicedirect.php =================================================================== --- trunk/moodle/lang/fr/voicedirect.php (rev 0) +++ trunk/moodle/lang/fr/voicedirect.php 2006-04-18 14:04:54 UTC (rev 3) @@ -0,0 +1,15 @@ +<?PHP + +$string['modulename'] = 'Voice Direct'; +$string['modulenameplural'] = 'Voice Directs'; + +$string['title'] = 'Titre'; +$string['description'] = 'Description'; +$string['basicquality'] = 'Qualité de base (qualité telephonique) - 8 kbit/s - Usage bas-débit/modem'; +$string['standardquality'] = 'Qualité Standard - 12.8 kbit/s - Usage bas-débit/modem'; +$string['goodquality'] = 'Bonne Qualité (qualité Radio) - 20.8 kbit/s - Usage haut-débit/ADSL'; +$string['audioquality'] = 'Qualité Audio'; + +$string['archivesession'] = 'Sessions Archivé'; + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mg...@us...> - 2006-04-18 14:00:30
|
Revision: 2 Author: mgimpel Date: 2006-04-18 07:00:18 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/hw4mdl/?rev=2&view=rev Log Message: ----------- Added french translation for Voice Boards Modified Paths: -------------- trunk/moodle/lang/en/voiceboard.php Added Paths: ----------- trunk/moodle/lang/fr/voiceboard.php Modified: trunk/moodle/lang/en/voiceboard.php =================================================================== --- trunk/moodle/lang/en/voiceboard.php 2006-04-15 12:07:23 UTC (rev 1) +++ trunk/moodle/lang/en/voiceboard.php 2006-04-18 14:00:18 UTC (rev 2) @@ -1,16 +1,16 @@ -<?PHP - -$string['modulename'] = 'Voice Board'; -$string['modulenameplural'] = 'Voice Boardss'; - - -$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'; - - - -?> +<?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'; + + + +?> Added: trunk/moodle/lang/fr/voiceboard.php =================================================================== --- trunk/moodle/lang/fr/voiceboard.php (rev 0) +++ trunk/moodle/lang/fr/voiceboard.php 2006-04-18 14:00:18 UTC (rev 2) @@ -0,0 +1,13 @@ +<?PHP + +$string['modulename'] = 'Forum vocal'; +$string['modulenameplural'] = 'Forums vocaux'; + +$string['title'] = 'Titre'; +$string['description'] = 'Description'; +$string['basicquality'] = 'Qualité de base (qualité telephonique) - 8 kbit/s - Usage bas-débit/modem'; +$string['standardquality'] = 'Qualité Standard - 12.8 kbit/s - Usage bas-débit/modem'; +$string['goodquality'] = 'Bonne Qualité (qualité Radio) - 20.8 kbit/s - Usage haut-débit/ADSL'; +$string['audioquality'] = 'Qualité Audio'; + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |