setName('form_config_general_theming'); } /** * {@inheritdoc} * * @return $this */ public function createElements(array $formData) { $themes = Icinga::app()->getThemes(); $themes[''] = $themes[StyleSheet::DEFAULT_THEME] . ' (' . $this->translate('default') . ')'; unset($themes[StyleSheet::DEFAULT_THEME]); $this->addElement( 'select', 'themes_default', array( 'description' => $this->translate('The default theme', 'Form element description'), 'label' => $this->translate('Default Theme', 'Form element label'), 'multiOptions' => $themes, 'value' => '' ) ); $this->addElement( 'checkbox', 'themes_disabled', array( 'description' => $this->translate( 'Check this box for disallowing users to change the theme. If a default theme is set, it will be' . ' used nonetheless', 'Form element description' ), 'label' => $this->translate('Users Can\'t Change Theme', 'Form element label') ) ); return $this; } /** * {@inheritdoc} */ public function getValues($suppressArrayNotation = false) { $values = parent::getValues($suppressArrayNotation); if ($values['themes_default'] === '') { $values['themes_default'] = null; } if (! $values['themes_disabled']) { $values['themes_disabled'] = null; } return $values; } }