You are here

function template_preprocess_insert_button_widget in Insert 8.2

Same name and namespace in other branches
  1. 8 insert.module \template_preprocess_insert_button_widget()

Preprocess variables for the insert-button-widget.html.twig file.

File

./insert.module, line 930

Code

function template_preprocess_insert_button_widget(array &$vars) {
  $element = $vars['element'];
  $vars['insert'] = [
    'config' => \Drupal::config('insert.config')
      ->get(),
    'default_style' => $element['#default_value'],
    'id' => $element['#insert']['id'],
    'settings' => $element['#insert']['settings'],
    'styles' => $element['#options'],
    'type' => $element['#insert']['type'],
  ];
  $vars['nid'] = $element['#nid'];
}