Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 7 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
27 | public function getForm(array &$form = array(), FormStateInterface &$form_state = NULL) { |
||
28 | $element = []; |
||
29 | foreach ($this->widget_ids as $id => $label) { |
||
30 | $name = 'tab_selector_' . $id; |
||
31 | $element[$name] = array( |
||
32 | '#type' => 'button', |
||
33 | '#attributes' => ['class' => ['tab']], |
||
34 | '#value' => $label, |
||
35 | '#disabled' => $id == $this->getDefaultWidget(), |
||
36 | '#executes_submit_callback' => TRUE, |
||
37 | '#limit_validation_errors' => array(array($id)), |
||
38 | // #limit_validation_errors only takes effect if #submit is present. |
||
39 | '#submit' => array(), |
||
40 | '#name' => $name, |
||
41 | '#widget_id' => $id, |
||
42 | ); |
||
43 | } |
||
44 | |||
45 | $element['#attached']['library'][] = 'entity_browser/tabs'; |
||
46 | |||
47 | return $element; |
||
48 | } |
||
49 | |||
62 |