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

Storage of editor settings. More...

+ Collaboration diagram for ilAuthLoginPageEditorSettings:

Public Member Functions

 __construct ()
 
 setMode ($a_mode)
 
 getMode ()
 
 getIliasEditorLanguage ($a_langkey)
 Get ilias editor language ilLanguage $lng. More...
 
 enableIliasEditor ($a_langkey, $a_status)
 Enable editor for language. More...
 
 isIliasEditorEnabled ($a_langkey)
 Check if ilias editor is enabled for a language. More...
 
 update ()
 Update settings. More...
 
 read ()
 Read settings. More...
 

Static Public Member Functions

static getInstance ()
 Get singelton instance. More...
 

Data Fields

const MODE__UNDEFINED = 0
 
const MODE_RTE = 1
 
const MODE_IPE = 2
 

Protected Member Functions

 getStorage ()
 

Private Attributes

 $languages = array()
 
 $storage = null
 
 $mode = 0
 

Static Private Attributes

static $instance = null
 

Detailed Description

Storage of editor settings.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 10 of file class.ilAuthLoginPageEditorSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthLoginPageEditorSettings::__construct ( )

Definition at line 25 of file class.ilAuthLoginPageEditorSettings.php.

References read().

26  {
27  include_once './Services/Administration/classes/class.ilSetting.php';
28  $this->storage = new ilSetting('login_editor');
29  $this->read();
30  }
+ Here is the call graph for this function:

Member Function Documentation

◆ enableIliasEditor()

ilAuthLoginPageEditorSettings::enableIliasEditor (   $a_langkey,
  $a_status 
)

Enable editor for language.

Definition at line 87 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by read().

88  {
89  $this->languages[$a_langkey] = (bool) $a_status;
90  }
+ Here is the caller graph for this function:

◆ getIliasEditorLanguage()

ilAuthLoginPageEditorSettings::getIliasEditorLanguage (   $a_langkey)

Get ilias editor language ilLanguage $lng.

Parameters
string$a_langkey
Returns
string

Definition at line 68 of file class.ilAuthLoginPageEditorSettings.php.

References $lng, getMode(), and isIliasEditorEnabled().

69  {
70  global $lng;
71 
72  if ($this->getMode() != self::MODE_IPE) {
73  return '';
74  }
75  if ($this->isIliasEditorEnabled($a_langkey)) {
76  return $a_langkey;
77  }
78  if ($this->isIliasEditorEnabled($lng->getDefaultLanguage())) {
79  return $lng->getDefaultLanguage();
80  }
81  return '';
82  }
isIliasEditorEnabled($a_langkey)
Check if ilias editor is enabled for a language.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getInstance()

static ilAuthLoginPageEditorSettings::getInstance ( )
static

Get singelton instance.

Returns
ilAuthLoginPageEditorSettings

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

Referenced by ilAuthLoginPageEditorGUI\__construct(), ilAuthLoginPageEditorGUI\activate(), ilStartUpGUI\getLoginPageEditorHTML(), and ilAuthLoginPageEditorTableGUI\parse().

37  {
38  if (self::$instance) {
39  return self::$instance;
40  }
41  return self::$instance = new ilAuthLoginPageEditorSettings();
42  }
+ Here is the caller graph for this function:

◆ getMode()

ilAuthLoginPageEditorSettings::getMode ( )

Definition at line 57 of file class.ilAuthLoginPageEditorSettings.php.

References $mode.

Referenced by getIliasEditorLanguage(), and update().

+ Here is the caller graph for this function:

◆ getStorage()

ilAuthLoginPageEditorSettings::getStorage ( )
protected
Returns
ilSetting

Definition at line 47 of file class.ilAuthLoginPageEditorSettings.php.

References $storage.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ isIliasEditorEnabled()

ilAuthLoginPageEditorSettings::isIliasEditorEnabled (   $a_langkey)

Check if ilias editor is enabled for a language.

Parameters
string$a_langkey

Definition at line 96 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by getIliasEditorLanguage().

97  {
98  if (isset($this->languages[$a_langkey])) {
99  return (bool) $this->languages[$a_langkey];
100  }
101  return false;
102  }
+ Here is the caller graph for this function:

◆ read()

ilAuthLoginPageEditorSettings::read ( )

Read settings.

Definition at line 119 of file class.ilAuthLoginPageEditorSettings.php.

References $lng, array, enableIliasEditor(), getStorage(), and setMode().

Referenced by __construct().

120  {
121  global $lng;
122 
123  $this->setMode($this->getStorage()->get('mode', self::MODE_RTE));
124 
125  // Language settings
126  $this->languages = array();
127  foreach ($lng->getInstalledLanguages() as $num => $lngkey) {
128  $this->enableIliasEditor($lngkey, $this->getStorage()->get($lngkey, 0));
129  }
130  }
Create styles array
The data for the language used.
enableIliasEditor($a_langkey, $a_status)
Enable editor for language.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMode()

ilAuthLoginPageEditorSettings::setMode (   $a_mode)

Definition at line 52 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by read().

53  {
54  $this->mode = $a_mode;
55  }
+ Here is the caller graph for this function:

◆ update()

ilAuthLoginPageEditorSettings::update ( )

Update settings.

Definition at line 107 of file class.ilAuthLoginPageEditorSettings.php.

References array, getMode(), and getStorage().

108  {
109  $this->getStorage()->set('mode', $this->getMode());
110 
111  foreach ((array) $this->languages as $lngkey => $stat) {
112  $this->storage->set($lngkey, (int) $stat);
113  }
114  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilAuthLoginPageEditorSettings::$instance = null
staticprivate

Definition at line 19 of file class.ilAuthLoginPageEditorSettings.php.

◆ $languages

ilAuthLoginPageEditorSettings::$languages = array()
private

Definition at line 16 of file class.ilAuthLoginPageEditorSettings.php.

◆ $mode

ilAuthLoginPageEditorSettings::$mode = 0
private

Definition at line 22 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by getMode().

◆ $storage

ilAuthLoginPageEditorSettings::$storage = null
private

Definition at line 20 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by getStorage().

◆ MODE__UNDEFINED

const ilAuthLoginPageEditorSettings::MODE__UNDEFINED = 0

Definition at line 12 of file class.ilAuthLoginPageEditorSettings.php.

◆ MODE_IPE

const ilAuthLoginPageEditorSettings::MODE_IPE = 2

◆ MODE_RTE

const ilAuthLoginPageEditorSettings::MODE_RTE = 1

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