<?php
/*
 * Copyright (c) 2024 Aimy Extensions, Netzum Sorglos Software GmbH
 *
 * https://www.aimy-extensions.com/
 *
 * License: GNU GPLv2, see LICENSE.txt within distribution and/or
 *          https://www.aimy-extensions.com/software-license.html
 */
 defined( '_JEXEC' ) or die(); require_once( __DIR__ . '/../helpers/DownloadKeyHelper.php' ); use Joomla\CMS\Form\FormField; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use AimyCanonical\Helpers\DownloadKeyHelper; class JFormFieldAimyDownloadKey extends FormField { protected $type = 'aimydownloadkey'; protected $layout = 'joomla.form.field.text'; public function getInput() { if ( strpos( JVERSION, '3.' ) !== 0 ) { Factory::getDocument() ->addStyleDeclaration( '#fieldset-key .control-group { align-items: center; }' ); return '<div>' . Text::sprintf( 'AIMY_CNCL_DL_KEY_USE_DL_KEY_MANAGER', DownloadKeyHelper::getEditLink() ) . '</div>'; } Factory::getDocument() ->addStyleDeclaration( '#jform_params_dl_key,#jform_dl_key { min-width: 250px; }' ); return $this->getRenderer( $this->layout ) ->render( $this->getLayoutData() ); } protected function getLayoutData() { return array_merge( array( 'options' => array(), 'addonBefore' => '', 'addonAfter' => '', 'dirname' => '' ), parent::getLayoutData() ); } } 
