function SystemBrandingOffCanvasForm::submitConfigurationForm

Same name and namespace in other branches
  1. 9 core/modules/system/src/Form/SystemBrandingOffCanvasForm.php \Drupal\system\Form\SystemBrandingOffCanvasForm::submitConfigurationForm()
  2. 8.9.x core/modules/system/src/Form/SystemBrandingOffCanvasForm.php \Drupal\system\Form\SystemBrandingOffCanvasForm::submitConfigurationForm()
  3. 11.x core/modules/system/src/Form/SystemBrandingOffCanvasForm.php \Drupal\system\Form\SystemBrandingOffCanvasForm::submitConfigurationForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides PluginFormInterface::submitConfigurationForm

File

core/modules/system/src/Form/SystemBrandingOffCanvasForm.php, line 114

Class

SystemBrandingOffCanvasForm
The settings_tray form handler for the SystemBrandingBlock.

Namespace

Drupal\system\Form

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $site_config = $this->configFactory
    ->get('system.site');
  if (AccessResult::allowedIf(!$site_config->hasOverrides('name') && !$site_config->hasOverrides('slogan'))
    ->isAllowed()) {
    $site_info = $form_state->getValue('site_information');
    $this->configFactory
      ->getEditable('system.site')
      ->set('name', $site_info['site_name'])
      ->set('slogan', $site_info['site_slogan'])
      ->save();
  }
  $this->plugin
    ->submitConfigurationForm($form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.