public function NodeFormBlock::blockForm in Form Block 2.0.x
Same name and namespace in other branches
- 8 src/Plugin/Block/NodeFormBlock.php \Drupal\formblock\Plugin\Block\NodeFormBlock::blockForm()
Overrides \Drupal\block\BlockBase::blockForm().
Overrides BlockPluginTrait::blockForm
File
- src/
Plugin/ Block/ NodeFormBlock.php, line 104
Class
- NodeFormBlock
- Provides a block for node forms.
Namespace
Drupal\formblock\Plugin\BlockCode
public function blockForm($form, FormStateInterface $form_state) {
$form['formblock_node_type'] = [
'#title' => $this
->t('Node type'),
'#description' => $this
->t('Select the node type whose form will be shown in the block.'),
'#type' => 'select',
'#required' => TRUE,
'#options' => $this
->getNodeTypes(),
'#default_value' => $this->configuration['type'],
];
$form['formblock_node_form_mode'] = [
'#title' => $this
->t('Form mode'),
'#description' => $this
->t('Select the form view mode that will be shown in the block.'),
'#type' => 'select',
'#required' => TRUE,
'#options' => $this
->getFormModes(),
'#default_value' => $this->configuration['form_mode'],
];
$form['formblock_show_help'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Show submission guidelines'),
'#default_value' => $this->configuration['show_help'],
'#description' => $this
->t('Enable this option to show the submission guidelines in the block above the form.'),
];
return $form;
}