You are here

protected function WebformActions::defineDefaultProperties in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformActions.php \Drupal\webform\Plugin\WebformElement\WebformActions::defineDefaultProperties()

Define an element's default properties.

Return value

array An associative array contain an the element's default properties.

Overrides ContainerBase::defineDefaultProperties

File

src/Plugin/WebformElement/WebformActions.php, line 26

Class

WebformActions
Provides a 'webform_actions' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function defineDefaultProperties() {
  $properties = [
    // Title.
    'title' => '',
    // Attributes.
    'attributes' => [],
  ] + $this
    ->defineDefaultBaseProperties();
  $buttons = array_merge(WebformActionsElement::$buttons, [
    'update',
  ]);
  foreach ($buttons as $button) {
    $properties[$button . '_hide'] = FALSE;
    $properties[$button . '__label'] = '';
    $properties[$button . '__attributes'] = [];
  }
  $properties['delete_hide'] = TRUE;
  $properties['delete__dialog'] = FALSE;
  return $properties;
}