Same name in this branch
  1. 8.x-3.x advagg_old_ie_compatibility/src/Form/SettingsForm.php \Drupal\advagg_old_ie_compatibility\Form\SettingsForm::submitForm()
  2. 8.x-3.x advagg_bundler/src/Form/SettingsForm.php \Drupal\advagg_bundler\Form\SettingsForm::submitForm()
  3. 8.x-3.x advagg_css_minify/src/Form/SettingsForm.php \Drupal\advagg_css_minify\Form\SettingsForm::submitForm()
  4. 8.x-3.x advagg_js_minify/src/Form/SettingsForm.php \Drupal\advagg_js_minify\Form\SettingsForm::submitForm()
  5. 8.x-3.x advagg_cdn/src/Form/SettingsForm.php \Drupal\advagg_cdn\Form\SettingsForm::submitForm()
  6. 8.x-3.x advagg_ext_minify/src/Form/SettingsForm.php \Drupal\advagg_ext_minify\Form\SettingsForm::submitForm()
  7. 8.x-3.x advagg_mod/src/Form/SettingsForm.php \Drupal\advagg_mod\Form\SettingsForm::submitForm()
Same name in other branches
  1. 5.0.x advagg_old_ie_compatibility/src/Form/SettingsForm.php \Drupal\advagg_old_ie_compatibility\Form\SettingsForm::submitForm()
  2. 5.0.x advagg_bundler/src/Form/SettingsForm.php \Drupal\advagg_bundler\Form\SettingsForm::submitForm()
  3. 5.0.x advagg_css_minify/src/Form/SettingsForm.php \Drupal\advagg_css_minify\Form\SettingsForm::submitForm()
  4. 5.0.x advagg_js_minify/src/Form/SettingsForm.php \Drupal\advagg_js_minify\Form\SettingsForm::submitForm()
  5. 5.0.x src/Form/SettingsForm.php \Drupal\advagg\Form\SettingsForm::submitForm()
  6. 5.0.x advagg_cdn/src/Form/SettingsForm.php \Drupal\advagg_cdn\Form\SettingsForm::submitForm()
  7. 5.0.x advagg_ext_minify/src/Form/SettingsForm.php \Drupal\advagg_ext_minify\Form\SettingsForm::submitForm()
  8. 5.0.x advagg_mod/src/Form/SettingsForm.php \Drupal\advagg_mod\Form\SettingsForm::submitForm()
  9. 6.0.x advagg_bundler/src/Form/SettingsForm.php \Drupal\advagg_bundler\Form\SettingsForm::submitForm()
  10. 6.0.x advagg_css_minify/src/Form/SettingsForm.php \Drupal\advagg_css_minify\Form\SettingsForm::submitForm()
  11. 6.0.x advagg_js_minify/src/Form/SettingsForm.php \Drupal\advagg_js_minify\Form\SettingsForm::submitForm()
  12. 6.0.x src/Form/SettingsForm.php \Drupal\advagg\Form\SettingsForm::submitForm()
  13. 6.0.x advagg_ext_minify/src/Form/SettingsForm.php \Drupal\advagg_ext_minify\Form\SettingsForm::submitForm()
  14. 6.0.x advagg_mod/src/Form/SettingsForm.php \Drupal\advagg_mod\Form\SettingsForm::submitForm()
  15. 8.x-2.x advagg_bundler/src/Form/SettingsForm.php \Drupal\advagg_bundler\Form\SettingsForm::submitForm()
  16. 8.x-2.x advagg_css_minify/src/Form/SettingsForm.php \Drupal\advagg_css_minify\Form\SettingsForm::submitForm()
  17. 8.x-2.x advagg_js_minify/src/Form/SettingsForm.php \Drupal\advagg_js_minify\Form\SettingsForm::submitForm()
  18. 8.x-2.x src/Form/SettingsForm.php \Drupal\advagg\Form\SettingsForm::submitForm()
  19. 8.x-2.x advagg_cdn/src/Form/SettingsForm.php \Drupal\advagg_cdn\Form\SettingsForm::submitForm()
  20. 8.x-2.x advagg_ext_minify/src/Form/SettingsForm.php \Drupal\advagg_ext_minify\Form\SettingsForm::submitForm()
  21. 8.x-2.x advagg_mod/src/Form/SettingsForm.php \Drupal\advagg_mod\Form\SettingsForm::submitForm()
  22. 8.x-4.x advagg_old_ie_compatibility/src/Form/SettingsForm.php \Drupal\advagg_old_ie_compatibility\Form\SettingsForm::submitForm()
  23. 8.x-4.x advagg_bundler/src/Form/SettingsForm.php \Drupal\advagg_bundler\Form\SettingsForm::submitForm()
  24. 8.x-4.x advagg_css_minify/src/Form/SettingsForm.php \Drupal\advagg_css_minify\Form\SettingsForm::submitForm()
  25. 8.x-4.x advagg_js_minify/src/Form/SettingsForm.php \Drupal\advagg_js_minify\Form\SettingsForm::submitForm()
  26. 8.x-4.x src/Form/SettingsForm.php \Drupal\advagg\Form\SettingsForm::submitForm()
  27. 8.x-4.x advagg_cdn/src/Form/SettingsForm.php \Drupal\advagg_cdn\Form\SettingsForm::submitForm()
  28. 8.x-4.x advagg_ext_minify/src/Form/SettingsForm.php \Drupal\advagg_ext_minify\Form\SettingsForm::submitForm()
  29. 8.x-4.x advagg_mod/src/Form/SettingsForm.php \Drupal\advagg_mod\Form\SettingsForm::submitForm()

