ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilBuddySystem.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8
class
ilBuddySystem
9
{
13
protected
static
$instance
;
14
18
protected
static
$is_enabled
;
19
23
protected
$settings
;
24
28
protected
$user
;
29
33
protected
function
__construct
()
34
{
35
global
$DIC
;
36
37
$this->
settings
=
new
ilSetting
(
'buddysystem'
);
38
$this->
user
= $DIC[
'ilUser'
];
39
}
40
44
public
static
function
getInstance
()
45
{
46
if
(!(self::$instance instanceof
self
)) {
47
self::$instance =
new
self
();
48
}
49
50
return
self::$instance;
51
}
52
57
public
function
setSetting
($keyword, $value)
58
{
59
$this->
settings
->set($keyword, $value);
60
}
61
67
public
function
getSetting
($keyword,
$default
=
false
)
68
{
69
return
$this->
settings
->get($keyword,
$default
);
70
}
71
75
public
function
isEnabled
()
76
{
77
if
(self::$is_enabled !== null) {
78
return
self::$is_enabled;
79
}
80
81
if
($this->
user
->isAnonymous()) {
82
self::$is_enabled =
false
;
83
return
false
;
84
}
85
86
self::$is_enabled = $this->
settings
->get(
'enabled'
,
false
);
87
return
self::$is_enabled;
88
}
89
}
settings
settings()
Definition:
settings.php:2
ilBuddySystem\$user
$user
Definition:
class.ilBuddySystem.php:28
ilBuddySystem\$instance
static $instance
Definition:
class.ilBuddySystem.php:13
$DIC
global $DIC
Definition:
saml.php:7
ilBuddySystem\getInstance
static getInstance()
Definition:
class.ilBuddySystem.php:44
user
user()
Definition:
user.php:4
ilBuddySystem\$settings
$settings
Definition:
class.ilBuddySystem.php:23
ilBuddySystem\setSetting
setSetting($keyword, $value)
Definition:
class.ilBuddySystem.php:57
ilBuddySystem\isEnabled
isEnabled()
Definition:
class.ilBuddySystem.php:75
ilBuddySystem\$is_enabled
static $is_enabled
Definition:
class.ilBuddySystem.php:18
$default
$default
Definition:
build.php:20
ilBuddySystem\__construct
__construct()
Definition:
class.ilBuddySystem.php:33
php
ilBuddySystem\getSetting
getSetting($keyword, $default=false)
Definition:
class.ilBuddySystem.php:67
ilBuddySystem
Class ilBuddySystem.
Definition:
class.ilBuddySystem.php:8
ilSetting
Services
Contact
BuddySystem
classes
class.ilBuddySystem.php
Generated on Thu Jan 30 2025 19:01:55 for ILIAS by
1.8.13 (using
Doxyfile
)