-
Notifications
You must be signed in to change notification settings - Fork 34
/
apigee_devportal_kickstart.profile
51 lines (46 loc) · 1.84 KB
/
apigee_devportal_kickstart.profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @file
* Copyright 2019 Google Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* @file
* Enables modules and site configuration for apigee_devportal_kickstart.
*/
use Drupal\apigee_devportal_kickstart\Installer\ApigeeDevportalKickstartTasksManager;
use Drupal\apigee_devportal_kickstart\Installer\Form\ApigeeMonetizationConfigurationForm;
use Drupal\apigee_devportal_kickstart\Installer\Form\ApigeeEdgeConfigurationForm;
use Drupal\apigee_devportal_kickstart\Installer\Form\DemoInstallForm;
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 apigee_devportal_kickstart_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
$form['#submit'][] = 'apigee_devportal_kickstart_form_install_configure_submit';
}
/**
* Submission handler to sync the contact.form.feedback recipient.
*/
function apigee_devportal_kickstart_form_install_configure_submit($form, FormStateInterface $form_state) {
$site_mail = $form_state->getValue('site_mail');
ContactForm::load('feedback')
->setRecipients([$site_mail])
->trustData()
->save();
}