You are here

function opigno_module_form_system_file_system_settings_submit in Opigno module 8

Same name and namespace in other branches
  1. 3.x opigno_module.module \opigno_module_form_system_file_system_settings_submit()

Implements additional submit for the file system settings form.

1 string reference to 'opigno_module_form_system_file_system_settings_submit'
opigno_module_form_system_file_system_settings_alter in ./opigno_module.module
Implements hook_form_FORM_ID_alter().

File

./opigno_module.module, line 1111
Contains opigno_module.module.

Code

function opigno_module_form_system_file_system_settings_submit($form, FormStateInterface $form_state) {
  $config = \Drupal::configFactory()
    ->getEditable('opigno_module.settings');
  if ($form_state
    ->hasValue('file_libreoffice_configs_path')) {
    $config
      ->set('libreoffice_configs_path', $form_state
      ->getValue('file_libreoffice_configs_path'));
  }
  if ($form_state
    ->hasValue('file_libreoffice_bin_path')) {
    $config
      ->set('libreoffice_bin_path', $form_state
      ->getValue('file_libreoffice_bin_path'));
  }
  if ($form_state
    ->hasValue('file_imagemagick_bin_path')) {
    $config
      ->set('imagemagick_bin_path', $form_state
      ->getValue('file_imagemagick_bin_path'));
  }
  $config
    ->save();
}