ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjiLincCourse Class Reference

Class ilObjiLincCourse. More...

+ Inheritance diagram for ilObjiLincCourse:
+ Collaboration diagram for ilObjiLincCourse:

Public Member Functions

 ilObjiLincCourse ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 getViewMode ()
 Get container view mode. More...
 
 read ()
 @access private More...
 
 getiLincId ()
 
 getErrorMsg ()
 
 getAKClassValue1 ()
 
 getAKClassValue2 ()
 
 setAKClassValue1 ($a_str)
 
 setAKClassValue2 ($a_str)
 
 update ()
 update object data More...
 
 addCourse ()
 create course on iLinc server More...
 
 delete ()
 delete object and all related data
More...
 
 storeiLincId ($a_icrs_id)
 
 saveActivationStatus ($a_activated)
 
 saveAKClassValues ($a_akclassvalue1, $a_akclassvalue2)
 
 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 happend, each object may decide how it reacts. More...
 
 addMember (&$a_user_obj, $a_mem_role, $a_instructor=false)
 add Member to iLic course @access public More...
 
 join ($a_user_id, $a_mem_role="")
 join icrs, assigns user to role @access private More...
 
 leave ($a_user_id)
 deassign member from group role @access private More...
 
 getMemberRoles ($a_user_id)
 get group member status @access public More...
 
 getMemberIds ()
 get all group Member ids regardless of role @access public More...
 
 getMemberData ($a_mem_ids, $active=1)
 get all group Members regardless of group role. More...
 
 getLocalRoles ($a_translate=false)
 get ALL local roles of group, also those created and defined afterwards only fetch data once from database. More...
 
 getMemberRolesTitle ($a_user_id)
 get group member status @access public More...
 
 getDefaultMemberRole ()
 returns object id of created default member role @access public More...
 
 getDefaultAdminRole ()
 returns object id of created default adminstrator role @access public More...
 
 getClassrooms ()
 
 updateClassrooms ()
 
 userExists (&$a_user_obj)
 
 addUser (&$a_user_obj)
 
 isMember ($a_user_id="")
 
 isDocent ($a_user_obj="")
 
 registerUser (&$a_user_obj, $a_instructor=false)
 
 registerUsers ($a_user_arr)
 
 unregisterUser ($a_user_obj)
 
 unregisterUsers ($a_ilinc_user_ids)
 
 userLogin (&$a_user_obj)
 
 uploadPicture (&$a_user_obj, $a_lang)
 
 getAdminIds ($a_grpId="")
 get Group Admin Id @access public More...
 
 removeMember (&$a_user_obj)
 removes Member from group @access public More...
 
 isAdmin ($a_user_id)
 is Admin @access public More...
 
 getDefaultRoles ($a_grp_id="")
 get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin @access public More...
 
 getiLincMemberIds ($a_instructorflag=false)
 
 checkiLincMemberStatus ($a_ilinc_user_id, $a_docent_ids, $a_student_ids)
 
 _isActivated ($a_course_obj_id)
 
 _getAKClassValues ($a_course_obj_id)
 
 _isMember ($a_user_id, $a_ref_id)
 checks wether the user relating to the passed usr_id is member of iLinc course with passed ref_id More...
 
 __setCourseStatus ()
 
 getSubItems ()
 get all subitems of the container overwrites method in ilContainerGUI More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor @access 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 @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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 @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 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...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. 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) @access public 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...
 
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 _getContainerDirectory ($a_id)
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 getCustomIconPath ()
 Get path for custom icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 clone all objects according to this container More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read 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 @global 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@access public 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...
 
- Static Public Member Functions inherited from ilContainer
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $a_obj_id)
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) 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...
 
- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_ILINC = 7
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 
- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = false
 

Detailed Description

Class ilObjiLincCourse.

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

Definition at line 37 of file class.ilObjiLincCourse.php.

Member Function Documentation

◆ __setCourseStatus()

ilObjiLincCourse::__setCourseStatus ( )

Definition at line 1185 of file class.ilObjiLincCourse.php.

1186 {
1187 // empty
1188 }

◆ _getAKClassValues()

ilObjiLincCourse::_getAKClassValues (   $a_course_obj_id)

Definition at line 1148 of file class.ilObjiLincCourse.php.

