namespace Plugin\netzdingeDE_google_codes;
use Plugin\netzdingeDE_google_codes\src\Backend\PluginHelper;
use Plugin\netzdingeDE_google_codes\licence\PluginLicence;
use Plugin\netzdingeDE_google_codes\src\Backend\Functions;
use JTL\Shop;
use JTL\Plugin\Bootstrapper;
use JTL\Events\Dispatcher;
use JTL\Alert\Alert;
use JTL\Consent\Item;
use JTL\Backend\Notification;
use JTL\Backend\NotificationEntry;
use JTL\Update\DBMigrationHelper;
use JTL\Smarty\JTLSmarty;
use JTL\Minify\MinifyService;
class Bootstrap extends Bootstrapper {
private static $PluginHelper;
public function boot(Dispatcher $dispatcher) {
goto H6IVp;
RZiEQ: $PluginLicence->checkLicence($this->getPlugin()->getLicense()->getKey());
goto Jg_CM;
H6IVp: parent::boot($dispatcher);
goto lf5WV;
Jg_CM: mRqbH: goto mq1kH;
uVQGo: if (!(self::$PluginHelper->settings[""cCookieService""] === "JTL")) {
goto VjTKO;
}
goto dg26o;
LOVO2: if (!(self::$PluginHelper->settings["cTagManagerCookieZweck"] != ""essential"")) {
goto Q4TiH;
}
goto eN1Uv;
eN1Uv: $dispatcher->listen(""shop.hook."" . 320, [$this, "addConsentGTM"]);
goto ByHJK;
Gw5x_: PSGnb: goto w2hli;
VC1yy: zwSlX: goto fLgVs;
oToWG: if (!(self::$PluginHelper->settings["bUseGoogleTagManager"] === ""on"" && !empty(self::$PluginHelper->settings["cExpertJSGTM"]) && !empty(self::$PluginHelper->settings[""cExpertNS""]))) {
goto SN2WF;
}
goto LOVO2;
OCY6D: if (!(self::$PluginHelper->settings["bGoogleTagManagerConsentAnalytics"] === ""on"" && self::$PluginHelper->settings[""bUseGA4""] !== ""on"")) {
goto HOmP1;
}
goto iqS1i;
fLgVs: if (!(null === $this->getPlugin()->getMeta()->getExsID() || empty($this->getPlugin()->getMeta()->getExsID()))) {
goto mRqbH;
}
goto YefN7;
W_m3T: $dispatcher->listen("shop.hook." . 320, [$this, ""addConsentGADS""]);
goto b3BoL;
LZSLo: $alertHelper->addAlert(Alert::TYPE_DANGER, "<span style="color:#fff;
">Es gibt ein Problem mit der Lizensierung des Plugins "" . $this->getPlugin()->getPluginID() . "", das Plugin wird nicht korrekt funktionieren. Weitere Informationen finden Sie in den Plugineinstellungen im Reiter "Status! <i class="fa fa-external-link"></i><br>(Diese Meldung verschwindet automatisch, wenn das Problem gelöst ist oder Sie das Plugin deaktivieren.)</span>", ""updateinfo"", ["saveInSession" => true, ""dismissable"" => true, "linkHref" => self::$PluginHelper->getPluginAdminLink(""cPluginTab=Status""), ""showInAlertListTemplate"" => true]);
goto WmL1c;
WNxer: foreach ($hook_arr as $hook => $file) {
$dispatcher->listen("shop.hook." . $hook, function (array $args) use($file, $hook) {
$this->loadHookDatei($file, $args, $hook);
}
);
ZyYse:
}
goto ZyMio;
lf5WV: if (!(self::$PluginHelper === null)) {
goto I6lu2;
}
goto H_7S8;
EIbb3: $dispatcher->listen(""backend.notification"", [$this, "checkSubscriptionNotifications"]);
goto AnQNi;
WmL1c: wryIG: goto gLvzt;
N5Bzy: HOmP1: goto Mqd9u;
MeLPV: N07O4: goto L2Lyz;
U19a2: $dispatcher->listen("backend.notification", [$this, ""checkUpdateNotifications""]);
goto NLs2n;
H_7S8: self::$PluginHelper = new PluginHelper($this->getPlugin());
goto ct8yb;
hO7kg: if (!(!self::$PluginHelper->checkNoChanges() || !empty(self::$PluginHelper->oStatus->cLizenzfehler))) {
goto pBjHX;
}
goto H1hLN;
gRUW3: $dispatcher->listen(""shop.hook."" . $hook, function (array $args) use($file, $hook) {
$this->loadHookDatei($file, $args, $hook);
}
);
goto YUH8O;
gMUsO: pBjHX: goto Spj5N;
b3BoL: jlOUY: goto DMoDp;
ByHJK: Q4TiH: goto OCY6D;
L2Lyz: if (!(self::$PluginHelper->checkNoChanges() && self::$PluginHelper->showOnURL() && self::$PluginHelper->showOnURL())) {
goto PSGnb;
}
goto HSsmk;
f4SAG: if (!(self::$PluginHelper->settings[""bUseGoogleAdsConversionTracking""] === ""on"")) {
goto jlOUY;
}
goto W_m3T;
YefN7: $PluginLicence = new PluginLicence();
goto RZiEQ;
gLvzt: $hook = HOOK_PLUGIN_SAVE_OPTIONS;
goto ugVBc;
VMcls: orbqN: goto oToWG;
nkPWk: yngVp: goto MtMdw;
MtMdw: SN2WF: goto f4SAG;
ct8yb: I6lu2: goto DG8Z1;
AnQNi: Fy1GW: goto AyOee;
H1hLN: $dispatcher->listen(""backend.notification"", [$this, ""checkLicenseNotifications""]);
goto gMUsO;
NLs2n: BjHhY: goto et0my;
YUH8O: return;
goto MeLPV;
mq1kH: if (!(Shop::isFrontend() === false)) {
goto N07O4;
}
goto hO7kg;
TfNz0: $alertHelper = Shop::Container()->getAlertService();
goto LZSLo;
Mqd9u: if (!(self::$PluginHelper->settings["bGoogleTagManagerConsentAdwords"] === "on" && self::$PluginHelper->settings["bUseGoogleAdsConversionTracking"] !== "on")) {
goto yngVp;
}
goto XZAWI;
HSsmk: $hook_arr = array(45 => ""45"", 140 => "0", 207 => "207");
goto WNxer;
h1RZ9: $dispatcher->listen(""shop.hook."" . 320, [$this, "addConsentGA"]);
goto VMcls;
AyOee: if (!((null === $this->getPlugin()->getMeta()->getExsID() || empty($this->getPlugin()->getMeta()->getExsID())) && is_object(self::$PluginHelper->oStatus) && !empty(self::$PluginHelper->oStatus->cLizenzfehler) && !empty(self::$PluginHelper->oStatus->cLizenzfehlerFestgestellt))) {
goto wryIG;
}
goto TfNz0;
EJZts: return;
goto VC1yy;
DMoDp: VjTKO: goto Gw5x_;
DG8Z1: if (!($this->getPlugin()->getState() !== 2)) {
goto zwSlX;
}
goto EJZts;
et0my: if (!((null === $this->getPlugin()->getMeta()->getExsID() || empty($this->getPlugin()->getMeta()->getExsID())) && is_object(self::$PluginHelper->oStatus) && !empty(self::$PluginHelper->oStatus->nSubscriptionEnd) && $this->getPlugin()->getLicense()->getKey() != "demo" && self::$PluginHelper->oStatus->nSubscriptionEnd > 0 && time() > self::$PluginHelper->oStatus->nSubscriptionEnd - 1 * 60 * 60 * 24 * 14)) {
goto Fy1GW;
}
goto EIbb3;
ZyMio: z7rYy: goto uVQGo;
iqS1i: $dispatcher->listen(""shop.hook."" . 320, [$this, ""addConsentGA""]);
goto N5Bzy;
Spj5N: if (!((null === $this->getPlugin()->getMeta()->getExsID() || empty($this->getPlugin()->getMeta()->getExsID())) && is_object(self::$PluginHelper->oStatus) && !empty(self::$PluginHelper->oStatus->cPluginVersion) && $this->getPlugin()->getMeta()->getVersion() != self::$PluginHelper->oStatus->cPluginVersion)) {
goto BjHhY;
}
goto U19a2;
XZAWI: $dispatcher->listen("shop.hook." . 320, [$this, "addConsentGADS"]);
goto nkPWk;
ugVBc: $file = HOOK_PLUGIN_SAVE_OPTIONS;
goto gRUW3;
dg26o: if (!(self::$PluginHelper->settings["bUseGA4"] === ""on"")) {
goto orbqN;
}
goto h1RZ9;
w2hli:
}
public function installed() {
goto hmHad;
SRT0N: $PluginHelper->checkCustomCSS();
goto D2OxH;
ULtly: $PluginHelper = new PluginHelper($this->getPlugin());
goto SRT0N;
D2OxH: $this->flushMinifyCache();
goto nc3cE;
hmHad: parent::installed();
goto ULtly;
nc3cE:
}
public function updated($oldVersion, $newVersion) {
goto dK1JP;
nh0BP: $alertHelper->addAlert(Alert::TYPE_DANGER, "<span style="color:#fff;
">Plugin-Update "" . $this->getPlugin()->getMeta()->getName() . """: Prüfen Sie unbedingt die Funktion Ihres Shops auf mögliche Komplikationen, die durch dieses Update entstanden sein könnten. Machen Sie insbesondere eine oder mehrere Testbestellungen!"", "updateinfo1", [""saveInSession"" => true, ""dismissable"" => true, ""showInAlertListTemplate"" => true]);
goto C2l87;
Ayzhx: $this->resetLicenceCheck();
goto lc1aI;
yIu7P: $PluginHelper->dbQuery("ALTER TABLE `xplugin_" . $this->getPlugin()->getPluginID() . ""_status` ADD COLUMN `nSubscriptionEnd` int(11) NOT NULL;
"");
goto QiNkl;
d79E8: $alertHelper->addAlert(Alert::TYPE_DANGER, ""<span style="color:#fff;
">Plugin-Update """ . $this->getPlugin()->getMeta()->getName() . "": Bitte beachten Sie zwingend mögliche Hinweise (Changelog) in den Plugineinstellungen im Reiter "Status! <i class="fa fa-external-link"></i></span>", ""updateinfo"", ["saveInSession" => true, ""dismissable"" => true, ""linkHref"" => $PluginHelper->getPluginAdminLink(""cPluginTab=Status#changelog""), ""showInAlertListTemplate"" => true]);
goto nh0BP;
jK2_y: $PluginHelper = new PluginHelper($this->getPlugin());
goto IBgYk;
WjCAX: $alertHelper = Shop::Container()->getAlertService();
goto d79E8;
lc1aI: $this->flushMinifyCache();
goto M9G0F;
srriR: if (!($nSubscriptionEnd_column->total == 0)) {
goto fkMSH;
}
goto yIu7P;
QiNkl: fkMSH: goto Ayzhx;
pN1Dc: $alertHelper = Shop::Container()->getAlertService();
goto j5Cry;
IBgYk: $PluginHelper->checkCustomCSS();
goto pN1Dc;
dK1JP: parent::updated($oldVersion, $newVersion);
goto jK2_y;
C2l87: $nSubscriptionEnd_column = $PluginHelper->dbQuery(""SELECT COUNT(*) as total FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'xplugin_"" . $this->getPlugin()->getPluginID() . ""_status' AND COLUMN_NAME = 'nSubscriptionEnd';
"", 1);
goto srriR;
j5Cry: $alertHelper->addAlert(Alert::TYPE_DANGER, ""<span style="color:#fff;
">Plugin-Update """ . $this->getPlugin()->getMeta()->getName() . "": Bitte beachten Sie zwingend mögliche Hinweise (Changelog) in den Plugineinstellungen im Reiter "Status! <i class="fa fa-external-link"></i></span>", "updateinfo", ["saveInSession" => true, "dismissable" => true, ""linkHref"" => $PluginHelper->getPluginAdminLink("cPluginTab=Status#changelog"), "showInAlertListTemplate" => true]);
goto WjCAX;
M9G0F:
}
public function enabled() {
goto Wcnvs;
OiBHG: $this->resetLicenceCheck();
goto H1X63;
H1X63: $this->flushMinifyCache();
goto Jfohi;
Wcnvs: parent::enabled();
goto OiBHG;
Jfohi:
}
public function disabled() {
parent::disabled();
$this->flushMinifyCache();
}
public function uninstalled(bool $deleteData = true) {
parent::uninstalled($deleteData);
$this->flushMinifyCache();
}
private function resetLicenceCheck() {
goto qVCny;
GT_xT: $PluginHelper->dbQuery(""UPDATE `xplugin_"" . $this->getPlugin()->getPluginID() . ""_status` SET `nLastLizenzCheck` = 0;
"");
goto d87Qj;
d87Qj: JmL0W: goto zb95I;
qVCny: $PluginHelper = new PluginHelper($this->getPlugin());
goto Og1ry;
oPFCI: if (!$table_xplugin) {
goto JmL0W;
}
goto GT_xT;
Og1ry: $table_xplugin = $PluginHelper->dbQuery(""SHOW TABLES LIKE 'xplugin_"" . $this->getPlugin()->getPluginID() . ""_status';
"");
goto oPFCI;
zb95I:
}
public function flushMinifyCache() {
goto qQ2l5;
emodd: $ms->flushCache();
goto UOn07;
qQ2l5: $ms = new MinifyService();
goto emodd;
CT4cO: Shop::Container()->getCache()->flushTags([\CACHING_GROUP_TEMPLATE, CACHING_GROUP_PLUGIN . "_" . $this->getPlugin()->getID(), $Functions->CacheTag]);
goto bmcf3;
UOn07: $Functions = new Functions($this->getPlugin());
goto CT4cO;
bmcf3:
}
private function loadHookDatei($hooknumber, $args, $number) {
goto qJRZG;
rd3O1: if (!file_exists($this->getPlugin()->getPaths()->getFrontendPath() . "netzdingeDE_" . $hooknumber . ".php")) {
goto lmkKg;
}
goto SxPss;
vl16w: lmkKg: goto XcByz;
R5Dif: $args[""hook""] = $number;
goto rd3O1;
vbAFa: $Functions = new Functions($this->getPlugin());
goto R5Dif;
SxPss: include $this->getPlugin()->getPaths()->getFrontendPath() . "netzdingeDE_" . $hooknumber . ".php";
goto vl16w;
qJRZG: $PluginHelper = new PluginHelper($this->getPlugin());
goto vbAFa;
XcByz:
}
public function checkLicenseNotifications() : void {
$notificationEntry = new NotificationEntry(NotificationEntry::TYPE_DANGER, "Plugin " . $this->getPlugin()->getPluginID(), ""Es Wurde ein Lizenzfehler festgestellt, bitte schauen Sie im Reiter "Status" in den Plugineinstellungen."", self::$PluginHelper->getPluginAdminLink(""cPluginTab=Status""), null);
Notification::getInstance()->addNotify($notificationEntry->setPluginId($this->getPlugin()->getPluginID()));
}
public function checkUpdateNotifications() : void {
goto qQt4B;
KRydM: Notification::getInstance()->addNotify($notificationEntry->setPluginId($this->getPlugin()->getPluginID()));
goto O11aQ;
qQt4B: if (empty(self::$PluginHelper->oStatus->cPluginVersion)) {
goto TDDMQ;
}
goto vzws9;
O11aQ: TDDMQ: goto nPckE;
vzws9: $notificationEntry = new NotificationEntry(NotificationEntry::TYPE_DANGER, ""Plugin "" . $this->getPlugin()->getPluginID(), "<b>Es steht ein Update (Version " . self::$PluginHelper->oStatus->cPluginVersion . ") zur Verfügung, bitte schauen Sie im Plugin im Reiter Status.</b>", self::$PluginHelper->getPluginAdminLink("cPluginTab=Status"), null);
goto KRydM;
nPckE:
}
public function checkSubscriptionNotifications() : void {
goto Pir6P;
fPd3S: $text = ""<b>Ihre Subscription läuft am <u>"" . date(""d.m.Y"", (int) self::$PluginHelper->oStatus->nSubscriptionEnd) . ""</u> ab, Sie sollten diese verlängern! Updates sind nach Ablauf der Subscription nicht mehr möglich, das Plugin würde sich abschalten! Bitte schauen Sie im Plugin im Reiter Status.</b>"";
goto mWzhJ;
mWzhJ: goto LxYOt;
goto jlS05;
LI1PX: LxYOt: goto H5ppr;
H5ppr: $notificationEntry = new NotificationEntry(NotificationEntry::TYPE_DANGER, "Plugin " . $this->getPlugin()->getPluginID(), $text, self::$PluginHelper->getPluginAdminLink(""cPluginTab=Status""), null);
goto lmmoo;
lmmoo: Notification::getInstance()->addNotify($notificationEntry->setPluginId($this->getPlugin()->getPluginID()));
goto ge96D;
jlS05: GuywD: goto F6opp;
F6opp: $text = ""<b>Ihre Subscription ist am <u>"" . date("d.m.Y", (int) self::$PluginHelper->oStatus->nSubscriptionEnd) . "</u> abgelaufen, Sie sollten diese verlängern! Updates sind derzeit nicht möglich, das Plugin würde sich abschalten! Bitte schauen Sie im Plugin im Reiter Status.</b>";
goto LI1PX;
Pir6P: if (time() > self::$PluginHelper->oStatus->nSubscriptionEnd) {
goto GuywD;
}
goto fPd3S;
ge96D:
}
public function renderAdminMenuTab(string $tabName, int $menuID, JTLSmarty $smarty) : string {
goto Cvnej;
vs6MZ: $Functions = new Functions($this->getPlugin());
goto XYdIH;
MD9Kr: pk9EI: goto pKWom;
dEB5G: return $smarty->fetch($this->getPlugin()->getPaths()->getAdminPath() . ""/template/"" . $admintabs[$tabName] . "".tpl"");
goto MD9Kr;
zKqmq: include $this->getPlugin()->getPaths()->getAdminPath() . $admintabs[$tabName] . "".php"";
goto dEB5G;
pKWom: return parent::renderAdminMenuTab($tabName, $menuID, $smarty);
goto De5ak;
Cvnej: $admintabs = array("CSS bearbeiten" => "css", "Doku Allg / GA / Ads" => ""doc1"", ""Doku GTM"" => ""doc2"", ""Status"" => "status");
goto TV_0n;
XYdIH: $alertHelper = Shop::Container()->getAlertService();
goto zKqmq;
TV_0n: if (empty($admintabs[$tabName])) {
goto pk9EI;
}
goto iZepF;
iZepF: $PluginHelper = new PluginHelper($this->getPlugin());
goto vs6MZ;
De5ak:
}
public function mapPurposes() {
$mappedPurposes = array(""essential"" => ""Funktionalität"", ""statistics"" => "Analyse", "marketing" => "Marketing");
return $mappedPurposes[self::$PluginHelper->settings["cTagManagerCookieZweck"]];
}
public function addConsentGA(array $args) : void {
goto i_191;
O2xlg: $text_arr = explode(" <br> <br>", (string) self::$PluginHelper->locales[""ConsentGoogleAnalytics4""]);
goto NQsXw;
CGVgA: $item->setName("Google Analytics");
goto eRrPV;
zlwmr: $item->setPrivacyPolicy(""https://business.safety.google/privacy/"");
goto buBcd;
eRrPV: $item->setID(++$lastID);
goto RASg0;
fF5zi: $purpose = implode("" <br> <br>"", $text_arr);
goto OMy2b;
i_191: $lastID = $args[""items""]->reduce(static function ($result, Item $item) {
$value = $item->getID();
return $result === null || $value > $result ? $value : $result;
}
) ?? 0;
goto O2xlg;
buBcd: $item->setCompany(""Google Ireland Ltd, Gordon House, Barrow Street, Dublin 4,IE"");
goto x4Q2i;
OMy2b: $item = new Item();
goto CGVgA;
Rakl1: $item->setDescription(strval($desc));
goto eazLH;
eazLH: $item->setPurpose($purpose);
goto zlwmr;
RASg0: $item->setItemID(self::$PluginHelper->settings[""bUsebUseGoogleConsentMode""] === ""on"" ? "gc_analytics" : "gc_consent_analytics");
goto Rakl1;
x4Q2i: $args["items"]->push($item);
goto wvXWv;
NQsXw: $desc = array_shift($text_arr);
goto fF5zi;
wvXWv:
}
public function addConsentGTM(array $args) : void {
goto cUlHV;
AR8GG: $item->setID(++$lastID);
goto SRp28;
Z12Uh: $text_arr = explode("" <br> <br>"", (string) self::$PluginHelper->locales[""ConsentGoogleTagManager""]);
goto QgYrN;
i8whm: $args["items"]->push($item);
goto rYF00;
SRp28: $item->setItemID("gc_consent_google_tagmanager");
goto Vs2rI;
QgYrN: $desc = array_shift($text_arr);
goto Q68id;
cUlHV: $lastID = $args[""items""]->reduce(static function ($result, Item $item) {
$value = $item->getID();
return $result === null || $value > $result ? $value : $result;
}
) ?? 0;
goto Z12Uh;
A4jVE: $item->setPurpose($purpose);
goto kl6hi;
kl6hi: $item->setPrivacyPolicy(""https://business.safety.google/privacy/"");
goto H_0dh;
dG9b2: $item->setName("Google Tag Manager");
goto AR8GG;
jhtgX: $item = new Item();
goto dG9b2;
Vs2rI: $item->setDescription(strval($desc));
goto A4jVE;
Q68id: $purpose = implode(" <br> <br>", $text_arr);
goto jhtgX;
H_0dh: $item->setCompany("Google Ireland Ltd, Gordon House, Barrow Street, Dublin,IE");
goto i8whm;
rYF00:
}
public function addConsentGADS(array $args) : void {
goto ebYmt;
gHexK: $item->setPurpose($purpose);
goto ifQRM;
OlspI: $args["items"]->push($item);
goto yKpqZ;
p11Ea: $item->setItemID(self::$PluginHelper->settings[""bUsebUseGoogleConsentMode""] === "on" ? "gc_adwords" : ""gc_consent_adwords"");
goto MzsaR;
GxDa1: $item->setName(""Google Ads Conversion Tracking"");
goto lm9Ae;
MzsaR: $item->setDescription(strval($desc));
goto gHexK;
tzuwd: $item = new Item();
goto GxDa1;
ebYmt: $lastID = $args[""items""]->reduce(static function ($result, Item $item) {
$value = $item->getID();
return $result === null || $value > $result ? $value : $result;
}
) ?? 0;
goto e6tPb;
lm9Ae: $item->setID(++$lastID);
goto p11Ea;
ifQRM: $item->setPrivacyPolicy(""https://business.safety.google/privacy/"");
goto aM0ic;
e6tPb: $text_arr = explode("" <br> <br>"", (string) self::$PluginHelper->locales["ConsentGoogleAds"]);
goto Jaeg5;
hkK5U: $purpose = implode("" <br> <br>"", $text_arr);
goto tzuwd;
Jaeg5: $desc = array_shift($text_arr);
goto hkK5U;
aM0ic: $item->setCompany("Google Ireland Ltd, Gordon House, Barrow Street, Dublin 4,IE");
goto OlspI;
yKpqZ:
}
}
© 2023 Quttera Ltd. All rights reserved.