33 require_once (
'./classes/class.ilObject.php');
34 require_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
49 $this->
id = $a_icla_id;
50 $this->parent = $a_icrs_id;
57 $this->max_title = MAXLENGTH_OBJ_TITLE;
58 $this->max_desc = MAXLENGTH_OBJ_DESC;
59 $this->add_dots =
true;
61 $this->referenced =
false;
62 $this->call_by_reference =
false;
64 if (!empty($this->
id))
76 $q =
"SELECT course_id FROM ilinc_data ".
77 "LEFT JOIN object_reference ON object_reference.obj_id=ilinc_data.obj_id ".
78 "WHERE object_reference.ref_id = ".$ilDB->quote($a_ref_id);
79 $obj_set = $ilDB->query($q);
82 return $obj_rec[
"course_id"];
91 $this->ilincAPI->findClass($this->
id);
92 $response = $this->ilincAPI->sendRequest();
94 if ($response->isError())
96 if (!$response->getErrorMsg())
98 $this->error_msg =
"err_read_class";
102 $this->error_msg = $response->getErrorMsg();
110 $this->
setTitle($response->data[
'classes'][$this->id][
'name']);
111 $this->
setDescription($response->data[
'classes'][$this->id][
'description']);
112 $this->
setDocentId($response->data[
'classes'][$this->id][
'instructoruserid']);
113 $this->
setStatus($response->data[
'classes'][$this->id][
'alwaysopen']);
119 include_once (
'./Modules/ILinc/classes/class.ilObjiLincUser.php');
122 $this->ilincAPI->joinClass($ilinc_user,$a_ilinc_class_id);
123 $response = $this->ilincAPI->sendRequest(
"joinClass");
125 if ($response->isError())
127 if (!$response->getErrorMsg())
129 $this->error_msg =
"err_join_classroom";
133 $this->error_msg = $response->getErrorMsg();
140 return trim($response->data[
'url'][
'cdata']);
146 $this->ilincAPI->findUser($a_user_obj);
147 $response = $this->ilincAPI->sendRequest();
149 var_dump($response->data);
168 if (!is_array($a_data))
175 $this->ilincAPI->editClass($this->
id,
$result);
177 $response = $this->ilincAPI->sendRequest(
"editClass");
179 if ($response->isError())
181 if (!$response->getErrorMsg())
183 $this->error_msg =
"err_edit_classroom";
187 $this->error_msg = $response->getErrorMsg();
193 $this->result_msg = $response->getResultMsg();
206 $this->ilincAPI->removeClass($this->
id);
207 $response = $this->ilincAPI->sendRequest();
209 if ($response->isError())
211 if (!$response->getErrorMsg())
213 $this->error_msg =
"err_delete_classroom";
217 $this->error_msg = $response->getErrorMsg();
231 $this->ilincAPI->findRegisteredUsersByRole($ilinc_crs_id,
true);
232 $response = $this->ilincAPI->sendRequest();
234 if (is_array($response->data[
'users']))
236 return $response->data[
'users'];
248 $q =
"SELECT title,firstname,lastname FROM usr_data WHERE ilinc_id = ".$ilDB->quote($a_ilinc_user_id).
" LIMIT 1";
249 $r = $ilDB->query($q);
259 function _setFullname($a_title =
"",$a_firstname =
"",$a_lastname =
"")
265 $fullname = $a_title.
" ";
270 $fullname .= $a_firstname.
" ";
275 return $fullname.$a_lastname;
281 $this->docent_id = $a_ilinc_user_id;
286 if (!$this->docent_name)
288 $this->docent_name = $this->
_getDocent($this->docent_id);
291 return $this->docent_name;
296 return $this->docent_id;
301 if ($a_status ==
"Wahr" or $a_status ==
"1" or $a_status ==
true)
313 return $this->status;
318 $err_msg = $this->error_msg;
319 $this->error_msg =
"";