芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/plugins.7/content/confirmconsent/confirmconsent.php
* @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\Plugin\CMSPlugin; /** * The Joomla Core confirm consent plugin * * @since 3.9.0 */ class PlgContentConfirmConsent extends CMSPlugin { /** * The Application object * * @var JApplicationSite * @since 3.9.0 */ protected $app; /** * Load the language file on instantiation. * * @var boolean * @since 3.9.0 */ protected $autoloadLanguage = true; /** * The supported form contexts * * @var array * @since 3.9.0 */ protected $supportedContext = array( 'com_contact.contact', 'com_privacy.request', ); /** * Add additional fields to the supported forms * * @param Form $form The form to be altered. * @param mixed $data The associated data for the form. * * @return boolean * * @since 3.9.0 */ public function onContentPrepareForm(Form $form, $data) { if ($this->app->isClient('administrator') || !in_array($form->getName(), $this->supportedContext)) { return true; } // Get the consent box Text & the selected privacyarticle $consentboxText = (string) $this->params->get('consentbox_text', Text::_('PLG_CONTENT_CONFIRMCONSENT_FIELD_NOTE_DEFAULT')); $privacyArticle = $this->params->get('privacy_article', false); $privacyType = $this->params->get('privacy_type', 'article'); $privacyMenuItem = $this->params->get('privacy_menu_item', false); $form->load('
' . htmlspecialchars($consentboxText, ENT_COMPAT, 'UTF-8') . '
' ); return true; } }