ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 public.
 getViewMode ()
 Get container view mode.
 read ()
 private
 getiLincId ()
 getErrorMsg ()
 getAKClassValue1 ()
 getAKClassValue2 ()
 setAKClassValue1 ($a_str)
 setAKClassValue2 ($a_str)
 update ()
 update object data
 addCourse ()
 create course on iLinc server
 delete ()
 delete object and all related data
 storeiLincId ($a_icrs_id)
 saveActivationStatus ($a_activated)
 saveAKClassValues ($a_akclassvalue1, $a_akclassvalue2)
 initDefaultRoles ()
 init default roles settings
 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.
 addMember (&$a_user_obj, $a_mem_role, $a_instructor=false)
 add Member to iLic course public
 join ($a_user_id, $a_mem_role="")
 join icrs, assigns user to role private
 leave ($a_user_id)
 deassign member from group role private
 getMemberRoles ($a_user_id)
 get group member status public
 getMemberIds ()
 get all group Member ids regardless of role public
 getMemberData ($a_mem_ids, $active=1)
 get all group Members regardless of group role.
 getLocalRoles ($a_translate=false)
 get ALL local roles of group, also those created and defined afterwards only fetch data once from database.
 getMemberRolesTitle ($a_user_id)
 get group member status public
 getDefaultMemberRole ()
 returns object id of created default member role public
 getDefaultAdminRole ()
 returns object id of created default adminstrator role public
 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 public
 removeMember (&$a_user_obj)
 removes Member from group public
 isAdmin ($a_user_id)
 is Admin public
 getDefaultRoles ($a_grp_id="")
 get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public
 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)
 __setCourseStatus ()
 getSubItems ()
 get all subitems of the container overwrites method in ilContainerGUI
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public.
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not)
 read ($a_force_db=false)
 read object data from db into object
 getId ()
 get object id public
 setId ($a_id)
 set object id public
 setRefId ($a_id)
 set reference id public
 getRefId ()
 get reference id public
 getType ()
 get object type public
 setType ($a_type)
 set object type public
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions
 getTitle ()
 get object title public
 getUntranslatedTitle ()
 get untranslated object title public
 setTitle ($a_title)
 set object title
 getDescription ()
 get object description
 setDescription ($a_desc)
 set object description
 getLongDescription ()
 get object long description (stored in object_description)
 getImportId ()
 get import id
 setImportId ($a_import_id)
 set import id
 _lookupObjIdByImportId ($a_import_id)
 getOwner ()
 get object owner
 getOwnerName ()
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id
 setOwner ($a_owner)
 set object owner
 getCreateDate ()
 get create date public
 getLastUpdateDate ()
 get last update date public
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class)
 create ()
 create
 MDUpdateListener ($a_element)
 Meta data update listener.
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 updateOwner ()
 update owner of object in db
 _getIdForImportId ($a_import_id)
 get current object id for import id (static)
 _getAllReferences ($a_id)
 get all reference ids of object
 _lookupTitle ($a_id)
 lookup object title
 _lookupDescription ($a_id)
 lookup object description
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _lookupObjId ($a_id)
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static)
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static)
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static)
 _lookupType ($a_id, $a_reference=false)
 lookup object type
 _isInTrash ($a_ref_id)
 checks wether object is in trash
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash
 _lookupObjectId ($a_ref_id)
 lookup object id
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!?
 setPermissions ($a_parent_ref)
 set permissions of object
 createReference ()
 creates reference for object
 countReferences ()
 count references of object
 createRoleFolder ()
 creates a local role folder
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getXMLZip ()
 getHTMLDirectory ()
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container.
 cloneMetaData ($target_obj)
 Copy meta data.
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor public.
 createContainerDirectory ()
 Create directory for the container.
 getContainerDirectory ()
 Get the container directory.
 _getContainerDirectory ($a_id)
 Get the container directory.
 getBigIconPath ()
 Get path for big icon.
 getSmallIconPath ()
 Get path for small icon.
 getTinyIconPath ()
 Get path for tiny icon.
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems).
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems).
 _lookupContainerSetting ($a_id, $a_keyword)
 Lookup a container setting.
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path
 saveIcons ($a_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons
 removeBigIcon ()
 remove big icon
 removeSmallIcon ()
 remove small icon
 removeTinyIcon ()
 remove tiny icon
 getFirstColumn ()
 Get right column.
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings.
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting)
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 clone all objects according to this container
 getOrderType ()
 Get order type default implementation.
 setOrderType ($a_value)
 getSubItems ($a_include_hidden_files=false, $a_include_side_block=false)
 Get subitems of container.
 gotItems ()
 Check whether we got any items.
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g.
 getGroupedObjTypes ()
 Get grouped repository object types.
 enablePageEditing ()
 Check whether page editing is allowed for container.

