You are here

public static function BrightcoveInlineEntityFormComplex::buildEntityFormActions in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/BrightcoveInlineEntityFormComplex.php \Drupal\brightcove\Plugin\Field\FieldWidget\BrightcoveInlineEntityFormComplex::buildEntityFormActions()
  2. 3.x src/Plugin/Field/FieldWidget/BrightcoveInlineEntityFormComplex.php \Drupal\brightcove\Plugin\Field\FieldWidget\BrightcoveInlineEntityFormComplex::buildEntityFormActions()

Adds actions to the inline entity form.

Parameters

array $element: Form array structure.

Overrides InlineEntityFormComplex::buildEntityFormActions

File

src/Plugin/Field/FieldWidget/BrightcoveInlineEntityFormComplex.php, line 50

Class

BrightcoveInlineEntityFormComplex
Complex inline widget.

Namespace

Drupal\brightcove\Plugin\Field\FieldWidget

Code

public static function buildEntityFormActions($element) {
  $parent_element = parent::buildEntityFormActions($element);

  // Override add/update button labels.
  if ($element['#op'] == 'add') {
    $save_label = t('Save Text Track');
  }
  else {
    $save_label = t('Update Text Track');
  }
  $parent_element['actions']['ief_' . $element['#op'] . '_save']['#value'] = $save_label;
  return $parent_element;
}