You are here

function mmeu_form_alter in Maintenance Mode Exclude Urls 8

Implements hook_form_alter() for system_site_maintenance_mode().

File

./mmeu.module, line 11
Module file for mmeu module.

Code

function mmeu_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  switch ($form_id) {
    case 'system_site_maintenance_mode':
      $config = \Drupal::config('mmeu.settings');
      $form['mmeu'] = array(
        '#type' => 'textarea',
        '#title' => 'Exclude Urls',
        '#description' => t("Enter pages to be shown to visitors in maintenance mode. Enter one page per line as Drupal paths. The * character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
          '%blog' => 'blog',
          '%blog-wildcard' => 'blog/*',
          '%front' => '<front>',
        )),
        '#default_value' => $config
          ->get('mmeu'),
      );
      $form['#submit'][] = 'mmeu_form_submit';
      break;
  }
}