ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
63  return self::$instance;
64  }
65  return self::$instance = new ilMediaCastSettings();
66  }
Stores all mediacast relevant settings.
+ Here is the caller graph for this function:

◆ getDefaultAccess()

ilMediaCastSettings::getDefaultAccess ( )

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

References $defaultAccess.

◆ getMimeTypes()

ilMediaCastSettings::getMimeTypes ( )
Returns
array of mimetypes

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

References $mimeTypes.

Referenced by save().

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

◆ getPurposeSuffixes()

ilMediaCastSettings::getPurposeSuffixes ( )

get filetypes for purposes

public

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

References $purposeSuffixes.

◆ initStorage()

ilMediaCastSettings::initStorage ( )
private

Init storage class (ilSetting) private.

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

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

Referenced by __construct().

152  {
153  include_once('./Services/Administration/classes/class.ilSetting.php');
154  $this->storage = new ilSetting('mcst');
155  include_once('./Modules/MediaCast/classes/class.ilObjMediaCast.php');
156  $this->purposeSuffixes = array_flip(ilObjMediaCast::$purposes);
157 
158  $this->purposeSuffixes["Standard"] = array("mp3","flv","mp4","m4v","mov","wmv","gif","png", "jpg", "jpeg");
159  $this->purposeSuffixes["AudioPortable"] = array("mp3");
160  $this->purposeSuffixes["VideoPortable"] = array("mp4","m4v","mov");
161  $this->setDefaultAccess("users");
162  include_once("./Services/Utilities/classes/class.ilMimeTypeUtil.php");
163  $mimeTypes = array_unique(array_values(ilMimeTypeUtil::getExt2MimeMap()));
164  sort($mimeTypes);
165  $this->setMimeTypes($mimeTypes);
166  }
ILIAS Setting Class.
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 134 of file class.ilMediaCastSettings.php.

References setDefaultAccess(), and setMimeTypes().

Referenced by __construct().

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

◆ save()

ilMediaCastSettings::save ( )

save

public

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

References getMimeTypes().

119  {
120  foreach ($this->purposeSuffixes as $purpose => $filetypes) {
121  $this->storage->set($purpose . "_types", implode(",",$filetypes));
122  }
123  $this->storage->set("defaultaccess",$this->defaultAccess);
124  $this->storage->set("mimetypes", implode(",", $this->getMimeTypes()));
125  }
+ 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().

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

◆ setMimeTypes()

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

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

References $mimeTypes.

Referenced by initStorage(), and read().

108  {
109  $this->mimeTypes = $mimeTypes;
110  }
+ Here is the caller graph for this function:

◆ setPurposeSuffixes()

ilMediaCastSettings::setPurposeSuffixes (   $purpose_filetypes)

set filetypes for purposes

public

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

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

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: