ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAchievements Class Reference

Maybe a separate service in the future. More...

+ Collaboration diagram for ilAchievements:

Public Member Functions

 __construct ()
 Constructor. More...
 
 isActive ($service)
 Is subservice active? More...
 
 isAnyActive ()
 Is any subservice active? More...
 
 getActiveServices ()
 Get active services. More...
 

Data Fields

const SERV_LEARNING_HISTORY = 1
 
const SERV_COMPETENCES = 2
 
const SERV_LEARNING_PROGRESS = 3
 
const SERV_BADGES = 4
 
const SERV_CERTIFICATES = 5
 

Protected Attributes

 $learing_history
 
 $services
 
 $setting
 

Detailed Description

Maybe a separate service in the future.

Needs a generic approach.

Currently only the main menu (and personal desktop) should use this.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 13 of file class.ilAchievements.php.

Constructor & Destructor Documentation

◆ __construct()

ilAchievements::__construct ( )

Constructor.

Definition at line 44 of file class.ilAchievements.php.

45 {
46 global $DIC;
47
48 $this->setting = $DIC["ilSetting"];
49 $this->learing_history = $DIC->learningHistory();
50 $this->skmg_setting = new ilSetting("skmg");
51 }
ILIAS Setting Class.
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ getActiveServices()

ilAchievements::getActiveServices ( )

Get active services.

Returns
int[]

Definition at line 103 of file class.ilAchievements.php.

103 : array
104 {
105 return array_filter($this->services, function ($s) {
106 return $this->isActive($s);
107 });
108 }
isActive($service)
Is subservice active?
$s
Definition: pwgen.php:45

References $s, and isActive().

+ Here is the call graph for this function:

◆ isActive()

ilAchievements::isActive (   $service)

Is subservice active?

Parameters
intservice
Returns
bool

Definition at line 59 of file class.ilAchievements.php.

59 : bool
60 {
61 switch ($service) {
63 return (bool) $this->learing_history->isActive();
64 break;
66 return (bool) $this->skmg_setting->get("enable_skmg");
67 break;
72 break;
74 return (bool) ilBadgeHandler::getInstance()->isActive();
75 break;
77 return (bool) ilCertificate::isActive();
78 break;
79 }
80 return false;
81 }
static getInstance()
Constructor.
static _enabledLearningProgress()
check wether learing progress is enabled or not

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), ilBadgeHandler\getInstance(), ilCertificate\isActive(), SERV_BADGES, SERV_CERTIFICATES, SERV_COMPETENCES, SERV_LEARNING_HISTORY, and SERV_LEARNING_PROGRESS.

Referenced by getActiveServices(), and isAnyActive().

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

◆ isAnyActive()

ilAchievements::isAnyActive ( )

Is any subservice active?

Returns
bool

Definition at line 88 of file class.ilAchievements.php.

88 : bool
89 {
90 foreach ($this->services as $s) {
91 if ($this->isActive($s)) {
92 return true;
93 }
94 }
95 return false;
96 }

References $s, and isActive().

+ Here is the call graph for this function:

Field Documentation

◆ $learing_history

ilAchievements::$learing_history
protected

Definition at line 18 of file class.ilAchievements.php.

◆ $services

ilAchievements::$services
protected

◆ $setting

ilAchievements::$setting
protected

Definition at line 39 of file class.ilAchievements.php.

◆ SERV_BADGES

const ilAchievements::SERV_BADGES = 4

◆ SERV_CERTIFICATES

const ilAchievements::SERV_CERTIFICATES = 5

◆ SERV_COMPETENCES

const ilAchievements::SERV_COMPETENCES = 2

◆ SERV_LEARNING_HISTORY

const ilAchievements::SERV_LEARNING_HISTORY = 1

◆ SERV_LEARNING_PROGRESS

const ilAchievements::SERV_LEARNING_PROGRESS = 3

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