ILIAS  release_8 Revision v8.24
class.ilObjFileAccessSettings.php
Go to the documentation of this file.
1<?php
19{
25 private string $inline_file_extensions = '';
37
41 public function __construct(int $a_id = 0, bool $a_call_by_reference = true)
42 {
43 global $DIC;
44
45 $this->type = "facs";
46 parent::__construct($a_id, $a_call_by_reference);
47 $this->ini_file = $DIC['ilClientIniFile'];
48 $this->settings = new ilSetting('file_access');
49 }
50
51
57 public function setInlineFileExtensions(string $value): void
58 {
59 $this->inline_file_extensions = $value;
60 }
61
62
66 public function getInlineFileExtensions(): string
67 {
69 }
70
71
75 public function setDownloadWithUploadedFilename(bool $value): void
76 {
77 $this->download_with_uploaded_filename = $value;
78 }
79
83 public function isDownloadWithUploadedFilename(): bool
84 {
86 }
87
88
96 public function create(): int
97 {
98 $id = parent::create();
99 $this->write();
100
101 return $id;
102 }
103
104
108 public function update(): bool
109 {
110 parent::update();
111 $this->write();
112
113 return true;
114 }
115
116
120 private function write(): void
121 {
122 if (!$this->ini_file->groupExists('file_access')) {
123 $this->ini_file->addGroup('file_access');
124 }
125 $this->ini_file->setVariable(
126 'file_access',
127 'download_with_uploaded_filename',
128 $this->download_with_uploaded_filename ? '1' : '0'
129 );
130 $this->ini_file->write();
131 if ($this->ini_file->getError()) {
132 }
133 $this->settings->set('inline_file_extensions', $this->inline_file_extensions);
134 }
135
136
140 public function read(): void
141 {
142 parent::read();
143
144 $this->download_with_uploaded_filename = $this->ini_file->readVariable(
145 'file_access',
146 'download_with_uploaded_filename'
147 ) === '1';
148
149 $this->inline_file_extensions = $this->settings->get('inline_file_extensions', '');
150 }
151}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInlineFileExtensions()
Gets the inlineFileExtensions property.
write()
write object data into db
setDownloadWithUploadedFilename(bool $value)
Sets the downloadWithUploadedFilename property.
isDownloadWithUploadedFilename()
Gets the downloadWithUploadedFilename property.
__construct(int $a_id=0, bool $a_call_by_reference=true)
Constructor.
read()
read object data from db into object
setInlineFileExtensions(string $value)
Sets the inlineFileExtensions property.
bool $download_with_uploaded_filename
Boolean property.
string $inline_file_extensions
String property.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc