Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasJanda committed Mar 22, 2020
1 parent 040c65b commit 0c86477
Show file tree
Hide file tree
Showing 28 changed files with 39 additions and 23 deletions.
27 changes: 17 additions & 10 deletions Application/Component/Widget/rs_cookie_manager_widget.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ class rs_cookie_manager_widget extends \OxidEsales\EshopCommunity\Application\Co
{

protected $_rs_cookiemanager_cookieName="rs_cookie_manager";

public function accept()
{
//set cookie
$sName = $this->_rs_cookiemanager_cookieName;
$sCookieValue = uniqid();

$iDays = (int) $this->getConfig()->getConfigParam('rs-cookiemanager_days_till_expire');
$sSourceCl = $this->getConfig()->getConfigParam('sourcecl');
if(!$sSourceCl || $sSourceCl==="")
$sSourceCl = "start";

if($iDays==0)
$iDays=365;

$iTime = time() + $iDays*24*60*60;
\OxidEsales\Eshop\Core\Registry::getUtilsServer()->setOxCookie($sName, $sCookieValue, $iTime);

Expand All @@ -30,23 +34,23 @@ public function accept()
if(is_array($aGroups))
{
$aGroupKeys = array_keys($aGroups);

//fix because jquery
$aGroupNew = [];
foreach($aGroups as $sKey => $sValue)
{
if(is_array($sValue))
$sValue = end($sValue);

$aGroupNew[$sKey] = $sValue;
}
$aGroups = $aGroupNew;
}

$iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
$iShop = $this->getConfig()->getShopId();
$oList = new \rs\cookiemanager\Model\rs_cookie_manager_list();

$oList = new \rs\cookiemanager\Model\rs_cookie_manager_list();
$aList = $oList->getList();
foreach($aList as $o)
{
Expand All @@ -72,8 +76,11 @@ public function accept()
$oTrack->save();
}
}

header("HTTP/1.0 200 Ok", true, 200);

$sUrl = $this->getConfig()->getShopCurrentUrl() . "cl=" . $sSourceCl;
$sUrl = \OxidEsales\Eshop\Core\Registry::get( "oxUtilsUrl" )->processUrl( $sUrl );
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect( $sUrl );

die("");
}
}
}
Empty file modified Application/translations/de/rs_cookiemanager_lang.php
100644 → 100755
Empty file.
Empty file modified Application/views/admin/de/rs-cookiemanager_lang.php
100644 → 100755
Empty file.
Empty file modified Core/Config.php
100644 → 100755
Empty file.
Empty file modified Core/Language.php
100644 → 100755
Empty file.
Empty file modified Core/ViewConfig.php
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager.php
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager_group.php
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager_item.php
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager_item_list.php
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager_list.php
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager_track.php
100644 → 100755
Empty file.
Empty file modified Model/rs_cookie_manager_track_list.php
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified TODO.txt
100644 → 100755
Empty file.
Empty file modified composer.json
100644 → 100755
Empty file.
Empty file modified menu.xml
100644 → 100755
Empty file.
Empty file modified metadata.php
100644 → 100755
Empty file.
25 changes: 16 additions & 9 deletions out/src/js/js.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$( document ).ready(function() {
$('#rs_cookie_manager_accept_all').click(function() {
$('#rs_cookie_manager_popup input[type="checkbox"]').each(function(index) {
$('#rs_cookie_manager_popup input[type="checkbox"]').each(function() {
$(this)[0].checked = true;
});
return rs_cookie_manager_accept();
Expand All @@ -9,7 +9,7 @@ $( document ).ready(function() {
return rs_cookie_manager_accept();
});
$('.rs_cookie_manager_group_more').click(function() {
let id = $(this).attr('data-group-id');
/* let id = $(this).attr('data-group-id'); */
$(this).next().toggleClass('show');
if($(this).next().hasClass('show')){
$(this).find('i').attr('style','transform: rotate(180deg)');
Expand All @@ -20,29 +20,36 @@ $( document ).ready(function() {
});
function rs_cookie_manager_popup_open()
{
"use strict";
$('#rs_cookie_manager_popup').modal('show');
return false;
}
function rs_cookie_manager_popup_close()
{
setTimeout("$('#rs_cookie_manager_popup').modal('hide')", 500);
}
"use strict";
window.setTimeout(function() {
$('#rs_cookie_manager_popup').modal('hide');
}, 500);
}
function rs_cookie_manager_accept()
{
"use strict";
$('#rs_cookie_manager_popup_form').trigger('submit');
/* sync ajax request */
var data = $('#rs_cookie_manager_popup_form').serialize();
var url = $('#rs_cookie_manager_popup_form').attr('data-url');
/*
let data = $('#rs_cookie_manager_popup_form').serialize();
let url = $('#rs_cookie_manager_popup_form').attr('data-url');
$.ajax({
async:false,
method: "POST",
url: url,
data: data
}).done(function( msg ) {
/* nothing */
}).always(function() {
/* nothing */
});
rs_cookie_manager_popup_close();
return true;
}
*/
return false;
}
Empty file modified out/src/style/css.css
100644 → 100755
Empty file.
Empty file modified shop1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified views/blocks/layout/base__base_js.tpl
100644 → 100755
Empty file.
Empty file modified views/blocks/layout/base__base_style.tpl
100644 → 100755
Empty file.
Empty file modified views/blocks/layout/base__rscookiemanager1.tpl
100644 → 100755
Empty file.
Empty file modified views/blocks/layout/base__rscookiemanager2.tpl
100644 → 100755
Empty file.
Empty file modified views/blocks/layout/base__rscookiemanager3.tpl
100644 → 100755
Empty file.
10 changes: 6 additions & 4 deletions views/tpl/rs_cookie_manager_popup.tpl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
[{/oxifcontent}]
</p>
<div class="text-left">
<form id="rs_cookie_manager_popup_form" action="" method="post" data-url="[{$oViewConf->getSslSelfLink()}]">
<form id="rs_cookie_manager_popup_form" action="[{$oViewConf->getSslSelfLink()|replace:'?':''}]" method="post">

[{$oViewConf->getHiddenSid()}]
[{$oViewConf->getNavFormParams()}]
<input type="hidden" name="fnc" value="accept">
<input type="hidden" name="cl" value="rs_cookie_manager_widget">

<input type="hidden" name="sourcecl" value="[{$oViewConf->getTopActiveClassName()}]">

[{assign var=aList value=$oViewConf->rs_cookiemanager_getPopupContent()}]
[{foreach from=$aList item=aItems}]
[{foreach from=$aItems item=oItem name=listitems}]
Expand Down Expand Up @@ -61,8 +63,8 @@
[{/oxifcontent}]
</div>
<div class="text-right text-lg-right">
<a rel="nofollow" id="rs_cookie_manager_accept" href="" class="mt-2 btn btn-outline-success btn-default">[{oxmultilang ident="rs_cookie_manager_popup_button_accept"}]</a>
<a rel="nofollow" id="rs_cookie_manager_accept_all" href="" class="mt-2 ml-2 btn btn-success">[{oxmultilang ident="rs_cookie_manager_popup_button_accept_all"}]</a>
<a rel="nofollow" id="rs_cookie_manager_accept" href="#" class="mt-2 btn btn-outline-success btn-default">[{oxmultilang ident="rs_cookie_manager_popup_button_accept"}]</a>
<a rel="nofollow" id="rs_cookie_manager_accept_all" href="#" class="mt-2 ml-2 btn btn-success">[{oxmultilang ident="rs_cookie_manager_popup_button_accept_all"}]</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 0c86477

Please sign in to comment.