You are here

public function HierarchyEmbed::buildOptionsForm in Entity Reference Hierarchy 8

Provide the default form for setting options.

Overrides DisplayPluginBase::buildOptionsForm

File

entity_hierarchy_views/src/Plugin/views/display/HierarchyEmbed.php, line 67
Contains \Drupal\entity_hierarchy_views\Plugin\views\display\HierarchyEmbed.

Class

HierarchyEmbed
The plugin that handles an HierarchyEmbed display.

Namespace

Drupal\entity_hierarchy_views\Plugin\views\display

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  switch ($form_state
    ->get('section')) {
    case 'entity_hierarchy_embed_admin_name':
      $form['#title'] .= t('Embed admin name');
      $form['entity_hierarchy_embed_admin_name'] = array(
        '#type' => 'textfield',
        '#description' => t('This will appear as the name of this embed in the node edit screen.'),
        '#default_value' => $this
          ->getOption('entity_hierarchy_embed_admin_name'),
      );
      break;
  }
}