/**
* Initialise the application.
*
* @param array $options An optional associative array of configuration settings.
*
* @return void
*
* @since 3.2
*/
protected function initialiseApp($options = array())
{
// Check that we were given a language in the array (since by default may be blank).
if (isset($options['language'])) {
$this->set('language', $options['language']);
}
// Build our language object
$lang = Language::getInstance($this->get('language'), $this->get('debug_lang'));
// Load the language to the API
$this->loadLanguage($lang);
// Register the language object with Factory
Factory::$language = $this->getLanguage();
// Load the library language files
$this->loadLibraryLanguage();
// Set user specific editor.
$user = Factory::getUser();
$editor = $user->getParam('editor', $this->get('editor'));
if (!PluginHelper::isEnabled('editors', $editor)) {
$editor = $this->get('editor');
if (!PluginHelper::isEnabled('editors', $editor)) {
$editor = 'none';
}
}
$this->set('editor', $editor);
// Load the behaviour plugins
PluginHelper::importPlugin('behaviour');
// Trigger the onAfterInitialise event.
PluginHelper::importPlugin('system');
$this->triggerEvent('onAfterInitialise');
}