Static Public Member Functions

 _getLinkToObject ($a_id)
 STATIC METHOD create a link to the object.
- Static Public Member Functions inherited from ilObject
static _getIdsForTitle ($title, $type= '')
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)

Additional Inherited Members

- Data Fields inherited from ilObject
 $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
- 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 SORT_TITLE = 0
const SORT_MANUAL = 1
const SORT_ACTIVATION = 2
- 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:
class.ilObjiLincCourse.php 18700 2009-01-22 14:59:46Z mjansen

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

Member Function Documentation

ilObjiLincCourse::__setCourseStatus ( )

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

Referenced by initDefaultRoles().

{
// empty
}

+ Here is the caller graph for this function:

ilObjiLincCourse::_getAKClassValues (   $a_course_obj_id)

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

References ilObject\$ilias, and DB_FETCHMODE_OBJECT.

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

{
global $ilDB,$ilias;
$q = "SELECT akclassvalue1, akclassvalue2 FROM ilinc_data WHERE obj_id=".$ilDB->quote($a_course_obj_id);
$r = $ilDB->query($q);
$row = $r->fetchRow(DB_FETCHMODE_OBJECT);
return $akclassvalues = array($row->akclassvalue1,$row->akclassvalue2);
}

+ Here is the caller graph for this function:

ilObjiLincCourse::_getLinkToObject (   $a_id)
static

STATIC METHOD create a link to the object.

Parameters
intuniq id
Returns
array array('link','target') public

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

{
return array("repository.php?ref_id=".$a_id."&set_mode=flat&cmdClass=ilobjilinccoursegui","");
}
ilObjiLincCourse::_isActivated (   $a_course_obj_id)

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

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

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

