ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilFMSettings.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
10 {
11  private static $instance = null;
12 
13  private $storage = null;
14  private $enabled = false;
15  private $localFS = true;
16  private $maxFileSize = 64;
17 
21  private function __construct()
22  {
23  $this->storage = new ilSetting('fm');
24  $this->read();
25  }
26 
31  public static function getInstance()
32  {
33  if (self::$instance) {
34  return self::$instance;
35  }
36  return self::$instance = new ilFMSettings();
37  }
38 
43  protected function getStorage()
44  {
45  return $this->storage;
46  }
47 
52  public function enable($a_status)
53  {
54  $this->enabled = $a_status;
55  }
56 
61  public function isEnabled()
62  {
63  return $this->enabled;
64  }
65 
70  public function enableLocalFS($a_stat)
71  {
72  $this->localFS = $a_stat;
73  }
74 
79  public function isLocalFSEnabled()
80  {
81  return $this->localFS;
82  }
83 
84  public function setMaxFileSize($a_size)
85  {
86  $this->maxFileSize = $a_size;
87  }
88 
89  public function getMaxFileSize()
90  {
91  return $this->maxFileSize;
92  }
93 
94 
98  public function update()
99  {
100  $this->getStorage()->set('enabled', (int) $this->isEnabled());
101  $this->getStorage()->set('local', (int) $this->isLocalFSEnabled());
102  $this->getStorage()->set('maxFileSize', (int) $this->getMaxFileSize());
103  }
104 
108  protected function read()
109  {
110  $this->enable($this->getStorage()->get('enabled', $this->enabled));
111  $this->enableLocalFS($this->getStorage()->get('local'), $this->localFS);
112  $this->setMaxFileSize($this->getStorage()->get('maxFileSize', $this->maxFileSize));
113  }
114 }
isLocalFSEnabled()
Check if local file system frame is enabled by default.
isEnabled()
check if enabled
__construct()
Singleton constructor.
read()
Read settings.
enable($a_status)
Enable file manager.
getStorage()
Get storage.
update()
Update settings.
setMaxFileSize($a_size)
static getInstance()
Get singleton instance.
File Manager settings.
enableLocalFS($a_stat)
Enable local file system frame.