You are here

public function FormHelper::displayRegenerateNow in Simple XML sitemap 4.x

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

Parameters

array $form_fragment:

Return value

$this

File

src/Form/FormHelper.php, line 253

Class

FormHelper
Class FormHelper

Namespace

Drupal\simple_sitemap\Form

Code

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