ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
All Data Structures Namespaces Files Functions Variables Typedefs Modules Pages
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 89 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by read().

90  {
91  $this->languages[$a_langkey] = (bool) $a_status;
92  }
+ 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 $DIC, $lng, getMode(), and isIliasEditorEnabled().

69  {
70  global $DIC;
71 
72  $lng = $DIC['lng'];
73 
74  if ($this->getMode() != self::MODE_IPE) {
75  return '';
76  }
77  if ($this->isIliasEditorEnabled($a_langkey)) {
78  return $a_langkey;
79  }
80  if ($this->isIliasEditorEnabled($lng->getDefaultLanguage())) {
81  return $lng->getDefaultLanguage();
82  }
83  return '';
84  }
isIliasEditorEnabled($a_langkey)
Check if ilias editor is enabled for a language.
global $DIC
Definition: saml.php:7
$lng
+ 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 98 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by getIliasEditorLanguage().

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

◆ read()

ilAuthLoginPageEditorSettings::read ( )

Read settings.

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

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

Referenced by __construct().

122  {
123  global $DIC;
124 
125  $lng = $DIC['lng'];
126 
127  $this->setMode($this->getStorage()->get('mode', self::MODE_RTE));
128 
129  // Language settings
130  $this->languages = array();
131  foreach ($lng->getInstalledLanguages() as $num => $lngkey) {
132  $this->enableIliasEditor($lngkey, $this->getStorage()->get($lngkey, 0));
133  }
134  }
global $DIC
Definition: saml.php:7
$lng
enableIliasEditor($a_langkey, $a_status)
Enable editor for language.
+ 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 109 of file class.ilAuthLoginPageEditorSettings.php.

References getMode(), and getStorage().

110  {
111  $this->getStorage()->set('mode', $this->getMode());
112 
113  foreach ((array) $this->languages as $lngkey => $stat) {
114  $this->storage->set($lngkey, (int) $stat);
115  }
116  }
+ 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: