You are here

panopoly.profile in Panopoly 8.2

Same filename and directory in other branches
  1. 7 panopoly.profile

Enables modules and site configuration for a Panopoly installation.

File

panopoly.profile
View source
<?php

/**
 * @file
 * Enables modules and site configuration for a Panopoly installation.
 */
use Drupal\contact\Entity\ContactForm;
use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_form_FORM_ID_alter() for install_configure_form().
 *
 * Allows the profile to alter the site configuration form.
 */
function panopoly_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
  $form['#submit'][] = 'panopoly_form_install_configure_submit';
}

/**
 * Submission handler to sync the contact.form.feedback recipient.
 */
function panopoly_form_install_configure_submit($form, FormStateInterface $form_state) {
  $site_mail = $form_state
    ->getValue('site_mail');
  ContactForm::load('feedback')
    ->setRecipients([
    $site_mail,
  ])
    ->trustData()
    ->save();
}

Functions

Namesort descending Description
panopoly_form_install_configure_form_alter Implements hook_form_FORM_ID_alter() for install_configure_form().
panopoly_form_install_configure_submit Submission handler to sync the contact.form.feedback recipient.