Server IP : 1.179.227.78 / Your IP : 10.104.4.41 Web Server : Apache System : Linux afdc-mdu34 5.4.0-153-generic #170-Ubuntu SMP Fri Jun 16 13:43:31 UTC 2023 x86_64 User : www ( 1001) PHP Version : 7.4.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/afdc-mdu34.rtarf.mi.th/joomla/plugins/content/confirmconsent/ |
Upload File : |
<?php /** * @package Joomla.Plugin * @subpackage Content.confirmconsent * * @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; 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_mailto.mailto', 'com_privacy.request', ); /** * Add additional fields to the supported forms * * @param JForm $form The form to be altered. * @param mixed $data The associated data for the form. * * @return boolean * * @since 3.9.0 */ public function onContentPrepareForm(JForm $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); $form->load(' <form> <fieldset name="default" addfieldpath="/plugins/content/confirmconsent/fields"> <field name="consentbox" type="consentbox" articleid="' . $privacyArticle . '" label="PLG_CONTENT_CONFIRMCONSENT_CONSENTBOX_LABEL" required="true" > <option value="0">' . htmlspecialchars($consentboxText, ENT_COMPAT, 'UTF-8') . '</option> </field> </fieldset> </form>' ); return true; } }