[Hw4mdl-svn] SF.net SVN: hw4mdl: [147] trunk/moodle
Brought to you by:
jhlinder,
trollinger
From: <hu...@us...> - 2006-12-29 10:25:44
|
Revision: 147 http://svn.sourceforge.net/hw4mdl/?rev=147&view=rev Author: hugues Date: 2006-12-29 02:25:41 -0800 (Fri, 29 Dec 2006) Log Message: ----------- http://u.horizonwimba.com/bugzilla/show_bug.cgi?id=10561 - Fixing some issues with define() - started to display i18n'd mesages in xml (does not work yet) Modified Paths: -------------- trunk/moodle/lang/en_utf8/liveclassroom.php trunk/moodle/lang/en_utf8/voicetool.php trunk/moodle/mod/liveclassroom/api.php trunk/moodle/mod/liveclassroom/lib.php Modified: trunk/moodle/lang/en_utf8/liveclassroom.php =================================================================== --- trunk/moodle/lang/en_utf8/liveclassroom.php 2006-12-29 09:49:02 UTC (rev 146) +++ trunk/moodle/lang/en_utf8/liveclassroom.php 2006-12-29 10:25:41 UTC (rev 147) @@ -83,6 +83,17 @@ $string['lcpopupshouldappear'] = 'The Live Classroom should now appear.<br/> if it does not, please click <a href=\"javascript:startActivity ();\">this link</a> to open it. '; +$string['roomCreated'] = "Your room has been successfully created."; +$string['roomUpdated'] = "Your room has been successfully updated."; +$string['roomDeleted'] = "Your room has been successfully deleted."; +$string['notfind'] = "Invalid Live Classroom parameters. Please contact your administrator for more information."; +$string['room'] = "Invalid Live Classroom parameters. Please contact your administrator for more information. "; +$string['connection'] = "Moodle cannot connect to the Live Classroom server. Please reload the page or contact your administrator for more information. "; +$string['bd'] = "Moodle cannot connect to the Live Classroom database. Please reload the page or contact your administrator for more information. "; +$string['signature'] = "Invalid connection to Live Classroom. Please contact your administrator for more information. "; +$string['board'] = "Invalid Voice Board parameters. Please contact your administrator for more information. "; + + //First Time Use - not use yet $string['firstRoom'] = 'Main classroom'; $string['secondRoom'] = 'Group 1'; Modified: trunk/moodle/lang/en_utf8/voicetool.php =================================================================== --- trunk/moodle/lang/en_utf8/voicetool.php 2006-12-29 09:49:02 UTC (rev 146) +++ trunk/moodle/lang/en_utf8/voicetool.php 2006-12-29 10:25:41 UTC (rev 147) @@ -52,6 +52,11 @@ $string['goodquality'] = 'Good Quality (FM Radio quality) - 20.8 kbit/s - Broadband usage'; $string['audioquality'] = 'Audio Quality'; +$string['connection_vt'] = "Moodle cannot connect to the Voice Board server. Please reload the page or contact your administrator for more information. "; +$string['bdvt'] = "Moodle cannot connect to the Voice Board database. Please reload the page or contact your administrator for more information. "; +$string['sessionvt'] = "The Voice Board session has timed out due to inactivity. Please reload the page to reconnect. "; +$string['signaturevt'] = "Invalid connection to Voice Board. Please contact your administrator for more information. "; + // Voice Direct tags $string['voicedirect'] = 'Voice Direct'; $string['voicedirects'] = 'Voice Directs'; Modified: trunk/moodle/mod/liveclassroom/api.php =================================================================== --- trunk/moodle/mod/liveclassroom/api.php 2006-12-29 09:49:02 UTC (rev 146) +++ trunk/moodle/mod/liveclassroom/api.php 2006-12-29 10:25:41 UTC (rev 147) @@ -43,7 +43,7 @@ require_once('lib.php'); -$LIVECLASSROOM_MOODLE_PREFIX = liveclassroom_api_get_prefix(); +define("LIVECLASSROOM_MOODLE_PREFIX", liveclassroom_api_get_prefix()); define("LIVECLASSROOM_API_ADMIN","/admin/api/api.pl?"); define("LIVECLASSROOM_API_FUNCTION_NOOP","function=NOOP"); @@ -129,7 +129,6 @@ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); - // curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); @@ -231,7 +230,6 @@ */ function liveclassroom_api_create_user ($userid, $coursename, $rolename) { global $CFG; - global $LIVECLASSROOM_MOODLE_PREFIX; global $COURSE; $final_list = "&target=$userid&first_name=$rolename&last_name=$coursename"; Modified: trunk/moodle/mod/liveclassroom/lib.php =================================================================== --- trunk/moodle/mod/liveclassroom/lib.php 2006-12-29 09:49:02 UTC (rev 146) +++ trunk/moodle/mod/liveclassroom/lib.php 2006-12-29 10:25:41 UTC (rev 147) @@ -38,12 +38,12 @@ define (LIVECLASSROOM_MODULE_VERSION, "0.9"); //Suffixes used when creting the profiles account on the LC server -define (LIVECLASSROOM_TEACHER_SUFFIX, "_T"); //Teachers will use the user $CFG->liveclassroom_settinguniqueid + $course->id + $LIVECLASSROOM_TEACHER_SUFFIX -define (LIVECLASSROOM_STUDENT_SUFFIX, "_S"); //Students will use the user $CFG->liveclassroom_settinguniqueid + $course->id + $LIVECLASSROOM_STUDENT_SUFFIX +define (LIVECLASSROOM_TEACHER_SUFFIX, "_T"); //Teachers will use the user $CFG->liveclassroom_settinguniqueid + $course->id + LIVECLASSROOM_TEACHER_SUFFIX +define (LIVECLASSROOM_STUDENT_SUFFIX, "_S"); //Students will use the user $CFG->liveclassroom_settinguniqueid + $course->id + LIVECLASSROOM_STUDENT_SUFFIX - $LIVECLASSROOM_LOGS = "logs.php"; //file use to the logs + /** * Validate the data in passed in the configuration page * @param $config - the information from the form mod.html @@ -61,13 +61,11 @@ } else if(empty($config->adminpassword)){ error(get_string('emptyAdminPassword', 'liveclassroom')); - } + } + liveclassroom_api_authenticate($config->servername,$config->adminusername,$config->adminpassword); -// error(get_string('wrongconfigurationURLincorrect', 'liveclassroom')); - //TODO: check the user is really an admin - return; } @@ -253,13 +251,10 @@ function liveclassroom_create_profiles ($course) { global $CFG; - global $LIVECLASSROOM_TEACHER_SUFFIX; - global $LIVECLASSROOM_STUDENT_SUFFIX; - global $LIVECLASSROOM_MOODLE_PREFIX; $enc_coursename = str_replace(" ", "_", $course->shortname); - $userid = $LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.$LIVECLASSROOM_TEACHER_SUFFIX; + $userid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.LIVECLASSROOM_TEACHER_SUFFIX; if (! liveclassroom_api_create_user ($userid, $enc_coursename, 'Teacher')) { @@ -267,7 +262,7 @@ return false; } - $userid = $LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.$LIVECLASSROOM_STUDENT_SUFFIX; + $userid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.LIVECLASSROOM_STUDENT_SUFFIX; if (! liveclassroom_api_create_user ($userid, $enc_coursename, 'Student')) { //error("Cannot Create Student profile"); @@ -301,14 +296,11 @@ function liveclassroom_create_session ($course, $isteacher) { global $CFG, $USER; - global $LIVECLASSROOM_TEACHER_SUFFIX; - global $LIVECLASSROOM_STUDENT_SUFFIX; - global $LIVECLASSROOM_MOODLE_PREFIX; - $enc_coursename = str_replace(" ", "_", $course->shortname); + $enc_coursename = str_replace(" ", "_", $course->shortname); - $userid = $LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename. - ($isteacher?$LIVECLASSROOM_TEACHER_SUFFIX:$LIVECLASSROOM_STUDENT_SUFFIX); + $userid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename. + ($isteacher?LIVECLASSROOM_TEACHER_SUFFIX:LIVECLASSROOM_STUDENT_SUFFIX); $nickname = fullname($USER); @@ -325,18 +317,14 @@ */ function liveclassroom_create_room ($courseid, $roomname, $bool, $attributes) { global $CFG; - global $LIVECLASSROOM_TEACHER_SUFFIX, - $LIVECLASSROOM_STUDENT_SUFFIX; - - global $LIVECLASSROOM_MOODLE_PREFIX; - + $course_name = liveclassroom_get_course_shortname($courseid); $enc_coursename = str_replace(" ", "_", $course_name); - $roomid = $LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.'_'.rand(); + $roomid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.'_'.rand(); - $teacherid = $LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.$LIVECLASSROOM_TEACHER_SUFFIX; - $studentid = $LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.$LIVECLASSROOM_STUDENT_SUFFIX; + $teacherid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.LIVECLASSROOM_TEACHER_SUFFIX; + $studentid = LIVECLASSROOM_MOODLE_PREFIX.$enc_coursename.LIVECLASSROOM_STUDENT_SUFFIX; if($bool==true) { // main lecture hall @@ -553,8 +541,6 @@ $element = $xmldoc->create_element('lineElement'); - - $displayContext = $xmldoc->create_element('displayContext'); $displayContext->append_child($xmldoc->create_text_node($p_displayContext)); $element->append_child($displayContext); @@ -1042,52 +1028,14 @@ * return a string with the message to display */ function liveclassroom_get_message($type) { - - switch ($type) { - case "roomCreated": - return "Your room has been successfully created."; - case "roomUpdated": - return "Your room has been successfully updated."; - - case "roomDeleted": - return "Your room has been successfully deleted."; - - case "notfind": - return "Invalid Live Classroom parameters. Please contact your administrator for more information."; - - case "room": - return "Invalid Live Classroom parameters. Please contact your administrator for more information. "; - - case "connection": - return "Moodle cannot connect to the Live Classroom server. Please reload the page or contact your administrator for more information. "; - - case "bd": - return "Moodle cannot connect to the Live Classroom database. Please reload the page or contact your administrator for more information. "; - + switch ($type) { case "session": //createMessage("exception","the session has timed out due to inactivity. Please reload the page to reconnect. "); - case "signature": - return "Invalid connection to Live Classroom. Please contact your administrator for more information. "; - - case "board": - return "Invalid Voice Board parameters. Please contact your administrator for more information. "; - - case "connection_vt": - return "Moodle cannot connect to the Voice Board server. Please reload the page or contact your administrator for more information. "; - - case "bdvt": - return "Moodle cannot connect to the Voice Board database. Please reload the page or contact your administrator for more information. "; - - case "sessionvt": - return "The Voice Board session has timed out due to inactivity. Please reload the page to reconnect. "; - - case "signaturevt": - return "Invalid connection to Voice Board. Please contact your administrator for more information. "; - } - return "Default Message"; + + return get_string ($type, 'liveclassrom'); } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |