public ViewEditForm::buildOptionForm(ViewUI $view, $id, $option, $display)
Build a renderable array representing one option on the edit form.
This function might be more logical as a method on an object, if a suitable object emerges out of refactoring.
File
- core/modules/views_ui/src/ViewEditForm.php, line 878
Class
- ViewEditForm
- Form controller for the Views edit form.
Namespace
Drupal\views_ui
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 | public function buildOptionForm(ViewUI $view , $id , $option , $display ) { $option_build = array (); $option_build [ '#theme' ] = 'views_ui_display_tab_setting' ; $option_build [ '#description' ] = $option [ 'title' ]; $option_build [ '#link' ] = $view ->getExecutable()->displayHandlers->get( $display [ 'id' ])->optionLink( $option [ 'value' ], $id , '' , empty ( $option [ 'desc' ]) ? '' : $option [ 'desc' ]); $option_build [ '#links' ] = array (); if (! empty ( $option [ 'links' ]) && is_array ( $option [ 'links' ])) { foreach ( $option [ 'links' ] as $link_id => $link_value ) { $option_build [ '#settings_links' ][] = $view ->getExecutable()->displayHandlers->get( $display [ 'id' ])->optionLink( $option [ 'setting' ], $link_id , 'views-button-configure' , $link_value ); } } if (! empty ( $view ->getExecutable()->displayHandlers->get( $display [ 'id' ])->options[ 'defaults' ][ $id ])) { $display_id = 'default' ; $option_build [ '#defaulted' ] = TRUE; } else { $display_id = $display [ 'id' ]; if (! $view ->getExecutable()->displayHandlers->get( $display [ 'id' ])->isDefaultDisplay()) { if ( $view ->getExecutable()->displayHandlers->get( $display [ 'id' ])->defaultableSections( $id )) { $option_build [ '#overridden' ] = TRUE; } } } $option_build [ '#attributes' ][ 'class' ][] = Html::cleanCssIdentifier( $display_id . '-' . $id ); return $option_build ; } |
Please login to continue.