Partner Login

Kontakt

AIR-COND Klimaanlagen-Handelsgesellschaft m.b.H.
AUSTRIA – CENTRAL EUROPE

Haushamer Straße 2
8054 Graz-Seiersberg, AUSTRIA

+43 316 80 89

+43 316 82 63 71

Referenzen Details

Zurück

<?php $strSession = 'user_privacy_settings'; // name of the session and formular identifyer $intPrivacy = \Input::cookie($strSession); // form listener if(\Input::post('FORM_SUBMIT') == $strSession) { // privacy settings \Input::setCookie($strSession, (int)\Input::post('privacy') ); // reload to have the session take effect $this->reload(); } ?>
<script> /* '); var privacy_cookie = document.cookie; if(privacy == undefined || privacy == '' || privacy == null || privacy_cookie.indexOf('<?= $strSession; ?>') < 0) { jQuery('#cookiebar_optin_<?= $this->id; ?>').addClass('open'); // set privacy level to -1 privacy = -1; } // remove token if(window.location.search.indexOf('clear_privacy_settings') >= 0) { // clear local storage localStorage.removeItem('<?= $strSession; ?>'); // empty cookie //document.cookie = '<?= $strSession; ?>=;'; jQuery.removeCookie('<?= $strSession; ?>',{path:'/'}); // fire event jQuery(document).trigger('Eclipse.clear_privacy_settings',{}); // log console.log('Privacy settings cleared'); // reload without parameter location.href = window.location.origin+window.location.pathname; } // set a body class jQuery('body').addClass('privacy_setting_'+privacy); // hide the info jQuery('#ajax_info_<?= $this->id; ?>').hide(); var form = jQuery('#<?= $strSession.'_'.$this->id; ?>'); // remove readonly from submit when user changes its selection form.find('.widget').change(function(e) { form.find('input[name="save_settings"]').removeClass('readonly'); form.find('input[name="save_settings"]').prop('disabled', false); }); form.find('input[name="save_settings"]').click(function(e) { e.preventDefault(); // still readonly if(jQuery(this).hasClass('readonly')) { return false; } // show ajax info jQuery('#ajax_info_<?= $this->id; ?>').fadeIn(50); var data = form.serializeArray(); var privacy = parseInt(data[2]['value']); // set local storage localStorage.setItem('<?= $strSession; ?>',privacy); // set cookie for php //document.cookie = '<?= $strSession; ?>='+privacy; jQuery.cookie('<?= $strSession; ?>',privacy,{expires:30,path:'/'}); // set a body class jQuery('body').addClass('privacy_setting_'+privacy); // remove negative body class jQuery('body').removeClass('privacy_setting_-1'); setTimeout(function() { // fire JS event jQuery(document).trigger('Eclipse.user_privacy',{'level':privacy}); // fire form as usal to catch it via php //form.submit(); }, 500); }); // help info jQuery('#cookiebar_optin_<?= $this->id; ?> .cookie_help_link').click(function() { jQuery('#cookiebar_optin_<?= $this->id; ?> .cookiebar_popup').toggleClass('view_help'); }); // help - scrollToTop jQuery('#cookiebar_optin_<?= $this->id; ?> .cookie_help_link').click(function() { jQuery("html, body").animate({ scrollTop: 0 }); return false; }); }); // listen to Eclipse.user_privacy Event jQuery(document).on('Eclipse.user_privacy',function(event,params) { if(params.level >= 0) { jQuery('#cookiebar_optin_<?= $this->id; ?>').removeClass('open'); // send ajax for log file jQuery.ajax( { url:location.href, data:{'user_privacy_settings':params.level,'tstamp':Math.round(new Date().getTime()/1000)} }); } }); </script> <?php // Create an opt-in log file "user_privacy_settings.log" in the system/config folder $strFileDir = 'system/config'; if(\Environment::get('isAjaxRequest') && \Input::get('user_privacy_settings') != '') { $objFile = new \File($strFileDir.'/user_privacy_settings.log',true); $objFile->write( $objFile->getContent() . \System::parseDate('d-m-Y G:i:s').' '.\Config::get('timeZone').';IP='.\Environment::get('ip').';DOMAIN:'.\Environment::get('base').';PRIVACY='.\Input::get('user_privacy_settings')."\n" ); $objFile->close(); } ?>