ILIAS  release_4-4 Revision
ilObjiLincClassroom Class Reference

Class ilObjiLincClassroom. More...

+ Inheritance diagram for ilObjiLincClassroom:
+ Collaboration diagram for ilObjiLincClassroom:

Public Member Functions

 ilObjiLincClassroom ($a_icla_id, $a_icrs_id)
 Constructor public. More...
 
 _lookupiCourseId ($a_ref_id)
 
 read ()
 private More...
 
 joinClass (&$a_user_obj, $a_ilinc_class_id)
 
 findUser (&$a_user_obj)
 
 update ($a_data="")
 update object data More...
 
 delete ()
 delete object and all related data More...
 
 getDocentList ()
 
 _getDocent ($a_ilinc_user_id)
 
 _setFullname ($a_title="", $a_firstname="", $a_lastname="")
 
 setDocentId ($a_ilinc_user_id)
 
 getDocentName ()
 
 getDocentId ()
 
 setStatus ($a_status)
 
 getStatus ()
 
 getErrorMsg ()
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Detailed Description

Class ilObjiLincClassroom.

Author
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

Definition at line 36 of file class.ilObjiLincClassroom.php.

Member Function Documentation

◆ _getDocent()

ilObjiLincClassroom::_getDocent (   $a_ilinc_user_id)

Definition at line 244 of file class.ilObjiLincClassroom.php.

References ilObject\$lng, $r, $row, _setFullname(), and DB_FETCHMODE_OBJECT.

Referenced by getDocentName(), and ilObjiLincClassroomListGUI\getProperties().

245  {
246  global $ilDB, $lng;
247 
248  $fullname = false;
249 
250  $ilDB->setLimit(1);
251  $r = $ilDB->queryf('
252  SELECT title, firstname, lastname FROM usr_data
253  WHERE ilinc_id = %s',
254  array('integer'), array($a_ilinc_user_id));
255 
256  while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
257  {
258  $fullname = ilObjiLincClassroom::_setFullname($row->title,$row->firstname,$row->lastname);
259  }
260 
261  return $fullname;
262  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
_setFullname($a_title="", $a_firstname="", $a_lastname="")
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupiCourseId()

ilObjiLincClassroom::_lookupiCourseId (   $a_ref_id)

Definition at line 72 of file class.ilObjiLincClassroom.php.

References $res.

Referenced by getDocentList(), and ilObjiLincClassroomGUI\save().

73  {
74  global $ilDB;
75 
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));
81 
82  $obj_rec = $ilDB->fetchAssoc($res);
83 
84  return $obj_rec["course_id"];
85  }
+ Here is the caller graph for this function:

◆ _setFullname()

ilObjiLincClassroom::_setFullname (   $a_title = "",
  $a_firstname = "",
  $a_lastname = "" 
)

Definition at line 264 of file class.ilObjiLincClassroom.php.

Referenced by _getDocent().

265  {
266  $fullname = "";
267 
268  if ($a_title)
269  {
270  $fullname = $a_title." ";
271  }
272 
273  if ($a_firstname)
274  {
275  $fullname .= $a_firstname." ";
276  }
277 
278  if ($a_lastname)
279  {
280  return $fullname.$a_lastname;
281  }
282  }
+ Here is the caller graph for this function:

◆ delete()

ilObjiLincClassroom::delete ( )

delete object and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

Definition at line 206 of file class.ilObjiLincClassroom.php.

207  {
208  $this->ilincAPI->removeClass($this->id);
209  $response = $this->ilincAPI->sendRequest();
210 
211  if ($response->isError())
212  {
213  if (!$response->getErrorMsg())
214  {
215  $this->error_msg = "err_delete_classroom";
216  }
217  else
218  {
219  $this->error_msg = $response->getErrorMsg();
220  }
221 
222  return false;
223  }
224 
225  return true;
226  }

◆ findUser()

ilObjiLincClassroom::findUser ( $a_user_obj)

Definition at line 146 of file class.ilObjiLincClassroom.php.

References exit.

147  {
148  $this->ilincAPI->findUser($a_user_obj);
149  $response = $this->ilincAPI->sendRequest();
150 
151  var_dump($response->data);
152  exit;
153  }
exit
Definition: login.php:54

◆ getDocentId()

ilObjiLincClassroom::getDocentId ( )

Definition at line 299 of file class.ilObjiLincClassroom.php.

Referenced by update().

300  {
301  return $this->docent_id;
302  }
+ Here is the caller graph for this function:

◆ getDocentList()

ilObjiLincClassroom::getDocentList ( )

Definition at line 229 of file class.ilObjiLincClassroom.php.

References _lookupiCourseId().

230  {
231  $ilinc_crs_id = ilObjiLincClassroom::_lookupiCourseId($this->parent);
232 
233  $this->ilincAPI->findRegisteredUsersByRole($ilinc_crs_id,true);
234  $response = $this->ilincAPI->sendRequest();
235 
236  if (is_array($response->data['users']))
237  {
238  return $response->data['users'];
239  }
240 
241  return array();
242  }
+ Here is the call graph for this function:

◆ getDocentName()

ilObjiLincClassroom::getDocentName ( )

Definition at line 289 of file class.ilObjiLincClassroom.php.

References _getDocent().

290  {
291  if (!$this->docent_name)
292  {
293  $this->docent_name = $this->_getDocent($this->docent_id);
294  }
295 
296  return $this->docent_name;
297  }
+ Here is the call graph for this function:

◆ getErrorMsg()

