public function FormHelper::displayRegenerateNow in Simple XML sitemap 4.x
Same name and namespace in other branches
- 8.3 src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::displayRegenerateNow()
- 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\FormCode
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;
}