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 $res = $ilDB->queryf(
'
77 SELECT course_id FROM ilinc_data
78 LEFT JOIN object_reference ON object_reference.obj_id = ilinc_data.obj_id
79 WHERE object_reference.ref_id = %s',
80 array(
'integer'), array($a_ref_id));
82 $obj_rec = $ilDB->fetchAssoc(
$res);
84 return $obj_rec[
"course_id"];
93 $this->ilincAPI->findClass($this->
id);
94 $response = $this->ilincAPI->sendRequest();
96 if ($response->isError())
98 if (!$response->getErrorMsg())
100 $this->error_msg =
"err_read_class";
104 $this->error_msg = $response->getErrorMsg();
112 $this->
setTitle($response->data[
'classes'][$this->id][
'name']);
113 $this->
setDescription($response->data[
'classes'][$this->id][
'description']);
114 $this->
setDocentId($response->data[
'classes'][$this->id][
'instructoruserid']);
115 $this->
setStatus($response->data[
'classes'][$this->id][
'alwaysopen']);
121 include_once (
'./Modules/ILinc/classes/class.ilObjiLincUser.php');
124 $this->ilincAPI->joinClass($ilinc_user,$a_ilinc_class_id);
125 $response = $this->ilincAPI->sendRequest(
"joinClass");
127 if ($response->isError())
129 if (!$response->getErrorMsg())
131 $this->error_msg =
"err_join_classroom";
135 $this->error_msg = $response->getErrorMsg();
142 return trim($response->data[
'url'][
'cdata']);
148 $this->ilincAPI->findUser($a_user_obj);
149 $response = $this->ilincAPI->sendRequest();
151 var_dump($response->data);
170 if (!is_array($a_data))
177 $this->ilincAPI->editClass($this->
id,
$result);
179 $response = $this->ilincAPI->sendRequest(
"editClass");
181 if ($response->isError())
183 if (!$response->getErrorMsg())
185 $this->error_msg =
"err_edit_classroom";
189 $this->error_msg = $response->getErrorMsg();
195 $this->result_msg = $response->getResultMsg();
208 $this->ilincAPI->removeClass($this->
id);
209 $response = $this->ilincAPI->sendRequest();
211 if ($response->isError())
213 if (!$response->getErrorMsg())
215 $this->error_msg =
"err_delete_classroom";
219 $this->error_msg = $response->getErrorMsg();
233 $this->ilincAPI->findRegisteredUsersByRole($ilinc_crs_id,
true);
234 $response = $this->ilincAPI->sendRequest();
236 if (is_array($response->data[
'users']))
238 return $response->data[
'users'];
252 SELECT title, firstname, lastname FROM usr_data
253 WHERE ilinc_id = %s',
254 array(
'integer'), array($a_ilinc_user_id));
264 function _setFullname($a_title =
"",$a_firstname =
"",$a_lastname =
"")
270 $fullname = $a_title.
" ";
275 $fullname .= $a_firstname.
" ";
280 return $fullname.$a_lastname;
286 $this->docent_id = $a_ilinc_user_id;
291 if (!$this->docent_name)
293 $this->docent_name = $this->
_getDocent($this->docent_id);
296 return $this->docent_name;
301 return $this->docent_id;
306 if ($a_status ==
"Wahr" or $a_status ==
"1" or $a_status ==
true)
318 return $this->status;
323 $err_msg = $this->error_msg;
324 $this->error_msg =
"";