[Hw4mdl-svn] SF.net SVN: hw4mdl: [108] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
|
From: <sh...@us...> - 2006-12-08 09:29:23
|
Revision: 108
http://svn.sourceforge.net/hw4mdl/?rev=108&view=rev
Author: shazan
Date: 2006-12-08 01:29:21 -0800 (Fri, 08 Dec 2006)
Log Message:
-----------
url encoding
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
trunk/moodle/mod/liveclassroom/css/StyleSheet.css
trunk/moodle/mod/liveclassroom/generateSettings.php
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-12-08 09:26:55 UTC (rev 107)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-12-08 09:29:21 UTC (rev 108)
@@ -67,6 +67,29 @@
$LIVECLASSROOM_LOGS = "logs.php";
+
+/*
+* Get the prefix to use for creating rooms and users.
+*
+* return $prefix : a string which is the prefix to use
+*/
+function liveclassroom_api_get_prefix() {
+ global $CFG;
+
+ //get the admin user name
+ $aun = $CFG->liveclassroom_adminusername;
+ if( (substr($aun, 0,1)=='_') && (substr($aun, -1,1)=='_') ) { //Prefix
+ $prefix = $aun;
+
+ }
+ else {
+ $prefix = '';
+
+ }
+ return $prefix;
+
+}
+
/**
* Creates a CURL session with the Live Classroom server. Upon success, it
* returns a CURL Handle authenticated and ready for use. It returns false
@@ -167,12 +190,12 @@
}
}
- $enc_list = str_replace(" ", "+", $attribute);
+// $enc_list = str_replace(" ", "+", $attribute);
$url = $CFG->liveclassroom_servername.
$LIVECLASSROOM_API_ADMIN.
$const.
- $enc_list;
+ $attribute;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
@@ -281,13 +304,17 @@
global $LIVECLASSROOM_LOGS;
global $COURSE;
+
+
+
$data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_TOKEN, "&target=$userid&nickname=$nickname");
-
+
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
if ( $respcode != 100) {
+
add_to_log($COURSE->id, "liveclassroom", "Create Session", "$LIVECLASSROOM_LOGS?type=errorCreateSession&time=".time()."&respcode=$respcode&nickname=$nickname&courseId=".$COURSE->id, "Cannot Create Session.");
return false;
}
@@ -338,8 +365,9 @@
}
$final_list = "&target=$roomid"."&longname=$roomname".$list_attributes;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_CLASS, $final_list);
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_CREATE_CLASS, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -444,8 +472,11 @@
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
+ $final_list = "&filter00=longname&filter00value=$roomname";
+ $enc_list = str_replace(" ", "+", $final_list);
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
+
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -493,8 +524,11 @@
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
global $LIVECLASSROOM_API_ADMIN,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
-
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&filter00=longname&filter00value=$roomname");
+
+ $final_list = "&filter00=longname&filter00value=$roomname";
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -555,6 +589,7 @@
$LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM;
global $LIVECLASSROOM_LOGS;
global $COURSE;
+
liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM,"&target=$roomid&preview=0");
preg_match("(\d*)", $data, $matches);
@@ -624,7 +659,9 @@
$final_list = "&target=$roomid".$list_attributes;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, $final_list);
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_MODIFY_ROOM, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -655,7 +692,10 @@
global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid");
+ $final_list = "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid";
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -697,7 +737,10 @@
global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&filter02=preview&filter02value=1&AccessUser=$userid");
+ $final_list = "&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&filter02=preview&filter02value=1&AccessUser=$userid";
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -738,7 +781,10 @@
global $LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
global $LIVECLASSROOM_API_RECORD_SEPERATOR;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid");
+ $final_list = "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid";
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1222,7 +1268,10 @@
$LIVECLASSROOM_API_RECORD_SEPERATOR,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=longname&filter00=archive&filter00value=0&AccessUser=$userid");
+ $final_list = "&attribute=class_id&attribute=longname&filter00=archive&filter00value=0&AccessUser=$userid";
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
preg_match("(\d*)", $data, $matches);
$respcode = $matches[0];
@@ -1258,7 +1307,10 @@
$LIVECLASSROOM_API_RECORD_SEPERATOR,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&attribute=archive&AccessUser=$userid");
+ $final_list = "&attribute=class_id&attribute=preview&attribute=longname&attribute=archive&AccessUser=$userid";
+ $enc_list = str_replace(" ", "+", $final_list);
+
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
$studentuserid = liveclassroom_api_get_student_user_id($course->id);
preg_match("(\d*)", $data, $matches);
@@ -1346,8 +1398,11 @@
$LIVECLASSROOM_API_RECORD_SEPERATOR,
$LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST;
- $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST,"&attribute=class_id&attribute=preview&attribute=longname&filter01=archive&filter01value=0&AccessUser=$userid");
+ $final_list = "&attribute=class_id&attribute=preview&attribute=longname&filter01=archive&filter01value=0&AccessUser=$userid";
+ $enc_list = str_replace(" ", "+", $final_list);
+ $data = liveclassroom_api_send_query($LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
+
$studentuserid = liveclassroom_api_get_student_user_id($courseid);
// $teacherid = liveclassroom_api_get_teacher_user_id($course->shortname);
Modified: trunk/moodle/mod/liveclassroom/css/StyleSheet.css
===================================================================
--- trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2006-12-08 09:26:55 UTC (rev 107)
+++ trunk/moodle/mod/liveclassroom/css/StyleSheet.css 2006-12-08 09:29:21 UTC (rev 108)
@@ -254,7 +254,7 @@
padding-left:5px ;
font-family:Verdana;
color:Black;
- font-size:10;
+ font-size:8;
border-bottom:solid 1px #F3F3F3;
cursor:pointer;
}
@@ -262,7 +262,7 @@
font-family:Verdana;
color:Black;
- font-size:10;
+ font-size:8;
border-bottom:solid 1px #F3F3F3;
cursor:pointer;
}
@@ -276,7 +276,7 @@
cursor:hand;
}
-.archive{
+.archive td{
padding-left:5px ;
font-family:Verdana;
color:#666666;
@@ -284,12 +284,41 @@
font-size:11px;
border-bottom:solid 1px #F3F3F3;
}
+
+.room td{
+ padding-left:5px ;
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:pointer;
+}
+
+.archive label{
+
+ font-family:Verdana;
+ color:Black;
+ font-size:8;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:pointer;
+}
+.room label{
+
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:pointer;
+}
+
+
+
.filterBar table{
padding-left:5px ;
background-image:url("../pictures/backgrounds/filterbar.png");
height:24px;
font-weight:bold ;
- width:100%;
+
border-bottom:fine 1px #C7D3E1
}
@@ -316,10 +345,12 @@
.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;
height:24px;
@@ -329,6 +360,7 @@
.filter_right_enabled
{
background-image:url("../pictures/items/filter-enabled-right.png");
+ background-repeat:no-repeat;
}
.contextBar table
@@ -336,6 +368,7 @@
padding-left:5px;
padding-right:5px;
background-image:url("../pictures/backgrounds/toolbar.png");
+ background-repeat:no-repeat;
height:30px;
width:100%
@@ -447,10 +480,13 @@
.list
{
height:215px;
- overflow-y:scroll;
-
+ overflow-y:scroll;
+ overflow-x: hidden;
+ width:100%;
}
+
+
.lineTitle{
padding-left:10px
Modified: trunk/moodle/mod/liveclassroom/generateSettings.php
===================================================================
--- trunk/moodle/mod/liveclassroom/generateSettings.php 2006-12-08 09:26:55 UTC (rev 107)
+++ trunk/moodle/mod/liveclassroom/generateSettings.php 2006-12-08 09:29:21 UTC (rev 108)
@@ -985,8 +985,6 @@
$root->appendChild($windows);
$xmldoc->appendChild($root);
-$xmldoc->save('settings.xml');
-
$xmlstring = $xmldoc->saveXML(); // Xml datas into a string
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-12-08 09:26:55 UTC (rev 107)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-12-08 09:29:21 UTC (rev 108)
@@ -39,28 +39,8 @@
-/*
-* Get the prefix to use for creating rooms and users.
-*
-* return $prefix : a string which is the prefix to use
-*/
-function liveclassroom_api_get_prefix() {
- global $CFG;
- //get the admin user name
- $aun = $CFG->liveclassroom_adminusername;
- if( (substr($aun, 0,1)=='_') && (substr($aun, -1,1)=='_') ) { //Prefix
- $prefix = $aun;
- }
- else {
- $prefix = '';
-
- }
- return $prefix;
-
-}
-
/**
* Validate the data in passed in the configuration page
* @param $config - the information from the form mod.html
@@ -328,7 +308,7 @@
$userid = $LIVECLASSROOM_MOODLE_PREFIX.$course->shortname.
($isteacher?$LIVECLASSROOM_TEACHER_SUFFIX:$LIVECLASSROOM_STUDENT_SUFFIX);
- $nickname = fullname ($USER);
+ $nickname = fullname($USER);
Modified: trunk/moodle/mod/liveclassroom/view.php
===================================================================
--- trunk/moodle/mod/liveclassroom/view.php 2006-12-08 09:26:55 UTC (rev 107)
+++ trunk/moodle/mod/liveclassroom/view.php 2006-12-08 09:29:21 UTC (rev 108)
@@ -64,14 +64,14 @@
require_login($course->id);
- add_to_log($course->id, "liveclassroom", "view", "view.php?id=$cm->id", "$liveclassroom->id");
+ // add_to_log($course->id, "liveclassroom", "view", "view.php?id=$cm->id", "$liveclassroom->id");
// Create the session for this user
if (!$usersession = liveclassroom_create_session ($course, isteacher($course->id, $USER->id))) {
- error ("Cannot create session");
- }
+ error ("Cannot create session");
+ }
/// Print the page header
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|