sUid = $sUid; parent::__construct(); $this->sLabel = $sLabel; $this->sIconClass = $sIconClass; $this->sTooltip = $sTooltip; } /** * @inheritDoc */ protected function GenerateId(): string { return parent::GenerateId().'--'.utils::GetSafeId($this->sUid, true); } public function GetAriaAttributes(): array { $aDefaultValues = []; // Keep the label as the default accessible name, falling back to the tooltip if (utils::IsNotNullOrEmptyString($this->sLabel)) { $aDefaultValues['label'] = $this->sLabel; } elseif (utils::IsNotNullOrEmptyString($this->sTooltip)) { $aDefaultValues['label'] = $this->sTooltip; } return array_merge($aDefaultValues, parent::GetAriaAttributes()); } public function HasAriaAttributes(): bool { return !empty($this->GetAriaAttributes()); } }