ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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.

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 140 of file class.ilFileUploadSettings.php.

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

141  {
142  return self::getInstance()->concurrentUploads;
143  }
+ Here is the caller graph for this function:

◆ getInstance()

static ilFileUploadSettings::getInstance ( )
staticprivate

Gets the instance of the ilFileUploadSettings.

Returns
ilFileUploadSettings

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

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

◆ 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  {
118  // don't allow to large numbers
119  $newValue = (int)$newValue;
120  if ($newValue < 1)
121  $newValue = 1;
122  else if ($newValue > self::CONCURRENT_UPLOADS_MAX)
123  $newValue = self::CONCURRENT_UPLOADS_MAX;
124  }
125  else
126  {
127  $newValue = self::CONCURRENT_UPLOADS_DEFAULT;
128  }
129 
130  $instance = self::getInstance();
131  $instance->concurrentUploads = $newValue;
132  $instance->settings->set("concurrent_upload_count", $instance->concurrentUploads);
133  }
+ 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: