ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilFileUploadSettings Class Reference
+ Collaboration diagram for ilFileUploadSettings:

Static Public Member Functions

static setDragAndDropUploadEnabled ($newValue)
 Sets whether drag and drop file upload is enabled. More...
 
static isDragAndDropUploadEnabled ()
 Gets whether drag and drop file upload is enabled. More...
 
static setRepositoryDragAndDropUploadEnabled ($newValue)
 Sets whether drag and drop file upload in the repository is enabled. More...
 
static isRepositoryDragAndDropUploadEnabled ()
 Gets whether drag and drop file upload in the repository is enabled. More...
 
static setConcurrentUploads ($newValue)
 Sets the number of files that can be uploaded at the same time. More...
 
static getConcurrentUploads ()
 Gets the number of files that can be uploaded at the same time. More...
 

Data Fields

const CONCURRENT_UPLOADS_DEFAULT = 3
 
const CONCURRENT_UPLOADS_MAX = 10
 

Private Member Functions

 __construct ()
 Private constructor. More...
 

Static Private Member Functions

static getInstance ()
 Gets the instance of the ilFileUploadSettings. More...
 

Private Attributes

 $settings = null
 
 $dndUploadEnabled = true
 
 $repositoryDndUploadEnabled = true
 
 $concurrentUploads = self::CONCURRENT_UPLOADS_DEFAULT
 

Static Private Attributes

static $instance = null
 

Detailed Description

Definition at line 15 of file class.ilFileUploadSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileUploadSettings::__construct ( )
private

Private constructor.

Definition at line 53 of file class.ilFileUploadSettings.php.

54 {
55 $this->settings = new ilSetting("fileupload");
56 $this->dndUploadEnabled = $this->settings->get("dnd_upload_enabled", true) == true;
57 $this->repositoryDndUploadEnabled = $this->settings->get("repository_dnd_upload_enabled", true) == true;
58 $this->concurrentUploads = $this->settings->get("concurrent_upload_count", self::CONCURRENT_UPLOADS_DEFAULT);
59 }
ILIAS Setting Class.
settings()
Definition: settings.php:2

References settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getConcurrentUploads()

static ilFileUploadSettings::getConcurrentUploads ( )
static

Gets the number of files that can be uploaded at the same time.

Returns
int value

Definition at line 138 of file class.ilFileUploadSettings.php.

139 {
140 return self::getInstance()->concurrentUploads;
141 }
static getInstance()
Gets the instance of the ilFileUploadSettings.

References getInstance().

Referenced by ilObjFileAccessSettingsGUI\editUploadSettings(), ilFileUploadGUI\getSharedHtml(), and ilObjFileAccessSettingsGUI\initUploadSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

static ilFileUploadSettings::getInstance ( )
staticprivate

Gets the instance of the ilFileUploadSettings.

Returns
ilFileUploadSettings

Definition at line 147 of file class.ilFileUploadSettings.php.

148 {
149 if (self::$instance == null) {
150 self::$instance = new ilFileUploadSettings();
151 }
152
153 return self::$instance;
154 }

References $instance.

Referenced by getConcurrentUploads(), isDragAndDropUploadEnabled(), isRepositoryDragAndDropUploadEnabled(), setConcurrentUploads(), setDragAndDropUploadEnabled(), and setRepositoryDragAndDropUploadEnabled().

+ Here is the caller graph for this function:

◆ isDragAndDropUploadEnabled()

static ilFileUploadSettings::isDragAndDropUploadEnabled ( )
static

Gets whether drag and drop file upload is enabled.

Returns
boolean value

Definition at line 79 of file class.ilFileUploadSettings.php.

80 {
81 return self::getInstance()->dndUploadEnabled;
82 }

References getInstance().

Referenced by ilObjFileAccessSettingsGUI\editUploadSettings(), ilObjFileGUI\initCreationForms(), ilObjFileAccessSettingsGUI\initUploadSettingsForm(), and ilFileUploadUtil\isUploadAllowed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryDragAndDropUploadEnabled()

