public function VarbaseCreateContent::blockForm in Varbase Total Control Dashboard 8.6
Same name and namespace in other branches
- 8 src/Plugin/Block/VarbaseCreateContent.php \Drupal\varbase_total_control\Plugin\Block\VarbaseCreateContent::blockForm()
- 8.5 src/Plugin/Block/VarbaseCreateContent.php \Drupal\varbase_total_control\Plugin\Block\VarbaseCreateContent::blockForm()
- 9.0.x src/Plugin/Block/VarbaseCreateContent.php \Drupal\varbase_total_control\Plugin\Block\VarbaseCreateContent::blockForm()
Returns the configuration form elements specific to this block plugin.
Blocks that need to add form elements to the normal block configuration form should implement this method.
Parameters
array $form: The form definition array for the block configuration form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The renderable form array representing the entire configuration form.
Overrides BlockPluginTrait::blockForm
File
- src/
Plugin/ Block/ VarbaseCreateContent.php, line 162
Class
- VarbaseCreateContent
- Provides a 'Create content'.
Namespace
Drupal\varbase_total_control\Plugin\BlockCode
public function blockForm($form, FormStateInterface $form_state) {
$form = parent::blockForm($form, $form_state);
$config = $this
->getConfiguration();
$types = $this->entityTypeManager
->getStorage('node_type')
->loadMultiple();
$type_defaults = [];
foreach ($types as $type => $object) {
if (!array_key_exists($type, $type_defaults)) {
$type_defaults[$type] = $type;
}
}
$form['total_control_admin_types_links'] = [
'#type' => 'checkboxes',
'#title' => $this
->t('Include Create links for Content Types'),
'#options' => $type_defaults,
'#default_value' => $config['total_control_admin_types_links'],
];
return $form;
}