public function MultiblockDeleteForm::buildForm in MultiBlock 8
Same name in this branch
- 8 src/MultiblockDeleteForm.php \Drupal\multiblock\MultiblockDeleteForm::buildForm()
- 8 src/Form/MultiblockDeleteForm.php \Drupal\multiblock\Form\MultiblockDeleteForm::buildForm()
File
- src/
MultiblockDeleteForm.php, line 13
Class
Namespace
Drupal\multiblockCode
public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state, $delta = NULL) {
$block = multiblock_get_block($delta);
if (empty($block)) {
drupal_set_message(t('The multiblock with the delta @delta was not found.', [
'@delta' => $delta,
]), 'error');
return [];
}
$form['delta'] = [
'#type' => 'value',
'#value' => $delta,
];
return confirm_form($form, t('Delete the block instance %title?', [
'%title' => $block->title,
]), 'admin/structure/block/instances', t('This will delete the instance of the block %title.', [
'%title' => $block->title,
]), t('Delete'), t('Cancel'));
}