ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  }
ILIAS Setting Class.
+ 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 91 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by read().

92  {
93  $this->languages[$a_langkey] = (bool) $a_status;
94  }
+ 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 69 of file class.ilAuthLoginPageEditorSettings.php.

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

70  {
71  global $lng;
72 
73  if($this->getMode() != self::MODE_IPE)
74  {
75  return '';
76  }
77  if($this->isIliasEditorEnabled($a_langkey))
78  {
79  return $a_langkey;
80  }
81  if($this->isIliasEditorEnabled($lng->getDefaultLanguage()))
82  {
83  return $lng->getDefaultLanguage();
84  }
85  return '';
86  }
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  {
40  return self::$instance;
41  }
42  return self::$instance = new ilAuthLoginPageEditorSettings();
43  }
+ Here is the caller graph for this function:

◆ getMode()

ilAuthLoginPageEditorSettings::getMode ( )

Definition at line 58 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 48 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 100 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by getIliasEditorLanguage().

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

◆ read()

ilAuthLoginPageEditorSettings::read ( )

Read settings.

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

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

Referenced by __construct().

126  {
127  global $lng;
128 
129  $this->setMode($this->getStorage()->get('mode', self::MODE_RTE));
130 
131  // Language settings
132  $this->languages = array();
133  foreach($lng->getInstalledLanguages() as $num => $lngkey)
134  {
135  $this->enableIliasEditor($lngkey,$this->getStorage()->get($lngkey,0));
136  }
137  }
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 53 of file class.ilAuthLoginPageEditorSettings.php.

Referenced by read().

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

◆ update()

ilAuthLoginPageEditorSettings::update ( )

Update settings.

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

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

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