ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilBuddySystem Class Reference

Class ilBuddySystem. More...

+ Collaboration diagram for ilBuddySystem:

Public Member Functions

 setSetting ($keyword, $value)
 
 getSetting ($keyword, $default=false)
 
 isEnabled ()
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 __construct ()
 

Protected Attributes

 $settings
 
 $user
 

Static Protected Attributes

static $instance
 
static $is_enabled
 

Detailed Description

Class ilBuddySystem.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 8 of file class.ilBuddySystem.php.

Constructor & Destructor Documentation

◆ __construct()

ilBuddySystem::__construct ( )
protected

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

References $DIC, settings(), and user().

34  {
35  global $DIC;
36 
37  $this->settings = new ilSetting('buddysystem');
38  $this->user = $DIC['ilUser'];
39  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ getInstance()

static ilBuddySystem::getInstance ( )
static

◆ getSetting()

ilBuddySystem::getSetting (   $keyword,
  $default = false 
)
Parameters
string$keyword
bool | false$default
Returns
string

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

References settings().

68  {
69  return $this->settings->get($keyword, $default);
70  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

◆ isEnabled()

ilBuddySystem::isEnabled ( )
Returns
bool

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

References settings(), and user().

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  }
user()
Definition: user.php:4
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

◆ setSetting()

ilBuddySystem::setSetting (   $keyword,
  $value 
)
Parameters
string$keyword
mixed$value

Definition at line 57 of file class.ilBuddySystem.php.

References settings().

58  {
59  $this->settings->set($keyword, $value);
60  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilBuddySystem::$instance
staticprotected

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

◆ $is_enabled

ilBuddySystem::$is_enabled
staticprotected

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

◆ $settings

ilBuddySystem::$settings
protected

Definition at line 23 of file class.ilBuddySystem.php.

◆ $user

ilBuddySystem::$user
protected

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


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