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

Class ilBadgeHandler. More...

+ Collaboration diagram for ilBadgeHandler:

Public Member Functions

 isActive ()
 
 setActive (bool $a_value)
 
 getComponents ()
 
 setComponents (?array $a_components=null)
 
 getProviderInstance (string $a_component_id)
 
 getComponentCaption (string $a_component_id)
 
 getUniqueTypeId (string $a_component_id, ilBadgeType $a_badge)
 
 getTypeInstanceByUniqueId (string $a_id)
 Get type instance by unique id (component, type) More...
 
 getInactiveTypes ()
 
 setInactiveTypes (?array $a_types=null)
 
 getAvailableTypes (bool $exclude_inactive=true)
 Get badges types. More...
 
 getAvailableTypesForObjType (string $a_object_type)
 Get valid badges types for object type. More...
 
 getAvailableManualBadges (int $a_parent_obj_id, ?string $a_parent_obj_type=null)
 Get available manual badges for object id. More...
 
 isObjectActive (int $a_obj_id, ?string $a_obj_type=null)
 
 triggerEvaluation (string $a_type_id, int $a_user_id, ?array $a_params=null)
 
 getUserIds (int $a_parent_ref_id, ?int $a_parent_obj_id=null, ?string $a_parent_type=null)
 
 getInstancePath (ilBadgeAssignment $a_ass)
 
 countStaticBadgeInstances (ilBadge $a_badge)
 
 getBadgePath (ilBadge $a_badge)
 
 sendNotification (array $a_user_map, ?int $a_parent_ref_id=null)
 

Static Public Member Functions

static getInstance ()
 
static updateFromXML (string $a_component_id)
 Import component definition. More...
 
static clearFromXML (string $a_component_id)
 Remove component definition. More...
 

Data Fields

const GENERAL_INFO = 'inform_about_badges'
 

Protected Member Functions

 __construct ()
 
 getComponent (string $a_id)
 
 getBasePath ()
 
 countStaticBadgeInstancesHelper (int &$a_cnt, string $a_path)
 

Protected Attributes

ilComponentRepository $component_repository
 
ilDBInterface $db
 
ilTree $tree
 
ilLanguage $lng
 
ilSetting $settings
 

Static Protected Attributes

static ilBadgeHandler $instance = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBadgeHandler::__construct ( )
protected

Definition at line 40 of file class.ilBadgeHandler.php.

41 {
42 global $DIC;
43
44 if (isset($DIC['component.repository'])) {
45 $this->component_repository = $DIC['component.repository'];
46 }
47 $this->db = $DIC->database();
48 if (isset($DIC['tree'])) {
49 $this->tree = $DIC->repositoryTree();
50 }
51 $this->settings = new ilSetting('bdga');
52 }
ILIAS Setting Class.
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ clearFromXML()

static ilBadgeHandler::clearFromXML ( string  $a_component_id)
static

Remove component definition.

Definition at line 302 of file class.ilBadgeHandler.php.

302 : void
303 {
305 $components = $handler->getComponents();
306 foreach ($components as $idx => $component) {
307 if ($component === $a_component_id) {
308 unset($components[$idx]);
309 }
310 }
311 $handler->setComponents($components);
312 }
$components
$handler
Definition: oai.php:29

References $components, and $handler.

◆ countStaticBadgeInstances()

ilBadgeHandler::countStaticBadgeInstances ( ilBadge  $a_badge)

Definition at line 444 of file class.ilBadgeHandler.php.

444 : int
445 {
446 $path = $this->getBasePath() . 'instances/' . $a_badge->getId();
447 $cnt = 0;
448 if (is_dir($path)) {
450 }
451 return $cnt;
452 }
countStaticBadgeInstancesHelper(int &$a_cnt, string $a_path)
$path
Definition: ltiservices.php:30

References $path, and ilBadge\getId().

+ Here is the call graph for this function:

◆ countStaticBadgeInstancesHelper()

ilBadgeHandler::countStaticBadgeInstancesHelper ( int &  $a_cnt,
string  $a_path 
)
protected

Definition at line 454 of file class.ilBadgeHandler.php.

