function cronkeychange_form_system_cron_settings_alter in Cron key change 8
Same name and namespace in other branches
- 7 cronkeychange.module \cronkeychange_form_system_cron_settings_alter()
- 2.x cronkeychange.module \cronkeychange_form_system_cron_settings_alter()
Implements hook_form_FORM_ID_alter().
File
- ./
cronkeychange.module, line 16 - Cron Key Change.
Code
function cronkeychange_form_system_cron_settings_alter(&$form, FormStateInterface $form_state, $form_id) {
$form['cronkeychange'] = [
'#type' => 'fieldset',
'#tree' => FALSE,
'#title' => t('Change cron key'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
];
$form['cronkeychange']['current'] = [
'#type' => 'item',
'#title' => t('Current cron key'),
'#markup' => \Drupal::state()
->get('system.cron_key'),
];
$form['cronkeychange']['generate'] = [
'#type' => 'submit',
'#value' => t('Generate new key'),
'#submit' => [
'cronkeychange_generate_submit',
],
];
}