1149 {
1150 global $ilDB,$ilias;
1151
1152 $r = $ilDB->queryf('
1153 SELECT akclassvalue1, akclassvalue2 FROM ilinc_data WHERE obj_id = %s',
1154 array('integer'), array($a_course_obj_id));
1155
1156 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
1157
1158 return $akclassvalues = array($row->akclassvalue1,$row->akclassvalue2);
1159 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

References $ilDB, ilObject\$ilias, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjiLincClassroomGUI\getDefaultValues(), ilObjiLincClassroomGUI\getObjectValues(), ilObjiLincCourseListGUI\getProperties(), ilObjiLincClassroomGUI\save(), and ilObjiLincClassroomGUI\updateClassroom().

+ Here is the caller graph for this function:

◆ _isActivated()

ilObjiLincCourse::_isActivated (   $a_course_obj_id)

Definition at line 1130 of file class.ilObjiLincCourse.php.

1131 {
1132 global $ilDB,$ilias;
1133
1134 if (!$ilias->getSetting("ilinc_active"))
1135 {
1136 return false;
1137 }
1138
1139 $r = $ilDB->queryf('
1140 SELECT activation_offline FROM ilinc_data WHERE obj_id = %s',
1141 array('integer'), array($a_course_obj_id));
1142
1143 $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
1144
1145 return ilUtil::yn2tf($row->activation_offline);
1146 }
static yn2tf($a_yn)
convert "y"/"n" to true/false

References $ilDB, ilObject\$ilias, $row, DB_FETCHMODE_OBJECT, and ilUtil\yn2tf().

Referenced by ilObjiLincCourseAccess\_checkAccess(), and ilObjiLincCourseListGUI\getProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isMember()

ilObjiLincCourse::_isMember (   $a_user_id,
  $a_ref_id 
)

checks wether the user relating to the passed usr_id is member of iLinc course with passed ref_id

@global ilRbacReview $rbacreview

Parameters
integer$a_user_id
integer$a_ref_id
Returns
boolean

Definition at line 1170 of file class.ilObjiLincCourse.php.

1171 {
1172 global $rbacreview;
1173
1174 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,false);
1175 $user_roles = $rbacreview->assignedRoles($a_user_id);
1176
1177 if (!array_intersect($local_roles,$user_roles))
1178 {
1179 return false;
1180 }
1181
1182 return true;
1183 }

Referenced by ilObjiLincClassroomAccess\_checkAccess(), and ilObjiLincCourseAccess\_checkAccess().

+ Here is the caller graph for this function:

◆ addCourse()

ilObjiLincCourse::addCourse ( )

create course on iLinc server

@access public

Returns
boolean

Definition at line 172 of file class.ilObjiLincCourse.php.

173 {
174 $this->ilincAPI->addCourse($_POST["Fobject"]);
175 $response = $this->ilincAPI->sendRequest();
176
177 if ($response->isError())
178 {
179 $this->error_msg = $response->getErrorMsg();
180 return false;
181 }
182
183 $this->ilinc_id = $response->getFirstID();
184
185 return true;
186 }
$_POST['username']
Definition: cron.php:12

References $_POST.

◆ addMember()

ilObjiLincCourse::addMember ( $a_user_obj,
  $a_mem_role,
  $a_instructor = false 
)

add Member to iLic course @access public

Parameters
integeruser_id
integermember role_id of local group_role
booleanregister member on iLinc server as student(false) or docent(true)

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

300 {
301 global $rbacadmin;
302//echo "0";
303 if (!isset($a_user_obj) && !isset($a_mem_role))
304 {
305 $this->error_msg = get_class($this)."::addMember(): Missing parameters !";
306 return false;
307 }
308//echo "1";
309 // check if user is registered at iLinc server
310 if (!$this->userExists($a_user_obj))
311 {
312 // if not, add user on iLinc server
313 if ($this->addUser($a_user_obj) == false)
314 {
315 // error_msg already set
316 return false;
317 }
318 }
319//echo "2";
320 // assign membership to icourse on iLinc server
321 if (!$this->registerUser($a_user_obj,$a_instructor))
322 {
323 // error_msg already set
324 return false;
325 }
326//echo "3";
327 // finally assign user to member role in ILIAS
328 $this->join($a_user_obj->getId(),$a_mem_role);
329//echo "4";
330 return true;
331 }
join($a_user_id, $a_mem_role="")
join icrs, assigns user to role @access private
registerUser(&$a_user_obj, $a_instructor=false)

References addUser(), join(), registerUser(), and userExists().

+ Here is the call graph for this function:

◆ addUser()

ilObjiLincCourse::addUser ( $a_user_obj)

Definition at line 728 of file class.ilObjiLincCourse.php.

729 {
730 include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
731 $ilinc_user = new ilObjiLincUser($a_user_obj);
732
733 return $ilinc_user->add();
734 }
Class ilObjiLincUser iLinc related user settings.

Referenced by addMember().

+ Here is the caller graph for this function:

◆ checkiLincMemberStatus()

ilObjiLincCourse::checkiLincMemberStatus (   $a_ilinc_user_id,
  $a_docent_ids,
  $a_student_ids 
)

Definition at line 1115 of file class.ilObjiLincCourse.php.

1116 {
1117 if (in_array($a_ilinc_user_id,$a_docent_ids))
1118 {
1119 return ILINC_MEMBER_DOCENT;
1120 }
1121
1122 if (in_array($a_ilinc_user_id,$a_student_ids))
1123 {
1124 return ILINC_MEMBER_STUDENT;
1125 }
1126
1127 return ILINC_MEMBER_NOTSET;
1128 }

◆ delete()

ilObjiLincCourse::delete ( )

delete object and all related data

@access public

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

Reimplemented from ilObject.

Definition at line 195 of file class.ilObjiLincCourse.php.

196 {
197 global $ilDB;
198
199 // always call parent delete function first!!
200 if (!parent::delete())
201 {
202 return false;
203 }
204
205 //put here your module specific stuff
206 $statement = $ilDB->manipulateF('
207 DELETE FROM ilinc_data WHERE course_id = %s',
208 array('integer'), array($this->getiLincId()));
209
210
211 // TODO: delete data in ilinc_registration table
212 /*
213 * not tested yet
214 */
215/* $statement = $ilDB->manipulateF('
216 DELETE FROM ilinc_registration
217 WHERE obj_id = %s',
218 array('integer'), array($this->getId()));
219
220*/
221
222 // remove course from ilinc server
223 $this->ilincAPI->removeCourse($this->getiLincId());
224 $response = $this->ilincAPI->sendRequest();
225
226 return true;
227 }

