Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
27
core/profiles/standard/standard.profile
Normal file
27
core/profiles/standard/standard.profile
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* Enables modules and site configuration for a standard site 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 standard_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
|
||||
// Add a placeholder as example that one can choose an arbitrary site name.
|
||||
$form['site_information']['site_name']['#attributes']['placeholder'] = t('My site');
|
||||
$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');
|
||||
ContactForm::load('feedback')->setRecipients([$site_mail])->trustData()->save();
|
||||
}
|
Reference in a new issue