ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjFileAccessSettings.php
Go to the documentation of this file.
1<?php
2// BEGIN WebDAV
3/*
4 +-----------------------------------------------------------------------------+
5 | ILIAS open source |
6 +-----------------------------------------------------------------------------+
7 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
8 | |
9 | This program is free software; you can redistribute it and/or |
10 | modify it under the terms of the GNU General Public License |
11 | as published by the Free Software Foundation; either version 2 |
12 | of the License, or (at your option) any later version. |
13 | |
14 | This program is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | GNU General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU General Public License |
20 | along with this program; if not, write to the Free Software |
21 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
22 +-----------------------------------------------------------------------------+
23*/
24
39include_once "./Services/Object/classes/class.ilObject.php";
40
42{
47
52
58
63
70
80
87 public function __construct($a_id = 0, $a_call_by_reference = true)
88 {
89 $this->type = "facs";
90 parent::__construct($a_id, $a_call_by_reference);
91 }
92
99 public function setWebdavEnabled($newValue)
100 {
101 $this->webdavEnabled = $newValue;
102 }
108 public function isWebdavEnabled()
109 {
111 }
118 public function setWebdavActionsVisible($newValue)
119 {
120 $this->webdavActionsVisible = $newValue;
121 }
127 public function isWebdavActionsVisible()
128 {
130 }
131
132
143 public function setCustomWebfolderInstructions($newValue)
144 {
145 $this->customWebfolderInstructions = $newValue;
146 }
153 {
154 if (strlen($this->customWebfolderInstructions) == 0) {
155 require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
156 $this->customWebfolderInstructions = ilDAVServer::_getDefaultWebfolderInstructions();
157 }
159 }
167 {
169 }
176 {
178 }
185 public function setCustomWebfolderInstructionsEnabled($newValue)
186 {
187 $this->customWebfolderInstructionsEnabled = $newValue;
188 }
189
190
197 public function setInlineFileExtensions($newValue)
198 {
199 $this->inlineFileExtensions = $newValue;
200 }
206 public function getInlineFileExtensions()
207 {
209 }
216 public function setDownloadWithUploadedFilename($newValue)
217 {
218 $this->downloadWithUploadedFilename = $newValue;
219 }
226 {
228 }
229
230
238 public function create()
239 {
240 parent::create();
241 $this->write();
242 }
248 public function update()
249 {
251 $this->write();
252 }
257 private function write()
258 {
259 global $DIC;
260 $ilClientIniFile = $DIC['ilClientIniFile'];
261
262 // Clear any old error messages
263 $ilClientIniFile->error(null);
264
265 if (!$ilClientIniFile->groupExists('file_access')) {
266 $ilClientIniFile->addGroup('file_access');
267 }
268 $ilClientIniFile->setVariable('file_access', 'webdav_enabled', $this->webdavEnabled ? '1' : '0');
269 $ilClientIniFile->setVariable('file_access', 'webdav_actions_visible', $this->webdavActionsVisible ? '1' : '0');
270 $ilClientIniFile->setVariable('file_access', 'download_with_uploaded_filename', $this->downloadWithUploadedFilename ? '1' : '0');
271 $ilClientIniFile->write();
272
273 if ($ilClientIniFile->getError()) {
274 global $DIC;
275 $ilErr = $DIC['ilErr'];
276 $ilErr->raiseError($ilClientIniFile->getError(), $ilErr->WARNING);
277 }
278
279 require_once 'Services/Administration/classes/class.ilSetting.php';
280 $settings = new ilSetting('file_access');
281 $settings->set('inline_file_extensions', $this->inlineFileExtensions);
282 $settings->set('custom_webfolder_instructions_enabled', $this->customWebfolderInstructionsEnabled ? '1' : '0');
283 $settings->set('custom_webfolder_instructions', $this->customWebfolderInstructions);
284 }
288 public function read()
289 {
290 parent::read();
291
292 global $DIC;
293 $ilClientIniFile = $DIC['ilClientIniFile'];
294 $this->webdavEnabled = $ilClientIniFile->readVariable('file_access', 'webdav_enabled') == '1';
295 $this->webdavActionsVisible = $ilClientIniFile->readVariable('file_access', 'webdav_actions_visible') == '1';
296 $this->downloadWithUploadedFilename = $ilClientIniFile->readVariable('file_access', 'download_with_uploaded_filename') == '1';
297 $ilClientIniFile->ERROR = false;
298
299 require_once 'Services/Administration/classes/class.ilSetting.php';
300 $settings = new ilSetting('file_access');
301 $this->inlineFileExtensions = $settings->get('inline_file_extensions', '');
302 $this->customWebfolderInstructionsEnabled = $settings->get('custom_webfolder_instructions_enabled', '0') == '1';
303 $this->customWebfolderInstructions = $settings->get('custom_webfolder_instructions', '');
304 }
305} // END class.ilObjFileAccessSettings
306// END WebDAV
An exception for terminatinating execution or to throw for unit testing.
static _getDefaultWebfolderInstructions()
Gets instructions for the usage of webfolders.
getInlineFileExtensions()
Gets the inlineFileExtensions property.
write()
write object data into db
getCustomWebfolderInstructions()
Gets the customWebfolderInstructions property.
setCustomWebfolderInstructionsEnabled($newValue)
Sets the customWebfolderInstructionsEnabled property.
isWebdavEnabled()
Gets the webdavEnabled property.
isCustomWebfolderInstructionsEnabled()
Gets the customWebfolderInstructionsEnabled property.
setCustomWebfolderInstructions($newValue)
Sets the customWebfolderInstructions property.
isDownloadWithUploadedFilename()
Gets the downloadWithUploadedFilename property.
setWebdavActionsVisible($newValue)
Sets the webdavActionsVisible property.
setWebdavEnabled($newValue)
Sets the webdavEnabled property.
setInlineFileExtensions($newValue)
Sets the inlineFileExtensions property.
read()
read object data from db into object
$customWebfolderInstructionsEnabled
Boolean property.
isWebdavActionsVisible()
Gets the webdavActionsVisible property.
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
getDefaultWebfolderInstructions()
Gets the defaultWebfolderInstructions property.
setDownloadWithUploadedFilename($newValue)
Sets the downloadWithUploadedFilename property.
Class ilObject Basic functions for all objects.
ILIAS Setting Class.
update($pash, $contents, Config $config)
global $ilErr
Definition: raiseError.php:16
global $DIC
Definition: saml.php:7