"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/profiles/standard/standard.profile" (26 Nov 2020, 785 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 
    3 /**
    4  * @file
    5  * Enables modules and site configuration for a standard site installation.
    6  */
    7 
    8 use Drupal\contact\Entity\ContactForm;
    9 use Drupal\Core\Form\FormStateInterface;
   10 
   11 /**
   12  * Implements hook_form_FORM_ID_alter() for install_configure_form().
   13  *
   14  * Allows the profile to alter the site configuration form.
   15  */
   16 function standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
   17   $form['#submit'][] = 'standard_form_install_configure_submit';
   18 }
   19 
   20 /**
   21  * Submission handler to sync the contact.form.feedback recipient.
   22  */
   23 function standard_form_install_configure_submit($form, FormStateInterface $form_state) {
   24   $site_mail = $form_state->getValue('site_mail');
   25   ContactForm::load('feedback')->setRecipients([$site_mail])->trustData()->save();
   26 }