ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
9{
13 protected static $instance;
14
18 protected static $is_enabled;
19
23 protected $settings;
24
28 protected function __construct()
29 {
30 $this->settings = new ilSetting('buddysystem');
31 }
32
36 public static function getInstance()
37 {
38 if(!(self::$instance instanceof self))
39 {
40 self::$instance = new self();
41 }
42
43 return self::$instance;
44 }
45
50 public function setSetting($keyword, $value)
51 {
52 $this->settings->set($keyword, $value);
53 }
54
60 public function getSetting($keyword, $default = false)
61 {
62 return $this->settings->get($keyword, $default);
63 }
64
68 public function isEnabled()
69 {
73 global $ilUser;
74
75 if(self::$is_enabled !== null)
76 {
77 return self::$is_enabled;
78 }
79
80 if($ilUser->isAnonymous())
81 {
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}
Class ilBuddySystem.
getSetting($keyword, $default=false)
setSetting($keyword, $value)
ILIAS Setting Class.
global $ilUser
Definition: imgupload.php:15