ilObjiLincClassroom::getErrorMsg ( )

Definition at line 321 of file class.ilObjiLincClassroom.php.

322  {
323  $err_msg = $this->error_msg;
324  $this->error_msg = "";
325 
326  return $err_msg;
327  }

◆ getStatus()

ilObjiLincClassroom::getStatus ( )

Definition at line 316 of file class.ilObjiLincClassroom.php.

Referenced by update().

317  {
318  return $this->status;
319  }
+ Here is the caller graph for this function:

◆ ilObjiLincClassroom()

ilObjiLincClassroom::ilObjiLincClassroom (   $a_icla_id,
  $a_icrs_id 
)

Constructor public.

Parameters
integerilinc class id
booleanilias ref id of ilinc course object

Definition at line 44 of file class.ilObjiLincClassroom.php.

References $ilErr, ilObject\$ilias, ilObject\$lng, and read().

45  {
46  global $ilErr,$ilias,$lng;
47 
48  $this->type = "icla";
49  $this->id = $a_icla_id;
50  $this->parent = $a_icrs_id;
51  $this->ilincAPI = new ilnetucateXMLAPI();
52 
53  $this->ilErr =& $ilErr;
54  $this->ilias =& $ilias;
55  $this->lng =& $lng;
56 
57  $this->max_title = MAXLENGTH_OBJ_TITLE;
58  $this->max_desc = MAXLENGTH_OBJ_DESC;
59  $this->add_dots = true;
60 
61  $this->referenced = false;
62  $this->call_by_reference = false;
63 
64  if (!empty($this->id))
65  {
66  $this->read();
67  }
68 
69  return $this;
70  }
redirection script todo: (a better solution should control the processing via a xml file) ...
API to communicate with a the CMSAPI of centra (c) Sascha Hofmann, 2004.
+ Here is the call graph for this function:

◆ joinClass()

ilObjiLincClassroom::joinClass ( $a_user_obj,
  $a_ilinc_class_id 
)

Definition at line 118 of file class.ilObjiLincClassroom.php.

119  {
120 
121  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
122  $ilinc_user = new ilObjiLincUser($a_user_obj);
123 
124  $this->ilincAPI->joinClass($ilinc_user,$a_ilinc_class_id);
125  $response = $this->ilincAPI->sendRequest("joinClass");
126 
127  if ($response->isError())
128  {
129  if (!$response->getErrorMsg())
130  {
131  $this->error_msg = "err_join_classroom";
132  }
133  else
134  {
135  $this->error_msg = $response->getErrorMsg();
136  }
137 
138  return false;
139  }
140 
141  // return URL to join class room
142  return trim($response->data['url']['cdata']);
143  }
Class ilObjiLincUser iLinc related user settings.

◆ read()

ilObjiLincClassroom::read ( )

private

Definition at line 91 of file class.ilObjiLincClassroom.php.

References ilObject\setDescription(), setDocentId(), setStatus(), and ilObject\setTitle().

Referenced by ilObjiLincClassroom().

92  {
93  $this->ilincAPI->findClass($this->id);
94  $response = $this->ilincAPI->sendRequest();
95 
96  if ($response->isError())
97  {
98  if (!$response->getErrorMsg())
99  {
100  $this->error_msg = "err_read_class";
101  }
102  else
103  {
104  $this->error_msg = $response->getErrorMsg();
105  }
106 
107  return false;
108  }
109 
110  //var_dump($response->data['classes']);
111 
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']);
116  }
setTitle($a_title)
set object title
setDescription($a_desc)
set object description
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDocentId()

ilObjiLincClassroom::setDocentId (   $a_ilinc_user_id)

Definition at line 284 of file class.ilObjiLincClassroom.php.

Referenced by read().

285  {
286  $this->docent_id = $a_ilinc_user_id;
287  }
+ Here is the caller graph for this function:

◆ setStatus()

ilObjiLincClassroom::setStatus (   $a_status)

Definition at line 304 of file class.ilObjiLincClassroom.php.

Referenced by read().

305  {
306  if ($a_status == "Wahr" or $a_status == "1" or $a_status == true)
307  {
308  $this->status = "1";
309  }
310  else
311  {
312  $this->status = "0";
313  }
314  }
+ Here is the caller graph for this function:

◆ update()

ilObjiLincClassroom::update (   $a_data = "")

update object data

public

Returns
boolean

Definition at line 161 of file class.ilObjiLincClassroom.php.

References $data, $result, ilObject\getDescription(), getDocentId(), getStatus(), and ilObject\getTitle().

162  {
163  $data = array(
164  "name" => $this->getTitle(),
165  "description" => $this->getDescription(),
166  "instructoruserid" => $this->getDocentId(),
167  "alwaysopen" => $this->getStatus()
168  );
169 
170  if (!is_array($a_data))
171  {
172  $a_data = array();
173  }
174 
175  $result = array_merge($data,$a_data);
176 
177  $this->ilincAPI->editClass($this->id,$result);
178 
179  $response = $this->ilincAPI->sendRequest("editClass");
180 
181  if ($response->isError())
182  {
183  if (!$response->getErrorMsg())
184  {
185  $this->error_msg = "err_edit_classroom";
186  }
187  else
188  {
189  $this->error_msg = $response->getErrorMsg();
190  }
191 
192  return false;
193  }
194 
195  $this->result_msg = $response->getResultMsg();
196 
197  return true;
198  }
$result
getTitle()
get object title public
getDescription()
get object description
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: