ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\components\File\Settings\General Class Reference
+ Inheritance diagram for ILIAS\components\File\Settings\General:
+ Collaboration diagram for ILIAS\components\File\Settings\General:

Public Member Functions

 __construct ()
 
 isDownloadWithAsciiFileName ()
 
 setDownloadWithAsciiFileName (bool $value)
 
 isShowAmountOfDownloads ()
 
 setShowAmountOfDownloads (bool $value)
 
 setInlineFileExtensions (array $extensions)
 
 getInlineFileExtensions ()
 
 getDownloadLimitinMB ()
 
 setDownloadLimitInMB (int $limit)
 
- Public Member Functions inherited from ilSetting
 __construct (string $a_module="common", bool $a_disabled_cache=false)
 
 getModule ()
 
 read ()
 
 get (string $a_keyword, ?string $a_default_value=null)
 get setting More...
 
 deleteAll ()
 
 deleteLike (string $a_like)
 
 delete (string $a_keyword)
 
 getAll ()
 
 set (string $a_key, string $a_val)
 
 setScormDebug (string $a_key, string $a_val)
 

Data Fields

const MODULE_NAME = 'file_access'
 
const F_BG_LIMIT = 'bg_limit'
 
const F_INLINE_FILE_EXTENSIONS = 'inline_file_extensions'
 
const F_SHOW_AMOUNT_OF_DOWNLOADS = 'show_amount_of_downloads'
 
const F_DOWNLOAD_ASCII_FILENAME = 'download_ascii_filename'
 
- Data Fields inherited from ilSetting
array $setting = array()
 
string $module = ""
 

Private Member Functions

 strToBool (string $value)
 
 boolToStr (bool $value)
 
 intToStr (int $int)
 
 strToInt (string $str)
 
 arrayToStr (array $array)
 
 strToArray (string $str)
 

Private Attributes

const SEPARATOR = ' '
 
array $default_inline_extensions
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSetting
static _lookupValue (string $a_module, string $a_keyword)
 
static _getValueType ()
 Get the type of the value column in the database. More...
 
static _changeValueType (string $a_new_type='text')
 change the type of the value column in the database More...
 
static _getLongerSettings (int $a_limit=4000)
 get a list of setting records with values loger than a limit More...
 
- Protected Attributes inherited from ilSetting
ilDBInterface $db
 
bool $cache_disabled = false
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 27 of file General.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\File\Settings\General::__construct ( )

Definition at line 48 of file General.php.

References ILIAS\GlobalScreen\Provider\__construct().

49  {
50  parent::__construct(self::MODULE_NAME, false);
51  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ arrayToStr()

ILIAS\components\File\Settings\General::arrayToStr ( array  $array)
private

Definition at line 122 of file General.php.

Referenced by ILIAS\components\File\Settings\General\getInlineFileExtensions(), and ILIAS\components\File\Settings\General\setInlineFileExtensions().

122  : string
123  {
124  return implode(self::SEPARATOR, $array);
125  }
+ Here is the caller graph for this function:

◆ boolToStr()

ILIAS\components\File\Settings\General::boolToStr ( bool  $value)
private

Definition at line 107 of file General.php.

Referenced by ILIAS\components\File\Settings\General\setDownloadWithAsciiFileName(), and ILIAS\components\File\Settings\General\setShowAmountOfDownloads().

107  : string
108  {
109  return $value ? '1' : '0';
110  }
+ Here is the caller graph for this function:

◆ getDownloadLimitinMB()

ILIAS\components\File\Settings\General::getDownloadLimitinMB ( )

Definition at line 90 of file General.php.

References ILIAS\components\File\Settings\General\strToInt().

90  : int
91  {
92  return $this->strToInt($this->get(self::F_BG_LIMIT, '200'));
93  }
+ Here is the call graph for this function:

◆ getInlineFileExtensions()

ILIAS\components\File\Settings\General::getInlineFileExtensions ( )

Definition at line 80 of file General.php.

References ILIAS\components\File\Settings\General\arrayToStr(), and ILIAS\components\File\Settings\General\strToArray().

80  : array
81  {
82  return $this->strToArray(
83  $this->get(
84  self::F_INLINE_FILE_EXTENSIONS,
85  $this->arrayToStr($this->default_inline_extensions)
86  )
87  );
88  }
+ Here is the call graph for this function:

◆ intToStr()

ILIAS\components\File\Settings\General::intToStr ( int  $int)
private

Definition at line 112 of file General.php.

Referenced by ILIAS\components\File\Settings\General\setDownloadLimitInMB().

112  : string
113  {
114  return (string) $int;
115  }
+ Here is the caller graph for this function:

◆ isDownloadWithAsciiFileName()

ILIAS\components\File\Settings\General::isDownloadWithAsciiFileName ( )

Definition at line 53 of file General.php.

References ILIAS\components\File\Settings\General\strToBool().

53  : bool
54  {
55  return $this->strToBool($this->get(self::F_DOWNLOAD_ASCII_FILENAME, '1'));
56  }
+ Here is the call graph for this function:

◆ isShowAmountOfDownloads()

ILIAS\components\File\Settings\General::isShowAmountOfDownloads ( )

Definition at line 63 of file General.php.

References ILIAS\components\File\Settings\General\strToBool().

63  : bool
64  {
65  return $this->strToBool($this->get(self::F_SHOW_AMOUNT_OF_DOWNLOADS, '1'));
66  }
+ Here is the call graph for this function:

◆ setDownloadLimitInMB()

ILIAS\components\File\Settings\General::setDownloadLimitInMB ( int  $limit)

Definition at line 95 of file General.php.

References ILIAS\components\File\Settings\General\intToStr().

95  : void
96  {
97  $this->set(self::F_BG_LIMIT, $this->intToStr($limit));
98  }
+ Here is the call graph for this function:

◆ setDownloadWithAsciiFileName()

ILIAS\components\File\Settings\General::setDownloadWithAsciiFileName ( bool  $value)

Definition at line 58 of file General.php.

References ILIAS\components\File\Settings\General\boolToStr().

58  : void
59  {
60  $this->set(self::F_DOWNLOAD_ASCII_FILENAME, $this->boolToStr($value));
61  }
+ Here is the call graph for this function:

◆ setInlineFileExtensions()

ILIAS\components\File\Settings\General::setInlineFileExtensions ( array  $extensions)

Definition at line 73 of file General.php.

References ILIAS\components\File\Settings\General\arrayToStr().

73  : void
74  {
75  $extensions = array_map(fn(string $extension): string => strtolower(trim($extension, " \t\n\r\0\x0B,")), $extensions);
76 
77  $this->set(self::F_INLINE_FILE_EXTENSIONS, $this->arrayToStr($extensions));
78  }
+ Here is the call graph for this function:

◆ setShowAmountOfDownloads()

ILIAS\components\File\Settings\General::setShowAmountOfDownloads ( bool  $value)

Definition at line 68 of file General.php.

References ILIAS\components\File\Settings\General\boolToStr().

68  : void
69  {
70  $this->set(self::F_SHOW_AMOUNT_OF_DOWNLOADS, $this->boolToStr($value));
71  }
+ Here is the call graph for this function:

◆ strToArray()

ILIAS\components\File\Settings\General::strToArray ( string  $str)
private

Definition at line 127 of file General.php.

Referenced by ILIAS\components\File\Settings\General\getInlineFileExtensions().

127  : array
128  {
129  return explode(self::SEPARATOR, $str);
130  }
+ Here is the caller graph for this function:

◆ strToBool()

ILIAS\components\File\Settings\General::strToBool ( string  $value)
private

Definition at line 102 of file General.php.

Referenced by ILIAS\components\File\Settings\General\isDownloadWithAsciiFileName(), and ILIAS\components\File\Settings\General\isShowAmountOfDownloads().

102  : bool
103  {
104  return $value === '1';
105  }
+ Here is the caller graph for this function:

◆ strToInt()

ILIAS\components\File\Settings\General::strToInt ( string  $str)
private

Definition at line 117 of file General.php.

Referenced by ILIAS\components\File\Settings\General\getDownloadLimitinMB().

117  : int
118  {
119  return (int) $str;
120  }
+ Here is the caller graph for this function:

Field Documentation

◆ $default_inline_extensions

array ILIAS\components\File\Settings\General::$default_inline_extensions
private
Initial value:
= [
'gif',
'jpg',
'jpeg',
'mp3',
'pdf',
'png',
]

Definition at line 39 of file General.php.

◆ F_BG_LIMIT

const ILIAS\components\File\Settings\General::F_BG_LIMIT = 'bg_limit'

Definition at line 30 of file General.php.

◆ F_DOWNLOAD_ASCII_FILENAME

const ILIAS\components\File\Settings\General::F_DOWNLOAD_ASCII_FILENAME = 'download_ascii_filename'

Definition at line 33 of file General.php.

◆ F_INLINE_FILE_EXTENSIONS

const ILIAS\components\File\Settings\General::F_INLINE_FILE_EXTENSIONS = 'inline_file_extensions'

Definition at line 31 of file General.php.

◆ F_SHOW_AMOUNT_OF_DOWNLOADS

const ILIAS\components\File\Settings\General::F_SHOW_AMOUNT_OF_DOWNLOADS = 'show_amount_of_downloads'

Definition at line 32 of file General.php.

◆ MODULE_NAME

const ILIAS\components\File\Settings\General::MODULE_NAME = 'file_access'

Definition at line 29 of file General.php.

◆ SEPARATOR

const ILIAS\components\File\Settings\General::SEPARATOR = ' '
private

Definition at line 37 of file General.php.


The documentation for this class was generated from the following file: