ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilMDSettings.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
34{
35 public static $instance = null;
36
37 private $settings;
39
46 private function __construct()
47 {
48 $this->read();
49 }
50
59 public static function _getInstance()
60 {
61 if (self::$instance) {
62 return self::$instance;
63 }
64 return self::$instance = new ilMDSettings();
65 }
66
74 {
75 return $this->copyright_selection_active ? true : false;
76 }
77
85 public function activateCopyrightSelection($a_status)
86 {
87 $this->copyright_selection_active = $a_status;
88 }
89
95 public function setDelimiter($a_val)
96 {
97 $this->delimiter = $a_val;
98 }
99
105 public function getDelimiter()
106 {
107 if (trim($this->delimiter) == "") {
108 return ",";
109 }
110 return $this->delimiter;
111 }
112
119 public function save()
120 {
121 $this->settings->set('copyright_selection_active', (int) $this->isCopyrightSelectionActive());
122 $this->settings->set('delimiter', $this->getDelimiter());
123 }
124
131 private function read()
132 {
133 $this->settings = new ilSetting('md_settings');
134
135 $this->copyright_selection_active = $this->settings->get('copyright_selection_active', 0);
136 $this->delimiter = $this->settings->get('delimiter', ",");
137 }
138}
An exception for terminatinating execution or to throw for unit testing.
__construct()
Constructor.
static _getInstance()
get instance
getDelimiter()
Get delimiter.
isCopyrightSelectionActive()
is copyright selection active
activateCopyrightSelection($a_status)
enable copyright selection
setDelimiter($a_val)
Set delimiter (used in quick editing screen)
ILIAS Setting Class.
$delimiter
Definition: showstats.php:16
settings()
Definition: settings.php:2