ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

References settings().

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  }
settings()
Definition: settings.php:2
+ 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.

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

139  {
140  return self::getInstance()->concurrentUploads;
141  }
+ 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  }

◆ 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.

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

80  {
81  return self::getInstance()->dndUploadEnabled;
82  }
+ 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.

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

103  {
104  return self::getInstance()->repositoryDndUploadEnabled;
105  }
+ 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.

References $instance.

Referenced by ilObjFileAccessSettingsGUI\saveUploadSettings().

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) {
122  $newValue = self::CONCURRENT_UPLOADS_MAX;
123  }
124  } else {
125  $newValue = self::CONCURRENT_UPLOADS_DEFAULT;
126  }
127 
128  $instance = self::getInstance();
129  $instance->concurrentUploads = $newValue;
130  $instance->settings->set("concurrent_upload_count", $instance->concurrentUploads);
131  }
+ 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.

References $instance.

Referenced by ilObjFileAccessSettingsGUI\saveUploadSettings().

68  {
69  $instance = self::getInstance();
70  $instance->dndUploadEnabled = $newValue == true;
71  $instance->settings->set("dnd_upload_enabled", $instance->dndUploadEnabled);
72  }
+ 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.

References $instance.

Referenced by ilObjFileAccessSettingsGUI\saveUploadSettings().

91  {
92  $instance = self::getInstance();
93  $instance->repositoryDndUploadEnabled = $newValue == true;
94  $instance->settings->set("repository_dnd_upload_enabled", $instance->repositoryDndUploadEnabled);
95  }
+ 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.

◆ CONCURRENT_UPLOADS_MAX

const ilFileUploadSettings::CONCURRENT_UPLOADS_MAX = 10

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