Your IP : 216.73.216.219


Current Path : /home/pteabiscqq/www/plugins/system/lab5_cookie_commander/cookie_commander/
Upload File :
Current File : /home/pteabiscqq/www/plugins/system/lab5_cookie_commander/cookie_commander/embed.bar.php

<?php defined('_JEXEC') or die();
/////////////////////////////////////////////////////////////////////////////////////////////
/** 
* Cookie Commander
* 
* @author : Lab5 - Dennis Riegelsberger
* @authorUrl : https://lab5.ch
* @copyright : Copyright (C) 2018+  Lab5 - Dennis Riegelsberger. All rights reserved.
* @license : GNU/GPL General Public License version 2 or later
* @project : https://lab5.ch/cookie-commander
* @on JED : https://extensions.joomla.org/extensions/extension/site-management/cookie-control/lab5-cookie-commander/
* 
* Built with <3 
* Lab5
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
/**
 * @CHANGELOG :
 * * 2020.08.10 : Great overhaul
 */
/////////////////////////////////////////////////////////////////////////////////////////////
/**
 * Attaches the Popup HTML into the Document HTML
 */
/////////////////////////////////////////////////////////////////////////////////////////////
if ( self::$this->params->get('cw_on', false )) : 
if(  in_array( JFactory::getDocument()->_type, ["html","error"] ) ) {
if( isset(self::$xstor->cooco->barContentHTML) ) { 
/////////////////////////////////////////////////////////////////////////////////////////////
$processfnc = function(){ // Anon function -> variable scope cleanliness 
/////////////////////////////////////////////////////////////////////////////////////////////

				$content = JResponse::getBody(); 

											if(self::$xstor->cooco->append){
															
													$content = 
													str_replace( '</body>', self::$xstor->cooco->barContentHTML.'</body>', $content);  
													
											}else{ 
													$ptrn = '/<body(.*?)>/ism' ; 
													$content = 
													preg_replace( $ptrn , '${0}'.self::$xstor->cooco->barContentHTML, $content);
											}
											
				JResponse::setBody($content);  

/////////////////////////////////////////////////////////////////////////////////////////////
}; $processfnc();					
/////////////////////////////////////////////////////////////////////////////////////////////
}
}
endif;