457 : void {
458 foreach (glob($a_path . '/*') as $item) {
459 if (is_dir($item)) {
460 $this->countStaticBadgeInstancesHelper($a_cnt, $item);
461 } elseif (str_ends_with($item, '.json')) {
462 $a_cnt++;
463 }
464 }
465 }

◆ getAvailableManualBadges()

ilBadgeHandler::getAvailableManualBadges ( int  $a_parent_obj_id,
?string  $a_parent_obj_type = null 
)

Get available manual badges for object id.

Returns
array<int, string>

Definition at line 256 of file class.ilBadgeHandler.php.

259 : array {
260 $res = [];
261
262 if (!$a_parent_obj_type) {
263 $a_parent_obj_type = ilObject::_lookupType($a_parent_obj_id);
264 }
265
266 $badges = ilBadge::getInstancesByParentId($a_parent_obj_id);
267 foreach (self::getInstance()->getAvailableTypesForObjType($a_parent_obj_type) as $type_id => $type) {
268 if (!$type instanceof ilBadgeAuto) {
269 foreach ($badges as $badge) {
270 if ($badge->getTypeId() === $type_id &&
271 $badge->isActive()) {
272 $res[$badge->getId()] = $badge->getTitle();
273 }
274 }
275 }
276 }
277
278 asort($res);
279 return $res;
280 }
getAvailableTypesForObjType(string $a_object_type)
Get valid badges types for object type.
static getInstancesByParentId(int $a_parent_id, ?array $a_filter=null)
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69

References ilObject\_lookupType().

+ Here is the call graph for this function:

◆ getAvailableTypes()

ilBadgeHandler::getAvailableTypes ( bool  $exclude_inactive = true)

Get badges types.

Returns
array<string, ilBadgeType>

Definition at line 215 of file class.ilBadgeHandler.php.

