From 72d4caad6a538d2d5ef1945187a8db77e34c7a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=81Z=C3=81R=20Imre=20AI=20Agent?= Date: Thu, 16 Jul 2026 11:24:52 +0200 Subject: [PATCH] feat(deployed): add EU Cookie Directive Lite 1.1.1 (no-source, vetted live) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EU Cookie Directive Lite system plugin (Channel Digital); unmapped -> deployed files. Signed-off-by: LÁZÁR Imre Assisted-by: claude-code@claude-opus-4-8 --- .../EUCookieDirectiveLite.php | 166 ++++++++++++++++++ .../EUCookieDirectiveLite.xml | 27 +++ .../EUCookieDirective.js | 9 + .../images/continue_button.png | Bin 0 -> 1192 bytes .../images/info_icon.png | Bin 0 -> 2160 bytes 5 files changed, 202 insertions(+) create mode 100644 deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.php create mode 100644 deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.xml create mode 100644 deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/EUCookieDirective.js create mode 100644 deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/images/continue_button.png create mode 100644 deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/images/info_icon.png diff --git a/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.php b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.php new file mode 100644 index 00000000..0bb774a9 --- /dev/null +++ b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.php @@ -0,0 +1,166 @@ +EU Cookie Directive. +Version: 1.0.5 +Author: Channel Computing +Author URI: http://www.channelcomputing.co.uk + +Copyright (C) 2011-2012, Channel Computing +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// no direct access +defined( '_JEXEC' ) or die( 'Restricted access' ); + +jimport( 'joomla.plugin.plugin' ); + +/** + * Joomla! EU Cookie Directive plugin + * + * @package Joomla + * @subpackage System + */ +class plgSystemEUCookieDirectiveLite extends JPlugin +{ + /** + * Constructor + * + * For php4 compatability we must not use the __constructor as a constructor for plugins + * because func_get_args ( void ) returns a copy of all passed arguments NOT references. + * This causes problems with cross-referencing necessary for the observer design pattern. + * + * @access protected + * @param object $subject The object to observe + * @param array $config An array that holds the plugin configuration + * @since 1.0 + */ + function plgSystemEUCookieDirectiveLite(& $subject, $config) + { + parent::__construct($subject, $config); + + } + + /** + * Start the output + * + */ + function onAfterRender() + { + + global $mainframe, $database; + + //get Params + $message = $this->params->get('warningMessage', ''); + $privacyLink = $this->params->get('detailsUrl', 'index.php'); + $width = $this->params->get('width', '0'); + + //deal with the width options + if ($width == "0") { + $width = "100%"; + } else { + $width = $width . "px"; + } + + $document = JFactory::getDocument(); + $doctype = $document->getType(); + $app = JFactory::getApplication(); + + $ICON_FOLDER = JURI::root() . 'plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/images/'; + + if ( $app->getClientId() === 0 ) { + + $strOutputHTML = ""; + $style = ''; + + $hide = "\n".''."\n"; + + //Define paths for portability + //$SCRIPTS_FOLDER = JURI::root() . 'plugins/system/EUCookieDirective/'; + $SCRIPTS_FOLDER = JURI::root() . 'plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/'; + $cookiescript = ''."\n"; + + $strOutputHTML = ""; + $strOutputHTML .= '
'; + $strOutputHTML .= '
'; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= '
'; + $strOutputHTML .= '
'; + $strOutputHTML .= '

' . $message . ' To find out more about the cookies we use and how to delete them, see our privacy policy.

'; + $strOutputHTML .= '
'; + $strOutputHTML .= '
  '; + $strOutputHTML .= 'I accept cookies from this site. '; + $strOutputHTML .= ''; + $strOutputHTML .= ''; + $strOutputHTML .= '
EU Cookie Directive Module Information
'; + $strOutputHTML .= '
'; + $strOutputHTML .= '
'; + $strOutputHTML .= '
'; + + //Only write the HTML Output if the cookie has not been set as "accepted" + if(!isset($_COOKIE['cookieAcceptanceCookie']) || $_COOKIE['cookieAcceptanceCookie'] != "accepted") + { + + $body = JResponse::getBody(); + $body = str_replace('', $style.'', $body); + $body = str_replace('', $strOutputHTML.$cookiescript.'', $body); + JResponse::setBody($body); + } + elseif($_COOKIE['cookieAcceptanceCookie'] == "accepted") { + $body = JResponse::getBody(); + $body = str_replace('', $hide.'', $body); + JResponse::setBody($body); + } + } + } +} \ No newline at end of file diff --git a/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.xml b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.xml new file mode 100644 index 00000000..990ba789 --- /dev/null +++ b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite.xml @@ -0,0 +1,27 @@ + + + system - EUCookieDirectiveLite + Channel Digital. + 2013-11-19 + All rights reserved by channeldigital.co.uk 2013. + GPL 1.0 + info@channeldigital.co.uk + www.channeldigital.co.uk + 1.1.1 + Displays a cookie acceptance banner at the top of the site to warn about the site using cookies. + + EUCookieDirectiveLite.php + EUCookieDirectiveLite/images/info_icon.png + EUCookieDirectiveLite/images/continue_button.png + EUCookieDirectiveLite/EUCookieDirective.js + + + +
+ + + +
+
+
+
diff --git a/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/EUCookieDirective.js b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/EUCookieDirective.js new file mode 100644 index 00000000..b829c99b --- /dev/null +++ b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/EUCookieDirective.js @@ -0,0 +1,9 @@ +function SetCookie(cookieName,cookieValue,nDays) { + var today = new Date(); + var expire = new Date(); + if (nDays==null || nDays==0) nDays=1; + expire.setTime(today.getTime() + 3600000*24*nDays); + document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString()+"; path=/"; + document.getElementById("cookieMessageContainer").style.display="none"; + window.location.href=window.location.href; +} \ No newline at end of file diff --git a/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/images/continue_button.png b/deployed/EUCookieDirectiveLite/plugins/system/EUCookieDirectiveLite/EUCookieDirectiveLite/images/continue_button.png new file mode 100644 index 0000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