You are here

public function Skin::elementLabel in Skinr 8.2

Returns the element label.

See also

hook_skinr_ui_element_title()

File

src/Entity/Skin.php, line 99
Contains \Drupal\skinr\Entity\Skin.

Class

Skin
Defines the Skin entity.

Namespace

Drupal\skinr\Entity

Code

public function elementLabel() {
  $cache =& drupal_static(__FUNCTION__);
  $key = $this->element_type . '__' . $this->element . '__' . $this->theme;
  if (!isset($cache[$key])) {
    $titles = skinr_invoke_all('skinr_ui_element_title', $this->element_type, $this->element, $this->theme);
    $title = $titles ? reset($titles) : $this->element;
    $cache[$key] = $title;
  }
  return $cache[$key];
}