You are here

public function Subgroup::buildConfigurationForm in Subgroup (Graph) 1.0.x

File

src/Plugin/GroupContentEnabler/Subgroup.php, line 89

Class

Subgroup
Provides a content enabler for subgroups.

Namespace

Drupal\ggroup\Plugin\GroupContentEnabler

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildConfigurationForm($form, $form_state);

  // Disable the entity cardinality field as the functionality of this module
  // relies on a cardinality of 1. We don't just hide it, though, to keep a UI
  // that's consistent with other content enabler plugins.
  $info = $this
    ->t("This field has been disabled by the plugin to guarantee the functionality that's expected of it.");
  $form['entity_cardinality']['#disabled'] = TRUE;
  $form['entity_cardinality']['#description'] .= '<br /><em>' . $info . '</em>';
  return $form;
}