You are here

public static function WebformElementHelper::getAdminTitle in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformElementHelper.php \Drupal\webform\Utility\WebformElementHelper::getAdminTitle()

Get a webform element's admin title.

Parameters

array $element: A webform element.

Return value

string A webform element's admin title.

8 calls to WebformElementHelper::getAdminTitle()
WebformNodeReferencesAddForm::buildForm in modules/webform_node/src/Form/WebformNodeReferencesAddForm.php
Form constructor.
WebformNodeReferencesListController::buildHeader in modules/webform_node/src/Controller/WebformNodeReferencesListController.php
Builds the header row for the entity listing.
WebformUiElementDeleteForm::getElementTitle in modules/webform_ui/src/Form/WebformUiElementDeleteForm.php
Get the webform element's title or key.
WebformUiElementDuplicateForm::buildForm in modules/webform_ui/src/Form/WebformUiElementDuplicateForm.php
Form constructor.
WebformUiElementEditForm::buildForm in modules/webform_ui/src/Form/WebformUiElementEditForm.php
Form constructor.

... See full list

File

src/Utility/WebformElementHelper.php, line 191

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

public static function getAdminTitle(array $element) {
  if (!empty($element['#admin_title'])) {
    return $element['#admin_title'];
  }
  elseif (!empty($element['#title'])) {
    return $element['#title'];
  }
  elseif (!empty($element['#webform_key'])) {
    return $element['#webform_key'];
  }
  else {
    return '';
  }
}