* */ if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } $sPluginName = 'phpbo.cookie_consent'; function phpboccInjectFrontend($sHtml) { $sInjection = ''; $sInjection .= ''. "\n"; $sInjection .= '' . "\n"; $sInjection .= '' . "\n"; $sInjection .= ''; return str_replace('', $sInjection, $sHtml); } function phpboccGetJs() { if (isset($_GET['phpboccGetJs'])) { $sFileContent = ''; ob_end_clean(); header("Content-Type: application/javascript"); header("Cache-Control: max-age=604800, public"); switch ($_GET['phpboccGetJs']) { case 'config.js': $sFileContent = file_get_contents(dirname(__FILE__, 2).'/external/klaro/config.js'); break; case 'klaro.js': $sFileContent = file_get_contents(dirname(__FILE__, 2).'/external/klaro/klaro.js'); break; default: break; } echo $sFileContent; die(); } } function phpboccGetCss() { if (isset($_GET['phpboccGetCss'])) { $sFileContent = ''; ob_end_clean(); header("Content-type: text/css; charset: UTF-8"); header("Cache-Control: max-age=604800, public"); switch ($_GET['phpboccGetCss']) { case 'klaro.css': $sFileContent = file_get_contents(dirname(__FILE__, 2).'/external/klaro/klaro.css'); break; default: break; } echo $sFileContent; die(); } } $_cecRegistry->addChainFunction("Contenido.Frontend.HTMLCodeOutput", "phpboccInjectFrontend"); $_cecRegistry->addChainFunction("Contenido.Frontend.AfterLoadPlugins", "phpboccGetJs"); $_cecRegistry->addChainFunction("Contenido.Frontend.AfterLoadPlugins", "phpboccGetCss");