You are here

public function FormHelper::displayRegenerateNow in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::displayRegenerateNow()
  2. 4.x src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::displayRegenerateNow()

Parameters

array $form_fragment:

File

src/Form/FormHelper.php, line 211

Class

FormHelper
Class FormHelper @package Drupal\simple_sitemap\Form

Namespace

Drupal\simple_sitemap\Form

Code

public function displayRegenerateNow(&$form_fragment) {
  $form_fragment['simple_sitemap_regenerate_now'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Regenerate sitemap after hitting <em>Save</em>'),
    '#description' => $this
      ->t('This setting will regenerate the whole sitemap including the above changes.'),
    '#default_value' => FALSE,
  ];
  if ($this->generator
    ->getSetting('cron_generate')) {
    $form_fragment['simple_sitemap_regenerate_now']['#description'] .= '</br>' . $this
      ->t('Otherwise the sitemap will be regenerated during a future cron run.');
  }
}