2006-07-13 13:14:25 +00:00
|
|
|
<?php
|
2012-02-29 21:19:26 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Enables modules and site configuration for a standard site installation.
|
|
|
|
*/
|
2006-07-13 13:14:25 +00:00
|
|
|
|
2014-10-23 12:10:36 +00:00
|
|
|
use Drupal\contact\Entity\ContactForm;
|
2014-08-04 11:21:15 +00:00
|
|
|
use Drupal\Core\Form\FormStateInterface;
|
|
|
|
|
2007-11-19 13:56:14 +00:00
|
|
|
/**
|
2012-02-29 21:19:26 +00:00
|
|
|
* Implements hook_form_FORM_ID_alter() for install_configure_form().
|
2007-11-19 13:56:14 +00:00
|
|
|
*
|
2010-01-03 06:58:52 +00:00
|
|
|
* Allows the profile to alter the site configuration form.
|
2007-11-19 13:56:14 +00:00
|
|
|
*/
|
2014-08-04 11:21:15 +00:00
|
|
|
function standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
|
2015-05-14 18:12:44 +00:00
|
|
|
// Add a placeholder as example that one can choose an arbitrary site name.
|
|
|
|
$form['site_information']['site_name']['#attributes']['placeholder'] = t('My site');
|
2014-10-23 12:10:36 +00:00
|
|
|
$form['#submit'][] = 'standard_form_install_configure_submit';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Submission handler to sync the contact.form.feedback recipient.
|
|
|
|
*/
|
|
|
|
function standard_form_install_configure_submit($form, FormStateInterface $form_state) {
|
|
|
|
$site_mail = $form_state->getValue('site_mail');
|
2015-05-05 10:47:16 +00:00
|
|
|
ContactForm::load('feedback')->setRecipients([$site_mail])->trustData()->save();
|
2007-11-19 13:56:14 +00:00
|
|
|
}
|