References $ilDB, and getiLincId().

+ Here is the call graph for this function:

◆ getAdminIds()

ilObjiLincCourse::getAdminIds (   $a_grpId = "")

get Group Admin Id @access public

Parameters
integergroup id
returnsuserids that are assigned to a group administrator! role

Definition at line 952 of file class.ilObjiLincCourse.php.

953 {
954 global $rbacreview;
955
956 if (!empty($a_grpId))
957 {
958 $grp_id = $a_grpId;
959 }
960 else
961 {
962 $grp_id = $this->getRefId();
963 }
964
965 $usr_arr = array();
966 $roles = $this->getDefaultRoles($this->getRefId());
967
968 foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
969 {
970 array_push($usr_arr,$member_id);
971 }
972
973 return $usr_arr;
974 }
getRefId()
get reference id @access public
getDefaultRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin @access pub...

References getDefaultRoles(), and ilObject\getRefId().

Referenced by removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAKClassValue1()

ilObjiLincCourse::getAKClassValue1 ( )

Definition at line 105 of file class.ilObjiLincCourse.php.

106 {
107 return $this->akclassvalue1;
108 }

Referenced by update().

+ Here is the caller graph for this function:

◆ getAKClassValue2()

ilObjiLincCourse::getAKClassValue2 ( )

Definition at line 110 of file class.ilObjiLincCourse.php.

111 {
112 return $this->akclassvalue2;
113 }

Referenced by update().

+ Here is the caller graph for this function:

◆ getClassrooms()

ilObjiLincCourse::getClassrooms ( )

Definition at line 606 of file class.ilObjiLincCourse.php.

607 {
608 global $ilErr;
609
610 if (!$this->ilias->getSetting("ilinc_active"))
611 {
612 $this->error_msg = "ilinc_server_not_active";
613 return false;
614 }
615
616 $this->ilincAPI->findCourseClasses($this->getiLincId());
617 $response = $this->ilincAPI->sendRequest();
618
619 if ($response->isError())
620 {
621 if (!$response->getErrorMsg())
622 {
623 $this->error_msg = "err_get_classrooms";
624 }
625 else
626 {
627 $this->error_msg = $response->getErrorMsg();
628 }
629
630 return false;
631 }
632
633 if (!$response->data['classes'])
634 {
635
636 $this->error_msg = $response->data['result']['cdata'];
637 return false;
638 }
639
640 foreach ($response->data['classes'] as $class_id => $data)
641 {
642 $this->ilincAPI->findClass($class_id);
643 $response = $this->ilincAPI->sendRequest("findClass");
644
645 if ($response->data['classes'])
646 {
647 $full_class_data[$class_id] = $response->data['classes'][$class_id];
648 }
649 }
650
651 return $full_class_data;
652 }
redirection script todo: (a better solution should control the processing via a xml file)

References $data, $ilErr, and getiLincId().

Referenced by getSubItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjiLincCourse::getDefaultAdminRole ( )

returns object id of created default adminstrator role @access public

Definition at line 599 of file class.ilObjiLincCourse.php.

600 {
601 $local_icrs_Roles = $this->getLocalRoles();
602
603 return $local_icrs_Roles["il_icrs_admin_".$this->getRefId()];
604 }
getLocalRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...

References getLocalRoles().

+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjiLincCourse::getDefaultMemberRole ( )

returns object id of created default member role @access public

Definition at line 588 of file class.ilObjiLincCourse.php.

589 {
590 $local_icrs_Roles = $this->getLocalRoles();
591
592 return $local_icrs_Roles["il_icrs_member_".$this->getRefId()];
593 }

References getLocalRoles().

+ Here is the call graph for this function:

◆ getDefaultRoles()

ilObjiLincCourse::getDefaultRoles (   $a_grp_id = "")

get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin @access public

Parameters
returnsthe obj_ids of group specific roles(il_grp_member,il_grp_admin)

Definition at line 1041 of file class.ilObjiLincCourse.php.

1042 {
1043 global $rbacadmin, $rbacreview;
1044
1045 if (strlen($a_grp_id) > 0)
1046 {
1047 $grp_id = $a_grp_id;
1048 }
1049 else
1050 {
1051 $grp_id = $this->getRefId();
1052 }
1053
1054 $role_arr = $rbacreview->getRolesOfRoleFolder($grp_id);
1055
1056 foreach ($role_arr as $role_id)
1057 {
1058 $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1059
1060 $grp_Member ="il_icrs_member_".$grp_id;
1061 $grp_Admin ="il_icrs_admin_".$grp_id;
1062
1063 if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
1064 {
1065 $arr_grpDefaultRoles["icrs_member_role"] = $role_Obj->getId();
1066 }
1067
1068 if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
1069 {
1070 $arr_grpDefaultRoles["icrs_admin_role"] = $role_Obj->getId();
1071 }
1072 }
1073
1074 return $arr_grpDefaultRoles;
1075 }

References ilObject\getRefId().

Referenced by getAdminIds(), and isAdmin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrorMsg()

ilObjiLincCourse::getErrorMsg ( )

Definition at line 97 of file class.ilObjiLincCourse.php.

