public function PanelsDeleteBlockForm::submitForm in Panels 8.3
Same name and namespace in other branches
- 8.4 src/Form/PanelsDeleteBlockForm.php \Drupal\panels\Form\PanelsDeleteBlockForm::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- src/
Form/ PanelsDeleteBlockForm.php, line 122
Class
- PanelsDeleteBlockForm
- Provides a form for deleting an access condition.
Namespace
Drupal\panels\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->plugin
->removeBlock($this->block
->getConfiguration()['uuid']);
$cached_values = $this
->getCachedValues($this->tempstore, $this
->getTempstoreId(), $form_state
->getValue('block_display'));
$cached_values['plugin'] = $this->plugin;
// PageManager specific handling.
if (isset($cached_values['page_variant'])) {
$cached_values['page_variant']
->getVariantPlugin()
->setConfiguration($cached_values['plugin']
->getConfiguration());
}
$this->tempstore
->get($this
->getTempstoreId())
->set($cached_values['id'], $cached_values);
drupal_set_message($this
->t('The block %label has been removed.', [
'%label' => $this->block
->label(),
]));
}