ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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.
 enableIliasEditor ($a_langkey, $a_status)
 Enable editor for language.
 isIliasEditorEnabled ($a_langkey)
 Check if ilias editor is enabled for a language.
 update ()
 Update settings.
 read ()
 Read settings.

Static Public Member Functions

static getInstance ()
 Get singelton instance.

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

ilAuthLoginPageEditorSettings::__construct ( )

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

References read().

{
include_once './Services/Administration/classes/class.ilSetting.php';
$this->storage = new ilSetting('login_editor');
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilAuthLoginPageEditorSettings::enableIliasEditor (   $a_langkey,
  $a_status 
)

Enable editor for language.

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

Referenced by read().

{
$this->languages[$a_langkey] = (bool) $a_status;
}

+ Here is the caller graph for this function:

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().

{
global $lng;
if($this->getMode() != self::MODE_IPE)
{
return '';
}
if($this->isIliasEditorEnabled($a_langkey))
{
return $a_langkey;
}
if($this->isIliasEditorEnabled($lng->getDefaultLanguage()))
{
return $lng->getDefaultLanguage();
}
return '';
}

+ Here is the call graph for this function:

static ilAuthLoginPageEditorSettings::getInstance ( )
static

Get singelton instance.

Returns
ilAuthLoginPageEditorSettings

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

References $instance.

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

{
if(self::$instance)
{
}
return self::$instance = new ilAuthLoginPageEditorSettings();
}

+ Here is the caller graph for this function:

ilAuthLoginPageEditorSettings::getMode ( )

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

References $mode.

Referenced by getIliasEditorLanguage(), and update().

{
return $this->mode;
}

+ Here is the caller graph for this function:

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:

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().

{
if(isset($this->languages[$a_langkey]))
{
return (bool) $this->languages[$a_langkey];
}
return false;
}

+ Here is the caller graph for this function:

ilAuthLoginPageEditorSettings::read ( )

Read settings.

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

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

Referenced by __construct().

{
global $lng;
$this->setMode($this->getStorage()->get('mode', self::MODE_RTE));
// Language settings
$this->languages = array();
foreach($lng->getInstalledLanguages() as $num => $lngkey)
{
$this->enableIliasEditor($lngkey,$this->getStorage()->get($lngkey,0));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthLoginPageEditorSettings::setMode (   $a_mode)

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

Referenced by read().

{
$this->mode = $a_mode;
}

+ Here is the caller graph for this function:

ilAuthLoginPageEditorSettings::update ( )

Update settings.

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

References getMode(), and getStorage().

{
$this->getStorage()->set('mode', $this->getMode());
foreach((array) $this->languages as $lngkey => $stat)
{
$this->storage->set($lngkey,(int) $stat);
}
}

+ Here is the call graph for this function:

Field Documentation

ilAuthLoginPageEditorSettings::$instance = null
staticprivate

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

Referenced by getInstance().

ilAuthLoginPageEditorSettings::$languages = array()
private

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

ilAuthLoginPageEditorSettings::$mode = 0
private

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

Referenced by getMode().

ilAuthLoginPageEditorSettings::$storage = null
private

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

Referenced by getStorage().

const ilAuthLoginPageEditorSettings::MODE__UNDEFINED = 0

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

const ilAuthLoginPageEditorSettings::MODE_IPE = 2
const ilAuthLoginPageEditorSettings::MODE_RTE = 1

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