Fichier

src/Form/SettingsForm.php, line 420

Classe

SettingsForm
Configure advagg settings for this site.

Namespace

Drupal\advagg\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    
    /** @var \Drupal\Core\Config\Config $config */
    $config = $this->config('advagg.settings');
    $htaccess = FALSE;
    if ($config->get('immutable') != $form_state->getValue('immutable')) {
        $htaccess = TRUE;
    }
    elseif ($config->get('symlinks') != $form_state->getValue('symlinks')) {
        $htaccess = TRUE;
    }
    elseif ($config->get('symlinksifownermatch') != $form_state->getValue('symlinksifownermatch')) {
        $htaccess = TRUE;
    }
    $config->set('css.brotli', $form_state->getValue('css_brotli'))
        ->set('css.fix_type', $form_state->getValue('css_fix_type'))
        ->set('css.combine_media', $form_state->getValue('css_combine_media'))
        ->set('css.preserve_external', $form_state->getValue('css_preserve_external'))
        ->set('path.convert.force_https', $form_state->getValue('path_convert_force_https'))
        ->set('path.convert.absolute', $form_state->getValue('path_convert_absolute'))
        ->set('path.convert.absolute_to_protocol_relative', $form_state->getValue('path_convert_absolute_to_protocol_relative'))
        ->set('enabled', $form_state->getValue('enabled'))
        ->set('dns_prefetch', $form_state->getValue('dns_prefetch'))
        ->set('cache_level', $form_state->getValue('cache_level'))
        ->set('cron_frequency', $form_state->getValue('cron_frequency'))
        ->set('js.brotli', $form_state->getValue('js_brotli'))
        ->set('js.fix_type', $form_state->getValue('js_fix_type'))
        ->set('js.preserve_external', $form_state->getValue('js_preserve_external'))
        ->set('immutable', $form_state->getValue('immutable'))
        ->set('symlinks', $form_state->getValue('symlinks'))
        ->set('symlinksifownermatch', $form_state->getValue('symlinksifownermatch'))
        ->save();
    $this->config('system.performance')
        ->set('stale_file_threshold', $form_state->getValue('stale_file_threshold'))
        ->set('css.gzip', $form_state->getValue('css_gzip'))
        ->set('js.gzip', $form_state->getValue('js_gzip'))
        ->save();
    // If changed options regenerate the .htaccess files.
    if ($htaccess) {
        AssetOptimizer::generateHtaccess('css', TRUE);
        AssetOptimizer::generateHtaccess('js', TRUE);
    }
    // Clear relevant caches.
    $this->cache
        ->invalidateAll();
    Cache::invalidateTags([
        'library_info',
    ]);
    parent::submitForm($form, $form_state);
}