function readonlymode_settings_form_submit in Read only mode 8
Same name and namespace in other branches
- 2.0.x readonlymode.module \readonlymode_settings_form_submit()
Settings form submission handler.
See readonlymode_form_system_site_maintenance_mode_alter().
1 string reference to 'readonlymode_settings_form_submit'
File
- ./
readonlymode.module, line 117 - Read Only Mode provides an alternative to the built in 'Maintenance Mode' in Drupal. Instead of displaying a static text file to users while the site is in maintenance mode, Read Only Mode will allow access (reading) of existing content…
Code
function readonlymode_settings_form_submit(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getUserInput();
\Drupal::configFactory()
->getEditable('readonlymode.settings')
->set('enabled', $values['enable_readonly'])
->set('url', $values['url'])
->set('messages.default', $values['default_message'])
->set('messages.not_saved', $values['not_saved_message'])
->set('forms.additional.edit', $values['additional_edit'])
->set('forms.additional.view', $values['additional_view'])
->save();
}