215 : array
216 {
217 $res = [];
218
219 $inactive = $this->getInactiveTypes();
220 foreach ($this->getComponents() as $component_id) {
221 $provider = $this->getProviderInstance($component_id);
222 if ($provider) {
223 foreach ($provider->getBadgeTypes() as $type) {
224 $id = $this->getUniqueTypeId($component_id, $type);
225 if (!$exclude_inactive || !in_array($id, $inactive, true)) {
226 $res[$id] = $type;
227 }
228 }
229 }
230 }
231
232 return $res;
233 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getUniqueTypeId(string $a_component_id, ilBadgeType $a_badge)
getProviderInstance(string $a_component_id)
$provider
Definition: ltitoken.php:80

References $id, $provider, and $res.

◆ getAvailableTypesForObjType()

ilBadgeHandler::getAvailableTypesForObjType ( string  $a_object_type)

Get valid badges types for object type.

Returns
array<string, ilBadgeType>

Definition at line 239 of file class.ilBadgeHandler.php.

239 : array
240 {
241 $res = [];
242
243 foreach ($this->getAvailableTypes() as $id => $type) {
244 if (in_array($a_object_type, $type->getValidObjectTypes(), true)) {
245 $res[$id] = $type;
246 }
247 }
248
249 return $res;
250 }
getAvailableTypes(bool $exclude_inactive=true)
Get badges types.

References $id, and $res.

◆ getBadgePath()

ilBadgeHandler::getBadgePath ( ilBadge  $a_badge)

Definition at line 467 of file class.ilBadgeHandler.php.

467 : string
468 {
469 $hash = md5($a_badge->getId());
470
471 $path = $this->getBasePath() . 'badges/' .
472 floor($a_badge->getId() / 100) . '/' .
473 $hash . '/';
474
476
477 return $path;
478 }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.

References $path, ilBadge\getId(), and ilFileUtils\makeDirParents().

+ Here is the call graph for this function:

◆ getBasePath()

ilBadgeHandler::getBasePath ( )
protected

Definition at line 424 of file class.ilBadgeHandler.php.

424 : string
425 {
426 return ilFileUtils::getWebspaceDir() . '/pub_badges/';
427 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory

References ilFileUtils\getWebspaceDir().

+ Here is the call graph for this function:

◆ getComponent()

ilBadgeHandler::getComponent ( string  $a_id)
protected

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

112 : ?array
113 {
114 if (!$this->component_repository->hasComponentId($a_id)) {
115 return null;
116 }
117 $component = $this->component_repository->getComponentById($a_id);
118 return [
119 'type' => $component->getType(),
120 'name' => $component->getName()
121 ];
122 }

Referenced by getComponentCaption(), and getProviderInstance().

+ Here is the caller graph for this function:

◆ getComponentCaption()

ilBadgeHandler::getComponentCaption ( string  $a_component_id)

Definition at line 140 of file class.ilBadgeHandler.php.

140 : string
141 {
142 $comp = $this->getComponent($a_component_id);
143 if ($comp) {
144 return $comp['type'] . '/' . $comp['name'];
145 }
146 return '';
147 }
getComponent(string $a_id)

References getComponent().

+ Here is the call graph for this function:

◆ getComponents()

ilBadgeHandler::getComponents ( )
Returns
string[]

Definition at line 80 of file class.ilBadgeHandler.php.

80 : array
81 {
82 $components = $this->settings->get('components', null);
83 if ($components) {
84 return unserialize($components, ['allowed_classes' => false]);
85 }
86
87 return [];
88 }

References $components, and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ getInactiveTypes()

ilBadgeHandler::getInactiveTypes ( )
Returns
string[]

Definition at line 184 of file class.ilBadgeHandler.php.

184 : array
185 {
186 $types = $this->settings->get('inactive_types', null);
187 if ($types) {
188 return unserialize($types, ['allowed_classes' => false]);
189 }
190
191 return [];
192 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ getInstance()

static ilBadgeHandler::getInstance ( )
static

Definition at line 54 of file class.ilBadgeHandler.php.

54 : self
55 {
56 if (!self::$instance) {
57 self::$instance = new self();
58 }
59 return self::$instance;
60 }
static ilBadgeHandler $instance

References $instance.

Referenced by ilBadgeManagementGUI\__construct(), ilObjBadgeAdministrationGUI\activateTypes(), ilBadgeManagementGUI\addBadge(), ilObjBadgeAdministrationGUI\assertActive(), ilBadgeManagementGUI\assignBadge(), ilBadgeManagementGUI\awardBadgeUserSelection(), ilObjBadgeAdministrationGUI\deactivateTypes(), ilBadge\deleteStaticFiles(), ilBadgeAssignment\deleteStaticFiles(), ilBadgeManagementGUI\editBadge(), ilBadgeManagementGUI\executeCommand(), ilObjBadgeAdministrationGUI\getAdminTabs(), ILIAS\Badge\ilBadgeTypesTableGUI\getRecords(), ILIAS\Badge\ilObjectBadgeTableGUI\getRecords(), ILIAS\Badge\Provider\BadgeMainBarProvider\getStaticSubItems(), ilObjCourseGUI\getTabs(), ilObjGroupGUI\getTabs(), ilBadge\getTypeInstance(), ilBadgeManagementGUI\getValidBadgesFromClipboard(), ilBadgeAppEventListener\handleEvent(), ilObjBadgeAdministrationGUI\initFormSettings(), ilBadgeLearningHistoryProvider\isActive(), ilAchievements\isActive(), ilBadgeManagementGUI\listBadges(), ilBadgeManagementGUI\listUsers(), ilBadgeDefinitionProcessor\purge(), ilBadgeManagementGUI\saveBadge(), ILIAS\User\Profile\PersonalProfileGUI\savePublicProfile(), ilObjBadgeAdministrationGUI\saveSettings(), ilBadgeManagementGUI\splitBadgeAndUserIdsFromString(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

+ Here is the caller graph for this function:

◆ getInstancePath()

ilBadgeHandler::getInstancePath ( ilBadgeAssignment  $a_ass)

Definition at line 429 of file class.ilBadgeHandler.php.

429 : string
430 {
431 $hash = md5($a_ass->getBadgeId() . '_' . $a_ass->getUserId());
432
433 $path = $this->getBasePath() . 'instances/' .
434 $a_ass->getBadgeId() . '/' .
435 floor($a_ass->getUserId() / 1000) . '/';
436
438
439 $path .= $hash . '.json';
440
441 return $path;
442 }

References $path, ilBadgeAssignment\getBadgeId(), ilBadgeAssignment\getUserId(), and ilFileUtils\makeDirParents().

+ Here is the call graph for this function:

◆ getProviderInstance()

ilBadgeHandler::getProviderInstance ( string  $a_component_id)

Definition at line 124 of file class.ilBadgeHandler.php.

125 {
126 $comp = $this->getComponent($a_component_id);
127 if ($comp) {
128 $class = 'il' . $comp['name'] . 'BadgeProvider';
129 $file = '../' . $comp['type'] . '/' . $comp['name'] . '/classes/class.' . $class . '.php';
130 if (file_exists($file)) {
131 $obj = new $class();
132 if ($obj instanceof ilBadgeProvider) {
133 return $obj;
134 }
135 }
136 }
137 return null;
138 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References getComponent().

+ Here is the call graph for this function:

◆ getTypeInstanceByUniqueId()

ilBadgeHandler::getTypeInstanceByUniqueId ( string  $a_id)

Get type instance by unique id (component, type)

Definition at line 163 of file class.ilBadgeHandler.php.

165 : ?ilBadgeType {
166 $parts = explode('/', $a_id);
167 $comp_id = $parts[0];
168 $type_id = $parts[1];
169
170 $provider = $this->getProviderInstance($comp_id);
171 if ($provider) {
172 foreach ($provider->getBadgeTypes() as $type) {
173 if ($type->getId() === $type_id) {
174 return $type;
175 }
176 }
177 }
178 return null;
179 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

◆ getUniqueTypeId()

ilBadgeHandler::getUniqueTypeId ( string  $a_component_id,
ilBadgeType  $a_badge 
)

Definition at line 153 of file class.ilBadgeHandler.php.

156 : string {
157 return $a_component_id . '/' . $a_badge->getId();
158 }
getId()
Get typ id (unique for component)

◆ getUserIds()

ilBadgeHandler::getUserIds ( int  $a_parent_ref_id,
?int  $a_parent_obj_id = null,
?string  $a_parent_type = null 
)
Parameters
int | null$a_parent_obj_id
string | null$a_parent_type
Returns
int[]

Definition at line 379 of file class.ilBadgeHandler.php.

383 : array {
385
386 if (!$a_parent_obj_id) {
387 $a_parent_obj_id = ilObject::_lookupObjectId($a_parent_ref_id);
388 }
389 if (!$a_parent_type) {
390 $a_parent_type = ilObject::_lookupType($a_parent_obj_id);
391 }
392
393 // try to get participants from (parent) course/group
394 switch ($a_parent_type) {
395 case 'crs':
396 $member_obj = ilCourseParticipants::_getInstanceByObjId($a_parent_obj_id);
397 return $member_obj->getMembers();
398
399 case 'grp':
400 $member_obj = ilGroupParticipants::_getInstanceByObjId($a_parent_obj_id);
401 return $member_obj->getMembers();
402
403 default:
404 // walk path to find course or group object and use members of that object
405 /* this does not work since getParticipantsForObject does not exist
406 $path = $tree->getPathId($a_parent_ref_id);
407 array_pop($path);
408 foreach (array_reverse($path) as $path_ref_id) {
409 $type = ilObject::_lookupType($path_ref_id, true);
410 if ($type == "crs" || $type == "grp") {
411 return $this->getParticipantsForObject($path_ref_id, null, $type);
412 }
413 }*/
414 break;
415 }
416 return [];
417 }
static _getInstanceByObjId(int $a_obj_id)
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
static _lookupObjectId(int $ref_id)

References ilObject\_lookupObjectId().

+ Here is the call graph for this function:

◆ isActive()

ilBadgeHandler::isActive ( )

Definition at line 67 of file class.ilBadgeHandler.php.

67 : bool
68 {
69 return (bool) $this->settings->get('active', '');
70 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ isObjectActive()

ilBadgeHandler::isObjectActive ( int  $a_obj_id,
?string  $a_obj_type = null 
)

Definition at line 319 of file class.ilBadgeHandler.php.

322 : bool {
323 if (!$this->isActive()) {
324 return false;
325 }
326
327 if (!$a_obj_type) {
328 $a_obj_type = ilObject::_lookupType($a_obj_id);
329 }
330
331 if ($a_obj_type !== 'bdga' && !ilContainer::_lookupContainerSetting(
332 $a_obj_id,
334 false
335 )) {
336 return false;
337 }
338
339 return true;
340 }
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)

◆ sendNotification()

ilBadgeHandler::sendNotification ( array  $a_user_map,
?int  $a_parent_ref_id = null 
)

Definition at line 485 of file class.ilBadgeHandler.php.

488 : void {
489 $badges = [];
490
491 foreach ($a_user_map as $user_id => $badge_ids) {
492 $user_badges = [];
493
494 foreach ($badge_ids as $badge_id) {
495 // making extra sure
496 if (!ilBadgeAssignment::exists($badge_id, $user_id)) {
497 continue;
498 }
499
500 if (!array_key_exists($badge_id, $badges)) {
501 $badges[$badge_id] = new ilBadge($badge_id);
502 }
503
504 $badge = $badges[$badge_id];
505
506 $user_badges[] = $badge->getTitle();
507 }
508
509 if (count($user_badges)) {
510 // compose and send mail
511
512 $ntf = new ilSystemNotification(false);
513 $ntf->setLangModules(['badge']);
514
515 if (isset($a_parent_ref_id)) {
516 $ntf->setRefId($a_parent_ref_id);
517 }
518 $ntf->setGotoLangId('badge_notification_parent_goto');
519
520 // user specific language
522
523 $ntf->setIntroductionLangId('badge_notification_body');
524
525 $ntf->addAdditionalInfo('badge_notification_badges', implode("\n", $user_badges), true);
526
527 $url = ilLink::_getLink($user_id, 'usr', [], '_bdg');
528 $ntf->addAdditionalInfo('badge_notification_badges_goto', $url);
529
530 $ntf->setReasonLangId('badge_notification_reason');
531
532 // force email
533 $mail = new ilMail(ANONYMOUS_USER_ID);
534 $mail->enqueue(
536 '',
537 '',
538 $lng->txt('badge_notification_subject'),
539 $ntf->composeAndGetMessage($user_id, null, 'read', true),
540 []
541 );
542
543
544 // osd
545 // bug #24562
546 if (ilContext::hasHTML()) {
547 $url = new ilNotificationLink(new ilNotificationParameter('badge_notification_badges_goto', [], 'badge'), $url);
548 $osd_params = ['badge_list' => implode(', ', $user_badges)];
549
550 $notification = new ilNotificationConfig(BadgeNotificationProvider::NOTIFICATION_TYPE);
551 $notification->setTitleVar('badge_notification_subject', [], 'badge');
552 $notification->setShortDescriptionVar('badge_notification_osd', $osd_params, 'badge');
553 $notification->setLongDescriptionVar('');
554 $notification->setLinks([$url]);
555 $notification->setIconPath(ilUtil::getImagePath('standard/icon_bdga.svg'));
556 $notification->setValidForSeconds(ilNotificationConfig::TTL_SHORT);
557 $notification->setVisibleForSeconds(ilNotificationConfig::DEFAULT_TTS);
558 $notification->setIdentification(new NotificationIdentification(
559 BadgeNotificationProvider::NOTIFICATION_TYPE,
560 self::GENERAL_INFO
561 ));
562 $notification->notifyByUsers([$user_id]);
563 }
564 }
565 }
566 }
description of a localized parameter this information is used locate translations while processing no...
static exists(int $a_badge_id, int $a_user_id)
static hasHTML()
Has HTML output.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getUserLanguage()
Return language of user.
static _lookupEmail(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
const ANONYMOUS_USER_ID
Definition: constants.php:27
$url
Definition: shib_logout.php:68

References $lng, $url, $user_id, ilObjUser\_lookupEmail(), ANONYMOUS_USER_ID, ilBadgeAssignment\exists(), ilUtil\getImagePath(), and ilContext\hasHTML().

+ Here is the call graph for this function:

◆ setActive()

ilBadgeHandler::setActive ( bool  $a_value)

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

72 : void
73 {
74 $this->settings->set('active', (string) $a_value);
75 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ setComponents()

ilBadgeHandler::setComponents ( ?array  $a_components = null)
Parameters
string[] | null$a_components

Definition at line 94 of file class.ilBadgeHandler.php.

94 : void
95 {
96 if (isset($a_components) && count($a_components) === 0) {
97 $a_components = null;
98 }
99 $this->settings->set(
100 'components',
101 $a_components !== null
102 ? serialize(array_unique($a_components))
103 : ''
104 );
105 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ setInactiveTypes()

ilBadgeHandler::setInactiveTypes ( ?array  $a_types = null)
Parameters
string[] | null$a_types

Definition at line 197 of file class.ilBadgeHandler.php.

197 : void
198 {
199 if (is_array($a_types) &&
200 !count($a_types)) {
201 $a_types = null;
202 }
203 $this->settings->set(
204 'inactive_types',
205 $a_types !== null
206 ? serialize(array_unique($a_types))
207 : ''
208 );
209 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ triggerEvaluation()

ilBadgeHandler::triggerEvaluation ( string  $a_type_id,
int  $a_user_id,
?array  $a_params = null 
)

Definition at line 342 of file class.ilBadgeHandler.php.

346 : void {
347 if (!$this->isActive() || in_array($a_type_id, $this->getInactiveTypes(), true)) {
348 return;
349 }
350
351 $type = $this->getTypeInstanceByUniqueId($a_type_id);
352 if (!$type instanceof ilBadgeAuto) {
353 return;
354 }
355
356 $new_badges = [];
357 foreach (ilBadge::getInstancesByType($a_type_id) as $badge) {
358 if ($badge->isActive()) {
359 // already assigned?
360 if (!ilBadgeAssignment::exists($badge->getId(), $a_user_id)) {
361 if ($type->evaluate($a_user_id, (array) $a_params, $badge->getConfiguration())) {
362 $ass = new ilBadgeAssignment($badge->getId(), $a_user_id);
363 $ass->store();
364
365 $new_badges[$a_user_id][] = $badge->getId();
366 }
367 }
368 }
369 }
370
371 $this->sendNotification($new_badges);
372 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
sendNotification(array $a_user_map, ?int $a_parent_ref_id=null)
getTypeInstanceByUniqueId(string $a_id)
Get type instance by unique id (component, type)
static getInstancesByType(string $a_type_id)

◆ updateFromXML()

static ilBadgeHandler::updateFromXML ( string  $a_component_id)
static

Import component definition.

Definition at line 291 of file class.ilBadgeHandler.php.

291 : void
292 {
294 $components = $handler->getComponents();
295 $components[] = $a_component_id;
296 $handler->setComponents($components);
297 }

References $components, and $handler.

Referenced by ilBadgeDefinitionProcessor\beginTag().

+ Here is the caller graph for this function:

Field Documentation

◆ $component_repository

ilComponentRepository ilBadgeHandler::$component_repository
protected

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

◆ $db

ilDBInterface ilBadgeHandler::$db
protected

Definition at line 34 of file class.ilBadgeHandler.php.

◆ $instance

ilBadgeHandler ilBadgeHandler::$instance = null
staticprotected

Definition at line 38 of file class.ilBadgeHandler.php.

Referenced by getInstance().

◆ $lng

ilLanguage ilBadgeHandler::$lng
protected

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

◆ $settings

ilSetting ilBadgeHandler::$settings
protected

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

◆ $tree

ilTree ilBadgeHandler::$tree
protected

Definition at line 35 of file class.ilBadgeHandler.php.

◆ GENERAL_INFO

const ilBadgeHandler::GENERAL_INFO = 'inform_about_badges'

Definition at line 31 of file class.ilBadgeHandler.php.


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