{
global $ilDB,$ilias;
if (!$ilias->getSetting("ilinc_active"))
{
return false;
}
$q = "SELECT activation_offline FROM ilinc_data WHERE obj_id=".$ilDB->quote($a_course_obj_id);
$r = $ilDB->query($q);
$row = $r->fetchRow(DB_FETCHMODE_OBJECT);
return ilUtil::yn2tf($row->activation_offline);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::_isMember (   $a_user_id,
  $a_ref_id 
)

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

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

{
global $rbacreview;
$rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
$local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
$user_roles = $rbacreview->assignedRoles($a_user_id);
if (!array_intersect($local_roles,$user_roles))
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilObjiLincCourse::addCourse ( )

create course on iLinc server

public

Returns
boolean

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

{
$this->ilincAPI->addCourse($_POST["Fobject"]);
$response = $this->ilincAPI->sendRequest();
if ($response->isError())
{
$this->error_msg = $response->getErrorMsg();
return false;
}
$this->ilinc_id = $response->getFirstID();
return true;
}
ilObjiLincCourse::addMember ( $a_user_obj,
  $a_mem_role,
  $a_instructor = false 
)

add Member to iLic course 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 332 of file class.ilObjiLincCourse.php.

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

{
global $rbacadmin;
//echo "0";
if (!isset($a_user_obj) && !isset($a_mem_role))
{
$this->error_msg = get_class($this)."::addMember(): Missing parameters !";
return false;
}
//echo "1";
// check if user is registered at iLinc server
if (!$this->userExists($a_user_obj))
{
// if not, add user on iLinc server
if ($this->addUser($a_user_obj) == false)
{
// error_msg already set
return false;
}
}
//echo "2";
// assign membership to icourse on iLinc server
if (!$this->registerUser($a_user_obj,$a_instructor))
{
// error_msg already set
return false;
}
//echo "3";
// finally assign user to member role in ILIAS
$this->join($a_user_obj->getId(),$a_mem_role);
//echo "4";
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::addUser ( $a_user_obj)

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

Referenced by addMember().

{
include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
$ilinc_user = new ilObjiLincUser($a_user_obj);
return $ilinc_user->add();
}

+ Here is the caller graph for this function:

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

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

{
if (in_array($a_ilinc_user_id,$a_docent_ids))
{
return ILINC_MEMBER_DOCENT;
}
if (in_array($a_ilinc_user_id,$a_student_ids))
{
return ILINC_MEMBER_STUDENT;
}
return ILINC_MEMBER_NOTSET;
}
ilObjiLincCourse::delete ( )

delete object and all related data

public

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

Reimplemented from ilObject.

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

References getiLincId().

{
global $ilDB;
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
//put here your module specific stuff
$q = "DELETE FROM ilinc_data WHERE course_id = ".$ilDB->quote($this->getiLincId());
$ilDB->query($q);
// TODO: delete data in ilinc_registration table
// remove course from ilinc server
$this->ilincAPI->removeCourse($this->getiLincId());
$response = $this->ilincAPI->sendRequest();
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::getAdminIds (   $a_grpId = "")

get Group Admin Id public

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

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

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

Referenced by removeMember().

{
global $rbacreview;
if (!empty($a_grpId))
{
$grp_id = $a_grpId;
}
else
{
$grp_id = $this->getRefId();
}
$usr_arr = array();
$roles = $this->getDefaultRoles($this->getRefId());
foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
{
array_push($usr_arr,$member_id);
}
return $usr_arr;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::getAKClassValue1 ( )

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

{
return $this->akclassvalue1;
}
ilObjiLincCourse::getAKClassValue2 ( )

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

{
return $this->akclassvalue2;
}
ilObjiLincCourse::getClassrooms ( )

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

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

Referenced by getSubItems().

{
global $ilErr;
if (!$this->ilias->getSetting("ilinc_active"))
{
$this->error_msg = "ilinc_server_not_active";
return false;
}
$this->ilincAPI->findCourseClasses($this->getiLincId());
$response = $this->ilincAPI->sendRequest();
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_get_classrooms";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
if (!$response->data['classes'])
{
$this->error_msg = $response->data['result']['cdata'];
return false;
}
foreach ($response->data['classes'] as $class_id => $data)
{
$this->ilincAPI->findClass($class_id);
$response = $this->ilincAPI->sendRequest("findClass");
if ($response->data['classes'])
{
$full_class_data[$class_id] = $response->data['classes'][$class_id];
}
}
return $full_class_data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::getDefaultAdminRole ( )

returns object id of created default adminstrator role public

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

References getLocalRoles().

{
$local_icrs_Roles = $this->getLocalRoles();
return $local_icrs_Roles["il_icrs_admin_".$this->getRefId()];
}

+ Here is the call graph for this function:

ilObjiLincCourse::getDefaultMemberRole ( )

returns object id of created default member role public

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

References getLocalRoles().

{
$local_icrs_Roles = $this->getLocalRoles();
return $local_icrs_Roles["il_icrs_member_".$this->getRefId()];
}

+ Here is the call graph for this function:

ilObjiLincCourse::getDefaultRoles (   $a_grp_id = "")

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

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

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

References ilObject\getRefId().

Referenced by getAdminIds(), and isAdmin().

{
global $rbacadmin, $rbacreview;
if (strlen($a_grp_id) > 0)
{
$grp_id = $a_grp_id;
}
else
{
$grp_id = $this->getRefId();
}
$rolf = $rbacreview->getRoleFolderOfObject($grp_id);
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
$role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
$grp_Member ="il_icrs_member_".$grp_id;
$grp_Admin ="il_icrs_admin_".$grp_id;
if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
{
$arr_grpDefaultRoles["icrs_member_role"] = $role_Obj->getId();
}
if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
{
$arr_grpDefaultRoles["icrs_admin_role"] = $role_Obj->getId();
}
}
return $arr_grpDefaultRoles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::getErrorMsg ( )

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

{
$err_msg = $this->error_msg;
$this->error_msg = "";
return $err_msg;
}
ilObjiLincCourse::getiLincId ( )

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

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

{
return $this->ilinc_id;
}

+ Here is the caller graph for this function:

ilObjiLincCourse::getiLincMemberIds (   $a_instructorflag = false)

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

References getiLincId().

Referenced by isDocent().

{
if ($a_instructorflag == true)
{
if (!empty($this->docent_ids))
{
return $this->docent_ids;
}
}
else
{
if (!empty($this->student_ids))
{
return $this->student_ids;
}
}
$this->ilincAPI->findRegisteredUsersByRole($this->getiLincId(),$a_instructorflag);
$response = $this->ilincAPI->sendRequest();
if (is_array($response->data['users']))
{
if ($a_instructorflag == true)
{
$this->docent_ids = array_keys($response->data['users']);
}
else
{
$this->student_ids = array_keys($response->data['users']);
}
return array_keys($response->data['users']);
}
return array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 public

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

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

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

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

{
global $rbacadmin,$rbacreview;
if (empty($this->local_roles))
{
$this->local_roles = array();
$rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
if ($rbacreview->isAssignable($role_id,$rolf["ref_id"]) == true)
{
$role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
if ($a_translate)
{
$role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
}
else
{
$role_name = $role_Obj->getTitle();
}
$this->local_roles[$role_name] = $role_Obj->getId();
}
}
}
return $this->local_roles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 public

Parameters
arrayof user ids
Returns
return array of userdata

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

References $ilBench, and DB_FETCHMODE_OBJECT.

{
global $rbacadmin, $rbacreview, $ilBench, $ilDB;
$usr_arr= array();
$q = "SELECT login,firstname,lastname,title,usr_id,ilinc_id ".
"FROM usr_data ".
"WHERE usr_id IN (".implode(',',$a_mem_ids).")";
if (is_numeric($active) && $active > -1)
$q .= "AND active = ".$ilDB->quote($active);
$r = $ilDB->query($q);
while($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
{
$mem_arr[] = array("id" => $row->usr_id,
"login" => $row->login,
"firstname" => $row->firstname,
"lastname" => $row->lastname,
"ilinc_id" => $row->ilinc_id
);
}
return $mem_arr ? $mem_arr : array();
}
ilObjiLincCourse::getMemberIds ( )

get all group Member ids regardless of role public

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

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

References getLocalRoles().

Referenced by isMember(), and removeMember().

{
global $rbacadmin, $rbacreview;
$usr_arr= array();
$rol = $this->getLocalRoles();
foreach ($rol as $value)
{
foreach ($rbacreview->assignedUsers($value) as $member_id)
{
array_push($usr_arr,$member_id);
}
}
$mem_arr = array_unique($usr_arr);
return $mem_arr ? $mem_arr : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::getMemberRoles (   $a_user_id)

get group member status public

Parameters
integeruser_id
Returns
returns array of obj_ids of assigned local roles

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

References getLocalRoles().

Referenced by leave().

{
global $rbacadmin, $rbacreview;
$arr_assignedRoles = array();
$arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalRoles());
return $arr_assignedRoles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::getMemberRolesTitle (   $a_user_id)

get group member status public

Parameters
integeruser_id
Returns
returns string of role titles

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

References $ilBench, ilObjRole\_getTranslation(), DB_FETCHMODE_ASSOC, and getLocalRoles().

{
global $ilDB,$ilBench;
include_once ('./Services/AccessControl/classes/class.ilObjRole.php');
$str_member_roles ="";
$q = "SELECT title ".
"FROM object_data ".
"LEFT JOIN rbac_ua ON object_data.obj_id=rbac_ua.rol_id ".
"WHERE object_data.type = 'role' ".
"AND rbac_ua.usr_id = ".$ilDB->quote($a_user_id)." ".
"AND rbac_ua.rol_id IN (".implode(',',$this->getLocalRoles()).")";
$r = $ilDB->query($q);
while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
{
// display human readable role names for autogenerated roles
$str_member_roles .= ilObjRole::_getTranslation($row["title"]).", ";
}
return substr($str_member_roles,0,-2);
}

+ Here is the call graph for this function:

ilObjiLincCourse::getSubItems ( )

get all subitems of the container overwrites method in ilContainerGUI

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

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

{
$objects = array();
if(!($objects = $this->getClassrooms()))
{
ilUtil::sendInfo($this->lng->txt($this->getErrorMsg()));
return array();
}
foreach((array)$objects as $key => $object)
{
$this->items['icla'][$key] = $object;
}
return is_array($this->items) ? $this->items : array();
}

+ Here is the call graph for this function:

ilObjiLincCourse::getViewMode ( )

Get container view mode.

Reimplemented from ilContainer.

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

References ilContainer\VIEW_ILINC.

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

Constructor 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.

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

{
$this->type = 'icrs';
$this->ilObject($a_id,$a_call_by_reference);
$this->setRegisterMode(false);
$this->ilincAPI = new ilnetucateXMLAPI();
$this->docent_ids = array();
$this->student_ids = array();
}

+ Here is the call graph for this function:

ilObjiLincCourse::initDefaultRoles ( )

init default roles settings

public

Returns
array object IDs of created local roles.

Reimplemented from ilObject.

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

References __setCourseStatus(), ilObject\createRoleFolder(), DB_FETCHMODE_OBJECT, ilObject\getId(), and ilObject\getRefId().

{
global $rbacadmin, $rbacreview;
// create a local role folder
$rfoldObj =& $this->createRoleFolder();
// ADMIN ROLE
// create role and assign role to rolefolder...
$roleObj = $rfoldObj->createRole("il_icrs_admin_".$this->getRefId(),"LearnLinc admin of seminar obj_no.".$this->getId());
$this->m_roleAdminId = $roleObj->getId();
//set permission template of new local role
$q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_icrs_admin'";
$r = $this->ilias->db->getRow($q, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
// set object permissions of icrs object
$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"icrs",$rfoldObj->getRefId());
$rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
// set object permissions of role folder object
//$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
//$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
// MEMBER ROLE
// create role and assign role to rolefolder...
$roleObj = $rfoldObj->createRole("il_icrs_member_".$this->getRefId(),"LearnLinc admin of seminar obj_no.".$this->getId());
$this->m_roleMemberId = $roleObj->getId();
//set permission template of new local role
$q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_icrs_member'";
$r = $this->ilias->db->getRow($q, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
// set object permissions of icrs object
$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"icrs",$rfoldObj->getRefId());
$rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
// set object permissions of role folder object
//$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
//$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
unset($rfoldObj);
unset($roleObj);
$roles[] = $this->m_roleAdminId;
$roles[] = $this->m_roleMemberId;
// Break inheritance and initialize permission settings using intersection method with a non_member_template
// not implemented for ilinc. maybe never will...
return $roles ? $roles : array();
}

+ Here is the call graph for this function:

ilObjiLincCourse::isAdmin (   $a_user_id)

is Admin public

Parameters
integeruser_id
boolean,trueif user is group administrator

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

References getDefaultRoles().

Referenced by removeMember().

{
global $rbacreview;
$icrs_roles = $this->getDefaultRoles();
if (in_array($a_user_id,$rbacreview->assignedUsers($icrs_roles["icrs_admin_role"])))
{
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::isDocent (   $a_user_obj = "")

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

References getiLincMemberIds().

{
if (!$a_user_obj)
{
$a_user_obj =& $this->ilias->account;
}
$docents = $this->getiLincMemberIds(true);
include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
$ilinc_user = new ilObjiLincUser($a_user_obj);
if (in_array($ilinc_user->id,$docents))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilObjiLincCourse::isMember (   $a_user_id = "")

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

References getMemberIds().

Referenced by removeMember().

{
if (strlen($a_user_id) == 0)
{
$a_user_id = $this->ilias->account->getId();
}
$arr_members = $this->getMemberIds();
if (in_array($a_user_id, $arr_members))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

join icrs, assigns user to role private

Parameters
integermember status = obj_id of local_group_role

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

Referenced by addMember().

{
global $rbacadmin;
if (is_array($a_mem_role))
{
foreach ($a_mem_role as $role)
{
$rbacadmin->assignUser($role,$a_user_id, false);
}
}
else
{
$rbacadmin->assignUser($a_mem_role,$a_user_id, false);
}
return true;
}

+ Here is the caller graph for this function:

ilObjiLincCourse::leave (   $a_user_id)

deassign member from group role private

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

References getMemberRoles().

Referenced by removeMember().

{
global $rbacadmin;
$arr_groupRoles = $this->getMemberRoles($a_user_id);
if (is_array($arr_groupRoles))
{
foreach ($arr_groupRoles as $groupRole)
{
$rbacadmin->deassignUser($groupRole, $a_user_id);
}
}
else
{
$rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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)

public

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

Reimplemented from ilObject.

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

{
return true;
}
ilObjiLincCourse::read ( )

private

Reimplemented from ilContainer.

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

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

{
global $ilDB, $ilErr;
// TODO: fetching default role should be done in rbacadmin
$q = "SELECT * FROM ilinc_data ".
"WHERE obj_id = ".$ilDB->quote($this->id);
$r = $ilDB->query($q);
if($r->numRows() > 0)
{
$data = $r->fetchRow(DB_FETCHMODE_OBJECT);
$this->ilinc_id = $data->course_id;
$this->activated = ilUtil::yn2tf($data->activation_offline);
$this->akclassvalue1 = $data->akclassvalue1;
$this->akclassvalue2 = $data->akclassvalue2;
}
else
{
$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);
}
}

+ Here is the call graph for this function:

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

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

References $user, and getiLincId().

Referenced by addMember().

{
if ($a_instructor === true)
{
$a_instructor = "True";
}
else
{
$a_instructor = "False";
}
include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
$ilinc_user = new ilObjiLincUser($a_user_obj);
$user[] = array('id' => $ilinc_user->id, 'instructor' => $a_instructor);
$this->ilincAPI->registerUser($this->getiLincId(),$user);
$response = $this->ilincAPI->sendRequest("registerUser");
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_register_user";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::registerUsers (   $a_user_arr)

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

References getiLincId().

{
foreach ($a_user_arr as $user_id => $instructorflag)
{
$flag = "False";
if ($instructorflag == ILINC_MEMBER_DOCENT)
{
$flag = "True";
}
$ilinc_users[] = array('id' => $user_id,'instructor' => $flag);
}
$this->ilincAPI->registerUser($this->getiLincId(),$ilinc_users);
$response = $this->ilincAPI->sendRequest("registerUser");
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_register_users";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::removeMember ( $a_user_obj)

removes Member from group public

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

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

{
if (!isset($a_user_obj))
{
$this->error_msg = get_class($this)."::removeMember(): Missing parameters !";
return false;
}
if (!$this->isMember($a_user_obj->getId()))
{
return true;
}
if (count($this->getMemberIds()) > 1)
{
if ($this->isAdmin($a_user_obj->getId()) && count($this->getAdminIds()) < 2)
{
$this->error_msg = "ilinc_err_administrator_required";
return false;
}
}
// unregister from course on iLinc server
if (!$this->unregisterUser($a_user_obj))
{
// error_msg already set
return false;
}
$this->leave($a_user_obj->getId());
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::saveActivationStatus (   $a_activated)

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

References ilObject\getId().

{
global $ilDB;
$q = "UPDATE ilinc_data SET activation_offline = ".$ilDB->quote($a_activated)." WHERE obj_id = ".$ilDB->quote($this->getId());
$r = $ilDB->query($q);
}

+ Here is the call graph for this function:

ilObjiLincCourse::saveAKClassValues (   $a_akclassvalue1,
  $a_akclassvalue2 
)

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

References ilObject\getId().

{
global $ilDB;
$q = "UPDATE ilinc_data SET ".
"akclassvalue1= ".$ilDB->quote($a_akclassvalue1).", ".
"akclassvalue2= ".$ilDB->quote($a_akclassvalue2)." ".
"WHERE obj_id= ".$ilDB->quote($this->getId());
$r = $ilDB->query($q);
}

+ Here is the call graph for this function:

ilObjiLincCourse::setAKClassValue1 (   $a_str)

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

{
$this->akclassvalue1 = $a_str;
}
ilObjiLincCourse::setAKClassValue2 (   $a_str)

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

{
$this->akclassvalue2 = $a_str;
}
ilObjiLincCourse::storeiLincId (   $a_icrs_id)

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

{
global $ilDB;
$q = "INSERT INTO ilinc_data (obj_id,type,course_id,activation_offline) VALUES (".$ilDB->quote($this->id).",'icrs',".$ilDB->quote($a_icrs_id).",".$ilDB->quote($this->activated).")";
$ilDB->query($q);
$this->ilinc_id = $a_icrs_id;
}
ilObjiLincCourse::unregisterUser (   $a_user_obj)

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

References getiLincId().

Referenced by removeMember().

{
include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
$ilinc_user = new ilObjiLincUser($a_user_obj);
// do not send request if user is not registered at iLinc server at all
if ($ilinc_user->id == '0')
{
return true;
}
$this->ilincAPI->unregisterUser($this->getiLincId(),array($ilinc_user->id));
$response = $this->ilincAPI->sendRequest();
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_unregister_user";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjiLincCourse::unregisterUsers (   $a_ilinc_user_ids)

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

References getiLincId().

{
$this->ilincAPI->unregisterUser($this->getiLincId(),$a_ilinc_user_ids);
$response = $this->ilincAPI->sendRequest();
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_unregister_users";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::update ( )

update object data

public

Returns
boolean

Reimplemented from ilObject.

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

References ilObject\getId(), and getiLincId().

{
global $ilDB;
$this->ilincAPI->editCourse($this->getiLincId(),$_POST["Fobject"]);
$response = $this->ilincAPI->sendRequest();
if ($response->isError())
{
$this->error_msg = $response->getErrorMsg();
return false;
}
// TODO: alter akclassvalues of classes here
if (!parent::update())
{
$this->error_msg = "database_error";
return false;
}
$q = "UPDATE ilinc_data SET ".
"activation_offline = ".$ilDB->quote($this->activated).", ".
"akclassvalue1 = ".$ilDB->quote($this->akclassvalue1).", ".
"akclassvalue2 = ".$ilDB->quote($this->akclassvalue2)." ".
"WHERE obj_id = ".$ilDB->quote($this->getId());
$r = $ilDB->query($q);
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::updateClassrooms ( )

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

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

{
global $ilErr;
$this->ilincAPI->findCourseClasses($this->getiLincId());
$response = $this->ilincAPI->sendRequest();
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_get_classrooms";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
if (!$response->data['classes'])
{
$this->error_msg = $response->data['result']['cdata'];
return false;
}
if (array_key_exists('akclassvalue1',$_POST["Fobject"]))
{
$data["akclassvalue1"] = $_POST["Fobject"]["akclassvalue1"];
}
if (array_key_exists('akclassvalue2',$_POST["Fobject"]))
{
$data["akclassvalue2"] = $_POST["Fobject"]["akclassvalue2"];
}
foreach ($response->data['classes'] as $class_id => $data2)
{
include_once("./Modules/ILinc/classes/class.ilObjiLincClassroom.php");
$icla_obj = new ilObjiLincClassroom($class_id,$this->ref_id);
if (!$icla_obj->update($data))
{
$this->error_msg = $icla_obj->getErrorMsg();
return false;
}
unset($icla_obj);
}
return true;
}

+ Here is the call graph for this function:

ilObjiLincCourse::uploadPicture ( $a_user_obj,
  $a_lang 
)

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

{
$this->ilincAPI->uploadPicture($a_user_obj,$a_lang);
$response = $this->ilincAPI->sendRequest("uploadPicture");
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_upload_picture";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
// return URL to user's personal page
return $response->data['url']['cdata'];
}
ilObjiLincCourse::userExists ( $a_user_obj)

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

Referenced by addMember().

{
//$data = $a_user_obj->getiLincData();
include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
$ilinc_user = new ilObjiLincUser($a_user_obj);
if (!$ilinc_user->id and !$ilinc_user->login)
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilObjiLincCourse::userLogin ( $a_user_obj)

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

{
include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
$ilinc_user = new ilObjiLincUser($a_user_obj);
$this->ilincAPI->userLogin($ilinc_user);
$response = $this->ilincAPI->sendRequest("userLogin");
if ($response->isError())
{
if (!$response->getErrorMsg())
{
$this->error_msg = "err_user_login";
}
else
{
$this->error_msg = $response->getErrorMsg();
}
return false;
}
// return URL to join class room
return $response->data['url']['cdata'];
}

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