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

EventListener for LSO. More...

+ Collaboration diagram for ilLearningSequenceAppEventListener:

Static Public Member Functions

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

Static Protected Member Functions

static getLSEventHandler ()
 
static getIlTree ()
 
static getIlLanguage ()
 
static getIlLPStatusWrapper ()
 

Static Private Member Functions

static onServiceTrackingUpdateStatus (array $parameter)
 
static onObjectDeletion (array $parameter)
 
static onObjectToTrash (array $parameter)
 
static onObjectCloned (ilObject $new_obj, ilObject $origin_obj)
 
static onParticipantDeletion (array $parameter)
 

Static Private Attributes

static ilLSLPEventHandler $lp_event_handler = null
 

Detailed Description

EventListener for LSO.

Definition at line 26 of file class.ilLearningSequenceAppEventListener.php.

Member Function Documentation

◆ getIlLanguage()

static ilLearningSequenceAppEventListener::getIlLanguage ( )
staticprotected

Definition at line 137 of file class.ilLearningSequenceAppEventListener.php.

137 : illanguage
138 {
139 global $DIC;
140 return $DIC['lng'];
141 }
global $DIC
Definition: shib_login.php:26

References $DIC.

Referenced by onServiceTrackingUpdateStatus().

+ Here is the caller graph for this function:

◆ getIlLPStatusWrapper()

static ilLearningSequenceAppEventListener::getIlLPStatusWrapper ( )
staticprotected

Definition at line 143 of file class.ilLearningSequenceAppEventListener.php.

144 {
145 return new ilLPStatusWrapper();
146 }
Class ilLPStatusWrapper This class is wrapper for all ilLPStatus classes.

◆ getIlTree()

static ilLearningSequenceAppEventListener::getIlTree ( )
staticprotected

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

131 : ilTree
132 {
133 global $DIC;
134 return $DIC['tree'];
135 }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

References $DIC.

◆ getLSEventHandler()

static ilLearningSequenceAppEventListener::getLSEventHandler ( )
staticprotected

Definition at line 126 of file class.ilLearningSequenceAppEventListener.php.

127 {
128 return new ilLSEventHandler(self::getIlTree());
129 }

Referenced by onObjectCloned(), onObjectDeletion(), onObjectToTrash(), and onParticipantDeletion().

+ Here is the caller graph for this function:

◆ handleEvent()

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

Definition at line 30 of file class.ilLearningSequenceAppEventListener.php.

30 : void
31 {
32 switch ($component) {
33 case "components/ILIAS/Tracking":
34 switch ($event) {
35 case "updateStatus":
37 break;
38 }
39 break;
40 case "components/ILIAS/ILIASObject":
41 switch ($event) {
42 case "beforeDeletion":
43 self::onObjectDeletion($parameter);
44 break;
45 case "toTrash":
46 self::onObjectToTrash($parameter);
47 break;
48 case 'cloneObject':
49 $new_obj = $parameter['object'];
50 $origin_obj = $parameter['cloned_from_object'];
51 self::onObjectCloned($new_obj, $origin_obj);
52 break;
53 }
54 break;
55
56 case "components/ILIAS/LearningSequence":
57 switch ($event) {
58 case "deleteParticipant":
60 break;
61 case "addParticipant":
62 default:
63 break;
64 }
65 break;
66
67 default:
68 throw new ilException(
69 "ilLearningSequenceAppEventListener::handleEvent: " .
70 "Won't handle events of '$component'."
71 );
72 }
73 }
Base class for ILIAS Exception handling.
static onObjectCloned(ilObject $new_obj, ilObject $origin_obj)

References onObjectCloned(), onObjectDeletion(), onObjectToTrash(), onParticipantDeletion(), and onServiceTrackingUpdateStatus().

+ Here is the call graph for this function:

◆ onObjectCloned()

static ilLearningSequenceAppEventListener::onObjectCloned ( ilObject  $new_obj,
ilObject  $origin_obj 
)
staticprivate

Definition at line 111 of file class.ilLearningSequenceAppEventListener.php.

111 : void
112 {
114 $handler->handleClonedObject($new_obj, $origin_obj);
115 }
$handler
Definition: oai.php:29

References $handler, and getLSEventHandler().

Referenced by handleEvent().

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

◆ onObjectDeletion()

static ilLearningSequenceAppEventListener::onObjectDeletion ( array  $parameter)
staticprivate

Definition at line 99 of file class.ilLearningSequenceAppEventListener.php.

99 : void
100 {
102 $handler->handleObjectDeletion($parameter);
103 }

References $handler, and getLSEventHandler().

Referenced by handleEvent().

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

◆ onObjectToTrash()

static ilLearningSequenceAppEventListener::onObjectToTrash ( array  $parameter)
staticprivate

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

105 : void
106 {
108 $handler->handleObjectToTrash($parameter);
109 }

References $handler, and getLSEventHandler().

Referenced by handleEvent().

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

◆ onParticipantDeletion()

static ilLearningSequenceAppEventListener::onParticipantDeletion ( array  $parameter)
staticprivate

Definition at line 117 of file class.ilLearningSequenceAppEventListener.php.

117 : void
118 {
120 $obj_id = (int) $parameter['obj_id'];
121 $usr_id = (int) $parameter['usr_id'];
122
123 $handler->handleParticipantDeletion($obj_id, $usr_id);
124 }

References $handler, getLSEventHandler(), and ILIAS\Repository\int().

Referenced by handleEvent().

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

◆ onServiceTrackingUpdateStatus()

static ilLearningSequenceAppEventListener::onServiceTrackingUpdateStatus ( array  $parameter)
staticprivate

Definition at line 75 of file class.ilLearningSequenceAppEventListener.php.

75 : void
76 {
77 if (self::$lp_event_handler === null) {
78 self::$lp_event_handler = new ilLSLPEventHandler(self::getIlTree(), self::getIlLPStatusWrapper());
79 }
80 self::$lp_event_handler->updateLPForChildEvent($parameter);
81
82 if ($parameter['status'] === ilLPStatus::LP_STATUS_COMPLETED_NUM
83 && $parameter['old_status'] !== $parameter['status']
84 && ilObject::_lookupType($parameter['obj_id']) === 'lso'
85 ) {
87 $lso_title = ilObject::_lookupTitle($parameter['obj_id']);
89 $notification->setValidForSeconds(ilNotificationConfig::TTL_LONG);
90 $notification->setVisibleForSeconds(ilNotificationConfig::DEFAULT_TTS);
91 $notification->setTitleVar($lng->txt('lso_toast_completed_title'));
92 $notification->setShortDescriptionVar($lng->txt('lso_toast_completed_desc'));
93 $notification->setLongDescriptionVar($lng->txt('lso_toast_completed_desc'));
94 $notification->setIconPath('assets/images/standard/icon_lso.svg');
95 $notification->notifyByUsers([$parameter['usr_id']]);
96 }
97 }
const LP_STATUS_COMPLETED_NUM
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
global $lng
Definition: privfeed.php:31

References $lng, ilObject\_lookupTitle(), ilObject\_lookupType(), getIlLanguage(), ilLPStatus\LP_STATUS_COMPLETED_NUM, and ilLSCompletionNotificationProvider\NOTIFICATION_TYPE.

Referenced by handleEvent().

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

Field Documentation

◆ $lp_event_handler

ilLSLPEventHandler ilLearningSequenceAppEventListener::$lp_event_handler = null
staticprivate

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


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