* @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\User\Profile\Field; use Joomla\CMS\Factory; use Joomla\CMS\Form\Field\RadioField; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Database\ParameterType; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Provides input for TOS * * @since 2.5.5 */ class TosField extends RadioField { /** * The form field type. * * @var string * @since 2.5.5 */ protected $type = 'Tos'; /** * Method to get the field label markup. * * @return string The field label markup. * * @since 2.5.5 */ protected function getLabel() { $label = ''; if ($this->hidden) { return $label; } // Get the label text from the XML element, defaulting to the element name. $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name']; $text = $this->translateLabel ? Text::_($text) : $text; // Set required to true as this field is not displayed at all if not required. $this->required = true; // Build the class for the label. $class = !empty($this->description) ? 'hasPopover' : ''; $class = $class . ' required'; $class = !empty($this->labelClass) ? $class . ' ' . $this->labelClass : $class; // Add the opening label tag and main attributes attributes. $label .= ''; return $label; } }