ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMediaCastSettings Class Reference

Stores all mediacast relevant settings. More...

+ Collaboration diagram for ilMediaCastSettings:

Public Member Functions

 setPurposeSuffixes ($purpose_filetypes)
 set filetypes for purposes More...
 
 getPurposeSuffixes ()
 get filetypes for purposes More...
 
 getDefaultAccess ()
 
 setDefaultAccess ($value)
 
 getMimeTypes ()
 
 setMimeTypes (array $mimeTypes)
 
 save ()
 save More...
 

Static Public Member Functions

static _getInstance ()
 get singleton instance More...
 

Private Member Functions

 __construct ()
 singleton contructor More...
 
 read ()
 Read settings. More...
 
 initStorage ()
 Init storage class (ilSetting) private. More...
 

Private Attributes

 $defaultAccess = "users"
 
 $purposeSuffixes = array()
 
 $mimeTypes = array()
 

Static Private Attributes

static $instance = null
 

Detailed Description

Stores all mediacast relevant settings.

Author
Roland Küstermann rkues.nosp@m.term.nosp@m.ann@m.nosp@m.ps.d.nosp@m.e
Version
$Id$

Definition at line 33 of file class.ilMediaCastSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilMediaCastSettings::__construct ( )
private

singleton contructor

private

Definition at line 46 of file class.ilMediaCastSettings.php.

References initStorage(), and read().

47  {
48  $this->initStorage();
49  $this->read();
50  }
initStorage()
Init storage class (ilSetting) private.
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilMediaCastSettings::_getInstance ( )
static

get singleton instance

public

Definition at line 59 of file class.ilMediaCastSettings.php.

Referenced by ilObjMediaCastGUI\__construct(), and ilObjMediaCastSettingsGUI\initMediaCastSettings().

60  {
61  if (self::$instance) {
62  return self::$instance;
63  }
64  return self::$instance = new ilMediaCastSettings();
65  }
Stores all mediacast relevant settings.
+ Here is the caller graph for this function:

◆ getDefaultAccess()

ilMediaCastSettings::getDefaultAccess ( )

Definition at line 89 of file class.ilMediaCastSettings.php.

References $defaultAccess.

◆ getMimeTypes()

ilMediaCastSettings::getMimeTypes ( )
Returns
array of mimetypes

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

References $mimeTypes.

Referenced by save().

103  {
104  return $this->mimeTypes;
105  }
+ Here is the caller graph for this function:

◆ getPurposeSuffixes()

ilMediaCastSettings::getPurposeSuffixes ( )

get filetypes for purposes

public

Definition at line 84 of file class.ilMediaCastSettings.php.

References $purposeSuffixes.

◆ initStorage()

ilMediaCastSettings::initStorage ( )
private

Init storage class (ilSetting) private.

Definition at line 155 of file class.ilMediaCastSettings.php.

References $mimeTypes, ilObjMediaCast\$purposes, array, ilMimeTypeUtil\getExt2MimeMap(), setDefaultAccess(), and setMimeTypes().

Referenced by __construct().

156  {
157  include_once('./Services/Administration/classes/class.ilSetting.php');
158  $this->storage = new ilSetting('mcst');
159  include_once('./Modules/MediaCast/classes/class.ilObjMediaCast.php');
160  $this->purposeSuffixes = array_flip(ilObjMediaCast::$purposes);
161 
162  $this->purposeSuffixes["Standard"] = array("mp3","flv","mp4","mov","wmv","gif","png", "jpg", "jpeg");
163  $this->purposeSuffixes["AudioPortable"] = array("mp3");
164  $this->purposeSuffixes["VideoPortable"] = array("mp4","mov");
165  $this->setDefaultAccess("users");
166  include_once("./Services/Utilities/classes/class.ilMimeTypeUtil.php");
167  $mimeTypes = array_unique(array_values(ilMimeTypeUtil::getExt2MimeMap()));
168  sort($mimeTypes);
169  $this->setMimeTypes($mimeTypes);
170  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilMediaCastSettings::read ( )
private

Read settings.

private

Parameters

Definition at line 137 of file class.ilMediaCastSettings.php.

References setDefaultAccess(), and setMimeTypes().

Referenced by __construct().

138  {
139  foreach ($this->purposeSuffixes as $purpose => $filetypes) {
140  if ($this->storage->get($purpose . "_types") != false) {
141  $this->purposeSuffixes[$purpose] = explode(",", $this->storage->get($purpose . "_types"));
142  }
143  }
144  $this->setDefaultAccess($this->storage->get("defaultaccess"));
145  if ($this->storage->get("mimetypes")) {
146  $this->setMimeTypes(explode(",", $this->storage->get("mimetypes")));
147  }
148  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilMediaCastSettings::save ( )

save

public

Definition at line 121 of file class.ilMediaCastSettings.php.

References getMimeTypes().

122  {
123  foreach ($this->purposeSuffixes as $purpose => $filetypes) {
124  $this->storage->set($purpose . "_types", implode(",", $filetypes));
125  }
126  $this->storage->set("defaultaccess", $this->defaultAccess);
127  $this->storage->set("mimetypes", implode(",", $this->getMimeTypes()));
128  }
+ Here is the call graph for this function:

◆ setDefaultAccess()

ilMediaCastSettings::setDefaultAccess (   $value)

Definition at line 94 of file class.ilMediaCastSettings.php.

Referenced by initStorage(), and read().

95  {
96  $this->defaultAccess = $value == "users" ? "users" : "public";
97  }
+ Here is the caller graph for this function:

◆ setMimeTypes()

ilMediaCastSettings::setMimeTypes ( array  $mimeTypes)
Parameters
unknown_type$mimeTypes

Definition at line 110 of file class.ilMediaCastSettings.php.

References $mimeTypes.

Referenced by initStorage(), and read().

111  {
112  $this->mimeTypes = $mimeTypes;
113  }
+ Here is the caller graph for this function:

◆ setPurposeSuffixes()

ilMediaCastSettings::setPurposeSuffixes (   $purpose_filetypes)

set filetypes for purposes

public

Definition at line 73 of file class.ilMediaCastSettings.php.

74  {
75  $this->purposeSuffixes = $purpose_filetypes;
76  }

Field Documentation

◆ $defaultAccess

ilMediaCastSettings::$defaultAccess = "users"
private

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

Referenced by getDefaultAccess().

◆ $instance

ilMediaCastSettings::$instance = null
staticprivate

Definition at line 35 of file class.ilMediaCastSettings.php.

◆ $mimeTypes

ilMediaCastSettings::$mimeTypes = array()
private

Definition at line 38 of file class.ilMediaCastSettings.php.

Referenced by getMimeTypes(), initStorage(), and setMimeTypes().

◆ $purposeSuffixes

ilMediaCastSettings::$purposeSuffixes = array()
private

Definition at line 37 of file class.ilMediaCastSettings.php.

Referenced by getPurposeSuffixes().


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