You are here

protected function WebformUiEntityElementsForm::getTableHeader in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_ui/src/WebformUiEntityElementsForm.php \Drupal\webform_ui\WebformUiEntityElementsForm::getTableHeader()

Gets the elements table header.

Return value

array The header elements.

1 call to WebformUiEntityElementsForm::getTableHeader()
WebformUiEntityElementsForm::buildForm in modules/webform_ui/src/WebformUiEntityElementsForm.php
Form constructor.

File

modules/webform_ui/src/WebformUiEntityElementsForm.php, line 374

Class

WebformUiEntityElementsForm
Webform manage elements UI form.

Namespace

Drupal\webform_ui

Code

protected function getTableHeader() {

  /** @var \Drupal\webform\WebformInterface $webform */
  $webform = $this
    ->getEntity();
  $header = [];
  $header['title'] = $this
    ->t('Title');
  if ($webform
    ->hasContainer()) {
    $header['add'] = [
      'data' => '',
      'class' => [
        'webform-ui-element-operations',
      ],
    ];
  }
  $header['key'] = [
    'data' => $this
      ->t('Key'),
    'class' => [
      RESPONSIVE_PRIORITY_LOW,
    ],
  ];
  $header['type'] = [
    'data' => $this
      ->t('Type'),
    'class' => [
      RESPONSIVE_PRIORITY_LOW,
    ],
  ];
  if ($webform
    ->hasFlexboxLayout()) {
    $header['flex'] = [
      'data' => $this
        ->t('Flex'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ];
  }
  if ($webform
    ->hasConditions()) {
    $header['conditions'] = [
      'data' => $this
        ->t('Conditional'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ];
  }
  $header['required'] = [
    'data' => $this
      ->t('Required'),
    'class' => [
      'webform-ui-element-required',
      RESPONSIVE_PRIORITY_LOW,
    ],
  ];
  $header['weight'] = [
    'data' => $this
      ->t('Weight'),
    'class' => [
      'webform-tabledrag-hide',
    ],
  ];
  $header['parent'] = [
    'data' => $this
      ->t('Parent'),
    'class' => [
      'webform-tabledrag-hide',
    ],
  ];
  $header['operations'] = [
    'data' => $this
      ->t('Operations'),
    'class' => [
      'webform-ui-element-operations',
    ],
  ];
  return $header;
}