59 public function read(): void
63 $res = $this->db->queryF(
64 "SELECT keyword, value FROM settings WHERE module = %s",
69 while ($row = $this->db->fetchAssoc(
$res)) {
70 $this->setting[$row[
"keyword"]] = $row[
"value"];
76 ?
string $default_value = null
78 if ($this->setting ===
null) {
82 return $this->setting[$keyword] ?? $default_value;
85 public function set(
string $keyword,
string $value):
void
87 if ($this->setting ===
null) {
94 'module' => [
'text', self::MODULE_NAME],
95 'keyword' => [
'text', $keyword],
98 'value' => [
'text', $value],
102 $this->setting[$keyword] = $value;
108 return $this->
strToBool($this->
get(self::F_DOWNLOAD_ASCII_FILENAME,
'1'));
118 return $this->
strToBool($this->
get(self::F_SHOW_AMOUNT_OF_DOWNLOADS,
'1'));
128 $extensions = array_map(
129 fn(
string $extension):
string => strtolower(trim($extension,
" \t\n\r\0\x0B,")),
140 self::F_INLINE_FILE_EXTENSIONS,
141 $this->
arrayToStr($this->default_inline_extensions)
148 return $this->
strToInt($this->
get(self::F_BG_LIMIT,
'200'));
160 return $value ===
'1';
165 return $value ?
'1' :
'0';
170 return (
string) $int;
180 return implode(self::SEPARATOR, $array);
185 return explode(self::SEPARATOR, (
string) $str);
setShowAmountOfDownloads(bool $value)
setDownloadLimitInMB(int $limit)
isDownloadWithAsciiFileName()
const F_DOWNLOAD_ASCII_FILENAME
read()
Reads this module's settings, replacing whatever was read before.
array $default_inline_extensions
strToBool(?string $value)
__construct(private readonly \ilDBInterface $db)
const F_SHOW_AMOUNT_OF_DOWNLOADS
getInlineFileExtensions()
isShowAmountOfDownloads()
setInlineFileExtensions(array $extensions)
setDownloadWithAsciiFileName(bool $value)
const F_INLINE_FILE_EXTENSIONS
The global limit for the sum of file sizes a ZIP download may collect.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
foreach($_POST as $key=> $value) $res