protected function getLabel()
{
// Get the label text from the XML element, defaulting to the element name.
$title = $this->element['label'] ? (string) $this->element['label'] : '';
if (empty($title)) {
$viewObject = $this->form->getView();
$viewName = $viewObject->getName();
$componentName = $viewObject->getContainer()->componentName;
$title = $componentName . '_' . $this->form->getModel()->getContainer()->inflector->pluralize($viewName) . '_FIELD_' . (string) $this->element['name'];
$title = strtoupper($title);
$result = \JText::_($title);
if ($result === $title) {
$title = ucfirst((string) $this->element['name']);
}
}
return $title;
}