Version Description
- (Core) Added HTML entities to convert in JS.
Download this release
Release Info
Developer | tivnet |
Plugin | WPGlobus – Multilingual Everything! |
Version | 2.6.8 |
Comparing to | |
See all releases |
Code changes from version 2.6.7 to 2.6.8
- includes/class-wpglobus.php +1 -2
- languages/wpglobus.pot +3 -3
- readme.txt +3 -0
- trunk/configs/acf.json +12 -0
- trunk/configs/all-in-one-seo-pack.json +16 -0
- trunk/configs/elementor.json +5 -0
- trunk/configs/pods.json +12 -0
- trunk/configs/rank-math-seo.json +14 -0
- trunk/configs/woocommerce.json +8 -0
- trunk/configs/wpglobus-seo.json +5 -0
- trunk/configs/wpglobus.json +5 -0
- trunk/configs/yoast-seo.json +25 -0
- trunk/data/paid_plugins.json +78 -0
- trunk/data/wpglobus-product-info.json +1 -0
- trunk/flags/ad.alt.png +0 -0
- trunk/flags/ad.png +0 -0
- trunk/flags/ae.png +0 -0
- trunk/flags/af.png +0 -0
- trunk/flags/ag.png +0 -0
- trunk/flags/ai.alt.png +0 -0
- trunk/flags/ai.png +0 -0
- trunk/flags/al.png +0 -0
- trunk/flags/am.png +0 -0
- trunk/flags/an.png +0 -0
- trunk/flags/ao.png +0 -0
- trunk/flags/aq.png +0 -0
- trunk/flags/ar.alt.png +0 -0
- trunk/flags/ar.png +0 -0
- trunk/flags/argm.jpg +0 -0
- trunk/flags/arle.png +0 -0
- trunk/flags/as.png +0 -0
- trunk/flags/asl.gif +0 -0
- trunk/flags/at.alt.png +0 -0
- trunk/flags/at.png +0 -0
- trunk/flags/au.png +0 -0
- trunk/flags/aw.png +0 -0
- trunk/flags/ax.png +0 -0
- trunk/flags/az.png +0 -0
- trunk/flags/ba.png +0 -0
- trunk/flags/bb.png +0 -0
- trunk/flags/bd.png +0 -0
- trunk/flags/be.png +0 -0
- trunk/flags/bf.png +0 -0
- trunk/flags/bg.png +0 -0
- trunk/flags/bh.png +0 -0
- trunk/flags/bi.alt.png +0 -0
- trunk/flags/bi.png +0 -0
- trunk/flags/big/au.png +0 -0
- trunk/flags/big/br.png +0 -0
- trunk/flags/big/ca.png +0 -0
- trunk/flags/big/cn.png +0 -0
- trunk/flags/big/cy.png +0 -0
- trunk/flags/big/de.png +0 -0
- trunk/flags/big/dk.png +0 -0
- trunk/flags/big/es.alt.png +0 -0
- trunk/flags/big/es.png +0 -0
- trunk/flags/big/fi.png +0 -0
- trunk/flags/big/ir.png +0 -0
- trunk/flags/big/it.png +0 -0
- trunk/flags/big/ka.png +0 -0
- trunk/flags/big/ru.png +0 -0
- trunk/flags/big/uk.png +0 -0
- trunk/flags/big/us.png +0 -0
- trunk/flags/bj.png +0 -0
- trunk/flags/bm.png +0 -0
- trunk/flags/bn.png +0 -0
- trunk/flags/bo.png +0 -0
- trunk/flags/br.png +0 -0
- trunk/flags/bs.png +0 -0
- trunk/flags/bt.png +0 -0
- trunk/flags/bv.png +0 -0
- trunk/flags/bw.png +0 -0
- trunk/flags/by.png +0 -0
- trunk/flags/bz.png +0 -0
- trunk/flags/ca.alt.png +0 -0
- trunk/flags/ca.png +0 -0
- trunk/flags/cc.alt.png +0 -0
- trunk/flags/cc.png +0 -0
- trunk/flags/cd.png +0 -0
- trunk/flags/cf.png +0 -0
- trunk/flags/cg.png +0 -0
- trunk/flags/ch.png +0 -0
- trunk/flags/ci.png +0 -0
- trunk/flags/ck.png +0 -0
- trunk/flags/cl.png +0 -0
- trunk/flags/cm.png +0 -0
- trunk/flags/cn.png +0 -0
- trunk/flags/co.png +0 -0
- trunk/flags/cr.alt.png +0 -0
- trunk/flags/cr.png +0 -0
- trunk/flags/cs.png +0 -0
- trunk/flags/cu.png +0 -0
- trunk/flags/cv.png +0 -0
- trunk/flags/cx.png +0 -0
- trunk/flags/cy.png +0 -0
- trunk/flags/cz.png +0 -0
- trunk/flags/de.png +0 -0
- trunk/flags/dj.png +0 -0
- trunk/flags/dk.png +0 -0
- trunk/flags/dm.png +0 -0
- trunk/flags/do.png +0 -0
- trunk/flags/dz.png +0 -0
- trunk/flags/easy_to_read.png +0 -0
- trunk/flags/ec.alt.png +0 -0
- trunk/flags/ec.png +0 -0
- trunk/flags/ee.png +0 -0
- trunk/flags/eg.png +0 -0
- trunk/flags/eh.alt.png +0 -0
- trunk/flags/eh.png +0 -0
- trunk/flags/en.png +0 -0
- trunk/flags/eo.png +0 -0
- trunk/flags/er.png +0 -0
- trunk/flags/es.alt.png +0 -0
- trunk/flags/es.png +0 -0
- trunk/flags/et.alt.png +0 -0
- trunk/flags/et.png +0 -0
- trunk/flags/eu.png +0 -0
- trunk/flags/eus.png +0 -0
- trunk/flags/fi.png +0 -0
- trunk/flags/fj.png +0 -0
- trunk/flags/fk.png +0 -0
- trunk/flags/fm.png +0 -0
- trunk/flags/fo.png +0 -0
- trunk/flags/fr.png +0 -0
- trunk/flags/fr_CA.png +0 -0
- trunk/flags/ga.png +0 -0
- trunk/flags/galego.png +0 -0
- trunk/flags/gb.png +0 -0
- trunk/flags/gd.png +0 -0
- trunk/flags/ge.png +0 -0
- trunk/flags/gf.png +0 -0
- trunk/flags/gg.png +0 -0
- trunk/flags/gh.png +0 -0
- trunk/flags/gi.png +0 -0
- trunk/flags/gl.png +0 -0
- trunk/flags/gm.png +0 -0
- trunk/flags/gn.png +0 -0
- trunk/flags/gp.png +0 -0
- trunk/flags/gq.png +0 -0
- trunk/flags/gr.png +0 -0
- trunk/flags/gs.png +0 -0
- trunk/flags/gt.alt.png +0 -0
- trunk/flags/gt.png +0 -0
- trunk/flags/gu.png +0 -0
- trunk/flags/gw.png +0 -0
- trunk/flags/gy.png +0 -0
- trunk/flags/hk.png +0 -0
- trunk/flags/hm.png +0 -0
- trunk/flags/hn.png +0 -0
- trunk/flags/hr.png +0 -0
- trunk/flags/ht.alt.png +0 -0
- trunk/flags/ht.png +0 -0
- trunk/flags/hu.png +0 -0
- trunk/flags/id.png +0 -0
- trunk/flags/ie.png +0 -0
- trunk/flags/il.png +0 -0
- trunk/flags/im.png +0 -0
- trunk/flags/in.png +0 -0
- trunk/flags/io.png +0 -0
- trunk/flags/iq.png +0 -0
- trunk/flags/ir.png +0 -0
- trunk/flags/is.png +0 -0
- trunk/flags/it.png +0 -0
- trunk/flags/je.png +0 -0
- trunk/flags/jm.png +0 -0
- trunk/flags/jo.png +0 -0
- trunk/flags/jp.png +0 -0
- trunk/flags/ka.png +0 -0
- trunk/flags/ke.png +0 -0
- trunk/flags/kg.png +0 -0
- trunk/flags/kh.png +0 -0
- trunk/flags/ki.png +0 -0
- trunk/flags/km.png +0 -0
- trunk/flags/kn.png +0 -0
- trunk/flags/kp.png +0 -0
- trunk/flags/kr.png +0 -0
- trunk/flags/ku.png +0 -0
- trunk/flags/kw.png +0 -0
- trunk/flags/ky.png +0 -0
- trunk/flags/kz.png +0 -0
- trunk/flags/la.png +0 -0
- trunk/flags/lb.png +0 -0
- trunk/flags/lc.png +0 -0
- trunk/flags/li.png +0 -0
- trunk/flags/lk.png +0 -0
- trunk/flags/lr.png +0 -0
- trunk/flags/ls.png +0 -0
- trunk/flags/lt.png +0 -0
- trunk/flags/lu.png +0 -0
- trunk/flags/lv.png +0 -0
- trunk/flags/ly.png +0 -0
- trunk/flags/ma.png +0 -0
- trunk/flags/mc.png +0 -0
- trunk/flags/md.png +0 -0
- trunk/flags/me.png +0 -0
- trunk/flags/mg.png +0 -0
- trunk/flags/mh.png +0 -0
- trunk/flags/mk.png +0 -0
- trunk/flags/ml.png +0 -0
- trunk/flags/mm.png +0 -0
- trunk/flags/mn.png +0 -0
- trunk/flags/mo.png +0 -0
- trunk/flags/montenegro.gif +0 -0
- trunk/flags/mp.png +0 -0
- trunk/flags/mq.png +0 -0
- trunk/flags/mr.png +0 -0
- trunk/flags/ms.png +0 -0
- trunk/flags/mt.png +0 -0
- trunk/flags/mu.png +0 -0
- trunk/flags/mv.png +0 -0
- trunk/flags/mw.png +0 -0
- trunk/flags/mx.png +0 -0
- trunk/flags/my.png +0 -0
- trunk/flags/my_MM.png +0 -0
- trunk/flags/mz.png +0 -0
- trunk/flags/na.png +0 -0
- trunk/flags/nc.png +0 -0
- trunk/flags/ne.png +0 -0
- trunk/flags/nf.png +0 -0
- trunk/flags/ng.png +0 -0
- trunk/flags/ni.alt.png +0 -0
- trunk/flags/ni.png +0 -0
- trunk/flags/nl.png +0 -0
- trunk/flags/no.png +0 -0
- trunk/flags/np.png +0 -0
- trunk/flags/nr.png +0 -0
- trunk/flags/nu.png +0 -0
- trunk/flags/nz.png +0 -0
- trunk/flags/om.png +0 -0
- trunk/flags/pa.png +0 -0
- trunk/flags/pe.png +0 -0
- trunk/flags/pf.alt.png +0 -0
- trunk/flags/pf.png +0 -0
- trunk/flags/pg.png +0 -0
- trunk/flags/ph.png +0 -0
- trunk/flags/pk.png +0 -0
- trunk/flags/pl.png +0 -0
- trunk/flags/pm.png +0 -0
- trunk/flags/pn.png +0 -0
- trunk/flags/pr.png +0 -0
- trunk/flags/ps.png +0 -0
- trunk/flags/pt.png +0 -0
- trunk/flags/purple.globe.png +0 -0
- trunk/flags/pw.png +0 -0
- trunk/flags/py.png +0 -0
- trunk/flags/qa.png +0 -0
- trunk/flags/re.png +0 -0
- trunk/flags/ro.png +0 -0
- trunk/flags/rs.png +0 -0
- trunk/flags/ru.png +0 -0
- trunk/flags/rw.png +0 -0
- trunk/flags/sa.png +0 -0
- trunk/flags/sb.png +0 -0
- trunk/flags/sc.png +0 -0
- trunk/flags/sd.png +0 -0
- trunk/flags/se.png +0 -0
- trunk/flags/serbska_malka.png +0 -0
- trunk/flags/sg.png +0 -0
- trunk/flags/sh.png +0 -0
- trunk/flags/si.png +0 -0
- trunk/flags/sj.png +0 -0
- trunk/flags/sk.png +0 -0
- trunk/flags/sl.png +0 -0
- trunk/flags/sm.png +0 -0
- trunk/flags/sn.png +0 -0
- trunk/flags/so.png +0 -0
- trunk/flags/sr.png +0 -0
- trunk/flags/st.png +0 -0
- trunk/flags/sv.alt.png +0 -0
- trunk/flags/sv.png +0 -0
- trunk/flags/sy.png +0 -0
- trunk/flags/sz.png +0 -0
- trunk/flags/tc.png +0 -0
- trunk/flags/td.png +0 -0
- trunk/flags/tf.png +0 -0
- trunk/flags/tg.png +0 -0
- trunk/flags/th.png +0 -0
- trunk/flags/tj.png +0 -0
- trunk/flags/tk.png +0 -0
- trunk/flags/tl.png +0 -0
- trunk/flags/tm.png +0 -0
- trunk/flags/tn.png +0 -0
- trunk/flags/to.png +0 -0
- trunk/flags/tr.png +0 -0
- trunk/flags/tt.png +0 -0
- trunk/flags/tv.png +0 -0
- trunk/flags/tw.png +0 -0
- trunk/flags/tz.png +0 -0
- trunk/flags/ua.png +0 -0
- trunk/flags/ug.png +0 -0
- trunk/flags/uk.png +0 -0
- trunk/flags/um.png +0 -0
- trunk/flags/us-uk.png +0 -0
- trunk/flags/us.png +0 -0
- trunk/flags/uy.png +0 -0
- trunk/flags/uz.png +0 -0
- trunk/flags/va.png +0 -0
- trunk/flags/vc.png +0 -0
- trunk/flags/ve.png +0 -0
- trunk/flags/vg.png +0 -0
- trunk/flags/vi.png +0 -0
- trunk/flags/vn.png +0 -0
- trunk/flags/vu.png +0 -0
- trunk/flags/wf.alt.png +0 -0
- trunk/flags/wf.png +0 -0
- trunk/flags/ws.png +0 -0
- trunk/flags/ye.png +0 -0
- trunk/flags/yt.png +0 -0
- trunk/flags/yu.png +0 -0
- trunk/flags/za.png +0 -0
- trunk/flags/zm.png +0 -0
- trunk/flags/zw.png +0 -0
- trunk/flags/zz.png +0 -0
- trunk/includes/admin/central/class-wpglobus-admin-central.php +172 -0
- trunk/includes/admin/class-wpglobus-about.php +178 -0
- trunk/includes/admin/class-wpglobus-admin-bar-menu.php +213 -0
- trunk/includes/admin/class-wpglobus-admin-menu.php +34 -0
- trunk/includes/admin/class-wpglobus-admin-page.php +208 -0
- trunk/includes/admin/class-wpglobus-admin-post.php +57 -0
- trunk/includes/admin/class-wpglobus-clean.php +743 -0
- trunk/includes/admin/class-wpglobus-customize-options.php +1588 -0
- trunk/includes/admin/class-wpglobus-dashboard-news.php +67 -0
- trunk/includes/admin/class-wpglobus-language-edit-request.php +255 -0
- trunk/includes/admin/class-wpglobus-language-edit.php +494 -0
- trunk/includes/admin/class-wpglobus-plugin-install.php +367 -0
- trunk/includes/admin/customize/class-wpglobus-customize-themes.php +88 -0
- trunk/includes/admin/customize/class-wpglobus-customize140.php +282 -0
- trunk/includes/admin/customize/class-wpglobus-customize170.php +300 -0
- trunk/includes/admin/customize/class-wpglobus-customize190.php +555 -0
- trunk/includes/admin/customize/wpglobus-customize-filters.php +87 -0
- trunk/includes/admin/customize/wpglobus-customize.php +22 -0
- trunk/includes/admin/debug/class-wpglobus-admin-debug.php +366 -0
- trunk/includes/admin/helpdesk/class-wpglobus-admin-helpdesk.php +292 -0
- trunk/includes/admin/helpdesk/wpglobus-admin-helpdesk-page.php +165 -0
- trunk/includes/admin/media/class-wpglobus-media.php +413 -0
- trunk/includes/admin/media/wpglobus-media.php +38 -0
- trunk/includes/admin/meta/class-wpglobus-meta.php +545 -0
- trunk/includes/admin/recommendations/class-wpglobus-admin-recommendations.php +309 -0
- trunk/includes/admin/register-post-types/class-wpglobus-register-post-types.php +147 -0
- trunk/includes/admin/wpglobus-admin.php +38 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-49.js +348 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-49.min.js +1 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-51.js +362 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-51.min.js +1 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-55.js +404 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-55.min.js +1 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-56.js +403 -0
- trunk/includes/builders/assets/wpglobus-admin-builder-56.min.js +1 -0
- trunk/includes/builders/class-wpglobus-builder-update-post.php +149 -0
- trunk/includes/builders/class-wpglobus-builder.php +424 -0
- trunk/includes/builders/class-wpglobus-builders.php +1627 -0
- trunk/includes/builders/class-wpglobus-config-builder.php +563 -0
- trunk/includes/builders/elementor/class-wpglobus-elementor-front.php +516 -0
- trunk/includes/builders/elementor/class-wpglobus-elementor-update-post.php +118 -0
- trunk/includes/builders/elementor/class-wpglobus-elementor.php +687 -0
- trunk/includes/builders/elementor/readme.txt +8 -0
- trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css +3 -0
- trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css.map +1 -0
- trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.scss +45 -0
- trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-switcher.css +116 -0
- trunk/includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css +3 -0
- trunk/includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css.map +1 -0
- trunk/includes/builders/gutenberg/assets/css/wpglobus-gutenberg.scss +30 -0
- trunk/includes/builders/gutenberg/assets/js/dist/wpglobus-block-editor.js +607 -0
- trunk/includes/builders/gutenberg/assets/js/dist/wpglobus-block-editor.min.js +1 -0
- trunk/includes/builders/gutenberg/assets/js/wpglobus-gutenberg.js +632 -0
- trunk/includes/builders/gutenberg/assets/js/wpglobus-gutenberg.min.js +1 -0
- trunk/includes/builders/gutenberg/class-wpglobus-gutenberg-update-post.php +304 -0
- trunk/includes/builders/gutenberg/class-wpglobus-gutenberg.php +601 -0
- trunk/includes/builders/js_composer/class-wpglobus-js_composer-update-post.php +119 -0
- trunk/includes/builders/js_composer/class-wpglobus-js_composer.php +26 -0
- trunk/includes/builders/pods/class-wpglobus-builder-pods.php +110 -0
- trunk/includes/builders/pods/class-wpglobus-pods-update-post.php +120 -0
- trunk/includes/builders/pods/class-wpglobus-pods.php +31 -0
- trunk/includes/builders/rank_math_seo/class-wpglobus-builder-rank_math_seo.php +75 -0
- trunk/includes/builders/rank_math_seo/class-wpglobus-rank_math_seo-functions.php +168 -0
- trunk/includes/builders/rank_math_seo/class-wpglobus-rank_math_seo-update-post.php +40 -0
- trunk/includes/builders/rank_math_seo/class-wpglobus-rank_math_seo.php +73 -0
- trunk/includes/builders/yoast_seo/class-wpglobus-yoast_seo-update-post.php +259 -0
- trunk/includes/builders/yoast_seo/class-wpglobus-yoast_seo.php +145 -0
- trunk/includes/class-wpglobus-config-vendor.php +437 -0
- trunk/includes/class-wpglobus-config.php +967 -0
- trunk/includes/class-wpglobus-core.php +433 -0
- trunk/includes/class-wpglobus-filters.php +1295 -0
- trunk/includes/class-wpglobus-plugin.php +96 -0
- trunk/includes/class-wpglobus-post-types.php +176 -0
- trunk/includes/class-wpglobus-redirect.php +99 -0
- trunk/includes/class-wpglobus-rest-api.php +130 -0
- trunk/includes/class-wpglobus-utils.php +505 -0
includes/class-wpglobus.php
CHANGED
@@ -4163,14 +4163,13 @@ class WPGlobus {
|
|
4163 |
|
4164 |
if ( ! empty( $js ) ) {
|
4165 |
$js = wp_kses( $js, array() );
|
4166 |
-
$js = str_replace( array( '>', '<' ), array( '>', '<' ), $js );
|
4167 |
?>
|
4168 |
<script type="text/javascript">
|
4169 |
<?php echo $js; // phpcs:ignore WordPress.XSS.EscapeOutput ?>
|
4170 |
</script>
|
4171 |
<?php
|
4172 |
}
|
4173 |
-
|
4174 |
}
|
4175 |
|
4176 |
/**
|
4163 |
|
4164 |
if ( ! empty( $js ) ) {
|
4165 |
$js = wp_kses( $js, array() );
|
4166 |
+
$js = str_replace( array( '>', '<', '"', ''' ), array( '>', '<', '"', "'" ), $js );
|
4167 |
?>
|
4168 |
<script type="text/javascript">
|
4169 |
<?php echo $js; // phpcs:ignore WordPress.XSS.EscapeOutput ?>
|
4170 |
</script>
|
4171 |
<?php
|
4172 |
}
|
|
|
4173 |
}
|
4174 |
|
4175 |
/**
|
languages/wpglobus.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C) 2021 WPGlobus 2.6.
|
2 |
-
# This file is distributed under the same license as the WPGlobus 2.6.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WPGlobus 2.6.
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
1 |
+
# Copyright (C) 2021 WPGlobus 2.6.8
|
2 |
+
# This file is distributed under the same license as the WPGlobus 2.6.8 package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WPGlobus 2.6.8\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
readme.txt
CHANGED
@@ -220,6 +220,9 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
|
|
220 |
|
221 |
== Changelog ==
|
222 |
|
|
|
|
|
|
|
223 |
= 2.6.7 =
|
224 |
* (Core/JS) Fixed `Uncaught TypeError: Cannot read property nodeName of null`.
|
225 |
* (Core/JS) Tweak: Frontend cookies set with `SameSite=strict` attribute.
|
220 |
|
221 |
== Changelog ==
|
222 |
|
223 |
+
= 2.6.8 =
|
224 |
+
* (Core) Added HTML entities to convert in JS.
|
225 |
+
|
226 |
= 2.6.7 =
|
227 |
* (Core/JS) Fixed `Uncaught TypeError: Cannot read property nodeName of null`.
|
228 |
* (Core/JS) Tweak: Frontend cookies set with `SameSite=strict` attribute.
|
trunk/configs/acf.json
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"*":{"file":"vendor/acf/class-wpglobus-acf.php","class":"WPGlobus_Acf_2"}
|
4 |
+
},
|
5 |
+
"post_ml_fields": {
|
6 |
+
"*":{"file":"vendor/acf/class-wpglobus-acf.php","class":"WPGlobus_Acf_2"}
|
7 |
+
},
|
8 |
+
"wp_options": {
|
9 |
+
"blogname": {},
|
10 |
+
"blogdescription": null
|
11 |
+
}
|
12 |
+
}
|
trunk/configs/all-in-one-seo-pack.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"_aioseop_title": {},
|
4 |
+
"_aioseop_description": {},
|
5 |
+
"_aioseop_keywords": {}
|
6 |
+
},
|
7 |
+
"post_ml_fields": {
|
8 |
+
"aiosp_title": {},
|
9 |
+
"aiosp_description": {},
|
10 |
+
"aiosp_keywords": {}
|
11 |
+
},
|
12 |
+
"wp_options": {
|
13 |
+
"blogname": {},
|
14 |
+
"blogdescription": null
|
15 |
+
}
|
16 |
+
}
|
trunk/configs/elementor.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"_elementor_data": {}
|
4 |
+
}
|
5 |
+
}
|
trunk/configs/pods.json
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"*":{"file":"vendor/pods/class-wpglobus-vendor-pods.php","class":"WPGlobus_Vendor_Pods"}
|
4 |
+
},
|
5 |
+
"post_ml_fields": {
|
6 |
+
"*":{"file":"vendor/pods/class-wpglobus-vendor-pods.php","class":"WPGlobus_Vendor_Pods"}
|
7 |
+
},
|
8 |
+
"wp_options": {
|
9 |
+
"blogname": {},
|
10 |
+
"blogdescription": null
|
11 |
+
}
|
12 |
+
}
|
trunk/configs/rank-math-seo.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"*":{"file":"vendor/rank-math-seo/class-wpglobus-vendor-rank_math_seo.php","class":"WPGlobus_Vendor_RankMathSEO"}
|
4 |
+
},
|
5 |
+
"post_ml_fields": {
|
6 |
+
"rank_math_title": {},
|
7 |
+
"rank_math_description": {},
|
8 |
+
"rank_math_focus_keyword": {}
|
9 |
+
},
|
10 |
+
"wp_options": {
|
11 |
+
"blogname": {},
|
12 |
+
"blogdescription": null
|
13 |
+
}
|
14 |
+
}
|
trunk/configs/woocommerce.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"_purchase_note": {}
|
4 |
+
},
|
5 |
+
"post_ml_fields": {
|
6 |
+
"_purchase_note": {}
|
7 |
+
}
|
8 |
+
}
|
trunk/configs/wpglobus-seo.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"_wpglobus_seo_test": {}
|
4 |
+
}
|
5 |
+
}
|
trunk/configs/wpglobus.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"_wpglobus_seo_test": {}
|
4 |
+
}
|
5 |
+
}
|
trunk/configs/yoast-seo.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"post_meta_fields": {
|
3 |
+
"_yoast_wpseo_title": {},
|
4 |
+
"_yoast_wpseo_metadesc": {},
|
5 |
+
"_yoast_wpseo_focuskw": {},
|
6 |
+
"_yoast_wpseo_focuskw_text_input": null,
|
7 |
+
"_yoast_wpseo_keywordsynonyms": {},
|
8 |
+
"_yoast_wpseo_focuskeywords": {},
|
9 |
+
"_yoast_wpseo_opengraph-title": {},
|
10 |
+
"_yoast_wpseo_opengraph-description": {},
|
11 |
+
"_yoast_wpseo_opengraph-image": {},
|
12 |
+
"_yoast_wpseo_opengraph-image-id": {},
|
13 |
+
"_yoast_wpseo_twitter-title": {},
|
14 |
+
"_yoast_wpseo_twitter-description": {},
|
15 |
+
"_yoast_wpseo_twitter-image": {},
|
16 |
+
"_yoast_wpseo_twitter-image-id": {}
|
17 |
+
},
|
18 |
+
"post_ml_fields": {
|
19 |
+
"focus-keyword-input-metabox": {}
|
20 |
+
},
|
21 |
+
"wp_options": {
|
22 |
+
"blogname": {},
|
23 |
+
"blogdescription": null
|
24 |
+
}
|
25 |
+
}
|
trunk/data/paid_plugins.json
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"woocommerce-wpglobus": {
|
3 |
+
"slug": "woocommerce-wpglobus",
|
4 |
+
"loader": "woocommerce-wpglobus.php",
|
5 |
+
"image_file": "woocommerce-wpglobus-logo-300x300.png",
|
6 |
+
"order": 120
|
7 |
+
},
|
8 |
+
"wpglobus-plus": {
|
9 |
+
"slug": "wpglobus-plus",
|
10 |
+
"loader": "wpglobus-plus.php",
|
11 |
+
"image_file": "wpglobus-plus-logo-300x300.png",
|
12 |
+
"order": 110
|
13 |
+
},
|
14 |
+
"wpglobus-revslider": {
|
15 |
+
"slug": "wpglobus-revslider",
|
16 |
+
"loader": "wpglobus-revslider.php",
|
17 |
+
"product_slug": "wpglobus-for-slider-revolution",
|
18 |
+
"image_file": "wpglobus-revslider-logo-400x400.png",
|
19 |
+
"order": 100,
|
20 |
+
"available": false
|
21 |
+
},
|
22 |
+
"wpglobus-language-widgets": {
|
23 |
+
"slug": "wpglobus-language-widgets",
|
24 |
+
"loader": "wpglobus-language-widgets.php",
|
25 |
+
"image_file": "wpglobus-lw-logo-400x400.png",
|
26 |
+
"order": 90
|
27 |
+
},
|
28 |
+
"wpglobus-menu-visibility": {
|
29 |
+
"slug": "wpglobus-menu-visibility",
|
30 |
+
"loader": "wpglobus-menu-visibility.php",
|
31 |
+
"image_file": "wpglobus-menu-visibility-logo.png",
|
32 |
+
"order": 80
|
33 |
+
},
|
34 |
+
"wpglobus-header-images": {
|
35 |
+
"slug": "wpglobus-header-images",
|
36 |
+
"loader": "wpglobus-header-images.php",
|
37 |
+
"image_file": "wpglobus-hi-logo-400x400.png",
|
38 |
+
"order": 70
|
39 |
+
},
|
40 |
+
"wpglobus-mobile-menu": {
|
41 |
+
"slug": "wpglobus-mobile-menu",
|
42 |
+
"loader": "wpglobus-mobile-menu.php",
|
43 |
+
"image_file": "wpglobus-mobile-menu-logo-400x400.png",
|
44 |
+
"order": 60
|
45 |
+
},
|
46 |
+
"wpglobus-for-ultimate-member": {
|
47 |
+
"slug": "wpglobus-for-ultimate-member",
|
48 |
+
"loader": "wpglobus-for-ultimate-member.php",
|
49 |
+
"image_file": "https://wpglobus.com/app/uploads/2021/01/wpglobus-for-um-logo-400x400-1.png",
|
50 |
+
"order": 50
|
51 |
+
},
|
52 |
+
"wpglobus-multilingual-popups": {
|
53 |
+
"slug": "wpglobus-multilingual-popups",
|
54 |
+
"loader": "wpglobus-multilingual-popups.php",
|
55 |
+
"image_file": "https://wpglobus.com/app/uploads/2021/02/wpglobus-ml-pop-400x400-1.png",
|
56 |
+
"order": 40
|
57 |
+
},
|
58 |
+
"wpglobus-multilingual-notices": {
|
59 |
+
"slug": "wpglobus-multilingual-notices",
|
60 |
+
"loader": "wpglobus-multilingual-notices.php",
|
61 |
+
"image_file": "wpglobus-multilingual-notices-logo.png",
|
62 |
+
"order": 30
|
63 |
+
},
|
64 |
+
"wpglobus-for-bridge-theme": {
|
65 |
+
"slug": "wpglobus-for-bridge-theme",
|
66 |
+
"loader": "wpglobus-for-bridge-theme.php",
|
67 |
+
"product_slug": "wpglobus-for-bridge-theme",
|
68 |
+
"image_file": "wpglobus-for-bridge-theme-logo-400x400.png",
|
69 |
+
"order": 20
|
70 |
+
},
|
71 |
+
"woocommerce-nets-netaxept": {
|
72 |
+
"slug": "woocommerce-nets-netaxept",
|
73 |
+
"loader": "woocommerce-nets-netaxept.php",
|
74 |
+
"product_slug": "multilingual-woocommerce-nets-netaxept",
|
75 |
+
"image_file": "woocommerce-wpglobus-netaxeptcw-logo-300x300.jpg",
|
76 |
+
"order": 10
|
77 |
+
}
|
78 |
+
}
|
trunk/data/wpglobus-product-info.json
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"4.3.0","_api_tested_up_to":"5.6"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.3.0","_api_tested_up_to":"5.5"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.6.0"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"2.5.0","_api_tested_up_to":"5.6"},"wpglobus-multilingual-popups":{"title":"{:en}WPGlobus Multilingual Popups{:}{:ru}WPGlobus Multilingual Popups{:}","_api_new_version":"1.3.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.5.7","_api_tested_up_to":"5.6"}}
|
trunk/flags/ad.alt.png
ADDED
Binary file
|
trunk/flags/ad.png
ADDED
Binary file
|
trunk/flags/ae.png
ADDED
Binary file
|
trunk/flags/af.png
ADDED
Binary file
|
trunk/flags/ag.png
ADDED
Binary file
|
trunk/flags/ai.alt.png
ADDED
Binary file
|
trunk/flags/ai.png
ADDED
Binary file
|
trunk/flags/al.png
ADDED
Binary file
|
trunk/flags/am.png
ADDED
Binary file
|
trunk/flags/an.png
ADDED
Binary file
|
trunk/flags/ao.png
ADDED
Binary file
|
trunk/flags/aq.png
ADDED
Binary file
|
trunk/flags/ar.alt.png
ADDED
Binary file
|
trunk/flags/ar.png
ADDED
Binary file
|
trunk/flags/argm.jpg
ADDED
Binary file
|
trunk/flags/arle.png
ADDED
Binary file
|
trunk/flags/as.png
ADDED
Binary file
|
trunk/flags/asl.gif
ADDED
Binary file
|
trunk/flags/at.alt.png
ADDED
Binary file
|
trunk/flags/at.png
ADDED
Binary file
|
trunk/flags/au.png
ADDED
Binary file
|
trunk/flags/aw.png
ADDED
Binary file
|
trunk/flags/ax.png
ADDED
Binary file
|
trunk/flags/az.png
ADDED
Binary file
|
trunk/flags/ba.png
ADDED
Binary file
|
trunk/flags/bb.png
ADDED
Binary file
|
trunk/flags/bd.png
ADDED
Binary file
|
trunk/flags/be.png
ADDED
Binary file
|
trunk/flags/bf.png
ADDED
Binary file
|
trunk/flags/bg.png
ADDED
Binary file
|
trunk/flags/bh.png
ADDED
Binary file
|
trunk/flags/bi.alt.png
ADDED
Binary file
|
trunk/flags/bi.png
ADDED
Binary file
|
trunk/flags/big/au.png
ADDED
Binary file
|
trunk/flags/big/br.png
ADDED
Binary file
|
trunk/flags/big/ca.png
ADDED
Binary file
|
trunk/flags/big/cn.png
ADDED
Binary file
|
trunk/flags/big/cy.png
ADDED
Binary file
|
trunk/flags/big/de.png
ADDED
Binary file
|
trunk/flags/big/dk.png
ADDED
Binary file
|
trunk/flags/big/es.alt.png
ADDED
Binary file
|
trunk/flags/big/es.png
ADDED
Binary file
|
trunk/flags/big/fi.png
ADDED
Binary file
|
trunk/flags/big/ir.png
ADDED
Binary file
|
trunk/flags/big/it.png
ADDED
Binary file
|
trunk/flags/big/ka.png
ADDED
Binary file
|
trunk/flags/big/ru.png
ADDED
Binary file
|
trunk/flags/big/uk.png
ADDED
Binary file
|
trunk/flags/big/us.png
ADDED
Binary file
|
trunk/flags/bj.png
ADDED
Binary file
|
trunk/flags/bm.png
ADDED
Binary file
|
trunk/flags/bn.png
ADDED
Binary file
|
trunk/flags/bo.png
ADDED
Binary file
|
trunk/flags/br.png
ADDED
Binary file
|
trunk/flags/bs.png
ADDED
Binary file
|
trunk/flags/bt.png
ADDED
Binary file
|
trunk/flags/bv.png
ADDED
Binary file
|
trunk/flags/bw.png
ADDED
Binary file
|
trunk/flags/by.png
ADDED
Binary file
|
trunk/flags/bz.png
ADDED
Binary file
|
trunk/flags/ca.alt.png
ADDED
Binary file
|
trunk/flags/ca.png
ADDED
Binary file
|
trunk/flags/cc.alt.png
ADDED
Binary file
|
trunk/flags/cc.png
ADDED
Binary file
|
trunk/flags/cd.png
ADDED
Binary file
|
trunk/flags/cf.png
ADDED
Binary file
|
trunk/flags/cg.png
ADDED
Binary file
|
trunk/flags/ch.png
ADDED
Binary file
|
trunk/flags/ci.png
ADDED
Binary file
|
trunk/flags/ck.png
ADDED
Binary file
|
trunk/flags/cl.png
ADDED
Binary file
|
trunk/flags/cm.png
ADDED
Binary file
|
trunk/flags/cn.png
ADDED
Binary file
|
trunk/flags/co.png
ADDED
Binary file
|
trunk/flags/cr.alt.png
ADDED
Binary file
|
trunk/flags/cr.png
ADDED
Binary file
|
trunk/flags/cs.png
ADDED
Binary file
|
trunk/flags/cu.png
ADDED
Binary file
|
trunk/flags/cv.png
ADDED
Binary file
|
trunk/flags/cx.png
ADDED
Binary file
|
trunk/flags/cy.png
ADDED
Binary file
|
trunk/flags/cz.png
ADDED
Binary file
|
trunk/flags/de.png
ADDED
Binary file
|
trunk/flags/dj.png
ADDED
Binary file
|
trunk/flags/dk.png
ADDED
Binary file
|
trunk/flags/dm.png
ADDED
Binary file
|
trunk/flags/do.png
ADDED
Binary file
|
trunk/flags/dz.png
ADDED
Binary file
|
trunk/flags/easy_to_read.png
ADDED
Binary file
|
trunk/flags/ec.alt.png
ADDED
Binary file
|
trunk/flags/ec.png
ADDED
Binary file
|
trunk/flags/ee.png
ADDED
Binary file
|
trunk/flags/eg.png
ADDED
Binary file
|
trunk/flags/eh.alt.png
ADDED
Binary file
|
trunk/flags/eh.png
ADDED
Binary file
|
trunk/flags/en.png
ADDED
Binary file
|
trunk/flags/eo.png
ADDED
Binary file
|
trunk/flags/er.png
ADDED
Binary file
|
trunk/flags/es.alt.png
ADDED
Binary file
|
trunk/flags/es.png
ADDED
Binary file
|
trunk/flags/et.alt.png
ADDED
Binary file
|
trunk/flags/et.png
ADDED
Binary file
|
trunk/flags/eu.png
ADDED
Binary file
|
trunk/flags/eus.png
ADDED
Binary file
|
trunk/flags/fi.png
ADDED
Binary file
|
trunk/flags/fj.png
ADDED
Binary file
|
trunk/flags/fk.png
ADDED
Binary file
|
trunk/flags/fm.png
ADDED
Binary file
|
trunk/flags/fo.png
ADDED
Binary file
|
trunk/flags/fr.png
ADDED
Binary file
|
trunk/flags/fr_CA.png
ADDED
Binary file
|
trunk/flags/ga.png
ADDED
Binary file
|
trunk/flags/galego.png
ADDED
Binary file
|
trunk/flags/gb.png
ADDED
Binary file
|
trunk/flags/gd.png
ADDED
Binary file
|
trunk/flags/ge.png
ADDED
Binary file
|
trunk/flags/gf.png
ADDED
Binary file
|
trunk/flags/gg.png
ADDED
Binary file
|
trunk/flags/gh.png
ADDED
Binary file
|
trunk/flags/gi.png
ADDED
Binary file
|
trunk/flags/gl.png
ADDED
Binary file
|
trunk/flags/gm.png
ADDED
Binary file
|
trunk/flags/gn.png
ADDED
Binary file
|
trunk/flags/gp.png
ADDED
Binary file
|
trunk/flags/gq.png
ADDED
Binary file
|
trunk/flags/gr.png
ADDED
Binary file
|
trunk/flags/gs.png
ADDED
Binary file
|
trunk/flags/gt.alt.png
ADDED
Binary file
|
trunk/flags/gt.png
ADDED
Binary file
|
trunk/flags/gu.png
ADDED
Binary file
|
trunk/flags/gw.png
ADDED
Binary file
|
trunk/flags/gy.png
ADDED
Binary file
|
trunk/flags/hk.png
ADDED
Binary file
|
trunk/flags/hm.png
ADDED
Binary file
|
trunk/flags/hn.png
ADDED
Binary file
|
trunk/flags/hr.png
ADDED
Binary file
|
trunk/flags/ht.alt.png
ADDED
Binary file
|
trunk/flags/ht.png
ADDED
Binary file
|
trunk/flags/hu.png
ADDED
Binary file
|
trunk/flags/id.png
ADDED
Binary file
|
trunk/flags/ie.png
ADDED
Binary file
|
trunk/flags/il.png
ADDED
Binary file
|
trunk/flags/im.png
ADDED
Binary file
|
trunk/flags/in.png
ADDED
Binary file
|
trunk/flags/io.png
ADDED
Binary file
|
trunk/flags/iq.png
ADDED
Binary file
|
trunk/flags/ir.png
ADDED
Binary file
|
trunk/flags/is.png
ADDED
Binary file
|
trunk/flags/it.png
ADDED
Binary file
|
trunk/flags/je.png
ADDED
Binary file
|
trunk/flags/jm.png
ADDED
Binary file
|
trunk/flags/jo.png
ADDED
Binary file
|
trunk/flags/jp.png
ADDED
Binary file
|
trunk/flags/ka.png
ADDED
Binary file
|
trunk/flags/ke.png
ADDED
Binary file
|
trunk/flags/kg.png
ADDED
Binary file
|
trunk/flags/kh.png
ADDED
Binary file
|
trunk/flags/ki.png
ADDED
Binary file
|
trunk/flags/km.png
ADDED
Binary file
|
trunk/flags/kn.png
ADDED
Binary file
|
trunk/flags/kp.png
ADDED
Binary file
|
trunk/flags/kr.png
ADDED
Binary file
|
trunk/flags/ku.png
ADDED
Binary file
|
trunk/flags/kw.png
ADDED
Binary file
|
trunk/flags/ky.png
ADDED
Binary file
|
trunk/flags/kz.png
ADDED
Binary file
|
trunk/flags/la.png
ADDED
Binary file
|
trunk/flags/lb.png
ADDED
Binary file
|
trunk/flags/lc.png
ADDED
Binary file
|
trunk/flags/li.png
ADDED
Binary file
|
trunk/flags/lk.png
ADDED
Binary file
|
trunk/flags/lr.png
ADDED
Binary file
|
trunk/flags/ls.png
ADDED
Binary file
|
trunk/flags/lt.png
ADDED
Binary file
|
trunk/flags/lu.png
ADDED
Binary file
|
trunk/flags/lv.png
ADDED
Binary file
|
trunk/flags/ly.png
ADDED
Binary file
|
trunk/flags/ma.png
ADDED
Binary file
|
trunk/flags/mc.png
ADDED
Binary file
|
trunk/flags/md.png
ADDED
Binary file
|
trunk/flags/me.png
ADDED
Binary file
|
trunk/flags/mg.png
ADDED
Binary file
|
trunk/flags/mh.png
ADDED
Binary file
|
trunk/flags/mk.png
ADDED
Binary file
|
trunk/flags/ml.png
ADDED
Binary file
|
trunk/flags/mm.png
ADDED
Binary file
|
trunk/flags/mn.png
ADDED
Binary file
|
trunk/flags/mo.png
ADDED
Binary file
|
trunk/flags/montenegro.gif
ADDED
Binary file
|
trunk/flags/mp.png
ADDED
Binary file
|
trunk/flags/mq.png
ADDED
Binary file
|
trunk/flags/mr.png
ADDED
Binary file
|
trunk/flags/ms.png
ADDED
Binary file
|
trunk/flags/mt.png
ADDED
Binary file
|
trunk/flags/mu.png
ADDED
Binary file
|
trunk/flags/mv.png
ADDED
Binary file
|
trunk/flags/mw.png
ADDED
Binary file
|
trunk/flags/mx.png
ADDED
Binary file
|
trunk/flags/my.png
ADDED
Binary file
|
trunk/flags/my_MM.png
ADDED
Binary file
|
trunk/flags/mz.png
ADDED
Binary file
|
trunk/flags/na.png
ADDED
Binary file
|
trunk/flags/nc.png
ADDED
Binary file
|
trunk/flags/ne.png
ADDED
Binary file
|
trunk/flags/nf.png
ADDED
Binary file
|
trunk/flags/ng.png
ADDED
Binary file
|
trunk/flags/ni.alt.png
ADDED
Binary file
|
trunk/flags/ni.png
ADDED
Binary file
|
trunk/flags/nl.png
ADDED
Binary file
|
trunk/flags/no.png
ADDED
Binary file
|
trunk/flags/np.png
ADDED
Binary file
|
trunk/flags/nr.png
ADDED
Binary file
|
trunk/flags/nu.png
ADDED
Binary file
|
trunk/flags/nz.png
ADDED
Binary file
|
trunk/flags/om.png
ADDED
Binary file
|
trunk/flags/pa.png
ADDED
Binary file
|
trunk/flags/pe.png
ADDED
Binary file
|
trunk/flags/pf.alt.png
ADDED
Binary file
|
trunk/flags/pf.png
ADDED
Binary file
|
trunk/flags/pg.png
ADDED
Binary file
|
trunk/flags/ph.png
ADDED
Binary file
|
trunk/flags/pk.png
ADDED
Binary file
|
trunk/flags/pl.png
ADDED
Binary file
|
trunk/flags/pm.png
ADDED
Binary file
|
trunk/flags/pn.png
ADDED
Binary file
|
trunk/flags/pr.png
ADDED
Binary file
|
trunk/flags/ps.png
ADDED
Binary file
|
trunk/flags/pt.png
ADDED
Binary file
|
trunk/flags/purple.globe.png
ADDED
Binary file
|
trunk/flags/pw.png
ADDED
Binary file
|
trunk/flags/py.png
ADDED
Binary file
|
trunk/flags/qa.png
ADDED
Binary file
|
trunk/flags/re.png
ADDED
Binary file
|
trunk/flags/ro.png
ADDED
Binary file
|
trunk/flags/rs.png
ADDED
Binary file
|
trunk/flags/ru.png
ADDED
Binary file
|
trunk/flags/rw.png
ADDED
Binary file
|
trunk/flags/sa.png
ADDED
Binary file
|
trunk/flags/sb.png
ADDED
Binary file
|
trunk/flags/sc.png
ADDED
Binary file
|
trunk/flags/sd.png
ADDED
Binary file
|
trunk/flags/se.png
ADDED
Binary file
|
trunk/flags/serbska_malka.png
ADDED
Binary file
|
trunk/flags/sg.png
ADDED
Binary file
|
trunk/flags/sh.png
ADDED
Binary file
|
trunk/flags/si.png
ADDED
Binary file
|
trunk/flags/sj.png
ADDED
Binary file
|
trunk/flags/sk.png
ADDED
Binary file
|
trunk/flags/sl.png
ADDED
Binary file
|
trunk/flags/sm.png
ADDED
Binary file
|
trunk/flags/sn.png
ADDED
Binary file
|
trunk/flags/so.png
ADDED
Binary file
|
trunk/flags/sr.png
ADDED
Binary file
|
trunk/flags/st.png
ADDED
Binary file
|
trunk/flags/sv.alt.png
ADDED
Binary file
|
trunk/flags/sv.png
ADDED
Binary file
|
trunk/flags/sy.png
ADDED
Binary file
|
trunk/flags/sz.png
ADDED
Binary file
|
trunk/flags/tc.png
ADDED
Binary file
|
trunk/flags/td.png
ADDED
Binary file
|
trunk/flags/tf.png
ADDED
Binary file
|
trunk/flags/tg.png
ADDED
Binary file
|
trunk/flags/th.png
ADDED
Binary file
|
trunk/flags/tj.png
ADDED
Binary file
|
trunk/flags/tk.png
ADDED
Binary file
|
trunk/flags/tl.png
ADDED
Binary file
|
trunk/flags/tm.png
ADDED
Binary file
|
trunk/flags/tn.png
ADDED
Binary file
|
trunk/flags/to.png
ADDED
Binary file
|
trunk/flags/tr.png
ADDED
Binary file
|
trunk/flags/tt.png
ADDED
Binary file
|
trunk/flags/tv.png
ADDED
Binary file
|
trunk/flags/tw.png
ADDED
Binary file
|
trunk/flags/tz.png
ADDED
Binary file
|
trunk/flags/ua.png
ADDED
Binary file
|
trunk/flags/ug.png
ADDED
Binary file
|
trunk/flags/uk.png
ADDED
Binary file
|
trunk/flags/um.png
ADDED
Binary file
|
trunk/flags/us-uk.png
ADDED
Binary file
|
trunk/flags/us.png
ADDED
Binary file
|
trunk/flags/uy.png
ADDED
Binary file
|
trunk/flags/uz.png
ADDED
Binary file
|
trunk/flags/va.png
ADDED
Binary file
|
trunk/flags/vc.png
ADDED
Binary file
|
trunk/flags/ve.png
ADDED
Binary file
|
trunk/flags/vg.png
ADDED
Binary file
|
trunk/flags/vi.png
ADDED
Binary file
|
trunk/flags/vn.png
ADDED
Binary file
|
trunk/flags/vu.png
ADDED
Binary file
|
trunk/flags/wf.alt.png
ADDED
Binary file
|
trunk/flags/wf.png
ADDED
Binary file
|
trunk/flags/ws.png
ADDED
Binary file
|
trunk/flags/ye.png
ADDED
Binary file
|
trunk/flags/yt.png
ADDED
Binary file
|
trunk/flags/yu.png
ADDED
Binary file
|
trunk/flags/za.png
ADDED
Binary file
|
trunk/flags/zm.png
ADDED
Binary file
|
trunk/flags/zw.png
ADDED
Binary file
|
trunk/flags/zz.png
ADDED
Binary file
|
trunk/includes/admin/central/class-wpglobus-admin-central.php
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-admin-central.php
|
4 |
+
*
|
5 |
+
* @since 1.6.6
|
6 |
+
* @package WPGlobus\Admin\Central
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Admin_Central.
|
11 |
+
*/
|
12 |
+
if ( ! class_exists( 'WPGlobus_Admin_Central' ) ) :
|
13 |
+
|
14 |
+
class WPGlobus_Admin_Central {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Link template.
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
public static $link_template;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor.
|
24 |
+
*/
|
25 |
+
public static function construct() {
|
26 |
+
|
27 |
+
self::set_vars();
|
28 |
+
|
29 |
+
add_action( 'admin_menu', array( __CLASS__, 'add_menu' ), PHP_INT_MAX );
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Set class variables.
|
35 |
+
*/
|
36 |
+
public static function set_vars() {
|
37 |
+
|
38 |
+
self::$link_template = '<a href="{{href}}" class="{{link_class}}" data-tab-id="{{tab_id}}">';
|
39 |
+
self::$link_template .= '<span class="{{span_class}}" style="vertical-align: sub;"></span>';
|
40 |
+
self::$link_template .= '{{title}}';
|
41 |
+
self::$link_template .= '</a>';
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Add a hidden admin menu item.
|
47 |
+
* It serves as a base for several admin tabs, but currently do not have the "root" content.
|
48 |
+
*/
|
49 |
+
public static function add_menu() {
|
50 |
+
add_submenu_page(
|
51 |
+
null,
|
52 |
+
'',
|
53 |
+
'',
|
54 |
+
'administrator',
|
55 |
+
WPGlobus::PAGE_WPGLOBUS_ADMIN_CENTRAL,
|
56 |
+
array( __CLASS__, 'central_page' )
|
57 |
+
);
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* The admin central page.
|
62 |
+
*/
|
63 |
+
public static function central_page() {
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Filter tabs.
|
67 |
+
* Returning array.
|
68 |
+
* @since 1.6.6
|
69 |
+
*
|
70 |
+
* @param array $tabs Array of tabs.
|
71 |
+
* @param string $link_template The link template.
|
72 |
+
*/
|
73 |
+
$tabs = apply_filters( 'wpglobus_admin_central_tabs', self::set_tabs(), self::$link_template );
|
74 |
+
|
75 |
+
WPGlobus_Admin_Page::print_header();
|
76 |
+
|
77 |
+
?>
|
78 |
+
<h2 class="nav-tab-wrapper"> <?php
|
79 |
+
foreach ( $tabs as $type=>$tab ) :
|
80 |
+
$html = str_replace( '{{link_class}}', implode( ' ', $tab['link_class'] ), $tab['link'] );
|
81 |
+
$html = str_replace( '{{span_class}}', implode( ' ', $tab['span_class'] ), $html );
|
82 |
+
$html = str_replace( '{{title}}', $tab['title'], $html );
|
83 |
+
if ( ! empty( $tab['tab_id'] ) ) {
|
84 |
+
$html = str_replace( '{{href}}', '#' . $tab['tab_id'], $html );
|
85 |
+
$html = str_replace( '{{tab_id}}', $tab['tab_id'], $html );
|
86 |
+
} elseif ( ! empty( $tab['href'] ) ) {
|
87 |
+
$html = str_replace( '{{href}}', $tab['href'], $html );
|
88 |
+
$html = str_replace( '{{tab_id}}', '', $html );
|
89 |
+
} else {
|
90 |
+
$html = str_replace( '{{href}}', '#', $html );
|
91 |
+
$html = str_replace( '{{tab_id}}', '', $html );
|
92 |
+
}
|
93 |
+
echo $html; // WPCS: XSS ok.
|
94 |
+
endforeach; ?>
|
95 |
+
</h2> <?php
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Fires to render a specific tab panel.
|
99 |
+
*
|
100 |
+
* @since 1.6.6
|
101 |
+
*
|
102 |
+
* @param array $tabs Array of tabs.
|
103 |
+
*/
|
104 |
+
do_action( 'wpglobus_admin_central_panel', $tabs );
|
105 |
+
|
106 |
+
WPGlobus_Admin_Page::print_footer();
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Add standard tabs.
|
112 |
+
* @return array
|
113 |
+
*/
|
114 |
+
protected static function set_tabs() {
|
115 |
+
|
116 |
+
$tabs = array();
|
117 |
+
|
118 |
+
/**
|
119 |
+
* WPGlobus Guide tab.
|
120 |
+
*/
|
121 |
+
$tab = array(
|
122 |
+
'title' => __( 'Guide', 'wpglobus' ),
|
123 |
+
'link_class' => array( 'nav-tab' ),
|
124 |
+
'span_class' => array( 'dashicons', 'dashicons-book-alt' ),
|
125 |
+
'link' => self::$link_template,
|
126 |
+
'href' => WPGlobus::URL_WPGLOBUS_SITE . 'quick-start/',
|
127 |
+
'tab_id' => ''
|
128 |
+
);
|
129 |
+
$tabs[ 'guide' ] = $tab;
|
130 |
+
|
131 |
+
/**
|
132 |
+
* WPGlobus Help Desk tab.
|
133 |
+
*/
|
134 |
+
$href = add_query_arg(
|
135 |
+
array(
|
136 |
+
'page' => WPGlobus::PAGE_WPGLOBUS_HELPDESK
|
137 |
+
),
|
138 |
+
admin_url( 'admin.php' )
|
139 |
+
);
|
140 |
+
|
141 |
+
$tab = array(
|
142 |
+
'title' => __( 'WPGlobus Help Desk', 'wpglobus' ),
|
143 |
+
'link_class' => array( 'nav-tab' ),
|
144 |
+
'span_class' => array( 'dashicons', 'dashicons-format-chat' ),
|
145 |
+
'link' => self::$link_template,
|
146 |
+
'href' => $href,
|
147 |
+
'tab_id' => ''
|
148 |
+
);
|
149 |
+
$tabs[ 'helpdesk' ] = $tab;
|
150 |
+
|
151 |
+
/**
|
152 |
+
* WPGlobus Add-ons tab.
|
153 |
+
*/
|
154 |
+
$href = WPGlobus_Admin_Page::url_addons();
|
155 |
+
|
156 |
+
$tab = array(
|
157 |
+
'title' => __( 'Add-ons', 'wpglobus' ),
|
158 |
+
'link_class' => array( 'nav-tab' ),
|
159 |
+
'span_class' => array( 'dashicons', 'dashicons-admin-plugins' ),
|
160 |
+
'link' => self::$link_template,
|
161 |
+
'href' => $href,
|
162 |
+
'tab_id' => ''
|
163 |
+
);
|
164 |
+
$tabs[ 'add_ons' ] = $tab;
|
165 |
+
|
166 |
+
return $tabs;
|
167 |
+
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
endif;
|
172 |
+
/* EOF */
|
trunk/includes/admin/class-wpglobus-about.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package WPGlobus\Admin
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Class WPGlobus_About
|
8 |
+
*/
|
9 |
+
class WPGlobus_About {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* For Google Analytics
|
13 |
+
*/
|
14 |
+
const QA_CAMPAIGN = '?utm_source=wpglobus-admin-about&utm_medium=link&utm_campaign=activate-plugin';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Output the about screen.
|
18 |
+
*/
|
19 |
+
public static function about_screen() {
|
20 |
+
|
21 |
+
WPGlobus_Admin_Page::print_header();
|
22 |
+
|
23 |
+
?>
|
24 |
+
<h2 class="nav-tab-wrapper">
|
25 |
+
<a href="#" class="nav-tab nav-tab-active">
|
26 |
+
<?php esc_html_e( 'Quick Start', 'wpglobus' ); ?>
|
27 |
+
</a>
|
28 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_settings() ); ?>"
|
29 |
+
class="nav-tab">
|
30 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Settings' ); ?>
|
31 |
+
<?php esc_html_e( 'Settings' ); ?>
|
32 |
+
</a>
|
33 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_addons() ); ?>"
|
34 |
+
class="nav-tab">
|
35 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Add-ons' ); ?>
|
36 |
+
<?php esc_html_e( 'Add-ons', 'wpglobus' ); ?>
|
37 |
+
</a>
|
38 |
+
<a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . 'quick-start/' . self::QA_CAMPAIGN ); ?>"
|
39 |
+
target="_blank"
|
40 |
+
class="nav-tab">
|
41 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Guide' ); ?>
|
42 |
+
<?php esc_html_e( 'Guide', 'wpglobus' ); ?>
|
43 |
+
</a>
|
44 |
+
<a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . 'faq/' . self::QA_CAMPAIGN ); ?>"
|
45 |
+
target="_blank"
|
46 |
+
class="nav-tab">
|
47 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'FAQ' ); ?>
|
48 |
+
<?php esc_html_e( 'FAQ', 'wpglobus' ); ?>
|
49 |
+
</a>
|
50 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_helpdesk() ); ?>"
|
51 |
+
class="nav-tab">
|
52 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Helpdesk' ); ?>
|
53 |
+
<?php echo esc_html( WPGlobus_Admin_HelpDesk::$page_title ); ?>
|
54 |
+
</a>
|
55 |
+
</h2>
|
56 |
+
|
57 |
+
<?php if ( ! extension_loaded( 'mbstring' ) ) : ?>
|
58 |
+
<div style="background: #fff;border-left: 4px solid #dc3232;margin: 15px 15px 2px;padding: 1px 12px;">
|
59 |
+
<h4><?php esc_html_e( 'Attention: the Multibyte String PHP extension (`mbstring`) is not loaded!', 'wpglobus' ); ?></h4>
|
60 |
+
<p><?php esc_html_e( 'The mbstring extension is required for the full UTF-8 compatibility and better performance. Without it, some parts of WordPress and WPGlobus may function incorrectly. Please contact your hosting company or systems administrator.', 'wpglobus' ); ?></p>
|
61 |
+
</div>
|
62 |
+
<?php endif; ?>
|
63 |
+
|
64 |
+
<div class="feature-main feature-section col two-col">
|
65 |
+
<div class="col">
|
66 |
+
<?php self::easy_1_2_3(); ?>
|
67 |
+
</div>
|
68 |
+
<div class="col last-feature">
|
69 |
+
<?php self::translation_help(); ?>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<div class="feature-main feature-section col two-col">
|
74 |
+
<div class="col">
|
75 |
+
<?php self::important_notes(); ?>
|
76 |
+
</div>
|
77 |
+
<div class="col last-feature">
|
78 |
+
<?php self::links(); ?>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
|
82 |
+
<hr />
|
83 |
+
|
84 |
+
<div class="return-to-dashboard">
|
85 |
+
<a class="button button-primary"
|
86 |
+
href="<?php echo esc_url( WPGlobus_Admin_Page::url_settings() ); ?>">
|
87 |
+
<?php esc_html_e( 'Go to WPGlobus Settings', 'wpglobus' ); ?>
|
88 |
+
</a>
|
89 |
+
</div>
|
90 |
+
|
91 |
+
<?php
|
92 |
+
WPGlobus_Admin_Page::print_footer();
|
93 |
+
}
|
94 |
+
|
95 |
+
protected static function easy_1_2_3() {
|
96 |
+
?>
|
97 |
+
<h4 class="dashicons-before dashicons-admin-settings bar">
|
98 |
+
<?php esc_html_e( 'Easy as 1-2-3:', 'wpglobus' ); ?>
|
99 |
+
</h4>
|
100 |
+
<ul class="wpglobus-checkmarks">
|
101 |
+
<li><?php esc_html_e( 'Go to WPGlobus admin menu and choose the countries / languages;', 'wpglobus' ); ?></li>
|
102 |
+
<li><?php esc_html_e( 'Enter the translations to the posts, pages, categories, tags and menus using a clean and simple interface.', 'wpglobus' ); ?></li>
|
103 |
+
<li><?php esc_html_e( 'Switch languages at the front-end using a drop-down menu with language names and country flags.', 'wpglobus' ); ?></li>
|
104 |
+
</ul>
|
105 |
+
<?php
|
106 |
+
}
|
107 |
+
|
108 |
+
protected static function links() {
|
109 |
+
?>
|
110 |
+
<h4 class="dashicons-before dashicons-admin-links bar">
|
111 |
+
<?php esc_html_e( 'Links:', 'wpglobus' ); ?>
|
112 |
+
</h4>
|
113 |
+
<ul>
|
114 |
+
<li>• <a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . self::QA_CAMPAIGN ); ?>"
|
115 |
+
target="_blank">WPGlobus.com</a></li>
|
116 |
+
<li>• <a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . 'quick-start/' . self::QA_CAMPAIGN ); ?>"
|
117 |
+
target="_blank"><?php esc_html_e( 'Guide', 'wpglobus' ); ?></a></li>
|
118 |
+
<li>• <a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . 'faq/' . self::QA_CAMPAIGN ); ?>"
|
119 |
+
target="_blank"><?php esc_html_e( 'FAQs', 'wpglobus' ); ?></a></li>
|
120 |
+
<li>• <a href="<?php echo esc_url( WPGlobus_Admin_Page::url_helpdesk() ); ?>"
|
121 |
+
target="_blank"><?php esc_html_e( 'Contact Us', 'wpglobus' ); ?></a></li>
|
122 |
+
<li>• <a href="https://wordpress.org/support/plugin/wpglobus/reviews/?filter=5"
|
123 |
+
target="_blank"><?php esc_html_e( 'Please give us 5 stars!', 'wpglobus' ); ?></a>
|
124 |
+
<span class="wpglobus-stars">☆☆☆☆☆</span></li>
|
125 |
+
|
126 |
+
</ul>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
|
130 |
+
protected static function translation_help() {
|
131 |
+
?>
|
132 |
+
<h4 class="dashicons-before dashicons-translation highlight">
|
133 |
+
<?php esc_html_e( 'WPGlobus does not translate texts automatically!', 'wpglobus' ); ?>
|
134 |
+
</h4>
|
135 |
+
<p>
|
136 |
+
<?php esc_html_e( 'There are many translation companies and individual translators who can help you write and proofread the texts.', 'wpglobus' ); ?>
|
137 |
+
<?php esc_html_e( 'When you choose a translator, please look at their native language, country of residence, specialization and knowledge of WordPress.', 'wpglobus' ); ?>
|
138 |
+
</p>
|
139 |
+
<p>
|
140 |
+
<?php
|
141 |
+
printf(
|
142 |
+
// translators: %s are used to insert HTML link. Keep them in place.
|
143 |
+
esc_html__( 'We are planning to maintain a %s list of translators %s on the WPGlobus website. This is not an endorsement, just a courtesy. Please contact them directly and let us know how did it work for you!', 'wpglobus' ),
|
144 |
+
'<a href="' . esc_url( WPGlobus_Utils::url_wpglobus_site() . 'translator/' . self::QA_CAMPAIGN ) . '">',
|
145 |
+
'</a>'
|
146 |
+
); ?>
|
147 |
+
</p>
|
148 |
+
<?php
|
149 |
+
}
|
150 |
+
|
151 |
+
protected static function important_notes() {
|
152 |
+
?>
|
153 |
+
<h4 class="dashicons-before dashicons-info highlight">
|
154 |
+
<?php esc_html_e( 'Important notes:', 'wpglobus' ); ?>
|
155 |
+
</h4>
|
156 |
+
<ul class="wpglobus-important">
|
157 |
+
|
158 |
+
<li>
|
159 |
+
<?php _e( 'WPGlobus only supports the localization URLs in the form of <code>example.com/xx/page/</code>. We do not plan to support subdomains <code>xx.example.com</code> and language queries <code>example.com?lang=xx</code>.', 'wpglobus' ); // WPCS: XSS ok. ?>
|
160 |
+
</li>
|
161 |
+
<li>
|
162 |
+
<?php _e( 'Some themes and plugins are <strong>not multilingual-ready</strong>.', 'wpglobus' ); // WPCS: XSS ok. ?>
|
163 |
+
<?php esc_html_e( 'They might display some texts with no translation, or with all languages mixed together.', 'wpglobus' ); ?>
|
164 |
+
<?php
|
165 |
+
printf(
|
166 |
+
// translators: %s are used to insert HTML link. Keep them in place.
|
167 |
+
esc_html__( 'Please contact the theme / plugin author. If they are unable to assist, consider %s hiring the WPGlobus Team %s to write a custom code for you.', 'wpglobus' ),
|
168 |
+
'<a href="' . esc_url( WPGlobus_Utils::url_wpglobus_site() . 'professional-support/' .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|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Show WPGlobus menu in admin bar.
|
4 |
+
*
|
5 |
+
* @since 2.2.7
|
6 |
+
* @package WPGlobus\Admin
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! class_exists( 'WPGlobus_Admin_Bar_Menu' ) ) :
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class WPGlobus_Admin_Bar_Menu.
|
13 |
+
*/
|
14 |
+
class WPGlobus_Admin_Bar_Menu {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Available languages.
|
18 |
+
*
|
19 |
+
* @var array
|
20 |
+
*/
|
21 |
+
protected static $available_languages = array();
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @since 2.2.8
|
25 |
+
*/
|
26 |
+
protected static $run_script = true;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Static constructor.
|
30 |
+
*
|
31 |
+
* @param WP_Admin_Bar $wp_admin_bar Admin bar.
|
32 |
+
*/
|
33 |
+
public static function construct( $wp_admin_bar ) {
|
34 |
+
|
35 |
+
$user_id = get_current_user_id();
|
36 |
+
|
37 |
+
if ( ! $user_id ) {
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
self::$available_languages = get_available_languages();
|
42 |
+
|
43 |
+
$user_locale = get_user_meta( $user_id, 'locale', true );
|
44 |
+
|
45 |
+
add_action( 'admin_footer', array( __CLASS__, 'on__admin_footer' ), 1000 );
|
46 |
+
|
47 |
+
if ( empty( $user_locale ) ) {
|
48 |
+
self::add_language_menu( $wp_admin_bar );
|
49 |
+
} else {
|
50 |
+
if ( ! self::add_info_menu( $wp_admin_bar, $user_locale ) ) {
|
51 |
+
self::$run_script = false;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @since 2.2.8
|
59 |
+
*/
|
60 |
+
public static function on__admin_footer() {
|
61 |
+
|
62 |
+
if ( ! self::$run_script ) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
?>
|
67 |
+
<!--suppress AnonymousFunctionJS, JSUnusedLocalSymbols -->
|
68 |
+
<script type="text/javascript">
|
69 |
+
//<![CDATA[
|
70 |
+
jQuery(document).ready(function ($) {
|
71 |
+
wpglobus_select_lang = function (locale) {
|
72 |
+
$.post(ajaxurl, {
|
73 |
+
action: 'WPGlobus_process_ajax',
|
74 |
+
order: {action: 'wpglobus_select_lang', locale: locale}
|
75 |
+
}, function (d) {
|
76 |
+
})
|
77 |
+
.done(function () {
|
78 |
+
window.location.reload();
|
79 |
+
});
|
80 |
+
}
|
81 |
+
$('#wpglobus-default-locale').on('click', function (e) {
|
82 |
+
wpglobus_select_lang('<?php echo esc_js( WPGlobus::Config()->locale[ WPGlobus::Config()->language ] ); ?>');
|
83 |
+
});
|
84 |
+
|
85 |
+
});
|
86 |
+
//]]>
|
87 |
+
</script>
|
88 |
+
<?php
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Language menu with link to `profile.php` page.
|
93 |
+
*
|
94 |
+
* @param WP_Admin_Bar $wp_admin_bar Admin bar.
|
95 |
+
* @param string[] $user_locale User locale.
|
96 |
+
*/
|
97 |
+
public static function add_info_menu( $wp_admin_bar, $user_locale ) {
|
98 |
+
|
99 |
+
$user_profile_language = array_search( $user_locale, WPGlobus::Config()->locale, true );
|
100 |
+
|
101 |
+
if ( ! $user_profile_language ) {
|
102 |
+
return false;
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( empty( WPGlobus::Config()->language_name[ $user_profile_language ] ) ) {
|
106 |
+
return false;
|
107 |
+
}
|
108 |
+
|
109 |
+
$img = '';
|
110 |
+
if ( ! empty( WPGlobus::Config()->flag[ $user_profile_language ] ) ) {
|
111 |
+
$img = '<span class="ab-icon"><img src="' . WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $user_profile_language ] . '" alt=""/></span>';
|
112 |
+
}
|
113 |
+
|
114 |
+
$wp_admin_bar->add_menu(
|
115 |
+
array(
|
116 |
+
'id' => 'wpglobus-language-select',
|
117 |
+
'parent' => 'top-secondary',
|
118 |
+
'title' => $img . '<span class="ab-label">' .
|
119 |
+
WPGlobus::Config()->language_name[ $user_profile_language ] .
|
120 |
+
'</span>',
|
121 |
+
)
|
122 |
+
);
|
123 |
+
|
124 |
+
$title = esc_html__( 'Language was set on your profile page', 'wpglobus' );
|
125 |
+
$wp_admin_bar->add_menu(
|
126 |
+
array(
|
127 |
+
'parent' => 'wpglobus-language-select',
|
128 |
+
'id' => 'wpglobus-add-languages',
|
129 |
+
'title' => $title,
|
130 |
+
'href' => admin_url( 'profile.php' ),
|
131 |
+
'meta' => array(
|
132 |
+
'tabindex' => -1,
|
133 |
+
),
|
134 |
+
)
|
135 |
+
);
|
136 |
+
|
137 |
+
return true;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Language menu in admin bar.
|
142 |
+
*
|
143 |
+
* @param WP_Admin_Bar $wp_admin_bar Admin bar.
|
144 |
+
*/
|
145 |
+
public static function add_language_menu( $wp_admin_bar ) {
|
146 |
+
|
147 |
+
$available_languages = self::$available_languages;
|
148 |
+
|
149 |
+
$wp_admin_bar->add_menu(
|
150 |
+
array(
|
151 |
+
'id' => 'wpglobus-language-select',
|
152 |
+
'parent' => 'top-secondary',
|
153 |
+
'title' => '<span class="ab-icon">' .
|
154 |
+
'<img alt="" src="' . WPGlobus::Config()->flags_url .
|
155 |
+
WPGlobus::Config()->flag[ WPGlobus::Config()->language ] . '"/>' .
|
156 |
+
'</span><span class="ab-label">' .
|
157 |
+
WPGlobus::Config()->language_name[ WPGlobus::Config()->language ] .
|
158 |
+
'</span>',
|
159 |
+
)
|
160 |
+
);
|
161 |
+
|
162 |
+
$add_more_languages = array();
|
163 |
+
foreach ( WPGlobus::Config()->enabled_languages as $language ) :
|
164 |
+
|
165 |
+
if ( WPGlobus::Config()->language === $language ) {
|
166 |
+
continue;
|
167 |
+
}
|
168 |
+
|
169 |
+
$locale = WPGlobus::Config()->locale[ $language ];
|
170 |
+
|
171 |
+
if ( 'en_US' !== $locale ) {
|
172 |
+
if ( ! in_array( $locale, $available_languages, true ) ) {
|
173 |
+
$add_more_languages[] = WPGlobus::Config()->language_name[ $language ];
|
174 |
+
continue;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
$wp_admin_bar->add_menu(
|
179 |
+
array(
|
180 |
+
'parent' => 'wpglobus-language-select',
|
181 |
+
'id' => 'wpglobus-' . $language,
|
182 |
+
'title' => '<span><img alt="" src="' . WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $language ] . '" /></span> ' . WPGlobus::Config()->language_name[ $language ],
|
183 |
+
'href' => admin_url( 'options-general.php' ),
|
184 |
+
'meta' => array(
|
185 |
+
'tabindex' => -1,
|
186 |
+
'onclick' => 'wpglobus_select_lang("' . $locale . '");return false;',
|
187 |
+
),
|
188 |
+
)
|
189 |
+
);
|
190 |
+
|
191 |
+
endforeach;
|
192 |
+
|
193 |
+
if ( ! empty( $add_more_languages ) ) {
|
194 |
+
$title = esc_html__( 'Add', 'wpglobus' ) . ' (' . implode( ', ', $add_more_languages ) . ')';
|
195 |
+
$wp_admin_bar->add_menu(
|
196 |
+
array(
|
197 |
+
'parent' => 'wpglobus-language-select',
|
198 |
+
'id' => 'wpglobus-add-languages',
|
199 |
+
'title' => $title,
|
200 |
+
'href' => admin_url( 'options-general.php' ),
|
201 |
+
'meta' => array(
|
202 |
+
'tabindex' => -1,
|
203 |
+
),
|
204 |
+
)
|
205 |
+
);
|
206 |
+
}
|
207 |
+
|
208 |
+
return;
|
209 |
+
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
endif;
|
trunk/includes/admin/class-wpglobus-admin-menu.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Show a sidebar menu item.
|
4 |
+
*
|
5 |
+
* @since 1.7.8
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPGlobus_Admin_Menu
|
10 |
+
*/
|
11 |
+
class WPGlobus_Admin_Menu {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Static constructor.
|
15 |
+
*/
|
16 |
+
public static function construct() {
|
17 |
+
add_action( 'admin_menu', array( __CLASS__, 'add_menu' ), PHP_INT_MAX );
|
18 |
+
}
|
19 |
+
|
20 |
+
public static function add_menu() {
|
21 |
+
$icon_class = 'dashicons dashicons-before dashicons-admin-plugins';
|
22 |
+
$menu_title = __( 'Add-ons', 'wpglobus' );
|
23 |
+
add_submenu_page(
|
24 |
+
WPGlobus::OPTIONS_PAGE_SLUG,
|
25 |
+
$menu_title,
|
26 |
+
'<span class="' . esc_attr( $icon_class )
|
27 |
+
. '" style="vertical-align:middle"></span> '
|
28 |
+
. $menu_title,
|
29 |
+
'administrator',
|
30 |
+
WPGlobus_Admin_Page::url_addons(true)
|
31 |
+
);
|
32 |
+
|
33 |
+
}
|
34 |
+
}
|
trunk/includes/admin/class-wpglobus-admin-page.php
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-admin-page.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Helpers for building admin pages.
|
10 |
+
*/
|
11 |
+
class WPGlobus_Admin_Page {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Print page header.
|
15 |
+
*/
|
16 |
+
public static function print_header() {
|
17 |
+
$url_wpglobus_logo = WPGlobus::internal_images_url() . '/wpglobus-logo-180x180.png';
|
18 |
+
?>
|
19 |
+
<style>
|
20 |
+
.wp-badge.wpglobus-badge {
|
21 |
+
background: #ffffff url(<?php echo esc_url( $url_wpglobus_logo ); ?>) no-repeat;
|
22 |
+
background-size: contain;
|
23 |
+
}
|
24 |
+
</style>
|
25 |
+
|
26 |
+
<?php echo '<div class="wrap about-wrap wpglobus-about-wrap">'; ?>
|
27 |
+
|
28 |
+
<h1 class="wpglobus"><span class="wpglobus-wp">WP</span>Globus
|
29 |
+
<span class="wpglobus-version"><?php echo esc_html( WPGLOBUS_VERSION ); ?></span>
|
30 |
+
</h1>
|
31 |
+
|
32 |
+
<div class="wpglobus-motto"><?php esc_html_e( 'Multilingual Everything!', 'wpglobus' ); ?></div>
|
33 |
+
<div class="about-text">
|
34 |
+
<?php esc_html_e( 'WPGlobus is a family of WordPress plugins assisting you in making multilingual WordPress blogs and sites.', 'wpglobus' ); ?>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div class="wp-badge wpglobus-badge"></div>
|
38 |
+
<?php
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Print page header.
|
43 |
+
*/
|
44 |
+
public static function print_footer() {
|
45 |
+
echo '</div>';
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* URL of the WPGlobus Add-ons page.
|
50 |
+
*
|
51 |
+
* @param bool $relative Set it to true to get the URL relative to the admin.
|
52 |
+
*
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
public static function url_addons( $relative = false ) {
|
56 |
+
|
57 |
+
$url = add_query_arg(
|
58 |
+
array(
|
59 |
+
'tab' => 'search',
|
60 |
+
's' => 'WPGlobus',
|
61 |
+
'source' => 'WPGlobus',
|
62 |
+
),
|
63 |
+
self_admin_url( 'plugin-install.php' )
|
64 |
+
);
|
65 |
+
|
66 |
+
if ( $relative ) {
|
67 |
+
$url = str_replace( self_admin_url(), '', $url );
|
68 |
+
}
|
69 |
+
|
70 |
+
return $url;
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* URL of the WPGlobus Settings page.
|
76 |
+
*
|
77 |
+
* @since 2.4.8 Added $tab parameter.
|
78 |
+
*
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
public static function url_settings( $tab = '' ) {
|
82 |
+
if ( empty($tab) ) {
|
83 |
+
return add_query_arg( 'page', WPGlobus::OPTIONS_PAGE_SLUG, admin_url( 'admin.php' ) );
|
84 |
+
}
|
85 |
+
return add_query_arg( array('page'=>WPGlobus::OPTIONS_PAGE_SLUG, 'tab'=>$tab), admin_url( 'admin.php' ) );
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* URL of the WPGlobus Helpdesk page.
|
90 |
+
*
|
91 |
+
* @return string
|
92 |
+
* @since 1.9.10
|
93 |
+
*/
|
94 |
+
public static function url_helpdesk() {
|
95 |
+
return add_query_arg( 'page', WPGlobus::PAGE_WPGLOBUS_HELPDESK, admin_url( 'admin.php' ) );
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* URL of the Clean-up Tool page.
|
100 |
+
*
|
101 |
+
* @return string
|
102 |
+
* @since 1.9.10
|
103 |
+
*/
|
104 |
+
public static function url_clean_up_tool() {
|
105 |
+
return add_query_arg( 'page', WPGlobus::PAGE_WPGLOBUS_CLEAN, admin_url( 'admin.php' ) );
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* URL of the About page.
|
110 |
+
*
|
111 |
+
* @return string
|
112 |
+
* @since 1.9.10
|
113 |
+
*/
|
114 |
+
public static function url_about() {
|
115 |
+
return add_query_arg( 'page', WPGlobus::PAGE_WPGLOBUS_ABOUT, admin_url( 'admin.php' ) );
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* URL of the Admin Central page.
|
120 |
+
*
|
121 |
+
* @param string $central_tab_id Tab on the page.
|
122 |
+
*
|
123 |
+
* @return string
|
124 |
+
* @since 1.9.10
|
125 |
+
*/
|
126 |
+
public static function url_admin_central( $central_tab_id = '' ) {
|
127 |
+
return add_query_arg( 'page', WPGlobus::PAGE_WPGLOBUS_ADMIN_CENTRAL . '#' . $central_tab_id, admin_url( 'admin.php' ) );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* URL of the Options Panel.
|
132 |
+
*
|
133 |
+
* @param string $tab Tab on the page.
|
134 |
+
*
|
135 |
+
* @return string
|
136 |
+
* @since 1.9.10
|
137 |
+
*/
|
138 |
+
public static function url_options_panel( $tab = WPGlobus_Options::DEFAULT_TAB ) {
|
139 |
+
|
140 |
+
return add_query_arg( array(
|
141 |
+
'page' => WPGlobus::OPTIONS_PAGE_SLUG,
|
142 |
+
'tab' => $tab,
|
143 |
+
), admin_url( 'admin.php' ) );
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* URL of the WPGlobus-Plus Panel.
|
148 |
+
*
|
149 |
+
* @param string $tab Tab on the page.
|
150 |
+
*
|
151 |
+
* @return string
|
152 |
+
* @since 1.9.10
|
153 |
+
*/
|
154 |
+
public static function url_wpglobus_plus_panel( $tab = 'modules' ) {
|
155 |
+
if ( class_exists( 'WPGlobusPlus', false ) ) {
|
156 |
+
return add_query_arg( array(
|
157 |
+
'page' => WPGlobusPlus::WPGLOBUS_PLUS_OPTIONS_PAGE,
|
158 |
+
'tab' => $tab,
|
159 |
+
), admin_url( 'admin.php' ) );
|
160 |
+
} else {
|
161 |
+
return admin_url();
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Icon for navigation tab item.
|
167 |
+
*
|
168 |
+
* @param string $icon_class A Dashicon CSS class or our internal alias.
|
169 |
+
* @param boolean $add_dashicons_class Add "dashicons" class before icon class.
|
170 |
+
*
|
171 |
+
* @link https://developer.wordpress.org/resource/dashicons/
|
172 |
+
* @return string
|
173 |
+
*/
|
174 |
+
public static function nav_tab_icon( $icon_class, $add_dashicons_class = true ) {
|
175 |
+
|
176 |
+
static $aliases = array(
|
177 |
+
'faq' => 'dashicons-editor-help',
|
178 |
+
'settings' => 'dashicons-admin-settings',
|
179 |
+
'add-ons' => 'dashicons-admin-plugins',
|
180 |
+
'guide' => 'dashicons-book-alt',
|
181 |
+
'helpdesk' => 'dashicons-format-chat',
|
182 |
+
'globe' => 'dashicons-admin-site',
|
183 |
+
);
|
184 |
+
|
185 |
+
$icon_class = strtolower( $icon_class );
|
186 |
+
|
187 |
+
if ( isset( $aliases[ $icon_class ] ) ) {
|
188 |
+
// An alias passed.
|
189 |
+
$icon_class = $aliases[ $icon_class ];
|
190 |
+
}
|
191 |
+
|
192 |
+
if ( $add_dashicons_class ) {
|
193 |
+
$icon_class = 'dashicons dashicons-before ' . $icon_class;
|
194 |
+
}
|
195 |
+
|
196 |
+
return $icon_class;
|
197 |
+
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Print icon for navigation tab item.
|
202 |
+
*
|
203 |
+
* @param string $icon_class A Dashicon CSS class or our internal alias.
|
204 |
+
*/
|
205 |
+
public static function nav_tab_icon_e( $icon_class ) {
|
206 |
+
echo '<span class="' . esc_attr( self::nav_tab_icon( $icon_class ) ) . '"></span>';
|
207 |
+
}
|
208 |
+
}
|
trunk/includes/admin/class-wpglobus-admin-post.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-admin-post.php
|
4 |
+
* Class for post.php page.
|
5 |
+
*
|
6 |
+
* @package WPGlobus\Admin
|
7 |
+
* @author Alex Gor(alexgff)
|
8 |
+
* @since 2.4
|
9 |
+
*/
|
10 |
+
if ( ! class_exists( 'WPGlobus_Admin_Post' ) ) :
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class WPGlobus_Admin_Menu.
|
14 |
+
*/
|
15 |
+
class WPGlobus_Admin_Post {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Static constructor.
|
19 |
+
*/
|
20 |
+
public static function construct() {
|
21 |
+
|
22 |
+
if ( ! WPGlobus_WP::is_pagenow('post.php') ) {
|
23 |
+
return;
|
24 |
+
}
|
25 |
+
|
26 |
+
if ( 'off' == WPGlobus::Config()->toggle ) {
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
|
30 |
+
add_filter( 'preview_post_link', array( __CLASS__, 'filter__preview_post_link' ), 5, 2 );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Filters the URL used for a post preview in builder mode.
|
35 |
+
* @see wp-includes/link-template.php
|
36 |
+
*
|
37 |
+
* @param string $preview_link URL used for the post preview.
|
38 |
+
* @param WP_Post $post Post object.
|
39 |
+
*/
|
40 |
+
public static function filter__preview_post_link( $preview_link, $post ) {
|
41 |
+
|
42 |
+
if ( ! WPGlobus::Config()->builder->is_builder_page() ) {
|
43 |
+
return $preview_link;
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( WPGlobus::Config()->builder->is_default_language() ) {
|
47 |
+
return $preview_link;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
return WPGlobus_Utils::localize_url( $preview_link, WPGlobus::Config()->builder->get_language() );
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
endif;
|
56 |
+
|
57 |
+
# --- EOF
|
trunk/includes/admin/class-wpglobus-clean.php
ADDED
@@ -0,0 +1,743 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package WPGlobus/Admin
|
4 |
+
* @since 1.4.3
|
5 |
+
*/
|
6 |
+
|
7 |
+
if ( ! class_exists( 'WPGlobus_Clean' ) ) :
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Clean
|
11 |
+
*/
|
12 |
+
class WPGlobus_Clean {
|
13 |
+
|
14 |
+
const LOG_BASENAME = 'wpglobus-clean';
|
15 |
+
|
16 |
+
protected static $tables = array();
|
17 |
+
|
18 |
+
protected static $log_file = '';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Controller
|
22 |
+
*/
|
23 |
+
public static function controller() {
|
24 |
+
|
25 |
+
self::_set_log_file();
|
26 |
+
|
27 |
+
self::get_table();
|
28 |
+
|
29 |
+
self::screen();
|
30 |
+
|
31 |
+
add_action( 'admin_footer', array(
|
32 |
+
'WPGlobus_Clean',
|
33 |
+
'action__admin_print_scripts'
|
34 |
+
),
|
35 |
+
99
|
36 |
+
);
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Initialize the class variable `log_file`.
|
42 |
+
* Note: 'wp-content' can be set to a different path, so we are using the standard WP method.
|
43 |
+
* @todo Check if the folder exists and file is writeable.
|
44 |
+
*/
|
45 |
+
protected static function _set_log_file() {
|
46 |
+
$upload_dir = wp_upload_dir();
|
47 |
+
$wpglobus_logs_dir = $upload_dir['basedir'] . '/' . 'wpglobus-logs';
|
48 |
+
|
49 |
+
wp_mkdir_p( $wpglobus_logs_dir );
|
50 |
+
// Protect the folder from reading via URL
|
51 |
+
if ( ! file_exists( $wpglobus_logs_dir . '/.htaccess' ) ) {
|
52 |
+
file_put_contents( $wpglobus_logs_dir . '/.htaccess', 'deny from all' );
|
53 |
+
}
|
54 |
+
if ( ! file_exists( $wpglobus_logs_dir . '/index.php' ) ) {
|
55 |
+
file_put_contents( $wpglobus_logs_dir . '/index.php', '' );
|
56 |
+
}
|
57 |
+
|
58 |
+
self::$log_file = $wpglobus_logs_dir . '/' . self::LOG_BASENAME . '.log';
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Get table
|
63 |
+
*
|
64 |
+
* @param string $table Table name to set data.
|
65 |
+
*
|
66 |
+
* @return void
|
67 |
+
*/
|
68 |
+
public static function get_table( $table = '' ) {
|
69 |
+
|
70 |
+
$get_all = false;
|
71 |
+
if ( '' === $table ) {
|
72 |
+
$get_all = true;
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( 'posts' === $table || $get_all ) {
|
76 |
+
|
77 |
+
/**
|
78 |
+
* table posts
|
79 |
+
*/
|
80 |
+
$posts = new stdClass();
|
81 |
+
$posts->include_fields = array(
|
82 |
+
'post_content',
|
83 |
+
'post_title',
|
84 |
+
'post_excerpt',
|
85 |
+
'post_content_filtered'
|
86 |
+
);
|
87 |
+
$posts->id_field = 'ID';
|
88 |
+
$posts->post_status = array(
|
89 |
+
'publish',
|
90 |
+
'draft'
|
91 |
+
);
|
92 |
+
|
93 |
+
self::$tables['posts'] = $posts;
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
if ( 'postmeta' === $table || $get_all ) {
|
98 |
+
|
99 |
+
/**
|
100 |
+
* table postmeta
|
101 |
+
*/
|
102 |
+
$postmeta = new stdClass();
|
103 |
+
$postmeta->include_fields = array(
|
104 |
+
'meta_value'
|
105 |
+
);
|
106 |
+
$postmeta->id_field = 'meta_id';
|
107 |
+
|
108 |
+
self::$tables['postmeta'] = $postmeta;
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
if ( 'options' === $table || $get_all ) {
|
113 |
+
|
114 |
+
/**
|
115 |
+
* table options
|
116 |
+
*/
|
117 |
+
$options = new stdClass();
|
118 |
+
$options->include_fields = array(
|
119 |
+
'option_value'
|
120 |
+
);
|
121 |
+
$options->id_field = 'option_id';
|
122 |
+
|
123 |
+
self::$tables['options'] = $options;
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( 'terms' === $table || $get_all ) {
|
128 |
+
|
129 |
+
/**
|
130 |
+
* table terms
|
131 |
+
*/
|
132 |
+
$terms = new stdClass();
|
133 |
+
$terms->include_fields = array(
|
134 |
+
'name'
|
135 |
+
);
|
136 |
+
$terms->id_field = 'term_id';
|
137 |
+
|
138 |
+
self::$tables['terms'] = $terms;
|
139 |
+
|
140 |
+
}
|
141 |
+
|
142 |
+
if ( 'term_taxonomy' === $table || $get_all ) {
|
143 |
+
|
144 |
+
/**
|
145 |
+
* table term_taxonomy
|
146 |
+
*/
|
147 |
+
$term_taxonomy = new stdClass();
|
148 |
+
$term_taxonomy->include_fields = array(
|
149 |
+
'description'
|
150 |
+
);
|
151 |
+
$term_taxonomy->id_field = 'term_taxonomy_id';
|
152 |
+
|
153 |
+
self::$tables['term_taxonomy'] = $term_taxonomy;
|
154 |
+
|
155 |
+
}
|
156 |
+
|
157 |
+
if ( 'usermeta' === $table || $get_all ) {
|
158 |
+
|
159 |
+
/**
|
160 |
+
* table usermeta
|
161 |
+
*/
|
162 |
+
$usermeta = new stdClass();
|
163 |
+
$usermeta->include_fields = array(
|
164 |
+
'meta_value'
|
165 |
+
);
|
166 |
+
|
167 |
+
$usermeta->id_field = 'umeta_id';
|
168 |
+
|
169 |
+
self::$tables['usermeta'] = $usermeta;
|
170 |
+
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
if ( class_exists( 'WooCommerce' ) ) :
|
175 |
+
|
176 |
+
/**
|
177 |
+
* WooCommerce tables
|
178 |
+
*/
|
179 |
+
if ( 'woocommerce_attribute_taxonomies' === $table || $get_all ) {
|
180 |
+
/**
|
181 |
+
* table woocommerce_attribute_taxonomies
|
182 |
+
*/
|
183 |
+
$woocommerce_attribute_taxonomies = new stdClass();
|
184 |
+
$woocommerce_attribute_taxonomies->include_fields = array(
|
185 |
+
'attribute_label'
|
186 |
+
);
|
187 |
+
$woocommerce_attribute_taxonomies->id_field = 'attribute_id';
|
188 |
+
|
189 |
+
self::$tables['woocommerce_attribute_taxonomies'] = $woocommerce_attribute_taxonomies;
|
190 |
+
}
|
191 |
+
|
192 |
+
if ( 'woocommerce_order_items' === $table || $get_all ) {
|
193 |
+
/**
|
194 |
+
* table woocommerce_order_items
|
195 |
+
*/
|
196 |
+
$woocommerce_order_items = new stdClass();
|
197 |
+
$woocommerce_order_items->include_fields = array(
|
198 |
+
'order_item_name'
|
199 |
+
);
|
200 |
+
$woocommerce_order_items->id_field = 'order_item_id';
|
201 |
+
|
202 |
+
self::$tables['woocommerce_order_items'] = $woocommerce_order_items;
|
203 |
+
}
|
204 |
+
|
205 |
+
endif;
|
206 |
+
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Get table list
|
211 |
+
*/
|
212 |
+
public static function get_table_list() {
|
213 |
+
|
214 |
+
$spinner = WPGlobus::$PLUGIN_DIR_URL . 'includes/css/images/spinner.gif';
|
215 |
+
|
216 |
+
$list = '<ul>';
|
217 |
+
foreach ( self::$tables as $table => $data ) {
|
218 |
+
|
219 |
+
$list .= '<li id="' . $table . '">';
|
220 |
+
/** @noinspection DisconnectedForeachInstructionInspection */
|
221 |
+
$list .= '<span class="wpglobus-spinner" style="float:left;margin-right:10px;"><img src="' . $spinner . '" /></span>';
|
222 |
+
$list .= '<span class="wpglobus-result" style="float:left;width:20px;height:20px;"></span>';
|
223 |
+
$list .= '<span class=""><input type="checkbox" id="cb-' . $table . '" checked disabled /></span>';
|
224 |
+
$list .= $table;
|
225 |
+
$list .= '</li>';
|
226 |
+
|
227 |
+
}
|
228 |
+
$list .= '<li id="wpglobus_options">';
|
229 |
+
$list .= '<span class="wpglobus-spinner" style="float:left;margin-right:10px;"><img src="' . $spinner . '" /></span>';
|
230 |
+
$list .= '<span class="wpglobus-result" style="float:left;width:20px;height:20px;"></span>';
|
231 |
+
$list .= '<span class=""><input type="checkbox" id="cb-wpglobus_options" name="cb-wpglobus_options" /></span>';
|
232 |
+
$list .= esc_html( __( 'Remove the WPGlobus settings (not recommended)', 'wpglobus' ) );
|
233 |
+
$list .= '</li>';
|
234 |
+
$list .= '</ul>';
|
235 |
+
|
236 |
+
return $list;
|
237 |
+
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Ajax action handler
|
242 |
+
*
|
243 |
+
* @param string[] $order
|
244 |
+
*/
|
245 |
+
public static function process_ajax( $order ) {
|
246 |
+
|
247 |
+
self::_set_log_file();
|
248 |
+
|
249 |
+
$_log = false;
|
250 |
+
|
251 |
+
if ( 'true' === $order['log'] ) {
|
252 |
+
$_log = true;
|
253 |
+
}
|
254 |
+
|
255 |
+
if ( $order['action'] === 'die' ) {
|
256 |
+
wp_send_json_success( $order );
|
257 |
+
}
|
258 |
+
|
259 |
+
if ( $order['action'] === 'wpglobus-reset' ) {
|
260 |
+
|
261 |
+
/**
|
262 |
+
* SELECT * FROM `wp_options` WHERE `option_name` REGEXP 'wpglobus'
|
263 |
+
*/
|
264 |
+
|
265 |
+
global $wpdb;
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Make table with prefix
|
269 |
+
*/
|
270 |
+
$table = $wpdb->prefix . 'options';
|
271 |
+
|
272 |
+
$query = "SELECT `option_id`, `option_name` FROM `$table` WHERE `option_name` REGEXP 'wpglobus'";
|
273 |
+
|
274 |
+
$ids = $wpdb->get_results( $query, ARRAY_A );
|
275 |
+
|
276 |
+
$records = array();
|
277 |
+
$fields = array();
|
278 |
+
|
279 |
+
foreach ( $ids as $data ) {
|
280 |
+
foreach ( $data as $field_id => $record_id ) {
|
281 |
+
if ( 'option_id' === $field_id ) {
|
282 |
+
$records[] = $record_id;
|
283 |
+
} else if ( 'option_name' === $field_id ) {
|
284 |
+
$fields[] = $record_id;
|
285 |
+
}
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
$result = true;
|
290 |
+
if ( ! empty( $records ) ) {
|
291 |
+
|
292 |
+
if ( $_log ) {
|
293 |
+
self::_log( $table, '', $fields, '' );
|
294 |
+
}
|
295 |
+
|
296 |
+
$set = implode( ',', $records );
|
297 |
+
$query = "DELETE FROM $table WHERE `option_id` IN ($set)";
|
298 |
+
$result = $wpdb->query( $query );
|
299 |
+
}
|
300 |
+
|
301 |
+
if ( false === $result ) {
|
302 |
+
wp_send_json_error( $order );
|
303 |
+
}
|
304 |
+
|
305 |
+
wp_send_json_success( $order );
|
306 |
+
|
307 |
+
}
|
308 |
+
|
309 |
+
if ( $order['action'] !== 'clean' ) {
|
310 |
+
wp_send_json_error( $order );
|
311 |
+
}
|
312 |
+
|
313 |
+
self::get_table( $order['table'] );
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Set of examples of sql queries
|
317 |
+
* @see http://dev.mysql.com/doc/refman/5.7/en/pattern-matching.html
|
318 |
+
* @see http://dev.mysql.com/doc/refman/5.7/en/regexp.html
|
319 |
+
*/
|
320 |
+
|
321 |
+
/**
|
322 |
+
* SELECT * FROM `wp_posts` WHERE 1=1 AND `post_status` REGEXP 'publish|draft' AND (
|
323 |
+
* `post_content` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}' OR
|
324 |
+
* `post_title` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}' OR
|
325 |
+
* `post_excerpt` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}' OR
|
326 |
+
* `post_content_filtered` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}' )
|
327 |
+
*/
|
328 |
+
|
329 |
+
/**
|
330 |
+
* SELECT * FROM `wp_postmeta` WHERE `meta_value` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
331 |
+
*/
|
332 |
+
|
333 |
+
/**
|
334 |
+
* SELECT * FROM `wp_options` WHERE `option_value` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
335 |
+
*/
|
336 |
+
|
337 |
+
/**
|
338 |
+
* SELECT * FROM `wp_terms` WHERE `name` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
339 |
+
*/
|
340 |
+
|
341 |
+
/**
|
342 |
+
* SELECT * FROM `wp_term_taxonomy` WHERE `description` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
343 |
+
*/
|
344 |
+
|
345 |
+
/**
|
346 |
+
* SELECT * FROM `wp_usermeta` WHERE `meta_value` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
347 |
+
*/
|
348 |
+
|
349 |
+
/**
|
350 |
+
* SELECT * FROM `wp_woocommerce_attribute_taxonomies` WHERE `attribute_label` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
351 |
+
*/
|
352 |
+
|
353 |
+
/**
|
354 |
+
* SELECT * FROM `wp_woocommerce_order_items` WHERE `order_item_name` REGEXP '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}'
|
355 |
+
*/
|
356 |
+
|
357 |
+
global $wpdb;
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Make table with prefix
|
361 |
+
*/
|
362 |
+
$table = $wpdb->prefix . $order['table'];
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Standard regexp
|
366 |
+
*/
|
367 |
+
$wpg_regexp = '{:[a-z]{2}|[[.[.]]:[a-z]{2}|<!--:[a-z]{2}';
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Post status
|
371 |
+
*/
|
372 |
+
$post_status = '';
|
373 |
+
if ( ! empty( self::$tables[ $order['table'] ]->post_status ) ) {
|
374 |
+
/**
|
375 |
+
* Example: AND `post_status` REGEXP 'publish|draft'
|
376 |
+
*/
|
377 |
+
$post_status = "AND post_status REGEXP '" . implode( '|', self::$tables[ $order['table'] ]->post_status ) . "' ";
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Set condition
|
382 |
+
*/
|
383 |
+
$condition = false;
|
384 |
+
if ( count( self::$tables[ $order['table'] ]->include_fields ) === 0 ) {
|
385 |
+
/** do nothing */
|
386 |
+
} else if ( count( self::$tables[ $order['table'] ]->include_fields ) === 1 ) {
|
387 |
+
/**
|
388 |
+
* one field
|
389 |
+
*/
|
390 |
+
$field = self::$tables[ $order['table'] ]->include_fields[0];
|
391 |
+
$condition = "AND $field REGEXP '$wpg_regexp'";
|
392 |
+
|
393 |
+
} else {
|
394 |
+
/**
|
395 |
+
* multiple fields
|
396 |
+
*/
|
397 |
+
$temp = array();
|
398 |
+
foreach ( self::$tables[ $order['table'] ]->include_fields as $field ) {
|
399 |
+
$temp[] = "$field REGEXP '$wpg_regexp'";
|
400 |
+
}
|
401 |
+
|
402 |
+
$condition = 'AND ( ' . implode( ' OR ', $temp ) . ' )';
|
403 |
+
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Set record ID
|
408 |
+
*/
|
409 |
+
$id = false;
|
410 |
+
if ( ! empty( self::$tables[ $order['table'] ]->id_field ) ) {
|
411 |
+
$id = self::$tables[ $order['table'] ]->id_field;
|
412 |
+
}
|
413 |
+
|
414 |
+
if ( ! $id ) {
|
415 |
+
wp_send_json_error( $order );
|
416 |
+
}
|
417 |
+
|
418 |
+
if ( ! $condition ) {
|
419 |
+
wp_send_json_error( $order );
|
420 |
+
}
|
421 |
+
|
422 |
+
$query = "SELECT $id FROM $table WHERE 1=1 $post_status $condition";
|
423 |
+
|
424 |
+
$ids = $wpdb->get_results( $query, ARRAY_A );
|
425 |
+
|
426 |
+
$result = true;
|
427 |
+
|
428 |
+
foreach ( $ids as $data ) {
|
429 |
+
|
430 |
+
foreach ( $data as $field_id => $record_id ) {
|
431 |
+
|
432 |
+
/** @noinspection DisconnectedForeachInstructionInspection */
|
433 |
+
$ifields = implode( ', ', self::$tables[ $order['table'] ]->include_fields );
|
434 |
+
|
435 |
+
$query1 = "SELECT $ifields FROM $table WHERE $field_id = '$record_id'";
|
436 |
+
|
437 |
+
/** @var array $record */
|
438 |
+
$record = $wpdb->get_results( $query1 );
|
439 |
+
|
440 |
+
$update_fields = array();
|
441 |
+
|
442 |
+
foreach ( self::$tables[ $order['table'] ]->include_fields as $include_field ) {
|
443 |
+
|
444 |
+
$value = $record[0]->$include_field;
|
445 |
+
|
446 |
+
$value = trim( $value );
|
447 |
+
if ( empty( $value ) ) {
|
448 |
+
continue;
|
449 |
+
}
|
450 |
+
|
451 |
+
$serialized = false;
|
452 |
+
if ( is_serialized( $value ) ) {
|
453 |
+
$serialized = true;
|
454 |
+
$value = maybe_unserialize( $value );
|
455 |
+
}
|
456 |
+
|
457 |
+
$converted = self::convert( $value );
|
458 |
+
|
459 |
+
if ( $_log ) {
|
460 |
+
self::_log( $table, $record_id, $value, $converted );
|
461 |
+
}
|
462 |
+
|
463 |
+
if ( $serialized ) {
|
464 |
+
$converted = maybe_serialize( $converted );
|
465 |
+
}
|
466 |
+
|
467 |
+
$update_fields[] = $include_field . "='" . $converted . "'";
|
468 |
+
|
469 |
+
} // endforeach;
|
470 |
+
|
471 |
+
if ( ! empty( $update_fields ) ) {
|
472 |
+
/**
|
473 |
+
* UPDATE record
|
474 |
+
*/
|
475 |
+
$updates = implode( ', ', $update_fields );
|
476 |
+
$upd_query = "UPDATE `$table` SET $updates WHERE `$field_id` = $record_id";
|
477 |
+
|
478 |
+
$res = $wpdb->query( $upd_query );
|
479 |
+
|
480 |
+
if ( false === $res ) {
|
481 |
+
$result = false;
|
482 |
+
}
|
483 |
+
|
484 |
+
}
|
485 |
+
|
486 |
+
} // endforeach
|
487 |
+
|
488 |
+
} // endforeach
|
489 |
+
|
490 |
+
if ( false === $result ) {
|
491 |
+
wp_send_json_error( $order );
|
492 |
+
}
|
493 |
+
|
494 |
+
wp_send_json_success( $order );
|
495 |
+
|
496 |
+
}
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Logger
|
500 |
+
*
|
501 |
+
* @param string $table
|
502 |
+
* @param string $id
|
503 |
+
* @param string $initial
|
504 |
+
* @param string $converted
|
505 |
+
*/
|
506 |
+
public static function _log( $table = '', $id = '', $initial = '', $converted = '' ) {
|
507 |
+
error_log( date( DATE_ATOM ) . "\n", 3, self::$log_file );
|
508 |
+
error_log( 'TABLE: ' . $table . "\n", 3, self::$log_file );
|
509 |
+
error_log( 'ID: ' . $id . "\n", 3, self::$log_file );
|
510 |
+
error_log( "BEFORE: \n" . print_r( $initial, true ) . "\n", 3, self::$log_file );
|
511 |
+
if ( empty($converted) ) {
|
512 |
+
error_log( "AFTER: \n(empty)\n", 3, self::$log_file );
|
513 |
+
} else {
|
514 |
+
error_log( "AFTER: \n" . print_r( $converted, true ) . "\n", 3, self::$log_file );
|
515 |
+
}
|
516 |
+
error_log( '=================' . "\n\n", 3, self::$log_file );
|
517 |
+
}
|
518 |
+
|
519 |
+
/**
|
520 |
+
* Enqueue js
|
521 |
+
*
|
522 |
+
* @return void
|
523 |
+
*/
|
524 |
+
public static function action__admin_print_scripts() {
|
525 |
+
|
526 |
+
$src = WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-clean' . WPGlobus::SCRIPT_SUFFIX() . '.js';
|
527 |
+
|
528 |
+
$result_icons['success'] = WPGlobus::$PLUGIN_DIR_URL . 'includes/css/images/success.png';
|
529 |
+
$result_icons['error'] = WPGlobus::$PLUGIN_DIR_URL . 'includes/css/images/error.png';
|
530 |
+
|
531 |
+
wp_enqueue_script(
|
532 |
+
'wpglobus-clean',
|
533 |
+
$src,
|
534 |
+
array( 'jquery' ),
|
535 |
+
WPGLOBUS_VERSION,
|
536 |
+
true
|
537 |
+
);
|
538 |
+
|
539 |
+
wp_localize_script(
|
540 |
+
'wpglobus-clean',
|
541 |
+
'WPGlobusClean',
|
542 |
+
array(
|
543 |
+
'version' => WPGLOBUS_VERSION,
|
544 |
+
'icons' => $result_icons,
|
545 |
+
'data' => array_merge( self::$tables, array( 'wpglobus_options' => new stdClass() ) )
|
546 |
+
)
|
547 |
+
);
|
548 |
+
|
549 |
+
|
550 |
+
}
|
551 |
+
|
552 |
+
/**
|
553 |
+
* Output the clean screen.
|
554 |
+
*
|
555 |
+
* @return void
|
556 |
+
*/
|
557 |
+
public static function screen() {
|
558 |
+
|
559 |
+
/**
|
560 |
+
* For Google Analytics
|
561 |
+
*/
|
562 |
+
$ga_campaign = '?utm_source=wpglobus-admin-clean&utm_medium=link&utm_campaign=clean-up-tool';
|
563 |
+
|
564 |
+
$url_wpglobus_site = WPGlobus_Utils::url_wpglobus_site();
|
565 |
+
// $url_wpglobus_site_home = $url_wpglobus_site . $ga_campaign;
|
566 |
+
$url_wpglobus_site_contact = $url_wpglobus_site . 'pg/contact-us/' . $ga_campaign;
|
567 |
+
$url_wpglobus_site_quick_start = $url_wpglobus_site . 'quick-start/' . $ga_campaign;
|
568 |
+
// $url_wpglobus_site_faq = $url_wpglobus_site . 'faq/' . $ga_campaign;
|
569 |
+
// $url_wpglobus_site_pro_support = $url_wpglobus_site . 'professional-support/' . $ga_campaign;
|
570 |
+
|
571 |
+
$url_wpglobus_logo = WPGlobus::$PLUGIN_DIR_URL . 'includes/css/images/wpglobus-logo-180x180.png';
|
572 |
+
|
573 |
+
?>
|
574 |
+
<style>
|
575 |
+
.wp-badge.wpglobus-badge {
|
576 |
+
background: #ffffff url(<?php echo esc_url( $url_wpglobus_logo ); ?>) no-repeat;
|
577 |
+
background-size: contain;
|
578 |
+
}
|
579 |
+
</style>
|
580 |
+
<div class="wrap about-wrap wpglobus-about-wrap clean-wrap wpglobus-clean">
|
581 |
+
<h1 class="wpglobus"><span class="wpglobus-wp">WP</span>Globus
|
582 |
+
<span class="wpglobus-version"><?php echo esc_html( WPGLOBUS_VERSION ); ?></span>
|
583 |
+
</h1>
|
584 |
+
|
585 |
+
<div class="wpglobus-motto"><?php esc_html_e( 'Multilingual Everything!', 'wpglobus' ); ?></div>
|
586 |
+
|
587 |
+
<div class="about-text">
|
588 |
+
<?php esc_html_e( 'WPGlobus is a family of WordPress plugins assisting you in making multilingual WordPress blogs and sites.', 'wpglobus' ); ?>
|
589 |
+
</div>
|
590 |
+
|
591 |
+
<div class="wp-badge wpglobus-badge"></div>
|
592 |
+
|
593 |
+
<h2 class="nav-tab-wrapper">
|
594 |
+
<a href="#" class="nav-tab nav-tab-active">
|
595 |
+
<?php esc_html_e( 'Clean-up Tool', 'wpglobus' ); ?>
|
596 |
+
</a>
|
597 |
+
<a href="<?php echo esc_url( $url_wpglobus_site_quick_start ); ?>"
|
598 |
+
target="_blank"
|
599 |
+
class="nav-tab">
|
600 |
+
<?php esc_html_e( 'Guide', 'wpglobus' ); ?>
|
601 |
+
</a>
|
602 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_settings() ); ?>" class="nav-tab">
|
603 |
+
<?php esc_html_e( 'Settings' ); ?>
|
604 |
+
</a>
|
605 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_addons() ); ?>" class="nav-tab">
|
606 |
+
<?php esc_html_e( 'Add-ons', 'wpglobus' ); ?>
|
607 |
+
</a>
|
608 |
+
<a href="<?php echo esc_url( $url_wpglobus_site_contact ); ?>" class="nav-tab">
|
609 |
+
<?php esc_html_e( 'Support', 'wpglobus' ); ?>
|
610 |
+
</a>
|
611 |
+
</h2>
|
612 |
+
|
613 |
+
<div style="color: white; background-color: red; padding: .5em; margin-top: 1em;">
|
614 |
+
<?php esc_html_e( 'WARNING: this operation is non-reversible. It is strongly recommended that you backup your database before proceeding.', 'wpglobus' ); ?>
|
615 |
+
</div>
|
616 |
+
|
617 |
+
<div style="padding: .5em">
|
618 |
+
<p><strong>
|
619 |
+
1. <?php esc_html_e( 'This tool should be used only if you plan to completely uninstall WPGlobus. By running it, you will remove ALL translations you have entered to your post, pages, etc., keeping only the MAIN language texts. Please make sure that all entries have some content in the main language. Otherwise, you might end up with empty titles, no content, no excerpts, blank comments and so on.', 'wpglobus' ); ?>
|
620 |
+
</strong></p>
|
621 |
+
<p><strong>
|
622 |
+
2. <?php esc_html_e( 'Make sure that your active theme does not have any code related to WPGlobus. Such code could be added by you or by a 3rd party developer. If that code runs without first verifying that WPGlobus is active, WordPress may die with a fatal error.', 'wpglobus' ); ?>
|
623 |
+
</strong></p>
|
624 |
+
</div>
|
625 |
+
|
626 |
+
<div style="color:red; background-color: white; padding: .5em">
|
627 |
+
<?php
|
628 |
+
$_message = esc_html( sprintf(
|
629 |
+
// translators: %1$s - language name, %2$s - language code. Do not remove.
|
630 |
+
__( 'The main language is currently set to %1$s (%2$s). ALL TEXTS THAT ARE NOT IN %1$s WILL BE DELETED! To change the main language, please go to {{settings}}.', 'wpglobus' ),
|
631 |
+
WPGlobus::Config()->en_language_name[ WPGlobus::Config()->default_language ],
|
632 |
+
WPGlobus::Config()->default_language )
|
633 |
+
);
|
634 |
+
$_settings_link = '<a href="'.esc_url( WPGlobus_Admin_Page::url_settings('languages') ).'">' . esc_html( 'Settings', 'wpglobus' ) . '</a>';
|
635 |
+
echo str_replace( '{{settings}}', $_settings_link, $_message );
|
636 |
+
?>
|
637 |
+
</div>
|
638 |
+
|
639 |
+
<hr />
|
640 |
+
<h3 id="about-to-clean">
|
641 |
+
<?php esc_html_e( 'You are about to clean the content of the following database tables:', 'wpglobus' ); ?>
|
642 |
+
</h3>
|
643 |
+
|
644 |
+
<?php echo self::get_table_list(); // WPCS: XSS ok. ?>
|
645 |
+
|
646 |
+
<hr />
|
647 |
+
|
648 |
+
<h3>
|
649 |
+
<?php esc_html_e( 'The operations log', 'wpglobus' ); ?>
|
650 |
+
</h3>
|
651 |
+
<div>
|
652 |
+
<?php esc_html_e( 'We are going to write a detailed log of all the database changes performed. It should help in the case you need to restore something important. The log will be written to the file:', 'wpglobus' ); ?>
|
653 |
+
</div>
|
654 |
+
<br />
|
655 |
+
<code>
|
656 |
+
<?php echo self::$log_file; // WPCS: XSS ok. ?>
|
657 |
+
</code>
|
658 |
+
<br />
|
659 |
+
<br />
|
660 |
+
<label>
|
661 |
+
<input type="checkbox" name="wpglobus-clean-log" id="wpglobus-clean-log" checked="checked" />
|
662 |
+
<?php esc_html_e( 'Uncheck if you do not want to write the operations log (we recommend to keep it checked)', 'wpglobus' ); ?>
|
663 |
+
|
664 |
+
</label>
|
665 |
+
<hr />
|
666 |
+
<h3>
|
667 |
+
<?php esc_html_e( 'You have been warned...', 'wpglobus' ); ?>
|
668 |
+
</h3>
|
669 |
+
<?php esc_html_e( 'Please confirm by checking the box below:', 'wpglobus' ); ?>
|
670 |
+
<div style="color:red; background-color: white; padding: .5em; margin: 1em 0;">
|
671 |
+
<?php esc_html_e( 'I have read and understood everything written on this page. I am aware that by using this tool I may loose some content of my website. I have made a database backup and know how to restore it if necessary. I am fully responsible for the results.', 'wpglobus' ); ?>
|
672 |
+
</div>
|
673 |
+
|
674 |
+
<label><input type="checkbox" name="wpglobus-clean-activate" id="wpglobus-clean-activate" /><?php esc_html_e( 'YES, I CONFIRM', 'wpglobus' ); ?>
|
675 |
+
</label>
|
676 |
+
<div class="return-to-dashboard">
|
677 |
+
<a id="wpglobus-clean-button" class="button button-primary hidden" href="#about-to-clean">
|
678 |
+
<?php esc_html_e( 'Process with the Clean-up', 'wpglobus' ); ?>
|
679 |
+
</a>
|
680 |
+
</div>
|
681 |
+
|
682 |
+
</div>
|
683 |
+
|
684 |
+
<?php
|
685 |
+
}
|
686 |
+
|
687 |
+
/**
|
688 |
+
* Convert string to text with default language
|
689 |
+
*
|
690 |
+
* @param mixed $data
|
691 |
+
*
|
692 |
+
* @return mixed $data
|
693 |
+
*/
|
694 |
+
public static function convert( $data ) {
|
695 |
+
|
696 |
+
if ( empty( $data ) ) {
|
697 |
+
return '';
|
698 |
+
}
|
699 |
+
|
700 |
+
if ( is_null( $data ) ) {
|
701 |
+
return $data;
|
702 |
+
}
|
703 |
+
|
704 |
+
if ( is_bool( $data ) ) {
|
705 |
+
return $data;
|
706 |
+
}
|
707 |
+
|
708 |
+
if ( is_float( $data ) ) {
|
709 |
+
return $data;
|
710 |
+
}
|
711 |
+
|
712 |
+
if ( is_int( $data ) ) {
|
713 |
+
return $data;
|
714 |
+
}
|
715 |
+
|
716 |
+
if ( is_string( $data ) ) {
|
717 |
+
$data = WPGlobus_Core::text_filter( $data, WPGlobus::Config()->default_language, WPGlobus::RETURN_EMPTY );
|
718 |
+
|
719 |
+
/**
|
720 |
+
* Set double apostrophe for mySQL UPDATE
|
721 |
+
*/
|
722 |
+
return str_replace( "'", "''", $data );
|
723 |
+
}
|
724 |
+
|
725 |
+
foreach ( $data as $key => $value ) {
|
726 |
+
if ( is_array( $data ) ) {
|
727 |
+
/** @noinspection AlterInForeachInspection */
|
728 |
+
$data[ $key ] = self::convert( $value );
|
729 |
+
} else if ( is_object( $data ) ) {
|
730 |
+
$data->$key = self::convert( $value );
|
731 |
+
}
|
732 |
+
}
|
733 |
+
|
734 |
+
return $data;
|
735 |
+
|
736 |
+
}
|
737 |
+
|
738 |
+
|
739 |
+
} //class
|
740 |
+
|
741 |
+
endif;
|
742 |
+
|
743 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-customize-options.php
|
4 |
+
*
|
5 |
+
* WPGlobus_Customize_Options
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Admin\Customizer
|
8 |
+
* @since 1.4.6
|
9 |
+
*
|
10 |
+
* @see http://www.narga.net/comprehensive-guide-wordpress-theme-options-with-customization-api/
|
11 |
+
* @see https://developer.wordpress.org/themes/advanced-topics/customizer-api/#top
|
12 |
+
* @see https://codex.wordpress.org/Theme_Customization_API
|
13 |
+
* @see #customize-controls
|
14 |
+
*/
|
15 |
+
|
16 |
+
/**
|
17 |
+
* wpglobus_option
|
18 |
+
* wpglobus_option_flags
|
19 |
+
* wpglobus_option_locale
|
20 |
+
* wpglobus_option_en_language_names
|
21 |
+
* wpglobus_option_language_names
|
22 |
+
* wpglobus_option_post_meta_settings
|
23 |
+
*/
|
24 |
+
|
25 |
+
/**
|
26 |
+
* WPGlobus option Customizer setting @see $wp_customize->add_setting
|
27 |
+
*
|
28 |
+
* wpglobus_option[last_tab] => are not used in customizer
|
29 |
+
*
|
30 |
+
* wpglobus_option[enabled_languages] => wpglobus_customize_enabled_languages
|
31 |
+
*
|
32 |
+
* wpglobus_option[more_languages] => are not used in customizer
|
33 |
+
*
|
34 |
+
* wpglobus_option[show_flag_name] => wpglobus_customize_language_selector_mode
|
35 |
+
*
|
36 |
+
* wpglobus_option[use_nav_menu] => wpglobus_customize_language_selector_menu
|
37 |
+
*
|
38 |
+
* wpglobus_option[selector_wp_list_pages]
|
39 |
+
* => Array
|
40 |
+
* (
|
41 |
+
* [show_selector] => 1 => wpglobus_customize_selector_wp_list_pages
|
42 |
+
* )
|
43 |
+
*
|
44 |
+
* wpglobus_option[css_editor] => wpglobus_customize_css_editor
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
if ( ! class_exists( 'WPGlobus_Customize_Options' ) ) :
|
48 |
+
|
49 |
+
|
50 |
+
if ( ! class_exists( 'WP_Customize_Control' ) ) {
|
51 |
+
require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Class WPGlobusTextBox.
|
56 |
+
* Adds textbox support to the theme customizer.
|
57 |
+
*
|
58 |
+
* @see wp-includes\class-wp-customize-control.php
|
59 |
+
*/
|
60 |
+
class WPGlobusTextBox extends WP_Customize_Control {
|
61 |
+
|
62 |
+
public $type = 'textbox';
|
63 |
+
|
64 |
+
public $content = '';
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Constructor.
|
68 |
+
*
|
69 |
+
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
|
70 |
+
* @param string $id Control ID.
|
71 |
+
* @param array $args Optional. Arguments to override class property defaults.
|
72 |
+
*/
|
73 |
+
public function __construct( $manager, $id, $args = array() ) {
|
74 |
+
$this->content = empty( $args['content'] ) ? '' : $args['content'];
|
75 |
+
$this->statuses = array( '' => esc_html__( 'Default', 'wpglobus' ) );
|
76 |
+
parent::__construct( $manager, $id, $args );
|
77 |
+
}
|
78 |
+
|
79 |
+
public function render_content() {
|
80 |
+
|
81 |
+
echo $this->content;
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Adds checkbox with title support to the theme customizer.
|
89 |
+
*
|
90 |
+
* @see wp-includes\class-wp-customize-control.php
|
91 |
+
*/
|
92 |
+
class WPGlobusCheckBox extends WP_Customize_Control {
|
93 |
+
|
94 |
+
public $type = 'wpglobus_checkbox';
|
95 |
+
|
96 |
+
public $title = '';
|
97 |
+
|
98 |
+
public function __construct( $manager, $id, $args = array() ) {
|
99 |
+
|
100 |
+
$this->title = empty( $args['title'] ) ? '' : $args['title'];
|
101 |
+
|
102 |
+
$this->statuses = array( '' => esc_html__( 'Default', 'wpglobus' ) );
|
103 |
+
|
104 |
+
parent::__construct( $manager, $id, $args );
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
public function render_content() {
|
109 |
+
|
110 |
+
?>
|
111 |
+
|
112 |
+
<label>
|
113 |
+
<?php if ( ! empty( $this->title ) ) : ?>
|
114 |
+
<span class="customize-control-title"><?php echo esc_html( $this->title ); ?></span>
|
115 |
+
<?php endif; ?>
|
116 |
+
<div style="display:flex;">
|
117 |
+
<div style="flex:1">
|
118 |
+
<input type="checkbox" value="<?php echo esc_attr( $this->value() ); ?>" <?php $this->link(); checked( $this->value() ); ?> />
|
119 |
+
</div>
|
120 |
+
<div style="flex:8">
|
121 |
+
<?php echo esc_html( $this->label ); ?>
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
<?php if ( ! empty( $this->description ) ) : ?>
|
125 |
+
<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
|
126 |
+
<?php endif; ?>
|
127 |
+
</label> <?php
|
128 |
+
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Adds link support to the theme customizer.
|
134 |
+
*
|
135 |
+
* @see wp-includes\class-wp-customize-control.php
|
136 |
+
*/
|
137 |
+
class WPGlobusLink extends WP_Customize_Control {
|
138 |
+
|
139 |
+
public $type = 'wpglobus_link';
|
140 |
+
|
141 |
+
public $args = array();
|
142 |
+
|
143 |
+
public function __construct( $manager, $id, $args = array() ) {
|
144 |
+
|
145 |
+
$this->args = $args;
|
146 |
+
|
147 |
+
$this->statuses = array( '' => esc_html__( 'Default', 'wpglobus' ) );
|
148 |
+
|
149 |
+
parent::__construct( $manager, $id, $args );
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
public function render_content() {
|
154 |
+
|
155 |
+
?>
|
156 |
+
|
157 |
+
<label>
|
158 |
+
<?php if ( ! empty( $this->args['title'] ) ) : ?>
|
159 |
+
<span class="customize-control-title"><?php echo esc_html( $this->args['title'] ); ?></span>
|
160 |
+
<?php endif; ?>
|
161 |
+
<a href="<?php echo $this->args['href']; // WPCS: XSS ok. ?>" target="_blank"><?php echo $this->args['text']; // WPCS: XSS ok. ?></a>
|
162 |
+
<?php if ( ! empty( $this->description ) ) : ?>
|
163 |
+
<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
|
164 |
+
<?php endif; ?>
|
165 |
+
</label> <?php
|
166 |
+
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Adds CheckBoxSet support to the theme customizer.
|
172 |
+
*
|
173 |
+
* @see wp-includes\class-wp-customize-control.php
|
174 |
+
*/
|
175 |
+
class WPGlobusCheckBoxSet extends WP_Customize_Control {
|
176 |
+
|
177 |
+
public $type = 'checkbox_set';
|
178 |
+
|
179 |
+
public $skeleton = '';
|
180 |
+
|
181 |
+
public $args = array();
|
182 |
+
|
183 |
+
public function __construct( $manager, $id, $args = array() ) {
|
184 |
+
$this->args = $args;
|
185 |
+
$this->statuses = array( '' => esc_html__( 'Default', 'wpglobus' ) );
|
186 |
+
|
187 |
+
$this->skeleton =
|
188 |
+
'<a href="{{edit-link}}" target="_blank"><span style="cursor:pointer;">Edit</span></a> ' .
|
189 |
+
'<img style="cursor:move;" {{flag}} /> ' .
|
190 |
+
'<input name="wpglobus_item_{{name}}" id="wpglobus_item_{{id}}" type="checkbox" checked="{{checked}}" ' .
|
191 |
+
' class="{{class}}" ' .
|
192 |
+
' data-order="{{order}}" data-language="{{language}}" disabled="{{disabled}}" />' .
|
193 |
+
'<span style="cursor:move;">{{item}}</span>';
|
194 |
+
|
195 |
+
parent::__construct( $manager, $id, $args );
|
196 |
+
|
197 |
+
}
|
198 |
+
|
199 |
+
public function render_content() { ?>
|
200 |
+
|
201 |
+
<label>
|
202 |
+
<?php if ( ! empty( $this->label ) ) : ?>
|
203 |
+
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
204 |
+
<?php endif;
|
205 |
+
if ( ! empty( $this->description ) ) : ?>
|
206 |
+
<span class="description customize-control-description"><?php echo esc_html($this->description); ?></span>
|
207 |
+
<?php endif;
|
208 |
+
|
209 |
+
$new_item = str_replace( '{{class}}', 'wpglobus-checkbox ' . $this->args['checkbox_class'], $this->skeleton );
|
210 |
+
echo '<div style="display:none;" id="wpglobus-item-skeleton">' . $new_item . '</div>'; // WPCS: XSS ok.
|
211 |
+
|
212 |
+
echo '<ul id="wpglobus-sortable" style="margin-top:10px;margin-left:20px;">';
|
213 |
+
|
214 |
+
foreach ( $this->args['items'] as $order => $item ) {
|
215 |
+
|
216 |
+
$disabled = $order == 0 ? ' disabled="disabled" ' : '';
|
217 |
+
|
218 |
+
$li_item = str_replace(
|
219 |
+
'{{flag}}',
|
220 |
+
'src="' . WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $item ] . '"',
|
221 |
+
$this->skeleton
|
222 |
+
);
|
223 |
+
$li_item = str_replace( '{{name}}', $item, $li_item );
|
224 |
+
$li_item = str_replace( '{{id}}', $item, $li_item );
|
225 |
+
$li_item = str_replace( 'checked="{{checked}}"', 'checked="checked"', $li_item );
|
226 |
+
$li_item = str_replace( 'disabled="{{disabled}}"', $disabled, $li_item );
|
227 |
+
$li_item = str_replace( '{{class}}', 'wpglobus-checkbox ' . $this->args['checkbox_class'], $li_item );
|
228 |
+
$li_item = str_replace( '{{item}}', WPGlobus::Config()->en_language_name[ $item ] . ' (' . $item . ')', $li_item );
|
229 |
+
$li_item = str_replace( '{{order}}', $order, $li_item );
|
230 |
+
$li_item = str_replace( '{{language}}', $item, $li_item );
|
231 |
+
$li_item = str_replace(
|
232 |
+
'{{edit-link}}',
|
233 |
+
admin_url() . 'admin.php?page=' . WPGlobus::LANGUAGE_EDIT_PAGE . '&action=edit&lang=' . $item . '"', $li_item
|
234 |
+
);
|
235 |
+
|
236 |
+
echo '<li>' . $li_item . '</li>'; // WPCS: XSS ok.
|
237 |
+
|
238 |
+
}
|
239 |
+
|
240 |
+
echo '</ul>'; ?>
|
241 |
+
|
242 |
+
</label> <hr /> <?php
|
243 |
+
|
244 |
+
}
|
245 |
+
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Adds Fields Settings Control support to the theme customizer.
|
250 |
+
*
|
251 |
+
* @see wp-includes\class-wp-customize-control.php
|
252 |
+
*/
|
253 |
+
class WPGlobusFieldsSettingsControl extends WP_Customize_Control {
|
254 |
+
|
255 |
+
public $type = 'wpglobus_fields_settings_control';
|
256 |
+
|
257 |
+
public $args = array();
|
258 |
+
|
259 |
+
public $section_template = '';
|
260 |
+
|
261 |
+
public function __construct( $manager, $id, $args = array() ) {
|
262 |
+
|
263 |
+
$this->args = $args;
|
264 |
+
|
265 |
+
$this->section_template = "<div id='wpglobus-settings-{{section}}' style='border-bottom:1px solid black;margin-bottom:5px;padding:5px;' class='items-box' data-section='{{section}}'>";
|
266 |
+
$this->section_template .= esc_html__( 'Section', 'wpglobus' ) . ": <a href='#' onclick='wp.customize.section({{section_id}}).expand();'><b>{{section_title}}</b></a>";
|
267 |
+
$this->section_template .= "<div class='items' style='padding-top:10px;'>{{items}}</div>";
|
268 |
+
$this->section_template .= "</div>";
|
269 |
+
|
270 |
+
parent::__construct( $manager, $id, $args );
|
271 |
+
|
272 |
+
}
|
273 |
+
|
274 |
+
public function render_content() {
|
275 |
+
?>
|
276 |
+
<div class="wpglobus-fields_settings_control_box" data-section-template="<?php echo $this->section_template; // WPCS: XSS ok. ?>">
|
277 |
+
<?php if ( $this->args['start_section'] ) : ?>
|
278 |
+
<div style="border-bottom:1px solid black;margin: 0 0 5px;padding-left:5px;">
|
279 |
+
<a href="#" onclick="jQuery('.wpglobus-fields_settings_control_box .items-box' ).css('display','block');"><b><?php esc_html_e( 'Show all sections', 'wpglobus' ); ?></b></a>
|
280 |
+
</div>
|
281 |
+
<input type="submit" style="float:right;" name="<?php echo WPGlobus_Customize_Options::$controls_save_button; // WPCS: XSS ok. ?>" id="<?php echo WPGlobus_Customize_Options::$controls_save_button; // WPCS: XSS ok. ?>" class="button button-primary save" value="<?php esc_html_e( 'Save & Reload', 'wpglobus' ); ?>">
|
282 |
+
<?php else: ?>
|
283 |
+
<div>
|
284 |
+
<?php if ( ! empty( $this->args['message'] ) ) {
|
285 |
+
echo $this->args['message']; // WPCS: XSS ok.
|
286 |
+
} ?>
|
287 |
+
</div>
|
288 |
+
<?php endif; ?>
|
289 |
+
</div> <!-- .wpglobus-fields_settings_control_box --> <?php
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Class WPGlobus_Customize_Options
|
295 |
+
*/
|
296 |
+
class WPGlobus_Customize_Options {
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Array of sections
|
300 |
+
*/
|
301 |
+
public static $sections = array();
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Array of settings
|
305 |
+
*/
|
306 |
+
public static $settings = array();
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Set transient key
|
310 |
+
*/
|
311 |
+
public static $enabled_post_types_key = 'wpglobus_customize_enabled_post_types';
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Set option key for customizer
|
315 |
+
*/
|
316 |
+
public static $options_key = 'wpglobus_customize_options';
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Save button ID
|
320 |
+
*/
|
321 |
+
public static $controls_save_button = 'wpglobus-user-controls-save';
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Current theme.
|
325 |
+
*
|
326 |
+
* @var WP_Theme
|
327 |
+
*/
|
328 |
+
public static $theme;
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Current theme name.
|
332 |
+
*
|
333 |
+
* @var string
|
334 |
+
*/
|
335 |
+
public static $theme_name = '';
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Array of disabled themes.
|
339 |
+
* @var string[]
|
340 |
+
*/
|
341 |
+
public static $disabled_themes = array();
|
342 |
+
|
343 |
+
public static function controller() {
|
344 |
+
|
345 |
+
self::$theme = wp_get_theme();
|
346 |
+
self::$theme_name = self::get_theme( 'name' );
|
347 |
+
|
348 |
+
self::$disabled_themes = array(
|
349 |
+
'customizr',
|
350 |
+
'customizr pro'
|
351 |
+
);
|
352 |
+
|
353 |
+
/**
|
354 |
+
* @since 1.7.7
|
355 |
+
* Don't standard loading of the option 'theme_mods_experon'. Theme uses redux.
|
356 |
+
* Don't standard behavior in customizer.
|
357 |
+
* @see https://wordpress.org/themes/experon/
|
358 |
+
*/
|
359 |
+
self::$disabled_themes[] = 'experon';
|
360 |
+
|
361 |
+
/**
|
362 |
+
* @since 2.3.12
|
363 |
+
* Don't standard behavior with links in Appearance section (requires installing an additional module).
|
364 |
+
* @see https://gwangi-theme.com/
|
365 |
+
*/
|
366 |
+
self::$disabled_themes[] = 'gwangi';
|
367 |
+
|
368 |
+
/**
|
369 |
+
* @since 2.5.21
|
370 |
+
* Is not correct saving the `Items Content` fields in some site configuration.
|
371 |
+
* @see https://wordpress.org/themes/newyork-city/
|
372 |
+
*/
|
373 |
+
self::$disabled_themes[] = 'newyork city';
|
374 |
+
|
375 |
+
add_action( 'wp_loaded', array( __CLASS__, 'init' ) );
|
376 |
+
|
377 |
+
/**
|
378 |
+
* @see \WP_Customize_Manager::wp_loaded
|
379 |
+
* It calls the `customize_register` action first,
|
380 |
+
* and then - the `customize_preview_init` action
|
381 |
+
*/
|
382 |
+
add_action( 'customize_register', array(
|
383 |
+
'WPGlobus_Customize_Options',
|
384 |
+
'action__customize_register'
|
385 |
+
) );
|
386 |
+
|
387 |
+
/**
|
388 |
+
* @since 1.6.0
|
389 |
+
*/
|
390 |
+
add_action( 'customize_register', array(
|
391 |
+
'WPGlobus_Customize_Options',
|
392 |
+
'action__customize_fields_settings'
|
393 |
+
) );
|
394 |
+
|
395 |
+
add_action( 'customize_preview_init', array(
|
396 |
+
'WPGlobus_Customize_Options',
|
397 |
+
'action__customize_preview_init'
|
398 |
+
), 11 );
|
399 |
+
|
400 |
+
/**
|
401 |
+
* This is called by wp-admin/customize.php
|
402 |
+
*/
|
403 |
+
|
404 |
+
add_action( 'customize_controls_enqueue_scripts', array(
|
405 |
+
'WPGlobus_Customize_Options',
|
406 |
+
'action__customize_controls_enqueue_scripts'
|
407 |
+
), 1010 );
|
408 |
+
|
409 |
+
add_action( 'wp_ajax_' . __CLASS__ . '_process_ajax', array(
|
410 |
+
'WPGlobus_Customize_Options',
|
411 |
+
'action__process_ajax'
|
412 |
+
) );
|
413 |
+
|
414 |
+
/**
|
415 |
+
* @since 1.9.8
|
416 |
+
*/
|
417 |
+
add_filter( 'wpglobus_customize_disabled_setting_mask', array(
|
418 |
+
__CLASS__,
|
419 |
+
'filter__disabled_setting_mask'
|
420 |
+
) );
|
421 |
+
|
422 |
+
}
|
423 |
+
|
424 |
+
/**
|
425 |
+
* Delayed processes.
|
426 |
+
* @since 1.6.0
|
427 |
+
*/
|
428 |
+
public static function init() {
|
429 |
+
|
430 |
+
/**
|
431 |
+
* Hook to modify the `$disabled_themes` array.
|
432 |
+
*
|
433 |
+
* @param string[] self ::$disabled_themes
|
434 |
+
* Enter the lowercase theme name (not slug, no dashes).
|
435 |
+
* For example, to disable the "Parallax One" theme,
|
436 |
+
* enter 'parallax one'.
|
437 |
+
*
|
438 |
+
* @see second param.
|
439 |
+
*
|
440 |
+
* @param string self::$theme_name Name of current theme.
|
441 |
+
* @param WP_Theme Object self::$theme Current theme.
|
442 |
+
*/
|
443 |
+
self::$disabled_themes = apply_filters( 'wpglobus_customizer_disabled_themes', self::$disabled_themes, self::$theme_name, self::$theme );
|
444 |
+
}
|
445 |
+
|
446 |
+
/**
|
447 |
+
* Ajax handler.
|
448 |
+
*/
|
449 |
+
public static function action__process_ajax() {
|
450 |
+
|
451 |
+
$result = true;
|
452 |
+
$ajax_return = array();
|
453 |
+
|
454 |
+
$post_order = isset( $_POST['order'] ) ? $_POST['order'] : null; // WPCS: input var ok, sanitization ok.
|
455 |
+
|
456 |
+
$order = array();
|
457 |
+
if ( $post_order ) {
|
458 |
+
$order['action'] = sanitize_text_field( $post_order['action'] );
|
459 |
+
$order['options'] = isset($post_order['options']) ? $post_order['options'] : array();
|
460 |
+
$order['controls'] = isset($post_order['controls']) ? $post_order['controls'] : array();
|
461 |
+
}
|
462 |
+
|
463 |
+
switch ( $order['action'] ) {
|
464 |
+
case 'wpglobus_customize_save':
|
465 |
+
/**
|
466 |
+
* Options array.
|
467 |
+
*
|
468 |
+
* @var array
|
469 |
+
*/
|
470 |
+
$options = get_option( WPGlobus::Config()->option );
|
471 |
+
|
472 |
+
foreach ( $order['options'] as $key => $value ) {
|
473 |
+
|
474 |
+
switch ( $key ) :
|
475 |
+
case 'show_selector':
|
476 |
+
$options['selector_wp_list_pages'][ $key ] = $value;
|
477 |
+
break;
|
478 |
+
case 'redirect_by_language':
|
479 |
+
// @todo check this option which do we really need?
|
480 |
+
$options['browser_redirect'][ $key ] = $value;
|
481 |
+
$options[ $key ] = $value;
|
482 |
+
break;
|
483 |
+
case 'use_nav_menu':
|
484 |
+
if ( '0' == $value ) {
|
485 |
+
$value = '';
|
486 |
+
} else {
|
487 |
+
$value = sanitize_text_field( $value );
|
488 |
+
}
|
489 |
+
$options[ $key ] = $value;
|
490 |
+
break;
|
491 |
+
case 'js_editor':
|
492 |
+
$value = trim($value);
|
493 |
+
if ( ! empty( $value ) ) {
|
494 |
+
$value = str_replace( '\"', '"', $value );
|
495 |
+
$value = str_replace( "\'", "'", $value );
|
496 |
+
$value = esc_html( $value );
|
497 |
+
}
|
498 |
+
$options[ $key ] = $value;
|
499 |
+
break;
|
500 |
+
default:
|
501 |
+
$options[ $key ] = $value;
|
502 |
+
endswitch;
|
503 |
+
|
504 |
+
}
|
505 |
+
|
506 |
+
update_option( WPGlobus::Config()->option, $options );
|
507 |
+
break;
|
508 |
+
|
509 |
+
case 'cb-controls-save':
|
510 |
+
$options = get_option( self::$options_key );
|
511 |
+
|
512 |
+
if ( empty( $order['controls'] ) ) {
|
513 |
+
if ( ! empty( $options['customize_user_control'][ self::$theme_name ] ) ) {
|
514 |
+
unset( $options['customize_user_control'][ self::$theme_name ] );
|
515 |
+
}
|
516 |
+
} else {
|
517 |
+
|
518 |
+
$cntrls = array();
|
519 |
+
foreach ( $order['controls'] as $cntr => $status ) {
|
520 |
+
$cntr = str_replace( '{{', '[', $cntr );
|
521 |
+
$cntr = str_replace( '}}', ']', $cntr );
|
522 |
+
|
523 |
+
$cntrls[ $cntr ] = $status;
|
524 |
+
}
|
525 |
+
|
526 |
+
$options['customize_user_control'][ self::$theme_name ] = $cntrls;
|
527 |
+
}
|
528 |
+
|
529 |
+
if ( empty( $options['customize_user_control'] ) ) {
|
530 |
+
unset( $options['customize_user_control'] );
|
531 |
+
}
|
532 |
+
|
533 |
+
if ( empty( $options ) ) {
|
534 |
+
delete_option( self::$options_key );
|
535 |
+
} else {
|
536 |
+
$result = update_option( self::$options_key, $options, false );
|
537 |
+
|
538 |
+
}
|
539 |
+
|
540 |
+
break;
|
541 |
+
}
|
542 |
+
|
543 |
+
if ( false === $result ) {
|
544 |
+
wp_send_json_error( $ajax_return );
|
545 |
+
}
|
546 |
+
|
547 |
+
wp_send_json_success( $ajax_return );
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Section for message about unsupported theme.
|
552 |
+
*
|
553 |
+
* @param WP_Customize_Manager $wp_customize
|
554 |
+
* @param WP_Theme $theme
|
555 |
+
*/
|
556 |
+
public static function sorry_section( $wp_customize, $theme ) {
|
557 |
+
|
558 |
+
/**
|
559 |
+
* Sorry section
|
560 |
+
*/
|
561 |
+
$wp_customize->add_section( 'wpglobus_sorry_section', array(
|
562 |
+
'title' => esc_html__( 'WPGlobus', 'wpglobus' ),
|
563 |
+
'priority' => 0,
|
564 |
+
'panel' => 'wpglobus_settings_panel'
|
565 |
+
) );
|
566 |
+
|
567 |
+
$wp_customize->add_setting( 'sorry_message', array(
|
568 |
+
'type' => 'option',
|
569 |
+
'capability' => 'manage_options',
|
570 |
+
'transport' => 'postMessage'
|
571 |
+
) );
|
572 |
+
$wp_customize->add_control( new WPGlobusTextBox( $wp_customize,
|
573 |
+
'sorry_message', array(
|
574 |
+
'section' => 'wpglobus_sorry_section',
|
575 |
+
'settings' => 'sorry_message',
|
576 |
+
'priority' => 0,
|
577 |
+
'content' => self::get_content( 'sorry_message', $theme )
|
578 |
+
|
579 |
+
)
|
580 |
+
) );
|
581 |
+
|
582 |
+
}
|
583 |
+
|
584 |
+
/**
|
585 |
+
* Callback for register fields settings section.
|
586 |
+
*
|
587 |
+
* @since 1.6.0
|
588 |
+
*
|
589 |
+
* @param WP_Customize_Manager $wp_customize
|
590 |
+
*/
|
591 |
+
public static function action__customize_fields_settings( WP_Customize_Manager $wp_customize ) {
|
592 |
+
|
593 |
+
if ( ! self::is_theme_enabled() ) {
|
594 |
+
return;
|
595 |
+
}
|
596 |
+
|
597 |
+
/**
|
598 |
+
* SECTION: fields settings
|
599 |
+
*/
|
600 |
+
if ( 1 ) {
|
601 |
+
|
602 |
+
/**
|
603 |
+
* @since WP 4.5
|
604 |
+
* @see https://make.wordpress.org/core/2016/03/10/customizer-improvements-in-4-5/
|
605 |
+
*/
|
606 |
+
|
607 |
+
global $wp_version;
|
608 |
+
|
609 |
+
$start_section = true;
|
610 |
+
$message = '';
|
611 |
+
if ( version_compare( $wp_version, '4.5-RC1', '<' ) ) :
|
612 |
+
$start_section = false;
|
613 |
+
$message = esc_html__( 'You need to update WordPress to 4.5 or later to get Fields Settings section', 'wpglobus' );
|
614 |
+
endif;
|
615 |
+
|
616 |
+
self::$sections['wpglobus_fields_settings_section'] = 'wpglobus_fields_settings_section';
|
617 |
+
|
618 |
+
/**
|
619 |
+
* CSS tweak for the `description` field.
|
620 |
+
* @since 2.5.21
|
621 |
+
*/
|
622 |
+
$wp_customize->add_section( self::$sections['wpglobus_fields_settings_section'], array(
|
623 |
+
'title' => esc_html__( 'Fields Settings', 'wpglobus' ),
|
624 |
+
'priority' => 500,
|
625 |
+
'panel' => 'wpglobus_settings_panel',
|
626 |
+
'description' => '<div class="inner" style="background-color:#00669b;padding:5px 10px;border-radius:5px;font-size:14px;color:#fff;border:3px solid #00669b;">' .
|
627 |
+
self::get_content( 'settings_section_help' ) .
|
628 |
+
'</div>'
|
629 |
+
) );
|
630 |
+
|
631 |
+
/** setting */
|
632 |
+
$wp_customize->add_setting( 'wpglobus_fields_settings_setting', array(
|
633 |
+
'type' => 'option',
|
634 |
+
'capability' => 'manage_options',
|
635 |
+
'transport' => 'postMessage'
|
636 |
+
) );
|
637 |
+
|
638 |
+
/** control */
|
639 |
+
$wp_customize->add_control( new WPGlobusFieldsSettingsControl( $wp_customize,
|
640 |
+
self::$sections['wpglobus_fields_settings_section'], array(
|
641 |
+
'section' => self::$sections['wpglobus_fields_settings_section'],
|
642 |
+
'settings' => 'wpglobus_fields_settings_setting',
|
643 |
+
'priority' => 0,
|
644 |
+
'start_section' => $start_section,
|
645 |
+
'message' => $message
|
646 |
+
|
647 |
+
)
|
648 |
+
) );
|
649 |
+
|
650 |
+
}
|
651 |
+
|
652 |
+
}
|
653 |
+
|
654 |
+
/**
|
655 |
+
* Callback for customize_register.
|
656 |
+
*
|
657 |
+
* @param WP_Customize_Manager $wp_customize
|
658 |
+
*/
|
659 |
+
public static function action__customize_register( WP_Customize_Manager $wp_customize ) {
|
660 |
+
|
661 |
+
/**
|
662 |
+
* WPGlobus panel
|
663 |
+
*/
|
664 |
+
$wp_customize->add_panel( 'wpglobus_settings_panel', array(
|
665 |
+
'priority' => 1010,
|
666 |
+
'capability' => 'edit_theme_options',
|
667 |
+
'theme_supports' => '',
|
668 |
+
'title' => esc_html__( 'WPGlobus Settings', 'wpglobus' ),
|
669 |
+
'description' => '<div style="background-color:#eee;padding:10px 5px;">' .
|
670 |
+
self::get_content( 'welcome_message' ) .
|
671 |
+
'</div>' . self::get_content( 'deactivate_message' ),
|
672 |
+
) );
|
673 |
+
|
674 |
+
if ( ! self::is_theme_enabled() ) {
|
675 |
+
|
676 |
+
self::sorry_section( $wp_customize, self::$theme );
|
677 |
+
|
678 |
+
return;
|
679 |
+
|
680 |
+
}
|
681 |
+
|
682 |
+
/**
|
683 |
+
* Updating options for customizer accordingly with WPGlobus::Config().
|
684 |
+
*/
|
685 |
+
/** wpglobus_customize_language_selector_mode <=> wpglobus_option[show_flag_name] */
|
686 |
+
update_option( 'wpglobus_customize_language_selector_mode', WPGlobus::Config()->show_flag_name );
|
687 |
+
|
688 |
+
/** */
|
689 |
+
if ( empty( WPGlobus::Config()->nav_menu ) ) {
|
690 |
+
/**
|
691 |
+
* Menu item '--- select navigation menu ---' has value 0.
|
692 |
+
* It is used when 'Language Selector Menu' setting is not selected.
|
693 |
+
*/
|
694 |
+
update_option( 'wpglobus_customize_language_selector_menu', '0' );
|
695 |
+
} else {
|
696 |
+
update_option( 'wpglobus_customize_language_selector_menu', WPGlobus::Config()->nav_menu );
|
697 |
+
}
|
698 |
+
|
699 |
+
/** wpglobus_customize_selector_wp_list_pages <=> wpglobus_option[selector_wp_list_pages][show_selector] */
|
700 |
+
update_option( 'wpglobus_customize_selector_wp_list_pages', WPGlobus::Config()->selector_wp_list_pages );
|
701 |
+
|
702 |
+
/** wpglobus_customize_css_editor <=> wpglobus_option[css_editor] */
|
703 |
+
update_option( 'wpglobus_customize_css_editor', WPGlobus::Config()->css_editor );
|
704 |
+
|
705 |
+
/** wpglobus_customize_redirect_by_language <=> wpglobus_option[browser_redirect][redirect_by_language] */
|
706 |
+
if ( empty( WPGlobus::Config()->browser_redirect['redirect_by_language'] ) || (int) WPGlobus::Config()->browser_redirect['redirect_by_language'] == 0 ) {
|
707 |
+
update_option( 'wpglobus_customize_redirect_by_language', '' );
|
708 |
+
} else {
|
709 |
+
update_option( 'wpglobus_customize_redirect_by_language', WPGlobus::Config()->browser_redirect['redirect_by_language'] );
|
710 |
+
}
|
711 |
+
|
712 |
+
/** wpglobus_customize_js_editor <=> wpglobus_option[js_editor] */
|
713 |
+
if ( empty( WPGlobus::Config()->js_editor ) ) {
|
714 |
+
update_option( 'wpglobus_customize_js_editor', '' );
|
715 |
+
} else {
|
716 |
+
update_option( 'wpglobus_customize_js_editor', WPGlobus::Config()->js_editor );
|
717 |
+
}
|
718 |
+
|
719 |
+
|
720 |
+
/** end updating options */
|
721 |
+
|
722 |
+
/**
|
723 |
+
* Init section priority.
|
724 |
+
*/
|
725 |
+
$section_priority = 0;
|
726 |
+
|
727 |
+
/**
|
728 |
+
* SECTION: Help.
|
729 |
+
*/
|
730 |
+
if ( 0 ) {
|
731 |
+
|
732 |
+
$section_priority = $section_priority + 0;
|
733 |
+
|
734 |
+
self::$sections['wpglobus_help_section'] = 'wpglobus_help_section';
|
735 |
+
$wp_customize->add_section( self::$sections['wpglobus_help_section'], array(
|
736 |
+
'title' => esc_html__( 'Help', 'wpglobus' ),
|
737 |
+
'priority' => $section_priority,
|
738 |
+
'panel' => 'wpglobus_settings_panel',
|
739 |
+
) );
|
740 |
+
|
741 |
+
$wp_customize->add_control( 'wpglobus_customize_add_onsZZZ', array(
|
742 |
+
'section' => self::$sections['wpglobus_help_section'],
|
743 |
+
'settings' => array(),
|
744 |
+
'type' => 'button',
|
745 |
+
)
|
746 |
+
);
|
747 |
+
}
|
748 |
+
/** end SECTION: Help */
|
749 |
+
|
750 |
+
/**
|
751 |
+
* SECTION: Language.
|
752 |
+
*/
|
753 |
+
if ( 1 ) {
|
754 |
+
|
755 |
+
$section_priority = $section_priority + 10;
|
756 |
+
|
757 |
+
$wp_customize->add_section( 'wpglobus_languages_section', array(
|
758 |
+
'title' => esc_html__( 'Languages', 'wpglobus' ),
|
759 |
+
'priority' => $section_priority,
|
760 |
+
'panel' => 'wpglobus_settings_panel'
|
761 |
+
) );
|
762 |
+
self::$sections['wpglobus_languages_section'] = 'wpglobus_languages_section';
|
763 |
+
|
764 |
+
/**
|
765 |
+
* Setting: Enabled languages.
|
766 |
+
*/
|
767 |
+
$wp_customize->add_setting( 'wpglobus_customize_enabled_languages', array(
|
768 |
+
'type' => 'option',
|
769 |
+
'capability' => 'manage_options',
|
770 |
+
'transport' => 'postMessage'
|
771 |
+
) );
|
772 |
+
$wp_customize->add_control( new WPGlobusCheckBoxSet( $wp_customize,
|
773 |
+
'wpglobus_customize_enabled_languages', array(
|
774 |
+
'section' => 'wpglobus_languages_section',
|
775 |
+
'settings' => 'wpglobus_customize_enabled_languages',
|
776 |
+
'priority' => 0,
|
777 |
+
'items' => WPGlobus::Config()->enabled_languages,
|
778 |
+
'label' => esc_html__( 'Enabled Languages', 'wpglobus' ),
|
779 |
+
'checkbox_class' => 'wpglobus-listen-change wpglobus-language-item',
|
780 |
+
'description' => esc_html__( 'These languages are currently enabled on your site.', 'wpglobus' )
|
781 |
+
|
782 |
+
)
|
783 |
+
) );
|
784 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_enabled_languages']['type'] = 'checkbox_set';
|
785 |
+
/** @see option wpglobus_option['enabled_languages'] */
|
786 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_enabled_languages']['option'] = 'enabled_languages';
|
787 |
+
|
788 |
+
/**
|
789 |
+
* Setting: Add languages.
|
790 |
+
*/
|
791 |
+
/** Generate array $more_languages */
|
792 |
+
/** @var array $more_languages */
|
793 |
+
$more_languages = array();
|
794 |
+
$more_languages['select'] = '---- select ----';
|
795 |
+
|
796 |
+
foreach ( WPGlobus::Config()->flag as $code => $file ) {
|
797 |
+
if ( ! in_array( $code, WPGlobus::Config()->enabled_languages ) ) {
|
798 |
+
$lang_in_en = '';
|
799 |
+
if ( ! empty( WPGlobus::Config()->en_language_name[ $code ] ) ) {
|
800 |
+
$lang_in_en = ' (' . WPGlobus::Config()->en_language_name[ $code ] . ')';
|
801 |
+
}
|
802 |
+
// '<img src="' . WPGlobus::Config()->flags_url . $file . '" />'
|
803 |
+
$more_languages[ $code ] = WPGlobus::Config()->language_name[ $code ] . $lang_in_en;
|
804 |
+
}
|
805 |
+
}
|
806 |
+
|
807 |
+
$desc_add_languages =
|
808 |
+
esc_html__( 'Choose a language you would like to enable.', 'wpglobus' ).
|
809 |
+
'<br />'.
|
810 |
+
esc_html__( 'Press the [Save & Publish] button to confirm.', 'wpglobus' ).
|
811 |
+
'<br />';
|
812 |
+
$desc_add_languages .= sprintf(
|
813 |
+
// translators: %1$s and %2$s - placeholders to insert HTML link around 'here'
|
814 |
+
esc_html__( 'or Add new Language %1$s here %2$s', 'wpglobus' ),
|
815 |
+
'<a style="text-decoration:underline;" href="' . admin_url() . 'admin.php?page=' . WPGlobus::LANGUAGE_EDIT_PAGE . '&action=add" target="_blank">',
|
816 |
+
'</a>'
|
817 |
+
);
|
818 |
+
|
819 |
+
$wp_customize->add_setting( 'wpglobus_customize_add_language', array(
|
820 |
+
'type' => 'option',
|
821 |
+
'capability' => 'manage_options',
|
822 |
+
'transport' => 'postMessage'
|
823 |
+
) );
|
824 |
+
$wp_customize->add_control( 'wpglobus_add_languages_select_box', array(
|
825 |
+
'settings' => 'wpglobus_customize_add_language',
|
826 |
+
'label' => esc_html__( 'Add Languages', 'wpglobus' ),
|
827 |
+
'section' => 'wpglobus_languages_section',
|
828 |
+
'type' => 'select',
|
829 |
+
'priority' => 10,
|
830 |
+
'choices' => $more_languages,
|
831 |
+
'description' => $desc_add_languages
|
832 |
+
) );
|
833 |
+
//self::$settings[ 'wpglobus_languages_section' ][ 'wpglobus_customize_add_language' ] = 'select';
|
834 |
+
|
835 |
+
/**
|
836 |
+
* Setting: Language Selector Mode.
|
837 |
+
*/
|
838 |
+
$wp_customize->add_setting( 'wpglobus_customize_language_selector_mode', array(
|
839 |
+
'type' => 'option',
|
840 |
+
'capability' => 'manage_options',
|
841 |
+
'transport' => 'refresh'
|
842 |
+
#'transport' => 'postMessage'
|
843 |
+
) );
|
844 |
+
$wp_customize->add_control( 'wpglobus_customize_language_selector_mode', array(
|
845 |
+
'settings' => 'wpglobus_customize_language_selector_mode',
|
846 |
+
'label' => esc_html__( 'Language Selector Mode', 'wpglobus' ),
|
847 |
+
'section' => 'wpglobus_languages_section',
|
848 |
+
'type' => 'select',
|
849 |
+
'priority' => 20,
|
850 |
+
'choices' => array(
|
851 |
+
'code' => esc_html__( 'Two-letter Code with flag (en, ru, it, etc.)', 'wpglobus' ),
|
852 |
+
'full_name' => esc_html__( 'Full Name (English, Russian, Italian, etc.)', 'wpglobus' ),
|
853 |
+
/* @since 1.2.1 */
|
854 |
+
'name' => esc_html__( 'Full Name with flag (English, Russian, Italian, etc.)', 'wpglobus' ),
|
855 |
+
'empty' => esc_html__( 'Flags only', 'wpglobus' )
|
856 |
+
),
|
857 |
+
'description' => esc_html__( 'Choose the way language name and country flag are shown in the drop-down menu', 'wpglobus' )
|
858 |
+
) );
|
859 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_language_selector_mode']['type'] = 'select';
|
860 |
+
/** @see option wpglobus_option['show_flag_name'] */
|
861 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_language_selector_mode']['option'] = 'show_flag_name';
|
862 |
+
|
863 |
+
/**
|
864 |
+
* @see https://make.wordpress.org/core/2016/03/22/implementing-selective-refresh-support-for-widgets/
|
865 |
+
* @see https://make.wordpress.org/core/2016/03/10/customizer-improvements-in-4-5/
|
866 |
+
*
|
867 |
+
* $wp_customize->selective_refresh->add_partial( 'wpglobus_customize_language_selector_mode', array(
|
868 |
+
* 'selector' => '#site-navigation',
|
869 |
+
* 'render_callback' => function() {
|
870 |
+
* wp_nav_menu();
|
871 |
+
* },
|
872 |
+
* ) );
|
873 |
+
* // */
|
874 |
+
|
875 |
+
/**
|
876 |
+
* Setting: Language Selector Menu.
|
877 |
+
*/
|
878 |
+
/** @var array $nav_menus */
|
879 |
+
$nav_menus = WPGlobus::_get_nav_menus();
|
880 |
+
|
881 |
+
$menus = array();
|
882 |
+
|
883 |
+
foreach ( $nav_menus as $menu ) {
|
884 |
+
$menus[ $menu->slug ] = $menu->name;
|
885 |
+
}
|
886 |
+
if ( ! empty( $nav_menus ) && count( $nav_menus ) > 1 ) {
|
887 |
+
$menus['all'] = 'All';
|
888 |
+
}
|
889 |
+
if ( ! empty( $nav_menus ) ) {
|
890 |
+
array_unshift(
|
891 |
+
$menus,
|
892 |
+
'--- ' . esc_html__('select navigation menu', 'wpglobus'). ' ---'
|
893 |
+
);
|
894 |
+
}
|
895 |
+
|
896 |
+
if ( empty( $menus ) ) {
|
897 |
+
|
898 |
+
$wp_customize->add_control( new WPGlobusLink( $wp_customize,
|
899 |
+
'wpglobus_customize_language_selector_menu', array(
|
900 |
+
'section' => 'wpglobus_languages_section',
|
901 |
+
'title' => esc_html__( 'Language Selector Menu', 'wpglobus' ),
|
902 |
+
'settings' => array(),
|
903 |
+
'priority' => 30,
|
904 |
+
'type' => 'wpglobus_link',
|
905 |
+
/**
|
906 |
+
* We are in Customizer, so we can "focus" to the menus and not go to menus in admin.
|
907 |
+
* The JS code and the message below are copied from
|
908 |
+
* @see WP_Nav_Menu_Widget::form
|
909 |
+
*/
|
910 |
+
'href' => esc_attr( 'javascript: wp.customize.panel( "nav_menus" ).focus();' ),
|
911 |
+
'text' => esc_html__( 'No menus have been created yet. Create some.', 'wpglobus' ),
|
912 |
+
'description' => esc_html__( 'Choose the navigation menu where the language selector will be shown', 'wpglobus' ),
|
913 |
+
)
|
914 |
+
) );
|
915 |
+
|
916 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_language_selector_menu']['type'] = 'wpglobus_link';
|
917 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_language_selector_menu']['option'] = array();
|
918 |
+
|
919 |
+
} else {
|
920 |
+
|
921 |
+
$wp_customize->add_setting( 'wpglobus_customize_language_selector_menu', array(
|
922 |
+
'type' => 'option',
|
923 |
+
'capability' => 'manage_options',
|
924 |
+
'transport' => 'postMessage'
|
925 |
+
) );
|
926 |
+
$wp_customize->add_control( 'wpglobus_customize_language_selector_menu', array(
|
927 |
+
'settings' => 'wpglobus_customize_language_selector_menu',
|
928 |
+
'label' => esc_html__( 'Language Selector Menu', 'wpglobus' ),
|
929 |
+
'section' => 'wpglobus_languages_section',
|
930 |
+
'type' => 'select',
|
931 |
+
'priority' => 30,
|
932 |
+
'choices' => $menus,
|
933 |
+
'description' => esc_html__( 'Choose the navigation menu where the language selector will be shown', 'wpglobus' ),
|
934 |
+
) );
|
935 |
+
|
936 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_language_selector_menu']['type'] = 'select';
|
937 |
+
/** @see option wpglobus_option['use_nav_menu'] */
|
938 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_language_selector_menu']['option'] = 'use_nav_menu';
|
939 |
+
|
940 |
+
}
|
941 |
+
|
942 |
+
/**
|
943 |
+
* Setting: "All Pages" menus Language selector.
|
944 |
+
*/
|
945 |
+
$wp_customize->add_setting( 'wpglobus_customize_selector_wp_list_pages', array(
|
946 |
+
'type' => 'option',
|
947 |
+
'capability' => 'manage_options',
|
948 |
+
'transport' => 'postMessage'
|
949 |
+
) );
|
950 |
+
$wp_customize->add_control( new WPGlobusCheckBox( $wp_customize,
|
951 |
+
'wpglobus_customize_selector_wp_list_pages', array(
|
952 |
+
'settings' => 'wpglobus_customize_selector_wp_list_pages',
|
953 |
+
'title' => esc_html__( '"All Pages" menus Language selector', 'wpglobus' ),
|
954 |
+
'section' => 'wpglobus_languages_section',
|
955 |
+
'priority' => 40,
|
956 |
+
'label' => esc_html__( 'Adds language selector to the menus that automatically list all existing pages (using `wp_list_pages`)', 'wpglobus' ),
|
957 |
+
)
|
958 |
+
) );
|
959 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_selector_wp_list_pages']['type'] = 'wpglobus_checkbox';
|
960 |
+
/** @see option wpglobus_option['selector_wp_list_pages']['show_selector'] */
|
961 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_selector_wp_list_pages']['option'] = 'show_selector';
|
962 |
+
|
963 |
+
/**
|
964 |
+
* Setting: Custom CSS.
|
965 |
+
*/
|
966 |
+
$wp_customize->add_setting( 'wpglobus_customize_css_editor', array(
|
967 |
+
'type' => 'option',
|
968 |
+
'capability' => 'manage_options',
|
969 |
+
'transport' => 'postMessage'
|
970 |
+
) );
|
971 |
+
$wp_customize->add_control( 'wpglobus_customize_css_editor', array(
|
972 |
+
'settings' => 'wpglobus_customize_css_editor',
|
973 |
+
'label' => esc_html__( 'Custom CSS', 'wpglobus' ),
|
974 |
+
'section' => 'wpglobus_languages_section',
|
975 |
+
'type' => 'textarea',
|
976 |
+
'priority' => 50,
|
977 |
+
'description' => esc_html__( 'Here you can enter the CSS rules to adjust the language selector menu for your theme. Look at the examples in the `style-samples.css` file.', 'wpglobus' ),
|
978 |
+
) );
|
979 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_css_editor']['type'] = 'textarea';
|
980 |
+
/** @see option wpglobus_option['css_editor'] */
|
981 |
+
self::$settings['wpglobus_languages_section']['wpglobus_customize_css_editor']['option'] = 'css_editor';
|
982 |
+
|
983 |
+
}
|
984 |
+
/** end SECTION: Language */
|
985 |
+
|
986 |
+
/**
|
987 |
+
* SECTION: Post types.
|
988 |
+
*/
|
989 |
+
if ( 1 ) {
|
990 |
+
|
991 |
+
$section_priority = $section_priority + 10;
|
992 |
+
|
993 |
+
$section = 'wpglobus_post_types_section';
|
994 |
+
|
995 |
+
$wp_customize->add_section( $section, array(
|
996 |
+
'title' => esc_html__( 'Post types', 'wpglobus' ),
|
997 |
+
'priority' => $section_priority,
|
998 |
+
'panel' => 'wpglobus_settings_panel'
|
999 |
+
) );
|
1000 |
+
self::$sections[ $section ] = $section;
|
1001 |
+
|
1002 |
+
if ( false === ( $enabled_post_types = get_transient( self::$enabled_post_types_key ) ) ) {
|
1003 |
+
|
1004 |
+
$post_types = get_post_types();
|
1005 |
+
|
1006 |
+
$enabled_post_types = array();
|
1007 |
+
|
1008 |
+
foreach ( $post_types as $post_type ) {
|
1009 |
+
/**
|
1010 |
+
* @see "SECTION: Post types" in includes\options\class-wpglobus-options.php for complete post type array.
|
1011 |
+
*/
|
1012 |
+
if ( ! in_array( $post_type, WPGlobus_Post_Types::hidden_types(), true ) ) {
|
1013 |
+
|
1014 |
+
/**
|
1015 |
+
* Obsolete from 1.9.10.
|
1016 |
+
* @todo Remove after testing.
|
1017 |
+
*/
|
1018 |
+
/**
|
1019 |
+
|
1020 |
+
if ( in_array( $post_type, array( 'post', 'page' ) ) ) {
|
1021 |
+
$enabled_post_types[ $post_type ] = $post_type;
|
1022 |
+
continue;
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
foreach ( WPGlobus::O()->vendors_scripts as $script => $status ) {
|
1026 |
+
|
1027 |
+
if ( empty( $status ) ) {
|
1028 |
+
continue;
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
if ( $script == 'ACF' || $script == 'ACFPRO' ) {
|
1032 |
+
if ( in_array( $post_type, array( 'acf-field-group', 'acf-field', 'acf' ) ) ) {
|
1033 |
+
continue 2;
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
if ( $script == 'WOOCOMMERCE' ) {
|
1038 |
+
if ( in_array(
|
1039 |
+
$post_type,
|
1040 |
+
array(
|
1041 |
+
'product',
|
1042 |
+
'product_tag',
|
1043 |
+
'product_cat',
|
1044 |
+
'shop_order',
|
1045 |
+
'shop_coupon',
|
1046 |
+
'product_variation',
|
1047 |
+
'shop_order_refund',
|
1048 |
+
'shop_webhook'
|
1049 |
+
)
|
1050 |
+
) ) {
|
1051 |
+
continue 2;
|
1052 |
+
}
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
if ( $script == 'WPCF7' ) {
|
1056 |
+
if ( in_array( $post_type, array( 'wpcf7_contact_form' ) ) ) {
|
1057 |
+
continue 2;
|
1058 |
+
}
|
1059 |
+
}
|
1060 |
+
|
1061 |
+
}
|
1062 |
+
// */
|
1063 |
+
|
1064 |
+
$enabled_post_types[ $post_type ] = $post_type;
|
1065 |
+
|
1066 |
+
}
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
set_transient( self::$enabled_post_types_key, $enabled_post_types, 60 );
|
1070 |
+
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
foreach ( $enabled_post_types as $post_type ) :
|
1074 |
+
|
1075 |
+
$status = '';
|
1076 |
+
|
1077 |
+
if ( isset( WPGlobus::Config()->extended_options['post_type'][ $post_type ] ) ) {
|
1078 |
+
|
1079 |
+
if ( WPGlobus::Config()->extended_options['post_type'][ $post_type ] == 1 ) {
|
1080 |
+
$status = '1';
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
} else {
|
1084 |
+
$status = '1';
|
1085 |
+
}
|
1086 |
+
|
1087 |
+
update_option( 'wpglobus_customize_post_type_' . $post_type, $status );
|
1088 |
+
|
1089 |
+
endforeach;
|
1090 |
+
|
1091 |
+
$i = 0;
|
1092 |
+
foreach ( $enabled_post_types as $post_type ) :
|
1093 |
+
|
1094 |
+
$pst = 'wpglobus_customize_post_type_' . $post_type;
|
1095 |
+
|
1096 |
+
$wp_customize->add_setting( $pst, array(
|
1097 |
+
'type' => 'option',
|
1098 |
+
'capability' => 'manage_options',
|
1099 |
+
'transport' => 'postMessage'
|
1100 |
+
) );
|
1101 |
+
|
1102 |
+
$title = '';
|
1103 |
+
if ( $i == 0 ) {
|
1104 |
+
$title = esc_html__( 'Uncheck to disable WPGlobus', 'wpglobus' );
|
1105 |
+
}
|
1106 |
+
|
1107 |
+
$wp_customize->add_control( new WPGlobusCheckBox( $wp_customize,
|
1108 |
+
$pst, array(
|
1109 |
+
'settings' => $pst,
|
1110 |
+
'title' => $title,
|
1111 |
+
'label' => $post_type,
|
1112 |
+
'section' => $section,
|
1113 |
+
#'default' => '1',
|
1114 |
+
'priority' => 10,
|
1115 |
+
)
|
1116 |
+
) );
|
1117 |
+
|
1118 |
+
$i ++;
|
1119 |
+
self::$settings[ $section ][ $pst ]['type'] = 'wpglobus_checkbox';
|
1120 |
+
/** @see option wpglobus_option['post_type'] */
|
1121 |
+
self::$settings[ $section ][ $pst ]['option'] = 'post_type';
|
1122 |
+
|
1123 |
+
endforeach;
|
1124 |
+
|
1125 |
+
};
|
1126 |
+
/** end SECTION: Post types */
|
1127 |
+
|
1128 |
+
/**
|
1129 |
+
* SECTION: Redirect.
|
1130 |
+
*/
|
1131 |
+
if ( 1 ) {
|
1132 |
+
|
1133 |
+
$section_priority = $section_priority + 10;
|
1134 |
+
|
1135 |
+
self::$sections['wpglobus_redirect_section'] = 'wpglobus_redirect_section';
|
1136 |
+
|
1137 |
+
$wp_customize->add_section( self::$sections['wpglobus_redirect_section'], array(
|
1138 |
+
'title' => esc_html__( 'Redirect', 'wpglobus' ),
|
1139 |
+
'priority' => $section_priority,
|
1140 |
+
'panel' => 'wpglobus_settings_panel',
|
1141 |
+
) );
|
1142 |
+
|
1143 |
+
/**
|
1144 |
+
* Option
|
1145 |
+
* [browser_redirect] => Array
|
1146 |
+
* (
|
1147 |
+
* [redirect_by_language] => 0
|
1148 |
+
* )
|
1149 |
+
*/
|
1150 |
+
|
1151 |
+
/**
|
1152 |
+
* Setting wpglobus_customize_redirect_by_language.
|
1153 |
+
*/
|
1154 |
+
$wp_customize->add_setting( 'wpglobus_customize_redirect_by_language', array(
|
1155 |
+
'type' => 'option',
|
1156 |
+
'capability' => 'manage_options',
|
1157 |
+
'transport' => 'postMessage'
|
1158 |
+
) );
|
1159 |
+
$wp_customize->add_control( new WPGlobusCheckBox( $wp_customize,
|
1160 |
+
'wpglobus_customize_redirect_by_language', array(
|
1161 |
+
'section' => self::$sections['wpglobus_redirect_section'],
|
1162 |
+
'settings' => 'wpglobus_customize_redirect_by_language',
|
1163 |
+
'title' => esc_html__( 'Choose the language automatically, based on:', 'wpglobus' ),
|
1164 |
+
'priority' => 10,
|
1165 |
+
'label' => esc_html__( 'Preferred language set in the browser', 'wpglobus' ),
|
1166 |
+
'description' => esc_html__('When a user comes to the site for the first time, try to find the best matching language version of the page.', 'wpglobus')
|
1167 |
+
)
|
1168 |
+
) );
|
1169 |
+
|
1170 |
+
self::$settings[ self::$sections['wpglobus_redirect_section'] ]['wpglobus_customize_redirect_by_language']['type'] = 'wpglobus_checkbox';
|
1171 |
+
/** @see option wpglobus_option[browser_redirect][redirect_by_language] */
|
1172 |
+
self::$settings[ self::$sections['wpglobus_redirect_section'] ]['wpglobus_customize_redirect_by_language']['option'] = 'redirect_by_language';
|
1173 |
+
|
1174 |
+
}
|
1175 |
+
/** end SECTION: Redirect */
|
1176 |
+
|
1177 |
+
/**
|
1178 |
+
* SECTION: Custom JS Code.
|
1179 |
+
*/
|
1180 |
+
if ( 1 ) {
|
1181 |
+
|
1182 |
+
$section_priority = $section_priority + 10;
|
1183 |
+
|
1184 |
+
self::$sections['wpglobus_js_editor_section'] = 'wpglobus_js_editor_section';
|
1185 |
+
|
1186 |
+
/**
|
1187 |
+
* Setting 'wpglobus_customize_js_editor'.
|
1188 |
+
*/
|
1189 |
+
|
1190 |
+
/**
|
1191 |
+
* class WP_Customize_Code_Editor_Control
|
1192 |
+
* @since WordPress 4.9.0
|
1193 |
+
* @see https://developer.wordpress.org/reference/classes/wp_customize_code_editor_control/
|
1194 |
+
*/
|
1195 |
+
if ( ! class_exists('WP_Customize_Code_Editor_Control') ) {
|
1196 |
+
|
1197 |
+
$content = esc_html__( 'To add a Custom JS Code in Customizer, you need to upgrade WordPress to version 4.9 or later.', 'wpglobus' );
|
1198 |
+
$content .= '<br /><br />' .
|
1199 |
+
esc_html__( 'With your version of WordPress, please use the', 'wpglobus' ) .
|
1200 |
+
' <a style="text-decoration:underline;" target="_blank" href="' . esc_url( admin_url() . 'admin.php?page=' . WPGlobus::OPTIONS_PAGE_SLUG . '&tab=0' ) . '">' .
|
1201 |
+
esc_html__( 'WPGlobus Settings page', 'wpglobus' ) .
|
1202 |
+
'.</a>';
|
1203 |
+
|
1204 |
+
$wp_customize->add_section( self::$sections['wpglobus_js_editor_section'], array(
|
1205 |
+
'title' => esc_html__( 'Custom JS Code', 'wpglobus' ),
|
1206 |
+
'priority' => $section_priority,
|
1207 |
+
'panel' => 'wpglobus_settings_panel',
|
1208 |
+
) );
|
1209 |
+
|
1210 |
+
$wp_customize->add_setting( 'wpglobus_customize_js_editor', array(
|
1211 |
+
'type' => 'option',
|
1212 |
+
'capability' => 'manage_options',
|
1213 |
+
'transport' => 'postMessage'
|
1214 |
+
) );
|
1215 |
+
|
1216 |
+
$wp_customize->add_control( new WPGlobusTextBox( $wp_customize,
|
1217 |
+
'wpglobus_customize_js_editor', array(
|
1218 |
+
'section' => self::$sections['wpglobus_js_editor_section'],
|
1219 |
+
'settings' => 'wpglobus_customize_js_editor',
|
1220 |
+
'content' => $content
|
1221 |
+
)
|
1222 |
+
) );
|
1223 |
+
|
1224 |
+
} else {
|
1225 |
+
|
1226 |
+
$wp_customize->add_section( self::$sections['wpglobus_js_editor_section'], array(
|
1227 |
+
'title' => esc_html__( 'Custom JS Code', 'wpglobus' ),
|
1228 |
+
'priority' => $section_priority,
|
1229 |
+
'panel' => 'wpglobus_settings_panel',
|
1230 |
+
) );
|
1231 |
+
|
1232 |
+
|
1233 |
+
$wp_customize->add_setting( 'wpglobus_customize_js_editor', array(
|
1234 |
+
'type' => 'option',
|
1235 |
+
'capability' => 'manage_options',
|
1236 |
+
'transport' => 'postMessage'
|
1237 |
+
) );
|
1238 |
+
$wp_customize->add_control( new WP_Customize_Code_Editor_Control( $wp_customize,
|
1239 |
+
'wpglobus_customize_js_editor', array(
|
1240 |
+
'code_type' => 'javascript',
|
1241 |
+
#'mode' => 'javascript',
|
1242 |
+
'input_attrs' => array('rows'=>80),
|
1243 |
+
'section' => self::$sections['wpglobus_js_editor_section'],
|
1244 |
+
'settings' => 'wpglobus_customize_js_editor',
|
1245 |
+
'title' => esc_html__( 'Title', 'wpglobus' ),
|
1246 |
+
'priority' => 10,
|
1247 |
+
'label' => esc_html__( 'Custom JS Code', 'wpglobus' ),
|
1248 |
+
'description' => esc_html__( '(Paste your JS code here.)', 'wpglobus' )
|
1249 |
+
)
|
1250 |
+
) );
|
1251 |
+
|
1252 |
+
self::$settings[ self::$sections['wpglobus_js_editor_section'] ]['wpglobus_customize_js_editor']['type'] = 'code_editor';
|
1253 |
+
/** @see option wpglobus_option['css_editor'] */
|
1254 |
+
self::$settings[ self::$sections['wpglobus_js_editor_section'] ]['wpglobus_customize_js_editor']['option'] = 'js_editor';
|
1255 |
+
|
1256 |
+
}
|
1257 |
+
}
|
1258 |
+
/** end SECTION: Custom JS Code */
|
1259 |
+
|
1260 |
+
/**
|
1261 |
+
* SECTION: Add ons.
|
1262 |
+
*/
|
1263 |
+
if ( 1 ) {
|
1264 |
+
|
1265 |
+
$section_priority = $section_priority + 10;
|
1266 |
+
|
1267 |
+
global $wp_version;
|
1268 |
+
|
1269 |
+
self::$sections['wpglobus_addons_section'] = 'wpglobus_addons_section';
|
1270 |
+
|
1271 |
+
if ( version_compare( $wp_version, '4.5-RC1', '<' ) ) {
|
1272 |
+
|
1273 |
+
$wp_customize->add_section( self::$sections['wpglobus_addons_section'], array(
|
1274 |
+
'title' => esc_html__( 'Add-ons', 'wpglobus' ),
|
1275 |
+
'priority' => $section_priority,
|
1276 |
+
'panel' => 'wpglobus_settings_panel',
|
1277 |
+
) );
|
1278 |
+
|
1279 |
+
/** Add ons setting */
|
1280 |
+
$wp_customize->add_setting( 'wpglobus_customize_add_ons', array(
|
1281 |
+
'type' => 'option',
|
1282 |
+
'capability' => 'manage_options',
|
1283 |
+
'transport' => 'postMessage',
|
1284 |
+
) );
|
1285 |
+
|
1286 |
+
$wp_customize->add_control( new WPGlobusCheckBox( $wp_customize,
|
1287 |
+
'wpglobus_customize_add_ons', array(
|
1288 |
+
'settings' => 'wpglobus_customize_add_ons',
|
1289 |
+
'title' => esc_html__( 'Title', 'wpglobus' ),
|
1290 |
+
'label' => esc_html__( 'Label', 'wpglobus' ),
|
1291 |
+
'section' => self::$sections['wpglobus_addons_section'],
|
1292 |
+
'type' => 'checkbox',
|
1293 |
+
'priority' => 10,
|
1294 |
+
'description' => esc_html__( 'Description', 'wpglobus' ),
|
1295 |
+
)
|
1296 |
+
) );
|
1297 |
+
|
1298 |
+
} else {
|
1299 |
+
|
1300 |
+
/**
|
1301 |
+
* Changes in WP 4.5
|
1302 |
+
* @link https://make.wordpress.org/core/2016/03/10/customizer-improvements-in-4-5/
|
1303 |
+
*/
|
1304 |
+
|
1305 |
+
$wp_customize->add_section( self::$sections['wpglobus_addons_section'], array(
|
1306 |
+
'title' => esc_html__( 'Add-ons', 'wpglobus' ),
|
1307 |
+
'priority' => $section_priority,
|
1308 |
+
'panel' => 'wpglobus_settings_panel',
|
1309 |
+
) );
|
1310 |
+
|
1311 |
+
$wp_customize->add_control( 'wpglobus_customize_add_ons', array(
|
1312 |
+
'section' => self::$sections['wpglobus_addons_section'],
|
1313 |
+
'settings' => array(),
|
1314 |
+
'type' => 'button',
|
1315 |
+
)
|
1316 |
+
);
|
1317 |
+
}
|
1318 |
+
}
|
1319 |
+
/** end SECTION: Add ons */
|
1320 |
+
|
1321 |
+
/**
|
1322 |
+
* Fires to add customize settings.
|
1323 |
+
*
|
1324 |
+
* @since 1.4.6
|
1325 |
+
*
|
1326 |
+
* @param WP_Customize_Manager $wp_customize The WP Customize Manager.
|
1327 |
+
*/
|
1328 |
+
do_action( 'wpglobus_customize_register', $wp_customize );
|
1329 |
+
|
1330 |
+
/** @var array $res */
|
1331 |
+
$res = apply_filters( 'wpglobus_customize_data', array(
|
1332 |
+
'sections' => self::$sections,
|
1333 |
+
'settings' => self::$settings,
|
1334 |
+
) );
|
1335 |
+
|
1336 |
+
self::$sections = $res['sections'];
|
1337 |
+
self::$settings = $res['settings'];
|
1338 |
+
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
/**
|
1342 |
+
* Get content for WPGlobusTextBox element.
|
1343 |
+
*
|
1344 |
+
* @param string $control
|
1345 |
+
* @param mixed $attrs
|
1346 |
+
*
|
1347 |
+
* @return string
|
1348 |
+
*/
|
1349 |
+
public static function get_content( $control = '', $attrs = null ) {
|
1350 |
+
|
1351 |
+
if ( '' == $control ) {
|
1352 |
+
return '';
|
1353 |
+
}
|
1354 |
+
|
1355 |
+
$content = '';
|
1356 |
+
switch ( $control ) :
|
1357 |
+
case 'settings_section_help' :
|
1358 |
+
$content = sprintf(
|
1359 |
+
esc_html__( 'Here you can specify which fields should be considered multilingual by WPGlobus. To exclude a field, uncheck it and then press the button %s below.', 'wpglobus'),
|
1360 |
+
'<strong>' . esc_html__( 'Save & Reload', 'wpglobus' ) . '</strong>'
|
1361 |
+
);
|
1362 |
+
|
1363 |
+
break;
|
1364 |
+
case 'welcome_message' :
|
1365 |
+
|
1366 |
+
$content = '<div style="width:100%;">' .
|
1367 |
+
esc_html__( 'Thank you for installing WPGlobus!', 'wpglobus' ) .
|
1368 |
+
'<br/>' .
|
1369 |
+
'• ' .
|
1370 |
+
'<a style="text-decoration:underline;" target="_blank" href="' . admin_url() . 'admin.php?page=' . WPGlobus::PAGE_WPGLOBUS_ABOUT . '">' .
|
1371 |
+
esc_html__( 'Read About WPGlobus', 'wpglobus' ) .
|
1372 |
+
'</a>' .
|
1373 |
+
'<br/>' .
|
1374 |
+
'• ' . esc_html__( 'Click the <strong>[Languages]</strong> tab at the left to setup the options.', 'wpglobus' ) .
|
1375 |
+
#'<br/>' .
|
1376 |
+
#'• ' . esc_html__( 'Use the <strong>[Languages Table]</strong> section to add a new language or to edit the language attributes: name, code, flag icon, etc.', 'wpglobus' ) .
|
1377 |
+
'<br/>' .
|
1378 |
+
'<br/>' .
|
1379 |
+
esc_html__( 'Should you have any questions or comments, please do not hesitate to contact us.', 'wpglobus' ) .
|
1380 |
+
'<br/>' .
|
1381 |
+
'<br/>' .
|
1382 |
+
'<em>' .
|
1383 |
+
esc_html__( 'Sincerely Yours,', 'wpglobus' ) .
|
1384 |
+
'<br/>' .
|
1385 |
+
esc_html__( 'The WPGlobus Team', 'wpglobus' ) .
|
1386 |
+
'</em>' .
|
1387 |
+
'</div>';
|
1388 |
+
|
1389 |
+
break;
|
1390 |
+
case 'deactivate_message' :
|
1391 |
+
|
1392 |
+
/**
|
1393 |
+
* For Google Analytics
|
1394 |
+
*/
|
1395 |
+
$ga_campaign = '?utm_source=wpglobus-admin-clean&utm_medium=link&utm_campaign=talk-to-us';
|
1396 |
+
|
1397 |
+
$url_wpglobus_site = WPGlobus_Utils::url_wpglobus_site();
|
1398 |
+
$url_wpglobus_site_submit_ticket = $url_wpglobus_site . 'support/submit-ticket/' . $ga_campaign;
|
1399 |
+
|
1400 |
+
$content = '<p><em>' .
|
1401 |
+
sprintf(
|
1402 |
+
esc_html(
|
1403 |
+
// translators: %?$s: HTML codes for hyperlink. Do not remove.
|
1404 |
+
__( 'We would hate to see you go. If something goes wrong, do not uninstall WPGlobus yet. Please %1$stalk to us%2$s and let us help!', 'wpglobus' ) ),
|
1405 |
+
'<a href="' . $url_wpglobus_site_submit_ticket . '" target="_blank" style="text-decoration:underline;">',
|
1406 |
+
'</a>'
|
1407 |
+
) .
|
1408 |
+
'</em></p>' .
|
1409 |
+
'<hr/>' .
|
1410 |
+
'<p><i class="el el-exclamation-sign" style="color:red"></i> <strong>' .
|
1411 |
+
esc_html( __( 'Please note that if you deactivate WPGlobus, your site will show all the languages together, mixed up. You will need to remove all translations, keeping only one language.', 'wpglobus' ) ) .
|
1412 |
+
'</strong></p>' .
|
1413 |
+
'<p>' .
|
1414 |
+
sprintf(
|
1415 |
+
// translators: %s: link to the Clean-up Tool
|
1416 |
+
esc_html__( 'If there are just a few places, you should edit them manually. To automatically remove all translations at once, you can use the %s. WARNING: The clean-up operation is irreversible, so use it only if you need to completely uninstall WPGlobus.', 'wpglobus' ),
|
1417 |
+
sprintf(
|
1418 |
+
// translators: %?$s: HTML codes for hyperlink. Do not remove.
|
1419 |
+
esc_html__( '%1$sClean-up Tool%2$s', 'wpglobus' ),
|
1420 |
+
'<a style="text-decoration:underline;" target="_blank" href="' . admin_url() . 'admin.php?page=' . WPGlobus::PAGE_WPGLOBUS_CLEAN . '">',
|
1421 |
+
'</a>'
|
1422 |
+
) ) .
|
1423 |
+
'</p>';
|
1424 |
+
|
1425 |
+
break;
|
1426 |
+
case 'sorry_message' :
|
1427 |
+
|
1428 |
+
$content = '<p><strong>' .
|
1429 |
+
sprintf(
|
1430 |
+
// translators: %s: name of current theme
|
1431 |
+
esc_html__( 'Sorry, WPGlobus customizer doesn\'t support current theme %s.', 'wpglobus' ),
|
1432 |
+
'<em>' . $attrs->__get( 'name' ) . '</em>'
|
1433 |
+
) .
|
1434 |
+
'<br />' .
|
1435 |
+
sprintf(
|
1436 |
+
// translators: %?$s: HTML codes for hyperlink. Do not remove.
|
1437 |
+
esc_html__( 'Please use %1$sWPGlobus options page%2$s instead.', 'wpglobus' ),
|
1438 |
+
'<a style="text-decoration:underline;" target="_blank" href="' . admin_url() . 'admin.php?page=' . WPGlobus::OPTIONS_PAGE_SLUG . '&tab=0">',
|
1439 |
+
'</a>'
|
1440 |
+
) .
|
1441 |
+
'</strong></p>';
|
1442 |
+
|
1443 |
+
break;
|
1444 |
+
endswitch;
|
1445 |
+
|
1446 |
+
return $content;
|
1447 |
+
|
1448 |
+
}
|
1449 |
+
|
1450 |
+
/**
|
1451 |
+
* Load Customize Preview JS.
|
1452 |
+
*
|
1453 |
+
* Used by hook: 'customize_preview_init'
|
1454 |
+
* @see 'customize_preview_init'
|
1455 |
+
*/
|
1456 |
+
public static function action__customize_preview_init() {
|
1457 |
+
|
1458 |
+
/*
|
1459 |
+
wp_enqueue_script(
|
1460 |
+
'wpglobus-customize-options-preview',
|
1461 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-customize-options-preview' .
|
1462 |
+
WPGlobus::SCRIPT_SUFFIX() . '.js',
|
1463 |
+
array( 'jquery' ),
|
1464 |
+
WPGLOBUS_VERSION,
|
1465 |
+
true
|
1466 |
+
);
|
1467 |
+
// */
|
1468 |
+
/*
|
1469 |
+
wp_localize_script(
|
1470 |
+
'wpglobus-customize-options-preview',
|
1471 |
+
'WPGlobusCustomize',
|
1472 |
+
array(
|
1473 |
+
'version' => WPGLOBUS_VERSION,
|
1474 |
+
#'blogname' => WPGlobus_Core::text_filter( get_option( 'blogname' ), WPGlobus::Config()->language ),
|
1475 |
+
#'blogdescription' => WPGlobus_Core::text_filter( get_option( 'blogdescription' ), WPGlobus::Config()->language )
|
1476 |
+
)
|
1477 |
+
); // */
|
1478 |
+
|
1479 |
+
}
|
1480 |
+
|
1481 |
+
/**
|
1482 |
+
* Load Customize Control JS.
|
1483 |
+
*/
|
1484 |
+
public static function action__customize_controls_enqueue_scripts() {
|
1485 |
+
|
1486 |
+
/**
|
1487 |
+
* Get customize_user_control options which there are specifically for every theme.
|
1488 |
+
*/
|
1489 |
+
$options = get_option( self::$options_key );
|
1490 |
+
if ( $options == '' ) {
|
1491 |
+
$options = null;
|
1492 |
+
} else {
|
1493 |
+
if ( empty( $options['customize_user_control'] ) ) {
|
1494 |
+
$options = null;
|
1495 |
+
} else {
|
1496 |
+
$options = $options['customize_user_control'];
|
1497 |
+
}
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
$i18n = array();
|
1501 |
+
$i18n['expandShrink'] = esc_html__('Expand/Shrink', 'wpglobus');
|
1502 |
+
|
1503 |
+
wp_register_script(
|
1504 |
+
'wpglobus-customize-options',
|
1505 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-customize-options' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
1506 |
+
array( 'jquery', 'jquery-ui-draggable' ),
|
1507 |
+
WPGLOBUS_VERSION,
|
1508 |
+
true
|
1509 |
+
);
|
1510 |
+
wp_enqueue_script( 'wpglobus-customize-options' );
|
1511 |
+
wp_localize_script(
|
1512 |
+
'wpglobus-customize-options',
|
1513 |
+
'WPGlobusCustomizeOptions',
|
1514 |
+
array(
|
1515 |
+
'version' => WPGLOBUS_VERSION,
|
1516 |
+
'i18n' => $i18n,
|
1517 |
+
'config' => WPGlobus::Config(),
|
1518 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
1519 |
+
'process_ajax' => __CLASS__ . '_process_ajax',
|
1520 |
+
'editLink' => admin_url() . 'admin.php?page=' . WPGlobus::LANGUAGE_EDIT_PAGE . '&action=edit&lang={{language}}"',
|
1521 |
+
'settings' => self::$settings,
|
1522 |
+
'sections' => self::$sections,
|
1523 |
+
'addonsPage' => admin_url() . 'plugin-install.php?tab=search&s=WPGlobus&source=WPGlobus',
|
1524 |
+
'themeName' => self::$theme_name,
|
1525 |
+
'themeEnabled' => self::is_theme_enabled() ? 'true' : 'false',
|
1526 |
+
'helpButton' => '<span style="float:right;cursor:pointer;" class="wpglobus-customize-icon-help customize-help-toggle dashicons dashicons-editor-help" tabindex="0" aria-expanded="false"></span>',
|
1527 |
+
'userControl' => $options,
|
1528 |
+
'userControlSaveButton' => self::$controls_save_button,
|
1529 |
+
'userControlIcon' => WPGlobus::$PLUGIN_DIR_URL . 'includes/css/images/checkbox-icon.png',
|
1530 |
+
'userControlIconClass' => 'wpglobus-customize-user-control-icon',
|
1531 |
+
'userControlBoxSelector' => '.wpglobus-fields_settings_control_box .items-box'
|
1532 |
+
# @see WPGlobusFieldsSettingsControl class
|
1533 |
+
)
|
1534 |
+
);
|
1535 |
+
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
/**
|
1539 |
+
* Get current theme or its property.
|
1540 |
+
*
|
1541 |
+
* @since 1.6.0
|
1542 |
+
*
|
1543 |
+
* @param string $param
|
1544 |
+
*
|
1545 |
+
* @return string|WP_Theme
|
1546 |
+
*/
|
1547 |
+
public static function get_theme( $param = '' ) {
|
1548 |
+
|
1549 |
+
if ( 'name' === $param ) {
|
1550 |
+
return strtolower( self::$theme->name );
|
1551 |
+
}
|
1552 |
+
|
1553 |
+
return self::$theme;
|
1554 |
+
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
/**
|
1558 |
+
* Check for enabled theme.
|
1559 |
+
*
|
1560 |
+
* @since 1.6.0
|
1561 |
+
* @return boolean
|
1562 |
+
*/
|
1563 |
+
public static function is_theme_enabled() {
|
1564 |
+
|
1565 |
+
if ( in_array( self::$theme_name, self::$disabled_themes ) ) {
|
1566 |
+
return false;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
return true;
|
1570 |
+
}
|
1571 |
+
|
1572 |
+
|
1573 |
+
/**
|
1574 |
+
* Filter to disable the making multilingual our own settings.
|
1575 |
+
*
|
1576 |
+
* @since 1.9.8
|
1577 |
+
* @return array
|
1578 |
+
*/
|
1579 |
+
public static function filter__disabled_setting_mask($disabled_setting_mask) {
|
1580 |
+
$disabled_setting_mask[] = 'wpglobus_customize_js_editor';
|
1581 |
+
return $disabled_setting_mask;
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
} // class WPGlobus_Customize_Options.
|
1585 |
+
|
1586 |
+
endif;
|
1587 |
+
|
1588 |
+
# --- EOF
|
trunk/includes/admin/class-wpglobus-dashboard-news.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class WPGlobus_Dashboard_News
|
5 |
+
* @since 1.7.7
|
6 |
+
*/
|
7 |
+
class WPGlobus_Dashboard_News {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* WPGlobus_Dashboard_News constructor.
|
11 |
+
*/
|
12 |
+
public function __construct() {
|
13 |
+
add_action( 'wp_dashboard_setup', array(
|
14 |
+
$this,
|
15 |
+
'action__wp_dashboard_setup'
|
16 |
+
) );
|
17 |
+
|
18 |
+
add_filter( 'wpglobus_localize_feed_url', array(
|
19 |
+
$this,
|
20 |
+
'filter__wpglobus_localize_feed_url'
|
21 |
+
), 0, 2 );
|
22 |
+
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Do not localize feed URL because we have news only in English.
|
27 |
+
*
|
28 |
+
* @param bool $need_to_localize
|
29 |
+
* @param SimplePie $feed
|
30 |
+
*
|
31 |
+
* @return bool
|
32 |
+
*/
|
33 |
+
public function filter__wpglobus_localize_feed_url( $need_to_localize, $feed ) {
|
34 |
+
|
35 |
+
return $need_to_localize && WPGlobus::URL_WPGLOBUS_SITE . 'feed/' !== $feed->feed_url;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Setup the dashboard widget.
|
40 |
+
*/
|
41 |
+
public function action__wp_dashboard_setup() {
|
42 |
+
add_meta_box( 'wpglobus_dashboard_news',
|
43 |
+
esc_html__( 'WPGlobus News', 'wpglobus' ),
|
44 |
+
array(
|
45 |
+
$this,
|
46 |
+
'dashboard_widget'
|
47 |
+
),
|
48 |
+
'dashboard', 'side', 'high'
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Output the widget content.
|
54 |
+
*/
|
55 |
+
public function dashboard_widget() {
|
56 |
+
echo '<div class="rss-widget">';
|
57 |
+
wp_widget_rss_output( array(
|
58 |
+
'url' => WPGlobus::URL_WPGLOBUS_SITE . 'feed/',
|
59 |
+
'title' => esc_html__( 'WPGlobus News', 'wpglobus' ),
|
60 |
+
'items' => 3,
|
61 |
+
'show_summary' => 1,
|
62 |
+
'show_author' => 0,
|
63 |
+
'show_date' => 1
|
64 |
+
) );
|
65 |
+
echo '</div>';
|
66 |
+
}
|
67 |
+
}
|
trunk/includes/admin/class-wpglobus-language-edit-request.php
ADDED
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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+
* plugins/wpglobus/includes/admin/class-wpglobus-language-edit-request.php
|
5 |
+
*
|
6 |
+
* @package WPGlobus\Admin
|
7 |
+
* @since 1.9.7.1
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class WPGlobus_Language_Edit_Request
|
12 |
+
*/
|
13 |
+
class WPGlobus_Language_Edit_Request {
|
14 |
+
|
15 |
+
const NONCE_ACTION = 'wpglobus-language-edit';
|
16 |
+
|
17 |
+
const ACTION_NONE = '';
|
18 |
+
|
19 |
+
const ACTION_EDIT = 'edit';
|
20 |
+
|
21 |
+
const ACTION_DELETE = 'delete';
|
22 |
+
|
23 |
+
const ACTION_ADD = 'add';
|
24 |
+
|
25 |
+
const ACTION_DONE = 'done';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* GET['action']
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
+
protected $action = self::ACTION_NONE;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* GET['lang']
|
36 |
+
*
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
protected $lang = '';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* POST['submit']
|
43 |
+
*
|
44 |
+
* @var bool
|
45 |
+
*/
|
46 |
+
protected $is_submit = false;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* POST['delete']
|
50 |
+
*
|
51 |
+
* @var bool
|
52 |
+
*/
|
53 |
+
protected $is_delete = false;
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* POST['wpglobus_language_code']
|
58 |
+
*
|
59 |
+
* @var string
|
60 |
+
*/
|
61 |
+
protected $wpglobus_language_code = '';
|
62 |
+
|
63 |
+
/**
|
64 |
+
* POST['wpglobus_flags']
|
65 |
+
*
|
66 |
+
* @var string
|
67 |
+
*/
|
68 |
+
protected $wpglobus_flags = '';
|
69 |
+
|
70 |
+
/**
|
71 |
+
* POST['wpglobus_language_name']
|
72 |
+
*
|
73 |
+
* @var string
|
74 |
+
*/
|
75 |
+
protected $wpglobus_language_name = '';
|
76 |
+
|
77 |
+
/**
|
78 |
+
* POST['wpglobus_en_language_name']
|
79 |
+
*
|
80 |
+
* @var string
|
81 |
+
*/
|
82 |
+
protected $wpglobus_en_language_name = '';
|
83 |
+
|
84 |
+
/**
|
85 |
+
* POST['wpglobus_locale']
|
86 |
+
*
|
87 |
+
* @var string
|
88 |
+
*/
|
89 |
+
protected $wpglobus_locale = '';
|
90 |
+
|
91 |
+
/**
|
92 |
+
* WPGlobus_Language_Edit_Request constructor.
|
93 |
+
*/
|
94 |
+
public function __construct() {
|
95 |
+
$this->parse_request();
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Parse GET and POST.
|
100 |
+
*/
|
101 |
+
protected function parse_request() {
|
102 |
+
|
103 |
+
check_admin_referer( self::NONCE_ACTION );
|
104 |
+
|
105 |
+
if ( isset( $_GET['action'] ) && is_string( $_GET['action'] ) ) { // WPCS: input var ok, sanitization ok.
|
106 |
+
$action = sanitize_text_field( wp_unslash( $_GET['action'] ) ); // Input var okay.
|
107 |
+
if ( in_array( $action, array(
|
108 |
+
self::ACTION_ADD,
|
109 |
+
self::ACTION_EDIT,
|
110 |
+
self::ACTION_DELETE,
|
111 |
+
self::ACTION_DONE,
|
112 |
+
), true ) ) {
|
113 |
+
$this->action = $action;
|
114 |
+
} else {
|
115 |
+
$this->action = self::ACTION_NONE;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
if ( isset( $_GET['lang'] ) && is_string( $_GET['lang'] ) ) { // WPCS: input var ok, sanitization ok.
|
120 |
+
$this->lang = sanitize_text_field( wp_unslash( $_GET['lang'] ) ); // Input var okay.
|
121 |
+
}
|
122 |
+
|
123 |
+
if ( isset( $_POST['submit'] ) ) { // Input var okay.
|
124 |
+
$this->is_submit = true;
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( isset( $_POST['delete'] ) ) { // Input var okay.
|
128 |
+
$this->is_delete = true;
|
129 |
+
}
|
130 |
+
|
131 |
+
foreach (
|
132 |
+
array(
|
133 |
+
'wpglobus_language_code',
|
134 |
+
'wpglobus_flags',
|
135 |
+
'wpglobus_language_name',
|
136 |
+
'wpglobus_en_language_name',
|
137 |
+
'wpglobus_locale',
|
138 |
+
) as $var_name
|
139 |
+
) {
|
140 |
+
if ( isset( $_POST[ $var_name ] ) && is_string( $_POST[ $var_name ] ) ) { // WPCS: input var ok, sanitization ok.
|
141 |
+
$this->$var_name = sanitize_text_field( wp_unslash( $_POST[ $var_name ] ) ); // Input var okay.
|
142 |
+
}
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Getter.
|
148 |
+
*
|
149 |
+
* @return string
|
150 |
+
*/
|
151 |
+
public function get_action() {
|
152 |
+
return $this->action;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Getter.
|
157 |
+
*
|
158 |
+
* @return string
|
159 |
+
*/
|
160 |
+
public function get_lang() {
|
161 |
+
return $this->lang;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Getter.
|
166 |
+
*
|
167 |
+
* @return bool
|
168 |
+
*/
|
169 |
+
public function is_submit() {
|
170 |
+
return $this->is_submit;
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Getter.
|
175 |
+
*
|
176 |
+
* @return bool
|
177 |
+
*/
|
178 |
+
public function is_delete() {
|
179 |
+
return $this->is_delete;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Getter.
|
184 |
+
*
|
185 |
+
* @return string
|
186 |
+
*/
|
187 |
+
public function get_wpglobus_language_code() {
|
188 |
+
return $this->wpglobus_language_code;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Getter.
|
193 |
+
*
|
194 |
+
* @return string
|
195 |
+
*/
|
196 |
+
public function get_wpglobus_flags() {
|
197 |
+
return $this->wpglobus_flags;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Getter.
|
202 |
+
*
|
203 |
+
* @return string
|
204 |
+
*/
|
205 |
+
public function get_wpglobus_language_name() {
|
206 |
+
return $this->wpglobus_language_name;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Getter.
|
211 |
+
*
|
212 |
+
* @return string
|
213 |
+
*/
|
214 |
+
public function get_wpglobus_en_language_name() {
|
215 |
+
return $this->wpglobus_en_language_name;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Getter.
|
220 |
+
*
|
221 |
+
* @return string
|
222 |
+
*/
|
223 |
+
public function get_wpglobus_locale() {
|
224 |
+
return $this->wpglobus_locale;
|
225 |
+
}
|
226 |
+
|
227 |
+
public static function url_language_add() {
|
228 |
+
$url = add_query_arg( array(
|
229 |
+
'page' => WPGlobus::LANGUAGE_EDIT_PAGE,
|
230 |
+
'action' => self::ACTION_ADD,
|
231 |
+
), admin_url( 'admin.php' ) );
|
232 |
+
|
233 |
+
return wp_nonce_url( $url, self::NONCE_ACTION );
|
234 |
+
}
|
235 |
+
|
236 |
+
public static function url_language_edit( $language_code ) {
|
237 |
+
$url = add_query_arg( array(
|
238 |
+
'page' => WPGlobus::LANGUAGE_EDIT_PAGE,
|
239 |
+
'lang' => $language_code,
|
240 |
+
'action' => self::ACTION_EDIT,
|
241 |
+
), admin_url( 'admin.php' ) );
|
242 |
+
|
243 |
+
return wp_nonce_url( $url, self::NONCE_ACTION );
|
244 |
+
}
|
245 |
+
|
246 |
+
public static function url_language_delete( $language_code ) {
|
247 |
+
$url = add_query_arg( array(
|
248 |
+
'page' => WPGlobus::LANGUAGE_EDIT_PAGE,
|
249 |
+
'lang' => $language_code,
|
250 |
+
'action' => self::ACTION_DELETE,
|
251 |
+
), admin_url( 'admin.php' ) );
|
252 |
+
|
253 |
+
return wp_nonce_url( $url, self::NONCE_ACTION );
|
254 |
+
}
|
255 |
+
}
|
trunk/includes/admin/class-wpglobus-language-edit.php
ADDED
@@ -0,0 +1,494 @@
|
|
|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Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Load the Request class.
|
9 |
+
require_once dirname( __FILE__ ) . '/class-wpglobus-language-edit-request.php';
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class WPGlobus_Language_Edit
|
13 |
+
*/
|
14 |
+
class WPGlobus_Language_Edit {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* All flag files.
|
18 |
+
*
|
19 |
+
* @var array
|
20 |
+
*/
|
21 |
+
protected $all_flags = array();
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Current action
|
25 |
+
*
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
protected $action = WPGlobus_Language_Edit_Request::ACTION_ADD;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Language code
|
32 |
+
*
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
protected $language_code = '';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Language name
|
39 |
+
*
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
protected $language_name = '';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Language name in English
|
46 |
+
*
|
47 |
+
* @var string
|
48 |
+
*/
|
49 |
+
protected $en_language_name = '';
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Locale
|
53 |
+
*
|
54 |
+
* @var string
|
55 |
+
*/
|
56 |
+
protected $locale = '';
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Flag for the current language
|
60 |
+
*
|
61 |
+
* @var string
|
62 |
+
*/
|
63 |
+
protected $flag = '';
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Set to true when the form is submitted
|
67 |
+
*
|
68 |
+
* @var bool
|
69 |
+
*/
|
70 |
+
protected $submit = false;
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Diagnostic messages
|
74 |
+
*
|
75 |
+
* @var string[]
|
76 |
+
*/
|
77 |
+
protected $submit_messages = array();
|
78 |
+
|
79 |
+
/**
|
80 |
+
* The Request object
|
81 |
+
*
|
82 |
+
* @var WPGlobus_Language_Edit_Request
|
83 |
+
*/
|
84 |
+
protected $request;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Constructor
|
88 |
+
*/
|
89 |
+
public function __construct() {
|
90 |
+
|
91 |
+
$this->request = new WPGlobus_Language_Edit_Request();
|
92 |
+
|
93 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_DELETE === $this->request->get_action() ) {
|
94 |
+
$this->action = WPGlobus_Language_Edit_Request::ACTION_DELETE;
|
95 |
+
} elseif ( WPGlobus_Language_Edit_Request::ACTION_EDIT === $this->request->get_action() ) {
|
96 |
+
$this->action = WPGlobus_Language_Edit_Request::ACTION_EDIT;
|
97 |
+
}
|
98 |
+
|
99 |
+
$this->language_code = $this->request->get_lang();
|
100 |
+
|
101 |
+
if ( $this->request->is_submit() ) {
|
102 |
+
$this->submit = true;
|
103 |
+
$this->process_submit();
|
104 |
+
} elseif ( $this->request->is_delete() ) {
|
105 |
+
$this->process_delete();
|
106 |
+
$this->action = WPGlobus_Language_Edit_Request::ACTION_DONE;
|
107 |
+
} else {
|
108 |
+
$this->get_data();
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_DONE !== $this->action ) {
|
112 |
+
$this->display_table();
|
113 |
+
}
|
114 |
+
|
115 |
+
add_action( 'admin_footer', array( $this, 'on_print_scripts' ), 99 );
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Add script in admin footer
|
121 |
+
*/
|
122 |
+
public function on_print_scripts() {
|
123 |
+
|
124 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_DONE === $this->action ) {
|
125 |
+
$location = '?page=' . WPGlobus::OPTIONS_PAGE_SLUG;
|
126 |
+
// @formatter:off
|
127 |
+
?>
|
128 |
+
<script>jQuery(document).ready(function () {window.location = window.location.protocol + '//' + window.location.host + window.location.pathname + '<?php echo $location; // WPCS: XSS ok. ?>'});</script>
|
129 |
+
<?php
|
130 |
+
// @formatter:on
|
131 |
+
}
|
132 |
+
|
133 |
+
wp_enqueue_script(
|
134 |
+
'wpglobus-form',
|
135 |
+
WPGlobus::plugin_dir_url() . 'includes/js/wpglobus-form' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
136 |
+
array( 'jquery' ),
|
137 |
+
WPGLOBUS_VERSION,
|
138 |
+
true
|
139 |
+
);
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Process delete language action
|
145 |
+
*/
|
146 |
+
protected function process_delete() {
|
147 |
+
|
148 |
+
$config = WPGlobus::Config();
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Get options
|
152 |
+
*
|
153 |
+
* @var array
|
154 |
+
*/
|
155 |
+
$opts = get_option( $config->option );
|
156 |
+
|
157 |
+
if ( isset( $opts['enabled_languages'][ $this->language_code ] ) ) {
|
158 |
+
|
159 |
+
unset( $opts['enabled_languages'][ $this->language_code ] );
|
160 |
+
|
161 |
+
/** FIX: reset $opts['more_languages'] */
|
162 |
+
if ( array_key_exists( 'more_languages', $opts ) ) {
|
163 |
+
$opts['more_languages'] = '';
|
164 |
+
}
|
165 |
+
update_option( $config->option, $opts );
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
unset( $config->language_name[ $this->language_code ] );
|
170 |
+
update_option( $config->option_language_names, $config->language_name );
|
171 |
+
|
172 |
+
unset( $config->flag[ $this->language_code ] );
|
173 |
+
update_option( $config->option_flags, $config->flag );
|
174 |
+
|
175 |
+
unset( $config->en_language_name[ $this->language_code ] );
|
176 |
+
update_option( $config->option_en_language_names, $config->en_language_name );
|
177 |
+
|
178 |
+
unset( $config->locale[ $this->language_code ] );
|
179 |
+
update_option( $config->option_locale, $config->locale );
|
180 |
+
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Process submit action
|
185 |
+
*/
|
186 |
+
protected function process_submit() {
|
187 |
+
|
188 |
+
$code = $this->request->get_wpglobus_language_code();
|
189 |
+
if ( $code && $this->language_code === $code ) {
|
190 |
+
if ( $this->check_fields( $code, false ) ) {
|
191 |
+
$this->save();
|
192 |
+
$this->submit_messages['success'][] = __( 'Options updated', 'wpglobus' );
|
193 |
+
}
|
194 |
+
} else {
|
195 |
+
if ( $this->check_fields( $code ) ) {
|
196 |
+
$this->save( true );
|
197 |
+
$this->submit_messages['success'][] = __( 'Options updated', 'wpglobus' );
|
198 |
+
}
|
199 |
+
}
|
200 |
+
$this->get_flags();
|
201 |
+
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Save data language to DB
|
206 |
+
*
|
207 |
+
* @param bool $update_code If need to change language code.
|
208 |
+
*/
|
209 |
+
protected function save( $update_code = false ) {
|
210 |
+
|
211 |
+
$config = WPGlobus::Config();
|
212 |
+
|
213 |
+
$old_code = '';
|
214 |
+
if ( $update_code && WPGlobus_Language_Edit_Request::ACTION_EDIT === $this->action ) {
|
215 |
+
$old_code = $this->language_code ? $this->language_code : $old_code;
|
216 |
+
if ( isset( $config->language_name[ $old_code ] ) ) {
|
217 |
+
unset( $config->language_name[ $old_code ] );
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Get options
|
222 |
+
*
|
223 |
+
* @var array
|
224 |
+
*/
|
225 |
+
$opts = get_option( $config->option );
|
226 |
+
if ( isset( $opts['enabled_languages'][ $old_code ] ) ) {
|
227 |
+
unset( $opts['enabled_languages'][ $old_code ] );
|
228 |
+
update_option( $config->option, $opts );
|
229 |
+
}
|
230 |
+
if ( isset( $opts['more_languages'] ) && $old_code === $opts['more_languages'] ) {
|
231 |
+
unset( $opts['more_languages'] );
|
232 |
+
update_option( $config->option, $opts );
|
233 |
+
}
|
234 |
+
}
|
235 |
+
$config->language_name[ $this->language_code ] = $this->language_name;
|
236 |
+
update_option( $config->option_language_names, $config->language_name );
|
237 |
+
|
238 |
+
if ( $update_code && isset( $config->flag[ $old_code ] ) ) {
|
239 |
+
unset( $config->flag[ $old_code ] );
|
240 |
+
}
|
241 |
+
$config->flag[ $this->language_code ] = $this->flag;
|
242 |
+
update_option( $config->option_flags, $config->flag );
|
243 |
+
|
244 |
+
if ( $update_code && isset( $config->en_language_name[ $old_code ] ) ) {
|
245 |
+
unset( $config->en_language_name[ $old_code ] );
|
246 |
+
}
|
247 |
+
$config->en_language_name[ $this->language_code ] = $this->en_language_name;
|
248 |
+
update_option( $config->option_en_language_names, $config->en_language_name );
|
249 |
+
|
250 |
+
if ( $update_code && isset( $config->locale[ $old_code ] ) ) {
|
251 |
+
unset( $config->locale[ $old_code ] );
|
252 |
+
}
|
253 |
+
$config->locale[ $this->language_code ] = $this->locale;
|
254 |
+
update_option( $config->option_locale, $config->locale );
|
255 |
+
|
256 |
+
if ( $update_code ) {
|
257 |
+
$this->action = WPGlobus_Language_Edit_Request::ACTION_DONE;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Check form fields
|
263 |
+
*
|
264 |
+
* @param string $lang_code Language code.
|
265 |
+
* @param bool $check_code Use for language code existence check.
|
266 |
+
*
|
267 |
+
* @return bool True if no errors, false otherwise.
|
268 |
+
*/
|
269 |
+
protected function check_fields( $lang_code, $check_code = true ) {
|
270 |
+
$this->submit_messages['errors'] = array();
|
271 |
+
if ( $check_code && empty( $lang_code ) ) {
|
272 |
+
$this->submit_messages['errors'][] = __( 'Please enter a language code!', 'wpglobus' );
|
273 |
+
}
|
274 |
+
|
275 |
+
if ( $check_code && $this->language_exists( $lang_code ) ) {
|
276 |
+
$this->submit_messages['errors'][] = __( 'Language code already exists!', 'wpglobus' );
|
277 |
+
}
|
278 |
+
|
279 |
+
if ( ! $this->request->get_wpglobus_flags() ) {
|
280 |
+
$this->submit_messages['errors'][] = __( 'Please specify the language flag!', 'wpglobus' );
|
281 |
+
}
|
282 |
+
|
283 |
+
if ( ! $this->request->get_wpglobus_language_name() ) {
|
284 |
+
$this->submit_messages['errors'][] = __( 'Please enter the language name!', 'wpglobus' );
|
285 |
+
}
|
286 |
+
|
287 |
+
if ( ! $this->request->get_wpglobus_en_language_name() ) {
|
288 |
+
$this->submit_messages['errors'][] = __( 'Please enter the language name in English!', 'wpglobus' );
|
289 |
+
}
|
290 |
+
|
291 |
+
if ( ! $this->request->get_wpglobus_locale() ) {
|
292 |
+
$this->submit_messages['errors'][] = __( 'Please enter the locale!', 'wpglobus' );
|
293 |
+
}
|
294 |
+
|
295 |
+
$this->language_code = $lang_code;
|
296 |
+
$this->flag = $this->request->get_wpglobus_flags();
|
297 |
+
$this->language_name = $this->request->get_wpglobus_language_name();
|
298 |
+
$this->en_language_name = $this->request->get_wpglobus_en_language_name();
|
299 |
+
$this->locale = $this->request->get_wpglobus_locale();
|
300 |
+
|
301 |
+
if ( empty( $this->submit_messages['errors'] ) ) {
|
302 |
+
return true;
|
303 |
+
}
|
304 |
+
|
305 |
+
return false;
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Check existing language code in global $WPGlobus_Config
|
310 |
+
*
|
311 |
+
* @param string $code Language code.
|
312 |
+
*
|
313 |
+
* @return bool true if language code exists
|
314 |
+
*/
|
315 |
+
protected function language_exists( $code ) {
|
316 |
+
|
317 |
+
if ( array_key_exists( $code, WPGlobus::Config()->language_name ) ) {
|
318 |
+
return true;
|
319 |
+
}
|
320 |
+
|
321 |
+
return false;
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Get data for form fields
|
326 |
+
*/
|
327 |
+
protected function get_data() {
|
328 |
+
|
329 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_EDIT === $this->action
|
330 |
+
|| WPGlobus_Language_Edit_Request::ACTION_DELETE === $this->action ) {
|
331 |
+
|
332 |
+
$config = WPGlobus::Config();
|
333 |
+
|
334 |
+
$this->language_name = $config->language_name[ $this->language_code ];
|
335 |
+
$this->en_language_name = $config->en_language_name[ $this->language_code ];
|
336 |
+
$this->locale = $config->locale[ $this->language_code ];
|
337 |
+
$this->flag = $config->flag[ $this->language_code ];
|
338 |
+
}
|
339 |
+
$this->get_flags();
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* Display language form
|
344 |
+
*/
|
345 |
+
protected function display_table() {
|
346 |
+
|
347 |
+
$disabled = '';
|
348 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_EDIT === $this->action ) {
|
349 |
+
$header = __( 'Edit Language', 'wpglobus' );
|
350 |
+
} elseif ( WPGlobus_Language_Edit_Request::ACTION_DELETE === $this->action ) {
|
351 |
+
$header = __( 'Delete Language', 'wpglobus' );
|
352 |
+
$disabled = 'disabled';
|
353 |
+
} else {
|
354 |
+
$header = __( 'Add Language', 'wpglobus' );
|
355 |
+
}
|
356 |
+
?>
|
357 |
+
<div class="wrap">
|
358 |
+
<h1>WPGlobus: <?php echo esc_html( $header ); ?></h1>
|
359 |
+
<?php
|
360 |
+
if ( $this->submit ) {
|
361 |
+
if ( ! empty( $this->submit_messages['errors'] ) ) {
|
362 |
+
$mess = '';
|
363 |
+
foreach ( $this->submit_messages['errors'] as $message ) {
|
364 |
+
$mess .= $message . '<br />';
|
365 |
+
}
|
366 |
+
?>
|
367 |
+
<div class="error"><p><?php echo wp_kses( $mess, array( 'br' => array() ) ); ?></p></div>
|
368 |
+
<?php
|
369 |
+
} elseif ( ! empty( $this->submit_messages['success'] ) ) {
|
370 |
+
$mess = '';
|
371 |
+
foreach ( $this->submit_messages['success'] as $message ) {
|
372 |
+
$mess .= $message . '<br />';
|
373 |
+
}
|
374 |
+
?>
|
375 |
+
<div class="updated"><p><?php echo wp_kses( $mess, array( 'br' => array() ) ); ?></p></div>
|
376 |
+
<?php
|
377 |
+
}
|
378 |
+
}
|
379 |
+
?>
|
380 |
+
<form id="wpglobus_edit_form" method="post" action="">
|
381 |
+
<table class="form-table">
|
382 |
+
<tr>
|
383 |
+
<th scope="row"><label
|
384 |
+
for="wpglobus_language_code"><?php esc_html_e( 'Language Code', 'wpglobus' ); ?></label>
|
385 |
+
</th>
|
386 |
+
<td>
|
387 |
+
<input name="wpglobus_language_code" <?php echo esc_attr( $disabled ); ?> type="text"
|
388 |
+
id="wpglobus_language_code"
|
389 |
+
value="<?php echo esc_attr( $this->language_code ); ?>" class="regular-text"/>
|
390 |
+
|
391 |
+
<p class="description"><?php esc_html_e( '2-Letter ISO Language Code for the Language you want to insert. (Example: en)', 'wpglobus' ); ?></p>
|
392 |
+
</td>
|
393 |
+
</tr>
|
394 |
+
<tr>
|
395 |
+
<th scope="row"><label
|
396 |
+
for="wpglobus_flags"><?php esc_html_e( 'Language flag', 'wpglobus' ); ?></label>
|
397 |
+
</th>
|
398 |
+
<td>
|
399 |
+
<select id="wpglobus_flags" name="wpglobus_flags" style="width:300px;"
|
400 |
+
class="populate">
|
401 |
+
<?php
|
402 |
+
foreach ( $this->all_flags as $file_name ) :
|
403 |
+
?>
|
404 |
+
<option <?php selected( $this->flag === $file_name ); ?>
|
405 |
+
value="<?php echo esc_attr( $file_name ); ?>"><?php echo esc_html( $file_name ); ?></option>
|
406 |
+
<?php endforeach; ?>
|
407 |
+
</select>
|
408 |
+
</td>
|
409 |
+
</tr>
|
410 |
+
<tr>
|
411 |
+
<th scope="row"><label
|
412 |
+
for="wpglobus_language_name"><?php esc_html_e( 'Name', 'wpglobus' ); ?></label>
|
413 |
+
</th>
|
414 |
+
<td><input name="wpglobus_language_name" type="text" id="wpglobus_language_name"
|
415 |
+
value="<?php echo esc_attr( $this->language_name ); ?>" class="regular-text"/>
|
416 |
+
|
417 |
+
<p class="description"><?php esc_html_e( 'The name of the language in its native alphabet. (Examples: English, Русский)', 'wpglobus' ); ?></p>
|
418 |
+
</td>
|
419 |
+
</tr>
|
420 |
+
<tr>
|
421 |
+
<th scope="row"><label
|
422 |
+
for="wpglobus_en_language_name"><?php esc_html_e( 'Name in English', 'wpglobus' ); ?></label>
|
423 |
+
</th>
|
424 |
+
<td><input name="wpglobus_en_language_name" type="text" id="wpglobus_en_language_name"
|
425 |
+
value="<?php echo esc_attr( $this->en_language_name ); ?>" class="regular-text"/>
|
426 |
+
|
427 |
+
<p class="description"><?php esc_html_e( 'The name of the language in English', 'wpglobus' ); ?></p>
|
428 |
+
</td>
|
429 |
+
</tr>
|
430 |
+
<tr>
|
431 |
+
<th scope="row"><label
|
432 |
+
for="wpglobus_locale"><?php esc_html_e( 'Locale', 'wpglobus' ); ?></label></th>
|
433 |
+
<td><input name="wpglobus_locale" type="text" id="wpglobus_locale"
|
434 |
+
value="<?php echo esc_attr( $this->locale ); ?>"
|
435 |
+
class="regular-text"/>
|
436 |
+
|
437 |
+
<p class="description"><?php esc_html_e( 'PHP/WordPress Locale of the language. (Examples: en_US, ru_RU)', 'wpglobus' ); ?></p>
|
438 |
+
</td>
|
439 |
+
</tr>
|
440 |
+
</table>
|
441 |
+
<?php
|
442 |
+
|
443 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_EDIT === $this->action
|
444 |
+
|| WPGlobus_Language_Edit_Request::ACTION_ADD === $this->action ) {
|
445 |
+
?>
|
446 |
+
<input class="button button-primary" type="submit" name="submit"
|
447 |
+
value="<?php esc_attr_e( 'Save Changes', 'wpglobus' ); ?>">
|
448 |
+
<?php
|
449 |
+
|
450 |
+
if ( WPGlobus_Language_Edit_Request::ACTION_EDIT === $this->action ) {
|
451 |
+
?>
|
452 |
+
|
453 |
+
<a class="button button-link-delete" style="margin-left: 1em" href="<?php echo esc_url( WPGlobus_Language_Edit_Request::url_language_delete( $this->language_code ) ); ?>">
|
454 |
+
<i class="dashicons dashicons-trash" style="margin-top: 4px;"></i>
|
455 |
+
<?php esc_html_e( 'Delete Language', 'wpglobus' ); ?>…</a>
|
456 |
+
<?php
|
457 |
+
}
|
458 |
+
} elseif ( WPGlobus_Language_Edit_Request::ACTION_DELETE === $this->action ) {
|
459 |
+
?>
|
460 |
+
<div class="notice-large wp-ui-notification"><?php esc_html_e( 'Are you sure you want to delete?', 'wpglobus' ); ?></div>
|
461 |
+
<p class="submit"><input class="button button-primary" type="submit" name="delete"
|
462 |
+
value="<?php esc_attr_e( 'Delete Language', 'wpglobus' ); ?>"></p>
|
463 |
+
<?php } ?>
|
464 |
+
|
465 |
+
</form>
|
466 |
+
|
467 |
+
<hr/>
|
468 |
+
<span class="dashicons dashicons-admin-site"></span>
|
469 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_settings() ); ?>">
|
470 |
+
<?php esc_html_e( 'Back to the WPGlobus Settings', 'wpglobus' ); ?>
|
471 |
+
</a>
|
472 |
+
</div>
|
473 |
+
<?php
|
474 |
+
}
|
475 |
+
|
476 |
+
/**
|
477 |
+
* Get flag files from directory
|
478 |
+
*/
|
479 |
+
protected function get_flags() {
|
480 |
+
|
481 |
+
$dir = new DirectoryIterator( WPGlobus::plugin_dir_path() . 'flags/' );
|
482 |
+
|
483 |
+
foreach ( $dir as $file ) {
|
484 |
+
/**
|
485 |
+
* File object
|
486 |
+
*
|
487 |
+
* @var DirectoryIterator $file
|
488 |
+
*/
|
489 |
+
if ( $file->isFile() ) {
|
490 |
+
$this->all_flags[] = $file->getFilename();
|
491 |
+
}
|
492 |
+
}
|
493 |
+
}
|
494 |
+
}
|
trunk/includes/admin/class-wpglobus-plugin-install.php
ADDED
@@ -0,0 +1,367 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-plugin-install.php
|
4 |
+
*
|
5 |
+
* @since 1.5.9
|
6 |
+
* @package WPGlobus\Admin
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! class_exists( 'WPGlobus_Plugin_Install' ) ) :
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class WPGlobus_Plugin_Install
|
13 |
+
*/
|
14 |
+
class WPGlobus_Plugin_Install {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Fake version for paid plugins to prevent the "Update Now" button from appearing.
|
18 |
+
*
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
const FAKE_VERSION = '999';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Fake active installs for paid plugins.
|
25 |
+
*
|
26 |
+
* @var int
|
27 |
+
*/
|
28 |
+
const FAKE_ACTIVE_INSTALLS = 0;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Fake "Compatible with your version of WordPress" for paid plugins.
|
32 |
+
*
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
protected static $fake_compatible_with = '';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Array of plugin cards.
|
39 |
+
*
|
40 |
+
* @var array
|
41 |
+
*/
|
42 |
+
static protected $plugin_card = array();
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Array of paid plugins data.
|
46 |
+
*
|
47 |
+
* @var array
|
48 |
+
*/
|
49 |
+
static protected $paid_plugins = array();
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Array of free plugins data.
|
53 |
+
*
|
54 |
+
* @var array
|
55 |
+
*/
|
56 |
+
static protected $free_plugins = array();
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Controller.
|
60 |
+
*/
|
61 |
+
public static function controller() {
|
62 |
+
|
63 |
+
// phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
|
64 |
+
if ( empty( $_GET['s'] ) || 'wpglobus' !== strtolower( $_GET['s'] ) ) {
|
65 |
+
return;
|
66 |
+
}
|
67 |
+
|
68 |
+
self::$fake_compatible_with = $GLOBALS['wp_version'];
|
69 |
+
|
70 |
+
self::$plugin_card['free'] = array();
|
71 |
+
self::$plugin_card['paid'] = array();
|
72 |
+
|
73 |
+
self::setup_paid_plugins();
|
74 |
+
|
75 |
+
// Enqueue the CSS & JS scripts.
|
76 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
77 |
+
|
78 |
+
add_filter( 'plugins_api_result', array( __CLASS__, 'filter__plugins_api_result' ), 10, 3 );
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* List of the premium WPGlobus extensions.
|
83 |
+
* This file is created manually.
|
84 |
+
*/
|
85 |
+
protected static function setup_paid_plugins() {
|
86 |
+
|
87 |
+
self::$paid_plugins = array();
|
88 |
+
|
89 |
+
$data_file = WPGlobus::data_path() . '/paid_plugins.json';
|
90 |
+
|
91 |
+
if ( is_readable( $data_file ) ) {
|
92 |
+
$_json = file_get_contents( $data_file );
|
93 |
+
self::$paid_plugins = json_decode( $_json, true );
|
94 |
+
uasort( self::$paid_plugins, array( __CLASS__, 'sort_paid_plugins' ) );
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Callback for sorting the paid_plugins array.
|
100 |
+
*
|
101 |
+
* @param array $a First.
|
102 |
+
* @param array $b Second.
|
103 |
+
*
|
104 |
+
* @return int
|
105 |
+
*/
|
106 |
+
public static function sort_paid_plugins( $a, $b ) {
|
107 |
+
return ( $a['order'] < $b['order'] ) ? - 1 : 1;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Filter api results
|
112 |
+
*
|
113 |
+
* @param stdClass|WP_Error $res Response object or WP_Error.
|
114 |
+
* @param string $action The type of information being requested from the Plugin Install API.
|
115 |
+
* @param stdClass $args Plugin API arguments.
|
116 |
+
*
|
117 |
+
* @return stdClass|WP_Error
|
118 |
+
*/
|
119 |
+
public static function filter__plugins_api_result(
|
120 |
+
$res,
|
121 |
+
// @formatter:off
|
122 |
+
/* @noinspection PhpUnusedParameterInspection */ $action,
|
123 |
+
/* @noinspection PhpUnusedParameterInspection */ $args
|
124 |
+
// @formatter:on
|
125 |
+
) {
|
126 |
+
|
127 |
+
if ( is_wp_error( $res ) ) {
|
128 |
+
return $res;
|
129 |
+
}
|
130 |
+
|
131 |
+
if ( empty( $res->plugins ) ) {
|
132 |
+
return $res;
|
133 |
+
}
|
134 |
+
|
135 |
+
foreach ( (array) $res->plugins as $key => $plugin ) {
|
136 |
+
if ( is_array( $plugin ) ) {
|
137 |
+
/** @since 2.1.10 */
|
138 |
+
$plugin = (object) $plugin;
|
139 |
+
}
|
140 |
+
if ( false === strpos( $plugin->slug, 'wpglobus' ) ) {
|
141 |
+
unset( $res->plugins[ $key ] );
|
142 |
+
} else {
|
143 |
+
|
144 |
+
if ( 'wpglobus-for-black-studio-tinymce-widget' === $plugin->slug ) {
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Set correct slug for the
|
148 |
+
* `WPGlobus for Black Studio TinyMCE Widget` plugin.
|
149 |
+
*
|
150 |
+
* @since 1.6.3
|
151 |
+
*/
|
152 |
+
$plugin->slug = 'wpglobus-for-black-studio-widget';
|
153 |
+
|
154 |
+
self::$plugin_card['free'][] = $plugin->slug;
|
155 |
+
|
156 |
+
self::$free_plugins[ $plugin->slug ]['extra_data']['correctLink'] = 'wpglobus-for-black-studio-tinymce-widget';
|
157 |
+
|
158 |
+
} else {
|
159 |
+
self::$plugin_card['free'][] = $plugin->slug;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
$url_wpglobus_site = WPGlobus_Utils::url_wpglobus_site();
|
165 |
+
|
166 |
+
$all_products = self::get_all_product_info();
|
167 |
+
|
168 |
+
foreach ( self::$paid_plugins as $plugin => $plugin_data ) {
|
169 |
+
|
170 |
+
$plugin_file = implode( '/', array( WP_PLUGIN_DIR, $plugin_data['slug'], $plugin_data['loader'] ) );
|
171 |
+
|
172 |
+
if ( is_readable( $plugin_file ) ) {
|
173 |
+
// Plugin is installed.
|
174 |
+
self::$paid_plugins[ $plugin ]['plugin_data'] = get_plugin_data( $plugin_file, false );
|
175 |
+
} else {
|
176 |
+
self::$paid_plugins[ $plugin ]['plugin_data'] = null;
|
177 |
+
|
178 |
+
$product_slug = ( isset( $plugin_data['product_slug'] ) ? $plugin_data['product_slug'] : $plugin );
|
179 |
+
|
180 |
+
if ( isset( $all_products[ $product_slug ] ) ) {
|
181 |
+
$plugin_info = $all_products[ $product_slug ];
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Titles come as multilingual strings but only in 2 languages ['en','ru']
|
185 |
+
* because the WPGlobus website has only those.
|
186 |
+
* So we need to force `en` language code if the admin language
|
187 |
+
* is out of the list.
|
188 |
+
*/
|
189 |
+
$language = WPGlobus::Config()->language;
|
190 |
+
if ( ! in_array( $language, array( 'en', 'ru' ), true ) ) {
|
191 |
+
$language = 'en';
|
192 |
+
}
|
193 |
+
$_plugin_title = WPGlobus_Core::text_filter( $plugin_info['title'], $language );
|
194 |
+
|
195 |
+
self::$paid_plugins[ $plugin ]['plugin_data'] = array(
|
196 |
+
'Description' => '', // TODO.
|
197 |
+
'Name' => $_plugin_title,
|
198 |
+
'Title' => $_plugin_title,
|
199 |
+
'Version' => $plugin_info['_api_new_version'],
|
200 |
+
'PluginURI' => $url_wpglobus_site . 'product/' .
|
201 |
+
$product_slug . '/',
|
202 |
+
);
|
203 |
+
}
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Prepend the premium add-ons to the list of plugins.
|
209 |
+
*/
|
210 |
+
foreach ( self::$paid_plugins as $slug => $paid_plugin ) {
|
211 |
+
|
212 |
+
$info = self::plugin_info_template();
|
213 |
+
|
214 |
+
$info->slug = $slug;
|
215 |
+
|
216 |
+
/**
|
217 |
+
* @since 2.6.4
|
218 |
+
*/
|
219 |
+
$internal_image = true;
|
220 |
+
foreach( array( 'http://', 'https://' ) as $_scheme ) {
|
221 |
+
if ( false !== strpos( $paid_plugin['image_file'], $_scheme ) ) {
|
222 |
+
$internal_image = false;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
if ( $internal_image ) {
|
227 |
+
$info->icons['default'] = WPGlobus::internal_images_url() . '/' . $paid_plugin['image_file'];
|
228 |
+
} else {
|
229 |
+
$info->icons['default'] = $paid_plugin['image_file'];
|
230 |
+
}
|
231 |
+
$info->icons['1x'] = $info->icons['default'];
|
232 |
+
$info->icons['2x'] = $info->icons['default'];
|
233 |
+
|
234 |
+
if ( ! empty( $paid_plugin['plugin_data'] ) ) {
|
235 |
+
$info->name = $paid_plugin['plugin_data']['Name'];
|
236 |
+
$info->short_description = $paid_plugin['plugin_data']['Description'];
|
237 |
+
$info->homepage = $paid_plugin['plugin_data']['PluginURI'];
|
238 |
+
} else {
|
239 |
+
$info->name = $slug;
|
240 |
+
}
|
241 |
+
|
242 |
+
self::$plugin_card['paid'][] = $slug;
|
243 |
+
|
244 |
+
self::$paid_plugins[ $slug ]['card'] = $info;
|
245 |
+
|
246 |
+
self::$paid_plugins[ $slug ]['extra_data']['product_url'] =
|
247 |
+
self::$paid_plugins[ $slug ]['extra_data']['details_url'] =
|
248 |
+
$info->homepage;
|
249 |
+
|
250 |
+
/**
|
251 |
+
* @since 2.4.2
|
252 |
+
*/
|
253 |
+
if ( isset( $paid_plugin['available'] ) && ( empty( $paid_plugin['available'] ) || false === $paid_plugin['available'] ) ) {
|
254 |
+
// Don't add unavailable plugin in response.
|
255 |
+
} else {
|
256 |
+
array_unshift( $res->plugins, $info );
|
257 |
+
}
|
258 |
+
}
|
259 |
+
|
260 |
+
$res->info['results'] = count( $res->plugins );
|
261 |
+
|
262 |
+
return $res;
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Get information about all premium plugins.
|
267 |
+
* This file is created automatically at build. Do not edit!
|
268 |
+
*
|
269 |
+
* @return array[]
|
270 |
+
*/
|
271 |
+
protected static function get_all_product_info() {
|
272 |
+
$all_product_info = array();
|
273 |
+
|
274 |
+
$data_file = WPGlobus::data_path() . '/wpglobus-product-info.json';
|
275 |
+
|
276 |
+
if ( is_readable( $data_file ) ) {
|
277 |
+
$all_product_info_json = file_get_contents( $data_file );
|
278 |
+
$all_product_info = json_decode( $all_product_info_json, true );
|
279 |
+
}
|
280 |
+
|
281 |
+
return $all_product_info;
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Template for plugin info.
|
286 |
+
*
|
287 |
+
* @return stdClass
|
288 |
+
*/
|
289 |
+
protected static function plugin_info_template() {
|
290 |
+
$url_wpglobus_site = WPGlobus_Utils::url_wpglobus_site();
|
291 |
+
|
292 |
+
$template = new stdClass();
|
293 |
+
$template->name = '';
|
294 |
+
$template->short_description = '';
|
295 |
+
$template->author = '<a href="' . $url_wpglobus_site . '">WPGlobus</a>';
|
296 |
+
$template->author_profile = $url_wpglobus_site;
|
297 |
+
$template->homepage = $url_wpglobus_site;
|
298 |
+
$template->slug = '';
|
299 |
+
$template->rating = 100;
|
300 |
+
$template->num_ratings = 0;
|
301 |
+
$template->active_installs = self::FAKE_ACTIVE_INSTALLS;
|
302 |
+
$template->version = self::FAKE_VERSION;
|
303 |
+
$template->tested = self::$fake_compatible_with;
|
304 |
+
$template->icons['default'] = '';
|
305 |
+
$template->icons['2x'] = '';
|
306 |
+
$template->icons['1x'] = '';
|
307 |
+
$template->last_updated = date( 'c' );
|
308 |
+
|
309 |
+
return $template;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Enqueue admin JS scripts.
|
314 |
+
*
|
315 |
+
* @param string $hook_page The current admin page.
|
316 |
+
*/
|
317 |
+
public static function enqueue_scripts( $hook_page ) {
|
318 |
+
|
319 |
+
if ( 'plugin-install.php' === $hook_page ) {
|
320 |
+
|
321 |
+
$i18n = array();
|
322 |
+
$i18n['current_version'] = esc_html__( 'Current Version', 'wpglobus' );
|
323 |
+
$i18n['card_header'] = esc_html__( 'Premium add-on', 'wpglobus' );
|
324 |
+
$i18n['installed'] = esc_html__( 'Installed', 'wpglobus' );
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Fix for ' !' in French translation.
|
328 |
+
*
|
329 |
+
* @since 2.5.20
|
330 |
+
*/
|
331 |
+
$i18n['get_it'] = html_entity_decode( __( 'Get it now!', 'wpglobus' ) );
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Link to the installation instructions.
|
335 |
+
*
|
336 |
+
* @since 2.4.3
|
337 |
+
*/
|
338 |
+
// translators: placeholders are for the HTML tags.
|
339 |
+
$pre_addons_info = esc_html__( 'If you have already purchased a WPGlobus premium extension, please read %1$sthe installation instructions here%2$s', 'wpglobus' );
|
340 |
+
$i18n['pre_addons_info'] = sprintf( $pre_addons_info, '<a href="' . WPGlobus::URL_WPGLOBUS_SITE . 'extensions/how-to-install/" target="_blank" style="color:#fff;">', '</a>' );
|
341 |
+
|
342 |
+
wp_register_script(
|
343 |
+
'wpglobus-plugin-install',
|
344 |
+
WPGlobus::$PLUGIN_DIR_URL . '/includes/js/wpglobus-plugin-install' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
345 |
+
array( 'jquery' ),
|
346 |
+
WPGLOBUS_VERSION,
|
347 |
+
true
|
348 |
+
);
|
349 |
+
wp_enqueue_script( 'wpglobus-plugin-install' );
|
350 |
+
wp_localize_script(
|
351 |
+
'wpglobus-plugin-install',
|
352 |
+
'WPGlobusPluginInstall',
|
353 |
+
array(
|
354 |
+
'version' => WPGLOBUS_VERSION,
|
355 |
+
'hookPage' => $hook_page,
|
356 |
+
'pluginCard' => self::$plugin_card,
|
357 |
+
'pluginData' => array_merge( self::$paid_plugins, self::$free_plugins ),
|
358 |
+
'i18n' => $i18n,
|
359 |
+
)
|
360 |
+
);
|
361 |
+
}
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
endif;
|
366 |
+
|
367 |
+
# --- EOF
|
trunk/includes/admin/customize/class-wpglobus-customize-themes.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-customize-themes.php
|
4 |
+
*
|
5 |
+
* WPGlobus Customize Themes.
|
6 |
+
*
|
7 |
+
* @package WPGlobus
|
8 |
+
* @since 1.9.12
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class WPGlobus_Customize_Themes.
|
13 |
+
*/
|
14 |
+
if ( ! class_exists('WPGlobus_Customize_Themes') ) :
|
15 |
+
|
16 |
+
class WPGlobus_Customize_Themes {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Current theme.
|
20 |
+
*/
|
21 |
+
protected static $current_theme = null;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Names of disabled themes in lowercase format.
|
25 |
+
*
|
26 |
+
* @var string[]
|
27 |
+
*/
|
28 |
+
protected static $disabled_themes = array(
|
29 |
+
'customizr',
|
30 |
+
'customizr pro',
|
31 |
+
'experon',
|
32 |
+
'gwangi', // @since 2.3.12
|
33 |
+
'newyork city', // @since 2.5.21
|
34 |
+
);
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get disabled themes.
|
38 |
+
*
|
39 |
+
* @return string[]
|
40 |
+
*/
|
41 |
+
public static function disabled_themes() {
|
42 |
+
$disabled_themes = self::$disabled_themes;
|
43 |
+
return $disabled_themes;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get current theme name.
|
48 |
+
*/
|
49 |
+
public static function current_theme() {
|
50 |
+
if ( is_null(self::$current_theme) ) {
|
51 |
+
self::$current_theme = wp_get_theme();
|
52 |
+
}
|
53 |
+
return self::get_theme( 'name' );
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Get current theme or its property.
|
58 |
+
*
|
59 |
+
* @param string $param
|
60 |
+
*
|
61 |
+
* @return string|WP_Theme
|
62 |
+
*/
|
63 |
+
public static function get_theme( $param = '' ) {
|
64 |
+
if ( is_null(self::$current_theme) ) {
|
65 |
+
self::$current_theme = wp_get_theme();
|
66 |
+
}
|
67 |
+
if ( 'name' === $param ) {
|
68 |
+
return self::$current_theme->name;
|
69 |
+
}
|
70 |
+
|
71 |
+
return self::$current_theme;
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get current theme in lowercase.
|
77 |
+
*
|
78 |
+
* @return string
|
79 |
+
*/
|
80 |
+
public static function get_theme_name_lc() {
|
81 |
+
return strtolower( self::get_theme( 'name' ) );
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
endif;
|
87 |
+
|
88 |
+
# --- EOF
|
trunk/includes/admin/customize/class-wpglobus-customize140.php
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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WPGlobus_Customize
|
12 |
+
*/
|
13 |
+
class WPGlobus_Customize {
|
14 |
+
|
15 |
+
public static function controller() {
|
16 |
+
/**
|
17 |
+
* @see \WP_Customize_Manager::wp_loaded
|
18 |
+
* It calls the `customize_register` action first,
|
19 |
+
* and then - the `customize_preview_init` action
|
20 |
+
*/
|
21 |
+
/*
|
22 |
+
add_action( 'customize_register', array(
|
23 |
+
'WPGlobus_Customize',
|
24 |
+
'action__customize_register'
|
25 |
+
) ); */
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @since 1.5.0
|
29 |
+
*/
|
30 |
+
if ( WPGlobus_WP::is_pagenow( 'customize.php' ) ) {
|
31 |
+
require_once 'wpglobus-customize-filters.php';
|
32 |
+
}
|
33 |
+
|
34 |
+
add_action( 'customize_preview_init', array(
|
35 |
+
'WPGlobus_Customize',
|
36 |
+
'action__customize_preview_init'
|
37 |
+
) );
|
38 |
+
|
39 |
+
/**
|
40 |
+
* This is called by wp-admin/customize.php
|
41 |
+
*/
|
42 |
+
add_action( 'customize_controls_enqueue_scripts', array(
|
43 |
+
'WPGlobus_Customize',
|
44 |
+
'action__customize_controls_enqueue_scripts'
|
45 |
+
), 1000 );
|
46 |
+
|
47 |
+
if ( WPGlobus_WP::is_admin_doing_ajax() ) {
|
48 |
+
add_filter( 'clean_url', array(
|
49 |
+
'WPGlobus_Customize',
|
50 |
+
'filter__clean_url'
|
51 |
+
), 10, 2 );
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Filter a string to check translations for URL.
|
58 |
+
* // We build multilingual URLs in customizer using the ':::' delimiter.
|
59 |
+
* We build multilingual URLs in customizer using the '|||' delimiter.
|
60 |
+
* See wpglobus-customize-control.js
|
61 |
+
*
|
62 |
+
* @note To work correctly, value of $url should begin with URL for default language.
|
63 |
+
* @see esc_url() - the 'clean_url' filter
|
64 |
+
* @since 1.3.0
|
65 |
+
*
|
66 |
+
* @param string $url The cleaned URL.
|
67 |
+
* @param string $original_url The URL prior to cleaning.
|
68 |
+
*
|
69 |
+
* @return string
|
70 |
+
*/
|
71 |
+
public static function filter__clean_url( $url, $original_url ) {
|
72 |
+
|
73 |
+
if ( false !== strpos( $original_url, '|||' ) ) {
|
74 |
+
$arr1 = array();
|
75 |
+
$arr = explode( '|||', $original_url );
|
76 |
+
foreach ( $arr as $k => $val ) {
|
77 |
+
// Note: 'null' is a string, not real `null`.
|
78 |
+
if ( 'null' !== $val ) {
|
79 |
+
$arr1[ WPGlobus::Config()->enabled_languages[ $k ] ] = $val;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
return WPGlobus_Utils::build_multilingual_string( $arr1 );
|
83 |
+
}
|
84 |
+
|
85 |
+
return $url;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Add multilingual controls.
|
90 |
+
* The original controls will be hidden.
|
91 |
+
* @param WP_Customize_Manager $wp_customize
|
92 |
+
*/
|
93 |
+
public static function action__customize_register( WP_Customize_Manager $wp_customize ) {}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Load Customize Preview JS
|
97 |
+
* Used by hook: 'customize_preview_init'
|
98 |
+
* @see 'customize_preview_init'
|
99 |
+
*/
|
100 |
+
public static function action__customize_preview_init() {
|
101 |
+
wp_enqueue_script(
|
102 |
+
'wpglobus-customize-preview',
|
103 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-customize-preview' .
|
104 |
+
WPGlobus::SCRIPT_SUFFIX() . '.js',
|
105 |
+
array( 'jquery', 'customize-preview' ),
|
106 |
+
WPGLOBUS_VERSION,
|
107 |
+
true
|
108 |
+
);
|
109 |
+
wp_localize_script(
|
110 |
+
'wpglobus-customize-preview',
|
111 |
+
'WPGlobusCustomize',
|
112 |
+
array(
|
113 |
+
'version' => WPGLOBUS_VERSION,
|
114 |
+
'blogname' => WPGlobus_Core::text_filter( get_option( 'blogname' ), WPGlobus::Config()->language ),
|
115 |
+
'blogdescription' => WPGlobus_Core::text_filter( get_option( 'blogdescription' ), WPGlobus::Config()->language )
|
116 |
+
)
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Load Customize Control JS
|
122 |
+
*/
|
123 |
+
public static function action__customize_controls_enqueue_scripts() {
|
124 |
+
|
125 |
+
/**
|
126 |
+
* @see wp.customize.control elements
|
127 |
+
* for example wp.customize.control('blogname');
|
128 |
+
*/
|
129 |
+
$disabled_setting_mask = array();
|
130 |
+
|
131 |
+
/** navigation menu elements */
|
132 |
+
$disabled_setting_mask[] = 'nav_menu_item';
|
133 |
+
$disabled_setting_mask[] = 'nav_menu[';
|
134 |
+
$disabled_setting_mask[] = 'nav_menu_locations';
|
135 |
+
$disabled_setting_mask[] = 'new_menu_name';
|
136 |
+
|
137 |
+
/** widgets */
|
138 |
+
$disabled_setting_mask[] = 'widgets';
|
139 |
+
|
140 |
+
/** color elements */
|
141 |
+
$disabled_setting_mask[] = 'color';
|
142 |
+
|
143 |
+
/** yoast seo */
|
144 |
+
$disabled_setting_mask[] = 'wpseo';
|
145 |
+
|
146 |
+
/** css elements */
|
147 |
+
$disabled_setting_mask[] = 'css';
|
148 |
+
|
149 |
+
/** social networks elements */
|
150 |
+
$disabled_setting_mask[] = 'facebook';
|
151 |
+
$disabled_setting_mask[] = 'twitter';
|
152 |
+
$disabled_setting_mask[] = 'linkedin';
|
153 |
+
$disabled_setting_mask[] = 'behance';
|
154 |
+
$disabled_setting_mask[] = 'dribbble';
|
155 |
+
$disabled_setting_mask[] = 'instagram';
|
156 |
+
/** since 1.4.4 */
|
157 |
+
$disabled_setting_mask[] = 'tumblr';
|
158 |
+
$disabled_setting_mask[] = 'flickr';
|
159 |
+
$disabled_setting_mask[] = 'wordpress';
|
160 |
+
$disabled_setting_mask[] = 'youtube';
|
161 |
+
$disabled_setting_mask[] = 'pinterest';
|
162 |
+
$disabled_setting_mask[] = 'github';
|
163 |
+
$disabled_setting_mask[] = 'rss';
|
164 |
+
$disabled_setting_mask[] = 'google';
|
165 |
+
$disabled_setting_mask[] = 'email';
|
166 |
+
/** since 1.5.9 */
|
167 |
+
$disabled_setting_mask[] = 'dropbox';
|
168 |
+
$disabled_setting_mask[] = 'foursquare';
|
169 |
+
$disabled_setting_mask[] = 'vine';
|
170 |
+
$disabled_setting_mask[] = 'vimeo';
|
171 |
+
/** since 1.6.0 */
|
172 |
+
$disabled_setting_mask[] = 'yelp';
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Filter to disable fields in customizer.
|
176 |
+
* @see wp.customize.control elements
|
177 |
+
* Returning array.
|
178 |
+
* @since 1.4.0
|
179 |
+
*
|
180 |
+
* @param array $disabled_setting_mask An array of disabled masks.
|
181 |
+
*/
|
182 |
+
$disabled_setting_mask = apply_filters( 'wpglobus_customize_disabled_setting_mask', $disabled_setting_mask );
|
183 |
+
|
184 |
+
$element_selector = array( 'input[type=text]', 'textarea' );
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Filter for element selectors.
|
188 |
+
* Returning array.
|
189 |
+
* @since 1.4.0
|
190 |
+
*
|
191 |
+
* @param array $element_selector An array of selectors.
|
192 |
+
*/
|
193 |
+
$element_selector = apply_filters( 'wpglobus_customize_element_selector', $element_selector );
|
194 |
+
|
195 |
+
$set_link_by = array( 'link', 'url' );
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Filter of masks to determine links.
|
199 |
+
* @see value data-customize-setting-link of element
|
200 |
+
* Returning array.
|
201 |
+
* @since 1.4.0
|
202 |
+
*
|
203 |
+
* @param array $set_link_by An array of masks.
|
204 |
+
*/
|
205 |
+
$set_link_by = apply_filters( 'wpglobus_customize_setlinkby', $set_link_by );
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Filter of disabled sections.
|
209 |
+
*
|
210 |
+
* Returning array.
|
211 |
+
* @since 1.5.0
|
212 |
+
*
|
213 |
+
* @param array $disabled_sections An array of sections.
|
214 |
+
*/
|
215 |
+
$disabled_sections = array();
|
216 |
+
|
217 |
+
$disabled_sections = apply_filters( 'wpglobus_customize_disabled_sections', $disabled_sections );
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Generate language select button for customizer
|
221 |
+
* @since 1.6.0
|
222 |
+
*
|
223 |
+
* @todo http://stackoverflow.com/questions/9607252/how-to-detect-when-an-element-over-another-element-in-javascript
|
224 |
+
*/
|
225 |
+
$attributes['href'] = '#';
|
226 |
+
$attributes['style'] = 'margin-left:48px;';
|
227 |
+
$attributes['class'] = 'customize-controls-close wpglobus-customize-selector';
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Filter of attributes to generate language selector button.
|
231 |
+
* For example @see Divi theme http://www.elegantthemes.com/gallery/divi/ .
|
232 |
+
*
|
233 |
+
* Returning array.
|
234 |
+
* @since 1.6.0
|
235 |
+
*
|
236 |
+
* @param array $attributes An array of attributes.
|
237 |
+
* @param string Name of current theme.
|
238 |
+
*/
|
239 |
+
$attributes = apply_filters( 'wpglobus_customize_language_selector_attrs', $attributes, WPGlobus_Customize_Options::get_theme( 'name' ) );
|
240 |
+
|
241 |
+
$string = '';
|
242 |
+
|
243 |
+
foreach ( $attributes as $attribute => $value ) {
|
244 |
+
if ( null !== $value ){
|
245 |
+
$string .= esc_attr( $attribute ) . '="' . esc_attr( $value ) . '" ';
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
$selector_button = sprintf(
|
250 |
+
'<a %1$s>%2$s</a>',
|
251 |
+
trim( $string ),
|
252 |
+
'<span class="wpglobus-globe"></span>'
|
253 |
+
);
|
254 |
+
|
255 |
+
wp_enqueue_script(
|
256 |
+
'wpglobus-customize-control140',
|
257 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-customize-control140' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
258 |
+
array( 'jquery' ),
|
259 |
+
WPGLOBUS_VERSION,
|
260 |
+
true
|
261 |
+
);
|
262 |
+
wp_localize_script(
|
263 |
+
'wpglobus-customize-control140',
|
264 |
+
'WPGlobusCustomize',
|
265 |
+
array(
|
266 |
+
'version' => WPGLOBUS_VERSION,
|
267 |
+
'selectorButton' => $selector_button,
|
268 |
+
'languageAdmin' => WPGlobus::Config()->language,
|
269 |
+
'disabledSettingMask' => $disabled_setting_mask,
|
270 |
+
'elementSelector' => $element_selector,
|
271 |
+
'setLinkBy' => $set_link_by,
|
272 |
+
'disabledSections' => $disabled_sections,
|
273 |
+
'controlClass' => 'wpglobus-customize-control',
|
274 |
+
)
|
275 |
+
);
|
276 |
+
|
277 |
+
}
|
278 |
+
|
279 |
+
} // class
|
280 |
+
|
281 |
+
endif;
|
282 |
+
# --- EOF
|
trunk/includes/admin/customize/class-wpglobus-customize170.php
ADDED
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Multilingual Customizer
|
4 |
+
* @package WPGlobus\Admin\Customizer
|
5 |
+
* @since 1.7.0
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! class_exists( 'WPGlobus_Customize' ) ) :
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class WPGlobus_Customize
|
12 |
+
*/
|
13 |
+
class WPGlobus_Customize {
|
14 |
+
|
15 |
+
public static function controller() {
|
16 |
+
/**
|
17 |
+
* @see \WP_Customize_Manager::wp_loaded
|
18 |
+
* It calls the `customize_register` action first,
|
19 |
+
* and then - the `customize_preview_init` action
|
20 |
+
*/
|
21 |
+
/*
|
22 |
+
add_action( 'customize_register', array(
|
23 |
+
'WPGlobus_Customize',
|
24 |
+
'action__customize_register'
|
25 |
+
) ); */
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @since 1.5.0
|
29 |
+
*/
|
30 |
+
if ( WPGlobus_WP::is_pagenow( 'customize.php' ) ) {
|
31 |
+
require_once 'wpglobus-customize-filters.php';
|
32 |
+
}
|
33 |
+
|
34 |
+
add_action( 'customize_preview_init', array(
|
35 |
+
'WPGlobus_Customize',
|
36 |
+
'action__customize_preview_init'
|
37 |
+
) );
|
38 |
+
|
39 |
+
/**
|
40 |
+
* This is called by wp-admin/customize.php
|
41 |
+
*/
|
42 |
+
add_action( 'customize_controls_enqueue_scripts', array(
|
43 |
+
'WPGlobus_Customize',
|
44 |
+
'action__customize_controls_enqueue_scripts'
|
45 |
+
), 1000 );
|
46 |
+
|
47 |
+
if ( WPGlobus_WP::is_admin_doing_ajax() ) {
|
48 |
+
add_filter( 'clean_url', array(
|
49 |
+
'WPGlobus_Customize',
|
50 |
+
'filter__clean_url'
|
51 |
+
), 10, 2 );
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Filter a string to check translations for URL.
|
58 |
+
* // We build multilingual URLs in customizer using the ':::' delimiter.
|
59 |
+
* We build multilingual URLs in customizer using the '|||' delimiter.
|
60 |
+
* See wpglobus-customize-control.js
|
61 |
+
*
|
62 |
+
* @note To work correctly, value of $url should begin with URL for default language.
|
63 |
+
* @see esc_url() - the 'clean_url' filter
|
64 |
+
* @since 1.3.0
|
65 |
+
*
|
66 |
+
* @param string $url The cleaned URL.
|
67 |
+
* @param string $original_url The URL prior to cleaning.
|
68 |
+
*
|
69 |
+
* @return string
|
70 |
+
*/
|
71 |
+
public static function filter__clean_url( $url, $original_url ) {
|
72 |
+
|
73 |
+
if ( false !== strpos( $original_url, '|||' ) ) {
|
74 |
+
$arr1 = array();
|
75 |
+
$arr = explode( '|||', $original_url );
|
76 |
+
foreach ( $arr as $k => $val ) {
|
77 |
+
// Note: 'null' is a string, not real `null`.
|
78 |
+
if ( 'null' !== $val ) {
|
79 |
+
$arr1[ WPGlobus::Config()->enabled_languages[ $k ] ] = $val;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
return WPGlobus_Utils::build_multilingual_string( $arr1 );
|
83 |
+
}
|
84 |
+
|
85 |
+
return $url;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Add multilingual controls.
|
90 |
+
* The original controls will be hidden.
|
91 |
+
* @param WP_Customize_Manager $wp_customize
|
92 |
+
*/
|
93 |
+
public static function action__customize_register( WP_Customize_Manager $wp_customize ) {}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Load Customize Preview JS
|
97 |
+
* Used by hook: 'customize_preview_init'
|
98 |
+
* @see 'customize_preview_init'
|
99 |
+
*/
|
100 |
+
public static function action__customize_preview_init() {
|
101 |
+
wp_enqueue_script(
|
102 |
+
'wpglobus-customize-preview',
|
103 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-customize-preview' .
|
104 |
+
WPGlobus::SCRIPT_SUFFIX() . '.js',
|
105 |
+
array( 'jquery', 'customize-preview' ),
|
106 |
+
WPGLOBUS_VERSION,
|
107 |
+
true
|
108 |
+
);
|
109 |
+
wp_localize_script(
|
110 |
+
'wpglobus-customize-preview',
|
111 |
+
'WPGlobusCustomize',
|
112 |
+
array(
|
113 |
+
'version' => WPGLOBUS_VERSION,
|
114 |
+
'blogname' => WPGlobus_Core::text_filter( get_option( 'blogname' ), WPGlobus::Config()->language ),
|
115 |
+
'blogdescription' => WPGlobus_Core::text_filter( get_option( 'blogdescription' ), WPGlobus::Config()->language )
|
116 |
+
)
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Load Customize Control JS
|
122 |
+
*/
|
123 |
+
public static function action__customize_controls_enqueue_scripts() {
|
124 |
+
|
125 |
+
/**
|
126 |
+
* @see wp.customize.control elements
|
127 |
+
* for example wp.customize.control('blogname');
|
128 |
+
*/
|
129 |
+
$disabled_setting_mask = array();
|
130 |
+
|
131 |
+
/** navigation menu elements */
|
132 |
+
$disabled_setting_mask[] = 'nav_menu_item';
|
133 |
+
$disabled_setting_mask[] = 'nav_menu[';
|
134 |
+
$disabled_setting_mask[] = 'nav_menu_locations';
|
135 |
+
$disabled_setting_mask[] = 'new_menu_name';
|
136 |
+
|
137 |
+
/** widgets */
|
138 |
+
$disabled_setting_mask[] = 'widgets';
|
139 |
+
|
140 |
+
/** color elements */
|
141 |
+
$disabled_setting_mask[] = 'color';
|
142 |
+
|
143 |
+
/** yoast seo */
|
144 |
+
$disabled_setting_mask[] = 'wpseo';
|
145 |
+
|
146 |
+
/** css elements */
|
147 |
+
$disabled_setting_mask[] = 'css';
|
148 |
+
|
149 |
+
/** social networks elements */
|
150 |
+
$disabled_setting_mask[] = 'facebook';
|
151 |
+
$disabled_setting_mask[] = 'twitter';
|
152 |
+
$disabled_setting_mask[] = 'linkedin';
|
153 |
+
$disabled_setting_mask[] = 'behance';
|
154 |
+
$disabled_setting_mask[] = 'dribbble';
|
155 |
+
$disabled_setting_mask[] = 'instagram';
|
156 |
+
/** since 1.4.4 */
|
157 |
+
$disabled_setting_mask[] = 'tumblr';
|
158 |
+
$disabled_setting_mask[] = 'flickr';
|
159 |
+
$disabled_setting_mask[] = 'wordpress';
|
160 |
+
$disabled_setting_mask[] = 'youtube';
|
161 |
+
$disabled_setting_mask[] = 'pinterest';
|
162 |
+
$disabled_setting_mask[] = 'github';
|
163 |
+
$disabled_setting_mask[] = 'rss';
|
164 |
+
$disabled_setting_mask[] = 'google';
|
165 |
+
$disabled_setting_mask[] = 'email';
|
166 |
+
/** since 1.5.9 */
|
167 |
+
$disabled_setting_mask[] = 'dropbox';
|
168 |
+
$disabled_setting_mask[] = 'foursquare';
|
169 |
+
$disabled_setting_mask[] = 'vine';
|
170 |
+
$disabled_setting_mask[] = 'vimeo';
|
171 |
+
/** since 1.6.0 */
|
172 |
+
$disabled_setting_mask[] = 'yelp';
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Exclude fields from Static Front Page section.
|
176 |
+
* It may be added to customizer in many themes.
|
177 |
+
*
|
178 |
+
* @since 1.7.6
|
179 |
+
*/
|
180 |
+
$disabled_setting_mask[] = 'page_on_front';
|
181 |
+
$disabled_setting_mask[] = 'page_for_posts';
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Filter to disable fields in customizer.
|
185 |
+
* @see wp.customize.control elements
|
186 |
+
* Returning array.
|
187 |
+
* @since 1.4.0
|
188 |
+
*
|
189 |
+
* @param array $disabled_setting_mask An array of disabled masks.
|
190 |
+
*/
|
191 |
+
$disabled_setting_mask = apply_filters( 'wpglobus_customize_disabled_setting_mask', $disabled_setting_mask );
|
192 |
+
|
193 |
+
$element_selector = array( 'input[type=text]', 'textarea' );
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Filter for element selectors.
|
197 |
+
* Returning array.
|
198 |
+
* @since 1.4.0
|
199 |
+
*
|
200 |
+
* @param array $element_selector An array of selectors.
|
201 |
+
*/
|
202 |
+
$element_selector = apply_filters( 'wpglobus_customize_element_selector', $element_selector );
|
203 |
+
|
204 |
+
$set_link_by = array( 'link', 'url' );
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Filter of masks to determine links.
|
208 |
+
* @see value data-customize-setting-link of element
|
209 |
+
* Returning array.
|
210 |
+
* @since 1.4.0
|
211 |
+
*
|
212 |
+
* @param array $set_link_by An array of masks.
|
213 |
+
*/
|
214 |
+
$set_link_by = apply_filters( 'wpglobus_customize_setlinkby', $set_link_by );
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Filter of disabled sections.
|
218 |
+
*
|
219 |
+
* Returning array.
|
220 |
+
* @since 1.5.0
|
221 |
+
*
|
222 |
+
* @param array $disabled_sections An array of sections.
|
223 |
+
*/
|
224 |
+
$disabled_sections = array();
|
225 |
+
|
226 |
+
$disabled_sections = apply_filters( 'wpglobus_customize_disabled_sections', $disabled_sections );
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Generate language select button for customizer
|
230 |
+
* @since 1.6.0
|
231 |
+
*
|
232 |
+
* @todo http://stackoverflow.com/questions/9607252/how-to-detect-when-an-element-over-another-element-in-javascript
|
233 |
+
*/
|
234 |
+
$attributes['href'] = '#';
|
235 |
+
$attributes['style'] = 'margin-left:48px;';
|
236 |
+
$attributes['class'] = 'customize-controls-close wpglobus-customize-selector';
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Filter of attributes to generate language selector button.
|
240 |
+
* For example @see Divi theme http://www.elegantthemes.com/gallery/divi/ .
|
241 |
+
*
|
242 |
+
* Returning array.
|
243 |
+
* @since 1.6.0
|
244 |
+
*
|
245 |
+
* @param array $attributes An array of attributes.
|
246 |
+
* @param string Name of current theme.
|
247 |
+
*/
|
248 |
+
$attributes = apply_filters( 'wpglobus_customize_language_selector_attrs', $attributes, WPGlobus_Customize_Options::get_theme( 'name' ) );
|
249 |
+
|
250 |
+
$string = '';
|
251 |
+
|
252 |
+
foreach ( $attributes as $attribute => $value ) {
|
253 |
+
if ( null !== $value ){
|
254 |
+
$string .= esc_attr( $attribute ) . '="' . esc_attr( $value ) . '" ';
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
$selector_button = sprintf(
|
259 |
+
'<a %1$s>%2$s</a>',
|
260 |
+
trim( $string ),
|
261 |
+
'<span class="wpglobus-globe"></span>'
|
262 |
+
);
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Since 1.7.9
|
266 |
+
*/
|
267 |
+
$changeset_uuid = null;
|
268 |
+
if ( ! empty( $_GET['changeset_uuid'] ) ) { // WPCS: input var ok, sanitization ok.
|
269 |
+
$changeset_uuid = sanitize_text_field( wp_unslash( $_GET['changeset_uuid'] ) ); // WPCS: input var ok.
|
270 |
+
}
|
271 |
+
|
272 |
+
wp_enqueue_script(
|
273 |
+
'wpglobus-customize-control170',
|
274 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-customize-control170' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
275 |
+
array( 'jquery' ),
|
276 |
+
WPGLOBUS_VERSION,
|
277 |
+
true
|
278 |
+
);
|
279 |
+
wp_localize_script(
|
280 |
+
'wpglobus-customize-control170',
|
281 |
+
'WPGlobusCustomize',
|
282 |
+
array(
|
283 |
+
'version' => WPGLOBUS_VERSION,
|
284 |
+
'selectorButton' => $selector_button,
|
285 |
+
'languageAdmin' => WPGlobus::Config()->language,
|
286 |
+
'disabledSettingMask' => $disabled_setting_mask,
|
287 |
+
'elementSelector' => $element_selector,
|
288 |
+
'setLinkBy' => $set_link_by,
|
289 |
+
'disabledSections' => $disabled_sections,
|
290 |
+
'controlClass' => 'wpglobus-customize-control',
|
291 |
+
'changeset_uuid' => $changeset_uuid
|
292 |
+
)
|
293 |
+
);
|
294 |
+
|
295 |
+
}
|
296 |
+
|
297 |
+
} // class
|
298 |
+
|
299 |
+
endif;
|
300 |
+
# --- EOF
|
trunk/includes/admin/customize/class-wpglobus-customize190.php
ADDED
@@ -0,0 +1,555 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Multilingual Customizer.
|
4 |
+
*
|
5 |
+
* @since 1.9.0
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Admin\Customizer
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! class_exists( 'WPGlobus_Customize' ) ) :
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class WPGlobus_Customize
|
14 |
+
*/
|
15 |
+
class WPGlobus_Customize {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Controller.
|
19 |
+
*/
|
20 |
+
public static function controller() {
|
21 |
+
|
22 |
+
add_action( 'admin_init', array( __CLASS__, 'on__admin_init' ), 1 );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* It calls the `customize_register` action first,
|
26 |
+
* and then - the `customize_preview_init` action.
|
27 |
+
*
|
28 |
+
* @see \WP_Customize_Manager::wp_loaded
|
29 |
+
*
|
30 |
+
* add_action( 'customize_register', array(
|
31 |
+
* 'WPGlobus_Customize',
|
32 |
+
* 'action__customize_register'
|
33 |
+
* ) );
|
34 |
+
*/
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Customizer filters.
|
38 |
+
*
|
39 |
+
* @since 1.5.0
|
40 |
+
*/
|
41 |
+
if ( WPGlobus_WP::is_pagenow( 'customize.php' ) ) {
|
42 |
+
require_once 'wpglobus-customize-filters.php';
|
43 |
+
}
|
44 |
+
|
45 |
+
add_action(
|
46 |
+
'customize_preview_init',
|
47 |
+
array( 'WPGlobus_Customize', 'action__customize_preview_init' )
|
48 |
+
);
|
49 |
+
|
50 |
+
/**
|
51 |
+
* This is called by wp-admin/customize.php
|
52 |
+
*/
|
53 |
+
add_action(
|
54 |
+
'customize_controls_enqueue_scripts',
|
55 |
+
array( 'WPGlobus_Customize', 'action__customize_controls_enqueue_scripts' ),
|
56 |
+
1000
|
57 |
+
);
|
58 |
+
|
59 |
+
if ( WPGlobus_WP::is_admin_doing_ajax() ) {
|
60 |
+
add_filter(
|
61 |
+
'clean_url',
|
62 |
+
array( 'WPGlobus_Customize', 'filter__clean_url' ),
|
63 |
+
10,
|
64 |
+
2
|
65 |
+
);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Filter customize_changeset_save_data.
|
70 |
+
*
|
71 |
+
* @see wp-includes\class-wp-customize-manager.php
|
72 |
+
* @since 1.9.3
|
73 |
+
*/
|
74 |
+
add_filter(
|
75 |
+
'customize_changeset_save_data',
|
76 |
+
array( __CLASS__, 'filter__customize_changeset_save_data' ),
|
77 |
+
1,
|
78 |
+
2
|
79 |
+
);
|
80 |
+
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Action on admin init.
|
85 |
+
*
|
86 |
+
* @since 1.9.3
|
87 |
+
*/
|
88 |
+
public static function on__admin_init() {
|
89 |
+
|
90 |
+
$excluded_mods = array(
|
91 |
+
'0',
|
92 |
+
'nav_menu_locations',
|
93 |
+
'sidebars_widgets',
|
94 |
+
'custom_css_post_id',
|
95 |
+
'wpglobus_blogname',
|
96 |
+
'wpglobus_blogdescription',
|
97 |
+
);
|
98 |
+
|
99 |
+
$mods = get_theme_mods();
|
100 |
+
|
101 |
+
$filtered_mods = array();
|
102 |
+
|
103 |
+
if ( $mods ) {
|
104 |
+
foreach ( $mods as $mod_key => $mod_value ) {
|
105 |
+
|
106 |
+
if ( in_array( $mod_key, $excluded_mods, true ) ) {
|
107 |
+
continue;
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( ! is_string( $mod_value ) ) {
|
111 |
+
continue;
|
112 |
+
}
|
113 |
+
|
114 |
+
$filtered_mods[ $mod_key ] = $mod_value;
|
115 |
+
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Filters the theme mods before save.
|
121 |
+
*
|
122 |
+
* @since 1.9.3
|
123 |
+
*
|
124 |
+
* @param array $filtered_mods Filtered theme modifications.
|
125 |
+
* @param array|void $mods Theme modifications.
|
126 |
+
*/
|
127 |
+
$filtered_mods = apply_filters( 'wpglobus_customize_filtered_mods', $filtered_mods, $mods );
|
128 |
+
|
129 |
+
foreach ( $filtered_mods as $mod_key => $mod_value ) {
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Filter {@see filter "pre_set_theme_mod_{$name}" in \wp-includes\theme.php}.
|
133 |
+
*/
|
134 |
+
add_filter(
|
135 |
+
"pre_set_theme_mod_{$mod_key}",
|
136 |
+
array( __CLASS__, 'filter__pre_set_theme_mod' ),
|
137 |
+
1,
|
138 |
+
2
|
139 |
+
);
|
140 |
+
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Filter a theme mod.
|
146 |
+
*
|
147 |
+
* @since 1.9.3
|
148 |
+
*
|
149 |
+
* @param string $value The value.
|
150 |
+
* @param string $old_value Unused.
|
151 |
+
*
|
152 |
+
* @return bool|string
|
153 |
+
*/
|
154 |
+
public static function filter__pre_set_theme_mod(
|
155 |
+
$value,
|
156 |
+
/**
|
157 |
+
* Unused.
|
158 |
+
*
|
159 |
+
* @noinspection PhpUnusedParameterInspection
|
160 |
+
*/
|
161 |
+
$old_value
|
162 |
+
) {
|
163 |
+
|
164 |
+
if ( ! is_string( $value ) ) {
|
165 |
+
return $value;
|
166 |
+
}
|
167 |
+
|
168 |
+
$new_value = self::_build_multilingual_string( $value );
|
169 |
+
|
170 |
+
if ( $new_value ) {
|
171 |
+
return $new_value;
|
172 |
+
}
|
173 |
+
|
174 |
+
return $value;
|
175 |
+
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Save/update a changeset.
|
180 |
+
*
|
181 |
+
* @since 1.9.3
|
182 |
+
*
|
183 |
+
* @param array $data The data.
|
184 |
+
* @param string $filter_context Unused.
|
185 |
+
*
|
186 |
+
* @return mixed
|
187 |
+
*/
|
188 |
+
public static function filter__customize_changeset_save_data(
|
189 |
+
$data,
|
190 |
+
/**
|
191 |
+
* Unused.
|
192 |
+
*
|
193 |
+
* @noinspection PhpUnusedParameterInspection
|
194 |
+
*/
|
195 |
+
$filter_context
|
196 |
+
) {
|
197 |
+
|
198 |
+
foreach ( $data as $option => $value ) {
|
199 |
+
|
200 |
+
$new_value = self::_build_multilingual_string( $value['value'] );
|
201 |
+
|
202 |
+
if ( $new_value ) {
|
203 |
+
$data[ $option ]['value'] = $new_value;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
return $data;
|
208 |
+
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Build standard WPGlobus multilingual string.
|
213 |
+
*
|
214 |
+
* @since 1.9.3
|
215 |
+
*
|
216 |
+
* @param string $value The value.
|
217 |
+
*
|
218 |
+
* @return bool|string
|
219 |
+
*/
|
220 |
+
public static function _build_multilingual_string( $value ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Ignore if not a string.
|
224 |
+
*
|
225 |
+
* @since 1.9.6
|
226 |
+
*/
|
227 |
+
if ( ! is_string( $value ) ) {
|
228 |
+
return $value;
|
229 |
+
}
|
230 |
+
|
231 |
+
// $new_value = '';
|
232 |
+
|
233 |
+
if ( false === strpos( $value, '|||' ) ) {
|
234 |
+
$new_value = false;
|
235 |
+
} else {
|
236 |
+
|
237 |
+
$arr1 = array();
|
238 |
+
$arr = explode( '|||', $value );
|
239 |
+
foreach ( $arr as $k => $val ) {
|
240 |
+
// Note: 'null' is a string, not real `null`.
|
241 |
+
if ( 'null' !== $val ) {
|
242 |
+
$arr1[ WPGlobus::Config()->enabled_languages[ $k ] ] = $val;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
$new_value = WPGlobus_Utils::build_multilingual_string( $arr1 );
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
return $new_value;
|
251 |
+
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Filter a string to check translations for URL.
|
256 |
+
* // We build multilingual URLs in customizer using the ':::' delimiter.
|
257 |
+
* We build multilingual URLs in customizer using the '|||' delimiter.
|
258 |
+
* See wpglobus-customize-control.js
|
259 |
+
*
|
260 |
+
* @note To work correctly, value of $url should begin with URL for default language.
|
261 |
+
* @see esc_url() - the 'clean_url' filter
|
262 |
+
* @since 1.3.0
|
263 |
+
*
|
264 |
+
* @param string $url The cleaned URL.
|
265 |
+
* @param string $original_url The URL prior to cleaning.
|
266 |
+
*
|
267 |
+
* @return string
|
268 |
+
*/
|
269 |
+
public static function filter__clean_url( $url, $original_url ) {
|
270 |
+
|
271 |
+
if ( false !== strpos( $original_url, '|||' ) ) {
|
272 |
+
$arr1 = array();
|
273 |
+
$arr = explode( '|||', $original_url );
|
274 |
+
foreach ( $arr as $k => $val ) {
|
275 |
+
// Note: 'null' is a string, not real `null`.
|
276 |
+
if ( 'null' !== $val ) {
|
277 |
+
$arr1[ WPGlobus::Config()->enabled_languages[ $k ] ] = $val;
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
+
return WPGlobus_Utils::build_multilingual_string( $arr1 );
|
282 |
+
}
|
283 |
+
|
284 |
+
return $url;
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* Add multilingual controls.
|
289 |
+
* The original controls will be hidden.
|
290 |
+
*
|
291 |
+
* @param WP_Customize_Manager $wp_customize Customize Manager.
|
292 |
+
*/
|
293 |
+
public static function action__customize_register( WP_Customize_Manager $wp_customize ) {
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Load Customize Preview JS
|
298 |
+
* Used by hook: 'customize_preview_init'
|
299 |
+
*
|
300 |
+
* @see 'customize_preview_init'
|
301 |
+
*/
|
302 |
+
public static function action__customize_preview_init() {
|
303 |
+
wp_enqueue_script(
|
304 |
+
'wpglobus-customize-preview',
|
305 |
+
WPGlobus::plugin_dir_url() . 'includes/js/wpglobus-customize-preview' .
|
306 |
+
WPGlobus::SCRIPT_SUFFIX() . '.js',
|
307 |
+
array( 'jquery', 'customize-preview' ),
|
308 |
+
WPGLOBUS_VERSION,
|
309 |
+
true
|
310 |
+
);
|
311 |
+
wp_localize_script(
|
312 |
+
'wpglobus-customize-preview',
|
313 |
+
'WPGlobusCustomize',
|
314 |
+
array(
|
315 |
+
'version' => WPGLOBUS_VERSION,
|
316 |
+
'blogname' => WPGlobus_Core::text_filter( get_option( 'blogname' ), WPGlobus::Config()->language ),
|
317 |
+
'blogdescription' => WPGlobus_Core::text_filter( get_option( 'blogdescription' ), WPGlobus::Config()->language ),
|
318 |
+
)
|
319 |
+
);
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Load Customize Control JS
|
324 |
+
*/
|
325 |
+
public static function action__customize_controls_enqueue_scripts() {
|
326 |
+
|
327 |
+
global $wp_version;
|
328 |
+
|
329 |
+
/**
|
330 |
+
* See wp.customize.control elements
|
331 |
+
* for example wp.customize.control('blogname');
|
332 |
+
*/
|
333 |
+
$disabled_setting_mask = array();
|
334 |
+
|
335 |
+
// navigation menu elements.
|
336 |
+
$disabled_setting_mask[] = 'nav_menu_item';
|
337 |
+
$disabled_setting_mask[] = 'nav_menu[';
|
338 |
+
$disabled_setting_mask[] = 'nav_menu_locations';
|
339 |
+
$disabled_setting_mask[] = 'new_menu_name';
|
340 |
+
|
341 |
+
// widgets.
|
342 |
+
$disabled_setting_mask[] = 'widgets';
|
343 |
+
|
344 |
+
// color elements.
|
345 |
+
$disabled_setting_mask[] = 'color';
|
346 |
+
|
347 |
+
// yoast seo.
|
348 |
+
$disabled_setting_mask[] = 'wpseo';
|
349 |
+
|
350 |
+
// css elements.
|
351 |
+
$disabled_setting_mask[] = 'css';
|
352 |
+
|
353 |
+
// social networks elements.
|
354 |
+
$disabled_setting_mask[] = 'facebook';
|
355 |
+
$disabled_setting_mask[] = 'twitter';
|
356 |
+
$disabled_setting_mask[] = 'linkedin';
|
357 |
+
$disabled_setting_mask[] = 'behance';
|
358 |
+
$disabled_setting_mask[] = 'dribbble';
|
359 |
+
$disabled_setting_mask[] = 'instagram';
|
360 |
+
/**
|
361 |
+
* Tumblr.
|
362 |
+
*
|
363 |
+
* @since 1.4.4
|
364 |
+
*/
|
365 |
+
$disabled_setting_mask[] = 'tumblr';
|
366 |
+
$disabled_setting_mask[] = 'flickr';
|
367 |
+
$disabled_setting_mask[] = 'wordpress'; // phpcs:ignore WordPress.WP.CapitalPDangit.Misspelled
|
368 |
+
$disabled_setting_mask[] = 'youtube';
|
369 |
+
$disabled_setting_mask[] = 'pinterest';
|
370 |
+
$disabled_setting_mask[] = 'github';
|
371 |
+
$disabled_setting_mask[] = 'rss';
|
372 |
+
$disabled_setting_mask[] = 'google';
|
373 |
+
$disabled_setting_mask[] = 'email';
|
374 |
+
/**
|
375 |
+
* Dropbox.
|
376 |
+
*
|
377 |
+
* @since 1.5.9
|
378 |
+
*/
|
379 |
+
$disabled_setting_mask[] = 'dropbox';
|
380 |
+
$disabled_setting_mask[] = 'foursquare';
|
381 |
+
$disabled_setting_mask[] = 'vine';
|
382 |
+
$disabled_setting_mask[] = 'vimeo';
|
383 |
+
/**
|
384 |
+
* Yelp.
|
385 |
+
*
|
386 |
+
* @since 1.6.0
|
387 |
+
*/
|
388 |
+
$disabled_setting_mask[] = 'yelp';
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Exclude fields from Static Front Page section.
|
392 |
+
* It may be added to customizer in many themes.
|
393 |
+
*
|
394 |
+
* @since 1.7.6
|
395 |
+
*/
|
396 |
+
$disabled_setting_mask[] = 'page_on_front';
|
397 |
+
$disabled_setting_mask[] = 'page_for_posts';
|
398 |
+
|
399 |
+
/**
|
400 |
+
* Filter to disable fields in customizer.
|
401 |
+
* See wp.customize.control elements
|
402 |
+
* Returning array.
|
403 |
+
*
|
404 |
+
* @since 1.4.0
|
405 |
+
*
|
406 |
+
* @param array $disabled_setting_mask An array of disabled masks.
|
407 |
+
*/
|
408 |
+
$disabled_setting_mask = apply_filters( 'wpglobus_customize_disabled_setting_mask', $disabled_setting_mask );
|
409 |
+
|
410 |
+
$element_selector = array( 'input[type=text]', 'textarea' );
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Filter for element selectors.
|
414 |
+
* Returning array.
|
415 |
+
*
|
416 |
+
* @since 1.4.0
|
417 |
+
*
|
418 |
+
* @param array $element_selector An array of selectors.
|
419 |
+
*/
|
420 |
+
$element_selector = apply_filters( 'wpglobus_customize_element_selector', $element_selector );
|
421 |
+
|
422 |
+
$set_link_by = array( 'link', 'url' );
|
423 |
+
|
424 |
+
/**
|
425 |
+
* Filter of masks to determine links.
|
426 |
+
* See value data-customize-setting-link of element
|
427 |
+
* Returning array.
|
428 |
+
*
|
429 |
+
* @since 1.4.0
|
430 |
+
*
|
431 |
+
* @param array $set_link_by An array of masks.
|
432 |
+
*/
|
433 |
+
$set_link_by = apply_filters( 'wpglobus_customize_setlinkby', $set_link_by );
|
434 |
+
|
435 |
+
/**
|
436 |
+
* Filter of disabled sections.
|
437 |
+
*
|
438 |
+
* Returning array.
|
439 |
+
*
|
440 |
+
* @since 1.5.0
|
441 |
+
*
|
442 |
+
* @param array $disabled_sections An array of sections.
|
443 |
+
*/
|
444 |
+
$disabled_sections = array();
|
445 |
+
|
446 |
+
$disabled_sections = apply_filters( 'wpglobus_customize_disabled_sections', $disabled_sections );
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Generate language select button for customizer
|
450 |
+
*
|
451 |
+
* @since 1.6.0
|
452 |
+
*
|
453 |
+
* @todo http://stackoverflow.com/questions/9607252/how-to-detect-when-an-element-over-another-element-in-javascript
|
454 |
+
*/
|
455 |
+
$attributes['href'] = '#';
|
456 |
+
$attributes['style'] = 'margin-left:48px;';
|
457 |
+
$attributes['class'] = 'customize-controls-close wpglobus-customize-selector';
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Filter of attributes to generate language selector button.
|
461 |
+
* For example @see Divi theme http://www.elegantthemes.com/gallery/divi/ .
|
462 |
+
*
|
463 |
+
* Returning array.
|
464 |
+
*
|
465 |
+
* @since 1.6.0
|
466 |
+
*
|
467 |
+
* @param array $attributes An array of attributes.
|
468 |
+
* @param string Name of current theme.
|
469 |
+
*/
|
470 |
+
$attributes = apply_filters( 'wpglobus_customize_language_selector_attrs', $attributes, WPGlobus_Customize_Options::get_theme( 'name' ) );
|
471 |
+
|
472 |
+
$string = '';
|
473 |
+
|
474 |
+
foreach ( $attributes as $attribute => $value ) {
|
475 |
+
if ( null !== $value ) {
|
476 |
+
$string .= esc_attr( $attribute ) . '="' . esc_attr( $value ) . '" ';
|
477 |
+
}
|
478 |
+
}
|
479 |
+
|
480 |
+
$selector_button = sprintf(
|
481 |
+
'<a %1$s data-language="' . WPGlobus::Config()->default_language . '">%2$s</a>',
|
482 |
+
trim( $string ),
|
483 |
+
'<span class="wpglobus-globe"></span>'
|
484 |
+
);
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Since 1.7.9
|
488 |
+
*/
|
489 |
+
$changeset_uuid = null;
|
490 |
+
if ( ! empty( $_GET['changeset_uuid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
491 |
+
$changeset_uuid = sanitize_text_field( wp_unslash( $_GET['changeset_uuid'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
492 |
+
}
|
493 |
+
|
494 |
+
/**
|
495 |
+
* Since 1.9.0
|
496 |
+
*/
|
497 |
+
$selector_type = 'dropdown';
|
498 |
+
$selector_types = array( 'dropdown', 'switch' );
|
499 |
+
|
500 |
+
/**
|
501 |
+
* Filter selector type.
|
502 |
+
*
|
503 |
+
* @since 1.9.0
|
504 |
+
*
|
505 |
+
* @param string $selector_type Name of the current selector type.
|
506 |
+
* @param array $selector_types An array of existing selector types.
|
507 |
+
*
|
508 |
+
* @return string
|
509 |
+
*/
|
510 |
+
$selector_type = apply_filters( 'wpglobus_customize_language_selector_type', $selector_type, $selector_types );
|
511 |
+
|
512 |
+
if ( ! in_array( $selector_type, $selector_types, true ) ) {
|
513 |
+
$selector_type = 'dropdown';
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Adjust for WP 5.2+.
|
518 |
+
*
|
519 |
+
* @since 2.2.0
|
520 |
+
*/
|
521 |
+
$selector_html = '<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span class="current-language" style="font-weight:bold;">{{language}}</span>';
|
522 |
+
if ( version_compare( $wp_version, '5.1.999', '>' ) ) {
|
523 |
+
$selector_html = '<span style="position:fixed;top:-7px;">' . $selector_html . '</span>';
|
524 |
+
}
|
525 |
+
|
526 |
+
wp_enqueue_script(
|
527 |
+
'wpglobus-customize-control190',
|
528 |
+
WPGlobus::plugin_dir_url() . 'includes/js/wpglobus-customize-control190' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
529 |
+
array( 'jquery' ),
|
530 |
+
WPGLOBUS_VERSION,
|
531 |
+
true
|
532 |
+
);
|
533 |
+
wp_localize_script(
|
534 |
+
'wpglobus-customize-control190',
|
535 |
+
'WPGlobusCustomize',
|
536 |
+
array(
|
537 |
+
'version' => WPGLOBUS_VERSION,
|
538 |
+
'selectorType' => $selector_type,
|
539 |
+
'selectorButton' => $selector_button,
|
540 |
+
'languageAdmin' => WPGlobus::Config()->language,
|
541 |
+
'disabledSettingMask' => $disabled_setting_mask,
|
542 |
+
'elementSelector' => $element_selector,
|
543 |
+
'setLinkBy' => $set_link_by,
|
544 |
+
'disabledSections' => $disabled_sections,
|
545 |
+
'controlClass' => 'wpglobus-customize-control',
|
546 |
+
'changeset_uuid' => $changeset_uuid,
|
547 |
+
'selector_html' => $selector_html,
|
548 |
+
)
|
549 |
+
);
|
550 |
+
|
551 |
+
}
|
552 |
+
|
553 |
+
} // class
|
554 |
+
|
555 |
+
endif;
|
trunk/includes/admin/customize/wpglobus-customize-filters.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Filters for customizer
|
4 |
+
*
|
5 |
+
* All add_filter and add_action calls should be placed here
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Admin\Customizer
|
8 |
+
*/
|
9 |
+
add_filter( 'wpglobus_customize_disabled_sections', array( 'WPGlobus_Customize_Filters', 'disable_sections' ) );
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_Customize_Filters' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_Customize_Filters
|
15 |
+
*/
|
16 |
+
class WPGlobus_Customize_Filters {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Disable sections in customizer.
|
20 |
+
*
|
21 |
+
* @param array $disabled_sections
|
22 |
+
*
|
23 |
+
* @return array
|
24 |
+
*/
|
25 |
+
public static function disable_sections( $disabled_sections ) {
|
26 |
+
|
27 |
+
if ( class_exists( 'Easy_Google_Fonts' ) ) {
|
28 |
+
/**
|
29 |
+
* @see https://wordpress.org/plugins/easy-google-fonts/
|
30 |
+
*/
|
31 |
+
$disabled_sections[] = 'tt_font_typography';
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @since 2.2.30
|
36 |
+
*/
|
37 |
+
if ( defined( 'GFP_VERSION' ) // premium
|
38 |
+
||
|
39 |
+
defined( 'OGF_VERSION' ) // free
|
40 |
+
) {
|
41 |
+
/**
|
42 |
+
* @see premium https://fontsplugin.com/
|
43 |
+
* @see free https://wordpress.org/plugins/olympus-google-fonts/
|
44 |
+
*/
|
45 |
+
$disabled_sections[] = 'ogf_custom';
|
46 |
+
$disabled_sections[] = 'ogf_advanced__css';
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @since 2.2.28
|
51 |
+
*/
|
52 |
+
if ( class_exists( 'WPGlobus_Customize_Themes' ) ) {
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @see W.I.P. `Prevent using element with no id attribute` in includes\js\wpglobus-customize-control190.js
|
56 |
+
* to getting sections for disabling.
|
57 |
+
*/
|
58 |
+
$theme_name = WPGlobus_Customize_Themes::get_theme_name_lc();
|
59 |
+
|
60 |
+
if ( 'startkit' == $theme_name ) {
|
61 |
+
/**
|
62 |
+
* @see https://wordpress.org/themes/startkit/
|
63 |
+
*/
|
64 |
+
$disabled_sections[] = 'slider_setting';
|
65 |
+
$disabled_sections[] = 'service_setting';
|
66 |
+
$disabled_sections[] = 'testimonial_setting';
|
67 |
+
$disabled_sections[] = 'footer_icon';
|
68 |
+
$disabled_sections[] = 'Body_typography';
|
69 |
+
$disabled_sections[] = 'paragraph_typography';
|
70 |
+
$disabled_sections[] = 'H1_typography';
|
71 |
+
$disabled_sections[] = 'H2_typography';
|
72 |
+
$disabled_sections[] = 'H3_typography';
|
73 |
+
$disabled_sections[] = 'H4_typography';
|
74 |
+
$disabled_sections[] = 'H5_typography';
|
75 |
+
$disabled_sections[] = 'H6_typography';
|
76 |
+
$disabled_sections[] = 'menu_typography';
|
77 |
+
$disabled_sections[] = 'section_typography';
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
return $disabled_sections;
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
endif;
|
trunk/includes/admin/customize/wpglobus-customize.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: wpglobus-customize.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Admin\Customizer
|
6 |
+
*/
|
7 |
+
|
8 |
+
global $wp_version;
|
9 |
+
|
10 |
+
if ( ! defined('WPGLOBUS_CUSTOMIZE') || WPGLOBUS_CUSTOMIZE ) {
|
11 |
+
|
12 |
+
if ( version_compare( $wp_version, '4.9-Beta1', '>=' ) ) {
|
13 |
+
require_once 'class-wpglobus-customize190.php';
|
14 |
+
} else if( version_compare( $wp_version, '4.6', '>=' ) ) {
|
15 |
+
require_once 'class-wpglobus-customize170.php';
|
16 |
+
} else {
|
17 |
+
require_once 'class-wpglobus-customize140.php';
|
18 |
+
}
|
19 |
+
WPGlobus_Customize::controller();
|
20 |
+
}
|
21 |
+
|
22 |
+
# --- EOF
|
trunk/includes/admin/debug/class-wpglobus-admin-debug.php
ADDED
@@ -0,0 +1,366 @@
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WPGlobus/Admin/Debug.
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! class_exists( 'WPGlobus_Admin_Debug' ) ) :
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class WPGlobus_Admin_Debug.
|
12 |
+
*
|
13 |
+
* @since 1.8.1
|
14 |
+
*/
|
15 |
+
class WPGlobus_Admin_Debug {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Instance.
|
19 |
+
*
|
20 |
+
* @var WPGlobus_Admin_Debug
|
21 |
+
*/
|
22 |
+
protected static $instance;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Debug mode.
|
26 |
+
* @since 2.2.35
|
27 |
+
*/
|
28 |
+
protected static $mode = 'godmode';
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Key.
|
32 |
+
* @since 2.2.35
|
33 |
+
*/
|
34 |
+
protected static $key = '';
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get instance.
|
38 |
+
*/
|
39 |
+
public static function get_instance() {
|
40 |
+
if ( null === self::$instance ) {
|
41 |
+
self::$instance = new self();
|
42 |
+
}
|
43 |
+
|
44 |
+
return self::$instance;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Constructor.
|
49 |
+
*/
|
50 |
+
public function __construct() {
|
51 |
+
|
52 |
+
if ( 'meta' == $_GET['wpglobus-debug'] ) { // WPCS: input var ok, sanitization ok.
|
53 |
+
self::$mode = 'meta';
|
54 |
+
} else if ( 'wpglobus_options' == $_GET['wpglobus-debug'] || 'wpglobus-options' == $_GET['wpglobus-debug'] ) { // WPCS: input var ok, sanitization ok.
|
55 |
+
self::$mode = 'wpglobus_options';
|
56 |
+
} else if ( 'yoast' == $_GET['wpglobus-debug'] ) { // WPCS: input var ok, sanitization ok.
|
57 |
+
self::$mode = 'yoast';
|
58 |
+
}
|
59 |
+
|
60 |
+
if ( 'godmode' !== self::$mode ) {
|
61 |
+
if ( ! empty( $_GET['key'] ) ) { // WPCS: input var ok, sanitization ok. )
|
62 |
+
self::$key = sanitize_text_field($_GET['key']);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Action.
|
68 |
+
*
|
69 |
+
* @scope admin
|
70 |
+
* @since 1.8.1
|
71 |
+
*/
|
72 |
+
add_action( 'admin_print_scripts', array( $this, 'on__admin_scripts' ), 99 );
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Action.
|
76 |
+
*
|
77 |
+
* @scope admin
|
78 |
+
* @since 1.8.1
|
79 |
+
*/
|
80 |
+
add_action( 'admin_print_styles', array( $this, 'on__admin_styles' ), 99 );
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Action.
|
84 |
+
*
|
85 |
+
* @scope admin
|
86 |
+
* @since 1.8.1
|
87 |
+
*/
|
88 |
+
add_action( 'admin_footer', array( $this, 'on__admin_footer' ), 9999 );
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @since 2.2.35
|
94 |
+
*/
|
95 |
+
public function is_enabled_section($section) {
|
96 |
+
if ( 'godmode' == self::$mode ) {
|
97 |
+
return true;
|
98 |
+
}
|
99 |
+
if ( $section == self::$mode ) {
|
100 |
+
return true;
|
101 |
+
}
|
102 |
+
return false;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Enqueue admin styles.
|
107 |
+
*
|
108 |
+
* @scope admin
|
109 |
+
* @since 1.8.1
|
110 |
+
*/
|
111 |
+
public function on__admin_styles() {
|
112 |
+
|
113 |
+
wp_register_style(
|
114 |
+
'wpglobus-admin-debug',
|
115 |
+
WPGlobus::plugin_dir_url() . 'includes/css/wpglobus-admin-debug.css',
|
116 |
+
array(),
|
117 |
+
WPGLOBUS_VERSION
|
118 |
+
);
|
119 |
+
wp_enqueue_style( 'wpglobus-admin-debug' );
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Enqueue admin scripts.
|
125 |
+
*
|
126 |
+
* @scope admin
|
127 |
+
* @since 1.8.1
|
128 |
+
*/
|
129 |
+
public function on__admin_scripts() {
|
130 |
+
|
131 |
+
wp_register_script(
|
132 |
+
'wpglobus-admin-debug',
|
133 |
+
WPGlobus::plugin_dir_url() . 'includes/js/wpglobus-admin-debug' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
134 |
+
array( 'jquery' ),
|
135 |
+
WPGLOBUS_VERSION,
|
136 |
+
true
|
137 |
+
);
|
138 |
+
wp_enqueue_script( 'wpglobus-admin-debug' );
|
139 |
+
wp_localize_script(
|
140 |
+
'wpglobus-admin-debug',
|
141 |
+
'WPGlobusAdminDebug',
|
142 |
+
array(
|
143 |
+
'version' => WPGLOBUS_VERSION,
|
144 |
+
'data' => '',
|
145 |
+
)
|
146 |
+
);
|
147 |
+
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Output table.
|
152 |
+
*
|
153 |
+
* @scope admin
|
154 |
+
* @since 1.8.1
|
155 |
+
*/
|
156 |
+
public function on__admin_footer() {
|
157 |
+
|
158 |
+
global $wpdb, $post, $pagenow;
|
159 |
+
|
160 |
+
if ( 'post.php' == $pagenow ) {
|
161 |
+
if ( is_object( $post ) ) {
|
162 |
+
/**
|
163 |
+
* post.php page.
|
164 |
+
*/
|
165 |
+
if ( empty( $post->ID ) || 0 === (int) $post->ID ) {
|
166 |
+
return;
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Get metadata.
|
171 |
+
*
|
172 |
+
* @var array $metas
|
173 |
+
*/
|
174 |
+
$meta_query = $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = %d", $post->ID );
|
175 |
+
$_id = $post->ID;
|
176 |
+
$meta_query_caption = "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = $_id";
|
177 |
+
$metas = $wpdb->get_results( $meta_query, ARRAY_A );
|
178 |
+
}
|
179 |
+
} else if ( 'term.php' == $pagenow ) {
|
180 |
+
|
181 |
+
if ( empty( $_GET['tag_ID'] ) ) {
|
182 |
+
return;
|
183 |
+
}
|
184 |
+
|
185 |
+
$_id = sanitize_text_field( $_GET['tag_ID'] );
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Get metadata.
|
189 |
+
*
|
190 |
+
* @var array $metas
|
191 |
+
*/
|
192 |
+
$meta_query = $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->termmeta WHERE term_id = %d", $_id );
|
193 |
+
$meta_query_caption = "SELECT meta_key, meta_value FROM $wpdb->termmeta WHERE term_id = $_id";
|
194 |
+
$metas = $wpdb->get_results( $meta_query, ARRAY_A );
|
195 |
+
} else {
|
196 |
+
return;
|
197 |
+
}
|
198 |
+
|
199 |
+
?>
|
200 |
+
<div id="wpglobus-admin-debug-box" class="" style="display:none;">
|
201 |
+
<h4>WPGlobus debug box</h4>
|
202 |
+
<?php
|
203 |
+
if ( $this->is_enabled_section('yoast') ) :
|
204 |
+
/**
|
205 |
+
* Output yoast options.
|
206 |
+
*/
|
207 |
+
if ( empty( self::$key ) ) {
|
208 |
+
$query = $wpdb->prepare( "SELECT * FROM $wpdb->options WHERE option_name LIKE '%s' OR option_name LIKE '%s'", '%wpseo%', '%yoast%' );
|
209 |
+
$query_caption = "SELECT * FROM $wpdb->options WHERE option_name LIKE '%wpseo%' OR option_name LIKE '%yoast%'";
|
210 |
+
} else {
|
211 |
+
$query = $wpdb->prepare( "SELECT * FROM $wpdb->options WHERE option_name = %s", self::$key );
|
212 |
+
$_key = self::$key;
|
213 |
+
$query_caption = "SELECT * FROM $wpdb->options WHERE option_name = $_key";
|
214 |
+
}
|
215 |
+
$results = $wpdb->get_results( $query );
|
216 |
+
?>
|
217 |
+
<table class="table1" cellspacing="0">
|
218 |
+
<caption><strong><?php echo '"' . $query_caption . '"'; ?></strong></caption>
|
219 |
+
<thead>
|
220 |
+
<tr>
|
221 |
+
<th><strong>№</strong></th>
|
222 |
+
<th><strong>option name</strong></th>
|
223 |
+
<th><strong>value</strong></th>
|
224 |
+
</tr>
|
225 |
+
</thead>
|
226 |
+
<tbody>
|
227 |
+
<?php
|
228 |
+
$order = 1;
|
229 |
+
|
230 |
+
foreach ( $results as $key=>$value ) {
|
231 |
+
$code = false;
|
232 |
+
//if ( is_array( $meta ) ) {
|
233 |
+
//$results[$key]['meta_key'] = htmlspecialchars( $meta['meta_value'] );
|
234 |
+
//}
|
235 |
+
$args = $_GET;
|
236 |
+
if ( empty( self::$key ) ) {
|
237 |
+
$args['wpglobus-debug'] = 'yoast';
|
238 |
+
$args = array_merge( $args, array('key'=>$value->option_name) );
|
239 |
+
$_url = admin_url( add_query_arg( $args, $pagenow ) );
|
240 |
+
} else {
|
241 |
+
$_url = admin_url( add_query_arg( $args, $pagenow ) );
|
242 |
+
}
|
243 |
+
?>
|
244 |
+
<tr>
|
245 |
+
<td><?php echo esc_html( $order ); ?></td>
|
246 |
+
<td><?php echo sprintf( '<a href="%s">%s</a>', $_url, esc_html( $value->option_name ) ); ?></td>
|
247 |
+
<?php if ( $code ) { ?>
|
248 |
+
<td>
|
249 |
+
<pre><?php echo esc_html( print_r( $value->option_value, true ) ); ?></pre>
|
250 |
+
</td>
|
251 |
+
<?php } else { ?>
|
252 |
+
<td><?php echo esc_html( print_r( $value->option_value, true ) ); ?></td>
|
253 |
+
<?php } ?>
|
254 |
+
</tr>
|
255 |
+
<?php $order ++; ?>
|
256 |
+
<?php } ?>
|
257 |
+
</tbody>
|
258 |
+
</table>
|
259 |
+
<?php
|
260 |
+
endif;
|
261 |
+
|
262 |
+
if ( $this->is_enabled_section('meta') ) :
|
263 |
+
/**
|
264 |
+
* Output metadata.
|
265 |
+
*/
|
266 |
+
?>
|
267 |
+
<table class="table2" cellspacing="0">
|
268 |
+
<caption><strong><?php echo '"' . $meta_query_caption . '"'; ?></strong></caption>
|
269 |
+
<thead>
|
270 |
+
<tr>
|
271 |
+
<th><strong>№</strong></th>
|
272 |
+
<th><strong>meta</strong></th>
|
273 |
+
<th><strong>value</strong></th>
|
274 |
+
</tr>
|
275 |
+
</thead>
|
276 |
+
<tbody>
|
277 |
+
<?php
|
278 |
+
if ( empty($metas) ) { ?>
|
279 |
+
<tr>
|
280 |
+
<td></td>
|
281 |
+
<td>No data</td>
|
282 |
+
<td>No data</td>
|
283 |
+
</tr> <?php
|
284 |
+
} else {
|
285 |
+
$order = 1;
|
286 |
+
foreach ( $metas as $key=>$meta ) {
|
287 |
+
$code = false;
|
288 |
+
if ( is_array( $meta ) ) {
|
289 |
+
$metas[$key]['meta_key'] = htmlspecialchars( $meta['meta_value'] );
|
290 |
+
}
|
291 |
+
?>
|
292 |
+
<tr>
|
293 |
+
<td><?php echo esc_html( $order ); ?></td>
|
294 |
+
<td><?php echo esc_html( print_r( $meta[ 'meta_key' ], true ) ); ?></td>
|
295 |
+
<?php if ( $code ) { ?>
|
296 |
+
<td>
|
297 |
+
<pre><?php echo esc_html( print_r( $meta[ 'meta_value' ], true ) ); ?></pre>
|
298 |
+
</td>
|
299 |
+
<?php } else { ?>
|
300 |
+
<td><?php echo esc_html( print_r( $meta[ 'meta_value' ], true ) ); ?></td>
|
301 |
+
<?php } ?>
|
302 |
+
</tr>
|
303 |
+
<?php $order ++;
|
304 |
+
}
|
305 |
+
} ?>
|
306 |
+
</tbody>
|
307 |
+
</table>
|
308 |
+
<?php
|
309 |
+
endif;
|
310 |
+
|
311 |
+
if ( $this->is_enabled_section('wpglobus_options') ) :
|
312 |
+
/**
|
313 |
+
* Output WPGlobus options.
|
314 |
+
*/
|
315 |
+
$query = "SELECT * FROM $wpdb->options WHERE option_name LIKE '%wpglobus%'";
|
316 |
+
$results = $wpdb->get_results( $query );
|
317 |
+
?>
|
318 |
+
<table class="table3" cellspacing="0">
|
319 |
+
<caption><strong><?php echo '"SELECT * FROM $wpdb->options WHERE option_name LIKE \'%wpglobus%\'"'; ?></strong></caption>
|
320 |
+
<caption><?php echo 'Option count: ' . count( $results ); ?></caption>
|
321 |
+
<thead>
|
322 |
+
<tr>
|
323 |
+
<th><strong>Option ID</strong></th>
|
324 |
+
<th><strong>Option Name</strong></th>
|
325 |
+
<th><strong>Option Value</strong></th>
|
326 |
+
</tr>
|
327 |
+
</thead>
|
328 |
+
<tbody>
|
329 |
+
<?php
|
330 |
+
|
331 |
+
$order = 1;
|
332 |
+
|
333 |
+
foreach ( $results as $option_key => $option ) {
|
334 |
+
$code = false;
|
335 |
+
if ( is_array( $option->option_value ) ) {
|
336 |
+
foreach ( $option->option_value as $key => $value ) {
|
337 |
+
$option->option_value[ $key ] = htmlspecialchars( $value );
|
338 |
+
}
|
339 |
+
} elseif ( is_string( $option->option_value ) ) {
|
340 |
+
$option->option_value = htmlspecialchars( $option->option_value );
|
341 |
+
}
|
342 |
+
?>
|
343 |
+
<tr>
|
344 |
+
<td><?php echo esc_html( $option->option_id ); ?></td>
|
345 |
+
<td><?php echo esc_html( print_r( $option->option_name, true ) ); ?></td>
|
346 |
+
<?php if ( $code ) { ?>
|
347 |
+
<td>
|
348 |
+
<pre><?php echo esc_html( print_r( $option->option_value, true ) ); ?></pre>
|
349 |
+
</td>
|
350 |
+
<?php } else { ?>
|
351 |
+
<td><?php echo esc_html( print_r( $option->option_value, true ) ); ?></td>
|
352 |
+
<?php } ?>
|
353 |
+
</tr>
|
354 |
+
<?php $order ++; ?>
|
355 |
+
<?php } ?>
|
356 |
+
</tbody>
|
357 |
+
</table><?php
|
358 |
+
endif; ?>
|
359 |
+
</div>
|
360 |
+
|
361 |
+
<?php
|
362 |
+
}
|
363 |
+
|
364 |
+
}
|
365 |
+
|
366 |
+
endif;
|
trunk/includes/admin/helpdesk/class-wpglobus-admin-helpdesk.php
ADDED
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-admin-helpdesk.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Admin\HelpDesk
|
6 |
+
*/
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Admin_HelpDesk.
|
11 |
+
* The Contact Support form.
|
12 |
+
*/
|
13 |
+
class WPGlobus_Admin_HelpDesk {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Nonce.
|
17 |
+
*
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
const NONCE_ACTION = 'wpglobus-helpdesk';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Email address of the Support.
|
24 |
+
*
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
+
const EMAIL_SUPPORT = 'support@wpglobus.com';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Admin page title.
|
31 |
+
*
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
+
public static $page_title;
|
35 |
+
/**
|
36 |
+
* Admin menu title.
|
37 |
+
*
|
38 |
+
* @var string
|
39 |
+
*/
|
40 |
+
protected static $menu_title;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var string
|
44 |
+
*/
|
45 |
+
protected static $name;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @return string
|
49 |
+
*/
|
50 |
+
public static function getName() {
|
51 |
+
return self::$name;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @var string
|
56 |
+
*/
|
57 |
+
protected static $email;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @return string
|
61 |
+
*/
|
62 |
+
public static function getEmail() {
|
63 |
+
return self::$email;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @var string
|
68 |
+
*/
|
69 |
+
protected static $submission_status = 'success';
|
70 |
+
|
71 |
+
/**
|
72 |
+
* @return string
|
73 |
+
*/
|
74 |
+
public static function getSubmissionStatus() {
|
75 |
+
return self::$submission_status;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @var string
|
80 |
+
*/
|
81 |
+
protected static $submission_message = '';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @return string
|
85 |
+
*/
|
86 |
+
public static function getSubmissionMessage() {
|
87 |
+
return self::$submission_message;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Static "constructor".
|
92 |
+
*/
|
93 |
+
public static function construct() {
|
94 |
+
self::set_vars();
|
95 |
+
self::set_hooks();
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Set class variables.
|
100 |
+
*/
|
101 |
+
public static function set_vars() {
|
102 |
+
self::$page_title = __( 'WPGlobus Help Desk', 'wpglobus' );
|
103 |
+
self::$menu_title = __( 'Help Desk', 'wpglobus' );
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Setup actions and filters.
|
108 |
+
*/
|
109 |
+
protected static function set_hooks() {
|
110 |
+
add_action( 'admin_menu', array( __CLASS__, 'add_menu' ), PHP_INT_MAX );
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Add admin menu item.
|
115 |
+
*/
|
116 |
+
public static function add_menu() {
|
117 |
+
add_submenu_page(
|
118 |
+
WPGlobus::OPTIONS_PAGE_SLUG,
|
119 |
+
self::$page_title,
|
120 |
+
'<span class="' . esc_attr( WPGlobus_Admin_Page::nav_tab_icon( 'Helpdesk' ) ) . '"></span> '
|
121 |
+
. self::$menu_title,
|
122 |
+
'administrator',
|
123 |
+
WPGlobus::PAGE_WPGLOBUS_HELPDESK,
|
124 |
+
array( __CLASS__, 'helpdesk_page' )
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* The admin page.
|
130 |
+
*/
|
131 |
+
public static function helpdesk_page() {
|
132 |
+
/** @noinspection PhpUnusedLocalVariableInspection */
|
133 |
+
$data = self::get_data();
|
134 |
+
|
135 |
+
self::handle_submit();
|
136 |
+
|
137 |
+
/*
|
138 |
+
* Prepare data for the view.
|
139 |
+
*/
|
140 |
+
|
141 |
+
$active_plugins = explode( ', ', $data['active_plugins'] );
|
142 |
+
unset( $data['active_plugins'] );
|
143 |
+
|
144 |
+
$tech_info = '';
|
145 |
+
foreach ( $data as $key => $value ) {
|
146 |
+
$tech_info .= $key . ' = ' . $value . "\n";
|
147 |
+
}
|
148 |
+
|
149 |
+
// Split one-cell formatted list of plugins into the separate rows.
|
150 |
+
foreach ( $active_plugins as $active_plugin ) {
|
151 |
+
list( $name, $version ) = explode( ':', $active_plugin );
|
152 |
+
|
153 |
+
$tech_info .= $name . ' = ' . $version . "\n";
|
154 |
+
}
|
155 |
+
|
156 |
+
/** @noinspection PhpUnusedLocalVariableInspection */
|
157 |
+
$subject = empty( $_POST['subject'] ) ? '' : sanitize_text_field( $_POST['subject'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
158 |
+
if ( empty($subject) ) {
|
159 |
+
$subject = empty( $_GET['subject'] ) ? '' : sanitize_text_field( $_GET['subject'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
160 |
+
}
|
161 |
+
|
162 |
+
|
163 |
+
/** @noinspection PhpUnusedLocalVariableInspection */
|
164 |
+
$details = empty( $_POST['details'] ) ? '' : sanitize_textarea_field( $_POST['details'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
165 |
+
|
166 |
+
// Render view.
|
167 |
+
include dirname( __FILE__ ) . '/wpglobus-admin-helpdesk-page.php';
|
168 |
+
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Handle the form submit.
|
173 |
+
*/
|
174 |
+
protected static function handle_submit() {
|
175 |
+
if ( ! empty( $_POST ) ) {
|
176 |
+
check_admin_referer( self::NONCE_ACTION );
|
177 |
+
|
178 |
+
if (
|
179 |
+
empty( $_POST['name'] )
|
180 |
+
|| empty( $_POST['email'] )
|
181 |
+
|| empty( $_POST['subject'] )
|
182 |
+
|| empty( $_POST['details'] )
|
183 |
+
) {
|
184 |
+
self::$submission_status = 'error';
|
185 |
+
self::$submission_message = __( 'Email not sent. Please fill in the entire form.', 'wpglobus' );
|
186 |
+
|
187 |
+
return;
|
188 |
+
}
|
189 |
+
|
190 |
+
self::$name = sanitize_text_field( $_POST['name'] );
|
191 |
+
self::$email = sanitize_email( $_POST['email'] );
|
192 |
+
|
193 |
+
if ( ! self::$name || ! self::$email ) {
|
194 |
+
self::$submission_status = 'error';
|
195 |
+
self::$submission_message = __( 'Email not sent. Please verify that your name and email are entered correctly.', 'wpglobus' );
|
196 |
+
|
197 |
+
return;
|
198 |
+
}
|
199 |
+
|
200 |
+
$message = sanitize_textarea_field( $_POST['details'] );
|
201 |
+
if ( ! empty( $_POST['info'] ) ) {
|
202 |
+
$message .= "\n-----\n" . sanitize_textarea_field( $_POST['info'] );
|
203 |
+
}
|
204 |
+
|
205 |
+
$headers = array(
|
206 |
+
'from: ' . self::$name . ' <' . self::$email . '>',
|
207 |
+
'reply-to: ' . self::$email,
|
208 |
+
'cc: ' . self::$email,
|
209 |
+
);
|
210 |
+
|
211 |
+
add_action( 'wp_mail_failed', array( __CLASS__, 'action__wp_mail_failed' ) );
|
212 |
+
|
213 |
+
if ( wp_mail( self::EMAIL_SUPPORT, $_POST['subject'], $message, $headers ) ) :
|
214 |
+
|
215 |
+
self::$submission_status = 'success';
|
216 |
+
self::$submission_message = __( 'Email sent.', 'wpglobus' );
|
217 |
+
|
218 |
+
endif;
|
219 |
+
|
220 |
+
remove_action( 'wp_mail_failed', array( __CLASS__, 'action__wp_mail_failed' ) );
|
221 |
+
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Collect technical data.
|
227 |
+
*
|
228 |
+
* @return array
|
229 |
+
*/
|
230 |
+
protected static function get_data() {
|
231 |
+
$user = wp_get_current_user();
|
232 |
+
self::$name = WPGlobus_Filters::filter__text( $user->display_name );
|
233 |
+
self::$email = $user->user_email;
|
234 |
+
|
235 |
+
$theme = wp_get_theme();
|
236 |
+
|
237 |
+
/**
|
238 |
+
* @see php_uname can be disabled in php.ini for security reasons
|
239 |
+
* disable_functions=php_uname
|
240 |
+
* @since 1.7.13
|
241 |
+
*/
|
242 |
+
$OS = 'Unknown';
|
243 |
+
if ( function_exists( 'php_uname' ) ) {
|
244 |
+
$OS = implode( ' ', array(
|
245 |
+
php_uname( 's' ),
|
246 |
+
php_uname( 'r' ),
|
247 |
+
php_uname( 'v' ),
|
248 |
+
) );
|
249 |
+
}
|
250 |
+
|
251 |
+
$data = array(
|
252 |
+
'home_url' => home_url(),
|
253 |
+
'site_url' => site_url(),
|
254 |
+
'REMOTE_ADDR' => sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ),
|
255 |
+
// WPCS: input var ok, sanitization ok.
|
256 |
+
'SERVER_PORT' => sanitize_text_field( wp_unslash( $_SERVER['SERVER_PORT'] ) ),
|
257 |
+
// WPCS: input var ok, sanitization ok.
|
258 |
+
'OS' => $OS,
|
259 |
+
'PHP_SAPI' => PHP_SAPI,
|
260 |
+
'PHP_VERSION' => PHP_VERSION,
|
261 |
+
'loaded_extensions' => implode( ', ', get_loaded_extensions() ),
|
262 |
+
'wp_version' => $GLOBALS['wp_version'],
|
263 |
+
'is_multisite' => is_multisite() ? 'Y' : 'N',
|
264 |
+
'theme' => $theme->display( 'Name' ) . ' ' . $theme->display( 'ThemeURI' ) . ' by ' . $theme->get( 'Author' ) . ' ' . $theme->get( 'AuthorURI' ) . ( is_child_theme() ? '; child of ' . $theme->display( 'Template' ) : '' ),
|
265 |
+
'enabled_languages' => implode( ', ', WPGlobus::Config()->enabled_languages ),
|
266 |
+
);
|
267 |
+
|
268 |
+
// The list of plugins is formatted here for display on the admin page,
|
269 |
+
// to fit into one table cell.
|
270 |
+
$active_plugins = array();
|
271 |
+
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
|
272 |
+
$plugin_data = get_plugin_data( $plugin );
|
273 |
+
$plugin_file = str_replace( trailingslashit( WP_PLUGIN_DIR ), '', dirname( $plugin ) );
|
274 |
+
|
275 |
+
$active_plugins[] = $plugin_file . ':' . $plugin_data['Version'];
|
276 |
+
}
|
277 |
+
$data['active_plugins'] = implode( ', ', $active_plugins );
|
278 |
+
|
279 |
+
return $data;
|
280 |
+
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Print admin notice if sending failed.
|
285 |
+
*
|
286 |
+
* @param WP_Error $error
|
287 |
+
*/
|
288 |
+
public static function action__wp_mail_failed( WP_Error $error ) {
|
289 |
+
self::$submission_status = 'error';
|
290 |
+
self::$submission_message = $error->get_error_message();
|
291 |
+
}
|
292 |
+
}
|
trunk/includes/admin/helpdesk/wpglobus-admin-helpdesk-page.php
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: view-page.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Admin\HelpDesk
|
6 |
+
* @global string[] $data
|
7 |
+
*/
|
8 |
+
|
9 |
+
// Exit if accessed directly
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
|
14 |
+
WPGlobus_Admin_Page::print_header();
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Vars defined in @see \WPGlobus_Admin_HelpDesk::helpdesk_page
|
18 |
+
*
|
19 |
+
* @var string $subject
|
20 |
+
* @var string $tech_info
|
21 |
+
*/
|
22 |
+
?>
|
23 |
+
|
24 |
+
<h2 class="nav-tab-wrapper wp-clearfix">
|
25 |
+
<a href="#" class="nav-tab nav-tab-active">
|
26 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Helpdesk' ); ?>
|
27 |
+
<?php echo esc_html( WPGlobus_Admin_HelpDesk::$page_title ); ?>
|
28 |
+
</a>
|
29 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_settings() ); ?>"
|
30 |
+
class="nav-tab">
|
31 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Settings' ); ?>
|
32 |
+
<?php esc_html_e( 'Settings' ); ?>
|
33 |
+
</a>
|
34 |
+
<a href="<?php echo esc_url( WPGlobus_Admin_Page::url_addons() ); ?>"
|
35 |
+
class="nav-tab">
|
36 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Add-ons' ); ?>
|
37 |
+
<?php esc_html_e( 'Add-ons', 'wpglobus' ); ?>
|
38 |
+
</a>
|
39 |
+
<a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . 'quick-start/' ); ?>"
|
40 |
+
target="_blank"
|
41 |
+
class="nav-tab">
|
42 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Guide' ); ?>
|
43 |
+
<?php esc_html_e( 'Guide', 'wpglobus' ); ?>
|
44 |
+
</a>
|
45 |
+
<a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() . 'faq/' ); ?>"
|
46 |
+
target="_blank"
|
47 |
+
class="nav-tab">
|
48 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'FAQ' ); ?>
|
49 |
+
<?php esc_html_e( 'FAQ', 'wpglobus' ); ?>
|
50 |
+
</a>
|
51 |
+
<a href="<?php echo esc_url( WPGlobus_Utils::url_wpglobus_site() ); ?>"
|
52 |
+
target="_blank"
|
53 |
+
class="nav-tab">
|
54 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'globe' ); ?>
|
55 |
+
<?php echo esc_html( 'WPGlobus.com' ); ?>
|
56 |
+
</a>
|
57 |
+
</h2>
|
58 |
+
|
59 |
+
<?php if ( WPGlobus_Admin_HelpDesk::getSubmissionMessage() ) : ?>
|
60 |
+
<div class="notice notice-<?php echo esc_attr( WPGlobus_Admin_HelpDesk::getSubmissionStatus() ); ?>">
|
61 |
+
<p>
|
62 |
+
<?php echo esc_html( WPGlobus_Admin_HelpDesk::getSubmissionMessage() ); ?>
|
63 |
+
</p>
|
64 |
+
</div>
|
65 |
+
<?php endif; ?>
|
66 |
+
|
67 |
+
<p><em>
|
68 |
+
<?php esc_html_e( 'Thank you for using WPGlobus!', 'wpglobus' ); ?>
|
69 |
+
<?php esc_html_e( 'Our Support Team is here to answer your questions or concerns.', 'wpglobus' ); ?>
|
70 |
+
</em></p>
|
71 |
+
<h4><?php esc_html_e( 'To help us serve you better:', 'wpglobus' ); ?></h4>
|
72 |
+
<ol>
|
73 |
+
<li><?php esc_html_e( 'Please check if the problem persists if you switch to a standard WordPress theme.', 'wpglobus' ); ?></li>
|
74 |
+
<li><?php esc_html_e( 'Try deactivating other plugins to see if any of them conflicts with WPGlobus.', 'wpglobus' ); ?></li>
|
75 |
+
</ol>
|
76 |
+
|
77 |
+
<h4><?php esc_html_e( 'Please fill in and submit the contact form:', 'wpglobus' ); ?></h4>
|
78 |
+
|
79 |
+
<form action="<?php echo esc_url( WPGlobus_Admin_Page::url_helpdesk() ); ?>" method="post" id="wpglobus-form-helpdesk">
|
80 |
+
|
81 |
+
<table class="form-table">
|
82 |
+
<tbody>
|
83 |
+
<tr class="form-field">
|
84 |
+
<th><label for="name"><?php esc_html_e( 'Name' ); ?>:</label></th>
|
85 |
+
<td><input required="required" type="text" name="name" id="name"
|
86 |
+
value="<?php echo esc_attr( WPGlobus_Admin_HelpDesk::getName() ); ?>" data-lpignore="true"/>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
<tr class="form-field">
|
90 |
+
<th><label for="email"><?php esc_html_e( 'Email' ); ?>:</label></th>
|
91 |
+
<td>
|
92 |
+
<input required="required" type="email" name="email" id="email"
|
93 |
+
value="<?php echo esc_attr( WPGlobus_Admin_HelpDesk::getEmail() ); ?>"
|
94 |
+
data-lpignore="true"/>
|
95 |
+
<p class="description">
|
96 |
+
<strong>
|
97 |
+
<?php esc_html_e( 'Please make sure the email address is correct.', 'wpglobus' ); ?>
|
98 |
+
</strong>
|
99 |
+
</p>
|
100 |
+
</td>
|
101 |
+
</tr>
|
102 |
+
<tr class="form-field">
|
103 |
+
<th><label for="subject"><?php esc_html_e( 'Subject', 'wpglobus' ); ?>:</label></th>
|
104 |
+
<td>
|
105 |
+
<input required="required" type="text" name="subject" id="subject"
|
106 |
+
value="<?php echo esc_attr( $subject ); ?>" data-lpignore="true"/>
|
107 |
+
<p class="description">
|
108 |
+
<?php esc_html_e( 'Short description of the problem', 'wpglobus' ); ?>
|
109 |
+
</p>
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
<tr class="form-field">
|
113 |
+
<th><label for="details"><?php esc_html_e( 'Detailed description', 'wpglobus' ); ?>:</label></th>
|
114 |
+
<td>
|
115 |
+
<textarea required="required" name="details" id="details"
|
116 |
+
rows="10"><?php echo esc_attr( $details ); ?></textarea>
|
117 |
+
</td>
|
118 |
+
</tr>
|
119 |
+
<tr class="form-field">
|
120 |
+
<th><label for="info"><?php esc_html_e( 'Technical Information', 'wpglobus' ); ?>:</label></th>
|
121 |
+
<td>
|
122 |
+
<textarea name="info" id="info" rows="10"
|
123 |
+
style="font-family: monospace; font-size: 10px; background-color: #eee; white-space: nowrap; overflow: hidden"
|
124 |
+
data-gramm_editor="false"
|
125 |
+
spellcheck="false"><?php echo esc_html( $tech_info ); ?></textarea>
|
126 |
+
<p class="description">
|
127 |
+
<?php esc_html_e( 'This information helps us to find the problem source', 'wpglobus' ); ?>
|
128 |
+
</p>
|
129 |
+
</td>
|
130 |
+
</tr>
|
131 |
+
</tbody>
|
132 |
+
</table>
|
133 |
+
|
134 |
+
<?php wp_nonce_field( WPGlobus_Admin_HelpDesk::NONCE_ACTION ); ?>
|
135 |
+
|
136 |
+
<button class="button-primary" type="submit" name="send_email" id="send_email">
|
137 |
+
<?php WPGlobus_Admin_Page::nav_tab_icon_e( 'Helpdesk' ); ?>
|
138 |
+
<?php esc_html_e( 'Submit' ); ?>
|
139 |
+
</button>
|
140 |
+
<script>
|
141 |
+
jQuery(function ($) {
|
142 |
+
$("#wpglobus-form-helpdesk").on("submit", function (e) {
|
143 |
+
$("#send_email").prop("disabled", true);
|
144 |
+
});
|
145 |
+
function adjustHeight(el, minHeight) {
|
146 |
+
var outerHeight = parseInt(window.getComputedStyle(el).height, 10);
|
147 |
+
var diff = outerHeight - el.clientHeight;
|
148 |
+
el.style.height = 0;
|
149 |
+
el.style.height = Math.max(minHeight, el.scrollHeight + diff) + 'px';
|
150 |
+
}
|
151 |
+
var textArea = [].slice.call(document.querySelectorAll('textarea#info'));
|
152 |
+
if ( textArea.length == 1 ) {
|
153 |
+
adjustHeight(textArea[0], textArea[0].scrollHeight);
|
154 |
+
}
|
155 |
+
|
156 |
+
});
|
157 |
+
</script>
|
158 |
+
|
159 |
+
</form>
|
160 |
+
<p>
|
161 |
+
*) <?php printf( esc_html__( 'Alternatively, please email %s. Do not forget to copy and paste the technical information to your email message.', 'wpglobus' ), '<a href="mailto:' . esc_attr( WPGlobus_Admin_HelpDesk::EMAIL_SUPPORT ) . '">' . esc_html( WPGlobus_Admin_HelpDesk::EMAIL_SUPPORT ) . '</a>' ); ?></p>
|
162 |
+
|
163 |
+
<?php
|
164 |
+
|
165 |
+
WPGlobus_Admin_Page::print_footer();
|
trunk/includes/admin/media/class-wpglobus-media.php
ADDED
@@ -0,0 +1,413 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package WPGlobus
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Class WPGlobus_Media.
|
8 |
+
*
|
9 |
+
* @since 1.7.3
|
10 |
+
* @since 2.2.22
|
11 |
+
*/
|
12 |
+
if ( ! class_exists( 'WPGlobus_Media' ) ) :
|
13 |
+
|
14 |
+
class WPGlobus_Media {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Instance.
|
18 |
+
*/
|
19 |
+
protected static $instance;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Post types to work on media page.
|
23 |
+
*/
|
24 |
+
protected $enabled_post_types = array();
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get instance.
|
28 |
+
*/
|
29 |
+
public static function get_instance($http_post_action = false, $http_post_actions = array()){
|
30 |
+
if( null == self::$instance ){
|
31 |
+
self::$instance = new self($http_post_action, $http_post_actions);
|
32 |
+
}
|
33 |
+
return self::$instance;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Constructor.
|
38 |
+
*/
|
39 |
+
public function __construct($http_post_action, $http_post_actions) {
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @scope admin
|
43 |
+
* @since 1.7.3
|
44 |
+
*/
|
45 |
+
add_action( 'admin_print_scripts', array(
|
46 |
+
$this,
|
47 |
+
'post_php__admin_scripts'
|
48 |
+
), 5 );
|
49 |
+
|
50 |
+
if ( in_array($http_post_action, $http_post_actions) ) {
|
51 |
+
|
52 |
+
if ( 'send-attachment-to-editor' == $http_post_action ) {
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @scope admin
|
56 |
+
* @see filter 'media_send_to_editor' in wp-admin\includes\media.php
|
57 |
+
* @since 1.7.3
|
58 |
+
*/
|
59 |
+
add_filter( 'media_send_to_editor', array(
|
60 |
+
$this,
|
61 |
+
'filter__media_send_to_editor'
|
62 |
+
), 5, 3 );
|
63 |
+
|
64 |
+
} else if ( 'query-attachments' == $http_post_action ) {
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @scope admin
|
68 |
+
* @see filter 'wp_prepare_attachment_for_js' in wp-includes\media.php
|
69 |
+
* @since 2.2.22
|
70 |
+
*/
|
71 |
+
add_filter( 'wp_prepare_attachment_for_js', array(
|
72 |
+
$this,
|
73 |
+
'filter__prepare_attachment_for_js'
|
74 |
+
), 5, 3 );
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->enabled_post_types[] = 'attachment';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @scope admin
|
85 |
+
* @since 1.7.3
|
86 |
+
*/
|
87 |
+
add_action( 'edit_form_after_editor', array(
|
88 |
+
$this,
|
89 |
+
'language_tabs'
|
90 |
+
) );
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @scope admin
|
94 |
+
* @since 1.7.3
|
95 |
+
*/
|
96 |
+
add_action( 'admin_print_scripts', array(
|
97 |
+
$this,
|
98 |
+
'media__admin_scripts'
|
99 |
+
) );
|
100 |
+
|
101 |
+
/**
|
102 |
+
* @scope admin
|
103 |
+
* @since 1.7.3
|
104 |
+
*/
|
105 |
+
add_action( 'admin_print_styles', array(
|
106 |
+
$this,
|
107 |
+
'action__admin_styles'
|
108 |
+
) );
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Filters the HTML markup for a media item sent to the editor.
|
116 |
+
*
|
117 |
+
* @scope admin
|
118 |
+
* @since 1.7.3
|
119 |
+
*
|
120 |
+
* @param string $html HTML markup.
|
121 |
+
* @param int $id Unused.
|
122 |
+
* @param array $attachment Array of attachment metadata.
|
123 |
+
*
|
124 |
+
* @return boolean
|
125 |
+
*/
|
126 |
+
public function filter__media_send_to_editor( $html, $id, $attachment ) {
|
127 |
+
|
128 |
+
$fields = array(
|
129 |
+
'post_content',
|
130 |
+
'post_excerpt',
|
131 |
+
'image_alt',
|
132 |
+
);
|
133 |
+
|
134 |
+
$current_language = WPGlobus::Config()->default_language;
|
135 |
+
if ( ! empty( $_POST['wpglobusLanguageTab'] ) ) { // WPCS: input var ok, sanitization ok.
|
136 |
+
/**
|
137 |
+
* See wpglobus-media.js
|
138 |
+
*/
|
139 |
+
$current_language = sanitize_text_field( wp_unslash( $_POST['wpglobusLanguageTab'] ) ); // WPCS: input var ok, sanitization ok.
|
140 |
+
|
141 |
+
if ( ! in_array( $current_language, WPGlobus::Config()->enabled_languages, true ) ) {
|
142 |
+
return $html;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
foreach ( $fields as $field ) {
|
147 |
+
if ( ! empty( $attachment[ $field ] ) && WPGlobus_Core::has_translations( $attachment[ $field ] ) ) {
|
148 |
+
$html = str_replace( $attachment[ $field ], WPGlobus_Core::text_filter( $attachment[ $field ], $current_language ), $html );
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
return $html;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Check for enabled post types.
|
157 |
+
*
|
158 |
+
* @scope admin
|
159 |
+
* @since 1.7.3
|
160 |
+
* @access public
|
161 |
+
*
|
162 |
+
* @return boolean
|
163 |
+
*/
|
164 |
+
public function is_enabled() {
|
165 |
+
|
166 |
+
global $post;
|
167 |
+
|
168 |
+
if ( empty( $post ) ) {
|
169 |
+
return false;
|
170 |
+
}
|
171 |
+
|
172 |
+
if ( in_array( $post->post_type, $this->enabled_post_types ) ) {
|
173 |
+
return true;
|
174 |
+
}
|
175 |
+
|
176 |
+
return false;
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Enqueue admin scripts on post.php page.
|
182 |
+
*
|
183 |
+
* @scope admin
|
184 |
+
* @since 1.7.3
|
185 |
+
* @access public
|
186 |
+
*
|
187 |
+
* @return void
|
188 |
+
*/
|
189 |
+
public function post_php__admin_scripts() {
|
190 |
+
|
191 |
+
global $post;
|
192 |
+
|
193 |
+
if ( empty( $post ) ) {
|
194 |
+
return;
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( in_array( $post->post_type, array( 'attachment' ) ) ) {
|
198 |
+
/**
|
199 |
+
* Don't load on edit media page.
|
200 |
+
*/
|
201 |
+
return;
|
202 |
+
}
|
203 |
+
|
204 |
+
wp_register_script(
|
205 |
+
'wpglobus-media-post-php',
|
206 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/js/wpglobus-media-post-php' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
207 |
+
array(),
|
208 |
+
WPGLOBUS_VERSION,
|
209 |
+
true
|
210 |
+
);
|
211 |
+
wp_enqueue_script( 'wpglobus-media-post-php' );
|
212 |
+
wp_localize_script(
|
213 |
+
'wpglobus-media-post-php',
|
214 |
+
'WPGlobusMediaInPost',
|
215 |
+
array(
|
216 |
+
'version' => WPGLOBUS_VERSION,
|
217 |
+
'builderID' => WPGlobus::Config()->builder->get_id(),
|
218 |
+
)
|
219 |
+
);
|
220 |
+
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Enqueue admin scripts.
|
225 |
+
*
|
226 |
+
* @scope admin
|
227 |
+
* @since 1.7.3
|
228 |
+
* @access public
|
229 |
+
*
|
230 |
+
* @return void
|
231 |
+
*/
|
232 |
+
public function media__admin_scripts() {
|
233 |
+
|
234 |
+
if ( ! $this->is_enabled() ) {
|
235 |
+
return;
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* WordPress 4.7+ needs a new version of our admin JS.
|
240 |
+
* @since 1.7.0
|
241 |
+
*/
|
242 |
+
$version = '';
|
243 |
+
if ( version_compare( $GLOBALS['wp_version'], '4.6.999', '>' ) ) {
|
244 |
+
$version = '-47';
|
245 |
+
}
|
246 |
+
|
247 |
+
wp_register_script(
|
248 |
+
'wpglobus-admin',
|
249 |
+
WPGlobus::$PLUGIN_DIR_URL . "includes/js/wpglobus-admin$version" . WPGlobus::SCRIPT_SUFFIX() . ".js",
|
250 |
+
array( 'jquery', 'jquery-ui-dialog', 'jquery-ui-tabs' ),
|
251 |
+
WPGLOBUS_VERSION,
|
252 |
+
true
|
253 |
+
);
|
254 |
+
wp_enqueue_script( 'wpglobus-admin' );
|
255 |
+
wp_localize_script(
|
256 |
+
'wpglobus-admin',
|
257 |
+
'WPGlobusAdmin',
|
258 |
+
array(
|
259 |
+
'version' => WPGLOBUS_VERSION,
|
260 |
+
'i18n' => array(),
|
261 |
+
'data' => array(
|
262 |
+
'default_language' => WPGlobus::Config()->default_language
|
263 |
+
)
|
264 |
+
)
|
265 |
+
);
|
266 |
+
|
267 |
+
wp_localize_script(
|
268 |
+
'wpglobus-admin',
|
269 |
+
'WPGlobusCoreData',
|
270 |
+
array(
|
271 |
+
'multisite' => 'false',
|
272 |
+
'default_language' => WPGlobus::Config()->default_language,
|
273 |
+
'enabled_languages' => WPGlobus::Config()->enabled_languages,
|
274 |
+
'locale_tag_start' => WPGlobus::LOCALE_TAG_START,
|
275 |
+
'locale_tag_end' => WPGlobus::LOCALE_TAG_END
|
276 |
+
)
|
277 |
+
);
|
278 |
+
|
279 |
+
wp_register_script(
|
280 |
+
'wpglobus-media',
|
281 |
+
WPGlobus::$PLUGIN_DIR_URL . "includes/js/wpglobus-media" . WPGlobus::SCRIPT_SUFFIX() . ".js",
|
282 |
+
array( 'jquery', 'wpglobus-admin' ),
|
283 |
+
WPGLOBUS_VERSION,
|
284 |
+
true
|
285 |
+
);
|
286 |
+
wp_enqueue_script( 'wpglobus-media' );
|
287 |
+
wp_localize_script(
|
288 |
+
'wpglobus-media',
|
289 |
+
'WPGlobusMedia',
|
290 |
+
array(
|
291 |
+
'version' => WPGLOBUS_VERSION,
|
292 |
+
'language' => WPGlobus::Config()->default_language,
|
293 |
+
'defaultLanguage' => WPGlobus::Config()->default_language,
|
294 |
+
'enabledLanguages' => WPGlobus::Config()->enabled_languages,
|
295 |
+
'attachment' => array(
|
296 |
+
'caption' => 'attachment_caption',
|
297 |
+
'alt' => 'attachment_alt',
|
298 |
+
'description' => 'attachment_content',
|
299 |
+
'title' => 'title'
|
300 |
+
)
|
301 |
+
)
|
302 |
+
);
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Enqueue admin styles.
|
307 |
+
*
|
308 |
+
* @scope admin
|
309 |
+
* @since 1.7.3
|
310 |
+
* @access public
|
311 |
+
*
|
312 |
+
* @return void
|
313 |
+
*/
|
314 |
+
public function action__admin_styles() {
|
315 |
+
|
316 |
+
if ( ! $this->is_enabled() ) {
|
317 |
+
return;
|
318 |
+
}
|
319 |
+
|
320 |
+
wp_register_style(
|
321 |
+
'wpglobus-admin-tabs',
|
322 |
+
WPGlobus::$PLUGIN_DIR_URL . 'includes/css/wpglobus-admin-tabs.css',
|
323 |
+
array(),
|
324 |
+
WPGLOBUS_VERSION,
|
325 |
+
'all'
|
326 |
+
);
|
327 |
+
wp_enqueue_style( 'wpglobus-admin-tabs' );
|
328 |
+
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Add language tabs on media page.
|
333 |
+
*
|
334 |
+
* @scope admin
|
335 |
+
* @since 1.7.3
|
336 |
+
* @access public
|
337 |
+
*
|
338 |
+
* @return void
|
339 |
+
*/
|
340 |
+
public function language_tabs() {
|
341 |
+
|
342 |
+
if ( ! $this->is_enabled() ) {
|
343 |
+
return;
|
344 |
+
}
|
345 |
+
|
346 |
+
?>
|
347 |
+
<div id="wpglobus-media-body-tabs" style="margin-top:20px;" class="wpglobus-post-body-tabs">
|
348 |
+
<ul class="wpglobus-post-body-tabs-list"> <?php
|
349 |
+
$order = 0;
|
350 |
+
foreach ( WPGlobus::Config()->open_languages as $language ) {
|
351 |
+
$tab_suffix = $language == WPGlobus::Config()->default_language ? 'default' : $language; ?>
|
352 |
+
<li id="link-tab-<?php echo esc_attr( $tab_suffix ); ?>" data-language="<?php echo esc_attr( $language ); ?>"
|
353 |
+
data-order="<?php echo esc_attr( $order ); ?>"
|
354 |
+
class="wpglobus-post-tab">
|
355 |
+
<a href="#tab-<?php echo esc_attr( $tab_suffix ); ?>"><?php echo esc_html( WPGlobus::Config()->en_language_name[ $language ] ); ?></a>
|
356 |
+
</li> <?php
|
357 |
+
$order ++;
|
358 |
+
} ?>
|
359 |
+
</ul> <?php
|
360 |
+
foreach ( WPGlobus::Config()->open_languages as $language ) {
|
361 |
+
$tab_suffix = $language == WPGlobus::Config()->default_language ? 'default' : $language; ?>
|
362 |
+
<div id="tab-<?php echo esc_attr( $tab_suffix ); ?>" style="display:none;"></div> <?php
|
363 |
+
} ?>
|
364 |
+
</div>
|
365 |
+
<?php
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* Filters the attachment data prepared for JavaScript.
|
370 |
+
*
|
371 |
+
* @since 2.2.22
|
372 |
+
*
|
373 |
+
* @param array $response Array of prepared attachment data.
|
374 |
+
* @param WP_Post $attachment Attachment object.
|
375 |
+
* @param array|false $meta Array of attachment meta data, or false if there is none.
|
376 |
+
*/
|
377 |
+
public function filter__prepare_attachment_for_js( $response, $attachment, $meta ) {
|
378 |
+
|
379 |
+
if ( empty( $_POST['wpglobusPrepareAttachments'] ) ) { // WPCS: input var ok, sanitization ok.
|
380 |
+
return $response;
|
381 |
+
}
|
382 |
+
|
383 |
+
$fields = array(
|
384 |
+
'alt',
|
385 |
+
'description',
|
386 |
+
'caption',
|
387 |
+
// @todo may be `uploadedToTitle` field
|
388 |
+
);
|
389 |
+
|
390 |
+
$current_language = WPGlobus::Config()->default_language;
|
391 |
+
if ( ! empty( $_POST['wpglobusLanguageTab'] ) ) { // WPCS: input var ok, sanitization ok.
|
392 |
+
/**
|
393 |
+
* See includes\js\wpglobus-media.js
|
394 |
+
*/
|
395 |
+
$current_language = sanitize_text_field( wp_unslash( $_POST['wpglobusLanguageTab'] ) ); // WPCS: input var ok, sanitization ok.
|
396 |
+
|
397 |
+
if ( ! in_array( $current_language, WPGlobus::Config()->enabled_languages, true ) ) {
|
398 |
+
return $response;
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
foreach ( $fields as $field ) {
|
403 |
+
if ( ! empty( $response[ $field ] ) && WPGlobus_Core::has_translations( $response[ $field ] ) ) {
|
404 |
+
$response[ $field ] = WPGlobus_Core::text_filter( $response[ $field ], $current_language );
|
405 |
+
}
|
406 |
+
}
|
407 |
+
|
408 |
+
return $response;
|
409 |
+
}
|
410 |
+
|
411 |
+
}
|
412 |
+
|
413 |
+
endif;
|
trunk/includes/admin/media/wpglobus-media.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* 1. Add multilingual Caption, Alternative Text, Description and post Title to media files.
|
4 |
+
* 2. Handling the inserting media in post.
|
5 |
+
*
|
6 |
+
* @since 2.2.22
|
7 |
+
* @package WPGlobus
|
8 |
+
*/
|
9 |
+
if ( version_compare( $GLOBALS['wp_version'], '4.6.999', '>' ) ) :
|
10 |
+
|
11 |
+
$http_post_action = false;
|
12 |
+
|
13 |
+
if ( WPGlobus_WP::is_doing_ajax() ) {
|
14 |
+
if ( WPGlobus_WP::is_http_post_action('send-attachment-to-editor') ) {
|
15 |
+
$http_post_action = 'send-attachment-to-editor';
|
16 |
+
} else if ( WPGlobus_WP::is_http_post_action('query-attachments') ) {
|
17 |
+
/**
|
18 |
+
* Action for gutenberg.
|
19 |
+
*/
|
20 |
+
$http_post_action = 'query-attachments';
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Array of actions to handle the inserting media on post.php page.
|
26 |
+
*/
|
27 |
+
$http_post_actions = array(
|
28 |
+
'send-attachment-to-editor', // standard and builder mode (except gutenberg).
|
29 |
+
'query-attachments' // gutenberg.
|
30 |
+
);
|
31 |
+
|
32 |
+
if ( WPGlobus_WP::is_pagenow( 'post.php' ) || $http_post_action ) {
|
33 |
+
if ( ! class_exists('WPGlobus_Media') ) {
|
34 |
+
require_once 'class-wpglobus-media.php';
|
35 |
+
}
|
36 |
+
WPGlobus_Media::get_instance($http_post_action, $http_post_actions);
|
37 |
+
}
|
38 |
+
endif;
|
trunk/includes/admin/meta/class-wpglobus-meta.php
ADDED
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class WPGlobus_Meta
|
4 |
+
*
|
5 |
+
* @since 1.9.17
|
6 |
+
* @since 1.9.25 Added build_multilingual_string function.
|
7 |
+
*
|
8 |
+
* @package WPGlobus\Admin\Meta
|
9 |
+
* @author Alex Gor(alexgff)
|
10 |
+
*/
|
11 |
+
|
12 |
+
if ( ! class_exists( 'WPGlobus_Meta' ) ) :
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Class WPGlobus_Meta.
|
16 |
+
*/
|
17 |
+
class WPGlobus_Meta {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Instance of this class.
|
21 |
+
*
|
22 |
+
* @var WPGlobus_Meta
|
23 |
+
*/
|
24 |
+
protected static $instance;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Meta fields.
|
28 |
+
*
|
29 |
+
* @var string[]
|
30 |
+
*/
|
31 |
+
public static $meta_fields = array();
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Builder.
|
35 |
+
*
|
36 |
+
* @var WPGlobus_Config_Builder
|
37 |
+
*/
|
38 |
+
protected static $builder = null;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Constructor.
|
42 |
+
*
|
43 |
+
* @param string[] $meta_fields
|
44 |
+
* @param WPGlobus_Config_Builder $builder
|
45 |
+
*/
|
46 |
+
protected function __construct( $meta_fields, $builder ) {
|
47 |
+
|
48 |
+
self::$meta_fields = $meta_fields;
|
49 |
+
self::$builder = $builder;
|
50 |
+
|
51 |
+
if ( is_admin() ) {
|
52 |
+
add_filter( 'get_post_metadata', array( __CLASS__, 'filter__post_metadata' ), 5, 4 );
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @see update_metadata() in wp-includes\meta.php
|
56 |
+
*/
|
57 |
+
add_filter( 'update_post_metadata', array( __CLASS__, 'filter__update_post_metadata' ), 5, 5 );
|
58 |
+
|
59 |
+
add_filter( 'delete_post_metadata', array( __CLASS__, 'filter__delete_metadata' ), 5, 5 );
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Get instance of this class.
|
66 |
+
*
|
67 |
+
* @param string[] $meta_fields
|
68 |
+
* @param WPGlobus_Config_Builder $builder
|
69 |
+
*
|
70 |
+
* @return WPGlobus_Meta
|
71 |
+
*/
|
72 |
+
public static function get_instance( $meta_fields, $builder ) {
|
73 |
+
if ( ! ( self::$instance instanceof WPGlobus_Meta ) ) {
|
74 |
+
self::$instance = new self( $meta_fields, $builder );
|
75 |
+
}
|
76 |
+
|
77 |
+
return self::$instance;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* public static function get_post_meta( $post_id = false ) {
|
82 |
+
* $meta_cache = wp_cache_get($post_id, 'post_meta');
|
83 |
+
* }
|
84 |
+
* // */
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Update post meta data.
|
88 |
+
*
|
89 |
+
* @see wp-includes\meta.php "update_{$meta_type}_metadata".
|
90 |
+
*
|
91 |
+
* @param null|bool $check Whether to allow updating metadata for the given type.
|
92 |
+
* @param int $object_id Object ID.
|
93 |
+
* @param string $meta_key Meta key.
|
94 |
+
* @param mixed $meta_value Meta value. Must be serializable if non-scalar.
|
95 |
+
* @param mixed $prev_value Optional. If specified, only update existing
|
96 |
+
* metadata entries with the specified value.
|
97 |
+
* Otherwise, update all entries.
|
98 |
+
*
|
99 |
+
* @return bool
|
100 |
+
*/
|
101 |
+
public static function filter__update_post_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
|
102 |
+
|
103 |
+
if ( empty( self::$meta_fields ) ) {
|
104 |
+
return $check;
|
105 |
+
}
|
106 |
+
|
107 |
+
if ( ! self::meta_key_exists( $meta_key ) ) {
|
108 |
+
return $check;
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( empty( self::$builder->get_language() ) ) {
|
112 |
+
/**
|
113 |
+
* Prevent update post meta when $builder is not set.
|
114 |
+
* For example, Elementor saves meta `_elementor_data` for Template (post type `elementor_library`).
|
115 |
+
* And we have meta `_elementor_data` in `$meta_fields` array @see wpglobus\configs\elementor.json
|
116 |
+
* @since 2.2.33
|
117 |
+
*/
|
118 |
+
return $check;
|
119 |
+
}
|
120 |
+
|
121 |
+
$meta_type = 'post';
|
122 |
+
|
123 |
+
/** @global wpdb $wpdb */
|
124 |
+
global $wpdb;
|
125 |
+
|
126 |
+
$table = _get_meta_table( $meta_type );
|
127 |
+
if ( ! $table ) {
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
$column = $meta_type . '_id';
|
132 |
+
$id_column = 'meta_id';
|
133 |
+
|
134 |
+
$raw_meta_key = $meta_key;
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Compare existing value to new value if no prev value given and the key exists only once.
|
138 |
+
* @since 2.5.16 Fixed PHP Warning: count(): Parameter must be an array or an object that implements Countable.
|
139 |
+
*/
|
140 |
+
if ( empty( $prev_value ) ) {
|
141 |
+
$old_value = get_metadata_raw( $meta_type, $object_id, $meta_key );
|
142 |
+
if ( is_countable( $old_value ) && count( $old_value ) === 1 ) {
|
143 |
+
if ( $old_value[0] === $meta_value ) {
|
144 |
+
return false;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
$_meta_value = $meta_value;
|
150 |
+
/**
|
151 |
+
* @since 2.1.7
|
152 |
+
*/
|
153 |
+
$meta_value = maybe_serialize( $meta_value );
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Don't auto-modify this SQL query.
|
157 |
+
*/
|
158 |
+
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
159 |
+
$meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) );
|
160 |
+
|
161 |
+
/*
|
162 |
+
// Incorrect query.
|
163 |
+
$meta_ids = $wpdb->get_col( $wpdb->prepare(
|
164 |
+
'SELECT %s FROM %s WHERE meta_key = %s AND %s = %d',
|
165 |
+
$id_column,
|
166 |
+
$table,
|
167 |
+
$meta_key,
|
168 |
+
$column,
|
169 |
+
$object_id
|
170 |
+
) );
|
171 |
+
// */
|
172 |
+
|
173 |
+
if ( empty( $meta_ids ) ) {
|
174 |
+
|
175 |
+
$_passed_value = $_meta_value;
|
176 |
+
|
177 |
+
if ( ! empty( $_passed_value ) && WPGlobus::Config()->default_language !== self::$builder->get_language() ) {
|
178 |
+
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement
|
179 |
+
if ( WPGlobus_Core::has_translations( $_passed_value ) ) {
|
180 |
+
/**
|
181 |
+
* We get multilingual $meta_value. Let save it as is.
|
182 |
+
*
|
183 |
+
* @since 1.9.25 do nothing.
|
184 |
+
*/
|
185 |
+
} else {
|
186 |
+
$_passed_value = self::build_multilingual_string( array( self::$builder->get_language() => $_passed_value ) );
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
return add_metadata( $meta_type, $object_id, $raw_meta_key, $_passed_value );
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* WPGlobus Core.
|
195 |
+
* We get $meta_value in language that can be retrieved with self::$builder->get_language().
|
196 |
+
*/
|
197 |
+
$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );
|
198 |
+
|
199 |
+
/**
|
200 |
+
* May be we need to update meta cache.
|
201 |
+
*
|
202 |
+
* @see 'filter__post_metadata' function.
|
203 |
+
*/
|
204 |
+
|
205 |
+
// if ( !$meta_cache ) {
|
206 |
+
// $meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
|
207 |
+
// $meta_cache = $meta_cache[$object_id];
|
208 |
+
// }
|
209 |
+
|
210 |
+
if ( isset( $meta_cache[ $meta_key ] ) ) {
|
211 |
+
|
212 |
+
//if ( WPGlobus_Core::has_translations( $passed_value ) ) {
|
213 |
+
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement
|
214 |
+
if ( WPGlobus_Core::has_translations( $meta_value ) ) {
|
215 |
+
/**
|
216 |
+
* We get multilingual $meta_value. Let save it as is.
|
217 |
+
*/
|
218 |
+
// @since 1.9.25 do nothing.
|
219 |
+
} else {
|
220 |
+
|
221 |
+
foreach ( $meta_cache[ $meta_key ] as $_key => $_ml_value ) {
|
222 |
+
|
223 |
+
$_new_ml_array = array();
|
224 |
+
|
225 |
+
if ( WPGlobus_Core::has_translations( $_ml_value ) ) {
|
226 |
+
|
227 |
+
foreach ( WPGlobus::Config()->enabled_languages as $language ) :
|
228 |
+
|
229 |
+
if ( $language === self::$builder->get_language() ) {
|
230 |
+
|
231 |
+
if ( ! empty( $meta_value ) ) {
|
232 |
+
$_new_ml_array[ $language ] = $meta_value;
|
233 |
+
}
|
234 |
+
} else {
|
235 |
+
|
236 |
+
$_value = WPGlobus_Core::text_filter( $_ml_value, $language, WPGlobus::RETURN_EMPTY );
|
237 |
+
|
238 |
+
if ( '' !== $_value ) {
|
239 |
+
$_new_ml_array[ $language ] = $_value;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
endforeach;
|
244 |
+
|
245 |
+
$_new_value = self::build_multilingual_string( $_new_ml_array );
|
246 |
+
|
247 |
+
} else {
|
248 |
+
|
249 |
+
if ( WPGlobus::Config()->default_language === self::$builder->get_language() ) {
|
250 |
+
$_new_ml_array[ WPGlobus::Config()->default_language ] = $meta_value;
|
251 |
+
} else {
|
252 |
+
$_new_ml_array[ WPGlobus::Config()->default_language ] = $_ml_value;
|
253 |
+
if ( ! empty( $meta_value ) ) {
|
254 |
+
$_new_ml_array[ self::$builder->get_language() ] = $meta_value;
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
$_new_value = self::build_multilingual_string( $_new_ml_array );
|
259 |
+
|
260 |
+
}
|
261 |
+
|
262 |
+
if ( ! empty( $_new_value ) ) {
|
263 |
+
//$meta_value = maybe_unserialize( $_new_value );
|
264 |
+
$meta_value = $_new_value;
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
$data = compact( 'meta_value' );
|
271 |
+
$where = array(
|
272 |
+
$column => $object_id,
|
273 |
+
'meta_key' => $meta_key,
|
274 |
+
);
|
275 |
+
|
276 |
+
$result = $wpdb->update( $table, $data, $where );
|
277 |
+
|
278 |
+
if ( ! $result ) {
|
279 |
+
return false;
|
280 |
+
}
|
281 |
+
|
282 |
+
wp_cache_delete( $object_id, $meta_type . '_meta' );
|
283 |
+
|
284 |
+
return true;
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* Delete metadata for the specified object.
|
289 |
+
*
|
290 |
+
* in our case we should prevent deleting multilingual string when $meta_value is empty.
|
291 |
+
*
|
292 |
+
* @see wp-includes\meta.php "delete_{$meta_type}_metadata".
|
293 |
+
*
|
294 |
+
* @param null|bool $check Whether to allow metadata deletion of the given type.
|
295 |
+
* @param int $object_id Object ID.
|
296 |
+
* @param string $meta_key Meta key.
|
297 |
+
* @param mixed $meta_value Meta value. Must be serializable if non-scalar.
|
298 |
+
* @param bool $delete_all Whether to delete the matching metadata entries
|
299 |
+
* for all objects, ignoring the specified $object_id.
|
300 |
+
* Default false.
|
301 |
+
*
|
302 |
+
* @return bool|null
|
303 |
+
*/
|
304 |
+
public static function filter__delete_metadata(
|
305 |
+
$check, $object_id, $meta_key, $meta_value,
|
306 |
+
/** @noinspection PhpUnusedParameterInspection */
|
307 |
+
$delete_all = false
|
308 |
+
) {
|
309 |
+
|
310 |
+
if ( empty( self::$meta_fields ) ) {
|
311 |
+
return $check;
|
312 |
+
}
|
313 |
+
|
314 |
+
if ( ! self::meta_key_exists( $meta_key ) ) {
|
315 |
+
return $check;
|
316 |
+
}
|
317 |
+
|
318 |
+
$result = true;
|
319 |
+
|
320 |
+
if ( empty( $meta_value ) && WPGlobus::Config()->default_language === self::$builder->get_language() ) {
|
321 |
+
|
322 |
+
/**
|
323 |
+
* @todo check for extra languages.
|
324 |
+
*/
|
325 |
+
|
326 |
+
/** @global wpdb $wpdb */
|
327 |
+
global $wpdb;
|
328 |
+
|
329 |
+
$_meta_value =
|
330 |
+
$wpdb->get_col(
|
331 |
+
$wpdb->prepare(
|
332 |
+
"SELECT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s",
|
333 |
+
$object_id,
|
334 |
+
$meta_key
|
335 |
+
)
|
336 |
+
);
|
337 |
+
|
338 |
+
if ( ! isset( $_meta_value ) || empty( $_meta_value[0] ) ) {
|
339 |
+
$result = null;
|
340 |
+
} else {
|
341 |
+
if ( WPGlobus_Core::has_translations( $_meta_value[0] ) ) {
|
342 |
+
$result = true;
|
343 |
+
} else {
|
344 |
+
$result = null;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
return $result;
|
350 |
+
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Get post meta.
|
355 |
+
*
|
356 |
+
* @see \get_metadata()
|
357 |
+
*
|
358 |
+
* @param null|array|string $check The value get_metadata() should return - a single metadata value,
|
359 |
+
* or an array of values.
|
360 |
+
* @param int $object_id Object ID.
|
361 |
+
* @param string $meta_key Meta key.
|
362 |
+
* @param bool $single Whether to return only the first value of the specified $meta_key.
|
363 |
+
*
|
364 |
+
* @return array|null|string
|
365 |
+
*/
|
366 |
+
public static function filter__post_metadata( $check, $object_id, $meta_key, $single ) {
|
367 |
+
|
368 |
+
if ( empty( self::$meta_fields ) ) {
|
369 |
+
return $check;
|
370 |
+
}
|
371 |
+
|
372 |
+
if ( empty( $meta_key ) ) {
|
373 |
+
$_cache_meta_key = '__WPGLOBUS_META_KEY_EMPTY__';
|
374 |
+
} else {
|
375 |
+
|
376 |
+
if ( ! self::meta_key_exists( $meta_key ) ) {
|
377 |
+
return $check;
|
378 |
+
}
|
379 |
+
$_cache_meta_key = $meta_key;
|
380 |
+
}
|
381 |
+
|
382 |
+
$return_value = 'as_array';
|
383 |
+
if ( $single ) {
|
384 |
+
$return_value = 'as_single';
|
385 |
+
}
|
386 |
+
|
387 |
+
/**
|
388 |
+
* Disable/enable to filter meta field.
|
389 |
+
*
|
390 |
+
* @since 1.9.25
|
391 |
+
*
|
392 |
+
* @param string $meta_key Meta key.
|
393 |
+
*
|
394 |
+
* @return string|boolean String if to filter meta field or false if not.
|
395 |
+
*/
|
396 |
+
if ( ! empty( $meta_key ) && is_string( $meta_key ) ) {
|
397 |
+
// phpcs:ignore WordPress.NamingConventions
|
398 |
+
$meta_key = apply_filters( 'wpglobus/meta/key', $meta_key );
|
399 |
+
if ( false === $meta_key ) {
|
400 |
+
return $check;
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
/**
|
405 |
+
* May be called many times on one page. Let's cache.
|
406 |
+
*/
|
407 |
+
static $_cache;
|
408 |
+
//if ( isset( $_cache[ $_cache_meta_key ][ $object_id ][ $return_value ] ) ) {
|
409 |
+
// @since 2.4
|
410 |
+
//return $_cache[ $_cache_meta_key ][ $object_id ][ $return_value ];
|
411 |
+
//}
|
412 |
+
|
413 |
+
$meta_type = 'post';
|
414 |
+
|
415 |
+
$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );
|
416 |
+
|
417 |
+
if ( ! $meta_cache ) {
|
418 |
+
$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
|
419 |
+
$meta_cache = $meta_cache[ $object_id ];
|
420 |
+
}
|
421 |
+
|
422 |
+
if ( ! $meta_key ) {
|
423 |
+
|
424 |
+
/**
|
425 |
+
* @todo add doc.
|
426 |
+
*/
|
427 |
+
if ( ! empty( $meta_cache ) ) {
|
428 |
+
|
429 |
+
foreach ( $meta_cache as $_meta_key => $_values ) {
|
430 |
+
if ( self::meta_key_exists( $_meta_key ) ) {
|
431 |
+
foreach ( $_values as $__key => $__value ) {
|
432 |
+
$meta_cache[ $_meta_key ][ $__key ] = WPGlobus_Core::text_filter( $__value, self::$builder->get_language(), WPGlobus::RETURN_EMPTY );
|
433 |
+
}
|
434 |
+
}
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
$_cache[ $_cache_meta_key ][ $object_id ][ $return_value ] = $meta_cache;
|
439 |
+
|
440 |
+
return $meta_cache;
|
441 |
+
|
442 |
+
} else {
|
443 |
+
|
444 |
+
if ( isset( $meta_cache[ $meta_key ] ) ) {
|
445 |
+
|
446 |
+
if ( $single ) {
|
447 |
+
|
448 |
+
$_value = WPGlobus_Core::text_filter( $meta_cache[ $meta_key ][0], self::$builder->get_language(), WPGlobus::RETURN_EMPTY );
|
449 |
+
|
450 |
+
if ( ! empty( $_value ) ) {
|
451 |
+
$_value = maybe_unserialize( $_value );
|
452 |
+
}
|
453 |
+
|
454 |
+
if ( is_array( $_value ) ) {
|
455 |
+
// !!!!!!
|
456 |
+
$_value = array( $_value );
|
457 |
+
} else {
|
458 |
+
$_cache[ $_cache_meta_key ][ $object_id ][ $return_value ] = $_value;
|
459 |
+
}
|
460 |
+
|
461 |
+
return $_value;
|
462 |
+
|
463 |
+
} else {
|
464 |
+
|
465 |
+
foreach ( $meta_cache[ $meta_key ] as $_key => $_value ) {
|
466 |
+
|
467 |
+
if ( WPGlobus_Core::has_translations( $_value ) ) {
|
468 |
+
$_value = WPGlobus_Core::text_filter( $_value, self::$builder->get_language(), WPGlobus::RETURN_EMPTY );
|
469 |
+
} elseif ( self::$builder->get_language() !== WPGlobus::Config()->default_language ) {
|
470 |
+
$_value = '';
|
471 |
+
}
|
472 |
+
|
473 |
+
if ( ! empty( $_value ) ) {
|
474 |
+
$meta_cache[ $meta_key ][ $_key ] = maybe_unserialize( $_value );
|
475 |
+
} else {
|
476 |
+
$meta_cache[ $meta_key ][ $_key ] = '';
|
477 |
+
}
|
478 |
+
}
|
479 |
+
|
480 |
+
$_cache[ $_cache_meta_key ][ $object_id ][ $return_value ] = $meta_cache[ $meta_key ];
|
481 |
+
|
482 |
+
return $meta_cache[ $meta_key ];
|
483 |
+
|
484 |
+
}
|
485 |
+
}
|
486 |
+
|
487 |
+
if ( $single ) {
|
488 |
+
return '';
|
489 |
+
} else {
|
490 |
+
return array();
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
// We should not be here. Keeping as a precaution for potential code changes.
|
495 |
+
|
496 |
+
/** @noinspection PhpUnreachableStatementInspection */
|
497 |
+
return $check;
|
498 |
+
|
499 |
+
}
|
500 |
+
|
501 |
+
/**
|
502 |
+
* Check for meta key existence.
|
503 |
+
*
|
504 |
+
* @param string $meta_key
|
505 |
+
*
|
506 |
+
* @return bool
|
507 |
+
*/
|
508 |
+
protected static function meta_key_exists( $meta_key ) {
|
509 |
+
if ( in_array( $meta_key, self::$meta_fields, true ) ) {
|
510 |
+
return true;
|
511 |
+
}
|
512 |
+
|
513 |
+
return false;
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Build multilingual string.
|
518 |
+
*
|
519 |
+
* @since 1.9.25
|
520 |
+
* @todo First idea is: This function needs for Page Builder by SiteOrigin because it should serialize array before creating multilingual string.
|
521 |
+
*
|
522 |
+
* @param string[] $ml_array
|
523 |
+
*
|
524 |
+
* @return string
|
525 |
+
*/
|
526 |
+
protected static function build_multilingual_string( $ml_array ) {
|
527 |
+
|
528 |
+
/**
|
529 |
+
* @todo W.I.P with Page Builder by SiteOrigin.
|
530 |
+
*/
|
531 |
+
/**
|
532 |
+
* foreach( $ml_array as $language=>$value ) {
|
533 |
+
* if ( is_array($value) ) {
|
534 |
+
* $ml_array[$language] = maybe_serialize($value);
|
535 |
+
* }
|
536 |
+
* }
|
537 |
+
* // */
|
538 |
+
|
539 |
+
$_str = WPGlobus_Utils::build_multilingual_string( $ml_array );
|
540 |
+
|
541 |
+
return $_str;
|
542 |
+
}
|
543 |
+
}
|
544 |
+
|
545 |
+
endif;
|
trunk/includes/admin/recommendations/class-wpglobus-admin-recommendations.php
ADDED
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-admin-recommendations.php
|
4 |
+
*
|
5 |
+
* WPGlobus Recommendations.
|
6 |
+
*
|
7 |
+
* @since 1.8.7
|
8 |
+
* @package WPGlobus\Admin
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class Admin Recommendations.
|
13 |
+
*/
|
14 |
+
class WPGlobus_Admin_Recommendations {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* True if need to run JS.
|
18 |
+
*
|
19 |
+
* @var bool
|
20 |
+
*/
|
21 |
+
protected static $run_js = false;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Setup actions and filters.
|
25 |
+
*/
|
26 |
+
public static function setup_hooks() {
|
27 |
+
/**
|
28 |
+
* Recommendations on WC Settings page.
|
29 |
+
*
|
30 |
+
* @since 2.5.21 Disabled. Needs refactoring.
|
31 |
+
* <code>
|
32 |
+
* add_filter( 'woocommerce_general_settings', array( __CLASS__, 'for_woocommerce' ) );
|
33 |
+
* </code>
|
34 |
+
*/
|
35 |
+
|
36 |
+
add_filter( 'wpglobus_edit_slug_box', array( __CLASS__, 'wpg_plus_slug' ) );
|
37 |
+
add_action( 'admin_footer', array( __CLASS__, 'on__admin_footer' ), 1000 );
|
38 |
+
add_action( 'wpglobus_gutenberg_metabox', array( __CLASS__, 'on__gutenberg_metabox' ) );
|
39 |
+
add_filter(
|
40 |
+
'plugin_action_links_' . dirname( dirname( dirname( dirname( plugin_basename( __FILE__ ) ) ) ) ) . '/wpglobus.php',
|
41 |
+
array(
|
42 |
+
__CLASS__,
|
43 |
+
'filter__plugin_action_links',
|
44 |
+
)
|
45 |
+
);
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @since 2.5.20
|
49 |
+
*/
|
50 |
+
add_action( 'admin_notices', array( __CLASS__, 'on__admin_notices' ) );
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Add a link to the Recommendations tab.
|
56 |
+
*
|
57 |
+
* @since 2.2.20
|
58 |
+
*
|
59 |
+
* @param array $links array of links for the plugins, adapted when the current plugin is found.
|
60 |
+
*
|
61 |
+
* @return array
|
62 |
+
*/
|
63 |
+
public static function filter__plugin_action_links( $links ) {
|
64 |
+
|
65 |
+
$_url = add_query_arg( array( 'page' => WPGlobus::OPTIONS_PAGE_SLUG, 'tab' => 'recommendations' ), admin_url( 'admin.php' ) );
|
66 |
+
|
67 |
+
$recommend_link = '<a style="font-weight: bold;" href="' . $_url . '">' . esc_html__( 'Go Premium' ) . '</a>';
|
68 |
+
array_unshift( $links, $recommend_link );
|
69 |
+
|
70 |
+
return $links;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Recommendations for WooCommerce.
|
75 |
+
*
|
76 |
+
* @param array $settings Passed by WooCommerce.
|
77 |
+
*
|
78 |
+
* @return array
|
79 |
+
*
|
80 |
+
* @internal
|
81 |
+
*/
|
82 |
+
public static function for_woocommerce( $settings ) {
|
83 |
+
// Ugly set of "IFs" to display heading only if needed, and only once.
|
84 |
+
$need_to_show_wc_heading = false;
|
85 |
+
$need_to_recommend_wpg_wc = false;
|
86 |
+
$need_to_recommend_wpg_mc = false;
|
87 |
+
|
88 |
+
if ( ! is_plugin_active( 'woocommerce-wpglobus/woocommerce-wpglobus.php' ) ) {
|
89 |
+
$need_to_show_wc_heading = true;
|
90 |
+
$need_to_recommend_wpg_wc = true;
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( ! is_plugin_active( 'woocommerce-multicurrency/woocommerce-multicurrency.php' ) ) {
|
94 |
+
$need_to_show_wc_heading = true;
|
95 |
+
$need_to_recommend_wpg_mc = true;
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( $need_to_show_wc_heading ) {
|
99 |
+
$id = 'wpglobus-recommend-wc-heading';
|
100 |
+
$title = '';
|
101 |
+
$desc =
|
102 |
+
'<h2><span class="wp-ui-notification" style="padding:10px 20px;">' .
|
103 |
+
'<span class="dashicons dashicons-admin-site"></span> ' .
|
104 |
+
esc_html__( 'WPGlobus Recommends:', 'wpglobus' ) .
|
105 |
+
'</span></h2>';
|
106 |
+
|
107 |
+
self::add_wc_section( $settings, $id, $title, $desc );
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( $need_to_recommend_wpg_wc ) {
|
111 |
+
$url = WPGlobus_Utils::url_wpglobus_site() . 'product/woocommerce-wpglobus/';
|
112 |
+
$id = 'wpglobus-recommend-wpg-wc';
|
113 |
+
$title = '• ' . esc_html__( 'WPGlobus for WooCommerce', 'wpglobus' );
|
114 |
+
$desc =
|
115 |
+
'<p class="wp-ui-text-notification">' .
|
116 |
+
'<strong>' .
|
117 |
+
esc_html__( 'Translate product titles and descriptions, product categories, tags and attributes.', 'wpglobus' ) .
|
118 |
+
'</strong>' .
|
119 |
+
'</p>' .
|
120 |
+
'<p>' .
|
121 |
+
'<strong>' .
|
122 |
+
esc_html__( 'Get it now:', 'wpglobus' ) . ' ' .
|
123 |
+
'</strong>' .
|
124 |
+
'<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>' .
|
125 |
+
'</p>';
|
126 |
+
self::add_wc_section( $settings, $id, $title, $desc );
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( $need_to_recommend_wpg_mc ) {
|
130 |
+
$url = WPGlobus_Utils::url_wpglobus_site() . 'product/wpglobus-multi-currency/';
|
131 |
+
$id = 'wpglobus-recommend-wpg-mc';
|
132 |
+
$title = '• ' . __( 'WooCommerce Multi-Currency', 'wpglobus' );
|
133 |
+
$desc =
|
134 |
+
'<p class="wp-ui-text-notification">' .
|
135 |
+
'<strong>' .
|
136 |
+
esc_html__( 'Accept multiple currencies in your online store!', 'wpglobus' ) .
|
137 |
+
'</strong>' .
|
138 |
+
'</p>' .
|
139 |
+
'<p>' .
|
140 |
+
'<strong>' .
|
141 |
+
esc_html__( 'Check it out:', 'wpglobus' ) .
|
142 |
+
'</strong>' .
|
143 |
+
' ' .
|
144 |
+
'<a href="' . $url . '">' . $url . '</a>' .
|
145 |
+
'</p>';
|
146 |
+
self::add_wc_section( $settings, $id, $title, $desc );
|
147 |
+
}
|
148 |
+
|
149 |
+
return $settings;
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Generic WC option section consisting of one block of text only.
|
155 |
+
*
|
156 |
+
* @param array $settings Array of WC settings, passed by reference.
|
157 |
+
* @param string $id Section ID, must be unique.
|
158 |
+
* @param string $title Section title, no HTML.
|
159 |
+
* @param string $desc The text to display, HTML is allowed.
|
160 |
+
*
|
161 |
+
* @return void
|
162 |
+
*/
|
163 |
+
protected static function add_wc_section( &$settings, $id, $title, $desc ) {
|
164 |
+
$settings[] =
|
165 |
+
array(
|
166 |
+
'type' => 'title',
|
167 |
+
'id' => $id,
|
168 |
+
'title' => $title,
|
169 |
+
'desc' => $desc,
|
170 |
+
);
|
171 |
+
|
172 |
+
$settings[] =
|
173 |
+
array(
|
174 |
+
'type' => 'sectionend',
|
175 |
+
'id' => $id,
|
176 |
+
);
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Recommend WPGlobus Plus to edit permalinks.
|
181 |
+
*
|
182 |
+
* @since 1.9.6
|
183 |
+
*/
|
184 |
+
public static function wpg_plus_slug() {
|
185 |
+
|
186 |
+
global $pagenow;
|
187 |
+
|
188 |
+
if ( 'post-new.php' === $pagenow ) {
|
189 |
+
return;
|
190 |
+
}
|
191 |
+
|
192 |
+
$container_start = '<p id="wpglobus-plus-slug-recommendation" style="padding:5px; font-weight: bold"><span class="dashicons dashicons-admin-site"></span> ';
|
193 |
+
$container_end = '</p>';
|
194 |
+
|
195 |
+
if ( ! is_plugin_active( 'wpglobus-plus/wpglobus-plus.php' ) ) {
|
196 |
+
$url = WPGlobus_Utils::url_wpglobus_site() . 'product/wpglobus-plus/#slug';
|
197 |
+
echo $container_start; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
198 |
+
esc_html_e( 'Translate permalinks with our premium add-on, WPGlobus Plus!', 'wpglobus' );
|
199 |
+
echo ' ';
|
200 |
+
esc_html_e( 'Check it out:', 'wpglobus' );
|
201 |
+
echo ' ';
|
202 |
+
echo '<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $url ) . '</a>';
|
203 |
+
echo $container_end; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
204 |
+
|
205 |
+
self::$run_js = true;
|
206 |
+
|
207 |
+
} elseif ( ! class_exists( 'WPGlobusPlus_Slug', false ) ) {
|
208 |
+
$url = admin_url( 'admin.php' ) . '?page=' . WPGlobusPlus::WPGLOBUS_PLUS_OPTIONS_PAGE . '&tab=modules';
|
209 |
+
echo $container_start; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
210 |
+
esc_html_e( 'To translate permalinks, please activate the module Slug.', 'wpglobus' );
|
211 |
+
echo ' ';
|
212 |
+
// Do not translate.
|
213 |
+
$msg = __( 'Go to WPGlobus Plus Options page', 'wpglobus-plus' );
|
214 |
+
|
215 |
+
echo '<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $msg ) . '.</a>';
|
216 |
+
echo $container_end; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
217 |
+
|
218 |
+
self::$run_js = true;
|
219 |
+
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Action wpglobus_gutenberg_metabox.
|
225 |
+
*
|
226 |
+
* @since 1.9.17
|
227 |
+
*/
|
228 |
+
public static function on__gutenberg_metabox() {
|
229 |
+
|
230 |
+
if ( WPGlobus::Config()->builder->is_running() ) {
|
231 |
+
self::wpg_plus_slug();
|
232 |
+
self::$run_js = false;
|
233 |
+
}
|
234 |
+
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Action admin_footer.
|
239 |
+
*
|
240 |
+
* @since 1.9.17
|
241 |
+
*/
|
242 |
+
public static function on__admin_footer() {
|
243 |
+
|
244 |
+
if ( ! self::$run_js ) {
|
245 |
+
return;
|
246 |
+
}
|
247 |
+
|
248 |
+
if ( ! WPGlobus::Config()->builder->is_running() ) {
|
249 |
+
return;
|
250 |
+
}
|
251 |
+
|
252 |
+
if ( WPGlobus::Config()->builder->get_language() === WPGlobus::Config()->default_language ) {
|
253 |
+
return;
|
254 |
+
}
|
255 |
+
|
256 |
+
?>
|
257 |
+
<script>
|
258 |
+
var $edit_slug_box = jQuery('#edit-slug-box');
|
259 |
+
$edit_slug_box.css({'display': 'none'});
|
260 |
+
var wpglobus_slug_recomm_box = jQuery('#wpglobus-plus-slug-recommendation').remove();
|
261 |
+
$edit_slug_box.before(wpglobus_slug_recomm_box);
|
262 |
+
</script>
|
263 |
+
<?php
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Display an admin notice in WordPress admin area.
|
268 |
+
*
|
269 |
+
* @since 2.5.20
|
270 |
+
*/
|
271 |
+
public static function on__admin_notices() {
|
272 |
+
|
273 |
+
global $wp_version;
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Check for PHP version.
|
277 |
+
*/
|
278 |
+
if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
|
279 |
+
|
280 |
+
echo '<div class="notice notice-error"><p>';
|
281 |
+
printf( // Translators: %1$s - this plugin name. %2$s - the required PHP version.
|
282 |
+
esc_html__( 'For %1$s to work correctly, PHP version %2$s or later is required.', 'wpglobus' ) . ' ' .
|
283 |
+
// Translators: %3$s - the current PHP version.
|
284 |
+
esc_html__( 'The PHP version on your server is %3$s.', 'wpglobus' ),
|
285 |
+
'<strong>WPGlobus</strong>',
|
286 |
+
'<strong>5.6</strong>',
|
287 |
+
'<strong>' . PHP_VERSION . '</strong>'
|
288 |
+
);
|
289 |
+
echo '</p></div>';
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Check for WordPress version.
|
294 |
+
*/
|
295 |
+
if ( version_compare( $wp_version, '5.4.99', '<' ) ) {
|
296 |
+
|
297 |
+
echo '<div class="notice notice-error"><p>';
|
298 |
+
printf( // Translators: %1$s - this plugin name. %2$s - the required WordPress version.
|
299 |
+
esc_html__( 'For %1$s to work correctly, WordPress version %2$s or later is required.', 'wpglobus' ) . ' ',
|
300 |
+
'<strong>WPGlobus ' . esc_html( WPGLOBUS_VERSION ) . '</strong>',
|
301 |
+
'<strong>5.5</strong>'
|
302 |
+
);
|
303 |
+
echo '</p></div>';
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
} // class WPGlobus_Admin_Recommendations.
|
308 |
+
|
309 |
+
# --- EOF
|
trunk/includes/admin/register-post-types/class-wpglobus-register-post-types.php
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-register-post-types.php
|
4 |
+
*
|
5 |
+
* @since 2.2.24
|
6 |
+
* @package WPGlobus\Admin
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Register_Post_Types.
|
11 |
+
*/
|
12 |
+
if ( ! class_exists( 'WPGlobus_Register_Post_Types' ) ) :
|
13 |
+
|
14 |
+
class WPGlobus_Register_Post_Types {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
protected static $pages = array( 'edit.php', 'post.php' );
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Don't handling with these post types.
|
23 |
+
* @var array
|
24 |
+
*/
|
25 |
+
protected static $excluded_post_types = array(
|
26 |
+
'attachment',
|
27 |
+
'attachment:audio',
|
28 |
+
'attachment:video',
|
29 |
+
'revision',
|
30 |
+
'nav_menu_item',
|
31 |
+
'custom_css',
|
32 |
+
'customize_changeset',
|
33 |
+
'oembed_cache',
|
34 |
+
'user_request',
|
35 |
+
'wp_block',
|
36 |
+
);
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var array
|
40 |
+
*/
|
41 |
+
protected static $post_types = array();
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Constructor.
|
45 |
+
*/
|
46 |
+
public static function construct() {
|
47 |
+
|
48 |
+
if ( ! WPGlobus_WP::is_pagenow(self::$pages) ) {
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @see wp-includes\post.php
|
54 |
+
*/
|
55 |
+
add_action( 'registered_post_type', array( __CLASS__, 'on__registered' ), 10, 2 );
|
56 |
+
|
57 |
+
add_action( 'wp_loaded', array( __CLASS__, 'on__wp_loaded' ) );
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Fires after a post type is registered.
|
63 |
+
*
|
64 |
+
* @param string $post_type Post type.
|
65 |
+
* @param WP_Post_Type $post_type_object Arguments used to register the post type.
|
66 |
+
*/
|
67 |
+
public static function on__registered( $post_type, $post_type_object ) {
|
68 |
+
|
69 |
+
global $_wp_post_type_features;
|
70 |
+
|
71 |
+
if ( defined('DOING_AJAX') && DOING_AJAX ) {
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
static $_init = null;
|
76 |
+
|
77 |
+
if ( is_null($_init) ) {
|
78 |
+
|
79 |
+
self::$excluded_post_types = array_merge(self::$excluded_post_types, WPGlobus::Config()->disabled_entities);
|
80 |
+
|
81 |
+
self::$excluded_post_types = array_unique( self::$excluded_post_types );
|
82 |
+
|
83 |
+
$_init = true;
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( self::is_excluded_post_type($post_type) ) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( empty($_wp_post_type_features[$post_type]) ) {
|
92 |
+
return;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @see `use_block_editor_for_post_type()` in wp-admin\includes\post.php
|
97 |
+
*/
|
98 |
+
self::$post_types[$post_type] = array(
|
99 |
+
'show_in_rest' => $post_type_object->show_in_rest,
|
100 |
+
'features' => $_wp_post_type_features[$post_type]
|
101 |
+
);
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Fired to save option.
|
107 |
+
*/
|
108 |
+
public static function on__wp_loaded() {
|
109 |
+
|
110 |
+
if ( defined('DOING_AJAX') && DOING_AJAX ) {
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
if ( ! empty(self::$post_types) ) {
|
114 |
+
update_option( WPGlobus::Config()->option_register_post_types, self::$post_types, false );
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Check for excluded post type.
|
120 |
+
*
|
121 |
+
* @return bool
|
122 |
+
*/
|
123 |
+
public static function is_excluded_post_type( $post_type = '') {
|
124 |
+
|
125 |
+
if ( empty($post_type) ) {
|
126 |
+
return true;
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( in_array( $post_type, self::get_excluded_post_types() ) ) {
|
130 |
+
return true;
|
131 |
+
}
|
132 |
+
|
133 |
+
return false;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Get excluded post types.
|
138 |
+
*
|
139 |
+
* @return array
|
140 |
+
*/
|
141 |
+
public static function get_excluded_post_types() {
|
142 |
+
return self::$excluded_post_types;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
endif;
|
147 |
+
/* EOF */
|
trunk/includes/admin/wpglobus-admin.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @since 1.8.1
|
4 |
+
* @package WPGlobus
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Admin page central.
|
9 |
+
*
|
10 |
+
* @since 1.6.6
|
11 |
+
*/
|
12 |
+
require_once dirname( __FILE__ ) . '/central/class-wpglobus-admin-central.php';
|
13 |
+
WPGlobus_Admin_Central::construct();
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @since 2.2.24
|
17 |
+
*/
|
18 |
+
require_once dirname( __FILE__ ) . '/register-post-types/class-wpglobus-register-post-types.php';
|
19 |
+
WPGlobus_Register_Post_Types::construct();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @since 2.4
|
23 |
+
*/
|
24 |
+
require_once dirname( __FILE__ ) . '/class-wpglobus-admin-post.php';
|
25 |
+
WPGlobus_Admin_Post::construct();
|
26 |
+
|
27 |
+
if ( isset( $_GET['wpglobus-debug'] ) ) { // WPCS: input var ok, sanitization ok.
|
28 |
+
/**
|
29 |
+
* To load debug info
|
30 |
+
* site/wp-admin/post.php?post={{post_ID}}&action=edit&wpglobus-debug=godmode
|
31 |
+
* or
|
32 |
+
* site/wp-admin/post.php?post={{post_ID}}&action=edit&wpglobus-debug=meta
|
33 |
+
*/
|
34 |
+
require_once dirname( __FILE__ ) . '/debug/class-wpglobus-admin-debug.php';
|
35 |
+
WPGlobus_Admin_Debug::get_instance();
|
36 |
+
}
|
37 |
+
|
38 |
+
# --- EOF
|
trunk/includes/builders/assets/wpglobus-admin-builder-49.js
ADDED
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WPGlobus Administration Core.
|
3 |
+
* Interface JS functions
|
4 |
+
*
|
5 |
+
* @since 1.9.17
|
6 |
+
*
|
7 |
+
* @package WPGlobus
|
8 |
+
* @subpackage Administration
|
9 |
+
*/
|
10 |
+
/*jslint browser: true*/
|
11 |
+
/*global jQuery, console, WPGlobusCore*/
|
12 |
+
|
13 |
+
var WPGlobusCore;
|
14 |
+
|
15 |
+
(function($) {
|
16 |
+
var api;
|
17 |
+
api = WPGlobusCore = {
|
18 |
+
strpos: function( haystack, needle, offset){
|
19 |
+
haystack = "" + haystack;
|
20 |
+
var i = haystack.indexOf( needle, offset );
|
21 |
+
return i >= 0 ? i : false;
|
22 |
+
},
|
23 |
+
|
24 |
+
TextFilter: function(text, language, return_in){
|
25 |
+
if ( typeof text == 'undefined' || '' === text ) { return text; }
|
26 |
+
|
27 |
+
var pos_start, pos_end, possible_delimiters = [], is_local_text_found = false;;
|
28 |
+
|
29 |
+
language = '' == language ? 'en' : language;
|
30 |
+
return_in = typeof return_in == 'undefined' || '' == return_in ? 'RETURN_IN_DEFAULT_LANGUAGE' : return_in;
|
31 |
+
|
32 |
+
possible_delimiters[0] = [];
|
33 |
+
possible_delimiters[0]['start'] = WPGlobusCoreData.locale_tag_start.replace('%s', language);
|
34 |
+
possible_delimiters[0]['end'] = WPGlobusCoreData.locale_tag_end;
|
35 |
+
|
36 |
+
possible_delimiters[1] = [];
|
37 |
+
possible_delimiters[1]['start'] = '<!--:'+language+'-->';
|
38 |
+
possible_delimiters[1]['end'] = '<!--:-->';
|
39 |
+
|
40 |
+
possible_delimiters[2] = [];
|
41 |
+
possible_delimiters[2]['start'] = '[:'+language+']';
|
42 |
+
possible_delimiters[2]['end'] = '[:';
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
for (var i = 0; i < 3; i++) {
|
47 |
+
|
48 |
+
pos_start = api.strpos( text, possible_delimiters[i]['start'] );
|
49 |
+
if ( pos_start === false ) {
|
50 |
+
continue;
|
51 |
+
}
|
52 |
+
|
53 |
+
pos_start = pos_start + possible_delimiters[i]['start'].length;
|
54 |
+
|
55 |
+
pos_end = api.strpos( text, possible_delimiters[i]['end'], pos_start );
|
56 |
+
|
57 |
+
if ( pos_end === false ) {
|
58 |
+
text = text.substr( pos_start );
|
59 |
+
} else {
|
60 |
+
text = text.substr( pos_start, pos_end - pos_start );
|
61 |
+
}
|
62 |
+
|
63 |
+
is_local_text_found = true;
|
64 |
+
break;
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( ! is_local_text_found ) {
|
69 |
+
if ( return_in == 'RETURN_EMPTY' ) {
|
70 |
+
if ( language == WPGlobusCoreData.default_language && ! /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
71 |
+
/** do nothing */
|
72 |
+
} else {
|
73 |
+
text = '';
|
74 |
+
}
|
75 |
+
} else {
|
76 |
+
/**
|
77 |
+
* Try RETURN_IN_DEFAULT_LANGUAGE.
|
78 |
+
*/
|
79 |
+
if ( language == WPGlobusCoreData.default_language ) {
|
80 |
+
if ( /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
81 |
+
text = '';
|
82 |
+
}
|
83 |
+
} else {
|
84 |
+
text = api.TextFilter( text, WPGlobusCoreData.default_language );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
return text;
|
89 |
+
},
|
90 |
+
addLocaleMarks: function(text, language) {
|
91 |
+
return WPGlobusCoreData.locale_tag_start.replace('%s', language) + text + WPGlobusCoreData.locale_tag_end;
|
92 |
+
},
|
93 |
+
getTranslations: function(text) {
|
94 |
+
var t = {},
|
95 |
+
return_in;
|
96 |
+
$.each(WPGlobusCoreData.enabled_languages, function(i,l){
|
97 |
+
return_in = l == WPGlobusCoreData.default_language ? 'RETURN_IN_DEFAULT_LANGUAGE' : 'RETURN_EMPTY';
|
98 |
+
t[l] = api.TextFilter(text, l, return_in);
|
99 |
+
});
|
100 |
+
return t;
|
101 |
+
},
|
102 |
+
getString: function(s, newVal, l) {
|
103 |
+
if ( 'undefined' === typeof(s) ) {
|
104 |
+
return s;
|
105 |
+
}
|
106 |
+
if ( 'undefined' === typeof(newVal) ) {
|
107 |
+
newVal = '';
|
108 |
+
}
|
109 |
+
if ( 'undefined' === typeof(l) ) {
|
110 |
+
l = WPGlobusCoreData.language;
|
111 |
+
}
|
112 |
+
|
113 |
+
s = api.getTranslations(s);
|
114 |
+
s[l] = newVal;
|
115 |
+
|
116 |
+
var cS = '';
|
117 |
+
|
118 |
+
$.each(s, function(ln,val){
|
119 |
+
if ( '' != val && ln != WPGlobusCoreData.default_language) {
|
120 |
+
cS += api.addLocaleMarks(val, ln);
|
121 |
+
}
|
122 |
+
});
|
123 |
+
|
124 |
+
if ( '' != s[WPGlobusCoreData.default_language] ) {
|
125 |
+
if ( '' == cS ) {
|
126 |
+
cS = s[WPGlobusCoreData.default_language];
|
127 |
+
} else {
|
128 |
+
cS = api.addLocaleMarks(s[WPGlobusCoreData.default_language], WPGlobusCoreData.default_language) + cS;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
return cS;
|
132 |
+
}
|
133 |
+
};
|
134 |
+
})(jQuery);
|
135 |
+
|
136 |
+
jQuery(document).ready(function ($) {
|
137 |
+
"use strict";
|
138 |
+
|
139 |
+
if ( 'undefined' === typeof WPGlobusAdmin ) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
var api = {
|
144 |
+
languageSelectorBoxDelta: 0,
|
145 |
+
locationPathname: '/wp-admin/post.php',
|
146 |
+
init: function() {
|
147 |
+
//api.setCookie();
|
148 |
+
if ('taxonomy-edit' === WPGlobusAdmin.page) {
|
149 |
+
api.taxonomyEdit();
|
150 |
+
} else {
|
151 |
+
api.start();
|
152 |
+
}
|
153 |
+
},
|
154 |
+
_info: function() {
|
155 |
+
var lang = undefined;
|
156 |
+
if( $('#language').length > 0 ) {
|
157 |
+
lang = $('#language').val();
|
158 |
+
}
|
159 |
+
console.log('Current language from hidden (#language) : ', lang);
|
160 |
+
|
161 |
+
lang = undefined;
|
162 |
+
if( $('#wpglobus-language').length > 0 ) {
|
163 |
+
lang = $('#wpglobus-language').val();
|
164 |
+
}
|
165 |
+
console.log('Current language from hidden (#wpglobus-language) : ', lang);
|
166 |
+
|
167 |
+
lang = undefined;
|
168 |
+
if( $('input[name="wpglobus-language"]').length > 0 ) {
|
169 |
+
lang = $('input[name="wpglobus-language"]').val();
|
170 |
+
}
|
171 |
+
console.log('Current language from hidden (input[name="wpglobus-language"]) : ', lang);
|
172 |
+
|
173 |
+
lang = undefined;
|
174 |
+
if( $('input[name="wpglobus_language"]').length > 0 ) {
|
175 |
+
lang = $('input[name="wpglobus_language"]').val();
|
176 |
+
}
|
177 |
+
console.log('Current language from hidden (input[name="wpglobus_language"]) : ', lang);
|
178 |
+
console.log('Builder : ', WPGlobusAdmin.builder);
|
179 |
+
|
180 |
+
var content = $('#content').val();
|
181 |
+
if ( content == '' ) {
|
182 |
+
console.log('Editor content (#content) : (empty)');
|
183 |
+
} else {
|
184 |
+
console.log(content);
|
185 |
+
}
|
186 |
+
},
|
187 |
+
checkCookie: function() {
|
188 |
+
if ( -1 != window.location.search.indexOf('language=') ) {
|
189 |
+
return false;
|
190 |
+
}
|
191 |
+
if ( 'post.php' == WPGlobusAdmin.page ) {
|
192 |
+
var cookie = wpCookies.get(WPGlobusAdmin.builder.languageCookie);
|
193 |
+
|
194 |
+
if ( null !== cookie && history.pushState) {
|
195 |
+
cookie = cookie.split('+');
|
196 |
+
var language = cookie[0];
|
197 |
+
if ('undefined' !== typeof cookie[1] && cookie[1] + 0 == WPGlobusAdmin.$_get.post ) {
|
198 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+language;
|
199 |
+
window.history.pushState({path:newurl},'',newurl);
|
200 |
+
return language;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
}
|
204 |
+
return false;
|
205 |
+
},
|
206 |
+
setCookie: function() {
|
207 |
+
var lang = api.checkCookie();
|
208 |
+
if ( ! lang ) {
|
209 |
+
lang = WPGlobusAdmin.$_get.language;
|
210 |
+
if ( 'undefined' === typeof lang ) {
|
211 |
+
lang = WPGlobusAdmin.data.default_language;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
wpCookies.set(WPGlobusAdmin.builder.languageCookie, lang+'+'+WPGlobusAdmin.$_get.post, 31536000, api.locationPathname );
|
215 |
+
},
|
216 |
+
setLocationSearch: function() {
|
217 |
+
if ( ! history.pushState || -1 != window.location.search.indexOf('language=') ) {
|
218 |
+
return;
|
219 |
+
}
|
220 |
+
if ( WPGlobusAdmin.data.default_language != WPGlobusAdmin.currentTab ) {
|
221 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+WPGlobusAdmin.currentTab;
|
222 |
+
window.history.pushState({path:newurl},'',newurl);
|
223 |
+
}
|
224 |
+
},
|
225 |
+
taxonomyEdit: function() {
|
226 |
+
|
227 |
+
$('.wpglobus-taxonomy-tabs').insertAfter('#ajax-response');
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Make class wrap as tabs container.
|
231 |
+
* Tabs on.
|
232 |
+
*/
|
233 |
+
$('.wrap').tabs();
|
234 |
+
|
235 |
+
$(WPGlobusAdmin.data.multilingualSlug.title).insertAfter('.term-slug-wrap th label');
|
236 |
+
|
237 |
+
if ( WPGlobusAdmin.currentTab !== WPGlobusAdmin.data.default_language ) {
|
238 |
+
$('.wpglobus-tax-edit-tab').removeClass('ui-tabs-active ui-state-active');
|
239 |
+
$('#wpglobus-link-tab-'+WPGlobusAdmin.currentTab).addClass('ui-tabs-active ui-state-active');
|
240 |
+
}
|
241 |
+
|
242 |
+
$(document).on('click', '.wpglobus-tax-edit-tab a', function(event) {
|
243 |
+
event.preventDefault();
|
244 |
+
var _href = $(this).data('href');
|
245 |
+
location.href = _href;
|
246 |
+
});
|
247 |
+
|
248 |
+
api.setMultilingualFields();
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Init Yoast tinymce editor for description.
|
252 |
+
*/
|
253 |
+
$(document).on( 'tinymce-editor-init', function( event, editor ) {
|
254 |
+
$( '#' + editor.getContainer().id ).find('iframe').addClass(WPGlobusAdmin.builder.translatableClass).css({'width':''});
|
255 |
+
});
|
256 |
+
},
|
257 |
+
start: function() {
|
258 |
+
/**
|
259 |
+
*
|
260 |
+
*/
|
261 |
+
api.setLocationSearch();
|
262 |
+
|
263 |
+
/**
|
264 |
+
*
|
265 |
+
*/
|
266 |
+
var wrap_at = '#postdivrich',
|
267 |
+
set_title = true,
|
268 |
+
content_tabs_id = '#post-body-content';
|
269 |
+
if ( WPGlobusAdmin.data.support['editor'] === false ) {
|
270 |
+
wrap_at = '#titlediv';
|
271 |
+
set_title = false;
|
272 |
+
}
|
273 |
+
if ( WPGlobusAdmin.data.support['title'] === false ) {
|
274 |
+
set_title = false;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Make post-body-content as tabs container.
|
279 |
+
*/
|
280 |
+
$(content_tabs_id).prepend($('.wpglobus-post-body-tabs-list'));
|
281 |
+
$.each(WPGlobusAdmin.tabs, function (index, suffix) {
|
282 |
+
if ('default' === suffix) {
|
283 |
+
$(wrap_at).wrap('<div id="tab-default"></div>');
|
284 |
+
if ( set_title ) {
|
285 |
+
$($('#titlediv')).insertBefore(wrap_at);
|
286 |
+
}
|
287 |
+
} else {
|
288 |
+
$(wrap_at+'-' + suffix).wrap('<div id="tab-' + suffix + '"></div>');
|
289 |
+
if ( set_title ) {
|
290 |
+
$($('#titlediv-' + suffix)).insertBefore(wrap_at+'-' + suffix);
|
291 |
+
}
|
292 |
+
}
|
293 |
+
});
|
294 |
+
|
295 |
+
$(content_tabs_id).addClass('wpglobus-post-body-tabs');
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Set fields as multilingual.
|
299 |
+
*/
|
300 |
+
//setTimeout(api.setMultilingualFields(), 1000);
|
301 |
+
api.setMultilingualFields();
|
302 |
+
|
303 |
+
/**
|
304 |
+
*
|
305 |
+
*/
|
306 |
+
//api.ajaxPrefilter();
|
307 |
+
|
308 |
+
},
|
309 |
+
ajaxPrefilter: function() {
|
310 |
+
/**
|
311 |
+
* @todo WIP.
|
312 |
+
*/
|
313 |
+
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
|
314 |
+
// Modify options, control originalOptions, store jqXHR, etc
|
315 |
+
//console.log(options);
|
316 |
+
});
|
317 |
+
},
|
318 |
+
setMultilingualFields: function() {
|
319 |
+
$.each(WPGlobusAdmin.builder.multilingualFields, function(indx, field) {
|
320 |
+
var elementBy = 'name';
|
321 |
+
var node = document.getElementsByName(field);
|
322 |
+
var $element;
|
323 |
+
|
324 |
+
if ( 0 == node.length ) {
|
325 |
+
elementBy = 'id';
|
326 |
+
node = document.getElementById(field);
|
327 |
+
}
|
328 |
+
|
329 |
+
if ( null === node ) {
|
330 |
+
return;
|
331 |
+
} else {
|
332 |
+
if ( 'id' == elementBy ) {
|
333 |
+
$element = $('#'+field);
|
334 |
+
} else {
|
335 |
+
var nodeName = node[0].nodeName;
|
336 |
+
nodeName = nodeName.toLowerCase();
|
337 |
+
$element = $(nodeName+'[name="'+field+'"]');
|
338 |
+
}
|
339 |
+
$element.addClass(WPGlobusAdmin.builder.translatableClass);
|
340 |
+
}
|
341 |
+
|
342 |
+
});
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
WPGlobusAdmin = $.extend({}, WPGlobusAdmin, api);
|
347 |
+
WPGlobusAdmin.init();
|
348 |
+
});
|
trunk/includes/builders/assets/wpglobus-admin-builder-49.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){var o=(a=""+a).indexOf(t,e);return 0<=o&&o},TextFilter:function(a,t,e){if(void 0===a||""===a)return a;var o,n,l=[],i=!1;t=""==t?"en":t,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",t),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+t+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+t+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(a,l[u].start))){o+=l[u].start.length,a=!1===(n=s.strpos(a,l[u].end,o))?a.substr(o):a.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==e?t==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(a)||(a=""):t==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(a)&&(a=""):a=s.TextFilter(a,WPGlobusCoreData.default_language)),a},addLocaleMarks:function(a,t){return WPGlobusCoreData.locale_tag_start.replace("%s",t)+a+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(a,t){o=t==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[t]=s.TextFilter(e,t,o)}),n},getString:function(a,t,e){if(void 0===a)return a;void 0===t&&(t=""),void 0===e&&(e=WPGlobusCoreData.language),(a=s.getTranslations(a))[e]=t;var o="";return l.each(a,function(a,t){""!=t&&a!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(t,a))}),""!=a[WPGlobusCoreData.default_language]&&(o=""==o?a[WPGlobusCoreData.default_language]:s.addLocaleMarks(a[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),jQuery(document).ready(function(l){"use strict";var t;"undefined"!=typeof WPGlobusAdmin&&(t={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?t.taxonomyEdit():t.start()},_info:function(){var a=void 0;0<l("#language").length&&(a=l("#language").val()),console.log("Current language from hidden (#language) : ",a),a=void 0,0<l("#wpglobus-language").length&&(a=l("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",a),a=void 0,0<l('input[name="wpglobus-language"]').length&&(a=l('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',a),a=void 0,0<l('input[name="wpglobus_language"]').length&&(a=l('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',a),console.log("Builder : ",WPGlobusAdmin.builder);var t=l("#content").val();""==t?console.log("Editor content (#content) : (empty)"):console.log(t)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page){var a=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==a&&history.pushState){var t=(a=a.split("+"))[0];if(void 0!==a[1]&&a[1]+0==WPGlobusAdmin.$_get.post){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+t;return window.history.pushState({path:e},"",e),t}}}return!1},setCookie:function(){var a=t.checkCookie();a||void 0===(a=WPGlobusAdmin.$_get.language)&&(a=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,a+"+"+WPGlobusAdmin.$_get.post,31536e3,t.locationPathname)},setLocationSearch:function(){var a;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:a},"",a))},taxonomyEdit:function(){l(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),l(".wrap").tabs(),l(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(l(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),l("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),l(document).on("click",".wpglobus-tax-edit-tab a",function(a){a.preventDefault();var t=l(this).data("href");location.href=t}),t.setMultilingualFields(),l(document).on("tinymce-editor-init",function(a,t){l("#"+t.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){t.setLocationSearch();var e="#postdivrich",o=!0,a="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),l(a).prepend(l(".wpglobus-post-body-tabs-list")),l.each(WPGlobusAdmin.tabs,function(a,t){"default"===t?(l(e).wrap('<div id="tab-default"></div>'),o&&l(l("#titlediv")).insertBefore(e)):(l(e+"-"+t).wrap('<div id="tab-'+t+'"></div>'),o&&l(l("#titlediv-"+t)).insertBefore(e+"-"+t))}),l(a).addClass("wpglobus-post-body-tabs"),t.setMultilingualFields()},ajaxPrefilter:function(){l.ajaxPrefilter(function(a,t,e){})},setMultilingualFields:function(){l.each(WPGlobusAdmin.builder.multilingualFields,function(a,t){var e,o="name",n=document.getElementsByName(t);0==n.length&&(o="id",n=document.getElementById(t)),null!==n&&("id"==o?l("#"+t):(e=(e=n[0].nodeName).toLowerCase(),l(e+'[name="'+t+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)})}},(WPGlobusAdmin=l.extend({},WPGlobusAdmin,t)).init())});
|
trunk/includes/builders/assets/wpglobus-admin-builder-51.js
ADDED
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WPGlobus Administration Core.
|
3 |
+
* Interface JS functions
|
4 |
+
*
|
5 |
+
* @since 1.9.17
|
6 |
+
*
|
7 |
+
* @package WPGlobus
|
8 |
+
* @subpackage Administration
|
9 |
+
*/
|
10 |
+
/*jslint browser: true*/
|
11 |
+
/*global jQuery, console, WPGlobusCore*/
|
12 |
+
|
13 |
+
var WPGlobusCore;
|
14 |
+
|
15 |
+
(function($) {
|
16 |
+
var api;
|
17 |
+
api = WPGlobusCore = {
|
18 |
+
strpos: function( haystack, needle, offset){
|
19 |
+
haystack = "" + haystack;
|
20 |
+
var i = haystack.indexOf( needle, offset );
|
21 |
+
return i >= 0 ? i : false;
|
22 |
+
},
|
23 |
+
|
24 |
+
TextFilter: function(text, language, return_in){
|
25 |
+
if ( typeof text == 'undefined' || '' === text ) { return text; }
|
26 |
+
|
27 |
+
var pos_start, pos_end, possible_delimiters = [], is_local_text_found = false;;
|
28 |
+
|
29 |
+
language = '' == language ? 'en' : language;
|
30 |
+
return_in = typeof return_in == 'undefined' || '' == return_in ? 'RETURN_IN_DEFAULT_LANGUAGE' : return_in;
|
31 |
+
|
32 |
+
possible_delimiters[0] = [];
|
33 |
+
possible_delimiters[0]['start'] = WPGlobusCoreData.locale_tag_start.replace('%s', language);
|
34 |
+
possible_delimiters[0]['end'] = WPGlobusCoreData.locale_tag_end;
|
35 |
+
|
36 |
+
possible_delimiters[1] = [];
|
37 |
+
possible_delimiters[1]['start'] = '<!--:'+language+'-->';
|
38 |
+
possible_delimiters[1]['end'] = '<!--:-->';
|
39 |
+
|
40 |
+
possible_delimiters[2] = [];
|
41 |
+
possible_delimiters[2]['start'] = '[:'+language+']';
|
42 |
+
possible_delimiters[2]['end'] = '[:';
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
for (var i = 0; i < 3; i++) {
|
47 |
+
|
48 |
+
pos_start = api.strpos( text, possible_delimiters[i]['start'] );
|
49 |
+
if ( pos_start === false ) {
|
50 |
+
continue;
|
51 |
+
}
|
52 |
+
|
53 |
+
pos_start = pos_start + possible_delimiters[i]['start'].length;
|
54 |
+
|
55 |
+
pos_end = api.strpos( text, possible_delimiters[i]['end'], pos_start );
|
56 |
+
|
57 |
+
if ( pos_end === false ) {
|
58 |
+
text = text.substr( pos_start );
|
59 |
+
} else {
|
60 |
+
text = text.substr( pos_start, pos_end - pos_start );
|
61 |
+
}
|
62 |
+
|
63 |
+
is_local_text_found = true;
|
64 |
+
break;
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( ! is_local_text_found ) {
|
69 |
+
if ( return_in == 'RETURN_EMPTY' ) {
|
70 |
+
if ( language == WPGlobusCoreData.default_language && ! /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
71 |
+
/** do nothing */
|
72 |
+
} else {
|
73 |
+
text = '';
|
74 |
+
}
|
75 |
+
} else {
|
76 |
+
/**
|
77 |
+
* Try RETURN_IN_DEFAULT_LANGUAGE.
|
78 |
+
*/
|
79 |
+
if ( language == WPGlobusCoreData.default_language ) {
|
80 |
+
if ( /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
81 |
+
text = '';
|
82 |
+
}
|
83 |
+
} else {
|
84 |
+
text = api.TextFilter( text, WPGlobusCoreData.default_language );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
return text;
|
89 |
+
},
|
90 |
+
addLocaleMarks: function(text, language) {
|
91 |
+
return WPGlobusCoreData.locale_tag_start.replace('%s', language) + text + WPGlobusCoreData.locale_tag_end;
|
92 |
+
},
|
93 |
+
getTranslations: function(text) {
|
94 |
+
var t = {},
|
95 |
+
return_in;
|
96 |
+
$.each(WPGlobusCoreData.enabled_languages, function(i,l){
|
97 |
+
return_in = l == WPGlobusCoreData.default_language ? 'RETURN_IN_DEFAULT_LANGUAGE' : 'RETURN_EMPTY';
|
98 |
+
t[l] = api.TextFilter(text, l, return_in);
|
99 |
+
});
|
100 |
+
return t;
|
101 |
+
},
|
102 |
+
getString: function(s, newVal, l) {
|
103 |
+
if ( 'undefined' === typeof(s) ) {
|
104 |
+
return s;
|
105 |
+
}
|
106 |
+
if ( 'undefined' === typeof(newVal) ) {
|
107 |
+
newVal = '';
|
108 |
+
}
|
109 |
+
if ( 'undefined' === typeof(l) ) {
|
110 |
+
l = WPGlobusCoreData.language;
|
111 |
+
}
|
112 |
+
|
113 |
+
s = api.getTranslations(s);
|
114 |
+
s[l] = newVal;
|
115 |
+
|
116 |
+
var cS = '';
|
117 |
+
|
118 |
+
$.each(s, function(ln,val){
|
119 |
+
if ( '' != val && ln != WPGlobusCoreData.default_language) {
|
120 |
+
cS += api.addLocaleMarks(val, ln);
|
121 |
+
}
|
122 |
+
});
|
123 |
+
|
124 |
+
if ( '' != s[WPGlobusCoreData.default_language] ) {
|
125 |
+
if ( '' == cS ) {
|
126 |
+
cS = s[WPGlobusCoreData.default_language];
|
127 |
+
} else {
|
128 |
+
cS = api.addLocaleMarks(s[WPGlobusCoreData.default_language], WPGlobusCoreData.default_language) + cS;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
return cS;
|
132 |
+
}
|
133 |
+
};
|
134 |
+
})(jQuery);
|
135 |
+
|
136 |
+
jQuery(document).ready(function ($) {
|
137 |
+
"use strict";
|
138 |
+
|
139 |
+
if ( 'undefined' === typeof WPGlobusAdmin ) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
var api = {
|
144 |
+
languageSelectorBoxDelta: 0,
|
145 |
+
locationPathname: '/wp-admin/post.php',
|
146 |
+
init: function() {
|
147 |
+
//api.setCookie();
|
148 |
+
if ('taxonomy-edit' === WPGlobusAdmin.page) {
|
149 |
+
api.taxonomyEdit();
|
150 |
+
} else {
|
151 |
+
api.start();
|
152 |
+
}
|
153 |
+
},
|
154 |
+
_info: function() {
|
155 |
+
var lang = undefined;
|
156 |
+
if( $('#language').length > 0 ) {
|
157 |
+
lang = $('#language').val();
|
158 |
+
}
|
159 |
+
console.log('Current language from hidden (#language) : ', lang);
|
160 |
+
|
161 |
+
lang = undefined;
|
162 |
+
if( $('#wpglobus-language').length > 0 ) {
|
163 |
+
lang = $('#wpglobus-language').val();
|
164 |
+
}
|
165 |
+
console.log('Current language from hidden (#wpglobus-language) : ', lang);
|
166 |
+
|
167 |
+
lang = undefined;
|
168 |
+
if( $('input[name="wpglobus-language"]').length > 0 ) {
|
169 |
+
lang = $('input[name="wpglobus-language"]').val();
|
170 |
+
}
|
171 |
+
console.log('Current language from hidden (input[name="wpglobus-language"]) : ', lang);
|
172 |
+
|
173 |
+
lang = undefined;
|
174 |
+
if( $('input[name="wpglobus_language"]').length > 0 ) {
|
175 |
+
lang = $('input[name="wpglobus_language"]').val();
|
176 |
+
}
|
177 |
+
console.log('Current language from hidden (input[name="wpglobus_language"]) : ', lang);
|
178 |
+
console.log('Builder : ', WPGlobusAdmin.builder);
|
179 |
+
|
180 |
+
var content = $('#content').val();
|
181 |
+
if ( content == '' ) {
|
182 |
+
console.log('Editor content (#content) : (empty)');
|
183 |
+
} else {
|
184 |
+
console.log(content);
|
185 |
+
}
|
186 |
+
},
|
187 |
+
checkCookie: function() {
|
188 |
+
if ( -1 != window.location.search.indexOf('language=') ) {
|
189 |
+
return false;
|
190 |
+
}
|
191 |
+
if ( 'post.php' == WPGlobusAdmin.page ) {
|
192 |
+
var cookie = wpCookies.get(WPGlobusAdmin.builder.languageCookie);
|
193 |
+
|
194 |
+
if ( null !== cookie && history.pushState) {
|
195 |
+
cookie = cookie.split('+');
|
196 |
+
var language = cookie[0];
|
197 |
+
if ('undefined' !== typeof cookie[1] && cookie[1] + 0 == WPGlobusAdmin.$_get.post ) {
|
198 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+language;
|
199 |
+
window.history.pushState({path:newurl},'',newurl);
|
200 |
+
return language;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
}
|
204 |
+
return false;
|
205 |
+
},
|
206 |
+
setCookie: function() {
|
207 |
+
var lang = api.checkCookie();
|
208 |
+
if ( ! lang ) {
|
209 |
+
lang = WPGlobusAdmin.$_get.language;
|
210 |
+
if ( 'undefined' === typeof lang ) {
|
211 |
+
lang = WPGlobusAdmin.data.default_language;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
wpCookies.set(WPGlobusAdmin.builder.languageCookie, lang+'+'+WPGlobusAdmin.$_get.post, 31536000, api.locationPathname );
|
215 |
+
},
|
216 |
+
setLocationSearch: function() {
|
217 |
+
if ( ! history.pushState || -1 != window.location.search.indexOf('language=') ) {
|
218 |
+
return;
|
219 |
+
}
|
220 |
+
if ( WPGlobusAdmin.data.default_language != WPGlobusAdmin.currentTab ) {
|
221 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+WPGlobusAdmin.currentTab;
|
222 |
+
window.history.pushState({path:newurl},'',newurl);
|
223 |
+
}
|
224 |
+
},
|
225 |
+
taxonomyEdit: function() {
|
226 |
+
|
227 |
+
$('.wpglobus-taxonomy-tabs').insertAfter('#ajax-response');
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Make class wrap as tabs container.
|
231 |
+
* Tabs on.
|
232 |
+
*/
|
233 |
+
$('.wrap').tabs();
|
234 |
+
|
235 |
+
$(WPGlobusAdmin.data.multilingualSlug.title).insertAfter('.term-slug-wrap th label');
|
236 |
+
|
237 |
+
if ( WPGlobusAdmin.currentTab !== WPGlobusAdmin.data.default_language ) {
|
238 |
+
$('.wpglobus-tax-edit-tab').removeClass('ui-tabs-active ui-state-active');
|
239 |
+
$('#wpglobus-link-tab-'+WPGlobusAdmin.currentTab).addClass('ui-tabs-active ui-state-active');
|
240 |
+
}
|
241 |
+
|
242 |
+
$(document).on('click', '.wpglobus-tax-edit-tab a', function(event) {
|
243 |
+
event.preventDefault();
|
244 |
+
var _href = $(this).data('href');
|
245 |
+
location.href = _href;
|
246 |
+
});
|
247 |
+
|
248 |
+
api.setMultilingualFields();
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Init Yoast tinymce editor for description.
|
252 |
+
*/
|
253 |
+
$(document).on( 'tinymce-editor-init', function( event, editor ) {
|
254 |
+
$( '#' + editor.getContainer().id ).find('iframe').addClass(WPGlobusAdmin.builder.translatableClass).css({'width':''});
|
255 |
+
});
|
256 |
+
},
|
257 |
+
start: function() {
|
258 |
+
/**
|
259 |
+
*
|
260 |
+
*/
|
261 |
+
api.setLocationSearch();
|
262 |
+
|
263 |
+
/**
|
264 |
+
*
|
265 |
+
*/
|
266 |
+
var wrap_at = '#postdivrich',
|
267 |
+
set_title = true,
|
268 |
+
content_tabs_id = '#post-body-content';
|
269 |
+
if ( WPGlobusAdmin.data.support['editor'] === false ) {
|
270 |
+
wrap_at = '#titlediv';
|
271 |
+
set_title = false;
|
272 |
+
}
|
273 |
+
if ( WPGlobusAdmin.data.support['title'] === false ) {
|
274 |
+
set_title = false;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Make post-body-content as tabs container.
|
279 |
+
*/
|
280 |
+
$(content_tabs_id).prepend($('.wpglobus-post-body-tabs-list'));
|
281 |
+
$.each(WPGlobusAdmin.tabs, function (index, suffix) {
|
282 |
+
if ('default' === suffix) {
|
283 |
+
$(wrap_at).wrap('<div id="tab-default"></div>');
|
284 |
+
if ( set_title ) {
|
285 |
+
$($('#titlediv')).insertBefore(wrap_at);
|
286 |
+
}
|
287 |
+
} else {
|
288 |
+
$(wrap_at+'-' + suffix).wrap('<div id="tab-' + suffix + '"></div>');
|
289 |
+
if ( set_title ) {
|
290 |
+
$($('#titlediv-' + suffix)).insertBefore(wrap_at+'-' + suffix);
|
291 |
+
}
|
292 |
+
}
|
293 |
+
});
|
294 |
+
|
295 |
+
$(content_tabs_id).addClass('wpglobus-post-body-tabs');
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Set fields as multilingual.
|
299 |
+
*/
|
300 |
+
//setTimeout(api.setMultilingualFields(), 1000);
|
301 |
+
api.setMultilingualFields();
|
302 |
+
|
303 |
+
/**
|
304 |
+
*
|
305 |
+
*/
|
306 |
+
//api.ajaxPrefilter();
|
307 |
+
|
308 |
+
/**
|
309 |
+
* @since 2.2.22
|
310 |
+
*/
|
311 |
+
if ('post.php' === WPGlobusAdmin.page) {
|
312 |
+
this.postEdit();
|
313 |
+
}
|
314 |
+
|
315 |
+
},
|
316 |
+
postEdit: function() {
|
317 |
+
/**
|
318 |
+
* For compatibility with wpglobus-admin-51.js.
|
319 |
+
* @since 2.2.22
|
320 |
+
*/
|
321 |
+
$(document).triggerHandler('wpglobus_after_post_edit');
|
322 |
+
},
|
323 |
+
ajaxPrefilter: function() {
|
324 |
+
/**
|
325 |
+
* @todo WIP.
|
326 |
+
*/
|
327 |
+
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
|
328 |
+
// Modify options, control originalOptions, store jqXHR, etc
|
329 |
+
//console.log(options);
|
330 |
+
});
|
331 |
+
},
|
332 |
+
setMultilingualFields: function() {
|
333 |
+
$.each(WPGlobusAdmin.builder.multilingualFields, function(indx, field) {
|
334 |
+
var elementBy = 'name';
|
335 |
+
var node = document.getElementsByName(field);
|
336 |
+
var $element;
|
337 |
+
|
338 |
+
if ( 0 == node.length ) {
|
339 |
+
elementBy = 'id';
|
340 |
+
node = document.getElementById(field);
|
341 |
+
}
|
342 |
+
|
343 |
+
if ( null === node ) {
|
344 |
+
return;
|
345 |
+
} else {
|
346 |
+
if ( 'id' == elementBy ) {
|
347 |
+
$element = $('#'+field);
|
348 |
+
} else {
|
349 |
+
var nodeName = node[0].nodeName;
|
350 |
+
nodeName = nodeName.toLowerCase();
|
351 |
+
$element = $(nodeName+'[name="'+field+'"]');
|
352 |
+
}
|
353 |
+
$element.addClass(WPGlobusAdmin.builder.translatableClass);
|
354 |
+
}
|
355 |
+
|
356 |
+
});
|
357 |
+
}
|
358 |
+
}
|
359 |
+
|
360 |
+
WPGlobusAdmin = $.extend({}, WPGlobusAdmin, api);
|
361 |
+
WPGlobusAdmin.init();
|
362 |
+
});
|
trunk/includes/builders/assets/wpglobus-admin-builder-51.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){var o=(a=""+a).indexOf(t,e);return 0<=o&&o},TextFilter:function(a,t,e){if(void 0===a||""===a)return a;var o,n,l=[],i=!1;t=""==t?"en":t,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",t),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+t+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+t+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(a,l[u].start))){o+=l[u].start.length,a=!1===(n=s.strpos(a,l[u].end,o))?a.substr(o):a.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==e?t==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(a)||(a=""):t==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(a)&&(a=""):a=s.TextFilter(a,WPGlobusCoreData.default_language)),a},addLocaleMarks:function(a,t){return WPGlobusCoreData.locale_tag_start.replace("%s",t)+a+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(a,t){o=t==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[t]=s.TextFilter(e,t,o)}),n},getString:function(a,t,e){if(void 0===a)return a;void 0===t&&(t=""),void 0===e&&(e=WPGlobusCoreData.language),(a=s.getTranslations(a))[e]=t;var o="";return l.each(a,function(a,t){""!=t&&a!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(t,a))}),""!=a[WPGlobusCoreData.default_language]&&(o=""==o?a[WPGlobusCoreData.default_language]:s.addLocaleMarks(a[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),jQuery(document).ready(function(l){"use strict";var t;"undefined"!=typeof WPGlobusAdmin&&(t={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?t.taxonomyEdit():t.start()},_info:function(){var a=void 0;0<l("#language").length&&(a=l("#language").val()),console.log("Current language from hidden (#language) : ",a),a=void 0,0<l("#wpglobus-language").length&&(a=l("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",a),a=void 0,0<l('input[name="wpglobus-language"]').length&&(a=l('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',a),a=void 0,0<l('input[name="wpglobus_language"]').length&&(a=l('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',a),console.log("Builder : ",WPGlobusAdmin.builder);var t=l("#content").val();""==t?console.log("Editor content (#content) : (empty)"):console.log(t)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page){var a=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==a&&history.pushState){var t=(a=a.split("+"))[0];if(void 0!==a[1]&&a[1]+0==WPGlobusAdmin.$_get.post){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+t;return window.history.pushState({path:e},"",e),t}}}return!1},setCookie:function(){var a=t.checkCookie();a||void 0===(a=WPGlobusAdmin.$_get.language)&&(a=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,a+"+"+WPGlobusAdmin.$_get.post,31536e3,t.locationPathname)},setLocationSearch:function(){var a;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:a},"",a))},taxonomyEdit:function(){l(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),l(".wrap").tabs(),l(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(l(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),l("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),l(document).on("click",".wpglobus-tax-edit-tab a",function(a){a.preventDefault();var t=l(this).data("href");location.href=t}),t.setMultilingualFields(),l(document).on("tinymce-editor-init",function(a,t){l("#"+t.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){t.setLocationSearch();var e="#postdivrich",o=!0,a="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),l(a).prepend(l(".wpglobus-post-body-tabs-list")),l.each(WPGlobusAdmin.tabs,function(a,t){"default"===t?(l(e).wrap('<div id="tab-default"></div>'),o&&l(l("#titlediv")).insertBefore(e)):(l(e+"-"+t).wrap('<div id="tab-'+t+'"></div>'),o&&l(l("#titlediv-"+t)).insertBefore(e+"-"+t))}),l(a).addClass("wpglobus-post-body-tabs"),t.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){l(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){l.ajaxPrefilter(function(a,t,e){})},setMultilingualFields:function(){l.each(WPGlobusAdmin.builder.multilingualFields,function(a,t){var e,o="name",n=document.getElementsByName(t);0==n.length&&(o="id",n=document.getElementById(t)),null!==n&&("id"==o?l("#"+t):(e=(e=n[0].nodeName).toLowerCase(),l(e+'[name="'+t+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)})}},(WPGlobusAdmin=l.extend({},WPGlobusAdmin,t)).init())});
|
trunk/includes/builders/assets/wpglobus-admin-builder-55.js
ADDED
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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string or object.
|
7 |
+
*
|
8 |
+
* @package WPGlobus
|
9 |
+
* @subpackage Administration
|
10 |
+
*/
|
11 |
+
/*jslint browser: true*/
|
12 |
+
/*global jQuery, console, WPGlobusCore*/
|
13 |
+
|
14 |
+
var WPGlobusCore;
|
15 |
+
|
16 |
+
(function($) {
|
17 |
+
var api;
|
18 |
+
api = WPGlobusCore = {
|
19 |
+
strpos: function( haystack, needle, offset){
|
20 |
+
haystack = "" + haystack;
|
21 |
+
var i = haystack.indexOf( needle, offset );
|
22 |
+
return i >= 0 ? i : false;
|
23 |
+
},
|
24 |
+
|
25 |
+
TextFilter: function(text, language, return_in){
|
26 |
+
if ( typeof text == 'undefined' || '' === text ) { return text; }
|
27 |
+
|
28 |
+
var pos_start, pos_end, possible_delimiters = [], is_local_text_found = false;;
|
29 |
+
|
30 |
+
language = '' == language ? 'en' : language;
|
31 |
+
return_in = typeof return_in == 'undefined' || '' == return_in ? 'RETURN_IN_DEFAULT_LANGUAGE' : return_in;
|
32 |
+
|
33 |
+
possible_delimiters[0] = [];
|
34 |
+
possible_delimiters[0]['start'] = WPGlobusCoreData.locale_tag_start.replace('%s', language);
|
35 |
+
possible_delimiters[0]['end'] = WPGlobusCoreData.locale_tag_end;
|
36 |
+
|
37 |
+
possible_delimiters[1] = [];
|
38 |
+
possible_delimiters[1]['start'] = '<!--:'+language+'-->';
|
39 |
+
possible_delimiters[1]['end'] = '<!--:-->';
|
40 |
+
|
41 |
+
possible_delimiters[2] = [];
|
42 |
+
possible_delimiters[2]['start'] = '[:'+language+']';
|
43 |
+
possible_delimiters[2]['end'] = '[:';
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
for (var i = 0; i < 3; i++) {
|
48 |
+
|
49 |
+
pos_start = api.strpos( text, possible_delimiters[i]['start'] );
|
50 |
+
if ( pos_start === false ) {
|
51 |
+
continue;
|
52 |
+
}
|
53 |
+
|
54 |
+
pos_start = pos_start + possible_delimiters[i]['start'].length;
|
55 |
+
|
56 |
+
pos_end = api.strpos( text, possible_delimiters[i]['end'], pos_start );
|
57 |
+
|
58 |
+
if ( pos_end === false ) {
|
59 |
+
text = text.substr( pos_start );
|
60 |
+
} else {
|
61 |
+
text = text.substr( pos_start, pos_end - pos_start );
|
62 |
+
}
|
63 |
+
|
64 |
+
is_local_text_found = true;
|
65 |
+
break;
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
if ( ! is_local_text_found ) {
|
70 |
+
if ( return_in == 'RETURN_EMPTY' ) {
|
71 |
+
if ( language == WPGlobusCoreData.default_language && ! /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
72 |
+
/** do nothing */
|
73 |
+
} else {
|
74 |
+
text = '';
|
75 |
+
}
|
76 |
+
} else {
|
77 |
+
/**
|
78 |
+
* Try RETURN_IN_DEFAULT_LANGUAGE.
|
79 |
+
*/
|
80 |
+
if ( language == WPGlobusCoreData.default_language ) {
|
81 |
+
if ( /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
82 |
+
text = '';
|
83 |
+
}
|
84 |
+
} else {
|
85 |
+
text = api.TextFilter( text, WPGlobusCoreData.default_language );
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
return text;
|
90 |
+
},
|
91 |
+
addLocaleMarks: function(text, language) {
|
92 |
+
return WPGlobusCoreData.locale_tag_start.replace('%s', language) + text + WPGlobusCoreData.locale_tag_end;
|
93 |
+
},
|
94 |
+
getTranslations: function(text) {
|
95 |
+
var t = {},
|
96 |
+
return_in;
|
97 |
+
$.each(WPGlobusCoreData.enabled_languages, function(i,l){
|
98 |
+
return_in = l == WPGlobusCoreData.default_language ? 'RETURN_IN_DEFAULT_LANGUAGE' : 'RETURN_EMPTY';
|
99 |
+
t[l] = api.TextFilter(text, l, return_in);
|
100 |
+
});
|
101 |
+
return t;
|
102 |
+
},
|
103 |
+
getString: function(s, newVal, l) {
|
104 |
+
if ( 'undefined' === typeof(s) ) {
|
105 |
+
return s;
|
106 |
+
}
|
107 |
+
if ( 'undefined' === typeof(newVal) ) {
|
108 |
+
newVal = '';
|
109 |
+
}
|
110 |
+
if ( 'undefined' === typeof(l) ) {
|
111 |
+
l = WPGlobusCoreData.language;
|
112 |
+
}
|
113 |
+
|
114 |
+
s = api.getTranslations(s);
|
115 |
+
s[l] = newVal;
|
116 |
+
|
117 |
+
var cS = '';
|
118 |
+
|
119 |
+
$.each(s, function(ln,val){
|
120 |
+
if ( '' != val && ln != WPGlobusCoreData.default_language) {
|
121 |
+
cS += api.addLocaleMarks(val, ln);
|
122 |
+
}
|
123 |
+
});
|
124 |
+
|
125 |
+
if ( '' != s[WPGlobusCoreData.default_language] ) {
|
126 |
+
if ( '' == cS ) {
|
127 |
+
cS = s[WPGlobusCoreData.default_language];
|
128 |
+
} else {
|
129 |
+
cS = api.addLocaleMarks(s[WPGlobusCoreData.default_language], WPGlobusCoreData.default_language) + cS;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
return cS;
|
133 |
+
}
|
134 |
+
};
|
135 |
+
})(jQuery);
|
136 |
+
|
137 |
+
jQuery(document).ready(function ($) {
|
138 |
+
"use strict";
|
139 |
+
|
140 |
+
if ( 'undefined' === typeof WPGlobusAdmin ) {
|
141 |
+
return;
|
142 |
+
}
|
143 |
+
|
144 |
+
var api = {
|
145 |
+
languageSelectorBoxDelta: 0,
|
146 |
+
locationPathname: '/wp-admin/post.php',
|
147 |
+
init: function() {
|
148 |
+
//api.setCookie();
|
149 |
+
if ('taxonomy-edit' === WPGlobusAdmin.page) {
|
150 |
+
api.taxonomyEdit();
|
151 |
+
} else {
|
152 |
+
api.start();
|
153 |
+
}
|
154 |
+
},
|
155 |
+
_info: function() {
|
156 |
+
var lang = undefined;
|
157 |
+
if( $('#language').length > 0 ) {
|
158 |
+
lang = $('#language').val();
|
159 |
+
}
|
160 |
+
console.log('Current language from hidden (#language) : ', lang);
|
161 |
+
|
162 |
+
lang = undefined;
|
163 |
+
if( $('#wpglobus-language').length > 0 ) {
|
164 |
+
lang = $('#wpglobus-language').val();
|
165 |
+
}
|
166 |
+
console.log('Current language from hidden (#wpglobus-language) : ', lang);
|
167 |
+
|
168 |
+
lang = undefined;
|
169 |
+
if( $('input[name="wpglobus-language"]').length > 0 ) {
|
170 |
+
lang = $('input[name="wpglobus-language"]').val();
|
171 |
+
}
|
172 |
+
console.log('Current language from hidden (input[name="wpglobus-language"]) : ', lang);
|
173 |
+
|
174 |
+
lang = undefined;
|
175 |
+
if( $('input[name="wpglobus_language"]').length > 0 ) {
|
176 |
+
lang = $('input[name="wpglobus_language"]').val();
|
177 |
+
}
|
178 |
+
console.log('Current language from hidden (input[name="wpglobus_language"]) : ', lang);
|
179 |
+
console.log('Builder : ', WPGlobusAdmin.builder);
|
180 |
+
|
181 |
+
var content = $('#content').val();
|
182 |
+
if ( content == '' ) {
|
183 |
+
console.log('Editor content (#content) : (empty)');
|
184 |
+
} else {
|
185 |
+
console.log(content);
|
186 |
+
}
|
187 |
+
},
|
188 |
+
checkCookie: function() {
|
189 |
+
if ( -1 != window.location.search.indexOf('language=') ) {
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
if ( 'post.php' == WPGlobusAdmin.page ) {
|
193 |
+
var cookie = wpCookies.get(WPGlobusAdmin.builder.languageCookie);
|
194 |
+
|
195 |
+
if ( null !== cookie && history.pushState) {
|
196 |
+
cookie = cookie.split('+');
|
197 |
+
var language = cookie[0];
|
198 |
+
if ('undefined' !== typeof cookie[1] && cookie[1] + 0 == WPGlobusAdmin.$_get.post ) {
|
199 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+language;
|
200 |
+
window.history.pushState({path:newurl},'',newurl);
|
201 |
+
return language;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
return false;
|
206 |
+
},
|
207 |
+
setCookie: function() {
|
208 |
+
var lang = api.checkCookie();
|
209 |
+
if ( ! lang ) {
|
210 |
+
lang = WPGlobusAdmin.$_get.language;
|
211 |
+
if ( 'undefined' === typeof lang ) {
|
212 |
+
lang = WPGlobusAdmin.data.default_language;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
wpCookies.set(WPGlobusAdmin.builder.languageCookie, lang+'+'+WPGlobusAdmin.$_get.post, 31536000, api.locationPathname );
|
216 |
+
},
|
217 |
+
setLocationSearch: function() {
|
218 |
+
if ( ! history.pushState || -1 != window.location.search.indexOf('language=') ) {
|
219 |
+
return;
|
220 |
+
}
|
221 |
+
if ( WPGlobusAdmin.data.default_language != WPGlobusAdmin.currentTab ) {
|
222 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+WPGlobusAdmin.currentTab;
|
223 |
+
window.history.pushState({path:newurl},'',newurl);
|
224 |
+
}
|
225 |
+
},
|
226 |
+
taxonomyEdit: function() {
|
227 |
+
|
228 |
+
$('.wpglobus-taxonomy-tabs').insertAfter('#ajax-response');
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Make class wrap as tabs container.
|
232 |
+
* Tabs on.
|
233 |
+
*/
|
234 |
+
$('.wrap').tabs();
|
235 |
+
|
236 |
+
$(WPGlobusAdmin.data.multilingualSlug.title).insertAfter('.term-slug-wrap th label');
|
237 |
+
|
238 |
+
if ( WPGlobusAdmin.currentTab !== WPGlobusAdmin.data.default_language ) {
|
239 |
+
$('.wpglobus-tax-edit-tab').removeClass('ui-tabs-active ui-state-active');
|
240 |
+
$('#wpglobus-link-tab-'+WPGlobusAdmin.currentTab).addClass('ui-tabs-active ui-state-active');
|
241 |
+
}
|
242 |
+
|
243 |
+
$(document).on('click', '.wpglobus-tax-edit-tab a', function(event) {
|
244 |
+
event.preventDefault();
|
245 |
+
var _href = $(this).data('href');
|
246 |
+
location.href = _href;
|
247 |
+
});
|
248 |
+
|
249 |
+
api.setMultilingualFields();
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Init Yoast tinymce editor for description.
|
253 |
+
*/
|
254 |
+
$(document).on( 'tinymce-editor-init', function( event, editor ) {
|
255 |
+
$( '#' + editor.getContainer().id ).find('iframe').addClass(WPGlobusAdmin.builder.translatableClass).css({'width':''});
|
256 |
+
});
|
257 |
+
},
|
258 |
+
start: function() {
|
259 |
+
/**
|
260 |
+
*
|
261 |
+
*/
|
262 |
+
api.setLocationSearch();
|
263 |
+
|
264 |
+
/**
|
265 |
+
*
|
266 |
+
*/
|
267 |
+
var wrap_at = '#postdivrich',
|
268 |
+
set_title = true,
|
269 |
+
content_tabs_id = '#post-body-content';
|
270 |
+
if ( WPGlobusAdmin.data.support['editor'] === false ) {
|
271 |
+
wrap_at = '#titlediv';
|
272 |
+
set_title = false;
|
273 |
+
}
|
274 |
+
if ( WPGlobusAdmin.data.support['title'] === false ) {
|
275 |
+
set_title = false;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Make post-body-content as tabs container.
|
280 |
+
*/
|
281 |
+
$(content_tabs_id).prepend($('.wpglobus-post-body-tabs-list'));
|
282 |
+
$.each(WPGlobusAdmin.tabs, function (index, suffix) {
|
283 |
+
if ('default' === suffix) {
|
284 |
+
$(wrap_at).wrap('<div id="tab-default"></div>');
|
285 |
+
if ( set_title ) {
|
286 |
+
$($('#titlediv')).insertBefore(wrap_at);
|
287 |
+
}
|
288 |
+
} else {
|
289 |
+
$(wrap_at+'-' + suffix).wrap('<div id="tab-' + suffix + '"></div>');
|
290 |
+
if ( set_title ) {
|
291 |
+
$($('#titlediv-' + suffix)).insertBefore(wrap_at+'-' + suffix);
|
292 |
+
}
|
293 |
+
}
|
294 |
+
});
|
295 |
+
|
296 |
+
$(content_tabs_id).addClass('wpglobus-post-body-tabs');
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Set fields as multilingual.
|
300 |
+
*/
|
301 |
+
//setTimeout(api.setMultilingualFields(), 1000);
|
302 |
+
api.setMultilingualFields();
|
303 |
+
|
304 |
+
/**
|
305 |
+
*
|
306 |
+
*/
|
307 |
+
//api.ajaxPrefilter();
|
308 |
+
|
309 |
+
/**
|
310 |
+
* @since 2.2.22
|
311 |
+
*/
|
312 |
+
if ('post.php' === WPGlobusAdmin.page) {
|
313 |
+
this.postEdit();
|
314 |
+
}
|
315 |
+
|
316 |
+
},
|
317 |
+
postEdit: function() {
|
318 |
+
/**
|
319 |
+
* For compatibility with wpglobus-admin-51.js.
|
320 |
+
* @since 2.2.22
|
321 |
+
*/
|
322 |
+
$(document).triggerHandler('wpglobus_after_post_edit');
|
323 |
+
},
|
324 |
+
ajaxPrefilter: function() {
|
325 |
+
/**
|
326 |
+
* @todo WIP.
|
327 |
+
*/
|
328 |
+
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
|
329 |
+
// Modify options, control originalOptions, store jqXHR, etc
|
330 |
+
//console.log(options);
|
331 |
+
});
|
332 |
+
},
|
333 |
+
setMultilingualFields: function() {
|
334 |
+
$.each(WPGlobusAdmin.builder.multilingualFields, function(indx, field) {
|
335 |
+
/**
|
336 |
+
* @since 2.5.17 Revised function to use field param as string or object.
|
337 |
+
*/
|
338 |
+
var attrs = api.getFieldAttrs(field);
|
339 |
+
if ( 'function' === typeof WPGlobusAdmin[attrs.fieldFunction] ) {
|
340 |
+
WPGlobusAdmin[attrs.fieldFunction](attrs);
|
341 |
+
}
|
342 |
+
});
|
343 |
+
},
|
344 |
+
textField: function(attrs){
|
345 |
+
var id = attrs.id;
|
346 |
+
var elementBy = 'name';
|
347 |
+
var node = document.getElementsByName(id);
|
348 |
+
var $element;
|
349 |
+
|
350 |
+
if ( 0 == node.length ) {
|
351 |
+
elementBy = 'id';
|
352 |
+
node = document.getElementById(id);
|
353 |
+
}
|
354 |
+
|
355 |
+
if ( null === node ) {
|
356 |
+
return true;
|
357 |
+
} else {
|
358 |
+
if ( 'id' == elementBy ) {
|
359 |
+
$element = $('#'+id);
|
360 |
+
} else {
|
361 |
+
var nodeName = node[0].nodeName;
|
362 |
+
nodeName = nodeName.toLowerCase();
|
363 |
+
$element = $(nodeName+'[name="'+id+'"]');
|
364 |
+
}
|
365 |
+
$element.addClass(WPGlobusAdmin.builder.translatableClass);
|
366 |
+
}
|
367 |
+
},
|
368 |
+
wysiwygField: function(attrs){
|
369 |
+
$(document).on('wpglobus_wysiwyg_field', function(evnt,params) {
|
370 |
+
params.callback(attrs);
|
371 |
+
});
|
372 |
+
},
|
373 |
+
fileField: function(attrs){
|
374 |
+
// @since 2.5.17 @W.I.P
|
375 |
+
/*
|
376 |
+
$(document).on('wpglobus_file_field', function(evnt,params) {
|
377 |
+
params.callback(attrs);
|
378 |
+
}); // */
|
379 |
+
},
|
380 |
+
getFieldAttrs: function(field){
|
381 |
+
var defaultAttrs = {
|
382 |
+
'id': false,
|
383 |
+
'type': 'text',
|
384 |
+
'fieldFunction': 'textField'
|
385 |
+
}
|
386 |
+
var attrs = {};
|
387 |
+
if ( 'string' === typeof field ) {
|
388 |
+
attrs['id'] = field;
|
389 |
+
} else if ( 'object' === typeof field ) {
|
390 |
+
if ( 'undefined' !== typeof field.id ) {
|
391 |
+
attrs['id'] = field.id;
|
392 |
+
}
|
393 |
+
if ( 'undefined' !== typeof field.type ) {
|
394 |
+
attrs['type'] = field.type;
|
395 |
+
attrs['fieldFunction'] = field.type+'Field';
|
396 |
+
}
|
397 |
+
}
|
398 |
+
return $.extend({}, defaultAttrs, attrs);
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
WPGlobusAdmin = $.extend({}, WPGlobusAdmin, api);
|
403 |
+
WPGlobusAdmin.init();
|
404 |
+
});
|
trunk/includes/builders/assets/wpglobus-admin-builder-55.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){var o=(t=""+t).indexOf(e,a);return 0<=o&&o},TextFilter:function(t,e,a){if(void 0===t||""===t)return t;var o,n,l=[],i=!1;e=""==e?"en":e,a=void 0===a||""==a?"RETURN_IN_DEFAULT_LANGUAGE":a,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",e),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+e+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+e+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(t,l[u].start))){o+=l[u].start.length,t=!1===(n=s.strpos(t,l[u].end,o))?t.substr(o):t.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==a?e==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):e==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=s.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,e){return WPGlobusCoreData.locale_tag_start.replace("%s",e)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(a){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(t,e){o=e==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[e]=s.TextFilter(a,e,o)}),n},getString:function(t,e,a){if(void 0===t)return t;void 0===e&&(e=""),void 0===a&&(a=WPGlobusCoreData.language),(t=s.getTranslations(t))[a]=e;var o="";return l.each(t,function(t,e){""!=e&&t!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(e,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:s.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),jQuery(document).ready(function(l){"use strict";var n;"undefined"!=typeof WPGlobusAdmin&&(n={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?n.taxonomyEdit():n.start()},_info:function(){var t=void 0;0<l("#language").length&&(t=l("#language").val()),console.log("Current language from hidden (#language) : ",t),t=void 0,0<l("#wpglobus-language").length&&(t=l("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",t),t=void 0,0<l('input[name="wpglobus-language"]').length&&(t=l('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',t),t=void 0,0<l('input[name="wpglobus_language"]').length&&(t=l('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',t),console.log("Builder : ",WPGlobusAdmin.builder);var e=l("#content").val();""==e?console.log("Editor content (#content) : (empty)"):console.log(e)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page){var t=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==t&&history.pushState){var e=(t=t.split("+"))[0];if(void 0!==t[1]&&t[1]+0==WPGlobusAdmin.$_get.post){var a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+e;return window.history.pushState({path:a},"",a),e}}}return!1},setCookie:function(){var t=n.checkCookie();t||void 0===(t=WPGlobusAdmin.$_get.language)&&(t=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,t+"+"+WPGlobusAdmin.$_get.post,31536e3,n.locationPathname)},setLocationSearch:function(){var t;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:t},"",t))},taxonomyEdit:function(){l(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),l(".wrap").tabs(),l(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(l(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),l("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),l(document).on("click",".wpglobus-tax-edit-tab a",function(t){t.preventDefault();var e=l(this).data("href");location.href=e}),n.setMultilingualFields(),l(document).on("tinymce-editor-init",function(t,e){l("#"+e.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){n.setLocationSearch();var a="#postdivrich",o=!0,t="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(a="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),l(t).prepend(l(".wpglobus-post-body-tabs-list")),l.each(WPGlobusAdmin.tabs,function(t,e){"default"===e?(l(a).wrap('<div id="tab-default"></div>'),o&&l(l("#titlediv")).insertBefore(a)):(l(a+"-"+e).wrap('<div id="tab-'+e+'"></div>'),o&&l(l("#titlediv-"+e)).insertBefore(a+"-"+e))}),l(t).addClass("wpglobus-post-body-tabs"),n.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){l(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){l.ajaxPrefilter(function(t,e,a){})},setMultilingualFields:function(){l.each(WPGlobusAdmin.builder.multilingualFields,function(t,e){var a=n.getFieldAttrs(e);"function"==typeof WPGlobusAdmin[a.fieldFunction]&&WPGlobusAdmin[a.fieldFunction](a)})},textField:function(t){var e,a=t.id,o="name",n=document.getElementsByName(a);if(0==n.length&&(o="id",n=document.getElementById(a)),null===n)return!0;("id"==o?l("#"+a):(e=(e=n[0].nodeName).toLowerCase(),l(e+'[name="'+a+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)},wysiwygField:function(a){l(document).on("wpglobus_wysiwyg_field",function(t,e){e.callback(a)})},fileField:function(t){},getFieldAttrs:function(t){var e={};return"string"==typeof t?e.id=t:"object"==typeof t&&(void 0!==t.id&&(e.id=t.id),void 0!==t.type&&(e.type=t.type,e.fieldFunction=t.type+"Field")),l.extend({},{id:!1,type:"text",fieldFunction:"textField"},e)}},(WPGlobusAdmin=l.extend({},WPGlobusAdmin,n)).init())});
|
trunk/includes/builders/assets/wpglobus-admin-builder-56.js
ADDED
@@ -0,0 +1,403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WPGlobus Administration Core.
|
3 |
+
* Interface JS functions
|
4 |
+
*
|
5 |
+
* @since 2.6
|
6 |
+
*
|
7 |
+
* @package WPGlobus
|
8 |
+
* @subpackage Administration
|
9 |
+
*/
|
10 |
+
/*jslint browser: true*/
|
11 |
+
/*global jQuery, console, WPGlobusCore*/
|
12 |
+
|
13 |
+
var WPGlobusCore;
|
14 |
+
|
15 |
+
(function($) {
|
16 |
+
var api;
|
17 |
+
api = WPGlobusCore = {
|
18 |
+
strpos: function( haystack, needle, offset){
|
19 |
+
haystack = "" + haystack;
|
20 |
+
var i = haystack.indexOf( needle, offset );
|
21 |
+
return i >= 0 ? i : false;
|
22 |
+
},
|
23 |
+
|
24 |
+
TextFilter: function(text, language, return_in){
|
25 |
+
if ( typeof text == 'undefined' || '' === text ) { return text; }
|
26 |
+
|
27 |
+
var pos_start, pos_end, possible_delimiters = [], is_local_text_found = false;;
|
28 |
+
|
29 |
+
language = '' == language ? 'en' : language;
|
30 |
+
return_in = typeof return_in == 'undefined' || '' == return_in ? 'RETURN_IN_DEFAULT_LANGUAGE' : return_in;
|
31 |
+
|
32 |
+
possible_delimiters[0] = [];
|
33 |
+
possible_delimiters[0]['start'] = WPGlobusCoreData.locale_tag_start.replace('%s', language);
|
34 |
+
possible_delimiters[0]['end'] = WPGlobusCoreData.locale_tag_end;
|
35 |
+
|
36 |
+
possible_delimiters[1] = [];
|
37 |
+
possible_delimiters[1]['start'] = '<!--:'+language+'-->';
|
38 |
+
possible_delimiters[1]['end'] = '<!--:-->';
|
39 |
+
|
40 |
+
possible_delimiters[2] = [];
|
41 |
+
possible_delimiters[2]['start'] = '[:'+language+']';
|
42 |
+
possible_delimiters[2]['end'] = '[:';
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
for (var i = 0; i < 3; i++) {
|
47 |
+
|
48 |
+
pos_start = api.strpos( text, possible_delimiters[i]['start'] );
|
49 |
+
if ( pos_start === false ) {
|
50 |
+
continue;
|
51 |
+
}
|
52 |
+
|
53 |
+
pos_start = pos_start + possible_delimiters[i]['start'].length;
|
54 |
+
|
55 |
+
pos_end = api.strpos( text, possible_delimiters[i]['end'], pos_start );
|
56 |
+
|
57 |
+
if ( pos_end === false ) {
|
58 |
+
text = text.substr( pos_start );
|
59 |
+
} else {
|
60 |
+
text = text.substr( pos_start, pos_end - pos_start );
|
61 |
+
}
|
62 |
+
|
63 |
+
is_local_text_found = true;
|
64 |
+
break;
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( ! is_local_text_found ) {
|
69 |
+
if ( return_in == 'RETURN_EMPTY' ) {
|
70 |
+
if ( language == WPGlobusCoreData.default_language && ! /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
71 |
+
/** do nothing */
|
72 |
+
} else {
|
73 |
+
text = '';
|
74 |
+
}
|
75 |
+
} else {
|
76 |
+
/**
|
77 |
+
* Try RETURN_IN_DEFAULT_LANGUAGE.
|
78 |
+
*/
|
79 |
+
if ( language == WPGlobusCoreData.default_language ) {
|
80 |
+
if ( /(\{:|\[:|<!--:)[a-z]{2}/.test(text) ) {
|
81 |
+
text = '';
|
82 |
+
}
|
83 |
+
} else {
|
84 |
+
text = api.TextFilter( text, WPGlobusCoreData.default_language );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
return text;
|
89 |
+
},
|
90 |
+
addLocaleMarks: function(text, language) {
|
91 |
+
return WPGlobusCoreData.locale_tag_start.replace('%s', language) + text + WPGlobusCoreData.locale_tag_end;
|
92 |
+
},
|
93 |
+
getTranslations: function(text) {
|
94 |
+
var t = {},
|
95 |
+
return_in;
|
96 |
+
$.each(WPGlobusCoreData.enabled_languages, function(i,l){
|
97 |
+
return_in = l == WPGlobusCoreData.default_language ? 'RETURN_IN_DEFAULT_LANGUAGE' : 'RETURN_EMPTY';
|
98 |
+
t[l] = api.TextFilter(text, l, return_in);
|
99 |
+
});
|
100 |
+
return t;
|
101 |
+
},
|
102 |
+
getString: function(s, newVal, l) {
|
103 |
+
if ( 'undefined' === typeof(s) ) {
|
104 |
+
return s;
|
105 |
+
}
|
106 |
+
if ( 'undefined' === typeof(newVal) ) {
|
107 |
+
newVal = '';
|
108 |
+
}
|
109 |
+
if ( 'undefined' === typeof(l) ) {
|
110 |
+
l = WPGlobusCoreData.language;
|
111 |
+
}
|
112 |
+
|
113 |
+
s = api.getTranslations(s);
|
114 |
+
s[l] = newVal;
|
115 |
+
|
116 |
+
var cS = '';
|
117 |
+
|
118 |
+
$.each(s, function(ln,val){
|
119 |
+
if ( '' != val && ln != WPGlobusCoreData.default_language) {
|
120 |
+
cS += api.addLocaleMarks(val, ln);
|
121 |
+
}
|
122 |
+
});
|
123 |
+
|
124 |
+
if ( '' != s[WPGlobusCoreData.default_language] ) {
|
125 |
+
if ( '' == cS ) {
|
126 |
+
cS = s[WPGlobusCoreData.default_language];
|
127 |
+
} else {
|
128 |
+
cS = api.addLocaleMarks(s[WPGlobusCoreData.default_language], WPGlobusCoreData.default_language) + cS;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
return cS;
|
132 |
+
}
|
133 |
+
};
|
134 |
+
})(jQuery);
|
135 |
+
|
136 |
+
jQuery(document).ready(function ($) {
|
137 |
+
"use strict";
|
138 |
+
|
139 |
+
if ( 'undefined' === typeof WPGlobusAdmin ) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
var api = {
|
144 |
+
languageSelectorBoxDelta: 0,
|
145 |
+
locationPathname: '/wp-admin/post.php',
|
146 |
+
init: function() {
|
147 |
+
//api.setCookie();
|
148 |
+
if ('taxonomy-edit' === WPGlobusAdmin.page) {
|
149 |
+
api.taxonomyEdit();
|
150 |
+
} else {
|
151 |
+
api.start();
|
152 |
+
}
|
153 |
+
},
|
154 |
+
_info: function() {
|
155 |
+
var lang = undefined;
|
156 |
+
if( $('#language').length > 0 ) {
|
157 |
+
lang = $('#language').val();
|
158 |
+
}
|
159 |
+
console.log('Current language from hidden (#language) : ', lang);
|
160 |
+
|
161 |
+
lang = undefined;
|
162 |
+
if( $('#wpglobus-language').length > 0 ) {
|
163 |
+
lang = $('#wpglobus-language').val();
|
164 |
+
}
|
165 |
+
console.log('Current language from hidden (#wpglobus-language) : ', lang);
|
166 |
+
|
167 |
+
lang = undefined;
|
168 |
+
if( $('input[name="wpglobus-language"]').length > 0 ) {
|
169 |
+
lang = $('input[name="wpglobus-language"]').val();
|
170 |
+
}
|
171 |
+
console.log('Current language from hidden (input[name="wpglobus-language"]) : ', lang);
|
172 |
+
|
173 |
+
lang = undefined;
|
174 |
+
if( $('input[name="wpglobus_language"]').length > 0 ) {
|
175 |
+
lang = $('input[name="wpglobus_language"]').val();
|
176 |
+
}
|
177 |
+
console.log('Current language from hidden (input[name="wpglobus_language"]) : ', lang);
|
178 |
+
console.log('Builder : ', WPGlobusAdmin.builder);
|
179 |
+
|
180 |
+
var content = $('#content').val();
|
181 |
+
if ( content == '' ) {
|
182 |
+
console.log('Editor content (#content) : (empty)');
|
183 |
+
} else {
|
184 |
+
console.log(content);
|
185 |
+
}
|
186 |
+
},
|
187 |
+
checkCookie: function() {
|
188 |
+
if ( -1 != window.location.search.indexOf('language=') ) {
|
189 |
+
return false;
|
190 |
+
}
|
191 |
+
if ( 'post.php' == WPGlobusAdmin.page ) {
|
192 |
+
var cookie = wpCookies.get(WPGlobusAdmin.builder.languageCookie);
|
193 |
+
|
194 |
+
if ( null !== cookie && history.pushState) {
|
195 |
+
cookie = cookie.split('+');
|
196 |
+
var language = cookie[0];
|
197 |
+
if ('undefined' !== typeof cookie[1] && cookie[1] + 0 == WPGlobusAdmin.$_get.post ) {
|
198 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+language;
|
199 |
+
window.history.pushState({path:newurl},'',newurl);
|
200 |
+
return language;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
}
|
204 |
+
return false;
|
205 |
+
},
|
206 |
+
setCookie: function() {
|
207 |
+
var lang = api.checkCookie();
|
208 |
+
if ( ! lang ) {
|
209 |
+
lang = WPGlobusAdmin.$_get.language;
|
210 |
+
if ( 'undefined' === typeof lang ) {
|
211 |
+
lang = WPGlobusAdmin.data.default_language;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
wpCookies.set(WPGlobusAdmin.builder.languageCookie, lang+'+'+WPGlobusAdmin.$_get.post, 31536000, api.locationPathname );
|
215 |
+
},
|
216 |
+
setLocationSearch: function() {
|
217 |
+
if ( ! history.pushState || -1 != window.location.search.indexOf('language=') ) {
|
218 |
+
return;
|
219 |
+
}
|
220 |
+
if ( WPGlobusAdmin.data.default_language != WPGlobusAdmin.currentTab ) {
|
221 |
+
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search + '&language='+WPGlobusAdmin.currentTab;
|
222 |
+
window.history.pushState({path:newurl},'',newurl);
|
223 |
+
}
|
224 |
+
},
|
225 |
+
taxonomyEdit: function() {
|
226 |
+
|
227 |
+
$('.wpglobus-taxonomy-tabs').insertAfter('#ajax-response');
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Make class wrap as tabs container.
|
231 |
+
* Tabs on.
|
232 |
+
*/
|
233 |
+
$('.wrap').tabs();
|
234 |
+
|
235 |
+
$(WPGlobusAdmin.data.multilingualSlug.title).insertAfter('.term-slug-wrap th label');
|
236 |
+
|
237 |
+
if ( WPGlobusAdmin.currentTab !== WPGlobusAdmin.data.default_language ) {
|
238 |
+
$('.wpglobus-tax-edit-tab').removeClass('ui-tabs-active ui-state-active');
|
239 |
+
$('#wpglobus-link-tab-'+WPGlobusAdmin.currentTab).addClass('ui-tabs-active ui-state-active');
|
240 |
+
}
|
241 |
+
|
242 |
+
$(document).on('click', '.wpglobus-tax-edit-tab a', function(event) {
|
243 |
+
event.preventDefault();
|
244 |
+
var _href = $(this).data('href');
|
245 |
+
location.href = _href;
|
246 |
+
});
|
247 |
+
|
248 |
+
api.setMultilingualFields();
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Init Yoast tinymce editor for description.
|
252 |
+
*/
|
253 |
+
$(document).on( 'tinymce-editor-init', function( event, editor ) {
|
254 |
+
$( '#' + editor.getContainer().id ).find('iframe').addClass(WPGlobusAdmin.builder.translatableClass).css({'width':''});
|
255 |
+
});
|
256 |
+
},
|
257 |
+
start: function() {
|
258 |
+
/**
|
259 |
+
*
|
260 |
+
*/
|
261 |
+
api.setLocationSearch();
|
262 |
+
|
263 |
+
/**
|
264 |
+
*
|
265 |
+
*/
|
266 |
+
var wrap_at = '#postdivrich',
|
267 |
+
set_title = true,
|
268 |
+
content_tabs_id = '#post-body-content';
|
269 |
+
if ( WPGlobusAdmin.data.support['editor'] === false ) {
|
270 |
+
wrap_at = '#titlediv';
|
271 |
+
set_title = false;
|
272 |
+
}
|
273 |
+
if ( WPGlobusAdmin.data.support['title'] === false ) {
|
274 |
+
set_title = false;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Make post-body-content as tabs container.
|
279 |
+
*/
|
280 |
+
$(content_tabs_id).prepend($('.wpglobus-post-body-tabs-list'));
|
281 |
+
$.each(WPGlobusAdmin.tabs, function (index, suffix) {
|
282 |
+
if ('default' === suffix) {
|
283 |
+
$(wrap_at).wrap('<div id="tab-default"></div>');
|
284 |
+
if ( set_title ) {
|
285 |
+
$($('#titlediv')).insertBefore(wrap_at);
|
286 |
+
}
|
287 |
+
} else {
|
288 |
+
$(wrap_at+'-' + suffix).wrap('<div id="tab-' + suffix + '"></div>');
|
289 |
+
if ( set_title ) {
|
290 |
+
$($('#titlediv-' + suffix)).insertBefore(wrap_at+'-' + suffix);
|
291 |
+
}
|
292 |
+
}
|
293 |
+
});
|
294 |
+
|
295 |
+
$(content_tabs_id).addClass('wpglobus-post-body-tabs');
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Set fields as multilingual.
|
299 |
+
*/
|
300 |
+
//setTimeout(api.setMultilingualFields(), 1000);
|
301 |
+
api.setMultilingualFields();
|
302 |
+
|
303 |
+
/**
|
304 |
+
*
|
305 |
+
*/
|
306 |
+
//api.ajaxPrefilter();
|
307 |
+
|
308 |
+
/**
|
309 |
+
* @since 2.2.22
|
310 |
+
*/
|
311 |
+
if ('post.php' === WPGlobusAdmin.page) {
|
312 |
+
this.postEdit();
|
313 |
+
}
|
314 |
+
|
315 |
+
},
|
316 |
+
postEdit: function() {
|
317 |
+
/**
|
318 |
+
* For compatibility with wpglobus-admin-51.js.
|
319 |
+
* @since 2.2.22
|
320 |
+
*/
|
321 |
+
$(document).triggerHandler('wpglobus_after_post_edit');
|
322 |
+
},
|
323 |
+
ajaxPrefilter: function() {
|
324 |
+
/**
|
325 |
+
* @todo WIP.
|
326 |
+
*/
|
327 |
+
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
|
328 |
+
// Modify options, control originalOptions, store jqXHR, etc
|
329 |
+
//console.log(options);
|
330 |
+
});
|
331 |
+
},
|
332 |
+
setMultilingualFields: function() {
|
333 |
+
$.each(WPGlobusAdmin.builder.multilingualFields, function(indx, field) {
|
334 |
+
/**
|
335 |
+
* @since 2.5.17 Revised function to use field param as string or object.
|
336 |
+
*/
|
337 |
+
var attrs = api.getFieldAttrs(field);
|
338 |
+
if ( 'function' === typeof WPGlobusAdmin[attrs.fieldFunction] ) {
|
339 |
+
WPGlobusAdmin[attrs.fieldFunction](attrs);
|
340 |
+
}
|
341 |
+
});
|
342 |
+
},
|
343 |
+
textField: function(attrs){
|
344 |
+
var id = attrs.id;
|
345 |
+
var elementBy = 'name';
|
346 |
+
var node = document.getElementsByName(id);
|
347 |
+
var $element;
|
348 |
+
|
349 |
+
if ( 0 == node.length ) {
|
350 |
+
elementBy = 'id';
|
351 |
+
node = document.getElementById(id);
|
352 |
+
}
|
353 |
+
|
354 |
+
if ( null === node ) {
|
355 |
+
return true;
|
356 |
+
} else {
|
357 |
+
if ( 'id' == elementBy ) {
|
358 |
+
$element = $('#'+id);
|
359 |
+
} else {
|
360 |
+
var nodeName = node[0].nodeName;
|
361 |
+
nodeName = nodeName.toLowerCase();
|
362 |
+
$element = $(nodeName+'[name="'+id+'"]');
|
363 |
+
}
|
364 |
+
$element.addClass(WPGlobusAdmin.builder.translatableClass);
|
365 |
+
}
|
366 |
+
},
|
367 |
+
wysiwygField: function(attrs){
|
368 |
+
$(document).on('wpglobus_wysiwyg_field', function(evnt,params) {
|
369 |
+
params.callback(attrs);
|
370 |
+
});
|
371 |
+
},
|
372 |
+
fileField: function(attrs){
|
373 |
+
// @since 2.5.17 @W.I.P
|
374 |
+
/*
|
375 |
+
$(document).on('wpglobus_file_field', function(evnt,params) {
|
376 |
+
params.callback(attrs);
|
377 |
+
}); // */
|
378 |
+
},
|
379 |
+
getFieldAttrs: function(field){
|
380 |
+
var defaultAttrs = {
|
381 |
+
'id': false,
|
382 |
+
'type': 'text',
|
383 |
+
'fieldFunction': 'textField'
|
384 |
+
}
|
385 |
+
var attrs = {};
|
386 |
+
if ( 'string' === typeof field ) {
|
387 |
+
attrs['id'] = field;
|
388 |
+
} else if ( 'object' === typeof field ) {
|
389 |
+
if ( 'undefined' !== typeof field.id ) {
|
390 |
+
attrs['id'] = field.id;
|
391 |
+
}
|
392 |
+
if ( 'undefined' !== typeof field.type ) {
|
393 |
+
attrs['type'] = field.type;
|
394 |
+
attrs['fieldFunction'] = field.type+'Field';
|
395 |
+
}
|
396 |
+
}
|
397 |
+
return $.extend({}, defaultAttrs, attrs);
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
WPGlobusAdmin = $.extend({}, WPGlobusAdmin, api);
|
402 |
+
WPGlobusAdmin.init();
|
403 |
+
});
|
trunk/includes/builders/assets/wpglobus-admin-builder-56.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){var o=(t=""+t).indexOf(e,a);return 0<=o&&o},TextFilter:function(t,e,a){if(void 0===t||""===t)return t;var o,n,l=[],i=!1;e=""==e?"en":e,a=void 0===a||""==a?"RETURN_IN_DEFAULT_LANGUAGE":a,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",e),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+e+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+e+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(t,l[u].start))){o+=l[u].start.length,t=!1===(n=s.strpos(t,l[u].end,o))?t.substr(o):t.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==a?e==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):e==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=s.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,e){return WPGlobusCoreData.locale_tag_start.replace("%s",e)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(a){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(t,e){o=e==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[e]=s.TextFilter(a,e,o)}),n},getString:function(t,e,a){if(void 0===t)return t;void 0===e&&(e=""),void 0===a&&(a=WPGlobusCoreData.language),(t=s.getTranslations(t))[a]=e;var o="";return l.each(t,function(t,e){""!=e&&t!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(e,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:s.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),jQuery(document).ready(function(l){"use strict";var n;"undefined"!=typeof WPGlobusAdmin&&(n={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?n.taxonomyEdit():n.start()},_info:function(){var t=void 0;0<l("#language").length&&(t=l("#language").val()),console.log("Current language from hidden (#language) : ",t),t=void 0,0<l("#wpglobus-language").length&&(t=l("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",t),t=void 0,0<l('input[name="wpglobus-language"]').length&&(t=l('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',t),t=void 0,0<l('input[name="wpglobus_language"]').length&&(t=l('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',t),console.log("Builder : ",WPGlobusAdmin.builder);var e=l("#content").val();""==e?console.log("Editor content (#content) : (empty)"):console.log(e)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page){var t=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==t&&history.pushState){var e=(t=t.split("+"))[0];if(void 0!==t[1]&&t[1]+0==WPGlobusAdmin.$_get.post){var a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+e;return window.history.pushState({path:a},"",a),e}}}return!1},setCookie:function(){var t=n.checkCookie();t||void 0===(t=WPGlobusAdmin.$_get.language)&&(t=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,t+"+"+WPGlobusAdmin.$_get.post,31536e3,n.locationPathname)},setLocationSearch:function(){var t;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:t},"",t))},taxonomyEdit:function(){l(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),l(".wrap").tabs(),l(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(l(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),l("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),l(document).on("click",".wpglobus-tax-edit-tab a",function(t){t.preventDefault();var e=l(this).data("href");location.href=e}),n.setMultilingualFields(),l(document).on("tinymce-editor-init",function(t,e){l("#"+e.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){n.setLocationSearch();var a="#postdivrich",o=!0,t="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(a="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),l(t).prepend(l(".wpglobus-post-body-tabs-list")),l.each(WPGlobusAdmin.tabs,function(t,e){"default"===e?(l(a).wrap('<div id="tab-default"></div>'),o&&l(l("#titlediv")).insertBefore(a)):(l(a+"-"+e).wrap('<div id="tab-'+e+'"></div>'),o&&l(l("#titlediv-"+e)).insertBefore(a+"-"+e))}),l(t).addClass("wpglobus-post-body-tabs"),n.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){l(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){l.ajaxPrefilter(function(t,e,a){})},setMultilingualFields:function(){l.each(WPGlobusAdmin.builder.multilingualFields,function(t,e){var a=n.getFieldAttrs(e);"function"==typeof WPGlobusAdmin[a.fieldFunction]&&WPGlobusAdmin[a.fieldFunction](a)})},textField:function(t){var e,a=t.id,o="name",n=document.getElementsByName(a);if(0==n.length&&(o="id",n=document.getElementById(a)),null===n)return!0;("id"==o?l("#"+a):(e=(e=n[0].nodeName).toLowerCase(),l(e+'[name="'+a+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)},wysiwygField:function(a){l(document).on("wpglobus_wysiwyg_field",function(t,e){e.callback(a)})},fileField:function(t){},getFieldAttrs:function(t){var e={};return"string"==typeof t?e.id=t:"object"==typeof t&&(void 0!==t.id&&(e.id=t.id),void 0!==t.type&&(e.type=t.type,e.fieldFunction=t.type+"Field")),l.extend({},{id:!1,type:"text",fieldFunction:"textField"},e)}},(WPGlobusAdmin=l.extend({},WPGlobusAdmin,n)).init())});
|
trunk/includes/builders/class-wpglobus-builder-update-post.php
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-builder-update-post.php
|
4 |
+
*
|
5 |
+
* @since 2.2.35
|
6 |
+
* @since 2.4.3 Added `wp_insert_post_data` filter.
|
7 |
+
*
|
8 |
+
* @package WPGlobus\Builders
|
9 |
+
* @author Alex Gor(alexgff)
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class WPGlobus_Builder_Update_Post.
|
14 |
+
*/
|
15 |
+
if ( ! class_exists( 'WPGlobus_Builder_Update_Post' ) ) :
|
16 |
+
|
17 |
+
class WPGlobus_Builder_Update_Post {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Builder ID.
|
21 |
+
*/
|
22 |
+
protected $id = null;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Constructor.
|
26 |
+
*/
|
27 |
+
public function __construct( $id ) {
|
28 |
+
|
29 |
+
$this->id = $id;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Do not start for `gutenberg`.
|
33 |
+
* The block editor prohibits saving post with an empty post title from post edit page.
|
34 |
+
*/
|
35 |
+
if ( 'gutenberg' == $this->id ) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
add_filter( 'wp_insert_post_empty_content', array( $this, 'filter__post_empty_content' ), 10, 2);
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @since 2.4.3
|
43 |
+
* @todo incorrect the saving post in extra languages with priority = 10
|
44 |
+
*/
|
45 |
+
add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Filters whether the post should be considered "empty".
|
50 |
+
*
|
51 |
+
* @see wp-includes\post.php
|
52 |
+
*
|
53 |
+
* @param bool $maybe_empty Whether the post should be considered "empty".
|
54 |
+
* @param array $postarr Array of post data.
|
55 |
+
*/
|
56 |
+
public function filter__post_empty_content( $maybe_empty, $postarr ) {
|
57 |
+
|
58 |
+
if ( WPGlobus::Config()->builder->is_default_language() ) {
|
59 |
+
return $maybe_empty;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Don't return a truthy value for extra language.
|
64 |
+
*/
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Callback for 'wp_insert_post_data'.
|
70 |
+
*
|
71 |
+
* @since 2.4.3
|
72 |
+
* @param array $data
|
73 |
+
* @param array $postarr
|
74 |
+
*
|
75 |
+
* @return mixed
|
76 |
+
*/
|
77 |
+
public function filter__wp_insert_post_data( $data, $postarr ) {
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Prevent to filter disabled post type.
|
81 |
+
*/
|
82 |
+
if ( in_array( $data['post_type'], WPGlobus::Config()->disabled_entities, true ) ) {
|
83 |
+
return $data;
|
84 |
+
}
|
85 |
+
|
86 |
+
global $wpdb;
|
87 |
+
$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d AND post_type = %s LIMIT 1", $postarr['ID'], $postarr['post_type'] ) );
|
88 |
+
|
89 |
+
$fields = array();
|
90 |
+
if ( isset( $postarr['post_title'] ) ) {
|
91 |
+
$fields['post_title'] = $postarr['post_title'];
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( isset( $postarr['post_content'] ) ) {
|
95 |
+
$fields['post_content'] = $postarr['post_content'];
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( isset( $postarr['post_excerpt'] ) ) {
|
99 |
+
$fields['post_excerpt'] = $postarr['post_excerpt'];
|
100 |
+
}
|
101 |
+
|
102 |
+
$builder_language = WPGlobus::Config()->builder->get_language();
|
103 |
+
|
104 |
+
if ( empty( $builder_language ) ) {
|
105 |
+
|
106 |
+
if ( empty( $postarr[ WPGlobus::get_language_meta_key() ] ) ) {
|
107 |
+
$builder_language = WPGlobus::Config()->default_language;
|
108 |
+
} else {
|
109 |
+
$builder_language = $postarr[ WPGlobus::get_language_meta_key() ];
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
foreach ( $fields as $field => $value ) {
|
114 |
+
|
115 |
+
$tr = array();
|
116 |
+
|
117 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
118 |
+
|
119 |
+
if ( $lang === $builder_language ) {
|
120 |
+
|
121 |
+
$text = $value;
|
122 |
+
if ( WPGlobus_Core::has_translations( $value ) ) {
|
123 |
+
$text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
|
124 |
+
}
|
125 |
+
if ( ! empty( $text ) ) {
|
126 |
+
$tr[ $lang ] = $text;
|
127 |
+
}
|
128 |
+
} else {
|
129 |
+
if ( isset( $_post->$field ) ) {
|
130 |
+
$text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
|
131 |
+
if ( ! empty( $text ) ) {
|
132 |
+
$tr[ $lang ] = $text;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
endforeach;
|
138 |
+
|
139 |
+
$data[ $field ] = WPGlobus_Utils::build_multilingual_string( $tr );
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
return $data;
|
144 |
+
}
|
145 |
+
} // class WPGlobus_Builder_Update_Post.
|
146 |
+
|
147 |
+
endif;
|
148 |
+
|
149 |
+
# --- EOF
|
trunk/includes/builders/class-wpglobus-builder.php
ADDED
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-builder.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Builder.
|
11 |
+
*
|
12 |
+
* @since 1.9.17
|
13 |
+
*/
|
14 |
+
if ( ! class_exists( 'WPGlobus_Builder' ) ) :
|
15 |
+
|
16 |
+
class WPGlobus_Builder {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Current language of post.
|
20 |
+
*/
|
21 |
+
protected $language = null;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Builder ID.
|
25 |
+
*/
|
26 |
+
protected $id = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Array of activated builders.
|
30 |
+
*
|
31 |
+
* @since 1.9.17
|
32 |
+
* @access protected
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
// phpcs:ignore
|
36 |
+
//protected $builders = array(); TODO remove
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var array
|
40 |
+
* @todo Unused?
|
41 |
+
*/
|
42 |
+
protected $builder_post = null;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Constructor method.
|
46 |
+
*
|
47 |
+
* @since 1.9.17
|
48 |
+
*
|
49 |
+
* @param string $id The Builder ID, such as 'gutenberg'.
|
50 |
+
*/
|
51 |
+
public function __construct( $id ) {
|
52 |
+
|
53 |
+
$this->id = $id;
|
54 |
+
|
55 |
+
$this->set_current_language();
|
56 |
+
|
57 |
+
// phpcs:ignore
|
58 |
+
// if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
59 |
+
/**
|
60 |
+
* @todo Add the handling of AJAX.
|
61 |
+
*/
|
62 |
+
// }
|
63 |
+
|
64 |
+
if ( is_admin() ) {
|
65 |
+
|
66 |
+
add_action( 'redirect_post_location', array( $this, 'on__redirect' ), 5, 2 );
|
67 |
+
|
68 |
+
add_filter( 'admin_body_class', array( $this, 'filter__add_admin_body_class' ) );
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Add builder/add-on label to admin bar.
|
72 |
+
*
|
73 |
+
* @since 1.9.27
|
74 |
+
*/
|
75 |
+
add_action( 'admin_bar_menu', array( $this, 'on__admin_bar_menu' ), 11 );
|
76 |
+
|
77 |
+
/**
|
78 |
+
* @see "{$field_no_prefix}_edit_pre" in wp-includes\post.php
|
79 |
+
*/
|
80 |
+
add_filter( 'content_edit_pre', array( $this, 'filter__content' ), 5, 2 );
|
81 |
+
add_filter( 'title_edit_pre', array( $this, 'filter__title' ), 5, 2 );
|
82 |
+
add_filter( 'excerpt_edit_pre', array( $this, 'filter__excerpt' ), 5, 2 );
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Show language tabs in post.php page.
|
88 |
+
*
|
89 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
90 |
+
*/
|
91 |
+
add_filter( 'wpglobus_show_language_tabs', array( $this, 'filter__show_language_tabs' ), 5 );
|
92 |
+
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Filter title.
|
97 |
+
*
|
98 |
+
* @param string $value The title.
|
99 |
+
* @param int $post_id Unused.
|
100 |
+
*
|
101 |
+
* @return string
|
102 |
+
*/
|
103 |
+
public function filter__title(
|
104 |
+
$value, /** @noinspection PhpUnusedParameterInspection */
|
105 |
+
$post_id
|
106 |
+
) {
|
107 |
+
$value = WPGlobus_Core::text_filter( $value, $this->get_current_language(), WPGlobus::RETURN_EMPTY );
|
108 |
+
|
109 |
+
return $value;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Filter content.
|
114 |
+
*
|
115 |
+
* @param string $content The content.
|
116 |
+
* @param int $post_id Post ID - Unused.
|
117 |
+
*
|
118 |
+
* @return string
|
119 |
+
*/
|
120 |
+
public function filter__content(
|
121 |
+
$content, /** @noinspection PhpUnusedParameterInspection */
|
122 |
+
$post_id
|
123 |
+
) {
|
124 |
+
$content = WPGlobus_Core::text_filter( $content, $this->get_current_language(), WPGlobus::RETURN_EMPTY );
|
125 |
+
|
126 |
+
return $content;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Filter excerpt.
|
131 |
+
*
|
132 |
+
* @param string $excerpt The excerpt.
|
133 |
+
* @param int $post_id Post ID - Unused.
|
134 |
+
*
|
135 |
+
* @return string
|
136 |
+
*/
|
137 |
+
public function filter__excerpt(
|
138 |
+
$excerpt, /** @noinspection PhpUnusedParameterInspection */
|
139 |
+
$post_id
|
140 |
+
) {
|
141 |
+
$excerpt = WPGlobus_Core::text_filter( $excerpt, $this->get_current_language(), WPGlobus::RETURN_EMPTY );
|
142 |
+
|
143 |
+
return $excerpt;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Redirect.
|
148 |
+
*
|
149 |
+
* @param string $location
|
150 |
+
* @param int $post_id Post ID - Unused.
|
151 |
+
*
|
152 |
+
* @return string
|
153 |
+
*/
|
154 |
+
public function on__redirect(
|
155 |
+
$location, /** @noinspection PhpUnusedParameterInspection */
|
156 |
+
$post_id
|
157 |
+
) {
|
158 |
+
/**
|
159 |
+
* Tested with:
|
160 |
+
* - Page Builder by SiteOrigin OK.
|
161 |
+
*/
|
162 |
+
return $location . '&language=' . $this->language;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Getter.
|
167 |
+
*
|
168 |
+
* @return null|string
|
169 |
+
*/
|
170 |
+
public function get_id() {
|
171 |
+
return $this->id;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Is this a "builder" post?
|
176 |
+
*
|
177 |
+
* @return bool
|
178 |
+
* @todo Unused?
|
179 |
+
*/
|
180 |
+
public function is_builder_post() {
|
181 |
+
if ( is_null( $this->builder_post ) ) {
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
|
185 |
+
return true;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Get hidden "wpglobus-language" field.
|
190 |
+
*
|
191 |
+
* @since 1.9.17
|
192 |
+
* @return string
|
193 |
+
*/
|
194 |
+
public function get_language_field() {
|
195 |
+
/**
|
196 |
+
* @see on_add_devmode_switcher() in wpglobus\includes\class-wpglobus.php
|
197 |
+
* @todo may be add special function to get hidden language field.
|
198 |
+
*/
|
199 |
+
return '<input type="hidden" id="' . esc_attr( WPGlobus::get_language_meta_key() ) . '" name="' . esc_attr( WPGlobus::get_language_meta_key() ) . '" value="' . esc_attr( $this->get_current_language() ) . '" />';
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Return current language.
|
204 |
+
*
|
205 |
+
* @since 1.9.17
|
206 |
+
* @return string
|
207 |
+
*/
|
208 |
+
public function get_current_language() {
|
209 |
+
return $this->language;
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Set current language.
|
214 |
+
*
|
215 |
+
* @since 1.9.17
|
216 |
+
* @return void
|
217 |
+
*/
|
218 |
+
public function set_current_language() {
|
219 |
+
|
220 |
+
if ( ! is_null( $this->language ) ) {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Don't duplicate the defining of current language.
|
226 |
+
* Let's just get it from WPGlobus::Config()->builder.
|
227 |
+
*/
|
228 |
+
$language = WPGlobus::Config()->builder->get_language();
|
229 |
+
|
230 |
+
if ( $language ) {
|
231 |
+
// Language was set in WPGlobus_Config_Builder class.
|
232 |
+
$this->language = $language;
|
233 |
+
}
|
234 |
+
|
235 |
+
$post_id = 0;
|
236 |
+
if ( ! empty( $_REQUEST['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
237 |
+
$post_id = (int) $_REQUEST['post'];
|
238 |
+
} elseif ( ! empty( $_REQUEST['id'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
239 |
+
$post_id = (int) $_REQUEST['id'];
|
240 |
+
} elseif ( ! empty( $_REQUEST['post_ID'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
241 |
+
$post_id = (int) $_REQUEST['post_ID'];
|
242 |
+
}
|
243 |
+
|
244 |
+
if ( $post_id && ! is_null( $this->language ) ) {
|
245 |
+
update_post_meta( $post_id, WPGlobus::Config()->builder->get_language_meta_key(), $this->language );
|
246 |
+
}
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Show language tabs on post.php page.
|
252 |
+
*
|
253 |
+
* @see_file includes\class-wpglobus.php
|
254 |
+
*
|
255 |
+
* @param bool $value
|
256 |
+
*
|
257 |
+
* @return bool
|
258 |
+
*/
|
259 |
+
public function filter__show_language_tabs(
|
260 |
+
/** @noinspection PhpUnusedParameterInspection */
|
261 |
+
$value
|
262 |
+
) {
|
263 |
+
|
264 |
+
global $pagenow;
|
265 |
+
|
266 |
+
$classes = array();
|
267 |
+
$classes['wpglobus-post-tab'] = 'wpglobus-post-tab';
|
268 |
+
$classes['ui-state-default'] = 'ui-state-default';
|
269 |
+
$classes['ui-corner-top'] = 'ui-corner-top';
|
270 |
+
$classes['ui-tabs-active'] = 'ui-tabs-active';
|
271 |
+
$classes['ui-tabs-loading'] = 'ui-tabs-loading';
|
272 |
+
|
273 |
+
$link_class = array();
|
274 |
+
$link_style = array();
|
275 |
+
$link_title = '';
|
276 |
+
if ( 'post-new.php' === $pagenow ) {
|
277 |
+
$link_style['cursor'] = 'cursor:not-allowed';
|
278 |
+
$link_title = esc_html__( 'Save draft before using extra language.', 'wpglobus' );
|
279 |
+
}
|
280 |
+
|
281 |
+
?>
|
282 |
+
<ul class="wpglobus-post-body-tabs-list">
|
283 |
+
<?php
|
284 |
+
$order = 0;
|
285 |
+
|
286 |
+
$get_array = $_GET; // phpcs:ignore WordPress.CSRF.NonceVerification
|
287 |
+
/**
|
288 |
+
* Unset unneeded elements.
|
289 |
+
*/
|
290 |
+
unset( $get_array['language'] );
|
291 |
+
unset( $get_array['message'] );
|
292 |
+
|
293 |
+
foreach ( WPGlobus::Config()->open_languages as $language ) {
|
294 |
+
|
295 |
+
$tab_suffix = WPGlobus::Config()->default_language === $language ? 'default' : $language;
|
296 |
+
|
297 |
+
$_classes = $classes;
|
298 |
+
|
299 |
+
$_link_class = $link_class;
|
300 |
+
$_link_style = $link_style;
|
301 |
+
|
302 |
+
if ( 'post-new.php' === $pagenow && WPGLobus::Config()->default_language === $language ) {
|
303 |
+
$_link_style['cursor'] = '';
|
304 |
+
}
|
305 |
+
|
306 |
+
$_link_class['tab-link-active'] = WPGlobus::Config()->builder->get_language() === $language ? 'wpglobus-tab-link-active' : '';
|
307 |
+
|
308 |
+
if ( $language === $this->language ) {
|
309 |
+
$_classes[] = 'ui-state-active';
|
310 |
+
}
|
311 |
+
|
312 |
+
$link = add_query_arg( array_merge( $get_array, array( 'language' => $language ) ), admin_url( $pagenow ) );
|
313 |
+
$_link_title = '';
|
314 |
+
if ( 'post-new.php' === $pagenow && WPGLobus::Config()->default_language !== $language ) {
|
315 |
+
$link = '#';
|
316 |
+
$_link_title = $link_title;
|
317 |
+
}
|
318 |
+
?>
|
319 |
+
<li id="link-tab-<?php echo esc_attr( $tab_suffix ); ?>"
|
320 |
+
data-language="<?php echo esc_attr( $language ); ?>"
|
321 |
+
data-order="<?php echo esc_attr( $order ); ?>"
|
322 |
+
class="<?php echo esc_attr( implode( ' ', $_classes ) ); ?>">
|
323 |
+
<!--<a href="#tab-<?php echo esc_attr( $tab_suffix ); ?>"><?php echo esc_html( WPGlobus::Config()->en_language_name[ $language ] ); ?></a>-->
|
324 |
+
<a style="<?php echo esc_attr( implode( ';', $_link_style ) ); ?>"
|
325 |
+
title="<?php echo esc_attr( $_link_title ); ?>"
|
326 |
+
class="<?php echo esc_attr( implode( ' ', $_link_class ) ); ?>"
|
327 |
+
href="<?php echo esc_url( $link ); ?>"><?php echo esc_html( WPGlobus::Config()->en_language_name[ $language ] ); ?></a>
|
328 |
+
</li>
|
329 |
+
<?php
|
330 |
+
$order++;
|
331 |
+
}
|
332 |
+
?>
|
333 |
+
</ul>
|
334 |
+
<?php
|
335 |
+
/**
|
336 |
+
* Return false to prevent output standard WPGlobus tabs.
|
337 |
+
*/
|
338 |
+
return false;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Add class to body in admin.
|
343 |
+
*
|
344 |
+
* @see admin_body_class filter
|
345 |
+
*
|
346 |
+
* @since 1.9.17
|
347 |
+
*
|
348 |
+
* @param string $classes
|
349 |
+
*
|
350 |
+
* @return string
|
351 |
+
*/
|
352 |
+
public function filter__add_admin_body_class( $classes ) {
|
353 |
+
return $classes . ' wpglobus-wp-admin-builder wpglobus-wp-admin-builder-' . $this->id;
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Add builder label to admin bar.
|
358 |
+
*
|
359 |
+
* @since 1.9.27
|
360 |
+
*
|
361 |
+
* @param WP_Admin_Bar $wp_admin_bar
|
362 |
+
*/
|
363 |
+
public function on__admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) {
|
364 |
+
|
365 |
+
global $pagenow;
|
366 |
+
|
367 |
+
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php', 'term.php' ), true ) ) {
|
368 |
+
return;
|
369 |
+
}
|
370 |
+
|
371 |
+
$_builder_label = esc_html__( 'Builder', 'wpglobus' ) . ': ';
|
372 |
+
if ( class_exists( 'WPGlobus_Builders' ) ) {
|
373 |
+
$_builder = WPGlobus_Builders::get_addon( $this->id );
|
374 |
+
|
375 |
+
if ( ! empty( $_builder['admin_bar_label'] ) ) {
|
376 |
+
$_builder_label = $_builder['admin_bar_label'] . ': ';
|
377 |
+
}
|
378 |
+
if ( empty( $_builder['admin_bar_builder_label'] ) ) {
|
379 |
+
$_builder_label .= $_builder['plugin_name'];
|
380 |
+
} else {
|
381 |
+
$_builder_label .= $_builder['admin_bar_builder_label'];
|
382 |
+
}
|
383 |
+
} else {
|
384 |
+
$_builder_label .= $this->id;
|
385 |
+
}
|
386 |
+
|
387 |
+
$wp_admin_bar->add_menu(
|
388 |
+
array(
|
389 |
+
'id' => 'wpglobus-builder-id',
|
390 |
+
'parent' => 'top-secondary',
|
391 |
+
'title' => '<span class="ab-label">' . $_builder_label . '</span>',
|
392 |
+
)
|
393 |
+
);
|
394 |
+
|
395 |
+
$_title = esc_html__( 'Сompatibility Settings', 'wpglobus' );
|
396 |
+
|
397 |
+
$_url = admin_url(
|
398 |
+
add_query_arg(
|
399 |
+
array(
|
400 |
+
'page' => 'wpglobus_options',
|
401 |
+
'tab' => 'compatibility',
|
402 |
+
),
|
403 |
+
'admin.php'
|
404 |
+
)
|
405 |
+
);
|
406 |
+
|
407 |
+
$wp_admin_bar->add_menu(
|
408 |
+
array(
|
409 |
+
'parent' => 'wpglobus-builder-id',
|
410 |
+
'id' => 'wpglobus-builder-compatibility-link',
|
411 |
+
'title' => '<span>' . $_title . '</span>',
|
412 |
+
'href' => $_url,
|
413 |
+
'meta' => array(
|
414 |
+
'_target' => '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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-builders.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Elementor.
|
11 |
+
* @since 2.4.11
|
12 |
+
*/
|
13 |
+
use Elementor\Modules\Gutenberg;
|
14 |
+
|
15 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
+
exit; // Exit if accessed directly.
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Class WPGlobus_Builders.
|
21 |
+
*/
|
22 |
+
if ( ! class_exists( 'WPGlobus_Builders' ) ) :
|
23 |
+
|
24 |
+
class WPGlobus_Builders {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @var array
|
28 |
+
*/
|
29 |
+
protected static $attrs = array();
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected static $admin_attrs = array();
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @var array
|
38 |
+
*/
|
39 |
+
protected static $add_on = array();
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @var string
|
43 |
+
* @since 2.2.11
|
44 |
+
*/
|
45 |
+
protected static $post_type = null;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @var array
|
49 |
+
* @since 2.2.24
|
50 |
+
*/
|
51 |
+
protected static $init_attrs = null;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
public static function get_addons() {
|
57 |
+
|
58 |
+
if ( ! empty( self::$add_on ) ) {
|
59 |
+
return self::$add_on;
|
60 |
+
}
|
61 |
+
|
62 |
+
global $wp_version;
|
63 |
+
|
64 |
+
self::$add_on['gutenberg'] = array(
|
65 |
+
'id' => 'gutenberg',
|
66 |
+
'role' => 'builder',
|
67 |
+
'admin_bar_label' => version_compare( $wp_version, '4.9.99', '>' ) ? 'Core' : 'Builder',
|
68 |
+
'supported_min_version' => '4.0.0',
|
69 |
+
'const' => 'GUTENBERG_VERSION',
|
70 |
+
'plugin_name' => 'Gutenberg',
|
71 |
+
'admin_bar_builder_label' => '',
|
72 |
+
'plugin_uri' => 'https://github.com/WordPress/gutenberg',
|
73 |
+
'path' => 'gutenberg/gutenberg.php',
|
74 |
+
'stage' => 'production',
|
75 |
+
);
|
76 |
+
|
77 |
+
self::$add_on['js_composer'] = array(
|
78 |
+
'id' => 'js_composer',
|
79 |
+
'role' => 'builder',
|
80 |
+
'supported_min_version' => '5.4.0',
|
81 |
+
'const' => 'WPB_VC_VERSION',
|
82 |
+
'plugin_name' => 'WPBakery Page Builder',
|
83 |
+
'admin_bar_builder_label' => 'WPBakery PB',
|
84 |
+
'plugin_uri' => 'https://wpbakery.com/',
|
85 |
+
'path' => 'js_composer/js_composer.php',
|
86 |
+
'stage' => 'production',
|
87 |
+
);
|
88 |
+
|
89 |
+
self::$add_on['elementor'] = array(
|
90 |
+
'id' => 'elementor',
|
91 |
+
'role' => 'builder',
|
92 |
+
'supported_min_version' => '2.5.14',
|
93 |
+
'const' => 'ELEMENTOR_VERSION',
|
94 |
+
'plugin_name' => 'Elementor',
|
95 |
+
'plugin_uri' => 'https://wordpress.org/plugins/elementor/',
|
96 |
+
'path' => 'elementor/elementor.php',
|
97 |
+
'stage' => 'beta',
|
98 |
+
'beta_version' => '3',
|
99 |
+
);
|
100 |
+
|
101 |
+
if ( file_exists( WP_PLUGIN_DIR . '/wordpress-seo-premium/wp-seo-premium.php' ) ) {
|
102 |
+
|
103 |
+
self::$add_on['yoast_seo'] = array(
|
104 |
+
'id' => 'yoast_seo',
|
105 |
+
'role' => 'builder',
|
106 |
+
'admin_bar_label' => 'Add-on',
|
107 |
+
'supported_min_version' => '7.7',
|
108 |
+
'const' => 'WPSEO_VERSION',
|
109 |
+
'plugin_name' => 'Yoast SEO Premium',
|
110 |
+
'plugin_uri' => 'https://yoast.com/wordpress/plugins/seo/',
|
111 |
+
'path' => 'wordpress-seo-premium/wp-seo-premium.php',
|
112 |
+
'stage' => 'production',
|
113 |
+
);
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @since 2.3.11
|
119 |
+
*/
|
120 |
+
$_file = 'wordpress-seo/wp-seo.php';
|
121 |
+
$_plugin_name = 'Yoast SEO';
|
122 |
+
if ( defined( 'WPGLOBUS_YOAST_PLUGIN_FILE' ) ) {
|
123 |
+
$_file = WPGLOBUS_YOAST_PLUGIN_FILE;
|
124 |
+
$_plugin_name = 'Yoast SEO('.$_file.')';
|
125 |
+
}
|
126 |
+
|
127 |
+
if ( file_exists( WP_PLUGIN_DIR . '/' . $_file ) ) {
|
128 |
+
|
129 |
+
if ( ! defined( 'WPSEO_PREMIUM_PLUGIN_FILE' ) ) {
|
130 |
+
|
131 |
+
self::$add_on['yoast_seo'] = array(
|
132 |
+
'id' => 'yoast_seo',
|
133 |
+
'role' => 'builder',
|
134 |
+
'admin_bar_label' => 'Add-on',
|
135 |
+
'supported_min_version' => '7.7',
|
136 |
+
'const' => 'WPSEO_VERSION',
|
137 |
+
'plugin_name' => $_plugin_name,
|
138 |
+
'plugin_uri' => 'https://wordpress.org/plugins/wordpress-seo/',
|
139 |
+
'path' => $_file,
|
140 |
+
'stage' => 'production',
|
141 |
+
);
|
142 |
+
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
self::$add_on['woocommerce'] = array(
|
147 |
+
'id' => 'woocommerce',
|
148 |
+
'role' => 'add-on',
|
149 |
+
'config_file' => 'woocommerce.json',
|
150 |
+
'supported_min_version' => '3.5.1',
|
151 |
+
'const' => 'WC_PLUGIN_FILE',
|
152 |
+
'plugin_name' => 'WooCommerce',
|
153 |
+
'plugin_uri' => 'https://woocommerce.com',
|
154 |
+
'path' => 'woocommerce/woocommerce.php',
|
155 |
+
'stage' => 'production',
|
156 |
+
);
|
157 |
+
|
158 |
+
/**
|
159 |
+
* @since 2.3.0
|
160 |
+
*/
|
161 |
+
self::$add_on['pods'] = array(
|
162 |
+
'id' => 'pods',
|
163 |
+
'role' => 'builder',
|
164 |
+
'admin_bar_label' => 'Add-on',
|
165 |
+
'config_file' => 'pods.json',
|
166 |
+
'supported_min_version' => '2.7.16',
|
167 |
+
'const' => 'PODS_VERSION',
|
168 |
+
'plugin_name' => 'Pods-Custom Content Types and Fields',
|
169 |
+
'plugin_uri' => 'https://wordpress.org/plugins/pods/',
|
170 |
+
'path' => 'pods/init.php',
|
171 |
+
'stage' => 'production',
|
172 |
+
'admin_bar_builder_label' => 'Pods',
|
173 |
+
);
|
174 |
+
|
175 |
+
/**
|
176 |
+
* @since 2.4.3
|
177 |
+
*/
|
178 |
+
self::$add_on['rank_math_seo'] = array(
|
179 |
+
'id' => 'rank_math_seo',
|
180 |
+
'role' => 'builder',
|
181 |
+
'admin_bar_label' => 'Add-on',
|
182 |
+
'config_file' => 'rank-math-seo.json',
|
183 |
+
'supported_min_version' => '1.0.42',
|
184 |
+
'const' => 'RANK_MATH_VERSION',
|
185 |
+
'plugin_name' => 'Rank Math SEO',
|
186 |
+
'plugin_uri' => 'https://wordpress.org/plugins/seo-by-rank-math/',
|
187 |
+
'path' => 'seo-by-rank-math/rank-math.php',
|
188 |
+
'stage' => 'beta',
|
189 |
+
'admin_bar_builder_label' => 'Rank Math SEO',
|
190 |
+
);
|
191 |
+
|
192 |
+
/**
|
193 |
+
* self::$add_on['wp-subtitle'] = array(
|
194 |
+
* 'id' => 'wp-subtitle',
|
195 |
+
* 'role' => 'add-on',
|
196 |
+
* 'config_file' => 'wp-subtitle.json',
|
197 |
+
* 'supported_min_version' => '3.1',
|
198 |
+
* 'const' => 'WPSUBTITLE_DIR',
|
199 |
+
* 'plugin_name' => 'WP Subtitle',
|
200 |
+
* 'plugin_uri' => 'http://wordpress.org/plugins/wp-subtitle/',
|
201 |
+
* 'path' => 'wp-subtitle/wp-subtitle.php',
|
202 |
+
* 'stage' => 'production',
|
203 |
+
* );
|
204 |
+
* // */
|
205 |
+
|
206 |
+
/**
|
207 |
+
* self::$add_on['__test'] = array(
|
208 |
+
* 'id' => '__test',
|
209 |
+
* 'supported_min_version' => '1.0',
|
210 |
+
* 'const' => '__TEST_VERSION',
|
211 |
+
* 'plugin_name' => 'Test Add-on',
|
212 |
+
* 'plugin_uri' => '',
|
213 |
+
* 'path' => 'test-add-on/test-add-on.php',
|
214 |
+
* );
|
215 |
+
* // */
|
216 |
+
|
217 |
+
return self::$add_on;
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* @param bool $builder
|
222 |
+
*
|
223 |
+
* @return false|array
|
224 |
+
*/
|
225 |
+
public static function get_addon( $builder = false ) {
|
226 |
+
if ( ! $builder ) {
|
227 |
+
return false;
|
228 |
+
}
|
229 |
+
if ( isset( self::$add_on[ $builder ] ) ) {
|
230 |
+
return self::$add_on[ $builder ];
|
231 |
+
}
|
232 |
+
|
233 |
+
return false;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* @param bool $init
|
238 |
+
* @param array $init_attrs added @since 2.2.24
|
239 |
+
*
|
240 |
+
* @return array|bool
|
241 |
+
*/
|
242 |
+
public static function get( $init = true, $init_attrs = array() ) {
|
243 |
+
|
244 |
+
// if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
245 |
+
//return false;
|
246 |
+
// }
|
247 |
+
|
248 |
+
/**
|
249 |
+
* @since 2.2.26
|
250 |
+
*/
|
251 |
+
if ( empty($init_attrs) ) {
|
252 |
+
return false;
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* @since 2.2.24
|
257 |
+
*/
|
258 |
+
self::$init_attrs = $init_attrs;
|
259 |
+
|
260 |
+
/**
|
261 |
+
* @since 2.2.24
|
262 |
+
*/
|
263 |
+
$post_types = $init_attrs['post_types'];
|
264 |
+
|
265 |
+
/** @global string $pagenow */
|
266 |
+
global $pagenow;
|
267 |
+
|
268 |
+
self::$attrs = array(
|
269 |
+
'id' => false,
|
270 |
+
'context' => 'add-on',
|
271 |
+
'version' => '',
|
272 |
+
'class' => '',
|
273 |
+
'post_type' => '',
|
274 |
+
'post_id' => '',
|
275 |
+
'is_admin' => true,
|
276 |
+
'pagenow' => $pagenow,
|
277 |
+
'builder_page' => false,
|
278 |
+
'doing_ajax' => WPGlobus_WP::is_doing_ajax(),
|
279 |
+
'language' => '',
|
280 |
+
'message' => '',
|
281 |
+
'ajax_actions' => '',
|
282 |
+
'builder_support' => true, // @since 2.4.12
|
283 |
+
);
|
284 |
+
|
285 |
+
self::$admin_attrs = array(
|
286 |
+
'multilingualFields' => array( 'post_title', 'excerpt' ),
|
287 |
+
'translatableClass' => 'wpglobus-translatable',
|
288 |
+
);
|
289 |
+
|
290 |
+
/**
|
291 |
+
* @since 2.2.11
|
292 |
+
*/
|
293 |
+
if ( in_array( $pagenow, array('post.php', 'post-new.php', 'media-new.php') ) ) {
|
294 |
+
|
295 |
+
/**
|
296 |
+
* @W.I.P @since 2.2.14
|
297 |
+
* if ( in_array( $pagenow, array('post.php', 'post-new.php', 'media-new.php', 'admin-ajax.php') ) ) {
|
298 |
+
*/
|
299 |
+
$post_type = self::get_post_type_2();
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Filter for post types.
|
303 |
+
*
|
304 |
+
* @since 2.2.11
|
305 |
+
*
|
306 |
+
* @param array $post_types Array of post types.
|
307 |
+
* @param string $post_type Current post type.
|
308 |
+
*
|
309 |
+
* @return array
|
310 |
+
*/
|
311 |
+
$post_types = apply_filters( 'wpglobus_builders_post_types', $post_types, $post_type );
|
312 |
+
|
313 |
+
if ( ! array_key_exists( $post_type, $post_types ) ) {
|
314 |
+
return self::$attrs;
|
315 |
+
} else if ( ! $post_types[$post_type] ) {
|
316 |
+
return self::$attrs;
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
320 |
+
if ( $init ) {
|
321 |
+
|
322 |
+
//$builder = false;
|
323 |
+
|
324 |
+
self::get_addons();
|
325 |
+
|
326 |
+
/**
|
327 |
+
* @since 1.9.17
|
328 |
+
*/
|
329 |
+
$builder = self::is_gutenberg();
|
330 |
+
if ( $builder && $builder['builder_page'] ) {
|
331 |
+
return $builder;
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* JS Composer.
|
336 |
+
*
|
337 |
+
* @since 1.9.17
|
338 |
+
* @since 2.2.3 Start js_composer as a builder.
|
339 |
+
*/
|
340 |
+
if ( ! $builder || ! $builder['builder_page'] ) {
|
341 |
+
$builder = self::is_js_composer();
|
342 |
+
if ( $builder && $builder['builder_page'] ) {
|
343 |
+
return $builder;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* Elementor.
|
349 |
+
*
|
350 |
+
* @since 1.9.17
|
351 |
+
*/
|
352 |
+
if ( ! $builder || ! $builder['builder_page'] ) {
|
353 |
+
$builder = self::is_elementor();
|
354 |
+
if ( $builder ) {
|
355 |
+
if ( $builder['is_admin'] ) {
|
356 |
+
if ( $builder['builder_page'] ) {
|
357 |
+
return $builder;
|
358 |
+
}
|
359 |
+
} else {
|
360 |
+
/** @noinspection PhpIncludeInspection */
|
361 |
+
include_once WPGlobus::$PLUGIN_DIR_PATH . 'includes/builders/elementor/class-wpglobus-elementor-front.php';
|
362 |
+
WPGlobus_Elementor_Front::init( $builder );
|
363 |
+
}
|
364 |
+
}
|
365 |
+
}
|
366 |
+
|
367 |
+
/**
|
368 |
+
* @since 1.9.17
|
369 |
+
* @W.I.P
|
370 |
+
*/
|
371 |
+
/*
|
372 |
+
$builder = self::is_siteorigin_panels();
|
373 |
+
if ( $builder ) {
|
374 |
+
return $builder;
|
375 |
+
}
|
376 |
+
// */
|
377 |
+
|
378 |
+
/**
|
379 |
+
* @since 1.9.17
|
380 |
+
*/
|
381 |
+
if ( ! $builder || ! $builder['builder_page'] ) {
|
382 |
+
$builder = self::is_yoast_seo();
|
383 |
+
if ( $builder && $builder['builder_page'] ) {
|
384 |
+
return $builder;
|
385 |
+
}
|
386 |
+
}
|
387 |
+
|
388 |
+
/**
|
389 |
+
* Pods – Custom Content Types and Fields.
|
390 |
+
*
|
391 |
+
* @since 2.3.0
|
392 |
+
*/
|
393 |
+
if ( ! $builder || ! $builder['builder_page'] ) {
|
394 |
+
$builder = self::is_pods();
|
395 |
+
if ( $builder && $builder['builder_page'] ) {
|
396 |
+
return $builder;
|
397 |
+
}
|
398 |
+
|
399 |
+
}
|
400 |
+
|
401 |
+
/**
|
402 |
+
* Rank Math SEO.
|
403 |
+
*
|
404 |
+
* @since 2.4.3
|
405 |
+
*/
|
406 |
+
if ( ! $builder || ! $builder['builder_page'] ) {
|
407 |
+
$builder = self::is_rank_math_seo();
|
408 |
+
if ( $builder && $builder['builder_page'] ) {
|
409 |
+
return $builder;
|
410 |
+
}
|
411 |
+
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
return self::$attrs;
|
416 |
+
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Page Builder by SiteOrigin.
|
421 |
+
* @W.I.P
|
422 |
+
* https://wordpress.org/plugins/siteorigin-panels/
|
423 |
+
*/
|
424 |
+
protected static function is_siteorigin_panels() {}
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Elementor Page Builder.
|
428 |
+
* https://wordpress.org/plugins/elementor/
|
429 |
+
*/
|
430 |
+
protected static function is_elementor() {
|
431 |
+
|
432 |
+
if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
|
433 |
+
return false;
|
434 |
+
}
|
435 |
+
|
436 |
+
$__builder = self::get_addon( 'elementor' );
|
437 |
+
|
438 |
+
if ( ! $__builder ) {
|
439 |
+
return false;
|
440 |
+
}
|
441 |
+
|
442 |
+
/** @global string $pagenow */
|
443 |
+
global $pagenow;
|
444 |
+
|
445 |
+
$load_elementor = false;
|
446 |
+
|
447 |
+
if ( version_compare( ELEMENTOR_VERSION, $__builder['supported_min_version'], '<' ) ) {
|
448 |
+
|
449 |
+
$message = 'Unsupported Elementor version.';
|
450 |
+
|
451 |
+
$_attrs = array(
|
452 |
+
'id' => 'elementor',
|
453 |
+
'version' => ELEMENTOR_VERSION,
|
454 |
+
'class' => 'WPGlobus_Elementor',
|
455 |
+
'is_admin' => false,
|
456 |
+
'builder_page' => false,
|
457 |
+
'message' => $message,
|
458 |
+
);
|
459 |
+
|
460 |
+
$attrs = self::get_attrs( $_attrs );
|
461 |
+
|
462 |
+
return $attrs;
|
463 |
+
|
464 |
+
} else {
|
465 |
+
|
466 |
+
if ( in_array( $pagenow, array( 'admin-ajax.php', 'post.php', 'index.php', 'post-new.php' ), true ) ) {
|
467 |
+
|
468 |
+
/**
|
469 |
+
* Init current post type.
|
470 |
+
*/
|
471 |
+
$post_type = is_null(self::$post_type) ? '' : self::$post_type;
|
472 |
+
|
473 |
+
/**
|
474 |
+
* Init post ID.
|
475 |
+
*/
|
476 |
+
$post_id = '';
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Init `builder_support`.
|
480 |
+
* @since 2.4.12
|
481 |
+
*/
|
482 |
+
$builder_support = true;
|
483 |
+
|
484 |
+
$ajax_actions = '';
|
485 |
+
$is_admin = true;
|
486 |
+
|
487 |
+
if ( 'admin-ajax.php' === $pagenow ) {
|
488 |
+
|
489 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
490 |
+
if ( ! isset( $_REQUEST['action'] ) || 'elementor_ajax' !== $_REQUEST['action'] ) {
|
491 |
+
return false;
|
492 |
+
}
|
493 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
494 |
+
if ( false !== strpos( $_REQUEST['actions'], 'save_builder' ) ) {
|
495 |
+
$ajax_actions = 'save_builder';
|
496 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
497 |
+
} elseif ( false !== strpos( $_REQUEST['actions'], '"action":"render_widget"' ) ) {
|
498 |
+
$ajax_actions = 'render_widget';
|
499 |
+
} else {
|
500 |
+
return false;
|
501 |
+
}
|
502 |
+
$load_elementor = true;
|
503 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
504 |
+
$post_id = sanitize_text_field( $_REQUEST['editor_post_id'] );
|
505 |
+
|
506 |
+
} elseif ( 'index.php' === $pagenow ) {
|
507 |
+
|
508 |
+
/**
|
509 |
+
* @todo remove after testing.
|
510 |
+
* if ( ! isset( $_GET['elementor-preview'] ) ) {
|
511 |
+
* return false;
|
512 |
+
* }
|
513 |
+
* // */
|
514 |
+
// @W.I.P @since 2.2.11
|
515 |
+
// [REQUEST_URI] => /?p=75&elementor-preview=75&ver=1561202861
|
516 |
+
|
517 |
+
$load_elementor = false;
|
518 |
+
$is_admin = false;
|
519 |
+
$builder_support = null; // @since 2.4.12
|
520 |
+
|
521 |
+
/**
|
522 |
+
* @todo Preview page for draft status.
|
523 |
+
* [REQUEST_URI] => /?p=75&elementor-preview=75&ver=1561202861
|
524 |
+
* @W.I.P
|
525 |
+
* @since 2.2.11 [REQUEST_URI] was changed to `?p=75&preview_id=75&preview_nonce=da660129a7&preview=true`.
|
526 |
+
*/
|
527 |
+
/*
|
528 |
+
if ( ! empty( $_GET['p'] ) ) {
|
529 |
+
$load_elementor = true;
|
530 |
+
$is_admin = true;
|
531 |
+
$post_id = sanitize_text_field( $_GET['p'] );
|
532 |
+
$post_type = self::get_post_type($post_id);
|
533 |
+
|
534 |
+
}
|
535 |
+
// */
|
536 |
+
|
537 |
+
} elseif ( 'post.php' === $pagenow ) {
|
538 |
+
|
539 |
+
$is_admin = true;
|
540 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
541 |
+
if ( isset( $_GET['action'] ) && 'elementor' === $_GET['action'] ) {
|
542 |
+
//$is_admin = false;
|
543 |
+
$load_elementor = true;
|
544 |
+
}
|
545 |
+
|
546 |
+
/**
|
547 |
+
* $cpt_support = get_option( 'elementor_cpt_support', array('page', 'post') );
|
548 |
+
*
|
549 |
+
* @see_file elementor\includes\plugin.php
|
550 |
+
*/
|
551 |
+
$cpt_support = get_option( 'elementor_cpt_support', array( 'page', 'post' ) );
|
552 |
+
|
553 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
554 |
+
if ( empty( $post_type ) && isset( $_GET['post_type'] ) ) {
|
555 |
+
/**
|
556 |
+
* For post-new.php page.
|
557 |
+
*/
|
558 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
559 |
+
$post_type = sanitize_text_field( $_GET['post_type'] );
|
560 |
+
}
|
561 |
+
|
562 |
+
if ( empty( $post_type ) ) {
|
563 |
+
// phpcs:ignore WordPress.CSRF.NonceVerification
|
564 |
+
if ( isset( $_GET['post'] ) ) {
|
565 |
+
$post_type = self::get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
566 |
+
} elseif ( isset( $_REQUEST['post_ID'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
567 |
+
$post_type = self::get_post_type( $_REQUEST['post_ID'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
568 |
+
}
|
569 |
+
}
|
570 |
+
|
571 |
+
/**
|
572 |
+
* @since 2.4.12
|
573 |
+
*/
|
574 |
+
if ( isset( $_GET['post'] ) ) {
|
575 |
+
$post_id = sanitize_text_field( $_GET['post'] );
|
576 |
+
}
|
577 |
+
|
578 |
+
// if ( empty( $post_type ) ) {
|
579 |
+
/**
|
580 |
+
* Post type by default.
|
581 |
+
* If we can not define post type then we don't set it to default value.
|
582 |
+
* Because it may cause incorrect behavior later.
|
583 |
+
*/
|
584 |
+
//$post_type = 'post';
|
585 |
+
// }
|
586 |
+
|
587 |
+
if ( in_array( $post_type, $cpt_support, true ) ) {
|
588 |
+
$load_elementor = true;
|
589 |
+
}
|
590 |
+
|
591 |
+
/**
|
592 |
+
* @since 2.4.12
|
593 |
+
*/
|
594 |
+
if ( $load_elementor ) {
|
595 |
+
|
596 |
+
if ( ! empty($post_id) && (int) $post_id > 0 ) {
|
597 |
+
|
598 |
+
$wpglobus_elementor_support = get_post_meta( $post_id, '_wpglobus_elementor_support', true );
|
599 |
+
if ( 'off' === $wpglobus_elementor_support ) {
|
600 |
+
$builder_support = false;
|
601 |
+
}
|
602 |
+
|
603 |
+
if ( $builder_support ) {
|
604 |
+
|
605 |
+
$elementor_edit_mode = get_post_meta( $post_id, '_elementor_edit_mode', true );
|
606 |
+
|
607 |
+
if ( 'builder' !== $elementor_edit_mode ) {
|
608 |
+
/**
|
609 |
+
* Disable elementor support for post, that doesn't use elementor builder.
|
610 |
+
*/
|
611 |
+
$builder_support = false;
|
612 |
+
}
|
613 |
+
}
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
} else {
|
618 |
+
/**
|
619 |
+
* @todo may be use @see is_built_with_elementor() in elementor\core\base\document.php
|
620 |
+
*/
|
621 |
+
$load_elementor = true;
|
622 |
+
}
|
623 |
+
|
624 |
+
$_attrs = array(
|
625 |
+
'id' => 'elementor',
|
626 |
+
'version' => ELEMENTOR_VERSION,
|
627 |
+
'is_admin' => $is_admin,
|
628 |
+
'class' => 'WPGlobus_Elementor',
|
629 |
+
'post_type' => $post_type,
|
630 |
+
'post_id' => $post_id,
|
631 |
+
'builder_page' => false,
|
632 |
+
'ajax_actions' => $ajax_actions,
|
633 |
+
'post_css_meta_key' => '_wpglobus_elementor_css',
|
634 |
+
'post_support_meta_key' => '_wpglobus_elementor_support', // @since 2.4.12
|
635 |
+
'elementor_data_meta_key' => '_elementor_data',
|
636 |
+
'elementor_css_meta_key' => '_elementor_css',
|
637 |
+
'elementor_edit_mode_meta_key' => '_elementor_edit_mode', // @since 2.4.12
|
638 |
+
'elementor_css_print_method' => get_option('elementor_css_print_method', 'external'), // @since 2.2.31
|
639 |
+
);
|
640 |
+
|
641 |
+
if ( $load_elementor ) {
|
642 |
+
$_attrs['builder_page'] = true;
|
643 |
+
} else {
|
644 |
+
$_attrs['builder_page'] = false;
|
645 |
+
}
|
646 |
+
|
647 |
+
/**
|
648 |
+
* @since 2.4.12
|
649 |
+
*/
|
650 |
+
$_attrs['builder_support'] = $builder_support;
|
651 |
+
|
652 |
+
$attrs = self::get_attrs( $_attrs );
|
653 |
+
|
654 |
+
return $attrs;
|
655 |
+
}
|
656 |
+
}
|
657 |
+
|
658 |
+
return false;
|
659 |
+
}
|
660 |
+
|
661 |
+
/**
|
662 |
+
* WPBakery Page Builder.
|
663 |
+
* https://wpbakery.com/
|
664 |
+
*/
|
665 |
+
protected static function is_js_composer() {
|
666 |
+
|
667 |
+
if ( ! defined( 'WPB_VC_VERSION' ) ) {
|
668 |
+
return false;
|
669 |
+
}
|
670 |
+
|
671 |
+
/** @global string $pagenow */
|
672 |
+
global $pagenow;
|
673 |
+
|
674 |
+
/** @global wpdb $wpdb */
|
675 |
+
// global $wpdb;
|
676 |
+
|
677 |
+
if ( 'post.php' === $pagenow ) {
|
678 |
+
|
679 |
+
$_builder_page = true;
|
680 |
+
|
681 |
+
/**
|
682 |
+
* @see vc_editor_post_types() (js_composer\include\helpers\helpers_api.php) doesn't work here.
|
683 |
+
* so let's check the roles.
|
684 |
+
*/
|
685 |
+
$_opts = wp_roles()->roles;
|
686 |
+
|
687 |
+
if ( ! function_exists( 'wp_get_current_user' ) ) {
|
688 |
+
/** @noinspection PhpIncludeInspection */
|
689 |
+
require_once ABSPATH . WPINC . '/pluggable.php';
|
690 |
+
}
|
691 |
+
|
692 |
+
$_user = wp_get_current_user();
|
693 |
+
|
694 |
+
$post_id = WPGlobus_Utils::safe_get( 'post' );
|
695 |
+
|
696 |
+
if ( empty( $post_id ) ) {
|
697 |
+
/**
|
698 |
+
* Before update post we can get empty $_GET array.
|
699 |
+
* Let's check $_POST.
|
700 |
+
*/
|
701 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
702 |
+
$post_id = isset( $_POST['post_ID'] ) ? sanitize_text_field( $_POST['post_ID'] ) : '';
|
703 |
+
}
|
704 |
+
|
705 |
+
// if ( empty( $post_id ) ) {
|
706 |
+
// @todo add handling this case.
|
707 |
+
// }
|
708 |
+
|
709 |
+
// $_post_type = $wpdb->get_col( $wpdb->prepare( "SELECT post_type FROM {$wpdb->prefix}posts WHERE ID = %d", $post_id ) );
|
710 |
+
//
|
711 |
+
// $post_type = '';
|
712 |
+
// if ( ! empty( $_post_type[0] ) ) {
|
713 |
+
// $post_type = $_post_type[0];
|
714 |
+
// }
|
715 |
+
|
716 |
+
$post = get_post( $post_id );
|
717 |
+
$post_type = ( $post ? $post->post_type : '' );
|
718 |
+
|
719 |
+
if ( ! isset( $_opts[ $_user->roles[0] ]['capabilities']['vc_access_rules_post_types'] ) ) {
|
720 |
+
/**
|
721 |
+
* WPBakery Page Builder is available for pages only (settings were not saved yet).
|
722 |
+
*/
|
723 |
+
if ( 'page' !== $post_type ) {
|
724 |
+
$_builder_page = false;
|
725 |
+
}
|
726 |
+
} elseif ( empty( $_opts[ $_user->roles[0] ]['capabilities']['vc_access_rules_post_types'] ) ) {
|
727 |
+
/**
|
728 |
+
* Settings exist but set to False, so all post types are disabled in WPBakery Page Builder.
|
729 |
+
*/
|
730 |
+
$_builder_page = false;
|
731 |
+
|
732 |
+
} elseif ( true === $_opts[ $_user->roles[0] ]['capabilities']['vc_access_rules_post_types'] ) {
|
733 |
+
/**
|
734 |
+
* WPBakery Page Builder is available for pages only.
|
735 |
+
*/
|
736 |
+
if ( 'page' !== $post_type ) {
|
737 |
+
$_builder_page = false;
|
738 |
+
}
|
739 |
+
} elseif ( 'custom' === $_opts[ $_user->roles[0] ]['capabilities']['vc_access_rules_post_types'] ) {
|
740 |
+
|
741 |
+
/**
|
742 |
+
* Custom settings for post types in WPBakery Page Builder.
|
743 |
+
*/
|
744 |
+
if ( ! empty( $_opts[ $_user->roles[0] ]['capabilities'][ 'vc_access_rules_post_types/' . $post_type ] ) ) {
|
745 |
+
// Setting for this post type exists and set to True.
|
746 |
+
$_builder_page = true;
|
747 |
+
} else {
|
748 |
+
$_builder_page = false;
|
749 |
+
}
|
750 |
+
} else {
|
751 |
+
$_builder_page = false;
|
752 |
+
}
|
753 |
+
|
754 |
+
$_attrs = array(
|
755 |
+
'id' => 'js_composer',
|
756 |
+
'version' => WPB_VC_VERSION,
|
757 |
+
'class' => 'WPGlobus_JS_Composer',
|
758 |
+
'post_type' => $post_type,
|
759 |
+
'builder_page' => $_builder_page,
|
760 |
+
);
|
761 |
+
|
762 |
+
/**
|
763 |
+
* @since 2.2.11
|
764 |
+
* @W.I.P
|
765 |
+
*/
|
766 |
+
//self::$admin_attrs['multilingualFields'][] = 'wpb_visual_composer';
|
767 |
+
|
768 |
+
$attrs = self::get_attrs( $_attrs );
|
769 |
+
|
770 |
+
return $attrs;
|
771 |
+
|
772 |
+
}
|
773 |
+
|
774 |
+
return false;
|
775 |
+
}
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Gutenberg.
|
779 |
+
*
|
780 |
+
* @since 1.9.17
|
781 |
+
*/
|
782 |
+
protected static function is_gutenberg() {
|
783 |
+
|
784 |
+
$load_gutenberg = false;
|
785 |
+
$message = '';
|
786 |
+
|
787 |
+
/** @global string $pagenow */
|
788 |
+
global $pagenow, $wp_version;
|
789 |
+
|
790 |
+
if ( version_compare( $wp_version, '4.9.99', '>' ) ) {
|
791 |
+
|
792 |
+
$context = 'core';
|
793 |
+
|
794 |
+
/**
|
795 |
+
* @since 2.0
|
796 |
+
*/
|
797 |
+
if ( 'post-new.php' === $pagenow ) {
|
798 |
+
|
799 |
+
/**
|
800 |
+
* Load specific language switcher for this page.
|
801 |
+
*
|
802 |
+
* @see get_switcher_box() in wpglobus\includes\builders\gutenberg\class-wpglobus-gutenberg.php
|
803 |
+
*/
|
804 |
+
//if ( ! isset( $_GET['classic-editor'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
805 |
+
// Start Gutenberg support if classic editor was not requested.
|
806 |
+
//$load_gutenberg = true;
|
807 |
+
//}
|
808 |
+
|
809 |
+
$load_gutenberg = true;
|
810 |
+
|
811 |
+
$load_gutenberg = self::get_3rd_party_status_for_gutenberg( $load_gutenberg );
|
812 |
+
|
813 |
+
} elseif ( 'index.php' === $pagenow ) {
|
814 |
+
|
815 |
+
/**
|
816 |
+
* When Update button was clicked.
|
817 |
+
*/
|
818 |
+
if ( ! is_admin() ) {
|
819 |
+
/**
|
820 |
+
* Gutenberg updates post as from front.
|
821 |
+
*
|
822 |
+
* @see $_SERVER['REQUEST_URI']
|
823 |
+
*/
|
824 |
+
//$actions = array( 'edit' );
|
825 |
+
// @todo check 'wp/v2/' in wp.api.versionString (JS).
|
826 |
+
|
827 |
+
// /wp-json/wp/v2/posts/
|
828 |
+
// /wp-json/wp/v2/pages/
|
829 |
+
/**
|
830 |
+
* We need define post type for correct work.
|
831 |
+
*
|
832 |
+
* @todo check
|
833 |
+
* /wp-json/wp/v2/taxonomies?context=edit
|
834 |
+
* /wp-json/wp/v2/taxonomies?context=edit&_locale=user
|
835 |
+
* /wp-json/wp/v2/types/wp_block?_locale=user
|
836 |
+
* /wp-json/wp/v2/blocks?per_page=100&_locale=user
|
837 |
+
*/
|
838 |
+
|
839 |
+
$_request_uri = explode( '/', $_SERVER['REQUEST_URI'] );
|
840 |
+
$post_id = end( $_request_uri );
|
841 |
+
$post_id = preg_replace( '/\?.*/', '', $post_id );
|
842 |
+
|
843 |
+
/**
|
844 |
+
* @todo @see https://wpglobus.freshdesk.com/a/tickets/4103
|
845 |
+
*/
|
846 |
+
|
847 |
+
/**
|
848 |
+
* @since 2.3.5 Added checking $_request_uri[4].
|
849 |
+
*/
|
850 |
+
$_continue = false;
|
851 |
+
if ( 0 !== (int) $post_id && ! empty($_request_uri[4]) ) {
|
852 |
+
|
853 |
+
$GLOBALS['WPGlobus']['builder'] = 'gutenberg';
|
854 |
+
$GLOBALS['WPGlobus']['context'] = $context;
|
855 |
+
$GLOBALS['WPGlobus']['post_id'] = $post_id;
|
856 |
+
switch ( $_request_uri[4] ) {
|
857 |
+
case 'posts':
|
858 |
+
$post_type = 'post';
|
859 |
+
break;
|
860 |
+
case 'pages':
|
861 |
+
$post_type = 'page';
|
862 |
+
break;
|
863 |
+
default:
|
864 |
+
$post_type = $_request_uri[4];
|
865 |
+
}
|
866 |
+
$GLOBALS['WPGlobus']['post_type'] = $post_type;
|
867 |
+
$_continue = true;
|
868 |
+
}
|
869 |
+
|
870 |
+
if ( false !== strpos( $_SERVER['REQUEST_URI'], 'wp/v2/posts' )
|
871 |
+
|| false !== strpos( $_SERVER['REQUEST_URI'], 'wp/v2/pages' )
|
872 |
+
|| $_continue ) {
|
873 |
+
$load_gutenberg = true;
|
874 |
+
}
|
875 |
+
}
|
876 |
+
} elseif ( 'post.php' === $pagenow ) {
|
877 |
+
|
878 |
+
$load_gutenberg = true;
|
879 |
+
|
880 |
+
$post_type = is_null(self::$post_type) ? '' : self::$post_type;
|
881 |
+
|
882 |
+
/**
|
883 |
+
* Check out $_POST['post_type'] to define post type.
|
884 |
+
*
|
885 |
+
* @since 2.1.6
|
886 |
+
*/
|
887 |
+
if ( empty( $post_type ) && ! empty( $_POST['post_type'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
888 |
+
$post_type = $_POST['post_type']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
889 |
+
}
|
890 |
+
|
891 |
+
if ( empty( $post_type ) && ! empty( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
892 |
+
$post_type = self::get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
893 |
+
}
|
894 |
+
|
895 |
+
/**
|
896 |
+
* @todo don't check post type @since 2.1.2
|
897 |
+
*/
|
898 |
+
// if ( ! in_array( $post_type, array( 'post', 'page' ), true ) ) {
|
899 |
+
// $load_gutenberg = false;
|
900 |
+
// }
|
901 |
+
|
902 |
+
/**
|
903 |
+
* @since 2.2.24
|
904 |
+
*/
|
905 |
+
if ( ! self::use_block_editor_for_post_type($post_type) ) {
|
906 |
+
/**
|
907 |
+
* Don't start Block Editor support.
|
908 |
+
*/
|
909 |
+
return false;
|
910 |
+
|
911 |
+
}
|
912 |
+
|
913 |
+
$load_gutenberg = self::get_3rd_party_status_for_gutenberg( $load_gutenberg, $post_type );
|
914 |
+
|
915 |
+
}
|
916 |
+
|
917 |
+
$_attrs = array(
|
918 |
+
'id' => 'gutenberg',
|
919 |
+
'version' => $wp_version,
|
920 |
+
'class' => 'WPGlobus_Gutenberg',
|
921 |
+
'builder_page' => false,
|
922 |
+
'pagenow' => $pagenow,
|
923 |
+
'post_type' => empty( $post_type ) ? '' : $post_type,
|
924 |
+
'message' => $message,
|
925 |
+
'context' => $context,
|
926 |
+
);
|
927 |
+
|
928 |
+
if ( $load_gutenberg ) {
|
929 |
+
$_attrs['builder_page'] = true;
|
930 |
+
}
|
931 |
+
|
932 |
+
$attrs = self::get_attrs( $_attrs );
|
933 |
+
|
934 |
+
self::$add_on['gutenberg']['admin_bar_builder_label'] = 'Block Editor';
|
935 |
+
|
936 |
+
return $attrs;
|
937 |
+
|
938 |
+
}
|
939 |
+
|
940 |
+
if ( defined( 'GUTENBERG_VERSION' ) ) {
|
941 |
+
|
942 |
+
$__builder = self::get_addon( 'gutenberg' );
|
943 |
+
|
944 |
+
if ( ! $__builder ) {
|
945 |
+
return false;
|
946 |
+
}
|
947 |
+
|
948 |
+
if ( version_compare( GUTENBERG_VERSION, $__builder['supported_min_version'], '<' ) ) {
|
949 |
+
|
950 |
+
$message = 'Unsupported Gutenberg version.';
|
951 |
+
|
952 |
+
} else {
|
953 |
+
|
954 |
+
if ( self::is_gutenberg_ajax() ) {
|
955 |
+
|
956 |
+
$load_gutenberg = true;
|
957 |
+
|
958 |
+
} else {
|
959 |
+
|
960 |
+
if ( 'post-new.php' === $pagenow ) {
|
961 |
+
|
962 |
+
/**
|
963 |
+
* Load specific language switcher for this page.
|
964 |
+
*
|
965 |
+
* @see get_switcher_box() in wpglobus\includes\builders\gutenberg\class-wpglobus-gutenberg.php
|
966 |
+
*/
|
967 |
+
if ( ! isset( $_GET['classic-editor'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
968 |
+
// Start Gutenberg support if classic editor was not requested.
|
969 |
+
$load_gutenberg = true;
|
970 |
+
}
|
971 |
+
|
972 |
+
/**
|
973 |
+
* @since 1.9.30
|
974 |
+
*/
|
975 |
+
$load_gutenberg = self::get_3rd_party_status_for_gutenberg( $load_gutenberg );
|
976 |
+
|
977 |
+
} elseif ( 'index.php' === $pagenow ) {
|
978 |
+
|
979 |
+
/**
|
980 |
+
* When Update button was clicked.
|
981 |
+
*/
|
982 |
+
if ( ! is_admin() ) {
|
983 |
+
/**
|
984 |
+
* Gutenberg updates post as from front.
|
985 |
+
*
|
986 |
+
* @see $_SERVER['REQUEST_URI']
|
987 |
+
*/
|
988 |
+
//$actions = array( 'edit' );
|
989 |
+
// @todo check 'wp/v2/' in wp.api.versionString (JS).
|
990 |
+
|
991 |
+
// /wp-json/wp/v2/posts/
|
992 |
+
// /wp-json/wp/v2/pages/
|
993 |
+
// @todo check /wp-json/wp/v2/taxonomies?context=edit
|
994 |
+
if ( false !== strpos( $_SERVER['REQUEST_URI'], 'wp/v2/posts' )
|
995 |
+
|| false !== strpos( $_SERVER['REQUEST_URI'], 'wp/v2/pages' ) ) {
|
996 |
+
$load_gutenberg = true;
|
997 |
+
}
|
998 |
+
}
|
999 |
+
} elseif ( 'post.php' === $pagenow ) {
|
1000 |
+
|
1001 |
+
$load_gutenberg = true;
|
1002 |
+
|
1003 |
+
$actions = array( 'edit', 'editpost' );
|
1004 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1005 |
+
if ( ! empty( $_GET['action'] ) ) {
|
1006 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1007 |
+
if ( in_array( $_GET['action'], $actions, true ) ) {
|
1008 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1009 |
+
if ( array_key_exists( 'classic-editor', $_GET ) ) {
|
1010 |
+
$load_gutenberg = false;
|
1011 |
+
}
|
1012 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1013 |
+
if ( isset( $_GET['meta_box'] ) && 1 === (int) $_GET['meta_box'] ) {
|
1014 |
+
$load_gutenberg = true;
|
1015 |
+
}
|
1016 |
+
}
|
1017 |
+
} elseif ( ! empty( $_POST['action'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1018 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
1019 |
+
if ( in_array( $_POST['action'], $actions, true ) ) {
|
1020 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
1021 |
+
if ( array_key_exists( 'classic-editor', $_POST ) ) {
|
1022 |
+
$load_gutenberg = false;
|
1023 |
+
}
|
1024 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
1025 |
+
if ( isset( $_POST['meta_box'] ) && 1 === (int) $_POST['meta_box'] ) {
|
1026 |
+
$load_gutenberg = true;
|
1027 |
+
}
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
$post_type = is_null(self::$post_type) ? '' : self::$post_type;
|
1032 |
+
|
1033 |
+
if ( empty($post_type) && ! empty( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1034 |
+
$post_type = self::get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
/**
|
1038 |
+
* Since 1.9.17 Gutenberg support will be start for posts and pages only.
|
1039 |
+
*/
|
1040 |
+
if ( ! in_array( $post_type, array( 'post', 'page' ), true ) ) {
|
1041 |
+
$load_gutenberg = false;
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
/**
|
1045 |
+
* @since 1.9.30
|
1046 |
+
*/
|
1047 |
+
$load_gutenberg = self::get_3rd_party_status_for_gutenberg( $load_gutenberg );
|
1048 |
+
|
1049 |
+
}
|
1050 |
+
}
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
$_attrs = array(
|
1054 |
+
'id' => 'gutenberg',
|
1055 |
+
'version' => GUTENBERG_VERSION,
|
1056 |
+
'class' => 'WPGlobus_Gutenberg',
|
1057 |
+
'builder_page' => false,
|
1058 |
+
'pagenow' => $pagenow,
|
1059 |
+
'post_type' => empty( $post_type ) ? '' : $post_type,
|
1060 |
+
'message' => $message,
|
1061 |
+
);
|
1062 |
+
|
1063 |
+
if ( $load_gutenberg ) {
|
1064 |
+
$_attrs['builder_page'] = true;
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
$attrs = self::get_attrs( $_attrs );
|
1068 |
+
|
1069 |
+
return $attrs;
|
1070 |
+
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
return $load_gutenberg;
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
/**
|
1077 |
+
* @since 1.9.30
|
1078 |
+
*
|
1079 |
+
* @param bool $load_gutenberg
|
1080 |
+
* @param string $post_type @since 2.1.6
|
1081 |
+
*
|
1082 |
+
* @return bool
|
1083 |
+
*/
|
1084 |
+
protected static function get_3rd_party_status_for_gutenberg( $load_gutenberg, $post_type = '' ) {
|
1085 |
+
|
1086 |
+
if ( '' === $post_type ) {
|
1087 |
+
$post_type = self::get_post_type_2();
|
1088 |
+
}
|
1089 |
+
|
1090 |
+
if ( defined( 'WC_PLUGIN_FILE' ) ) {
|
1091 |
+
/**
|
1092 |
+
* WooCommerce.
|
1093 |
+
*/
|
1094 |
+
if ( 'product' === $post_type ) {
|
1095 |
+
|
1096 |
+
$load_gutenberg = false;
|
1097 |
+
|
1098 |
+
} elseif ( '' === $post_type ) {
|
1099 |
+
|
1100 |
+
if ( ! empty( $_POST['post_type'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1101 |
+
$post_type = $_POST['post_type']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1102 |
+
}
|
1103 |
+
|
1104 |
+
if ( empty( $post_type ) && ! empty( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1105 |
+
$post_type = self::get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
if ( empty( $post_type ) && ! empty( $_GET['post_type'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1109 |
+
$post_type = $_GET['post_type']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1110 |
+
}
|
1111 |
+
|
1112 |
+
if ( 'product' === $post_type ) {
|
1113 |
+
$load_gutenberg = false;
|
1114 |
+
}
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
/**
|
1119 |
+
* Elementor.
|
1120 |
+
*
|
1121 |
+
* @since 2.4.11
|
1122 |
+
* @see elementor\modules\gutenberg\module.php
|
1123 |
+
*/
|
1124 |
+
if ( defined( 'ELEMENTOR_VERSION' ) ) {
|
1125 |
+
$gutenberg_module = new Gutenberg\Module();
|
1126 |
+
if ( $gutenberg_module->is_active() ) {
|
1127 |
+
if ( isset($_GET['action']) && 'elementor' == $_GET['action'] ) {
|
1128 |
+
/**
|
1129 |
+
* Prevent init block editor support when elementor edit page is loading.
|
1130 |
+
*/
|
1131 |
+
return false;
|
1132 |
+
}
|
1133 |
+
}
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
if ( function_exists( 'classic_editor_settings' ) ) {
|
1137 |
+
/**
|
1138 |
+
* @see ver.0.5 https://wordpress.org/plugins/classic-editor/#developers
|
1139 |
+
*/
|
1140 |
+
if ( isset( $_GET['classic-editor'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1141 |
+
/**
|
1142 |
+
* Option 'Use the Block editor by default and include optional links back to the Classic editor' was selected.
|
1143 |
+
*/
|
1144 |
+
$load_gutenberg = false;
|
1145 |
+
} else {
|
1146 |
+
$classic_editor_replace = get_option( 'classic-editor-replace' );
|
1147 |
+
if ( empty( $classic_editor_replace ) || 'replace' === $classic_editor_replace ) {
|
1148 |
+
$load_gutenberg = false;
|
1149 |
+
}
|
1150 |
+
}
|
1151 |
+
}
|
1152 |
+
|
1153 |
+
if ( class_exists( 'Classic_Editor' ) ) {
|
1154 |
+
/** @global string $wp_version */
|
1155 |
+
global $wp_version;
|
1156 |
+
|
1157 |
+
if ( version_compare( $wp_version, '4.9.99', '>' ) ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement
|
1158 |
+
// continue
|
1159 |
+
} else {
|
1160 |
+
/**
|
1161 |
+
* Incorrect work with WP 4.9
|
1162 |
+
*
|
1163 |
+
* @see https://wordpress.org/support/topic/does-nor-work-anymore-since-v-1-0/
|
1164 |
+
*/
|
1165 |
+
return $load_gutenberg;
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
/**
|
1169 |
+
* ver.1.0 https://wordpress.org/plugins/classic-editor/
|
1170 |
+
*/
|
1171 |
+
if ( isset( $_GET['classic-editor'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1172 |
+
/**
|
1173 |
+
* @todo
|
1174 |
+
* 1. set 'classic-editor-remember' as 'block-editor'.
|
1175 |
+
* 2. load your-site/wp-admin/post.php?post=POST_ID&action=edit&classic-editor.
|
1176 |
+
* 3. incorrect loading post page.
|
1177 |
+
*/
|
1178 |
+
//update_post_meta( POST_ID, 'classic-editor-remember', 'classic-editor' );
|
1179 |
+
|
1180 |
+
$load_gutenberg = false;
|
1181 |
+
} elseif ( isset( $_GET['classic-editor__forget'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1182 |
+
$load_gutenberg = true;
|
1183 |
+
} else {
|
1184 |
+
$post_id = isset( $_GET['post'] ) ? (int) $_GET['post'] : 0; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1185 |
+
|
1186 |
+
if ( 0 === $post_id ) {
|
1187 |
+
/**
|
1188 |
+
* We need to check $_POST when the saving post in 'classic-editor' mode.
|
1189 |
+
* As option we can use $_POST['classic-editor'], but now get 'classic-editor-remember' meta.
|
1190 |
+
*/
|
1191 |
+
$post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
if ( 0 !== $post_id ) {
|
1195 |
+
$classic_editor_remember = get_post_meta( $post_id, 'classic-editor-remember', true );
|
1196 |
+
if ( 'classic-editor' === $classic_editor_remember ) {
|
1197 |
+
$load_gutenberg = false;
|
1198 |
+
|
1199 |
+
return $load_gutenberg;
|
1200 |
+
} elseif ( 'block-editor' === $classic_editor_remember ) {
|
1201 |
+
$load_gutenberg = true;
|
1202 |
+
|
1203 |
+
return $load_gutenberg;
|
1204 |
+
}
|
1205 |
+
//else {
|
1206 |
+
/**
|
1207 |
+
* @todo meta doesn't exist?
|
1208 |
+
*/
|
1209 |
+
//}
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
$classic_editor_replace = get_option( 'classic-editor-replace' );
|
1213 |
+
if ( empty( $classic_editor_replace ) || 'classic' === $classic_editor_replace ) {
|
1214 |
+
$load_gutenberg = false;
|
1215 |
+
} elseif ( 'block' === $classic_editor_replace ) {
|
1216 |
+
$load_gutenberg = true;
|
1217 |
+
} else {
|
1218 |
+
$load_gutenberg = false;
|
1219 |
+
|
1220 |
+
}
|
1221 |
+
}
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
return $load_gutenberg;
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
/**
|
1228 |
+
* Check for gutenberg ajax.
|
1229 |
+
*/
|
1230 |
+
protected static function is_gutenberg_ajax() {
|
1231 |
+
$result = false;
|
1232 |
+
|
1233 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
1234 |
+
if ( empty( $_POST ) || empty( $_POST['action'] ) ) {
|
1235 |
+
return $result;
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
$actions = array( 'edit', 'editpost' );
|
1239 |
+
if ( in_array( $_POST['action'], $actions, true ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1240 |
+
if ( array_key_exists( 'gutenberg_meta_boxes', $_POST ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1241 |
+
$result = true;
|
1242 |
+
}
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
return $result;
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
/**
|
1249 |
+
* Check for Yoast SEO.
|
1250 |
+
*
|
1251 |
+
* @since 1.9.17
|
1252 |
+
*/
|
1253 |
+
protected static function is_yoast_seo() {
|
1254 |
+
|
1255 |
+
if ( defined( 'WPSEO_VERSION' ) ) {
|
1256 |
+
|
1257 |
+
/** @global string $pagenow */
|
1258 |
+
global $pagenow;
|
1259 |
+
|
1260 |
+
$wpseo_titles = get_option( 'wpseo_titles' );
|
1261 |
+
|
1262 |
+
if ( 'post.php' === $pagenow ) {
|
1263 |
+
|
1264 |
+
$post_type = is_null(self::$post_type) ? '' : self::$post_type;
|
1265 |
+
|
1266 |
+
if ( empty( $post_type ) && ! empty( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1267 |
+
$post_type = self::get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
if ( empty( $post_type ) ) {
|
1271 |
+
/**
|
1272 |
+
* Check $_REQUEST when post is updated.
|
1273 |
+
*/
|
1274 |
+
if ( ! empty( $_REQUEST['post_type'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1275 |
+
$post_type = $_REQUEST['post_type']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1276 |
+
}
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
$_attrs = array(
|
1280 |
+
'id' => 'yoast_seo',
|
1281 |
+
'version' => WPSEO_VERSION,
|
1282 |
+
'class' => 'WPGlobus_Yoast_SEO',
|
1283 |
+
'builder_page' => false,
|
1284 |
+
'post_type' => empty( $post_type ) ? '' : $post_type,
|
1285 |
+
);
|
1286 |
+
|
1287 |
+
if ( empty( $post_type ) ) {
|
1288 |
+
/**
|
1289 |
+
* @since 1.9.17 detect builder page using $pagenow.
|
1290 |
+
*/
|
1291 |
+
$_attrs['builder_page'] = true;
|
1292 |
+
} else {
|
1293 |
+
|
1294 |
+
if ( ! array_key_exists( 'display-metabox-pt-' . $post_type, $wpseo_titles ) ) {
|
1295 |
+
/**
|
1296 |
+
* @since 2.2.25
|
1297 |
+
*/
|
1298 |
+
$_attrs['builder_page'] = true;
|
1299 |
+
} elseif ( 0 === (int) $wpseo_titles[ 'display-metabox-pt-' . $post_type ] ) {
|
1300 |
+
$_attrs['builder_page'] = false;
|
1301 |
+
} else {
|
1302 |
+
$_attrs['builder_page'] = true;
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
$attrs = self::get_attrs( $_attrs );
|
1308 |
+
|
1309 |
+
return $attrs;
|
1310 |
+
|
1311 |
+
} elseif ( 'term.php' === $pagenow ) {
|
1312 |
+
|
1313 |
+
$tax = empty( $_GET['taxonomy'] ) ? false : sanitize_text_field( wp_unslash( $_GET['taxonomy'] ) ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
1314 |
+
|
1315 |
+
if ( $tax ) {
|
1316 |
+
|
1317 |
+
$_attrs = array(
|
1318 |
+
'id' => 'yoast_seo',
|
1319 |
+
'version' => WPSEO_VERSION,
|
1320 |
+
'class' => 'WPGlobus_Yoast_SEO',
|
1321 |
+
'builder_page' => false,
|
1322 |
+
'post_type' => '',
|
1323 |
+
'taxonomy' => $tax,
|
1324 |
+
);
|
1325 |
+
|
1326 |
+
self::$admin_attrs = array(
|
1327 |
+
'multilingualFields' => array( 'name', 'description_ifr' ),
|
1328 |
+
'translatableClass' => 'wpglobus-translatable',
|
1329 |
+
);
|
1330 |
+
|
1331 |
+
if ( isset( $wpseo_titles[ 'display-metabox-tax-' . $tax ] ) && 0 === (int) $wpseo_titles[ 'display-metabox-tax-' . $tax ] ) {
|
1332 |
+
$_attrs['builder_page'] = false;
|
1333 |
+
} else {
|
1334 |
+
$_attrs['builder_page'] = true;
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
$attrs = self::get_attrs( $_attrs );
|
1338 |
+
|
1339 |
+
return $attrs;
|
1340 |
+
}
|
1341 |
+
} elseif ( 'edit-tags.php' === $pagenow ) {
|
1342 |
+
/**
|
1343 |
+
* Case when Update button was clicked on term.php page .
|
1344 |
+
*/
|
1345 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
1346 |
+
$tax = empty( $_POST['taxonomy'] ) ? false : sanitize_text_field( wp_unslash( $_POST['taxonomy'] ) );
|
1347 |
+
|
1348 |
+
if ( $tax ) {
|
1349 |
+
|
1350 |
+
$_attrs = array(
|
1351 |
+
'id' => 'yoast_seo',
|
1352 |
+
'version' => WPSEO_VERSION,
|
1353 |
+
'class' => 'WPGlobus_Yoast_SEO',
|
1354 |
+
'builder_page' => false,
|
1355 |
+
'post_type' => '',
|
1356 |
+
'taxonomy' => $tax,
|
1357 |
+
);
|
1358 |
+
|
1359 |
+
self::$admin_attrs = array(
|
1360 |
+
'multilingualFields' => array( 'name', 'description_ifr' ),
|
1361 |
+
'translatableClass' => 'wpglobus-translatable',
|
1362 |
+
);
|
1363 |
+
|
1364 |
+
if ( isset( $_POST['action'] ) && 'editedtag' === $_POST['action'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1365 |
+
$_attrs['builder_page'] = true;
|
1366 |
+
}
|
1367 |
+
|
1368 |
+
$attrs = self::get_attrs( $_attrs );
|
1369 |
+
|
1370 |
+
return $attrs;
|
1371 |
+
}
|
1372 |
+
}
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
return false;
|
1376 |
+
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
/**
|
1380 |
+
* Check for Pods – Custom Content Types and Fields.
|
1381 |
+
*
|
1382 |
+
* @since 2.3.0
|
1383 |
+
*/
|
1384 |
+
protected static function is_pods() {
|
1385 |
+
|
1386 |
+
if ( ! defined( 'PODS_VERSION' ) ) {
|
1387 |
+
return false;
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
$post_type = self::get_post_type_2();
|
1391 |
+
|
1392 |
+
$_attrs = array(
|
1393 |
+
'id' => 'pods',
|
1394 |
+
'version' => PODS_VERSION,
|
1395 |
+
'class' => 'WPGlobus_Pods',
|
1396 |
+
'builder_page' => false,
|
1397 |
+
'post_type' => empty( $post_type ) ? '' : $post_type,
|
1398 |
+
);
|
1399 |
+
|
1400 |
+
require_once 'pods/class-wpglobus-builder-pods.php';
|
1401 |
+
$_attrs = WPGlobus_Builder_Pods::get_attrs( self::get_attrs( $_attrs ) );
|
1402 |
+
|
1403 |
+
if ( ! $_attrs ) {
|
1404 |
+
return false;
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
return $_attrs;
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
/**
|
1411 |
+
* Check for Rank Math SEO Plugin.
|
1412 |
+
*
|
1413 |
+
* @since 2.4.3
|
1414 |
+
*/
|
1415 |
+
protected static function is_rank_math_seo() {
|
1416 |
+
|
1417 |
+
if ( ! defined( 'RANK_MATH_VERSION' ) ) {
|
1418 |
+
return false;
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
$post_type = self::get_post_type_2();
|
1422 |
+
|
1423 |
+
$_attrs = array(
|
1424 |
+
'id' => 'rank_math_seo',
|
1425 |
+
'version' => RANK_MATH_VERSION,
|
1426 |
+
'class' => 'WPGlobus_RankMathSEO',
|
1427 |
+
'builder_page' => false,
|
1428 |
+
'post_type' => empty( $post_type ) ? '' : $post_type,
|
1429 |
+
'taxonomy' => ''
|
1430 |
+
);
|
1431 |
+
|
1432 |
+
require_once 'rank_math_seo/class-wpglobus-builder-rank_math_seo.php';
|
1433 |
+
$_attrs = WPGlobus_Builder_RankMathSEO::get_attrs( self::get_attrs( $_attrs ) );
|
1434 |
+
|
1435 |
+
if ( ! $_attrs ) {
|
1436 |
+
return false;
|
1437 |
+
}
|
1438 |
+
|
1439 |
+
return $_attrs;
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
/**
|
1443 |
+
* Get attributes.
|
1444 |
+
*
|
1445 |
+
* @param array $attrs
|
1446 |
+
*
|
1447 |
+
* @return array
|
1448 |
+
*/
|
1449 |
+
protected static function get_attrs( $attrs ) {
|
1450 |
+
$_attrs = array_merge( self::$attrs, $attrs );
|
1451 |
+
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedIf
|
1452 |
+
if ( isset( $_attrs['is_admin'] ) && ! $_attrs['is_admin'] ) {
|
1453 |
+
// do nothing.
|
1454 |
+
} else {
|
1455 |
+
$_attrs = array_merge( $_attrs, self::$admin_attrs );
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
if ( empty( $_attrs['post_id'] ) ) {
|
1459 |
+
if ( isset( $_GET['post'] ) && is_string( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1460 |
+
/**
|
1461 |
+
* With bulk action (trash, untrash) we get $_GET['post'] as array.
|
1462 |
+
*
|
1463 |
+
* @since WPGlobus 2.0 we are working with single post only.
|
1464 |
+
*/
|
1465 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1466 |
+
$_attrs['post_id'] = sanitize_text_field( $_GET['post'] );
|
1467 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1468 |
+
} elseif ( isset( $_REQUEST['post_ID'] ) && is_string( $_REQUEST['post_ID'] ) ) {
|
1469 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1470 |
+
$_attrs['post_id'] = sanitize_text_field( $_REQUEST['post_ID'] );
|
1471 |
+
// } else {
|
1472 |
+
// @todo Check additional ways to get post ID.
|
1473 |
+
}
|
1474 |
+
}
|
1475 |
+
|
1476 |
+
// @todo may be disable post type here.
|
1477 |
+
// $_attrs['builder_page'] = false;
|
1478 |
+
return $_attrs;
|
1479 |
+
}
|
1480 |
+
|
1481 |
+
/**
|
1482 |
+
* Get post type.
|
1483 |
+
*
|
1484 |
+
* @param string $id
|
1485 |
+
*
|
1486 |
+
* @return null|string
|
1487 |
+
*/
|
1488 |
+
protected static function get_post_type( $id = '' ) {
|
1489 |
+
|
1490 |
+
/**
|
1491 |
+
* Get post type.
|
1492 |
+
*
|
1493 |
+
* @since 2.2.11
|
1494 |
+
*/
|
1495 |
+
if ( ! is_null( self::$post_type ) ) {
|
1496 |
+
return self::$post_type;
|
1497 |
+
}
|
1498 |
+
|
1499 |
+
/**
|
1500 |
+
* @since 2.2.11
|
1501 |
+
* @W.I.P to use get_post_type_2()
|
1502 |
+
*/
|
1503 |
+
if ( 0 === (int) $id ) {
|
1504 |
+
return null;
|
1505 |
+
}
|
1506 |
+
|
1507 |
+
/** @global wpdb $wpdb */
|
1508 |
+
global $wpdb;
|
1509 |
+
|
1510 |
+
$post_type = $wpdb->get_var( $wpdb->prepare( "SELECT post_type FROM $wpdb->posts WHERE ID = %d", $id ) );
|
1511 |
+
|
1512 |
+
return $post_type;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
/**
|
1516 |
+
* Get post type 2.
|
1517 |
+
*
|
1518 |
+
* @since 2.2.11
|
1519 |
+
*/
|
1520 |
+
protected static function get_post_type_2() {
|
1521 |
+
|
1522 |
+
if ( ! is_null( self::$post_type ) ) {
|
1523 |
+
return self::$post_type;
|
1524 |
+
}
|
1525 |
+
|
1526 |
+
/** @global string $pagenow */
|
1527 |
+
global $pagenow;
|
1528 |
+
|
1529 |
+
$post_type = '';
|
1530 |
+
$post_id = '';
|
1531 |
+
|
1532 |
+
switch ($pagenow) {
|
1533 |
+
case 'media-new.php' :
|
1534 |
+
$post_type = 'attachment';
|
1535 |
+
break;
|
1536 |
+
case 'post-new.php':
|
1537 |
+
if ( isset( $_GET['post_type'] ) ) {
|
1538 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
1539 |
+
$post_type = sanitize_text_field( $_GET['post_type'] );
|
1540 |
+
} else {
|
1541 |
+
$post_type = 'post';
|
1542 |
+
}
|
1543 |
+
break;
|
1544 |
+
/**
|
1545 |
+
* @W.I.P @since 2.2.14
|
1546 |
+
case 'admin-ajax.php' :
|
1547 |
+
$post_type = '';
|
1548 |
+
break;
|
1549 |
+
// */
|
1550 |
+
default:
|
1551 |
+
// post.php page.
|
1552 |
+
if ( isset( $_GET['post'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1553 |
+
$post_id = $_GET['post']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1554 |
+
} else if ( isset( $_GET['post_id'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1555 |
+
/**
|
1556 |
+
* For example when loading WPBakery PB's front editor.
|
1557 |
+
* @since 2.3.7
|
1558 |
+
*/
|
1559 |
+
$post_id = $_GET['post_id']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1560 |
+
} else if ( isset( $_REQUEST['post_ID'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1561 |
+
/**
|
1562 |
+
* Case when Update button was clicked.
|
1563 |
+
*/
|
1564 |
+
$post_id = $_REQUEST['post_ID']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
1565 |
+
}
|
1566 |
+
break;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
if ( ! empty($post_type) ) {
|
1570 |
+
self::$post_type = $post_type;
|
1571 |
+
return self::$post_type;
|
1572 |
+
}
|
1573 |
+
|
1574 |
+
if ( 0 === (int) $post_id ) {
|
1575 |
+
return false;
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
/** @global wpdb $wpdb */
|
1579 |
+
global $wpdb;
|
1580 |
+
|
1581 |
+
self::$post_type = $wpdb->get_var( $wpdb->prepare( "SELECT post_type FROM $wpdb->posts WHERE ID = %d", $post_id ) );
|
1582 |
+
|
1583 |
+
return self::$post_type;
|
1584 |
+
}
|
1585 |
+
|
1586 |
+
/**
|
1587 |
+
* Check for post type supports.
|
1588 |
+
*
|
1589 |
+
* @since 2.2.24
|
1590 |
+
* @since 2.2.34 Fix with empty `show_in_rest`.
|
1591 |
+
*
|
1592 |
+
* @return bool
|
1593 |
+
*/
|
1594 |
+
protected static function use_block_editor_for_post_type($post_type) {
|
1595 |
+
|
1596 |
+
$_opts = get_option(self::$init_attrs['options']['register_post_types']);
|
1597 |
+
|
1598 |
+
if ( empty($_opts[$post_type]) ) {
|
1599 |
+
/**
|
1600 |
+
* We don't have info about post type.
|
1601 |
+
*/
|
1602 |
+
return true;
|
1603 |
+
}
|
1604 |
+
|
1605 |
+
if ( empty($_opts[$post_type]['features']['editor']) || (int) $_opts[$post_type]['features']['editor'] == 0 ) {
|
1606 |
+
/**
|
1607 |
+
* Don't start Block Editor support.
|
1608 |
+
* @see `use_block_editor_for_post_type()` in wp-admin\includes\post.php
|
1609 |
+
*/
|
1610 |
+
return false;
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
if ( empty($_opts[$post_type]['show_in_rest']) || (int) $_opts[$post_type]['show_in_rest'] == 0 ) {
|
1614 |
+
/**
|
1615 |
+
* Don't start Block Editor support.
|
1616 |
+
* @see `use_block_editor_for_post_type()` in wp-admin\includes\post.php
|
1617 |
+
*/
|
1618 |
+
return false;
|
1619 |
+
}
|
1620 |
+
|
1621 |
+
return true;
|
1622 |
+
}
|
1623 |
+
}
|
1624 |
+
|
1625 |
+
endif;
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-config-builder.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! class_exists( 'WPGlobus_Config_Builder' ) ) :
|
10 |
+
|
11 |
+
class WPGlobus_Config_Builder {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var string|false
|
15 |
+
*/
|
16 |
+
protected $id = false;
|
17 |
+
|
18 |
+
protected $is_run = false;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* May be to use "wpglobus_language" meta (reserved in WPGlobus).
|
22 |
+
*
|
23 |
+
* @todo remove after test
|
24 |
+
*/
|
25 |
+
//protected $language_meta_key = '_wpglobus_builder_language';
|
26 |
+
|
27 |
+
protected $language_cookie = 'wpglobus-builder-language';
|
28 |
+
|
29 |
+
protected $attrs = array();
|
30 |
+
|
31 |
+
protected $__class = null;
|
32 |
+
|
33 |
+
protected $__builder_page = false;
|
34 |
+
|
35 |
+
protected $__is_admin = false;
|
36 |
+
|
37 |
+
protected $language = false;
|
38 |
+
|
39 |
+
protected $default_language;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @since 2.2.11
|
43 |
+
*/
|
44 |
+
public $post_types = array();
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Constructor.
|
48 |
+
*
|
49 |
+
* @param bool $init
|
50 |
+
* @param array $init_attrs
|
51 |
+
*/
|
52 |
+
public function __construct( $init = true, $init_attrs = array() ) {
|
53 |
+
|
54 |
+
if ( isset( $init_attrs['default_language'] ) ) {
|
55 |
+
$this->default_language = $init_attrs['default_language'];
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @since 2.2.11
|
60 |
+
*/
|
61 |
+
if ( isset( $init_attrs['post_types'] ) ) {
|
62 |
+
$this->post_types = $init_attrs['post_types'];
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( $init ) {
|
66 |
+
|
67 |
+
require_once dirname( __FILE__ ) . '/class-wpglobus-builders.php';
|
68 |
+
/**
|
69 |
+
* @since 2.2.24 added $init_attrs.
|
70 |
+
*/
|
71 |
+
$builder = WPGlobus_Builders::get(true, $init_attrs);
|
72 |
+
|
73 |
+
$this->id = $builder['id'];
|
74 |
+
unset( $builder['id'] );
|
75 |
+
|
76 |
+
if ( $this->id ) {
|
77 |
+
|
78 |
+
$this->attrs['version'] = null;
|
79 |
+
|
80 |
+
foreach ( $builder as $key => $value ) {
|
81 |
+
if ( 'class' === $key ) {
|
82 |
+
$this->__class = $value;
|
83 |
+
} elseif ( 'builder_page' === $key ) {
|
84 |
+
$this->__builder_page = $value;
|
85 |
+
} elseif ( 'is_admin' === $key ) {
|
86 |
+
$this->__is_admin = $value;
|
87 |
+
}
|
88 |
+
$this->attrs[ $key ] = $value;
|
89 |
+
}
|
90 |
+
|
91 |
+
$this->language = $this->get_language();
|
92 |
+
$this->attrs['language'] = $this->language;
|
93 |
+
|
94 |
+
} else {
|
95 |
+
unset( $this->attrs );
|
96 |
+
}
|
97 |
+
} else {
|
98 |
+
|
99 |
+
require_once dirname( __FILE__ ) . '/class-wpglobus-builders.php';
|
100 |
+
/** @noinspection PhpUnusedLocalVariableInspection */
|
101 |
+
$builder = WPGlobus_Builders::get( false );
|
102 |
+
|
103 |
+
}
|
104 |
+
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Try to run builder.
|
109 |
+
*
|
110 |
+
* @param string $builder
|
111 |
+
* @param bool $set_run_flag
|
112 |
+
*
|
113 |
+
* @return bool
|
114 |
+
*/
|
115 |
+
public function maybe_run( $builder = '', $set_run_flag = false ) {
|
116 |
+
|
117 |
+
//if ( defined('DOING_AJAX') && DOING_AJAX ) {
|
118 |
+
//return false;
|
119 |
+
//}
|
120 |
+
|
121 |
+
if ( ! $this->id ) {
|
122 |
+
return false;
|
123 |
+
}
|
124 |
+
|
125 |
+
$check_run_flag = true;
|
126 |
+
|
127 |
+
if ( is_bool( $builder ) ) {
|
128 |
+
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedIF
|
129 |
+
if ( $builder ) {
|
130 |
+
// @todo
|
131 |
+
} else {
|
132 |
+
$check_run_flag = false;
|
133 |
+
$set_run_flag = false;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
if ( $check_run_flag && $this->is_run ) {
|
138 |
+
/**
|
139 |
+
* Don't run again.
|
140 |
+
*/
|
141 |
+
return false;
|
142 |
+
}
|
143 |
+
|
144 |
+
if ( '' === $builder ) {
|
145 |
+
$builder = $this->id;
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( ! $builder ) {
|
149 |
+
return false;
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( $builder !== $this->id ) {
|
153 |
+
return false;
|
154 |
+
}
|
155 |
+
|
156 |
+
if ( $this->is_front() ) {
|
157 |
+
if ( $set_run_flag ) {
|
158 |
+
$this->is_run = true;
|
159 |
+
}
|
160 |
+
|
161 |
+
return true;
|
162 |
+
}
|
163 |
+
|
164 |
+
if ( $this->is_builder_page() ) {
|
165 |
+
if ( $set_run_flag ) {
|
166 |
+
$this->is_run = true;
|
167 |
+
}
|
168 |
+
|
169 |
+
return true;
|
170 |
+
}
|
171 |
+
|
172 |
+
return false;
|
173 |
+
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Get attribute.
|
178 |
+
*
|
179 |
+
* @param string $attr
|
180 |
+
*
|
181 |
+
* @return bool|mixed
|
182 |
+
*/
|
183 |
+
public function get( $attr = 'id' ) {
|
184 |
+
if ( ! $this->id ) {
|
185 |
+
return false;
|
186 |
+
}
|
187 |
+
if ( 'id' === $attr ) {
|
188 |
+
return $this->get_id();
|
189 |
+
}
|
190 |
+
if ( ! empty( $this->attrs[ $attr ] ) ) {
|
191 |
+
return $this->attrs[ $attr ];
|
192 |
+
}
|
193 |
+
|
194 |
+
return false;
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Set builder language.
|
199 |
+
*
|
200 |
+
* @param string $language
|
201 |
+
*/
|
202 |
+
public function set_language( $language = '' ) {
|
203 |
+
if ( ! empty( $language ) ) {
|
204 |
+
$this->language = $language;
|
205 |
+
$this->attrs['language'] = $this->language;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Get builder language.
|
211 |
+
*
|
212 |
+
* @param int|string $post_id
|
213 |
+
*
|
214 |
+
* @return array|bool|mixed|string
|
215 |
+
*/
|
216 |
+
public function get_language( $post_id = '' ) {
|
217 |
+
|
218 |
+
if ( ! $this->id ) {
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
|
222 |
+
if ( ! $this->is_builder_page() ) {
|
223 |
+
/**
|
224 |
+
* @todo maybe need to check the matching of $this->language and WPGlobus::Config()->language.
|
225 |
+
* @see Set language for builder in wpglobus\includes\class-wpglobus-config.php
|
226 |
+
*/
|
227 |
+
return $this->language;
|
228 |
+
}
|
229 |
+
|
230 |
+
if ( $this->language ) {
|
231 |
+
return $this->language;
|
232 |
+
}
|
233 |
+
|
234 |
+
/** @global string $pagenow */
|
235 |
+
global $pagenow;
|
236 |
+
|
237 |
+
if ( 'post-new.php' === $pagenow ) {
|
238 |
+
/**
|
239 |
+
* Correctly define language for the 'post-new.php' page.
|
240 |
+
*
|
241 |
+
* @since 2.1.1
|
242 |
+
*/
|
243 |
+
$this->language = $this->default_language;
|
244 |
+
|
245 |
+
return $this->language;
|
246 |
+
}
|
247 |
+
|
248 |
+
$post_id = (int) $post_id;
|
249 |
+
if ( ! $post_id ) {
|
250 |
+
// Post ID not passed..getting from global Post.
|
251 |
+
$global_post = get_post();
|
252 |
+
if ( $global_post instanceof WP_Post ) {
|
253 |
+
$post_id = $global_post->ID;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
$language = false;
|
258 |
+
if ( $post_id ) {
|
259 |
+
$language = get_post_meta( $post_id, $this->get_language_meta_key(), true );
|
260 |
+
}
|
261 |
+
|
262 |
+
if ( ! $language ) {
|
263 |
+
|
264 |
+
if ( empty( $_REQUEST ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
265 |
+
|
266 |
+
if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
|
267 |
+
/**
|
268 |
+
* @todo front-end? check it.
|
269 |
+
*/
|
270 |
+
return false;
|
271 |
+
|
272 |
+
} elseif ( false !== strpos( $_SERVER['HTTP_REFERER'], 'language=' ) ) {
|
273 |
+
$language = explode( 'language=', $_SERVER['HTTP_REFERER'] );
|
274 |
+
$language = $language[1];
|
275 |
+
}
|
276 |
+
} else {
|
277 |
+
|
278 |
+
if ( ! empty( $_REQUEST['language'] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
279 |
+
$language = sanitize_text_field( $_REQUEST['language'] );
|
280 |
+
}
|
281 |
+
|
282 |
+
if ( isset( $_REQUEST[ WPGlobus::get_language_meta_key() ] ) ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
283 |
+
$language = sanitize_text_field( $_REQUEST[ WPGlobus::get_language_meta_key() ] );
|
284 |
+
}
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
if ( ! $language ) {
|
289 |
+
|
290 |
+
if ( isset( $_REQUEST['post'] ) && 0 !== (int) $_REQUEST['post'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
291 |
+
|
292 |
+
$language = get_post_meta( $_REQUEST['post'], $this->get_language_meta_key(), true ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
293 |
+
|
294 |
+
} elseif ( isset( $_REQUEST['id'] ) && 0 !== (int) $_REQUEST['id'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Case when post in draft status is autosaved.
|
298 |
+
*/
|
299 |
+
$language = get_post_meta( $_REQUEST['id'], $this->get_language_meta_key(), true ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
300 |
+
|
301 |
+
} elseif ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
302 |
+
|
303 |
+
/**
|
304 |
+
* See also the Update action in @see \WPGlobus_Builders
|
305 |
+
*/
|
306 |
+
$_continue = false;
|
307 |
+
|
308 |
+
/**
|
309 |
+
* @since 2.5.17 Check $GLOBALS['WPGlobus'] for an array to prevent an occurring error `Cannot use object of type WPGlobus as array`.
|
310 |
+
* @todo In a rare case (so far only one) $GLOBALS['WPGlobus'] defined as object. Need an investigation.
|
311 |
+
*/
|
312 |
+
if ( isset( $GLOBALS['WPGlobus'] ) &&
|
313 |
+
is_array( $GLOBALS['WPGlobus'] ) &&
|
314 |
+
! empty( $GLOBALS['WPGlobus']['post_type'] )
|
315 |
+
)
|
316 |
+
{
|
317 |
+
$_continue = true;
|
318 |
+
}
|
319 |
+
if ( false !== strpos( $_SERVER['REQUEST_URI'], '/wp-json/wp/v2/posts/' )
|
320 |
+
|| false !== strpos( $_SERVER['REQUEST_URI'], '/wp-json/wp/v2/pages/' )
|
321 |
+
|| $_continue ) {
|
322 |
+
/**
|
323 |
+
* Case when post status was changed ( draft->publish or publish->draft ) in Gutenberg.
|
324 |
+
*
|
325 |
+
* @see \WPGlobus_Builders::is_gutenberg()
|
326 |
+
*/
|
327 |
+
if ( isset( $GLOBALS['WPGlobus'] ) && ! empty( $GLOBALS['WPGlobus']['post_id'] ) ) {
|
328 |
+
$post_id = $GLOBALS['WPGlobus']['post_id'];
|
329 |
+
} else {
|
330 |
+
$_request_uri = explode( '/', $_SERVER['REQUEST_URI'] );
|
331 |
+
|
332 |
+
$post_id = end( $_request_uri );
|
333 |
+
$post_id = preg_replace( '/\?.*/', '', $post_id );
|
334 |
+
}
|
335 |
+
|
336 |
+
if ( 0 !== (int) $post_id ) {
|
337 |
+
$language = get_post_meta( $post_id, $this->get_language_meta_key(), true ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
338 |
+
}
|
339 |
+
}
|
340 |
+
}
|
341 |
+
}
|
342 |
+
|
343 |
+
if ( ! $language ) {
|
344 |
+
if ( $this->get_post_id() ) {
|
345 |
+
$language = get_post_meta( $this->get_post_id(), $this->get_language_meta_key(), true );
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
if ( ! $language && ! empty( $this->default_language ) ) {
|
350 |
+
/**
|
351 |
+
* Possible options when the language is not defined:
|
352 |
+
* - new post, post-new.php page;
|
353 |
+
*/
|
354 |
+
$language = $this->default_language;
|
355 |
+
/**
|
356 |
+
* @todo test point if was incorrect setting of $language.
|
357 |
+
*/
|
358 |
+
|
359 |
+
}
|
360 |
+
|
361 |
+
$this->language = $language;
|
362 |
+
|
363 |
+
return $language;
|
364 |
+
|
365 |
+
}
|
366 |
+
|
367 |
+
/**
|
368 |
+
* Check if builder is run.
|
369 |
+
*/
|
370 |
+
public function is_run() {
|
371 |
+
if ( ! $this->id ) {
|
372 |
+
return false;
|
373 |
+
}
|
374 |
+
|
375 |
+
return $this->is_run;
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Check if builder is run.
|
380 |
+
*/
|
381 |
+
public function is_running() {
|
382 |
+
return $this->is_run();
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Check if builder is in admin.
|
387 |
+
*/
|
388 |
+
public function is_admin() {
|
389 |
+
if ( ! $this->id ) {
|
390 |
+
return false;
|
391 |
+
}
|
392 |
+
|
393 |
+
return $this->__is_admin;
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* Check if builder is in front.
|
398 |
+
*/
|
399 |
+
public function is_front() {
|
400 |
+
if ( ! $this->id ) {
|
401 |
+
return false;
|
402 |
+
}
|
403 |
+
|
404 |
+
return ! $this->__is_admin;
|
405 |
+
}
|
406 |
+
|
407 |
+
/**
|
408 |
+
* Get builder ID.
|
409 |
+
*/
|
410 |
+
public function get_id() {
|
411 |
+
return $this->id;
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Get post ID.
|
416 |
+
*/
|
417 |
+
public function get_post_id() {
|
418 |
+
if ( isset( $this->attrs['post_id'] ) && (int) $this->attrs['post_id'] > 0 ) {
|
419 |
+
return $this->attrs['post_id'];
|
420 |
+
}
|
421 |
+
|
422 |
+
return false;
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Get builder class.
|
427 |
+
*/
|
428 |
+
public function get_class() {
|
429 |
+
if ( ! $this->id ) {
|
430 |
+
return false;
|
431 |
+
}
|
432 |
+
|
433 |
+
return $this->__class;
|
434 |
+
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
*
|
438 |
+
*/
|
439 |
+
public function get_language_meta_key() {
|
440 |
+
if ( ! $this->id ) {
|
441 |
+
return false;
|
442 |
+
}
|
443 |
+
|
444 |
+
return WPGlobus::get_language_meta_key();
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
*
|
449 |
+
*/
|
450 |
+
public function get_cookie_name() {
|
451 |
+
if ( ! $this->id ) {
|
452 |
+
return false;
|
453 |
+
}
|
454 |
+
|
455 |
+
return $this->language_cookie;
|
456 |
+
}
|
457 |
+
|
458 |
+
/**
|
459 |
+
* @param string $cookie_name
|
460 |
+
*
|
461 |
+
* @return bool|null
|
462 |
+
*/
|
463 |
+
public function get_cookie( $cookie_name = '' ) {
|
464 |
+
|
465 |
+
if ( ! $this->id ) {
|
466 |
+
return false;
|
467 |
+
}
|
468 |
+
|
469 |
+
static $_cookie_value = null;
|
470 |
+
|
471 |
+
if ( is_null( $_cookie_value ) ) {
|
472 |
+
if ( empty( $cookie_name ) ) {
|
473 |
+
$cookie_name = $this->get_cookie_name();
|
474 |
+
}
|
475 |
+
if ( empty( $_COOKIE[ $cookie_name ] ) ) {
|
476 |
+
$_cookie_value = false;
|
477 |
+
} else {
|
478 |
+
$_cookie_value = $_COOKIE[ $cookie_name ];
|
479 |
+
}
|
480 |
+
}
|
481 |
+
|
482 |
+
return $_cookie_value;
|
483 |
+
}
|
484 |
+
|
485 |
+
/**
|
486 |
+
* Check if current page is builder's page.
|
487 |
+
*/
|
488 |
+
public function is_builder_page() {
|
489 |
+
if ( ! $this->id ) {
|
490 |
+
return false;
|
491 |
+
}
|
492 |
+
|
493 |
+
return $this->__builder_page;
|
494 |
+
}
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Get all builder data.
|
498 |
+
*/
|
499 |
+
public function get_data() {
|
500 |
+
|
501 |
+
if ( ! $this->id ) {
|
502 |
+
return false;
|
503 |
+
}
|
504 |
+
|
505 |
+
$data = array();
|
506 |
+
$data['id'] = $this->get_id();
|
507 |
+
|
508 |
+
if ( empty( $data['id'] ) ) {
|
509 |
+
return false;
|
510 |
+
}
|
511 |
+
|
512 |
+
if ( ! empty( $this->attrs ) ) {
|
513 |
+
foreach ( $this->attrs as $key => $value ) {
|
514 |
+
$data[ $key ] = $value;
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
$data['language'] = $this->get_language();
|
519 |
+
|
520 |
+
return $data;
|
521 |
+
|
522 |
+
}
|
523 |
+
|
524 |
+
/**
|
525 |
+
* If $this->default_language was not set, returns `null`.
|
526 |
+
* If the language is equal to the default_language, returns `true`,
|
527 |
+
* otherwise it returns `false`.
|
528 |
+
*
|
529 |
+
* @since 2.2.6
|
530 |
+
*
|
531 |
+
* @return null|boolean
|
532 |
+
*/
|
533 |
+
public function is_default_language() {
|
534 |
+
|
535 |
+
if ( empty( $this->default_language ) ) {
|
536 |
+
return null;
|
537 |
+
}
|
538 |
+
if ( $this->language === $this->default_language ) {
|
539 |
+
return true;
|
540 |
+
}
|
541 |
+
|
542 |
+
return false;
|
543 |
+
}
|
544 |
+
|
545 |
+
/**
|
546 |
+
* Set multilingual fields.
|
547 |
+
*
|
548 |
+
* @param array $multilingual_fields
|
549 |
+
*/
|
550 |
+
public function set_multilingual_fields( $multilingual_fields ) {
|
551 |
+
|
552 |
+
if ( ! isset( $this->attrs ) ) {
|
553 |
+
return;
|
554 |
+
}
|
555 |
+
|
556 |
+
if ( is_array( $multilingual_fields ) && ! empty( $multilingual_fields ) ) {
|
557 |
+
$this->attrs['multilingualFields'] = array_merge( $this->attrs['multilingualFields'], $multilingual_fields );
|
558 |
+
}
|
559 |
+
}
|
560 |
+
|
561 |
+
}
|
562 |
+
|
563 |
+
endif;
|
trunk/includes/builders/elementor/class-wpglobus-elementor-front.php
ADDED
@@ -0,0 +1,516 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-elementor-front.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\Elementor
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @see elementor\core\files\css\post.php
|
11 |
+
*/
|
12 |
+
use Elementor\Core\Files\CSS\Post as Post_CSS;
|
13 |
+
/**
|
14 |
+
* @since 2.5.5
|
15 |
+
* @see elementor\core\files\css\post-preview.php
|
16 |
+
*/
|
17 |
+
use Elementor\Core\Files\CSS\Post_Preview as Post_Preview;
|
18 |
+
/**
|
19 |
+
* @since 2.5.5
|
20 |
+
* @see elementor\core\kits\manager.php
|
21 |
+
*/
|
22 |
+
use Elementor\Core\Kits\Manager as Manager;
|
23 |
+
|
24 |
+
if ( ! class_exists( 'WPGlobus_Elementor_Front' ) ) :
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Class WPGlobus_Elementor_Front.
|
28 |
+
*/
|
29 |
+
class WPGlobus_Elementor_Front {
|
30 |
+
|
31 |
+
public static $file_prefix = 'post-';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @since 2.1.15
|
35 |
+
*/
|
36 |
+
protected static $post_css_meta_key = null;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @since 2.1.15
|
40 |
+
*/
|
41 |
+
protected static $elementor_data_meta_key = null;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @since 2.1.15
|
45 |
+
*/
|
46 |
+
protected static $elementor_css_meta_key = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @since 2.4.12
|
50 |
+
*/
|
51 |
+
protected static $elementor_edit_mode_meta_key = null;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* @since 2.4.12
|
55 |
+
*/
|
56 |
+
protected static $post_elementor_support_meta_key = null;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @since 2.4.12
|
60 |
+
*/
|
61 |
+
protected static $post_elementor_support = null;
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Init.
|
65 |
+
*/
|
66 |
+
public static function init($attrs) {
|
67 |
+
|
68 |
+
if ( ! empty($attrs['post_css_meta_key']) ) {
|
69 |
+
self::$post_css_meta_key = $attrs['post_css_meta_key'];
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( ! empty($attrs['elementor_data_meta_key']) ) {
|
73 |
+
self::$elementor_data_meta_key = $attrs['elementor_data_meta_key'];
|
74 |
+
}
|
75 |
+
|
76 |
+
if ( ! empty($attrs['elementor_css_meta_key']) ) {
|
77 |
+
self::$elementor_css_meta_key = $attrs['elementor_css_meta_key'];
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @since 2.4.12
|
82 |
+
*/
|
83 |
+
if ( ! empty($attrs['elementor_edit_mode_meta_key']) ) {
|
84 |
+
self::$elementor_edit_mode_meta_key = $attrs['elementor_edit_mode_meta_key'];
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* @since 2.4.12
|
89 |
+
*/
|
90 |
+
if ( ! empty($attrs['post_support_meta_key']) ) {
|
91 |
+
self::$post_elementor_support_meta_key = $attrs['post_support_meta_key'];
|
92 |
+
}
|
93 |
+
|
94 |
+
add_filter( 'get_post_metadata', array( __CLASS__, 'filter__get_metadata' ), 5, 4 );
|
95 |
+
|
96 |
+
/**
|
97 |
+
* @since 2.1.15
|
98 |
+
*/
|
99 |
+
add_filter( 'update_post_metadata', array( __CLASS__, 'filter__update_metadata' ), 5, 5 );
|
100 |
+
|
101 |
+
/**
|
102 |
+
* @since 2.1.15
|
103 |
+
*/
|
104 |
+
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'on__enqueue_styles' ), 20 );
|
105 |
+
|
106 |
+
/**
|
107 |
+
* @since 2.5.5
|
108 |
+
* @see `do_action` in elementor\includes\frontend.php
|
109 |
+
* @see callback function name and using it in elementor\core\kits\manager.php
|
110 |
+
*/
|
111 |
+
add_action( 'elementor/frontend/after_enqueue_styles', array( __CLASS__, 'frontend_before_enqueue_styles' ), 0 );
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @since 2.1.13
|
115 |
+
* @see elementor\core\files\base.php
|
116 |
+
*/
|
117 |
+
add_action( 'elementor/files/file_name', array( __CLASS__, 'filter__elementor_files_file_name' ), 5, 4 );
|
118 |
+
|
119 |
+
/**
|
120 |
+
* @since 2.2.11
|
121 |
+
* @W.I.P
|
122 |
+
* @todo maybe we need to use these filters.
|
123 |
+
*/
|
124 |
+
//add_filter( 'elementor/editor/localize_settings', array( __CLASS__, 'filter__localize_settings' ), 10, 2 );
|
125 |
+
//add_action( 'elementor/editor/after_enqueue_scripts', array( __CLASS__, 'filter__localize_settings' ) );
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @since 2.3.6
|
129 |
+
*/
|
130 |
+
add_filter( 'wpglobus_plus_publish_template_include_handler', array( __CLASS__, 'filter__template_include_handler' ) );
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @since 2.4.12
|
134 |
+
*/
|
135 |
+
add_action( 'template_include', array( __CLASS__, 'on__template_include' ) );
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* @since 2.4.12
|
140 |
+
*/
|
141 |
+
public static function is_builder_support() {
|
142 |
+
if ( is_null( self::$post_elementor_support ) || self::$post_elementor_support ) {
|
143 |
+
return true;
|
144 |
+
}
|
145 |
+
return false;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* @since 2.4.12
|
150 |
+
*/
|
151 |
+
public static function on__template_include( $template ) {
|
152 |
+
|
153 |
+
if ( ! is_singular() ) {
|
154 |
+
return $template;
|
155 |
+
}
|
156 |
+
|
157 |
+
if ( is_null( self::$post_elementor_support ) ) {
|
158 |
+
|
159 |
+
/** @global WP_Post $post */
|
160 |
+
global $post;
|
161 |
+
|
162 |
+
$_support = get_post_meta( $post->ID, self::$post_elementor_support_meta_key, true );
|
163 |
+
|
164 |
+
if ( 'off' === $_support ) {
|
165 |
+
self::$post_elementor_support = false;
|
166 |
+
} else {
|
167 |
+
self::$post_elementor_support = true;
|
168 |
+
}
|
169 |
+
|
170 |
+
if ( self::$post_elementor_support ) {
|
171 |
+
|
172 |
+
$_support = get_post_meta( $post->ID, self::$elementor_edit_mode_meta_key, true );
|
173 |
+
|
174 |
+
if ( 'builder' !== $_support ) {
|
175 |
+
/**
|
176 |
+
* Disable elementor support for post, that doesn't use elementor builder.
|
177 |
+
*/
|
178 |
+
self::$post_elementor_support = false;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
return $template;
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* @since 2.5.5
|
188 |
+
*/
|
189 |
+
public static function frontend_before_enqueue_styles() {
|
190 |
+
|
191 |
+
if ( WPGlobus::Config()->language == WPGlobus::Config()->default_language ) {
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
|
195 |
+
if ( ! self::is_builder_support() ) {
|
196 |
+
return;
|
197 |
+
}
|
198 |
+
|
199 |
+
$manager = new Manager();
|
200 |
+
|
201 |
+
$kit = $manager->get_kit_for_frontend();
|
202 |
+
|
203 |
+
if ( $kit ) {
|
204 |
+
if ( $kit->is_autosave() ) {
|
205 |
+
$css_file = Post_Preview::create( $kit->get_id() );
|
206 |
+
} else {
|
207 |
+
$css_file = Post_CSS::create( $kit->get_id() );
|
208 |
+
}
|
209 |
+
|
210 |
+
$handle = 'elementor-post-' . $css_file->get_post_id() .'-' . WPGlobus::Config()->language;
|
211 |
+
|
212 |
+
$url = $css_file->get_url();
|
213 |
+
|
214 |
+
/**
|
215 |
+
* @since 2.5.5 @W.I.P `enqueue` doesn't work here.
|
216 |
+
* @see `frontend_before_enqueue_styles` in elementor\core\kits\manager.php.
|
217 |
+
*/
|
218 |
+
// $css_file->enqueue();
|
219 |
+
|
220 |
+
wp_register_style(
|
221 |
+
$handle,
|
222 |
+
$url,
|
223 |
+
array(),
|
224 |
+
'wpglobus-' . WPGLOBUS_VERSION
|
225 |
+
|
226 |
+
);
|
227 |
+
wp_enqueue_style($handle);
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* @since 2.1.15
|
233 |
+
*/
|
234 |
+
public static function on__enqueue_styles() {
|
235 |
+
|
236 |
+
if ( WPGlobus::Config()->language == WPGlobus::Config()->default_language ) {
|
237 |
+
return;
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* @since 2.4.12
|
242 |
+
*/
|
243 |
+
if ( ! self::is_builder_support() ) {
|
244 |
+
return;
|
245 |
+
}
|
246 |
+
|
247 |
+
$css_file = new Post_CSS( get_the_ID() );
|
248 |
+
|
249 |
+
/**
|
250 |
+
* @see elementor\core\files\css\post.php
|
251 |
+
*/
|
252 |
+
$handle = 'elementor-post-' . $css_file->get_post_id() .'-' . WPGlobus::Config()->language;
|
253 |
+
|
254 |
+
/**
|
255 |
+
* @see elementor\core\files\base.php
|
256 |
+
*/
|
257 |
+
$url = $css_file->get_url();
|
258 |
+
|
259 |
+
wp_register_style(
|
260 |
+
$handle,
|
261 |
+
$url,
|
262 |
+
array(),
|
263 |
+
'wpglobus-' . WPGLOBUS_VERSION
|
264 |
+
|
265 |
+
);
|
266 |
+
wp_enqueue_style($handle);
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Filters the file name.
|
271 |
+
*
|
272 |
+
* @since 2.1.13
|
273 |
+
* @since 2.3.3 Handle multiple file names.
|
274 |
+
*
|
275 |
+
* @param string $file_name CSS file name.
|
276 |
+
* @param object $instance The file instance, which inherits Elementor\Core\Files
|
277 |
+
*/
|
278 |
+
public static function filter__elementor_files_file_name( $file_name, $instance ) {
|
279 |
+
|
280 |
+
if ( WPGlobus::Config()->language == WPGlobus::Config()->default_language ) {
|
281 |
+
return $file_name;
|
282 |
+
}
|
283 |
+
|
284 |
+
if ( false === strpos( $file_name, self::$file_prefix ) ) {
|
285 |
+
return $file_name;
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* @since 2.4.12
|
290 |
+
*/
|
291 |
+
if ( ! self::is_builder_support() ) {
|
292 |
+
return $file_name;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* @since 2.3.3 @W.I.P May be check out for global post ID.
|
297 |
+
*/
|
298 |
+
//global $post;
|
299 |
+
//if ( ! $post instanceof WP_Post ) {
|
300 |
+
//return $file_name;
|
301 |
+
//}
|
302 |
+
//$file_unique_part = str_replace( self::$file_prefix, '', $file_name );
|
303 |
+
//if ( false === strpos( $file_unique_part, $post->ID . '.' ) ) {
|
304 |
+
//return $file_name;
|
305 |
+
//}
|
306 |
+
|
307 |
+
static $_file_names = null;
|
308 |
+
|
309 |
+
if ( ! is_null( $_file_names ) && ! empty( $_file_names[$file_name] ) ) {
|
310 |
+
return $_file_names[$file_name];
|
311 |
+
}
|
312 |
+
|
313 |
+
$_file_name = $file_name;
|
314 |
+
if ( false !== strpos( $file_name, '.css' ) ) {
|
315 |
+
$_file_name = str_replace( '.css', '-' . WPGlobus::Config()->language . '.css', $file_name );
|
316 |
+
}
|
317 |
+
|
318 |
+
$_file_names[$file_name] = $_file_name;
|
319 |
+
|
320 |
+
return $_file_name;
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Get meta callback.
|
325 |
+
*
|
326 |
+
* @scope front.
|
327 |
+
* @param $check
|
328 |
+
* @param $object_id
|
329 |
+
* @param $meta_key
|
330 |
+
* @param $single
|
331 |
+
*
|
332 |
+
* @return string
|
333 |
+
*/
|
334 |
+
public static function filter__get_metadata(
|
335 |
+
$check, $object_id, $meta_key, /** @noinspection PhpUnusedParameterInspection */
|
336 |
+
$single
|
337 |
+
) {
|
338 |
+
|
339 |
+
if ( self::$elementor_data_meta_key === $meta_key ) {
|
340 |
+
|
341 |
+
$meta_cache = wp_cache_get( $object_id, 'post_meta' );
|
342 |
+
|
343 |
+
if ( isset( $meta_cache[ $meta_key ] ) && isset( $meta_cache[ $meta_key ][0] ) ) {
|
344 |
+
|
345 |
+
/** @noinspection PhpUnusedLocalVariableInspection */
|
346 |
+
$_value = '';
|
347 |
+
|
348 |
+
if ( WPGlobus_Core::has_translations( $meta_cache[ $meta_key ][0] ) ) {
|
349 |
+
$_value = WPGlobus_Core::text_filter( $meta_cache[ $meta_key ][0], WPGlobus::Config()->language );
|
350 |
+
} else {
|
351 |
+
$_value = $meta_cache[ $meta_key ][0];
|
352 |
+
}
|
353 |
+
|
354 |
+
return $_value;
|
355 |
+
|
356 |
+
}
|
357 |
+
|
358 |
+
} elseif ( self::$elementor_css_meta_key === $meta_key ) {
|
359 |
+
|
360 |
+
if ( WPGlobus::Config()->language == WPGlobus::Config()->default_language ) {
|
361 |
+
return $check;
|
362 |
+
}
|
363 |
+
|
364 |
+
$meta_cache = wp_cache_get( $object_id, 'post_meta' );
|
365 |
+
|
366 |
+
if ( isset( $meta_cache[ self::$post_css_meta_key ] ) && isset( $meta_cache[ self::$post_css_meta_key ][0] ) ) {
|
367 |
+
|
368 |
+
$_value = '';
|
369 |
+
|
370 |
+
$has_translations = WPGlobus_Core::has_translations( $meta_cache[ self::$post_css_meta_key ][0] );
|
371 |
+
|
372 |
+
if ( $has_translations ) {
|
373 |
+
$_value = WPGlobus_Core::text_filter( $meta_cache[ self::$post_css_meta_key ][0], WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY );
|
374 |
+
}
|
375 |
+
|
376 |
+
if ( ! empty($_value) ) {
|
377 |
+
$_value = maybe_unserialize( $_value );
|
378 |
+
|
379 |
+
/**
|
380 |
+
* @todo may be better return value for default language.
|
381 |
+
*/
|
382 |
+
//if ( isset( $meta_cache[ self::$elementor_css_meta_key ] ) && isset( $meta_cache[ self::$elementor_css_meta_key ][0] ) ) {
|
383 |
+
//$_value = maybe_unserialize( $meta_cache[ self::$elementor_css_meta_key ] );
|
384 |
+
//}
|
385 |
+
}
|
386 |
+
|
387 |
+
return $_value;
|
388 |
+
}
|
389 |
+
|
390 |
+
}
|
391 |
+
|
392 |
+
return $check;
|
393 |
+
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* @since 2.1.15
|
397 |
+
*/
|
398 |
+
public static function filter__update_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
|
399 |
+
|
400 |
+
if ( self::$elementor_css_meta_key != $meta_key ) {
|
401 |
+
return $check;
|
402 |
+
}
|
403 |
+
|
404 |
+
if ( WPGlobus::Config()->language == WPGlobus::Config()->default_language ) {
|
405 |
+
return $check;
|
406 |
+
}
|
407 |
+
|
408 |
+
$meta_cache = wp_cache_get( $object_id, 'post_meta' );
|
409 |
+
|
410 |
+
if ( isset( $meta_cache[ self::$post_css_meta_key ] ) && isset( $meta_cache[ self::$post_css_meta_key ][0] ) ) {
|
411 |
+
|
412 |
+
$new_value = $check;
|
413 |
+
$_tr = array();
|
414 |
+
|
415 |
+
foreach( WPGlobus::Config()->enabled_languages as $language ) {
|
416 |
+
$_s = WPGlobus_Core::text_filter( $meta_cache[ self::$post_css_meta_key ][0], $language, WPGlobus::RETURN_EMPTY );
|
417 |
+
if ( ! empty( $_s ) ) {
|
418 |
+
$_tr[$language] = $_s;
|
419 |
+
}
|
420 |
+
}
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Fix for $meta_value[0].
|
424 |
+
*/
|
425 |
+
$meta_value[0] = '';
|
426 |
+
|
427 |
+
$_tr[WPGlobus::Config()->language] = maybe_serialize($meta_value);
|
428 |
+
$new_value = WPGlobus_Utils::build_multilingual_string($_tr);
|
429 |
+
|
430 |
+
if ( $new_value != $check ) {
|
431 |
+
|
432 |
+
global $wpdb;
|
433 |
+
|
434 |
+
$meta_value = $new_value;
|
435 |
+
$table = _get_meta_table('post');
|
436 |
+
$data = compact( 'meta_value' );
|
437 |
+
$where = array(
|
438 |
+
'post_id' => $object_id,
|
439 |
+
'meta_key' => self::$post_css_meta_key
|
440 |
+
);
|
441 |
+
|
442 |
+
$result = $wpdb->update( $table, $data, $where );
|
443 |
+
|
444 |
+
if ( ! $result ) {
|
445 |
+
return false;
|
446 |
+
}
|
447 |
+
|
448 |
+
}
|
449 |
+
|
450 |
+
return $new_value;
|
451 |
+
|
452 |
+
} else {
|
453 |
+
|
454 |
+
/**
|
455 |
+
* $meta_cache[ $meta_key ] is undefined.
|
456 |
+
*/
|
457 |
+
|
458 |
+
global $wpdb;
|
459 |
+
|
460 |
+
$_tr = array();
|
461 |
+
$_tr[WPGlobus::Config()->language] = maybe_serialize($meta_value);
|
462 |
+
$new_value = WPGlobus_Utils::build_multilingual_string($_tr);
|
463 |
+
|
464 |
+
$table = _get_meta_table('post');
|
465 |
+
|
466 |
+
$result = $wpdb->insert(
|
467 |
+
$table,
|
468 |
+
array(
|
469 |
+
'post_id' => $object_id,
|
470 |
+
'meta_key' => self::$post_css_meta_key,
|
471 |
+
'meta_value' => $new_value
|
472 |
+
),
|
473 |
+
array(
|
474 |
+
'%d',
|
475 |
+
'%s',
|
476 |
+
'%s'
|
477 |
+
)
|
478 |
+
);
|
479 |
+
|
480 |
+
if ( ! $result ) {
|
481 |
+
return false;
|
482 |
+
}
|
483 |
+
|
484 |
+
return $new_value;
|
485 |
+
}
|
486 |
+
|
487 |
+
return $check;
|
488 |
+
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* @since 2.3.6
|
493 |
+
*/
|
494 |
+
public static function filter__template_include_handler($handler) {
|
495 |
+
|
496 |
+
/**
|
497 |
+
* @W.I.P @since 2.4.12 Do we need to check is_builder_support?
|
498 |
+
*/
|
499 |
+
//if ( ! self::is_builder_support() ) {
|
500 |
+
//return $handler;
|
501 |
+
//}
|
502 |
+
|
503 |
+
/**
|
504 |
+
* Don't fire `template_include` filter with active Elementor
|
505 |
+
* to prevent `The preview could not be loaded` for language in draft status.
|
506 |
+
*/
|
507 |
+
if ( empty( $_GET['elementor-preview'] ) ) {
|
508 |
+
return $handler;
|
509 |
+
}
|
510 |
+
return false;
|
511 |
+
}
|
512 |
+
} // end class WPGlobus_Elementor_Front.
|
513 |
+
|
514 |
+
endif;
|
515 |
+
|
516 |
+
# --- EOF
|
trunk/includes/builders/elementor/class-wpglobus-elementor-update-post.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-elementor-update-post.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\Elementor
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_elementor_Update_Post.
|
11 |
+
*/
|
12 |
+
if ( ! class_exists( 'WPGlobus_elementor_Update_Post' ) ) :
|
13 |
+
|
14 |
+
// phpcs:ignore PEAR.NamingConventions
|
15 |
+
class WPGlobus_elementor_Update_Post extends WPGlobus_Builder_Update_Post {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
parent::__construct( 'elementor' );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
26 |
+
*/
|
27 |
+
remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @todo incorrect the saving post in extra languages with priority = 10
|
31 |
+
*/
|
32 |
+
add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Callback for 'wp_insert_post_data'.
|
38 |
+
*
|
39 |
+
* @param array $data
|
40 |
+
* @param array $postarr
|
41 |
+
*
|
42 |
+
* @return mixed
|
43 |
+
*/
|
44 |
+
public function filter__wp_insert_post_data( $data, $postarr ) {
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Prevent to filter disabled post type.
|
48 |
+
*
|
49 |
+
* @since 2.1.4
|
50 |
+
*/
|
51 |
+
if ( in_array( $data['post_type'], WPGlobus::Config()->disabled_entities, true ) ) {
|
52 |
+
return $data;
|
53 |
+
}
|
54 |
+
|
55 |
+
global $wpdb;
|
56 |
+
$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d AND post_type = %s LIMIT 1", $postarr['ID'], $postarr['post_type'] ) );
|
57 |
+
|
58 |
+
$fields = array();
|
59 |
+
if ( isset( $postarr['post_title'] ) ) {
|
60 |
+
$fields['post_title'] = $postarr['post_title'];
|
61 |
+
}
|
62 |
+
|
63 |
+
if ( isset( $postarr['post_content'] ) ) {
|
64 |
+
$fields['post_content'] = $postarr['post_content'];
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( isset( $postarr['post_excerpt'] ) ) {
|
68 |
+
$fields['post_excerpt'] = $postarr['post_excerpt'];
|
69 |
+
}
|
70 |
+
|
71 |
+
$builder_language = WPGlobus::Config()->builder->get_language();
|
72 |
+
|
73 |
+
if ( empty( $builder_language ) ) {
|
74 |
+
|
75 |
+
if ( empty( $postarr[ WPGlobus::get_language_meta_key() ] ) ) {
|
76 |
+
$builder_language = WPGlobus::Config()->default_language;
|
77 |
+
} else {
|
78 |
+
$builder_language = $postarr[ WPGlobus::get_language_meta_key() ];
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
foreach ( $fields as $field => $value ) {
|
83 |
+
|
84 |
+
$tr = array();
|
85 |
+
|
86 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
87 |
+
|
88 |
+
if ( $lang === $builder_language ) {
|
89 |
+
|
90 |
+
$text = $value;
|
91 |
+
if ( WPGlobus_Core::has_translations( $value ) ) {
|
92 |
+
$text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
|
93 |
+
}
|
94 |
+
if ( ! empty( $text ) ) {
|
95 |
+
$tr[ $lang ] = $text;
|
96 |
+
}
|
97 |
+
} else {
|
98 |
+
if ( isset( $_post->$field ) ) {
|
99 |
+
$text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
|
100 |
+
if ( ! empty( $text ) ) {
|
101 |
+
$tr[ $lang ] = $text;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
endforeach;
|
107 |
+
|
108 |
+
$data[ $field ] = WPGlobus_Utils::build_multilingual_string( $tr );
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
return $data;
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
endif;
|
trunk/includes/builders/elementor/class-wpglobus-elementor.php
ADDED
@@ -0,0 +1,687 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-elementor.php
|
4 |
+
*
|
5 |
+
* @since 2.2.31 We are providing support for `External File` only. @see elementor\core\files\css\base.php::use_external_file().
|
6 |
+
* @since 2.4.12 Disable elementor support for post, that doesn't use elementor builder.
|
7 |
+
Add submit box switcher to ON/OFF elementor's support.
|
8 |
+
*
|
9 |
+
* @package WPGlobus\Builders\Elementor
|
10 |
+
* @author Alex Gor(alexgff)
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( file_exists( WP_PLUGIN_DIR . '/elementor/core/files/manager.php' ) ) {
|
14 |
+
require_once( WP_PLUGIN_DIR . '/elementor/core/files/manager.php' );
|
15 |
+
}
|
16 |
+
|
17 |
+
if ( ! class_exists( 'WPGlobus_Elementor' ) ) :
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Class WPGlobus_Elementor.
|
21 |
+
*/
|
22 |
+
class WPGlobus_Elementor extends WPGlobus_Builder {
|
23 |
+
|
24 |
+
protected $base_redirect_url = '';
|
25 |
+
|
26 |
+
protected $post_content = null;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @since 2.1.15
|
30 |
+
*/
|
31 |
+
protected static $post_css_meta_key = null;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @since 2.1.15
|
35 |
+
*/
|
36 |
+
protected static $elementor_data_meta_key = null;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @since 2.4.12
|
40 |
+
*/
|
41 |
+
protected static $elementor_edit_mode_meta_key = null;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @since 2.4.12
|
45 |
+
*/
|
46 |
+
protected static $post_elementor_support_meta_key = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @since 2.4.12
|
50 |
+
*/
|
51 |
+
protected static $post_elementor_support_get_key = 'wpglobus-elementor-support';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* @since 2.4.12
|
55 |
+
*/
|
56 |
+
protected static $post_elementor_support = null;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Constructor.
|
60 |
+
*/
|
61 |
+
public function __construct() {
|
62 |
+
|
63 |
+
parent::__construct( 'elementor' );
|
64 |
+
|
65 |
+
$_post_css_meta_key = WPGlobus::Config()->builder->get('post_css_meta_key');
|
66 |
+
if ( ! empty( $_post_css_meta_key ) ) {
|
67 |
+
self::$post_css_meta_key = $_post_css_meta_key;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* @since 2.4.12
|
72 |
+
*/
|
73 |
+
$_post_support_meta_key = WPGlobus::Config()->builder->get('post_support_meta_key');
|
74 |
+
if ( ! empty( $_post_support_meta_key ) ) {
|
75 |
+
self::$post_elementor_support_meta_key = $_post_support_meta_key;
|
76 |
+
}
|
77 |
+
|
78 |
+
$_elementor_data_meta_key = WPGlobus::Config()->builder->get('elementor_data_meta_key');
|
79 |
+
if ( ! empty( $_elementor_data_meta_key ) ) {
|
80 |
+
self::$elementor_data_meta_key = $_elementor_data_meta_key;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @since 2.4.12
|
85 |
+
*/
|
86 |
+
$_elementor_edit_mode_meta_key = WPGlobus::Config()->builder->get('elementor_edit_mode_meta_key');
|
87 |
+
if ( ! empty( $_elementor_edit_mode_meta_key ) ) {
|
88 |
+
self::$elementor_edit_mode_meta_key = $_elementor_edit_mode_meta_key;
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( isset( $_GET['action'] ) && 'elementor' === $_GET['action'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
92 |
+
/**
|
93 |
+
* @see wp-includes/revision.php
|
94 |
+
*/
|
95 |
+
$post_id = $_GET['post']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
96 |
+
if ( (int) $post_id > 0 ) {
|
97 |
+
$revision = wp_get_post_autosave( $post_id );
|
98 |
+
if ( is_object( $revision ) ) {
|
99 |
+
wp_delete_post_revision( $revision->ID );
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* @see wpglobus\includes\class-wpglobus.php
|
106 |
+
*
|
107 |
+
* @since 2.4.12
|
108 |
+
*/
|
109 |
+
add_action( 'wpglobus_submitbox_action', array( $this, 'on__submitbox_switcher' ) );
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
113 |
+
* @todo remove after test.
|
114 |
+
*/
|
115 |
+
remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
|
116 |
+
|
117 |
+
add_filter( 'get_post_metadata', array( $this, 'filter__post_metadata' ), 13, 4 );
|
118 |
+
|
119 |
+
// @todo may be need this filter for admin, @see includes\builders\elementor\class-wpglobus-elementor-front.php
|
120 |
+
//add_filter( 'update_post_metadata', array( $this, 'filter__update_metadata' ), 5, 5 );
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Elementor editor footer.
|
124 |
+
*
|
125 |
+
* @see_file elementor\includes\editor.php
|
126 |
+
*/
|
127 |
+
add_action( 'elementor/editor/footer', array( $this, 'on__elementor_footer' ), 100 );
|
128 |
+
|
129 |
+
/**
|
130 |
+
* @since 2.2.11
|
131 |
+
* @W.I.P
|
132 |
+
* @see meta classic-editor-remember = block-editor OR classic-editor
|
133 |
+
* @todo maybe to use `wp_footer` action instead of `elementor/editor/footer`.
|
134 |
+
*/
|
135 |
+
//add_action( 'wp_footer', array( $this, 'on__elementor_footer' ), 100 );
|
136 |
+
|
137 |
+
/**
|
138 |
+
* @since 2.2.11
|
139 |
+
* @W.I.P
|
140 |
+
* @todo maybe useful
|
141 |
+
*/
|
142 |
+
//add_filter( 'elementor/editor/localize_settings', array( $this, 'on__localize_settings' ), 10, 2 );
|
143 |
+
//add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'on__localize_settings' ) );
|
144 |
+
|
145 |
+
/**
|
146 |
+
* AJAX handling.
|
147 |
+
*/
|
148 |
+
if ( defined('DOING_AJAX') && DOING_AJAX ) {
|
149 |
+
if ( 'elementor_ajax' == $_POST['action'] && false !== strpos($_POST['actions'], '"action":"save_builder"') ) {
|
150 |
+
if ( class_exists( '\Elementor\Core\Files\Manager' ) ) {
|
151 |
+
/**
|
152 |
+
* Clear Elementor cache and WPGlobus css meta.
|
153 |
+
* @since 2.1.15
|
154 |
+
*/
|
155 |
+
$_fm = new \Elementor\Core\Files\Manager;
|
156 |
+
$_fm->clear_cache();
|
157 |
+
if ( ! is_null(self::$post_css_meta_key) ) {
|
158 |
+
update_post_meta( WPGlobus::Config()->builder->get('post_id'), self::$post_css_meta_key, '' );
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
if ( is_admin() ) {
|
165 |
+
|
166 |
+
/**
|
167 |
+
* @since 2.2.31
|
168 |
+
*/
|
169 |
+
add_action( 'admin_notices', array( $this, 'on__admin_notice' ) );
|
170 |
+
|
171 |
+
add_filter( 'the_post', array( $this, 'filter__the_post' ), 5 );
|
172 |
+
|
173 |
+
/**
|
174 |
+
* @see_file elementor\core\base\document.php
|
175 |
+
*/
|
176 |
+
add_filter( 'elementor/document/urls/edit', array( $this, 'filter__url' ), 5, 2 );
|
177 |
+
|
178 |
+
/**
|
179 |
+
* @see_file elementor\core\base\document.php
|
180 |
+
*/
|
181 |
+
add_filter( 'elementor/document/urls/exit_to_dashboard', array( $this, 'filter__url' ), 5, 2 );
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Filter Preview Button link in elementor side panel.
|
185 |
+
*
|
186 |
+
* @see_file elementor\core\base\document.php
|
187 |
+
*/
|
188 |
+
add_filter( 'elementor/document/urls/wp_preview', array( $this, 'filter__preview_url' ), 5, 2 );
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Filter for URL in elementor-preview-iframe.
|
192 |
+
*
|
193 |
+
* @see_file elementor\core\base\document.php
|
194 |
+
*/
|
195 |
+
add_filter( 'elementor/document/urls/preview', array( $this, 'filter__preview_url' ), 5, 2 );
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Filters the editor localized settings.
|
199 |
+
*
|
200 |
+
* @since 2.2.6
|
201 |
+
*
|
202 |
+
* @see_file elementor\includes\editor.php
|
203 |
+
*/
|
204 |
+
add_filter( 'elementor/editor/localize_settings', array( $this, 'filter__localize_settings' ), 5, 2 );
|
205 |
+
}
|
206 |
+
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* @since 2.4.12
|
211 |
+
*/
|
212 |
+
public function on__submitbox_switcher( $post ) {
|
213 |
+
|
214 |
+
if ( ! $post instanceof WP_Post ) {
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
|
218 |
+
if ( 'builder' !== get_post_meta( $post->ID, $this->get_elementor_edit_mode_meta_key(), true ) ) {
|
219 |
+
/**
|
220 |
+
* Disable elementor support for post, that doesn't use elementor builder.
|
221 |
+
*/
|
222 |
+
self::$post_elementor_support = false;
|
223 |
+
return;
|
224 |
+
}
|
225 |
+
|
226 |
+
if ( ! empty( $_GET[ self::$post_elementor_support_get_key ] ) ) {
|
227 |
+
$current_mode = sanitize_text_field( $_GET[ self::$post_elementor_support_get_key ] );
|
228 |
+
if ( in_array( $current_mode, array('on', 'off') ) ) {
|
229 |
+
update_post_meta( $post->ID, self::$post_elementor_support_meta_key, $current_mode );
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
$elementor_support = get_post_meta( $post->ID, self::$post_elementor_support_meta_key, true );
|
234 |
+
|
235 |
+
if ( 'off' === $elementor_support ) {
|
236 |
+
self::$post_elementor_support = false;
|
237 |
+
} else {
|
238 |
+
$elementor_support = 'on';
|
239 |
+
self::$post_elementor_support = true;
|
240 |
+
}
|
241 |
+
|
242 |
+
// "Reverse" logic here. It's the mode to turn to, not the current one.
|
243 |
+
$switch_to_mode = 'off';
|
244 |
+
if ( 'off' === $elementor_support ) {
|
245 |
+
$switch_to_mode = 'on';
|
246 |
+
}
|
247 |
+
|
248 |
+
if ( 'off' === $elementor_support ) {
|
249 |
+
// Translators: ON/OFF status of WPGlobus on the edit pages.
|
250 |
+
$status_text = __( 'OFF', 'wpglobus' );
|
251 |
+
$toggle_text = __( 'Turn on', 'wpglobus' );
|
252 |
+
$highlight_class = 'wp-ui-text-notification';
|
253 |
+
} else {
|
254 |
+
// Translators: ON/OFF status of WPGlobus on the edit pages.
|
255 |
+
$status_text = __( 'ON', 'wpglobus' );
|
256 |
+
$toggle_text = __( 'Turn off', 'wpglobus' );
|
257 |
+
$highlight_class = 'wp-ui-text-highlight';
|
258 |
+
}
|
259 |
+
|
260 |
+
$query_string = explode( '&', $_SERVER['QUERY_STRING'] );
|
261 |
+
|
262 |
+
foreach ( $query_string as $key => $_q ) {
|
263 |
+
if ( false !== strpos( $_q, 'wpglobus=' ) ) {
|
264 |
+
unset( $query_string[ $key ] );
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
$query = implode( '&', $query_string );
|
269 |
+
|
270 |
+
$url = admin_url(
|
271 |
+
add_query_arg(
|
272 |
+
array( self::$post_elementor_support_get_key => $switch_to_mode ),
|
273 |
+
'post.php?' . $query
|
274 |
+
)
|
275 |
+
);
|
276 |
+
|
277 |
+
?>
|
278 |
+
<div class="misc-pub-section wpglobus-elementor-support-switch">
|
279 |
+
<span id="wpglobus-elementor-support-raw" style="margin-right: 2px;"
|
280 |
+
class="dashicons dashicons-admin-site <?php echo esc_attr( $highlight_class ); ?>"></span>
|
281 |
+
<?php esc_html_e( 'Elementor', 'wpglobus' ); ?>:
|
282 |
+
<strong class="<?php echo esc_attr( $highlight_class ); ?>"><?php echo esc_html( $status_text ); ?></strong>
|
283 |
+
<a class="button button-small" style="margin:-3px 0 0 3px;"
|
284 |
+
href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $toggle_text ); ?></a>
|
285 |
+
</div>
|
286 |
+
<?php
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* @since 2.4.12
|
291 |
+
*/
|
292 |
+
public function is_elementor_support() {
|
293 |
+
|
294 |
+
if ( is_null( self::$post_elementor_support ) ) {
|
295 |
+
|
296 |
+
global $post;
|
297 |
+
|
298 |
+
$elementor_support = get_post_meta( $post->ID, self::$post_elementor_support_meta_key, true );
|
299 |
+
|
300 |
+
if ( 'off' === $elementor_support ) {
|
301 |
+
self::$post_elementor_support = false;
|
302 |
+
} else {
|
303 |
+
self::$post_elementor_support = true;
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
if ( self::$post_elementor_support ) {
|
308 |
+
return true;
|
309 |
+
}
|
310 |
+
|
311 |
+
return false;
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* @since 2.4.12
|
316 |
+
*/
|
317 |
+
public function get_elementor_edit_mode_meta_key() {
|
318 |
+
return self::$elementor_edit_mode_meta_key;
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Localize editor settings.
|
323 |
+
*
|
324 |
+
* Filters the editor localized settings.
|
325 |
+
*
|
326 |
+
* @since 2.2.6
|
327 |
+
*
|
328 |
+
* @param array $localized_settings Localized settings.
|
329 |
+
* @param int $post_id The ID of the current post being edited.
|
330 |
+
*
|
331 |
+
* @return array
|
332 |
+
*/
|
333 |
+
public function filter__localize_settings( $localized_settings, $post_id ) {
|
334 |
+
|
335 |
+
if ( WPGlobus::Config()->builder->is_default_language() ) {
|
336 |
+
return $localized_settings;
|
337 |
+
}
|
338 |
+
|
339 |
+
/**
|
340 |
+
* @since 2.4.12
|
341 |
+
*/
|
342 |
+
if ( ! $this->is_elementor_support() ) {
|
343 |
+
return $localized_settings;
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* @since 2.2.31
|
348 |
+
*/
|
349 |
+
if ( 'external' !== WPGlobus::Config()->builder->get('elementor_css_print_method') ) {
|
350 |
+
return $localized_settings;
|
351 |
+
}
|
352 |
+
|
353 |
+
$url = get_permalink( $post_id );
|
354 |
+
|
355 |
+
$localized_settings['document']['urls']['permalink'] = WPGlobus_Utils::localize_url( $url, WPGlobus::Config()->builder->get_language() );
|
356 |
+
|
357 |
+
return $localized_settings;
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* To avoid output content with language marks from $post->post_content field on elementor builder page
|
362 |
+
* if "_elementor_data" meta has not content in extra language.
|
363 |
+
*
|
364 |
+
* @param WP_Post $object
|
365 |
+
*
|
366 |
+
* @return WP_Post
|
367 |
+
*/
|
368 |
+
public function filter__the_post( $object ) {
|
369 |
+
|
370 |
+
if ( 'post.php' !== WPGlobus::Config()->builder->get( 'pagenow' ) ) {
|
371 |
+
return $object;
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* @since 2.4.12
|
376 |
+
*/
|
377 |
+
if ( ! $this->is_elementor_support() ) {
|
378 |
+
return $object;
|
379 |
+
}
|
380 |
+
|
381 |
+
if ( is_null( $this->post_content ) ) {
|
382 |
+
$this->post_content = $object->post_content;
|
383 |
+
}
|
384 |
+
|
385 |
+
$_post = clone( $object );
|
386 |
+
$_post->post_content = WPGlobus_Core::text_filter( $this->post_content, WPGlobus::Config()->builder->get_language(), WPGlobus::RETURN_EMPTY );
|
387 |
+
|
388 |
+
/**
|
389 |
+
* @see \wp-includes\cache.php
|
390 |
+
*/
|
391 |
+
wp_cache_replace( $object->ID, $_post, 'posts' );
|
392 |
+
|
393 |
+
return $object;
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* @todo W.I.P
|
398 |
+
*/
|
399 |
+
public static function filter__update_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
|
400 |
+
if ( '_elementor_css' != $meta_key ) {
|
401 |
+
return $check;
|
402 |
+
}
|
403 |
+
return $check;
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Get meta callback.
|
408 |
+
*
|
409 |
+
* @param $check
|
410 |
+
* @param $object_id
|
411 |
+
* @param $meta_key
|
412 |
+
* @param $single
|
413 |
+
*
|
414 |
+
* @return string
|
415 |
+
*/
|
416 |
+
public static function filter__post_metadata(
|
417 |
+
$check, $object_id, $meta_key, /** @noinspection PhpUnusedParameterInspection */
|
418 |
+
$single
|
419 |
+
) {
|
420 |
+
|
421 |
+
if ( self::$elementor_data_meta_key === $meta_key ) {
|
422 |
+
|
423 |
+
$meta_cache = wp_cache_get( $object_id, 'post_meta' );
|
424 |
+
|
425 |
+
if ( is_admin() ) {
|
426 |
+
|
427 |
+
if ( isset( $meta_cache[ $meta_key ] ) && isset( $meta_cache[ $meta_key ][0] ) ) {
|
428 |
+
|
429 |
+
$_value = '';
|
430 |
+
|
431 |
+
if ( WPGlobus_Core::has_translations( $meta_cache[ $meta_key ][0] ) ) {
|
432 |
+
$_value = WPGlobus_Core::text_filter( $meta_cache[ $meta_key ][0], WPGlobus::Config()->builder->get_language() );
|
433 |
+
} else {
|
434 |
+
$_value = $meta_cache[ $meta_key ][0];
|
435 |
+
}
|
436 |
+
|
437 |
+
return $_value;
|
438 |
+
|
439 |
+
}
|
440 |
+
} else {
|
441 |
+
|
442 |
+
/**
|
443 |
+
* scope front.
|
444 |
+
*/
|
445 |
+
|
446 |
+
if ( isset( $meta_cache[ $meta_key ] ) && isset( $meta_cache[ $meta_key ][0] ) ) {
|
447 |
+
|
448 |
+
/** @noinspection PhpUnusedLocalVariableInspection */
|
449 |
+
$_value = '';
|
450 |
+
|
451 |
+
if ( WPGlobus_Core::has_translations( $meta_cache[ $meta_key ][0] ) ) {
|
452 |
+
//$_value = WPGlobus_Core::text_filter( $meta_cache[ $meta_key ][0], WPGlobus::Config()->builder->get_language(), WPGlobus::RETURN_EMPTY );
|
453 |
+
/**
|
454 |
+
* We can get current language from WPGlobus::Config().
|
455 |
+
*
|
456 |
+
* @todo just for testing purposes.
|
457 |
+
*/
|
458 |
+
//$_value = WPGlobus_Core::text_filter( $meta_cache[ $meta_key ][0], WPGlobus::Config()->language );
|
459 |
+
|
460 |
+
$_value = WPGlobus_Core::text_filter( $meta_cache[ $meta_key ][0], WPGlobus::Config()->builder->get_language() );
|
461 |
+
} else {
|
462 |
+
$_value = $meta_cache[ $meta_key ][0];
|
463 |
+
}
|
464 |
+
|
465 |
+
return $_value;
|
466 |
+
|
467 |
+
}
|
468 |
+
}
|
469 |
+
}
|
470 |
+
|
471 |
+
return $check;
|
472 |
+
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* Elementor editor footer.
|
477 |
+
*
|
478 |
+
* Fires on Elementor editor before closing the body tag.
|
479 |
+
* Used to prints scripts or any other HTML before closing the body tag.
|
480 |
+
*/
|
481 |
+
public function on__elementor_footer() {
|
482 |
+
|
483 |
+
/**
|
484 |
+
* @since 2.4.12
|
485 |
+
*/
|
486 |
+
if ( ! $this->is_elementor_support() ) {
|
487 |
+
return;
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* @since 2.2.31
|
492 |
+
*/
|
493 |
+
if ( 'external' != WPGlobus::Config()->builder->get('elementor_css_print_method') ) {
|
494 |
+
return;
|
495 |
+
}
|
496 |
+
|
497 |
+
$this->base_redirect_url = str_replace( array( '&language=' . WPGlobus::Config()->builder->get_language() ), '', $this->base_redirect_url );
|
498 |
+
$this->base_redirect_url = str_replace( '&action=edit', '&action=elementor', $this->base_redirect_url );
|
499 |
+
?>
|
500 |
+
<div id="wpglobus-elementor-wrapper">
|
501 |
+
<div class="elementor-panel-menu-item" id="wpglobus-elementor-panel-menu-item" style="cursor:auto;">
|
502 |
+
<div class="elementor-panel-menu-item-icon">
|
503 |
+
<i class="fa fa-globe"></i>
|
504 |
+
</div>
|
505 |
+
<div class="elementor-panel-menu-item-title" id="wpglobus-elementor-selector-box"
|
506 |
+
style="padding-top:0;">
|
507 |
+
<span id="wpglobus-elementor-selector-title"
|
508 |
+
style="cursor:pointer;"><?php esc_html_e( 'WPGlobus languages', 'wpglobus' ); ?></span>
|
509 |
+
<ul id="wpglobus-elementor-selector" style="display:none;margin:10px;" class="hidden">
|
510 |
+
<?php
|
511 |
+
foreach ( WPGlobus::Config()->enabled_languages as $language ) {
|
512 |
+
$_current = '';
|
513 |
+
if ( $language == WPGlobus::Config()->builder->get_language() ) {
|
514 |
+
$_current = esc_html__( 'current', 'wpglobus' );
|
515 |
+
$_current = ' - ' . $_current;
|
516 |
+
}
|
517 |
+
?>
|
518 |
+
<li style="margin-bottom:10px;cursor:auto;">
|
519 |
+
<a href="<?php echo esc_url( $this->base_redirect_url . '&language=' . $language ); ?>"><?php echo esc_html( WPGlobus::Config()->en_language_name[ $language ] . " ($language)" ); echo $_current; ?></a>
|
520 |
+
</li>
|
521 |
+
<?php
|
522 |
+
}
|
523 |
+
?>
|
524 |
+
</ul>
|
525 |
+
</div>
|
526 |
+
</div>
|
527 |
+
</div>
|
528 |
+
<?php // phpcs:disable ?>
|
529 |
+
<script type='text/javascript'>
|
530 |
+
/* <![CDATA[ */
|
531 |
+
var WPGlobusTimeID;
|
532 |
+
WPGlobusTimeID = setInterval(function(){
|
533 |
+
if ( jQuery("#elementor-panel-header-menu-button").length === 0 || 'undefined' === typeof elementor.config.version ) {
|
534 |
+
return;
|
535 |
+
}
|
536 |
+
clearInterval(WPGlobusTimeID);
|
537 |
+
var wpglobusElementorPanelMenu = jQuery("#wpglobus-elementor-wrapper").html();
|
538 |
+
jQuery(document).on('click', "#elementor-panel-header-menu-button", function () {
|
539 |
+
if ( elementor.config.version[0] == '3' ) {
|
540 |
+
jQuery(".elementor-panel-menu-item-exit-to-dashboard").before(wpglobusElementorPanelMenu);
|
541 |
+
} else {
|
542 |
+
jQuery(".elementor-panel-menu-item").eq(7).after(wpglobusElementorPanelMenu);
|
543 |
+
}
|
544 |
+
});
|
545 |
+
jQuery(document).on('click', "#wpglobus-elementor-selector-title", function () {
|
546 |
+
var $t = jQuery("#wpglobus-elementor-selector");
|
547 |
+
$t.toggleClass('hidden');
|
548 |
+
if ($t.hasClass('hidden')) {
|
549 |
+
$t.css({'display': 'none'});
|
550 |
+
jQuery('#wpglobus-elementor-selector-box').css({'padding-top': '0'});
|
551 |
+
} else {
|
552 |
+
jQuery('#wpglobus-elementor-selector-box').css({'padding-top': '10px'});
|
553 |
+
$t.css({'display': 'block'});
|
554 |
+
}
|
555 |
+
});
|
556 |
+
}, 500);
|
557 |
+
/* ]]> */
|
558 |
+
</script>
|
559 |
+
<?php // phpcs:enable ?>
|
560 |
+
<?php
|
561 |
+
}
|
562 |
+
|
563 |
+
/**
|
564 |
+
* Document edit url.
|
565 |
+
*
|
566 |
+
* Filters the document edit url.
|
567 |
+
*
|
568 |
+
* @param string $url The edit url.
|
569 |
+
* @param mixed $instance The document instance.
|
570 |
+
*
|
571 |
+
* @return string
|
572 |
+
*/
|
573 |
+
public function filter__url(
|
574 |
+
$url,
|
575 |
+
/**
|
576 |
+
* Unused.
|
577 |
+
*
|
578 |
+
* @noinspection PhpUnusedParameterInspection
|
579 |
+
*/
|
580 |
+
$instance
|
581 |
+
) {
|
582 |
+
|
583 |
+
/**
|
584 |
+
* @since 2.4.12
|
585 |
+
*/
|
586 |
+
if ( ! $this->is_elementor_support() ) {
|
587 |
+
return $url;
|
588 |
+
}
|
589 |
+
|
590 |
+
if ( 'external' === WPGlobus::Config()->builder->get('elementor_css_print_method') ) {
|
591 |
+
if ( false === strpos( $url, 'language' ) ) {
|
592 |
+
$url = $url . '&language=' . WPGlobus::Config()->builder->get_language();
|
593 |
+
}
|
594 |
+
} else {
|
595 |
+
if ( false === strpos( $url, 'language' ) ) {
|
596 |
+
$url = $url . '&language=' . WPGlobus::Config()->default_language;
|
597 |
+
}
|
598 |
+
}
|
599 |
+
|
600 |
+
$this->base_redirect_url = $url;
|
601 |
+
|
602 |
+
return $url;
|
603 |
+
}
|
604 |
+
|
605 |
+
/**
|
606 |
+
* Document "WordPress preview" URL.
|
607 |
+
*
|
608 |
+
* Filters the WordPress preview URL.
|
609 |
+
*
|
610 |
+
* @param string $url WordPress preview URL.
|
611 |
+
* @param mixed $instance The document instance.
|
612 |
+
*
|
613 |
+
* @return string
|
614 |
+
*/
|
615 |
+
public function filter__preview_url(
|
616 |
+
$url,
|
617 |
+
/**
|
618 |
+
* Unused.
|
619 |
+
*
|
620 |
+
* @noinspection PhpUnusedParameterInspection
|
621 |
+
*/
|
622 |
+
$instance
|
623 |
+
) {
|
624 |
+
|
625 |
+
/**
|
626 |
+
* @since 2.4.12
|
627 |
+
*/
|
628 |
+
if ( ! $this->is_elementor_support() ) {
|
629 |
+
return $url;
|
630 |
+
}
|
631 |
+
|
632 |
+
/**
|
633 |
+
* @since 2.2.31
|
634 |
+
*/
|
635 |
+
if ( 'external' !== WPGlobus::Config()->builder->get('elementor_css_print_method') ) {
|
636 |
+
return $url;
|
637 |
+
}
|
638 |
+
|
639 |
+
$url = WPGlobus_Utils::localize_url( $url, WPGlobus::Config()->builder->get_language() );
|
640 |
+
|
641 |
+
return $url;
|
642 |
+
}
|
643 |
+
|
644 |
+
/**
|
645 |
+
* Prints admin screen notices.
|
646 |
+
*
|
647 |
+
* @since 2.2.31
|
648 |
+
*/
|
649 |
+
public function on__admin_notice() {
|
650 |
+
|
651 |
+
if ( 'post.php' != WPGlobus::Config()->builder->get('pagenow') ) {
|
652 |
+
return;
|
653 |
+
}
|
654 |
+
|
655 |
+
/**
|
656 |
+
* @since 2.4.12
|
657 |
+
*/
|
658 |
+
if ( ! $this->is_elementor_support() ) {
|
659 |
+
return;
|
660 |
+
}
|
661 |
+
|
662 |
+
if ( 'external' == WPGlobus::Config()->builder->get('elementor_css_print_method') ) {
|
663 |
+
return;
|
664 |
+
}
|
665 |
+
|
666 |
+
$_url = add_query_arg(
|
667 |
+
array(
|
668 |
+
'page' => 'elementor#tab-advanced',
|
669 |
+
),
|
670 |
+
admin_url( 'admin.php' )
|
671 |
+
);
|
672 |
+
|
673 |
+
echo '<div class="notice error"><p>';
|
674 |
+
printf(
|
675 |
+
esc_html__( 'WPGlobus provides multilingual support for Elementor only when the option %1$s%2$s%3$s is set to %4$s.', 'wpglobus' ),
|
676 |
+
'<a href="'.$_url.'" target="_blank">',
|
677 |
+
'<strong>CSS Print Method</strong>',
|
678 |
+
'</a>',
|
679 |
+
'<strong>External File</strong>'
|
680 |
+
);
|
681 |
+
echo '</p></div>';
|
682 |
+
}
|
683 |
+
}
|
684 |
+
|
685 |
+
endif;
|
686 |
+
|
687 |
+
# --- EOF
|
trunk/includes/builders/elementor/readme.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* File: readme.txt
|
3 |
+
*
|
4 |
+
* @package WPGlobus\Builders\Elementor
|
5 |
+
* @author Alex Gor(alexgff)
|
6 |
+
*/
|
7 |
+
|
8 |
+
The handling of post meta fields @see wpglobus\configs\elementor.json
|
trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site,.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site *{fill:#0000ff !important;display:none}.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site,.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site *{fill:#0000ff;display:none}.edit-post-pinned-plugins .wpglobus-switcher-button{border-color:#cccccc;border-radius:3px}.wpglobus-block-editor-panel__notice{border-left:0}.wpglobus-block-editor-panel__notice .components-notice__content{margin-top:0;margin-bottom:0;color:#000;font-weight:500}.edit-post-layout .wpglobus-block-editor-panel__notice.components-notice{min-height:0}.edit-post-layout .wpglobus-block-editor-panel__settings-link{float:right;margin-bottom:10px}.edit-post-layout .wpglobus-block-editor-panel__info{float:left;margin-bottom:10px}.edit-post-layout .wpglobus-block-editor-panel__flag{vertical-align:middle}
|
2 |
+
|
3 |
+
/*# sourceMappingURL=wpglobus-block-editor.css.map */
|
trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["wpglobus-block-editor.scss"],"names":[],"mappings":"AAAA,8KAEE,uBAAwB,CACxB,YAAa,CACd,0LAIC,YAAa,CACb,YAAa,CACd,oDAGC,oBAAqB,CACrB,iBAAkB,CACnB,qCAGC,aAAc,CACf,iEAGC,YAAa,CACb,eAAgB,CAChB,UAAW,CACX,eAAgB,CACjB,yEAGC,YAAa,CACd,8DAGC,WAAY,CACZ,kBAAmB,CACpB,qDAGC,UAAW,CACX,kBAAmB,CACpB,qDAGC,qBAAsB","file":"wpglobus-block-editor.css"}
|
trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.scss
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site,
|
2 |
+
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site * {
|
3 |
+
fill: #0000ff !important;
|
4 |
+
display: none;
|
5 |
+
}
|
6 |
+
|
7 |
+
.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site,
|
8 |
+
.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site * {
|
9 |
+
fill: #0000ff;
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
.edit-post-pinned-plugins .wpglobus-switcher-button {
|
14 |
+
border-color: #cccccc;
|
15 |
+
border-radius: 3px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.wpglobus-block-editor-panel__notice {
|
19 |
+
border-left: 0;
|
20 |
+
}
|
21 |
+
|
22 |
+
.wpglobus-block-editor-panel__notice .components-notice__content {
|
23 |
+
margin-top: 0;
|
24 |
+
margin-bottom: 0;
|
25 |
+
color: #000;
|
26 |
+
font-weight: 500;
|
27 |
+
}
|
28 |
+
|
29 |
+
.edit-post-layout .wpglobus-block-editor-panel__notice.components-notice {
|
30 |
+
min-height: 0;
|
31 |
+
}
|
32 |
+
|
33 |
+
.edit-post-layout .wpglobus-block-editor-panel__settings-link {
|
34 |
+
float: right;
|
35 |
+
margin-bottom: 10px;
|
36 |
+
}
|
37 |
+
|
38 |
+
.edit-post-layout .wpglobus-block-editor-panel__info {
|
39 |
+
float: left;
|
40 |
+
margin-bottom: 10px;
|
41 |
+
}
|
42 |
+
|
43 |
+
.edit-post-layout .wpglobus-block-editor-panel__flag {
|
44 |
+
vertical-align: middle;
|
45 |
+
}
|
trunk/includes/builders/gutenberg/assets/css/dist/wpglobus-switcher.css
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site,
|
2 |
+
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site *{fill:#0000ff !important;display:none}
|
3 |
+
.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site,
|
4 |
+
.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site *{fill:#0000ff;display:none}
|
5 |
+
.edit-post-pinned-plugins .wpglobus-switcher-button{border-color:#cccccc;border-radius:3px}
|
6 |
+
.edit-post-layout .wpglobus-switcher-panel__notice.components-notice{min-height:0}
|
7 |
+
.edit-post-layout .wpglobus-switcher-panel__settings-link{float:right;margin-bottom:10px}
|
8 |
+
.edit-post-layout .wpglobus-switcher-panel__info{float:left;margin-bottom:10px}
|
9 |
+
.edit-post-layout .wpglobus-switcher-panel__flag{vertical-align:middle}
|
10 |
+
.wpglobus-switcher-panel__notice{border-left:0}
|
11 |
+
.wpglobus-switcher-panel__notice .components-notice__content{margin-top:0;margin-bottom:0;color:#000;font-weight:500}
|
12 |
+
.wpglobus-switcher-panel__body .components-base-control__help{margin-top:10px}
|
13 |
+
.wpglobus-switcher-panel__body.is-opened{padding-top:0;padding-bottom:3em;}
|
14 |
+
.wpglobus-switcher-components-panel .wpglobus-switcher-message {
|
15 |
+
z-index:10;width:90%;position:absolute;border:2px solid #ff8100;margin:5px 10px;padding:5px;border-radius:6px;background-color:#ff8100;
|
16 |
+
font-size:14px;color:#000;font-weight:500;text-align:center;
|
17 |
+
}
|
18 |
+
.wpglobus-switcher-pulsate-radio-on {
|
19 |
+
-webkit-animation: pulsate-radio-on 0.3s ease-in-out both;
|
20 |
+
animation: pulsate-radio-on 0.3s ease-in-out both;
|
21 |
+
}
|
22 |
+
.wpglobus-switcher-pulsate-radio-off {
|
23 |
+
-webkit-animation: pulsate-radio-off 0.3s ease-in-out both;
|
24 |
+
animation: pulsate-radio-off 0.3s ease-in-out both;
|
25 |
+
}
|
26 |
+
.wpglobus-switcher-pulsate-radio {
|
27 |
+
-webkit-animation: pulsate-radio 0.5s ease-in-out infinite both;
|
28 |
+
animation: pulsate-radio 0.5s ease-in-out infinite both;
|
29 |
+
}
|
30 |
+
/** animation pulsate-radio-on */
|
31 |
+
@-webkit-keyframes pulsate-radio-on {
|
32 |
+
0% {
|
33 |
+
-webkit-transform: scale(0);
|
34 |
+
transform: scale(0);
|
35 |
+
}
|
36 |
+
50% {
|
37 |
+
-webkit-transform: scale(0.7);
|
38 |
+
transform: scale(0.7);
|
39 |
+
}
|
40 |
+
100% {
|
41 |
+
-webkit-transform: scale(1.1);
|
42 |
+
transform: scale(1.1);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
@keyframes pulsate-radio-on {
|
46 |
+
0% {
|
47 |
+
-webkit-transform: scale(0);
|
48 |
+
transform: scale(0);
|
49 |
+
}
|
50 |
+
50% {
|
51 |
+
-webkit-transform: scale(0.7);
|
52 |
+
transform: scale(0.7);
|
53 |
+
}
|
54 |
+
100% {
|
55 |
+
-webkit-transform: scale(1.1);
|
56 |
+
transform: scale(1.1);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
/** animation pulsate-radio-off */
|
60 |
+
@-webkit-keyframes pulsate-radio-off {
|
61 |
+
0% {
|
62 |
+
-webkit-transform: scale(1.1);
|
63 |
+
transform: scale(1.1);
|
64 |
+
}
|
65 |
+
50% {
|
66 |
+
-webkit-transform: scale(0.7);
|
67 |
+
transform: scale(0.7);
|
68 |
+
}
|
69 |
+
100% {
|
70 |
+
-webkit-transform: scale(0);
|
71 |
+
transform: scale(0);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
@keyframes pulsate-radio-off {
|
75 |
+
0% {
|
76 |
+
-webkit-transform: scale(1.1);
|
77 |
+
transform: scale(1.1);
|
78 |
+
}
|
79 |
+
50% {
|
80 |
+
-webkit-transform: scale(0.7);
|
81 |
+
transform: scale(0.7);
|
82 |
+
}
|
83 |
+
100% {
|
84 |
+
-webkit-transform: scale(0);
|
85 |
+
transform: scale(0);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
/** animation pulsate-radio */
|
89 |
+
@-webkit-keyframes pulsate-radio {
|
90 |
+
0% {
|
91 |
+
-webkit-transform: scale(1.1);
|
92 |
+
transform: scale(1.1);
|
93 |
+
}
|
94 |
+
50% {
|
95 |
+
-webkit-transform: scale(0.7);
|
96 |
+
transform: scale(0.7);
|
97 |
+
}
|
98 |
+
100% {
|
99 |
+
-webkit-transform: scale(1.1);
|
100 |
+
transform: scale(1.1);
|
101 |
+
}
|
102 |
+
}
|
103 |
+
@keyframes pulsate-radio {
|
104 |
+
0% {
|
105 |
+
-webkit-transform: scale(1.1);
|
106 |
+
transform: scale(1.1);
|
107 |
+
}
|
108 |
+
50% {
|
109 |
+
-webkit-transform: scale(0.7);
|
110 |
+
transform: scale(0.7);
|
111 |
+
}
|
112 |
+
100% {
|
113 |
+
-webkit-transform: scale(1.1);
|
114 |
+
transform: scale(1.1);
|
115 |
+
}
|
116 |
+
}
|
trunk/includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.wpglobus-selector-grid{display:grid;grid-template-columns:40% 60%;place-items:center;grid-gap:0}.wpglobus-selector-grid .wpglobus-gutenberg-selector-column-2{width:90px}.wpglobus-gutenberg-selector-box{margin-left:220px}@media screen and (max-width: 599px){.wpglobus-gutenberg-selector-box{margin-left:40px}}@media screen and (max-width: 700px){.wpglobus-gutenberg-selector-column-1{height:25px;width:25px}.wpglobus-gutenberg-selector-column-2{display:none}}
|
2 |
+
|
3 |
+
/*# sourceMappingURL=wpglobus-gutenberg.css.map */
|
trunk/includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["wpglobus-gutenberg.scss"],"names":[],"mappings":"AAAA,wBACE,YAAa,CACb,6BAA8B,CAC9B,kBAAmB,CACnB,UAAW,CACZ,8DAGC,UAAW,CACZ,iCAGC,iBAAkB,CACnB,qCAGC,iCACE,gBAAiB,CAClB,CAGH,qCACE,sCACE,WAAY,CACZ,UAAW,CACZ,sCAEC,YAAa,CACd","file":"wpglobus-gutenberg.css"}
|
trunk/includes/builders/gutenberg/assets/css/wpglobus-gutenberg.scss
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wpglobus-selector-grid {
|
2 |
+
display: grid;
|
3 |
+
grid-template-columns: 40% 60%;
|
4 |
+
place-items: center;
|
5 |
+
grid-gap: 0;
|
6 |
+
}
|
7 |
+
|
8 |
+
.wpglobus-selector-grid .wpglobus-gutenberg-selector-column-2 {
|
9 |
+
width: 90px;
|
10 |
+
}
|
11 |
+
|
12 |
+
.wpglobus-gutenberg-selector-box {
|
13 |
+
margin-left: 220px;
|
14 |
+
}
|
15 |
+
|
16 |
+
@media screen and (max-width: 599px) {
|
17 |
+
.wpglobus-gutenberg-selector-box {
|
18 |
+
margin-left: 40px;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
@media screen and (max-width: 700px) {
|
23 |
+
.wpglobus-gutenberg-selector-column-1 {
|
24 |
+
height: 25px;
|
25 |
+
width: 25px;
|
26 |
+
}
|
27 |
+
.wpglobus-gutenberg-selector-column-2 {
|
28 |
+
display: none;
|
29 |
+
}
|
30 |
+
}
|
trunk/includes/builders/gutenberg/assets/js/dist/wpglobus-block-editor.js
ADDED
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, {
|
40 |
+
/******/ configurable: false,
|
41 |
+
/******/ enumerable: true,
|
42 |
+
/******/ get: getter
|
43 |
+
/******/ });
|
44 |
+
/******/ }
|
45 |
+
/******/ };
|
46 |
+
/******/
|
47 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
48 |
+
/******/ __webpack_require__.n = function(module) {
|
49 |
+
/******/ var getter = module && module.__esModule ?
|
50 |
+
/******/ function getDefault() { return module['default']; } :
|
51 |
+
/******/ function getModuleExports() { return module; };
|
52 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
53 |
+
/******/ return getter;
|
54 |
+
/******/ };
|
55 |
+
/******/
|
56 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
57 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
58 |
+
/******/
|
59 |
+
/******/ // __webpack_public_path__
|
60 |
+
/******/ __webpack_require__.p = "";
|
61 |
+
/******/
|
62 |
+
/******/ // Load entry module and return exports
|
63 |
+
/******/ return __webpack_require__(__webpack_require__.s = 41);
|
64 |
+
/******/ })
|
65 |
+
/************************************************************************/
|
66 |
+
/******/ ([
|
67 |
+
/* 0 */
|
68 |
+
/***/ (function(module, exports) {
|
69 |
+
|
70 |
+
eval("var core = module.exports = { version: '2.6.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz8xNWUwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjYuNScgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n");
|
71 |
+
|
72 |
+
/***/ }),
|
73 |
+
/* 1 */
|
74 |
+
/***/ (function(module, exports) {
|
75 |
+
|
76 |
+
eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZ2xvYmFsLmpzP2VjYWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzg2I2lzc3VlY29tbWVudC0xMTU3NTkwMjhcbnZhciBnbG9iYWwgPSBtb2R1bGUuZXhwb3J0cyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93Lk1hdGggPT0gTWF0aFxuICA/IHdpbmRvdyA6IHR5cGVvZiBzZWxmICE9ICd1bmRlZmluZWQnICYmIHNlbGYuTWF0aCA9PSBNYXRoID8gc2VsZlxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tbmV3LWZ1bmNcbiAgOiBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuaWYgKHR5cGVvZiBfX2cgPT0gJ251bWJlcicpIF9fZyA9IGdsb2JhbDsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///1\n");
|
77 |
+
|
78 |
+
/***/ }),
|
79 |
+
/* 2 */
|
80 |
+
/***/ (function(module, exports) {
|
81 |
+
|
82 |
+
eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzPzBmNjIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhc093blByb3BlcnR5ID0ge30uaGFzT3duUHJvcGVydHk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwga2V5KSB7XG4gIHJldHVybiBoYXNPd25Qcm9wZXJ0eS5jYWxsKGl0LCBrZXkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19oYXMuanNcbi8vIG1vZHVsZSBpZCA9IDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n");
|
83 |
+
|
84 |
+
/***/ }),
|
85 |
+
/* 3 */
|
86 |
+
/***/ (function(module, exports, __webpack_require__) {
|
87 |
+
|
88 |
+
eval("var anObject = __webpack_require__(10);\nvar IE8_DOM_DEFINE = __webpack_require__(31);\nvar toPrimitive = __webpack_require__(18);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwLmpzPzdhZjAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgSUU4X0RPTV9ERUZJTkUgPSByZXF1aXJlKCcuL19pZTgtZG9tLWRlZmluZScpO1xudmFyIHRvUHJpbWl0aXZlID0gcmVxdWlyZSgnLi9fdG8tcHJpbWl0aXZlJyk7XG52YXIgZFAgPSBPYmplY3QuZGVmaW5lUHJvcGVydHk7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydHkgOiBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGFuT2JqZWN0KEF0dHJpYnV0ZXMpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGRQKE8sIFAsIEF0dHJpYnV0ZXMpO1xuICB9IGNhdGNoIChlKSB7IC8qIGVtcHR5ICovIH1cbiAgaWYgKCdnZXQnIGluIEF0dHJpYnV0ZXMgfHwgJ3NldCcgaW4gQXR0cmlidXRlcykgdGhyb3cgVHlwZUVycm9yKCdBY2Nlc3NvcnMgbm90IHN1cHBvcnRlZCEnKTtcbiAgaWYgKCd2YWx1ZScgaW4gQXR0cmlidXRlcykgT1tQXSA9IEF0dHJpYnV0ZXMudmFsdWU7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3\n");
|
89 |
+
|
90 |
+
/***/ }),
|
91 |
+
/* 4 */
|
92 |
+
/***/ (function(module, exports, __webpack_require__) {
|
93 |
+
|
94 |
+
eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(11)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/Zjg0ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n");
|
95 |
+
|
96 |
+
/***/ }),
|
97 |
+
/* 5 */
|
98 |
+
/***/ (function(module, exports, __webpack_require__) {
|
99 |
+
|
100 |
+
eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar ctx = __webpack_require__(30);\nvar hide = __webpack_require__(6);\nvar has = __webpack_require__(2);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzPzkwY2QiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBQUk9UT1RZUEUgPSAncHJ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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5\n");
|
101 |
+
|
102 |
+
/***/ }),
|
103 |
+
/* 6 */
|
104 |
+
/***/ (function(module, exports, __webpack_require__) {
|
105 |
+
|
106 |
+
eval("var dP = __webpack_require__(3);\nvar createDesc = __webpack_require__(14);\nmodule.exports = __webpack_require__(4) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qcz84NDljIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGNyZWF0ZURlc2MgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIHJldHVybiBkUC5mKG9iamVjdCwga2V5LCBjcmVhdGVEZXNjKDEsIHZhbHVlKSk7XG59IDogZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICBvYmplY3Rba2V5XSA9IHZhbHVlO1xuICByZXR1cm4gb2JqZWN0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSA2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6\n");
|
107 |
+
|
108 |
+
/***/ }),
|
109 |
+
/* 7 */
|
110 |
+
/***/ (function(module, exports) {
|
111 |
+
|
112 |
+
eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzEyYTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7\n");
|
113 |
+
|
114 |
+
/***/ }),
|
115 |
+
/* 8 */
|
116 |
+
/***/ (function(module, exports, __webpack_require__) {
|
117 |
+
|
118 |
+
eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(61);\nvar defined = __webpack_require__(15);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8taW9iamVjdC5qcz80ZGM0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHRvIGluZGV4ZWQgb2JqZWN0LCB0b09iamVjdCB3aXRoIGZhbGxiYWNrIGZvciBub24tYXJyYXktbGlrZSBFUzMgc3RyaW5nc1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBJT2JqZWN0KGRlZmluZWQoaXQpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8taW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8\n");
|
119 |
+
|
120 |
+
/***/ }),
|
121 |
+
/* 9 */
|
122 |
+
/***/ (function(module, exports, __webpack_require__) {
|
123 |
+
|
124 |
+
eval("var store = __webpack_require__(17)('wks');\nvar uid = __webpack_require__(13);\nvar Symbol = __webpack_require__(1).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLmpzPzc1MmMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHN0b3JlID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ3drcycpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xudmFyIFN5bWJvbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLlN5bWJvbDtcbnZhciBVU0VfU1lNQk9MID0gdHlwZW9mIFN5bWJvbCA9PSAnZnVuY3Rpb24nO1xuXG52YXIgJGV4cG9ydHMgPSBtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHJldHVybiBzdG9yZVtuYW1lXSB8fCAoc3RvcmVbbmFtZV0gPVxuICAgIFVTRV9TWU1CT0wgJiYgU3ltYm9sW25hbWVdIHx8IChVU0VfU1lNQk9MID8gU3ltYm9sIDogdWlkKSgnU3ltYm9sLicgKyBuYW1lKSk7XG59O1xuXG4kZXhwb3J0cy5zdG9yZSA9IHN0b3JlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy5qc1xuLy8gbW9kdWxlIGlkID0gOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n");
|
125 |
+
|
126 |
+
/***/ }),
|
127 |
+
/* 10 */
|
128 |
+
/***/ (function(module, exports, __webpack_require__) {
|
129 |
+
|
130 |
+
eval("var isObject = __webpack_require__(7);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qcz9lZmIzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n");
|
131 |
+
|
132 |
+
/***/ }),
|
133 |
+
/* 11 */
|
134 |
+
/***/ (function(module, exports) {
|
135 |
+
|
136 |
+
eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///11\n");
|
137 |
+
|
138 |
+
/***/ }),
|
139 |
+
/* 12 */
|
140 |
+
/***/ (function(module, exports) {
|
141 |
+
|
142 |
+
eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n");
|
143 |
+
|
144 |
+
/***/ }),
|
145 |
+
/* 13 */
|
146 |
+
/***/ (function(module, exports) {
|
147 |
+
|
148 |
+
eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gMTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///13\n");
|
149 |
+
|
150 |
+
/***/ }),
|
151 |
+
/* 14 */
|
152 |
+
/***/ (function(module, exports) {
|
153 |
+
|
154 |
+
eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n");
|
155 |
+
|
156 |
+
/***/ }),
|
157 |
+
/* 15 */
|
158 |
+
/***/ (function(module, exports) {
|
159 |
+
|
160 |
+
eval("// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/ZTc2OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///15\n");
|
161 |
+
|
162 |
+
/***/ }),
|
163 |
+
/* 16 */
|
164 |
+
/***/ (function(module, exports, __webpack_require__) {
|
165 |
+
|
166 |
+
eval("var shared = __webpack_require__(17)('keys');\nvar uid = __webpack_require__(13);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/NmIxZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAxNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n");
|
167 |
+
|
168 |
+
/***/ }),
|
169 |
+
/* 17 */
|
170 |
+
/***/ (function(module, exports, __webpack_require__) {
|
171 |
+
|
172 |
+
eval("var core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(12) ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qcz83YmMwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIFNIQVJFRCA9ICdfX2NvcmUtanNfc2hhcmVkX18nO1xudmFyIHN0b3JlID0gZ2xvYmFsW1NIQVJFRF0gfHwgKGdsb2JhbFtTSEFSRURdID0ge30pO1xuXG4obW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkge1xuICByZXR1cm4gc3RvcmVba2V5XSB8fCAoc3RvcmVba2V5XSA9IHZhbHVlICE9PSB1bmRlZmluZWQgPyB2YWx1ZSA6IHt9KTtcbn0pKCd2ZXJzaW9ucycsIFtdKS5wdXNoKHtcbiAgdmVyc2lvbjogY29yZS52ZXJzaW9uLFxuICBtb2RlOiByZXF1aXJlKCcuL19saWJyYXJ5JykgPyAncHVyZScgOiAnZ2xvYmFsJyxcbiAgY29weXJpZ2h0OiAnwqkgMjAxOSBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSdcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qc1xuLy8gbW9kdWxlIGlkID0gMTdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///17\n");
|
173 |
+
|
174 |
+
/***/ }),
|
175 |
+
/* 18 */
|
176 |
+
/***/ (function(module, exports, __webpack_require__) {
|
177 |
+
|
178 |
+
eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(7);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8zMjYzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIFRvUHJpbWl0aXZlKGlucHV0IFssIFByZWZlcnJlZFR5cGVdKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG4vLyBpbnN0ZWFkIG9mIHRoZSBFUzYgc3BlYyB2ZXJzaW9uLCB3ZSBkaWRuJ3QgaW1wbGVtZW50IEBAdG9QcmltaXRpdmUgY2FzZVxuLy8gYW5kIHRoZSBzZWNvbmQgYXJndW1lbnQgLSBmbGFnIC0gcHJlZmVycmVkIHR5cGUgaXMgYSBzdHJpbmdcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBTKSB7XG4gIGlmICghaXNPYmplY3QoaXQpKSByZXR1cm4gaXQ7XG4gIHZhciBmbiwgdmFsO1xuICBpZiAoUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgaWYgKHR5cGVvZiAoZm4gPSBpdC52YWx1ZU9mKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIGlmICghUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY29udmVydCBvYmplY3QgdG8gcHJpbWl0aXZlIHZhbHVlXCIpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1wcmltaXRpdmUuanNcbi8vIG1vZHVsZSBpZCA9IDE4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///18\n");
|
179 |
+
|
180 |
+
/***/ }),
|
181 |
+
/* 19 */
|
182 |
+
/***/ (function(module, exports) {
|
183 |
+
|
184 |
+
eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/NTJlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///19\n");
|
185 |
+
|
186 |
+
/***/ }),
|
187 |
+
/* 20 */
|
188 |
+
/***/ (function(module, exports) {
|
189 |
+
|
190 |
+
eval("module.exports = {};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXJhdG9ycy5qcz9mZGI0Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0ge307XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlcmF0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///20\n");
|
191 |
+
|
192 |
+
/***/ }),
|
193 |
+
/* 21 */
|
194 |
+
/***/ (function(module, exports, __webpack_require__) {
|
195 |
+
|
196 |
+
eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(10);\nvar dPs = __webpack_require__(60);\nvar enumBugKeys = __webpack_require__(23);\nvar IE_PROTO = __webpack_require__(16)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(32)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(65).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1jcmVhdGUuanM/NjI4NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMiAvIDE1LjIuMy41IE9iamVjdC5jcmVhdGUoTyBbLCBQcm9wZXJ0aWVzXSlcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGRQcyA9IHJlcXVpcmUoJy4vX29iamVjdC1kcHMnKTtcbnZhciBlbnVtQnVnS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKTtcbnZhciBJRV9QUk9UTyA9IHJlcXVpcmUoJy4vX3NoYXJlZC1rZXknKSgnSUVfUFJPVE8nKTtcbnZhciBFbXB0eSA9IGZ1bmN0aW9uICgpIHsgLyogZW1wdHkgKi8gfTtcbnZhciBQUk9UT1RZUEUgPSAncHJvdG90eXBlJztcblxuLy8gQ3JlYXRlIG9iamVjdCB3aXRoIGZha2UgYG51bGxgIHByb3RvdHlwZTogdXNlIGlmcmFtZSBPYmplY3Qgd2l0aCBjbGVhcmVkIHByb3RvdHlwZVxudmFyIGNyZWF0ZURpY3QgPSBmdW5jdGlvbiAoKSB7XG4gIC8vIFRocmFzaCwgd2FzdGUgYW5kIHNvZG9teTogSUUgR0MgYnVnXG4gIHZhciBpZnJhbWUgPSByZXF1aXJlKCcuL19kb20tY3JlYXRlJykoJ2lmcmFtZScpO1xuICB2YXIgaSA9IGVudW1CdWdLZXlzLmxlbmd0aDtcbiAgdmFyIGx0ID0gJzwnO1xuICB2YXIgZ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WN0LmdldFByb3RvdHlwZU9mIHBvbHlmaWxsXG4gICAgcmVzdWx0W0lFX1BST1RPXSA9IE87XG4gIH0gZWxzZSByZXN1bHQgPSBjcmVhdGVEaWN0KCk7XG4gIHJldHVybiBQcm9wZXJ0aWVzID09PSB1bmRlZmluZWQgPyByZXN1bHQgOiBkUHMocmVzdWx0LCBQcm9wZXJ0aWVzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///21\n");
|
197 |
+
|
198 |
+
/***/ }),
|
199 |
+
/* 22 */
|
200 |
+
/***/ (function(module, exports, __webpack_require__) {
|
201 |
+
|
202 |
+
eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(36);\nvar enumBugKeys = __webpack_require__(23);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n");
|
203 |
+
|
204 |
+
/***/ }),
|
205 |
+
/* 23 */
|
206 |
+
/***/ (function(module, exports) {
|
207 |
+
|
208 |
+
eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YzY3NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///23\n");
|
209 |
+
|
210 |
+
/***/ }),
|
211 |
+
/* 24 */
|
212 |
+
/***/ (function(module, exports, __webpack_require__) {
|
213 |
+
|
214 |
+
eval("var def = __webpack_require__(3).f;\nvar has = __webpack_require__(2);\nvar TAG = __webpack_require__(9)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC10by1zdHJpbmctdGFnLmpzPzdiYTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRlZiA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgVEFHID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvU3RyaW5nVGFnJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCB0YWcsIHN0YXQpIHtcbiAgaWYgKGl0ICYmICFoYXMoaXQgPSBzdGF0ID8gaXQgOiBpdC5wcm90b3R5cGUsIFRBRykpIGRlZihpdCwgVEFHLCB7IGNvbmZpZ3VyYWJsZTogdHJ1ZSwgdmFsdWU6IHRhZyB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXRvLXN0cmluZy10YWcuanNcbi8vIG1vZHVsZSBpZCA9IDI0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n");
|
215 |
+
|
216 |
+
/***/ }),
|
217 |
+
/* 25 */
|
218 |
+
/***/ (function(module, exports, __webpack_require__) {
|
219 |
+
|
220 |
+
eval("exports.f = __webpack_require__(9);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1leHQuanM/MmExZSJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSByZXF1aXJlKCcuL193a3MnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAyNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///25\n");
|
221 |
+
|
222 |
+
/***/ }),
|
223 |
+
/* 26 */
|
224 |
+
/***/ (function(module, exports, __webpack_require__) {
|
225 |
+
|
226 |
+
eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar LIBRARY = __webpack_require__(12);\nvar wksExt = __webpack_require__(25);\nvar defineProperty = __webpack_require__(3).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1kZWZpbmUuanM/NzJiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyIHdrc0V4dCA9IHJlcXVpcmUoJy4vX3drcy1leHQnKTtcbnZhciBkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHZhciAkU3ltYm9sID0gY29yZS5TeW1ib2wgfHwgKGNvcmUuU3ltYm9sID0gTElCUkFSWSA/IHt9IDogZ2xvYmFsLlN5bWJvbCB8fCB7fSk7XG4gIGlmIChuYW1lLmNoYXJBdCgwKSAhPSAnXycgJiYgIShuYW1lIGluICRTeW1ib2wpKSBkZWZpbmVQcm9wZXJ0eSgkU3ltYm9sLCBuYW1lLCB7IHZhbHVlOiB3a3NFeHQuZihuYW1lKSB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///26\n");
|
227 |
+
|
228 |
+
/***/ }),
|
229 |
+
/* 27 */
|
230 |
+
/***/ (function(module, exports) {
|
231 |
+
|
232 |
+
eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/MzY5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSAyN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///27\n");
|
233 |
+
|
234 |
+
/***/ }),
|
235 |
+
/* 28 */
|
236 |
+
/***/ (function(module, exports, __webpack_require__) {
|
237 |
+
|
238 |
+
eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(15);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///28\n");
|
239 |
+
|
240 |
+
/***/ }),
|
241 |
+
/* 29 */
|
242 |
+
/***/ (function(module, exports, __webpack_require__) {
|
243 |
+
|
244 |
+
eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(2);\nvar toObject = __webpack_require__(28);\nvar IE_PROTO = __webpack_require__(16)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1ncG8uanM/M2YzYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuOSAvIDE1LjIuMy4yIE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgT2JqZWN0UHJvdG8gPSBPYmplY3QucHJvdG90eXBlO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5nZXRQcm90b3R5cGVPZiB8fCBmdW5jdGlvbiAoTykge1xuICBPID0gdG9PYmplY3QoTyk7XG4gIGlmIChoYXMoTywgSUVfUFJPVE8pKSByZXR1cm4gT1tJRV9QUk9UT107XG4gIGlmICh0eXBlb2YgTy5jb25zdHJ1Y3RvciA9PSAnZnVuY3Rpb24nICYmIE8gaW5zdGFuY2VvZiBPLmNvbnN0cnVjdG9yKSB7XG4gICAgcmV0dXJuIE8uY29uc3RydWN0b3IucHJvdG90eXBlO1xuICB9IHJldHVybiBPIGluc3RhbmNlb2YgT2JqZWN0ID8gT2JqZWN0UHJvdG8gOiBudWxsO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ3BvLmpzXG4vLyBtb2R1bGUgaWQgPSAyOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///29\n");
|
245 |
+
|
246 |
+
/***/ }),
|
247 |
+
/* 30 */
|
248 |
+
/***/ (function(module, exports, __webpack_require__) {
|
249 |
+
|
250 |
+
eval("// optional / simple context binding\nvar aFunction = __webpack_require__(48);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///30\n");
|
251 |
+
|
252 |
+
/***/ }),
|
253 |
+
/* 31 */
|
254 |
+
/***/ (function(module, exports, __webpack_require__) {
|
255 |
+
|
256 |
+
eval("module.exports = !__webpack_require__(4) && !__webpack_require__(11)(function () {\n return Object.defineProperty(__webpack_require__(32)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzPzQ5ZjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///31\n");
|
257 |
+
|
258 |
+
/***/ }),
|
259 |
+
/* 32 */
|
260 |
+
/***/ (function(module, exports, __webpack_require__) {
|
261 |
+
|
262 |
+
eval("var isObject = __webpack_require__(7);\nvar document = __webpack_require__(1).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/MzhkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///32\n");
|
263 |
+
|
264 |
+
/***/ }),
|
265 |
+
/* 33 */
|
266 |
+
/***/ (function(module, exports, __webpack_require__) {
|
267 |
+
|
268 |
+
"use strict";
|
269 |
+
eval("\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(55);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(70);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz9hNDU2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2l0ZXJhdG9yID0gcmVxdWlyZShcIi4uL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yXCIpO1xuXG52YXIgX2l0ZXJhdG9yMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2l0ZXJhdG9yKTtcblxudmFyIF9zeW1ib2wgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9zeW1ib2xcIik7XG5cbnZhciBfc3ltYm9sMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX3N5bWJvbCk7XG5cbnZhciBfdHlwZW9mID0gdHlwZW9m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FwidW5kZWZpbmVkXCIgOiBfdHlwZW9mKG9iaik7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90eXBlb2YuanNcbi8vIG1vZHVsZSBpZCA9IDMzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///33\n");
|
270 |
+
|
271 |
+
/***/ }),
|
272 |
+
/* 34 */
|
273 |
+
/***/ (function(module, exports, __webpack_require__) {
|
274 |
+
|
275 |
+
"use strict";
|
276 |
+
eval("\nvar LIBRARY = __webpack_require__(12);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(35);\nvar hide = __webpack_require__(6);\nvar Iterators = __webpack_require__(20);\nvar $iterCreate = __webpack_require__(59);\nvar setToStringTag = __webpack_require__(24);\nvar getPrototypeOf = __webpack_require__(29);\nvar ITERATOR = __webpack_require__(9)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItZGVmaW5lLmpzP2JjODAiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3Q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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///34\n");
|
277 |
+
|
278 |
+
/***/ }),
|
279 |
+
/* 35 */
|
280 |
+
/***/ (function(module, exports, __webpack_require__) {
|
281 |
+
|
282 |
+
eval("module.exports = __webpack_require__(6);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLmpzP2YzY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19oaWRlJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fcmVkZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDM1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///35\n");
|
283 |
+
|
284 |
+
/***/ }),
|
285 |
+
/* 36 */
|
286 |
+
/***/ (function(module, exports, __webpack_require__) {
|
287 |
+
|
288 |
+
eval("var has = __webpack_require__(2);\nvar toIObject = __webpack_require__(8);\nvar arrayIndexOf = __webpack_require__(62)(false);\nvar IE_PROTO = __webpack_require__(16)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzPzIxYjgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUluZGV4T2YgPSByZXF1aXJlKCcuL19hcnJheS1pbmNsdWRlcycpKGZhbHNlKTtcbnZhciBJRV9QUk9UTyA9IHJlcXVpcmUoJy4vX3NoYXJlZC1rZXknKSgnSUVfUFJPVE8nKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBuYW1lcykge1xuICB2YXIgTyA9IHRvSU9iamVjdChvYmplY3QpO1xuICB2YXIgaSA9IDA7XG4gIHZhciByZXN1bHQgPSBbXTtcbiAgdmFyIGtleTtcbiAgZm9yIChrZXkgaW4gTykgaWYgKGtleSAhPSBJRV9QUk9UTykgaGFzKE8sIGtleSkgJiYgcmVzdWx0LnB1c2goa2V5KTtcbiAgLy8gRG9uJ3QgZW51bSBidWcgJiBoaWRkZW4ga2V5c1xuICB3aGlsZSAobmFtZXMubGVuZ3RoID4gaSkgaWYgKGhhcyhPLCBrZXkgPSBuYW1lc1tpKytdKSkge1xuICAgIH5hcnJheUluZGV4T2YocmVzdWx0LCBrZXkpIHx8IHJlc3VsdC5wdXNoKGtleSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDM2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///36\n");
|
289 |
+
|
290 |
+
/***/ }),
|
291 |
+
/* 37 */
|
292 |
+
/***/ (function(module, exports) {
|
293 |
+
|
294 |
+
eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDM3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///37\n");
|
295 |
+
|
296 |
+
/***/ }),
|
297 |
+
/* 38 */
|
298 |
+
/***/ (function(module, exports) {
|
299 |
+
|
300 |
+
eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BzLmpzP2Q2NDQiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qc1xuLy8gbW9kdWxlIGlkID0gMzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///38\n");
|
301 |
+
|
302 |
+
/***/ }),
|
303 |
+
/* 39 */
|
304 |
+
/***/ (function(module, exports, __webpack_require__) {
|
305 |
+
|
306 |
+
eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(36);\nvar hiddenKeys = __webpack_require__(23).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLmpzPzlmNDQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjcgLyAxNS4yLjMuNCBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhPKVxudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMtaW50ZXJuYWwnKTtcbnZhciBoaWRkZW5LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpLmNvbmNhdCgnbGVuZ3RoJywgJ3Byb3RvdHlwZScpO1xuXG5leHBvcnRzLmYgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyB8fCBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKE8pIHtcbiAgcmV0dXJuICRrZXlzKE8sIGhpZGRlbktleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi5qc1xuLy8gbW9kdWxlIGlkID0gMzlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///39\n");
|
307 |
+
|
308 |
+
/***/ }),
|
309 |
+
/* 40 */
|
310 |
+
/***/ (function(module, exports, __webpack_require__) {
|
311 |
+
|
312 |
+
eval("var pIE = __webpack_require__(27);\nvar createDesc = __webpack_require__(14);\nvar toIObject = __webpack_require__(8);\nvar toPrimitive = __webpack_require__(18);\nvar has = __webpack_require__(2);\nvar IE8_DOM_DEFINE = __webpack_require__(31);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(4) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BkLmpzPzJjYTYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHBJRSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIElFOF9ET01fREVGSU5FID0gcmVxdWlyZSgnLi9faWU4LWRvbS1kZWZpbmUnKTtcbnZhciBnT1BEID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGdPUEQgOiBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoTywgUCkge1xuICBPID0gdG9JT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZ09QRChPLCBQKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIGlmIChoYXMoTywgUCkpIHJldHVybiBjcmVhdGVEZXNjKCFwSUUuZi5jYWxsKE8sIFApLCBPW1BdKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcGQuanNcbi8vIG1vZHVsZSBpZCA9IDQwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///40\n");
|
313 |
+
|
314 |
+
/***/ }),
|
315 |
+
/* 41 */
|
316 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
317 |
+
|
318 |
+
"use strict";
|
319 |
+
eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss__ = __webpack_require__(42);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sidebar_js__ = __webpack_require__(43);\n// Include stylesheet\n\n\n// Import Click to Tweet Block\n//import './block.js';\n\n// Import Gutenberg Boilerplate Sidebar\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanM/ODc0OSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJbmNsdWRlIHN0eWxlc2hlZXRcbmltcG9ydCAnLi9zdHlsZS5zY3NzJztcblxuLy8gSW1wb3J0IENsaWNrIHRvIFR3ZWV0IEJsb2NrXG4vL2ltcG9ydCAnLi9ibG9jay5qcyc7XG5cbi8vIEltcG9ydCBHdXRlbmJlcmcgQm9pbGVycGxhdGUgU2lkZWJhclxuaW1wb3J0ICcuL3NpZGViYXIuanMnO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vc3JjL2luZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSA0MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///41\n");
|
320 |
+
|
321 |
+
/***/ }),
|
322 |
+
/* 42 */
|
323 |
+
/***/ (function(module, exports) {
|
324 |
+
|
325 |
+
eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvc3R5bGUuc2Nzcz9hY2Q4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvc3R5bGUuc2Nzc1xuLy8gbW9kdWxlIGlkID0gNDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///42\n");
|
326 |
+
|
327 |
+
/***/ }),
|
328 |
+
/* 43 */
|
329 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
330 |
+
|
331 |
+
"use strict";
|
332 |
+
eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of__ = __webpack_require__(44);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(49);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(50);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(80);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);\n\n\n\n\n\n/**\n * Internal block libraries.\n * @since 2.2.3\n */\nvar __ = wp.i18n.__;\nvar _wp$editPost = wp.editPost,\n PluginSidebar = _wp$editPost.PluginSidebar,\n PluginSidebarMoreMenuItem = _wp$editPost.PluginSidebarMoreMenuItem;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Button = _wp$components.Button,\n Notice = _wp$components.Notice;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\nvar withSelect = wp.data.withSelect;\nvar compose = wp.compose.compose;\n\n\nvar LanguageSwitcherNotice = function LanguageSwitcherNotice(props) {\n\tif (WPGlobusGutenberg.pagenow == WPGlobusGutenberg.postNewPage) {\n\t\treturn wp.element.createElement('div', null);\n\t}\n\n\tvar dev = '';\n\tif ('undefined' !== typeof WPGlobusBlockEditorDevelop && !WPGlobusBlockEditorDevelop.production) {\n\t\tdev = '(develop)';\n\t}\n\n\treturn wp.element.createElement(\n\t\tNotice,\n\t\t{ className: 'wpglobus-block-editor-panel__notice', status: 'informational', isDismissible: false },\n\t\t__('Select language'),\n\t\t' ',\n\t\tdev\n\t);\n};\n\nvar LanguageSwitcher = function LanguageSwitcher(props) {\n\n\tif (WPGlobusGutenberg.pagenow == WPGlobusGutenberg.postNewPage) {\n\t\treturn wp.element.createElement(\n\t\t\t'div',\n\t\t\t{ className: 'wpglobus-block-editor-panel__switcher-box' },\n\t\t\tWPGlobusGutenberg.i18n.save_post\n\t\t);\n\t}\n\n\tvar language = WPGlobusGutenberg.language;\n\tvar flagsUrl = WPGlobusGutenberg.flags_url;\n\tvar enabledLanguages = WPGlobusCoreData.enabled_languages;\n\tvar languageNames = WPGlobusCoreData.en_language_name;\n\tvar ref = location.href;\n\tvar refs = {};\n\tfor (var key in enabledLanguages) {\n\t\tif (-1 == ref.indexOf('language=' + language)) {\n\t\t\trefs[enabledLanguages[key]] = ref + '&language=' + enabledLanguages[key];\n\t\t} else {\n\t\t\trefs[enabledLanguages[key]] = ref.replace('language=' + language, 'language=' + enabledLanguages[key]);\n\t\t}\n\t}\n\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'wpglobus-block-editor-panel__switcher-box' },\n\t\twp.element.createElement(\n\t\t\t'ul',\n\t\t\tnull,\n\t\t\tenabledLanguages.map(function (lang) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t'li',\n\t\t\t\t\t{ key: lang },\n\t\t\t\t\twp.element.createElement('img', { className: 'wpglobus-block-editor-panel__flag', height: '20px', width: '20px', src: flagsUrl[lang] }),\n\t\t\t\t\t'\\xA0\\xA0',\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tButton,\n\t\t\t\t\t\t{ href: refs[lang], isSmall: true, isPrimary: true },\n\t\t\t\t\t\tlanguageNames[lang]\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t})\n\t\t)\n\t);\n};\n\nvar WPGlobusInfo = function WPGlobusInfo(props) {\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'wpglobus-block-editor-panel__info' },\n\t\twp.element.createElement(\n\t\t\tButton,\n\t\t\t{ href: props.href, target: '_blank', isLink: true },\n\t\t\t__('WPGlobus Premium Add-ons')\n\t\t)\n\t);\n};\n\nvar SettingsLink = function SettingsLink(props) {\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'wpglobus-block-editor-panel__settings-link' },\n\t\twp.element.createElement(\n\t\t\tButton,\n\t\t\t{ href: props.href, isLink: true },\n\t\t\t__('Settings')\n\t\t)\n\t);\n};\n\nvar registerPlugin = wp.plugins.registerPlugin;\n\nvar WPGlobus_BlockEditor = function (_Component) {\n\t__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(WPGlobus_BlockEditor, _Component);\n\n\tfunction WPGlobus_BlockEditor() {\n\t\t__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, WPGlobus_BlockEditor);\n\n\t\tvar _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (WPGlobus_BlockEditor.__proto__ || __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of___default()(WPGlobus_BlockEditor)).apply(this, arguments));\n\n\t\tvar dev = '';\n\t\tif ('undefined' !== typeof WPGlobusBlockEditorDevelop && !WPGlobusBlockEditorDevelop.production) {\n\t\t\tdev = ' (develop)';\n\t\t}\n\n\t\t_this.state = {\n\t\t\toptionsTabUrl: WPGlobusGutenberg.block_editor_tab_url,\n\t\t\tstoreLink: WPGlobusGutenberg.store_link,\n\t\t\theaderTitle: __('WPGlobus') + dev,\n\t\t\tmoreMenuItemTitle: __('WPGlobus')\n\t\t};\n\n\t\tsetTimeout(function () {\n\t\t\tvar buttons = document.getElementsByClassName('components-icon-button');\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\tvar status = buttons[i].getAttribute('aria-label');\n\t\t\t\t//if ( status == 'WPGlobus' ) { \n\t\t\t\tif (-1 != status.indexOf('WPGlobus')) {\n\t\t\t\t\tvar done = buttons[i].dataset.done;\n\t\t\t\t\tif ('undefined' === typeof done) {\n\t\t\t\t\t\tvar content = buttons[i].innerHTML;\n\t\t\t\t\t\t//@todo buttons[i].classList.add('wpglobus-switcher-button');\n\t\t\t\t\t\tbuttons[i].innerHTML = content + '<img height=\"20px\" width=\"20px\" src=\"' + WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language] + '\" /> ' + WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language];\n\t\t\t\t\t\tbuttons[i].dataset.done = 'yes';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, 500);\n\t\treturn _this;\n\t}\n\n\t__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(WPGlobus_BlockEditor, [{\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\treturn wp.element.createElement(\n\t\t\t\tFragment,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPluginSidebarMoreMenuItem,\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: 'wpglobus-gutenberg-sidebar'\n\t\t\t\t\t},\n\t\t\t\t\tthis.state.moreMenuItemTitle\n\t\t\t\t),\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPluginSidebar,\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'wpglobus-gutenberg-sidebar',\n\t\t\t\t\t\ttitle: this.state.headerTitle\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ className: 'wpglobus-block-editor-panel__body' },\n\t\t\t\t\t\twp.element.createElement(LanguageSwitcherNotice, null),\n\t\t\t\t\t\twp.element.createElement(LanguageSwitcher, null),\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\twp.element.createElement(WPGlobusInfo, { href: this.state.storeLink }),\n\t\t\t\t\t\t\twp.element.createElement(SettingsLink, { href: this.state.optionsTabUrl })\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn WPGlobus_BlockEditor;\n}(Component);\n\nvar WPGBE = withSelect(function (select, _ref) {\n\tvar forceIsSaving = _ref.forceIsSaving;\n\n\tvar _select = select('core/editor'),\n\t getCurrentPostId = _select.getCurrentPostId,\n\t isSavingPost = _select.isSavingPost,\n\t isPublishingPost = _select.isPublishingPost,\n\t isAutosavingPost = _select.isAutosavingPost;\n\n\treturn {\n\t\tpostId: getCurrentPostId(),\n\t\tisSaving: forceIsSaving || isSavingPost(),\n\t\tisAutoSaving: isAutosavingPost(),\n\t\tisPublishing: isPublishingPost()\n\t};\n})(WPGlobus_BlockEditor);\n\nregisterPlugin('wpglobus-gutenberg', {\n\ticon: 'admin-site',\n\trender: WPGBE\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///43\n");
|
333 |
+
|
334 |
+
/***/ }),
|
335 |
+
/* 44 */
|
336 |
+
/***/ (function(module, exports, __webpack_require__) {
|
337 |
+
|
338 |
+
eval("module.exports = { \"default\": __webpack_require__(45), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzY3MWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA0NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n");
|
339 |
+
|
340 |
+
/***/ }),
|
341 |
+
/* 45 */
|
342 |
+
/***/ (function(module, exports, __webpack_require__) {
|
343 |
+
|
344 |
+
eval("__webpack_require__(46);\nmodule.exports = __webpack_require__(0).Object.getPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzdkMmUiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1wcm90b3R5cGUtb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpLk9iamVjdC5nZXRQcm90b3R5cGVPZjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n");
|
345 |
+
|
346 |
+
/***/ }),
|
347 |
+
/* 46 */
|
348 |
+
/***/ (function(module, exports, __webpack_require__) {
|
349 |
+
|
350 |
+
eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(28);\nvar $getPrototypeOf = __webpack_require__(29);\n\n__webpack_require__(47)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mLmpzPzJhMWUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjkgT2JqZWN0LmdldFByb3RvdHlwZU9mKE8pXG52YXIgdG9PYmplY3QgPSByZXF1aXJlKCcuL190by1vYmplY3QnKTtcbnZhciAkZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnZ2V0UHJvdG90eXBlT2YnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBnZXRQcm90b3R5cGVPZihpdCkge1xuICAgIHJldHVybiAkZ2V0UHJvdG90eXBlT2YodG9PYmplY3QoaXQpKTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///46\n");
|
351 |
+
|
352 |
+
/***/ }),
|
353 |
+
/* 47 */
|
354 |
+
/***/ (function(module, exports, __webpack_require__) {
|
355 |
+
|
356 |
+
eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar fails = __webpack_require__(11);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1zYXAuanM/YmFhNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBtb3N0IE9iamVjdCBtZXRob2RzIGJ5IEVTNiBzaG91bGQgYWNjZXB0IHByaW1pdGl2ZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVksIGV4ZWMpIHtcbiAgdmFyIGZuID0gKGNvcmUuT2JqZWN0IHx8IHt9KVtLRVldIHx8IE9iamVjdFtLRVldO1xuICB2YXIgZXhwID0ge307XG4gIGV4cFtLRVldID0gZXhlYyhmbik7XG4gICRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogZmFpbHMoZnVuY3Rpb24gKCkgeyBmbigxKTsgfSksICdPYmplY3QnLCBleHApO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzXG4vLyBtb2R1bGUgaWQgPSA0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///47\n");
|
357 |
+
|
358 |
+
/***/ }),
|
359 |
+
/* 48 */
|
360 |
+
/***/ (function(module, exports) {
|
361 |
+
|
362 |
+
eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///48\n");
|
363 |
+
|
364 |
+
/***/ }),
|
365 |
+
/* 49 */
|
366 |
+
/***/ (function(module, exports, __webpack_require__) {
|
367 |
+
|
368 |
+
"use strict";
|
369 |
+
eval("\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzPzY2YjkiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5cbmV4cG9ydHMuZGVmYXVsdCA9IGZ1bmN0aW9uIChpbnN0YW5jZSwgQ29uc3RydWN0b3IpIHtcbiAgaWYgKCEoaW5zdGFuY2UgaW5zdGFuY2VvZiBDb25zdHJ1Y3RvcikpIHtcbiAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwiQ2Fubm90IGNhbGwgYSBjbGFzcyBhcyBhIGZ1bmN0aW9uXCIpO1xuICB9XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9jbGFzc0NhbGxDaGVjay5qc1xuLy8gbW9kdWxlIGlkID0gNDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///49\n");
|
370 |
+
|
371 |
+
/***/ }),
|
372 |
+
/* 50 */
|
373 |
+
/***/ (function(module, exports, __webpack_require__) {
|
374 |
+
|
375 |
+
"use strict";
|
376 |
+
eval("\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(51);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZX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b3RvUHJvcHMpIGRlZmluZVByb3BlcnRpZXMoQ29uc3RydWN0b3IucHJvdG90eXBlLCBwcm90b1Byb3BzKTtcbiAgICBpZiAoc3RhdGljUHJvcHMpIGRlZmluZVByb3BlcnRpZXMoQ29uc3RydWN0b3IsIHN0YXRpY1Byb3BzKTtcbiAgICByZXR1cm4gQ29uc3RydWN0b3I7XG4gIH07XG59KCk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NyZWF0ZUNsYXNzLmpzXG4vLyBtb2R1bGUgaWQgPSA1MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///50\n");
|
377 |
+
|
378 |
+
/***/ }),
|
379 |
+
/* 51 */
|
380 |
+
/***/ (function(module, exports, __webpack_require__) {
|
381 |
+
|
382 |
+
eval("module.exports = { \"default\": __webpack_require__(52), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/MGI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA1MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///51\n");
|
383 |
+
|
384 |
+
/***/ }),
|
385 |
+
/* 52 */
|
386 |
+
/***/ (function(module, exports, __webpack_require__) {
|
387 |
+
|
388 |
+
eval("__webpack_require__(53);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/ZjViMCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5Jyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpIHtcbiAgcmV0dXJuICRPYmplY3QuZGVmaW5lUHJvcGVydHkoaXQsIGtleSwgZGVzYyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///52\n");
|
389 |
+
|
390 |
+
/***/ }),
|
391 |
+
/* 53 */
|
392 |
+
/***/ (function(module, exports, __webpack_require__) {
|
393 |
+
|
394 |
+
eval("var $export = __webpack_require__(5);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(4), 'Object', { defineProperty: __webpack_require__(3).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanM/OTgyOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjQgLyAxNS4yLjMuNiBPYmplY3QuZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnR5OiByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDUzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///53\n");
|
395 |
+
|
396 |
+
/***/ }),
|
397 |
+
/* 54 */
|
398 |
+
/***/ (function(module, exports, __webpack_require__) {
|
399 |
+
|
400 |
+
"use strict";
|
401 |
+
eval("\n\nexports.__esModule = true;\n\nvar _typeof2 = __webpack_require__(33);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3Bvc3NpYmxlQ29uc3RydWN0b3JSZXR1cm4uanM/Y2YwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF90eXBlb2YyID0gcmVxdWlyZShcIi4uL2hlbHBlcnMvdHlwZW9mXCIpO1xuXG52YXIgX3R5cGVvZjMgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF90eXBlb2YyKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKHNlbGYsIGNhbGwpIHtcbiAgaWYgKCFzZWxmKSB7XG4gICAgdGhyb3cgbmV3IFJlZmVyZW5jZUVycm9yKFwidGhpcyBoYXNuJ3QgYmVlbiBpbml0aWFsaXNlZCAtIHN1cGVyKCkgaGFzbid0IGJlZW4gY2FsbGVkXCIpO1xuICB9XG5cbiAgcmV0dXJuIGNhbGwgJiYgKCh0eXBlb2YgY2FsbCA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiAoMCwgX3R5cGVvZjMuZGVmYXVsdCkoY2FsbCkpID09PSBcIm9iamVjdFwiIHx8IHR5cGVvZiBjYWxsID09PSBcImZ1bmN0aW9uXCIpID8gY2FsbCA6IHNlbGY7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9wb3NzaWJsZUNvbnN0cnVjdG9yUmV0dXJuLmpzXG4vLyBtb2R1bGUgaWQgPSA1NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///54\n");
|
402 |
+
|
403 |
+
/***/ }),
|
404 |
+
/* 55 */
|
405 |
+
/***/ (function(module, exports, __webpack_require__) {
|
406 |
+
|
407 |
+
eval("module.exports = { \"default\": __webpack_require__(56), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC9pdGVyYXRvci5qcz82NzM4Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///55\n");
|
408 |
+
|
409 |
+
/***/ }),
|
410 |
+
/* 56 */
|
411 |
+
/***/ (function(module, exports, __webpack_require__) {
|
412 |
+
|
413 |
+
eval("__webpack_require__(57);\n__webpack_require__(66);\nmodule.exports = __webpack_require__(25).f('iterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qcz9mZTdlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvcicpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX3drcy1leHQnKS5mKCdpdGVyYXRvcicpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///56\n");
|
414 |
+
|
415 |
+
/***/ }),
|
416 |
+
/* 57 */
|
417 |
+
/***/ (function(module, exports, __webpack_require__) {
|
418 |
+
|
419 |
+
"use strict";
|
420 |
+
eval("\nvar $at = __webpack_require__(58)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(34)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qcz9jZDA0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuLy8gMjEuMS4zLjI3IF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function(module, exports, __webpack_require__) {
|
425 |
+
|
426 |
+
eval("var toInteger = __webpack_require__(19);\nvar defined = __webpack_require__(15);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3N0cmluZy1hdC5qcz84N2FlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbi8vIHRydWUgIC0+IFN0cmluZyNhdFxuLy8gZmFsc2UgLT4gU3RyaW5nI2NvZGVQb2ludEF0XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChUT19TVFJJTkcpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uICh0aGF0LCBwb3MpIHtcbiAgICB2YXIgcyA9IFN0cmluZyhkZWZpbmVkKHRoYXQpKTtcbiAgICB2YXIgaSA9IHRvSW50ZWdlcihwb3MpO1xuICAgIHZhciBsID0gcy5sZW5ndGg7XG4gICAgdmFyIGEsIGI7XG4gICAgaWYgKGkgPCAwIHx8IGkgPj0gbCkgcmV0dXJuIFRPX1NUUklORyA/ICcnIDogdW5kZWZpbmVkO1xuICAgIGEgPSBzLmNoYXJDb2RlQXQoaSk7XG4gICAgcmV0dXJuIGEgPCAweGQ4MDAgfHwgYSA+IDB4ZGJmZiB8fCBpICsgMSA9PT0gbCB8fCAoYiA9IHMuY2hhckNvZGVBdChpICsgMSkpIDwgMHhkYzAwIHx8IGIgPiAweGRmZmZcbiAgICAgID8gVE9fU1RSSU5HID8gcy5jaGFyQXQoaSkgOiBhXG4gICAgICA6IFRPX1NUUklORyA/IHMuc2xpY2UoaSwgaSArIDIpIDogKGEgLSAweGQ4MDAgPDwgMTApICsgKGIgLSAweGRjMDApICsgMHgxMDAwMDtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc3RyaW5nLWF0LmpzXG4vLyBtb2R1bGUgaWQgPSA1OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///58\n");
|
427 |
+
|
428 |
+
/***/ }),
|
429 |
+
/* 59 */
|
430 |
+
/***/ (function(module, exports, __webpack_require__) {
|
431 |
+
|
432 |
+
"use strict";
|
433 |
+
eval("\nvar create = __webpack_require__(21);\nvar descriptor = __webpack_require__(14);\nvar setToStringTag = __webpack_require__(24);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(6)(IteratorPrototype, __webpack_require__(9)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY3JlYXRlLmpzP2Y3ODUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciBkZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciBJdGVyYXRvclByb3RvdHlwZSA9IHt9O1xuXG4vLyAyNS4xLjIuMS4xICVJdGVyYXRvclByb3RvdHlwZSVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faGlkZScpKEl0ZXJhdG9yUHJvdG90eXBlLCByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKSwgZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpczsgfSk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKENvbnN0cnVjdG9yLCBOQU1FLCBuZXh0KSB7XG4gIENvbnN0cnVjdG9yLnByb3RvdHlwZSA9IGNyZWF0ZShJdGVyYXRvclByb3RvdHlwZSwgeyBuZXh0OiBkZXNjcmlwdG9yKDEsIG5leHQpIH0pO1xuICBzZXRUb1N0cmluZ1RhZyhDb25zdHJ1Y3RvciwgTkFNRSArICcgSXRlcmF0b3InKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlci1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDU5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///59\n");
|
434 |
+
|
435 |
+
/***/ }),
|
436 |
+
/* 60 */
|
437 |
+
/***/ (function(module, exports, __webpack_require__) {
|
438 |
+
|
439 |
+
eval("var dP = __webpack_require__(3);\nvar anObject = __webpack_require__(10);\nvar getKeys = __webpack_require__(22);\n\nmodule.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcHMuanM/YWEyYSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydGllcyA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcykge1xuICBhbk9iamVjdChPKTtcbiAgdmFyIGtleXMgPSBnZXRLZXlzKFByb3BlcnRpZXMpO1xuICB2YXIgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG4gIHZhciBpID0gMDtcbiAgdmFyIFA7XG4gIHdoaWxlIChsZW5ndGggPiBpKSBkUC5mKE8sIFAgPSBrZXlzW2krK10sIFByb3BlcnRpZXNbUF0pO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gNjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///60\n");
|
440 |
+
|
441 |
+
/***/ }),
|
442 |
+
/* 61 */
|
443 |
+
/***/ (function(module, exports, __webpack_require__) {
|
444 |
+
|
445 |
+
eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(37);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/MzE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///61\n");
|
446 |
+
|
447 |
+
/***/ }),
|
448 |
+
/* 62 */
|
449 |
+
/***/ (function(module, exports, __webpack_require__) {
|
450 |
+
|
451 |
+
eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(8);\nvar toLength = __webpack_require__(63);\nvar toAbsoluteIndex = __webpack_require__(64);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzP2JjNTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXNcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0Fic29sdXRlSW5kZXggPSByZXF1aXJlKCcuL190by1hYnNvbHV0ZS1pbmRleCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoSVNfSU5DTFVERVMpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uICgkdGhpcywgZWwsIGZyb21JbmRleCkge1xuICAgIHZhciBPID0gdG9JT2JqZWN0KCR0aGlzKTtcbiAgICB2YXIgbGVuZ3RoID0gdG9MZW5ndGgoTy5sZW5ndGgpO1xuICAgIHZhciBpbmRleCA9IHRvQWJzb2x1dGVJbmRleChmcm9tSW5kZXgsIGxlbmd0aCk7XG4gICAgdmFyIHZhbHVlO1xuICAgIC8vIEFycmF5I2luY2x1ZGVzIHVzZXMgU2FtZVZhbHVlWmVybyBlcXVhbGl0eSBhbGdvcml0aG1cbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gICAgaWYgKElTX0lOQ0xVREVTICYmIGVsICE9IGVsKSB3aGlsZSAobGVuZ3RoID4gaW5kZXgpIHtcbiAgICAgIHZhbHVlID0gT1tpbmRleCsrXTtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgIGlmICh2YWx1ZSAhPSB2YWx1ZSkgcmV0dXJuIHRydWU7XG4gICAgLy8gQXJyYXkjaW5kZXhPZiBpZ25vcmVzIGhvbGVzLCBBcnJheSNpbmNsdWRlcyAtIG5vdFxuICAgIH0gZWxzZSBmb3IgKDtsZW5ndGggPiBpbmRleDsgaW5kZXgrKykgaWYgKElTX0lOQ0xVREVTIHx8IGluZGV4IGluIE8pIHtcbiAgICAgIGlmIChPW2luZGV4XSA9PT0gZWwpIHJldHVybiBJU19JTkNMVURFUyB8fCBpbmRleCB8fCAwO1xuICAgIH0gcmV0dXJuICFJU19JTkNMVURFUyAmJiAtMTtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYXJyYXktaW5jbHVkZXMuanNcbi8vIG1vZHVsZSBpZCA9IDYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///62\n");
|
452 |
+
|
453 |
+
/***/ }),
|
454 |
+
/* 63 */
|
455 |
+
/***/ (function(module, exports, __webpack_require__) {
|
456 |
+
|
457 |
+
eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(19);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz80MTExIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///63\n");
|
458 |
+
|
459 |
+
/***/ }),
|
460 |
+
/* 64 */
|
461 |
+
/***/ (function(module, exports, __webpack_require__) {
|
462 |
+
|
463 |
+
eval("var toInteger = __webpack_require__(19);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzPzdlNDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDY0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///64\n");
|
464 |
+
|
465 |
+
/***/ }),
|
466 |
+
/* 65 */
|
467 |
+
/***/ (function(module, exports, __webpack_require__) {
|
468 |
+
|
469 |
+
eval("var document = __webpack_require__(1).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanM/NDRmMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbm1vZHVsZS5leHBvcnRzID0gZG9jdW1lbnQgJiYgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///65\n");
|
470 |
+
|
471 |
+
/***/ }),
|
472 |
+
/* 66 */
|
473 |
+
/***/ (function(module, exports, __webpack_require__) {
|
474 |
+
|
475 |
+
eval("__webpack_require__(67);\nvar global = __webpack_require__(1);\nvar hide = __webpack_require__(6);\nvar Iterators = __webpack_require__(20);\nvar TO_STRING_TAG = __webpack_require__(9)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZS5qcz9mYWQzIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vZXM2LmFycmF5Lml0ZXJhdG9yJyk7XG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciBUT19TVFJJTkdfVEFHID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvU3RyaW5nVGFnJyk7XG5cbnZhciBET01JdGVyYWJsZXMgPSAoJ0NTU1J1bGVMaXN0LENTU1N0eWxlRGVjbGFyYXRpb24sQ1NTVmFsdWVMaXN0LENsaWVudFJlY3RMaXN0LERPTVJlY3RMaXN0LERPTVN0cmluZ0xpc3QsJyArXG4gICdET01Ub2tlbkxpc3QsRGF0YVRyYW5zZmVySXRlbUxpc3QsRmlsZUxpc3QsSFRNTEFsbENvbGxlY3Rpb24sSFRNTENvbGxlY3Rpb24sSFRNTEZvcm1FbGVtZW50LEhUTUxTZWxlY3RFbGVtZW50LCcgK1xuICAnTWVkaWFMaXN0LE1pbWVUeXBlQXJyYXksTmFtZWROb2RlTWFwLE5vZGVMaXN0LFBhaW50UmVxdWVzdExpc3QsUGx1Z2luLFBsdWdpbkFycmF5LFNWR0xlbmd0aExpc3QsU1ZHTnVtYmVyTGlzdCwnICtcbiAgJ1NWR1BhdGhTZWdMaXN0LFNWR1BvaW50TGlzdCxTVkdTdHJpbmdMaXN0LFNWR1RyYW5zZm9ybUxpc3QsU291cmNlQnVmZmVyTGlzdCxTdHlsZVNoZWV0TGlzdCxUZXh0VHJhY2tDdWVMaXN0LCcgK1xuICAnVGV4dFRyYWNrTGlzdCxUb3VjaExpc3QnKS5zcGxpdCgnLCcpO1xuXG5mb3IgKHZhciBpID0gMDsgaSA8IERPTUl0ZXJhYmxlcy5sZW5ndGg7IGkrKykge1xuICB2YXIgTkFNRSA9IERPTUl0ZXJhYmxlc1tpXTtcbiAgdmFyIENvbGxlY3Rpb24gPSBnbG9iYWxbTkFNRV07XG4gIHZhciBwcm90byA9IENvbGxlY3Rpb24gJiYgQ29sbGVjdGlvbi5wcm90b3R5cGU7XG4gIGlmIChwcm90byAmJiAhcHJvdG9bVE9fU1RSSU5HX1RBR10pIGhpZGUocHJvdG8sIFRPX1NUUklOR19UQUcsIE5BTUUpO1xuICBJdGVyYXRvcnNbTkFNRV0gPSBJdGVyYXRvcnMuQXJyYXk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA2NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///66\n");
|
476 |
+
|
477 |
+
/***/ }),
|
478 |
+
/* 67 */
|
479 |
+
/***/ (function(module, exports, __webpack_require__) {
|
480 |
+
|
481 |
+
"use strict";
|
482 |
+
eval("\nvar addToUnscopables = __webpack_require__(68);\nvar step = __webpack_require__(69);\nvar Iterators = __webpack_require__(20);\nvar toIObject = __webpack_require__(8);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(34)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LmFycmF5Lml0ZXJhdG9yLmpzP2M0NjkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGFkZFRvVW5zY29wYWJsZXMgPSByZXF1aXJlKCcuL19hZGQtdG8tdW5zY29wYWJsZXMnKTtcbnZhciBzdGVwID0gcmVxdWlyZSgnLi9faXRlci1zdGVwJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xuXG4vLyAyMi4xLjMuNCBBcnJheS5wcm90b3R5cGUuZW50cmllcygpXG4vLyAyM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kFycmF5O1xuXG5hZGRUb1Vuc2NvcGFibGVzKCdrZXlzJyk7XG5hZGRUb1Vuc2NvcGFibGVzKCd2YWx1ZXMnKTtcbmFkZFRvVW5zY29wYWJsZXMoJ2VudHJpZXMnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///67\n");
|
483 |
+
|
484 |
+
/***/ }),
|
485 |
+
/* 68 */
|
486 |
+
/***/ (function(module, exports) {
|
487 |
+
|
488 |
+
eval("module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qcz9lMjY3Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qc1xuLy8gbW9kdWxlIGlkID0gNjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///68\n");
|
489 |
+
|
490 |
+
/***/ }),
|
491 |
+
/* 69 */
|
492 |
+
/***/ (function(module, exports) {
|
493 |
+
|
494 |
+
eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qcz8xMDY2Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGRvbmUsIHZhbHVlKSB7XG4gIHJldHVybiB7IHZhbHVlOiB2YWx1ZSwgZG9uZTogISFkb25lIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qc1xuLy8gbW9kdWxlIGlkID0gNjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///69\n");
|
495 |
+
|
496 |
+
/***/ }),
|
497 |
+
/* 70 */
|
498 |
+
/***/ (function(module, exports, __webpack_require__) {
|
499 |
+
|
500 |
+
eval("module.exports = { \"default\": __webpack_require__(71), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC5qcz9lNTA1Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2xcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sLmpzXG4vLyBtb2R1bGUgaWQgPSA3MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///70\n");
|
501 |
+
|
502 |
+
/***/ }),
|
503 |
+
/* 71 */
|
504 |
+
/***/ (function(module, exports, __webpack_require__) {
|
505 |
+
|
506 |
+
eval("__webpack_require__(72);\n__webpack_require__(77);\n__webpack_require__(78);\n__webpack_require__(79);\nmodule.exports = __webpack_require__(0).Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qcz8wNzA3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN5bWJvbCcpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZycpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcuc3ltYm9sLmFzeW5jLWl0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuU3ltYm9sO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gNzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///71\n");
|
507 |
+
|
508 |
+
/***/ }),
|
509 |
+
/* 72 */
|
510 |
+
/***/ (function(module, exports, __webpack_require__) {
|
511 |
+
|
512 |
+
"use strict";
|
513 |
+
eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(1);\nvar has = __webpack_require__(2);\nvar DESCRIPTORS = __webpack_require__(4);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(35);\nvar META = __webpack_require__(73).KEY;\nvar $fails = __webpack_require__(11);\nvar shared = __webpack_require__(17);\nvar setToStringTag = __webpack_require__(24);\nvar uid = __webpack_require__(13);\nvar wks = __webpack_require__(9);\nvar wksExt = __webpack_require__(25);\nvar wksDefine = __webpack_require__(26);\nvar enumKeys = __webpack_require__(74);\nvar isArray = __webpack_require__(75);\nvar anObject = __webpack_require__(10);\nvar isObject = __webpack_require__(7);\nvar toIObject = __webpack_require__(8);\nvar toPrimitive = __webpack_require__(18);\nvar createDesc = __webpack_require__(14);\nvar _create = __webpack_require__(21);\nvar gOPNExt = __webpack_require__(76);\nvar $GOPD = __webpack_require__(40);\nvar $DP = __webpack_require__(3);\nvar $keys = __webpack_require__(22);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(39).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(27).f = $propertyIsEnumerable;\n __webpack_require__(38).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(12)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(6)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN5bWJvbC5qcz83ZDY3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEVDTUFTY3JpcHQgNiBzeW1ib2xzIHNoaW1cbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHJlZGVmaW5lID0gcmVxdWlyZSgnLi9fcmVkZWZpbmUnKTtcbnZhciBNRVRBID0gcmVxdWlyZSgnLi9fbWV0YScpLktFWTtcbnZhciAkZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIHNoYXJlZCA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbnZhciB3a3MgPSByZXF1aXJlKCcuL193a3MnKTtcbnZhciB3a3NFeHQgPSByZXF1aXJlKCcuL193a3MtZXh0Jyk7XG52YXIgd2tzRGVmaW5lID0gcmVxdWlyZSgnLi9fd2tzLWRlZmluZScpO1xudmFyIGVudW1LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1rZXlzJyk7XG52YXIgaXNBcnJheSA9IHJlcXVpcmUoJy4vX2lzLWFycmF5Jyk7XG52YXIgYW5PYm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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///72\n");
|
514 |
+
|
515 |
+
/***/ }),
|
516 |
+
/* 73 */
|
517 |
+
/***/ (function(module, exports, __webpack_require__) {
|
518 |
+
|
519 |
+
eval("var META = __webpack_require__(13)('meta');\nvar isObject = __webpack_require__(7);\nvar has = __webpack_require__(2);\nvar setDesc = __webpack_require__(3).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(11)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21ldGEuanM/ZDNhMyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgTUVUQSA9IHJlcXVpcmUoJy4vX3VpZCcpKCdtZXRhJyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBzZXREZXNjID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbnZhciBpZCA9IDA7XG52YXIgaXNFeHRlbnNpYmxlID0gT2JqZWN0LmlzRXh0ZW5zaWJsZSB8fCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiB0cnVlO1xufTtcbnZhciBGUkVFWkUgPSAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBpc0V4dGVuc2libGUoT2JqZWN0LnByZXZlbnRFeHRlbnNpb25zKHt9KSk7XG59KTtcbnZhciBzZXRNZXRhID0gZnVuY3Rpb24gKGl0KSB7XG4gIHNldERlc2MoaXQsIE1FVEEsIHsgdmFsdWU6IHtcbiAgICBpOiAnTycgKyArK2lkLCAvLyBvYmplY3QgSURcbiAgICB3OiB7fSAgICAgICAgICAvLyB3ZWFrIGNvbGxlY3Rpb25zIElEc1xuICB9IH0pO1xufTtcbnZhciBmYXN0S2V5ID0gZnVuY3Rpb24gKGl0LCBjcmVhdGUpIHtcbiAgLy8gcmV0dXJuIHByaW1pdGl2ZSB3aXRoIHByZWZpeFxuICBpZiAoIWlzT2JqZWN0KGl0KSkgcmV0dXJuIHR5cGVvZiBpdCA9PSAnc3ltYm9sJyA/IGl0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AmJiAhaGFzKGl0LCBNRVRBKSkgc2V0TWV0YShpdCk7XG4gIHJldHVybiBpdDtcbn07XG52YXIgbWV0YSA9IG1vZHVsZS5leHBvcnRzID0ge1xuICBLRVk6IE1FVEEsXG4gIE5FRUQ6IGZhbHNlLFxuICBmYXN0S2V5OiBmYXN0S2V5LFxuICBnZXRXZWFrOiBnZXRXZWFrLFxuICBvbkZyZWV6ZTogb25GcmVlemVcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbWV0YS5qc1xuLy8gbW9kdWxlIGlkID0gNzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///73\n");
|
520 |
+
|
521 |
+
/***/ }),
|
522 |
+
/* 74 */
|
523 |
+
/***/ (function(module, exports, __webpack_require__) {
|
524 |
+
|
525 |
+
eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(22);\nvar gOPS = __webpack_require__(38);\nvar pIE = __webpack_require__(27);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0ta2V5cy5qcz81ZGNlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGFsbCBlbnVtZXJhYmxlIG9iamVjdCBrZXlzLCBpbmNsdWRlcyBzeW1ib2xzXG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG52YXIgZ09QUyA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BzJyk7XG52YXIgcElFID0gcmVxdWlyZSgnLi9fb2JqZWN0LXBpZScpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgdmFyIHJlc3VsdCA9IGdldEtleXMoaXQpO1xuICB2YXIgZ2V0U3ltYm9scyA9IGdPUFMuZjtcbiAgaWYgKGdldFN5bWJvbHMpIHtcbiAgICB2YXIgc3ltYm9scyA9IGdldFN5bWJvbHMoaXQpO1xuICAgIHZhciBpc0VudW0gPSBwSUUuZjtcbiAgICB2YXIgaSA9IDA7XG4gICAgdmFyIGtleTtcbiAgICB3aGlsZSAoc3ltYm9scy5sZW5ndGggPiBpKSBpZiAoaXNFbnVtLmNhbGwoaXQsIGtleSA9IHN5bWJvbHNbaSsrXSkpIHJlc3VsdC5wdXNoKGtleSk7XG4gIH0gcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZW51bS1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA3NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///74\n");
|
526 |
+
|
527 |
+
/***/ }),
|
528 |
+
/* 75 */
|
529 |
+
/***/ (function(module, exports, __webpack_require__) {
|
530 |
+
|
531 |
+
eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(37);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LmpzP2VkNDMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjIgSXNBcnJheShhcmd1bWVudClcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gQXJyYXkuaXNBcnJheSB8fCBmdW5jdGlvbiBpc0FycmF5KGFyZykge1xuICByZXR1cm4gY29mKGFyZykgPT0gJ0FycmF5Jztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDc1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///75\n");
|
532 |
+
|
533 |
+
/***/ }),
|
534 |
+
/* 76 */
|
535 |
+
/***/ (function(module, exports, __webpack_require__) {
|
536 |
+
|
537 |
+
eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(8);\nvar gOPN = __webpack_require__(39).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qcz80NmI3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbGxiYWNrIGZvciBJRTExIGJ1Z2d5IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzIHdpdGggaWZyYW1lIGFuZCB3aW5kb3dcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgZ09QTiA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BuJykuZjtcbnZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG52YXIgd2luZG93TmFtZXMgPSB0eXBlb2Ygd2luZG93ID09ICdvYmplY3QnICYmIHdpbmRvdyAmJiBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lc1xuICA/IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHdpbmRvdykgOiBbXTtcblxudmFyIGdldFdpbmRvd05hbWVzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGdPUE4oaXQpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHdpbmRvd05hbWVzLnNsaWNlKCk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzLmYgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKGl0KSB7XG4gIHJldHVybiB3aW5kb3dOYW1lcyAmJiB0b1N0cmluZy5jYWxsKGl0KSA9PSAnW29iamVjdCBXaW5kb3ddJyA/IGdldFdpbmRvd05hbWVzKGl0KSA6IGdPUE4odG9JT2JqZWN0KGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///76\n");
|
538 |
+
|
539 |
+
/***/ }),
|
540 |
+
/* 77 */
|
541 |
+
/***/ (function(module, exports) {
|
542 |
+
|
543 |
+
eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzcuanMiLCJzb3VyY2VzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///77\n");
|
544 |
+
|
545 |
+
/***/ }),
|
546 |
+
/* 78 */
|
547 |
+
/***/ (function(module, exports, __webpack_require__) {
|
548 |
+
|
549 |
+
eval("__webpack_require__(26)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvci5qcz8zOTg5Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKSgnYXN5bmNJdGVyYXRvcicpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///78\n");
|
550 |
+
|
551 |
+
/***/ }),
|
552 |
+
/* 79 */
|
553 |
+
/***/ (function(module, exports, __webpack_require__) {
|
554 |
+
|
555 |
+
eval("__webpack_require__(26)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5vYnNlcnZhYmxlLmpzPzQxNjciXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fd2tzLWRlZmluZScpKCdvYnNlcnZhYmxlJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUuanNcbi8vIG1vZHVsZSBpZCA9IDc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///79\n");
|
556 |
+
|
557 |
+
/***/ }),
|
558 |
+
/* 80 */
|
559 |
+
/***/ (function(module, exports, __webpack_require__) {
|
560 |
+
|
561 |
+
"use strict";
|
562 |
+
eval("\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = __webpack_require__(81);\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = __webpack_require__(85);\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = __webpack_require__(33);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVs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* 81 */
|
566 |
+
/***/ (function(module, exports, __webpack_require__) {
|
567 |
+
|
568 |
+
eval("module.exports = { \"default\": __webpack_require__(82), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9zZXQtcHJvdG90eXBlLW9mLmpzPzkyMjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9zZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9zZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA4MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///81\n");
|
569 |
+
|
570 |
+
/***/ }),
|
571 |
+
/* 82 */
|
572 |
+
/***/ (function(module, exports, __webpack_require__) {
|
573 |
+
|
574 |
+
eval("__webpack_require__(83);\nmodule.exports = __webpack_require__(0).Object.setPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9zZXQtcHJvdG90eXBlLW9mLmpzPzhiZjAiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpLk9iamVjdC5zZXRQcm90b3R5cGVPZjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gODJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///82\n");
|
575 |
+
|
576 |
+
/***/ }),
|
577 |
+
/* 83 */
|
578 |
+
/***/ (function(module, exports, __webpack_require__) {
|
579 |
+
|
580 |
+
eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(5);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(84).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5zZXQtcHJvdG90eXBlLW9mLmpzPzdiMTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4zLjE5IE9iamVjdC5zZXRQcm90b3R5cGVPZihPLCBwcm90bylcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHsgc2V0UHJvdG90eXBlT2Y6IHJlcXVpcmUoJy4vX3NldC1wcm90bycpLnNldCB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gODNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///83\n");
|
581 |
+
|
582 |
+
/***/ }),
|
583 |
+
/* 84 */
|
584 |
+
/***/ (function(module, exports, __webpack_require__) {
|
585 |
+
|
586 |
+
eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(7);\nvar anObject = __webpack_require__(10);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(30)(Function.call, __webpack_require__(40).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC1wcm90by5qcz82NWE0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIFdvcmtzIHdpdGggX19wcm90b19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RvKTtcbiAgICAgICAgcmV0dXJuIE87XG4gICAgICB9O1xuICAgIH0oe30sIGZhbHNlKSA6IHVuZGVmaW5lZCksXG4gIGNoZWNrOiBjaGVja1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtcHJvdG8uanNcbi8vIG1vZHVsZSBpZCA9IDg0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///84\n");
|
587 |
+
|
588 |
+
/***/ }),
|
589 |
+
/* 85 */
|
590 |
+
/***/ (function(module, exports, __webpack_require__) {
|
591 |
+
|
592 |
+
eval("module.exports = { \"default\": __webpack_require__(86), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9jcmVhdGUuanM/M2FmNCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2NyZWF0ZVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSA4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///85\n");
|
593 |
+
|
594 |
+
/***/ }),
|
595 |
+
/* 86 */
|
596 |
+
/***/ (function(module, exports, __webpack_require__) {
|
597 |
+
|
598 |
+
eval("__webpack_require__(87);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGUuanM/YTBjZSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuY3JlYXRlJyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGNyZWF0ZShQLCBEKSB7XG4gIHJldHVybiAkT2JqZWN0LmNyZWF0ZShQLCBEKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2NyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///86\n");
|
599 |
+
|
600 |
+
/***/ }),
|
601 |
+
/* 87 */
|
602 |
+
/***/ (function(module, exports, __webpack_require__) {
|
603 |
+
|
604 |
+
eval("var $export = __webpack_require__(5);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(21) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUuanM/YjA1ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjIgLyAxNS4yLjMuNSBPYmplY3QuY3JlYXRlKE8gWywgUHJvcGVydGllc10pXG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHsgY3JlYXRlOiByZXF1aXJlKCcuL19vYmplY3QtY3JlYXRlJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///87\n");
|
605 |
+
|
606 |
+
/***/ })
|
607 |
+
/******/ ]);
|
trunk/includes/builders/gutenberg/assets/js/dist/wpglobus-block-editor.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(c){var t={};function l(e){if(t[e])return t[e].exports;var n=t[e]={i:e,l:!1,exports:{}};return c[e].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=c,l.c=t,l.d=function(e,n,c){l.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:c})},l.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(n,"a",n),n},l.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},l.p="",l(l.s=41)}([function(module,exports){eval("var core = module.exports = { version: '2.6.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz8xNWUwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjYuNScgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZ2xvYmFsLmpzP2VjYWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzg2I2lzc3VlY29tbWVudC0xMTU3NTkwMjhcbnZhciBnbG9iYWwgPSBtb2R1bGUuZXhwb3J0cyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93Lk1hdGggPT0gTWF0aFxuICA/IHdpbmRvdyA6IHR5cGVvZiBzZWxmICE9ICd1bmRlZmluZWQnICYmIHNlbGYuTWF0aCA9PSBNYXRoID8gc2VsZlxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tbmV3LWZ1bmNcbiAgOiBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuaWYgKHR5cGVvZiBfX2cgPT0gJ251bWJlcicpIF9fZyA9IGdsb2JhbDsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///1\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzPzBmNjIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhc093blByb3BlcnR5ID0ge30uaGFzT3duUHJvcGVydHk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwga2V5KSB7XG4gIHJldHVybiBoYXNPd25Qcm9wZXJ0eS5jYWxsKGl0LCBrZXkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19oYXMuanNcbi8vIG1vZHVsZSBpZCA9IDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(10);\nvar IE8_DOM_DEFINE = __webpack_require__(31);\nvar toPrimitive = __webpack_require__(18);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data: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yBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(11)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/Zjg0ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar ctx = __webpack_require__(30);\nvar hide = __webpack_require__(6);\nvar has = __webpack_require__(2);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzPzkwY2QiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBQUk9UT1RZUEUgPSAncHJvdG90eXBlJztcblxudmFyICRleHBvcnQgPSBmdW5jdGlvbiAodHlwZSwgbmFtZSwgc291cmNlKSB7XG4gIHZhciBJU19GT1JDRUQgPSB0eXBlICYgJGV4cG9ydC5GO1xuICB2YXIgSVNfR0xPQkFMID0gdHlwZSAmICRleHBvcnQuRztcbiAgdmFyIElTX1NUQVRJQyA9IHR5cGUgJiAkZXhwb3J0LlM7XG4gIHZhciBJU19QUk9UTyA9IHR5cGUgJiAkZXhwb3J0LlA7XG4gIHZhciBJU19CSU5EID0gdHlwZSAmICRleHBvcnQuQjtcbiAgdmFyIElTX1dSQVAgPSB0eXBlICYgJGV4cG9ydC5XO1xuICB2YXIgZXhwb3J0cyA9IElTX0dMT0JBTCA/IGNvcmUgOiBjb3JlW25hbWVdIHx8IChjb3JlW25hbWVdID0ge30pO1xuICB2YXIgZXhwUHJvdG8gPSBleHBvcnRz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ZXhwb3J0LlMgPSA0OyAgIC8vIHN0YXRpY1xuJGV4cG9ydC5QID0gODsgICAvLyBwcm90b1xuJGV4cG9ydC5CID0gMTY7ICAvLyBiaW5kXG4kZXhwb3J0LlcgPSAzMjsgIC8vIHdyYXBcbiRleHBvcnQuVSA9IDY0OyAgLy8gc2FmZVxuJGV4cG9ydC5SID0gMTI4OyAvLyByZWFsIHByb3RvIG1ldGhvZCBmb3IgYGxpYnJhcnlgXG5tb2R1bGUuZXhwb3J0cyA9ICRleHBvcnQ7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzXG4vLyBtb2R1bGUgaWQgPSA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(3);\nvar createDesc = __webpack_require__(14);\nmodule.exports = __webpack_require__(4) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qcz84NDljIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGNyZWF0ZURlc2MgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIHJldHVybiBkUC5mKG9iamVjdCwga2V5LCBjcmVhdGVEZXNjKDEsIHZhbHVlKSk7XG59IDogZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICBvYmplY3Rba2V5XSA9IHZhbHVlO1xuICByZXR1cm4gb2JqZWN0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSA2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzEyYTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(61);\nvar defined = __webpack_require__(15);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8taW9iamVjdC5qcz80ZGM0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHRvIGluZGV4ZWQgb2JqZWN0LCB0b09iamVjdCB3aXRoIGZhbGxiYWNrIGZvciBub24tYXJyYXktbGlrZSBFUzMgc3RyaW5nc1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBJT2JqZWN0KGRlZmluZWQoaXQpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8taW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(17)('wks');\nvar uid = __webpack_require__(13);\nvar Symbol = __webpack_require__(1).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLmpzPzc1MmMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHN0b3JlID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ3drcycpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xudmFyIFN5bWJvbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLlN5bWJvbDtcbnZhciBVU0VfU1lNQk9MID0gdHlwZW9mIFN5bWJvbCA9PSAnZnVuY3Rpb24nO1xuXG52YXIgJGV4cG9ydHMgPSBtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHJldHVybiBzdG9yZVtuYW1lXSB8fCAoc3RvcmVbbmFtZV0gPVxuICAgIFVTRV9TWU1CT0wgJiYgU3ltYm9sW25hbWVdIHx8IChVU0VfU1lNQk9MID8gU3ltYm9sIDogdWlkKSgnU3ltYm9sLicgKyBuYW1lKSk7XG59O1xuXG4kZXhwb3J0cy5zdG9yZSA9IHN0b3JlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy5qc1xuLy8gbW9kdWxlIGlkID0gOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(7);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qcz9lZmIzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///11\n")},function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gMTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///13\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/ZTc2OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///15\n')},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(17)('keys');\nvar uid = __webpack_require__(13);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/NmIxZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAxNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(12) ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qcz83YmMwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIFNIQVJFRCA9ICdfX2NvcmUtanNfc2hhcmVkX18nO1xudmFyIHN0b3JlID0gZ2xvYmFsW1NIQVJFRF0gfHwgKGdsb2JhbFtTSEFSRURdID0ge30pO1xuXG4obW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkge1xuICByZXR1cm4gc3RvcmVba2V5XSB8fCAoc3RvcmVba2V5XSA9IHZhbHVlICE9PSB1bmRlZmluZWQgPyB2YWx1ZSA6IHt9KTtcbn0pKCd2ZXJzaW9ucycsIFtdKS5wdXNoKHtcbiAgdmVyc2lvbjogY29yZS52ZXJzaW9uLFxuICBtb2RlOiByZXF1aXJlKCcuL19saWJyYXJ5JykgPyAncHVyZScgOiAnZ2xvYmFsJyxcbiAgY29weXJpZ2h0OiAnwqkgMjAxOSBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSdcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qc1xuLy8gbW9kdWxlIGlkID0gMTdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///17\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(7);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8zMjYzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIFRvUHJpbWl0aXZlKGlucHV0IFssIFByZWZlcnJlZFR5cGVdKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG4vLyBpbnN0ZWFkIG9mIHRoZSBFUzYgc3BlYyB2ZXJzaW9uLCB3ZSBkaWRuJ3QgaW1wbGVtZW50IEBAdG9QcmltaXRpdmUgY2FzZVxuLy8gYW5kIHRoZSBzZWNvbmQgYXJndW1lbnQgLSBmbGFnIC0gcHJlZmVycmVkIHR5cGUgaXMgYSBzdHJpbmdcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBTKSB7XG4gIGlmICghaXNPYmplY3QoaXQpKSByZXR1cm4gaXQ7XG4gIHZhciBmbiwgdmFsO1xuICBpZiAoUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgaWYgKHR5cGVvZiAoZm4gPSBpdC52YWx1ZU9mKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIGlmICghUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY29udmVydCBvYmplY3QgdG8gcHJpbWl0aXZlIHZhbHVlXCIpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1wcmltaXRpdmUuanNcbi8vIG1vZHVsZSBpZCA9IDE4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///18\n")},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/NTJlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = {};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXJhdG9ycy5qcz9mZGI0Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0ge307XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlcmF0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///20\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(10);\nvar dPs = __webpack_require__(60);\nvar enumBugKeys = __webpack_require__(23);\nvar IE_PROTO = __webpack_require__(16)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(32)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(65).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1jcmVhdGUuanM/NjI4NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMiAvIDE1LjIuMy41IE9iamVjdC5jcmVhdGUoTyBbLCBQcm9wZXJ0aWVzXSlcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGRQcyA9IHJlcXVpcmUoJy4vX29iamVjdC1kcHMnKTtcbnZhciBlbnVtQnVnS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKTtcbnZhciBJRV9QUk9UTy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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///21\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(36);\nvar enumBugKeys = __webpack_require__(23);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YzY3NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///23\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(3).f;\nvar has = __webpack_require__(2);\nvar TAG = __webpack_require__(9)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC10by1zdHJpbmctdGFnLmpzPzdiYTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRlZiA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgVEFHID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvU3RyaW5nVGFnJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCB0YWcsIHN0YXQpIHtcbiAgaWYgKGl0ICYmICFoYXMoaXQgPSBzdGF0ID8gaXQgOiBpdC5wcm90b3R5cGUsIFRBRykpIGRlZihpdCwgVEFHLCB7IGNvbmZpZ3VyYWJsZTogdHJ1ZSwgdmFsdWU6IHRhZyB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXRvLXN0cmluZy10YWcuanNcbi8vIG1vZHVsZSBpZCA9IDI0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(9);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1leHQuanM/MmExZSJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSByZXF1aXJlKCcuL193a3MnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAyNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///25\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar LIBRARY = __webpack_require__(12);\nvar wksExt = __webpack_require__(25);\nvar defineProperty = __webpack_require__(3).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1kZWZpbmUuanM/NzJiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyIHdrc0V4dCA9IHJlcXVpcmUoJy4vX3drcy1leHQnKTtcbnZhciBkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHZhciAkU3ltYm9sID0gY29yZS5TeW1ib2wgfHwgKGNvcmUuU3ltYm9sID0gTElCUkFSWSA/IHt9IDogZ2xvYmFsLlN5bWJvbCB8fCB7fSk7XG4gIGlmIChuYW1lLmNoYXJBdCgwKSAhPSAnXycgJiYgIShuYW1lIGluICRTeW1ib2wpKSBkZWZpbmVQcm9wZXJ0eSgkU3ltYm9sLCBuYW1lLCB7IHZhbHVlOiB3a3NFeHQuZihuYW1lKSB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///26\n")},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/MzY5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSAyN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///27\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(15);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(2);\nvar toObject = __webpack_require__(28);\nvar IE_PROTO = __webpack_require__(16)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1ncG8uanM/M2YzYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuOSAvIDE1LjIuMy4yIE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgT2JqZWN0UHJvdG8gPSBPYmplY3QucHJvdG90eXBlO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5nZXRQcm90b3R5cGVPZiB8fCBmdW5jdGlvbiAoTykge1xuICBPID0gdG9PYmplY3QoTyk7XG4gIGlmIChoYXMoTywgSUVfUFJPVE8pKSByZXR1cm4gT1tJRV9QUk9UT107XG4gIGlmICh0eXBlb2YgTy5jb25zdHJ1Y3RvciA9PSAnZnVuY3Rpb24nICYmIE8gaW5zdGFuY2VvZiBPLmNvbnN0cnVjdG9yKSB7XG4gICAgcmV0dXJuIE8uY29uc3RydWN0b3IucHJvdG90eXBlO1xuICB9IHJldHVybiBPIGluc3RhbmNlb2YgT2JqZWN0ID8gT2JqZWN0UHJvdG8gOiBudWxsO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ3BvLmpzXG4vLyBtb2R1bGUgaWQgPSAyOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(48);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///30\n")},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(4) && !__webpack_require__(11)(function () {\n return Object.defineProperty(__webpack_require__(32)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzPzQ5ZjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///31\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(7);\nvar document = __webpack_require__(1).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/MzhkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///32\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(55);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(70);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {\n return typeof obj === "undefined" ? "undefined" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz9hNDU2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2l0ZXJhdG9yID0gcmVxdWlyZShcIi4uL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yXCIpO1xuXG52YXIgX2l0ZXJhdG9yMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2l0ZXJhdG9yKTtcblxudmFyIF9zeW1ib2wgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9zeW1ib2xcIik7XG5cbnZhciBfc3ltYm9sMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX3N5bWJvbCk7XG5cbnZhciBfdHlwZW9mID0gdHlwZW9mIF9zeW1ib2wyLmRlZmF1bHQgPT09IFwiZnVuY3Rpb25cIiAmJiB0eXBlb2YgX2l0ZXJhdG9yMi5kZWZhdWx0ID09PSBcInN5bWJvbFwiID8gZnVuY3Rpb24gKG9iaikgeyByZXR1cm4gdHlwZW9mIG9iajsgfSA6IGZ1bmN0aW9uIChvYmopIHsgcmV0dXJuIG9iaiAmJiB0eXBlb2YgX3N5bWJvbDIuZGVmYXVsdCA9PT0gXCJmdW5jdGlvblwiICYmIG9iai5jb25zdHJ1Y3RvciA9PT0gX3N5bWJvbDIuZGVmYXVsdCAmJiBvYmogIT09IF9zeW1ib2wyLmRlZmF1bHQucHJvdG90eXBlID8gXCJzeW1ib2xcIiA6IHR5cGVvZi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BQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///33\n')},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(12);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(35);\nvar hide = __webpack_require__(6);\nvar Iterators = __webpack_require__(20);\nvar $iterCreate = __webpack_require__(59);\nvar setToStringTag = __webpack_require__(24);\nvar getPrototypeOf = __webpack_require__(29);\nvar ITERATOR = __webpack_require__(9)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItZGVmaW5lLmpzP2JjODAiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIExJQlJBUlkgPSByZXF1aXJlKCcuL19saWJyYXJ5Jyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHJlZGVmaW5lID0gcmVxdWlyZSgnLi9fcmVkZWZpbmUnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xudmFyICRpdGVyQ3JlYXRlID0gcmVxdWlyZSgnLi9faXRlci1jcmVhdGUnKTtcbnZhciBzZXRUb1N0cmluZ1RhZyA9IHJlcXVpcmUoJy4vX3NldC10by1zdHJpbmctdGFnJyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgSVRFUkFUT1IgPSBy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IG1ldGhvZHMpO1xuICB9XG4gIHJldHVybiBtZXRob2RzO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///34\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(6);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLmpzP2YzY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19oaWRlJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fcmVkZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDM1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///35\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(2);\nvar toIObject = __webpack_require__(8);\nvar arrayIndexOf = __webpack_require__(62)(false);\nvar IE_PROTO = __webpack_require__(16)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzPzIxYjgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUluZGV4T2YgPSByZXF1aXJlKCcuL19hcnJheS1pbmNsdWRlcycpKGZhbHNlKTtcbnZhciBJRV9QUk9UTyA9IHJlcXVpcmUoJy4vX3NoYXJlZC1rZXknKSgnSUVfUFJPVE8nKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBuYW1lcykge1xuICB2YXIgTyA9IHRvSU9iamVjdChvYmplY3QpO1xuICB2YXIgaSA9IDA7XG4gIHZhciByZXN1bHQgPSBbXTtcbiAgdmFyIGtleTtcbiAgZm9yIChrZXkgaW4gTykgaWYgKGtleSAhPSBJRV9QUk9UTykgaGFzKE8sIGtleSkgJiYgcmVzdWx0LnB1c2goa2V5KTtcbiAgLy8gRG9uJ3QgZW51bSBidWcgJiBoaWRkZW4ga2V5c1xuICB3aGlsZSAobmFtZXMubGVuZ3RoID4gaSkgaWYgKGhhcyhPLCBrZXkgPSBuYW1lc1tpKytdKSkge1xuICAgIH5hcnJheUluZGV4T2YocmVzdWx0LCBrZXkpIHx8IHJlc3VsdC5wdXNoKGtleSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDM2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///36\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDM3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///37\n")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BzLmpzP2Q2NDQiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qc1xuLy8gbW9kdWxlIGlkID0gMzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///38\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(36);\nvar hiddenKeys = __webpack_require__(23).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLmpzPzlmNDQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjcgLyAxNS4yLjMuNCBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhPKVxudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMtaW50ZXJuYWwnKTtcbnZhciBoaWRkZW5LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpLmNvbmNhdCgnbGVuZ3RoJywgJ3Byb3RvdHlwZScpO1xuXG5leHBvcnRzLmYgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyB8fCBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKE8pIHtcbiAgcmV0dXJuICRrZXlzKE8sIGhpZGRlbktleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi5qc1xuLy8gbW9kdWxlIGlkID0gMzlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///39\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(27);\nvar createDesc = __webpack_require__(14);\nvar toIObject = __webpack_require__(8);\nvar toPrimitive = __webpack_require__(18);\nvar has = __webpack_require__(2);\nvar IE8_DOM_DEFINE = __webpack_require__(31);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(4) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BkLmpzPzJjYTYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHBJRSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIElFOF9ET01fREVGSU5FID0gcmVxdWlyZSgnLi9faWU4LWRvbS1kZWZpbmUnKTtcbnZhciBnT1BEID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGdPUEQgOiBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoTywgUCkge1xuICBPID0gdG9JT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZ09QRChPLCBQKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIGlmIChoYXMoTywgUCkpIHJldHVybiBjcmVhdGVEZXNjKCFwSUUuZi5jYWxsKE8sIFApLCBPW1BdKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcGQuanNcbi8vIG1vZHVsZSBpZCA9IDQwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///40\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("Object.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss__ = __webpack_require__(42);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__style_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__style_scss__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sidebar_js__ = __webpack_require__(43);\n// Include stylesheet\n\n\n// Import Click to Tweet Block\n//import './block.js';\n\n// Import Gutenberg Boilerplate Sidebar\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanM/ODc0OSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJbmNsdWRlIHN0eWxlc2hlZXRcbmltcG9ydCAnLi9zdHlsZS5zY3NzJztcblxuLy8gSW1wb3J0IENsaWNrIHRvIFR3ZWV0IEJsb2NrXG4vL2ltcG9ydCAnLi9ibG9jay5qcyc7XG5cbi8vIEltcG9ydCBHdXRlbmJlcmcgQm9pbGVycGxhdGUgU2lkZWJhclxuaW1wb3J0ICcuL3NpZGViYXIuanMnO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vc3JjL2luZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSA0MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///41\n")},function(module,exports){eval("// removed by extract-text-webpack-plugin//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvc3R5bGUuc2Nzcz9hY2Q4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvc3R5bGUuc2Nzc1xuLy8gbW9kdWxlIGlkID0gNDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///42\n")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of__ = __webpack_require__(44);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(49);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(50);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(54);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(80);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__);\n\n\n\n\n\n/**\n * Internal block libraries.\n * @since 2.2.3\n */\nvar __ = wp.i18n.__;\nvar _wp$editPost = wp.editPost,\n PluginSidebar = _wp$editPost.PluginSidebar,\n PluginSidebarMoreMenuItem = _wp$editPost.PluginSidebarMoreMenuItem;\nvar _wp$components = wp.components,\n PanelBody = _wp$components.PanelBody,\n TextControl = _wp$components.TextControl,\n Button = _wp$components.Button,\n Notice = _wp$components.Notice;\nvar _wp$element = wp.element,\n Component = _wp$element.Component,\n Fragment = _wp$element.Fragment;\nvar withSelect = wp.data.withSelect;\nvar compose = wp.compose.compose;\n\n\nvar LanguageSwitcherNotice = function LanguageSwitcherNotice(props) {\n\tif (WPGlobusGutenberg.pagenow == WPGlobusGutenberg.postNewPage) {\n\t\treturn wp.element.createElement('div', null);\n\t}\n\n\tvar dev = '';\n\tif ('undefined' !== typeof WPGlobusBlockEditorDevelop && !WPGlobusBlockEditorDevelop.production) {\n\t\tdev = '(develop)';\n\t}\n\n\treturn wp.element.createElement(\n\t\tNotice,\n\t\t{ className: 'wpglobus-block-editor-panel__notice', status: 'informational', isDismissible: false },\n\t\t__('Select language'),\n\t\t' ',\n\t\tdev\n\t);\n};\n\nvar LanguageSwitcher = function LanguageSwitcher(props) {\n\n\tif (WPGlobusGutenberg.pagenow == WPGlobusGutenberg.postNewPage) {\n\t\treturn wp.element.createElement(\n\t\t\t'div',\n\t\t\t{ className: 'wpglobus-block-editor-panel__switcher-box' },\n\t\t\tWPGlobusGutenberg.i18n.save_post\n\t\t);\n\t}\n\n\tvar language = WPGlobusGutenberg.language;\n\tvar flagsUrl = WPGlobusGutenberg.flags_url;\n\tvar enabledLanguages = WPGlobusCoreData.enabled_languages;\n\tvar languageNames = WPGlobusCoreData.en_language_name;\n\tvar ref = location.href;\n\tvar refs = {};\n\tfor (var key in enabledLanguages) {\n\t\tif (-1 == ref.indexOf('language=' + language)) {\n\t\t\trefs[enabledLanguages[key]] = ref + '&language=' + enabledLanguages[key];\n\t\t} else {\n\t\t\trefs[enabledLanguages[key]] = ref.replace('language=' + language, 'language=' + enabledLanguages[key]);\n\t\t}\n\t}\n\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'wpglobus-block-editor-panel__switcher-box' },\n\t\twp.element.createElement(\n\t\t\t'ul',\n\t\t\tnull,\n\t\t\tenabledLanguages.map(function (lang) {\n\t\t\t\treturn wp.element.createElement(\n\t\t\t\t\t'li',\n\t\t\t\t\t{ key: lang },\n\t\t\t\t\twp.element.createElement('img', { className: 'wpglobus-block-editor-panel__flag', height: '20px', width: '20px', src: flagsUrl[lang] }),\n\t\t\t\t\t'\\xA0\\xA0',\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tButton,\n\t\t\t\t\t\t{ href: refs[lang], isSmall: true, isPrimary: true },\n\t\t\t\t\t\tlanguageNames[lang]\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t})\n\t\t)\n\t);\n};\n\nvar WPGlobusInfo = function WPGlobusInfo(props) {\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'wpglobus-block-editor-panel__info' },\n\t\twp.element.createElement(\n\t\t\tButton,\n\t\t\t{ href: props.href, target: '_blank', isLink: true },\n\t\t\t__('WPGlobus Premium Add-ons')\n\t\t)\n\t);\n};\n\nvar SettingsLink = function SettingsLink(props) {\n\treturn wp.element.createElement(\n\t\t'div',\n\t\t{ className: 'wpglobus-block-editor-panel__settings-link' },\n\t\twp.element.createElement(\n\t\t\tButton,\n\t\t\t{ href: props.href, isLink: true },\n\t\t\t__('Settings')\n\t\t)\n\t);\n};\n\nvar registerPlugin = wp.plugins.registerPlugin;\n\nvar WPGlobus_BlockEditor = function (_Component) {\n\t__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(WPGlobus_BlockEditor, _Component);\n\n\tfunction WPGlobus_BlockEditor() {\n\t\t__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, WPGlobus_BlockEditor);\n\n\t\tvar _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (WPGlobus_BlockEditor.__proto__ || __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of___default()(WPGlobus_BlockEditor)).apply(this, arguments));\n\n\t\tvar dev = '';\n\t\tif ('undefined' !== typeof WPGlobusBlockEditorDevelop && !WPGlobusBlockEditorDevelop.production) {\n\t\t\tdev = ' (develop)';\n\t\t}\n\n\t\t_this.state = {\n\t\t\toptionsTabUrl: WPGlobusGutenberg.block_editor_tab_url,\n\t\t\tstoreLink: WPGlobusGutenberg.store_link,\n\t\t\theaderTitle: __('WPGlobus') + dev,\n\t\t\tmoreMenuItemTitle: __('WPGlobus')\n\t\t};\n\n\t\tsetTimeout(function () {\n\t\t\tvar buttons = document.getElementsByClassName('components-icon-button');\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\n\t\t\t\tvar status = buttons[i].getAttribute('aria-label');\n\t\t\t\t//if ( status == 'WPGlobus' ) { \n\t\t\t\tif (-1 != status.indexOf('WPGlobus')) {\n\t\t\t\t\tvar done = buttons[i].dataset.done;\n\t\t\t\t\tif ('undefined' === typeof done) {\n\t\t\t\t\t\tvar content = buttons[i].innerHTML;\n\t\t\t\t\t\t//@todo buttons[i].classList.add('wpglobus-switcher-button');\n\t\t\t\t\t\tbuttons[i].innerHTML = content + '<img height=\"20px\" width=\"20px\" src=\"' + WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language] + '\" /> ' + WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language];\n\t\t\t\t\t\tbuttons[i].dataset.done = 'yes';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, 500);\n\t\treturn _this;\n\t}\n\n\t__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(WPGlobus_BlockEditor, [{\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\treturn wp.element.createElement(\n\t\t\t\tFragment,\n\t\t\t\tnull,\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPluginSidebarMoreMenuItem,\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: 'wpglobus-gutenberg-sidebar'\n\t\t\t\t\t},\n\t\t\t\t\tthis.state.moreMenuItemTitle\n\t\t\t\t),\n\t\t\t\twp.element.createElement(\n\t\t\t\t\tPluginSidebar,\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'wpglobus-gutenberg-sidebar',\n\t\t\t\t\t\ttitle: this.state.headerTitle\n\t\t\t\t\t},\n\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\tPanelBody,\n\t\t\t\t\t\t{ className: 'wpglobus-block-editor-panel__body' },\n\t\t\t\t\t\twp.element.createElement(LanguageSwitcherNotice, null),\n\t\t\t\t\t\twp.element.createElement(LanguageSwitcher, null),\n\t\t\t\t\t\twp.element.createElement(\n\t\t\t\t\t\t\t'div',\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\twp.element.createElement(WPGlobusInfo, { href: this.state.storeLink }),\n\t\t\t\t\t\t\twp.element.createElement(SettingsLink, { href: this.state.optionsTabUrl })\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn WPGlobus_BlockEditor;\n}(Component);\n\nvar WPGBE = withSelect(function (select, _ref) {\n\tvar forceIsSaving = _ref.forceIsSaving;\n\n\tvar _select = select('core/editor'),\n\t getCurrentPostId = _select.getCurrentPostId,\n\t isSavingPost = _select.isSavingPost,\n\t isPublishingPost = _select.isPublishingPost,\n\t isAutosavingPost = _select.isAutosavingPost;\n\n\treturn {\n\t\tpostId: getCurrentPostId(),\n\t\tisSaving: forceIsSaving || isSavingPost(),\n\t\tisAutoSaving: isAutosavingPost(),\n\t\tisPublishing: isPublishingPost()\n\t};\n})(WPGlobus_BlockEditor);\n\nregisterPlugin('wpglobus-gutenberg', {\n\ticon: 'admin-site',\n\trender: WPGBE\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvc2lkZWJhci5qcz8yNWQ1Il0sInNvdXJjZXNDb250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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(45), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzY3MWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA0NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(46);\nmodule.exports = __webpack_require__(0).Object.getPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzdkMmUiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1wcm90b3R5cGUtb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpLk9iamVjdC5nZXRQcm90b3R5cGVPZjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(28);\nvar $getPrototypeOf = __webpack_require__(29);\n\n__webpack_require__(47)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mLmpzPzJhMWUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjkgT2JqZWN0LmdldFByb3RvdHlwZU9mKE8pXG52YXIgdG9PYmplY3QgPSByZXF1aXJlKCcuL190by1vYmplY3QnKTtcbnZhciAkZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnZ2V0UHJvdG90eXBlT2YnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBnZXRQcm90b3R5cGVPZihpdCkge1xuICAgIHJldHVybiAkZ2V0UHJvdG90eXBlT2YodG9PYmplY3QoaXQpKTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///46\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar fails = __webpack_require__(11);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1zYXAuanM/YmFhNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBtb3N0IE9iamVjdCBtZXRob2RzIGJ5IEVTNiBzaG91bGQgYWNjZXB0IHByaW1pdGl2ZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVksIGV4ZWMpIHtcbiAgdmFyIGZuID0gKGNvcmUuT2JqZWN0IHx8IHt9KVtLRVldIHx8IE9iamVjdFtLRVldO1xuICB2YXIgZXhwID0ge307XG4gIGV4cFtLRVldID0gZXhlYyhmbik7XG4gICRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogZmFpbHMoZnVuY3Rpb24gKCkgeyBmbigxKTsgfSksICdPYmplY3QnLCBleHApO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzXG4vLyBtb2R1bGUgaWQgPSA0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///47\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///48\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzPzY2YjkiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5cbmV4cG9ydHMuZGVmYXVsdCA9IGZ1bmN0aW9uIChpbnN0YW5jZSwgQ29uc3RydWN0b3IpIHtcbiAgaWYgKCEoaW5zdGFuY2UgaW5zdGFuY2VvZiBDb25zdHJ1Y3RvcikpIHtcbiAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwiQ2Fubm90IGNhbGwgYSBjbGFzcyBhcyBhIGZ1bmN0aW9uXCIpO1xuICB9XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9jbGFzc0NhbGxDaGVjay5qc1xuLy8gbW9kdWxlIGlkID0gNDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///49\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(51);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NyZWF0ZUNsYXNzLmpzP2MzMTAiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5cbnZhciBfZGVmaW5lUHJvcGVydHkgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5XCIpO1xuXG52YXIgX2RlZmluZVByb3BlcnR5MiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2RlZmluZVByb3BlcnR5KTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKCkge1xuICBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0aWVzKHRhcmdldCwgcHJvcHMpIHtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHByb3BzLmxlbmd0aDsgaSsrKSB7X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UNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///50\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(52), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/MGI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA1MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///51\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(53);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/ZjViMCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5Jyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpIHtcbiAgcmV0dXJuICRPYmplY3QuZGVmaW5lUHJvcGVydHkoaXQsIGtleSwgZGVzYyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///52\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(4), 'Object', { defineProperty: __webpack_require__(3).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanM/OTgyOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjQgLyAxNS4yLjMuNiBPYmplY3QuZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnR5OiByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDUzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///53\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _typeof2 = __webpack_require__(33);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n\n return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3Bvc3NpYmxlQ29uc3RydWN0b3JSZXR1cm4uanM/Y2YwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9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Q0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///54\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(56), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC9pdGVyYXRvci5qcz82NzM4Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///55\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(57);\n__webpack_require__(66);\nmodule.exports = __webpack_require__(25).f('iterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qcz9mZTdlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvcicpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX3drcy1leHQnKS5mKCdpdGVyYXRvcicpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///56\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(58)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(34)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qcz9jZDA0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuLy8gMjEuMS4zLjI3IFN0cmluZy5wcm90b3R5cGVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faXRlci1kZWZpbmUnKShTdHJpbmcsICdTdHJpbmcnLCBmdW5jdGlvbiAoaXRlcmF0ZWQpIHtcbiAgdGhpcy5fdCA9IFN0cmluZyhpdGVyYXRlZCk7IC8vIHRhcmdldFxuICB0aGlzLl9pID0gMDsgICAgICAgICAgICAgICAgLy8gbmV4dCBpbmRleFxuLy8gMjEuMS41LjIuMSAlU3RyaW5nSXRlcmF0b3JQcm90b3R5cGUlLm5leHQoKVxufSwgZnVuY3Rpb24gKCkge1xuICB2YXIgTyA9IHRoaXMuX3Q7XG4gIHZhciBpbmRleCA9IHRoaXMuX2k7XG4gIHZhciBwb2ludDtcbiAgaWYgKGluZGV4ID49IE8ubGVuZ3RoKSByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIHBvaW50ID0gJGF0KE8sIGluZGV4KTtcbiAgdGhpcy5faSArPSBwb2ludC5sZW5ndGg7XG4gIHJldHVybiB7IHZhbHVlOiBwb2ludCwgZG9uZTogZmFsc2UgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNTdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///57\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(19);\nvar defined = __webpack_require__(15);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3N0cmluZy1hdC5qcz84N2FlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbi8vIHRydWUgIC0+IFN0cmluZyNhdFxuLy8gZmFsc2UgLT4gU3RyaW5nI2NvZGVQb2ludEF0XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChUT19TVFJJTkcpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uICh0aGF0LCBwb3MpIHtcbiAgICB2YXIgcyA9IFN0cmluZyhkZWZpbmVkKHRoYXQpKTtcbiAgICB2YXIgaSA9IHRvSW50ZWdlcihwb3MpO1xuICAgIHZhciBsID0gcy5sZW5ndGg7XG4gICAgdmFyIGEsIGI7XG4gICAgaWYgKGkgPCAwIHx8IGkgPj0gbCkgcmV0dXJuIFRPX1NUUklORyA/ICcnIDogdW5kZWZpbmVkO1xuICAgIGEgPSBzLmNoYXJDb2RlQXQoaSk7XG4gICAgcmV0dXJuIGEgPCAweGQ4MDAgfHwgYSA+IDB4ZGJmZiB8fCBpICsgMSA9PT0gbCB8fCAoYiA9IHMuY2hhckNvZGVBdChpICsgMSkpIDwgMHhkYzAwIHx8IGIgPiAweGRmZmZcbiAgICAgID8gVE9fU1RSSU5HID8gcy5jaGFyQXQoaSkgOiBhXG4gICAgICA6IFRPX1NUUklORyA/IHMuc2xpY2UoaSwgaSArIDIpIDogKGEgLSAweGQ4MDAgPDwgMTApICsgKGIgLSAweGRjMDApICsgMHgxMDAwMDtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc3RyaW5nLWF0LmpzXG4vLyBtb2R1bGUgaWQgPSA1OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///58\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(21);\nvar descriptor = __webpack_require__(14);\nvar setToStringTag = __webpack_require__(24);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(6)(IteratorPrototype, __webpack_require__(9)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY3JlYXRlLmpzP2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6IiJ9\n//# sourceURL=webpack-internal:///59\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(3);\nvar anObject = __webpack_require__(10);\nvar getKeys = __webpack_require__(22);\n\nmodule.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcHMuanM/YWEyYSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydGllcyA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcykge1xuICBhbk9iamVjdChPKTtcbiAgdmFyIGtleXMgPSBnZXRLZXlzKFByb3BlcnRpZXMpO1xuICB2YXIgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG4gIHZhciBpID0gMDtcbiAgdmFyIFA7XG4gIHdoaWxlIChsZW5ndGggPiBpKSBkUC5mKE8sIFAgPSBrZXlzW2krK10sIFByb3BlcnRpZXNbUF0pO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gNjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///60\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(37);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/MzE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///61\n")},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(8);\nvar toLength = __webpack_require__(63);\nvar toAbsoluteIndex = __webpack_require__(64);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzP2JjNTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXNcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9MZW5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yAmJiAtMTtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYXJyYXktaW5jbHVkZXMuanNcbi8vIG1vZHVsZSBpZCA9IDYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///62\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(19);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz80MTExIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///63\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(19);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzPzdlNDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDY0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///64\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(1).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanM/NDRmMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbm1vZHVsZS5leHBvcnRzID0gZG9jdW1lbnQgJiYgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///65\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(67);\nvar global = __webpack_require__(1);\nvar hide = __webpack_require__(6);\nvar Iterators = __webpack_require__(20);\nvar TO_STRING_TAG = __webpack_require__(9)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZS5qcz9mYWQzIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vZXM2LmFycmF5Lml0ZXJhdG9yJyk7XG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciBUT19TVFJJTkdfVEFHID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvU3RyaW5nVGFnJyk7XG5cbnZhciBET01JdGVyYWJsZXMgPSAoJ0NTU1J1bGVMaXN0LENTU1N0eWxlRGVjbGFyYXRpb24sQ1NTVmFsdWVMaXN0LENsaWVudFJlY3RMaXN0LERPTVJlY3RMaXN0LERPTVN0cmluZ0xpc3QsJyArXG4gICdET01Ub2tlbkxpc3Qs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NodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(68);\nvar step = __webpack_require__(69);\nvar Iterators = __webpack_require__(20);\nvar toIObject = __webpack_require__(8);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(34)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LmFycmF5Lml0ZXJhdG9yLmpzP2M0NjkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGFkZFRvVW5zY29wYWJsZXMgPSBy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gJ3ZhbHVlcycpIHJldHVybiBzdGVwKDAsIE9baW5kZXhdKTtcbiAgcmV0dXJuIHN0ZXAoMCwgW2luZGV4LCBPW2luZGV4XV0pO1xufSwgJ3ZhbHVlcycpO1xuXG4vLyBhcmd1bWVudHNMaXN0W0BAaXRlcmF0b3JdIGlzICVBcnJheVByb3RvX3ZhbHVlcyUgKDkuNC40LjYsIDkuNC40LjcpXG5JdGVyYXRvcnMuQXJndW1lbnRzID0gSXRlcmF0b3JzLkFycmF5O1xuXG5hZGRUb1Vuc2NvcGFibGVzKCdrZXlzJyk7XG5hZGRUb1Vuc2NvcGFibGVzKCd2YWx1ZXMnKTtcbmFkZFRvVW5zY29wYWJsZXMoJ2VudHJpZXMnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///67\n")},function(module,exports){eval("module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qcz9lMjY3Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qc1xuLy8gbW9kdWxlIGlkID0gNjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///68\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qcz8xMDY2Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGRvbmUsIHZhbHVlKSB7XG4gIHJldHVybiB7IHZhbHVlOiB2YWx1ZSwgZG9uZTogISFkb25lIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qc1xuLy8gbW9kdWxlIGlkID0gNjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///69\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(71), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC5qcz9lNTA1Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2xcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sLmpzXG4vLyBtb2R1bGUgaWQgPSA3MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///70\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(72);\n__webpack_require__(77);\n__webpack_require__(78);\n__webpack_require__(79);\nmodule.exports = __webpack_require__(0).Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qcz8wNzA3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN5bWJvbCcpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZycpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcuc3ltYm9sLmFzeW5jLWl0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuU3ltYm9sO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gNzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///71\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(1);\nvar has = __webpack_require__(2);\nvar DESCRIPTORS = __webpack_require__(4);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(35);\nvar META = __webpack_require__(73).KEY;\nvar $fails = __webpack_require__(11);\nvar shared = __webpack_require__(17);\nvar setToStringTag = __webpack_require__(24);\nvar uid = __webpack_require__(13);\nvar wks = __webpack_require__(9);\nvar wksExt = __webpack_require__(25);\nvar wksDefine = __webpack_require__(26);\nvar enumKeys = __webpack_require__(74);\nvar isArray = __webpack_require__(75);\nvar anObject = __webpack_require__(10);\nvar isObject = __webpack_require__(7);\nvar toIObject = __webpack_require__(8);\nvar toPrimitive = __webpack_require__(18);\nvar createDesc = __webpack_require__(14);\nvar _create = __webpack_require__(21);\nvar gOPNExt = __webpack_require__(76);\nvar $GOPD = __webpack_require__(40);\nvar $DP = __webpack_require__(3);\nvar $keys = __webpack_require__(22);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(39).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(27).f = $propertyIsEnumerable;\n __webpack_require__(38).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(12)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(6)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzI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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///72\n")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(13)('meta');\nvar isObject = __webpack_require__(7);\nvar has = __webpack_require__(2);\nvar setDesc = __webpack_require__(3).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(11)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21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ZXRXZWFrOiBnZXRXZWFrLFxuICBvbkZyZWV6ZTogb25GcmVlemVcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbWV0YS5qc1xuLy8gbW9kdWxlIGlkID0gNzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///73\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(22);\nvar gOPS = __webpack_require__(38);\nvar pIE = __webpack_require__(27);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21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VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///74\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(37);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LmpzP2VkNDMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjIgSXNBcnJheShhcmd1bWVudClcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gQXJyYXkuaXNBcnJheSB8fCBmdW5jdGlvbiBpc0FycmF5KGFyZykge1xuICByZXR1cm4gY29mKGFyZykgPT0gJ0FycmF5Jztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDc1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///75\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(8);\nvar gOPN = __webpack_require__(39).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qcz80NmI3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbGxiYWNrIGZvciBJRTExIGJ1Z2d5IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzIHdpdGggaWZyYW1lIGFuZCB3aW5kb3dcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgZ09QTiA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BuJykuZjtcbnZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG52YXIgd2luZG93TmFtZXMgPSB0eXBlb2Ygd2luZG93ID09ICdvYmplY3QnICYmIHdpbmRvdyAmJiBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lc1xuICA/IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHdpbmRvdykgOiBbXTtcblxudmFyIGdldFdpbmRvd05hbWVzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGdPUE4oaXQpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHdpbmRvd05hbWVzLnNsaWNlKCk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzLmYgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKGl0KSB7XG4gIHJldHVybiB3aW5kb3dOYW1lcyAmJiB0b1N0cmluZy5jYWxsKGl0KSA9PSAnW29iamVjdCBXaW5kb3ddJyA/IGdldFdpbmRvd05hbWVzKGl0KSA6IGdPUE4odG9JT2JqZWN0KGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///76\n")},function(module,exports){eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzcuanMiLCJzb3VyY2VzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///77\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(26)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvci5qcz8zOTg5Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKSgnYXN5bmNJdGVyYXRvcicpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///78\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(26)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5vYnNlcnZhYmxlLmpzPzQxNjciXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fd2tzLWRlZmluZScpKCdvYnNlcnZhYmxlJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUuanNcbi8vIG1vZHVsZSBpZCA9IDc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///79\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = __webpack_require__(81);\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = __webpack_require__(85);\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = __webpack_require__(33);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2luaGVyaXRzLmpzPzNkZmQiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5cbnZhciBfc2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZlwiKTtcblxudmFyIF9zZXRQcm90b3R5cGVPZjIgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF9zZXRQcm90b3R5cGVPZik7XG5cbnZhciBfY3JlYXRlID0gcmVxdWlyZShcIi4uL2NvcmUtanMvb2JqZWN0L2NyZWF0ZVwiKTtcblxudmFyIF9jcmVhdGUyID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfY3JlYXRlKTtcblxudmFyIF90eXBlb2YyID0gcmVxdWlyZShcIi4uL2hlbHBlcnMvdHlwZW9mXCIpO1xuXG52YXIgX3R5cGVvZjMgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF90eXBlb2YyKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9ia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bW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///80\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(82), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9zZXQtcHJvdG90eXBlLW9mLmpzPzkyMjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9zZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9zZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA4MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///81\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(83);\nmodule.exports = __webpack_require__(0).Object.setPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9zZXQtcHJvdG90eXBlLW9mLmpzPzhiZjAiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpLk9iamVjdC5zZXRQcm90b3R5cGVPZjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gODJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///82\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(5);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(84).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5zZXQtcHJvdG90eXBlLW9mLmpzPzdiMTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4zLjE5IE9iamVjdC5zZXRQcm90b3R5cGVPZihPLCBwcm90bylcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHsgc2V0UHJvdG90eXBlT2Y6IHJlcXVpcmUoJy4vX3NldC1wcm90bycpLnNldCB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gODNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///83\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(7);\nvar anObject = __webpack_require__(10);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(30)(Function.call, __webpack_require__(40).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMv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gICBpZiAoYnVnZ3kpIE8uX19wcm90b19fID0gcHJvdG87XG4gICAgICAgIGVsc2Ugc2V0KE8sIHByb3RvKTtcbiAgICAgICAgcmV0dXJuIE87XG4gICAgICB9O1xuICAgIH0oe30sIGZhbHNlKSA6IHVuZGVmaW5lZCksXG4gIGNoZWNrOiBjaGVja1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtcHJvdG8uanNcbi8vIG1vZHVsZSBpZCA9IDg0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///84\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(86), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9jcmVhdGUuanM/M2FmNCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2NyZWF0ZVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSA4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///85\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(87);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGUuanM/YTBjZSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuY3JlYXRlJyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGNyZWF0ZShQLCBEKSB7XG4gIHJldHVybiAkT2JqZWN0LmNyZWF0ZShQLCBEKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2NyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///86\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(21) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUuanM/YjA1ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjIgLyAxNS4yLjMuNSBPYmplY3QuY3JlYXRlKE8gWywgUHJvcGVydGllc10pXG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHsgY3JlYXRlOiByZXF1aXJlKCcuL19vYmplY3QtY3JlYXRlJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///87\n")}]);
|
trunk/includes/builders/gutenberg/assets/js/wpglobus-gutenberg.js
ADDED
@@ -0,0 +1,632 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WPGlobus Administration
|
3 |
+
* Interface JS functions
|
4 |
+
*
|
5 |
+
* @since 1.9.17
|
6 |
+
* @since 2.2.3
|
7 |
+
*
|
8 |
+
* @package WPGlobus
|
9 |
+
* @subpackage Administration/Gutenberg
|
10 |
+
*/
|
11 |
+
/*jslint browser: true */
|
12 |
+
/*global jQuery, console, _wpGutenbergCodeEditorSettings*/
|
13 |
+
|
14 |
+
jQuery(document).ready(function ($) {
|
15 |
+
"use strict";
|
16 |
+
|
17 |
+
var api = {
|
18 |
+
counter: 0,
|
19 |
+
noticeOn: false,
|
20 |
+
initDone: false,
|
21 |
+
languageSelectorBoxDelta: 0,
|
22 |
+
oldLanguageSelector: false,
|
23 |
+
languageSelectorEnabled: true,
|
24 |
+
parseBool: function(b) {
|
25 |
+
return !(/^(false|0)$/i).test(b) && !!b;
|
26 |
+
},
|
27 |
+
getCounter: function(alias) {
|
28 |
+
return api.counter;
|
29 |
+
},
|
30 |
+
getOptionKey: function(alias) {
|
31 |
+
alias = alias || '';
|
32 |
+
return WPGlobusGutenberg.keyOption[alias];
|
33 |
+
},
|
34 |
+
getOptions: function() {
|
35 |
+
return WPGlobusGutenberg.options;
|
36 |
+
},
|
37 |
+
isOldLanguageSelector: function() {
|
38 |
+
return api.oldLanguageSelector;
|
39 |
+
},
|
40 |
+
isPostDisabled: function() {
|
41 |
+
return WPGlobusGutenberg.__post.disabled;
|
42 |
+
},
|
43 |
+
isEnabledTab: function(tab) {
|
44 |
+
if ( 'undefined' === typeof tab ) {
|
45 |
+
tab = 'options';
|
46 |
+
}
|
47 |
+
var enabled = false;
|
48 |
+
if ( 'options' == tab ) {
|
49 |
+
if ( api.parseBool(WPGlobusGutenberg.enabledOptionsTab) ) {
|
50 |
+
enabled = true;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
return enabled;
|
54 |
+
},
|
55 |
+
init: function() {
|
56 |
+
WPGlobusGutenberg.yoastSeo = api.parseBool(WPGlobusGutenberg.yoastSeo);
|
57 |
+
WPGlobusGutenberg.elementor = api.parseBool(WPGlobusGutenberg.elementor);
|
58 |
+
if ( api.isPostDisabled() ) {
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
api.initListeners();
|
62 |
+
api.initNotifications();
|
63 |
+
api.setTabs();
|
64 |
+
api.formHandler();
|
65 |
+
api.attachListeners();
|
66 |
+
},
|
67 |
+
initListeners: function() {
|
68 |
+
if ( WPGlobusGutenberg.yoastSeo && 1 == $('.yoast.wpseo-metabox').length ) {
|
69 |
+
/**
|
70 |
+
* Prevent start of alert message when yoast seo is present.
|
71 |
+
* Check getEventListeners(window).beforeunload in Chrome console for beforeunload event.
|
72 |
+
* @see https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference#monitoreventsobject-events
|
73 |
+
*/
|
74 |
+
$(window).on('beforeunload', function (event) {
|
75 |
+
event.stopImmediatePropagation()
|
76 |
+
});
|
77 |
+
}
|
78 |
+
},
|
79 |
+
formHandler: function() {
|
80 |
+
|
81 |
+
var val = $('.metabox-base-form #referredby').attr('value');
|
82 |
+
if ( 'undefined' !== typeof val ) {
|
83 |
+
if( val.indexOf('language=en') == -1 ) {
|
84 |
+
val = val+'&language='+WPGlobusGutenberg.language;
|
85 |
+
} else {
|
86 |
+
val = val.replace('language=en', 'language='+WPGlobusGutenberg.language);
|
87 |
+
}
|
88 |
+
$('.metabox-base-form #referredby').attr('value', val);
|
89 |
+
}
|
90 |
+
|
91 |
+
val = $('input[name="_wp_original_http_referer"]').attr('value');
|
92 |
+
if ( 'undefined' !== typeof val ) {
|
93 |
+
if( val.indexOf('language=en') == -1 ) {
|
94 |
+
val = val+'&language='+WPGlobusGutenberg.language;
|
95 |
+
} else {
|
96 |
+
val = val.replace('language=en', 'language='+WPGlobusGutenberg.language);
|
97 |
+
}
|
98 |
+
$('input[name="_wp_original_http_referer"]').attr('value', val);
|
99 |
+
}
|
100 |
+
},
|
101 |
+
initNotifications: function() {
|
102 |
+
// @since 2.4.11
|
103 |
+
if ( 'undefined' === typeof wp.editPost || 'undefined' === typeof wp.plugins ) {
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
if ( ! WPGlobusGutenberg.elementor ) {
|
107 |
+
return;
|
108 |
+
}
|
109 |
+
if ( 'internal' != WPGlobusGutenberg.data.elementorCssPrintMethod ) {
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
|
113 |
+
wp.data.dispatch('core/notices').createNotice(
|
114 |
+
'error', // Can be one of: success, info, warning, error.
|
115 |
+
WPGlobusGutenberg.i18n.elementorWarning, // Text string to display.
|
116 |
+
{
|
117 |
+
id: 'elementorcssprintmethodnotice', // Assigning an ID prevents the notice from being added repeatedly.
|
118 |
+
isDismissible: true, // Whether the user can dismiss the notice.
|
119 |
+
actions: [
|
120 |
+
// Any actions the user can perform.
|
121 |
+
{
|
122 |
+
url: WPGlobusGutenberg.i18n.elementorActionLink,
|
123 |
+
label: WPGlobusGutenberg.i18n.elementorActionLabel
|
124 |
+
}
|
125 |
+
]
|
126 |
+
}
|
127 |
+
);
|
128 |
+
},
|
129 |
+
setTabs: function() {
|
130 |
+
if ( WPGlobusGutenberg.tabs.length == 0 ) {
|
131 |
+
api.WPGlobusSwitcherPlugin();
|
132 |
+
return;
|
133 |
+
}
|
134 |
+
api.oldLanguageSelector = true;
|
135 |
+
var intervalID = setInterval( function() {
|
136 |
+
/** var $toolbar = $('.edit-post-header'); **/
|
137 |
+
var $toolbar = $('.edit-post-header__settings');
|
138 |
+
if( $toolbar.length == 1 ) {
|
139 |
+
$toolbar.before(WPGlobusGutenberg.tabs);
|
140 |
+
/*
|
141 |
+
var width = $('.edit-post-header-toolbar').css('width');
|
142 |
+
width = width.replace('px','') * 1;
|
143 |
+
if ( width < 50 ) {
|
144 |
+
width = width + 5;
|
145 |
+
} else {
|
146 |
+
width = width + 30;
|
147 |
+
}
|
148 |
+
$('.wpglobus-gutenberg-selector-box').css({'margin-left':width+'px'});
|
149 |
+
// */
|
150 |
+
clearInterval(intervalID)
|
151 |
+
} else {
|
152 |
+
//console.log('Here: else');
|
153 |
+
}
|
154 |
+
}, 200);
|
155 |
+
},
|
156 |
+
setSelectorStatus: function() {
|
157 |
+
if ( ! api.isOldLanguageSelector() ) {
|
158 |
+
return;
|
159 |
+
}
|
160 |
+
$('.wpglobus-gutenberg-selector-box').css({'opacity':'0.2'}).attr('onclick','return false;');
|
161 |
+
api.languageSelectorEnabled = false;
|
162 |
+
var iID = setInterval( function() {
|
163 |
+
if ( $('.is-saving').length == 0 ) {
|
164 |
+
clearInterval(iID);
|
165 |
+
if ( WPGlobusGutenberg.pagenow == WPGlobusGutenberg.postNewPage ) {
|
166 |
+
if ( location.pathname.indexOf(WPGlobusGutenberg.postEditPage) != -1 ) {
|
167 |
+
WPGlobusGutenberg.pagenow = WPGlobusGutenberg.postEditPage;
|
168 |
+
$('.wpglobus-gutenberg-selector-box').css({'opacity':'1'}).attr('onclick','');
|
169 |
+
api.reloadPage();
|
170 |
+
return;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
api.languageSelectorEnabled = true;
|
174 |
+
$('.wpglobus-gutenberg-selector-box').css({'opacity':'1'}).attr('onclick','');
|
175 |
+
}
|
176 |
+
}, 400);
|
177 |
+
},
|
178 |
+
reloadPage: function() {
|
179 |
+
$('.wpglobus-selector-grid').css({'grid-template-columns':'10% 90%'});
|
180 |
+
$('.wpglobus-gutenberg-selector-text').text(WPGlobusGutenberg.i18n.reload);
|
181 |
+
(function blink() {
|
182 |
+
$('.wpglobus-gutenberg-selector').fadeOut(500).fadeIn(500, blink);
|
183 |
+
})();
|
184 |
+
setTimeout( function() {
|
185 |
+
location.reload();
|
186 |
+
}, 500);
|
187 |
+
},
|
188 |
+
attachListeners: function() {
|
189 |
+
if ( ! api.isOldLanguageSelector() ) {
|
190 |
+
return;
|
191 |
+
}
|
192 |
+
/**
|
193 |
+
* Language selector.
|
194 |
+
*/
|
195 |
+
$(document).on('mouseenter', '.wpglobus-gutenberg-selector', function(ev) {
|
196 |
+
if ( ! api.languageSelectorEnabled ) {
|
197 |
+
return;
|
198 |
+
}
|
199 |
+
$('.wpglobus-gutenberg-selector-dropdown').css({'display':'block'});
|
200 |
+
api.languageSelectorBoxDelta = ev.screenY;
|
201 |
+
$('.edit-post-header').css({'z-index':'100000'});
|
202 |
+
$('.wpglobus-gutenberg-selector-box').css({'z-index':'100001'});
|
203 |
+
});
|
204 |
+
$(document).on('mouseleave', '.wpglobus-gutenberg-selector', function(ev) {
|
205 |
+
if ( api.languageSelectorBoxDelta != 0 && ev.screenY - api.languageSelectorBoxDelta <= 0) {
|
206 |
+
$('.wpglobus-gutenberg-selector-dropdown').css({'display':'none'});
|
207 |
+
$('.edit-post-header').css({'z-index':'9989'});
|
208 |
+
$('.wpglobus-gutenberg-selector-box').css({'z-index':'100'});
|
209 |
+
}
|
210 |
+
});
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Dropdown list.
|
214 |
+
*/
|
215 |
+
$(document).on('mouseleave', '.wpglobus-gutenberg-selector-dropdown', function(ev) {
|
216 |
+
$('.wpglobus-gutenberg-selector-dropdown').css({'display':'none'});
|
217 |
+
$('.edit-post-header').css({'z-index':'9989'});
|
218 |
+
$('.wpglobus-gutenberg-selector-box').css({'z-index':'10000'});
|
219 |
+
});
|
220 |
+
|
221 |
+
/**
|
222 |
+
* editor-post-save-draft.
|
223 |
+
*/
|
224 |
+
$(document).on('click', '.editor-post-save-draft', function() {
|
225 |
+
api.setSelectorStatus();
|
226 |
+
});
|
227 |
+
|
228 |
+
/**
|
229 |
+
* editor-post-publish-button.
|
230 |
+
*/
|
231 |
+
$(document).on('click', '.editor-post-publish-button', function() {
|
232 |
+
api.setSelectorStatus();
|
233 |
+
});
|
234 |
+
|
235 |
+
},
|
236 |
+
WPGlobusSwitcherPlugin: function(){
|
237 |
+
// @since 2.2.3
|
238 |
+
// @since 2.2.14
|
239 |
+
|
240 |
+
if ( 'undefined' === typeof wp.editPost || 'undefined' === typeof wp.plugins ) {
|
241 |
+
// @since 2.2.15
|
242 |
+
return;
|
243 |
+
}
|
244 |
+
var language = WPGlobusGutenberg.language;
|
245 |
+
var enabledLanguages = WPGlobusCoreData.enabled_languages;
|
246 |
+
var languageNames = WPGlobusCoreData.en_language_name;
|
247 |
+
var flagsUrl = WPGlobusGutenberg.flags_url;
|
248 |
+
var switcherButtonTitle = 'WPGlobus Switcher';
|
249 |
+
var ref = location.href;
|
250 |
+
var refs = {};
|
251 |
+
for (var key in enabledLanguages) {
|
252 |
+
if ( -1 == ref.indexOf('language='+language) ) {
|
253 |
+
refs[enabledLanguages[key]] = ref + '&language='+enabledLanguages[key];
|
254 |
+
} else {
|
255 |
+
refs[enabledLanguages[key]] = ref.replace( 'language='+language, 'language='+enabledLanguages[key] );
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
var __ = wp.i18n.__;
|
260 |
+
var el = wp.element.createElement;
|
261 |
+
var Fragment = wp.element.Fragment;
|
262 |
+
|
263 |
+
var TabPanel = wp.components.TabPanel;
|
264 |
+
var withState = wp.compose.withState;
|
265 |
+
var RadioControl = wp.components.RadioControl;
|
266 |
+
var Notice = wp.components.Notice;
|
267 |
+
var Button = wp.components.Button;
|
268 |
+
|
269 |
+
var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
|
270 |
+
var PanelBody = wp.components.PanelBody;
|
271 |
+
var PluginSidebar = wp.editPost.PluginSidebar;
|
272 |
+
var registerPlugin = wp.plugins.registerPlugin;
|
273 |
+
|
274 |
+
var pluginStarButton = $('.components-panel__header.edit-post-sidebar-header button.components-icon-button').eq(0);
|
275 |
+
|
276 |
+
var switcherButtonHTML = {
|
277 |
+
flagOnly: '<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />',
|
278 |
+
flagLanguage: '<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> ' + WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],
|
279 |
+
flagCode: '<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> ' + WPGlobusGutenberg.language,
|
280 |
+
languageOnly: ' ' + WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],
|
281 |
+
languageCode: ' ' + WPGlobusGutenberg.language,
|
282 |
+
};
|
283 |
+
|
284 |
+
var switcherPluginButtonType = '';
|
285 |
+
var promisedPluginButtonType = '';
|
286 |
+
var optionSwitcherButtonType = api.getOptionKey('switcherButtonType');
|
287 |
+
|
288 |
+
function setSwitcherButtonType(type) {
|
289 |
+
type = type || 'flagLanguage';
|
290 |
+
switcherPluginButtonType = type;
|
291 |
+
}
|
292 |
+
|
293 |
+
function getSwitcherButtonType() {
|
294 |
+
return switcherPluginButtonType;
|
295 |
+
}
|
296 |
+
|
297 |
+
function getSwitcherButtonTitle() {
|
298 |
+
return switcherButtonTitle;
|
299 |
+
}
|
300 |
+
|
301 |
+
setSwitcherButtonType(WPGlobusGutenberg.options[optionSwitcherButtonType]);
|
302 |
+
|
303 |
+
promisedPluginButtonType = getSwitcherButtonType();
|
304 |
+
|
305 |
+
$(document).on('click', pluginStarButton, function(){
|
306 |
+
setSwitcherPluginButton();
|
307 |
+
});
|
308 |
+
|
309 |
+
function rbAnimate(start) {
|
310 |
+
if ( 'undefined' === typeof start ) {
|
311 |
+
start = true;
|
312 |
+
}
|
313 |
+
var elems = document.querySelectorAll('.wpglobus-switcher-components-radio-control .components-radio-control__input');
|
314 |
+
if ( elems.length == 0 ) {
|
315 |
+
return;
|
316 |
+
}
|
317 |
+
if ( start ) {
|
318 |
+
elems.forEach(function(elem) {
|
319 |
+
elem.classList.add(elem.value);
|
320 |
+
elem.classList.remove('wpglobus-switcher-pulsate-radio');
|
321 |
+
elem.classList.add('wpglobus-switcher-pulsate-radio-off');
|
322 |
+
});
|
323 |
+
var elem = document.querySelector('.wpglobus-switcher-components-radio-control .'+promisedPluginButtonType);
|
324 |
+
elem.classList.remove('wpglobus-switcher-pulsate-radio-off');
|
325 |
+
elem.classList.add('wpglobus-switcher-pulsate-radio');
|
326 |
+
} else {
|
327 |
+
elems.forEach(function(elem) {
|
328 |
+
elem.classList.remove('wpglobus-switcher-pulsate-radio');
|
329 |
+
elem.classList.remove('wpglobus-switcher-pulsate-radio-off');
|
330 |
+
elem.classList.add('wpglobus-switcher-pulsate-radio-on');
|
331 |
+
});
|
332 |
+
}
|
333 |
+
}
|
334 |
+
function notice(el, mess) {
|
335 |
+
if ( 'undefined' === typeof el || api.noticeOn ) {
|
336 |
+
return;
|
337 |
+
}
|
338 |
+
api.noticeOn = true;
|
339 |
+
el.innerText = mess;
|
340 |
+
el.classList.remove('hidden');
|
341 |
+
setTimeout(function() {
|
342 |
+
el.classList.add('hidden');
|
343 |
+
api.noticeOn = false;
|
344 |
+
}, 3000);
|
345 |
+
}
|
346 |
+
|
347 |
+
function setOption(option, value) {
|
348 |
+
option = option || '';
|
349 |
+
value = value || '';
|
350 |
+
if ( optionSwitcherButtonType == option ) {
|
351 |
+
rbAnimate(true);
|
352 |
+
saveOptions(option, value).then(function(response){
|
353 |
+
if ('success' == response.result) {
|
354 |
+
setSwitcherButtonType(value);
|
355 |
+
WPGlobusGutenberg.options[optionSwitcherButtonType] = value;
|
356 |
+
setSwitcherPluginButton(value);
|
357 |
+
}
|
358 |
+
})
|
359 |
+
.fail( function(response) {
|
360 |
+
var el = document.getElementsByClassName('wpglobus-switcher-error-message');
|
361 |
+
if ('undefined' !== typeof el[0]) {
|
362 |
+
if ('error' == response.result) {
|
363 |
+
notice(el[0], response.message);
|
364 |
+
} else if (response.status == 400) {
|
365 |
+
notice(el[0], 'Error: '+response.status + ' (' + response.statusText + ')' );
|
366 |
+
}
|
367 |
+
promisedPluginButtonType = getSwitcherButtonType();
|
368 |
+
}
|
369 |
+
var tab = document.getElementsByClassName('wpglobus-panel-tab-options');
|
370 |
+
if ('undefined' !== typeof tab[0]) {
|
371 |
+
if ( -1 != tab[0].classList.value.indexOf('is-active') ) {
|
372 |
+
tab[0].click();
|
373 |
+
}
|
374 |
+
}
|
375 |
+
})
|
376 |
+
.always(function() {
|
377 |
+
rbAnimate(false);
|
378 |
+
});
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
function saveOptions(option, value) {
|
383 |
+
option = option || '';
|
384 |
+
if ( option == '' ) {
|
385 |
+
return;
|
386 |
+
}
|
387 |
+
var data = {};
|
388 |
+
data['sender'] = 'WPGlobusGutenberg';
|
389 |
+
data['_action'] = 'saveOption';
|
390 |
+
data['is_admin'] = 1;
|
391 |
+
data['counter'] = api.counter++;
|
392 |
+
data['options'] = {};
|
393 |
+
data['options'][option] = value;
|
394 |
+
return wp.ajax.post(WPGlobusGutenberg.wpglobusAjax, {data:data});
|
395 |
+
}
|
396 |
+
|
397 |
+
function getSwitcherButton(type) {
|
398 |
+
if ( 'undefined' === typeof switcherButtonHTML[type] ) {
|
399 |
+
type = switcherPluginButtonType;
|
400 |
+
}
|
401 |
+
return switcherButtonHTML[type];
|
402 |
+
}
|
403 |
+
|
404 |
+
function setSwitcherPluginButton(type) {
|
405 |
+
if ( 'undefined' === typeof type || 'undefined' === typeof switcherButtonHTML[type] ) {
|
406 |
+
type = switcherPluginButtonType;
|
407 |
+
}
|
408 |
+
|
409 |
+
setTimeout(function() {
|
410 |
+
var button = document.querySelector('[aria-label="'+getSwitcherButtonTitle()+'"]');
|
411 |
+
if ( 'undefined' === typeof button || null === button ) {
|
412 |
+
return;
|
413 |
+
}
|
414 |
+
var status = button.dataset.status;
|
415 |
+
if ( 'undefined' === typeof status ) {
|
416 |
+
var content = button.innerHTML;
|
417 |
+
button.innerHTML = content + getSwitcherButton(type);
|
418 |
+
button.dataset.status = 'init';
|
419 |
+
} else {
|
420 |
+
button.innerHTML = getSwitcherButton(type);
|
421 |
+
button.dataset.status = 'changed';
|
422 |
+
}
|
423 |
+
}, 300);
|
424 |
+
}
|
425 |
+
|
426 |
+
function languageList() {
|
427 |
+
|
428 |
+
if ( WPGlobusGutenberg.pagenow == WPGlobusGutenberg.postNewPage ) {
|
429 |
+
return el(
|
430 |
+
'div',
|
431 |
+
{style:{marginBottom:'20px'},className: "wpglobus-switcher-panel__switcher-notice"},
|
432 |
+
WPGlobusGutenberg.i18n.save_post
|
433 |
+
);
|
434 |
+
}
|
435 |
+
|
436 |
+
return el(
|
437 |
+
'ul',
|
438 |
+
{className: 'language-list'},
|
439 |
+
enabledLanguages.map(
|
440 |
+
function(lang){
|
441 |
+
return el( 'li', {key:lang, className:'language-item'},
|
442 |
+
el('img', {style:{marginRight:'7px',width:'20px'},className:'wpglobus-switcher-panel__flag', height:'20', width:'20', src:flagsUrl[lang]}),
|
443 |
+
el(Button, {href:refs[lang], isSmall:true, isPrimary:true}, languageNames[lang])
|
444 |
+
);
|
445 |
+
}
|
446 |
+
)
|
447 |
+
);
|
448 |
+
}
|
449 |
+
|
450 |
+
function onTabSelect(tab) {
|
451 |
+
if ( tab.name == 'switcher' ) {
|
452 |
+
return SwitcherTabContent();
|
453 |
+
} else if ( tab.name == 'options' ) {
|
454 |
+
return OptionsTabContent();
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
function TabLayout() {
|
459 |
+
|
460 |
+
var tabs = [
|
461 |
+
{
|
462 |
+
name: 'switcher',
|
463 |
+
title: 'Languages',
|
464 |
+
className: 'wpglobus-panel-tab wpglobus-panel-tab-selector edit-post-sidebar__panel-tab'
|
465 |
+
}
|
466 |
+
];
|
467 |
+
|
468 |
+
if ( WPGlobusGutenberg.isEnabledTab('options') ) {
|
469 |
+
tabs.push(
|
470 |
+
{
|
471 |
+
name: 'options',
|
472 |
+
title: 'Options',
|
473 |
+
className: 'wpglobus-panel-tab wpglobus-panel-tab-options edit-post-sidebar__panel-tab'
|
474 |
+
}
|
475 |
+
);
|
476 |
+
}
|
477 |
+
|
478 |
+
return el(
|
479 |
+
TabPanel,
|
480 |
+
{
|
481 |
+
name: 'WPGlobusSwitcherTabPanel',
|
482 |
+
className: 'wpglobus-tab-panel',
|
483 |
+
activeClass: 'is-active',
|
484 |
+
tabs: tabs
|
485 |
+
},
|
486 |
+
onTabSelect
|
487 |
+
);
|
488 |
+
}
|
489 |
+
|
490 |
+
function SwitcherTabContent() {
|
491 |
+
return el(
|
492 |
+
'div',
|
493 |
+
{
|
494 |
+
className: 'wpglobus-tab-content wpglobus-selector-tab-content',
|
495 |
+
},
|
496 |
+
el(
|
497 |
+
Notice,
|
498 |
+
{
|
499 |
+
className: 'wpglobus-switcher-panel__notice',
|
500 |
+
status: 'informational',
|
501 |
+
isDismissible: false
|
502 |
+
},
|
503 |
+
__( 'Select language' )
|
504 |
+
),
|
505 |
+
el(
|
506 |
+
'div',
|
507 |
+
{
|
508 |
+
className: 'wpglobus-switcher-panel__switcher-box'
|
509 |
+
},
|
510 |
+
languageList()
|
511 |
+
),
|
512 |
+
el(
|
513 |
+
Button,
|
514 |
+
{
|
515 |
+
className: 'wpglobus-switcher-panel__button-link wpglobus-switcher-panel__info',
|
516 |
+
href: WPGlobusGutenberg.store_link,
|
517 |
+
isLink: true,
|
518 |
+
target: "_blank"
|
519 |
+
},
|
520 |
+
__( 'WPGlobus Premium' )
|
521 |
+
),
|
522 |
+
el(
|
523 |
+
Button,
|
524 |
+
{
|
525 |
+
className: 'wpglobus-switcher-panel__button-link wpglobus-switcher-panel__settings-link',
|
526 |
+
href: WPGlobusGutenberg.options_page_url,
|
527 |
+
isLink: true
|
528 |
+
},
|
529 |
+
__( 'WPGlobus Options' )
|
530 |
+
)
|
531 |
+
);
|
532 |
+
}
|
533 |
+
|
534 |
+
var SwitcherPluginButton = withState({
|
535 |
+
value: promisedPluginButtonType
|
536 |
+
})(({
|
537 |
+
value,
|
538 |
+
setState
|
539 |
+
}) => el(RadioControl, {
|
540 |
+
label: '',
|
541 |
+
help: 'Select type of switcher language button.',
|
542 |
+
selected: promisedPluginButtonType,
|
543 |
+
className: 'wpglobus-switcher-components-radio-control',
|
544 |
+
options: [
|
545 |
+
{ label: 'Flag only', value: 'flagOnly' },
|
546 |
+
{ label: 'Flag with language', value: 'flagLanguage' },
|
547 |
+
{ label: 'Flag with language code', value: 'flagCode' },
|
548 |
+
{ label: 'Language only', value: 'languageOnly' },
|
549 |
+
{ label: 'Language code', value: 'languageCode' },
|
550 |
+
],
|
551 |
+
onChange: value => {
|
552 |
+
promisedPluginButtonType = value;
|
553 |
+
setState({
|
554 |
+
value
|
555 |
+
});
|
556 |
+
// @see setOption function for setSwitcherButtonType(value) and setSwitcherPluginButton(value)
|
557 |
+
setOption(optionSwitcherButtonType, value);
|
558 |
+
}
|
559 |
+
}));
|
560 |
+
|
561 |
+
function OptionsTabContent() {
|
562 |
+
return el(
|
563 |
+
'div',
|
564 |
+
{
|
565 |
+
className: 'wpglobus-tab-content wpglobus-options-tab-content',
|
566 |
+
},
|
567 |
+
el(
|
568 |
+
Notice,
|
569 |
+
{
|
570 |
+
className: 'wpglobus-switcher-panel__notice',
|
571 |
+
status: 'informational',
|
572 |
+
isDismissible: false
|
573 |
+
},
|
574 |
+
__( 'Select type' )
|
575 |
+
),
|
576 |
+
el(
|
577 |
+
SwitcherPluginButton,
|
578 |
+
null
|
579 |
+
)
|
580 |
+
);
|
581 |
+
}
|
582 |
+
|
583 |
+
function Component() {
|
584 |
+
setSwitcherPluginButton();
|
585 |
+
return el(
|
586 |
+
Fragment,
|
587 |
+
{},
|
588 |
+
el(
|
589 |
+
PluginSidebarMoreMenuItem,
|
590 |
+
{
|
591 |
+
target: 'wpglobus-switcher-sidebar',
|
592 |
+
icon: 'admin-site',
|
593 |
+
//onClick: @see wp-includes\js\dist\edit-post.js
|
594 |
+
},
|
595 |
+
__( 'WPGlobus' )
|
596 |
+
),
|
597 |
+
el(
|
598 |
+
PluginSidebar,
|
599 |
+
{
|
600 |
+
name: 'wpglobus-switcher-sidebar',
|
601 |
+
title: getSwitcherButtonTitle(),
|
602 |
+
className: 'wpglobus-switcher-components-panel',
|
603 |
+
//togglePin: @see wp-includes\js\dist\edit-post.js
|
604 |
+
},
|
605 |
+
el(
|
606 |
+
'div',
|
607 |
+
{
|
608 |
+
className: 'wpglobus-switcher-message wpglobus-switcher-error-message hidden',
|
609 |
+
style:{}
|
610 |
+
},
|
611 |
+
''
|
612 |
+
),
|
613 |
+
el(
|
614 |
+
PanelBody,
|
615 |
+
{
|
616 |
+
className: 'wpglobus-switcher-panel__body'
|
617 |
+
},
|
618 |
+
TabLayout()
|
619 |
+
)
|
620 |
+
|
621 |
+
)
|
622 |
+
);
|
623 |
+
}
|
624 |
+
registerPlugin( 'wpglobus-switcher', {
|
625 |
+
icon: '',
|
626 |
+
render: Component,
|
627 |
+
} );
|
628 |
+
}
|
629 |
+
}
|
630 |
+
WPGlobusGutenberg = $.extend({}, WPGlobusGutenberg, api);
|
631 |
+
WPGlobusGutenberg.init();
|
632 |
+
});
|
trunk/includes/builders/gutenberg/assets/js/wpglobus-gutenberg.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
"use strict";jQuery(document).ready(function(E){var C={counter:0,noticeOn:!1,initDone:!1,languageSelectorBoxDelta:0,oldLanguageSelector:!1,languageSelectorEnabled:!0,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},getCounter:function(){return C.counter},getOptionKey:function(e){return e=e||"",WPGlobusGutenberg.keyOption[e]},getOptions:function(){return WPGlobusGutenberg.options},isOldLanguageSelector:function(){return C.oldLanguageSelector},isPostDisabled:function(){return WPGlobusGutenberg.__post.disabled},isEnabledTab:function(e){void 0===e&&(e="options");var t=!1;return"options"==e&&C.parseBool(WPGlobusGutenberg.enabledOptionsTab)&&(t=!0),t},init:function(){WPGlobusGutenberg.yoastSeo=C.parseBool(WPGlobusGutenberg.yoastSeo),WPGlobusGutenberg.elementor=C.parseBool(WPGlobusGutenberg.elementor),C.isPostDisabled()||(C.initListeners(),C.initNotifications(),C.setTabs(),C.formHandler(),C.attachListeners())},initListeners:function(){WPGlobusGutenberg.yoastSeo&&1==E(".yoast.wpseo-metabox").length&&E(window).on("beforeunload",function(e){e.stopImmediatePropagation()})},formHandler:function(){var e=E(".metabox-base-form #referredby").attr("value");void 0!==e&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),E(".metabox-base-form #referredby").attr("value",e)),void 0!==(e=E('input[name="_wp_original_http_referer"]').attr("value"))&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),E('input[name="_wp_original_http_referer"]').attr("value",e))},initNotifications:function(){void 0!==wp.editPost&&void 0!==wp.plugins&&WPGlobusGutenberg.elementor&&"internal"==WPGlobusGutenberg.data.elementorCssPrintMethod&&wp.data.dispatch("core/notices").createNotice("error",WPGlobusGutenberg.i18n.elementorWarning,{id:"elementorcssprintmethodnotice",isDismissible:!0,actions:[{url:WPGlobusGutenberg.i18n.elementorActionLink,label:WPGlobusGutenberg.i18n.elementorActionLabel}]})},setTabs:function(){var t;0!=WPGlobusGutenberg.tabs.length?(C.oldLanguageSelector=!0,t=setInterval(function(){var e=E(".edit-post-header__settings");1==e.length&&(e.before(WPGlobusGutenberg.tabs),clearInterval(t))},200)):C.WPGlobusSwitcherPlugin()},setSelectorStatus:function(){var e;C.isOldLanguageSelector()&&(E(".wpglobus-gutenberg-selector-box").css({opacity:"0.2"}).attr("onclick","return false;"),C.languageSelectorEnabled=!1,e=setInterval(function(){if(0==E(".is-saving").length){if(clearInterval(e),WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage&&-1!=location.pathname.indexOf(WPGlobusGutenberg.postEditPage))return WPGlobusGutenberg.pagenow=WPGlobusGutenberg.postEditPage,E(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick",""),void C.reloadPage();C.languageSelectorEnabled=!0,E(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick","")}},400))},reloadPage:function(){E(".wpglobus-selector-grid").css({"grid-template-columns":"10% 90%"}),E(".wpglobus-gutenberg-selector-text").text(WPGlobusGutenberg.i18n.reload),function e(){E(".wpglobus-gutenberg-selector").fadeOut(500).fadeIn(500,e)}(),setTimeout(function(){location.reload()},500)},attachListeners:function(){C.isOldLanguageSelector()&&(E(document).on("mouseenter",".wpglobus-gutenberg-selector",function(e){C.languageSelectorEnabled&&(E(".wpglobus-gutenberg-selector-dropdown").css({display:"block"}),C.languageSelectorBoxDelta=e.screenY,E(".edit-post-header").css({"z-index":"100000"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"100001"}))}),E(document).on("mouseleave",".wpglobus-gutenberg-selector",function(e){0!=C.languageSelectorBoxDelta&&e.screenY-C.languageSelectorBoxDelta<=0&&(E(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),E(".edit-post-header").css({"z-index":"9989"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"100"}))}),E(document).on("mouseleave",".wpglobus-gutenberg-selector-dropdown",function(e){E(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),E(".edit-post-header").css({"z-index":"9989"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"10000"})}),E(document).on("click",".editor-post-save-draft",function(){C.setSelectorStatus()}),E(document).on("click",".editor-post-publish-button",function(){C.setSelectorStatus()}))},WPGlobusSwitcherPlugin:function(){if(void 0!==wp.editPost&&void 0!==wp.plugins){var e,t=WPGlobusGutenberg.language,n=WPGlobusCoreData.enabled_languages,o=WPGlobusCoreData.en_language_name,s=WPGlobusGutenberg.flags_url,a="WPGlobus Switcher",l=location.href,u={};for(e in n)-1==l.indexOf("language="+t)?u[n[e]]=l+"&language="+n[e]:u[n[e]]=l.replace("language="+t,"language="+n[e]);var i=wp.i18n.__,r=wp.element.createElement,g=wp.element.Fragment,c=wp.components.TabPanel,b=wp.compose.withState,p=wp.components.RadioControl,d=wp.components.Notice,w=wp.components.Button,m=wp.editPost.PluginSidebarMoreMenuItem,G=wp.components.PanelBody,f=wp.editPost.PluginSidebar,h=wp.plugins.registerPlugin,P=E(".components-panel__header.edit-post-sidebar-header button.components-icon-button").eq(0),v={flagOnly:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />',flagLanguage:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> '+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],flagCode:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> '+WPGlobusGutenberg.language,languageOnly:" "+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],languageCode:" "+WPGlobusGutenberg.language},W="",_="",y=C.getOptionKey("switcherButtonType");S(WPGlobusGutenberg.options[y]),_=W,E(document).on("click",P,function(){T()});var x=b({value:_})(function(e){e.value;var t=e.setState;return r(p,{label:"",help:"Select type of switcher language button.",selected:_,className:"wpglobus-switcher-components-radio-control",options:[{label:"Flag only",value:"flagOnly"},{label:"Flag with language",value:"flagLanguage"},{label:"Flag with language code",value:"flagCode"},{label:"Language only",value:"languageOnly"},{label:"Language code",value:"languageCode"}],onChange:function(e){t({value:_=e}),O(y,e)}})});h("wpglobus-switcher",{icon:"",render:function(){return T(),r(g,{},r(m,{target:"wpglobus-switcher-sidebar",icon:"admin-site"},i("WPGlobus")),r(f,{name:"wpglobus-switcher-sidebar",title:a,className:"wpglobus-switcher-components-panel"},r("div",{className:"wpglobus-switcher-message wpglobus-switcher-error-message hidden",style:{}},""),r(G,{className:"wpglobus-switcher-panel__body"},(e=[{name:"switcher",title:"Languages",className:"wpglobus-panel-tab wpglobus-panel-tab-selector edit-post-sidebar__panel-tab"}],WPGlobusGutenberg.isEnabledTab("options")&&e.push({name:"options",title:"Options",className:"wpglobus-panel-tab wpglobus-panel-tab-options edit-post-sidebar__panel-tab"}),r(c,{name:"WPGlobusSwitcherTabPanel",className:"wpglobus-tab-panel",activeClass:"is-active",tabs:e},B)))));var e}})}function S(e){W=e=e||"flagLanguage"}function L(e){void 0===e&&(e=!0);var t,n=document.querySelectorAll(".wpglobus-switcher-components-radio-control .components-radio-control__input");0!=n.length&&(e?(n.forEach(function(e){e.classList.add(e.value),e.classList.remove("wpglobus-switcher-pulsate-radio"),e.classList.add("wpglobus-switcher-pulsate-radio-off")}),(t=document.querySelector(".wpglobus-switcher-components-radio-control ."+_)).classList.remove("wpglobus-switcher-pulsate-radio-off"),t.classList.add("wpglobus-switcher-pulsate-radio")):n.forEach(function(e){e.classList.remove("wpglobus-switcher-pulsate-radio"),e.classList.remove("wpglobus-switcher-pulsate-radio-off"),e.classList.add("wpglobus-switcher-pulsate-radio-on")}))}function N(e,t){void 0===e||C.noticeOn||(C.noticeOn=!0,e.innerText=t,e.classList.remove("hidden"),setTimeout(function(){e.classList.add("hidden"),C.noticeOn=!1},3e3))}function O(e,t){t=t||"",y==(e=e||"")&&(L(!0),function(e,t){if(""==(e=e||""))return;var n={sender:"WPGlobusGutenberg",_action:"saveOption",is_admin:1};return n.counter=C.counter++,n.options={},n.options[e]=t,wp.ajax.post(WPGlobusGutenberg.wpglobusAjax,{data:n})}(e,t).then(function(e){"success"==e.result&&(S(t),T(WPGlobusGutenberg.options[y]=t))}).fail(function(e){var t=document.getElementsByClassName("wpglobus-switcher-error-message");void 0!==t[0]&&("error"==e.result?N(t[0],e.message):400==e.status&&N(t[0],"Error: "+e.status+" ("+e.statusText+")"),_=W);var n=document.getElementsByClassName("wpglobus-panel-tab-options");void 0!==n[0]&&-1!=n[0].classList.value.indexOf("is-active")&&n[0].click()}).always(function(){L(!1)}))}function k(e){return void 0===v[e]&&(e=W),v[e]}function T(n){void 0!==n&&void 0!==v[n]||(n=W),setTimeout(function(){var e,t=document.querySelector('[aria-label="'+a+'"]');null!=t&&(void 0===t.dataset.status?(e=t.innerHTML,t.innerHTML=e+k(n),t.dataset.status="init"):(t.innerHTML=k(n),t.dataset.status="changed"))},300)}function B(e){return"switcher"==e.name?r("div",{className:"wpglobus-tab-content wpglobus-selector-tab-content"},r(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},i("Select language")),r("div",{className:"wpglobus-switcher-panel__switcher-box"},WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage?r("div",{style:{marginBottom:"20px"},className:"wpglobus-switcher-panel__switcher-notice"},WPGlobusGutenberg.i18n.save_post):r("ul",{className:"language-list"},n.map(function(e){return r("li",{key:e,className:"language-item"},r("img",{style:{marginRight:"7px",width:"20px"},className:"wpglobus-switcher-panel__flag",height:"20",width:"20",src:s[e]}),r(w,{href:u[e],isSmall:!0,isPrimary:!0},o[e]))}))),r(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__info",href:WPGlobusGutenberg.store_link,isLink:!0,target:"_blank"},i("WPGlobus Premium")),r(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__settings-link",href:WPGlobusGutenberg.options_page_url,isLink:!0},i("WPGlobus Options"))):"options"==e.name?r("div",{className:"wpglobus-tab-content wpglobus-options-tab-content"},r(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},i("Select type")),r(x,null)):void 0}}};WPGlobusGutenberg=E.extend({},WPGlobusGutenberg,C),WPGlobusGutenberg.init()});
|
trunk/includes/builders/gutenberg/class-wpglobus-gutenberg-update-post.php
ADDED
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-gutenberg-update-post.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\Gutenberg
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! class_exists( 'WPGlobus_Gutenberg_Update_Post' ) ) :
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class WPGlobus_Gutenberg_Update_Post.
|
13 |
+
*/
|
14 |
+
class WPGlobus_Gutenberg_Update_Post extends WPGlobus_Builder_Update_Post {
|
15 |
+
|
16 |
+
/** @var string */
|
17 |
+
protected $language = null;
|
18 |
+
|
19 |
+
/** @var WP_Post */
|
20 |
+
protected $_prepared_post = null;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor.
|
24 |
+
*/
|
25 |
+
public function __construct() {
|
26 |
+
|
27 |
+
parent::__construct( 'gutenberg' );
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @todo to save meta see request ($_REQUEST)
|
31 |
+
* post.php?post=259&action=edit&classic-editor=1&meta_box=1
|
32 |
+
*/
|
33 |
+
|
34 |
+
//if ( defined('DOING_AJAX') && DOING_AJAX ) {
|
35 |
+
//}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Filter's order:
|
39 |
+
* 1. rest_pre_insert_post
|
40 |
+
* 2. wp_insert_post_data
|
41 |
+
* 3. rest_request_after_callbacks
|
42 |
+
*/
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @see \WP_REST_Posts_Controller::prepare_item_for_database
|
46 |
+
*/
|
47 |
+
if ( 'core' === WPGlobus::Config()->builder->get( 'context' ) ) {
|
48 |
+
|
49 |
+
$post_type = WPGlobus::Config()->builder->get( 'post_type' );
|
50 |
+
if ( ! empty( $post_type ) ) {
|
51 |
+
add_filter( "rest_pre_insert_{$post_type}", array( $this, 'filter__pre_insert_post' ), 2, 2 );
|
52 |
+
}
|
53 |
+
} else {
|
54 |
+
|
55 |
+
add_filter( 'rest_pre_insert_post', array( $this, 'filter__pre_insert_post' ), 2, 2 );
|
56 |
+
add_filter( 'rest_pre_insert_page', array( $this, 'filter__pre_insert_post' ), 2, 2 );
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @todo incorrect the saving post in extra languages with priority = 10
|
62 |
+
*/
|
63 |
+
add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @see \WP_REST_Server::dispatch in \wp-includes\rest-api\class-wp-rest-server.php
|
67 |
+
*/
|
68 |
+
add_filter( 'rest_request_after_callbacks', array( $this, 'filter__rest_after_callbacks' ), 10, 3 );
|
69 |
+
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Callback for 'rest_request_after_callbacks' will be fired after 'wp_insert_post_data' filter.
|
74 |
+
*
|
75 |
+
* @see 'filter__wp_insert_post_data'
|
76 |
+
*
|
77 |
+
* @param stdClass $response
|
78 |
+
* @param array $handler
|
79 |
+
* @param mixed $request Unused.
|
80 |
+
*
|
81 |
+
* @return mixed
|
82 |
+
*/
|
83 |
+
public function filter__rest_after_callbacks(
|
84 |
+
$response, $handler, /** @noinspection PhpUnusedParameterInspection */
|
85 |
+
$request
|
86 |
+
) {
|
87 |
+
|
88 |
+
if ( ! empty( $handler['methods']['POST'] ) && ! empty( $handler['methods']['PUT'] ) && ! empty( $handler['methods']['PATCH'] ) ) {
|
89 |
+
/**
|
90 |
+
* Update post.
|
91 |
+
*/
|
92 |
+
|
93 |
+
/**
|
94 |
+
* This returns incorrect language
|
95 |
+
* $builder_language = get_post_meta($post_id, WPGlobus::Config()->builder->get_language_meta_key(), true);
|
96 |
+
*
|
97 |
+
* @todo check updating language meta after UPDATE post
|
98 |
+
*/
|
99 |
+
$builder_language = $this->language;
|
100 |
+
|
101 |
+
// if ( empty( $builder_language ) ) {
|
102 |
+
// @todo incorrect case
|
103 |
+
// }
|
104 |
+
|
105 |
+
$fix_title = true;
|
106 |
+
if ( ! empty( $response->data['title']['raw'] ) && WPGlobus_Core::has_translations( $response->data['title']['raw'] ) ) {
|
107 |
+
$response->data['title']['raw'] = WPGlobus_Core::text_filter( $response->data['title']['raw'], $builder_language, WPGlobus::RETURN_EMPTY );
|
108 |
+
$response->data['title']['rendered'] = $response->data['title']['raw'];
|
109 |
+
$fix_title = false;
|
110 |
+
}
|
111 |
+
|
112 |
+
// $fix_excerpt = true;
|
113 |
+
if ( ! empty( $response->data['excerpt']['raw'] ) && WPGlobus_Core::has_translations( $response->data['excerpt']['raw'] ) ) {
|
114 |
+
$excerpt_in_default = WPGlobus_Core::text_filter( $response->data['excerpt']['raw'], WPGlobus::Config()->default_language );
|
115 |
+
//$excerpt = WPGlobus_Core::text_filter($response->data['excerpt']['raw'], $builder_language);
|
116 |
+
$excerpt = WPGlobus_Core::text_filter( $response->data['excerpt']['raw'], $builder_language, WPGlobus::RETURN_EMPTY );
|
117 |
+
$response->data['excerpt']['raw'] = $excerpt;
|
118 |
+
$response->data['excerpt']['rendered'] = str_replace( $excerpt_in_default, $excerpt, $response->data['excerpt']['rendered'] );
|
119 |
+
// $fix_excerpt = false;
|
120 |
+
}
|
121 |
+
|
122 |
+
if ( WPGlobus::Config()->default_language === $builder_language ) {
|
123 |
+
return $response;
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( $fix_title ) :
|
127 |
+
/**
|
128 |
+
* Fix the title.
|
129 |
+
* When we have title with different value:
|
130 |
+
* $response->data[title][raw] => Русский заголовок
|
131 |
+
* $response->data[title][rendered] => English title
|
132 |
+
*/
|
133 |
+
if ( empty( $response->data['title'] ) ) {
|
134 |
+
return $response;
|
135 |
+
}
|
136 |
+
if ( empty( $response->data['title']['rendered'] ) || empty( $response->data['title']['raw'] ) ) {
|
137 |
+
return $response;
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( $response->data['title']['rendered'] !== $response->data['title']['raw'] ) {
|
141 |
+
$response->data['title']['rendered'] = $response->data['title']['raw'];
|
142 |
+
}
|
143 |
+
|
144 |
+
endif;
|
145 |
+
|
146 |
+
}
|
147 |
+
|
148 |
+
return $response;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Callback for 'rest_pre_insert_post'.
|
153 |
+
*
|
154 |
+
* @param WP_Post $prepared_post
|
155 |
+
* @param mixed $request Unused.
|
156 |
+
*
|
157 |
+
* @return mixed
|
158 |
+
*/
|
159 |
+
public function filter__pre_insert_post(
|
160 |
+
$prepared_post, /** @noinspection PhpUnusedParameterInspection */
|
161 |
+
$request
|
162 |
+
) {
|
163 |
+
|
164 |
+
global $wpdb;
|
165 |
+
$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $prepared_post->ID ) );
|
166 |
+
|
167 |
+
$builder_language = WPGlobus::Config()->builder->get_language();
|
168 |
+
|
169 |
+
if ( empty( $builder_language ) ) {
|
170 |
+
/**
|
171 |
+
* @todo Probably we are working with WP Rest API here.
|
172 |
+
* Check superglobal variable $_SERVER or may be something other.
|
173 |
+
*/
|
174 |
+
$builder_language = get_post_meta( $prepared_post->ID, WPGlobus::get_language_meta_key(), true );
|
175 |
+
|
176 |
+
if ( empty( $builder_language ) ) {
|
177 |
+
/**
|
178 |
+
* Case when post is draft and has post_status 'auto-draft'.
|
179 |
+
*/
|
180 |
+
$builder_language = WPGlobus::Config()->default_language;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
$this->language = $builder_language;
|
185 |
+
|
186 |
+
$fields = array();
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Post title.
|
190 |
+
*/
|
191 |
+
if ( ! empty( $prepared_post->post_title ) ) {
|
192 |
+
$fields['post_title'] = $prepared_post->post_title;
|
193 |
+
// } else {
|
194 |
+
//$fields['post_title'] = '';
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Post content.
|
199 |
+
*/
|
200 |
+
if ( ! empty( $prepared_post->post_content ) ) {
|
201 |
+
$fields['post_content'] = $prepared_post->post_content;
|
202 |
+
} else {
|
203 |
+
$fields['post_content'] = '';
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Post excerpt.
|
208 |
+
*/
|
209 |
+
if ( isset( $prepared_post->post_excerpt ) ) {
|
210 |
+
if ( empty( $prepared_post->post_excerpt ) ) {
|
211 |
+
/**
|
212 |
+
* Post excerpt was removed by user.
|
213 |
+
*/
|
214 |
+
$fields['post_excerpt'] = '';
|
215 |
+
} else {
|
216 |
+
$fields['post_excerpt'] = $prepared_post->post_excerpt;
|
217 |
+
}
|
218 |
+
} else {
|
219 |
+
/**
|
220 |
+
* Post excerpt was not modified by user.
|
221 |
+
* so, we have unset '$prepared_post->post_excerpt' field.
|
222 |
+
*/
|
223 |
+
$fields['post_excerpt'] = WPGlobus_Core::text_filter( $_post->post_excerpt, $builder_language, WPGlobus::RETURN_EMPTY );
|
224 |
+
}
|
225 |
+
|
226 |
+
foreach ( $fields as $field => $value ) {
|
227 |
+
|
228 |
+
$tr = array();
|
229 |
+
|
230 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
231 |
+
|
232 |
+
if ( $lang === $builder_language ) {
|
233 |
+
|
234 |
+
$text = $value;
|
235 |
+
if ( WPGlobus_Core::has_translations( $value ) ) {
|
236 |
+
$text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
|
237 |
+
}
|
238 |
+
if ( ! empty( $text ) ) {
|
239 |
+
$tr[ $lang ] = $text;
|
240 |
+
}
|
241 |
+
} else {
|
242 |
+
|
243 |
+
$text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
|
244 |
+
if ( ! empty( $text ) ) {
|
245 |
+
$tr[ $lang ] = $text;
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
endforeach;
|
250 |
+
|
251 |
+
/**
|
252 |
+
* @since 2.2.29 we are using `wp_slash` function.
|
253 |
+
* @see https://github.com/WPGlobus/WPGlobus/pull/83
|
254 |
+
*/
|
255 |
+
$prepared_post->$field = wp_slash( WPGlobus_Utils::build_multilingual_string( $tr ) );
|
256 |
+
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* $this->_prepared_post contains 'post_title', 'post_content', 'post_excerpt' with language marks and ready to insert in DB.
|
261 |
+
*/
|
262 |
+
$this->_prepared_post = clone $prepared_post;
|
263 |
+
|
264 |
+
return $prepared_post;
|
265 |
+
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Callback for 'wp_insert_post_data'.
|
270 |
+
*
|
271 |
+
* @param array $data
|
272 |
+
* @param mixed $postarr Unused.
|
273 |
+
*
|
274 |
+
* @return array
|
275 |
+
*/
|
276 |
+
public function filter__wp_insert_post_data(
|
277 |
+
$data, /** @noinspection PhpUnusedParameterInspection */
|
278 |
+
$postarr
|
279 |
+
) {
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Check $this->_prepared_post was loaded with first XMLHttpRequest.
|
283 |
+
*
|
284 |
+
* @see 'filter__pre_insert_post' filter.
|
285 |
+
* @see Network tab in browser console.
|
286 |
+
*/
|
287 |
+
if ( ! is_object( $this->_prepared_post ) ) {
|
288 |
+
return $data;
|
289 |
+
}
|
290 |
+
|
291 |
+
$_fields = array( 'post_title', 'post_content', 'post_excerpt' );
|
292 |
+
foreach ( $_fields as $_field ) {
|
293 |
+
|
294 |
+
if ( ! empty( $data[ $_field ] ) && ! empty( $this->_prepared_post->$_field ) ) {
|
295 |
+
$data[ $_field ] = $this->_prepared_post->$_field;
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
return $data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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-gutenberg.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\Gutenberg
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Gutenberg.
|
11 |
+
*/
|
12 |
+
class WPGlobus_Gutenberg extends WPGlobus_Builder {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Constructor.
|
16 |
+
*/
|
17 |
+
public function __construct() {
|
18 |
+
|
19 |
+
parent::__construct( 'gutenberg' );
|
20 |
+
|
21 |
+
if ( is_admin() ) {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Filter the post for Gutenberg editor.
|
25 |
+
*
|
26 |
+
* @see wp-includes\class-wp-query.php
|
27 |
+
*/
|
28 |
+
add_action( 'the_post', array( $this, 'translate_post' ), 5 );
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Add 'wpglobus-language' hidden field.
|
32 |
+
*/
|
33 |
+
add_action( 'add_meta_boxes', array( $this, 'on__add_meta_box' ) );
|
34 |
+
|
35 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'on__enqueue_scripts' ), 1000 );
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Action admin_print_styles.
|
39 |
+
*
|
40 |
+
* @since 1.9.29
|
41 |
+
*/
|
42 |
+
add_action( 'admin_print_styles', array( $this, 'on__enqueue_styles' ) );
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Action enqueue_block_assets.
|
46 |
+
*
|
47 |
+
* @see wp-includes\script-loader.php
|
48 |
+
* @since 2.2.3
|
49 |
+
*/
|
50 |
+
add_action( 'enqueue_block_assets', array( $this, 'on__enqueue_block_assets' ) );
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Filter wpglobus_seo_meta_box_title.
|
54 |
+
*
|
55 |
+
* @see wpglobus-seo\includes\class-wpglobus-seo.php
|
56 |
+
*/
|
57 |
+
add_filter( 'wpglobus_seo_meta_box_title', array( $this, 'filter__seo_meta_box_title' ) );
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Enqueue block assets.
|
65 |
+
*
|
66 |
+
* @since 2.2.3
|
67 |
+
*/
|
68 |
+
public function on__enqueue_block_assets() {
|
69 |
+
|
70 |
+
if ( ! empty( WPGlobus::Config()->block_editor_old_fashioned_language_switcher ) && '1' === WPGlobus::Config()->block_editor_old_fashioned_language_switcher ) {
|
71 |
+
return;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @since 2.2.3 wpglobus-block-editor.css
|
76 |
+
* @since 2.2.14 wpglobus-switcher.css
|
77 |
+
*/
|
78 |
+
$style_file = WPGlobus::plugin_dir_url() . 'includes/builders/gutenberg/assets/css/dist/wpglobus-switcher.css';
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Enqueue frontend and editor block styles.
|
82 |
+
*/
|
83 |
+
wp_enqueue_style(
|
84 |
+
'wpglobus-switcher-css',
|
85 |
+
$style_file,
|
86 |
+
'',
|
87 |
+
WPGLOBUS_VERSION
|
88 |
+
);
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Using ESNext syntax @W.I.P.
|
92 |
+
*
|
93 |
+
* @since 2.2.3 We are using ES5 syntax for WPGlobus plugin for Block Editor.
|
94 |
+
*/
|
95 |
+
return;
|
96 |
+
|
97 |
+
// phpcs:disable
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Temporarily.
|
101 |
+
*
|
102 |
+
* @noinspection PhpUnreachableStatementInspection
|
103 |
+
*/
|
104 |
+
$script_file = WPGlobus::plugin_dir_url() . 'includes/builders/gutenberg/assets/js/dist/wpglobus-block-editor' . WPGlobus::SCRIPT_SUFFIX() . '.js';
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Enqueue the bundled block JS file.
|
108 |
+
*/
|
109 |
+
wp_enqueue_script(
|
110 |
+
'wpglobus-block-editor-js',
|
111 |
+
$script_file,
|
112 |
+
array(
|
113 |
+
'wp-i18n',
|
114 |
+
'wp-blocks',
|
115 |
+
'wp-edit-post',
|
116 |
+
'wp-element',
|
117 |
+
'wp-editor',
|
118 |
+
'wp-components',
|
119 |
+
'wp-data',
|
120 |
+
'wp-plugins',
|
121 |
+
'wp-edit-post',
|
122 |
+
'wp-api',
|
123 |
+
),
|
124 |
+
WPGLOBUS_VERSION,
|
125 |
+
false
|
126 |
+
);
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Enqueue frontend and editor block styles.
|
130 |
+
*/
|
131 |
+
wp_enqueue_style(
|
132 |
+
'wpglobus-block-editor-css',
|
133 |
+
$style_file,
|
134 |
+
'',
|
135 |
+
WPGLOBUS_VERSION
|
136 |
+
);
|
137 |
+
|
138 |
+
// phpcs:enable
|
139 |
+
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Translate post.
|
144 |
+
*
|
145 |
+
* @param WP_Post $object The Post object.
|
146 |
+
*/
|
147 |
+
public function translate_post( $object ) {
|
148 |
+
if ( $object instanceof WP_Post ) {
|
149 |
+
WPGlobus_Core::translate_wp_post( $object, $this->language, WPGlobus::RETURN_EMPTY );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Generate box with language switcher.
|
155 |
+
*
|
156 |
+
* @param string $page The page.
|
157 |
+
*
|
158 |
+
* @return string
|
159 |
+
*/
|
160 |
+
private function get_switcher_box( $page ) {
|
161 |
+
|
162 |
+
global $post;
|
163 |
+
|
164 |
+
// TODO check if $_SERVER['QUERY_STRING'] exists and sanitize it.
|
165 |
+
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized: Detected usage of a non-sanitized input variable: $_SERVER['QUERY_STRING'].
|
166 |
+
// phpcs: WordPress.Security.ValidatedSanitizedInput.InputNotValidated: Detected usage of a possibly undefined superglobal array index: $_SERVER['QUERY_STRING']. Use isset() or empty() to check the index exists before using it.
|
167 |
+
// phpcs: WordPress.Security.ValidatedSanitizedInput.MissingUnslash: $_SERVER data not unslashed before sanitization. Use wp_unslash() or similar.
|
168 |
+
$query_string = explode( '&', $_SERVER['QUERY_STRING'] ); // phpcs:ignore
|
169 |
+
|
170 |
+
foreach ( $query_string as $key => $_q ) {
|
171 |
+
if ( false !== strpos( $_q, 'language=' ) ) {
|
172 |
+
unset( $query_string[ $key ] );
|
173 |
+
}
|
174 |
+
}
|
175 |
+
$query = implode( '&', $query_string );
|
176 |
+
$url = admin_url(
|
177 |
+
add_query_arg(
|
178 |
+
array(
|
179 |
+
'language' => '{{language}}',
|
180 |
+
),
|
181 |
+
'post.php?' . $query
|
182 |
+
)
|
183 |
+
);
|
184 |
+
|
185 |
+
$_box_style = 'position:absolute;top:15px;left:10px;z-index:100;';
|
186 |
+
if ( file_exists( WPGlobus::Config()->flag_path['big'] . WPGlobus::Config()->flag[ $this->language ] ) ) {
|
187 |
+
$_flag_img = WPGlobus::Config()->flag_urls['big'] . WPGlobus::Config()->flag[ $this->language ];
|
188 |
+
$_height = 'height="25px"';
|
189 |
+
$_width = 'width="25px"';
|
190 |
+
$_flag_style = 'style="border: 1px solid #bfbfbf;border-radius: 25px;"';
|
191 |
+
} else {
|
192 |
+
$_flag_img = WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $this->language ];
|
193 |
+
$_height = '';
|
194 |
+
$_width = '';
|
195 |
+
$_flag_style = 'style="margin-top:5px;"';
|
196 |
+
|
197 |
+
$_box_style .= 'margin-top:3px;';
|
198 |
+
}
|
199 |
+
|
200 |
+
$out = '';
|
201 |
+
|
202 |
+
if ( 'post-new.php' === $page ) {
|
203 |
+
|
204 |
+
ob_start();
|
205 |
+
?>
|
206 |
+
<div style="<?php echo $_box_style; // phpcs:ignore WordPress.Security.EscapeOutput ?>"
|
207 |
+
class="wpglobus-gutenberg-selector-box">
|
208 |
+
<!--suppress CssInvalidPropertyValue -->
|
209 |
+
<div class="wpglobus-selector-grid"
|
210 |
+
style="">
|
211 |
+
<a style="text-decoration:none;cursor:text;" onclick="return false;"
|
212 |
+
href="#" class="wpglobus-gutenberg-selector wpglobus-gutenberg-selector-column-1"
|
213 |
+
data-language="<?php echo esc_attr( $this->language ); ?>">
|
214 |
+
<img <?php echo $_height . $_width; // phpcs:ignore WordPress.Security.EscapeOutput ?>
|
215 |
+
<?php echo $_flag_style; // phpcs:ignore WordPress.Security.EscapeOutput ?>
|
216 |
+
src="<?php echo esc_url( $_flag_img ); ?>" alt=""/>
|
217 |
+
</a>
|
218 |
+
<a style="text-decoration:none;cursor:text;" onclick="return false;"
|
219 |
+
href="#" class="wpglobus-gutenberg-selector wpglobus-gutenberg-selector-column-2"
|
220 |
+
data-language="<?php echo esc_attr( $this->language ); ?>">
|
221 |
+
<span
|
222 |
+
class="wpglobus-gutenberg-selector-text"><?php echo esc_html( WPGlobus::Config()->en_language_name[ $this->language ] ); ?></span>
|
223 |
+
</a>
|
224 |
+
</div>
|
225 |
+
<ul class="wpglobus-gutenberg-selector-dropdown"
|
226 |
+
style="display:none;position:fixed;margin:5px;list-style-type:none;">
|
227 |
+
<li class="item" style="border:1px solid #ddd;background-color:#eee;padding:4px;">
|
228 |
+
<?php esc_html_e( 'Before switching the language, please save draft or publish.', 'wpglobus' ); ?>
|
229 |
+
</li>
|
230 |
+
</ul>
|
231 |
+
</div>
|
232 |
+
<?php
|
233 |
+
$out = ob_get_clean();
|
234 |
+
|
235 |
+
} elseif ( 'post.php' === $page ) {
|
236 |
+
|
237 |
+
ob_start();
|
238 |
+
?>
|
239 |
+
<div style="<?php echo $_box_style; // phpcs:ignore WordPress.Security.EscapeOutput ?>"
|
240 |
+
class="wpglobus-gutenberg-selector-box">
|
241 |
+
<!--suppress CssInvalidPropertyValue -->
|
242 |
+
<div class="wpglobus-selector-grid"
|
243 |
+
style="">
|
244 |
+
<a style="text-decoration: none;"
|
245 |
+
href="<?php echo esc_url( str_replace( '{{language}}', $this->language, $url ) ); ?>"
|
246 |
+
class="wpglobus-gutenberg-selector wpglobus-gutenberg-selector-column-1"
|
247 |
+
data-language="<?php echo esc_attr( $this->language ); ?>">
|
248 |
+
<img <?php echo $_height . $_width; // phpcs:ignore WordPress.Security.EscapeOutput ?>
|
249 |
+
<?php echo $_flag_style; // phpcs:ignore WordPress.Security.EscapeOutput ?>
|
250 |
+
src="<?php echo $_flag_img; // phpcs:ignore WordPress.Security.EscapeOutput ?>" alt=""/>
|
251 |
+
</a>
|
252 |
+
<a style="text-decoration: none;"
|
253 |
+
href="<?php echo esc_url( str_replace( '{{language}}', $this->language, $url ) ); ?>"
|
254 |
+
class="wpglobus-gutenberg-selector wpglobus-gutenberg-selector-column-2"
|
255 |
+
data-language="<?php echo esc_attr( $this->language ); ?>">
|
256 |
+
<span class="wpglobus-gutenberg-selector-text">
|
257 |
+
<?php
|
258 |
+
/**
|
259 |
+
* Filter the current language name.
|
260 |
+
*
|
261 |
+
* @since 2.1.0
|
262 |
+
*
|
263 |
+
* @param string $en_language_name English language name.
|
264 |
+
* @param string $language Current language.
|
265 |
+
* @param WP_Post $post The current post.
|
266 |
+
*
|
267 |
+
* @return string
|
268 |
+
*/
|
269 |
+
$en_language_name = apply_filters(
|
270 |
+
'wpglobus_gutenberg_selector_text',
|
271 |
+
WPGlobus::Config()->en_language_name[ $this->language ],
|
272 |
+
$this->language,
|
273 |
+
$post
|
274 |
+
);
|
275 |
+
echo esc_html( $en_language_name );
|
276 |
+
?>
|
277 |
+
</span>
|
278 |
+
</a>
|
279 |
+
</div>
|
280 |
+
<ul class="wpglobus-gutenberg-selector-dropdown"
|
281 |
+
style="display:none;position:fixed;border-left:1px solid #ddd;border-right:1px solid #ddd;background-color:#eee;margin:5px 0 0;padding:0 5px 5px 0;list-style-type:none;">
|
282 |
+
<?php foreach ( WPGlobus::Config()->enabled_languages as $lang ) : ?>
|
283 |
+
<?php
|
284 |
+
if ( $lang === $this->language ) {
|
285 |
+
continue;
|
286 |
+
}
|
287 |
+
?>
|
288 |
+
<li class="item"
|
289 |
+
style="text-align:left;cursor:pointer;border-bottom:1px solid #ddd;margin:0;height:25px;padding:5px 0 5px 5px;"
|
290 |
+
data-language="<?php echo esc_attr( $lang ); ?>">
|
291 |
+
<a href="<?php echo esc_url( str_replace( '{{language}}', $lang, $url ) ); ?>">
|
292 |
+
<img src="<?php echo esc_url( WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $lang ] ); ?>"
|
293 |
+
alt=""/> <?php echo esc_html( WPGlobus::Config()->en_language_name[ $lang ] ); ?>
|
294 |
+
</a>
|
295 |
+
</li>
|
296 |
+
<?php endforeach; ?>
|
297 |
+
</ul>
|
298 |
+
</div>
|
299 |
+
<?php
|
300 |
+
$out = ob_get_clean();
|
301 |
+
|
302 |
+
}
|
303 |
+
|
304 |
+
return $out;
|
305 |
+
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Callback for 'wpglobus_seo_meta_box_title'.
|
310 |
+
*
|
311 |
+
* @param string $meta_box_title Metabox title.
|
312 |
+
*
|
313 |
+
* @return string
|
314 |
+
*/
|
315 |
+
public function filter__seo_meta_box_title( $meta_box_title ) {
|
316 |
+
return $meta_box_title . ' ' .
|
317 |
+
// Translators: Metabox title FOR language.
|
318 |
+
_x( 'for', 'filter__seo_meta_box_title', 'wpglobus' )
|
319 |
+
. ' ' . WPGlobus::Config()->en_language_name[ $this->get_current_language() ];
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Enqueue styles.
|
324 |
+
*
|
325 |
+
* @since 1.9.29
|
326 |
+
* @return void
|
327 |
+
*/
|
328 |
+
public function on__enqueue_styles() {
|
329 |
+
/**
|
330 |
+
* Pagenow global.
|
331 |
+
*
|
332 |
+
* @var string $pagenow
|
333 |
+
*/
|
334 |
+
global $pagenow;
|
335 |
+
|
336 |
+
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) {
|
337 |
+
return;
|
338 |
+
}
|
339 |
+
|
340 |
+
// phpcs:ignore WordPress.Security.NonceVerification
|
341 |
+
if ( isset( $_GET['classic-editor'] ) ) {
|
342 |
+
return;
|
343 |
+
}
|
344 |
+
|
345 |
+
wp_register_style(
|
346 |
+
'wpglobus-gutenberg',
|
347 |
+
WPGlobus::plugin_dir_url() . 'includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css',
|
348 |
+
array(),
|
349 |
+
WPGLOBUS_VERSION,
|
350 |
+
'all'
|
351 |
+
);
|
352 |
+
wp_enqueue_style( 'wpglobus-gutenberg' );
|
353 |
+
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Enqueue scripts.
|
358 |
+
*
|
359 |
+
* @return void
|
360 |
+
*/
|
361 |
+
public function on__enqueue_scripts() {
|
362 |
+
|
363 |
+
/**
|
364 |
+
* Globals.
|
365 |
+
*
|
366 |
+
* @var string $pagenow
|
367 |
+
* @var string $wp_version
|
368 |
+
* @var \WP_Post $post
|
369 |
+
*/
|
370 |
+
global $pagenow, $wp_version, $post;
|
371 |
+
|
372 |
+
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) {
|
373 |
+
return;
|
374 |
+
}
|
375 |
+
|
376 |
+
// phpcs:ignore WordPress.Security.NonceVerification
|
377 |
+
if ( isset( $_GET['classic-editor'] ) ) {
|
378 |
+
return;
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Old-style switcher.
|
383 |
+
*
|
384 |
+
* @since 2.2.3
|
385 |
+
*/
|
386 |
+
$tabs = '';
|
387 |
+
if ( ! empty( WPGlobus::Config()->block_editor_old_fashioned_language_switcher ) && 1 === (int) WPGlobus::Config()->block_editor_old_fashioned_language_switcher ) {
|
388 |
+
$tabs = $this->get_switcher_box( $pagenow );
|
389 |
+
}
|
390 |
+
|
391 |
+
$i18n = array();
|
392 |
+
$i18n['reload'] = esc_html__( 'Page is being reloaded. Please wait...', 'wpglobus' );
|
393 |
+
$i18n['save_post'] = esc_html__( 'Before switching the language, please save draft or publish, then reload page.', 'wpglobus' );
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Extra data.
|
397 |
+
*
|
398 |
+
* @since 2.4.11
|
399 |
+
*/
|
400 |
+
$__data = array();
|
401 |
+
|
402 |
+
/**
|
403 |
+
* We have Gutenberg in core since WP 5.0.
|
404 |
+
*
|
405 |
+
* @since 2.0
|
406 |
+
*/
|
407 |
+
$version_gutenberg = '';
|
408 |
+
if ( version_compare( $wp_version, '4.9.99', '>' ) ) {
|
409 |
+
$version_gutenberg = $wp_version;
|
410 |
+
} elseif ( defined( 'GUTENBERG_VERSION' ) ) {
|
411 |
+
$version_gutenberg = GUTENBERG_VERSION;
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Check for Yoast SEO.
|
416 |
+
*/
|
417 |
+
$yoast_seo = false;
|
418 |
+
if ( defined( 'WPSEO_VERSION' ) ) {
|
419 |
+
$yoast_seo = true;
|
420 |
+
}
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Check for Elementor.
|
424 |
+
*
|
425 |
+
* @since 2.4.11
|
426 |
+
*/
|
427 |
+
$elementor = false;
|
428 |
+
if ( defined( 'ELEMENTOR_VERSION' ) ) {
|
429 |
+
$elementor = true;
|
430 |
+
$__data['elementorVersion'] = ELEMENTOR_VERSION;
|
431 |
+
$__data['elementorCssPrintMethod'] = get_option('elementor_css_print_method', 'external');
|
432 |
+
$_url = add_query_arg(
|
433 |
+
array(
|
434 |
+
'page' => 'elementor#tab-advanced',
|
435 |
+
),
|
436 |
+
admin_url( 'admin.php' )
|
437 |
+
);
|
438 |
+
$i18n['elementorWarning'] = esc_html__( 'WPGlobus provides multilingual support for Elementor only when the option `CSS Print Method` is set to `External File`.', 'wpglobus' );
|
439 |
+
$i18n['elementorActionLabel'] = esc_html__( 'Open Elementor Settings page', 'wpglobus' );
|
440 |
+
$i18n['elementorActionLink'] = $_url;
|
441 |
+
}
|
442 |
+
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Block editor tab URL.
|
446 |
+
*
|
447 |
+
* @since 2.2.3
|
448 |
+
*/
|
449 |
+
$block_editor_tab_url = admin_url(
|
450 |
+
add_query_arg(
|
451 |
+
array(
|
452 |
+
'page' => WPGlobus::OPTIONS_PAGE_SLUG,
|
453 |
+
'tab' => 'block-editor',
|
454 |
+
),
|
455 |
+
'admin.php'
|
456 |
+
)
|
457 |
+
);
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Optons page URL.
|
461 |
+
*
|
462 |
+
* @since 2.5.10
|
463 |
+
*/
|
464 |
+
$options_page_url = admin_url(
|
465 |
+
add_query_arg(
|
466 |
+
array(
|
467 |
+
'page' => WPGlobus::OPTIONS_PAGE_SLUG
|
468 |
+
),
|
469 |
+
'admin.php'
|
470 |
+
)
|
471 |
+
);
|
472 |
+
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Build the flags URL.
|
476 |
+
*
|
477 |
+
* @since 2.2.3
|
478 |
+
*/
|
479 |
+
$flags_url = array();
|
480 |
+
foreach ( WPGlobus::Config()->enabled_languages as $language ) {
|
481 |
+
if ( file_exists( WPGlobus::Config()->flag_path['big'] . WPGlobus::Config()->flag[ $language ] ) ) {
|
482 |
+
$flags_url[ $language ] = WPGlobus::Config()->flag_urls['big'] . WPGlobus::Config()->flag[ $language ];
|
483 |
+
} else {
|
484 |
+
$flags_url[ $language ] = WPGlobus::Config()->flags_url . WPGlobus::Config()->flag[ $language ];
|
485 |
+
}
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* Pass the $post to JS.
|
490 |
+
*
|
491 |
+
* @since 2.2.4
|
492 |
+
*/
|
493 |
+
$__post = array(
|
494 |
+
'ID' => '',
|
495 |
+
'type' => '',
|
496 |
+
'disabled' => false,
|
497 |
+
);
|
498 |
+
if ( $post instanceof WP_Post ) {
|
499 |
+
$__post['ID'] = $post->ID;
|
500 |
+
$__post['type'] = $post->post_type;
|
501 |
+
if ( in_array( $post->post_type, WPGlobus::Config()->disabled_entities, true ) ) {
|
502 |
+
$__post['disabled'] = true;
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
/**
|
507 |
+
* @see includes\class-wpglobus-config.php for config options.
|
508 |
+
* @since 2.2.14
|
509 |
+
*/
|
510 |
+
$key_option = array();
|
511 |
+
$key_option['switcherButtonType'] = 'block_editor_switcher_plugin_button_type';
|
512 |
+
|
513 |
+
$options = array();
|
514 |
+
foreach($key_option as $key=>$option) {
|
515 |
+
$options[ $option ] = '';
|
516 |
+
if ( ! empty( WPGlobus::Config()->$option ) ) {
|
517 |
+
$options[$option] = WPGlobus::Config()->$option;
|
518 |
+
}
|
519 |
+
}
|
520 |
+
|
521 |
+
$data = array(
|
522 |
+
'version' => WPGLOBUS_VERSION,
|
523 |
+
'versionGutenberg' => $version_gutenberg,
|
524 |
+
'wpglobusAjax' => WPGLOBUS_AJAX,
|
525 |
+
'context' => WPGlobus::Config()->builder->get( 'context' ),
|
526 |
+
'tabs' => $tabs,
|
527 |
+
'language' => $this->language,
|
528 |
+
'pagenow' => $pagenow,
|
529 |
+
'postEditPage' => 'post.php',
|
530 |
+
'postNewPage' => 'post-new.php',
|
531 |
+
'defaultLanguage' => WPGlobus::Config()->default_language,
|
532 |
+
'i18n' => $i18n,
|
533 |
+
'yoastSeo' => $yoast_seo,
|
534 |
+
'elementor' => $elementor,
|
535 |
+
'flags_url' => $flags_url,
|
536 |
+
'store_link' => WPGlobus::URL_WPGLOBUS_SHOP,
|
537 |
+
'__post' => $__post,
|
538 |
+
'block_editor_tab_url' => $block_editor_tab_url,
|
539 |
+
'options_page_url' => $options_page_url,
|
540 |
+
'disabled_entities' => WPGlobus::Config()->disabled_entities,
|
541 |
+
'options' => $options,
|
542 |
+
'enabledOptionsTab' => true,
|
543 |
+
'keyOption' => $key_option,
|
544 |
+
'data' => $__data
|
545 |
+
);
|
546 |
+
|
547 |
+
/**
|
548 |
+
* Filter for data to send to JS.
|
549 |
+
* Returning array.
|
550 |
+
*
|
551 |
+
* @since 2.2.14
|
552 |
+
*
|
553 |
+
* @param array $data An array with data.
|
554 |
+
*/
|
555 |
+
$data = apply_filters( 'wpglobus_block_editor_localize_data', $data );
|
556 |
+
|
557 |
+
wp_register_script(
|
558 |
+
'wpglobus-gutenberg',
|
559 |
+
WPGlobus::plugin_dir_url() . 'includes/builders/gutenberg/assets/js/wpglobus-gutenberg' . WPGlobus::SCRIPT_SUFFIX() . '.js',
|
560 |
+
array( 'jquery' ),
|
561 |
+
WPGLOBUS_VERSION,
|
562 |
+
true
|
563 |
+
);
|
564 |
+
wp_enqueue_script( 'wpglobus-gutenberg' );
|
565 |
+
wp_localize_script(
|
566 |
+
'wpglobus-gutenberg',
|
567 |
+
'WPGlobusGutenberg',
|
568 |
+
$data
|
569 |
+
);
|
570 |
+
}
|
571 |
+
|
572 |
+
/**
|
573 |
+
* Callback for 'add_meta_boxes'.
|
574 |
+
*/
|
575 |
+
public function on__add_meta_box() {
|
576 |
+
|
577 |
+
global $post;
|
578 |
+
|
579 |
+
if ( in_array( $post->post_type, WPGlobus::Config()->disabled_entities, true ) ) {
|
580 |
+
return;
|
581 |
+
}
|
582 |
+
|
583 |
+
add_meta_box(
|
584 |
+
'wpglobus',
|
585 |
+
__( 'WPGlobus', 'wpglobus' ),
|
586 |
+
array( $this, 'callback__meta_box' ),
|
587 |
+
null,
|
588 |
+
'side',
|
589 |
+
'core'
|
590 |
+
);
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Callback for 'add_meta_box' function.
|
595 |
+
*/
|
596 |
+
public function callback__meta_box() {
|
597 |
+
echo $this->get_language_field(); // phpcs:ignore WordPress.Security.EscapeOutput
|
598 |
+
do_action( 'wpglobus_gutenberg_metabox' );
|
599 |
+
}
|
600 |
+
|
601 |
+
}
|
trunk/includes/builders/js_composer/class-wpglobus-js_composer-update-post.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-js_composer-update-post.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\JS_Composer
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_js_composer_Update_Post.
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! class_exists( 'WPGlobus_js_composer_Update_Post' ) ) :
|
14 |
+
|
15 |
+
// phpcs:ignore PEAR.NamingConventions
|
16 |
+
class WPGlobus_js_composer_Update_Post extends WPGlobus_Builder_Update_Post {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor.
|
20 |
+
*/
|
21 |
+
public function __construct() {
|
22 |
+
|
23 |
+
parent::__construct( 'js_composer' );
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
27 |
+
*/
|
28 |
+
remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @todo incorrect the saving post in extra languages with priority = 10
|
32 |
+
*/
|
33 |
+
add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Callback for 'wp_insert_post_data'.
|
39 |
+
*
|
40 |
+
* @param array $data
|
41 |
+
* @param array $postarr
|
42 |
+
*
|
43 |
+
* @return array mixed
|
44 |
+
*/
|
45 |
+
public function filter__wp_insert_post_data( $data, $postarr ) {
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Prevent to filter disabled post type.
|
49 |
+
*
|
50 |
+
* @since 2.1.4
|
51 |
+
*/
|
52 |
+
if ( in_array( $data['post_type'], WPGlobus::Config()->disabled_entities, true ) ) {
|
53 |
+
return $data;
|
54 |
+
}
|
55 |
+
|
56 |
+
global $wpdb;
|
57 |
+
$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d AND post_type = %s LIMIT 1", $postarr['ID'], $postarr['post_type'] ) );
|
58 |
+
|
59 |
+
$fields = array();
|
60 |
+
if ( isset( $postarr['post_title'] ) ) {
|
61 |
+
$fields['post_title'] = $postarr['post_title'];
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( isset( $postarr['post_content'] ) ) {
|
65 |
+
$fields['post_content'] = $postarr['post_content'];
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( isset( $postarr['post_excerpt'] ) ) {
|
69 |
+
$fields['post_excerpt'] = $postarr['post_excerpt'];
|
70 |
+
}
|
71 |
+
|
72 |
+
$builder_language = WPGlobus::Config()->builder->get_language();
|
73 |
+
|
74 |
+
if ( empty( $builder_language ) ) {
|
75 |
+
|
76 |
+
if ( empty( $postarr[ WPGlobus::get_language_meta_key() ] ) ) {
|
77 |
+
$builder_language = WPGlobus::Config()->default_language;
|
78 |
+
} else {
|
79 |
+
$builder_language = $postarr[ WPGlobus::get_language_meta_key() ];
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
foreach ( $fields as $field => $value ) {
|
84 |
+
|
85 |
+
$tr = array();
|
86 |
+
|
87 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
88 |
+
|
89 |
+
if ( $lang === $builder_language ) {
|
90 |
+
|
91 |
+
$text = $value;
|
92 |
+
if ( WPGlobus_Core::has_translations( $value ) ) {
|
93 |
+
$text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
|
94 |
+
}
|
95 |
+
if ( ! empty( $text ) ) {
|
96 |
+
$tr[ $lang ] = $text;
|
97 |
+
}
|
98 |
+
} else {
|
99 |
+
if ( isset( $_post->$field ) ) {
|
100 |
+
$text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
|
101 |
+
if ( ! empty( $text ) ) {
|
102 |
+
$tr[ $lang ] = $text;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
endforeach;
|
108 |
+
|
109 |
+
$data[ $field ] = WPGlobus_Utils::build_multilingual_string( $tr );
|
110 |
+
|
111 |
+
}
|
112 |
+
|
113 |
+
return $data;
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
endif;
|
trunk/includes/builders/js_composer/class-wpglobus-js_composer.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-js_composer.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\WPBakeryPageBuilder
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
if ( ! class_exists( 'WPGlobus_JS_Composer' ) ) :
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class WPGlobus_JS_Composer.
|
14 |
+
*/
|
15 |
+
class WPGlobus_JS_Composer extends WPGlobus_Builder {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
parent::__construct( 'js_composer' );
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
endif;
|
trunk/includes/builders/pods/class-wpglobus-builder-pods.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-builder-pods.php
|
4 |
+
*
|
5 |
+
* @since 2.3.0
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\Pods.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_Builder_Pods' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_Builder_Pods.
|
15 |
+
*/
|
16 |
+
class WPGlobus_Builder_Pods {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Default Pods post type.
|
20 |
+
*/
|
21 |
+
protected static $post_type = '_pods_pod';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Type of Pods: `post_type` or `settings`.
|
25 |
+
*/
|
26 |
+
protected static $pods_type = '';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get attributes.
|
30 |
+
*/
|
31 |
+
public static function get_attrs($attrs) {
|
32 |
+
|
33 |
+
if ( ! function_exists('pods_api') ) {
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
|
37 |
+
/** @global string $pagenow */
|
38 |
+
/** @global string $wpdb */
|
39 |
+
global $pagenow, $wpdb;
|
40 |
+
|
41 |
+
$result = true;
|
42 |
+
|
43 |
+
if ( 'post.php' === $pagenow ) {
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @see pods\includes\classes.php
|
47 |
+
*/
|
48 |
+
$pods = pods_api()->load_pods( array( 'type' => 'post_type', 'fields' => true ) );
|
49 |
+
|
50 |
+
self::$pods_type = 'post_type';
|
51 |
+
|
52 |
+
$post_id = $attrs['post_id'];
|
53 |
+
|
54 |
+
if ( $post_id > 0 ) {
|
55 |
+
|
56 |
+
$pods_pod = $wpdb->get_results( $wpdb->prepare(
|
57 |
+
"SELECT p.post_name AS name, p.ID, p.post_title AS title, p.post_parent AS parent, pm.meta_value AS type FROM $wpdb->posts as p
|
58 |
+
LEFT JOIN $wpdb->postmeta AS pm ON pm.post_id = p.ID WHERE p.post_type = %s AND p.post_status = 'publish'
|
59 |
+
AND pm.meta_key = 'type' AND pm.meta_value = %s",
|
60 |
+
self::$post_type,
|
61 |
+
self::$pods_type
|
62 |
+
), OBJECT_K );
|
63 |
+
|
64 |
+
if ( ! empty($pods_pod) ) {
|
65 |
+
|
66 |
+
foreach ( $pods_pod as $_pod_key => $_pod ) :
|
67 |
+
|
68 |
+
if ( $attrs['post_type'] != $_pod_key ) {
|
69 |
+
continue;
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( empty($pods[ $_pod->ID ]['fields']) ) {
|
73 |
+
/**
|
74 |
+
* Pods_pod is attached to post type (e.g. for post) but has no fields.
|
75 |
+
*/
|
76 |
+
$result = false;
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
|
80 |
+
endforeach;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( ! $result ) {
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
|
88 |
+
$attrs['builder_page'] = true;
|
89 |
+
return $attrs;
|
90 |
+
|
91 |
+
} else {
|
92 |
+
/**
|
93 |
+
* @todo W.I.P @since 2.3.0
|
94 |
+
*/
|
95 |
+
//
|
96 |
+
//if ( ! empty($_GET['page']) && false !== strpos( $_GET['page'], 'pods-settings' ) ) {
|
97 |
+
// $attrs['builder_page'] = true;
|
98 |
+
// return $attrs;
|
99 |
+
//}
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
endif;
|
109 |
+
|
110 |
+
# --- EOF
|
trunk/includes/builders/pods/class-wpglobus-pods-update-post.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-pods-update-post.php
|
4 |
+
*
|
5 |
+
* @since 2.3.0
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\Pods.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class WPGlobus_pods_Update_Post.
|
13 |
+
*/
|
14 |
+
if ( ! class_exists( 'WPGlobus_pods_Update_Post' ) ) :
|
15 |
+
|
16 |
+
// phpcs:ignore PEAR.NamingConventions
|
17 |
+
class WPGlobus_pods_Update_Post extends WPGlobus_Builder_Update_Post {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructor.
|
21 |
+
*/
|
22 |
+
public function __construct() {
|
23 |
+
|
24 |
+
parent::__construct( 'pods' );
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
28 |
+
*/
|
29 |
+
remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @todo incorrect the saving post in extra languages with priority = 10
|
33 |
+
*/
|
34 |
+
add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Callback for 'wp_insert_post_data'.
|
40 |
+
*
|
41 |
+
* @param array $data
|
42 |
+
* @param array $postarr
|
43 |
+
*
|
44 |
+
* @return mixed
|
45 |
+
*/
|
46 |
+
public function filter__wp_insert_post_data( $data, $postarr ) {
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Prevent to filter disabled post type.
|
50 |
+
*/
|
51 |
+
if ( in_array( $data['post_type'], WPGlobus::Config()->disabled_entities, true ) ) {
|
52 |
+
return $data;
|
53 |
+
}
|
54 |
+
|
55 |
+
global $wpdb;
|
56 |
+
$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d AND post_type = %s LIMIT 1", $postarr['ID'], $postarr['post_type'] ) );
|
57 |
+
|
58 |
+
$fields = array();
|
59 |
+
if ( isset( $postarr['post_title'] ) ) {
|
60 |
+
$fields['post_title'] = $postarr['post_title'];
|
61 |
+
}
|
62 |
+
|
63 |
+
if ( isset( $postarr['post_content'] ) ) {
|
64 |
+
$fields['post_content'] = $postarr['post_content'];
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( isset( $postarr['post_excerpt'] ) ) {
|
68 |
+
$fields['post_excerpt'] = $postarr['post_excerpt'];
|
69 |
+
}
|
70 |
+
|
71 |
+
$builder_language = WPGlobus::Config()->builder->get_language();
|
72 |
+
|
73 |
+
if ( empty( $builder_language ) ) {
|
74 |
+
|
75 |
+
if ( empty( $postarr[ WPGlobus::get_language_meta_key() ] ) ) {
|
76 |
+
$builder_language = WPGlobus::Config()->default_language;
|
77 |
+
} else {
|
78 |
+
$builder_language = $postarr[ WPGlobus::get_language_meta_key() ];
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
foreach ( $fields as $field => $value ) {
|
83 |
+
|
84 |
+
$tr = array();
|
85 |
+
|
86 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
87 |
+
|
88 |
+
if ( $lang === $builder_language ) {
|
89 |
+
|
90 |
+
$text = $value;
|
91 |
+
if ( WPGlobus_Core::has_translations( $value ) ) {
|
92 |
+
$text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
|
93 |
+
}
|
94 |
+
if ( ! empty( $text ) ) {
|
95 |
+
$tr[ $lang ] = $text;
|
96 |
+
}
|
97 |
+
} else {
|
98 |
+
if ( isset( $_post->$field ) ) {
|
99 |
+
$text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
|
100 |
+
if ( ! empty( $text ) ) {
|
101 |
+
$tr[ $lang ] = $text;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
endforeach;
|
107 |
+
|
108 |
+
$data[ $field ] = WPGlobus_Utils::build_multilingual_string( $tr );
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
return $data;
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
endif;
|
119 |
+
|
120 |
+
# --- EOF
|
trunk/includes/builders/pods/class-wpglobus-pods.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-pods.php
|
4 |
+
*
|
5 |
+
* @since 2.3.0
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\Pods.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_Pods' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_Pods.
|
15 |
+
*/
|
16 |
+
class WPGlobus_Pods extends WPGlobus_Builder {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor.
|
20 |
+
*/
|
21 |
+
public function __construct() {
|
22 |
+
|
23 |
+
parent::__construct( 'pods' );
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
+
endif;
|
30 |
+
|
31 |
+
# --- EOF
|
trunk/includes/builders/rank_math_seo/class-wpglobus-builder-rank_math_seo.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-builder-rank_math_seo.php
|
4 |
+
*
|
5 |
+
* @since 2.4.3
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\RankMathSEO.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_Builder_RankMathSEO' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_Builder_RankMathSEO.
|
15 |
+
*/
|
16 |
+
class WPGlobus_Builder_RankMathSEO {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Options titles.
|
20 |
+
* @see section Titles&Meta.
|
21 |
+
*/
|
22 |
+
protected static $options_titles = 'rank-math-options-titles';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Get attributes.
|
26 |
+
*/
|
27 |
+
public static function get_attrs($attrs) {
|
28 |
+
|
29 |
+
/** @global string $pagenow */
|
30 |
+
global $pagenow;
|
31 |
+
|
32 |
+
if ( 'post.php' === $pagenow ) {
|
33 |
+
|
34 |
+
$post_type = 'post';
|
35 |
+
if ( ! empty( $attrs['post_type'] ) ) {
|
36 |
+
$post_type = $attrs['post_type'];
|
37 |
+
}
|
38 |
+
|
39 |
+
$opts = get_option( self::$options_titles );
|
40 |
+
|
41 |
+
if ( ! empty( $opts[ "pt_{$post_type}_add_meta_box" ] ) && 'off' == $opts[ "pt_{$post_type}_add_meta_box" ] ) {
|
42 |
+
$attrs = false;
|
43 |
+
} else {
|
44 |
+
$attrs['builder_page'] = true;
|
45 |
+
}
|
46 |
+
|
47 |
+
return $attrs;
|
48 |
+
|
49 |
+
} elseif ( 'term.php' === $pagenow ) {
|
50 |
+
|
51 |
+
$tax = empty( $_GET['taxonomy'] ) ? false : sanitize_text_field( wp_unslash( $_GET['taxonomy'] ) ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
52 |
+
|
53 |
+
if ( $tax ) {
|
54 |
+
|
55 |
+
$opts = get_option( self::$options_titles );
|
56 |
+
|
57 |
+
if ( ! empty( $opts[ "tax_{$tax}_add_meta_box" ] ) && 'off' == $opts[ "tax_{$tax}_add_meta_box" ] ) {
|
58 |
+
$attrs = false;
|
59 |
+
} else {
|
60 |
+
$attrs['post_type'] = ''; // reset post type.
|
61 |
+
$attrs['taxonomy'] = $tax;
|
62 |
+
$attrs['builder_page'] = true;
|
63 |
+
}
|
64 |
+
|
65 |
+
return $attrs;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
endif;
|
74 |
+
|
75 |
+
# --- EOF
|
trunk/includes/builders/rank_math_seo/class-wpglobus-rank_math_seo-functions.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-rank_math_seo-functions.php
|
4 |
+
*
|
5 |
+
* @since 2.4.3
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\RankMathSEO.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_RankMathSEO_Functions' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_RankMathSEO_Functions.
|
15 |
+
*/
|
16 |
+
class WPGlobus_RankMathSEO_Functions {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Current taxonomy.
|
20 |
+
*/
|
21 |
+
protected static $taxonomy = false;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* WP_Term object.
|
25 |
+
*/
|
26 |
+
protected static $tag = false;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Current language.
|
30 |
+
*/
|
31 |
+
protected static $current_language = false;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor.
|
35 |
+
*/
|
36 |
+
public static function controller() {
|
37 |
+
|
38 |
+
if ( empty( $_POST['nonce_CMB2phprank_math_metabox'] ) || empty( $_POST['action'] ) ) {
|
39 |
+
/**
|
40 |
+
* Not `Rank Math SEO`.
|
41 |
+
*/
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
|
45 |
+
global $pagenow;
|
46 |
+
|
47 |
+
if ( ! empty( $_POST[ WPGlobus::get_language_meta_key() ] ) ) {
|
48 |
+
self::$current_language = sanitize_text_field( $_POST[ WPGlobus::get_language_meta_key() ] );
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( 'edit-tags.php' === $pagenow && 'editedtag' === $_POST['action'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
52 |
+
/**
|
53 |
+
* Update button was clicked.
|
54 |
+
*/
|
55 |
+
self::build_ml_description();
|
56 |
+
}
|
57 |
+
|
58 |
+
add_filter( 'wp_update_term_data', array( __CLASS__, 'filter__update_term_data' ), 5, 4 );
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Build multilingual description.
|
63 |
+
* We don't have filter for description like filter for name @see 'wp_update_term_data' in wp-includes\taxonomy.php
|
64 |
+
*/
|
65 |
+
protected static function build_ml_description() {
|
66 |
+
|
67 |
+
if ( ! self::$current_language ) {
|
68 |
+
return;
|
69 |
+
}
|
70 |
+
|
71 |
+
global $wpdb;
|
72 |
+
|
73 |
+
$tag_ID = (int) $_POST['tag_ID'];
|
74 |
+
$taxonomy = $_POST['taxonomy']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
75 |
+
|
76 |
+
self::$tag = get_term( $tag_ID, $taxonomy );
|
77 |
+
|
78 |
+
if ( is_wp_error( self::$tag ) ) {
|
79 |
+
|
80 |
+
$terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id = %d", $tag_ID ) );
|
81 |
+
if ( ! empty( $terms[0] ) && is_object( $terms[0] ) ) {
|
82 |
+
self::$tag = $terms[0];
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
if ( is_wp_error( self::$tag ) ) {
|
87 |
+
/**
|
88 |
+
* @todo Investigate.
|
89 |
+
*/
|
90 |
+
return;
|
91 |
+
}
|
92 |
+
|
93 |
+
$new_desc = array();
|
94 |
+
|
95 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
96 |
+
|
97 |
+
if ( $lang === self::$current_language ) {
|
98 |
+
|
99 |
+
$text = trim( $_POST['description'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
100 |
+
if ( ! empty( $text ) ) {
|
101 |
+
$new_desc[ $lang ] = $text;
|
102 |
+
}
|
103 |
+
} else {
|
104 |
+
|
105 |
+
$text = WPGlobus_Core::text_filter( self::$tag->description, $lang, WPGlobus::RETURN_EMPTY );
|
106 |
+
if ( ! empty( $text ) ) {
|
107 |
+
$new_desc[ $lang ] = $text;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
endforeach;
|
112 |
+
|
113 |
+
$_POST['description'] = WPGlobus_Utils::build_multilingual_string( $new_desc );
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Filters term data before it is updated in the database.
|
118 |
+
*
|
119 |
+
* @param array $data Term data to be updated.
|
120 |
+
* @param int $term_id Term ID.
|
121 |
+
* @param string $taxonomy Taxonomy slug.
|
122 |
+
* @param array $args Arguments passed to wp_update_term().
|
123 |
+
*
|
124 |
+
* @return array
|
125 |
+
*/
|
126 |
+
public static function filter__update_term_data( $data, $term_id, $taxonomy, $args ) {
|
127 |
+
|
128 |
+
if ( is_wp_error( self::$tag ) ) {
|
129 |
+
/**
|
130 |
+
* @todo Investigate.
|
131 |
+
* may be to use $args.
|
132 |
+
*/
|
133 |
+
return $data;
|
134 |
+
}
|
135 |
+
|
136 |
+
if ( ! self::$current_language ) {
|
137 |
+
return $data;
|
138 |
+
}
|
139 |
+
|
140 |
+
$new_term_name = array();
|
141 |
+
foreach ( WPGlobus::Config()->enabled_languages as $language ) :
|
142 |
+
|
143 |
+
if ( $language === self::$current_language ) {
|
144 |
+
|
145 |
+
$text = trim( $data['name'] );
|
146 |
+
if ( ! empty( $text ) ) {
|
147 |
+
$new_term_name[ $language ] = $text;
|
148 |
+
}
|
149 |
+
} else {
|
150 |
+
|
151 |
+
$text = WPGlobus_Core::text_filter( self::$tag->name, $language, WPGlobus::RETURN_EMPTY );
|
152 |
+
if ( ! empty( $text ) ) {
|
153 |
+
$new_term_name[ $language ] = $text;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
endforeach;
|
158 |
+
|
159 |
+
$data['name'] = WPGlobus_Utils::build_multilingual_string( $new_term_name );
|
160 |
+
|
161 |
+
return $data;
|
162 |
+
}
|
163 |
+
|
164 |
+
} // class WPGlobus_RankMathSEO_Functions.
|
165 |
+
|
166 |
+
endif;
|
167 |
+
|
168 |
+
# --- EOF
|
trunk/includes/builders/rank_math_seo/class-wpglobus-rank_math_seo-update-post.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-rank_math_seo-update-post.php
|
4 |
+
*
|
5 |
+
* @since 2.4.3
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\RankMathSEO.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_rank_math_seo_Update_Post' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_rank_math_seo_Update_Post.
|
15 |
+
*/
|
16 |
+
// phpcs:ignore PEAR.NamingConventions
|
17 |
+
class WPGlobus_rank_math_seo_Update_Post extends WPGlobus_Builder_Update_Post {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Constructor.
|
21 |
+
*/
|
22 |
+
public function __construct( $id = null ) {
|
23 |
+
|
24 |
+
if ( is_null($id) ) {
|
25 |
+
$id = WPGlobus::Config()->builder->get_id();
|
26 |
+
}
|
27 |
+
|
28 |
+
parent::__construct( $id );
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
32 |
+
*/
|
33 |
+
remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
|
34 |
+
}
|
35 |
+
|
36 |
+
} // class WPGlobus_rank_math_seo_Update_Post.
|
37 |
+
|
38 |
+
endif;
|
39 |
+
|
40 |
+
# --- EOF
|
trunk/includes/builders/rank_math_seo/class-wpglobus-rank_math_seo.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-rank_math_seo.php
|
4 |
+
*
|
5 |
+
* @since 2.4.3
|
6 |
+
*
|
7 |
+
* @package WPGlobus\Builders\RankMathSEO.
|
8 |
+
* @author Alex Gor(alexgff)
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! class_exists( 'WPGlobus_RankMathSEO' ) ) :
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPGlobus_RankMathSEO.
|
15 |
+
*/
|
16 |
+
class WPGlobus_RankMathSEO extends WPGlobus_Builder {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Current taxonomy.
|
20 |
+
*/
|
21 |
+
protected $taxonomy = null;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Constructor.
|
25 |
+
*/
|
26 |
+
public function __construct( $id = null ) {
|
27 |
+
|
28 |
+
if ( is_null($id) ) {
|
29 |
+
$id = WPGlobus::Config()->builder->get_id();
|
30 |
+
}
|
31 |
+
|
32 |
+
parent::__construct( $id );
|
33 |
+
|
34 |
+
$this->taxonomy = WPGlobus::Config()->builder->get('taxonomy');
|
35 |
+
|
36 |
+
if ( ! is_null($this->taxonomy) ) {
|
37 |
+
|
38 |
+
add_action( "{$this->taxonomy}_pre_edit_form", array( $this, 'on__pre_edit_form' ), 10, 2 );
|
39 |
+
|
40 |
+
add_action( "{$this->taxonomy}_term_edit_form_top", array( $this, 'on__edit_form' ), 10, 2 );
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Fires before the Edit Term form for all taxonomies.
|
47 |
+
*
|
48 |
+
* @param object $tag Current taxonomy term object.
|
49 |
+
* @param string $taxonomy Current $taxonomy slug.
|
50 |
+
*/
|
51 |
+
public function on__pre_edit_form( $tag, $taxonomy ) {
|
52 |
+
/**
|
53 |
+
* Init Name and Description in current language.
|
54 |
+
*/
|
55 |
+
$tag->description = WPGlobus_Core::text_filter( $tag->description, $this->get_current_language(), WPGlobus::RETURN_EMPTY );
|
56 |
+
$tag->name = WPGlobus_Core::text_filter( $tag->name, $this->get_current_language(), WPGlobus::RETURN_EMPTY );
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Add language field to taxonomy edit form.
|
61 |
+
* Fires at the beginning of the Edit Term form.
|
62 |
+
*
|
63 |
+
* @param object $tag Current taxonomy term object.
|
64 |
+
* @param string $taxonomy Current $taxonomy slug.
|
65 |
+
*/
|
66 |
+
public function on__edit_form( $tag, $taxonomy ) {
|
67 |
+
echo '<input type="hidden" name="'.WPGlobus::get_language_meta_key().'" value="'.$this->get_current_language().'">';
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
endif;
|
72 |
+
|
73 |
+
# --- EOF
|
trunk/includes/builders/yoast_seo/class-wpglobus-yoast_seo-update-post.php
ADDED
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-yoast_seo-update-post.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\Yoast_SEO
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_yoast_seo_Update_Post.
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! class_exists( 'WPGlobus_yoast_seo_Update_Post' ) ) :
|
14 |
+
|
15 |
+
// phpcs:ignore PEAR.NamingConventions
|
16 |
+
class WPGlobus_yoast_seo_Update_Post extends WPGlobus_Builder_Update_Post {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Current taxonomy.
|
20 |
+
*/
|
21 |
+
protected $taxonomy = '';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* WP_Term object.
|
25 |
+
*/
|
26 |
+
protected $tag;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor.
|
30 |
+
*/
|
31 |
+
public function __construct() {
|
32 |
+
|
33 |
+
parent::__construct( 'yoast_seo' );
|
34 |
+
|
35 |
+
global $pagenow;
|
36 |
+
|
37 |
+
if ( 'edit-tags.php' === $pagenow && 'editedtag' === $_POST['action'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
38 |
+
/**
|
39 |
+
* Update button was clicked.
|
40 |
+
*/
|
41 |
+
$this->build_ml_description();
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @see_file wpglobus\includes\class-wpglobus.php
|
46 |
+
*/
|
47 |
+
remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @todo incorrect the saving post in extra languages with priority = 10
|
51 |
+
*/
|
52 |
+
add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
|
53 |
+
|
54 |
+
$this->taxonomy = WPGlobus::Config()->builder->get( 'taxonomy' );
|
55 |
+
|
56 |
+
if ( $this->taxonomy ) {
|
57 |
+
|
58 |
+
add_filter( 'wp_update_term_data', array( $this, 'filter__update_term_data' ), 10, 4 );
|
59 |
+
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Build multilingual description.
|
65 |
+
* We don't have filter for description like filter for name @see 'wp_update_term_data' in wp-includes\taxonomy.php
|
66 |
+
*/
|
67 |
+
public function build_ml_description() {
|
68 |
+
|
69 |
+
global $wpdb;
|
70 |
+
|
71 |
+
$current_language = WPGlobus::Config()->builder->get_language();
|
72 |
+
|
73 |
+
$tag_ID = (int) $_POST['tag_ID'];
|
74 |
+
$taxonomy = $_POST['taxonomy']; // phpcs:ignore WordPress.CSRF.NonceVerification
|
75 |
+
|
76 |
+
$this->tag = get_term( $tag_ID, $taxonomy );
|
77 |
+
|
78 |
+
if ( is_wp_error( $this->tag ) ) {
|
79 |
+
|
80 |
+
$terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id = %d", $tag_ID ) );
|
81 |
+
if ( ! empty( $terms[0] ) && is_object( $terms[0] ) ) {
|
82 |
+
$this->tag = $terms[0];
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
if ( is_wp_error( $this->tag ) ) {
|
87 |
+
/**
|
88 |
+
* @todo Investigate.
|
89 |
+
*/
|
90 |
+
return;
|
91 |
+
}
|
92 |
+
|
93 |
+
$new_desc = array();
|
94 |
+
|
95 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
96 |
+
|
97 |
+
if ( $lang === $current_language ) {
|
98 |
+
|
99 |
+
$text = trim( $_POST['description'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
|
100 |
+
if ( ! empty( $text ) ) {
|
101 |
+
$new_desc[ $lang ] = $text;
|
102 |
+
}
|
103 |
+
} else {
|
104 |
+
|
105 |
+
$text = WPGlobus_Core::text_filter( $this->tag->description, $lang, WPGlobus::RETURN_EMPTY );
|
106 |
+
if ( ! empty( $text ) ) {
|
107 |
+
$new_desc[ $lang ] = $text;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
endforeach;
|
112 |
+
|
113 |
+
$_POST['description'] = WPGlobus_Utils::build_multilingual_string( $new_desc );
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Filters term data before it is updated in the database.
|
119 |
+
*
|
120 |
+
* @param array $data Term data to be updated.
|
121 |
+
* @param int $term_id Term ID.
|
122 |
+
* @param string $taxonomy Taxonomy slug.
|
123 |
+
* @param array $args Arguments passed to wp_update_term().
|
124 |
+
*
|
125 |
+
* @return array
|
126 |
+
*/
|
127 |
+
public function filter__update_term_data(
|
128 |
+
$data,
|
129 |
+
/** @noinspection PhpUnusedParameterInspection */
|
130 |
+
$term_id,
|
131 |
+
/** @noinspection PhpUnusedParameterInspection */
|
132 |
+
$taxonomy,
|
133 |
+
/** @noinspection PhpUnusedParameterInspection */
|
134 |
+
$args
|
135 |
+
) {
|
136 |
+
|
137 |
+
if ( is_wp_error( $this->tag ) ) {
|
138 |
+
/**
|
139 |
+
* @todo Investigate.
|
140 |
+
* may be to use $args.
|
141 |
+
*/
|
142 |
+
return $data;
|
143 |
+
}
|
144 |
+
|
145 |
+
if ( WPGlobus::Config()->builder && ! WPGlobus::Config()->builder->is_builder_page() ) {
|
146 |
+
return $data;
|
147 |
+
}
|
148 |
+
|
149 |
+
$current_language = WPGlobus::Config()->builder->get_language();
|
150 |
+
|
151 |
+
$new_name = array();
|
152 |
+
|
153 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
154 |
+
|
155 |
+
if ( $lang === $current_language ) {
|
156 |
+
|
157 |
+
$text = trim( $data['name'] );
|
158 |
+
if ( ! empty( $text ) ) {
|
159 |
+
$new_name[ $lang ] = $text;
|
160 |
+
}
|
161 |
+
} else {
|
162 |
+
|
163 |
+
$text = WPGlobus_Core::text_filter( $this->tag->name, $lang, WPGlobus::RETURN_EMPTY );
|
164 |
+
if ( ! empty( $text ) ) {
|
165 |
+
$new_name[ $lang ] = $text;
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
endforeach;
|
170 |
+
|
171 |
+
$data['name'] = WPGlobus_Utils::build_multilingual_string( $new_name );
|
172 |
+
|
173 |
+
return $data;
|
174 |
+
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Callback for 'wp_insert_post_data'.
|
179 |
+
*
|
180 |
+
* @param array $data
|
181 |
+
* @param array $postarr
|
182 |
+
*
|
183 |
+
* @return array mixed
|
184 |
+
*/
|
185 |
+
public function filter__wp_insert_post_data( $data, $postarr ) {
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Prevent to filter disabled post type.
|
189 |
+
*
|
190 |
+
* @since 2.1.4
|
191 |
+
*/
|
192 |
+
if ( in_array( $data['post_type'], WPGlobus::Config()->disabled_entities, true ) ) {
|
193 |
+
return $data;
|
194 |
+
}
|
195 |
+
|
196 |
+
global $wpdb;
|
197 |
+
$_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d AND post_type = %s LIMIT 1", $postarr['ID'], $postarr['post_type'] ) );
|
198 |
+
|
199 |
+
$fields = array();
|
200 |
+
if ( isset( $postarr['post_title'] ) ) {
|
201 |
+
$fields['post_title'] = $postarr['post_title'];
|
202 |
+
}
|
203 |
+
|
204 |
+
if ( isset( $postarr['post_content'] ) ) {
|
205 |
+
$fields['post_content'] = $postarr['post_content'];
|
206 |
+
}
|
207 |
+
|
208 |
+
if ( isset( $postarr['post_excerpt'] ) ) {
|
209 |
+
$fields['post_excerpt'] = $postarr['post_excerpt'];
|
210 |
+
}
|
211 |
+
|
212 |
+
$builder_language = WPGlobus::Config()->builder->get_language();
|
213 |
+
|
214 |
+
if ( empty( $builder_language ) ) {
|
215 |
+
|
216 |
+
if ( empty( $postarr[ WPGlobus::get_language_meta_key() ] ) ) {
|
217 |
+
$builder_language = WPGlobus::Config()->default_language;
|
218 |
+
} else {
|
219 |
+
$builder_language = $postarr[ WPGlobus::get_language_meta_key() ];
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
foreach ( $fields as $field => $value ) {
|
224 |
+
|
225 |
+
$tr = array();
|
226 |
+
|
227 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
228 |
+
|
229 |
+
if ( $lang === $builder_language ) {
|
230 |
+
|
231 |
+
$text = $value;
|
232 |
+
if ( WPGlobus_Core::has_translations( $value ) ) {
|
233 |
+
$text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
|
234 |
+
}
|
235 |
+
if ( ! empty( $text ) ) {
|
236 |
+
$tr[ $lang ] = $text;
|
237 |
+
}
|
238 |
+
} else {
|
239 |
+
if ( isset( $_post->$field ) ) {
|
240 |
+
$text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
|
241 |
+
if ( ! empty( $text ) ) {
|
242 |
+
$tr[ $lang ] = $text;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
endforeach;
|
248 |
+
|
249 |
+
$data[ $field ] = WPGlobus_Utils::build_multilingual_string( $tr );
|
250 |
+
|
251 |
+
}
|
252 |
+
|
253 |
+
return $data;
|
254 |
+
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
258 |
+
|
259 |
+
endif;
|
trunk/includes/builders/yoast_seo/class-wpglobus-yoast_seo.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-yoast_seo.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus\Builders\Yoast_SEO
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
if ( ! class_exists( 'WPGlobus_Yoast_SEO' ) ) :
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class WPGlobus_Yoast_SEO.
|
14 |
+
*/
|
15 |
+
class WPGlobus_Yoast_SEO extends WPGlobus_Builder {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Current taxonomy.
|
19 |
+
*/
|
20 |
+
protected $taxonomy = '';
|
21 |
+
|
22 |
+
protected $wpseo_taxonomy_option_name = '';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Constructor.
|
26 |
+
*/
|
27 |
+
public function __construct() {
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @see 'WPSEO_PREMIUM_FILE' for premium add-on.
|
31 |
+
*/
|
32 |
+
|
33 |
+
parent::__construct( 'yoast_seo' );
|
34 |
+
|
35 |
+
$this->taxonomy = WPGlobus::Config()->builder->get('taxonomy');
|
36 |
+
|
37 |
+
if ( $this->taxonomy ) {
|
38 |
+
|
39 |
+
add_action( "{$this->taxonomy}_pre_edit_form", array( $this, 'on__pre_edit_form' ), 10, 2 );
|
40 |
+
|
41 |
+
add_action( "{$this->taxonomy}_term_edit_form_top", array( $this, 'on__edit_form' ), 10, 2 );
|
42 |
+
|
43 |
+
if ( class_exists('WPSEO_Taxonomy_Meta') ) {
|
44 |
+
$wpseo_taxonomy_meta = WPSEO_Taxonomy_Meta::get_instance();
|
45 |
+
$this->wpseo_taxonomy_option_name = $wpseo_taxonomy_meta::$name;
|
46 |
+
} else {
|
47 |
+
$this->wpseo_taxonomy_option_name = 'wpseo_taxonomy_meta';
|
48 |
+
}
|
49 |
+
|
50 |
+
add_filter( "option_{$this->wpseo_taxonomy_option_name}", array( $this, 'filter__wpseo_taxonomy_meta' ), 5, 2 );
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @see wordpress-seo\inc\class-wpseo-replace-vars.php
|
54 |
+
*/
|
55 |
+
add_filter( 'wpseo_replacements', array( $this, 'filter__wpseo_replacements' ), 5, 2 );
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Customization of the replacements before they are applied.
|
63 |
+
*
|
64 |
+
* @api array $replacements The replacements.
|
65 |
+
*
|
66 |
+
* @param array $args The object some of the replacement values might come from,
|
67 |
+
* could be a post, taxonomy or term.
|
68 |
+
*/
|
69 |
+
public function filter__wpseo_replacements( $replacements, $args ) {
|
70 |
+
|
71 |
+
if ( ! is_array($replacements) || empty($replacements) ) {
|
72 |
+
return $replacements;
|
73 |
+
}
|
74 |
+
|
75 |
+
$key = key($replacements);
|
76 |
+
|
77 |
+
if ( WPGlobus_Core::has_translations( $replacements[$key] ) ) {
|
78 |
+
$replacements[$key] = WPGlobus_Core::text_filter( $replacements[$key], WPGlobus::Config()->builder->get_language(), WPGlobus::RETURN_EMPTY );
|
79 |
+
}
|
80 |
+
|
81 |
+
return $replacements;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Filters the value of a 'wpseo_taxonomy_meta' option.
|
86 |
+
*
|
87 |
+
* @param mixed $option_value Value of the option. If stored serialized, it will be
|
88 |
+
* unserialized prior to being returned.
|
89 |
+
* @param string $option_name Option name.
|
90 |
+
*/
|
91 |
+
public function filter__wpseo_taxonomy_meta( $option_value, $option_name ) {
|
92 |
+
|
93 |
+
if ( empty( $option_value[$this->taxonomy] ) ) {
|
94 |
+
return $option_value;
|
95 |
+
}
|
96 |
+
|
97 |
+
$_enabled_keys = array('wpseo_title', 'wpseo_desc', 'wpseo_focuskw');
|
98 |
+
|
99 |
+
$language = WPGlobus::Config()->builder->get_language();
|
100 |
+
|
101 |
+
foreach( $option_value[$this->taxonomy] as $tag_ID=>$values ) {
|
102 |
+
foreach($values as $_key=>$_value) {
|
103 |
+
if ( in_array($_key, $_enabled_keys) ) {
|
104 |
+
if ( WPGlobus_Core::has_translations($_value) ) {
|
105 |
+
$option_value[$this->taxonomy][$tag_ID][$_key] = WPGlobus_Core::text_filter($_value, $language, WPGlobus::RETURN_EMPTY);
|
106 |
+
} else {
|
107 |
+
if ( $language != WPGlobus::Config()->default_language ) {
|
108 |
+
$option_value[$this->taxonomy][$tag_ID][$_key] = '';
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
return $option_value;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Fires before the Edit Term form for all taxonomies.
|
120 |
+
*
|
121 |
+
* @param object $tag Current taxonomy term object.
|
122 |
+
* @param string $taxonomy Current $taxonomy slug.
|
123 |
+
*/
|
124 |
+
public function on__pre_edit_form( $tag, $taxonomy ) {
|
125 |
+
|
126 |
+
$language = WPGlobus::Config()->builder->get_language();
|
127 |
+
$tag->description = WPGlobus_Core::text_filter( $tag->description, $language, WPGlobus::RETURN_EMPTY );
|
128 |
+
$tag->name = WPGlobus_Core::text_filter( $tag->name, $language, WPGlobus::RETURN_EMPTY );
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Fires at the beginning of the Edit Term form. Add language field to taxonomy edit form.
|
134 |
+
*
|
135 |
+
* @param object $tag Current taxonomy term object.
|
136 |
+
* @param string $taxonomy Current $taxonomy slug.
|
137 |
+
*/
|
138 |
+
public function on__edit_form( $tag, $taxonomy ) {
|
139 |
+
echo '<input type="hidden" name="'.WPGlobus::get_language_meta_key().'" value="'.WPGlobus::Config()->builder->get_language().'">';
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
}
|
144 |
+
|
145 |
+
endif;
|
trunk/includes/class-wpglobus-config-vendor.php
ADDED
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class WPGlobus_Config_Vendor
|
4 |
+
*
|
5 |
+
* @package WPGlobus
|
6 |
+
* @author Alex Gor(alexgff)
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! class_exists( 'WPGlobus_Config_Vendor' ) ) :
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Vendor configuration.
|
13 |
+
*/
|
14 |
+
class WPGlobus_Config_Vendor {
|
15 |
+
|
16 |
+
const PLUGIN_CONFIG_FILES = 'configs/*.json';
|
17 |
+
|
18 |
+
const PLUGIN_CONFIG_DIR = 'configs/';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Instance of this class.
|
22 |
+
*
|
23 |
+
* @var WPGlobus_Config_Vendor
|
24 |
+
*/
|
25 |
+
protected static $instance;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var array
|
29 |
+
*/
|
30 |
+
protected static $config = array();
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @var array|null
|
34 |
+
*/
|
35 |
+
protected static $post_meta_fields = null;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @var array|null
|
39 |
+
*/
|
40 |
+
protected static $post_ml_fields = null;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @var array|null
|
44 |
+
*/
|
45 |
+
protected static $wp_options = null;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Builder.
|
49 |
+
*
|
50 |
+
* @var WPGlobus_Config_Builder
|
51 |
+
*/
|
52 |
+
protected static $builder = null;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Array of registered vendors.
|
56 |
+
*
|
57 |
+
* @var string[]
|
58 |
+
*/
|
59 |
+
protected static $vendors = array();
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Constructor.
|
63 |
+
*
|
64 |
+
* @param WPGlobus_Config_Builder $builder
|
65 |
+
*/
|
66 |
+
protected function __construct( $builder ) {
|
67 |
+
|
68 |
+
self::$builder = $builder;
|
69 |
+
|
70 |
+
self::get_config_files();
|
71 |
+
self::parse_config();
|
72 |
+
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get instance of this class.
|
77 |
+
*
|
78 |
+
* @param WPGlobus_Config_Builder $builder
|
79 |
+
*
|
80 |
+
* @return WPGlobus_Config_Vendor
|
81 |
+
*/
|
82 |
+
public static function get_instance( $builder ) {
|
83 |
+
if ( ! ( self::$instance instanceof WPGlobus_Config_Vendor ) ) {
|
84 |
+
self::$instance = new self( $builder );
|
85 |
+
}
|
86 |
+
|
87 |
+
return self::$instance;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Get meta fields.
|
92 |
+
*
|
93 |
+
* @return array|false
|
94 |
+
*/
|
95 |
+
public static function get_meta_fields() {
|
96 |
+
if ( is_null( self::$post_meta_fields ) ) {
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
return self::$post_meta_fields;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Get multilingual fields.
|
105 |
+
*
|
106 |
+
* @return array|false
|
107 |
+
*/
|
108 |
+
public static function get_ml_fields() {
|
109 |
+
if ( is_null( self::$post_ml_fields ) ) {
|
110 |
+
return false;
|
111 |
+
}
|
112 |
+
|
113 |
+
return self::$post_ml_fields;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Get wp_options.
|
118 |
+
*
|
119 |
+
* @return array|false
|
120 |
+
*/
|
121 |
+
public static function get_wp_options() {
|
122 |
+
if ( is_null( self::$wp_options ) ) {
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
|
126 |
+
return self::$wp_options;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Get config files.
|
131 |
+
*/
|
132 |
+
public static function get_config_files() {
|
133 |
+
|
134 |
+
$config_plugin_dir = WPGlobus::$PLUGIN_DIR_PATH . self::PLUGIN_CONFIG_DIR;
|
135 |
+
|
136 |
+
/**
|
137 |
+
* WPGlobus SEO.
|
138 |
+
*/
|
139 |
+
if ( function_exists( 'wpglobus_seo__init' ) ) {
|
140 |
+
self::$vendors[] = 'wpglobus-seo.json';
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Yoast SEO.
|
145 |
+
* https://wordpress.org/plugins/wordpress-seo/
|
146 |
+
*/
|
147 |
+
if ( defined( 'WPSEO_VERSION' ) ) {
|
148 |
+
/**
|
149 |
+
* check 'WPSEO_PREMIUM_PLUGIN_FILE' for premium add-on.
|
150 |
+
*/
|
151 |
+
self::$vendors[] = 'yoast-seo.json';
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* All in One SEO Pack.
|
156 |
+
* https://wordpress.org/plugins/all-in-one-seo-pack/
|
157 |
+
*/
|
158 |
+
if ( defined( 'AIOSEOP_VERSION' ) ) {
|
159 |
+
/**
|
160 |
+
* Load config file for builder page only.
|
161 |
+
*/
|
162 |
+
if ( self::$builder->is_builder_page() ) {
|
163 |
+
self::$vendors[] = 'all-in-one-seo-pack.json';
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Elementor.
|
169 |
+
* https://wordpress.org/plugins/elementor/
|
170 |
+
*/
|
171 |
+
if ( defined( 'ELEMENTOR_VERSION' ) ) {
|
172 |
+
self::$vendors[] = 'elementor.json';
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Advanced Custom Fields.
|
177 |
+
* https://wordpress.org/plugins/advanced-custom-fields/
|
178 |
+
*/
|
179 |
+
if ( function_exists( 'acf' ) ) {
|
180 |
+
/**
|
181 |
+
* Check the existence of function to prevent getting fatal error in older version (checked with 4.4.12).
|
182 |
+
*/
|
183 |
+
if ( function_exists( 'acf_maybe_get_field' ) ) {
|
184 |
+
self::$vendors[] = 'acf.json';
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Pods – Custom Content Types and Fields.
|
190 |
+
* https://wordpress.org/plugins/pods/
|
191 |
+
* @since 2.3.0
|
192 |
+
*/
|
193 |
+
if ( defined( 'PODS_VERSION' ) ) {
|
194 |
+
self::$vendors[] = 'pods.json';
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Rank Math SEO.
|
199 |
+
* https://wordpress.org/plugins/seo-by-rank-math/
|
200 |
+
* @since 2.4.3
|
201 |
+
*/
|
202 |
+
if ( defined( 'RANK_MATH_VERSION' ) ) {
|
203 |
+
self::$vendors[] = 'rank-math-seo.json';
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Page Builder by SiteOrigin.
|
208 |
+
* https://wordpress.org/plugins/siteorigin-panels/
|
209 |
+
* // if ( defined('SITEORIGIN_PANELS_VERSION') ) {
|
210 |
+
* // self::$vendors[] = 'siteorigin-panels.json';
|
211 |
+
* // }
|
212 |
+
*/
|
213 |
+
|
214 |
+
// TODO: builder ID can be a string or `false`. Need to refactor this condition or the `get_id` method.
|
215 |
+
// phpcs:ignore WordPress.PHP.StrictComparisons
|
216 |
+
if ( self::$builder->get_id() != '' && self::$builder->is_builder_page() ) {
|
217 |
+
|
218 |
+
$addons = WPGlobus_Builders::get_addons();
|
219 |
+
|
220 |
+
if ( ! empty( $addons ) ) {
|
221 |
+
foreach ( $addons as $id => $addon ) {
|
222 |
+
if ( 'add-on' === $addon['role'] ) {
|
223 |
+
if ( ! empty( $addon['const'] ) && defined( $addon['const'] ) ) {
|
224 |
+
self::$vendors[] = $addon['config_file'];
|
225 |
+
}
|
226 |
+
}
|
227 |
+
}
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Now handle with config files.
|
233 |
+
*/
|
234 |
+
foreach ( self::$vendors as $file ) {
|
235 |
+
|
236 |
+
if ( is_readable( $config_plugin_dir . $file ) ) {
|
237 |
+
$file_name = pathinfo( $file, PATHINFO_FILENAME );
|
238 |
+
|
239 |
+
self::$config[ $file_name ] = json_decode( file_get_contents( $config_plugin_dir . $file ), true );
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Filter vendor's config.
|
245 |
+
*
|
246 |
+
* @since 2.1.10
|
247 |
+
*
|
248 |
+
* @param array $config Config.
|
249 |
+
* @param object $builder An object WPGlobus_Config_Builder.
|
250 |
+
*
|
251 |
+
* @return array
|
252 |
+
*/
|
253 |
+
self::$config = apply_filters( 'wpglobus_config_vendors', self::$config, self::$builder );
|
254 |
+
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Get multilingual fields for post.
|
259 |
+
*
|
260 |
+
* @param mixed $_meta Unused.
|
261 |
+
* @param array $_init
|
262 |
+
*
|
263 |
+
* @return array|false
|
264 |
+
*/
|
265 |
+
public static function get_post_ml_fields(
|
266 |
+
/** @noinspection PhpUnusedParameterInspection */
|
267 |
+
$_meta, $_init
|
268 |
+
) {
|
269 |
+
|
270 |
+
if ( ! self::$builder->is_builder_page() ) {
|
271 |
+
/**
|
272 |
+
* Prevent getting multilingual fields for no builder page.
|
273 |
+
*
|
274 |
+
* @since 2.1.11
|
275 |
+
*/
|
276 |
+
return false;
|
277 |
+
}
|
278 |
+
|
279 |
+
$_post_ml_fields = array();
|
280 |
+
|
281 |
+
if ( empty( $_init ) ) {
|
282 |
+
return $_post_ml_fields;
|
283 |
+
}
|
284 |
+
|
285 |
+
// phpcs:ignore
|
286 |
+
// $file = empty( $_init['file'] ) ? '' : WPGlobus::$PLUGIN_DIR_PATH . 'includes/' . $_init['file']; // TODO remove
|
287 |
+
|
288 |
+
/** @var WPGlobus_Acf_2 $class */
|
289 |
+
$class = empty( $_init['class'] ) ? '' : $_init['class'];
|
290 |
+
|
291 |
+
if ( ! empty( $class ) && class_exists( $class ) ) {
|
292 |
+
$_post_ml_fields = $class::get_post_multilingual_fields();
|
293 |
+
}
|
294 |
+
|
295 |
+
return $_post_ml_fields;
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Get meta fields for post.
|
300 |
+
*
|
301 |
+
* @param mixed $_meta Unused.
|
302 |
+
* @param array $_init
|
303 |
+
*
|
304 |
+
* @return array|false
|
305 |
+
*/
|
306 |
+
public static function get_post_meta_fields(
|
307 |
+
/** @noinspection PhpUnusedParameterInspection */
|
308 |
+
$_meta, $_init
|
309 |
+
) {
|
310 |
+
|
311 |
+
if ( ! self::$builder->is_builder_page() ) {
|
312 |
+
/**
|
313 |
+
* Prevent getting meta fields for no builder page.
|
314 |
+
*
|
315 |
+
* @since 2.1.11
|
316 |
+
*/
|
317 |
+
return false;
|
318 |
+
}
|
319 |
+
|
320 |
+
$_post_meta_fields = array();
|
321 |
+
|
322 |
+
if ( empty( $_init ) ) {
|
323 |
+
return $_post_meta_fields;
|
324 |
+
}
|
325 |
+
|
326 |
+
$file = empty( $_init['file'] ) ? '' : WPGlobus::$PLUGIN_DIR_PATH . 'includes/' . $_init['file'];
|
327 |
+
|
328 |
+
/** @var WPGlobus_Acf_2 $class */
|
329 |
+
$class = empty( $_init['class'] ) ? '' : $_init['class'];
|
330 |
+
|
331 |
+
if ( ! empty( $file ) && file_exists( $file ) ) {
|
332 |
+
/** @noinspection PhpIncludeInspection */
|
333 |
+
include_once $file;
|
334 |
+
if ( ! empty( $class ) && class_exists( $class ) ) {
|
335 |
+
/**
|
336 |
+
* @since 2.1.3 Added post type parameter.
|
337 |
+
*/
|
338 |
+
$_post_meta_fields = $class::get_post_meta_fields( self::$builder->get( 'post_id' ), self::$builder->get( 'post_type' ) );
|
339 |
+
} else {
|
340 |
+
/**
|
341 |
+
* Mark as being incorrectly called.
|
342 |
+
*/
|
343 |
+
_doing_it_wrong( 'Class `' . $class . '` (in ' . __FILE__ . ')', 'Check out `configs\*.json` files.', '2.3.0' );
|
344 |
+
}
|
345 |
+
} else {
|
346 |
+
/**
|
347 |
+
* Mark as being incorrectly called.
|
348 |
+
*/
|
349 |
+
_doing_it_wrong( 'File `' . $file . '` (in ' . __FILE__ . ')', 'Check out `configs\*.json` files.', '2.3.0' );
|
350 |
+
}
|
351 |
+
|
352 |
+
return $_post_meta_fields;
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* Parse config files.
|
357 |
+
*/
|
358 |
+
public static function parse_config() {
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Parse post meta fields.
|
362 |
+
*/
|
363 |
+
if ( is_null( self::$post_meta_fields ) ) {
|
364 |
+
|
365 |
+
self::$post_meta_fields = array();
|
366 |
+
self::$post_ml_fields = array();
|
367 |
+
|
368 |
+
foreach ( self::$config as $vendor => $data ) {
|
369 |
+
|
370 |
+
if ( isset( $data['post_meta_fields'] ) && is_array( $data['post_meta_fields'] ) ) :
|
371 |
+
|
372 |
+
foreach ( $data['post_meta_fields'] as $_meta => $_init ) {
|
373 |
+
|
374 |
+
if ( isset( $data['post_meta_fields'][ $_meta ] ) ) {
|
375 |
+
|
376 |
+
if ( '*' === $_meta ) {
|
377 |
+
$_arr = self::get_post_meta_fields( $_meta, $_init );
|
378 |
+
if ( ! empty( $_arr ) ) {
|
379 |
+
self::$post_meta_fields = array_merge( self::$post_meta_fields, $_arr );
|
380 |
+
}
|
381 |
+
} else {
|
382 |
+
self::$post_meta_fields[] = $_meta;
|
383 |
+
}
|
384 |
+
}
|
385 |
+
}
|
386 |
+
|
387 |
+
endif;
|
388 |
+
|
389 |
+
if ( isset( $data['post_ml_fields'] ) && is_array( $data['post_ml_fields'] ) ) :
|
390 |
+
foreach ( $data['post_ml_fields'] as $_meta => $_init ) {
|
391 |
+
if ( isset( $data['post_ml_fields'][ $_meta ] ) ) {
|
392 |
+
|
393 |
+
if ( '*' === $_meta ) {
|
394 |
+
$_arr = self::get_post_ml_fields( $_meta, $_init );
|
395 |
+
if ( ! empty( $_arr ) ) {
|
396 |
+
self::$post_ml_fields = array_merge( self::$post_ml_fields, $_arr );
|
397 |
+
}
|
398 |
+
} else {
|
399 |
+
self::$post_ml_fields[] = $_meta;
|
400 |
+
}
|
401 |
+
}
|
402 |
+
}
|
403 |
+
endif;
|
404 |
+
|
405 |
+
}
|
406 |
+
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Parse WP options.
|
411 |
+
*/
|
412 |
+
if ( is_null( self::$wp_options ) ) {
|
413 |
+
|
414 |
+
foreach ( self::$config as $vendor => $data ) {
|
415 |
+
|
416 |
+
if ( isset( $data['wp_options'] ) && is_array( $data['wp_options'] ) ) :
|
417 |
+
foreach ( $data['wp_options'] as $_option => $_init ) {
|
418 |
+
if ( isset( $data['wp_options'][ $_option ] ) ) {
|
419 |
+
self::$wp_options[] = $_option;
|
420 |
+
}
|
421 |
+
}
|
422 |
+
endif;
|
423 |
+
|
424 |
+
}
|
425 |
+
|
426 |
+
if ( ! is_null( self::$wp_options ) ) {
|
427 |
+
self::$wp_options = array_unique( self::$wp_options );
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
}
|
432 |
+
|
433 |
+
}
|
434 |
+
|
435 |
+
endif;
|
436 |
+
|
437 |
+
# --- EOF
|
trunk/includes/class-wpglobus-config.php
ADDED
@@ -0,0 +1,967 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package WPGlobus
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Class WPGlobus_Config
|
8 |
+
*/
|
9 |
+
class WPGlobus_Config {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Language by default
|
13 |
+
* @var string
|
14 |
+
*/
|
15 |
+
public $default_language = 'en';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Current language. Should be set to default initially.
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
public $language = 'en';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Enabled languages
|
25 |
+
* @var string[]
|
26 |
+
*/
|
27 |
+
public $enabled_languages = array(
|
28 |
+
'en',
|
29 |
+
'es',
|
30 |
+
'de',
|
31 |
+
'fr',
|
32 |
+
'ru',
|
33 |
+
);
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Hide from URL language by default
|
37 |
+
* @var bool
|
38 |
+
*/
|
39 |
+
public $hide_default_language = true;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Opened languages
|
43 |
+
* @var string[]
|
44 |
+
*/
|
45 |
+
public $open_languages = array();
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Flag images configuration
|
49 |
+
* Look in /flags/ directory for a huge list of flags for usage
|
50 |
+
* @var array
|
51 |
+
*/
|
52 |
+
public $flag = array();
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Location of flags (needs trailing slash!)
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
public $flags_url = '';
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Path to flags.
|
62 |
+
* @var array
|
63 |
+
* @since 1.9.17
|
64 |
+
*/
|
65 |
+
public $flag_path = array();
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Location of flags.
|
69 |
+
* @var array
|
70 |
+
* @since 1.9.17
|
71 |
+
*/
|
72 |
+
public $flag_urls = array();
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Stores languages in pairs code=>name
|
76 |
+
* @var array
|
77 |
+
*/
|
78 |
+
public $language_name = array();
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Stores languages names in English
|
82 |
+
* @var array
|
83 |
+
*/
|
84 |
+
public $en_language_name = array();
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Stores locales
|
88 |
+
* @var array
|
89 |
+
*/
|
90 |
+
public $locale = array();
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Stores enabled locales
|
94 |
+
* @since 1.0.10
|
95 |
+
* @var array
|
96 |
+
*/
|
97 |
+
public $enabled_locale = array();
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Stores version and update from WPGlobus Mini info
|
101 |
+
* @var array
|
102 |
+
*/
|
103 |
+
public $version = array();
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Use flag name for navigation menu : 'name' || 'code' || ''
|
107 |
+
* @var string
|
108 |
+
*/
|
109 |
+
public $show_flag_name = 'code';
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Use navigation menu by slug
|
113 |
+
* for use in all nav menu set value to 'all'
|
114 |
+
* @var string
|
115 |
+
*/
|
116 |
+
public $nav_menu = '';
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Add language selector to navigation menu which was created with wp_list_pages
|
120 |
+
* @since 1.0.7
|
121 |
+
* @var bool
|
122 |
+
*/
|
123 |
+
public $selector_wp_list_pages = true;
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Custom CSS
|
127 |
+
* @var string
|
128 |
+
*/
|
129 |
+
public $custom_css = '';
|
130 |
+
|
131 |
+
/**
|
132 |
+
* WPGlobus option key
|
133 |
+
* @var string
|
134 |
+
*/
|
135 |
+
public $option = 'wpglobus_option';
|
136 |
+
|
137 |
+
/**
|
138 |
+
* WPGlobus option versioning key
|
139 |
+
* @var string
|
140 |
+
*/
|
141 |
+
public static $option_versioning = 'wpglobus_option_versioning';
|
142 |
+
|
143 |
+
/**
|
144 |
+
* WPGlobus option key for $language_name
|
145 |
+
* @var string
|
146 |
+
*/
|
147 |
+
public $option_language_names = 'wpglobus_option_language_names';
|
148 |
+
|
149 |
+
/**
|
150 |
+
* WPGlobus option key for $en_language_name
|
151 |
+
* @var string
|
152 |
+
*/
|
153 |
+
public $option_en_language_names = 'wpglobus_option_en_language_names';
|
154 |
+
|
155 |
+
/**
|
156 |
+
* WPGlobus option key for $locale
|
157 |
+
* @var string
|
158 |
+
*/
|
159 |
+
public $option_locale = 'wpglobus_option_locale';
|
160 |
+
|
161 |
+
/**
|
162 |
+
* WPGlobus option key for $flag
|
163 |
+
* @var string
|
164 |
+
*/
|
165 |
+
public $option_flags = 'wpglobus_option_flags';
|
166 |
+
|
167 |
+
/**
|
168 |
+
* WPGlobus option key for meta settings
|
169 |
+
* @var string
|
170 |
+
*/
|
171 |
+
public $option_post_meta_settings = 'wpglobus_option_post_meta_settings';
|
172 |
+
|
173 |
+
/**
|
174 |
+
* WPGlobus option key for registered post types.
|
175 |
+
* @since 2.2.24
|
176 |
+
* @var string
|
177 |
+
*/
|
178 |
+
public $option_register_post_types = 'wpglobus_option_register_post_types';
|
179 |
+
|
180 |
+
/**
|
181 |
+
* @var string
|
182 |
+
*/
|
183 |
+
public $css_editor = '';
|
184 |
+
|
185 |
+
/**
|
186 |
+
* @var string
|
187 |
+
*/
|
188 |
+
public $js_editor = '';
|
189 |
+
|
190 |
+
/**
|
191 |
+
* WPGlobus devmode.
|
192 |
+
* @var string
|
193 |
+
*/
|
194 |
+
public $toggle = 'on';
|
195 |
+
|
196 |
+
/**
|
197 |
+
* @todo Refactor this
|
198 |
+
* Duplicate var @see WPGlobus
|
199 |
+
* @var array
|
200 |
+
*/
|
201 |
+
public $disabled_entities = array();
|
202 |
+
|
203 |
+
/**
|
204 |
+
* WPGlobus extended options can be added via filter 'wpglobus_option_sections'
|
205 |
+
*
|
206 |
+
* @since 1.2.3
|
207 |
+
* @var array
|
208 |
+
*/
|
209 |
+
public $extended_options = array();
|
210 |
+
|
211 |
+
/**
|
212 |
+
* @var array
|
213 |
+
* @since 1.8.0
|
214 |
+
*/
|
215 |
+
public $browser_redirect;
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Used to temporarily store the language detected from the URL processed by oembed.
|
219 |
+
* @var string
|
220 |
+
* @since 1.8.4
|
221 |
+
*/
|
222 |
+
protected $language_for_oembed = '';
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Builder.
|
226 |
+
*
|
227 |
+
* @var WPGlobus_Config_Builder
|
228 |
+
* @since 1.9.17
|
229 |
+
*/
|
230 |
+
public $builder = null;
|
231 |
+
|
232 |
+
/**
|
233 |
+
* True if builder is disabled.
|
234 |
+
*
|
235 |
+
* @var boolean
|
236 |
+
* @since 1.9.17
|
237 |
+
*/
|
238 |
+
public $builder_disabled = true;
|
239 |
+
|
240 |
+
/**
|
241 |
+
* If '1', use the old style language switcher in Gutenberg. Set through the Options Panel.
|
242 |
+
*
|
243 |
+
* @var string
|
244 |
+
* @since 2.2.3
|
245 |
+
*/
|
246 |
+
public $block_editor_old_fashioned_language_switcher = '';
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Type of switcher button for WPGlobusSwitcherPlugin.
|
250 |
+
*
|
251 |
+
* @var string
|
252 |
+
* @since 2.2.14
|
253 |
+
*/
|
254 |
+
public $block_editor_switcher_plugin_button_type = '';
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Language- and region-specific hreflang.
|
258 |
+
*
|
259 |
+
* @var string
|
260 |
+
* @since 2.3.4
|
261 |
+
*/
|
262 |
+
public $seo_hreflang_type = 'zz-ZZ';
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Language- and region-specific hreflang for default language.
|
266 |
+
*
|
267 |
+
* @var string
|
268 |
+
* @since 2.3.4
|
269 |
+
*/
|
270 |
+
public $seo_hreflang_default_language_type = false;
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Can get it only once.
|
274 |
+
*
|
275 |
+
* @since 1.8.4
|
276 |
+
* @return string
|
277 |
+
*/
|
278 |
+
public function getAndResetLanguageForOembed() {
|
279 |
+
$to_return = $this->language_for_oembed;
|
280 |
+
$this->language_for_oembed = '';
|
281 |
+
|
282 |
+
return $to_return;
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Setter.
|
287 |
+
* @param string $language_for_oembed
|
288 |
+
* @since 1.8.4
|
289 |
+
*/
|
290 |
+
public function setLanguageForOembed( $language_for_oembed ) {
|
291 |
+
$this->language_for_oembed = $language_for_oembed;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Constructor.
|
296 |
+
*/
|
297 |
+
public function __construct() {
|
298 |
+
|
299 |
+
/**
|
300 |
+
* @since 1.0.9 Hooked to 'plugins_loaded'. The 'init' is too late, because it happens after all plugins already loaded their translations.
|
301 |
+
* @since 2.5.17 Change the priority for compatibility with `woocommerce-pdf-invoices-italian-add-on`,
|
302 |
+
* it seems that calling init_current_language() in plugin_loaded hook with priority 0 is too late, with -1 it works fine.
|
303 |
+
*/
|
304 |
+
add_action( 'plugins_loaded', array(
|
305 |
+
$this,
|
306 |
+
'init_current_language'
|
307 |
+
), -1 );
|
308 |
+
|
309 |
+
add_action( 'plugins_loaded', array(
|
310 |
+
$this,
|
311 |
+
'on_load_textdomain'
|
312 |
+
), 1 );
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Sets the current language and switches the translations according to the given locale.
|
316 |
+
*
|
317 |
+
* @param string $locale The locale to switch to.
|
318 |
+
*
|
319 |
+
* @since 1.9.14
|
320 |
+
*/
|
321 |
+
add_action( 'switch_locale', array( $this, 'on_switch_locale' ), - PHP_INT_MAX );
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Sets the current language and switches the translations according to the given locale.
|
325 |
+
*
|
326 |
+
* @param string $locale The locale to switch to.
|
327 |
+
*
|
328 |
+
* @since 1.9.14
|
329 |
+
*/
|
330 |
+
add_action( 'restore_previous_locale', array( $this, 'on_switch_locale' ), - PHP_INT_MAX );
|
331 |
+
|
332 |
+
add_action( 'upgrader_process_complete', array( $this, 'on_activate' ), 10, 2 );
|
333 |
+
|
334 |
+
|
335 |
+
$this->_get_options();
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Sets the current language and switches the translations according to the given locale.
|
340 |
+
*
|
341 |
+
* @param string $locale The locale to switch to.
|
342 |
+
*
|
343 |
+
* @since 1.9.14
|
344 |
+
*/
|
345 |
+
public function on_switch_locale( $locale ) {
|
346 |
+
$this->set_language( $locale );
|
347 |
+
$this->on_load_textdomain();
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Set the current language: if not found in the URL or REFERER, then keep the default
|
352 |
+
* @since 1.1.1
|
353 |
+
*/
|
354 |
+
public function init_current_language() {
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Keep the default language if any of the code before does not detect another one.
|
358 |
+
*/
|
359 |
+
$this->language = $this->default_language;
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Theoretically, we might not have any URL to get the language info from.
|
363 |
+
*/
|
364 |
+
$url_to_check = '';
|
365 |
+
|
366 |
+
if ( WPGlobus_WP::is_doing_ajax() ) {
|
367 |
+
/**
|
368 |
+
* If DOING_AJAX, we cannot retrieve the language information from the URL,
|
369 |
+
* because it's always `admin-ajax`.
|
370 |
+
* Therefore, we'll rely on the HTTP_REFERER (if it exists).
|
371 |
+
*/
|
372 |
+
if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) { // WPCS: input var ok, sanitization ok.
|
373 |
+
$url_to_check = $_SERVER['HTTP_REFERER']; // WPCS: input var ok, sanitization ok.
|
374 |
+
}
|
375 |
+
} else {
|
376 |
+
/**
|
377 |
+
* If not AJAX and not ADMIN then we are at the front. Will use the current URL.
|
378 |
+
*/
|
379 |
+
if ( ! is_admin() ) {
|
380 |
+
$url_to_check = WPGlobus_Utils::current_url();
|
381 |
+
}
|
382 |
+
}
|
383 |
+
|
384 |
+
/**
|
385 |
+
* If we have an URL, extract language from it.
|
386 |
+
* If extracted, set it as a current.
|
387 |
+
*/
|
388 |
+
if ( $url_to_check ) {
|
389 |
+
$language_from_url = WPGlobus_Utils::extract_language_from_url( $url_to_check );
|
390 |
+
if ( $language_from_url ) {
|
391 |
+
$this->language = $language_from_url;
|
392 |
+
}
|
393 |
+
/**
|
394 |
+
* @since 1.9.17
|
395 |
+
* Set language for builder.
|
396 |
+
* For compatibility we set language here for front-end only.
|
397 |
+
* As for the setting in admin @see wpglobus\includes\builders\class-wpglobus-config-builder.php
|
398 |
+
*/
|
399 |
+
if ( $this->builder && ! is_admin() ) {
|
400 |
+
/**
|
401 |
+
* We can work with Gutenberg that was defined as front-end but we should set 'language' for real front-end without builder.
|
402 |
+
* Any builder may have behavior like Gutenberg.
|
403 |
+
* @todo check each builder that WPGlobus will be support.
|
404 |
+
*/
|
405 |
+
if ( ! $this->builder->is_builder_page() ) {
|
406 |
+
$this->builder->set_language($this->language);
|
407 |
+
}
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
}
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Check plugin version and update versioning option
|
415 |
+
*
|
416 |
+
* @param stdClass $object Plugin_Upgrader
|
417 |
+
* @param array $options
|
418 |
+
*
|
419 |
+
* @return void
|
420 |
+
*/
|
421 |
+
public function on_activate(
|
422 |
+
/** @noinspection PhpUnusedParameterInspection */
|
423 |
+
$object = null,
|
424 |
+
$options = array()
|
425 |
+
) {
|
426 |
+
|
427 |
+
if (
|
428 |
+
empty( $options['plugin'] ) or $options['plugin'] !== WPGLOBUS_PLUGIN_BASENAME or
|
429 |
+
empty( $options['action'] ) or $options['action'] !== 'update'
|
430 |
+
) {
|
431 |
+
/**
|
432 |
+
* Not our business
|
433 |
+
*/
|
434 |
+
return;
|
435 |
+
}
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Here we can read the previous version value and do some actions if necessary.
|
439 |
+
* For example, warn the users about breaking changes.
|
440 |
+
* $version = get_option( self::$option_versioning );
|
441 |
+
* ...
|
442 |
+
*/
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Store the current version
|
446 |
+
*/
|
447 |
+
update_option( self::$option_versioning, array(
|
448 |
+
'current_version' => WPGLOBUS_VERSION
|
449 |
+
) );
|
450 |
+
|
451 |
+
}
|
452 |
+
|
453 |
+
/**
|
454 |
+
* Set the current language to match the given locale.
|
455 |
+
*
|
456 |
+
* @since 1.9.14 : If we do not know such locale, set to default.
|
457 |
+
*
|
458 |
+
* @param string $locale The locale ('en_US', 'fr_FR', etc.).
|
459 |
+
*/
|
460 |
+
public function set_language( $locale ) {
|
461 |
+
|
462 |
+
$locale_to_language = array_flip( $this->locale );
|
463 |
+
|
464 |
+
$this->language = empty( $locale_to_language[ $locale ] )
|
465 |
+
? $this->default_language
|
466 |
+
: $locale_to_language[ $locale ];
|
467 |
+
}
|
468 |
+
|
469 |
+
/**
|
470 |
+
* Check for enabled locale
|
471 |
+
* @since 1.0.10
|
472 |
+
*
|
473 |
+
* @param string $locale
|
474 |
+
*
|
475 |
+
* @return boolean
|
476 |
+
*/
|
477 |
+
public function is_enabled_locale( $locale ) {
|
478 |
+
return in_array( $locale, $this->enabled_locale, true );
|
479 |
+
}
|
480 |
+
|
481 |
+
/**
|
482 |
+
* Load textdomain
|
483 |
+
* @since 1.0.0
|
484 |
+
* @return void
|
485 |
+
*/
|
486 |
+
public function on_load_textdomain() {
|
487 |
+
self::load_mofile();
|
488 |
+
|
489 |
+
/**
|
490 |
+
* Can use this action to load additional translations.
|
491 |
+
*
|
492 |
+
* @since 1.9.14
|
493 |
+
*/
|
494 |
+
do_action( 'wpglobus_after_load_textdomain' );
|
495 |
+
}
|
496 |
+
|
497 |
+
/**
|
498 |
+
* Load .MO file from the plugin's `languages` folder.
|
499 |
+
* Used instead of @see load_plugin_textdomain to ignore translation files from WordPress.org, which are outdated.
|
500 |
+
* To force loading from a different place, use the `load_textdomain_mofile` filter.
|
501 |
+
*
|
502 |
+
* @since 1.9.6
|
503 |
+
*/
|
504 |
+
protected function load_mofile() {
|
505 |
+
$domain = 'wpglobus';
|
506 |
+
|
507 |
+
/**
|
508 |
+
* Delete translations that could be loaded already from the main /languages/ folder.
|
509 |
+
*
|
510 |
+
* @since 1.9.10
|
511 |
+
*/
|
512 |
+
unload_textdomain( $domain );
|
513 |
+
|
514 |
+
/**
|
515 |
+
* Load our translations.
|
516 |
+
*/
|
517 |
+
$locale = apply_filters( 'plugin_locale', is_admin() ? get_user_locale() : get_locale(), $domain );
|
518 |
+
$mofile = WPGlobus::languages_path() . '/' . $domain . '-' . $locale . '.mo';
|
519 |
+
load_textdomain( $domain, $mofile );
|
520 |
+
}
|
521 |
+
|
522 |
+
/**
|
523 |
+
* Set flags URL.
|
524 |
+
* @return void
|
525 |
+
*/
|
526 |
+
public function _set_flags_url() {
|
527 |
+
$this->flags_url = WPGlobus::$PLUGIN_DIR_URL . 'flags/';
|
528 |
+
/**
|
529 |
+
* @since 1.9.17
|
530 |
+
*/
|
531 |
+
$this->flag_urls['small'] = WPGlobus::$PLUGIN_DIR_URL . 'flags/';
|
532 |
+
$this->flag_urls['big'] = WPGlobus::$PLUGIN_DIR_URL . 'flags/big/';
|
533 |
+
}
|
534 |
+
|
535 |
+
/**
|
536 |
+
* Set flag PATH.
|
537 |
+
* @return void
|
538 |
+
*/
|
539 |
+
public function _set_flag_path() {
|
540 |
+
$this->flag_path['small'] = WPGlobus::$PLUGIN_DIR_PATH . 'flags/';
|
541 |
+
$this->flag_path['big'] = WPGlobus::$PLUGIN_DIR_PATH . 'flags/big/';
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Set languages by default.
|
546 |
+
*/
|
547 |
+
public function _set_languages() {
|
548 |
+
|
549 |
+
/**
|
550 |
+
* Names, flags and locales
|
551 |
+
* Useful links
|
552 |
+
* - languages in ISO 639-1 format http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
|
553 |
+
* - regions http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
554 |
+
* - WordPress locales https://make.wordpress.org/polyglots/teams/
|
555 |
+
* - converter https://www.unicodetools.com/unicode/convert-to-html.php
|
556 |
+
*/
|
557 |
+
|
558 |
+
/* @noinspection SpellCheckingInspection */
|
559 |
+
$language_table = array(
|
560 |
+
// Prefix => Name, Native name, locale, flag.
|
561 |
+
'ar' => array( 'Arabic', 'العربية', 'ar', 'arle.png' ),
|
562 |
+
'en' => array( 'English', 'English', 'en_US', 'us.png' ),
|
563 |
+
'au' => array( 'English (AU)', 'English (AU)', 'en_AU', 'au.png' ),
|
564 |
+
'ca' => array( 'English (CA)', 'English (CA)', 'en_CA', 'ca.png' ),
|
565 |
+
'gb' => array( 'English (UK)', 'English (UK)', 'en_GB', 'uk.png' ),
|
566 |
+
'zh' => array( 'Chinese', '简体中文', 'zh_CN', 'cn.png' ),
|
567 |
+
'tw' => array( 'Chinese (TW)', '繁體中文', 'zh_TW', 'mm.png' ),
|
568 |
+
'da' => array( 'Danish', 'Dansk', 'da_DK', 'dk.png' ),
|
569 |
+
'nl' => array( 'Dutch', 'Nederlands', 'nl_NL', 'nl.png' ),
|
570 |
+
'gl' => array( 'Galician', 'Galego', 'gl_ES', 'galego.png' ),
|
571 |
+
'de' => array( 'German', 'Deutsch', 'de_DE', 'de.png' ),
|
572 |
+
'fi' => array( 'Finnish', 'Suomi', 'fi', 'fi.png' ),
|
573 |
+
'fr' => array( 'French', 'Français', 'fr_FR', 'fr.png' ),
|
574 |
+
'qc' => array( 'French (CA)', 'Français (CA)', 'fr_CA', 'fr_CA.png' ),
|
575 |
+
'he' => array( 'Hebrew', 'עברית', 'he_IL', 'il.png' ),
|
576 |
+
'hi' => array( 'Hindi', 'हिन्दी', 'hi_IN', 'in.png' ),
|
577 |
+
'hu' => array( 'Hungarian', 'Magyar', 'hu_HU', 'hu.png' ),
|
578 |
+
'it' => array( 'Italian', 'Italiano', 'it_IT', 'it.png' ),
|
579 |
+
'ja' => array( 'Japanese', '日本語', 'ja', 'jp.png' ),
|
580 |
+
'ko' => array( 'Korean', '한국어', 'ko_KR', 'kr.png' ),
|
581 |
+
'no' => array( 'Norwegian', 'Norsk', 'nb_NO', 'no.png' ),
|
582 |
+
'fa' => array( 'Persian', 'فارسی', 'fa_IR', 'ir.png' ),
|
583 |
+
'pl' => array( 'Polish', 'Polski', 'pl_PL', 'pl.png' ),
|
584 |
+
'pt' => array( 'Portuguese', 'Português', 'pt_PT', 'pt.png' ),
|
585 |
+
'br' => array( 'Portuguese (BR)', 'Português (BR)', 'pt_BR', 'br.png' ),
|
586 |
+
'ro' => array( 'Romanian', 'Română', 'ro_RO', 'ro.png' ),
|
587 |
+
'ru' => array( 'Russian', 'Русский', 'ru_RU', 'ru.png' ),
|
588 |
+
'es' => array( 'Spanish', 'Español', 'es_ES', 'es.png' ),
|
589 |
+
'mx' => array( 'Spanish (MX)', 'Español (MX)', 'es_MX', 'mx.png' ),
|
590 |
+
'sv' => array( 'Swedish', 'Svenska', 'sv_SE', 'se.png' ),
|
591 |
+
'tr' => array( 'Turkish', 'Türkçe', 'tr_TR', 'tr.png' ),
|
592 |
+
'uk' => array( 'Ukrainian', 'Українська', 'uk', 'ua.png' ),
|
593 |
+
'vi' => array( 'Vietnamese', 'Tiếng Việt', 'vi', 'vn.png' ),
|
594 |
+
'cy' => array( 'Welsh', 'Cymraeg', 'cy', 'cy.png' ),
|
595 |
+
'ka' => array( 'Georgian', 'ქართული', 'ka_GE', 'ka.png' ),
|
596 |
+
);
|
597 |
+
|
598 |
+
foreach ( $language_table as $language => $data ) {
|
599 |
+
list(
|
600 |
+
$this->en_language_name[ $language ],
|
601 |
+
$this->language_name[ $language ],
|
602 |
+
$this->locale[ $language ],
|
603 |
+
$this->flag[ $language ]
|
604 |
+
) = $data;
|
605 |
+
}
|
606 |
+
|
607 |
+
}
|
608 |
+
|
609 |
+
/**
|
610 |
+
* Initialize the language table with the hard-coded names, locales and flags.
|
611 |
+
*
|
612 |
+
* @see _set_languages For the hard-coded table.
|
613 |
+
*/
|
614 |
+
protected function _init_language_table() {
|
615 |
+
|
616 |
+
update_option( $this->option_language_names, $this->language_name );
|
617 |
+
update_option( $this->option_en_language_names, $this->en_language_name );
|
618 |
+
update_option( $this->option_locale, $this->locale );
|
619 |
+
update_option( $this->option_flags, $this->flag );
|
620 |
+
|
621 |
+
}
|
622 |
+
|
623 |
+
/**
|
624 |
+
* Get options from DB and wp-config.php
|
625 |
+
* @return void
|
626 |
+
*/
|
627 |
+
protected function _get_options() {
|
628 |
+
|
629 |
+
/**
|
630 |
+
* For developers use only. Re-creates language table with no warning! Irreversible!
|
631 |
+
*
|
632 |
+
* @link wp-admin/?wpglobus-reset-language-table=1
|
633 |
+
*/
|
634 |
+
if ( ! defined( 'DOING_AJAX' ) && ! empty( $_GET['wpglobus-reset-language-table'] ) && is_admin() ) { // WPCS: input var ok, sanitization ok.
|
635 |
+
delete_option( $this->option_language_names );
|
636 |
+
}
|
637 |
+
|
638 |
+
|
639 |
+
$wpglobus_option = get_option( $this->option );
|
640 |
+
|
641 |
+
/**
|
642 |
+
* Get enabled languages and default language ( just one main language )
|
643 |
+
*/
|
644 |
+
if ( isset( $wpglobus_option['enabled_languages'] ) && ! empty( $wpglobus_option['enabled_languages'] ) ) {
|
645 |
+
$this->enabled_languages = array();
|
646 |
+
foreach ( $wpglobus_option['enabled_languages'] as $lang => $value ) {
|
647 |
+
if ( ! empty( $value ) ) {
|
648 |
+
$this->enabled_languages[] = $lang;
|
649 |
+
}
|
650 |
+
}
|
651 |
+
|
652 |
+
/**
|
653 |
+
* Set default language
|
654 |
+
*/
|
655 |
+
$this->default_language = $this->enabled_languages[0];
|
656 |
+
|
657 |
+
unset( $wpglobus_option['enabled_languages'] );
|
658 |
+
}
|
659 |
+
|
660 |
+
/**
|
661 |
+
* Set available languages for editors
|
662 |
+
*/
|
663 |
+
$this->open_languages = $this->enabled_languages;
|
664 |
+
|
665 |
+
/**
|
666 |
+
* Set flags URL
|
667 |
+
*/
|
668 |
+
$this->_set_flags_url();
|
669 |
+
|
670 |
+
/**
|
671 |
+
* Set flags PATH.
|
672 |
+
*/
|
673 |
+
$this->_set_flag_path();
|
674 |
+
|
675 |
+
/**
|
676 |
+
* Get languages name
|
677 |
+
* big array of used languages
|
678 |
+
*/
|
679 |
+
$this->language_name = get_option( $this->option_language_names );
|
680 |
+
|
681 |
+
if ( empty( $this->language_name ) ) {
|
682 |
+
|
683 |
+
$this->_set_languages();
|
684 |
+
$this->_init_language_table();
|
685 |
+
|
686 |
+
}
|
687 |
+
|
688 |
+
/**
|
689 |
+
* Get locales
|
690 |
+
*/
|
691 |
+
$this->locale = get_option( $this->option_locale );
|
692 |
+
if ( empty( $this->locale ) ) {
|
693 |
+
|
694 |
+
$this->_set_languages();
|
695 |
+
$this->_init_language_table();
|
696 |
+
|
697 |
+
}
|
698 |
+
|
699 |
+
/**
|
700 |
+
* Get enabled locales
|
701 |
+
*/
|
702 |
+
foreach ( $this->enabled_languages as $language ) {
|
703 |
+
$this->enabled_locale[] = $this->locale[ $language ];
|
704 |
+
}
|
705 |
+
|
706 |
+
/**
|
707 |
+
* Get en_language_name
|
708 |
+
*/
|
709 |
+
$this->en_language_name = get_option( $this->option_en_language_names );
|
710 |
+
|
711 |
+
/**
|
712 |
+
* Get option 'show_flag_name'
|
713 |
+
*/
|
714 |
+
if ( isset( $wpglobus_option['show_flag_name'] ) ) {
|
715 |
+
$this->show_flag_name = $wpglobus_option['show_flag_name'];
|
716 |
+
unset( $wpglobus_option['show_flag_name'] );
|
717 |
+
}
|
718 |
+
if ( defined( 'WPGLOBUS_SHOW_FLAG_NAME' ) ) {
|
719 |
+
if ( 'name' === WPGLOBUS_SHOW_FLAG_NAME ) {
|
720 |
+
$this->show_flag_name = 'name';
|
721 |
+
} elseif ( false === WPGLOBUS_SHOW_FLAG_NAME || '' === WPGLOBUS_SHOW_FLAG_NAME ) {
|
722 |
+
$this->show_flag_name = '';
|
723 |
+
}
|
724 |
+
}
|
725 |
+
|
726 |
+
/**
|
727 |
+
* Get navigation menu slug for add flag in front-end 'use_nav_menu'.
|
728 |
+
*/
|
729 |
+
$this->nav_menu = '';
|
730 |
+
|
731 |
+
if ( isset( $wpglobus_option['use_nav_menu'] ) ) {
|
732 |
+
if ( '--none--' != $wpglobus_option['use_nav_menu'] ) {
|
733 |
+
$this->nav_menu = $wpglobus_option['use_nav_menu'];
|
734 |
+
}
|
735 |
+
unset( $wpglobus_option['use_nav_menu'] );
|
736 |
+
}
|
737 |
+
|
738 |
+
// This can be used in `wp-config` to override the options settings.
|
739 |
+
if ( defined( 'WPGLOBUS_USE_NAV_MENU' ) ) {
|
740 |
+
$this->nav_menu = WPGLOBUS_USE_NAV_MENU;
|
741 |
+
}
|
742 |
+
|
743 |
+
|
744 |
+
/**
|
745 |
+
* Get selector_wp_list_pages option
|
746 |
+
* @since 1.0.7
|
747 |
+
*/
|
748 |
+
if ( empty( $wpglobus_option['selector_wp_list_pages']['show_selector'] ) ||
|
749 |
+
(int) $wpglobus_option['selector_wp_list_pages']['show_selector'] === 0
|
750 |
+
) {
|
751 |
+
$this->selector_wp_list_pages = false;
|
752 |
+
}
|
753 |
+
if ( isset( $wpglobus_option['selector_wp_list_pages'] ) ) {
|
754 |
+
unset( $wpglobus_option['selector_wp_list_pages'] );
|
755 |
+
}
|
756 |
+
|
757 |
+
/**
|
758 |
+
* Get custom CSS
|
759 |
+
*/
|
760 |
+
if ( isset( $wpglobus_option['css_editor'] ) ) {
|
761 |
+
$this->css_editor = $wpglobus_option['css_editor'];
|
762 |
+
unset( $wpglobus_option['css_editor'] );
|
763 |
+
}
|
764 |
+
|
765 |
+
/**
|
766 |
+
* Get custom JS.
|
767 |
+
* @since 1.7.6
|
768 |
+
*/
|
769 |
+
if ( isset( $wpglobus_option['js_editor'] ) ) {
|
770 |
+
$this->js_editor = $wpglobus_option['js_editor'];
|
771 |
+
unset( $wpglobus_option['js_editor'] );
|
772 |
+
}
|
773 |
+
|
774 |
+
/**
|
775 |
+
* Old fashioned language switcher for Block Editor (Gutenberg).
|
776 |
+
* @since 2.2.3
|
777 |
+
*/
|
778 |
+
if ( isset( $wpglobus_option['block_editor_old_fashioned_language_switcher'] ) ) {
|
779 |
+
$this->block_editor_old_fashioned_language_switcher = $wpglobus_option['block_editor_old_fashioned_language_switcher'];
|
780 |
+
unset( $wpglobus_option['block_editor_old_fashioned_language_switcher'] );
|
781 |
+
}
|
782 |
+
|
783 |
+
/**
|
784 |
+
* Type of switcher button for WPGlobusSwitcherPlugin (Gutenberg).
|
785 |
+
* @since 2.2.14
|
786 |
+
*/
|
787 |
+
if ( isset( $wpglobus_option['block_editor_switcher_plugin_button_type'] ) ) {
|
788 |
+
$this->block_editor_switcher_plugin_button_type = $wpglobus_option['block_editor_switcher_plugin_button_type'];
|
789 |
+
unset( $wpglobus_option['block_editor_switcher_plugin_button_type'] );
|
790 |
+
}
|
791 |
+
|
792 |
+
/**
|
793 |
+
* Type of hreflang tag. Language- and region-specific hreflang.
|
794 |
+
* @since 2.3.4
|
795 |
+
*/
|
796 |
+
if ( isset( $wpglobus_option['seo_hreflang_type'] ) ) {
|
797 |
+
$this->seo_hreflang_type = $wpglobus_option['seo_hreflang_type'];
|
798 |
+
unset( $wpglobus_option['seo_hreflang_type'] );
|
799 |
+
}
|
800 |
+
|
801 |
+
/**
|
802 |
+
* Type of hreflang tag for default language. Language- and region-specific hreflang for default language.
|
803 |
+
* @since 2.3.4
|
804 |
+
*/
|
805 |
+
if ( isset( $wpglobus_option['seo_hreflang_default_language_type'] ) ) {
|
806 |
+
$this->seo_hreflang_default_language_type = $wpglobus_option['seo_hreflang_default_language_type'];
|
807 |
+
unset( $wpglobus_option['seo_hreflang_default_language_type'] );
|
808 |
+
}
|
809 |
+
|
810 |
+
/**
|
811 |
+
* Get flag files without path
|
812 |
+
*/
|
813 |
+
$option = get_option( $this->option_flags );
|
814 |
+
if ( ! empty( $option ) ) {
|
815 |
+
$this->flag = $option;
|
816 |
+
}
|
817 |
+
|
818 |
+
/**
|
819 |
+
* Get versioning info
|
820 |
+
*/
|
821 |
+
$option = get_option( self::$option_versioning );
|
822 |
+
if ( empty( $option ) ) {
|
823 |
+
$this->version = array();
|
824 |
+
} else {
|
825 |
+
$this->version = $option;
|
826 |
+
}
|
827 |
+
|
828 |
+
/**
|
829 |
+
* WPGlobus devmode.
|
830 |
+
*/
|
831 |
+
if ( isset( $_GET['wpglobus'] ) && 'off' === $_GET['wpglobus'] ) { // WPCS: input var ok, sanitization ok.
|
832 |
+
$this->toggle = 'off';
|
833 |
+
} else {
|
834 |
+
$this->toggle = 'on';
|
835 |
+
}
|
836 |
+
|
837 |
+
/**
|
838 |
+
* Need additional check for devmode (toggle=OFF)
|
839 |
+
* in case 'wpglobus' was not set to 'off' at /wp-admin/post.php
|
840 |
+
* and $_SERVER[QUERY_STRING] is empty at the time of `wp_insert_post_data` action
|
841 |
+
* @see WPGlobus::on_save_post_data
|
842 |
+
*/
|
843 |
+
if (
|
844 |
+
empty( $_SERVER['QUERY_STRING'] ) // WPCS: input var ok, sanitization ok.
|
845 |
+
&& isset( $_SERVER['HTTP_REFERER'] ) // WPCS: input var ok, sanitization ok.
|
846 |
+
&& WPGlobus_WP::is_pagenow( 'post.php' )
|
847 |
+
&& false !== strpos( $_SERVER['HTTP_REFERER'], 'wpglobus=off' ) // WPCS: input var ok, sanitization ok.
|
848 |
+
) {
|
849 |
+
$this->toggle = 'off';
|
850 |
+
}
|
851 |
+
|
852 |
+
if ( isset( $wpglobus_option['last_tab'] ) ) {
|
853 |
+
unset( $wpglobus_option['last_tab'] );
|
854 |
+
}
|
855 |
+
|
856 |
+
/**
|
857 |
+
* Builders.
|
858 |
+
* @since 1.9.17
|
859 |
+
*/
|
860 |
+
if ( isset( $wpglobus_option['builder_disabled'] ) && 1 === (int) $wpglobus_option['builder_disabled'] ) {
|
861 |
+
|
862 |
+
require_once dirname( __FILE__ ).'/builders/class-wpglobus-config-builder.php' ;
|
863 |
+
$this->builder = new WPGlobus_Config_Builder(false);
|
864 |
+
|
865 |
+
$this->builder_disabled = true;
|
866 |
+
unset( $wpglobus_option['builder_disabled'] );
|
867 |
+
|
868 |
+
} else {
|
869 |
+
|
870 |
+
$this->builder_disabled = false;
|
871 |
+
|
872 |
+
/**
|
873 |
+
* @since 2.2.11
|
874 |
+
*/
|
875 |
+
if ( empty( $wpglobus_option['builder_post_types'] ) ) {
|
876 |
+
$builder_post_types = array();
|
877 |
+
} else {
|
878 |
+
$builder_post_types = $wpglobus_option['builder_post_types'];
|
879 |
+
unset( $wpglobus_option['builder_post_types'] );
|
880 |
+
}
|
881 |
+
|
882 |
+
/**
|
883 |
+
* Init post types settings.
|
884 |
+
*
|
885 |
+
* @since 2.2.11
|
886 |
+
*/
|
887 |
+
$builder_default_post_types = array(
|
888 |
+
'post' => true,
|
889 |
+
'page' => true,
|
890 |
+
'attachment' => false
|
891 |
+
);
|
892 |
+
|
893 |
+
/** $wpglobus_option['post_type'] contains disabled post types. */
|
894 |
+
if ( empty( $wpglobus_option['post_type'] ) ) {
|
895 |
+
$post_types_disabled = array();
|
896 |
+
} else {
|
897 |
+
$post_types_disabled = array_intersect_key($builder_default_post_types, $wpglobus_option['post_type']);
|
898 |
+
}
|
899 |
+
|
900 |
+
if ( ! empty( $post_types_disabled ) ) {
|
901 |
+
foreach( $post_types_disabled as $_post_type=>$status ) {
|
902 |
+
if ( array_key_exists($_post_type, $builder_default_post_types) ) {
|
903 |
+
$builder_default_post_types[$_post_type] = false;
|
904 |
+
}
|
905 |
+
}
|
906 |
+
}
|
907 |
+
|
908 |
+
if ( empty($builder_post_types) ) {
|
909 |
+
$builder_post_types = $builder_default_post_types;
|
910 |
+
} else {
|
911 |
+
$builder_post_types = array_merge( $builder_default_post_types, $builder_post_types );
|
912 |
+
}
|
913 |
+
|
914 |
+
require_once dirname( __FILE__ ).'/builders/class-wpglobus-config-builder.php' ;
|
915 |
+
$this->builder = new WPGlobus_Config_Builder(
|
916 |
+
true,
|
917 |
+
array(
|
918 |
+
'default_language' => $this->default_language,
|
919 |
+
'post_types' => $builder_post_types,
|
920 |
+
'options' => array(
|
921 |
+
'register_post_types' => $this->option_register_post_types, // @since 2.2.24
|
922 |
+
)
|
923 |
+
)
|
924 |
+
);
|
925 |
+
|
926 |
+
if ( is_admin() ) {
|
927 |
+
|
928 |
+
require_once dirname( __FILE__ ) . '/class-wpglobus-config-vendor.php';
|
929 |
+
$config_vendor = WPGlobus_Config_Vendor::get_instance( $this->builder );
|
930 |
+
|
931 |
+
require_once dirname( __FILE__ ).'/admin/meta/class-wpglobus-meta.php' ;
|
932 |
+
WPGlobus_Meta::get_instance( $config_vendor::get_meta_fields(), $this->builder );
|
933 |
+
$this->meta = $config_vendor::get_meta_fields();
|
934 |
+
|
935 |
+
require_once dirname( __FILE__ ).'/wp_options/class-wpglobus-wp_options.php' ;
|
936 |
+
WPGlobus_WP_Options::get_instance( $config_vendor::get_wp_options() );
|
937 |
+
|
938 |
+
$this->builder->set_multilingual_fields($config_vendor::get_ml_fields());
|
939 |
+
}
|
940 |
+
}
|
941 |
+
|
942 |
+
/**
|
943 |
+
* @since 2.2.11
|
944 |
+
*/
|
945 |
+
if ( isset( $wpglobus_option['post_type'] ) ) {
|
946 |
+
unset( $wpglobus_option['post_type'] );
|
947 |
+
}
|
948 |
+
|
949 |
+
/**
|
950 |
+
* Remaining wpglobus options after unset() is extended options
|
951 |
+
* @since 1.2.3
|
952 |
+
*/
|
953 |
+
$this->extended_options = $wpglobus_option;
|
954 |
+
|
955 |
+
/**
|
956 |
+
* Option browser_redirect.
|
957 |
+
* @since 1.8.0
|
958 |
+
*/
|
959 |
+
if ( isset( $wpglobus_option['browser_redirect'] ) ) {
|
960 |
+
$this->browser_redirect = $wpglobus_option['browser_redirect'];
|
961 |
+
unset( $wpglobus_option['browser_redirect'] );
|
962 |
+
}
|
963 |
+
}
|
964 |
+
|
965 |
+
} //class
|
966 |
+
|
967 |
+
# --- EOF
|
trunk/includes/class-wpglobus-core.php
ADDED
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-core.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPGlobus_Core
|
10 |
+
*/
|
11 |
+
class WPGlobus_Core {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The main filter function.
|
15 |
+
* Default behavior: extracts text in one language from multi-lingual strings.
|
16 |
+
*
|
17 |
+
* @param string $text Multilingual text, with special delimiters between languages
|
18 |
+
* @param string $language The code of the language to be extracted from the `$text`
|
19 |
+
* @param string $return What to do if the text in the `$language` was not found
|
20 |
+
* @param string $default_language Pass this if you want to return a non-default language content, when the content in `$language` is not available
|
21 |
+
*
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public static function text_filter(
|
25 |
+
$text = '',
|
26 |
+
$language = '',
|
27 |
+
$return = WPGlobus::RETURN_IN_DEFAULT_LANGUAGE,
|
28 |
+
$default_language = ''
|
29 |
+
) {
|
30 |
+
|
31 |
+
if ( empty( $text ) ) {
|
32 |
+
// Nothing to do
|
33 |
+
return $text;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* There are cases when numeric terms are passed here. We should not tamper with them.
|
38 |
+
*
|
39 |
+
* @since 1.0.8.1 Before, was returning empty string, which was incorrect.
|
40 |
+
*/
|
41 |
+
if ( ! is_string( $text ) ) {
|
42 |
+
return $text;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* `$default_language` not passed
|
47 |
+
*/
|
48 |
+
if ( ! $default_language ) {
|
49 |
+
if ( class_exists( 'WPGlobus_Config' ) ) {
|
50 |
+
$default_language = WPGlobus::Config()->default_language;
|
51 |
+
} else {
|
52 |
+
// When in unit tests
|
53 |
+
$default_language = 'en';
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* `$language` not passed
|
59 |
+
*/
|
60 |
+
if ( empty( $language ) ) {
|
61 |
+
$language = $default_language;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Fix for the case
|
66 |
+
* <!--:en-->ENG<!--:--><!--:ru-->RUS<!--:-->
|
67 |
+
*
|
68 |
+
* @since 2.5.17 Disabled. Breaks block editing and converts markup-as-text to actual markup.
|
69 |
+
* <code>
|
70 |
+
* // This `if` solves only the block editing. But we still have issues with viewing the post.
|
71 |
+
* if ( ! WPGlobus_WP::is_function_in_backtrace( array( 'WPGlobus_Gutenberg', 'translate_post' ) ) ) {
|
72 |
+
* $text = htmlspecialchars_decode( $text );
|
73 |
+
* }
|
74 |
+
* </code>
|
75 |
+
*/
|
76 |
+
|
77 |
+
$possible_delimiters =
|
78 |
+
array(
|
79 |
+
/**
|
80 |
+
* Our delimiters
|
81 |
+
*/
|
82 |
+
array(
|
83 |
+
'start' => sprintf( WPGlobus::LOCALE_TAG_START, $language ),
|
84 |
+
'end' => WPGlobus::LOCALE_TAG_END,
|
85 |
+
),
|
86 |
+
/**
|
87 |
+
* qTranslate compatibility
|
88 |
+
* qTranslate uses these two types of delimiters
|
89 |
+
*
|
90 |
+
* @example
|
91 |
+
* <!--:en-->English<!--:--><!--:ru-->Russian<!--:-->
|
92 |
+
* [:en]English S[:ru]Russian S
|
93 |
+
* The [] delimiter does not have the closing tag, so we will look for the next opening [: or
|
94 |
+
* take the rest until end of end of the string
|
95 |
+
*/
|
96 |
+
array(
|
97 |
+
'start' => "<!--:{$language}-->",
|
98 |
+
'end' => '<!--:-->',
|
99 |
+
),
|
100 |
+
/**
|
101 |
+
* Check for encoded version here instead of applying htmlspecialchars_decode().
|
102 |
+
*
|
103 |
+
* @since 2.5.17
|
104 |
+
*/
|
105 |
+
array(
|
106 |
+
'start' => "<!--:{$language}-->",
|
107 |
+
'end' => '<!--:-->',
|
108 |
+
),
|
109 |
+
array(
|
110 |
+
'start' => "[:{$language}]",
|
111 |
+
'end' => '[:',
|
112 |
+
),
|
113 |
+
);
|
114 |
+
|
115 |
+
/**
|
116 |
+
* We'll use this flag after the loop to see if the loop was successful. See the `break` clause in the loop.
|
117 |
+
*/
|
118 |
+
$is_local_text_found = false;
|
119 |
+
|
120 |
+
/**
|
121 |
+
* We do not know which delimiter was used, so we'll try both, in a loop
|
122 |
+
*/
|
123 |
+
/* @noinspection LoopWhichDoesNotLoopInspection */
|
124 |
+
foreach ( $possible_delimiters as $delimiters ) {
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Try the starting position. If not found, continue the loop to the next set of delimiters.
|
128 |
+
*/
|
129 |
+
$pos_start = strpos( $text, $delimiters['start'] );
|
130 |
+
if ( false === $pos_start ) {
|
131 |
+
continue;
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* The starting position found..adjust the pointer to the text start
|
136 |
+
* (Do not need mb_strlen here, because we expect delimiters to be Latin only)
|
137 |
+
*/
|
138 |
+
$pos_start += strlen( $delimiters['start'] );
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Try to find the ending position.
|
142 |
+
* If could not find, will extract the text until end of string.
|
143 |
+
*/
|
144 |
+
$pos_end = strpos( $text, $delimiters['end'], $pos_start );
|
145 |
+
if ( false === $pos_end ) {
|
146 |
+
// - Until end of string
|
147 |
+
$text = substr( $text, $pos_start );
|
148 |
+
} else {
|
149 |
+
$text = substr( $text, $pos_start, $pos_end - $pos_start );
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Set the "found" flag and end the loop.
|
154 |
+
*/
|
155 |
+
$is_local_text_found = true;
|
156 |
+
break;
|
157 |
+
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* If we could not find anything in the current language...
|
162 |
+
*/
|
163 |
+
if ( ! $is_local_text_found ) {
|
164 |
+
if ( WPGlobus::RETURN_EMPTY === $return ) {
|
165 |
+
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedIF
|
166 |
+
if ( $language === $default_language && ! self::has_translations( $text ) ) {
|
167 |
+
/**
|
168 |
+
* @todo Check the above condition. What if only one part is true?
|
169 |
+
* If text does not contain language delimiters nothing to do
|
170 |
+
*/
|
171 |
+
} else {
|
172 |
+
/** We are forced to return empty string. */
|
173 |
+
$text = '';
|
174 |
+
}
|
175 |
+
} else {
|
176 |
+
/**
|
177 |
+
* Try RETURN_IN_DEFAULT_LANGUAGE
|
178 |
+
*/
|
179 |
+
if ( $language === $default_language ) {
|
180 |
+
if ( self::has_translations( $text ) ) {
|
181 |
+
/**
|
182 |
+
* Rare case of text in default language doesn't exist
|
183 |
+
*
|
184 |
+
* @todo make option for return warning message or maybe another action
|
185 |
+
*/
|
186 |
+
$text = '';
|
187 |
+
}
|
188 |
+
} else {
|
189 |
+
/**
|
190 |
+
* Try the default language (recursion)
|
191 |
+
*
|
192 |
+
* @qa covered by the 'one_tag' case
|
193 |
+
* @see WPGlobus_QA::_test_string_parsing()
|
194 |
+
*/
|
195 |
+
$text = self::text_filter( $text, $default_language );
|
196 |
+
}
|
197 |
+
}
|
198 |
+
/** else - we do not change the input string, and it will be returned as-is */
|
199 |
+
}
|
200 |
+
|
201 |
+
return $text;
|
202 |
+
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Extract text from a string which is either:
|
207 |
+
* - in the requested language (could be multiple blocks)
|
208 |
+
* - or does not have the language marks
|
209 |
+
*
|
210 |
+
* @since 1.7.9
|
211 |
+
* @since 2.2.12 Fixed regex to support line breaks in strings.
|
212 |
+
*
|
213 |
+
* @param string $text Input text.
|
214 |
+
* @param string $language Language to extract. Default is the current language.
|
215 |
+
*
|
216 |
+
* @return string
|
217 |
+
* @example
|
218 |
+
* Input:
|
219 |
+
* '{:en}first_EN{:}{:ru}first_RU{:} blah-blah {:en}second_EN{:}{:ru}second_RU{:}'
|
220 |
+
* Language: en
|
221 |
+
* Output:
|
222 |
+
* 'first_EN blah-blah second_EN'
|
223 |
+
*
|
224 |
+
* @todo May fail on large texts because regex are used.
|
225 |
+
*
|
226 |
+
*/
|
227 |
+
public static function extract_text( $text = '', $language = '' ) {
|
228 |
+
if ( ! $text || ! is_string( $text ) ) {
|
229 |
+
return $text;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* `$language` not passed
|
234 |
+
*/
|
235 |
+
if ( ! $language ) {
|
236 |
+
// When in unit tests.
|
237 |
+
$language = 'en';
|
238 |
+
// Normally.
|
239 |
+
if ( class_exists( 'WPGlobus_Config', false ) ) {
|
240 |
+
$language = WPGlobus::Config()->language;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
// Pass 1. Remove the language marks surrounding the language we need.
|
245 |
+
// Pass 2. Remove the texts surrounded with other language marks, together with the marks.
|
246 |
+
return preg_replace(
|
247 |
+
array( '/{:' . $language . '}([\S\s]+?){:}/m', '/{:.+?}[\S\s]+?{:}/m' ),
|
248 |
+
array( '\\1', '' ),
|
249 |
+
$text
|
250 |
+
);
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Check if string has language delimiters
|
255 |
+
*
|
256 |
+
* @param string $string
|
257 |
+
*
|
258 |
+
* @return bool
|
259 |
+
*/
|
260 |
+
public static function has_translations( $string ) {
|
261 |
+
|
262 |
+
/**
|
263 |
+
* This should detect majority of the strings with our delimiters without calling preg_match
|
264 |
+
*
|
265 |
+
* @var int $pos_start
|
266 |
+
*/
|
267 |
+
$pos_start = strpos( $string, WPGlobus::LOCALE_TAG_OPEN );
|
268 |
+
if ( false !== $pos_start ) {
|
269 |
+
if ( ctype_lower( $string[ $pos_start + 2 ] ) && ctype_lower( $string[ $pos_start + 3 ] ) ) {
|
270 |
+
return true;
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* For compatibility, etc. - the universal procedure with regexp
|
276 |
+
*/
|
277 |
+
|
278 |
+
return (bool) preg_match( '/(\{:|\[:|<!--:)[a-z]{2}/', $string );
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* True if language code is a string of two [a-z] characters.
|
283 |
+
*
|
284 |
+
* @since 2.5.6
|
285 |
+
*
|
286 |
+
* @param string $language The language code.
|
287 |
+
*
|
288 |
+
* @return bool
|
289 |
+
*/
|
290 |
+
public static function is_language_code_valid( $language ) {
|
291 |
+
if (
|
292 |
+
is_string( $language )
|
293 |
+
&& 2 === strlen( $language )
|
294 |
+
&& ctype_lower( $language )
|
295 |
+
) {
|
296 |
+
return true;
|
297 |
+
}
|
298 |
+
|
299 |
+
return false;
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Check if string has language delimiters for the given language.
|
304 |
+
*
|
305 |
+
* @since 2.5.6
|
306 |
+
*
|
307 |
+
* @param string $string The string to test.
|
308 |
+
* @param string $language 2-Letter language code.
|
309 |
+
*
|
310 |
+
* @return bool
|
311 |
+
*/
|
312 |
+
public static function has_translation( $string, $language = '' ) {
|
313 |
+
|
314 |
+
if ( ! is_string( $string ) || ! $string ) {
|
315 |
+
return false;
|
316 |
+
}
|
317 |
+
|
318 |
+
if ( class_exists( 'WPGlobus_Config' ) ) {
|
319 |
+
$default_language = WPGlobus::Config()->default_language;
|
320 |
+
} else {
|
321 |
+
// When in unit tests.
|
322 |
+
$default_language = 'en';
|
323 |
+
}
|
324 |
+
|
325 |
+
if ( $language ) {
|
326 |
+
if ( ! self::is_language_code_valid( $language ) ) {
|
327 |
+
return false;
|
328 |
+
}
|
329 |
+
} else {
|
330 |
+
// `$language` not passed.
|
331 |
+
$language = $default_language;
|
332 |
+
}
|
333 |
+
|
334 |
+
$language_open_tag = WPGlobus::LOCALE_TAG_OPEN . $language . WPGlobus::LOCALE_TAG_CLOSE;
|
335 |
+
|
336 |
+
/**
|
337 |
+
* This should detect majority of the strings with our delimiters without calling preg_match.
|
338 |
+
*
|
339 |
+
* @var int $pos_start
|
340 |
+
*/
|
341 |
+
$pos_start = strpos( $string, $language_open_tag );
|
342 |
+
if ( false !== $pos_start ) {
|
343 |
+
// Found {:xx} where xx is the language code we were looking for.
|
344 |
+
return true;
|
345 |
+
} else {
|
346 |
+
// Try to extract the language portion.
|
347 |
+
$filtered = self::text_filter( $string, $language, WPGlobus::RETURN_EMPTY, $default_language );
|
348 |
+
|
349 |
+
// Non-empty `filtered` is OK.
|
350 |
+
return (bool) $filtered;
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Keeps only one language in all textual fields of the `$post` object.
|
356 |
+
*
|
357 |
+
* @see \WPGlobus_Core::text_filter for the parameters description
|
358 |
+
*
|
359 |
+
* @param WP_Post|mixed $post The Post object. Object always passed by reference.
|
360 |
+
* @param string $language
|
361 |
+
* @param string $return
|
362 |
+
* @param string $default_language
|
363 |
+
*/
|
364 |
+
public static function translate_wp_post(
|
365 |
+
&$post,
|
366 |
+
$language = '',
|
367 |
+
$return = WPGlobus::RETURN_IN_DEFAULT_LANGUAGE,
|
368 |
+
$default_language = ''
|
369 |
+
) {
|
370 |
+
|
371 |
+
/**
|
372 |
+
* `$default_language` not passed
|
373 |
+
*/
|
374 |
+
if ( ! $default_language ) {
|
375 |
+
if ( class_exists( 'WPGlobus_Config' ) ) {
|
376 |
+
$default_language = WPGlobus::Config()->default_language;
|
377 |
+
} else {
|
378 |
+
// When in unit tests
|
379 |
+
$default_language = 'en';
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
/**
|
384 |
+
* `$language` not passed
|
385 |
+
*/
|
386 |
+
if ( empty( $language ) ) {
|
387 |
+
$language = $default_language;
|
388 |
+
}
|
389 |
+
|
390 |
+
$fields = array(
|
391 |
+
'post_title',
|
392 |
+
'post_content',
|
393 |
+
'post_excerpt',
|
394 |
+
'title',
|
395 |
+
'attr_title',
|
396 |
+
);
|
397 |
+
|
398 |
+
foreach ( $fields as $field ) {
|
399 |
+
if ( ! empty( $post->$field ) ) {
|
400 |
+
$post->$field = self::text_filter( $post->$field, $language, $return, $default_language );
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Translate a term (category, post_tag, etc.)
|
408 |
+
* Term can be an object (default for the @see wp_get_object_terms() filter)
|
409 |
+
* or a string (for example, when wp_get_object_terms is called with the 'fields'=>'names' argument)
|
410 |
+
*
|
411 |
+
* @param string|object $term
|
412 |
+
* @param string $language
|
413 |
+
*/
|
414 |
+
public static function translate_term( &$term, $language = '' ) {
|
415 |
+
if ( is_object( $term ) ) {
|
416 |
+
if ( ! empty( $term->name ) ) {
|
417 |
+
$term->name = self::text_filter( $term->name, $language );
|
418 |
+
}
|
419 |
+
if ( ! empty( $term->description ) ) {
|
420 |
+
$term->description = self::text_filter( $term->description, $language );
|
421 |
+
}
|
422 |
+
} else {
|
423 |
+
if ( ! empty( $term ) ) {
|
424 |
+
$term = self::text_filter( $term, $language );
|
425 |
+
}
|
426 |
+
}
|
427 |
+
|
428 |
+
}
|
429 |
+
|
430 |
+
|
431 |
+
} // class
|
432 |
+
|
433 |
+
# --- EOF
|
trunk/includes/class-wpglobus-filters.php
ADDED
@@ -0,0 +1,1295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Filters and actions
|
4 |
+
* Only methods here. The add_filter calls are in the Controller
|
5 |
+
*
|
6 |
+
* @package WPGlobus
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Filters
|
11 |
+
*/
|
12 |
+
class WPGlobus_Filters {
|
13 |
+
|
14 |
+
/** @var string[] Meta keys where data can be multilingual */
|
15 |
+
protected static $multilingual_meta_keys = array();
|
16 |
+
|
17 |
+
/**
|
18 |
+
* This is the basic filter used to extract the text portion in the current language from a string.
|
19 |
+
* Applied to the main WP texts, such as post title, content and excerpt.
|
20 |
+
*
|
21 |
+
* @param string $text
|
22 |
+
*
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
public static function filter__text( $text ) {
|
26 |
+
|
27 |
+
return WPGlobus_Core::text_filter(
|
28 |
+
$text,
|
29 |
+
WPGlobus::Config()->language,
|
30 |
+
null,
|
31 |
+
WPGlobus::Config()->default_language
|
32 |
+
);
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* This is the alternate filter used to extract the text portion in the current language from a string.
|
38 |
+
*
|
39 |
+
* @since 2.4.16
|
40 |
+
*
|
41 |
+
* @param string $text
|
42 |
+
*
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public static function filter__extract_text( $text ) {
|
46 |
+
|
47 |
+
return WPGlobus_Core::extract_text(
|
48 |
+
$text,
|
49 |
+
WPGlobus::Config()->language
|
50 |
+
);
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* This filter is needed to display correctly the posts with the '--- MORE ---' separator
|
56 |
+
* in archives.
|
57 |
+
* Without it, the post content is truncated at the beginning of <!--more-->, thus keeping
|
58 |
+
* only the first language.
|
59 |
+
* *
|
60 |
+
* 'the_posts' filter is used by @see get_posts(), which is commonly used in all sorts of places,
|
61 |
+
* including, for instance, @see wp_get_associated_nav_menu_items while deleting a post.
|
62 |
+
* So, to minimize potential side effects, we limit the scope to main queries, or
|
63 |
+
* when the 'wpglobus_force_filter__the_posts' is set
|
64 |
+
* (@see WPGlobus_QA::_test_get_posts for example).
|
65 |
+
*
|
66 |
+
* @param array $posts
|
67 |
+
* @param WP_Query $query
|
68 |
+
*
|
69 |
+
* @return array
|
70 |
+
* @since 1.0.14
|
71 |
+
*/
|
72 |
+
public static function filter__the_posts( $posts, $query ) {
|
73 |
+
|
74 |
+
if ( $query->is_main_query() || $query->get( 'wpglobus_force_filter__the_posts' ) ) {
|
75 |
+
foreach ( $posts as $post ) {
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Don't filter post of disabled post type.
|
79 |
+
* @since 2.5.15
|
80 |
+
*/
|
81 |
+
if ( in_array( $post->post_type, WPGlobus::Config()->disabled_entities ) ) {
|
82 |
+
continue;
|
83 |
+
}
|
84 |
+
|
85 |
+
WPGlobus_Core::translate_wp_post(
|
86 |
+
$post,
|
87 |
+
WPGlobus::Config()->language,
|
88 |
+
WPGlobus::RETURN_IN_DEFAULT_LANGUAGE
|
89 |
+
);
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
return $posts;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* This is similar to the @see filter__text filter,
|
98 |
+
* but it returns text in the DEFAULT language.
|
99 |
+
*
|
100 |
+
* @param string $text
|
101 |
+
*
|
102 |
+
* @return string
|
103 |
+
* @since 1.0.8
|
104 |
+
*/
|
105 |
+
public static function filter__text_default_language( $text ) {
|
106 |
+
|
107 |
+
return WPGlobus_Core::text_filter(
|
108 |
+
$text,
|
109 |
+
WPGlobus::Config()->default_language,
|
110 |
+
null,
|
111 |
+
WPGlobus::Config()->default_language
|
112 |
+
);
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Filter @see get_terms
|
119 |
+
*
|
120 |
+
* @scope admin
|
121 |
+
* @scope front
|
122 |
+
*
|
123 |
+
* @param string[]|object[] $terms
|
124 |
+
*
|
125 |
+
* @return array
|
126 |
+
*/
|
127 |
+
public static function filter__get_terms( array $terms ) {
|
128 |
+
|
129 |
+
/**
|
130 |
+
* @todo Example of a "stopper" filter
|
131 |
+
* if ( apply_filters( 'wpglobus_do_filter__get_terms', true ) ) {}
|
132 |
+
* Because it might affect the performance, this is a to-do for now.
|
133 |
+
*/
|
134 |
+
|
135 |
+
foreach ( $terms as &$_term ) {
|
136 |
+
WPGlobus_Core::translate_term( $_term, WPGlobus::Config()->language );
|
137 |
+
}
|
138 |
+
unset( $_term );
|
139 |
+
|
140 |
+
reset( $terms );
|
141 |
+
|
142 |
+
return $terms;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Filter @see get_the_terms
|
147 |
+
*
|
148 |
+
* @scope admin
|
149 |
+
*
|
150 |
+
* @param stdClass[]|WP_Error $terms List of attached terms, or WP_Error on failure.
|
151 |
+
*
|
152 |
+
* @return array
|
153 |
+
*/
|
154 |
+
public static function filter__get_the_terms( $terms ) {
|
155 |
+
|
156 |
+
/**
|
157 |
+
* @internal 15.01.31
|
158 |
+
* Theoretically, we should not have this filter because @see get_the_terms
|
159 |
+
* calls @see wp_get_object_terms, which is already filtered.
|
160 |
+
* However, there is a case when the terms are retrieved from @see get_object_term_cache,
|
161 |
+
* and when we do a Quick Edit / inline-save, we ourselves write raw terms to the cache.
|
162 |
+
* As of now, we know only one such case, so we activate this filter only in admin,
|
163 |
+
* and only on the 'single_row' call
|
164 |
+
* @todo Keep watching this
|
165 |
+
*/
|
166 |
+
|
167 |
+
if ( ! is_wp_error( $terms ) && WPGlobus_WP::is_function_in_backtrace( 'single_row' ) ) {
|
168 |
+
|
169 |
+
// Casting $terms to (array) causes syntax error in PHP 5.3 and older.
|
170 |
+
/* @noinspection ForeachSourceInspection */
|
171 |
+
foreach ( $terms as &$_term ) {
|
172 |
+
WPGlobus_Core::translate_term( $_term, WPGlobus::Config()->language );
|
173 |
+
}
|
174 |
+
unset( $_term );
|
175 |
+
|
176 |
+
reset( $terms );
|
177 |
+
}
|
178 |
+
|
179 |
+
return $terms;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Filter @see wp_get_object_terms()
|
184 |
+
*
|
185 |
+
* @scope admin
|
186 |
+
* @scope front
|
187 |
+
*
|
188 |
+
* @param string[]|stdClass[] $terms An array of terms for the given object or objects.
|
189 |
+
*
|
190 |
+
* @return array
|
191 |
+
*/
|
192 |
+
public static function filter__wp_get_object_terms( array $terms ) {
|
193 |
+
|
194 |
+
/**
|
195 |
+
* @internal
|
196 |
+
* Do not need to check for is_wp_error($terms),
|
197 |
+
* because the WP_Error is returned by wp_get_object_terms() before applying filter.
|
198 |
+
*/
|
199 |
+
|
200 |
+
if ( ! count( $terms ) ) {
|
201 |
+
return $terms;
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Don't filter term names when saving or publishing posts
|
206 |
+
*
|
207 |
+
* @todo Check this before add_filter and not here
|
208 |
+
* @todo Describe exactly how to check this visually, and is possible - write the acceptance test
|
209 |
+
*/
|
210 |
+
if (
|
211 |
+
is_admin() &&
|
212 |
+
WPGlobus_WP::is_pagenow( 'post.php' ) &&
|
213 |
+
( ! empty( $_POST['save'] ) || ! empty( $_POST['publish'] ) ) // phpcs:ignore WordPress.CSRF.NonceVerification
|
214 |
+
) {
|
215 |
+
return $terms;
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Don't filter term names for trash and un-trash single post
|
220 |
+
*
|
221 |
+
* @see we check post.php page instead of edit.php because redirect
|
222 |
+
*/
|
223 |
+
if ( is_admin() && WPGlobus_WP::is_pagenow( 'post.php' ) && isset( $_GET['action'] ) && ( 'trash' === $_GET['action'] || 'untrash' === $_GET['action'] ) // phpcs:ignore WordPress.CSRF.NonceVerification
|
224 |
+
) {
|
225 |
+
return $terms;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Don't filter term names bulk trash and untrash posts
|
230 |
+
*/
|
231 |
+
if ( is_admin() && WPGlobus_WP::is_pagenow( 'edit.php' ) && isset( $_GET['action'] ) && ( 'trash' === $_GET['action'] || 'untrash' === $_GET['action'] ) // phpcs:ignore WordPress.CSRF.NonceVerification
|
232 |
+
) {
|
233 |
+
return $terms;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Don't filter term names for bulk edit post from edit.php page
|
238 |
+
*/
|
239 |
+
if ( is_admin() && WPGlobus_WP::is_function_in_backtrace( 'bulk_edit_posts' ) ) {
|
240 |
+
return $terms;
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Don't filter term names for inline-save ajax action from edit.php page
|
245 |
+
*
|
246 |
+
* @see wp_ajax_inline_save
|
247 |
+
* ...except when the same AJAX refreshes the table row @see WP_Posts_List_Table::single_row
|
248 |
+
* -
|
249 |
+
* @qa At the "All posts" admin page, do Quick Edit on any post. After update, categories and tags
|
250 |
+
* must not show multilingual strings with delimiters.
|
251 |
+
* @qa At Quick Edit, enter an existing tag. After save, check if there is no additional tag
|
252 |
+
* on the "Tags" page. If a new tag is created then the "is tag exists" check was checking
|
253 |
+
* only a single language representation of the tag, while there is a multilingual tag in the DB.
|
254 |
+
*/
|
255 |
+
if ( WPGlobus_WP::is_http_post_action( 'inline-save' ) &&
|
256 |
+
WPGlobus_WP::is_pagenow( 'admin-ajax.php' )
|
257 |
+
) {
|
258 |
+
if ( ! WPGlobus_WP::is_function_in_backtrace( 'single_row' ) ) {
|
259 |
+
return $terms;
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Don't filter term names for heartbeat autosave
|
265 |
+
*/
|
266 |
+
if ( WPGlobus_WP::is_http_post_action( 'heartbeat' ) &&
|
267 |
+
WPGlobus_WP::is_pagenow( 'admin-ajax.php' ) &&
|
268 |
+
! empty( $_POST['data']['wp_autosave'] ) // phpcs:ignore WordPress.CSRF
|
269 |
+
) {
|
270 |
+
return $terms;
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Don't filter term name at time generate checklist categories in metabox
|
275 |
+
*/
|
276 |
+
if (
|
277 |
+
empty( $_POST ) && // phpcs:ignore WordPress.CSRF
|
278 |
+
is_admin() &&
|
279 |
+
WPGlobus_WP::is_pagenow( 'post.php' ) &&
|
280 |
+
WPGlobus_WP::is_function_in_backtrace( 'wp_terms_checklist' )
|
281 |
+
) {
|
282 |
+
return $terms;
|
283 |
+
}
|
284 |
+
|
285 |
+
foreach ( $terms as &$_term ) {
|
286 |
+
WPGlobus_Core::translate_term( $_term, WPGlobus::Config()->language );
|
287 |
+
}
|
288 |
+
unset( $_term );
|
289 |
+
|
290 |
+
reset( $terms );
|
291 |
+
|
292 |
+
return $terms;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* This filter is needed to build correct permalink (slug, post_name)
|
297 |
+
* using only the main part of the post title (in the default language).
|
298 |
+
* -
|
299 |
+
* Because 'sanitize_title' is a commonly used function, we have to apply our filter
|
300 |
+
* only on very specific calls. Therefore, there are (ugly) debug_backtrace checks.
|
301 |
+
* -
|
302 |
+
* Case 1
|
303 |
+
* When a draft post is created,
|
304 |
+
* the post title is converted to the slug in the @see get_sample_permalink function,
|
305 |
+
* using the 'sanitize_title' filter.
|
306 |
+
* -
|
307 |
+
* Case 2
|
308 |
+
* When the draft is published, @see wp_insert_post calls
|
309 |
+
*
|
310 |
+
* @see sanitize_title to set the slug
|
311 |
+
* -
|
312 |
+
* @see WPGLobus_QA::_test_post_name
|
313 |
+
* -
|
314 |
+
* @see WPSEO_Metabox::localize_script
|
315 |
+
* @todo Check what's going on in localize_script of WPSEO?
|
316 |
+
* @todo What if there is no EN language? Only ru and kz but - we cannot use 'en' for permalink
|
317 |
+
* @todo check guid
|
318 |
+
*
|
319 |
+
* @param string $title
|
320 |
+
*
|
321 |
+
* @return string
|
322 |
+
*/
|
323 |
+
public static function filter__sanitize_title( $title ) {
|
324 |
+
|
325 |
+
if (
|
326 |
+
WPGlobus_WP::is_filter_called_by( 'get_sample_permalink' ) ||
|
327 |
+
WPGlobus_WP::is_filter_called_by( 'wp_insert_post' ) ||
|
328 |
+
WPGlobus_WP::is_filter_called_by( 'wp_update_term' )
|
329 |
+
) {
|
330 |
+
/**
|
331 |
+
* @internal_note: the DEFAULT language, not the current one
|
332 |
+
*/
|
333 |
+
$title = WPGlobus_Core::text_filter(
|
334 |
+
$title, WPGlobus::Config()->default_language
|
335 |
+
);
|
336 |
+
}
|
337 |
+
|
338 |
+
return $title;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Filter @see get_term()
|
343 |
+
*
|
344 |
+
* @param string|object $term
|
345 |
+
*
|
346 |
+
* @return string|object
|
347 |
+
*/
|
348 |
+
public static function filter__get_term( $term ) {
|
349 |
+
|
350 |
+
if ( WPGlobus_WP::is_http_post_action( 'inline-save-tax' ) ) { // phpcs:ignore Generic
|
351 |
+
/**
|
352 |
+
* Don't filter ajax action 'inline-save-tax' from edit-tags.php page.
|
353 |
+
* See quick_edit() in includes/js/wpglobus.admin.js
|
354 |
+
* for and example of working with taxonomy name and description
|
355 |
+
* wp_current_filter contains
|
356 |
+
* 0=wp_ajax_inline-save-tax
|
357 |
+
* 1=get_term
|
358 |
+
*
|
359 |
+
* @see wp_ajax_inline_save_tax()
|
360 |
+
*/
|
361 |
+
// do nothing
|
362 |
+
} else {
|
363 |
+
WPGlobus_Core::translate_term( $term, WPGlobus::Config()->language );
|
364 |
+
}
|
365 |
+
|
366 |
+
return $term;
|
367 |
+
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Filter @see get_terms_to_edit()
|
372 |
+
*
|
373 |
+
* @since 1.6.4
|
374 |
+
*
|
375 |
+
* @param string
|
376 |
+
*
|
377 |
+
* @return string
|
378 |
+
*/
|
379 |
+
public static function filter__terms_to_edit( $terms_to_edit ) {
|
380 |
+
|
381 |
+
if ( ! WPGlobus_Core::has_translations( $terms_to_edit ) ) {
|
382 |
+
return $terms_to_edit;
|
383 |
+
}
|
384 |
+
|
385 |
+
$terms = explode( ',', $terms_to_edit );
|
386 |
+
|
387 |
+
foreach ( $terms as $k => $term ) {
|
388 |
+
$terms[ $k ] = WPGlobus_Core::text_filter( $term, WPGlobus::Config()->language );
|
389 |
+
}
|
390 |
+
|
391 |
+
return implode( ',', $terms );
|
392 |
+
}
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Filter @see wp_insert_term().
|
396 |
+
*
|
397 |
+
* @since 1.6.6
|
398 |
+
*
|
399 |
+
* @param string $term The term to add or update.
|
400 |
+
* @param string $taxonomy Taxonomy slug.
|
401 |
+
*
|
402 |
+
* @return string
|
403 |
+
*/
|
404 |
+
public static function filter__pre_insert_term(
|
405 |
+
$term,
|
406 |
+
/** @noinspection PhpUnusedParameterInspection */
|
407 |
+
$taxonomy
|
408 |
+
) {
|
409 |
+
|
410 |
+
$multilingual_term = esc_sql( $term );
|
411 |
+
if ( WPGlobus::Config()->language !== WPGlobus::Config()->default_language ) {
|
412 |
+
$multilingual_term = WPGlobus_Utils::build_multilingual_string( array( WPGlobus::Config()->language => $term ) );
|
413 |
+
}
|
414 |
+
|
415 |
+
global $wpdb;
|
416 |
+
// phpcs:ignore WordPress.WP.PreparedSQL
|
417 |
+
$data = $wpdb->get_results( "SELECT * FROM $wpdb->terms AS terms WHERE terms.name LIKE '%{$multilingual_term}%'" );
|
418 |
+
|
419 |
+
if ( count( $data ) > 0 ) {
|
420 |
+
/**
|
421 |
+
* Return empty to prevent creating duplicate term.
|
422 |
+
*
|
423 |
+
* @see wp_insert_term() in wp-includes\taxonomy.php
|
424 |
+
*/
|
425 |
+
return '';
|
426 |
+
}
|
427 |
+
|
428 |
+
return $term;
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Localize home_url
|
433 |
+
* Should be processed on:
|
434 |
+
* - front
|
435 |
+
* - AJAX, except for several specific actions
|
436 |
+
*
|
437 |
+
* @param string $url
|
438 |
+
*
|
439 |
+
* @return string
|
440 |
+
*/
|
441 |
+
public static function filter__home_url( $url ) {
|
442 |
+
|
443 |
+
/**
|
444 |
+
* @internal note
|
445 |
+
* Example of URL in admin:
|
446 |
+
* When admin interface is not in default language, we still should not see
|
447 |
+
* any permalinks with language prefixes.
|
448 |
+
* For that, we could check if we are at the 'post.php' screen:
|
449 |
+
* if ( 'post.php' == $pagenow ) ....
|
450 |
+
* However, we do not need it, because we disallowed almost any processing in admin.
|
451 |
+
*/
|
452 |
+
|
453 |
+
/**
|
454 |
+
* 1. Do not work in admin
|
455 |
+
*/
|
456 |
+
$need_to_process = ( ! is_admin() );
|
457 |
+
|
458 |
+
if ( WPGlobus_WP::is_pagenow( 'admin-ajax.php' ) ) {
|
459 |
+
/**
|
460 |
+
* 2. But work in AJAX, which is also admin
|
461 |
+
*/
|
462 |
+
$need_to_process = true;
|
463 |
+
|
464 |
+
/**
|
465 |
+
* 3. However, don't convert url for these AJAX actions:
|
466 |
+
*/
|
467 |
+
if ( WPGlobus_WP::is_http_post_action(
|
468 |
+
array(
|
469 |
+
'heartbeat',
|
470 |
+
'sample-permalink',
|
471 |
+
'add-menu-item',
|
472 |
+
)
|
473 |
+
)
|
474 |
+
) {
|
475 |
+
$need_to_process = false;
|
476 |
+
}
|
477 |
+
}
|
478 |
+
|
479 |
+
if ( $need_to_process ) {
|
480 |
+
$url = WPGlobus_Utils::localize_url( $url );
|
481 |
+
}
|
482 |
+
|
483 |
+
return $url;
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Filter @see get_pages
|
488 |
+
*
|
489 |
+
* @qa See a list of available pages in the "Parent Page" metabox when editing a page.
|
490 |
+
*
|
491 |
+
* @param WP_Post[] $pages
|
492 |
+
*
|
493 |
+
* @return WP_Post[]
|
494 |
+
*/
|
495 |
+
public static function filter__get_pages( $pages ) {
|
496 |
+
|
497 |
+
foreach ( $pages as &$_page ) {
|
498 |
+
WPGlobus_Core::translate_wp_post( $_page, WPGlobus::Config()->language );
|
499 |
+
}
|
500 |
+
unset( $_page );
|
501 |
+
|
502 |
+
reset( $pages );
|
503 |
+
|
504 |
+
return $pages;
|
505 |
+
}
|
506 |
+
|
507 |
+
/**
|
508 |
+
* Filter for @see get_locale
|
509 |
+
*
|
510 |
+
* @param string $locale
|
511 |
+
*
|
512 |
+
* @return string
|
513 |
+
* @todo Do we need to do setlocale(LC_???, $locale)? (*** NOT HERE )
|
514 |
+
* @see setlocale
|
515 |
+
* @link http://php.net/manual/en/function.setlocale.php
|
516 |
+
* @example echo setlocale(LC_ALL, 'Russian'); => Russian_Russia.1251
|
517 |
+
*/
|
518 |
+
public static function filter__get_locale(
|
519 |
+
/** @noinspection PhpUnusedParameterInspection */
|
520 |
+
$locale
|
521 |
+
) {
|
522 |
+
|
523 |
+
/**
|
524 |
+
* @todo This caching breaks the admin language switcher.
|
525 |
+
*/
|
526 |
+
/* static $cached_locale = null;
|
527 |
+
if ( null !== $cached_locale ) {
|
528 |
+
return $cached_locale;
|
529 |
+
}*/
|
530 |
+
|
531 |
+
/**
|
532 |
+
* Special case: in admin area, show everything in the language of admin interface.
|
533 |
+
* (set in the General Settings in WP 4.1)
|
534 |
+
*/
|
535 |
+
/**
|
536 |
+
* @internal
|
537 |
+
* We need to exclude is_admin when it's a front-originated AJAX,
|
538 |
+
* so we are doing a "hack" checking @see WPGlobus_WP::is_admin_doing_ajax.
|
539 |
+
*/
|
540 |
+
if (
|
541 |
+
is_admin() &&
|
542 |
+
( ! WPGlobus_WP::is_doing_ajax() || WPGlobus_WP::is_admin_doing_ajax() )
|
543 |
+
&& apply_filters( 'wpglobus_use_admin_wplang', true )
|
544 |
+
) {
|
545 |
+
/**
|
546 |
+
* @todo is_multisite
|
547 |
+
* @todo Pre-WP4, WPLANG constant from wp-config
|
548 |
+
*/
|
549 |
+
$WPLANG = get_option( 'WPLANG' );
|
550 |
+
if ( empty( $WPLANG ) ) {
|
551 |
+
$WPLANG = 'en_US';
|
552 |
+
}
|
553 |
+
WPGlobus::Config()->set_language( $WPLANG );
|
554 |
+
|
555 |
+
}
|
556 |
+
|
557 |
+
if ( is_admin() ) {
|
558 |
+
/**
|
559 |
+
* Checking case for set locale which does not set in WPGlobus
|
560 |
+
*/
|
561 |
+
if ( WPGlobus::Config()->is_enabled_locale( $locale ) ) {
|
562 |
+
$locale = WPGlobus::Config()->locale[ WPGlobus::Config()->language ];
|
563 |
+
}
|
564 |
+
} else {
|
565 |
+
$locale = WPGlobus::Config()->locale[ WPGlobus::Config()->language ];
|
566 |
+
}
|
567 |
+
|
568 |
+
/* $cached_locale = $locale;*/
|
569 |
+
|
570 |
+
return $locale;
|
571 |
+
|
572 |
+
}
|
573 |
+
|
574 |
+
/**
|
575 |
+
* Filter @see wp_setup_nav_menu_item in wp-includes\nav-menu.php for more info
|
576 |
+
*
|
577 |
+
* @since 1.0.0
|
578 |
+
*
|
579 |
+
* @param WP_Post[] $object
|
580 |
+
*
|
581 |
+
* @return WP_Post[]
|
582 |
+
*/
|
583 |
+
public static function filter__nav_menu_item( $object ) {
|
584 |
+
/**
|
585 |
+
* This filter is used at nav-menus.php page for .field-move elements
|
586 |
+
*/
|
587 |
+
if ( is_object( $object ) && 'WP_Post' === get_class( $object ) ) {
|
588 |
+
|
589 |
+
if ( ! empty( $object->title ) ) {
|
590 |
+
$object->title = WPGlobus_Core::text_filter( $object->title, WPGlobus::Config()->language );
|
591 |
+
}
|
592 |
+
if ( ! empty( $object->description ) ) {
|
593 |
+
$object->description = WPGlobus_Core::text_filter( $object->description, WPGlobus::Config()->language );
|
594 |
+
}
|
595 |
+
}
|
596 |
+
|
597 |
+
return $object;
|
598 |
+
}
|
599 |
+
|
600 |
+
/**
|
601 |
+
* Filter @see nav_menu_description
|
602 |
+
*
|
603 |
+
* @since 1.0.0
|
604 |
+
*
|
605 |
+
* @param string $description
|
606 |
+
*
|
607 |
+
* @return string
|
608 |
+
*/
|
609 |
+
public static function filter__nav_menu_description( $description ) {
|
610 |
+
/**
|
611 |
+
* This filter for translate menu item description
|
612 |
+
*/
|
613 |
+
if ( ! empty( $description ) ) {
|
614 |
+
$description = WPGlobus_Core::text_filter( $description, WPGlobus::Config()->language );
|
615 |
+
}
|
616 |
+
|
617 |
+
return $description;
|
618 |
+
}
|
619 |
+
|
620 |
+
/**
|
621 |
+
* Filter @see heartbeat_received
|
622 |
+
*
|
623 |
+
* @since 1.0.1
|
624 |
+
*
|
625 |
+
* @param array $response
|
626 |
+
* @param array $data
|
627 |
+
* @param string $screen_id
|
628 |
+
*
|
629 |
+
* @return array
|
630 |
+
*/
|
631 |
+
public static function filter__heartbeat_received(
|
632 |
+
$response, $data,
|
633 |
+
/** @noinspection PhpUnusedParameterInspection */
|
634 |
+
$screen_id
|
635 |
+
) {
|
636 |
+
|
637 |
+
if ( false !== strpos( $_SERVER['HTTP_REFERER'], 'wpglobus=off' ) ) { // WPCS: input var ok, sanitization ok.
|
638 |
+
/**
|
639 |
+
* Check $_SERVER['HTTP_REFERER'] for wpglobus toggle is off because wpglobus-admin.js doesn't loaded in this mode
|
640 |
+
*/
|
641 |
+
return $response;
|
642 |
+
}
|
643 |
+
|
644 |
+
if ( ! empty( $data['wp_autosave'] ) ) {
|
645 |
+
|
646 |
+
if ( empty( $data['wp_autosave']['post_id'] ) || 0 === (int) $data['wp_autosave']['post_id'] ) {
|
647 |
+
/**
|
648 |
+
* wp_autosave may come from edit.php page
|
649 |
+
*/
|
650 |
+
return $response;
|
651 |
+
}
|
652 |
+
|
653 |
+
if ( empty( $data['wpglobus_heartbeat'] ) ) {
|
654 |
+
/**
|
655 |
+
* Check for wpglobus key
|
656 |
+
*/
|
657 |
+
return $response;
|
658 |
+
}
|
659 |
+
|
660 |
+
$title_wrap = false;
|
661 |
+
$content_wrap = false;
|
662 |
+
$post_title_ext = '';
|
663 |
+
$content_ext = '';
|
664 |
+
|
665 |
+
foreach ( WPGlobus::Config()->enabled_languages as $language ) {
|
666 |
+
if ( WPGlobus::Config()->default_language === $language ) {
|
667 |
+
|
668 |
+
$post_title_ext .= WPGlobus::add_locale_marks( $data['wp_autosave']['post_title'], $language );
|
669 |
+
$content_ext .= WPGlobus::add_locale_marks( $data['wp_autosave']['content'], $language );
|
670 |
+
|
671 |
+
} else {
|
672 |
+
|
673 |
+
if ( ! empty( $data['wp_autosave'][ 'post_title_' . $language ] ) ) {
|
674 |
+
$title_wrap = true;
|
675 |
+
|
676 |
+
$post_title_ext .= WPGlobus::add_locale_marks( $data['wp_autosave'][ 'post_title_' . $language ], $language );
|
677 |
+
}
|
678 |
+
|
679 |
+
if ( ! empty( $data['wp_autosave'][ 'content_' . $language ] ) ) {
|
680 |
+
$content_wrap = true;
|
681 |
+
|
682 |
+
$content_ext .= WPGlobus::add_locale_marks( $data['wp_autosave'][ 'content_' . $language ], $language );
|
683 |
+
}
|
684 |
+
}
|
685 |
+
}
|
686 |
+
|
687 |
+
if ( $title_wrap ) {
|
688 |
+
$data['wp_autosave']['post_title'] = $post_title_ext;
|
689 |
+
}
|
690 |
+
|
691 |
+
if ( $content_wrap ) {
|
692 |
+
$data['wp_autosave']['content'] = $content_ext;
|
693 |
+
}
|
694 |
+
|
695 |
+
/**
|
696 |
+
* Filter before autosave
|
697 |
+
*
|
698 |
+
* @since 1.0.2
|
699 |
+
*
|
700 |
+
* @param array $data ['wp_autosave'] Array of post data.
|
701 |
+
*/
|
702 |
+
$data['wp_autosave'] = apply_filters( 'wpglobus_autosave_post_data', $data['wp_autosave'] );
|
703 |
+
|
704 |
+
$saved = wp_autosave( $data['wp_autosave'] );
|
705 |
+
|
706 |
+
if ( is_wp_error( $saved ) ) {
|
707 |
+
$response['wp_autosave'] = array(
|
708 |
+
'success' => false,
|
709 |
+
'message' => $saved->get_error_message(),
|
710 |
+
);
|
711 |
+
} elseif ( empty( $saved ) ) {
|
712 |
+
$response['wp_autosave'] = array(
|
713 |
+
'success' => false,
|
714 |
+
'message' => __( 'Error while saving.' ),
|
715 |
+
);
|
716 |
+
} else {
|
717 |
+
$draft_saved_date_format = __( 'g:i:s a' );
|
718 |
+
$response['wp_autosave'] = array(
|
719 |
+
'success' => true,
|
720 |
+
'message' => sprintf(
|
721 |
+
__( 'Draft saved at %s.' ), date_i18n( $draft_saved_date_format )
|
722 |
+
),
|
723 |
+
);
|
724 |
+
}
|
725 |
+
}
|
726 |
+
|
727 |
+
return $response;
|
728 |
+
}
|
729 |
+
|
730 |
+
/**
|
731 |
+
* Filter @see wp_nav_menu_objects
|
732 |
+
*
|
733 |
+
* @since 1.0.2
|
734 |
+
*
|
735 |
+
* @param array $object
|
736 |
+
*
|
737 |
+
* @return array
|
738 |
+
*/
|
739 |
+
public static function filter__nav_menu_objects( $object ) {
|
740 |
+
|
741 |
+
if ( is_array( $object ) ) {
|
742 |
+
foreach ( $object as &$post ) {
|
743 |
+
if ( ! empty( $post->attr_title ) ) {
|
744 |
+
$post->attr_title = WPGlobus_Core::text_filter( $post->attr_title, WPGlobus::Config()->language );
|
745 |
+
}
|
746 |
+
}
|
747 |
+
}
|
748 |
+
|
749 |
+
return $object;
|
750 |
+
|
751 |
+
}
|
752 |
+
|
753 |
+
/**
|
754 |
+
* Translate widget strings (besides the title handled by the `widget_title` filter)
|
755 |
+
*
|
756 |
+
* @see WP_Widget::display_callback
|
757 |
+
* @scope front
|
758 |
+
*
|
759 |
+
* @since 1.0.6
|
760 |
+
* @since 2.4.10 Prevent handling of incorrect widget instance's settings.
|
761 |
+
*
|
762 |
+
* @param string[] $instance
|
763 |
+
*
|
764 |
+
* @return string[]
|
765 |
+
*/
|
766 |
+
public static function filter__widget_display_callback( $instance ) {
|
767 |
+
|
768 |
+
/**
|
769 |
+
* Prevent handling of incorrect widget instance's settings.
|
770 |
+
* @since 2.4.10
|
771 |
+
*/
|
772 |
+
if ( empty($instance) || is_bool($instance) ) {
|
773 |
+
return $instance;
|
774 |
+
}
|
775 |
+
|
776 |
+
foreach ( $instance as &$widget_setting ) {
|
777 |
+
|
778 |
+
/** @noinspection ReferenceMismatchInspection */
|
779 |
+
if ( ! empty( $widget_setting ) && is_string( $widget_setting ) ) {
|
780 |
+
$widget_setting =
|
781 |
+
WPGlobus_Core::text_filter( $widget_setting, WPGlobus::Config()->language );
|
782 |
+
}
|
783 |
+
}
|
784 |
+
|
785 |
+
return $instance;
|
786 |
+
}
|
787 |
+
|
788 |
+
/**
|
789 |
+
* Filter @see comment_moderation_text,
|
790 |
+
*
|
791 |
+
* @see comment_moderation_subject
|
792 |
+
* @since 1.0.6
|
793 |
+
*
|
794 |
+
* @param string $text
|
795 |
+
* @param int $comment_id
|
796 |
+
*
|
797 |
+
* @return string
|
798 |
+
*/
|
799 |
+
public static function filter__comment_moderation( $text, $comment_id ) {
|
800 |
+
|
801 |
+
$comment = get_comment( $comment_id );
|
802 |
+
$post = get_post( $comment->comment_post_ID );
|
803 |
+
$title = WPGlobus_Core::text_filter( $post->post_title, WPGlobus::Config()->language );
|
804 |
+
|
805 |
+
return str_replace( $post->post_title, $title, $text );
|
806 |
+
|
807 |
+
}
|
808 |
+
|
809 |
+
/**
|
810 |
+
* Filter @see wp_trim_words
|
811 |
+
*
|
812 |
+
* @qa At the /wp-admin/index.php page is a Quick Draft metabox
|
813 |
+
* which shows 3 last post drafts. This filter lets post content in default language.
|
814 |
+
* @since 1.0.14
|
815 |
+
*
|
816 |
+
* @param string $text The trimmed text.
|
817 |
+
* @param int $num_words The number of words to trim the text to.
|
818 |
+
* @param string $more An optional string to append to the end of the trimmed text, e.g. ….
|
819 |
+
* @param string $original_text The text before it was trimmed.
|
820 |
+
*
|
821 |
+
* @return string
|
822 |
+
*/
|
823 |
+
public static function filter__wp_trim_words(
|
824 |
+
/** @noinspection PhpUnusedParameterInspection */
|
825 |
+
$text, $num_words, $more, $original_text
|
826 |
+
) {
|
827 |
+
|
828 |
+
// Method argument is ignored.
|
829 |
+
/* @noinspection SuspiciousAssignmentsInspection */
|
830 |
+
$text = WPGlobus_Core::text_filter( $original_text, WPGlobus::Config()->language );
|
831 |
+
|
832 |
+
if ( null === $more ) {
|
833 |
+
$more = __( '…' );
|
834 |
+
}
|
835 |
+
|
836 |
+
$text = wp_strip_all_tags( $text );
|
837 |
+
if ( 'characters' == _x( 'words', 'word count: words or characters?' ) && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {//phpcs:ignore WordPress.PHP.StrictComparisons
|
838 |
+
$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
|
839 |
+
preg_match_all( '/./u', $text, $words_array );
|
840 |
+
$words_array = array_slice( $words_array[0], 0, $num_words + 1 );
|
841 |
+
$sep = '';
|
842 |
+
} else {
|
843 |
+
$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
844 |
+
$sep = ' ';
|
845 |
+
}
|
846 |
+
if ( count( $words_array ) > $num_words ) {
|
847 |
+
array_pop( $words_array );
|
848 |
+
$text = implode( $sep, $words_array );
|
849 |
+
$text = $text . $more;
|
850 |
+
} else {
|
851 |
+
$text = implode( $sep, $words_array );
|
852 |
+
}
|
853 |
+
|
854 |
+
return $text;
|
855 |
+
|
856 |
+
}
|
857 |
+
|
858 |
+
/**
|
859 |
+
* Register the WPGlobus widgets
|
860 |
+
*
|
861 |
+
* @wp-hook widgets_init
|
862 |
+
* @since 1.0.7
|
863 |
+
*/
|
864 |
+
public static function register_widgets() {
|
865 |
+
register_widget( 'WPGlobusWidget' );
|
866 |
+
}
|
867 |
+
|
868 |
+
/**
|
869 |
+
* Do something on admin_init hook.
|
870 |
+
*
|
871 |
+
* @todo Note: runs on admin-ajax and admin-post, too
|
872 |
+
*/
|
873 |
+
public static function action__admin_init() {
|
874 |
+
/**
|
875 |
+
* Display blog name correctly on the WooThemes Helper page
|
876 |
+
* wp-admin/index.php?page=woothemes-helper
|
877 |
+
*/
|
878 |
+
if ( WPGlobus_WP::is_plugin_page( 'woothemes-helper' ) ) {
|
879 |
+
add_filter( 'option_blogname', array( 'WPGlobus_Filters', 'filter__text' ), 0 );
|
880 |
+
}
|
881 |
+
}
|
882 |
+
|
883 |
+
/**
|
884 |
+
* Specify meta keys where the meta data can be multilingual.
|
885 |
+
*
|
886 |
+
* @example
|
887 |
+
* <code>
|
888 |
+
* add_filter( 'wpglobus_multilingual_meta_keys',
|
889 |
+
* function ( $multilingual_meta_keys ) {
|
890 |
+
* $multilingual_meta_keys['slides'] = true;
|
891 |
+
* return $multilingual_meta_keys;
|
892 |
+
* }
|
893 |
+
* );
|
894 |
+
* </code>
|
895 |
+
* @since 1.2.1
|
896 |
+
*/
|
897 |
+
public static function set_multilingual_meta_keys() {
|
898 |
+
|
899 |
+
/**
|
900 |
+
* Add Alternative Text meta value for media.
|
901 |
+
* We need to use only one meta because Title, Caption and Description was stored in wp_posts table.
|
902 |
+
*
|
903 |
+
* @todo may be to use another class to store keys for $multilingual_meta_keys in future version.
|
904 |
+
*
|
905 |
+
* @since 1.9.11
|
906 |
+
*/
|
907 |
+
self::$multilingual_meta_keys['_wp_attachment_image_alt'] = true;
|
908 |
+
|
909 |
+
self::$multilingual_meta_keys = apply_filters(
|
910 |
+
'wpglobus_multilingual_meta_keys', self::$multilingual_meta_keys
|
911 |
+
);
|
912 |
+
}
|
913 |
+
|
914 |
+
/**
|
915 |
+
* Translate meta data
|
916 |
+
*
|
917 |
+
* @see \WPGlobus_Filters::set_multilingual_meta_keys
|
918 |
+
*
|
919 |
+
* @param string|array $value Null is passed. We set the value.
|
920 |
+
* @param int $object_id Post ID
|
921 |
+
* @param string $meta_key Passed by the filter. We need only one key.
|
922 |
+
* @param string|array $single Meta value, or an array of values.
|
923 |
+
*
|
924 |
+
* @return string|array
|
925 |
+
*/
|
926 |
+
public static function filter__postmeta( $value, $object_id, $meta_key, $single ) {
|
927 |
+
|
928 |
+
/**
|
929 |
+
* @todo Currently, only single values are supported
|
930 |
+
*/
|
931 |
+
if ( ! $single ) {
|
932 |
+
return $value;
|
933 |
+
}
|
934 |
+
|
935 |
+
/**
|
936 |
+
* Will process only if the `meta_key` is one of the explicitly set.
|
937 |
+
*/
|
938 |
+
if ( ! isset( self::$multilingual_meta_keys[ $meta_key ] ) ) {
|
939 |
+
return $value;
|
940 |
+
}
|
941 |
+
|
942 |
+
/**
|
943 |
+
* May be called many times on one page. Let's cache.
|
944 |
+
*/
|
945 |
+
static $_cache;
|
946 |
+
if ( isset( $_cache[ $meta_key ][ $object_id ] ) ) {
|
947 |
+
return $_cache[ $meta_key ][ $object_id ];
|
948 |
+
}
|
949 |
+
|
950 |
+
/** @global wpdb $wpdb */
|
951 |
+
global $wpdb;
|
952 |
+
$meta_value = $wpdb->get_var(
|
953 |
+
$wpdb->prepare(
|
954 |
+
"SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d LIMIT 1;",
|
955 |
+
$meta_key, $object_id
|
956 |
+
)
|
957 |
+
);
|
958 |
+
|
959 |
+
if ( $meta_value ) {
|
960 |
+
|
961 |
+
if ( is_serialized( $meta_value ) ) {
|
962 |
+
/**
|
963 |
+
* @todo Refactor this. Write a `filter__array` method.
|
964 |
+
*/
|
965 |
+
$_meta_array = unserialize( $meta_value ); //phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions
|
966 |
+
foreach ( $_meta_array as &$_value ) {
|
967 |
+
if ( is_array( $_value ) ) {
|
968 |
+
foreach ( $_value as &$_deep_value ) {
|
969 |
+
/**
|
970 |
+
* @todo Assuming that the array had max. two levels, which is wrong.
|
971 |
+
*/
|
972 |
+
$_deep_value = self::filter__text( $_deep_value );
|
973 |
+
}
|
974 |
+
unset( $_deep_value );
|
975 |
+
} else {
|
976 |
+
$_value = self::filter__text( $_value );
|
977 |
+
}
|
978 |
+
}
|
979 |
+
unset( $_value );
|
980 |
+
$value = $_meta_array;
|
981 |
+
|
982 |
+
/**
|
983 |
+
* If single is requested, the following code is executed by
|
984 |
+
*
|
985 |
+
* @see get_metadata
|
986 |
+
* <code>
|
987 |
+
* if ( $single && is_array( $check ) )
|
988 |
+
* return $check[0];
|
989 |
+
* </code>
|
990 |
+
* Therefore, we need to return the entire `$value` as the first element of
|
991 |
+
* an array.
|
992 |
+
*/
|
993 |
+
if ( $single ) {
|
994 |
+
$value = array( $value );
|
995 |
+
}
|
996 |
+
} else {
|
997 |
+
$value = self::filter__text( $meta_value );
|
998 |
+
}
|
999 |
+
}
|
1000 |
+
|
1001 |
+
/**
|
1002 |
+
* Save to cache, even if we did not do anything
|
1003 |
+
*/
|
1004 |
+
$_cache[ $meta_key ][ $object_id ] = $value;
|
1005 |
+
|
1006 |
+
return $value;
|
1007 |
+
}
|
1008 |
+
|
1009 |
+
/**
|
1010 |
+
* Localize feed url
|
1011 |
+
*
|
1012 |
+
* @since 1.5.3
|
1013 |
+
*
|
1014 |
+
* @scope both (RSS are shown in admin dashboard "News" widgets).
|
1015 |
+
*
|
1016 |
+
* @param SimplePie $obj
|
1017 |
+
*/
|
1018 |
+
public static function fetch_feed_options( $obj ) {
|
1019 |
+
|
1020 |
+
$need_to_localize = true;
|
1021 |
+
/**
|
1022 |
+
* Filter to disable localize feed url.
|
1023 |
+
*
|
1024 |
+
* @since 1.5.3
|
1025 |
+
*
|
1026 |
+
* @param bool $need_to_localize True is value by default.
|
1027 |
+
* @param SimplePie $obj The feed object.
|
1028 |
+
*
|
1029 |
+
* @return bool
|
1030 |
+
*/
|
1031 |
+
$need_to_localize = apply_filters( 'wpglobus_localize_feed_url', $need_to_localize, $obj );
|
1032 |
+
|
1033 |
+
if ( ! empty( $obj->feed_url ) && $need_to_localize ) {
|
1034 |
+
$obj->feed_url = WPGlobus_Utils::localize_url( $obj->feed_url );
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* Filter CSS rules for frontend.
|
1041 |
+
*
|
1042 |
+
* @since 1.6.6
|
1043 |
+
*
|
1044 |
+
* @scope front
|
1045 |
+
*
|
1046 |
+
* @param string $css
|
1047 |
+
* @param string $css_editor
|
1048 |
+
*
|
1049 |
+
* @return string
|
1050 |
+
*/
|
1051 |
+
public static function filter__front_styles( $css, $css_editor ) {
|
1052 |
+
if ( ! empty( $css_editor ) ) {
|
1053 |
+
$css .= strip_tags( $css_editor );
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
return $css;
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
/**
|
1060 |
+
* De-localize URL to the default language so that @see url_to_postid() can
|
1061 |
+
* determine the post ID.
|
1062 |
+
*
|
1063 |
+
* @since 1.8.4
|
1064 |
+
*
|
1065 |
+
* @param string $url The URL to derive the post ID from.
|
1066 |
+
*
|
1067 |
+
* @return string
|
1068 |
+
*/
|
1069 |
+
public static function filter__url_to_postid( $url ) {
|
1070 |
+
$url = WPGlobus_Utils::localize_url( $url, WPGlobus::Config()->default_language );
|
1071 |
+
|
1072 |
+
return $url;
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
/**
|
1076 |
+
* The post ID has been changed already by the @see filter__url_to_postid,
|
1077 |
+
* so we do not need to modify it here.
|
1078 |
+
* However, oembed does not know which language to use to fill in its $data
|
1079 |
+
* from the post.
|
1080 |
+
* Therefore, we use a workaround: extract the language from the URL and
|
1081 |
+
* store it in a special variable, to use later in
|
1082 |
+
*
|
1083 |
+
* @see filter__oembed_response_data.
|
1084 |
+
*
|
1085 |
+
* @since 1.8.4
|
1086 |
+
*
|
1087 |
+
* @param int $post_id The post ID.
|
1088 |
+
* @param string $url The requested URL.
|
1089 |
+
*
|
1090 |
+
* @return int The post ID, unchanged.
|
1091 |
+
*/
|
1092 |
+
public static function filter__oembed_request_post_id( $post_id, $url ) {
|
1093 |
+
$language = WPGlobus_Utils::extract_language_from_url( $url );
|
1094 |
+
if ( WPGlobus::Config()->default_language !== $language ) {
|
1095 |
+
WPGlobus::Config()->setLanguageForOembed( $language );
|
1096 |
+
}
|
1097 |
+
|
1098 |
+
return $post_id;
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
/**
|
1102 |
+
* Filter the oembed data returned by the /wp-json/oembed/... calls.
|
1103 |
+
*
|
1104 |
+
* @param array $data The response data.
|
1105 |
+
*
|
1106 |
+
* @return array
|
1107 |
+
* @since 1.8.4
|
1108 |
+
*/
|
1109 |
+
public static function filter__oembed_response_data( $data ) {
|
1110 |
+
// If $language_for_oembed is empty, text_filter will use the default language.
|
1111 |
+
$language_for_oembed = WPGlobus::Config()->getAndResetLanguageForOembed();
|
1112 |
+
foreach ( array( 'author_name', 'title' ) as $field ) {
|
1113 |
+
if ( ! empty( $data[ $field ] ) ) {
|
1114 |
+
$data[ $field ] = WPGlobus_Core::text_filter( $data[ $field ], $language_for_oembed );
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
return $data;
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
/**
|
1122 |
+
* Filters the wp_mail() arguments.
|
1123 |
+
*
|
1124 |
+
* @see wp-includes\pluggable.php
|
1125 |
+
*
|
1126 |
+
* @param array $atts A compacted array of wp_mail() arguments.
|
1127 |
+
*
|
1128 |
+
* @return array
|
1129 |
+
* @since 1.9.5
|
1130 |
+
*/
|
1131 |
+
public static function filter__wp_mail( $atts ) {
|
1132 |
+
|
1133 |
+
/**
|
1134 |
+
* May be called many times. Let's cache.
|
1135 |
+
*/
|
1136 |
+
/*
|
1137 |
+
static $_cache;
|
1138 |
+
if ( isset( $_cache ) ) {
|
1139 |
+
return $_cache;
|
1140 |
+
} // */
|
1141 |
+
|
1142 |
+
/**
|
1143 |
+
* Array of enabled attributes to translate.
|
1144 |
+
* Full array is 'to', 'subject', 'message', 'headers', 'attachments';
|
1145 |
+
*/
|
1146 |
+
$keys = array( 'subject', 'message', 'headers' );
|
1147 |
+
|
1148 |
+
foreach ( $keys as $key ) :
|
1149 |
+
|
1150 |
+
if ( empty( $atts[ $key ] ) ) {
|
1151 |
+
continue;
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
if ( 'message' === $key ) {
|
1155 |
+
$atts[ $key ] = str_replace( "\n", '[[wpg-newline]]', $atts[ $key ] );
|
1156 |
+
}
|
1157 |
+
|
1158 |
+
$atts[ $key ] = WPGlobus_Core::extract_text( $atts[ $key ], WPGlobus::Config()->default_language );
|
1159 |
+
|
1160 |
+
if ( 'message' === $key ) {
|
1161 |
+
$atts[ $key ] = str_replace( '[[wpg-newline]]', "\n", $atts[ $key ] );
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
endforeach;
|
1165 |
+
|
1166 |
+
/**
|
1167 |
+
* Save to cache.
|
1168 |
+
*/
|
1169 |
+
// $_cache = $atts;
|
1170 |
+
|
1171 |
+
return $atts;
|
1172 |
+
}
|
1173 |
+
|
1174 |
+
/**
|
1175 |
+
* Filters oEmbed HTML.
|
1176 |
+
*
|
1177 |
+
* @param mixed $cache The cached HTML result, stored in post meta.
|
1178 |
+
* @param string $url The attempted embed URL.
|
1179 |
+
* @param array $attr An array of shortcode attributes.
|
1180 |
+
* @param int $post_ID Post ID.
|
1181 |
+
*
|
1182 |
+
* @return string
|
1183 |
+
* @since 1.9.8
|
1184 |
+
*/
|
1185 |
+
public static function filter__embed_oembed_html(
|
1186 |
+
$cache, $url,
|
1187 |
+
/** @noinspection PhpUnusedParameterInspection */
|
1188 |
+
$attr,
|
1189 |
+
/** @noinspection PhpUnusedParameterInspection */
|
1190 |
+
$post_ID
|
1191 |
+
) {
|
1192 |
+
|
1193 |
+
if ( ! is_string( $cache ) ) {
|
1194 |
+
/**
|
1195 |
+
* @since 1.9.8. We are working with string.
|
1196 |
+
*/
|
1197 |
+
return $cache;
|
1198 |
+
}
|
1199 |
+
|
1200 |
+
$language = WPGlobus_Utils::extract_language_from_url( $url );
|
1201 |
+
|
1202 |
+
if ( empty( $language ) ) {
|
1203 |
+
/**
|
1204 |
+
* URL has no language code. So this is default language.
|
1205 |
+
*/
|
1206 |
+
return $cache;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
$cache = str_replace( WPGlobus_Utils::localize_url( $url, WPGlobus::Config()->default_language ), $url, $cache );
|
1210 |
+
|
1211 |
+
return $cache;
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
/**
|
1215 |
+
* Filters a 'wpseo_taxonomy_meta' option before its value is updated.
|
1216 |
+
*
|
1217 |
+
* @since 2.0
|
1218 |
+
*
|
1219 |
+
* @param mixed $new_value The new, unserialized option value.
|
1220 |
+
* @param mixed $old_value The old option value.
|
1221 |
+
* @param string $option Option name.
|
1222 |
+
*
|
1223 |
+
* @return mixed
|
1224 |
+
*/
|
1225 |
+
public static function filter__pre_update_wpseo_taxonomy_meta(
|
1226 |
+
$new_value,
|
1227 |
+
/** @noinspection PhpUnusedParameterInspection */
|
1228 |
+
$old_value,
|
1229 |
+
/** @noinspection PhpUnusedParameterInspection */
|
1230 |
+
$option
|
1231 |
+
) {
|
1232 |
+
|
1233 |
+
global $pagenow;
|
1234 |
+
|
1235 |
+
if ( 'edit-tags.php' === $pagenow && 'editedtag' === $_POST['action'] ) { // phpcs:ignore WordPress.CSRF.NonceVerification
|
1236 |
+
/**
|
1237 |
+
* Update button was clicked on term.php page.
|
1238 |
+
*/
|
1239 |
+
$current_language = WPGlobus::Config()->builder->get_language();
|
1240 |
+
$taxonomy = WPGlobus::Config()->builder->get( 'taxonomy' );
|
1241 |
+
$tag_ID = (int) $_POST['tag_ID'];
|
1242 |
+
|
1243 |
+
$_enabled_keys = array( 'wpseo_title', 'wpseo_desc', 'wpseo_focuskw' );
|
1244 |
+
|
1245 |
+
/**
|
1246 |
+
* Get option.
|
1247 |
+
*/
|
1248 |
+
global $wpdb;
|
1249 |
+
$query = "SELECT option_value FROM $wpdb->options WHERE option_name = 'wpseo_taxonomy_meta'";
|
1250 |
+
$result = $wpdb->get_col( $query ); // phpcs:ignore WordPress.WP.PreparedSQL
|
1251 |
+
|
1252 |
+
if ( ! empty($result[0]) ) {
|
1253 |
+
$option_values = maybe_unserialize( $result[0] );
|
1254 |
+
} else {
|
1255 |
+
$option_values = array();
|
1256 |
+
}
|
1257 |
+
|
1258 |
+
foreach ( $_enabled_keys as $field ) {
|
1259 |
+
|
1260 |
+
$new = array();
|
1261 |
+
|
1262 |
+
foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
|
1263 |
+
|
1264 |
+
if ( $lang === $current_language ) {
|
1265 |
+
|
1266 |
+
if ( empty( $new_value[ $taxonomy ][ $tag_ID ][ $field ] ) ) {//phpcs:ignore Generic.CodeAnalysis
|
1267 |
+
//$text = '';
|
1268 |
+
} else {
|
1269 |
+
$new[ $lang ] = $new_value[ $taxonomy ][ $tag_ID ][ $field ];
|
1270 |
+
}
|
1271 |
+
} else {
|
1272 |
+
|
1273 |
+
if ( ! empty( $option_values[ $taxonomy ][ $tag_ID ][ $field ] ) ) {
|
1274 |
+
|
1275 |
+
$_text = WPGlobus_Core::text_filter( $option_values[ $taxonomy ][ $tag_ID ][ $field ], $lang, WPGlobus::RETURN_EMPTY );
|
1276 |
+
if ( ! empty( $_text ) ) {
|
1277 |
+
$new[ $lang ] = $_text;
|
1278 |
+
}
|
1279 |
+
}
|
1280 |
+
}
|
1281 |
+
|
1282 |
+
endforeach;
|
1283 |
+
|
1284 |
+
$new_value[ $taxonomy ][ $tag_ID ][ $field ] = WPGlobus_Utils::build_multilingual_string( $new );
|
1285 |
+
|
1286 |
+
} // endforeach
|
1287 |
+
}
|
1288 |
+
|
1289 |
+
return $new_value;
|
1290 |
+
|
1291 |
+
}
|
1292 |
+
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
# --- EOF
|
trunk/includes/class-wpglobus-plugin.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-plugin.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus
|
6 |
+
* @since 1.6.1
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Plugin
|
11 |
+
*/
|
12 |
+
abstract class WPGlobus_Plugin {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* `__FILE__` from the loader.
|
16 |
+
*
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
+
public $plugin_file = '';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Basename from `__FILE__`.
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
public $plugin_basename = '';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Plugin directory URL. Initialized by the constructor.
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
+
*/
|
33 |
+
public $plugin_dir_url = '';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Parameter for the updater: slug of the product URL.
|
37 |
+
*
|
38 |
+
* @var string
|
39 |
+
*/
|
40 |
+
protected $product_slug = '';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Parameter for the updater: product ID (name).
|
44 |
+
*
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
protected $product_id = '';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Used in the `load_textdomain` call.
|
51 |
+
*
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
protected $textdomain = '';
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Constructor.
|
58 |
+
*
|
59 |
+
* @param string $the__file__ Pass `__FILE__` from the loader.
|
60 |
+
*/
|
61 |
+
public function __construct( $the__file__ ) {
|
62 |
+
$this->plugin_file = $the__file__;
|
63 |
+
$this->plugin_basename = plugin_basename( $this->plugin_file );
|
64 |
+
$this->plugin_dir_url = plugin_dir_url( $this->plugin_file );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Setup updater.
|
69 |
+
* All parameters must be set by the child class' constructor.
|
70 |
+
*/
|
71 |
+
public function setup_updater() {
|
72 |
+
if ( $this->plugin_file && $this->product_id && $this->product_slug ) {
|
73 |
+
/* @noinspection PhpUndefinedClassInspection */
|
74 |
+
new TIVWP_Updater( array(
|
75 |
+
'plugin_file' => $this->plugin_file,
|
76 |
+
'product_id' => $this->product_id,
|
77 |
+
'url_product' => WPGlobus::URL_WPGLOBUS_SITE . 'product/' .
|
78 |
+
$this->product_slug . '/',
|
79 |
+
) );
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Load PO/MO.
|
85 |
+
* The parameter must be set by the child class' constructor.
|
86 |
+
*/
|
87 |
+
public function load_translations() {
|
88 |
+
if ( $this->textdomain ) {
|
89 |
+
load_plugin_textdomain( $this->textdomain, false,
|
90 |
+
dirname( $this->plugin_basename ) . '/languages'
|
91 |
+
);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/* EOF */
|
trunk/includes/class-wpglobus-post-types.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WPGlobus Post Types
|
4 |
+
*
|
5 |
+
* @package WPGlobus
|
6 |
+
* @since 1.9.10
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Post_Types
|
11 |
+
*/
|
12 |
+
class WPGlobus_Post_Types {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Names of the CPTs that should not be visible in the WPGlobus options panel.
|
16 |
+
*
|
17 |
+
* @var string[]
|
18 |
+
*/
|
19 |
+
protected static $hidden_types_main = array(
|
20 |
+
/**
|
21 |
+
* Built-in.
|
22 |
+
* @see create_initial_post_types() in wp-includes\post.php
|
23 |
+
*/
|
24 |
+
'attachment',
|
25 |
+
'revision',
|
26 |
+
'nav_menu_item',
|
27 |
+
'custom_css',
|
28 |
+
'customize_changeset',
|
29 |
+
'oembed_cache',
|
30 |
+
'user_request', // @since 1.9.17
|
31 |
+
// Custom types that do not need WPGlobus' tabbed interface or those that we cannot handle.
|
32 |
+
'scheduled-action',
|
33 |
+
'wp-types-group',
|
34 |
+
'wp-types-user-group',
|
35 |
+
'wp-types-term-group',
|
36 |
+
'wpcf7_contact_form',
|
37 |
+
'tablepress_table',
|
38 |
+
// ACF: free and pro.
|
39 |
+
'acf',
|
40 |
+
'acf-field',
|
41 |
+
'acf-field-group',
|
42 |
+
// Gutenberg: @since 1.9.17
|
43 |
+
'wp_block',
|
44 |
+
// Gutenberg: @since 2.2.20
|
45 |
+
'wp_template',
|
46 |
+
'wp_area',
|
47 |
+
// Gutenberg: @since 2.5.14
|
48 |
+
'wp_template_part',
|
49 |
+
'wp_global_styles',
|
50 |
+
// WPBakery PB: @since 1.9.17
|
51 |
+
'vc4_templates',
|
52 |
+
'vc_grid_item',
|
53 |
+
// Elementor: @since 2.2.7
|
54 |
+
'elementor_library',
|
55 |
+
// NextGEN Gallery: @since 2.2.29
|
56 |
+
'ngg_album',
|
57 |
+
'ngg_gallery',
|
58 |
+
'ngg_pictures',
|
59 |
+
'lightbox_library',
|
60 |
+
'displayed_gallery',
|
61 |
+
'display_type',
|
62 |
+
'gal_display_source',
|
63 |
+
// MC4WP: Mailchimp for WordPress(https://wordpress.org/plugins/mailchimp-for-wp/) : @since 2.2.32
|
64 |
+
'mc4wp-form',
|
65 |
+
// Pods: https://wordpress.org/plugins/pods/ @since 2.2.34
|
66 |
+
'_pods_template',
|
67 |
+
'_pods_pod',
|
68 |
+
'_pods_field',
|
69 |
+
// Elementor Pro: @since 2.3.1
|
70 |
+
'elementor_font',
|
71 |
+
'elementor_icons',
|
72 |
+
// WPForms Lite: https://wordpress.org/plugins/wpforms-lite/ @since 2.3.6
|
73 |
+
'wpforms',
|
74 |
+
'wpforms_log',
|
75 |
+
// rtMedia for WordPress, BuddyPress and bbPress: https://wordpress.org/plugins/buddypress-media/ @since 2.3.12
|
76 |
+
'rtmedia_album',
|
77 |
+
// Divi: https://www.elegantthemes.com/gallery/divi/ @since 2.3.12
|
78 |
+
'et_theme_builder',
|
79 |
+
'et_template',
|
80 |
+
'et_header_layout',
|
81 |
+
'et_body_layout',
|
82 |
+
'et_footer_layout',
|
83 |
+
// GDPR Cookie Consent: https://wordpress.org/plugins/cookie-law-info/ @since 2.4.14
|
84 |
+
'cookielawinfo',
|
85 |
+
// Advanced Post List: https://wordpress.org/plugins/advanced-post-list/ @since 2.4.15
|
86 |
+
'apl_post_list',
|
87 |
+
'apl_design',
|
88 |
+
// Molongui Author Box: https://wordpress.org/plugins/molongui-authorship/ @since 2.5.3
|
89 |
+
'guest_author',
|
90 |
+
// Comments – wpDiscuz: https://wordpress.org/plugins/wpdiscuz/ @since 2.5.4
|
91 |
+
'wpdiscuz_form',
|
92 |
+
// FooGallery: https://wordpress.org/plugins/foogallery/ @since 2.5.11
|
93 |
+
'foogallery',
|
94 |
+
// Customizable WordPress Gallery Plugin – Modula Image Gallery: https://wordpress.org/plugins/modula-best-grid-gallery/ @since 2.5.11
|
95 |
+
'modula-gallery',
|
96 |
+
// Kali Forms - WordPress Forms Made Easy: https://wordpress.org/plugins/kali-forms/ @since 2.5.11
|
97 |
+
'kaliforms_forms',
|
98 |
+
// Schema & Structured Data for WP & AMP: https://wordpress.org/plugins/schema-and-structured-data-for-wp/ @since 2.5.13
|
99 |
+
'saswp_reviews',
|
100 |
+
'saswp_rvs_location',
|
101 |
+
'saswp-collections',
|
102 |
+
// Getwid – Gutenberg Blocks: https://wordpress.org/plugins/getwid/ @since 2.5.15
|
103 |
+
'getwid_template_part',
|
104 |
+
// Web Stories: https://wordpress.org/plugins/web-stories/ @since 2.5.15
|
105 |
+
'web-story-template',
|
106 |
+
'web-story',
|
107 |
+
// 3D FlipBook Dflip Lite: https://wordpress.org/plugins/3d-flipbook-dflip-lite/ @since 2.5.17
|
108 |
+
'dflip',
|
109 |
+
// https://oceanwp.org/ @since 2.5.17
|
110 |
+
'oceanwp_library',
|
111 |
+
// Ultimate Member – User Profile, User Registration, Login & Membership Plugin: https://wordpress.org/plugins/ultimate-member/ @since 2.6.2
|
112 |
+
'um_form',
|
113 |
+
'um_directory',
|
114 |
+
// Popup Maker – Popup for opt-ins, lead gen, & more: https://wordpress.org/plugins/popup-maker/ @since 2.6.4
|
115 |
+
'popup',
|
116 |
+
'popup_theme',
|
117 |
+
// Popup Builder — Responsive WordPress Pop up: https://ru.wordpress.org/plugins/popup-builder/ @since 2.6.5
|
118 |
+
'popupbuilder',
|
119 |
+
// Simple Custom CSS and JS: https://wordpress.org/plugins/custom-css-js/ @since 2.6.6
|
120 |
+
'custom-css-js',
|
121 |
+
// Content Blocks (Custom Post Widget): https://wordpress.org/plugins/custom-post-widget/ @since 2.6.6
|
122 |
+
'content_block',
|
123 |
+
);
|
124 |
+
|
125 |
+
/**
|
126 |
+
* WooCommerce types: we either force-enable them in WPG-WC or we do not need to handle them.
|
127 |
+
* Will hide them only if WooCommerce is active, to prevent potential conflict with other plugins
|
128 |
+
* that may use the same ("product") type(s).
|
129 |
+
*
|
130 |
+
* @var string[]
|
131 |
+
*/
|
132 |
+
protected static $hidden_types_wc = array(
|
133 |
+
'product',
|
134 |
+
'product_variation',
|
135 |
+
'shop_subscription',
|
136 |
+
'shop_coupon',
|
137 |
+
'shop_order',
|
138 |
+
'shop_order_refund',
|
139 |
+
);
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get hidden post types.
|
143 |
+
*
|
144 |
+
* @return string[]
|
145 |
+
*/
|
146 |
+
public static function hidden_types() {
|
147 |
+
|
148 |
+
/**
|
149 |
+
* @since 2.3.6
|
150 |
+
* @see https://themeforest.net/item/bodega-a-stylish-theme-for-small-businesses/10276763
|
151 |
+
*/
|
152 |
+
if ( defined('BODEGA_CORE_VERSION') ) {
|
153 |
+
self::$hidden_types_main[] = 'testimonials';
|
154 |
+
self::$hidden_types_main[] = 'slides';
|
155 |
+
self::$hidden_types_main[] = 'carousels';
|
156 |
+
}
|
157 |
+
|
158 |
+
$hidden_types = self::$hidden_types_main;
|
159 |
+
|
160 |
+
if ( class_exists( 'WooCommerce', false ) ) {
|
161 |
+
$hidden_types = array_merge( $hidden_types, self::$hidden_types_wc );
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Filter for hidden post types.
|
166 |
+
* @see filter `wpglobus_disabled_entities` in includes\class-wpglobus.php for admin.
|
167 |
+
*
|
168 |
+
* @since 2.3.2
|
169 |
+
*
|
170 |
+
* @param array $hidden_types Array of hidden types.
|
171 |
+
*/
|
172 |
+
$hidden_types = apply_filters( 'wpglobus_hidden_types', $hidden_types );
|
173 |
+
|
174 |
+
return $hidden_types;
|
175 |
+
}
|
176 |
+
}
|
trunk/includes/class-wpglobus-redirect.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package WPGlobus
|
4 |
+
* @since 1.8.0
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class WPGlobus_Redirect
|
9 |
+
*/
|
10 |
+
class WPGlobus_Redirect {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Constructor.
|
14 |
+
*/
|
15 |
+
public static function construct() {
|
16 |
+
add_action( 'wp', array( __CLASS__, 'on__init' ), 1 );
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Init action.
|
21 |
+
*/
|
22 |
+
public static function on__init() {
|
23 |
+
|
24 |
+
if ( empty( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { // WPCS: input var ok, sanitization ok.
|
25 |
+
// No language information in browser.
|
26 |
+
return;
|
27 |
+
}
|
28 |
+
|
29 |
+
$cookie_name = WPGlobus::_COOKIE;
|
30 |
+
|
31 |
+
if ( ! isset( $_COOKIE[ $cookie_name ] ) ) { // WPCS: input var ok, sanitization ok.
|
32 |
+
/**
|
33 |
+
* First visit.
|
34 |
+
*/
|
35 |
+
$browser_language = substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ); // WPCS: input var ok, sanitization ok.
|
36 |
+
/* @noinspection SummerTimeUnsafeTimeManipulationInspection */
|
37 |
+
setcookie( $cookie_name, $browser_language, time() + 3600 * 24 * 365, '/' );
|
38 |
+
self::redirect( $browser_language );
|
39 |
+
|
40 |
+
return;
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Redirect to specified language.
|
47 |
+
*
|
48 |
+
* @param string $language
|
49 |
+
*/
|
50 |
+
public static function redirect( $language ) {
|
51 |
+
|
52 |
+
if ( $language === WPGlobus::Config()->language ) {
|
53 |
+
// Already in that language.
|
54 |
+
return;
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( ! in_array( $language, WPGlobus::Config()->enabled_languages, true ) ) {
|
58 |
+
// No such language.
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
|
62 |
+
// Convert the current URL to the requested language and redirect.
|
63 |
+
$current_url = WPGlobus_Utils::current_url();
|
64 |
+
$redirect_to = WPGlobus_Utils::localize_url( $current_url, $language );
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Filter the `$redirect_to` URL.
|
68 |
+
* Returning a false value cancels redirect.
|
69 |
+
*
|
70 |
+
* @param string $redirect_to URL redirect to.
|
71 |
+
* @param string $language Language redirect to.
|
72 |
+
*
|
73 |
+
* @return string|false
|
74 |
+
*/
|
75 |
+
$redirect_to = apply_filters( 'wpglobus_first_visit_redirect', $redirect_to, $language );
|
76 |
+
|
77 |
+
if ( ! $redirect_to ) {
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* @todo This is for the old versions of WPGlobus Plus that do not have the above filter.
|
83 |
+
*/
|
84 |
+
if ( class_exists( 'WPGlobusPlus_Publish' )
|
85 |
+
&& version_compare( WPGLOBUS_PLUS_VERSION, '1.1.31', '<' )
|
86 |
+
&& is_singular()
|
87 |
+
) {
|
88 |
+
$post_status = get_post_meta( get_the_ID(), WPGlobusPlus_Publish::LANGUAGE_POST_STATUS, true );
|
89 |
+
if ( isset( $post_status[ $language ] ) && 'draft' === $post_status[ $language ] ) {
|
90 |
+
// This language is set to draft by WPGlobus Plus.
|
91 |
+
return;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
wp_redirect( $redirect_to );
|
96 |
+
exit;
|
97 |
+
|
98 |
+
}
|
99 |
+
}
|
trunk/includes/class-wpglobus-rest-api.php
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File: class-wpglobus-rest-api.php
|
4 |
+
*
|
5 |
+
* @package WPGlobus
|
6 |
+
* @since 2.5.7
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPGlobus_Rest_API
|
11 |
+
*/
|
12 |
+
if ( ! class_exists( 'WPGlobus_Rest_API' ) ) :
|
13 |
+
|
14 |
+
class WPGlobus_Rest_API {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* The name of the WPGlobus field.
|
18 |
+
*
|
19 |
+
* @since 2.5.10
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
const REST_FIELD_NAME = 'translation';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Constructor.
|
26 |
+
*/
|
27 |
+
public static function construct() {
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @see wp-includes\rest-api.php
|
31 |
+
*/
|
32 |
+
add_action( 'rest_api_init', array( __CLASS__, 'on__rest_api_init' ), 5 );
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Preparing to serve an API request.
|
37 |
+
*
|
38 |
+
* @since 2.5.10
|
39 |
+
*
|
40 |
+
* @param WP_REST_Server $wp_rest_server Server object.
|
41 |
+
*/
|
42 |
+
public static function on__rest_api_init( WP_REST_Server $wp_rest_server ) {
|
43 |
+
|
44 |
+
$public_post_types = self::get_public_post_types();
|
45 |
+
|
46 |
+
foreach ( $public_post_types as $post_type ) {
|
47 |
+
/**
|
48 |
+
* @see wp-includes\rest-api.php
|
49 |
+
*/
|
50 |
+
register_rest_field(
|
51 |
+
$post_type,
|
52 |
+
self::REST_FIELD_NAME,
|
53 |
+
array(
|
54 |
+
'get_callback' => array( __CLASS__, 'rest_field__for_post' ),
|
55 |
+
)
|
56 |
+
);
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Registers a new field.
|
63 |
+
*
|
64 |
+
*
|
65 |
+
* @param string|array $object_type Object(s) the field is being registered
|
66 |
+
* to, "post"|"term"|"comment" etc.
|
67 |
+
* @param string $attribute The attribute name.
|
68 |
+
* @param array $args {
|
69 |
+
* Optional. An array of arguments used to handle the registered field.
|
70 |
+
*
|
71 |
+
* @type callable|null $get_callback Optional. The callback function used to retrieve the field value. Default is
|
72 |
+
* 'null', the field will not be returned in the response. The function will
|
73 |
+
* be passed the prepared object data.
|
74 |
+
* @type callable|null $update_callback Optional. The callback function used to set and update the field value. Default
|
75 |
+
* is 'null', the value cannot be set or updated. The function will be passed
|
76 |
+
* the model object, like WP_Post.
|
77 |
+
* @type array|null $schema Optional. The callback function used to create the schema for this field.
|
78 |
+
* Default is 'null', no schema entry will be returned.
|
79 |
+
* }
|
80 |
+
*/
|
81 |
+
public static function rest_field__for_post( $object_type, $attribute, $args ) {
|
82 |
+
|
83 |
+
if ( 'attachment' == $object_type['type'] ) {
|
84 |
+
$_fields = array( 'title' );
|
85 |
+
/**
|
86 |
+
* @W.I.P @since 2.5.10 Add description, caption, alternative text fields for attachment.
|
87 |
+
*/
|
88 |
+
} else {
|
89 |
+
$_fields = array( 'title', 'content', 'excerpt' );
|
90 |
+
}
|
91 |
+
|
92 |
+
$response = array(
|
93 |
+
'provider' => 'WPGlobus',
|
94 |
+
'version' => WPGLOBUS_VERSION,
|
95 |
+
'language' => WPGlobus::Config()->language,
|
96 |
+
'enabled_languages' => WPGlobus::Config()->enabled_languages,
|
97 |
+
'languages' => null
|
98 |
+
);
|
99 |
+
|
100 |
+
foreach( WPGlobus::Config()->enabled_languages as $_language ) {
|
101 |
+
foreach( $_fields as $_field ) {
|
102 |
+
if ( empty( $object_type[$_field]['raw'] ) ) {
|
103 |
+
$response['languages'][$_language][$_field] = false;
|
104 |
+
} else {
|
105 |
+
$response['languages'][$_language][$_field] = WPGlobus_Core::has_translation( $object_type[$_field]['raw'], $_language );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
return $response;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns an array with the public post types.
|
115 |
+
*
|
116 |
+
* @since 2.5.10
|
117 |
+
*
|
118 |
+
* @param string $output The output type to use.
|
119 |
+
*
|
120 |
+
* @return array Array with all the public post_types.
|
121 |
+
*/
|
122 |
+
public static function get_public_post_types( $output = 'names' ) {
|
123 |
+
return get_post_types( array( 'public' => true ), $output );
|
124 |
+
}
|
125 |
+
|
126 |
+
} // class
|
127 |
+
|
128 |
+
endif;
|
129 |
+
|
130 |
+
# --- EOF
|
trunk/includes/class-wpglobus-utils.php
ADDED
@@ -0,0 +1,510 @@
|
|
|
|
|
|
|
|
|
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
|
4 |
+
*
|
5 |
+
* @package WPGlobus
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPGlobus_Utils
|
10 |
+
*/
|
11 |
+
class WPGlobus_Utils {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Localize URL by inserting language prefix
|
15 |
+
*
|
16 |
+
* @param string $url URL to localize
|
17 |
+
* @param string $language Language code
|
18 |
+
* @param WPGlobus_Config $config Alternative configuration (i.e. Unit Test mock object)
|
19 |
+
*
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public static function localize_url( $url = '', $language = '', WPGlobus_Config $config = null ) {
|
23 |
+
/**
|
24 |
+
* Use the global configuration if alternative not passed
|
25 |
+
*/
|
26 |
+
if ( null === $config ) {
|
27 |
+
// @codeCoverageIgnoreStart
|
28 |
+
$config = WPGlobus::Config();
|
29 |
+
}
|
30 |
+
// @codeCoverageIgnoreEnd
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Use the current language if not passed
|
34 |
+
*/
|
35 |
+
$language = empty( $language ) ? $config->language : $language;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Local cache to speed-up processing on pages with multiple links.
|
39 |
+
*/
|
40 |
+
static $cache = array();
|
41 |
+
if ( isset( $cache[ $language ][ $url ] ) ) {
|
42 |
+
return $cache[ $language ][ $url ];
|
43 |
+
}
|
44 |
+
if ( ! isset( $cache[ $language ] ) ) {
|
45 |
+
$cache[ $language ] = array();
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* In Admin-Settings-General:
|
50 |
+
* WordPress Address (URL) is site_url()
|
51 |
+
* Site Address (URL) is home_url
|
52 |
+
* We need home_url, and we cannot use the @home_url function,
|
53 |
+
* because it will filter back here causing endless loop.
|
54 |
+
*
|
55 |
+
* @todo Multisite?
|
56 |
+
*/
|
57 |
+
$home_url = get_option( 'home' );
|
58 |
+
|
59 |
+
/**
|
60 |
+
* `hide_default_language` means "Do not use language code in the default URL"
|
61 |
+
* So, no /en/page/, just /page/
|
62 |
+
*/
|
63 |
+
if ( $language === $config->default_language && $config->hide_default_language ) {
|
64 |
+
$language_url_prefix = '';
|
65 |
+
} else {
|
66 |
+
/**
|
67 |
+
* Language prefix looks like '/ru'
|
68 |
+
*/
|
69 |
+
$language_url_prefix = '/' . $language;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* For the following regex, we need home_url without prefix
|
74 |
+
* http://www.example.com becomes example.com
|
75 |
+
*/
|
76 |
+
$home_domain_tld = self::domain_tld( $home_url );
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Regex to replace current language prefix with the requested one.
|
80 |
+
*
|
81 |
+
* @example ^(https?:\/\/(?:.+\.)?example\.com)(?:\/?(?:en|ru|pt))?($|\/$|[\/#\?].*$)
|
82 |
+
*/
|
83 |
+
|
84 |
+
/**
|
85 |
+
* The "host+path" part of the URL (captured)
|
86 |
+
* We ignore http(s) and domain prefix, but we must match the domain-tld, so any external URLs
|
87 |
+
* are not localized.
|
88 |
+
*/
|
89 |
+
$re_host_part = '(https?:\/\/(?:.+\.)?' .
|
90 |
+
str_replace( '.', '\.', $home_domain_tld ) .
|
91 |
+
str_replace( '/', '\/', parse_url( $home_url, PHP_URL_PATH ) )
|
92 |
+
. ')';
|
93 |
+
|
94 |
+
/**
|
95 |
+
* The "language" part (optional, not captured, will be thrown away)
|
96 |
+
*/
|
97 |
+
$re_language_part = '(?:\/?(?:' . implode( '|', $config->enabled_languages ) . '))?';
|
98 |
+
|
99 |
+
/**
|
100 |
+
* The rest of the URL. Can be:
|
101 |
+
* - Nothing or trailing slash, or
|
102 |
+
* - Slash, hash or question and optionally anything after
|
103 |
+
* *
|
104 |
+
* Using 'or' regex to capture things like '/rush' or '/designer/' correctly,
|
105 |
+
* and not extract '/ru' or '/de' from them,
|
106 |
+
*/
|
107 |
+
$re_trailer = '(\/?|[\/#\?].*)';
|
108 |
+
|
109 |
+
$re = '!^' . $re_host_part . $re_language_part . $re_trailer . '$!';
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Replace the existing (or empty) language prefix with the requested one
|
113 |
+
*/
|
114 |
+
$localized_url = preg_replace( $re, '\1' . $language_url_prefix . '\2', $url );
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Cache it.
|
118 |
+
*/
|
119 |
+
$cache[ $language ][ $url ] = $localized_url;
|
120 |
+
|
121 |
+
return $localized_url;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Extract language from URL
|
126 |
+
* http://example.com/ru/page/ returns 'ru'
|
127 |
+
*
|
128 |
+
* @param string $url
|
129 |
+
* @param WPGlobus_Config $config Alternative configuration (i.e. Unit Test mock object)
|
130 |
+
*
|
131 |
+
* @return string
|
132 |
+
*/
|
133 |
+
public static function extract_language_from_url( $url = '', WPGlobus_Config $config = null ) {
|
134 |
+
|
135 |
+
$language = '';
|
136 |
+
|
137 |
+
if ( ! is_string( $url ) ) {
|
138 |
+
return $language;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Use the global configuration is alternative not passed
|
143 |
+
*/
|
144 |
+
if ( null === $config ) {
|
145 |
+
// @codeCoverageIgnoreStart
|
146 |
+
$config = WPGlobus::Config();
|
147 |
+
}
|
148 |
+
// @codeCoverageIgnoreEnd
|
149 |
+
|
150 |
+
$path = parse_url( $url, PHP_URL_PATH );
|
151 |
+
|
152 |
+
$path_home = untrailingslashit( parse_url( get_option( 'home' ), PHP_URL_PATH ) );
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Regex to find the language prefix.
|
156 |
+
*
|
157 |
+
* @example !^/(en|ru|pt)/!
|
158 |
+
*/
|
159 |
+
$re = '!^' . $path_home .
|
160 |
+
'/(' . implode( '|', $config->enabled_languages ) . ')(?:/|$)' . '!';
|
161 |
+
|
162 |
+
if ( preg_match( $re, $path, $match ) ) {
|
163 |
+
// Found language information
|
164 |
+
$language = $match[1];
|
165 |
+
}
|
166 |
+
|
167 |
+
return $language;
|
168 |
+
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Check if was called by a specific function (could be any levels deep).
|
173 |
+
* @deprecated 1.7.7 Use WPGlobus_WP::is_function_in_backtrace()
|
174 |
+
* @see WPGlobus_WP::is_function_in_backtrace()
|
175 |
+
*
|
176 |
+
* @param string|callable $function_name Function name or array(class,function).
|
177 |
+
*
|
178 |
+
* @return bool True if Function is in backtrace.
|
179 |
+
*/
|
180 |
+
public static function is_function_in_backtrace( $function_name ) {
|
181 |
+
_deprecated_function( __METHOD__, 'WPGlobus 1.7.7', 'WPGlobus_WP::is_function_in_backtrace()' );
|
182 |
+
|
183 |
+
return WPGlobus_WP::is_function_in_backtrace( $function_name );
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Strip the prefix from the host name
|
188 |
+
* http://www.example.com becomes example.com
|
189 |
+
*
|
190 |
+
* @param string $url
|
191 |
+
*
|
192 |
+
* @return string
|
193 |
+
* @since 1.0.12
|
194 |
+
*/
|
195 |
+
public static function domain_tld( $url ) {
|
196 |
+
|
197 |
+
$pre = '';
|
198 |
+
/**
|
199 |
+
* Short-circuit processing to provide own return for the cases not covered by the algorithm.
|
200 |
+
* Ex. www.example.carrara-massa.it (carrara-massa.it is a TLD)
|
201 |
+
*
|
202 |
+
* @param string $pre Empty string. Return your domain_tld instead.
|
203 |
+
* @param string $url The URL to extract domain_tld from.
|
204 |
+
*/
|
205 |
+
$pre = apply_filters( 'wpglobus_pre_domain_tld', $pre, $url );
|
206 |
+
if ( $pre ) {
|
207 |
+
return $pre;
|
208 |
+
}
|
209 |
+
|
210 |
+
// URL passed with no scheme. parse_url will think it's a path only. Let's add a scheme.
|
211 |
+
if ( ! preg_match( '!^(?:https?:)?//!', $url ) ) {
|
212 |
+
$url = '//' . $url;
|
213 |
+
}
|
214 |
+
|
215 |
+
$host = parse_url( $url, PHP_URL_HOST );
|
216 |
+
|
217 |
+
if ( ! $host ) {
|
218 |
+
// parse_url failed. We cannot do much. Let's return the original url.
|
219 |
+
return $url;
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Extract domain-tld from the host.
|
224 |
+
* Note: this does not cover all possible public suffixes.
|
225 |
+
* Using the proper algorithm based PublicList might be resource-consuming.
|
226 |
+
* We'll provide a filter for special cases instead.
|
227 |
+
*
|
228 |
+
* @link https://publicsuffix.org/list/
|
229 |
+
*/
|
230 |
+
$re = '/([a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6})$/';
|
231 |
+
$domain_tld = $host;
|
232 |
+
if ( preg_match( $re, $host, $matches ) ) {
|
233 |
+
$domain_tld = $matches[1];
|
234 |
+
}
|
235 |
+
|
236 |
+
return $domain_tld;
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Convert array of local texts to multilingual string (with WPGlobus delimiters)
|
241 |
+
*
|
242 |
+
* @param string[] $translations
|
243 |
+
*
|
244 |
+
* @return string
|
245 |
+
*/
|
246 |
+
public static function build_multilingual_string( $translations ) {
|
247 |
+
$sz = '';
|
248 |
+
$single = ( 1 === count( $translations ) );
|
249 |
+
foreach ( $translations as $language => $text ) {
|
250 |
+
if ( $single && $language === WPGlobus::Config()->default_language ) {
|
251 |
+
$sz = $text;
|
252 |
+
} else {
|
253 |
+
$sz .= WPGlobus::add_locale_marks( $text, $language );
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
return $sz;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Returns the current URL.
|
262 |
+
* There is no method of getting the current URL in WordPress.
|
263 |
+
* Various snippets published on the Web use a combination of home_url and add_query_arg.
|
264 |
+
* However, none of them work when WordPress is installed in a subfolder.
|
265 |
+
* The method below looks valid. There is a theoretical chance of HTTP_HOST tampered, etc.
|
266 |
+
* However, the same line of code is used by the WordPress core,
|
267 |
+
* for example in @see wp_admin_canonical_url, so we are going to use it, too
|
268 |
+
* *
|
269 |
+
* Note that #hash is always lost because it's a client-side parameter.
|
270 |
+
* We might add it using a JavaScript call.
|
271 |
+
*
|
272 |
+
* @since 1.1.1
|
273 |
+
*/
|
274 |
+
public static function current_url() {
|
275 |
+
return \set_url_scheme( 'http://' . self::http_host() . self::request_uri('/') );
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Build hreflang metas.
|
280 |
+
*
|
281 |
+
* @since 1.1.1
|
282 |
+
* @since 2.3.4 Revised code.
|
283 |
+
*
|
284 |
+
* @param WPGlobus_Config $config Alternative configuration (i.e. Unit Test mock object)
|
285 |
+
*
|
286 |
+
* @return string[] Array of rel-alternate link tags
|
287 |
+
*/
|
288 |
+
public static function hreflangs( WPGlobus_Config $config = null ) {
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Use the global configuration is alternative not passed
|
292 |
+
*/
|
293 |
+
if ( null === $config ) {
|
294 |
+
// @codeCoverageIgnoreStart
|
295 |
+
$config = WPGlobus::Config();
|
296 |
+
}
|
297 |
+
// @codeCoverageIgnoreEnd
|
298 |
+
|
299 |
+
$hreflangs = array();
|
300 |
+
|
301 |
+
if ( is_404() ) {
|
302 |
+
return $hreflangs;
|
303 |
+
}
|
304 |
+
|
305 |
+
foreach ( $config->enabled_languages as $language ) {
|
306 |
+
|
307 |
+
switch ( $config->seo_hreflang_type ) {
|
308 |
+
case 'zz':
|
309 |
+
$_hreflang_type = $language;
|
310 |
+
break;
|
311 |
+
case 'zz-zz':
|
312 |
+
$_hreflang_type = str_replace( '_', '-', strtolower($config->locale[ $language ]) );
|
313 |
+
break;
|
314 |
+
default :
|
315 |
+
// 'zz-ZZ'
|
316 |
+
$_hreflang_type = str_replace( '_', '-', $config->locale[ $language ] );
|
317 |
+
break;
|
318 |
+
}
|
319 |
+
|
320 |
+
if ( $language == $config->default_language ) {
|
321 |
+
if ( ! empty($config->seo_hreflang_default_language_type) && $config->seo_hreflang_default_language_type ) {
|
322 |
+
$_hreflang_type = $config->seo_hreflang_default_language_type;
|
323 |
+
|
324 |
+
}
|
325 |
+
}
|
326 |
+
|
327 |
+
$hreflangs[ $language ] = sprintf( '<link rel="alternate" hreflang="%s" href="%s"/>',
|
328 |
+
$_hreflang_type,
|
329 |
+
esc_url( WPGlobus_Utils::localize_current_url( $language, $config ) )
|
330 |
+
);
|
331 |
+
|
332 |
+
}
|
333 |
+
|
334 |
+
return $hreflangs;
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Localize the current URL.
|
339 |
+
* @since 1.2.3
|
340 |
+
*
|
341 |
+
* @param string $language Language to localize the URL to.
|
342 |
+
* @param WPGlobus_Config $config Alternative configuration (i.e. Unit Test mock object)
|
343 |
+
*
|
344 |
+
* @return string
|
345 |
+
*/
|
346 |
+
public static function localize_current_url( $language = '', WPGlobus_Config $config = null ) {
|
347 |
+
/**
|
348 |
+
* Filter the current URL before it is localized (a short-circuit filter).
|
349 |
+
* If a non-empty string is returned by the filter, then the `localize_url()`
|
350 |
+
* won't be called.
|
351 |
+
*
|
352 |
+
* @param string $url Empty string is passed.
|
353 |
+
* @param string $language The language that the URL is going to be localized to.
|
354 |
+
*
|
355 |
+
* @return string
|
356 |
+
*/
|
357 |
+
$url = apply_filters( 'wpglobus_pre_localize_current_url', '', $language );
|
358 |
+
|
359 |
+
if ( ! $url ) {
|
360 |
+
/**
|
361 |
+
* Use the global configuration if alternative not passed
|
362 |
+
*/
|
363 |
+
if ( null === $config ) {
|
364 |
+
// @codeCoverageIgnoreStart
|
365 |
+
$config = WPGlobus::Config();
|
366 |
+
}
|
367 |
+
// @codeCoverageIgnoreEnd
|
368 |
+
$url = WPGlobus_Utils::localize_url( WPGlobus_Utils::current_url(), $language, $config );
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Filter the current URL after it was localized.
|
373 |
+
*
|
374 |
+
* @since 1.8.1
|
375 |
+
*
|
376 |
+
* @param string $url The localized URL.
|
377 |
+
* @param string $language The language it was localized to.
|
378 |
+
*
|
379 |
+
* @return string
|
380 |
+
*/
|
381 |
+
$url = apply_filters( 'wpglobus_after_localize_current_url', $url, $language );
|
382 |
+
|
383 |
+
return $url;
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Localize wpglobus.com for use in outgoing links
|
388 |
+
*
|
389 |
+
* @param WPGlobus_Config $config
|
390 |
+
*
|
391 |
+
* @return string
|
392 |
+
* @since 1.2.6
|
393 |
+
*/
|
394 |
+
public static function url_wpglobus_site( WPGlobus_Config $config = null ) {
|
395 |
+
if ( null === $config ) {
|
396 |
+
// @codeCoverageIgnoreStart
|
397 |
+
$config = WPGlobus::Config();
|
398 |
+
}
|
399 |
+
// @codeCoverageIgnoreEnd
|
400 |
+
|
401 |
+
$url = WPGlobus::URL_WPGLOBUS_SITE;
|
402 |
+
if ( 'ru' === $config->language ) {
|
403 |
+
$url .= 'ru' . '/';
|
404 |
+
}
|
405 |
+
|
406 |
+
return $url;
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* @codeCoverageIgnore
|
411 |
+
* Return true if language is in array of enabled languages, otherwise false
|
412 |
+
*
|
413 |
+
* @param string $language
|
414 |
+
*
|
415 |
+
* @return bool
|
416 |
+
*/
|
417 |
+
public static function is_enabled( $language ) {
|
418 |
+
return in_array( $language, WPGlobus::Config()->enabled_languages, true );
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Secure access to scalars in $_GET.
|
423 |
+
*
|
424 |
+
* @param string $key Index ($_GET[ $key ]).
|
425 |
+
*
|
426 |
+
* @return string The value or empty string if not exists or not scalar.
|
427 |
+
*/
|
428 |
+
public static function safe_get( $key ) {
|
429 |
+
$value = '';
|
430 |
+
|
431 |
+
if ( isset( $_GET[ $key ] ) ) { // Input var okay.
|
432 |
+
$get_key = $_GET[ $key ]; // Input var okay; sanitization okay.
|
433 |
+
|
434 |
+
if ( is_scalar( $get_key ) ) {
|
435 |
+
$value = sanitize_text_field( $get_key );
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
return $value;
|
440 |
+
}
|
441 |
+
|
442 |
+
/**
|
443 |
+
* @todo The methods below are not used by the WPGlobus plugin.
|
444 |
+
* Need to check if they are used by any add-on.
|
445 |
+
* Marking them as deprecated so they will pop-up on code inspection.
|
446 |
+
*/
|
447 |
+
|
448 |
+
/**
|
449 |
+
* @deprecated
|
450 |
+
* @codeCoverageIgnore
|
451 |
+
* Return true if language is in array of opened languages, otherwise false
|
452 |
+
*
|
453 |
+
* @param string $language
|
454 |
+
*
|
455 |
+
* @return bool
|
456 |
+
*/
|
457 |
+
public static function is_open( $language ) {
|
458 |
+
return in_array( $language, WPGlobus::Config()->open_languages, true );
|
459 |
+
}
|
460 |
+
|
461 |
+
/**
|
462 |
+
* @deprecated
|
463 |
+
* @codeCoverageIgnore
|
464 |
+
*
|
465 |
+
* @param string $s
|
466 |
+
* @param string $n
|
467 |
+
*
|
468 |
+
* @return bool
|
469 |
+
*/
|
470 |
+
public static function starts_with( $s, $n ) {
|
471 |
+
if ( strlen( $n ) > strlen( $s ) ) {
|
472 |
+
return false;
|
473 |
+
}
|
474 |
+
|
475 |
+
/* @noinspection SubStrUsedAsStrPosInspection */
|
476 |
+
return ( $n === substr( $s, 0, strlen( $n ) ) );
|
477 |
+
}
|
478 |
+
|
479 |
+
/**
|
480 |
+
* Returns sanitized $_SERVER['REQUEST_URI'].
|
481 |
+
*
|
482 |
+
* @param string $default Default to return when unset.
|
483 |
+
*
|
484 |
+
* @return string
|
485 |
+
*/
|
486 |
+
public static function request_uri( $default = '' ) {
|
487 |
+
if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
|
488 |
+
// Something abnormal.
|
489 |
+
return $default;
|
490 |
+
}
|
491 |
+
|
492 |
+
return \esc_url_raw( \wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
493 |
+
}
|
494 |
+
|
495 |
+
/**
|
496 |
+
* Returns sanitized $_SERVER['HTTP_HOST'].
|
497 |
+
*
|
498 |
+
* @param string $default Default to return when unset.
|
499 |
+
*
|
500 |
+
* @return string
|
501 |
+
*/
|
502 |
+
public static function http_host( $default = 'localhost' ) {
|
503 |
+
if ( ! isset( $_SERVER['HTTP_HOST'] ) ) {
|
504 |
+
// Something abnormal. Maybe WP-CLI.
|
505 |
+
return
|