[Hw4mdl-svn] SF.net SVN: hw4mdl: [153] trunk/moodle/mod/voicetool
Brought to you by:
jhlinder,
trollinger
From: <sh...@us...> - 2006-12-29 16:03:28
|
Revision: 153 http://svn.sourceforge.net/hw4mdl/?rev=153&view=rev Author: shazan Date: 2006-12-29 08:03:27 -0800 (Fri, 29 Dec 2006) Log Message: ----------- latest version for Voice Tools, integrate a part of the integration, form and list Modified Paths: -------------- trunk/moodle/mod/voicetool/config.html trunk/moodle/mod/voicetool/css/StyleSheet.css trunk/moodle/mod/voicetool/db/mysql.sql trunk/moodle/mod/voicetool/displayChoicePage.php trunk/moodle/mod/voicetool/generateListPanel.php trunk/moodle/mod/voicetool/index.php trunk/moodle/mod/voicetool/lib.php trunk/moodle/mod/voicetool/mod.html trunk/moodle/mod/voicetool/view.php trunk/moodle/mod/voicetool/welcome.php Added Paths: ----------- trunk/moodle/mod/voicetool/api.php trunk/moodle/mod/voicetool/db/postgres7.php trunk/moodle/mod/voicetool/db/postgres7.sql trunk/moodle/mod/voicetool/getXmlNewPanel.php trunk/moodle/mod/voicetool/js/Ajax.js trunk/moodle/mod/voicetool/js/constants.js trunk/moodle/mod/voicetool/js/hwCommons.js trunk/moodle/mod/voicetool/js/manageXml.js trunk/moodle/mod/voicetool/js/pngfix.js trunk/moodle/mod/voicetool/js/verifForm.js trunk/moodle/mod/voicetool/pictures/items/more-link.png Added: trunk/moodle/mod/voicetool/api.php =================================================================== --- trunk/moodle/mod/voicetool/api.php (rev 0) +++ trunk/moodle/mod/voicetool/api.php 2006-12-29 16:03:27 UTC (rev 153) @@ -0,0 +1,544 @@ +<?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$ */ +error_reporting(E_ALL); +//WebService Client. +require_once($CFG->libdir.'/soap/nusoap.php'); +//require_once($CFG->dirroot.'/lib/soap/nusoap.php'); +//require_once("$CFG->dirroot./lib/soap/nusoap.php"); +//require_once("lib.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_QUALITY_SUPERIOR = 'spx_32_q8'; //ou q10 ?? + +$VT_API_SERVICES = '/services/Broker?wsdl'; +$VT_API_CREATE_RESOURCE = 'createResource'; +$VT_API_MODIFY_RESOURCE = 'modifyResource'; +$VT_API_DELETE_RESOURCE = 'deleteResource'; +$VT_API_GET_RESOURCE = 'getResource'; +$VT_API_GET_RESOURCES = 'getResources'; +$VT_API_RESOURCE_EXISTS = 'resourceExists'; +$VT_API_CREATE_SESSION = 'createSession'; +$VT_API_ALLOWEDDOCBASE = 'isDocumentBaseAllowed'; +$VT_API_MESSAGE_EXISTS = 'messageExists'; +//------- +$VT_API_STORE_AUDIO = 'storeAudio'; + +$VT_API_GET_AUDIO = 'getAudio'; + +$VT_API_AUDIO_EXISTS = 'audioExists'; + + +/** + * 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 voicetools_api_create_resource ($resource_data) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_RESOURCE; + + // print_r($resource_data); + + // Set the WebService URL + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + // Set the parameters to send to the WebService + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $resource_data); + + //print_r($resource); + + // Call the WebService and store its result in $result. + $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource); + + // echo "create resource".'<br>'; + //print_r ($result); + + /* + if (!voicetool_api_check_result ($result)) { + + return false; + } + */ + //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 voicetools_api_modify_resource ($resource_data) { + global $CFG, + $VT_API_SERVICES, + $VT_API_MODIFY_RESOURCE; + + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_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; +} +// To CHECK !!! +function voicetools_api_message_exists ($rid, $mid) { + + global $CFG, + $VT_API_SERVICES, + $VT_API_MESSAGE_EXISTS; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $rid, + $mid); + //print_r($resource); + + $result = $soapclient->call($VT_API_MESSAGE_EXISTS, $resource); + + if (!voicetool_api_check_result ($result)) { + return false; + } + + + $res=false; + foreach ($result['values'] as $item) { + if ($item['name'] == 'exists') { + $res = $item['value']; + } + } + + return $res; + //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 voicetools_api_delete_resource ($rid) { + global $CFG, + $VT_API_SERVICES, + $VT_API_DELETE_RESOURCE; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $rid); + + $result = $soapclient->call($VT_API_DELETE_RESOURCE, $resource); + + /* + if (!voicetool_api_check_result ($result)) { + return false; + } + */ + return $result; +} + +/** + * Send an SDK request to the VT server to test if the resource exist. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_RESOURCE_EXISTS + * @param $rid - the rid of the resource to find + * @return - a boolean. true if the resource exist, false elsewhere. + */ +function voicetools_api_resource_exists ($rid) { + global $CFG, + $VT_API_SERVICES, + $VT_API_RESOURCE_EXISTS; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $rid); + + $result = $soapclient->call($VT_API_RESOURCE_EXISTS, $resource); + /* + if (!voicetool_api_check_result ($result)) { + return false; + } + */ + $res=false; + foreach ($result['values'] as $item) { + if ($item['name'] == 'exists') { + $res = $item['value']; + } + } + + return $res; +} + +/** + * Send an SDK request to the VT server to get the resource. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_GET_RESOURCE + * @param $rid - the rid of the resource to get + * @return - the object returned by the call, or false if something goes wrong. + */ +function voicetools_api_get_resource($rid) { + + global $CFG, + $VT_API_SERVICES, + $VT_API_GET_RESOURCE; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $rid); + + $result = $soapclient->call($VT_API_GET_RESOURCE, $resource); + + /* + if (!voicetool_api_check_result ($result)) { + return false; + } + */ + //pair set + return $result; +} + + +/** + * Send an SDK request to the VT server to get the resources. + * @uses CFG + * @uses VT_API_SERVICES + * @uses VT_API_GET_RESOURCES + * @param $ridtable - a table with the rid of the resources to get + * @return - an array of the objects returned by the call, or false if something goes wrong. + */ +function voicetools_api_get_resources($ridtable) { + + global $CFG, + $VT_API_SERVICES, + $VT_API_GET_RESOURCES; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $ridtable); + + $result = $soapclient->call($VT_API_GET_RESOURCES, $resource); + + /* + if (!voicetool_api_check_result ($result)) { + return false; + } + */ + //pair set + 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 voicetools_api_create_session ($voicetool) { + global $CFG, + $VT_API_SERVICES, + $VT_API_CREATE_SESSION; + + + $sessiondata = voicetools_create_session_data($voicetool); + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $sessiondata['user'], + $sessiondata['resource'], + $sessiondata['message'], + $sessiondata['rights']); + + //print_r($resource); + + $result = $soapclient->call($VT_API_CREATE_SESSION, $resource); + + echo "create session".'<br>'; + print_r ($result); + + if (!voicetools_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 voicetools_api_check_documentbase($server, $login, $password, $url) { + global $VT_API_SERVICES, + $VT_API_ALLOWEDDOCBASE; + + + $soapclient = new soap_client($server.$VT_API_SERVICES,true); + + $resource = array ($login, + $password, + $url); + + $result = $soapclient->call($VT_API_ALLOWEDDOCBASE, $resource); + +// print_r($result); + + if (!voicetools_api_check_result ($result)) { + add_to_log("", "voice tool", "", "", "result ".$result); + return voicetools_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'); +} + +function voicetools_api_audio_exists ($rid, $mid) { + + global $CFG, + $VT_API_SERVICES, + $VT_API_AUDIO_EXISTS; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $rid, + $mid); + //print_r($resource); + + $result = $soapclient->call($VT_API_AUDIO_EXISTS, $resource); + + if (!voicetools_api_check_result ($result)) { + return false; + } + + + $res=false; + foreach ($result['values'] as $item) { + if ($item['name'] == 'exists') { + $res = $item['value']; + } + } + + return $res; + //return $result; +} + +function voicetools_api_store_audio($rid, $mid, $audio, $filename) { + global $CFG, + $VT_API_SERVICES, + $VT_API_STORE_AUDIO; + + $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true); + + $resource = array ($CFG->voicetools_adminusername, + $CFG->voicetools_adminpassword, + $rid, + $mid, + $audio, + $filename); + + $result = $soapclient->call($VT_API_STORE_AUDIO, $resource); +} + +////////// Helper Function, kind of private + +/** + * 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 voicetools_api_check_result ($result) { + + + if (empty($result)){ + //error ("Empty result after call to $VT_API_SERVICES"); + error_log( "voicetool_api_check_result: Empty result after call to $VT_API_SERVICES"); + add_to_log("", "voice tool", "", "", "voicetool_api_check_result: Empty result after call to ".$VT_API_SERVICES); + return false; + } + + //$resultcode = voicetool_api_get_status_code($result); + if (voicetools_api_get_status_code($result) != 'ok') { + add_to_log("", "voice tool", "", "", "voicetool_api_check_result: not ok"); + error_log( "voicetool_api_check_result: ".voicetools_api_get_error_message($result)); + return false; + } + + return true; +} + + +/** + * Return the status code as a string + * @param array $result - the result from a soap call + * @return string - the status code returned if any, or the empty string if none is found + */ +function voicetools_api_get_status_code ($result) { + + foreach ($result['values'] as $values) { + if ($values['name'] == 'status_code') { + return $values['value']; + } + } + return ''; +} + +/** + * Return the error message as a string + * @param array $result - the result from a soap call + * @return string - the error message returned if any, or the empty string if none is found + */ +function voicetools_api_get_error_message ($result) { + foreach ($result['values'] as $values) { + if ($values['name'] == 'error_message') { + return $values['value']; + } + } + return ''; +} + +function voicetools_api_get_options($resourceid) { + + $result = voicetools_api_get_resource($resourceid) ; + + foreach ($result['groups'] as $values) { + if ($values['name'] == 'options'){ + return $values['pairSet']; + } + } + + +} + + + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +class PairSet { + var $data = array ('values' => array (), 'groups' => array ()); + + + /** + * Add a new NameValuePair in this PairSet + * @param aname - the name of the new NameValuePair + * @param avalue - the value of the new NameValuePair + */ + function addNameValuePair ($aname, $avalue) { + array_push ($this->data['values'], array('name' => $aname, 'value' => $avalue)); + } + + /** + * Add a PairSet to this PairSet + * @param - the name of the new PairSet + * @param - the PairSet to add + */ + function addPairSet ($aname, $aPairSet) { + array_push ($this->data['groups'], + array('name' => $aname, 'pairSet' => $aPairSet->getData())); + } + + /** + * @return - an associative array containing this PairSet ready for the web service call + */ + function getData () { + return $this->data; + } +} + +?> Property changes on: trunk/moodle/mod/voicetool/api.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Modified: trunk/moodle/mod/voicetool/config.html =================================================================== --- trunk/moodle/mod/voicetool/config.html 2006-12-29 13:51:23 UTC (rev 152) +++ trunk/moodle/mod/voicetool/config.html 2006-12-29 16:03:27 UTC (rev 153) @@ -1,57 +1,55 @@ -<?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"> +<input type="hidden" name="module" value="voicetools"> <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> + <div><b><?php print_string('serverconfiguration', 'voicetools')?></b></div> + <div style="font-size: 0.8em;">(<?php print_string('explainserverconfiguration', 'voicetools')?>)</div> </td> </tr> <tr valign="top"> - <td align="right"><?php print_string('servername', 'voicetool')?>:</td> + <td align="right"><?php print_string('servername', 'voicetools')?> :</td> <td> - <input name="servername" type="text" size="30" value="<?php p($CFG->voicetool_servername) ?>" /> + <input name="servername" type="text" size="30" value="<?php p($CFG->voicetools_servername) ?>" /> </td> <td> - <?php print_string('configservername', 'voicetool') ?> + <?php print_string('configservername', 'voicetools') ?> </td> </tr> <tr valign="top"> - <td align="right"><?php print_string('adminusername', 'voicetool')?>:</td> + <td align="right"><?php print_string('adminusername', 'voicetools')?> :</td> <td> - <input name="adminusername" type="text" size="20" value="<?php p($CFG->voicetool_adminusername) ?>" /> + <input name="adminusername" type="text" size="30" value="<?php p($CFG->voicetools_adminusername) ?>" /> </td> <td> - <?php print_string('configadminusername', 'voicetool') ?> + <?php print_string('configadminusername', 'voicetools') ?> </td> </tr> <tr valign="top"> - <td align="right"><?php print_string('adminpassword', 'voicetool')?>:</td> + <td align="right"><?php print_string('adminpassword', 'voicetools')?> :</td> <td> - <input name="adminpassword" type="text" size="20" value="<?php p($CFG->voicetool_adminpassword) ?>" /> + <input name="adminpassword" type="text" size="30" value="<?php p($CFG->voicetools_adminpassword) ?>" /> </td> <td> - <?php print_string('configadminpassword', 'voicetool') ?> + <?php print_string('configadminpassword', 'voicetools') ?> </td> </tr> + <tr> +<td><br /></td> +</tr> +<tr valign="top"> + <td align="right"><?php print_string('integrationversion', 'voicetools')?> :</td> + <td> + <?php print_string("integrationversionnumber", "voicetools") ?> + </td> +</tr> + +<tr> <td colspan="3" align="center"> <input type="submit" value="<?php print_string('savechanges') ?>" /></td> </tr> Modified: trunk/moodle/mod/voicetool/css/StyleSheet.css =================================================================== --- trunk/moodle/mod/voicetool/css/StyleSheet.css 2006-12-29 13:51:23 UTC (rev 152) +++ trunk/moodle/mod/voicetool/css/StyleSheet.css 2006-12-29 16:03:27 UTC (rev 153) @@ -14,6 +14,8 @@ body p, body div, body li, body li li, body input, body textarea, body select, body option ,td textarea {font-size:100%;} + + .page_title { font-family: Verdana, Arial, Helvetica, sans-serif; @@ -34,61 +36,106 @@ padding-left:2px; vertical-align:middle; } -table.tab -{ - width:100%; +.limitWidth +{ + width:160px; } -table.tab td +.alignRight { - vertical-align:top; + + } +.shiftAvailability +{ + + padding-right:50px; +} div.tab { - padding-top:2%; - padding-left:5%; + padding-top:2%; + + padding-left:5%; + padding-right:5%; display: none; height:180px; + + } +.titlePodcaster + { + color:#305060; + font-size:14pt; + padding-left:10px; + font-family:Century Gothic, Verdana, Helvetica, Arial; + font-weight:bold; + font-style:italic; + vertical-align:top; + + + } + + + .podcaster + { + padding-left:15px; + } +.button_hide +{ + + width:25px; + display:none; +} div.current_tab { - margin-top:2%; - margin-left:5%; + padding-top:2%; + + padding-left:5%; + padding-right:5%; position: relative; display: block; height:180px; + + } td.tabSelected -{ +{ + background-image:url(../pictures/tab_Select.gif); background-repeat: no-repeat; width: 78px; - font-size: 10pt; + font-size: 10px; font-family: Verdana; -} -td.tabDisabled -{ -background-image:url(../pictures/tab_disabled.gif); + } + + td.tabDisabled +{ + color:#CACACA; + background-image:url(../pictures/tab.gif); background-repeat: no-repeat; width: 78px; - font-size: 10pt; + font-size: 10px; font-family: Verdana; border-bottom:solid 1px #818181; -} + } td.tabNoSelected -{ -background-image:url(../pictures/tab.gif); +{ + + background-image:url(../pictures/tab.gif); background-repeat: no-repeat; width: 78px; - font-size: 10pt; + font-size: 10px; font-family: Verdana; border-bottom:solid 1px #818181; } + a { text-decoration:none; color:Black; } + a:hover { text-decoration:none; color:Black; } + td.action,input.action{ background-image:url(../pictures/buttons/general-empty.png); background-repeat :no-repeat; @@ -111,28 +158,44 @@ { cursor:pointer } + .alert { color:Red; } -a.room { -color:#889EB3; + + + +a.room { color:#889EB3; + text-decoration:none; display:block; width:100%; +cursor:help; + } -a.room:hover {color:#889EB3; + +a.room:hover {color:#889EB3; + + text-decoration:none; - border: none; - background-position: 3px 4px; + border: none; + + background-position: 3px 4px; + cursor:help; } + + .info a{ position:relative; /*this is the key*/ z-index:24; color:#000; text-decoration:none} + .info a:hover{z-index:25;text-decoration:underline;} + .info a span{display: none;font-size:8pt;} + .info a:hover span{ /*the span will display just on :hover state*/ font-size:8pt; display:block; @@ -140,60 +203,91 @@ top:1.5em; left:5em; width:28em; border:1px solid #FFF99F; background-color:#FFF99F; color:#000; - text-align: center} -.button_disabled a{ + text-align: center} + + + +.button_disabled { + color:#666666; font-family: Arial; text-decoration:none; font-size: 9px; - height:44px; + } -.button_disabled a:hover + + +.button_enabled a { - color:#666666; + + color:black; font-family: Arial; - text-decoration:none; + width:30px; font-size: 9px; - cursor:pointer; + } -.button_enabled a + +.separator_space { - color:black; + width:2px; +} + +.empty_space +{ + width:50px; +} + + +.button_enabled a:hover{ color:black; + font-family: Arial; - text-decoration:none; - font-size: 9px; -} -.button_enabled a:hover{ color:black; - font-family: Arial; font-size: 9px; - text-decoration: underline; - display:block; + cursor:hand; } + + + + tr.selectRoom{ background-color:red; cursor:hand; + text-decoration:none; } .divProduct { - padding-top:3px; + padding-top:3px; +padding-left:2px ; + } +.separateProduct +{ + border-top:solid 1px #C7D3E1 +} + .shortShift{ + padding-left:5px; } -.room td{ + +.room td{ + padding-left:0px ; font-family:Verdana; color:Black; font-size:10; - border-bottom:solid 1px #F3F3F3; - cursor:pointer; + + cursor:default; + text-decoration:none; } -.room label{ + +.room label{ + font-family:Verdana; color:Black; font-size:10; - border-bottom:solid 1px #F3F3F3; - cursor:pointer; + + cursor:default; + text-decoration:none; } tr.overRoom{ font-family:Verdana; @@ -201,99 +295,212 @@ font-size:11px; border-bottom:solid 1px #F3F3F3; background-color:#f0f3f5; - cursor:pointer; - cursor:hand; + + cursor:default; } -.archive{ + +.archive td{ + padding-left:2px ; font-family:Verdana; color:#666666; font-style:italic; font-size:11px; + +} + +.room td{ + padding-left:5px ; + font-family:Verdana; + color:Black; + font-size:10; border-bottom:solid 1px #F3F3F3; + cursor:default; } -.filterBar { + +.archive label{ + + font-family:Verdana; + color:Black; + font-size:10; + border-bottom:solid 1px #F3F3F3; + cursor:default; +} +.room label{ + + font-family:Verdana; + color:Black; + font-size:10; + border-bottom:solid 1px #F3F3F3; + cursor:default; +} + + + +.filterBar table{ + background-image:url("../pictures/backgrounds/filterbar.png"); height:24px; font-weight:bold ; - width:100%; + border-bottom:fine 1px #C7D3E1 } + + + .filter_enabled { font-family :Verdana; color:#333333; height:24px; - font-size:12px; + text-align:center; + font-size:10px; font-weight:bold ; } + .filter_selected { font-weight:bold ; font-family :Verdana; color:#ffffff; + text-align:center; height:24px; - font-size:12px; + font-size:10px; + } + .filter_left_enabled { background-image:url("../pictures/items/filter-enabled-left.png"); + background-repeat:no-repeat; } .filter_middle_enabled { background-image:url("../pictures/items/filter-enabled-middle.png"); font-family :Verdana; color:#ffffff; + text-align:center; height:24px; - font-size:12px; + font-size:10px; font-weight:bold ; } .filter_right_enabled { background-image:url("../pictures/items/filter-enabled-right.png"); + background-repeat:no-repeat; } +.filter_right_rollover +{ + background-image:url("../pictures/items/filter-rollover-right.png"); + background-repeat:no-repeat; +} +.noFilter +{ + background-image:none; + font-family :Verdana; + color:#333333; + text-align:center; + height:24px; + font-size:10px; + font-weight:bold ; +} +.filter_middle_rollover +{ + background-image:url("../pictures/items/filter-rollover-middle.png"); + font-family :Verdana; + color:#333333; + text-align:center; + height:24px; + font-size:10px; + font-weight:bold ; + +} +.filter_left_rollover +{ + background-image:url("../pictures/items/filter-rollover-left.png"); + background-repeat:no-repeat; +} +.filterSpace +{ + padding-left:10px; +} + .contextBar table { + padding-left:5px; + padding-right:5px; background-image:url("../pictures/backgrounds/toolbar.png"); + height:30px; - width:100% + width:100% + } + .tabBackground { background-image:url("../pictures/backgrounds/toolbar.png"); + } + .productChoice table -{ - height:72px; +{ + + border-bottom:solid 1px #F0F0F0; margin-left:10px; margin-right:10px; + } -.comment{ + + +.comment{ + font-family:Verdana; color:#555555; font-style:italic; font-size:11px; padding-left:20px; } + .subOption td { - font-family:Verdana; + + font-family:Verdana; + font-size:11px; padding-left:20px; vertical-align:top; } + .roomNameForSettings { font-family:Verdana; font-weight: bold; - font-size:12px; + font-size:12px; + + } + .hide { display:none; } +.hideAndShift + +{ + display:none; + padding-left:20px; +} .visible { display:block; } + +.visibleAndShift +{ + display:block; + padding-left:20px; +} + + + label.moreRoom { color:Navy; @@ -301,56 +508,83 @@ padding-left:20px; font-weight: bold; } + + #popup { + display:none; font-size:8pt; display:block; position:absolute; - top:50%; left:50%; + top:45%; left:45%; + color:#000; text-align: center; } + + .expand { background-color:Black; -}.headerBar table +} + + +.headerBar table { -padding:0px ; +padding-left:5px ; width:100%; +padding-right:5px ; + background-image:url("../pictures/backgrounds/headerbar.png"); height:32px; border-bottom:solid 1px Black; + } .toolBar table { + padding-left:5px ; width:100%; - padding:0px ; + background-image:url("../pictures/backgrounds/toolbar.png"); + border-bottom:solid 1px #999999; + } -.search -{ - max-width:105px; - } + .list { - height:280px; - overflow-y:scroll; + height:285px; + overflow-y:scroll; + overflow-x: hidden; + width:100%; + } -.productTitle { + + +.lineTitle{ + +padding-left:10px +} +.productTitle{ + background-color:#B0C1D5; font-family:Verdana; color:White; font-size:12px; height:16px; font-weight:bold; - cursor:default; + cursor:default; + + } .validationBar table { width:100%; height:24px ; padding:0px ; - background-color:#F0F0F0; + background-color:#F0F0F0; + border-top:solid 1px #999999 + + } .panelSettings table { @@ -359,12 +593,54 @@ display:none; width:100% } -.part td + + + .part td { + width:100%; border-bottom: #818181 1px solid; } - .messageBar + + .tooltip { - background-color:#ffff99; - } \ No newline at end of file + width:200px; + display:none; + position:absolute; + z-index:1; + background-color:#ffffd0; + padding:2px; + margin:2px; + left:0px; + top:0px; + font-family:Verdana; + font-size:8pt; + cursor:default; + } + + #error_frame { + background-color : #FFD0D0; + padding : 0; + margin : 0; + border-style : solid; + border-color: red; + border-width : 1px; + text-align : left; + vertical-align : middle; + } + + #error_title { + font-family : Verdana,Arial,Helvetica; + font-size : 12px; + font-weight : bold; + color : black; + padding : 0; + margin : 0; + text-align : left; + vertical-align : top; + } + + .message{ + + background-color:#ffff99; + } \ No newline at end of file Modified: trunk/moodle/mod/voicetool/db/mysql.sql =================================================================== --- trunk/moodle/mod/voicetool/db/mysql.sql 2006-12-29 13:51:23 UTC (rev 152) +++ trunk/moodle/mod/voicetool/db/mysql.sql 2006-12-29 16:03:27 UTC (rev 153) @@ -34,25 +34,22 @@ # that may be used, especially new entries in the table log_display -CREATE TABLE `prefix_voicetool` ( +CREATE TABLE `prefix_voicetools` ( `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 '', + `type` varchar(160) NOT NULL default '', + `section` int(10) unsigned NOT NULL default '0', + `timemodified` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`) -) COMMENT='Defines Voice Tool'; -# -------------------------------------------------------- +) COMMENT='Defines Voice Tools'; -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 (`rid`) -) COMMENT='Defines Voice Direct'; -# -------------------------------------------------------- + +CREATE TABLE `prefix_tools` ( + `rid` varchar(160) NOT NULL default '', + `name` varchar(255) NOT NULL default '', + `course` int(10) unsigned NOT NULL default '0', + `type` varchar(160) NOT NULL default '', + PRIMARY KEY (`rid`) +) COMMENT='Defines Voice Tools on the server'; \ No newline at end of file Added: trunk/moodle/mod/voicetool/db/postgres7.php =================================================================== --- trunk/moodle/mod/voicetool/db/postgres7.php (rev 0) +++ trunk/moodle/mod/voicetool/db/postgres7.php 2006-12-29 16:03:27 UTC (rev 153) @@ -0,0 +1,46 @@ +<?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 voicetools_upgrade($oldversion) { +/// This function does anything necessary to upgrade +/// older versions to match current functionality + + global $CFG; + + if ($oldversion < 2006041500) { + + # Do something ... + + } + + return true; +} + +?> Property changes on: trunk/moodle/mod/voicetool/db/postgres7.php ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Revision Author Id Name: svn:eol-style + native Added: trunk/moodle/mod/voicetool/db/postgres7.sql =================================================================== --- trunk/moodle/mod/voicetool/db/postgres7.sql (rev 0) +++ trunk/moodle/mod/voicetool/db/postgres7.sql 2006-12-29 16:03:27 UTC (rev 153) @@ -0,0 +1,54 @@ +#****************************************************************************** +#* * +#* 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 + +# It may also contain INSERT statements for particular data +# that may be used, especially new entries in the table log_display + +# -------------------------------------------------------- + +# +# Table structure for table `liveclassroom` +# + +CREATE TABLE prefix_voicetools ( + id SERIAL, + rid varchar(160) NOT NULL default '', + course integer NOT NULL default '0', + name varchar(255) NOT NULL default '', + type varchar(15) NOT NULL default '', + section integer NOT NULL default '0', + timemodified integer NOT NULL default '0', + PRIMARY KEY (id) +); + +CREATE INDEX prefix_voicetools_course_idx ON prefix_voicetools (course); + Property changes on: trunk/moodle/mod/voicetool/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/voicetool/displayChoicePage.php =================================================================== --- trunk/moodle/mod/voicetool/displayChoicePage.php 2006-12-29 13:51:23 UTC (rev 152) +++ trunk/moodle/mod/voicetool/displayChoicePage.php 2006-12-29 16:03:27 UTC (rev 153) @@ -28,8 +28,8 @@ ******************************************************************************/ /* $Id$ */ +error_reporting(E_ALL); - require_once("../../config.php"); require_once("lib.php"); // require_once("api.php"); @@ -45,7 +45,7 @@ //print_r($params); $courseid = $params['enc_course_id']; - add_to_log("", "voicetool", "view", "test", $courseid); + //add_to_log("", "voicetool", "view", "test", $courseid); // echo $courseid; /* @@ -65,110 +65,113 @@ error("ExpiredSessionException"); } */ - - $xmldoc = new DomDocument(); + if (version_compare(PHP_VERSION,'5','>=')) { + require_once($CFG->libdir.'/cas/domxml-php4-php5.php'); + } + + $xmldoc = domxml_new_doc("1.0"); - $root = $xmldoc->createElement('root'); + $root = $xmldoc->create_element('root'); - $root->appendChild(voicetool_get_session_params($xmldoc,$params)); + //$root->append_child(voicetools_get_session_params($xmldoc,$params)); - $windows = $xmldoc->createElement('windows'); + $windows = $xmldoc->create_element('windows'); //HEADER BAR - $windows->appendChild(voicetool_create_headerbar($xmldoc)); + $windows->append_child(voicetools_create_headerbar($xmldoc)); // NEW BOARD - $productChoice = $xmldoc->createElement('windowsElement'); - $productChoicetype = $xmldoc->createElement('type'); - $productChoicetype->appendChild($xmldoc->createTextNode("productChoice")); - $productChoice->appendChild($productChoicetype); + $productChoice = $xmldoc->create_element('windowsElement'); + $productChoicetype = $xmldoc->create_element('type'); + $productChoicetype->append_child($xmldoc->create_text_node("productChoice")); + $productChoice->append_child($productChoicetype); - $productChoiceElementParameters = $xmldoc->createElement("windowsElementParameters"); + $productChoiceElementParameters = $xmldoc->create_element("windowsElementParameters"); - $productInfo = $xmldoc->createElement('productInformations'); + $productInfo = $xmldoc->create_element('productInformations'); - $action = $xmldoc->createElement('action'); + $action = $xmldoc->create_element('action'); - $actionName = $xmldoc->createElement('name'); - $actionName->appendChild($xmldoc->createTextNode("gaga.php")); - $action->appendChild($actionName); + $actionName = $xmldoc->create_element('name'); + $actionName->append_child($xmldoc->create_text_node("launchNew(\"getXmlNewPanel.php\",\"Management\",\"createRoom\",\"VoiceBoard\")")); + $action->append_child($actionName); - $productParameters = $xmldoc->createElement('parameters'); - $productParameter = $xmldoc->createElement('parameter'); - $productParameter->appendChild($xmldoc->createTextNode("test=2")); - $productParameters->appendChild($productParameter); - $action->appendChild($productParameters); + $productParameters = $xmldoc->create_element('parameters'); + $productParameter = $xmldoc->create_element('parameter'); + $productParameter->append_child($xmldoc->create_text_node("test=2")); + $productParameters->append_child($productParameter); + $action->append_child($productParameters); - $productInfo->appendChild($action); + $productInfo->append_child($action); - $pictureUrl = $xmldoc->createElement('pictureUrl'); - $pictureUrl->appendChild($xmldoc->createTextNode("pictures/buttons/new-createvoiceboard.png")); - $productInfo->appendChild($pictureUrl); + $pictureUrl = $xmldoc->create_element('pictureUrl'); + $pictureUrl->append_child($xmldoc->create_text_node("pictures/buttons/new-createvoiceboard.png")); + $productInfo->append_child($pictureUrl); - $value = $xmldoc->createElement('value'); - $value->appendChild($xmldoc->createTextNode("New Board")); - $productInfo->appendChild($value); + $value = $xmldoc->create_element('value'); + $value->append_child($xmldoc->create_text_node("New Board")); + $productInfo->append_child($value); - $description = $xmldoc->createElement('description'); - $description->appendChild($xmldoc->createTextNode(get_string('newVoiceBoard', 'voicetool'))); - $productInfo->appendChild($description); + $description = $xmldoc->create_element('description'); + $description->append_child($xmldoc->create_text_node(get_string('VoiceBoardDescription', 'voicetools'))); + $productInfo->append_child($description); - $productChoiceElementParameters->appendChild($productInfo); + $productChoiceElementParameters->append_child($productInfo); - $productChoice->appendChild($productChoiceElementParameters); + $productChoice->append_child($productChoiceElementParameters); - $windows->appendChild($productChoice); + $windows->append_child($productChoice); // NEW PRESENTATION - $productPresentation = $xmldoc->createElement('windowsElement'); - $productPresentationtype = $xmldoc->createElement('type'); - $productPresentationtype->appendChild($xmldoc->createTextNode("productChoice")); - $productPresentation->appendChild($productPresentationtype); + $productPresentation = $xmldoc->create_element('windowsElement'); + $productPresentationtype = $xmldoc->create_element('type'); + $productPresentationtype->append_child($xmldoc->create_text_node("productChoice")); + $productPresentation->append_child($productPresentationtype); - $productPresentationElementParameters = $xmldoc->createElement("windowsElementParameters"); + $productPresentationElementParameters = $xmldoc->create_element("windowsElementParameters"); - $productPresentationInfo = $xmldoc->createElement('productInformations'); + $productPresentationInfo = $xmldoc->create_element('productInformations'); - $productPresentationaction = $xmldoc->createElement('action'); + $productPresentationaction = $xmldoc->create_element('action'); - $productPresentationactionName = $xmldoc->createElement('name'); - $productPresentationactionName->appendChild($xmldoc->createTextNode("gaga.php")); - $productPresentationaction->appendChild($productPresentationactionName); + $productPresentationactionName = $xmldoc->create_element('name'); + $productPresentationactionName->append_child($xmldoc->create_text_node("launchNew(\"getXmlNewPanel.php\",\"Management\",\"createRoom\",\"VoicePresentation\")")); + $productPresentationaction->append_child($productPresentationactionName); - $productPresentationproductParameters = $xmldoc->createElement('parameters'); - $productPresentationproductParameter = $xmldoc->createElement('parameter'); - $productPresentationproductParameter->appendChild($xmldoc->createTextNode("test=2")); - $productPresentationproductParameters->appendChild($productPresentationproductParameter); - $productPresentationaction->appendChild($productPresentationproductParameters); + $productPresentationproductParameters = $xmldoc->create_element('parameters'); + $productPresentationproductParameter = $xmldoc->create_element('parameter'); + $productPresentationproductParameter->append_child($xmldoc->create_text_node("test=2")); + $productPresentationproductParameters->append_child($productPresentationproductParameter); + $productPresentationaction->append_child($productPresentationproductParameters); - $productPresentationInfo->appendChild($productPresentationaction); + $productPresentationInfo->append_child($productPresentationaction); - $productPresentationpictureUrl = $xmldoc->createElement('pictureUrl'); - $productPresentationpictureUrl->appendChild($xmldoc->createTextNode("pictures/buttons/new-createvoicepresentation.png")); - $productPresentationInfo->appendChild($productPresentationpictureUrl); + $productPresentationpictureUrl = $xmldoc->create_element('pictureUrl'); + $productPresentationpictureUrl->append_child($xmldoc->create_text_node("pictures/buttons/new-createvoicepresentation.png")); + $productPresentationInfo->append_child($productPresentationpictureUrl); - $productPresentationvalue = $xmldoc->createElement('value'); - $productPresentationvalue->appendChild($xmldoc->createTextNode("New Presentation")); - $productPresentationInfo->appendChild($productPresentationvalue); + $productPresentationvalue = $xmldoc->create_element('value'); + $productPresentationvalue->append_child($xmldoc->create_text_node("New Presentation")); + $productPresentationInfo->append_child($productPresentationvalue); - $productPresentationdescription = $xmldoc->createElement('description'); - $productPresentationdescription->appendChild($xmldoc->createTextNode(get_string('newVoicePresentation', 'voicetool'))); - $productPresentationInfo->appendChild($productPresentationdescription); + $productPresentationdescription = $xmldoc->create_element('description'); + $productPresentationdescription->append_child($xmldoc->create_text_node(get_string('VoicePresentationDescription', 'voicetools'))); + $productPresentationInfo->append_child($productPresentationdescription); - $productPresentationElementParameters->appendChild($productPresentationInfo); + $productPresentationElementParameters->append_child($productPresentationInfo); - $productPresentation->appendChild($productPresentationElementParameters); + $productPresentation->append_child($productPresentationElementParameters); //--------- - $windows->appendChild($productPresentation); + $windows->append_child($productPresentation); - $root->appendChild($windows); + $root->append_child($windows); - $xmldoc->appendChild($root); - $xmldoc->save('choice.xml'); + $xmldoc->append_child($root); + $xmldoc->dump_file('choice.xml'); - $xmlstring = $xmldoc->saveXML(); // Xml datas into a string + $xmlstring = $xmldoc->dump_mem(true); // Xml datas into a string $finalstring = str_replace("\n", '', $xmlstring); echo $xmlstring; Modified: trunk/moodle/mod/voicetool/generateListPanel.php =================================================================== --- trunk/moodle/mod/voicetool/generateListPanel.php 2006-12-29 13:51:23 UTC (rev 152) +++ trunk/moodle/mod/voicetool/generateListPanel.php 2006-12-29 16:03:27 UTC (rev 153) @@ -66,88 +66,93 @@ error("ExpiredSessionException"); } */ + if (version_compare(PHP_VERSION,'5','>=')) { + require_once($CFG->libdir.'/cas/domxml-php4-php5.php'); + } + - $xmldoc = new DomDocument(); + $xmldoc = domxml_new_doc("1.0"); - $root = $xmldoc->createElement('root'); + $root = $xmldoc->create_element('root'); - $root->appendChild(voicetool_get_session_params($xmldoc,$params)); + //$root->append_child(voicetools_get_session_params($xmldoc,$params)); - $windows = $xmldoc->createElement('windows'); + $windows = $xmldoc->create_element('windows'); //HEADER BAR - $windows->appendChild(voicetool_create_headerbar($xmldoc)); + $windows->append_child(voicetools_create_headerbar($xmldoc)); - + //TOOL BAR - $toolbar = $xmldoc->createElement('windowsElement'); - $tbtype = $xmldoc->createElement('type'); - $tbtype->appendChild($xmldoc->createTextNode("toolBar")); - $toolbar->appendChild($tbtype); + $toolbar = $xmldoc->create_element('windowsElement'); + $tbtype = $xmldoc->create_element('type'); + $tbtype->append_child($xmldoc->create_text_node("toolBar")); + $toolbar->append_child($tbtype); - $tbelementParameters = $xmldoc->createElement("windowsElementParameters"); + $tbelementParameters = $xmldoc->create_element("windowsElementParameters"); - $menubar = $xmldoc->createElement('menuElements'); + $menubar = $xmldoc->create_element('menuElements'); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false', 'button', 'all', 'all', 'pictures/buttons/toolbar-launch', 'Launch', 'Launch()', '')); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true', 'button', 'instructor', 'all', 'pictures/buttons/toolbar-new', 'New', "launchAjaxRequest('displayChoicePage.php','Management','new','true')", '')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'false', 'button', 'all', 'all', 'pictures/buttons/toolbar-launch', 'Launch', 'Launch()', '')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'false', 'button', 'instructor', 'all', 'pictures/buttons/toolbar-activities', 'Add Activity', "doOpenAddActivity('../../course/mod.php','add=voicetool')",'')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'true', 'button', 'instructor', 'all', 'pictures/buttons/toolbar-new', 'New', "launchAjaxRequest('displayChoicePage.php','Management','new','true')", '')); //separator - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', '')); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false', 'button', 'instructor', 'all', 'pictures/buttons/toolbar-activities', 'Add Activity', "doOpenAddActivity('../../course/mod.php','add=liveclassroom')",'')); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false','button', 'instructor', 'all', 'pictures/buttons/toolbar-settings', 'Settings', "launchAjaxRequest('generateSettings.php','Management','update','false')", '')); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false','button', 'instructor', 'all', 'pictures/buttons/toolbar-delete', 'Delete', 'doDelete()', '')); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', '')); - $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true','search', 'all','all', "", "", "", "","")); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', '')); + + $menubar->append_child(voicetools_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', '')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'false','button', 'instructor', 'all', 'pictures/buttons/toolbar-settings', 'Settings', "launchAjaxRequest('getXmlNewPanel.php','Management','update','false')", '')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'false','button', 'instructor', 'all', 'pictures/buttons/toolbar-delete', 'Delete', 'doDelete()', '')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', '')); + $menubar->append_child(voicetools_create_menu_element($xmldoc,'true','search', 'all','all', "", "", "", "","")); - $tbelementParameters->appendChild($menubar); - $toolbar->appendChild($tbelementParameters); + $tbelementParameters->append_child($menubar); + $toolbar->append_child($tbelementParameters); - $windows->appendChild($toolbar); - /* + $windows->append_child($toolbar); + // MESSAGE BAR if (isset($params['messageType'])) { - $windows->appendChild(liveclassroom_create_message($xmldoc, 'info', liveclassroom_get_message($params['messageType']))); + $windows->append_child(voicetools_create_message($xmldoc, 'info', voicetools_get_message($params['messageType']))); } - */ + // LIST - - $list = $xmldoc->createElement('windowsElement'); - $typeWindowsElement = $xmldoc->createElement('type'); - $typeWindowsElement->appendChild($xmldoc->createTextNode("list")); - $list->appendChild($typeWindowsElement); - $elementParameters = $xmldoc->createElement('windowsElementParameters'); + $list = $xmldoc->create_element('windowsElement'); + $typeWindowsElement = $xmldoc->create_element('type'); + $typeWindowsElement->append_child($xmldoc->create_text_node("list")); + $list->append_child($typeWindowsElement); + + $elementParameters = $xmldoc->create_element('windowsElementParameters'); - $products = $xmldoc->createElement('products'); + $products = $xmldoc->create_element('products'); // LIST PRODUCTS - $listProducts = $xmldoc->createElement('listProducts'); + $listProducts = $xmldoc->create_element('listProducts'); - $listProducts->appendChild(voicetool_create_product_information($xmldoc,'1','','productType','Voice Boards')); - $listProducts->appendChild(voicetool_create_product_information($xmldoc,'2','','productType','Voice Presentations')); + $listProducts->append_child(voicetools_create_product_information($xmldoc,'3','toggleimgboard','productType','Voice Boards')); + $listProducts->append_child(voicetools_create_product_information($xmldoc,'4','toggleimgpresentation','productType','Voice Presentations')); + + $products->append_child($listProducts); - $products->appendChild($listProducts); - // PRODUCTS CONTENT - $productContent = $xmldoc->createElement('productsContent'); - $productContent->appendChild(voicetool_xml_list_voice_board($xmldoc,$courseid)); + + $products->append_child(voicetools_xml_list_voice_tools($xmldoc,$courseid)); + + $elementParameters->append_child($products); - $products->appendChild($productContent); + $list->append_child($elementParameters); - $elementParameters->appendChild($products); + $windows->append_child($list); - $list->appendChild($elementParameters); - $windows->appendChild($list); + $root->append_child($windows); - $root->appendChild($windows); + $xmldoc->append_child($root); +// $xmldoc->dump_file('test.xml', false, true); + $xmlstring = $xmldoc->dump_mem(true); // Xml datas into a string - $xmldoc->appendChild($root); - $xmldoc->save('list.xml'); - $xmlstring = $xmldoc->saveXML(); // Xml datas into a string - $finalstring = str_replace("\n", '', $xmlstring); echo $xmlstring; Added: trunk/moodle/mod/voicetool/getXmlNewPanel.php =================================================================== --- trunk/moodle/mod/voicetool/getXmlNewPanel.php (rev 0) +++ trunk/moodle/mod/voicetool/getXmlNewPanel.php 2006-12-29 16:03:27 UTC (rev 153) @@ -0,0 +1,1017 @@ +<?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. ... [truncated message content] |