You are here

public function Contact::getForms in FZ152 8

Returns a list of form to and confirmation for sending private data.

Return value

array Array with form names to add checkbox:

  • "form_id": The form id. Can contains wildcards "*".
  • "weight": (optional) The weight for checkbox in the form.

Overrides Fz152PluginBase::getForms

File

modules/contact/src/Plugin/Fz152/Contact.php, line 39

Class

Contact
Provides an annotated Fz152 plugin to configure contact form.

Namespace

Drupal\fz152_contact\Plugin\Fz152

Code

public function getForms() {
  $forms = [];
  $contact_forms = $this
    ->getContactForms();
  foreach (array_keys($contact_forms) as $form) {
    $config = $this
      ->config("fz152_contact.settings.{$form}");
    if ($config
      ->get('enabled')) {
      $forms[] = [
        'form_id' => 'contact_message_' . $form . '_form',
        'weight' => $config
          ->get('weight') ?: NULL,
      ];
    }
  }
  return $forms;
}