2006-07-13 13:14:25 +00:00
|
|
|
<?php
|
|
|
|
|
2009-05-13 19:42:18 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Install, update and uninstall functions for the contact module.
|
|
|
|
*/
|
|
|
|
|
2013-05-25 20:12:45 +00:00
|
|
|
use Drupal\Core\Language\Language;
|
2012-12-26 17:06:27 +00:00
|
|
|
|
2009-10-09 02:54:10 +00:00
|
|
|
/**
|
2009-12-04 16:49:48 +00:00
|
|
|
* Implements hook_install().
|
2009-10-09 02:54:10 +00:00
|
|
|
*/
|
|
|
|
function contact_install() {
|
2013-09-16 03:58:06 +00:00
|
|
|
$site_mail = \Drupal::config('system.site')->get('mail');
|
2012-07-02 17:20:33 +00:00
|
|
|
if (empty($site_mail)) {
|
|
|
|
$site_mail = ini_get('sendmail_from');
|
|
|
|
}
|
2014-08-16 11:57:44 +00:00
|
|
|
$config = \Drupal::config('contact.form.feedback');
|
2014-04-04 13:49:13 +00:00
|
|
|
// Update the recipients if the default configuration entity has been created.
|
|
|
|
// We should never rely on default config entities as during enabling a module
|
|
|
|
// during config sync they will not exist.
|
|
|
|
if (!$config->isNew()) {
|
2014-08-16 11:57:44 +00:00
|
|
|
\Drupal::config('contact.form.feedback')->set('recipients', array($site_mail))->save();
|
2014-04-04 13:49:13 +00:00
|
|
|
}
|
2009-10-09 02:54:10 +00:00
|
|
|
}
|