diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index 1f479f2..02e270f 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -7,6 +7,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Url; use Drupal\user\Entity\User; /** @@ -35,6 +36,14 @@ function contact_help($route_name, RouteMatchInterface $route_match) { $output .= ''; return $output; + case 'contact.form_list': + $output = '

' . t('Create seperate contact forms for different purposes.') . '

'; + $output .= '

' . t('If you would like additional text to appear on the site-wide contact page, use a block. You can create and edit blocks on the Blocks administration page.', array('@blocks' => \Drupal::url('block.admin_display'))) . '

'; + if (\Drupal::moduleHandler()->moduleExists('block')) { + $output .= '

' . t('Each form gets a link in the Contact forms block. You can enable this block on the Block layout page.', array( + '@block' => Url::fromRoute('block.admin_display')->toString(), + )); + } case 'entity.contact_form.collection': $menu_page = \Drupal::moduleHandler()->moduleExists('menu_ui') ? \Drupal::url('entity.menu.collection') : '#'; $block_page = \Drupal::moduleHandler()->moduleExists('block') ? \Drupal::url('block.admin_display') : '#'; diff --git a/core/modules/contact/src/ContactFormListBuilder.php b/core/modules/contact/src/ContactFormListBuilder.php index 5a2b6b0..c6fb3d0 100644 --- a/core/modules/contact/src/ContactFormListBuilder.php +++ b/core/modules/contact/src/ContactFormListBuilder.php @@ -10,6 +10,8 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Routing\LinkGeneratorTrait; +use Drupal\Core\Url; use Drupal\Core\Link; /** @@ -25,7 +27,7 @@ class ContactFormListBuilder extends ConfigEntityListBuilder { public function buildHeader() { $header['form'] = t('Form'); $header['recipients'] = t('Recipients'); - $header['selected'] = t('Selected'); + $header['default'] = t('Default'); return $header + parent::buildHeader(); } @@ -37,13 +39,13 @@ public function buildRow(EntityInterface $entity) { if ($entity->id() == 'personal') { $row['form'] = $this->getLabel($entity); $row['recipients'] = t('Selected user'); - $row['selected'] = t('No'); + $row['default'] = t('No'); } else { $row['form'] = $entity->link(NULL, 'canonical'); $row['recipients'] = SafeMarkup::checkPlain(implode(', ', $entity->getRecipients())); $default_form = \Drupal::config('contact.settings')->get('default_form'); - $row['selected'] = ($default_form == $entity->id() ? t('Yes') : t('No')); + $row['default'] = ($default_form == $entity->id() ? t('Yes') : t('No')); } return $row + parent::buildRow($entity); } diff --git a/core/modules/contact/src/Entity/ContactForm.php b/core/modules/contact/src/Entity/ContactForm.php index 1a9f73a..86eabbe 100644 --- a/core/modules/contact/src/Entity/ContactForm.php +++ b/core/modules/contact/src/Entity/ContactForm.php @@ -7,8 +7,11 @@ namespace Drupal\contact\Entity; +use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBundleBase; use Drupal\contact\ContactFormInterface; +use Drupal\Core\Config\Entity\ThirdPartySettingsTrait; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines the contact form entity.