protected EntityDisplayFormBase::buildExtraFieldRow($field_id, $extra_field)
Builds the table row structure for a single extra field.
Parameters
string $field_id: The field ID.
array $extra_field: The pseudo-field element.
Return value
array A table row array.
File
- core/modules/field_ui/src/Form/EntityDisplayFormBase.php, line 441
Class
- EntityDisplayFormBase
- Base class for EntityDisplay edit forms.
Namespace
Drupal\field_ui\Form
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | protected function buildExtraFieldRow( $field_id , $extra_field ) { $display_options = $this ->entity->getComponent( $field_id ); $regions = array_keys ( $this ->getRegions()); $extra_field_row = array ( '#attributes' => array ( 'class' => array ( 'draggable' , 'tabledrag-leaf' )), '#row_type' => 'extra_field' , '#region_callback' => array ( $this , 'getRowRegion' ), '#js_settings' => array ( 'rowHandler' => 'field' ), 'human_name' => array ( '#markup' => $extra_field [ 'label' ], ), 'weight' => array ( '#type' => 'textfield' , '#title' => $this ->t( 'Weight for @title' , array ( '@title' => $extra_field [ 'label' ])), '#title_display' => 'invisible' , '#default_value' => $display_options ? $display_options [ 'weight' ] : 0, '#size' => 3, '#attributes' => array ( 'class' => array ( 'field-weight' )), ), 'parent_wrapper' => array ( 'parent' => array ( '#type' => 'select' , '#title' => $this ->t( 'Parents for @title' , array ( '@title' => $extra_field [ 'label' ])), '#title_display' => 'invisible' , '#options' => array_combine ( $regions , $regions ), '#empty_value' => '' , '#attributes' => array ( 'class' => array ( 'js-field-parent' , 'field-parent' )), '#parents' => array ( 'fields' , $field_id , 'parent' ), ), 'hidden_name' => array ( '#type' => 'hidden' , '#default_value' => $field_id , '#attributes' => array ( 'class' => array ( 'field-name' )), ), ), 'plugin' => array ( 'type' => array ( '#type' => 'select' , '#title' => $this ->t( 'Visibility for @title' , array ( '@title' => $extra_field [ 'label' ])), '#title_display' => 'invisible' , '#options' => $this ->getExtraFieldVisibilityOptions(), '#default_value' => $display_options ? 'visible' : 'hidden' , '#parents' => array ( 'fields' , $field_id , 'type' ), '#attributes' => array ( 'class' => array ( 'field-plugin-type' )), ), ), 'settings_summary' => array (), 'settings_edit' => array (), ); return $extra_field_row ; } |
Please login to continue.