ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCmiXapiAppEventListener Class Reference

Event listener for cmix. More...

+ Collaboration diagram for ilCmiXapiAppEventListener:

Static Public Member Functions

static handleEvent (string $component, string $event, array $parameter)
 

Static Private Member Functions

static onServiceUserDeleteUser (array $parameter)
 
static onServiceObjectDeleteOrToTrash (array $parameter)
 
static removeMembers (string $src_type, array $parameter)
 

Detailed Description

Event listener for cmix.

Has the following tasks:

Author
Uwe Kohnle kohnl.nosp@m.e@in.nosp@m.terne.nosp@m.tleh.nosp@m.rer-g.nosp@m.mbh..nosp@m.de

Definition at line 28 of file class.ilCmiXapiAppEventListener.php.

Member Function Documentation

◆ handleEvent()

static ilCmiXapiAppEventListener::handleEvent ( string  $component,
string  $event,
array  $parameter 
)
static
Exceptions
ilException

Definition at line 33 of file class.ilCmiXapiAppEventListener.php.

33 : void
34 {
35 switch ($component) {
36 case "components/ILIAS/User":
37 if ($event == "deleteUser") {
39 }
40 break;
41 case "components/ILIAS/ILIASObject":
42 switch ($event) {
43 case "delete":
44 case "toTrash":
46 break;
47 }
48 break;
49
50 case "components/ILIAS/Course":
51 if ($event == "deleteParticipant") {
53 'crs',
54 $parameter
55 );
56 }
57 break;
58 case "components/ILIAS/Group":
59 if ($event == "deleteParticipant") {
61 'grp',
62 $parameter
63 );
64 }
65 break;
66
67 default:
68 throw new ilException(
69 "ilCmiXapiAppEventListener::handleEvent: Won't handle events of '$component'."
70 );
71 }
72 }
static removeMembers(string $src_type, array $parameter)
static onServiceObjectDeleteOrToTrash(array $parameter)
static onServiceUserDeleteUser(array $parameter)
Base class for ILIAS Exception handling.

References onServiceObjectDeleteOrToTrash(), onServiceUserDeleteUser(), and removeMembers().

+ Here is the call graph for this function:

◆ onServiceObjectDeleteOrToTrash()

static ilCmiXapiAppEventListener::onServiceObjectDeleteOrToTrash ( array  $parameter)
staticprivate

Definition at line 89 of file class.ilCmiXapiAppEventListener.php.

89 : void
90 {
91 if (ilObject::_lookupType((int) $parameter["ref_id"], true) !== "cmix") {
92 return;
93 }
94
95 $model = ilCmiXapiDelModel::init();
96 $objId = (int) $parameter['obj_id'];
97 $xapiObject = $model->getXapiObjectData($objId);
98
99 if(!is_null($xapiObject)) {
100 if ((int) $xapiObject['delete_data'] != 0) {
101 if((int) $xapiObject['delete_data'] < 10) {
102 //remove only ident
103 $model->removeCmixUsersForObject($objId);
104 } else {
105 // add obj as deleted
106 $model->setXapiObjAsDeleted($objId, $xapiObject['lrs_type_id'], $xapiObject['activity_id']);
107 }
108 }
109 }
110 }
static _lookupType(int $id, bool $reference=false)
$objId
Definition: xapitoken.php:57

References $objId, ilObject\_lookupType(), ilCmiXapiDelModel\init(), and ILIAS\Repository\int().

Referenced by handleEvent().

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

◆ onServiceUserDeleteUser()

static ilCmiXapiAppEventListener::onServiceUserDeleteUser ( array  $parameter)
staticprivate

Definition at line 74 of file class.ilCmiXapiAppEventListener.php.

74 : void
75 {
76 /* nicht testbar aktuell
77 $usr_id = $parameter['usr_id'];
78 $model = ilCmiXapiDelModel::init();
79
80 // null or array with objIds, if are going to need more
81 $xapiObjUser = $model->getXapiObjIdForUser($usr_id);
82 if(!is_null($xapiObjUser)) {
83 // add user as deleted
84 $model->setXapiUserAsDeleted($usr_id);
85 }
86 */
87 }

Referenced by handleEvent().

+ Here is the caller graph for this function:

◆ removeMembers()

static ilCmiXapiAppEventListener::removeMembers ( string  $src_type,
array  $parameter 
)
staticprivate

Definition at line 112 of file class.ilCmiXapiAppEventListener.php.

112 : void
113 {
114 $usr_id = $parameter['usr_id'];
115 $id = $parameter['obj_id'];
116 if (
117 $src_type === 'grp' || $src_type === 'crs'
118 ) {
120 $id = array_shift($ref_ids);
121 }
122 //stimmt so nicht: brauche array mit IDs
123 if (ilObject::_lookupType($id, true) !== "cmix") {
124 return;
125 }
126
127 // $model = ilCmiXapiDelModel::init();
128 // $objId = (int) $parameter['obj_id'];
129 // $xapiObject = $model->getXapiObjectData($objId);
130 // if( !is_null($xapiObject) ) {
131 // // add obj as deleted
132 // $model->setXapiObjAsDeleted($objId, $xapiObject['lrs_type_id'], $xapiObject['activity_id']);
133 // }
134 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getAllReferences(int $id)
get all reference ids for object ID

References $id, ilObject\_getAllReferences(), and ilObject\_lookupType().

Referenced by handleEvent().

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

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