98 {
99 $err_msg = $this->error_msg;
100 $this->error_msg = "";
101
102 return $err_msg;
103 }

◆ getiLincId()

ilObjiLincCourse::getiLincId ( )

Definition at line 92 of file class.ilObjiLincCourse.php.

93 {
94 return $this->ilinc_id;
95 }

Referenced by delete(), getClassrooms(), getiLincMemberIds(), registerUser(), registerUsers(), unregisterUser(), unregisterUsers(), update(), and updateClassrooms().

+ Here is the caller graph for this function:

◆ getiLincMemberIds()

ilObjiLincCourse::getiLincMemberIds (   $a_instructorflag = false)

Definition at line 1078 of file class.ilObjiLincCourse.php.

1079 {
1080 if ($a_instructorflag == true)
1081 {
1082 if (!empty($this->docent_ids))
1083 {
1084 return $this->docent_ids;
1085 }
1086 }
1087 else
1088 {
1089 if (!empty($this->student_ids))
1090 {
1091 return $this->student_ids;
1092 }
1093 }
1094
1095 $this->ilincAPI->findRegisteredUsersByRole($this->getiLincId(),$a_instructorflag);
1096 $response = $this->ilincAPI->sendRequest();
1097
1098 if (is_array($response->data['users']))
1099 {
1100 if ($a_instructorflag == true)
1101 {
1102 $this->docent_ids = array_keys($response->data['users']);
1103 }
1104 else
1105 {
1106 $this->student_ids = array_keys($response->data['users']);
1107 }
1108
1109 return array_keys($response->data['users']);
1110 }
1111
1112 return array();
1113 }

References getiLincId().

Referenced by isDocent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalRoles()

ilObjiLincCourse::getLocalRoles (   $a_translate = false)

get ALL local roles of group, also those created and defined afterwards only fetch data once from database.

info is stored in object variable @access public

Returns
return array [title|id] of roles...

Definition at line 492 of file class.ilObjiLincCourse.php.

493 {
494 global $rbacadmin,$rbacreview;
495
496 if (empty($this->local_roles))
497 {
498 $this->local_roles = array();
499 $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
500
501 foreach ($role_arr as $role_id)
502 {
503 if ($rbacreview->isAssignable($role_id,$this->getRefId()) == true)
504 {
505 $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
506
507 if ($a_translate)
508 {
509 $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
510 }
511 else
512 {
513 $role_name = $role_Obj->getTitle();
514 }
515
516 $this->local_roles[$role_name] = $role_Obj->getId();
517 }
518 }
519 }
520
521 return $this->local_roles;
522 }
_getTranslation($a_role_title)

References ilObjRole\_getTranslation(), and ilObject\getRefId().

Referenced by getDefaultAdminRole(), getDefaultMemberRole(), getMemberIds(), and getMemberRolesTitle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberData()

ilObjiLincCourse::getMemberData (   $a_mem_ids,
  $active = 1 
)

get all group Members regardless of group role.

fetch all users data in one shot to improve performance @access public

Parameters
arrayof user ids
Returns
return array of userdata

Definition at line 433 of file class.ilObjiLincCourse.php.

434 {
435 global $rbacadmin, $rbacreview, $ilBench, $ilDB;
436
437 $usr_arr= array();
438
439 $data_types = array();
440 $data_values = array();
441 $cnt_mem_ids = count($a_mem_ids);
442
443 $query = 'SELECT login,firstname,lastname,title,usr_id,ilinc_id
444 FROM usr_data WHERE usr_id IN ';
445
446 if (is_array($a_mem_ids) &&
447 $cnt_mem_ids > 0)
448 {
449 $in = '(';
450 $counter = 0;
451 foreach($a_mem_ids as $mem_id)
452 {
453 array_push($data_values, $mem_id);
454 array_push($data_types, 'integer');
455
456 if($counter > 0) $in .= ',';
457 $in .= '%s';
458 ++$counter;
459 }
460 $in .= ')';
461 $query .= $in;
462 }
463
464 if (is_numeric($active) && $active > -1)
465 {
466 $query .= ' AND active = %s';
467 array_push($data_values,$active);
468 array_push($data_types, 'integer');
469 }
470
471 $r = $ilDB->queryf($query, $data_types, $data_values);
472
473 while($row = $ilDB->fetchObject($r))
474 {
475 $mem_arr[] = array("id" => $row->usr_id,
476 "login" => $row->login,
477 "firstname" => $row->firstname,
478 "lastname" => $row->lastname,
479 "ilinc_id" => $row->ilinc_id
480 );
481 }
482
483 return $mem_arr ? $mem_arr : array();
484 }
global $ilBench
Definition: ilias.php:18

References $ilBench, $ilDB, $in, $query, and $row.

◆ getMemberIds()

ilObjiLincCourse::getMemberIds ( )

get all group Member ids regardless of role @access public

Returns
return array of users (obj_ids) that are assigned to the groupspecific roles (grp_member,grp_admin)

Definition at line 405 of file class.ilObjiLincCourse.php.

406 {
407 global $rbacadmin, $rbacreview;
408
409 $usr_arr= array();
410
411 $rol = $this->getLocalRoles();
412
413 foreach ($rol as $value)
414 {
415 foreach ($rbacreview->assignedUsers($value) as $member_id)
416 {
417 array_push($usr_arr,$member_id);
418 }
419 }
420
421 $mem_arr = array_unique($usr_arr);
422
423 return $mem_arr ? $mem_arr : array();
424 }

