You are here

public static function ShipmentInlineForm::disableSaveButton in Commerce Shipping 8.2

Disables the save button for the IEF element.

Parameters

array $element: The element.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

array The element.

File

src/Form/ShipmentInlineForm.php, line 62

Class

ShipmentInlineForm
Defines the inline form for shipments.

Namespace

Drupal\commerce_shipping\Form

Code

public static function disableSaveButton(array $element, FormStateInterface $form_state) {
  $action_button_key = 'ief_' . $element['#op'] . '_save';
  if (isset($element['actions'][$action_button_key])) {
    $element['actions'][$action_button_key]['#access'] = FALSE;
  }
  return $element;
}