static ilFileUploadSettings::isRepositoryDragAndDropUploadEnabled ( )
static

Gets whether drag and drop file upload in the repository is enabled.

Returns
boolean value

Definition at line 102 of file class.ilFileUploadSettings.php.

103 {
104 return self::getInstance()->repositoryDndUploadEnabled;
105 }

References getInstance().

Referenced by ilObjFileAccessSettingsGUI\editUploadSettings(), ilObjFileAccessSettingsGUI\initUploadSettingsForm(), and ilFileUploadUtil\isUploadAllowed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setConcurrentUploads()

static ilFileUploadSettings::setConcurrentUploads (   $newValue)
static

Sets the number of files that can be uploaded at the same time.

Parameters
intnew value
Returns
void

Definition at line 113 of file class.ilFileUploadSettings.php.

114 {
115 // is number?
116 if (is_numeric($newValue)) {
117 // don't allow to large numbers
118 $newValue = (int) $newValue;
119 if ($newValue < 1) {
120 $newValue = 1;
121 } elseif ($newValue > self::CONCURRENT_UPLOADS_MAX) {
123 }
124 } else {
126 }
127
129 $instance->concurrentUploads = $newValue;
130 $instance->settings->set("concurrent_upload_count", $instance->concurrentUploads);
131 }

References $instance, CONCURRENT_UPLOADS_DEFAULT, CONCURRENT_UPLOADS_MAX, and getInstance().

Referenced by ilObjFileAccessSettingsGUI\saveUploadSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDragAndDropUploadEnabled()

static ilFileUploadSettings::setDragAndDropUploadEnabled (   $newValue)
static

Sets whether drag and drop file upload is enabled.

Parameters
boolnew value
Returns
void

Definition at line 67 of file class.ilFileUploadSettings.php.

68 {
70 $instance->dndUploadEnabled = $newValue == true;
71 $instance->settings->set("dnd_upload_enabled", $instance->dndUploadEnabled);
72 }

References $instance, and getInstance().

Referenced by ilObjFileAccessSettingsGUI\saveUploadSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRepositoryDragAndDropUploadEnabled()

static ilFileUploadSettings::setRepositoryDragAndDropUploadEnabled (   $newValue)
static

Sets whether drag and drop file upload in the repository is enabled.

Parameters
boolnew value
Returns
void

Definition at line 90 of file class.ilFileUploadSettings.php.

91 {
93 $instance->repositoryDndUploadEnabled = $newValue == true;
94 $instance->settings->set("repository_dnd_upload_enabled", $instance->repositoryDndUploadEnabled);
95 }

References $instance, and getInstance().

Referenced by ilObjFileAccessSettingsGUI\saveUploadSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $concurrentUploads

ilFileUploadSettings::$concurrentUploads = self::CONCURRENT_UPLOADS_DEFAULT
private

Definition at line 48 of file class.ilFileUploadSettings.php.

◆ $dndUploadEnabled

ilFileUploadSettings::$dndUploadEnabled = true
private

Definition at line 36 of file class.ilFileUploadSettings.php.

◆ $instance

ilFileUploadSettings::$instance = null
staticprivate

◆ $repositoryDndUploadEnabled

ilFileUploadSettings::$repositoryDndUploadEnabled = true
private

Definition at line 42 of file class.ilFileUploadSettings.php.

◆ $settings

ilFileUploadSettings::$settings = null
private

Definition at line 30 of file class.ilFileUploadSettings.php.

◆ CONCURRENT_UPLOADS_DEFAULT

const ilFileUploadSettings::CONCURRENT_UPLOADS_DEFAULT = 3

Definition at line 17 of file class.ilFileUploadSettings.php.

Referenced by setConcurrentUploads().

◆ CONCURRENT_UPLOADS_MAX

const ilFileUploadSettings::CONCURRENT_UPLOADS_MAX = 10

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