References getLocalRoles().

Referenced by isMember(), and removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberRoles()

ilObjiLincCourse::getMemberRoles (   $a_user_id)

get group member status @access public

Parameters
integeruser_id
Returns
returns array of obj_ids of assigned local roles

Definition at line 388 of file class.ilObjiLincCourse.php.

389 {
390 global $rbacadmin, $rbacreview;
391
392 $arr_assignedRoles = array();
393
394 $arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalRoles());
395
396 return $arr_assignedRoles;
397 }

Referenced by leave().

+ Here is the caller graph for this function:

◆ getMemberRolesTitle()

ilObjiLincCourse::getMemberRolesTitle (   $a_user_id)

get group member status @access public

Parameters
integeruser_id
Returns
returns string of role titles

Definition at line 530 of file class.ilObjiLincCourse.php.

531 {
532 global $ilDB,$ilBench;
533
534 include_once ('./Services/AccessControl/classes/class.ilObjRole.php');
535
536 $str_member_roles ="";
537
538 $data_types = array();
539 $data_values = array();
540
541 $query = 'SELECT title FROM object_data
542 LEFT JOIN rbac_ua ON object_data.obj_id = rbac_ua.rol_id
543 WHERE object_data.type = %s
544 AND rbac_ua.usr_id = %s
545 AND rbac_ua.rol_id IN';
546
547 array_push($data_types, 'text', 'integer');
548 array_push($data_values,'role', $a_user_id);
549
550 $local_roles = $this->getLocalRoles();
551 $cnt_local_roles = count($local_roles);
552
553 if (is_array($local_roles) &&
554 $cnt_local_roles > 0)
555 {
556 $in = '(';
557 $counter = 0;
558 foreach($local_roles as $local_role)
559 {
560 array_push($data_values, $local_role);
561 array_push($data_types, 'integer');
562
563 if($counter > 0) $in .= ',';
564 $in .= '%s';
565 ++$counter;
566 }
567 $in .= ')';
568 $query .= $in;
569 }
570 $cnt_data_values = count($data_values);
571 $cnt_data_types = count($data_types);
572
573 $r = $ilDB->queryf($query, $data_types, $data_values);
574
575 while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
576 {
577 // display human readable role names for autogenerated roles
578 $str_member_roles .= ilObjRole::_getTranslation($row["title"]).", ";
579 }
580
581 return substr($str_member_roles,0,-2);
582 }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10

References $ilBench, $ilDB, $in, $query, $row, ilObjRole\_getTranslation(), DB_FETCHMODE_ASSOC, and getLocalRoles().

+ Here is the call graph for this function:

◆ getSubItems()

ilObjiLincCourse::getSubItems ( )

get all subitems of the container overwrites method in ilContainerGUI

Definition at line 1194 of file class.ilObjiLincCourse.php.

1195 {
1196 $objects = array();
1197
1198 if(!($objects = $this->getClassrooms()))
1199 {
1200 ilUtil::sendInfo($this->lng->txt($this->getErrorMsg()));
1201 return array();
1202 }
1203
1204 foreach((array)$objects as $key => $object)
1205 {
1206 $this->items['icla'][$key] = $object;
1207 }
1208
1209 return is_array($this->items) ? $this->items : array();
1210 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References getClassrooms(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ getViewMode()

ilObjiLincCourse::getViewMode ( )

Get container view mode.

Reimplemented from ilContainer.

Definition at line 56 of file class.ilObjiLincCourse.php.

57 {
59 }

References ilContainer\VIEW_ILINC.

◆ ilObjiLincCourse()

ilObjiLincCourse::ilObjiLincCourse (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor @access public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 45 of file class.ilObjiLincCourse.php.

46 {
47 $this->type = 'icrs';
48 $this->ilObject($a_id,$a_call_by_reference);
49 $this->setRegisterMode(false);
50 $this->ilincAPI = new ilnetucateXMLAPI();
51
52 $this->docent_ids = array();
53 $this->student_ids = array();
54 }
ilObject($a_id=0, $a_reference=true)
Constructor @access public.
setRegisterMode($a_bool)
API to communicate with a the CMSAPI of centra (c) Sascha Hofmann, 2004.

References ilObject\ilObject(), and ilObject\setRegisterMode().

+ Here is the call graph for this function:

◆ isAdmin()

ilObjiLincCourse::isAdmin (   $a_user_id)

is Admin @access public

Parameters
integeruser_id
boolean,trueif user is group administrator

Definition at line 1020 of file class.ilObjiLincCourse.php.

1021 {
1022 global $rbacreview;
1023
1024 $icrs_roles = $this->getDefaultRoles();
1025
1026 if (in_array($a_user_id,$rbacreview->assignedUsers($icrs_roles["icrs_admin_role"])))
1027 {
1028 return true;
1029 }
1030 else
1031 {
1032 return false;
1033 }
1034 }

References getDefaultRoles().

Referenced by removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDocent()

ilObjiLincCourse::isDocent (   $a_user_obj = "")

Definition at line 753 of file class.ilObjiLincCourse.php.

754 {
755 if (!$a_user_obj)
756 {
757 $a_user_obj =& $this->ilias->account;
758 }
759
760 $docents = $this->getiLincMemberIds(true);
761
762 include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
763 $ilinc_user = new ilObjiLincUser($a_user_obj);
764
765 if (in_array($ilinc_user->id,$docents))
766 {
767 return true;
768 }
769
770 return false;
771 }
getiLincMemberIds($a_instructorflag=false)

References getiLincMemberIds().

+ Here is the call graph for this function:

◆ isMember()

ilObjiLincCourse::isMember (   $a_user_id = "")

Definition at line 736 of file class.ilObjiLincCourse.php.

737 {
738 if (strlen($a_user_id) == 0)
739 {
740 $a_user_id = $this->ilias->account->getId();
741 }
742
743 $arr_members = $this->getMemberIds();
744
745 if (in_array($a_user_id, $arr_members))
746 {
747 return true;
748 }
749
750 return false;
751 }
getMemberIds()
get all group Member ids regardless of role @access public

References getMemberIds().

Referenced by removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ join()

ilObjiLincCourse::join (   $a_user_id,
  $a_mem_role = "" 
)

join icrs, assigns user to role @access private

Parameters
integermember status = obj_id of local_group_role

Definition at line 338 of file class.ilObjiLincCourse.php.

339 {
340 global $rbacadmin;
341
342 if (is_array($a_mem_role))
343 {
344 foreach ($a_mem_role as $role)
345 {
346 $rbacadmin->assignUser($role,$a_user_id, false);
347 }
348 }
349 else
350 {
351 $rbacadmin->assignUser($a_mem_role,$a_user_id, false);
352 }
353
354 return true;
355 }

Referenced by addMember().

+ Here is the caller graph for this function:

◆ leave()

ilObjiLincCourse::leave (   $a_user_id)

deassign member from group role @access private

Definition at line 361 of file class.ilObjiLincCourse.php.

362 {
363 global $rbacadmin;
364
365 $arr_groupRoles = $this->getMemberRoles($a_user_id);
366
367 if (is_array($arr_groupRoles))
368 {
369 foreach ($arr_groupRoles as $groupRole)
370 {
371 $rbacadmin->deassignUser($groupRole, $a_user_id);
372 }
373 }
374 else
375 {
376 $rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
377 }
378
379 return true;
380 }
getMemberRoles($a_user_id)
get group member status @access public

References getMemberRoles().

Referenced by removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notify()

ilObjiLincCourse::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 happend, each object may decide how it reacts.

If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)

@access public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

Reimplemented from ilObject.

Definition at line 287 of file class.ilObjiLincCourse.php.

288 {
289 return true;
290 }

◆ read()

ilObjiLincCourse::read ( )

@access private

Reimplemented from ilContainer.

Definition at line 65 of file class.ilObjiLincCourse.php.

66 {
67 global $ilDB, $ilErr;
68
69 parent::read();
70
71 // TODO: fetching default role should be done in rbacadmin
72 $r = $ilDB->queryf('
73 SELECT * FROM ilinc_data
74 WHERE obj_id = %s',
75 array('integer'), array($this->id));
76
77 if($ilDB->numRows($r) > 0)
78 {
79 $data = $ilDB->fetchObject($r);
80
81 $this->ilinc_id = $data->course_id;
82 $this->activated = ilUtil::yn2tf($data->activation_offline);
83 $this->akclassvalue1 = $data->akclassvalue1;
84 $this->akclassvalue2 = $data->akclassvalue2;
85 }
86 else
87 {
88 $ilErr->raiseError("<b>Error: There is no dataset with id ".$this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__."<br />Line: ".__LINE__, $ilErr->FATAL);
89 }
90 }

References $data, $ilDB, $ilErr, and ilUtil\yn2tf().

+ Here is the call graph for this function:

◆ registerUser()

ilObjiLincCourse::registerUser ( $a_user_obj,
  $a_instructor = false 
)

Definition at line 773 of file class.ilObjiLincCourse.php.

774 {
775 if ($a_instructor === true)
776 {
777 $a_instructor = "True";
778 }
779 else
780 {
781 $a_instructor = "False";
782 }
783
784 include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
785 $ilinc_user = new ilObjiLincUser($a_user_obj);
786
787 $user[] = array('id' => $ilinc_user->id, 'instructor' => $a_instructor);
788 $this->ilincAPI->registerUser($this->getiLincId(),$user);
789 $response = $this->ilincAPI->sendRequest("registerUser");
790
791 if ($response->isError())
792 {
793 if (!$response->getErrorMsg())
794 {
795 $this->error_msg = "err_register_user";
796 }
797 else
798 {
799 $this->error_msg = $response->getErrorMsg();
800 }
801
802 return false;
803 }
804
805 return true;
806 }

References getiLincId().

Referenced by addMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerUsers()

ilObjiLincCourse::registerUsers (   $a_user_arr)

Definition at line 808 of file class.ilObjiLincCourse.php.

809 {
810 foreach ($a_user_arr as $user_id => $instructorflag)
811 {
812 $flag = "False";
813
814 if ($instructorflag == ILINC_MEMBER_DOCENT)
815 {
816 $flag = "True";
817 }
818
819 $ilinc_users[] = array('id' => $user_id,'instructor' => $flag);
820 }
821
822 $this->ilincAPI->registerUser($this->getiLincId(),$ilinc_users);
823 $response = $this->ilincAPI->sendRequest("registerUser");
824
825 if ($response->isError())
826 {
827 if (!$response->getErrorMsg())
828 {
829 $this->error_msg = "err_register_users";
830 }
831 else
832 {
833 $this->error_msg = $response->getErrorMsg();
834 }
835
836 return false;
837 }
838
839 return true;
840 }

References getiLincId().

+ Here is the call graph for this function:

◆ removeMember()

ilObjiLincCourse::removeMember ( $a_user_obj)

removes Member from group @access public

Definition at line 980 of file class.ilObjiLincCourse.php.

981 {
982 if (!isset($a_user_obj))
983 {
984 $this->error_msg = get_class($this)."::removeMember(): Missing parameters !";
985 return false;
986 }
987
988 if (!$this->isMember($a_user_obj->getId()))
989 {
990 return true;
991 }
992
993 if (count($this->getMemberIds()) > 1)
994 {
995 if ($this->isAdmin($a_user_obj->getId()) && count($this->getAdminIds()) < 2)
996 {
997 $this->error_msg = "ilinc_err_administrator_required";
998 return false;
999 }
1000 }
1001
1002 // unregister from course on iLinc server
1003 if (!$this->unregisterUser($a_user_obj))
1004 {
1005 // error_msg already set
1006 return false;
1007 }
1008
1009 $this->leave($a_user_obj->getId());
1010
1011 return true;
1012 }
getAdminIds($a_grpId="")
get Group Admin Id @access public
leave($a_user_id)
deassign member from group role @access private
isAdmin($a_user_id)
is Admin @access public

References getAdminIds(), getMemberIds(), isAdmin(), isMember(), leave(), and unregisterUser().

+ Here is the call graph for this function:

◆ saveActivationStatus()

ilObjiLincCourse::saveActivationStatus (   $a_activated)

Definition at line 245 of file class.ilObjiLincCourse.php.

246 {
247 global $ilDB;
248
249 $statement = $ilDB->manipulateF('
250 UPDATE ilinc_data
251 SET activation_offline = %s
252 WHERE obj_id = %s',
253 array('text', 'integer'),
254 array($a_activated, $this->getId()));
255
256 }
getId()
get object id @access public

References $ilDB, and ilObject\getId().

+ Here is the call graph for this function:

◆ saveAKClassValues()

ilObjiLincCourse::saveAKClassValues (   $a_akclassvalue1,
  $a_akclassvalue2 
)

Definition at line 259 of file class.ilObjiLincCourse.php.

260 {
261 global $ilDB;
262
263 $statement = $ilDB->manipulateF('
264 UPDATE ilinc_data
265 SET akclassvalue1 = %s,
266 akclassvalue2 = %s
267 WHERE obj_id = %s',
268 array('text', 'text', 'integer'),
269 array($a_akclassvalue1, $a_akclassvalue2, $this->getId()));
270
271 }

References $ilDB, and ilObject\getId().

+ Here is the call graph for this function:

◆ setAKClassValue1()

ilObjiLincCourse::setAKClassValue1 (   $a_str)

Definition at line 115 of file class.ilObjiLincCourse.php.

116 {
117 $this->akclassvalue1 = $a_str;
118 }

◆ setAKClassValue2()

ilObjiLincCourse::setAKClassValue2 (   $a_str)

Definition at line 120 of file class.ilObjiLincCourse.php.

121 {
122 $this->akclassvalue2 = $a_str;
123 }

◆ storeiLincId()

ilObjiLincCourse::storeiLincId (   $a_icrs_id)

Definition at line 230 of file class.ilObjiLincCourse.php.

231 {
232 global $ilDB;
233
234 $statement = $ilDB->manipulateF('
235 INSERT INTO ilinc_data (
236 obj_id, i_type, course_id, activation_offline)
237 VALUES (%s, %s, %s, %s)',
238 array('integer', 'text', 'integer', 'text'),
239 array($this->id,'icrs',$a_icrs_id,$this->activated));
240
241 $this->ilinc_id = $a_icrs_id;
242 }

References $ilDB.

◆ unregisterUser()

ilObjiLincCourse::unregisterUser (   $a_user_obj)

Definition at line 843 of file class.ilObjiLincCourse.php.

844 {
845 include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
846 $ilinc_user = new ilObjiLincUser($a_user_obj);
847
848 // do not send request if user is not registered at iLinc server at all
849 if ($ilinc_user->id == '0')
850 {
851 return true;
852 }
853
854 $this->ilincAPI->unregisterUser($this->getiLincId(),array($ilinc_user->id));
855 $response = $this->ilincAPI->sendRequest();
856
857 if ($response->isError())
858 {
859 if (!$response->getErrorMsg())
860 {
861 $this->error_msg = "err_unregister_user";
862 }
863 else
864 {
865 $this->error_msg = $response->getErrorMsg();
866 }
867
868 return false;
869 }
870
871 return true;
872 }

References getiLincId().

Referenced by removeMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterUsers()

ilObjiLincCourse::unregisterUsers (   $a_ilinc_user_ids)

Definition at line 874 of file class.ilObjiLincCourse.php.

875 {
876 $this->ilincAPI->unregisterUser($this->getiLincId(),$a_ilinc_user_ids);
877 $response = $this->ilincAPI->sendRequest();
878
879 if ($response->isError())
880 {
881 if (!$response->getErrorMsg())
882 {
883 $this->error_msg = "err_unregister_users";
884 }
885 else
886 {
887 $this->error_msg = $response->getErrorMsg();
888 }
889
890 return false;
891 }
892
893 return true;
894 }

References getiLincId().

+ Here is the call graph for this function:

◆ update()

ilObjiLincCourse::update ( )

update object data

@access public

Returns
boolean

Reimplemented from ilContainer.

Definition at line 131 of file class.ilObjiLincCourse.php.

132 {
133 global $ilDB;
134
135 $this->ilincAPI->editCourse($this->getiLincId(),$_POST["Fobject"]);
136 $response = $this->ilincAPI->sendRequest();
137
138 if ($response->isError())
139 {
140 $this->error_msg = $response->getErrorMsg();
141 return false;
142 }
143
144 // TODO: alter akclassvalues of classes here
145
146 if (!parent::update())
147 {
148 $this->error_msg = "database_error";
149 return false;
150 }
151
152 $db_activated_value = is_bool($this->activated) ? ($this->activated ? 'y' : 'n') : $this->activated;
153
154 $r = $ilDB->manipulateF('
155 UPDATE ilinc_data
156 SET activation_offline = %s,
157 akclassvalue1 = %s,
158 akclassvalue2 = %s
159 WHERE obj_id = %s',
160 array('text', 'text', 'text', 'integer'),
161 array($db_activated_value, $this->getAKClassValue1(), $this->getAKClassValue2(), $this->getId()));
162
163 return true;
164 }

References $_POST, $ilDB, getAKClassValue1(), getAKClassValue2(), ilObject\getId(), and getiLincId().

+ Here is the call graph for this function:

◆ updateClassrooms()

ilObjiLincCourse::updateClassrooms ( )

Definition at line 654 of file class.ilObjiLincCourse.php.

655 {
656 global $ilErr;
657
658 $this->ilincAPI->findCourseClasses($this->getiLincId());
659 $response = $this->ilincAPI->sendRequest();
660
661 if ($response->isError())
662 {
663 if (!$response->getErrorMsg())
664 {
665 $this->error_msg = "err_get_classrooms";
666 }
667 else
668 {
669 $this->error_msg = $response->getErrorMsg();
670 }
671
672 return false;
673 }
674
675 if (!$response->data['classes'])
676 {
677
678 $this->error_msg = $response->data['result']['cdata'];
679 return false;
680 }
681
682 if (array_key_exists('akclassvalue1',$_POST["Fobject"]))
683 {
684 $data["akclassvalue1"] = $_POST["Fobject"]["akclassvalue1"];
685 }
686
687 if (array_key_exists('akclassvalue2',$_POST["Fobject"]))
688 {
689 $data["akclassvalue2"] = $_POST["Fobject"]["akclassvalue2"];
690 }
691
692 foreach ($response->data['classes'] as $class_id => $data2)
693 {
694 include_once("./Modules/ILinc/classes/class.ilObjiLincClassroom.php");
695 $icla_obj = new ilObjiLincClassroom($class_id,$this->ref_id);
696
697 if (!$icla_obj->update($data))
698 {
699 $this->error_msg = $icla_obj->getErrorMsg();
700
701 return false;
702 }
703
704 unset($icla_obj);
705 }
706
707 return true;
708 }
Class ilObjiLincClassroom.

References $_POST, $data, $ilErr, and getiLincId().

+ Here is the call graph for this function:

◆ uploadPicture()

ilObjiLincCourse::uploadPicture ( $a_user_obj,
  $a_lang 
)

Definition at line 923 of file class.ilObjiLincCourse.php.

924 {
925 $this->ilincAPI->uploadPicture($a_user_obj,$a_lang);
926 $response = $this->ilincAPI->sendRequest("uploadPicture");
927
928 if ($response->isError())
929 {
930 if (!$response->getErrorMsg())
931 {
932 $this->error_msg = "err_upload_picture";
933 }
934 else
935 {
936 $this->error_msg = $response->getErrorMsg();
937 }
938
939 return false;
940 }
941
942 // return URL to user's personal page
943 return $response->data['url']['cdata'];
944 }

◆ userExists()

ilObjiLincCourse::userExists ( $a_user_obj)

Definition at line 712 of file class.ilObjiLincCourse.php.

713 {
714 //$data = $a_user_obj->getiLincData();
715
716 include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
717 $ilinc_user = new ilObjiLincUser($a_user_obj);
718
719 if (!$ilinc_user->id and !$ilinc_user->login)
720 {
721 return false;
722 }
723
724 return true;
725 }

Referenced by addMember().

+ Here is the caller graph for this function:

◆ userLogin()

ilObjiLincCourse::userLogin ( $a_user_obj)

Definition at line 896 of file class.ilObjiLincCourse.php.

897 {
898 include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
899 $ilinc_user = new ilObjiLincUser($a_user_obj);
900
901 $this->ilincAPI->userLogin($ilinc_user);
902 $response = $this->ilincAPI->sendRequest("userLogin");
903
904 if ($response->isError())
905 {
906 if (!$response->getErrorMsg())
907 {
908 $this->error_msg = "err_user_login";
909 }
910 else
911 {
912 $this->error_msg = $response->getErrorMsg();
913 }
914
915 return false;
916 }
917
918 // return URL to join class room
919 return $response->data['url']['cdata'];
920 }

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