You are here

public function Tabs::submit in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/EntityBrowser/WidgetSelector/Tabs.php \Drupal\entity_browser\Plugin\EntityBrowser\WidgetSelector\Tabs::submit()

Submits form.

Parameters

array $form: Form.

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

Return value

string The selected widget ID.

Overrides WidgetSelectorBase::submit

File

src/Plugin/EntityBrowser/WidgetSelector/Tabs.php, line 51

Class

Tabs
Displays entity browser widgets as tabs.

Namespace

Drupal\entity_browser\Plugin\EntityBrowser\WidgetSelector

Code

public function submit(array &$form, FormStateInterface $form_state) {
  if (($trigger = $form_state
    ->getTriggeringElement()) && strpos($trigger['#name'], 'tab_selector_') === 0) {
    if (!empty($this->widget_ids[$trigger['#widget_id']])) {
      return $trigger['#widget_id'];
    }
  }
}