Version Description
- 2017-11-16
Download this release
Release Info
Developer | themeisle |
Plugin | NavMenu Addon For Elementor |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- CHANGELOG.md +3 -5
- assets/css/editor.css +36 -36
- assets/css/editor.min.css +36 -36
- assets/css/frontend.css +36 -36
- assets/css/frontend.min.css +36 -36
- assets/js/editor.js +362 -311
- assets/js/editor.min.js +362 -311
- assets/js/frontend.js +362 -311
- assets/js/frontend.min.js +365 -314
- elementor-navmenu.php +39 -5
- includes/class-tgm-plugin-activation.php +3855 -0
- modules/branding/module.info.php +2 -2
- modules/branding/widgets/elementor-branding.php +55 -55
- modules/menus/module.info.php +2 -2
- modules/menus/widgets/default-navmenu.php +158 -158
- modules/menus/widgets/elementor-branding.php +55 -55
- modules/menus/widgets/elementor-search.php +31 -31
- modules/menus/widgets/mega-menu.php +52 -52
- modules/menus/widgets/navmenu-overlay.php +51 -51
- modules/search/module.info.php +2 -2
- modules/search/widgets/elementor-search.php +31 -31
- plugin.php +2 -2
- readme.md +7 -1
- readme.txt +7 -1
CHANGELOG.md
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
|
2 |
-
### v1.1.
|
3 |
**Changes:**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
* Changed contributors.
|
7 |
-
* Removed Stable Tag.
|
8 |
|
9 |
### v1.1.0 - 2017-09-28
|
10 |
**Changes:**
|
1 |
|
2 |
+
### v1.1.1 - 2017-11-16
|
3 |
**Changes:**
|
4 |
+
* Add recommendation for Elementor Addons & Widgets.
|
5 |
+
* Tested up to 4.9.
|
|
|
|
|
6 |
|
7 |
### v1.1.0 - 2017-09-28
|
8 |
**Changes:**
|
assets/css/editor.css
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
-
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
@@ -78,7 +78,7 @@
|
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
-
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
@@ -129,7 +129,7 @@
|
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
-
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
@@ -143,7 +143,7 @@
|
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
-
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
@@ -174,7 +174,7 @@
|
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
-
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
@@ -213,14 +213,14 @@
|
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
-
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
-
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
@@ -232,15 +232,15 @@
|
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
-
|
236 |
-
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
-
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
@@ -252,7 +252,7 @@
|
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
-
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
@@ -294,7 +294,7 @@
|
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
-
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
@@ -308,9 +308,9 @@
|
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
@@ -350,7 +350,7 @@
|
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
-
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
@@ -446,13 +446,13 @@
|
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
-
z-index: 10;
|
450 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
@@ -519,7 +519,7 @@
|
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
-
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
@@ -540,7 +540,7 @@
|
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
-
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
@@ -629,14 +629,14 @@
|
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
-
.cbp-hssubmenu:before,
|
633 |
-
.cbp-hssubmenu:after {
|
634 |
-
content: " ";
|
635 |
-
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
-
.cbp-hssubmenu:after {
|
639 |
-
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
@@ -656,7 +656,7 @@
|
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
-
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
@@ -801,7 +801,7 @@
|
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
-
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
@@ -832,7 +832,7 @@
|
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
-
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
@@ -847,25 +847,25 @@
|
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
-
|
851 |
.menu-item-description {
|
852 |
-
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
-
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
-
margin-right: 0px;
|
862 |
-
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
-
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
+
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
+
font-family: FontAwesome;
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
+
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
+
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
+
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
+
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
+
|
236 |
+
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
+
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
+
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
+
backface-visibility: hidden;
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
+
width: calc(331px + 2rem);
|
312 |
+
padding: 0.1rem 1rem 0.567rem;
|
313 |
+
background-color: #ffffff;
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
+
backface-visibility: hidden;
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
+
z-index: 10;
|
450 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
+
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
+
font-weight: inherit;
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
+
.cbp-hssubmenu:before,
|
633 |
+
.cbp-hssubmenu:after {
|
634 |
+
content: " ";
|
635 |
+
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
+
.cbp-hssubmenu:after {
|
639 |
+
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
+
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
+
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
+
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
+
|
851 |
.menu-item-description {
|
852 |
+
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
+
font-size: 1.15em;
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
+
margin-right: 0px;
|
862 |
+
margin-left: 2px
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
+
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
assets/css/editor.min.css
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
-
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
@@ -78,7 +78,7 @@
|
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
-
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
@@ -129,7 +129,7 @@
|
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
-
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
@@ -143,7 +143,7 @@
|
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
-
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
@@ -174,7 +174,7 @@
|
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
-
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
@@ -213,14 +213,14 @@
|
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
-
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
-
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
@@ -232,15 +232,15 @@
|
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
-
|
236 |
-
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
-
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
@@ -252,7 +252,7 @@
|
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
-
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
@@ -294,7 +294,7 @@
|
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
-
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
@@ -308,9 +308,9 @@
|
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
@@ -350,7 +350,7 @@
|
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
-
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
@@ -446,13 +446,13 @@
|
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
-
z-index: 10;
|
450 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
@@ -519,7 +519,7 @@
|
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
-
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
@@ -540,7 +540,7 @@
|
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
-
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
@@ -629,14 +629,14 @@
|
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
-
.cbp-hssubmenu:before,
|
633 |
-
.cbp-hssubmenu:after {
|
634 |
-
content: " ";
|
635 |
-
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
-
.cbp-hssubmenu:after {
|
639 |
-
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
@@ -656,7 +656,7 @@
|
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
-
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
@@ -801,7 +801,7 @@
|
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
-
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
@@ -832,7 +832,7 @@
|
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
-
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
@@ -847,25 +847,25 @@
|
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
-
|
851 |
.menu-item-description {
|
852 |
-
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
-
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
-
margin-right: 0px;
|
862 |
-
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
-
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
+
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
+
font-family: FontAwesome;
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
+
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
+
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
+
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
+
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
+
|
236 |
+
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
+
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
+
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
+
backface-visibility: hidden;
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
+
width: calc(331px + 2rem);
|
312 |
+
padding: 0.1rem 1rem 0.567rem;
|
313 |
+
background-color: #ffffff;
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
+
backface-visibility: hidden;
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
+
z-index: 10;
|
450 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
+
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
+
font-weight: inherit;
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
+
.cbp-hssubmenu:before,
|
633 |
+
.cbp-hssubmenu:after {
|
634 |
+
content: " ";
|
635 |
+
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
+
.cbp-hssubmenu:after {
|
639 |
+
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
+
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
+
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
+
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
+
|
851 |
.menu-item-description {
|
852 |
+
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
+
font-size: 1.15em;
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
+
margin-right: 0px;
|
862 |
+
margin-left: 2px
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
+
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
assets/css/frontend.css
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
-
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
@@ -78,7 +78,7 @@
|
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
-
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
@@ -129,7 +129,7 @@
|
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
-
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
@@ -143,7 +143,7 @@
|
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
-
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
@@ -174,7 +174,7 @@
|
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
-
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
@@ -213,14 +213,14 @@
|
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
-
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
-
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
@@ -232,15 +232,15 @@
|
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
-
|
236 |
-
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
-
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
@@ -252,7 +252,7 @@
|
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
-
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
@@ -294,7 +294,7 @@
|
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
-
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
@@ -308,9 +308,9 @@
|
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
@@ -350,7 +350,7 @@
|
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
-
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
@@ -446,13 +446,13 @@
|
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
-
z-index: 10;
|
450 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
@@ -519,7 +519,7 @@
|
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
-
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
@@ -540,7 +540,7 @@
|
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
-
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
@@ -629,14 +629,14 @@
|
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
-
.cbp-hssubmenu:before,
|
633 |
-
.cbp-hssubmenu:after {
|
634 |
-
content: " ";
|
635 |
-
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
-
.cbp-hssubmenu:after {
|
639 |
-
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
@@ -656,7 +656,7 @@
|
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
-
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
@@ -801,7 +801,7 @@
|
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
-
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
@@ -832,7 +832,7 @@
|
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
-
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
@@ -847,25 +847,25 @@
|
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
-
|
851 |
.menu-item-description {
|
852 |
-
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
-
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
-
margin-right: 0px;
|
862 |
-
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
-
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
+
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
+
font-family: FontAwesome;
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
+
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
+
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
+
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
+
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
+
|
236 |
+
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
+
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
+
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
+
backface-visibility: hidden;
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
+
width: calc(331px + 2rem);
|
312 |
+
padding: 0.1rem 1rem 0.567rem;
|
313 |
+
background-color: #ffffff;
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
+
backface-visibility: hidden;
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
+
z-index: 10;
|
450 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
+
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
+
font-weight: inherit;
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
+
.cbp-hssubmenu:before,
|
633 |
+
.cbp-hssubmenu:after {
|
634 |
+
content: " ";
|
635 |
+
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
+
.cbp-hssubmenu:after {
|
639 |
+
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
+
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
+
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
+
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
+
|
851 |
.menu-item-description {
|
852 |
+
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
+
font-size: 1.15em;
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
+
margin-right: 0px;
|
862 |
+
margin-left: 2px
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
+
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
assets/css/frontend.min.css
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
-
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
@@ -78,7 +78,7 @@
|
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
-
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
@@ -129,7 +129,7 @@
|
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
-
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
@@ -143,7 +143,7 @@
|
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
-
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
@@ -174,7 +174,7 @@
|
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
-
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
@@ -213,14 +213,14 @@
|
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
-
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
-
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
@@ -232,15 +232,15 @@
|
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
-
|
236 |
-
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
-
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
@@ -252,7 +252,7 @@
|
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
-
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
@@ -294,7 +294,7 @@
|
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
-
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
@@ -308,9 +308,9 @@
|
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
@@ -350,7 +350,7 @@
|
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
-
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
@@ -446,13 +446,13 @@
|
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
-
z-index: 10;
|
450 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
-
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
@@ -519,7 +519,7 @@
|
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
-
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
@@ -540,7 +540,7 @@
|
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
-
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
@@ -629,14 +629,14 @@
|
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
-
.cbp-hssubmenu:before,
|
633 |
-
.cbp-hssubmenu:after {
|
634 |
-
content: " ";
|
635 |
-
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
-
.cbp-hssubmenu:after {
|
639 |
-
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
@@ -656,7 +656,7 @@
|
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
-
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
@@ -801,7 +801,7 @@
|
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
-
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
@@ -832,7 +832,7 @@
|
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
-
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
@@ -847,25 +847,25 @@
|
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
-
|
851 |
.menu-item-description {
|
852 |
-
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
-
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
-
margin-right: 0px;
|
862 |
-
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
-
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
4 |
-ms-flex: 0 1 100%;
|
5 |
flex: 0 1 100%;
|
6 |
margin: 0;
|
7 |
+
clear: both;
|
8 |
}
|
9 |
|
10 |
.elementor-menu.eltoggled-on,
|
78 |
border: 0 solid #d1d1d1;
|
79 |
border-left-width: 1px;
|
80 |
content: "\f107";
|
81 |
+
font-family: FontAwesome;
|
82 |
font-size: 24px;
|
83 |
left: 1px;
|
84 |
position: relative;
|
129 |
font-size: 1.0rem;
|
130 |
margin: 1.3125em 0;
|
131 |
padding: 0.8125em 0.875em 0.6875em;
|
132 |
+
}
|
133 |
}
|
134 |
|
135 |
@media screen and (min-width: 56.875em) {
|
143 |
.elementor-navigation {
|
144 |
margin: 0 -0.875em;
|
145 |
}
|
146 |
+
|
147 |
.elementor-navigation li {
|
148 |
display: inline-block;
|
149 |
}
|
174 |
.elementor-navigation ul ul a {
|
175 |
white-space: normal;
|
176 |
width: 12.6875em;
|
177 |
+
}
|
178 |
|
179 |
.elementor-navigation li:hover > ul,
|
180 |
.elementor-navigation li.focus > ul {
|
213 |
-ms-transform: rotate(-90deg);
|
214 |
transform: rotate(-90deg);
|
215 |
}
|
216 |
+
|
217 |
.elementor-align-left .elementor-navigation ul ul .menu-item-has-children > a:after {
|
218 |
-webkit-transform: rotate(-90deg);
|
219 |
-moz-transform: rotate(-90deg);
|
220 |
-ms-transform: rotate(-90deg);
|
221 |
transform: rotate(-90deg);
|
222 |
}
|
223 |
+
|
224 |
.elementor-align-left .elementor-navigation li:hover > ul,
|
225 |
.elementor-align-left .elementor-navigation li.focus > ul {
|
226 |
left: 0;
|
232 |
left: 100%;
|
233 |
right: auto;
|
234 |
}
|
235 |
+
|
236 |
+
|
237 |
.elementor-align-right .elementor-navigation ul ul .menu-item-has-children > a:after {
|
238 |
-webkit-transform: rotate(90deg);
|
239 |
-moz-transform: rotate(90deg);
|
240 |
-ms-transform: rotate(90deg);
|
241 |
transform: rotate(90deg);
|
242 |
}
|
243 |
+
|
244 |
.elementor-align-right .elementor-navigation li:hover > ul,
|
245 |
.elementor-align-right .elementor-navigation li.focus > ul {
|
246 |
left: auto;
|
252 |
left: auto;
|
253 |
right: 100%;
|
254 |
}
|
255 |
+
|
256 |
.eldropdown-toggle,
|
257 |
.elementor-navigation ul .eldropdown-toggle.eltoggled-on,
|
258 |
.elementor-menu-toggle {
|
294 |
-webkit-transition: opacity 100ms ease-in-out;
|
295 |
transition: opacity 100ms ease-in-out;
|
296 |
-webkit-backface-visibility: hidden;
|
297 |
+
backface-visibility: hidden;
|
298 |
}
|
299 |
.elementor-search input[type=submit]:hover,
|
300 |
.elementor-search input[type=button]:hover,
|
308 |
}
|
309 |
|
310 |
.elementor-search {
|
311 |
+
width: calc(331px + 2rem);
|
312 |
+
padding: 0.1rem 1rem 0.567rem;
|
313 |
+
background-color: #ffffff;
|
314 |
display: inline-block;
|
315 |
}
|
316 |
|
350 |
-webkit-transition: opacity 100ms ease-in-out;
|
351 |
transition: opacity 100ms ease-in-out;
|
352 |
-webkit-backface-visibility: hidden;
|
353 |
+
backface-visibility: hidden;
|
354 |
}
|
355 |
.elementor-search .label:hover,
|
356 |
.elementor-search .dismiss:hover {
|
446 |
position: fixed;
|
447 |
width: 100%;
|
448 |
overflow: auto;
|
449 |
+
z-index: 10;
|
450 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
451 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
452 |
}
|
453 |
.overlay-navigation.visible {
|
454 |
display: block;
|
455 |
+
-webkit-transition: background-color 2s ease-in, opacity 2s ease-in;
|
456 |
transition: background-color 2s ease-in, opacity 2s ease-in;
|
457 |
}
|
458 |
.overlay-navigation > ul,
|
519 |
/*
|
520 |
* MegaMenu Styles
|
521 |
*/
|
522 |
+
|
523 |
/* Main menu wrapper */
|
524 |
.cbp-hsmenu-wrapper {
|
525 |
position: relative;
|
540 |
}
|
541 |
|
542 |
.cbp-hsinner {
|
543 |
+
font-weight: inherit;
|
544 |
}
|
545 |
|
546 |
/* Main menu style */
|
629 |
}
|
630 |
#cbp-hsmenu-wrapper ul.sub-menu:before,
|
631 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
632 |
+
.cbp-hssubmenu:before,
|
633 |
+
.cbp-hssubmenu:after {
|
634 |
+
content: " ";
|
635 |
+
display: table;
|
636 |
}
|
637 |
#cbp-hsmenu-wrapper ul.sub-menu:after,
|
638 |
+
.cbp-hssubmenu:after {
|
639 |
+
clear: both;
|
640 |
}
|
641 |
|
642 |
/* Let's allow 6 item in a row */
|
656 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+6),
|
657 |
.cbp-hssubmenu > li:nth-child(-n+6) {
|
658 |
box-shadow: -28px 0 0 -27px #ddd;
|
659 |
+
}
|
660 |
|
661 |
/* Every 7th item does not have a left box shadow */
|
662 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(6n+1),
|
801 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(-n+3),
|
802 |
.cbp-hssubmenu > li:nth-child(-n+3) {
|
803 |
box-shadow: -28px 0 0 -27px #ddd;
|
804 |
+
}
|
805 |
|
806 |
/* Every 5th item does not have a left box shadow */
|
807 |
#cbp-hsmenu-wrapper ul.sub-menu > li:nth-child(3n+1),
|
832 |
padding: 0.4em 1em;
|
833 |
}
|
834 |
|
835 |
+
#cbp-hsmenu-wrapper ul.sub-menu > li a img,
|
836 |
.cbp-hssubmenu > li a img{
|
837 |
display:none;
|
838 |
}
|
847 |
/*
|
848 |
* Support for MegaMenu's description.
|
849 |
*/
|
850 |
+
|
851 |
.menu-item-description {
|
852 |
+
display: block;
|
853 |
text-transform: uppercase;
|
854 |
font-size: .55rem;
|
855 |
}
|
856 |
|
857 |
.menu-item-object-custom .menu-item-description i:before{
|
858 |
+
font-size: 1.15em;
|
859 |
position: relative;
|
860 |
top: 0;
|
861 |
+
margin-right: 0px;
|
862 |
+
margin-left: 2px
|
863 |
}
|
864 |
|
865 |
/*
|
866 |
* Branding support
|
867 |
*/
|
868 |
+
|
869 |
.elementor-branding .custom-logo-link {
|
870 |
padding: 0;
|
871 |
float: none;
|
assets/js/editor.js
CHANGED
@@ -4,41 +4,49 @@
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
-
|
8 |
(function ($, root, undefined) {
|
9 |
-
|
10 |
-
$(document).ready(function() {
|
11 |
-
|
12 |
-
'use strict';
|
13 |
-
|
14 |
-
var touch = $('#touch-menu');
|
15 |
-
var overlaymenu = $('.overlay-navigation');
|
16 |
-
|
17 |
-
$(touch).on('click', function(e) {
|
18 |
-
e.preventDefault();
|
19 |
-
overlaymenu.toggleClass("visible");
|
20 |
-
$('body').toggleClass("menu-open");
|
21 |
-
touch.toggleClass("on");
|
22 |
-
});
|
23 |
-
|
24 |
-
$(window).resize(function(){
|
25 |
-
var w = $(window).width();
|
26 |
-
if(w > 768 && overlaymenu.is(':hidden')) {
|
27 |
-
overlaymenu.removeAttr('style');
|
28 |
-
}
|
29 |
-
});
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
fullWindow();
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
})(jQuery);
|
43 |
|
44 |
|
@@ -48,13 +56,19 @@
|
|
48 |
function initElementorPrimaryNavigation( container ) {
|
49 |
|
50 |
// Add dropdown toggle that displays child menu items.
|
51 |
-
var eldropdownToggle = $(
|
52 |
-
'
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
60 |
|
@@ -65,26 +79,28 @@
|
|
65 |
// Add menu items with submenus to aria-haspopup="true".
|
66 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
67 |
|
68 |
-
container.find( '.eldropdown-toggle' ).click(
|
69 |
-
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
81 |
}
|
82 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
83 |
|
84 |
-
menuAreaPrimary
|
85 |
-
elmenuTogglePrimary
|
86 |
-
elementorPrimaryHeaderMenu
|
87 |
-
elementorPrimaryNavigation
|
88 |
|
89 |
// Enable elmenuTogglePrimary.
|
90 |
( function() {
|
@@ -97,13 +113,15 @@
|
|
97 |
// Add an initial values for the attribute.
|
98 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
99 |
|
100 |
-
elmenuTogglePrimary.on(
|
101 |
-
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
107 |
} )();
|
108 |
|
109 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
@@ -115,20 +133,24 @@
|
|
115 |
// Toggle `focus` class to allow submenu access on tablets.
|
116 |
function toggleFocusClassTouchScreen() {
|
117 |
if ( window.innerWidth >= 910 ) {
|
118 |
-
$( document.body ).on(
|
119 |
-
|
120 |
-
$( '.elementor-navigation li' ).
|
|
|
|
|
121 |
}
|
122 |
-
|
123 |
-
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
130 |
}
|
131 |
-
|
132 |
} else {
|
133 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
134 |
}
|
@@ -139,9 +161,11 @@
|
|
139 |
toggleFocusClassTouchScreen();
|
140 |
}
|
141 |
|
142 |
-
elementorPrimaryNavigation.find( 'a' ).on(
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
} )();
|
146 |
|
147 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
@@ -167,295 +191,322 @@
|
|
167 |
}
|
168 |
}
|
169 |
|
|
|
|
|
|
|
170 |
|
171 |
-
|
172 |
-
( function( $ ) {
|
173 |
-
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
174 |
-
|
175 |
-
function initElementorSecondaryNavigation( container ) {
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
187 |
|
188 |
-
|
189 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
190 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
191 |
|
192 |
-
|
193 |
-
|
|
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
screenReaderSpan = _this.find( '.screen-reader-text' );
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
207 |
-
} );
|
208 |
-
}
|
209 |
-
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
215 |
|
216 |
-
|
217 |
-
|
|
|
|
|
218 |
|
219 |
-
//
|
220 |
-
|
221 |
-
return;
|
222 |
-
}
|
223 |
|
224 |
-
|
225 |
-
|
|
|
|
|
226 |
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
} );
|
234 |
-
} )();
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
241 |
|
242 |
-
//
|
243 |
-
function
|
244 |
-
if (
|
245 |
-
|
246 |
-
|
247 |
-
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
248 |
-
}
|
249 |
-
} );
|
250 |
-
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
|
251 |
-
var el = $( this ).parent( 'li' );
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
-
}
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
} else {
|
280 |
-
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
281 |
-
}
|
282 |
|
283 |
-
|
284 |
-
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
285 |
} else {
|
286 |
-
|
|
|
|
|
287 |
}
|
|
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
-
}
|
296 |
-
|
297 |
-
//// Search slideOut
|
298 |
-
function slideOut(parent) {
|
299 |
-
$(parent).each(function(){
|
300 |
-
var label = $(this).find('.label'),
|
301 |
-
form = $(this).find('.form'),
|
302 |
-
dismiss = $(this).find('.dismiss'),
|
303 |
-
formMarginLeft = form.css('margin-left'),
|
304 |
-
spd = 500;
|
305 |
-
|
306 |
-
label.click(function(){
|
307 |
-
form.animate({'margin-left':0},spd)
|
308 |
-
label.hide()
|
309 |
-
label.animate({'opacity':0},spd)
|
310 |
-
setTimeout(function(){
|
311 |
-
dismiss.show()
|
312 |
-
dismiss.animate({'opacity':1},spd)
|
313 |
-
},spd)
|
314 |
-
})
|
315 |
-
|
316 |
-
dismiss.click(function(){
|
317 |
-
form.animate({'margin-left':formMarginLeft},spd)
|
318 |
-
dismiss.hide()
|
319 |
-
dismiss.animate({'opacity':0},spd)
|
320 |
-
setTimeout(function(){
|
321 |
-
label.show()
|
322 |
-
label.animate({'opacity':1},spd)
|
323 |
-
},spd)
|
324 |
-
})
|
325 |
-
})
|
326 |
-
}
|
327 |
|
328 |
-
|
329 |
-
} )( jQuery );
|
|
|
|
|
330 |
|
331 |
-
|
|
|
332 |
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
if( b.hasOwnProperty( key ) ) {
|
339 |
-
a[key] = b[key];
|
340 |
}
|
|
|
341 |
}
|
342 |
-
return a;
|
343 |
-
}
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
item
|
368 |
-
items
|
369 |
-
submenu
|
370 |
closeCurrent = function( current ) {
|
371 |
-
var current
|
372 |
current.className = '';
|
373 |
-
current.setAttribute( 'data-open', '' );
|
374 |
},
|
375 |
closePanel = function() {
|
376 |
-
self.current
|
377 |
self.menuBg.style.height = '0px';
|
378 |
};
|
379 |
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
closeCurrent();
|
|
|
392 |
}
|
393 |
-
self.current = items.indexOf( item );
|
394 |
-
item.className = 'cbp-hsitem-open';
|
395 |
-
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
396 |
-
}
|
397 |
-
}
|
398 |
-
else {
|
399 |
-
if( self.current !== -1 ) {
|
400 |
-
closeCurrent();
|
401 |
-
closePanel();
|
402 |
}
|
403 |
-
}
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
var self = this;
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
}
|
418 |
-
} );
|
419 |
-
|
420 |
-
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
421 |
-
|
422 |
-
},
|
423 |
-
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
424 |
-
// original debounce by John Hann
|
425 |
-
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
426 |
-
_resizeHandler : function() {
|
427 |
-
var self = this;
|
428 |
-
function delayed() {
|
429 |
-
self._resize();
|
430 |
-
self._resizeTimeout = null;
|
431 |
-
}
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
|
|
442 |
}
|
443 |
}
|
444 |
-
}
|
445 |
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
450 |
|
451 |
-
|
452 |
|
|
|
453 |
|
454 |
} )( jQuery );
|
455 |
|
456 |
-
jQuery(document).ready(
|
457 |
-
|
458 |
-
jQuery(
|
459 |
-
|
460 |
-
|
461 |
-
|
|
|
|
|
|
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
+
|
8 |
(function ($, root, undefined) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
$( document ).ready(
|
11 |
+
function() {
|
12 |
+
|
13 |
+
'use strict';
|
14 |
+
|
15 |
+
var touch = $( '#touch-menu' );
|
16 |
+
var overlaymenu = $( '.overlay-navigation' );
|
17 |
+
|
18 |
+
$( touch ).on(
|
19 |
+
'click', function(e) {
|
20 |
+
e.preventDefault();
|
21 |
+
overlaymenu.toggleClass( "visible" );
|
22 |
+
$( 'body' ).toggleClass( "menu-open" );
|
23 |
+
touch.toggleClass( "on" );
|
24 |
+
}
|
25 |
+
);
|
26 |
|
27 |
+
$( window ).resize(
|
28 |
+
function(){
|
29 |
+
var w = $( window ).width();
|
30 |
+
if (w > 768 && overlaymenu.is( ':hidden' )) {
|
31 |
+
overlaymenu.removeAttr( 'style' );
|
32 |
+
}
|
33 |
+
}
|
34 |
+
);
|
35 |
+
|
36 |
+
function fullWindow() {
|
37 |
+
$( ".fullwindow" ).css( "height", $( window ).height() );
|
38 |
+
};
|
39 |
fullWindow();
|
40 |
+
|
41 |
+
$( window ).resize(
|
42 |
+
function() {
|
43 |
+
fullWindow();
|
44 |
+
}
|
45 |
+
);
|
46 |
+
|
47 |
+
}
|
48 |
+
);
|
49 |
+
|
50 |
})(jQuery);
|
51 |
|
52 |
|
56 |
function initElementorPrimaryNavigation( container ) {
|
57 |
|
58 |
// Add dropdown toggle that displays child menu items.
|
59 |
+
var eldropdownToggle = $(
|
60 |
+
'<button />', {
|
61 |
+
'class': 'eldropdown-toggle',
|
62 |
+
'aria-expanded': false
|
63 |
+
}
|
64 |
+
).append(
|
65 |
+
$(
|
66 |
+
'<span />', {
|
67 |
+
'class': 'screen-reader-text',
|
68 |
+
text: elementorScreenReaderText.expand
|
69 |
+
}
|
70 |
+
)
|
71 |
+
);
|
72 |
|
73 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
74 |
|
79 |
// Add menu items with submenus to aria-haspopup="true".
|
80 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
81 |
|
82 |
+
container.find( '.eldropdown-toggle' ).click(
|
83 |
+
function( e ) {
|
84 |
+
var _this = $( this ),
|
85 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
86 |
|
87 |
+
e.preventDefault();
|
88 |
+
_this.toggleClass( 'eltoggled-on' );
|
89 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
90 |
|
91 |
+
// jscs:disable
|
92 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
93 |
+
// jscs:enable
|
94 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
|
95 |
+
}
|
96 |
+
);
|
97 |
}
|
98 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
99 |
|
100 |
+
menuAreaPrimary = $( '#elementor-header-primary' );
|
101 |
+
elmenuTogglePrimary = menuAreaPrimary.find( '#elementor-menu-toggle' );
|
102 |
+
elementorPrimaryHeaderMenu = menuAreaPrimary.find( '#elementor-menu' );
|
103 |
+
elementorPrimaryNavigation = menuAreaPrimary.find( '#elementor-navigation' );
|
104 |
|
105 |
// Enable elmenuTogglePrimary.
|
106 |
( function() {
|
113 |
// Add an initial values for the attribute.
|
114 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
115 |
|
116 |
+
elmenuTogglePrimary.on(
|
117 |
+
'click.actions', function() {
|
118 |
+
$( this ).add( elementorPrimaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
119 |
|
120 |
+
// jscs:disable
|
121 |
+
$( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
122 |
+
// jscs:enable
|
123 |
+
}
|
124 |
+
);
|
125 |
} )();
|
126 |
|
127 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
133 |
// Toggle `focus` class to allow submenu access on tablets.
|
134 |
function toggleFocusClassTouchScreen() {
|
135 |
if ( window.innerWidth >= 910 ) {
|
136 |
+
$( document.body ).on(
|
137 |
+
'touchstart.actions', function( e ) {
|
138 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
139 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
140 |
+
}
|
141 |
}
|
142 |
+
);
|
143 |
+
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
144 |
+
'touchstart.actions', function( e ) {
|
145 |
+
var el = $( this ).parent( 'li' );
|
146 |
+
|
147 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
148 |
+
e.preventDefault();
|
149 |
+
el.toggleClass( 'focus' );
|
150 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
151 |
+
}
|
152 |
}
|
153 |
+
);
|
154 |
} else {
|
155 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
156 |
}
|
161 |
toggleFocusClassTouchScreen();
|
162 |
}
|
163 |
|
164 |
+
elementorPrimaryNavigation.find( 'a' ).on(
|
165 |
+
'focus.actions blur.actions', function() {
|
166 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
167 |
+
}
|
168 |
+
);
|
169 |
} )();
|
170 |
|
171 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
191 |
}
|
192 |
}
|
193 |
|
194 |
+
// Start our Secondary navigation
|
195 |
+
( function( $ ) {
|
196 |
+
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
197 |
|
198 |
+
function initElementorSecondaryNavigation( container ) {
|
|
|
|
|
|
|
|
|
199 |
|
200 |
+
// Add dropdown toggle that displays child menu items.
|
201 |
+
var eldropdownSecondaryToggle = $(
|
202 |
+
'<button />', {
|
203 |
+
'class': 'eldropdown-toggle',
|
204 |
+
'aria-expanded': false
|
205 |
+
}
|
206 |
+
).append(
|
207 |
+
$(
|
208 |
+
'<span />', {
|
209 |
+
'class': 'screen-reader-text',
|
210 |
+
text: elementorSecondaryScreenReaderText.expand
|
211 |
+
}
|
212 |
+
)
|
213 |
+
);
|
214 |
|
215 |
+
container.find( '#elementor-header-secondary .menu-item-has-children > a' ).after( eldropdownSecondaryToggle );
|
|
|
|
|
216 |
|
217 |
+
// Toggle buttons and submenu items with active children menu items.
|
218 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
219 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
220 |
|
221 |
+
// Add menu items with submenus to aria-haspopup="true".
|
222 |
+
container.find( '#elementor-header-secondary .menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
|
|
223 |
|
224 |
+
container.find( '#elementor-header-secondary .eldropdown-toggle' ).click(
|
225 |
+
function( e ) {
|
226 |
+
var _this = $( this ),
|
227 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
228 |
|
229 |
+
e.preventDefault();
|
230 |
+
_this.toggleClass( 'eltoggled-on' );
|
231 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
|
|
|
|
|
|
|
|
232 |
|
233 |
+
// jscs:disable
|
234 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
235 |
+
// jscs:enable
|
236 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
237 |
+
}
|
238 |
+
);
|
239 |
+
}
|
240 |
+
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
241 |
|
242 |
+
menuAreaSecondary = $( '#elementor-header-secondary' );
|
243 |
+
elmenuToggleSecondary = menuAreaSecondary.find( '#elementor-menu-toggle' );
|
244 |
+
elementorSecondaryHeaderMenu = menuAreaSecondary.find( '#elementor-menu' );
|
245 |
+
elementorSecondaryNavigation = menuAreaSecondary.find( '#elementor-navigation' );
|
246 |
|
247 |
+
// Enable elmenuToggleSecondary.
|
248 |
+
( function() {
|
|
|
|
|
249 |
|
250 |
+
// Return early if elmenuToggleSecondary is missing.
|
251 |
+
if ( ! elmenuToggleSecondary.length ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
|
255 |
+
// Add an initial values for the attribute.
|
256 |
+
elmenuToggleSecondary.add( elementorSecondaryNavigation ).attr( 'aria-expanded', 'false' );
|
257 |
|
258 |
+
elmenuToggleSecondary.on(
|
259 |
+
'click.actions', function() {
|
260 |
+
$( this ).add( elementorSecondaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
|
|
|
|
261 |
|
262 |
+
// jscs:disable
|
263 |
+
$( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
264 |
+
// jscs:enable
|
265 |
+
}
|
266 |
+
);
|
267 |
+
} )();
|
268 |
|
269 |
+
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
270 |
+
( function() {
|
271 |
+
if ( ! elementorSecondaryNavigation.length || ! elementorSecondaryNavigation.children().length ) {
|
272 |
+
return;
|
273 |
+
}
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
+
// Toggle `focus` class to allow submenu access on tablets.
|
276 |
+
function toggleFocusClassTouchScreen() {
|
277 |
+
if ( window.innerWidth >= 910 ) {
|
278 |
+
$( document.body ).on(
|
279 |
+
'touchstart.actions', function( e ) {
|
280 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
281 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
282 |
+
}
|
283 |
+
}
|
284 |
+
);
|
285 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on(
|
286 |
+
'touchstart.actions', function( e ) {
|
287 |
+
var el = $( this ).parent( 'li' );
|
288 |
+
|
289 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
290 |
+
e.preventDefault();
|
291 |
+
el.toggleClass( 'focus' );
|
292 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
293 |
+
}
|
294 |
+
}
|
295 |
+
);
|
296 |
+
} else {
|
297 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
298 |
+
}
|
299 |
}
|
|
|
300 |
|
301 |
+
if ( 'ontouchstart' in window ) {
|
302 |
+
$( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
|
303 |
+
toggleFocusClassTouchScreen();
|
304 |
+
}
|
305 |
|
306 |
+
elementorSecondaryNavigation.find( 'a' ).on(
|
307 |
+
'focus.actions blur.actions', function() {
|
308 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
309 |
+
}
|
310 |
+
);
|
311 |
+
} )();
|
312 |
+
|
313 |
+
// Add the default ARIA attributes for the menu toggle and the navigations.
|
314 |
+
function onResizeARIA() {
|
315 |
+
if ( window.innerWidth < 910 ) {
|
316 |
+
if ( elmenuToggleSecondary.hasClass( 'eltoggled-on' ) ) {
|
317 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'true' );
|
318 |
+
} else {
|
319 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
320 |
+
}
|
321 |
|
322 |
+
if ( elementorSecondaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
|
323 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
324 |
+
} else {
|
325 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'false' );
|
326 |
+
}
|
|
|
|
|
|
|
327 |
|
328 |
+
elmenuToggleSecondary.attr( 'aria-controls', 'site-navigation' );
|
|
|
329 |
} else {
|
330 |
+
elmenuToggleSecondary.removeAttr( 'aria-expanded' );
|
331 |
+
elementorSecondaryNavigation.removeAttr( 'aria-expanded' );
|
332 |
+
elmenuToggleSecondary.removeAttr( 'aria-controls' );
|
333 |
}
|
334 |
+
}
|
335 |
|
336 |
+
// Search slideOut
|
337 |
+
function slideOut(parent) {
|
338 |
+
$( parent ).each(
|
339 |
+
function(){
|
340 |
+
var label = $( this ).find( '.label' ),
|
341 |
+
form = $( this ).find( '.form' ),
|
342 |
+
dismiss = $( this ).find( '.dismiss' ),
|
343 |
+
formMarginLeft = form.css( 'margin-left' ),
|
344 |
+
spd = 500;
|
345 |
+
|
346 |
+
label.click(
|
347 |
+
function(){
|
348 |
+
form.animate( {'margin-left':0},spd )
|
349 |
+
label.hide()
|
350 |
+
label.animate( {'opacity':0},spd )
|
351 |
+
setTimeout(
|
352 |
+
function(){
|
353 |
+
dismiss.show()
|
354 |
+
dismiss.animate( {'opacity':1},spd )
|
355 |
+
},spd
|
356 |
+
)
|
357 |
+
}
|
358 |
+
)
|
359 |
+
|
360 |
+
dismiss.click(
|
361 |
+
function(){
|
362 |
+
form.animate( {'margin-left':formMarginLeft},spd )
|
363 |
+
dismiss.hide()
|
364 |
+
dismiss.animate( {'opacity':0},spd )
|
365 |
+
setTimeout(
|
366 |
+
function(){
|
367 |
+
label.show()
|
368 |
+
label.animate( {'opacity':1},spd )
|
369 |
+
},spd
|
370 |
+
)
|
371 |
+
}
|
372 |
+
)
|
373 |
+
}
|
374 |
+
)
|
375 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
|
377 |
+
slideOut( '.search' );
|
378 |
+
} )( jQuery );
|
379 |
+
|
380 |
+
(function ($, root, undefined) {
|
381 |
|
382 |
+
var document = window.document;
|
383 |
+
'use strict';
|
384 |
|
385 |
+
function extend( a, b ) {
|
386 |
+
for ( var key in b ) {
|
387 |
+
if ( b.hasOwnProperty( key ) ) {
|
388 |
+
a[key] = b[key];
|
389 |
+
}
|
|
|
|
|
390 |
}
|
391 |
+
return a;
|
392 |
}
|
|
|
|
|
393 |
|
394 |
+
function cbpHorizontalSlideOutMenu( el, options ) {
|
395 |
+
this.el = el;
|
396 |
+
this.options = extend( this.defaults, options );
|
397 |
+
this._init();
|
398 |
+
}
|
399 |
|
400 |
+
cbpHorizontalSlideOutMenu.prototype = {
|
401 |
+
|
402 |
+
defaults : {},
|
403 |
+
_init : function() {
|
404 |
+
this.current = -1;
|
405 |
+
this.touch = Modernizr.touch;
|
406 |
+
this.menu = this.el.querySelector( '.cbp-hsmenu' );
|
407 |
+
this.menuItems = this.el.querySelectorAll( '.cbp-hsmenu > li' );
|
408 |
+
this.menuBg = document.createElement( 'div' );
|
409 |
+
this.menuBg.className = 'cbp-hsmenubg';
|
410 |
+
this.el.appendChild( this.menuBg );
|
411 |
+
this._initEvents();
|
412 |
+
},
|
413 |
+
_openMenu : function( el, ev ) {
|
414 |
+
|
415 |
+
var self = this,
|
416 |
+
item = el.parentNode,
|
417 |
+
items = Array.prototype.slice.call( this.menuItems ),
|
418 |
+
submenu = item.querySelector( '.cbp-hssubmenu' ),
|
419 |
closeCurrent = function( current ) {
|
420 |
+
var current = current || self.menuItems[ self.current ];
|
421 |
current.className = '';
|
422 |
+
current.setAttribute( 'data-open', '' );
|
423 |
},
|
424 |
closePanel = function() {
|
425 |
+
self.current = -1;
|
426 |
self.menuBg.style.height = '0px';
|
427 |
};
|
428 |
|
429 |
+
if ( submenu ) {
|
430 |
+
|
431 |
+
ev.preventDefault();
|
432 |
+
|
433 |
+
if ( item.getAttribute( 'data-open' ) === 'open' ) {
|
434 |
+
closeCurrent( item );
|
435 |
+
closePanel();
|
436 |
+
} else {
|
437 |
+
item.setAttribute( 'data-open', 'open' );
|
438 |
+
if ( self.current !== -1 ) {
|
439 |
+
closeCurrent();
|
440 |
+
}
|
441 |
+
self.current = items.indexOf( item );
|
442 |
+
item.className = 'cbp-hsitem-open';
|
443 |
+
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
444 |
+
}
|
445 |
+
} else {
|
446 |
+
if ( self.current !== -1 ) {
|
447 |
closeCurrent();
|
448 |
+
closePanel();
|
449 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
}
|
|
|
451 |
|
452 |
+
},
|
453 |
+
_initEvents : function() {
|
|
|
|
|
454 |
|
455 |
+
var self = this;
|
456 |
+
|
457 |
+
Array.prototype.slice.call( this.menuItems ).forEach(
|
458 |
+
function( el, i ) {
|
459 |
+
var trigger = el.querySelector( 'a' );
|
460 |
+
if ( self.touch ) {
|
461 |
+
trigger.addEventListener( 'touchstart', function( ev ) { self._openMenu( this, ev ); } );
|
462 |
+
} else {
|
463 |
+
trigger.addEventListener( 'click', function( ev ) { self._openMenu( this, ev ); } );
|
464 |
+
}
|
465 |
+
}
|
466 |
+
);
|
467 |
+
|
468 |
+
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
469 |
+
|
470 |
+
},
|
471 |
+
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
472 |
+
// original debounce by John Hann
|
473 |
+
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
474 |
+
_resizeHandler : function() {
|
475 |
+
var self = this;
|
476 |
+
function delayed() {
|
477 |
+
self._resize();
|
478 |
+
self._resizeTimeout = null;
|
479 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
|
481 |
+
if ( this._resizeTimeout ) {
|
482 |
+
clearTimeout( this._resizeTimeout );
|
483 |
+
}
|
484 |
|
485 |
+
this._resizeTimeout = setTimeout( delayed, 50 );
|
486 |
+
},
|
487 |
+
_resize : function() {
|
488 |
+
if ( this.current !== -1 ) {
|
489 |
+
this.menuBg.style.height = this.menuItems[ this.current ].querySelector( '.cbp-hssubmenu' ).offsetHeight + 'px';
|
490 |
+
}
|
491 |
}
|
492 |
}
|
|
|
493 |
|
494 |
+
// add to global namespace
|
495 |
+
window.cbpHorizontalSlideOutMenu = cbpHorizontalSlideOutMenu;
|
|
|
|
|
496 |
|
497 |
+
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
498 |
|
499 |
+
})(jQuery, this.el);
|
500 |
|
501 |
} )( jQuery );
|
502 |
|
503 |
+
jQuery( document ).ready(
|
504 |
+
function() {
|
505 |
+
jQuery( "#cbp-hsmenu-wrapper ul.sub-menu" ).each(
|
506 |
+
function(i){
|
507 |
+
jQuery( this ).removeClass( "sub-menu" );
|
508 |
+
jQuery( this ).addClass( "cbp-hssubmenu" );
|
509 |
+
}
|
510 |
+
);
|
511 |
+
}
|
512 |
+
);
|
assets/js/editor.min.js
CHANGED
@@ -4,41 +4,49 @@
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
-
|
8 |
(function ($, root, undefined) {
|
9 |
-
|
10 |
-
$(document).ready(function() {
|
11 |
-
|
12 |
-
'use strict';
|
13 |
-
|
14 |
-
var touch = $('#touch-menu');
|
15 |
-
var overlaymenu = $('.overlay-navigation');
|
16 |
-
|
17 |
-
$(touch).on('click', function(e) {
|
18 |
-
e.preventDefault();
|
19 |
-
overlaymenu.toggleClass("visible");
|
20 |
-
$('body').toggleClass("menu-open");
|
21 |
-
touch.toggleClass("on");
|
22 |
-
});
|
23 |
-
|
24 |
-
$(window).resize(function(){
|
25 |
-
var w = $(window).width();
|
26 |
-
if(w > 768 && overlaymenu.is(':hidden')) {
|
27 |
-
overlaymenu.removeAttr('style');
|
28 |
-
}
|
29 |
-
});
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
fullWindow();
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
})(jQuery);
|
43 |
|
44 |
|
@@ -48,13 +56,19 @@
|
|
48 |
function initElementorPrimaryNavigation( container ) {
|
49 |
|
50 |
// Add dropdown toggle that displays child menu items.
|
51 |
-
var eldropdownToggle = $(
|
52 |
-
'
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
60 |
|
@@ -65,26 +79,28 @@
|
|
65 |
// Add menu items with submenus to aria-haspopup="true".
|
66 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
67 |
|
68 |
-
container.find( '.eldropdown-toggle' ).click(
|
69 |
-
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
81 |
}
|
82 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
83 |
|
84 |
-
menuAreaPrimary
|
85 |
-
elmenuTogglePrimary
|
86 |
-
elementorPrimaryHeaderMenu
|
87 |
-
elementorPrimaryNavigation
|
88 |
|
89 |
// Enable elmenuTogglePrimary.
|
90 |
( function() {
|
@@ -97,13 +113,15 @@
|
|
97 |
// Add an initial values for the attribute.
|
98 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
99 |
|
100 |
-
elmenuTogglePrimary.on(
|
101 |
-
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
107 |
} )();
|
108 |
|
109 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
@@ -115,20 +133,24 @@
|
|
115 |
// Toggle `focus` class to allow submenu access on tablets.
|
116 |
function toggleFocusClassTouchScreen() {
|
117 |
if ( window.innerWidth >= 910 ) {
|
118 |
-
$( document.body ).on(
|
119 |
-
|
120 |
-
$( '.elementor-navigation li' ).
|
|
|
|
|
121 |
}
|
122 |
-
|
123 |
-
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
130 |
}
|
131 |
-
|
132 |
} else {
|
133 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
134 |
}
|
@@ -139,9 +161,11 @@
|
|
139 |
toggleFocusClassTouchScreen();
|
140 |
}
|
141 |
|
142 |
-
elementorPrimaryNavigation.find( 'a' ).on(
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
} )();
|
146 |
|
147 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
@@ -167,295 +191,322 @@
|
|
167 |
}
|
168 |
}
|
169 |
|
|
|
|
|
|
|
170 |
|
171 |
-
|
172 |
-
( function( $ ) {
|
173 |
-
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
174 |
-
|
175 |
-
function initElementorSecondaryNavigation( container ) {
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
187 |
|
188 |
-
|
189 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
190 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
191 |
|
192 |
-
|
193 |
-
|
|
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
screenReaderSpan = _this.find( '.screen-reader-text' );
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
207 |
-
} );
|
208 |
-
}
|
209 |
-
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
215 |
|
216 |
-
|
217 |
-
|
|
|
|
|
218 |
|
219 |
-
//
|
220 |
-
|
221 |
-
return;
|
222 |
-
}
|
223 |
|
224 |
-
|
225 |
-
|
|
|
|
|
226 |
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
} );
|
234 |
-
} )();
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
241 |
|
242 |
-
//
|
243 |
-
function
|
244 |
-
if (
|
245 |
-
|
246 |
-
|
247 |
-
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
248 |
-
}
|
249 |
-
} );
|
250 |
-
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
|
251 |
-
var el = $( this ).parent( 'li' );
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
-
}
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
} else {
|
280 |
-
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
281 |
-
}
|
282 |
|
283 |
-
|
284 |
-
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
285 |
} else {
|
286 |
-
|
|
|
|
|
287 |
}
|
|
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
-
}
|
296 |
-
|
297 |
-
//// Search slideOut
|
298 |
-
function slideOut(parent) {
|
299 |
-
$(parent).each(function(){
|
300 |
-
var label = $(this).find('.label'),
|
301 |
-
form = $(this).find('.form'),
|
302 |
-
dismiss = $(this).find('.dismiss'),
|
303 |
-
formMarginLeft = form.css('margin-left'),
|
304 |
-
spd = 500;
|
305 |
-
|
306 |
-
label.click(function(){
|
307 |
-
form.animate({'margin-left':0},spd)
|
308 |
-
label.hide()
|
309 |
-
label.animate({'opacity':0},spd)
|
310 |
-
setTimeout(function(){
|
311 |
-
dismiss.show()
|
312 |
-
dismiss.animate({'opacity':1},spd)
|
313 |
-
},spd)
|
314 |
-
})
|
315 |
-
|
316 |
-
dismiss.click(function(){
|
317 |
-
form.animate({'margin-left':formMarginLeft},spd)
|
318 |
-
dismiss.hide()
|
319 |
-
dismiss.animate({'opacity':0},spd)
|
320 |
-
setTimeout(function(){
|
321 |
-
label.show()
|
322 |
-
label.animate({'opacity':1},spd)
|
323 |
-
},spd)
|
324 |
-
})
|
325 |
-
})
|
326 |
-
}
|
327 |
|
328 |
-
|
329 |
-
} )( jQuery );
|
|
|
|
|
330 |
|
331 |
-
|
|
|
332 |
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
if( b.hasOwnProperty( key ) ) {
|
339 |
-
a[key] = b[key];
|
340 |
}
|
|
|
341 |
}
|
342 |
-
return a;
|
343 |
-
}
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
item
|
368 |
-
items
|
369 |
-
submenu
|
370 |
closeCurrent = function( current ) {
|
371 |
-
var current
|
372 |
current.className = '';
|
373 |
-
current.setAttribute( 'data-open', '' );
|
374 |
},
|
375 |
closePanel = function() {
|
376 |
-
self.current
|
377 |
self.menuBg.style.height = '0px';
|
378 |
};
|
379 |
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
closeCurrent();
|
|
|
392 |
}
|
393 |
-
self.current = items.indexOf( item );
|
394 |
-
item.className = 'cbp-hsitem-open';
|
395 |
-
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
396 |
-
}
|
397 |
-
}
|
398 |
-
else {
|
399 |
-
if( self.current !== -1 ) {
|
400 |
-
closeCurrent();
|
401 |
-
closePanel();
|
402 |
}
|
403 |
-
}
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
var self = this;
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
}
|
418 |
-
} );
|
419 |
-
|
420 |
-
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
421 |
-
|
422 |
-
},
|
423 |
-
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
424 |
-
// original debounce by John Hann
|
425 |
-
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
426 |
-
_resizeHandler : function() {
|
427 |
-
var self = this;
|
428 |
-
function delayed() {
|
429 |
-
self._resize();
|
430 |
-
self._resizeTimeout = null;
|
431 |
-
}
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
|
|
442 |
}
|
443 |
}
|
444 |
-
}
|
445 |
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
450 |
|
451 |
-
|
452 |
|
|
|
453 |
|
454 |
} )( jQuery );
|
455 |
|
456 |
-
jQuery(document).ready(
|
457 |
-
|
458 |
-
jQuery(
|
459 |
-
|
460 |
-
|
461 |
-
|
|
|
|
|
|
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
+
|
8 |
(function ($, root, undefined) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
$( document ).ready(
|
11 |
+
function() {
|
12 |
+
|
13 |
+
'use strict';
|
14 |
+
|
15 |
+
var touch = $( '#touch-menu' );
|
16 |
+
var overlaymenu = $( '.overlay-navigation' );
|
17 |
+
|
18 |
+
$( touch ).on(
|
19 |
+
'click', function(e) {
|
20 |
+
e.preventDefault();
|
21 |
+
overlaymenu.toggleClass( "visible" );
|
22 |
+
$( 'body' ).toggleClass( "menu-open" );
|
23 |
+
touch.toggleClass( "on" );
|
24 |
+
}
|
25 |
+
);
|
26 |
|
27 |
+
$( window ).resize(
|
28 |
+
function(){
|
29 |
+
var w = $( window ).width();
|
30 |
+
if (w > 768 && overlaymenu.is( ':hidden' )) {
|
31 |
+
overlaymenu.removeAttr( 'style' );
|
32 |
+
}
|
33 |
+
}
|
34 |
+
);
|
35 |
+
|
36 |
+
function fullWindow() {
|
37 |
+
$( ".fullwindow" ).css( "height", $( window ).height() );
|
38 |
+
};
|
39 |
fullWindow();
|
40 |
+
|
41 |
+
$( window ).resize(
|
42 |
+
function() {
|
43 |
+
fullWindow();
|
44 |
+
}
|
45 |
+
);
|
46 |
+
|
47 |
+
}
|
48 |
+
);
|
49 |
+
|
50 |
})(jQuery);
|
51 |
|
52 |
|
56 |
function initElementorPrimaryNavigation( container ) {
|
57 |
|
58 |
// Add dropdown toggle that displays child menu items.
|
59 |
+
var eldropdownToggle = $(
|
60 |
+
'<button />', {
|
61 |
+
'class': 'eldropdown-toggle',
|
62 |
+
'aria-expanded': false
|
63 |
+
}
|
64 |
+
).append(
|
65 |
+
$(
|
66 |
+
'<span />', {
|
67 |
+
'class': 'screen-reader-text',
|
68 |
+
text: elementorScreenReaderText.expand
|
69 |
+
}
|
70 |
+
)
|
71 |
+
);
|
72 |
|
73 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
74 |
|
79 |
// Add menu items with submenus to aria-haspopup="true".
|
80 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
81 |
|
82 |
+
container.find( '.eldropdown-toggle' ).click(
|
83 |
+
function( e ) {
|
84 |
+
var _this = $( this ),
|
85 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
86 |
|
87 |
+
e.preventDefault();
|
88 |
+
_this.toggleClass( 'eltoggled-on' );
|
89 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
90 |
|
91 |
+
// jscs:disable
|
92 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
93 |
+
// jscs:enable
|
94 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
|
95 |
+
}
|
96 |
+
);
|
97 |
}
|
98 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
99 |
|
100 |
+
menuAreaPrimary = $( '#elementor-header-primary' );
|
101 |
+
elmenuTogglePrimary = menuAreaPrimary.find( '#elementor-menu-toggle' );
|
102 |
+
elementorPrimaryHeaderMenu = menuAreaPrimary.find( '#elementor-menu' );
|
103 |
+
elementorPrimaryNavigation = menuAreaPrimary.find( '#elementor-navigation' );
|
104 |
|
105 |
// Enable elmenuTogglePrimary.
|
106 |
( function() {
|
113 |
// Add an initial values for the attribute.
|
114 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
115 |
|
116 |
+
elmenuTogglePrimary.on(
|
117 |
+
'click.actions', function() {
|
118 |
+
$( this ).add( elementorPrimaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
119 |
|
120 |
+
// jscs:disable
|
121 |
+
$( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
122 |
+
// jscs:enable
|
123 |
+
}
|
124 |
+
);
|
125 |
} )();
|
126 |
|
127 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
133 |
// Toggle `focus` class to allow submenu access on tablets.
|
134 |
function toggleFocusClassTouchScreen() {
|
135 |
if ( window.innerWidth >= 910 ) {
|
136 |
+
$( document.body ).on(
|
137 |
+
'touchstart.actions', function( e ) {
|
138 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
139 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
140 |
+
}
|
141 |
}
|
142 |
+
);
|
143 |
+
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
144 |
+
'touchstart.actions', function( e ) {
|
145 |
+
var el = $( this ).parent( 'li' );
|
146 |
+
|
147 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
148 |
+
e.preventDefault();
|
149 |
+
el.toggleClass( 'focus' );
|
150 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
151 |
+
}
|
152 |
}
|
153 |
+
);
|
154 |
} else {
|
155 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
156 |
}
|
161 |
toggleFocusClassTouchScreen();
|
162 |
}
|
163 |
|
164 |
+
elementorPrimaryNavigation.find( 'a' ).on(
|
165 |
+
'focus.actions blur.actions', function() {
|
166 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
167 |
+
}
|
168 |
+
);
|
169 |
} )();
|
170 |
|
171 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
191 |
}
|
192 |
}
|
193 |
|
194 |
+
// Start our Secondary navigation
|
195 |
+
( function( $ ) {
|
196 |
+
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
197 |
|
198 |
+
function initElementorSecondaryNavigation( container ) {
|
|
|
|
|
|
|
|
|
199 |
|
200 |
+
// Add dropdown toggle that displays child menu items.
|
201 |
+
var eldropdownSecondaryToggle = $(
|
202 |
+
'<button />', {
|
203 |
+
'class': 'eldropdown-toggle',
|
204 |
+
'aria-expanded': false
|
205 |
+
}
|
206 |
+
).append(
|
207 |
+
$(
|
208 |
+
'<span />', {
|
209 |
+
'class': 'screen-reader-text',
|
210 |
+
text: elementorSecondaryScreenReaderText.expand
|
211 |
+
}
|
212 |
+
)
|
213 |
+
);
|
214 |
|
215 |
+
container.find( '#elementor-header-secondary .menu-item-has-children > a' ).after( eldropdownSecondaryToggle );
|
|
|
|
|
216 |
|
217 |
+
// Toggle buttons and submenu items with active children menu items.
|
218 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
219 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
220 |
|
221 |
+
// Add menu items with submenus to aria-haspopup="true".
|
222 |
+
container.find( '#elementor-header-secondary .menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
|
|
223 |
|
224 |
+
container.find( '#elementor-header-secondary .eldropdown-toggle' ).click(
|
225 |
+
function( e ) {
|
226 |
+
var _this = $( this ),
|
227 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
228 |
|
229 |
+
e.preventDefault();
|
230 |
+
_this.toggleClass( 'eltoggled-on' );
|
231 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
|
|
|
|
|
|
|
|
232 |
|
233 |
+
// jscs:disable
|
234 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
235 |
+
// jscs:enable
|
236 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
237 |
+
}
|
238 |
+
);
|
239 |
+
}
|
240 |
+
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
241 |
|
242 |
+
menuAreaSecondary = $( '#elementor-header-secondary' );
|
243 |
+
elmenuToggleSecondary = menuAreaSecondary.find( '#elementor-menu-toggle' );
|
244 |
+
elementorSecondaryHeaderMenu = menuAreaSecondary.find( '#elementor-menu' );
|
245 |
+
elementorSecondaryNavigation = menuAreaSecondary.find( '#elementor-navigation' );
|
246 |
|
247 |
+
// Enable elmenuToggleSecondary.
|
248 |
+
( function() {
|
|
|
|
|
249 |
|
250 |
+
// Return early if elmenuToggleSecondary is missing.
|
251 |
+
if ( ! elmenuToggleSecondary.length ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
|
255 |
+
// Add an initial values for the attribute.
|
256 |
+
elmenuToggleSecondary.add( elementorSecondaryNavigation ).attr( 'aria-expanded', 'false' );
|
257 |
|
258 |
+
elmenuToggleSecondary.on(
|
259 |
+
'click.actions', function() {
|
260 |
+
$( this ).add( elementorSecondaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
|
|
|
|
261 |
|
262 |
+
// jscs:disable
|
263 |
+
$( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
264 |
+
// jscs:enable
|
265 |
+
}
|
266 |
+
);
|
267 |
+
} )();
|
268 |
|
269 |
+
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
270 |
+
( function() {
|
271 |
+
if ( ! elementorSecondaryNavigation.length || ! elementorSecondaryNavigation.children().length ) {
|
272 |
+
return;
|
273 |
+
}
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
+
// Toggle `focus` class to allow submenu access on tablets.
|
276 |
+
function toggleFocusClassTouchScreen() {
|
277 |
+
if ( window.innerWidth >= 910 ) {
|
278 |
+
$( document.body ).on(
|
279 |
+
'touchstart.actions', function( e ) {
|
280 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
281 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
282 |
+
}
|
283 |
+
}
|
284 |
+
);
|
285 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on(
|
286 |
+
'touchstart.actions', function( e ) {
|
287 |
+
var el = $( this ).parent( 'li' );
|
288 |
+
|
289 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
290 |
+
e.preventDefault();
|
291 |
+
el.toggleClass( 'focus' );
|
292 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
293 |
+
}
|
294 |
+
}
|
295 |
+
);
|
296 |
+
} else {
|
297 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
298 |
+
}
|
299 |
}
|
|
|
300 |
|
301 |
+
if ( 'ontouchstart' in window ) {
|
302 |
+
$( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
|
303 |
+
toggleFocusClassTouchScreen();
|
304 |
+
}
|
305 |
|
306 |
+
elementorSecondaryNavigation.find( 'a' ).on(
|
307 |
+
'focus.actions blur.actions', function() {
|
308 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
309 |
+
}
|
310 |
+
);
|
311 |
+
} )();
|
312 |
+
|
313 |
+
// Add the default ARIA attributes for the menu toggle and the navigations.
|
314 |
+
function onResizeARIA() {
|
315 |
+
if ( window.innerWidth < 910 ) {
|
316 |
+
if ( elmenuToggleSecondary.hasClass( 'eltoggled-on' ) ) {
|
317 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'true' );
|
318 |
+
} else {
|
319 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
320 |
+
}
|
321 |
|
322 |
+
if ( elementorSecondaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
|
323 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
324 |
+
} else {
|
325 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'false' );
|
326 |
+
}
|
|
|
|
|
|
|
327 |
|
328 |
+
elmenuToggleSecondary.attr( 'aria-controls', 'site-navigation' );
|
|
|
329 |
} else {
|
330 |
+
elmenuToggleSecondary.removeAttr( 'aria-expanded' );
|
331 |
+
elementorSecondaryNavigation.removeAttr( 'aria-expanded' );
|
332 |
+
elmenuToggleSecondary.removeAttr( 'aria-controls' );
|
333 |
}
|
334 |
+
}
|
335 |
|
336 |
+
// Search slideOut
|
337 |
+
function slideOut(parent) {
|
338 |
+
$( parent ).each(
|
339 |
+
function(){
|
340 |
+
var label = $( this ).find( '.label' ),
|
341 |
+
form = $( this ).find( '.form' ),
|
342 |
+
dismiss = $( this ).find( '.dismiss' ),
|
343 |
+
formMarginLeft = form.css( 'margin-left' ),
|
344 |
+
spd = 500;
|
345 |
+
|
346 |
+
label.click(
|
347 |
+
function(){
|
348 |
+
form.animate( {'margin-left':0},spd )
|
349 |
+
label.hide()
|
350 |
+
label.animate( {'opacity':0},spd )
|
351 |
+
setTimeout(
|
352 |
+
function(){
|
353 |
+
dismiss.show()
|
354 |
+
dismiss.animate( {'opacity':1},spd )
|
355 |
+
},spd
|
356 |
+
)
|
357 |
+
}
|
358 |
+
)
|
359 |
+
|
360 |
+
dismiss.click(
|
361 |
+
function(){
|
362 |
+
form.animate( {'margin-left':formMarginLeft},spd )
|
363 |
+
dismiss.hide()
|
364 |
+
dismiss.animate( {'opacity':0},spd )
|
365 |
+
setTimeout(
|
366 |
+
function(){
|
367 |
+
label.show()
|
368 |
+
label.animate( {'opacity':1},spd )
|
369 |
+
},spd
|
370 |
+
)
|
371 |
+
}
|
372 |
+
)
|
373 |
+
}
|
374 |
+
)
|
375 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
|
377 |
+
slideOut( '.search' );
|
378 |
+
} )( jQuery );
|
379 |
+
|
380 |
+
(function ($, root, undefined) {
|
381 |
|
382 |
+
var document = window.document;
|
383 |
+
'use strict';
|
384 |
|
385 |
+
function extend( a, b ) {
|
386 |
+
for ( var key in b ) {
|
387 |
+
if ( b.hasOwnProperty( key ) ) {
|
388 |
+
a[key] = b[key];
|
389 |
+
}
|
|
|
|
|
390 |
}
|
391 |
+
return a;
|
392 |
}
|
|
|
|
|
393 |
|
394 |
+
function cbpHorizontalSlideOutMenu( el, options ) {
|
395 |
+
this.el = el;
|
396 |
+
this.options = extend( this.defaults, options );
|
397 |
+
this._init();
|
398 |
+
}
|
399 |
|
400 |
+
cbpHorizontalSlideOutMenu.prototype = {
|
401 |
+
|
402 |
+
defaults : {},
|
403 |
+
_init : function() {
|
404 |
+
this.current = -1;
|
405 |
+
this.touch = Modernizr.touch;
|
406 |
+
this.menu = this.el.querySelector( '.cbp-hsmenu' );
|
407 |
+
this.menuItems = this.el.querySelectorAll( '.cbp-hsmenu > li' );
|
408 |
+
this.menuBg = document.createElement( 'div' );
|
409 |
+
this.menuBg.className = 'cbp-hsmenubg';
|
410 |
+
this.el.appendChild( this.menuBg );
|
411 |
+
this._initEvents();
|
412 |
+
},
|
413 |
+
_openMenu : function( el, ev ) {
|
414 |
+
|
415 |
+
var self = this,
|
416 |
+
item = el.parentNode,
|
417 |
+
items = Array.prototype.slice.call( this.menuItems ),
|
418 |
+
submenu = item.querySelector( '.cbp-hssubmenu' ),
|
419 |
closeCurrent = function( current ) {
|
420 |
+
var current = current || self.menuItems[ self.current ];
|
421 |
current.className = '';
|
422 |
+
current.setAttribute( 'data-open', '' );
|
423 |
},
|
424 |
closePanel = function() {
|
425 |
+
self.current = -1;
|
426 |
self.menuBg.style.height = '0px';
|
427 |
};
|
428 |
|
429 |
+
if ( submenu ) {
|
430 |
+
|
431 |
+
ev.preventDefault();
|
432 |
+
|
433 |
+
if ( item.getAttribute( 'data-open' ) === 'open' ) {
|
434 |
+
closeCurrent( item );
|
435 |
+
closePanel();
|
436 |
+
} else {
|
437 |
+
item.setAttribute( 'data-open', 'open' );
|
438 |
+
if ( self.current !== -1 ) {
|
439 |
+
closeCurrent();
|
440 |
+
}
|
441 |
+
self.current = items.indexOf( item );
|
442 |
+
item.className = 'cbp-hsitem-open';
|
443 |
+
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
444 |
+
}
|
445 |
+
} else {
|
446 |
+
if ( self.current !== -1 ) {
|
447 |
closeCurrent();
|
448 |
+
closePanel();
|
449 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
}
|
|
|
451 |
|
452 |
+
},
|
453 |
+
_initEvents : function() {
|
|
|
|
|
454 |
|
455 |
+
var self = this;
|
456 |
+
|
457 |
+
Array.prototype.slice.call( this.menuItems ).forEach(
|
458 |
+
function( el, i ) {
|
459 |
+
var trigger = el.querySelector( 'a' );
|
460 |
+
if ( self.touch ) {
|
461 |
+
trigger.addEventListener( 'touchstart', function( ev ) { self._openMenu( this, ev ); } );
|
462 |
+
} else {
|
463 |
+
trigger.addEventListener( 'click', function( ev ) { self._openMenu( this, ev ); } );
|
464 |
+
}
|
465 |
+
}
|
466 |
+
);
|
467 |
+
|
468 |
+
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
469 |
+
|
470 |
+
},
|
471 |
+
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
472 |
+
// original debounce by John Hann
|
473 |
+
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
474 |
+
_resizeHandler : function() {
|
475 |
+
var self = this;
|
476 |
+
function delayed() {
|
477 |
+
self._resize();
|
478 |
+
self._resizeTimeout = null;
|
479 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
|
481 |
+
if ( this._resizeTimeout ) {
|
482 |
+
clearTimeout( this._resizeTimeout );
|
483 |
+
}
|
484 |
|
485 |
+
this._resizeTimeout = setTimeout( delayed, 50 );
|
486 |
+
},
|
487 |
+
_resize : function() {
|
488 |
+
if ( this.current !== -1 ) {
|
489 |
+
this.menuBg.style.height = this.menuItems[ this.current ].querySelector( '.cbp-hssubmenu' ).offsetHeight + 'px';
|
490 |
+
}
|
491 |
}
|
492 |
}
|
|
|
493 |
|
494 |
+
// add to global namespace
|
495 |
+
window.cbpHorizontalSlideOutMenu = cbpHorizontalSlideOutMenu;
|
|
|
|
|
496 |
|
497 |
+
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
498 |
|
499 |
+
})(jQuery, this.el);
|
500 |
|
501 |
} )( jQuery );
|
502 |
|
503 |
+
jQuery( document ).ready(
|
504 |
+
function() {
|
505 |
+
jQuery( "#cbp-hsmenu-wrapper ul.sub-menu" ).each(
|
506 |
+
function(i){
|
507 |
+
jQuery( this ).removeClass( "sub-menu" );
|
508 |
+
jQuery( this ).addClass( "cbp-hssubmenu" );
|
509 |
+
}
|
510 |
+
);
|
511 |
+
}
|
512 |
+
);
|
assets/js/frontend.js
CHANGED
@@ -4,41 +4,49 @@
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
-
|
8 |
(function ($, root, undefined) {
|
9 |
-
|
10 |
-
$(document).ready(function() {
|
11 |
-
|
12 |
-
'use strict';
|
13 |
-
|
14 |
-
var touch = $('#touch-menu');
|
15 |
-
var overlaymenu = $('.overlay-navigation');
|
16 |
-
|
17 |
-
$(touch).on('click', function(e) {
|
18 |
-
e.preventDefault();
|
19 |
-
overlaymenu.toggleClass("visible");
|
20 |
-
$('body').toggleClass("menu-open");
|
21 |
-
touch.toggleClass("on");
|
22 |
-
});
|
23 |
-
|
24 |
-
$(window).resize(function(){
|
25 |
-
var w = $(window).width();
|
26 |
-
if(w > 768 && overlaymenu.is(':hidden')) {
|
27 |
-
overlaymenu.removeAttr('style');
|
28 |
-
}
|
29 |
-
});
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
fullWindow();
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
})(jQuery);
|
43 |
|
44 |
|
@@ -48,13 +56,19 @@
|
|
48 |
function initElementorPrimaryNavigation( container ) {
|
49 |
|
50 |
// Add dropdown toggle that displays child menu items.
|
51 |
-
var eldropdownToggle = $(
|
52 |
-
'
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
60 |
|
@@ -65,26 +79,28 @@
|
|
65 |
// Add menu items with submenus to aria-haspopup="true".
|
66 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
67 |
|
68 |
-
container.find( '.eldropdown-toggle' ).click(
|
69 |
-
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
81 |
}
|
82 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
83 |
|
84 |
-
menuAreaPrimary
|
85 |
-
elmenuTogglePrimary
|
86 |
-
elementorPrimaryHeaderMenu
|
87 |
-
elementorPrimaryNavigation
|
88 |
|
89 |
// Enable elmenuTogglePrimary.
|
90 |
( function() {
|
@@ -97,13 +113,15 @@
|
|
97 |
// Add an initial values for the attribute.
|
98 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
99 |
|
100 |
-
elmenuTogglePrimary.on(
|
101 |
-
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
107 |
} )();
|
108 |
|
109 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
@@ -115,20 +133,24 @@
|
|
115 |
// Toggle `focus` class to allow submenu access on tablets.
|
116 |
function toggleFocusClassTouchScreen() {
|
117 |
if ( window.innerWidth >= 910 ) {
|
118 |
-
$( document.body ).on(
|
119 |
-
|
120 |
-
$( '.elementor-navigation li' ).
|
|
|
|
|
121 |
}
|
122 |
-
|
123 |
-
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
130 |
}
|
131 |
-
|
132 |
} else {
|
133 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
134 |
}
|
@@ -139,9 +161,11 @@
|
|
139 |
toggleFocusClassTouchScreen();
|
140 |
}
|
141 |
|
142 |
-
elementorPrimaryNavigation.find( 'a' ).on(
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
} )();
|
146 |
|
147 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
@@ -167,295 +191,322 @@
|
|
167 |
}
|
168 |
}
|
169 |
|
|
|
|
|
|
|
170 |
|
171 |
-
|
172 |
-
( function( $ ) {
|
173 |
-
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
174 |
-
|
175 |
-
function initElementorSecondaryNavigation( container ) {
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
187 |
|
188 |
-
|
189 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
190 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
191 |
|
192 |
-
|
193 |
-
|
|
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
screenReaderSpan = _this.find( '.screen-reader-text' );
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
207 |
-
} );
|
208 |
-
}
|
209 |
-
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
215 |
|
216 |
-
|
217 |
-
|
|
|
|
|
218 |
|
219 |
-
//
|
220 |
-
|
221 |
-
return;
|
222 |
-
}
|
223 |
|
224 |
-
|
225 |
-
|
|
|
|
|
226 |
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
} );
|
234 |
-
} )();
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
241 |
|
242 |
-
//
|
243 |
-
function
|
244 |
-
if (
|
245 |
-
|
246 |
-
|
247 |
-
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
248 |
-
}
|
249 |
-
} );
|
250 |
-
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
|
251 |
-
var el = $( this ).parent( 'li' );
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
}
|
262 |
-
}
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
} else {
|
280 |
-
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
281 |
-
}
|
282 |
|
283 |
-
|
284 |
-
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
285 |
} else {
|
286 |
-
|
|
|
|
|
287 |
}
|
|
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
-
}
|
296 |
-
|
297 |
-
//// Search slideOut
|
298 |
-
function slideOut(parent) {
|
299 |
-
$(parent).each(function(){
|
300 |
-
var label = $(this).find('.label'),
|
301 |
-
form = $(this).find('.form'),
|
302 |
-
dismiss = $(this).find('.dismiss'),
|
303 |
-
formMarginLeft = form.css('margin-left'),
|
304 |
-
spd = 500;
|
305 |
-
|
306 |
-
label.click(function(){
|
307 |
-
form.animate({'margin-left':0},spd)
|
308 |
-
label.hide()
|
309 |
-
label.animate({'opacity':0},spd)
|
310 |
-
setTimeout(function(){
|
311 |
-
dismiss.show()
|
312 |
-
dismiss.animate({'opacity':1},spd)
|
313 |
-
},spd)
|
314 |
-
})
|
315 |
-
|
316 |
-
dismiss.click(function(){
|
317 |
-
form.animate({'margin-left':formMarginLeft},spd)
|
318 |
-
dismiss.hide()
|
319 |
-
dismiss.animate({'opacity':0},spd)
|
320 |
-
setTimeout(function(){
|
321 |
-
label.show()
|
322 |
-
label.animate({'opacity':1},spd)
|
323 |
-
},spd)
|
324 |
-
})
|
325 |
-
})
|
326 |
-
}
|
327 |
|
328 |
-
|
329 |
-
} )( jQuery );
|
|
|
|
|
330 |
|
331 |
-
|
|
|
332 |
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
if( b.hasOwnProperty( key ) ) {
|
339 |
-
a[key] = b[key];
|
340 |
}
|
|
|
341 |
}
|
342 |
-
return a;
|
343 |
-
}
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
item
|
368 |
-
items
|
369 |
-
submenu
|
370 |
closeCurrent = function( current ) {
|
371 |
-
var current
|
372 |
current.className = '';
|
373 |
-
current.setAttribute( 'data-open', '' );
|
374 |
},
|
375 |
closePanel = function() {
|
376 |
-
self.current
|
377 |
self.menuBg.style.height = '0px';
|
378 |
};
|
379 |
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
closeCurrent();
|
|
|
392 |
}
|
393 |
-
self.current = items.indexOf( item );
|
394 |
-
item.className = 'cbp-hsitem-open';
|
395 |
-
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
396 |
-
}
|
397 |
-
}
|
398 |
-
else {
|
399 |
-
if( self.current !== -1 ) {
|
400 |
-
closeCurrent();
|
401 |
-
closePanel();
|
402 |
}
|
403 |
-
}
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
var self = this;
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
}
|
418 |
-
} );
|
419 |
-
|
420 |
-
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
421 |
-
|
422 |
-
},
|
423 |
-
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
424 |
-
// original debounce by John Hann
|
425 |
-
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
426 |
-
_resizeHandler : function() {
|
427 |
-
var self = this;
|
428 |
-
function delayed() {
|
429 |
-
self._resize();
|
430 |
-
self._resizeTimeout = null;
|
431 |
-
}
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
|
|
442 |
}
|
443 |
}
|
444 |
-
}
|
445 |
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
450 |
|
451 |
-
|
452 |
|
|
|
453 |
|
454 |
} )( jQuery );
|
455 |
|
456 |
-
jQuery(document).ready(
|
457 |
-
|
458 |
-
jQuery(
|
459 |
-
|
460 |
-
|
461 |
-
|
|
|
|
|
|
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
+
|
8 |
(function ($, root, undefined) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
$( document ).ready(
|
11 |
+
function() {
|
12 |
+
|
13 |
+
'use strict';
|
14 |
+
|
15 |
+
var touch = $( '#touch-menu' );
|
16 |
+
var overlaymenu = $( '.overlay-navigation' );
|
17 |
+
|
18 |
+
$( touch ).on(
|
19 |
+
'click', function(e) {
|
20 |
+
e.preventDefault();
|
21 |
+
overlaymenu.toggleClass( "visible" );
|
22 |
+
$( 'body' ).toggleClass( "menu-open" );
|
23 |
+
touch.toggleClass( "on" );
|
24 |
+
}
|
25 |
+
);
|
26 |
|
27 |
+
$( window ).resize(
|
28 |
+
function(){
|
29 |
+
var w = $( window ).width();
|
30 |
+
if (w > 768 && overlaymenu.is( ':hidden' )) {
|
31 |
+
overlaymenu.removeAttr( 'style' );
|
32 |
+
}
|
33 |
+
}
|
34 |
+
);
|
35 |
+
|
36 |
+
function fullWindow() {
|
37 |
+
$( ".fullwindow" ).css( "height", $( window ).height() );
|
38 |
+
};
|
39 |
fullWindow();
|
40 |
+
|
41 |
+
$( window ).resize(
|
42 |
+
function() {
|
43 |
+
fullWindow();
|
44 |
+
}
|
45 |
+
);
|
46 |
+
|
47 |
+
}
|
48 |
+
);
|
49 |
+
|
50 |
})(jQuery);
|
51 |
|
52 |
|
56 |
function initElementorPrimaryNavigation( container ) {
|
57 |
|
58 |
// Add dropdown toggle that displays child menu items.
|
59 |
+
var eldropdownToggle = $(
|
60 |
+
'<button />', {
|
61 |
+
'class': 'eldropdown-toggle',
|
62 |
+
'aria-expanded': false
|
63 |
+
}
|
64 |
+
).append(
|
65 |
+
$(
|
66 |
+
'<span />', {
|
67 |
+
'class': 'screen-reader-text',
|
68 |
+
text: elementorScreenReaderText.expand
|
69 |
+
}
|
70 |
+
)
|
71 |
+
);
|
72 |
|
73 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
74 |
|
79 |
// Add menu items with submenus to aria-haspopup="true".
|
80 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
81 |
|
82 |
+
container.find( '.eldropdown-toggle' ).click(
|
83 |
+
function( e ) {
|
84 |
+
var _this = $( this ),
|
85 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
86 |
|
87 |
+
e.preventDefault();
|
88 |
+
_this.toggleClass( 'eltoggled-on' );
|
89 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
90 |
|
91 |
+
// jscs:disable
|
92 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
93 |
+
// jscs:enable
|
94 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
|
95 |
+
}
|
96 |
+
);
|
97 |
}
|
98 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
99 |
|
100 |
+
menuAreaPrimary = $( '#elementor-header-primary' );
|
101 |
+
elmenuTogglePrimary = menuAreaPrimary.find( '#elementor-menu-toggle' );
|
102 |
+
elementorPrimaryHeaderMenu = menuAreaPrimary.find( '#elementor-menu' );
|
103 |
+
elementorPrimaryNavigation = menuAreaPrimary.find( '#elementor-navigation' );
|
104 |
|
105 |
// Enable elmenuTogglePrimary.
|
106 |
( function() {
|
113 |
// Add an initial values for the attribute.
|
114 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
115 |
|
116 |
+
elmenuTogglePrimary.on(
|
117 |
+
'click.actions', function() {
|
118 |
+
$( this ).add( elementorPrimaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
119 |
|
120 |
+
// jscs:disable
|
121 |
+
$( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
122 |
+
// jscs:enable
|
123 |
+
}
|
124 |
+
);
|
125 |
} )();
|
126 |
|
127 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
133 |
// Toggle `focus` class to allow submenu access on tablets.
|
134 |
function toggleFocusClassTouchScreen() {
|
135 |
if ( window.innerWidth >= 910 ) {
|
136 |
+
$( document.body ).on(
|
137 |
+
'touchstart.actions', function( e ) {
|
138 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
139 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
140 |
+
}
|
141 |
}
|
142 |
+
);
|
143 |
+
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
144 |
+
'touchstart.actions', function( e ) {
|
145 |
+
var el = $( this ).parent( 'li' );
|
146 |
+
|
147 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
148 |
+
e.preventDefault();
|
149 |
+
el.toggleClass( 'focus' );
|
150 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
151 |
+
}
|
152 |
}
|
153 |
+
);
|
154 |
} else {
|
155 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
156 |
}
|
161 |
toggleFocusClassTouchScreen();
|
162 |
}
|
163 |
|
164 |
+
elementorPrimaryNavigation.find( 'a' ).on(
|
165 |
+
'focus.actions blur.actions', function() {
|
166 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
167 |
+
}
|
168 |
+
);
|
169 |
} )();
|
170 |
|
171 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
191 |
}
|
192 |
}
|
193 |
|
194 |
+
// Start our Secondary navigation
|
195 |
+
( function( $ ) {
|
196 |
+
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
197 |
|
198 |
+
function initElementorSecondaryNavigation( container ) {
|
|
|
|
|
|
|
|
|
199 |
|
200 |
+
// Add dropdown toggle that displays child menu items.
|
201 |
+
var eldropdownSecondaryToggle = $(
|
202 |
+
'<button />', {
|
203 |
+
'class': 'eldropdown-toggle',
|
204 |
+
'aria-expanded': false
|
205 |
+
}
|
206 |
+
).append(
|
207 |
+
$(
|
208 |
+
'<span />', {
|
209 |
+
'class': 'screen-reader-text',
|
210 |
+
text: elementorSecondaryScreenReaderText.expand
|
211 |
+
}
|
212 |
+
)
|
213 |
+
);
|
214 |
|
215 |
+
container.find( '#elementor-header-secondary .menu-item-has-children > a' ).after( eldropdownSecondaryToggle );
|
|
|
|
|
216 |
|
217 |
+
// Toggle buttons and submenu items with active children menu items.
|
218 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
219 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
220 |
|
221 |
+
// Add menu items with submenus to aria-haspopup="true".
|
222 |
+
container.find( '#elementor-header-secondary .menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
|
|
223 |
|
224 |
+
container.find( '#elementor-header-secondary .eldropdown-toggle' ).click(
|
225 |
+
function( e ) {
|
226 |
+
var _this = $( this ),
|
227 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
228 |
|
229 |
+
e.preventDefault();
|
230 |
+
_this.toggleClass( 'eltoggled-on' );
|
231 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
|
|
|
|
|
|
|
|
232 |
|
233 |
+
// jscs:disable
|
234 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
235 |
+
// jscs:enable
|
236 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
237 |
+
}
|
238 |
+
);
|
239 |
+
}
|
240 |
+
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
241 |
|
242 |
+
menuAreaSecondary = $( '#elementor-header-secondary' );
|
243 |
+
elmenuToggleSecondary = menuAreaSecondary.find( '#elementor-menu-toggle' );
|
244 |
+
elementorSecondaryHeaderMenu = menuAreaSecondary.find( '#elementor-menu' );
|
245 |
+
elementorSecondaryNavigation = menuAreaSecondary.find( '#elementor-navigation' );
|
246 |
|
247 |
+
// Enable elmenuToggleSecondary.
|
248 |
+
( function() {
|
|
|
|
|
249 |
|
250 |
+
// Return early if elmenuToggleSecondary is missing.
|
251 |
+
if ( ! elmenuToggleSecondary.length ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
|
255 |
+
// Add an initial values for the attribute.
|
256 |
+
elmenuToggleSecondary.add( elementorSecondaryNavigation ).attr( 'aria-expanded', 'false' );
|
257 |
|
258 |
+
elmenuToggleSecondary.on(
|
259 |
+
'click.actions', function() {
|
260 |
+
$( this ).add( elementorSecondaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
|
|
|
|
261 |
|
262 |
+
// jscs:disable
|
263 |
+
$( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
264 |
+
// jscs:enable
|
265 |
+
}
|
266 |
+
);
|
267 |
+
} )();
|
268 |
|
269 |
+
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
270 |
+
( function() {
|
271 |
+
if ( ! elementorSecondaryNavigation.length || ! elementorSecondaryNavigation.children().length ) {
|
272 |
+
return;
|
273 |
+
}
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
+
// Toggle `focus` class to allow submenu access on tablets.
|
276 |
+
function toggleFocusClassTouchScreen() {
|
277 |
+
if ( window.innerWidth >= 910 ) {
|
278 |
+
$( document.body ).on(
|
279 |
+
'touchstart.actions', function( e ) {
|
280 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
281 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
282 |
+
}
|
283 |
+
}
|
284 |
+
);
|
285 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on(
|
286 |
+
'touchstart.actions', function( e ) {
|
287 |
+
var el = $( this ).parent( 'li' );
|
288 |
+
|
289 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
290 |
+
e.preventDefault();
|
291 |
+
el.toggleClass( 'focus' );
|
292 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
293 |
+
}
|
294 |
+
}
|
295 |
+
);
|
296 |
+
} else {
|
297 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
298 |
+
}
|
299 |
}
|
|
|
300 |
|
301 |
+
if ( 'ontouchstart' in window ) {
|
302 |
+
$( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
|
303 |
+
toggleFocusClassTouchScreen();
|
304 |
+
}
|
305 |
|
306 |
+
elementorSecondaryNavigation.find( 'a' ).on(
|
307 |
+
'focus.actions blur.actions', function() {
|
308 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
309 |
+
}
|
310 |
+
);
|
311 |
+
} )();
|
312 |
+
|
313 |
+
// Add the default ARIA attributes for the menu toggle and the navigations.
|
314 |
+
function onResizeARIA() {
|
315 |
+
if ( window.innerWidth < 910 ) {
|
316 |
+
if ( elmenuToggleSecondary.hasClass( 'eltoggled-on' ) ) {
|
317 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'true' );
|
318 |
+
} else {
|
319 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
320 |
+
}
|
321 |
|
322 |
+
if ( elementorSecondaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
|
323 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
324 |
+
} else {
|
325 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'false' );
|
326 |
+
}
|
|
|
|
|
|
|
327 |
|
328 |
+
elmenuToggleSecondary.attr( 'aria-controls', 'site-navigation' );
|
|
|
329 |
} else {
|
330 |
+
elmenuToggleSecondary.removeAttr( 'aria-expanded' );
|
331 |
+
elementorSecondaryNavigation.removeAttr( 'aria-expanded' );
|
332 |
+
elmenuToggleSecondary.removeAttr( 'aria-controls' );
|
333 |
}
|
334 |
+
}
|
335 |
|
336 |
+
// Search slideOut
|
337 |
+
function slideOut(parent) {
|
338 |
+
$( parent ).each(
|
339 |
+
function(){
|
340 |
+
var label = $( this ).find( '.label' ),
|
341 |
+
form = $( this ).find( '.form' ),
|
342 |
+
dismiss = $( this ).find( '.dismiss' ),
|
343 |
+
formMarginLeft = form.css( 'margin-left' ),
|
344 |
+
spd = 500;
|
345 |
+
|
346 |
+
label.click(
|
347 |
+
function(){
|
348 |
+
form.animate( {'margin-left':0},spd )
|
349 |
+
label.hide()
|
350 |
+
label.animate( {'opacity':0},spd )
|
351 |
+
setTimeout(
|
352 |
+
function(){
|
353 |
+
dismiss.show()
|
354 |
+
dismiss.animate( {'opacity':1},spd )
|
355 |
+
},spd
|
356 |
+
)
|
357 |
+
}
|
358 |
+
)
|
359 |
+
|
360 |
+
dismiss.click(
|
361 |
+
function(){
|
362 |
+
form.animate( {'margin-left':formMarginLeft},spd )
|
363 |
+
dismiss.hide()
|
364 |
+
dismiss.animate( {'opacity':0},spd )
|
365 |
+
setTimeout(
|
366 |
+
function(){
|
367 |
+
label.show()
|
368 |
+
label.animate( {'opacity':1},spd )
|
369 |
+
},spd
|
370 |
+
)
|
371 |
+
}
|
372 |
+
)
|
373 |
+
}
|
374 |
+
)
|
375 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
|
377 |
+
slideOut( '.search' );
|
378 |
+
} )( jQuery );
|
379 |
+
|
380 |
+
(function ($, root, undefined) {
|
381 |
|
382 |
+
var document = window.document;
|
383 |
+
'use strict';
|
384 |
|
385 |
+
function extend( a, b ) {
|
386 |
+
for ( var key in b ) {
|
387 |
+
if ( b.hasOwnProperty( key ) ) {
|
388 |
+
a[key] = b[key];
|
389 |
+
}
|
|
|
|
|
390 |
}
|
391 |
+
return a;
|
392 |
}
|
|
|
|
|
393 |
|
394 |
+
function cbpHorizontalSlideOutMenu( el, options ) {
|
395 |
+
this.el = el;
|
396 |
+
this.options = extend( this.defaults, options );
|
397 |
+
this._init();
|
398 |
+
}
|
399 |
|
400 |
+
cbpHorizontalSlideOutMenu.prototype = {
|
401 |
+
|
402 |
+
defaults : {},
|
403 |
+
_init : function() {
|
404 |
+
this.current = -1;
|
405 |
+
this.touch = Modernizr.touch;
|
406 |
+
this.menu = this.el.querySelector( '.cbp-hsmenu' );
|
407 |
+
this.menuItems = this.el.querySelectorAll( '.cbp-hsmenu > li' );
|
408 |
+
this.menuBg = document.createElement( 'div' );
|
409 |
+
this.menuBg.className = 'cbp-hsmenubg';
|
410 |
+
this.el.appendChild( this.menuBg );
|
411 |
+
this._initEvents();
|
412 |
+
},
|
413 |
+
_openMenu : function( el, ev ) {
|
414 |
+
|
415 |
+
var self = this,
|
416 |
+
item = el.parentNode,
|
417 |
+
items = Array.prototype.slice.call( this.menuItems ),
|
418 |
+
submenu = item.querySelector( '.cbp-hssubmenu' ),
|
419 |
closeCurrent = function( current ) {
|
420 |
+
var current = current || self.menuItems[ self.current ];
|
421 |
current.className = '';
|
422 |
+
current.setAttribute( 'data-open', '' );
|
423 |
},
|
424 |
closePanel = function() {
|
425 |
+
self.current = -1;
|
426 |
self.menuBg.style.height = '0px';
|
427 |
};
|
428 |
|
429 |
+
if ( submenu ) {
|
430 |
+
|
431 |
+
ev.preventDefault();
|
432 |
+
|
433 |
+
if ( item.getAttribute( 'data-open' ) === 'open' ) {
|
434 |
+
closeCurrent( item );
|
435 |
+
closePanel();
|
436 |
+
} else {
|
437 |
+
item.setAttribute( 'data-open', 'open' );
|
438 |
+
if ( self.current !== -1 ) {
|
439 |
+
closeCurrent();
|
440 |
+
}
|
441 |
+
self.current = items.indexOf( item );
|
442 |
+
item.className = 'cbp-hsitem-open';
|
443 |
+
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
444 |
+
}
|
445 |
+
} else {
|
446 |
+
if ( self.current !== -1 ) {
|
447 |
closeCurrent();
|
448 |
+
closePanel();
|
449 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
}
|
|
|
451 |
|
452 |
+
},
|
453 |
+
_initEvents : function() {
|
|
|
|
|
454 |
|
455 |
+
var self = this;
|
456 |
+
|
457 |
+
Array.prototype.slice.call( this.menuItems ).forEach(
|
458 |
+
function( el, i ) {
|
459 |
+
var trigger = el.querySelector( 'a' );
|
460 |
+
if ( self.touch ) {
|
461 |
+
trigger.addEventListener( 'touchstart', function( ev ) { self._openMenu( this, ev ); } );
|
462 |
+
} else {
|
463 |
+
trigger.addEventListener( 'click', function( ev ) { self._openMenu( this, ev ); } );
|
464 |
+
}
|
465 |
+
}
|
466 |
+
);
|
467 |
+
|
468 |
+
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
469 |
+
|
470 |
+
},
|
471 |
+
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
472 |
+
// original debounce by John Hann
|
473 |
+
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
474 |
+
_resizeHandler : function() {
|
475 |
+
var self = this;
|
476 |
+
function delayed() {
|
477 |
+
self._resize();
|
478 |
+
self._resizeTimeout = null;
|
479 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
|
481 |
+
if ( this._resizeTimeout ) {
|
482 |
+
clearTimeout( this._resizeTimeout );
|
483 |
+
}
|
484 |
|
485 |
+
this._resizeTimeout = setTimeout( delayed, 50 );
|
486 |
+
},
|
487 |
+
_resize : function() {
|
488 |
+
if ( this.current !== -1 ) {
|
489 |
+
this.menuBg.style.height = this.menuItems[ this.current ].querySelector( '.cbp-hssubmenu' ).offsetHeight + 'px';
|
490 |
+
}
|
491 |
}
|
492 |
}
|
|
|
493 |
|
494 |
+
// add to global namespace
|
495 |
+
window.cbpHorizontalSlideOutMenu = cbpHorizontalSlideOutMenu;
|
|
|
|
|
496 |
|
497 |
+
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
498 |
|
499 |
+
})(jQuery, this.el);
|
500 |
|
501 |
} )( jQuery );
|
502 |
|
503 |
+
jQuery( document ).ready(
|
504 |
+
function() {
|
505 |
+
jQuery( "#cbp-hsmenu-wrapper ul.sub-menu" ).each(
|
506 |
+
function(i){
|
507 |
+
jQuery( this ).removeClass( "sub-menu" );
|
508 |
+
jQuery( this ).addClass( "cbp-hssubmenu" );
|
509 |
+
}
|
510 |
+
);
|
511 |
+
}
|
512 |
+
);
|
assets/js/frontend.min.js
CHANGED
@@ -4,41 +4,49 @@
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
-
|
8 |
(function ($, root, undefined) {
|
9 |
-
|
10 |
-
$(document).ready(function() {
|
11 |
-
|
12 |
-
'use strict';
|
13 |
-
|
14 |
-
var touch = $('#touch-menu');
|
15 |
-
var overlaymenu = $('.overlay-navigation');
|
16 |
-
|
17 |
-
$(touch).on('click', function(e) {
|
18 |
-
e.preventDefault();
|
19 |
-
overlaymenu.toggleClass("visible");
|
20 |
-
$('body').toggleClass("menu-open");
|
21 |
-
touch.toggleClass("on");
|
22 |
-
});
|
23 |
-
|
24 |
-
$(window).resize(function(){
|
25 |
-
var w = $(window).width();
|
26 |
-
if(w > 768 && overlaymenu.is(':hidden')) {
|
27 |
-
overlaymenu.removeAttr('style');
|
28 |
-
}
|
29 |
-
});
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
fullWindow();
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
})(jQuery);
|
43 |
|
44 |
|
@@ -48,13 +56,19 @@
|
|
48 |
function initElementorPrimaryNavigation( container ) {
|
49 |
|
50 |
// Add dropdown toggle that displays child menu items.
|
51 |
-
var eldropdownToggle = $(
|
52 |
-
'
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
60 |
|
@@ -65,26 +79,28 @@
|
|
65 |
// Add menu items with submenus to aria-haspopup="true".
|
66 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
67 |
|
68 |
-
container.find( '.eldropdown-toggle' ).click(
|
69 |
-
|
70 |
-
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
81 |
}
|
82 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
83 |
|
84 |
-
menuAreaPrimary
|
85 |
-
elmenuTogglePrimary
|
86 |
-
elementorPrimaryHeaderMenu
|
87 |
-
elementorPrimaryNavigation
|
88 |
|
89 |
// Enable elmenuTogglePrimary.
|
90 |
( function() {
|
@@ -97,13 +113,15 @@
|
|
97 |
// Add an initial values for the attribute.
|
98 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
99 |
|
100 |
-
elmenuTogglePrimary.on(
|
101 |
-
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
107 |
} )();
|
108 |
|
109 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
@@ -115,20 +133,24 @@
|
|
115 |
// Toggle `focus` class to allow submenu access on tablets.
|
116 |
function toggleFocusClassTouchScreen() {
|
117 |
if ( window.innerWidth >= 910 ) {
|
118 |
-
$( document.body ).on(
|
119 |
-
|
120 |
-
$( '.elementor-navigation li' ).
|
|
|
|
|
121 |
}
|
122 |
-
|
123 |
-
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
130 |
}
|
131 |
-
|
132 |
} else {
|
133 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
134 |
}
|
@@ -139,9 +161,11 @@
|
|
139 |
toggleFocusClassTouchScreen();
|
140 |
}
|
141 |
|
142 |
-
elementorPrimaryNavigation.find( 'a' ).on(
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
} )();
|
146 |
|
147 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
@@ -167,297 +191,324 @@
|
|
167 |
}
|
168 |
}
|
169 |
|
|
|
|
|
|
|
170 |
|
171 |
-
|
172 |
-
( function( $ ) {
|
173 |
-
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
174 |
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
-
|
178 |
-
var eldropdownSecondaryToggle = $( '<button />', {
|
179 |
-
'class': 'eldropdown-toggle',
|
180 |
-
'aria-expanded': false
|
181 |
-
} ).append( $( '<span />', {
|
182 |
-
'class': 'screen-reader-text',
|
183 |
-
text: elementorSecondaryScreenReaderText.expand
|
184 |
-
} ) );
|
185 |
|
186 |
-
|
|
|
|
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
191 |
|
192 |
-
|
193 |
-
|
|
|
|
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
} );
|
208 |
-
}
|
209 |
-
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
elementorSecondaryHeaderMenu = menuAreaSecondary.find( '#elementor-menu' );
|
214 |
-
elementorSecondaryNavigation = menuAreaSecondary.find( '#elementor-navigation' );
|
215 |
|
216 |
-
|
217 |
-
|
|
|
|
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
return;
|
222 |
-
}
|
223 |
|
224 |
-
|
225 |
-
|
|
|
226 |
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
247 |
-
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
248 |
-
}
|
249 |
-
} );
|
250 |
-
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
|
251 |
-
var el = $( this ).parent( 'li' );
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
} else {
|
260 |
-
|
|
|
|
|
261 |
}
|
262 |
}
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
}
|
268 |
|
269 |
-
|
270 |
-
|
271 |
-
} );
|
272 |
-
} )();
|
273 |
|
274 |
-
|
275 |
-
function onResizeARIA() {
|
276 |
-
if ( window.innerWidth < 910 ) {
|
277 |
-
if ( elmenuToggleSecondary.hasClass( 'eltoggled-on' ) ) {
|
278 |
-
elmenuToggleSecondary.attr( 'aria-expanded', 'true' );
|
279 |
-
} else {
|
280 |
-
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
281 |
-
}
|
282 |
-
|
283 |
-
if ( elementorSecondaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
|
284 |
-
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
285 |
-
} else {
|
286 |
-
elementorSecondaryNavigation.attr( 'aria-expanded', 'false' );
|
287 |
-
}
|
288 |
|
289 |
-
|
290 |
-
|
291 |
-
elmenuToggleSecondary.removeAttr( 'aria-expanded' );
|
292 |
-
elementorSecondaryNavigation.removeAttr( 'aria-expanded' );
|
293 |
-
elmenuToggleSecondary.removeAttr( 'aria-controls' );
|
294 |
-
}
|
295 |
-
}
|
296 |
-
|
297 |
-
//// Search slideOut
|
298 |
-
function slideOut(parent) {
|
299 |
-
$(parent).each(function(){
|
300 |
-
var label = $(this).find('.label'),
|
301 |
-
form = $(this).find('.form'),
|
302 |
-
dismiss = $(this).find('.dismiss'),
|
303 |
-
formMarginLeft = form.css('margin-left'),
|
304 |
-
spd = 500;
|
305 |
-
|
306 |
-
label.click(function(){
|
307 |
-
form.animate({'margin-left':0},spd)
|
308 |
-
label.hide()
|
309 |
-
label.animate({'opacity':0},spd)
|
310 |
-
setTimeout(function(){
|
311 |
-
dismiss.show()
|
312 |
-
dismiss.animate({'opacity':1},spd)
|
313 |
-
},spd)
|
314 |
-
})
|
315 |
-
|
316 |
-
dismiss.click(function(){
|
317 |
-
form.animate({'margin-left':formMarginLeft},spd)
|
318 |
-
dismiss.hide()
|
319 |
-
dismiss.animate({'opacity':0},spd)
|
320 |
-
setTimeout(function(){
|
321 |
-
label.show()
|
322 |
-
label.animate({'opacity':1},spd)
|
323 |
-
},spd)
|
324 |
-
})
|
325 |
-
})
|
326 |
-
}
|
327 |
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
var document = window.document;
|
334 |
-
'use strict';
|
335 |
-
|
336 |
-
function extend( a, b ) {
|
337 |
-
for( var key in b ) {
|
338 |
-
if( b.hasOwnProperty( key ) ) {
|
339 |
-
a[key] = b[key];
|
340 |
}
|
|
|
341 |
}
|
342 |
-
return a;
|
343 |
-
}
|
344 |
-
|
345 |
-
function cbpHorizontalSlideOutMenu( el, options ) {
|
346 |
-
var el;
|
347 |
-
this.el = el;
|
348 |
-
this.options = extend( this.defaults, options );
|
349 |
-
this._init();
|
350 |
-
}
|
351 |
|
352 |
-
|
353 |
-
|
354 |
-
defaults : {},
|
355 |
-
_init : function() {
|
356 |
var el;
|
357 |
-
this.
|
358 |
-
this.
|
359 |
-
this.
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
closeCurrent = function( current ) {
|
373 |
-
var current
|
374 |
current.className = '';
|
375 |
-
current.setAttribute( 'data-open', '' );
|
376 |
},
|
377 |
closePanel = function() {
|
378 |
-
self.current
|
379 |
self.menuBg.style.height = '0px';
|
380 |
};
|
381 |
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
closeCurrent();
|
|
|
394 |
}
|
395 |
-
self.current = items.indexOf( item );
|
396 |
-
item.className = 'cbp-hsitem-open';
|
397 |
-
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
398 |
-
}
|
399 |
-
}
|
400 |
-
else {
|
401 |
-
if( self.current !== -1 ) {
|
402 |
-
closeCurrent();
|
403 |
-
closePanel();
|
404 |
}
|
405 |
-
}
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
var self = this;
|
411 |
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
}
|
420 |
-
} );
|
421 |
-
|
422 |
-
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
423 |
-
|
424 |
-
},
|
425 |
-
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
426 |
-
// original debounce by John Hann
|
427 |
-
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
428 |
-
_resizeHandler : function() {
|
429 |
-
var self = this;
|
430 |
-
function delayed() {
|
431 |
-
self._resize();
|
432 |
-
self._resizeTimeout = null;
|
433 |
-
}
|
434 |
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
|
|
444 |
}
|
445 |
}
|
446 |
-
}
|
447 |
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
452 |
|
453 |
-
|
454 |
|
|
|
455 |
|
456 |
} )( jQuery);
|
457 |
|
458 |
-
jQuery(document).ready(
|
459 |
-
|
460 |
-
jQuery(
|
461 |
-
|
462 |
-
|
463 |
-
|
|
|
|
|
|
|
|
4 |
*
|
5 |
* Contains handlers for navigation and widget area.
|
6 |
*/
|
7 |
+
|
8 |
(function ($, root, undefined) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
$( document ).ready(
|
11 |
+
function() {
|
12 |
+
|
13 |
+
'use strict';
|
14 |
+
|
15 |
+
var touch = $( '#touch-menu' );
|
16 |
+
var overlaymenu = $( '.overlay-navigation' );
|
17 |
+
|
18 |
+
$( touch ).on(
|
19 |
+
'click', function(e) {
|
20 |
+
e.preventDefault();
|
21 |
+
overlaymenu.toggleClass( "visible" );
|
22 |
+
$( 'body' ).toggleClass( "menu-open" );
|
23 |
+
touch.toggleClass( "on" );
|
24 |
+
}
|
25 |
+
);
|
26 |
|
27 |
+
$( window ).resize(
|
28 |
+
function(){
|
29 |
+
var w = $( window ).width();
|
30 |
+
if (w > 768 && overlaymenu.is( ':hidden' )) {
|
31 |
+
overlaymenu.removeAttr( 'style' );
|
32 |
+
}
|
33 |
+
}
|
34 |
+
);
|
35 |
+
|
36 |
+
function fullWindow() {
|
37 |
+
$( ".fullwindow" ).css( "height", $( window ).height() );
|
38 |
+
};
|
39 |
fullWindow();
|
40 |
+
|
41 |
+
$( window ).resize(
|
42 |
+
function() {
|
43 |
+
fullWindow();
|
44 |
+
}
|
45 |
+
);
|
46 |
+
|
47 |
+
}
|
48 |
+
);
|
49 |
+
|
50 |
})(jQuery);
|
51 |
|
52 |
|
56 |
function initElementorPrimaryNavigation( container ) {
|
57 |
|
58 |
// Add dropdown toggle that displays child menu items.
|
59 |
+
var eldropdownToggle = $(
|
60 |
+
'<button />', {
|
61 |
+
'class': 'eldropdown-toggle',
|
62 |
+
'aria-expanded': false
|
63 |
+
}
|
64 |
+
).append(
|
65 |
+
$(
|
66 |
+
'<span />', {
|
67 |
+
'class': 'screen-reader-text',
|
68 |
+
text: elementorScreenReaderText.expand
|
69 |
+
}
|
70 |
+
)
|
71 |
+
);
|
72 |
|
73 |
container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
|
74 |
|
79 |
// Add menu items with submenus to aria-haspopup="true".
|
80 |
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
81 |
|
82 |
+
container.find( '.eldropdown-toggle' ).click(
|
83 |
+
function( e ) {
|
84 |
+
var _this = $( this ),
|
85 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
86 |
|
87 |
+
e.preventDefault();
|
88 |
+
_this.toggleClass( 'eltoggled-on' );
|
89 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
90 |
|
91 |
+
// jscs:disable
|
92 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
93 |
+
// jscs:enable
|
94 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
|
95 |
+
}
|
96 |
+
);
|
97 |
}
|
98 |
initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
|
99 |
|
100 |
+
menuAreaPrimary = $( '#elementor-header-primary' );
|
101 |
+
elmenuTogglePrimary = menuAreaPrimary.find( '#elementor-menu-toggle' );
|
102 |
+
elementorPrimaryHeaderMenu = menuAreaPrimary.find( '#elementor-menu' );
|
103 |
+
elementorPrimaryNavigation = menuAreaPrimary.find( '#elementor-navigation' );
|
104 |
|
105 |
// Enable elmenuTogglePrimary.
|
106 |
( function() {
|
113 |
// Add an initial values for the attribute.
|
114 |
elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
|
115 |
|
116 |
+
elmenuTogglePrimary.on(
|
117 |
+
'click.actions', function() {
|
118 |
+
$( this ).add( elementorPrimaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
119 |
|
120 |
+
// jscs:disable
|
121 |
+
$( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
122 |
+
// jscs:enable
|
123 |
+
}
|
124 |
+
);
|
125 |
} )();
|
126 |
|
127 |
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
133 |
// Toggle `focus` class to allow submenu access on tablets.
|
134 |
function toggleFocusClassTouchScreen() {
|
135 |
if ( window.innerWidth >= 910 ) {
|
136 |
+
$( document.body ).on(
|
137 |
+
'touchstart.actions', function( e ) {
|
138 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
139 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
140 |
+
}
|
141 |
}
|
142 |
+
);
|
143 |
+
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on(
|
144 |
+
'touchstart.actions', function( e ) {
|
145 |
+
var el = $( this ).parent( 'li' );
|
146 |
+
|
147 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
148 |
+
e.preventDefault();
|
149 |
+
el.toggleClass( 'focus' );
|
150 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
151 |
+
}
|
152 |
}
|
153 |
+
);
|
154 |
} else {
|
155 |
elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
156 |
}
|
161 |
toggleFocusClassTouchScreen();
|
162 |
}
|
163 |
|
164 |
+
elementorPrimaryNavigation.find( 'a' ).on(
|
165 |
+
'focus.actions blur.actions', function() {
|
166 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
167 |
+
}
|
168 |
+
);
|
169 |
} )();
|
170 |
|
171 |
// Add the default ARIA attributes for the menu toggle and the navigations.
|
191 |
}
|
192 |
}
|
193 |
|
194 |
+
// Start our Secondary navigation
|
195 |
+
( function( $ ) {
|
196 |
+
var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
|
197 |
|
198 |
+
function initElementorSecondaryNavigation( container ) {
|
|
|
|
|
199 |
|
200 |
+
// Add dropdown toggle that displays child menu items.
|
201 |
+
var eldropdownSecondaryToggle = $(
|
202 |
+
'<button />', {
|
203 |
+
'class': 'eldropdown-toggle',
|
204 |
+
'aria-expanded': false
|
205 |
+
}
|
206 |
+
).append(
|
207 |
+
$(
|
208 |
+
'<span />', {
|
209 |
+
'class': 'screen-reader-text',
|
210 |
+
text: elementorSecondaryScreenReaderText.expand
|
211 |
+
}
|
212 |
+
)
|
213 |
+
);
|
214 |
|
215 |
+
container.find( '#elementor-header-secondary .menu-item-has-children > a' ).after( eldropdownSecondaryToggle );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
+
// Toggle buttons and submenu items with active children menu items.
|
218 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
|
219 |
+
container.find( '#elementor-header-secondary .current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
|
220 |
|
221 |
+
// Add menu items with submenus to aria-haspopup="true".
|
222 |
+
container.find( '#elementor-header-secondary .menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
|
|
|
223 |
|
224 |
+
container.find( '#elementor-header-secondary .eldropdown-toggle' ).click(
|
225 |
+
function( e ) {
|
226 |
+
var _this = $( this ),
|
227 |
+
screenReaderSpan = _this.find( '.screen-reader-text' );
|
228 |
|
229 |
+
e.preventDefault();
|
230 |
+
_this.toggleClass( 'eltoggled-on' );
|
231 |
+
_this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
|
232 |
|
233 |
+
// jscs:disable
|
234 |
+
_this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
235 |
+
// jscs:enable
|
236 |
+
screenReaderSpan.text( screenReaderSpan.text() === elementorSecondaryScreenReaderText.expand ? elementorSecondaryScreenReaderText.collapse : elementorSecondaryScreenReaderText.expand );
|
237 |
+
}
|
238 |
+
);
|
239 |
+
}
|
240 |
+
initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
|
241 |
|
242 |
+
menuAreaSecondary = $( '#elementor-header-secondary' );
|
243 |
+
elmenuToggleSecondary = menuAreaSecondary.find( '#elementor-menu-toggle' );
|
244 |
+
elementorSecondaryHeaderMenu = menuAreaSecondary.find( '#elementor-menu' );
|
245 |
+
elementorSecondaryNavigation = menuAreaSecondary.find( '#elementor-navigation' );
|
|
|
|
|
|
|
246 |
|
247 |
+
// Enable elmenuToggleSecondary.
|
248 |
+
( function() {
|
|
|
|
|
249 |
|
250 |
+
// Return early if elmenuToggleSecondary is missing.
|
251 |
+
if ( ! elmenuToggleSecondary.length ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
|
255 |
+
// Add an initial values for the attribute.
|
256 |
+
elmenuToggleSecondary.add( elementorSecondaryNavigation ).attr( 'aria-expanded', 'false' );
|
|
|
|
|
257 |
|
258 |
+
elmenuToggleSecondary.on(
|
259 |
+
'click.actions', function() {
|
260 |
+
$( this ).add( elementorSecondaryHeaderMenu ).toggleClass( 'eltoggled-on' );
|
261 |
|
262 |
+
// jscs:disable
|
263 |
+
$( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
264 |
+
// jscs:enable
|
265 |
+
}
|
266 |
+
);
|
267 |
+
} )();
|
268 |
|
269 |
+
// Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
|
270 |
+
( function() {
|
271 |
+
if ( ! elementorSecondaryNavigation.length || ! elementorSecondaryNavigation.children().length ) {
|
272 |
+
return;
|
273 |
+
}
|
274 |
|
275 |
+
// Toggle `focus` class to allow submenu access on tablets.
|
276 |
+
function toggleFocusClassTouchScreen() {
|
277 |
+
if ( window.innerWidth >= 910 ) {
|
278 |
+
$( document.body ).on(
|
279 |
+
'touchstart.actions', function( e ) {
|
280 |
+
if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
|
281 |
+
$( '.elementor-navigation li' ).removeClass( 'focus' );
|
282 |
+
}
|
283 |
+
}
|
284 |
+
);
|
285 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on(
|
286 |
+
'touchstart.actions', function( e ) {
|
287 |
+
var el = $( this ).parent( 'li' );
|
288 |
+
|
289 |
+
if ( ! el.hasClass( 'focus' ) ) {
|
290 |
+
e.preventDefault();
|
291 |
+
el.toggleClass( 'focus' );
|
292 |
+
el.siblings( '.focus' ).removeClass( 'focus' );
|
293 |
+
}
|
294 |
+
}
|
295 |
+
);
|
296 |
+
} else {
|
297 |
+
elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
|
298 |
+
}
|
299 |
+
}
|
300 |
|
301 |
+
if ( 'ontouchstart' in window ) {
|
302 |
+
$( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
|
303 |
+
toggleFocusClassTouchScreen();
|
304 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
|
306 |
+
elementorSecondaryNavigation.find( 'a' ).on(
|
307 |
+
'focus.actions blur.actions', function() {
|
308 |
+
$( this ).parents( '.menu-item' ).toggleClass( 'focus' );
|
309 |
+
}
|
310 |
+
);
|
311 |
+
} )();
|
312 |
+
|
313 |
+
// Add the default ARIA attributes for the menu toggle and the navigations.
|
314 |
+
function onResizeARIA() {
|
315 |
+
if ( window.innerWidth < 910 ) {
|
316 |
+
if ( elmenuToggleSecondary.hasClass( 'eltoggled-on' ) ) {
|
317 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'true' );
|
318 |
+
} else {
|
319 |
+
elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
|
320 |
+
}
|
321 |
+
|
322 |
+
if ( elementorSecondaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
|
323 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
|
324 |
+
} else {
|
325 |
+
elementorSecondaryNavigation.attr( 'aria-expanded', 'false' );
|
326 |
+
}
|
327 |
+
|
328 |
+
elmenuToggleSecondary.attr( 'aria-controls', 'site-navigation' );
|
329 |
} else {
|
330 |
+
elmenuToggleSecondary.removeAttr( 'aria-expanded' );
|
331 |
+
elementorSecondaryNavigation.removeAttr( 'aria-expanded' );
|
332 |
+
elmenuToggleSecondary.removeAttr( 'aria-controls' );
|
333 |
}
|
334 |
}
|
335 |
|
336 |
+
// Search slideOut
|
337 |
+
function slideOut(parent) {
|
338 |
+
$( parent ).each(
|
339 |
+
function(){
|
340 |
+
var label = $( this ).find( '.label' ),
|
341 |
+
form = $( this ).find( '.form' ),
|
342 |
+
dismiss = $( this ).find( '.dismiss' ),
|
343 |
+
formMarginLeft = form.css( 'margin-left' ),
|
344 |
+
spd = 500;
|
345 |
+
|
346 |
+
label.click(
|
347 |
+
function(){
|
348 |
+
form.animate( {'margin-left':0},spd )
|
349 |
+
label.hide()
|
350 |
+
label.animate( {'opacity':0},spd )
|
351 |
+
setTimeout(
|
352 |
+
function(){
|
353 |
+
dismiss.show()
|
354 |
+
dismiss.animate( {'opacity':1},spd )
|
355 |
+
},spd
|
356 |
+
)
|
357 |
+
}
|
358 |
+
)
|
359 |
+
|
360 |
+
dismiss.click(
|
361 |
+
function(){
|
362 |
+
form.animate( {'margin-left':formMarginLeft},spd )
|
363 |
+
dismiss.hide()
|
364 |
+
dismiss.animate( {'opacity':0},spd )
|
365 |
+
setTimeout(
|
366 |
+
function(){
|
367 |
+
label.show()
|
368 |
+
label.animate( {'opacity':1},spd )
|
369 |
+
},spd
|
370 |
+
)
|
371 |
+
}
|
372 |
+
)
|
373 |
+
}
|
374 |
+
)
|
375 |
}
|
376 |
|
377 |
+
slideOut( '.search' );
|
378 |
+
} )( jQuery );
|
|
|
|
|
379 |
|
380 |
+
(function ($, el, root, undefined) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
|
382 |
+
var document = window.document;
|
383 |
+
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
|
385 |
+
function extend( a, b ) {
|
386 |
+
for ( var key in b ) {
|
387 |
+
if ( b.hasOwnProperty( key ) ) {
|
388 |
+
a[key] = b[key];
|
389 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
}
|
391 |
+
return a;
|
392 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
|
394 |
+
function cbpHorizontalSlideOutMenu( el, options ) {
|
|
|
|
|
|
|
395 |
var el;
|
396 |
+
this.el = el;
|
397 |
+
this.options = extend( this.defaults, options );
|
398 |
+
this._init();
|
399 |
+
}
|
400 |
+
|
401 |
+
cbpHorizontalSlideOutMenu.prototype = {
|
402 |
+
|
403 |
+
defaults : {},
|
404 |
+
_init : function() {
|
405 |
+
var el;
|
406 |
+
this.current = -1;
|
407 |
+
this.touch = Modernizr.touch;
|
408 |
+
this.menu = this.el.querySelector( '.cbp-hsmenu' );
|
409 |
+
this.menuItems = this.el.querySelectorAll( '.cbp-hsmenu > li' );
|
410 |
+
this.menuBg = document.createElement( 'div' );
|
411 |
+
this.menuBg.className = 'cbp-hsmenubg';
|
412 |
+
this.el.appendChild( this.menuBg );
|
413 |
+
this._initEvents();
|
414 |
+
},
|
415 |
+
_openMenu : function( el, ev ) {
|
416 |
+
|
417 |
+
var self = this,
|
418 |
+
item = el.parentNode,
|
419 |
+
items = Array.prototype.slice.call( this.menuItems ),
|
420 |
+
submenu = item.querySelector( '.cbp-hssubmenu' ),
|
421 |
closeCurrent = function( current ) {
|
422 |
+
var current = current || self.menuItems[ self.current ];
|
423 |
current.className = '';
|
424 |
+
current.setAttribute( 'data-open', '' );
|
425 |
},
|
426 |
closePanel = function() {
|
427 |
+
self.current = -1;
|
428 |
self.menuBg.style.height = '0px';
|
429 |
};
|
430 |
|
431 |
+
if ( submenu ) {
|
432 |
+
|
433 |
+
ev.preventDefault();
|
434 |
+
|
435 |
+
if ( item.getAttribute( 'data-open' ) === 'open' ) {
|
436 |
+
closeCurrent( item );
|
437 |
+
closePanel();
|
438 |
+
} else {
|
439 |
+
item.setAttribute( 'data-open', 'open' );
|
440 |
+
if ( self.current !== -1 ) {
|
441 |
+
closeCurrent();
|
442 |
+
}
|
443 |
+
self.current = items.indexOf( item );
|
444 |
+
item.className = 'cbp-hsitem-open';
|
445 |
+
self.menuBg.style.height = submenu.offsetHeight + 'px';
|
446 |
+
}
|
447 |
+
} else {
|
448 |
+
if ( self.current !== -1 ) {
|
449 |
closeCurrent();
|
450 |
+
closePanel();
|
451 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
}
|
|
|
453 |
|
454 |
+
},
|
455 |
+
_initEvents : function() {
|
|
|
|
|
456 |
|
457 |
+
var self = this;
|
458 |
+
|
459 |
+
Array.prototype.slice.call( this.menuItems ).forEach(
|
460 |
+
function( el, i ) {
|
461 |
+
var trigger = el.querySelector( 'a' );
|
462 |
+
if ( self.touch ) {
|
463 |
+
trigger.addEventListener( 'touchstart', function( ev ) { self._openMenu( this, ev ); } );
|
464 |
+
} else {
|
465 |
+
trigger.addEventListener( 'click', function( ev ) { self._openMenu( this, ev ); } );
|
466 |
+
}
|
467 |
+
}
|
468 |
+
);
|
469 |
+
|
470 |
+
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
|
471 |
+
|
472 |
+
},
|
473 |
+
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
|
474 |
+
// original debounce by John Hann
|
475 |
+
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
|
476 |
+
_resizeHandler : function() {
|
477 |
+
var self = this;
|
478 |
+
function delayed() {
|
479 |
+
self._resize();
|
480 |
+
self._resizeTimeout = null;
|
481 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
|
483 |
+
if ( this._resizeTimeout ) {
|
484 |
+
clearTimeout( this._resizeTimeout );
|
485 |
+
}
|
486 |
|
487 |
+
this._resizeTimeout = setTimeout( delayed, 50 );
|
488 |
+
},
|
489 |
+
_resize : function() {
|
490 |
+
if ( this.current !== -1 ) {
|
491 |
+
this.menuBg.style.height = this.menuItems[ this.current ].querySelector( '.cbp-hssubmenu' ).offsetHeight + 'px';
|
492 |
+
}
|
493 |
}
|
494 |
}
|
|
|
495 |
|
496 |
+
// add to global namespace
|
497 |
+
window.cbpHorizontalSlideOutMenu = cbpHorizontalSlideOutMenu;
|
|
|
|
|
498 |
|
499 |
+
var menu = new cbpHorizontalSlideOutMenu( document.getElementById( 'cbp-hsmenu-wrapper' ) );
|
500 |
|
501 |
+
})(jQuery);
|
502 |
|
503 |
} )( jQuery);
|
504 |
|
505 |
+
jQuery( document ).ready(
|
506 |
+
function() {
|
507 |
+
jQuery( "#cbp-hsmenu-wrapper ul.sub-menu" ).each(
|
508 |
+
function(i){
|
509 |
+
jQuery( this ).removeClass( "sub-menu" );
|
510 |
+
jQuery( this ).addClass( "cbp-hssubmenu" );
|
511 |
+
}
|
512 |
+
);
|
513 |
+
}
|
514 |
+
);
|
elementor-navmenu.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Description: Adds new NavMenus to the Elementor Page Builder plugin. Now with Site Branding options, search box, basic MegaMenu and Fullscreen Menu Overlay
|
5 |
* Plugin URI: https://themeisle.com/
|
6 |
* Author: ThemeIsle
|
7 |
-
* Version: 1.1.
|
8 |
* Author URI: https://themeisle.com/
|
9 |
*
|
10 |
* Text Domain: navmenu-addon-for-elementor
|
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
16 |
exit;
|
17 |
} // Exit if accessed directly
|
18 |
|
19 |
-
define( 'ELEMENTOR_MENUS_VERSION', '1.1.
|
20 |
|
21 |
define( 'ELEMENTOR_MENUS__FILE__', __FILE__ );
|
22 |
define( 'ELEMENTOR_MENUS_PLUGIN_BASE', plugin_basename( ELEMENTOR_MENUS__FILE__ ) );
|
@@ -76,7 +76,7 @@ function elementor_menus_fail_load() {
|
|
76 |
|
77 |
$activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin );
|
78 |
|
79 |
-
$message
|
80 |
$message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Elementor Now', 'navmenu-addon-for-elementor' ) ) . '</p>';
|
81 |
} else {
|
82 |
if ( ! current_user_can( 'install_plugins' ) ) {
|
@@ -85,7 +85,7 @@ function elementor_menus_fail_load() {
|
|
85 |
|
86 |
$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
|
87 |
|
88 |
-
$message
|
89 |
$message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, __( 'Install Elementor Now', 'navmenu-addon-for-elementor' ) ) . '</p>';
|
90 |
}
|
91 |
|
@@ -101,7 +101,7 @@ function elementor_menus_fail_load_out_of_date() {
|
|
101 |
|
102 |
$upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
|
103 |
$message = '<p>' . __( 'Elementor NavMenu is not working because you are using an old version of Elementor.', 'navmenu-addon-for-elementor' ) . '</p>';
|
104 |
-
$message
|
105 |
|
106 |
echo '<div class="error">' . $message . '</div>';
|
107 |
}
|
@@ -186,6 +186,40 @@ function nav_menu_body_classes( $classes ) {
|
|
186 |
|
187 |
add_filter( 'body_class', 'nav_menu_body_classes' );
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
$vendor_file = ELEMENTOR_MENUS_PATH . '/vendor/autoload.php';
|
190 |
if ( is_readable( $vendor_file ) ) {
|
191 |
require_once $vendor_file;
|
4 |
* Description: Adds new NavMenus to the Elementor Page Builder plugin. Now with Site Branding options, search box, basic MegaMenu and Fullscreen Menu Overlay
|
5 |
* Plugin URI: https://themeisle.com/
|
6 |
* Author: ThemeIsle
|
7 |
+
* Version: 1.1.1
|
8 |
* Author URI: https://themeisle.com/
|
9 |
*
|
10 |
* Text Domain: navmenu-addon-for-elementor
|
16 |
exit;
|
17 |
} // Exit if accessed directly
|
18 |
|
19 |
+
define( 'ELEMENTOR_MENUS_VERSION', '1.1.1' );
|
20 |
|
21 |
define( 'ELEMENTOR_MENUS__FILE__', __FILE__ );
|
22 |
define( 'ELEMENTOR_MENUS_PLUGIN_BASE', plugin_basename( ELEMENTOR_MENUS__FILE__ ) );
|
76 |
|
77 |
$activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin );
|
78 |
|
79 |
+
$message = '<p>' . __( 'Elementor NavMenu is not working because you need to activate the Elementor plugin.', 'navmenu-addon-for-elementor' ) . '</p>';
|
80 |
$message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Elementor Now', 'navmenu-addon-for-elementor' ) ) . '</p>';
|
81 |
} else {
|
82 |
if ( ! current_user_can( 'install_plugins' ) ) {
|
85 |
|
86 |
$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
|
87 |
|
88 |
+
$message = '<p>' . __( 'Elementor NavMenu is not working because you need to install the Elemenor plugin', 'navmenu-addon-for-elementor' ) . '</p>';
|
89 |
$message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, __( 'Install Elementor Now', 'navmenu-addon-for-elementor' ) ) . '</p>';
|
90 |
}
|
91 |
|
101 |
|
102 |
$upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
|
103 |
$message = '<p>' . __( 'Elementor NavMenu is not working because you are using an old version of Elementor.', 'navmenu-addon-for-elementor' ) . '</p>';
|
104 |
+
$message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $upgrade_link, __( 'Update Elementor Now', 'navmenu-addon-for-elementor' ) ) . '</p>';
|
105 |
|
106 |
echo '<div class="error">' . $message . '</div>';
|
107 |
}
|
186 |
|
187 |
add_filter( 'body_class', 'nav_menu_body_classes' );
|
188 |
|
189 |
+
/* Load TGM */
|
190 |
+
require_once( ELEMENTOR_MENUS_PATH . 'includes/class-tgm-plugin-activation.php' );
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Configure TGMPA.
|
194 |
+
*/
|
195 |
+
function elementor_nav_menus_register_required_plugins() {
|
196 |
+
$plugins = array(
|
197 |
+
array(
|
198 |
+
'name' => 'Elementor Addons & Widgets',
|
199 |
+
'slug' => 'elementor-addon-widgets',
|
200 |
+
'required' => false,
|
201 |
+
),
|
202 |
+
);
|
203 |
+
|
204 |
+
$config = array(
|
205 |
+
'id' => 'navmenu-addon-for-elementor',
|
206 |
+
'default_path' => '',
|
207 |
+
'menu' => 'tgmpa-install-plugins',
|
208 |
+
'parent_slug' => 'plugins.php',
|
209 |
+
'capability' => 'manage_options',
|
210 |
+
'has_notices' => true,
|
211 |
+
'dismissable' => true,
|
212 |
+
'dismiss_msg' => '',
|
213 |
+
'is_automatic' => false,
|
214 |
+
'message' => '',
|
215 |
+
);
|
216 |
+
|
217 |
+
tgmpa( $plugins, $config );
|
218 |
+
}
|
219 |
+
|
220 |
+
add_action( 'tgmpa_register', 'elementor_nav_menus_register_required_plugins' );
|
221 |
+
|
222 |
+
|
223 |
$vendor_file = ELEMENTOR_MENUS_PATH . '/vendor/autoload.php';
|
224 |
if ( is_readable( $vendor_file ) ) {
|
225 |
require_once $vendor_file;
|
includes/class-tgm-plugin-activation.php
ADDED
@@ -0,0 +1,3855 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin installation and activation for WordPress themes.
|
4 |
+
*
|
5 |
+
* Please note that this is a drop-in library for a theme or plugin.
|
6 |
+
* The authors of this library (Thomas, Gary and Juliette) are NOT responsible
|
7 |
+
* for the support of your plugin or theme. Please contact the plugin
|
8 |
+
* or theme author for support.
|
9 |
+
*
|
10 |
+
* @package TGM-Plugin-Activation
|
11 |
+
* @version 2.6.1
|
12 |
+
* @link http://tgmpluginactivation.com/
|
13 |
+
* @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
|
14 |
+
* @copyright Copyright (c) 2011, Thomas Griffin
|
15 |
+
* @license GPL-2.0+
|
16 |
+
*/
|
17 |
+
|
18 |
+
/*
|
19 |
+
Copyright 2011 Thomas Griffin (thomasgriffinmedia.com)
|
20 |
+
|
21 |
+
This program is free software; you can redistribute it and/or modify
|
22 |
+
it under the terms of the GNU General Public License, version 2, as
|
23 |
+
published by the Free Software Foundation.
|
24 |
+
|
25 |
+
This program is distributed in the hope that it will be useful,
|
26 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28 |
+
GNU General Public License for more details.
|
29 |
+
|
30 |
+
You should have received a copy of the GNU General Public License
|
31 |
+
along with this program; if not, write to the Free Software
|
32 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
33 |
+
*/
|
34 |
+
|
35 |
+
if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Automatic plugin installation and activation library.
|
39 |
+
*
|
40 |
+
* Creates a way to automatically install and activate plugins from within themes.
|
41 |
+
* The plugins can be either bundled, downloaded from the WordPress
|
42 |
+
* Plugin Repository or downloaded from another external source.
|
43 |
+
*
|
44 |
+
* @since 1.0.0
|
45 |
+
*
|
46 |
+
* @package TGM-Plugin-Activation
|
47 |
+
* @author Thomas Griffin
|
48 |
+
* @author Gary Jones
|
49 |
+
*/
|
50 |
+
class TGM_Plugin_Activation {
|
51 |
+
/**
|
52 |
+
* TGMPA version number.
|
53 |
+
*
|
54 |
+
* @since 2.5.0
|
55 |
+
*
|
56 |
+
* @const string Version number.
|
57 |
+
*/
|
58 |
+
const TGMPA_VERSION = '2.6.1';
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Regular expression to test if a URL is a WP plugin repo URL.
|
62 |
+
*
|
63 |
+
* @const string Regex.
|
64 |
+
*
|
65 |
+
* @since 2.5.0
|
66 |
+
*/
|
67 |
+
const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|';
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Arbitrary regular expression to test if a string starts with a URL.
|
71 |
+
*
|
72 |
+
* @const string Regex.
|
73 |
+
*
|
74 |
+
* @since 2.5.0
|
75 |
+
*/
|
76 |
+
const IS_URL_REGEX = '|^http[s]?://|';
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Holds a copy of itself, so it can be referenced by the class name.
|
80 |
+
*
|
81 |
+
* @since 1.0.0
|
82 |
+
*
|
83 |
+
* @var TGM_Plugin_Activation
|
84 |
+
*/
|
85 |
+
public static $instance;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Holds arrays of plugin details.
|
89 |
+
*
|
90 |
+
* @since 1.0.0
|
91 |
+
* @since 2.5.0 the array has the plugin slug as an associative key.
|
92 |
+
*
|
93 |
+
* @var array
|
94 |
+
*/
|
95 |
+
public $plugins = array();
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Holds arrays of plugin names to use to sort the plugins array.
|
99 |
+
*
|
100 |
+
* @since 2.5.0
|
101 |
+
*
|
102 |
+
* @var array
|
103 |
+
*/
|
104 |
+
protected $sort_order = array();
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Whether any plugins have the 'force_activation' setting set to true.
|
108 |
+
*
|
109 |
+
* @since 2.5.0
|
110 |
+
*
|
111 |
+
* @var bool
|
112 |
+
*/
|
113 |
+
protected $has_forced_activation = false;
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Whether any plugins have the 'force_deactivation' setting set to true.
|
117 |
+
*
|
118 |
+
* @since 2.5.0
|
119 |
+
*
|
120 |
+
* @var bool
|
121 |
+
*/
|
122 |
+
protected $has_forced_deactivation = false;
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Name of the unique ID to hash notices.
|
126 |
+
*
|
127 |
+
* @since 2.4.0
|
128 |
+
*
|
129 |
+
* @var string
|
130 |
+
*/
|
131 |
+
public $id = 'tgmpa';
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Name of the query-string argument for the admin page.
|
135 |
+
*
|
136 |
+
* @since 1.0.0
|
137 |
+
*
|
138 |
+
* @var string
|
139 |
+
*/
|
140 |
+
protected $menu = 'tgmpa-install-plugins';
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Parent menu file slug.
|
144 |
+
*
|
145 |
+
* @since 2.5.0
|
146 |
+
*
|
147 |
+
* @var string
|
148 |
+
*/
|
149 |
+
public $parent_slug = 'themes.php';
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Capability needed to view the plugin installation menu item.
|
153 |
+
*
|
154 |
+
* @since 2.5.0
|
155 |
+
*
|
156 |
+
* @var string
|
157 |
+
*/
|
158 |
+
public $capability = 'edit_theme_options';
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Default absolute path to folder containing bundled plugin zip files.
|
162 |
+
*
|
163 |
+
* @since 2.0.0
|
164 |
+
*
|
165 |
+
* @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string.
|
166 |
+
*/
|
167 |
+
public $default_path = '';
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Flag to show admin notices or not.
|
171 |
+
*
|
172 |
+
* @since 2.1.0
|
173 |
+
*
|
174 |
+
* @var boolean
|
175 |
+
*/
|
176 |
+
public $has_notices = true;
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Flag to determine if the user can dismiss the notice nag.
|
180 |
+
*
|
181 |
+
* @since 2.4.0
|
182 |
+
*
|
183 |
+
* @var boolean
|
184 |
+
*/
|
185 |
+
public $dismissable = true;
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Message to be output above nag notice if dismissable is false.
|
189 |
+
*
|
190 |
+
* @since 2.4.0
|
191 |
+
*
|
192 |
+
* @var string
|
193 |
+
*/
|
194 |
+
public $dismiss_msg = '';
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Flag to set automatic activation of plugins. Off by default.
|
198 |
+
*
|
199 |
+
* @since 2.2.0
|
200 |
+
*
|
201 |
+
* @var boolean
|
202 |
+
*/
|
203 |
+
public $is_automatic = false;
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Optional message to display before the plugins table.
|
207 |
+
*
|
208 |
+
* @since 2.2.0
|
209 |
+
*
|
210 |
+
* @var string Message filtered by wp_kses_post(). Default is empty string.
|
211 |
+
*/
|
212 |
+
public $message = '';
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Holds configurable array of strings.
|
216 |
+
*
|
217 |
+
* Default values are added in the constructor.
|
218 |
+
*
|
219 |
+
* @since 2.0.0
|
220 |
+
*
|
221 |
+
* @var array
|
222 |
+
*/
|
223 |
+
public $strings = array();
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Holds the version of WordPress.
|
227 |
+
*
|
228 |
+
* @since 2.4.0
|
229 |
+
*
|
230 |
+
* @var int
|
231 |
+
*/
|
232 |
+
public $wp_version;
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Holds the hook name for the admin page.
|
236 |
+
*
|
237 |
+
* @since 2.5.0
|
238 |
+
*
|
239 |
+
* @var string
|
240 |
+
*/
|
241 |
+
public $page_hook;
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Adds a reference of this object to $instance, populates default strings,
|
245 |
+
* does the tgmpa_init action hook, and hooks in the interactions to init.
|
246 |
+
*
|
247 |
+
* {@internal This method should be `protected`, but as too many TGMPA implementations
|
248 |
+
* haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.
|
249 |
+
* Reverted back to public for the time being.}}
|
250 |
+
*
|
251 |
+
* @since 1.0.0
|
252 |
+
*
|
253 |
+
* @see TGM_Plugin_Activation::init()
|
254 |
+
*/
|
255 |
+
public function __construct() {
|
256 |
+
// Set the current WordPress version.
|
257 |
+
$this->wp_version = $GLOBALS['wp_version'];
|
258 |
+
|
259 |
+
// Announce that the class is ready, and pass the object (for advanced use).
|
260 |
+
do_action_ref_array( 'tgmpa_init', array( $this ) );
|
261 |
+
|
262 |
+
/*
|
263 |
+
* Load our text domain and allow for overloading the fall-back file.
|
264 |
+
*
|
265 |
+
* {@internal IMPORTANT! If this code changes, review the regex in the custom TGMPA
|
266 |
+
* generator on the website.}}
|
267 |
+
*/
|
268 |
+
add_action( 'init', array( $this, 'load_textdomain' ), 5 );
|
269 |
+
add_filter( 'load_textdomain_mofile', array( $this, 'overload_textdomain_mofile' ), 10, 2 );
|
270 |
+
|
271 |
+
// When the rest of WP has loaded, kick-start the rest of the class.
|
272 |
+
add_action( 'init', array( $this, 'init' ) );
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Magic method to (not) set protected properties from outside of this class.
|
277 |
+
*
|
278 |
+
* {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property
|
279 |
+
* is being assigned rather than tested in a conditional, effectively rendering it useless.
|
280 |
+
* This 'hack' prevents this from happening.}}
|
281 |
+
*
|
282 |
+
* @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593
|
283 |
+
*
|
284 |
+
* @since 2.5.2
|
285 |
+
*
|
286 |
+
* @param string $name Name of an inaccessible property.
|
287 |
+
* @param mixed $value Value to assign to the property.
|
288 |
+
* @return void Silently fail to set the property when this is tried from outside of this class context.
|
289 |
+
* (Inside this class context, the __set() method if not used as there is direct access.)
|
290 |
+
*/
|
291 |
+
public function __set( $name, $value ) {
|
292 |
+
return;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Magic method to get the value of a protected property outside of this class context.
|
297 |
+
*
|
298 |
+
* @since 2.5.2
|
299 |
+
*
|
300 |
+
* @param string $name Name of an inaccessible property.
|
301 |
+
* @return mixed The property value.
|
302 |
+
*/
|
303 |
+
public function __get( $name ) {
|
304 |
+
return $this->{$name};
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Initialise the interactions between this class and WordPress.
|
309 |
+
*
|
310 |
+
* Hooks in three new methods for the class: admin_menu, notices and styles.
|
311 |
+
*
|
312 |
+
* @since 2.0.0
|
313 |
+
*
|
314 |
+
* @see TGM_Plugin_Activation::admin_menu()
|
315 |
+
* @see TGM_Plugin_Activation::notices()
|
316 |
+
* @see TGM_Plugin_Activation::styles()
|
317 |
+
*/
|
318 |
+
public function init() {
|
319 |
+
/**
|
320 |
+
* By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter
|
321 |
+
* you can overrule that behaviour.
|
322 |
+
*
|
323 |
+
* @since 2.5.0
|
324 |
+
*
|
325 |
+
* @param bool $load Whether or not TGMPA should load.
|
326 |
+
* Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.
|
327 |
+
*/
|
328 |
+
if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {
|
329 |
+
return;
|
330 |
+
}
|
331 |
+
|
332 |
+
// Load class strings.
|
333 |
+
$this->strings = array(
|
334 |
+
'page_title' => __( 'Install Required Plugins', 'navmenu-addon-for-elementor' ),
|
335 |
+
'menu_title' => __( 'Install Plugins', 'navmenu-addon-for-elementor' ),
|
336 |
+
/* translators: %s: plugin name. */
|
337 |
+
'installing' => __( 'Installing Plugin: %s', 'navmenu-addon-for-elementor' ),
|
338 |
+
/* translators: %s: plugin name. */
|
339 |
+
'updating' => __( 'Updating Plugin: %s', 'navmenu-addon-for-elementor' ),
|
340 |
+
'oops' => __( 'Something went wrong with the plugin API.', 'navmenu-addon-for-elementor' ),
|
341 |
+
'notice_can_install_required' => _n_noop(
|
342 |
+
/* translators: 1: plugin name(s). */
|
343 |
+
'This theme requires the following plugin: %1$s.',
|
344 |
+
'This theme requires the following plugins: %1$s.',
|
345 |
+
'navmenu-addon-for-elementor'
|
346 |
+
),
|
347 |
+
'notice_can_install_recommended' => _n_noop(
|
348 |
+
/* translators: 1: plugin name(s). */
|
349 |
+
'This theme recommends the following plugin: %1$s.',
|
350 |
+
'This theme recommends the following plugins: %1$s.',
|
351 |
+
'navmenu-addon-for-elementor'
|
352 |
+
),
|
353 |
+
'notice_ask_to_update' => _n_noop(
|
354 |
+
/* translators: 1: plugin name(s). */
|
355 |
+
'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
|
356 |
+
'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
|
357 |
+
'navmenu-addon-for-elementor'
|
358 |
+
),
|
359 |
+
'notice_ask_to_update_maybe' => _n_noop(
|
360 |
+
/* translators: 1: plugin name(s). */
|
361 |
+
'There is an update available for: %1$s.',
|
362 |
+
'There are updates available for the following plugins: %1$s.',
|
363 |
+
'navmenu-addon-for-elementor'
|
364 |
+
),
|
365 |
+
'notice_can_activate_required' => _n_noop(
|
366 |
+
/* translators: 1: plugin name(s). */
|
367 |
+
'The following required plugin is currently inactive: %1$s.',
|
368 |
+
'The following required plugins are currently inactive: %1$s.',
|
369 |
+
'navmenu-addon-for-elementor'
|
370 |
+
),
|
371 |
+
'notice_can_activate_recommended' => _n_noop(
|
372 |
+
/* translators: 1: plugin name(s). */
|
373 |
+
'The following recommended plugin is currently inactive: %1$s.',
|
374 |
+
'The following recommended plugins are currently inactive: %1$s.',
|
375 |
+
'navmenu-addon-for-elementor'
|
376 |
+
),
|
377 |
+
'install_link' => _n_noop(
|
378 |
+
'Begin installing plugin',
|
379 |
+
'Begin installing plugins',
|
380 |
+
'navmenu-addon-for-elementor'
|
381 |
+
),
|
382 |
+
'update_link' => _n_noop(
|
383 |
+
'Begin updating plugin',
|
384 |
+
'Begin updating plugins',
|
385 |
+
'navmenu-addon-for-elementor'
|
386 |
+
),
|
387 |
+
'activate_link' => _n_noop(
|
388 |
+
'Begin activating plugin',
|
389 |
+
'Begin activating plugins',
|
390 |
+
'navmenu-addon-for-elementor'
|
391 |
+
),
|
392 |
+
'return' => __( 'Return to Required Plugins Installer', 'navmenu-addon-for-elementor' ),
|
393 |
+
'dashboard' => __( 'Return to the Dashboard', 'navmenu-addon-for-elementor' ),
|
394 |
+
'plugin_activated' => __( 'Plugin activated successfully.', 'navmenu-addon-for-elementor' ),
|
395 |
+
'activated_successfully' => __( 'The following plugin was activated successfully:', 'navmenu-addon-for-elementor' ),
|
396 |
+
/* translators: 1: plugin name. */
|
397 |
+
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'navmenu-addon-for-elementor' ),
|
398 |
+
/* translators: 1: plugin name. */
|
399 |
+
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'navmenu-addon-for-elementor' ),
|
400 |
+
/* translators: 1: dashboard link. */
|
401 |
+
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'navmenu-addon-for-elementor' ),
|
402 |
+
'dismiss' => __( 'Dismiss this notice', 'navmenu-addon-for-elementor' ),
|
403 |
+
'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'navmenu-addon-for-elementor' ),
|
404 |
+
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'navmenu-addon-for-elementor' ),
|
405 |
+
);
|
406 |
+
|
407 |
+
do_action( 'tgmpa_register' );
|
408 |
+
|
409 |
+
/* After this point, the plugins should be registered and the configuration set. */
|
410 |
+
|
411 |
+
// Proceed only if we have plugins to handle.
|
412 |
+
if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
// Set up the menu and notices if we still have outstanding actions.
|
417 |
+
if ( true !== $this->is_tgmpa_complete() ) {
|
418 |
+
// Sort the plugins.
|
419 |
+
array_multisort( $this->sort_order, SORT_ASC, $this->plugins );
|
420 |
+
|
421 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
422 |
+
add_action( 'admin_head', array( $this, 'dismiss' ) );
|
423 |
+
|
424 |
+
// Prevent the normal links from showing underneath a single install/update page.
|
425 |
+
add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );
|
426 |
+
add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );
|
427 |
+
|
428 |
+
if ( $this->has_notices ) {
|
429 |
+
add_action( 'admin_notices', array( $this, 'notices' ) );
|
430 |
+
add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
|
431 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
// If needed, filter plugin action links.
|
436 |
+
add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );
|
437 |
+
|
438 |
+
// Make sure things get reset on switch theme.
|
439 |
+
add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );
|
440 |
+
|
441 |
+
if ( $this->has_notices ) {
|
442 |
+
add_action( 'switch_theme', array( $this, 'update_dismiss' ) );
|
443 |
+
}
|
444 |
+
|
445 |
+
// Setup the force activation hook.
|
446 |
+
if ( true === $this->has_forced_activation ) {
|
447 |
+
add_action( 'admin_init', array( $this, 'force_activation' ) );
|
448 |
+
}
|
449 |
+
|
450 |
+
// Setup the force deactivation hook.
|
451 |
+
if ( true === $this->has_forced_deactivation ) {
|
452 |
+
add_action( 'switch_theme', array( $this, 'force_deactivation' ) );
|
453 |
+
}
|
454 |
+
}
|
455 |
+
|
456 |
+
/**
|
457 |
+
* Load translations.
|
458 |
+
*
|
459 |
+
* @since 2.6.0
|
460 |
+
*
|
461 |
+
* (@internal Uses `load_theme_textdomain()` rather than `load_plugin_textdomain()` to
|
462 |
+
* get round the different ways of handling the path and deprecated notices being thrown
|
463 |
+
* and such. For plugins, the actual file name will be corrected by a filter.}}
|
464 |
+
*
|
465 |
+
* {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
|
466 |
+
* generator on the website.}}
|
467 |
+
*/
|
468 |
+
public function load_textdomain() {
|
469 |
+
if ( is_textdomain_loaded( 'tgmpa' ) ) {
|
470 |
+
return;
|
471 |
+
}
|
472 |
+
|
473 |
+
if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {
|
474 |
+
// Plugin, we'll need to adjust the file name.
|
475 |
+
add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 );
|
476 |
+
load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
|
477 |
+
remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 );
|
478 |
+
} else {
|
479 |
+
load_theme_textdomain( 'tgmpa', dirname( __FILE__ ) . '/languages' );
|
480 |
+
}
|
481 |
+
}
|
482 |
+
|
483 |
+
/**
|
484 |
+
* Correct the .mo file name for (must-use) plugins.
|
485 |
+
*
|
486 |
+
* Themese use `/path/{locale}.mo` while plugins use `/path/{text-domain}-{locale}.mo`.
|
487 |
+
*
|
488 |
+
* {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
|
489 |
+
* generator on the website.}}
|
490 |
+
*
|
491 |
+
* @since 2.6.0
|
492 |
+
*
|
493 |
+
* @param string $mofile Full path to the target mofile.
|
494 |
+
* @param string $domain The domain for which a language file is being loaded.
|
495 |
+
* @return string $mofile
|
496 |
+
*/
|
497 |
+
public function correct_plugin_mofile( $mofile, $domain ) {
|
498 |
+
// Exit early if not our domain (just in case).
|
499 |
+
if ( 'tgmpa' !== $domain ) {
|
500 |
+
return $mofile;
|
501 |
+
}
|
502 |
+
return preg_replace( '`/([a-z]{2}_[A-Z]{2}.mo)$`', '/tgmpa-$1', $mofile );
|
503 |
+
}
|
504 |
+
|
505 |
+
/**
|
506 |
+
* Potentially overload the fall-back translation file for the current language.
|
507 |
+
*
|
508 |
+
* WP, by default since WP 3.7, will load a local translation first and if none
|
509 |
+
* can be found, will try and find a translation in the /wp-content/languages/ directory.
|
510 |
+
* As this library is theme/plugin agnostic, translation files for TGMPA can exist both
|
511 |
+
* in the WP_LANG_DIR /plugins/ subdirectory as well as in the /themes/ subdirectory.
|
512 |
+
*
|
513 |
+
* This method makes sure both directories are checked.
|
514 |
+
*
|
515 |
+
* {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
|
516 |
+
* generator on the website.}}
|
517 |
+
*
|
518 |
+
* @since 2.6.0
|
519 |
+
*
|
520 |
+
* @param string $mofile Full path to the target mofile.
|
521 |
+
* @param string $domain The domain for which a language file is being loaded.
|
522 |
+
* @return string $mofile
|
523 |
+
*/
|
524 |
+
public function overload_textdomain_mofile( $mofile, $domain ) {
|
525 |
+
// Exit early if not our domain, not a WP_LANG_DIR load or if the file exists and is readable.
|
526 |
+
if ( 'tgmpa' !== $domain || false === strpos( $mofile, WP_LANG_DIR ) || @is_readable( $mofile ) ) {
|
527 |
+
return $mofile;
|
528 |
+
}
|
529 |
+
|
530 |
+
// Current fallback file is not valid, let's try the alternative option.
|
531 |
+
if ( false !== strpos( $mofile, '/themes/' ) ) {
|
532 |
+
return str_replace( '/themes/', '/plugins/', $mofile );
|
533 |
+
} elseif ( false !== strpos( $mofile, '/plugins/' ) ) {
|
534 |
+
return str_replace( '/plugins/', '/themes/', $mofile );
|
535 |
+
} else {
|
536 |
+
return $mofile;
|
537 |
+
}
|
538 |
+
}
|
539 |
+
|
540 |
+
/**
|
541 |
+
* Hook in plugin action link filters for the WP native plugins page.
|
542 |
+
*
|
543 |
+
* - Prevent activation of plugins which don't meet the minimum version requirements.
|
544 |
+
* - Prevent deactivation of force-activated plugins.
|
545 |
+
* - Add update notice if update available.
|
546 |
+
*
|
547 |
+
* @since 2.5.0
|
548 |
+
*/
|
549 |
+
public function add_plugin_action_link_filters() {
|
550 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
551 |
+
if ( false === $this->can_plugin_activate( $slug ) ) {
|
552 |
+
add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
|
553 |
+
}
|
554 |
+
|
555 |
+
if ( true === $plugin['force_activation'] ) {
|
556 |
+
add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
|
557 |
+
}
|
558 |
+
|
559 |
+
if ( false !== $this->does_plugin_require_update( $slug ) ) {
|
560 |
+
add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
|
561 |
+
}
|
562 |
+
}
|
563 |
+
}
|
564 |
+
|
565 |
+
/**
|
566 |
+
* Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the
|
567 |
+
* minimum version requirements.
|
568 |
+
*
|
569 |
+
* @since 2.5.0
|
570 |
+
*
|
571 |
+
* @param array $actions Action links.
|
572 |
+
* @return array
|
573 |
+
*/
|
574 |
+
public function filter_plugin_action_links_activate( $actions ) {
|
575 |
+
unset( $actions['activate'] );
|
576 |
+
|
577 |
+
return $actions;
|
578 |
+
}
|
579 |
+
|
580 |
+
/**
|
581 |
+
* Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate.
|
582 |
+
*
|
583 |
+
* @since 2.5.0
|
584 |
+
*
|
585 |
+
* @param array $actions Action links.
|
586 |
+
* @return array
|
587 |
+
*/
|
588 |
+
public function filter_plugin_action_links_deactivate( $actions ) {
|
589 |
+
unset( $actions['deactivate'] );
|
590 |
+
|
591 |
+
return $actions;
|
592 |
+
}
|
593 |
+
|
594 |
+
/**
|
595 |
+
* Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the
|
596 |
+
* minimum version requirements.
|
597 |
+
*
|
598 |
+
* @since 2.5.0
|
599 |
+
*
|
600 |
+
* @param array $actions Action links.
|
601 |
+
* @return array
|
602 |
+
*/
|
603 |
+
public function filter_plugin_action_links_update( $actions ) {
|
604 |
+
$actions['update'] = sprintf(
|
605 |
+
'<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
|
606 |
+
esc_url( $this->get_tgmpa_status_url( 'update' ) ),
|
607 |
+
esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'navmenu-addon-for-elementor' ),
|
608 |
+
esc_html__( 'Update Required', 'navmenu-addon-for-elementor' )
|
609 |
+
);
|
610 |
+
|
611 |
+
return $actions;
|
612 |
+
}
|
613 |
+
|
614 |
+
/**
|
615 |
+
* Handles calls to show plugin information via links in the notices.
|
616 |
+
*
|
617 |
+
* We get the links in the admin notices to point to the TGMPA page, rather
|
618 |
+
* than the typical plugin-install.php file, so we can prepare everything
|
619 |
+
* beforehand.
|
620 |
+
*
|
621 |
+
* WP does not make it easy to show the plugin information in the thickbox -
|
622 |
+
* here we have to require a file that includes a function that does the
|
623 |
+
* main work of displaying it, enqueue some styles, set up some globals and
|
624 |
+
* finally call that function before exiting.
|
625 |
+
*
|
626 |
+
* Down right easy once you know how...
|
627 |
+
*
|
628 |
+
* Returns early if not the TGMPA page.
|
629 |
+
*
|
630 |
+
* @since 2.1.0
|
631 |
+
*
|
632 |
+
* @global string $tab Used as iframe div class names, helps with styling
|
633 |
+
* @global string $body_id Used as the iframe body ID, helps with styling
|
634 |
+
*
|
635 |
+
* @return null Returns early if not the TGMPA page.
|
636 |
+
*/
|
637 |
+
public function admin_init() {
|
638 |
+
if ( ! $this->is_tgmpa_page() ) {
|
639 |
+
return;
|
640 |
+
}
|
641 |
+
|
642 |
+
if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
|
643 |
+
// Needed for install_plugin_information().
|
644 |
+
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
645 |
+
|
646 |
+
wp_enqueue_style( 'plugin-install' );
|
647 |
+
|
648 |
+
global $tab, $body_id;
|
649 |
+
$body_id = 'plugin-information';
|
650 |
+
// @codingStandardsIgnoreStart
|
651 |
+
$tab = 'plugin-information';
|
652 |
+
// @codingStandardsIgnoreEnd
|
653 |
+
|
654 |
+
install_plugin_information();
|
655 |
+
|
656 |
+
exit;
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
/**
|
661 |
+
* Enqueue thickbox scripts/styles for plugin info.
|
662 |
+
*
|
663 |
+
* Thickbox is not automatically included on all admin pages, so we must
|
664 |
+
* manually enqueue it for those pages.
|
665 |
+
*
|
666 |
+
* Thickbox is only loaded if the user has not dismissed the admin
|
667 |
+
* notice or if there are any plugins left to install and activate.
|
668 |
+
*
|
669 |
+
* @since 2.1.0
|
670 |
+
*/
|
671 |
+
public function thickbox() {
|
672 |
+
if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) {
|
673 |
+
add_thickbox();
|
674 |
+
}
|
675 |
+
}
|
676 |
+
|
677 |
+
/**
|
678 |
+
* Adds submenu page if there are plugin actions to take.
|
679 |
+
*
|
680 |
+
* This method adds the submenu page letting users know that a required
|
681 |
+
* plugin needs to be installed.
|
682 |
+
*
|
683 |
+
* This page disappears once the plugin has been installed and activated.
|
684 |
+
*
|
685 |
+
* @since 1.0.0
|
686 |
+
*
|
687 |
+
* @see TGM_Plugin_Activation::init()
|
688 |
+
* @see TGM_Plugin_Activation::install_plugins_page()
|
689 |
+
*
|
690 |
+
* @return null Return early if user lacks capability to install a plugin.
|
691 |
+
*/
|
692 |
+
public function admin_menu() {
|
693 |
+
// Make sure privileges are correct to see the page.
|
694 |
+
if ( ! current_user_can( 'install_plugins' ) ) {
|
695 |
+
return;
|
696 |
+
}
|
697 |
+
|
698 |
+
$args = apply_filters(
|
699 |
+
'tgmpa_admin_menu_args',
|
700 |
+
array(
|
701 |
+
'parent_slug' => $this->parent_slug, // Parent Menu slug.
|
702 |
+
'page_title' => $this->strings['page_title'], // Page title.
|
703 |
+
'menu_title' => $this->strings['menu_title'], // Menu title.
|
704 |
+
'capability' => $this->capability, // Capability.
|
705 |
+
'menu_slug' => $this->menu, // Menu slug.
|
706 |
+
'function' => array( $this, 'install_plugins_page' ), // Callback.
|
707 |
+
)
|
708 |
+
);
|
709 |
+
|
710 |
+
$this->add_admin_menu( $args );
|
711 |
+
}
|
712 |
+
|
713 |
+
/**
|
714 |
+
* Add the menu item.
|
715 |
+
*
|
716 |
+
* {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA
|
717 |
+
* generator on the website.}}
|
718 |
+
*
|
719 |
+
* @since 2.5.0
|
720 |
+
*
|
721 |
+
* @param array $args Menu item configuration.
|
722 |
+
*/
|
723 |
+
protected function add_admin_menu( array $args ) {
|
724 |
+
if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {
|
725 |
+
_deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'navmenu-addon-for-elementor' ) );
|
726 |
+
}
|
727 |
+
|
728 |
+
if ( 'themes.php' === $this->parent_slug ) {
|
729 |
+
$this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
|
730 |
+
} else {
|
731 |
+
$this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
|
732 |
+
}
|
733 |
+
}
|
734 |
+
|
735 |
+
/**
|
736 |
+
* Echoes plugin installation form.
|
737 |
+
*
|
738 |
+
* This method is the callback for the admin_menu method function.
|
739 |
+
* This displays the admin page and form area where the user can select to install and activate the plugin.
|
740 |
+
* Aborts early if we're processing a plugin installation action.
|
741 |
+
*
|
742 |
+
* @since 1.0.0
|
743 |
+
*
|
744 |
+
* @return null Aborts early if we're processing a plugin installation action.
|
745 |
+
*/
|
746 |
+
public function install_plugins_page() {
|
747 |
+
// Store new instance of plugin table in object.
|
748 |
+
$plugin_table = new TGMPA_List_Table;
|
749 |
+
|
750 |
+
// Return early if processing a plugin installation action.
|
751 |
+
if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
|
752 |
+
return;
|
753 |
+
}
|
754 |
+
|
755 |
+
// Force refresh of available plugin information so we'll know about manual updates/deletes.
|
756 |
+
wp_clean_plugins_cache( false );
|
757 |
+
|
758 |
+
?>
|
759 |
+
<div class="tgmpa wrap">
|
760 |
+
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
761 |
+
<?php $plugin_table->prepare_items(); ?>
|
762 |
+
|
763 |
+
<?php
|
764 |
+
if ( ! empty( $this->message ) && is_string( $this->message ) ) {
|
765 |
+
echo wp_kses_post( $this->message );
|
766 |
+
}
|
767 |
+
?>
|
768 |
+
<?php $plugin_table->views(); ?>
|
769 |
+
|
770 |
+
<form id="tgmpa-plugins" action="" method="post">
|
771 |
+
<input type="hidden" name="tgmpa-page" value="<?php echo esc_attr( $this->menu ); ?>" />
|
772 |
+
<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $plugin_table->view_context ); ?>" />
|
773 |
+
<?php $plugin_table->display(); ?>
|
774 |
+
</form>
|
775 |
+
</div>
|
776 |
+
<?php
|
777 |
+
}
|
778 |
+
|
779 |
+
/**
|
780 |
+
* Installs, updates or activates a plugin depending on the action link clicked by the user.
|
781 |
+
*
|
782 |
+
* Checks the $_GET variable to see which actions have been
|
783 |
+
* passed and responds with the appropriate method.
|
784 |
+
*
|
785 |
+
* Uses WP_Filesystem to process and handle the plugin installation
|
786 |
+
* method.
|
787 |
+
*
|
788 |
+
* @since 1.0.0
|
789 |
+
*
|
790 |
+
* @uses WP_Filesystem
|
791 |
+
* @uses WP_Error
|
792 |
+
* @uses WP_Upgrader
|
793 |
+
* @uses Plugin_Upgrader
|
794 |
+
* @uses Plugin_Installer_Skin
|
795 |
+
* @uses Plugin_Upgrader_Skin
|
796 |
+
*
|
797 |
+
* @return boolean True on success, false on failure.
|
798 |
+
*/
|
799 |
+
protected function do_plugin_install() {
|
800 |
+
if ( empty( $_GET['plugin'] ) ) {
|
801 |
+
return false;
|
802 |
+
}
|
803 |
+
|
804 |
+
// All plugin information will be stored in an array for processing.
|
805 |
+
$slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
|
806 |
+
|
807 |
+
if ( ! isset( $this->plugins[ $slug ] ) ) {
|
808 |
+
return false;
|
809 |
+
}
|
810 |
+
|
811 |
+
// Was an install or upgrade action link clicked?
|
812 |
+
if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) {
|
813 |
+
|
814 |
+
$install_type = 'install';
|
815 |
+
if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) {
|
816 |
+
$install_type = 'update';
|
817 |
+
}
|
818 |
+
|
819 |
+
check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' );
|
820 |
+
|
821 |
+
// Pass necessary information via URL if WP_Filesystem is needed.
|
822 |
+
$url = wp_nonce_url(
|
823 |
+
add_query_arg(
|
824 |
+
array(
|
825 |
+
'plugin' => urlencode( $slug ),
|
826 |
+
'tgmpa-' . $install_type => $install_type . '-plugin',
|
827 |
+
),
|
828 |
+
$this->get_tgmpa_url()
|
829 |
+
),
|
830 |
+
'tgmpa-' . $install_type,
|
831 |
+
'tgmpa-nonce'
|
832 |
+
);
|
833 |
+
|
834 |
+
$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
|
835 |
+
|
836 |
+
if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) {
|
837 |
+
return true;
|
838 |
+
}
|
839 |
+
|
840 |
+
if ( ! WP_Filesystem( $creds ) ) {
|
841 |
+
request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
|
842 |
+
return true;
|
843 |
+
}
|
844 |
+
|
845 |
+
/* If we arrive here, we have the filesystem. */
|
846 |
+
|
847 |
+
// Prep variables for Plugin_Installer_Skin class.
|
848 |
+
$extra = array();
|
849 |
+
$extra['slug'] = $slug; // Needed for potentially renaming of directory name.
|
850 |
+
$source = $this->get_download_url( $slug );
|
851 |
+
$api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
|
852 |
+
$api = ( false !== $api ) ? $api : null;
|
853 |
+
|
854 |
+
$url = add_query_arg(
|
855 |
+
array(
|
856 |
+
'action' => $install_type . '-plugin',
|
857 |
+
'plugin' => urlencode( $slug ),
|
858 |
+
),
|
859 |
+
'update.php'
|
860 |
+
);
|
861 |
+
|
862 |
+
if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
|
863 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
864 |
+
}
|
865 |
+
|
866 |
+
$title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];
|
867 |
+
$skin_args = array(
|
868 |
+
'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
|
869 |
+
'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ),
|
870 |
+
'url' => esc_url_raw( $url ),
|
871 |
+
'nonce' => $install_type . '-plugin_' . $slug,
|
872 |
+
'plugin' => '',
|
873 |
+
'api' => $api,
|
874 |
+
'extra' => $extra,
|
875 |
+
);
|
876 |
+
unset( $title );
|
877 |
+
|
878 |
+
if ( 'update' === $install_type ) {
|
879 |
+
$skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
|
880 |
+
$skin = new Plugin_Upgrader_Skin( $skin_args );
|
881 |
+
} else {
|
882 |
+
$skin = new Plugin_Installer_Skin( $skin_args );
|
883 |
+
}
|
884 |
+
|
885 |
+
// Create a new instance of Plugin_Upgrader.
|
886 |
+
$upgrader = new Plugin_Upgrader( $skin );
|
887 |
+
|
888 |
+
// Perform the action and install the plugin from the $source urldecode().
|
889 |
+
add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
|
890 |
+
|
891 |
+
if ( 'update' === $install_type ) {
|
892 |
+
// Inject our info into the update transient.
|
893 |
+
$to_inject = array( $slug => $this->plugins[ $slug ] );
|
894 |
+
$to_inject[ $slug ]['source'] = $source;
|
895 |
+
$this->inject_update_info( $to_inject );
|
896 |
+
|
897 |
+
$upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
|
898 |
+
} else {
|
899 |
+
$upgrader->install( $source );
|
900 |
+
}
|
901 |
+
|
902 |
+
remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 );
|
903 |
+
|
904 |
+
// Make sure we have the correct file path now the plugin is installed/updated.
|
905 |
+
$this->populate_file_path( $slug );
|
906 |
+
|
907 |
+
// Only activate plugins if the config option is set to true and the plugin isn't
|
908 |
+
// already active (upgrade).
|
909 |
+
if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {
|
910 |
+
$plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.
|
911 |
+
if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {
|
912 |
+
return true; // Finish execution of the function early as we encountered an error.
|
913 |
+
}
|
914 |
+
}
|
915 |
+
|
916 |
+
$this->show_tgmpa_version();
|
917 |
+
|
918 |
+
// Display message based on if all plugins are now active or not.
|
919 |
+
if ( $this->is_tgmpa_complete() ) {
|
920 |
+
echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'navmenu-addon-for-elementor' ) . '</a>' ), '</p>';
|
921 |
+
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
|
922 |
+
} else {
|
923 |
+
echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
|
924 |
+
}
|
925 |
+
|
926 |
+
return true;
|
927 |
+
} elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) {
|
928 |
+
// Activate action link was clicked.
|
929 |
+
check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' );
|
930 |
+
|
931 |
+
if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
|
932 |
+
return true; // Finish execution of the function early as we encountered an error.
|
933 |
+
}
|
934 |
+
}
|
935 |
+
|
936 |
+
return false;
|
937 |
+
}
|
938 |
+
|
939 |
+
/**
|
940 |
+
* Inject information into the 'update_plugins' site transient as WP checks that before running an update.
|
941 |
+
*
|
942 |
+
* @since 2.5.0
|
943 |
+
*
|
944 |
+
* @param array $plugins The plugin information for the plugins which are to be updated.
|
945 |
+
*/
|
946 |
+
public function inject_update_info( $plugins ) {
|
947 |
+
$repo_updates = get_site_transient( 'update_plugins' );
|
948 |
+
|
949 |
+
if ( ! is_object( $repo_updates ) ) {
|
950 |
+
$repo_updates = new stdClass;
|
951 |
+
}
|
952 |
+
|
953 |
+
foreach ( $plugins as $slug => $plugin ) {
|
954 |
+
$file_path = $plugin['file_path'];
|
955 |
+
|
956 |
+
if ( empty( $repo_updates->response[ $file_path ] ) ) {
|
957 |
+
$repo_updates->response[ $file_path ] = new stdClass;
|
958 |
+
}
|
959 |
+
|
960 |
+
// We only really need to set package, but let's do all we can in case WP changes something.
|
961 |
+
$repo_updates->response[ $file_path ]->slug = $slug;
|
962 |
+
$repo_updates->response[ $file_path ]->plugin = $file_path;
|
963 |
+
$repo_updates->response[ $file_path ]->new_version = $plugin['version'];
|
964 |
+
$repo_updates->response[ $file_path ]->package = $plugin['source'];
|
965 |
+
if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
|
966 |
+
$repo_updates->response[ $file_path ]->url = $plugin['external_url'];
|
967 |
+
}
|
968 |
+
}
|
969 |
+
|
970 |
+
set_site_transient( 'update_plugins', $repo_updates );
|
971 |
+
}
|
972 |
+
|
973 |
+
/**
|
974 |
+
* Adjust the plugin directory name if necessary.
|
975 |
+
*
|
976 |
+
* The final destination directory of a plugin is based on the subdirectory name found in the
|
977 |
+
* (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this
|
978 |
+
* subdirectory name is not the same as the expected slug and the plugin will not be recognized
|
979 |
+
* as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to
|
980 |
+
* the expected plugin slug.
|
981 |
+
*
|
982 |
+
* @since 2.5.0
|
983 |
+
*
|
984 |
+
* @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
|
985 |
+
* @param string $remote_source Path to upgrade/zip-file-name.tmp.
|
986 |
+
* @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
|
987 |
+
* @return string $source
|
988 |
+
*/
|
989 |
+
public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
|
990 |
+
if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
|
991 |
+
return $source;
|
992 |
+
}
|
993 |
+
|
994 |
+
// Check for single file plugins.
|
995 |
+
$source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
|
996 |
+
if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
|
997 |
+
return $source;
|
998 |
+
}
|
999 |
+
|
1000 |
+
// Multi-file plugin, let's see if the directory is correctly named.
|
1001 |
+
$desired_slug = '';
|
1002 |
+
|
1003 |
+
// Figure out what the slug is supposed to be.
|
1004 |
+
if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
|
1005 |
+
$desired_slug = $upgrader->skin->options['extra']['slug'];
|
1006 |
+
} else {
|
1007 |
+
// Bulk installer contains less info, so fall back on the info registered here.
|
1008 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1009 |
+
if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
|
1010 |
+
$desired_slug = $slug;
|
1011 |
+
break;
|
1012 |
+
}
|
1013 |
+
}
|
1014 |
+
unset( $slug, $plugin );
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
if ( ! empty( $desired_slug ) ) {
|
1018 |
+
$subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
|
1019 |
+
|
1020 |
+
if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
|
1021 |
+
$from_path = untrailingslashit( $source );
|
1022 |
+
$to_path = trailingslashit( $remote_source ) . $desired_slug;
|
1023 |
+
|
1024 |
+
if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
|
1025 |
+
return trailingslashit( $to_path );
|
1026 |
+
} else {
|
1027 |
+
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'navmenu-addon-for-elementor' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'navmenu-addon-for-elementor' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
|
1028 |
+
}
|
1029 |
+
} elseif ( empty( $subdir_name ) ) {
|
1030 |
+
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'navmenu-addon-for-elementor' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'navmenu-addon-for-elementor' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
return $source;
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
/**
|
1038 |
+
* Activate a single plugin and send feedback about the result to the screen.
|
1039 |
+
*
|
1040 |
+
* @since 2.5.0
|
1041 |
+
*
|
1042 |
+
* @param string $file_path Path within wp-plugins/ to main plugin file.
|
1043 |
+
* @param string $slug Plugin slug.
|
1044 |
+
* @param bool $automatic Whether this is an automatic activation after an install. Defaults to false.
|
1045 |
+
* This determines the styling of the output messages.
|
1046 |
+
* @return bool False if an error was encountered, true otherwise.
|
1047 |
+
*/
|
1048 |
+
protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {
|
1049 |
+
if ( $this->can_plugin_activate( $slug ) ) {
|
1050 |
+
$activate = activate_plugin( $file_path );
|
1051 |
+
|
1052 |
+
if ( is_wp_error( $activate ) ) {
|
1053 |
+
echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
|
1054 |
+
'<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
|
1055 |
+
|
1056 |
+
return false; // End it here if there is an error with activation.
|
1057 |
+
} else {
|
1058 |
+
if ( ! $automatic ) {
|
1059 |
+
// Make sure message doesn't display again if bulk activation is performed
|
1060 |
+
// immediately after a single activation.
|
1061 |
+
if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
|
1062 |
+
echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
|
1063 |
+
}
|
1064 |
+
} else {
|
1065 |
+
// Simpler message layout for use on the plugin install page.
|
1066 |
+
echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
|
1067 |
+
}
|
1068 |
+
}
|
1069 |
+
} elseif ( $this->is_plugin_active( $slug ) ) {
|
1070 |
+
// No simpler message format provided as this message should never be encountered
|
1071 |
+
// on the plugin install page.
|
1072 |
+
echo '<div id="message" class="error"><p>',
|
1073 |
+
sprintf(
|
1074 |
+
esc_html( $this->strings['plugin_already_active'] ),
|
1075 |
+
'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
|
1076 |
+
),
|
1077 |
+
'</p></div>';
|
1078 |
+
} elseif ( $this->does_plugin_require_update( $slug ) ) {
|
1079 |
+
if ( ! $automatic ) {
|
1080 |
+
// Make sure message doesn't display again if bulk activation is performed
|
1081 |
+
// immediately after a single activation.
|
1082 |
+
if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
|
1083 |
+
echo '<div id="message" class="error"><p>',
|
1084 |
+
sprintf(
|
1085 |
+
esc_html( $this->strings['plugin_needs_higher_version'] ),
|
1086 |
+
'<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
|
1087 |
+
),
|
1088 |
+
'</p></div>';
|
1089 |
+
}
|
1090 |
+
} else {
|
1091 |
+
// Simpler message layout for use on the plugin install page.
|
1092 |
+
echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
|
1093 |
+
}
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
return true;
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
/**
|
1100 |
+
* Echoes required plugin notice.
|
1101 |
+
*
|
1102 |
+
* Outputs a message telling users that a specific plugin is required for
|
1103 |
+
* their theme. If appropriate, it includes a link to the form page where
|
1104 |
+
* users can install and activate the plugin.
|
1105 |
+
*
|
1106 |
+
* Returns early if we're on the Install page.
|
1107 |
+
*
|
1108 |
+
* @since 1.0.0
|
1109 |
+
*
|
1110 |
+
* @global object $current_screen
|
1111 |
+
*
|
1112 |
+
* @return null Returns early if we're on the Install page.
|
1113 |
+
*/
|
1114 |
+
public function notices() {
|
1115 |
+
// Remove nag on the install page / Return early if the nag message has been dismissed or user < author.
|
1116 |
+
if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) {
|
1117 |
+
return;
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
// Store for the plugin slugs by message type.
|
1121 |
+
$message = array();
|
1122 |
+
|
1123 |
+
// Initialize counters used to determine plurality of action link texts.
|
1124 |
+
$install_link_count = 0;
|
1125 |
+
$update_link_count = 0;
|
1126 |
+
$activate_link_count = 0;
|
1127 |
+
$total_required_action_count = 0;
|
1128 |
+
|
1129 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1130 |
+
if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {
|
1131 |
+
continue;
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
if ( ! $this->is_plugin_installed( $slug ) ) {
|
1135 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
1136 |
+
$install_link_count++;
|
1137 |
+
|
1138 |
+
if ( true === $plugin['required'] ) {
|
1139 |
+
$message['notice_can_install_required'][] = $slug;
|
1140 |
+
} else {
|
1141 |
+
$message['notice_can_install_recommended'][] = $slug;
|
1142 |
+
}
|
1143 |
+
}
|
1144 |
+
if ( true === $plugin['required'] ) {
|
1145 |
+
$total_required_action_count++;
|
1146 |
+
}
|
1147 |
+
} else {
|
1148 |
+
if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {
|
1149 |
+
if ( current_user_can( 'activate_plugins' ) ) {
|
1150 |
+
$activate_link_count++;
|
1151 |
+
|
1152 |
+
if ( true === $plugin['required'] ) {
|
1153 |
+
$message['notice_can_activate_required'][] = $slug;
|
1154 |
+
} else {
|
1155 |
+
$message['notice_can_activate_recommended'][] = $slug;
|
1156 |
+
}
|
1157 |
+
}
|
1158 |
+
if ( true === $plugin['required'] ) {
|
1159 |
+
$total_required_action_count++;
|
1160 |
+
}
|
1161 |
+
}
|
1162 |
+
|
1163 |
+
if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
|
1164 |
+
|
1165 |
+
if ( current_user_can( 'update_plugins' ) ) {
|
1166 |
+
$update_link_count++;
|
1167 |
+
|
1168 |
+
if ( $this->does_plugin_require_update( $slug ) ) {
|
1169 |
+
$message['notice_ask_to_update'][] = $slug;
|
1170 |
+
} elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
|
1171 |
+
$message['notice_ask_to_update_maybe'][] = $slug;
|
1172 |
+
}
|
1173 |
+
}
|
1174 |
+
if ( true === $plugin['required'] ) {
|
1175 |
+
$total_required_action_count++;
|
1176 |
+
}
|
1177 |
+
}
|
1178 |
+
}
|
1179 |
+
}
|
1180 |
+
unset( $slug, $plugin );
|
1181 |
+
|
1182 |
+
// If we have notices to display, we move forward.
|
1183 |
+
if ( ! empty( $message ) || $total_required_action_count > 0 ) {
|
1184 |
+
krsort( $message ); // Sort messages.
|
1185 |
+
$rendered = '';
|
1186 |
+
|
1187 |
+
// As add_settings_error() wraps the final message in a <p> and as the final message can't be
|
1188 |
+
// filtered, using <p>'s in our html would render invalid html output.
|
1189 |
+
$line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
|
1190 |
+
|
1191 |
+
if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {
|
1192 |
+
$rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] );
|
1193 |
+
$rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );
|
1194 |
+
} else {
|
1195 |
+
|
1196 |
+
// If dismissable is false and a message is set, output it now.
|
1197 |
+
if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {
|
1198 |
+
$rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
// Render the individual message lines for the notice.
|
1202 |
+
foreach ( $message as $type => $plugin_group ) {
|
1203 |
+
$linked_plugins = array();
|
1204 |
+
|
1205 |
+
// Get the external info link for a plugin if one is available.
|
1206 |
+
foreach ( $plugin_group as $plugin_slug ) {
|
1207 |
+
$linked_plugins[] = $this->get_info_link( $plugin_slug );
|
1208 |
+
}
|
1209 |
+
unset( $plugin_slug );
|
1210 |
+
|
1211 |
+
$count = count( $plugin_group );
|
1212 |
+
$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
|
1213 |
+
$last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
|
1214 |
+
$imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'navmenu-addon-for-elementor' ) . ' ' . $last_plugin );
|
1215 |
+
|
1216 |
+
$rendered .= sprintf(
|
1217 |
+
$line_template,
|
1218 |
+
sprintf(
|
1219 |
+
translate_nooped_plural( $this->strings[ $type ], $count, 'tgmpa' ),
|
1220 |
+
$imploded,
|
1221 |
+
$count
|
1222 |
+
)
|
1223 |
+
);
|
1224 |
+
|
1225 |
+
}
|
1226 |
+
unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );
|
1227 |
+
|
1228 |
+
$rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template );
|
1229 |
+
}
|
1230 |
+
|
1231 |
+
// Register the nag messages and prepare them to be processed.
|
1232 |
+
add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() );
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
// Admin options pages already output settings_errors, so this is to avoid duplication.
|
1236 |
+
if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
|
1237 |
+
$this->display_settings_errors();
|
1238 |
+
}
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
/**
|
1242 |
+
* Generate the user action links for the admin notice.
|
1243 |
+
*
|
1244 |
+
* @since 2.6.0
|
1245 |
+
*
|
1246 |
+
* @param int $install_count Number of plugins to install.
|
1247 |
+
* @param int $update_count Number of plugins to update.
|
1248 |
+
* @param int $activate_count Number of plugins to activate.
|
1249 |
+
* @param int $line_template Template for the HTML tag to output a line.
|
1250 |
+
* @return string Action links.
|
1251 |
+
*/
|
1252 |
+
protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) {
|
1253 |
+
// Setup action links.
|
1254 |
+
$action_links = array(
|
1255 |
+
'install' => '',
|
1256 |
+
'update' => '',
|
1257 |
+
'activate' => '',
|
1258 |
+
'dismiss' => $this->dismissable ? '<a href="' . esc_url( wp_nonce_url( add_query_arg( 'tgmpa-dismiss', 'dismiss_admin_notices' ), 'tgmpa-dismiss-' . get_current_user_id() ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
|
1259 |
+
);
|
1260 |
+
|
1261 |
+
$link_template = '<a href="%2$s">%1$s</a>';
|
1262 |
+
|
1263 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
1264 |
+
if ( $install_count > 0 ) {
|
1265 |
+
$action_links['install'] = sprintf(
|
1266 |
+
$link_template,
|
1267 |
+
translate_nooped_plural( $this->strings['install_link'], $install_count, 'tgmpa' ),
|
1268 |
+
esc_url( $this->get_tgmpa_status_url( 'install' ) )
|
1269 |
+
);
|
1270 |
+
}
|
1271 |
+
if ( $update_count > 0 ) {
|
1272 |
+
$action_links['update'] = sprintf(
|
1273 |
+
$link_template,
|
1274 |
+
translate_nooped_plural( $this->strings['update_link'], $update_count, 'tgmpa' ),
|
1275 |
+
esc_url( $this->get_tgmpa_status_url( 'update' ) )
|
1276 |
+
);
|
1277 |
+
}
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
|
1281 |
+
$action_links['activate'] = sprintf(
|
1282 |
+
$link_template,
|
1283 |
+
translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'tgmpa' ),
|
1284 |
+
esc_url( $this->get_tgmpa_status_url( 'activate' ) )
|
1285 |
+
);
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
$action_links = apply_filters( 'tgmpa_notice_action_links', $action_links );
|
1289 |
+
|
1290 |
+
$action_links = array_filter( (array) $action_links ); // Remove any empty array items.
|
1291 |
+
|
1292 |
+
if ( ! empty( $action_links ) ) {
|
1293 |
+
$action_links = sprintf( $line_template, implode( ' | ', $action_links ) );
|
1294 |
+
return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links );
|
1295 |
+
} else {
|
1296 |
+
return '';
|
1297 |
+
}
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
/**
|
1301 |
+
* Get admin notice class.
|
1302 |
+
*
|
1303 |
+
* Work around all the changes to the various admin notice classes between WP 4.4 and 3.7
|
1304 |
+
* (lowest supported version by TGMPA).
|
1305 |
+
*
|
1306 |
+
* @since 2.6.0
|
1307 |
+
*
|
1308 |
+
* @return string
|
1309 |
+
*/
|
1310 |
+
protected function get_admin_notice_class() {
|
1311 |
+
if ( ! empty( $this->strings['nag_type'] ) ) {
|
1312 |
+
return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );
|
1313 |
+
} else {
|
1314 |
+
if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {
|
1315 |
+
return 'notice-warning';
|
1316 |
+
} elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) {
|
1317 |
+
return 'notice';
|
1318 |
+
} else {
|
1319 |
+
return 'updated';
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
}
|
1323 |
+
|
1324 |
+
/**
|
1325 |
+
* Display settings errors and remove those which have been displayed to avoid duplicate messages showing
|
1326 |
+
*
|
1327 |
+
* @since 2.5.0
|
1328 |
+
*/
|
1329 |
+
protected function display_settings_errors() {
|
1330 |
+
global $wp_settings_errors;
|
1331 |
+
|
1332 |
+
settings_errors( 'tgmpa' );
|
1333 |
+
|
1334 |
+
foreach ( (array) $wp_settings_errors as $key => $details ) {
|
1335 |
+
if ( 'tgmpa' === $details['setting'] ) {
|
1336 |
+
unset( $wp_settings_errors[ $key ] );
|
1337 |
+
break;
|
1338 |
+
}
|
1339 |
+
}
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
/**
|
1343 |
+
* Register dismissal of admin notices.
|
1344 |
+
*
|
1345 |
+
* Acts on the dismiss link in the admin nag messages.
|
1346 |
+
* If clicked, the admin notice disappears and will no longer be visible to this user.
|
1347 |
+
*
|
1348 |
+
* @since 2.1.0
|
1349 |
+
*/
|
1350 |
+
public function dismiss() {
|
1351 |
+
if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) {
|
1352 |
+
update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 );
|
1353 |
+
}
|
1354 |
+
}
|
1355 |
+
|
1356 |
+
/**
|
1357 |
+
* Add individual plugin to our collection of plugins.
|
1358 |
+
*
|
1359 |
+
* If the required keys are not set or the plugin has already
|
1360 |
+
* been registered, the plugin is not added.
|
1361 |
+
*
|
1362 |
+
* @since 2.0.0
|
1363 |
+
*
|
1364 |
+
* @param array|null $plugin Array of plugin arguments or null if invalid argument.
|
1365 |
+
* @return null Return early if incorrect argument.
|
1366 |
+
*/
|
1367 |
+
public function register( $plugin ) {
|
1368 |
+
if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
|
1369 |
+
return;
|
1370 |
+
}
|
1371 |
+
|
1372 |
+
if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
|
1373 |
+
return;
|
1374 |
+
}
|
1375 |
+
|
1376 |
+
$defaults = array(
|
1377 |
+
'name' => '', // String
|
1378 |
+
'slug' => '', // String
|
1379 |
+
'source' => 'repo', // String
|
1380 |
+
'required' => false, // Boolean
|
1381 |
+
'version' => '', // String
|
1382 |
+
'force_activation' => false, // Boolean
|
1383 |
+
'force_deactivation' => false, // Boolean
|
1384 |
+
'external_url' => '', // String
|
1385 |
+
'is_callable' => '', // String|Array.
|
1386 |
+
);
|
1387 |
+
|
1388 |
+
// Prepare the received data.
|
1389 |
+
$plugin = wp_parse_args( $plugin, $defaults );
|
1390 |
+
|
1391 |
+
// Standardize the received slug.
|
1392 |
+
$plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
|
1393 |
+
|
1394 |
+
// Forgive users for using string versions of booleans or floats for version number.
|
1395 |
+
$plugin['version'] = (string) $plugin['version'];
|
1396 |
+
$plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
|
1397 |
+
$plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] );
|
1398 |
+
$plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] );
|
1399 |
+
$plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
|
1400 |
+
|
1401 |
+
// Enrich the received data.
|
1402 |
+
$plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
|
1403 |
+
$plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
|
1404 |
+
|
1405 |
+
// Set the class properties.
|
1406 |
+
$this->plugins[ $plugin['slug'] ] = $plugin;
|
1407 |
+
$this->sort_order[ $plugin['slug'] ] = $plugin['name'];
|
1408 |
+
|
1409 |
+
// Should we add the force activation hook ?
|
1410 |
+
if ( true === $plugin['force_activation'] ) {
|
1411 |
+
$this->has_forced_activation = true;
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
// Should we add the force deactivation hook ?
|
1415 |
+
if ( true === $plugin['force_deactivation'] ) {
|
1416 |
+
$this->has_forced_deactivation = true;
|
1417 |
+
}
|
1418 |
+
}
|
1419 |
+
|
1420 |
+
/**
|
1421 |
+
* Determine what type of source the plugin comes from.
|
1422 |
+
*
|
1423 |
+
* @since 2.5.0
|
1424 |
+
*
|
1425 |
+
* @param string $source The source of the plugin as provided, either empty (= WP repo), a file path
|
1426 |
+
* (= bundled) or an external URL.
|
1427 |
+
* @return string 'repo', 'external', or 'bundled'
|
1428 |
+
*/
|
1429 |
+
protected function get_plugin_source_type( $source ) {
|
1430 |
+
if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {
|
1431 |
+
return 'repo';
|
1432 |
+
} elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {
|
1433 |
+
return 'external';
|
1434 |
+
} else {
|
1435 |
+
return 'bundled';
|
1436 |
+
}
|
1437 |
+
}
|
1438 |
+
|
1439 |
+
/**
|
1440 |
+
* Sanitizes a string key.
|
1441 |
+
*
|
1442 |
+
* Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are*
|
1443 |
+
* allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase
|
1444 |
+
* characters in the plugin directory path/slug. Silly them.
|
1445 |
+
*
|
1446 |
+
* @see https://developer.wordpress.org/reference/hooks/sanitize_key/
|
1447 |
+
*
|
1448 |
+
* @since 2.5.0
|
1449 |
+
*
|
1450 |
+
* @param string $key String key.
|
1451 |
+
* @return string Sanitized key
|
1452 |
+
*/
|
1453 |
+
public function sanitize_key( $key ) {
|
1454 |
+
$raw_key = $key;
|
1455 |
+
$key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
|
1456 |
+
|
1457 |
+
/**
|
1458 |
+
* Filter a sanitized key string.
|
1459 |
+
*
|
1460 |
+
* @since 2.5.0
|
1461 |
+
*
|
1462 |
+
* @param string $key Sanitized key.
|
1463 |
+
* @param string $raw_key The key prior to sanitization.
|
1464 |
+
*/
|
1465 |
+
return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
|
1466 |
+
}
|
1467 |
+
|
1468 |
+
/**
|
1469 |
+
* Amend default configuration settings.
|
1470 |
+
*
|
1471 |
+
* @since 2.0.0
|
1472 |
+
*
|
1473 |
+
* @param array $config Array of config options to pass as class properties.
|
1474 |
+
*/
|
1475 |
+
public function config( $config ) {
|
1476 |
+
$keys = array(
|
1477 |
+
'id',
|
1478 |
+
'default_path',
|
1479 |
+
'has_notices',
|
1480 |
+
'dismissable',
|
1481 |
+
'dismiss_msg',
|
1482 |
+
'menu',
|
1483 |
+
'parent_slug',
|
1484 |
+
'capability',
|
1485 |
+
'is_automatic',
|
1486 |
+
'message',
|
1487 |
+
'strings',
|
1488 |
+
);
|
1489 |
+
|
1490 |
+
foreach ( $keys as $key ) {
|
1491 |
+
if ( isset( $config[ $key ] ) ) {
|
1492 |
+
if ( is_array( $config[ $key ] ) ) {
|
1493 |
+
$this->$key = array_merge( $this->$key, $config[ $key ] );
|
1494 |
+
} else {
|
1495 |
+
$this->$key = $config[ $key ];
|
1496 |
+
}
|
1497 |
+
}
|
1498 |
+
}
|
1499 |
+
}
|
1500 |
+
|
1501 |
+
/**
|
1502 |
+
* Amend action link after plugin installation.
|
1503 |
+
*
|
1504 |
+
* @since 2.0.0
|
1505 |
+
*
|
1506 |
+
* @param array $install_actions Existing array of actions.
|
1507 |
+
* @return false|array Amended array of actions.
|
1508 |
+
*/
|
1509 |
+
public function actions( $install_actions ) {
|
1510 |
+
// Remove action links on the TGMPA install page.
|
1511 |
+
if ( $this->is_tgmpa_page() ) {
|
1512 |
+
return false;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
return $install_actions;
|
1516 |
+
}
|
1517 |
+
|
1518 |
+
/**
|
1519 |
+
* Flushes the plugins cache on theme switch to prevent stale entries
|
1520 |
+
* from remaining in the plugin table.
|
1521 |
+
*
|
1522 |
+
* @since 2.4.0
|
1523 |
+
*
|
1524 |
+
* @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.
|
1525 |
+
* Parameter added in v2.5.0.
|
1526 |
+
*/
|
1527 |
+
public function flush_plugins_cache( $clear_update_cache = true ) {
|
1528 |
+
wp_clean_plugins_cache( $clear_update_cache );
|
1529 |
+
}
|
1530 |
+
|
1531 |
+
/**
|
1532 |
+
* Set file_path key for each installed plugin.
|
1533 |
+
*
|
1534 |
+
* @since 2.1.0
|
1535 |
+
*
|
1536 |
+
* @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.
|
1537 |
+
* Parameter added in v2.5.0.
|
1538 |
+
*/
|
1539 |
+
public function populate_file_path( $plugin_slug = '' ) {
|
1540 |
+
if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
|
1541 |
+
$this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
|
1542 |
+
} else {
|
1543 |
+
// Add file_path key for all plugins.
|
1544 |
+
foreach ( $this->plugins as $slug => $values ) {
|
1545 |
+
$this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
|
1546 |
+
}
|
1547 |
+
}
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
/**
|
1551 |
+
* Helper function to extract the file path of the plugin file from the
|
1552 |
+
* plugin slug, if the plugin is installed.
|
1553 |
+
*
|
1554 |
+
* @since 2.0.0
|
1555 |
+
*
|
1556 |
+
* @param string $slug Plugin slug (typically folder name) as provided by the developer.
|
1557 |
+
* @return string Either file path for plugin if installed, or just the plugin slug.
|
1558 |
+
*/
|
1559 |
+
protected function _get_plugin_basename_from_slug( $slug ) {
|
1560 |
+
$keys = array_keys( $this->get_plugins() );
|
1561 |
+
|
1562 |
+
foreach ( $keys as $key ) {
|
1563 |
+
if ( preg_match( '|^' . $slug . '/|', $key ) ) {
|
1564 |
+
return $key;
|
1565 |
+
}
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
return $slug;
|
1569 |
+
}
|
1570 |
+
|
1571 |
+
/**
|
1572 |
+
* Retrieve plugin data, given the plugin name.
|
1573 |
+
*
|
1574 |
+
* Loops through the registered plugins looking for $name. If it finds it,
|
1575 |
+
* it returns the $data from that plugin. Otherwise, returns false.
|
1576 |
+
*
|
1577 |
+
* @since 2.1.0
|
1578 |
+
*
|
1579 |
+
* @param string $name Name of the plugin, as it was registered.
|
1580 |
+
* @param string $data Optional. Array key of plugin data to return. Default is slug.
|
1581 |
+
* @return string|boolean Plugin slug if found, false otherwise.
|
1582 |
+
*/
|
1583 |
+
public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
|
1584 |
+
foreach ( $this->plugins as $values ) {
|
1585 |
+
if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
|
1586 |
+
return $values[ $data ];
|
1587 |
+
}
|
1588 |
+
}
|
1589 |
+
|
1590 |
+
return false;
|
1591 |
+
}
|
1592 |
+
|
1593 |
+
/**
|
1594 |
+
* Retrieve the download URL for a package.
|
1595 |
+
*
|
1596 |
+
* @since 2.5.0
|
1597 |
+
*
|
1598 |
+
* @param string $slug Plugin slug.
|
1599 |
+
* @return string Plugin download URL or path to local file or empty string if undetermined.
|
1600 |
+
*/
|
1601 |
+
public function get_download_url( $slug ) {
|
1602 |
+
$dl_source = '';
|
1603 |
+
|
1604 |
+
switch ( $this->plugins[ $slug ]['source_type'] ) {
|
1605 |
+
case 'repo':
|
1606 |
+
return $this->get_wp_repo_download_url( $slug );
|
1607 |
+
case 'external':
|
1608 |
+
return $this->plugins[ $slug ]['source'];
|
1609 |
+
case 'bundled':
|
1610 |
+
return $this->default_path . $this->plugins[ $slug ]['source'];
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
return $dl_source; // Should never happen.
|
1614 |
+
}
|
1615 |
+
|
1616 |
+
/**
|
1617 |
+
* Retrieve the download URL for a WP repo package.
|
1618 |
+
*
|
1619 |
+
* @since 2.5.0
|
1620 |
+
*
|
1621 |
+
* @param string $slug Plugin slug.
|
1622 |
+
* @return string Plugin download URL.
|
1623 |
+
*/
|
1624 |
+
protected function get_wp_repo_download_url( $slug ) {
|
1625 |
+
$source = '';
|
1626 |
+
$api = $this->get_plugins_api( $slug );
|
1627 |
+
|
1628 |
+
if ( false !== $api && isset( $api->download_link ) ) {
|
1629 |
+
$source = $api->download_link;
|
1630 |
+
}
|
1631 |
+
|
1632 |
+
return $source;
|
1633 |
+
}
|
1634 |
+
|
1635 |
+
/**
|
1636 |
+
* Try to grab information from WordPress API.
|
1637 |
+
*
|
1638 |
+
* @since 2.5.0
|
1639 |
+
*
|
1640 |
+
* @param string $slug Plugin slug.
|
1641 |
+
* @return object Plugins_api response object on success, WP_Error on failure.
|
1642 |
+
*/
|
1643 |
+
protected function get_plugins_api( $slug ) {
|
1644 |
+
static $api = array(); // Cache received responses.
|
1645 |
+
|
1646 |
+
if ( ! isset( $api[ $slug ] ) ) {
|
1647 |
+
if ( ! function_exists( 'plugins_api' ) ) {
|
1648 |
+
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
1649 |
+
}
|
1650 |
+
|
1651 |
+
$response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
|
1652 |
+
|
1653 |
+
$api[ $slug ] = false;
|
1654 |
+
|
1655 |
+
if ( is_wp_error( $response ) ) {
|
1656 |
+
wp_die( esc_html( $this->strings['oops'] ) );
|
1657 |
+
} else {
|
1658 |
+
$api[ $slug ] = $response;
|
1659 |
+
}
|
1660 |
+
}
|
1661 |
+
|
1662 |
+
return $api[ $slug ];
|
1663 |
+
}
|
1664 |
+
|
1665 |
+
/**
|
1666 |
+
* Retrieve a link to a plugin information page.
|
1667 |
+
*
|
1668 |
+
* @since 2.5.0
|
1669 |
+
*
|
1670 |
+
* @param string $slug Plugin slug.
|
1671 |
+
* @return string Fully formed html link to a plugin information page if available
|
1672 |
+
* or the plugin name if not.
|
1673 |
+
*/
|
1674 |
+
public function get_info_link( $slug ) {
|
1675 |
+
if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
|
1676 |
+
$link = sprintf(
|
1677 |
+
'<a href="%1$s" target="_blank">%2$s</a>',
|
1678 |
+
esc_url( $this->plugins[ $slug ]['external_url'] ),
|
1679 |
+
esc_html( $this->plugins[ $slug ]['name'] )
|
1680 |
+
);
|
1681 |
+
} elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
|
1682 |
+
$url = add_query_arg(
|
1683 |
+
array(
|
1684 |
+
'tab' => 'plugin-information',
|
1685 |
+
'plugin' => urlencode( $slug ),
|
1686 |
+
'TB_iframe' => 'true',
|
1687 |
+
'width' => '640',
|
1688 |
+
'height' => '500',
|
1689 |
+
),
|
1690 |
+
self_admin_url( 'plugin-install.php' )
|
1691 |
+
);
|
1692 |
+
|
1693 |
+
$link = sprintf(
|
1694 |
+
'<a href="%1$s" class="thickbox">%2$s</a>',
|
1695 |
+
esc_url( $url ),
|
1696 |
+
esc_html( $this->plugins[ $slug ]['name'] )
|
1697 |
+
);
|
1698 |
+
} else {
|
1699 |
+
$link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
|
1700 |
+
}
|
1701 |
+
|
1702 |
+
return $link;
|
1703 |
+
}
|
1704 |
+
|
1705 |
+
/**
|
1706 |
+
* Determine if we're on the TGMPA Install page.
|
1707 |
+
*
|
1708 |
+
* @since 2.1.0
|
1709 |
+
*
|
1710 |
+
* @return boolean True when on the TGMPA page, false otherwise.
|
1711 |
+
*/
|
1712 |
+
protected function is_tgmpa_page() {
|
1713 |
+
return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
|
1714 |
+
}
|
1715 |
+
|
1716 |
+
/**
|
1717 |
+
* Determine if we're on a WP Core installation/upgrade page.
|
1718 |
+
*
|
1719 |
+
* @since 2.6.0
|
1720 |
+
*
|
1721 |
+
* @return boolean True when on a WP Core installation/upgrade page, false otherwise.
|
1722 |
+
*/
|
1723 |
+
protected function is_core_update_page() {
|
1724 |
+
// Current screen is not always available, most notably on the customizer screen.
|
1725 |
+
if ( ! function_exists( 'get_current_screen' ) ) {
|
1726 |
+
return false;
|
1727 |
+
}
|
1728 |
+
|
1729 |
+
$screen = get_current_screen();
|
1730 |
+
|
1731 |
+
if ( 'update-core' === $screen->base ) {
|
1732 |
+
// Core update screen.
|
1733 |
+
return true;
|
1734 |
+
} elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
|
1735 |
+
// Plugins bulk update screen.
|
1736 |
+
return true;
|
1737 |
+
} elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
|
1738 |
+
// Individual updates (ajax call).
|
1739 |
+
return true;
|
1740 |
+
}
|
1741 |
+
|
1742 |
+
return false;
|
1743 |
+
}
|
1744 |
+
|
1745 |
+
/**
|
1746 |
+
* Retrieve the URL to the TGMPA Install page.
|
1747 |
+
*
|
1748 |
+
* I.e. depending on the config settings passed something along the lines of:
|
1749 |
+
* http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins
|
1750 |
+
*
|
1751 |
+
* @since 2.5.0
|
1752 |
+
*
|
1753 |
+
* @return string Properly encoded URL (not escaped).
|
1754 |
+
*/
|
1755 |
+
public function get_tgmpa_url() {
|
1756 |
+
static $url;
|
1757 |
+
|
1758 |
+
if ( ! isset( $url ) ) {
|
1759 |
+
$parent = $this->parent_slug;
|
1760 |
+
if ( false === strpos( $parent, '.php' ) ) {
|
1761 |
+
$parent = 'admin.php';
|
1762 |
+
}
|
1763 |
+
$url = add_query_arg(
|
1764 |
+
array(
|
1765 |
+
'page' => urlencode( $this->menu ),
|
1766 |
+
),
|
1767 |
+
self_admin_url( $parent )
|
1768 |
+
);
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
return $url;
|
1772 |
+
}
|
1773 |
+
|
1774 |
+
/**
|
1775 |
+
* Retrieve the URL to the TGMPA Install page for a specific plugin status (view).
|
1776 |
+
*
|
1777 |
+
* I.e. depending on the config settings passed something along the lines of:
|
1778 |
+
* http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install
|
1779 |
+
*
|
1780 |
+
* @since 2.5.0
|
1781 |
+
*
|
1782 |
+
* @param string $status Plugin status - either 'install', 'update' or 'activate'.
|
1783 |
+
* @return string Properly encoded URL (not escaped).
|
1784 |
+
*/
|
1785 |
+
public function get_tgmpa_status_url( $status ) {
|
1786 |
+
return add_query_arg(
|
1787 |
+
array(
|
1788 |
+
'plugin_status' => urlencode( $status ),
|
1789 |
+
),
|
1790 |
+
$this->get_tgmpa_url()
|
1791 |
+
);
|
1792 |
+
}
|
1793 |
+
|
1794 |
+
/**
|
1795 |
+
* Determine whether there are open actions for plugins registered with TGMPA.
|
1796 |
+
*
|
1797 |
+
* @since 2.5.0
|
1798 |
+
*
|
1799 |
+
* @return bool True if complete, i.e. no outstanding actions. False otherwise.
|
1800 |
+
*/
|
1801 |
+
public function is_tgmpa_complete() {
|
1802 |
+
$complete = true;
|
1803 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
1804 |
+
if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
|
1805 |
+
$complete = false;
|
1806 |
+
break;
|
1807 |
+
}
|
1808 |
+
}
|
1809 |
+
|
1810 |
+
return $complete;
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
/**
|
1814 |
+
* Check if a plugin is installed. Does not take must-use plugins into account.
|
1815 |
+
*
|
1816 |
+
* @since 2.5.0
|
1817 |
+
*
|
1818 |
+
* @param string $slug Plugin slug.
|
1819 |
+
* @return bool True if installed, false otherwise.
|
1820 |
+
*/
|
1821 |
+
public function is_plugin_installed( $slug ) {
|
1822 |
+
$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
|
1823 |
+
|
1824 |
+
return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
|
1825 |
+
}
|
1826 |
+
|
1827 |
+
/**
|
1828 |
+
* Check if a plugin is active.
|
1829 |
+
*
|
1830 |
+
* @since 2.5.0
|
1831 |
+
*
|
1832 |
+
* @param string $slug Plugin slug.
|
1833 |
+
* @return bool True if active, false otherwise.
|
1834 |
+
*/
|
1835 |
+
public function is_plugin_active( $slug ) {
|
1836 |
+
return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
|
1837 |
+
}
|
1838 |
+
|
1839 |
+
/**
|
1840 |
+
* Check if a plugin can be updated, i.e. if we have information on the minimum WP version required
|
1841 |
+
* available, check whether the current install meets them.
|
1842 |
+
*
|
1843 |
+
* @since 2.5.0
|
1844 |
+
*
|
1845 |
+
* @param string $slug Plugin slug.
|
1846 |
+
* @return bool True if OK to update, false otherwise.
|
1847 |
+
*/
|
1848 |
+
public function can_plugin_update( $slug ) {
|
1849 |
+
// We currently can't get reliable info on non-WP-repo plugins - issue #380.
|
1850 |
+
if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
|
1851 |
+
return true;
|
1852 |
+
}
|
1853 |
+
|
1854 |
+
$api = $this->get_plugins_api( $slug );
|
1855 |
+
|
1856 |
+
if ( false !== $api && isset( $api->requires ) ) {
|
1857 |
+
return version_compare( $this->wp_version, $api->requires, '>=' );
|
1858 |
+
}
|
1859 |
+
|
1860 |
+
// No usable info received from the plugins API, presume we can update.
|
1861 |
+
return true;
|
1862 |
+
}
|
1863 |
+
|
1864 |
+
/**
|
1865 |
+
* Check to see if the plugin is 'updatetable', i.e. installed, with an update available
|
1866 |
+
* and no WP version requirements blocking it.
|
1867 |
+
*
|
1868 |
+
* @since 2.6.0
|
1869 |
+
*
|
1870 |
+
* @param string $slug Plugin slug.
|
1871 |
+
* @return bool True if OK to proceed with update, false otherwise.
|
1872 |
+
*/
|
1873 |
+
public function is_plugin_updatetable( $slug ) {
|
1874 |
+
if ( ! $this->is_plugin_installed( $slug ) ) {
|
1875 |
+
return false;
|
1876 |
+
} else {
|
1877 |
+
return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) );
|
1878 |
+
}
|
1879 |
+
}
|
1880 |
+
|
1881 |
+
/**
|
1882 |
+
* Check if a plugin can be activated, i.e. is not currently active and meets the minimum
|
1883 |
+
* plugin version requirements set in TGMPA (if any).
|
1884 |
+
*
|
1885 |
+
* @since 2.5.0
|
1886 |
+
*
|
1887 |
+
* @param string $slug Plugin slug.
|
1888 |
+
* @return bool True if OK to activate, false otherwise.
|
1889 |
+
*/
|
1890 |
+
public function can_plugin_activate( $slug ) {
|
1891 |
+
return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
/**
|
1895 |
+
* Retrieve the version number of an installed plugin.
|
1896 |
+
*
|
1897 |
+
* @since 2.5.0
|
1898 |
+
*
|
1899 |
+
* @param string $slug Plugin slug.
|
1900 |
+
* @return string Version number as string or an empty string if the plugin is not installed
|
1901 |
+
* or version unknown (plugins which don't comply with the plugin header standard).
|
1902 |
+
*/
|
1903 |
+
public function get_installed_version( $slug ) {
|
1904 |
+
$installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
|
1905 |
+
|
1906 |
+
if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
|
1907 |
+
return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
|
1908 |
+
}
|
1909 |
+
|
1910 |
+
return '';
|
1911 |
+
}
|
1912 |
+
|
1913 |
+
/**
|
1914 |
+
* Check whether a plugin complies with the minimum version requirements.
|
1915 |
+
*
|
1916 |
+
* @since 2.5.0
|
1917 |
+
*
|
1918 |
+
* @param string $slug Plugin slug.
|
1919 |
+
* @return bool True when a plugin needs to be updated, otherwise false.
|
1920 |
+
*/
|
1921 |
+
public function does_plugin_require_update( $slug ) {
|
1922 |
+
$installed_version = $this->get_installed_version( $slug );
|
1923 |
+
$minimum_version = $this->plugins[ $slug ]['version'];
|
1924 |
+
|
1925 |
+
return version_compare( $minimum_version, $installed_version, '>' );
|
1926 |
+
}
|
1927 |
+
|
1928 |
+
/**
|
1929 |
+
* Check whether there is an update available for a plugin.
|
1930 |
+
*
|
1931 |
+
* @since 2.5.0
|
1932 |
+
*
|
1933 |
+
* @param string $slug Plugin slug.
|
1934 |
+
* @return false|string Version number string of the available update or false if no update available.
|
1935 |
+
*/
|
1936 |
+
public function does_plugin_have_update( $slug ) {
|
1937 |
+
// Presume bundled and external plugins will point to a package which meets the minimum required version.
|
1938 |
+
if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
|
1939 |
+
if ( $this->does_plugin_require_update( $slug ) ) {
|
1940 |
+
return $this->plugins[ $slug ]['version'];
|
1941 |
+
}
|
1942 |
+
|
1943 |
+
return false;
|
1944 |
+
}
|
1945 |
+
|
1946 |
+
$repo_updates = get_site_transient( 'update_plugins' );
|
1947 |
+
|
1948 |
+
if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
|
1949 |
+
return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
|
1950 |
+
}
|
1951 |
+
|
1952 |
+
return false;
|
1953 |
+
}
|
1954 |
+
|
1955 |
+
/**
|
1956 |
+
* Retrieve potential upgrade notice for a plugin.
|
1957 |
+
*
|
1958 |
+
* @since 2.5.0
|
1959 |
+
*
|
1960 |
+
* @param string $slug Plugin slug.
|
1961 |
+
* @return string The upgrade notice or an empty string if no message was available or provided.
|
1962 |
+
*/
|
1963 |
+
public function get_upgrade_notice( $slug ) {
|
1964 |
+
// We currently can't get reliable info on non-WP-repo plugins - issue #380.
|
1965 |
+
if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
|
1966 |
+
return '';
|
1967 |
+
}
|
1968 |
+
|
1969 |
+
$repo_updates = get_site_transient( 'update_plugins' );
|
1970 |
+
|
1971 |
+
if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {
|
1972 |
+
return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;
|
1973 |
+
}
|
1974 |
+
|
1975 |
+
return '';
|
1976 |
+
}
|
1977 |
+
|
1978 |
+
/**
|
1979 |
+
* Wrapper around the core WP get_plugins function, making sure it's actually available.
|
1980 |
+
*
|
1981 |
+
* @since 2.5.0
|
1982 |
+
*
|
1983 |
+
* @param string $plugin_folder Optional. Relative path to single plugin folder.
|
1984 |
+
* @return array Array of installed plugins with plugin information.
|
1985 |
+
*/
|
1986 |
+
public function get_plugins( $plugin_folder = '' ) {
|
1987 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
1988 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
1989 |
+
}
|
1990 |
+
|
1991 |
+
return get_plugins( $plugin_folder );
|
1992 |
+
}
|
1993 |
+
|
1994 |
+
/**
|
1995 |
+
* Delete dismissable nag option when theme is switched.
|
1996 |
+
*
|
1997 |
+
* This ensures that the user(s) is/are again reminded via nag of required
|
1998 |
+
* and/or recommended plugins if they re-activate the theme.
|
1999 |
+
*
|
2000 |
+
* @since 2.1.1
|
2001 |
+
*/
|
2002 |
+
public function update_dismiss() {
|
2003 |
+
delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true );
|
2004 |
+
}
|
2005 |
+
|
2006 |
+
/**
|
2007 |
+
* Forces plugin activation if the parameter 'force_activation' is
|
2008 |
+
* set to true.
|
2009 |
+
*
|
2010 |
+
* This allows theme authors to specify certain plugins that must be
|
2011 |
+
* active at all times while using the current theme.
|
2012 |
+
*
|
2013 |
+
* Please take special care when using this parameter as it has the
|
2014 |
+
* potential to be harmful if not used correctly. Setting this parameter
|
2015 |
+
* to true will not allow the specified plugin to be deactivated unless
|
2016 |
+
* the user switches themes.
|
2017 |
+
*
|
2018 |
+
* @since 2.2.0
|
2019 |
+
*/
|
2020 |
+
public function force_activation() {
|
2021 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
2022 |
+
if ( true === $plugin['force_activation'] ) {
|
2023 |
+
if ( ! $this->is_plugin_installed( $slug ) ) {
|
2024 |
+
// Oops, plugin isn't there so iterate to next condition.
|
2025 |
+
continue;
|
2026 |
+
} elseif ( $this->can_plugin_activate( $slug ) ) {
|
2027 |
+
// There we go, activate the plugin.
|
2028 |
+
activate_plugin( $plugin['file_path'] );
|
2029 |
+
}
|
2030 |
+
}
|
2031 |
+
}
|
2032 |
+
}
|
2033 |
+
|
2034 |
+
/**
|
2035 |
+
* Forces plugin deactivation if the parameter 'force_deactivation'
|
2036 |
+
* is set to true and adds the plugin to the 'recently active' plugins list.
|
2037 |
+
*
|
2038 |
+
* This allows theme authors to specify certain plugins that must be
|
2039 |
+
* deactivated upon switching from the current theme to another.
|
2040 |
+
*
|
2041 |
+
* Please take special care when using this parameter as it has the
|
2042 |
+
* potential to be harmful if not used correctly.
|
2043 |
+
*
|
2044 |
+
* @since 2.2.0
|
2045 |
+
*/
|
2046 |
+
public function force_deactivation() {
|
2047 |
+
$deactivated = array();
|
2048 |
+
|
2049 |
+
foreach ( $this->plugins as $slug => $plugin ) {
|
2050 |
+
/*
|
2051 |
+
* Only proceed forward if the parameter is set to true and plugin is active
|
2052 |
+
* as a 'normal' (not must-use) plugin.
|
2053 |
+
*/
|
2054 |
+
if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) {
|
2055 |
+
deactivate_plugins( $plugin['file_path'] );
|
2056 |
+
$deactivated[ $plugin['file_path'] ] = time();
|
2057 |
+
}
|
2058 |
+
}
|
2059 |
+
|
2060 |
+
if ( ! empty( $deactivated ) ) {
|
2061 |
+
update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
|
2062 |
+
}
|
2063 |
+
}
|
2064 |
+
|
2065 |
+
/**
|
2066 |
+
* Echo the current TGMPA version number to the page.
|
2067 |
+
*
|
2068 |
+
* @since 2.5.0
|
2069 |
+
*/
|
2070 |
+
public function show_tgmpa_version() {
|
2071 |
+
echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
|
2072 |
+
esc_html(
|
2073 |
+
sprintf(
|
2074 |
+
/* translators: %s: version number */
|
2075 |
+
__( 'TGMPA v%s', 'navmenu-addon-for-elementor' ),
|
2076 |
+
self::TGMPA_VERSION
|
2077 |
+
)
|
2078 |
+
),
|
2079 |
+
'</small></strong></p>';
|
2080 |
+
}
|
2081 |
+
|
2082 |
+
/**
|
2083 |
+
* Returns the singleton instance of the class.
|
2084 |
+
*
|
2085 |
+
* @since 2.4.0
|
2086 |
+
*
|
2087 |
+
* @return \TGM_Plugin_Activation The TGM_Plugin_Activation object.
|
2088 |
+
*/
|
2089 |
+
public static function get_instance() {
|
2090 |
+
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
|
2091 |
+
self::$instance = new self();
|
2092 |
+
}
|
2093 |
+
|
2094 |
+
return self::$instance;
|
2095 |
+
}
|
2096 |
+
}
|
2097 |
+
|
2098 |
+
if ( ! function_exists( 'load_tgm_plugin_activation' ) ) {
|
2099 |
+
/**
|
2100 |
+
* Ensure only one instance of the class is ever invoked.
|
2101 |
+
*
|
2102 |
+
* @since 2.5.0
|
2103 |
+
*/
|
2104 |
+
function load_tgm_plugin_activation() {
|
2105 |
+
$GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance();
|
2106 |
+
}
|
2107 |
+
}
|
2108 |
+
|
2109 |
+
if ( did_action( 'plugins_loaded' ) ) {
|
2110 |
+
load_tgm_plugin_activation();
|
2111 |
+
} else {
|
2112 |
+
add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );
|
2113 |
+
}
|
2114 |
+
}
|
2115 |
+
|
2116 |
+
if ( ! function_exists( 'tgmpa' ) ) {
|
2117 |
+
/**
|
2118 |
+
* Helper function to register a collection of required plugins.
|
2119 |
+
*
|
2120 |
+
* @since 2.0.0
|
2121 |
+
* @api
|
2122 |
+
*
|
2123 |
+
* @param array $plugins An array of plugin arrays.
|
2124 |
+
* @param array $config Optional. An array of configuration values.
|
2125 |
+
*/
|
2126 |
+
function tgmpa( $plugins, $config = array() ) {
|
2127 |
+
$instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
2128 |
+
|
2129 |
+
foreach ( $plugins as $plugin ) {
|
2130 |
+
call_user_func( array( $instance, 'register' ), $plugin );
|
2131 |
+
}
|
2132 |
+
|
2133 |
+
if ( ! empty( $config ) && is_array( $config ) ) {
|
2134 |
+
// Send out notices for deprecated arguments passed.
|
2135 |
+
if ( isset( $config['notices'] ) ) {
|
2136 |
+
_deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' );
|
2137 |
+
if ( ! isset( $config['has_notices'] ) ) {
|
2138 |
+
$config['has_notices'] = $config['notices'];
|
2139 |
+
}
|
2140 |
+
}
|
2141 |
+
|
2142 |
+
if ( isset( $config['parent_menu_slug'] ) ) {
|
2143 |
+
_deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
|
2144 |
+
}
|
2145 |
+
if ( isset( $config['parent_url_slug'] ) ) {
|
2146 |
+
_deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
|
2147 |
+
}
|
2148 |
+
|
2149 |
+
call_user_func( array( $instance, 'config' ), $config );
|
2150 |
+
}
|
2151 |
+
}
|
2152 |
+
}
|
2153 |
+
|
2154 |
+
/**
|
2155 |
+
* WP_List_Table isn't always available. If it isn't available,
|
2156 |
+
* we load it here.
|
2157 |
+
*
|
2158 |
+
* @since 2.2.0
|
2159 |
+
*/
|
2160 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
2161 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
2162 |
+
}
|
2163 |
+
|
2164 |
+
if ( ! class_exists( 'TGMPA_List_Table' ) ) {
|
2165 |
+
|
2166 |
+
/**
|
2167 |
+
* List table class for handling plugins.
|
2168 |
+
*
|
2169 |
+
* Extends the WP_List_Table class to provide a future-compatible
|
2170 |
+
* way of listing out all required/recommended plugins.
|
2171 |
+
*
|
2172 |
+
* Gives users an interface similar to the Plugin Administration
|
2173 |
+
* area with similar (albeit stripped down) capabilities.
|
2174 |
+
*
|
2175 |
+
* This class also allows for the bulk install of plugins.
|
2176 |
+
*
|
2177 |
+
* @since 2.2.0
|
2178 |
+
*
|
2179 |
+
* @package TGM-Plugin-Activation
|
2180 |
+
* @author Thomas Griffin
|
2181 |
+
* @author Gary Jones
|
2182 |
+
*/
|
2183 |
+
class TGMPA_List_Table extends WP_List_Table {
|
2184 |
+
/**
|
2185 |
+
* TGMPA instance.
|
2186 |
+
*
|
2187 |
+
* @since 2.5.0
|
2188 |
+
*
|
2189 |
+
* @var object
|
2190 |
+
*/
|
2191 |
+
protected $tgmpa;
|
2192 |
+
|
2193 |
+
/**
|
2194 |
+
* The currently chosen view.
|
2195 |
+
*
|
2196 |
+
* @since 2.5.0
|
2197 |
+
*
|
2198 |
+
* @var string One of: 'all', 'install', 'update', 'activate'
|
2199 |
+
*/
|
2200 |
+
public $view_context = 'all';
|
2201 |
+
|
2202 |
+
/**
|
2203 |
+
* The plugin counts for the various views.
|
2204 |
+
*
|
2205 |
+
* @since 2.5.0
|
2206 |
+
*
|
2207 |
+
* @var array
|
2208 |
+
*/
|
2209 |
+
protected $view_totals = array(
|
2210 |
+
'all' => 0,
|
2211 |
+
'install' => 0,
|
2212 |
+
'update' => 0,
|
2213 |
+
'activate' => 0,
|
2214 |
+
);
|
2215 |
+
|
2216 |
+
/**
|
2217 |
+
* References parent constructor and sets defaults for class.
|
2218 |
+
*
|
2219 |
+
* @since 2.2.0
|
2220 |
+
*/
|
2221 |
+
public function __construct() {
|
2222 |
+
$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
2223 |
+
|
2224 |
+
parent::__construct(
|
2225 |
+
array(
|
2226 |
+
'singular' => 'plugin',
|
2227 |
+
'plural' => 'plugins',
|
2228 |
+
'ajax' => false,
|
2229 |
+
)
|
2230 |
+
);
|
2231 |
+
|
2232 |
+
if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) {
|
2233 |
+
$this->view_context = sanitize_key( $_REQUEST['plugin_status'] );
|
2234 |
+
}
|
2235 |
+
|
2236 |
+
add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) );
|
2237 |
+
}
|
2238 |
+
|
2239 |
+
/**
|
2240 |
+
* Get a list of CSS classes for the <table> tag.
|
2241 |
+
*
|
2242 |
+
* Overruled to prevent the 'plural' argument from being added.
|
2243 |
+
*
|
2244 |
+
* @since 2.5.0
|
2245 |
+
*
|
2246 |
+
* @return array CSS classnames.
|
2247 |
+
*/
|
2248 |
+
public function get_table_classes() {
|
2249 |
+
return array( 'widefat', 'fixed' );
|
2250 |
+
}
|
2251 |
+
|
2252 |
+
/**
|
2253 |
+
* Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
|
2254 |
+
*
|
2255 |
+
* @since 2.2.0
|
2256 |
+
*
|
2257 |
+
* @return array $table_data Information for use in table.
|
2258 |
+
*/
|
2259 |
+
protected function _gather_plugin_data() {
|
2260 |
+
// Load thickbox for plugin links.
|
2261 |
+
$this->tgmpa->admin_init();
|
2262 |
+
$this->tgmpa->thickbox();
|
2263 |
+
|
2264 |
+
// Categorize the plugins which have open actions.
|
2265 |
+
$plugins = $this->categorize_plugins_to_views();
|
2266 |
+
|
2267 |
+
// Set the counts for the view links.
|
2268 |
+
$this->set_view_totals( $plugins );
|
2269 |
+
|
2270 |
+
// Prep variables for use and grab list of all installed plugins.
|
2271 |
+
$table_data = array();
|
2272 |
+
$i = 0;
|
2273 |
+
|
2274 |
+
// Redirect to the 'all' view if no plugins were found for the selected view context.
|
2275 |
+
if ( empty( $plugins[ $this->view_context ] ) ) {
|
2276 |
+
$this->view_context = 'all';
|
2277 |
+
}
|
2278 |
+
|
2279 |
+
foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {
|
2280 |
+
$table_data[ $i ]['sanitized_plugin'] = $plugin['name'];
|
2281 |
+
$table_data[ $i ]['slug'] = $slug;
|
2282 |
+
$table_data[ $i ]['plugin'] = '<strong>' . $this->tgmpa->get_info_link( $slug ) . '</strong>';
|
2283 |
+
$table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] );
|
2284 |
+
$table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] );
|
2285 |
+
$table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug );
|
2286 |
+
$table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug );
|
2287 |
+
$table_data[ $i ]['minimum_version'] = $plugin['version'];
|
2288 |
+
$table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug );
|
2289 |
+
|
2290 |
+
// Prep the upgrade notice info.
|
2291 |
+
$upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug );
|
2292 |
+
if ( ! empty( $upgrade_notice ) ) {
|
2293 |
+
$table_data[ $i ]['upgrade_notice'] = $upgrade_notice;
|
2294 |
+
|
2295 |
+
add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 );
|
2296 |
+
}
|
2297 |
+
|
2298 |
+
$table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );
|
2299 |
+
|
2300 |
+
$i++;
|
2301 |
+
}
|
2302 |
+
|
2303 |
+
return $table_data;
|
2304 |
+
}
|
2305 |
+
|
2306 |
+
/**
|
2307 |
+
* Categorize the plugins which have open actions into views for the TGMPA page.
|
2308 |
+
*
|
2309 |
+
* @since 2.5.0
|
2310 |
+
*/
|
2311 |
+
protected function categorize_plugins_to_views() {
|
2312 |
+
$plugins = array(
|
2313 |
+
'all' => array(), // Meaning: all plugins which still have open actions.
|
2314 |
+
'install' => array(),
|
2315 |
+
'update' => array(),
|
2316 |
+
'activate' => array(),
|
2317 |
+
);
|
2318 |
+
|
2319 |
+
foreach ( $this->tgmpa->plugins as $slug => $plugin ) {
|
2320 |
+
if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2321 |
+
// No need to display plugins if they are installed, up-to-date and active.
|
2322 |
+
continue;
|
2323 |
+
} else {
|
2324 |
+
$plugins['all'][ $slug ] = $plugin;
|
2325 |
+
|
2326 |
+
if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
|
2327 |
+
$plugins['install'][ $slug ] = $plugin;
|
2328 |
+
} else {
|
2329 |
+
if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2330 |
+
$plugins['update'][ $slug ] = $plugin;
|
2331 |
+
}
|
2332 |
+
|
2333 |
+
if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
|
2334 |
+
$plugins['activate'][ $slug ] = $plugin;
|
2335 |
+
}
|
2336 |
+
}
|
2337 |
+
}
|
2338 |
+
}
|
2339 |
+
|
2340 |
+
return $plugins;
|
2341 |
+
}
|
2342 |
+
|
2343 |
+
/**
|
2344 |
+
* Set the counts for the view links.
|
2345 |
+
*
|
2346 |
+
* @since 2.5.0
|
2347 |
+
*
|
2348 |
+
* @param array $plugins Plugins order by view.
|
2349 |
+
*/
|
2350 |
+
protected function set_view_totals( $plugins ) {
|
2351 |
+
foreach ( $plugins as $type => $list ) {
|
2352 |
+
$this->view_totals[ $type ] = count( $list );
|
2353 |
+
}
|
2354 |
+
}
|
2355 |
+
|
2356 |
+
/**
|
2357 |
+
* Get the plugin required/recommended text string.
|
2358 |
+
*
|
2359 |
+
* @since 2.5.0
|
2360 |
+
*
|
2361 |
+
* @param string $required Plugin required setting.
|
2362 |
+
* @return string
|
2363 |
+
*/
|
2364 |
+
protected function get_plugin_advise_type_text( $required ) {
|
2365 |
+
if ( true === $required ) {
|
2366 |
+
return __( 'Required', 'navmenu-addon-for-elementor' );
|
2367 |
+
}
|
2368 |
+
|
2369 |
+
return __( 'Recommended', 'navmenu-addon-for-elementor' );
|
2370 |
+
}
|
2371 |
+
|
2372 |
+
/**
|
2373 |
+
* Get the plugin source type text string.
|
2374 |
+
*
|
2375 |
+
* @since 2.5.0
|
2376 |
+
*
|
2377 |
+
* @param string $type Plugin type.
|
2378 |
+
* @return string
|
2379 |
+
*/
|
2380 |
+
protected function get_plugin_source_type_text( $type ) {
|
2381 |
+
$string = '';
|
2382 |
+
|
2383 |
+
switch ( $type ) {
|
2384 |
+
case 'repo':
|
2385 |
+
$string = __( 'WordPress Repository', 'navmenu-addon-for-elementor' );
|
2386 |
+
break;
|
2387 |
+
case 'external':
|
2388 |
+
$string = __( 'External Source', 'navmenu-addon-for-elementor' );
|
2389 |
+
break;
|
2390 |
+
case 'bundled':
|
2391 |
+
$string = __( 'Pre-Packaged', 'navmenu-addon-for-elementor' );
|
2392 |
+
break;
|
2393 |
+
}
|
2394 |
+
|
2395 |
+
return $string;
|
2396 |
+
}
|
2397 |
+
|
2398 |
+
/**
|
2399 |
+
* Determine the plugin status message.
|
2400 |
+
*
|
2401 |
+
* @since 2.5.0
|
2402 |
+
*
|
2403 |
+
* @param string $slug Plugin slug.
|
2404 |
+
* @return string
|
2405 |
+
*/
|
2406 |
+
protected function get_plugin_status_text( $slug ) {
|
2407 |
+
if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
|
2408 |
+
return __( 'Not Installed', 'navmenu-addon-for-elementor' );
|
2409 |
+
}
|
2410 |
+
|
2411 |
+
if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
|
2412 |
+
$install_status = __( 'Installed But Not Activated', 'navmenu-addon-for-elementor' );
|
2413 |
+
} else {
|
2414 |
+
$install_status = __( 'Active', 'navmenu-addon-for-elementor' );
|
2415 |
+
}
|
2416 |
+
|
2417 |
+
$update_status = '';
|
2418 |
+
|
2419 |
+
if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2420 |
+
$update_status = __( 'Required Update not Available', 'navmenu-addon-for-elementor' );
|
2421 |
+
|
2422 |
+
} elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
|
2423 |
+
$update_status = __( 'Requires Update', 'navmenu-addon-for-elementor' );
|
2424 |
+
|
2425 |
+
} elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
|
2426 |
+
$update_status = __( 'Update recommended', 'navmenu-addon-for-elementor' );
|
2427 |
+
}
|
2428 |
+
|
2429 |
+
if ( '' === $update_status ) {
|
2430 |
+
return $install_status;
|
2431 |
+
}
|
2432 |
+
|
2433 |
+
return sprintf(
|
2434 |
+
/* translators: 1: install status, 2: update status */
|
2435 |
+
_x( '%1$s, %2$s', 'Install/Update Status', 'navmenu-addon-for-elementor' ),
|
2436 |
+
$install_status,
|
2437 |
+
$update_status
|
2438 |
+
);
|
2439 |
+
}
|
2440 |
+
|
2441 |
+
/**
|
2442 |
+
* Sort plugins by Required/Recommended type and by alphabetical plugin name within each type.
|
2443 |
+
*
|
2444 |
+
* @since 2.5.0
|
2445 |
+
*
|
2446 |
+
* @param array $items Prepared table items.
|
2447 |
+
* @return array Sorted table items.
|
2448 |
+
*/
|
2449 |
+
public function sort_table_items( $items ) {
|
2450 |
+
$type = array();
|
2451 |
+
$name = array();
|
2452 |
+
|
2453 |
+
foreach ( $items as $i => $plugin ) {
|
2454 |
+
$type[ $i ] = $plugin['type']; // Required / recommended.
|
2455 |
+
$name[ $i ] = $plugin['sanitized_plugin'];
|
2456 |
+
}
|
2457 |
+
|
2458 |
+
array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );
|
2459 |
+
|
2460 |
+
return $items;
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
/**
|
2464 |
+
* Get an associative array ( id => link ) of the views available on this table.
|
2465 |
+
*
|
2466 |
+
* @since 2.5.0
|
2467 |
+
*
|
2468 |
+
* @return array
|
2469 |
+
*/
|
2470 |
+
public function get_views() {
|
2471 |
+
$status_links = array();
|
2472 |
+
|
2473 |
+
foreach ( $this->view_totals as $type => $count ) {
|
2474 |
+
if ( $count < 1 ) {
|
2475 |
+
continue;
|
2476 |
+
}
|
2477 |
+
|
2478 |
+
switch ( $type ) {
|
2479 |
+
case 'all':
|
2480 |
+
/* translators: 1: number of plugins. */
|
2481 |
+
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'navmenu-addon-for-elementor' );
|
2482 |
+
break;
|
2483 |
+
case 'install':
|
2484 |
+
/* translators: 1: number of plugins. */
|
2485 |
+
$text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'navmenu-addon-for-elementor' );
|
2486 |
+
break;
|
2487 |
+
case 'update':
|
2488 |
+
/* translators: 1: number of plugins. */
|
2489 |
+
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'navmenu-addon-for-elementor' );
|
2490 |
+
break;
|
2491 |
+
case 'activate':
|
2492 |
+
/* translators: 1: number of plugins. */
|
2493 |
+
$text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'navmenu-addon-for-elementor' );
|
2494 |
+
break;
|
2495 |
+
default:
|
2496 |
+
$text = '';
|
2497 |
+
break;
|
2498 |
+
}
|
2499 |
+
|
2500 |
+
if ( ! empty( $text ) ) {
|
2501 |
+
|
2502 |
+
$status_links[ $type ] = sprintf(
|
2503 |
+
'<a href="%s"%s>%s</a>',
|
2504 |
+
esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ),
|
2505 |
+
( $type === $this->view_context ) ? ' class="current"' : '',
|
2506 |
+
sprintf( $text, number_format_i18n( $count ) )
|
2507 |
+
);
|
2508 |
+
}
|
2509 |
+
}
|
2510 |
+
|
2511 |
+
return $status_links;
|
2512 |
+
}
|
2513 |
+
|
2514 |
+
/**
|
2515 |
+
* Create default columns to display important plugin information
|
2516 |
+
* like type, action and status.
|
2517 |
+
*
|
2518 |
+
* @since 2.2.0
|
2519 |
+
*
|
2520 |
+
* @param array $item Array of item data.
|
2521 |
+
* @param string $column_name The name of the column.
|
2522 |
+
* @return string
|
2523 |
+
*/
|
2524 |
+
public function column_default( $item, $column_name ) {
|
2525 |
+
return $item[ $column_name ];
|
2526 |
+
}
|
2527 |
+
|
2528 |
+
/**
|
2529 |
+
* Required for bulk installing.
|
2530 |
+
*
|
2531 |
+
* Adds a checkbox for each plugin.
|
2532 |
+
*
|
2533 |
+
* @since 2.2.0
|
2534 |
+
*
|
2535 |
+
* @param array $item Array of item data.
|
2536 |
+
* @return string The input checkbox with all necessary info.
|
2537 |
+
*/
|
2538 |
+
public function column_cb( $item ) {
|
2539 |
+
return sprintf(
|
2540 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />',
|
2541 |
+
esc_attr( $this->_args['singular'] ),
|
2542 |
+
esc_attr( $item['slug'] ),
|
2543 |
+
esc_attr( $item['sanitized_plugin'] )
|
2544 |
+
);
|
2545 |
+
}
|
2546 |
+
|
2547 |
+
/**
|
2548 |
+
* Create default title column along with the action links.
|
2549 |
+
*
|
2550 |
+
* @since 2.2.0
|
2551 |
+
*
|
2552 |
+
* @param array $item Array of item data.
|
2553 |
+
* @return string The plugin name and action links.
|
2554 |
+
*/
|
2555 |
+
public function column_plugin( $item ) {
|
2556 |
+
return sprintf(
|
2557 |
+
'%1$s %2$s',
|
2558 |
+
$item['plugin'],
|
2559 |
+
$this->row_actions( $this->get_row_actions( $item ), true )
|
2560 |
+
);
|
2561 |
+
}
|
2562 |
+
|
2563 |
+
/**
|
2564 |
+
* Create version information column.
|
2565 |
+
*
|
2566 |
+
* @since 2.5.0
|
2567 |
+
*
|
2568 |
+
* @param array $item Array of item data.
|
2569 |
+
* @return string HTML-formatted version information.
|
2570 |
+
*/
|
2571 |
+
public function column_version( $item ) {
|
2572 |
+
$output = array();
|
2573 |
+
|
2574 |
+
if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
|
2575 |
+
$installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'navmenu-addon-for-elementor' );
|
2576 |
+
|
2577 |
+
$color = '';
|
2578 |
+
if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {
|
2579 |
+
$color = ' color: #ff0000; font-weight: bold;';
|
2580 |
+
}
|
2581 |
+
|
2582 |
+
$output[] = sprintf(
|
2583 |
+
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'navmenu-addon-for-elementor' ) . '</p>',
|
2584 |
+
$color,
|
2585 |
+
$installed
|
2586 |
+
);
|
2587 |
+
}
|
2588 |
+
|
2589 |
+
if ( ! empty( $item['minimum_version'] ) ) {
|
2590 |
+
$output[] = sprintf(
|
2591 |
+
'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'navmenu-addon-for-elementor' ) . '</p>',
|
2592 |
+
$item['minimum_version']
|
2593 |
+
);
|
2594 |
+
}
|
2595 |
+
|
2596 |
+
if ( ! empty( $item['available_version'] ) ) {
|
2597 |
+
$color = '';
|
2598 |
+
if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) {
|
2599 |
+
$color = ' color: #71C671; font-weight: bold;';
|
2600 |
+
}
|
2601 |
+
|
2602 |
+
$output[] = sprintf(
|
2603 |
+
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'navmenu-addon-for-elementor' ) . '</p>',
|
2604 |
+
$color,
|
2605 |
+
$item['available_version']
|
2606 |
+
);
|
2607 |
+
}
|
2608 |
+
|
2609 |
+
if ( empty( $output ) ) {
|
2610 |
+
return ' '; // Let's not break the table layout.
|
2611 |
+
} else {
|
2612 |
+
return implode( "\n", $output );
|
2613 |
+
}
|
2614 |
+
}
|
2615 |
+
|
2616 |
+
/**
|
2617 |
+
* Sets default message within the plugins table if no plugins
|
2618 |
+
* are left for interaction.
|
2619 |
+
*
|
2620 |
+
* Hides the menu item to prevent the user from clicking and
|
2621 |
+
* getting a permissions error.
|
2622 |
+
*
|
2623 |
+
* @since 2.2.0
|
2624 |
+
*/
|
2625 |
+
public function no_items() {
|
2626 |
+
echo esc_html__( 'No plugins to install, update or activate.', 'navmenu-addon-for-elementor' ) . ' <a href="' . esc_url( self_admin_url() ) . '"> ' . esc_html__( 'Return to the Dashboard', 'navmenu-addon-for-elementor' ) . '</a>';
|
2627 |
+
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
|
2628 |
+
}
|
2629 |
+
|
2630 |
+
/**
|
2631 |
+
* Output all the column information within the table.
|
2632 |
+
*
|
2633 |
+
* @since 2.2.0
|
2634 |
+
*
|
2635 |
+
* @return array $columns The column names.
|
2636 |
+
*/
|
2637 |
+
public function get_columns() {
|
2638 |
+
$columns = array(
|
2639 |
+
'cb' => '<input type="checkbox" />',
|
2640 |
+
'plugin' => __( 'Plugin', 'navmenu-addon-for-elementor' ),
|
2641 |
+
'source' => __( 'Source', 'navmenu-addon-for-elementor' ),
|
2642 |
+
'type' => __( 'Type', 'navmenu-addon-for-elementor' ),
|
2643 |
+
);
|
2644 |
+
|
2645 |
+
if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
|
2646 |
+
$columns['version'] = __( 'Version', 'navmenu-addon-for-elementor' );
|
2647 |
+
$columns['status'] = __( 'Status', 'navmenu-addon-for-elementor' );
|
2648 |
+
}
|
2649 |
+
|
2650 |
+
return apply_filters( 'tgmpa_table_columns', $columns );
|
2651 |
+
}
|
2652 |
+
|
2653 |
+
/**
|
2654 |
+
* Get name of default primary column
|
2655 |
+
*
|
2656 |
+
* @since 2.5.0 / WP 4.3+ compatibility
|
2657 |
+
* @access protected
|
2658 |
+
*
|
2659 |
+
* @return string
|
2660 |
+
*/
|
2661 |
+
protected function get_default_primary_column_name() {
|
2662 |
+
return 'plugin';
|
2663 |
+
}
|
2664 |
+
|
2665 |
+
/**
|
2666 |
+
* Get the name of the primary column.
|
2667 |
+
*
|
2668 |
+
* @since 2.5.0 / WP 4.3+ compatibility
|
2669 |
+
* @access protected
|
2670 |
+
*
|
2671 |
+
* @return string The name of the primary column.
|
2672 |
+
*/
|
2673 |
+
protected function get_primary_column_name() {
|
2674 |
+
if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {
|
2675 |
+
return parent::get_primary_column_name();
|
2676 |
+
} else {
|
2677 |
+
return $this->get_default_primary_column_name();
|
2678 |
+
}
|
2679 |
+
}
|
2680 |
+
|
2681 |
+
/**
|
2682 |
+
* Get the actions which are relevant for a specific plugin row.
|
2683 |
+
*
|
2684 |
+
* @since 2.5.0
|
2685 |
+
*
|
2686 |
+
* @param array $item Array of item data.
|
2687 |
+
* @return array Array with relevant action links.
|
2688 |
+
*/
|
2689 |
+
protected function get_row_actions( $item ) {
|
2690 |
+
$actions = array();
|
2691 |
+
$action_links = array();
|
2692 |
+
|
2693 |
+
// Display the 'Install' action link if the plugin is not yet available.
|
2694 |
+
if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
|
2695 |
+
/* translators: %2$s: plugin name in screen reader markup */
|
2696 |
+
$actions['install'] = __( 'Install %2$s', 'navmenu-addon-for-elementor' );
|
2697 |
+
} else {
|
2698 |
+
// Display the 'Update' action link if an update is available and WP complies with plugin minimum.
|
2699 |
+
if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
|
2700 |
+
/* translators: %2$s: plugin name in screen reader markup */
|
2701 |
+
$actions['update'] = __( 'Update %2$s', 'navmenu-addon-for-elementor' );
|
2702 |
+
}
|
2703 |
+
|
2704 |
+
// Display the 'Activate' action link, but only if the plugin meets the minimum version.
|
2705 |
+
if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
|
2706 |
+
/* translators: %2$s: plugin name in screen reader markup */
|
2707 |
+
$actions['activate'] = __( 'Activate %2$s', 'navmenu-addon-for-elementor' );
|
2708 |
+
}
|
2709 |
+
}
|
2710 |
+
|
2711 |
+
// Create the actual links.
|
2712 |
+
foreach ( $actions as $action => $text ) {
|
2713 |
+
$nonce_url = wp_nonce_url(
|
2714 |
+
add_query_arg(
|
2715 |
+
array(
|
2716 |
+
'plugin' => urlencode( $item['slug'] ),
|
2717 |
+
'tgmpa-' . $action => $action . '-plugin',
|
2718 |
+
),
|
2719 |
+
$this->tgmpa->get_tgmpa_url()
|
2720 |
+
),
|
2721 |
+
'tgmpa-' . $action,
|
2722 |
+
'tgmpa-nonce'
|
2723 |
+
);
|
2724 |
+
|
2725 |
+
$action_links[ $action ] = sprintf(
|
2726 |
+
'<a href="%1$s">' . esc_html( $text ) . '</a>', // $text contains the second placeholder.
|
2727 |
+
esc_url( $nonce_url ),
|
2728 |
+
'<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
|
2729 |
+
);
|
2730 |
+
}
|
2731 |
+
|
2732 |
+
$prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';
|
2733 |
+
return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context );
|
2734 |
+
}
|
2735 |
+
|
2736 |
+
/**
|
2737 |
+
* Generates content for a single row of the table.
|
2738 |
+
*
|
2739 |
+
* @since 2.5.0
|
2740 |
+
*
|
2741 |
+
* @param object $item The current item.
|
2742 |
+
*/
|
2743 |
+
public function single_row( $item ) {
|
2744 |
+
parent::single_row( $item );
|
2745 |
+
|
2746 |
+
/**
|
2747 |
+
* Fires after each specific row in the TGMPA Plugins list table.
|
2748 |
+
*
|
2749 |
+
* The dynamic portion of the hook name, `$item['slug']`, refers to the slug
|
2750 |
+
* for the plugin.
|
2751 |
+
*
|
2752 |
+
* @since 2.5.0
|
2753 |
+
*/
|
2754 |
+
do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context );
|
2755 |
+
}
|
2756 |
+
|
2757 |
+
/**
|
2758 |
+
* Show the upgrade notice below a plugin row if there is one.
|
2759 |
+
*
|
2760 |
+
* @since 2.5.0
|
2761 |
+
*
|
2762 |
+
* @see /wp-admin/includes/update.php
|
2763 |
+
*
|
2764 |
+
* @param string $slug Plugin slug.
|
2765 |
+
* @param array $item The information available in this table row.
|
2766 |
+
* @return null Return early if upgrade notice is empty.
|
2767 |
+
*/
|
2768 |
+
public function wp_plugin_update_row( $slug, $item ) {
|
2769 |
+
if ( empty( $item['upgrade_notice'] ) ) {
|
2770 |
+
return;
|
2771 |
+
}
|
2772 |
+
|
2773 |
+
echo '
|
2774 |
+
<tr class="plugin-update-tr">
|
2775 |
+
<td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
|
2776 |
+
<div class="update-message">',
|
2777 |
+
esc_html__( 'Upgrade message from the plugin author:', 'navmenu-addon-for-elementor' ),
|
2778 |
+
' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
|
2779 |
+
</div>
|
2780 |
+
</td>
|
2781 |
+
</tr>';
|
2782 |
+
}
|
2783 |
+
|
2784 |
+
/**
|
2785 |
+
* Extra controls to be displayed between bulk actions and pagination.
|
2786 |
+
*
|
2787 |
+
* @since 2.5.0
|
2788 |
+
*
|
2789 |
+
* @param string $which 'top' or 'bottom' table navigation.
|
2790 |
+
*/
|
2791 |
+
public function extra_tablenav( $which ) {
|
2792 |
+
if ( 'bottom' === $which ) {
|
2793 |
+
$this->tgmpa->show_tgmpa_version();
|
2794 |
+
}
|
2795 |
+
}
|
2796 |
+
|
2797 |
+
/**
|
2798 |
+
* Defines the bulk actions for handling registered plugins.
|
2799 |
+
*
|
2800 |
+
* @since 2.2.0
|
2801 |
+
*
|
2802 |
+
* @return array $actions The bulk actions for the plugin install table.
|
2803 |
+
*/
|
2804 |
+
public function get_bulk_actions() {
|
2805 |
+
|
2806 |
+
$actions = array();
|
2807 |
+
|
2808 |
+
if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
|
2809 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
2810 |
+
$actions['tgmpa-bulk-install'] = __( 'Install', 'navmenu-addon-for-elementor' );
|
2811 |
+
}
|
2812 |
+
}
|
2813 |
+
|
2814 |
+
if ( 'install' !== $this->view_context ) {
|
2815 |
+
if ( current_user_can( 'update_plugins' ) ) {
|
2816 |
+
$actions['tgmpa-bulk-update'] = __( 'Update', 'navmenu-addon-for-elementor' );
|
2817 |
+
}
|
2818 |
+
if ( current_user_can( 'activate_plugins' ) ) {
|
2819 |
+
$actions['tgmpa-bulk-activate'] = __( 'Activate', 'navmenu-addon-for-elementor' );
|
2820 |
+
}
|
2821 |
+
}
|
2822 |
+
|
2823 |
+
return $actions;
|
2824 |
+
}
|
2825 |
+
|
2826 |
+
/**
|
2827 |
+
* Processes bulk installation and activation actions.
|
2828 |
+
*
|
2829 |
+
* The bulk installation process looks for the $_POST information and passes that
|
2830 |
+
* through if a user has to use WP_Filesystem to enter their credentials.
|
2831 |
+
*
|
2832 |
+
* @since 2.2.0
|
2833 |
+
*/
|
2834 |
+
public function process_bulk_actions() {
|
2835 |
+
// Bulk installation process.
|
2836 |
+
if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) {
|
2837 |
+
|
2838 |
+
check_admin_referer( 'bulk-' . $this->_args['plural'] );
|
2839 |
+
|
2840 |
+
$install_type = 'install';
|
2841 |
+
if ( 'tgmpa-bulk-update' === $this->current_action() ) {
|
2842 |
+
$install_type = 'update';
|
2843 |
+
}
|
2844 |
+
|
2845 |
+
$plugins_to_install = array();
|
2846 |
+
|
2847 |
+
// Did user actually select any plugins to install/update ?
|
2848 |
+
if ( empty( $_POST['plugin'] ) ) {
|
2849 |
+
if ( 'install' === $install_type ) {
|
2850 |
+
$message = __( 'No plugins were selected to be installed. No action taken.', 'navmenu-addon-for-elementor' );
|
2851 |
+
} else {
|
2852 |
+
$message = __( 'No plugins were selected to be updated. No action taken.', 'navmenu-addon-for-elementor' );
|
2853 |
+
}
|
2854 |
+
|
2855 |
+
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
|
2856 |
+
|
2857 |
+
return false;
|
2858 |
+
}
|
2859 |
+
|
2860 |
+
if ( is_array( $_POST['plugin'] ) ) {
|
2861 |
+
$plugins_to_install = (array) $_POST['plugin'];
|
2862 |
+
} elseif ( is_string( $_POST['plugin'] ) ) {
|
2863 |
+
// Received via Filesystem page - un-flatten array (WP bug #19643).
|
2864 |
+
$plugins_to_install = explode( ',', $_POST['plugin'] );
|
2865 |
+
}
|
2866 |
+
|
2867 |
+
// Sanitize the received input.
|
2868 |
+
$plugins_to_install = array_map( 'urldecode', $plugins_to_install );
|
2869 |
+
$plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install );
|
2870 |
+
|
2871 |
+
// Validate the received input.
|
2872 |
+
foreach ( $plugins_to_install as $key => $slug ) {
|
2873 |
+
// Check if the plugin was registered with TGMPA and remove if not.
|
2874 |
+
if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) {
|
2875 |
+
unset( $plugins_to_install[ $key ] );
|
2876 |
+
continue;
|
2877 |
+
}
|
2878 |
+
|
2879 |
+
// For install: make sure this is a plugin we *can* install and not one already installed.
|
2880 |
+
if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) {
|
2881 |
+
unset( $plugins_to_install[ $key ] );
|
2882 |
+
}
|
2883 |
+
|
2884 |
+
// For updates: make sure this is a plugin we *can* update (update available and WP version ok).
|
2885 |
+
if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) {
|
2886 |
+
unset( $plugins_to_install[ $key ] );
|
2887 |
+
}
|
2888 |
+
}
|
2889 |
+
|
2890 |
+
// No need to proceed further if we have no plugins to handle.
|
2891 |
+
if ( empty( $plugins_to_install ) ) {
|
2892 |
+
if ( 'install' === $install_type ) {
|
2893 |
+
$message = __( 'No plugins are available to be installed at this time.', 'navmenu-addon-for-elementor' );
|
2894 |
+
} else {
|
2895 |
+
$message = __( 'No plugins are available to be updated at this time.', 'navmenu-addon-for-elementor' );
|
2896 |
+
}
|
2897 |
+
|
2898 |
+
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
|
2899 |
+
|
2900 |
+
return false;
|
2901 |
+
}
|
2902 |
+
|
2903 |
+
// Pass all necessary information if WP_Filesystem is needed.
|
2904 |
+
$url = wp_nonce_url(
|
2905 |
+
$this->tgmpa->get_tgmpa_url(),
|
2906 |
+
'bulk-' . $this->_args['plural']
|
2907 |
+
);
|
2908 |
+
|
2909 |
+
// Give validated data back to $_POST which is the only place the filesystem looks for extra fields.
|
2910 |
+
$_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.
|
2911 |
+
|
2912 |
+
$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
|
2913 |
+
$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
|
2914 |
+
|
2915 |
+
if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
|
2916 |
+
return true; // Stop the normal page form from displaying, credential request form will be shown.
|
2917 |
+
}
|
2918 |
+
|
2919 |
+
// Now we have some credentials, setup WP_Filesystem.
|
2920 |
+
if ( ! WP_Filesystem( $creds ) ) {
|
2921 |
+
// Our credentials were no good, ask the user for them again.
|
2922 |
+
request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
|
2923 |
+
|
2924 |
+
return true;
|
2925 |
+
}
|
2926 |
+
|
2927 |
+
/* If we arrive here, we have the filesystem */
|
2928 |
+
|
2929 |
+
// Store all information in arrays since we are processing a bulk installation.
|
2930 |
+
$names = array();
|
2931 |
+
$sources = array(); // Needed for installs.
|
2932 |
+
$file_paths = array(); // Needed for upgrades.
|
2933 |
+
$to_inject = array(); // Information to inject into the update_plugins transient.
|
2934 |
+
|
2935 |
+
// Prepare the data for validated plugins for the install/upgrade.
|
2936 |
+
foreach ( $plugins_to_install as $slug ) {
|
2937 |
+
$name = $this->tgmpa->plugins[ $slug ]['name'];
|
2938 |
+
$source = $this->tgmpa->get_download_url( $slug );
|
2939 |
+
|
2940 |
+
if ( ! empty( $name ) && ! empty( $source ) ) {
|
2941 |
+
$names[] = $name;
|
2942 |
+
|
2943 |
+
switch ( $install_type ) {
|
2944 |
+
|
2945 |
+
case 'install':
|
2946 |
+
$sources[] = $source;
|
2947 |
+
break;
|
2948 |
+
|
2949 |
+
case 'update':
|
2950 |
+
$file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path'];
|
2951 |
+
$to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ];
|
2952 |
+
$to_inject[ $slug ]['source'] = $source;
|
2953 |
+
break;
|
2954 |
+
}
|
2955 |
+
}
|
2956 |
+
}
|
2957 |
+
unset( $slug, $name, $source );
|
2958 |
+
|
2959 |
+
// Create a new instance of TGMPA_Bulk_Installer.
|
2960 |
+
$installer = new TGMPA_Bulk_Installer(
|
2961 |
+
new TGMPA_Bulk_Installer_Skin(
|
2962 |
+
array(
|
2963 |
+
'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ),
|
2964 |
+
'nonce' => 'bulk-' . $this->_args['plural'],
|
2965 |
+
'names' => $names,
|
2966 |
+
'install_type' => $install_type,
|
2967 |
+
)
|
2968 |
+
)
|
2969 |
+
);
|
2970 |
+
|
2971 |
+
// Wrap the install process with the appropriate HTML.
|
2972 |
+
echo '<div class="tgmpa">',
|
2973 |
+
'<h2 style="font-size: 23px; font-weight: 400; line-height: 29px; margin: 0; padding: 9px 15px 4px 0;">', esc_html( get_admin_page_title() ), '</h2>
|
2974 |
+
<div class="update-php" style="width: 100%; height: 98%; min-height: 850px; padding-top: 1px;">';
|
2975 |
+
|
2976 |
+
// Process the bulk installation submissions.
|
2977 |
+
add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
|
2978 |
+
|
2979 |
+
if ( 'tgmpa-bulk-update' === $this->current_action() ) {
|
2980 |
+
// Inject our info into the update transient.
|
2981 |
+
$this->tgmpa->inject_update_info( $to_inject );
|
2982 |
+
|
2983 |
+
$installer->bulk_upgrade( $file_paths );
|
2984 |
+
} else {
|
2985 |
+
$installer->bulk_install( $sources );
|
2986 |
+
}
|
2987 |
+
|
2988 |
+
remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 );
|
2989 |
+
|
2990 |
+
echo '</div></div>';
|
2991 |
+
|
2992 |
+
return true;
|
2993 |
+
}
|
2994 |
+
|
2995 |
+
// Bulk activation process.
|
2996 |
+
if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
|
2997 |
+
check_admin_referer( 'bulk-' . $this->_args['plural'] );
|
2998 |
+
|
2999 |
+
// Did user actually select any plugins to activate ?
|
3000 |
+
if ( empty( $_POST['plugin'] ) ) {
|
3001 |
+
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'navmenu-addon-for-elementor' ), '</p></div>';
|
3002 |
+
|
3003 |
+
return false;
|
3004 |
+
}
|
3005 |
+
|
3006 |
+
// Grab plugin data from $_POST.
|
3007 |
+
$plugins = array();
|
3008 |
+
if ( isset( $_POST['plugin'] ) ) {
|
3009 |
+
$plugins = array_map( 'urldecode', (array) $_POST['plugin'] );
|
3010 |
+
$plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins );
|
3011 |
+
}
|
3012 |
+
|
3013 |
+
$plugins_to_activate = array();
|
3014 |
+
$plugin_names = array();
|
3015 |
+
|
3016 |
+
// Grab the file paths for the selected & inactive plugins from the registration array.
|
3017 |
+
foreach ( $plugins as $slug ) {
|
3018 |
+
if ( $this->tgmpa->can_plugin_activate( $slug ) ) {
|
3019 |
+
$plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path'];
|
3020 |
+
$plugin_names[] = $this->tgmpa->plugins[ $slug ]['name'];
|
3021 |
+
}
|
3022 |
+
}
|
3023 |
+
unset( $slug );
|
3024 |
+
|
3025 |
+
// Return early if there are no plugins to activate.
|
3026 |
+
if ( empty( $plugins_to_activate ) ) {
|
3027 |
+
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'navmenu-addon-for-elementor' ), '</p></div>';
|
3028 |
+
|
3029 |
+
return false;
|
3030 |
+
}
|
3031 |
+
|
3032 |
+
// Now we are good to go - let's start activating plugins.
|
3033 |
+
$activate = activate_plugins( $plugins_to_activate );
|
3034 |
+
|
3035 |
+
if ( is_wp_error( $activate ) ) {
|
3036 |
+
echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
|
3037 |
+
} else {
|
3038 |
+
$count = count( $plugin_names ); // Count so we can use _n function.
|
3039 |
+
$plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
|
3040 |
+
$last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability.
|
3041 |
+
$imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'navmenu-addon-for-elementor' ) . ' ' . $last_plugin );
|
3042 |
+
|
3043 |
+
printf( // WPCS: xss ok.
|
3044 |
+
'<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
|
3045 |
+
esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'navmenu-addon-for-elementor' ) ),
|
3046 |
+
$imploded
|
3047 |
+
);
|
3048 |
+
|
3049 |
+
// Update recently activated plugins option.
|
3050 |
+
$recent = (array) get_option( 'recently_activated' );
|
3051 |
+
foreach ( $plugins_to_activate as $plugin => $time ) {
|
3052 |
+
if ( isset( $recent[ $plugin ] ) ) {
|
3053 |
+
unset( $recent[ $plugin ] );
|
3054 |
+
}
|
3055 |
+
}
|
3056 |
+
update_option( 'recently_activated', $recent );
|
3057 |
+
}
|
3058 |
+
|
3059 |
+
unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.
|
3060 |
+
|
3061 |
+
return true;
|
3062 |
+
}
|
3063 |
+
|
3064 |
+
return false;
|
3065 |
+
}
|
3066 |
+
|
3067 |
+
/**
|
3068 |
+
* Prepares all of our information to be outputted into a usable table.
|
3069 |
+
*
|
3070 |
+
* @since 2.2.0
|
3071 |
+
*/
|
3072 |
+
public function prepare_items() {
|
3073 |
+
$columns = $this->get_columns(); // Get all necessary column information.
|
3074 |
+
$hidden = array(); // No columns to hide, but we must set as an array.
|
3075 |
+
$sortable = array(); // No reason to make sortable columns.
|
3076 |
+
$primary = $this->get_primary_column_name(); // Column which has the row actions.
|
3077 |
+
$this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers.
|
3078 |
+
|
3079 |
+
// Process our bulk activations here.
|
3080 |
+
if ( 'tgmpa-bulk-activate' === $this->current_action() ) {
|
3081 |
+
$this->process_bulk_actions();
|
3082 |
+
}
|
3083 |
+
|
3084 |
+
// Store all of our plugin data into $items array so WP_List_Table can use it.
|
3085 |
+
$this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() );
|
3086 |
+
}
|
3087 |
+
|
3088 |
+
/* *********** DEPRECATED METHODS *********** */
|
3089 |
+
|
3090 |
+
/**
|
3091 |
+
* Retrieve plugin data, given the plugin name.
|
3092 |
+
*
|
3093 |
+
* @since 2.2.0
|
3094 |
+
* @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead.
|
3095 |
+
* @see TGM_Plugin_Activation::_get_plugin_data_from_name()
|
3096 |
+
*
|
3097 |
+
* @param string $name Name of the plugin, as it was registered.
|
3098 |
+
* @param string $data Optional. Array key of plugin data to return. Default is slug.
|
3099 |
+
* @return string|boolean Plugin slug if found, false otherwise.
|
3100 |
+
*/
|
3101 |
+
protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
|
3102 |
+
_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' );
|
3103 |
+
|
3104 |
+
return $this->tgmpa->_get_plugin_data_from_name( $name, $data );
|
3105 |
+
}
|
3106 |
+
}
|
3107 |
+
}
|
3108 |
+
|
3109 |
+
|
3110 |
+
if ( ! class_exists( 'TGM_Bulk_Installer' ) ) {
|
3111 |
+
|
3112 |
+
/**
|
3113 |
+
* Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.
|
3114 |
+
*
|
3115 |
+
* @since 2.5.2
|
3116 |
+
*
|
3117 |
+
* {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer.
|
3118 |
+
* For more information, see that class.}}
|
3119 |
+
*/
|
3120 |
+
class TGM_Bulk_Installer {
|
3121 |
+
}
|
3122 |
+
}
|
3123 |
+
if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) {
|
3124 |
+
|
3125 |
+
/**
|
3126 |
+
* Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.
|
3127 |
+
*
|
3128 |
+
* @since 2.5.2
|
3129 |
+
*
|
3130 |
+
* {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin.
|
3131 |
+
* For more information, see that class.}}
|
3132 |
+
*/
|
3133 |
+
class TGM_Bulk_Installer_Skin {
|
3134 |
+
}
|
3135 |
+
}
|
3136 |
+
|
3137 |
+
/**
|
3138 |
+
* The WP_Upgrader file isn't always available. If it isn't available,
|
3139 |
+
* we load it here.
|
3140 |
+
*
|
3141 |
+
* We check to make sure no action or activation keys are set so that WordPress
|
3142 |
+
* does not try to re-include the class when processing upgrades or installs outside
|
3143 |
+
* of the class.
|
3144 |
+
*
|
3145 |
+
* @since 2.2.0
|
3146 |
+
*/
|
3147 |
+
add_action( 'admin_init', 'tgmpa_load_bulk_installer' );
|
3148 |
+
if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
|
3149 |
+
/**
|
3150 |
+
* Load bulk installer
|
3151 |
+
*/
|
3152 |
+
function tgmpa_load_bulk_installer() {
|
3153 |
+
// Silently fail if 2.5+ is loaded *after* an older version.
|
3154 |
+
if ( ! isset( $GLOBALS['tgmpa'] ) ) {
|
3155 |
+
return;
|
3156 |
+
}
|
3157 |
+
|
3158 |
+
// Get TGMPA class instance.
|
3159 |
+
$tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
3160 |
+
|
3161 |
+
if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) {
|
3162 |
+
if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
|
3163 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
3164 |
+
}
|
3165 |
+
|
3166 |
+
if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) {
|
3167 |
+
|
3168 |
+
/**
|
3169 |
+
* Installer class to handle bulk plugin installations.
|
3170 |
+
*
|
3171 |
+
* Extends WP_Upgrader and customizes to suit the installation of multiple
|
3172 |
+
* plugins.
|
3173 |
+
*
|
3174 |
+
* @since 2.2.0
|
3175 |
+
*
|
3176 |
+
* {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}}
|
3177 |
+
* {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer.
|
3178 |
+
* This was done to prevent backward compatibility issues with v2.3.6.}}
|
3179 |
+
*
|
3180 |
+
* @package TGM-Plugin-Activation
|
3181 |
+
* @author Thomas Griffin
|
3182 |
+
* @author Gary Jones
|
3183 |
+
*/
|
3184 |
+
class TGMPA_Bulk_Installer extends Plugin_Upgrader {
|
3185 |
+
/**
|
3186 |
+
* Holds result of bulk plugin installation.
|
3187 |
+
*
|
3188 |
+
* @since 2.2.0
|
3189 |
+
*
|
3190 |
+
* @var string
|
3191 |
+
*/
|
3192 |
+
public $result;
|
3193 |
+
|
3194 |
+
/**
|
3195 |
+
* Flag to check if bulk installation is occurring or not.
|
3196 |
+
*
|
3197 |
+
* @since 2.2.0
|
3198 |
+
*
|
3199 |
+
* @var boolean
|
3200 |
+
*/
|
3201 |
+
public $bulk = false;
|
3202 |
+
|
3203 |
+
/**
|
3204 |
+
* TGMPA instance
|
3205 |
+
*
|
3206 |
+
* @since 2.5.0
|
3207 |
+
*
|
3208 |
+
* @var object
|
3209 |
+
*/
|
3210 |
+
protected $tgmpa;
|
3211 |
+
|
3212 |
+
/**
|
3213 |
+
* Whether or not the destination directory needs to be cleared ( = on update).
|
3214 |
+
*
|
3215 |
+
* @since 2.5.0
|
3216 |
+
*
|
3217 |
+
* @var bool
|
3218 |
+
*/
|
3219 |
+
protected $clear_destination = false;
|
3220 |
+
|
3221 |
+
/**
|
3222 |
+
* References parent constructor and sets defaults for class.
|
3223 |
+
*
|
3224 |
+
* @since 2.2.0
|
3225 |
+
*
|
3226 |
+
* @param \Bulk_Upgrader_Skin|null $skin Installer skin.
|
3227 |
+
*/
|
3228 |
+
public function __construct( $skin = null ) {
|
3229 |
+
// Get TGMPA class instance.
|
3230 |
+
$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
3231 |
+
|
3232 |
+
parent::__construct( $skin );
|
3233 |
+
|
3234 |
+
if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {
|
3235 |
+
$this->clear_destination = true;
|
3236 |
+
}
|
3237 |
+
|
3238 |
+
if ( $this->tgmpa->is_automatic ) {
|
3239 |
+
$this->activate_strings();
|
3240 |
+
}
|
3241 |
+
|
3242 |
+
add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) );
|
3243 |
+
}
|
3244 |
+
|
3245 |
+
/**
|
3246 |
+
* Sets the correct activation strings for the installer skin to use.
|
3247 |
+
*
|
3248 |
+
* @since 2.2.0
|
3249 |
+
*/
|
3250 |
+
public function activate_strings() {
|
3251 |
+
$this->strings['activation_failed'] = __( 'Plugin activation failed.', 'navmenu-addon-for-elementor' );
|
3252 |
+
$this->strings['activation_success'] = __( 'Plugin activated successfully.', 'navmenu-addon-for-elementor' );
|
3253 |
+
}
|
3254 |
+
|
3255 |
+
/**
|
3256 |
+
* Performs the actual installation of each plugin.
|
3257 |
+
*
|
3258 |
+
* @since 2.2.0
|
3259 |
+
*
|
3260 |
+
* @see WP_Upgrader::run()
|
3261 |
+
*
|
3262 |
+
* @param array $options The installation config options.
|
3263 |
+
* @return null|array Return early if error, array of installation data on success.
|
3264 |
+
*/
|
3265 |
+
public function run( $options ) {
|
3266 |
+
$result = parent::run( $options );
|
3267 |
+
|
3268 |
+
// Reset the strings in case we changed one during automatic activation.
|
3269 |
+
if ( $this->tgmpa->is_automatic ) {
|
3270 |
+
if ( 'update' === $this->skin->options['install_type'] ) {
|
3271 |
+
$this->upgrade_strings();
|
3272 |
+
} else {
|
3273 |
+
$this->install_strings();
|
3274 |
+
}
|
3275 |
+
}
|
3276 |
+
|
3277 |
+
return $result;
|
3278 |
+
}
|
3279 |
+
|
3280 |
+
/**
|
3281 |
+
* Processes the bulk installation of plugins.
|
3282 |
+
*
|
3283 |
+
* @since 2.2.0
|
3284 |
+
*
|
3285 |
+
* {@internal This is basically a near identical copy of the WP Core
|
3286 |
+
* Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with
|
3287 |
+
* new installs instead of upgrades.
|
3288 |
+
* For ease of future synchronizations, the adjustments are clearly commented, but no other
|
3289 |
+
* comments are added. Code style has been made to comply.}}
|
3290 |
+
*
|
3291 |
+
* @see Plugin_Upgrader::bulk_upgrade()
|
3292 |
+
* @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838
|
3293 |
+
* (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}}
|
3294 |
+
*
|
3295 |
+
* @param array $plugins The plugin sources needed for installation.
|
3296 |
+
* @param array $args Arbitrary passed extra arguments.
|
3297 |
+
* @return array|false Install confirmation messages on success, false on failure.
|
3298 |
+
*/
|
3299 |
+
public function bulk_install( $plugins, $args = array() ) {
|
3300 |
+
// [TGMPA + ] Hook auto-activation in.
|
3301 |
+
add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3302 |
+
|
3303 |
+
$defaults = array(
|
3304 |
+
'clear_update_cache' => true,
|
3305 |
+
);
|
3306 |
+
$parsed_args = wp_parse_args( $args, $defaults );
|
3307 |
+
|
3308 |
+
$this->init();
|
3309 |
+
$this->bulk = true;
|
3310 |
+
|
3311 |
+
$this->install_strings(); // [TGMPA + ] adjusted.
|
3312 |
+
|
3313 |
+
/* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */
|
3314 |
+
|
3315 |
+
/* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */
|
3316 |
+
|
3317 |
+
$this->skin->header();
|
3318 |
+
|
3319 |
+
// Connect to the Filesystem first.
|
3320 |
+
$res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
|
3321 |
+
if ( ! $res ) {
|
3322 |
+
$this->skin->footer();
|
3323 |
+
return false;
|
3324 |
+
}
|
3325 |
+
|
3326 |
+
$this->skin->bulk_header();
|
3327 |
+
|
3328 |
+
/*
|
3329 |
+
* Only start maintenance mode if:
|
3330 |
+
* - running Multisite and there are one or more plugins specified, OR
|
3331 |
+
* - a plugin with an update available is currently active.
|
3332 |
+
* @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
|
3333 |
+
*/
|
3334 |
+
$maintenance = ( is_multisite() && ! empty( $plugins ) );
|
3335 |
+
|
3336 |
+
/*
|
3337 |
+
[TGMPA - ]
|
3338 |
+
foreach ( $plugins as $plugin )
|
3339 |
+
$maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
|
3340 |
+
*/
|
3341 |
+
if ( $maintenance ) {
|
3342 |
+
$this->maintenance_mode( true );
|
3343 |
+
}
|
3344 |
+
|
3345 |
+
$results = array();
|
3346 |
+
|
3347 |
+
$this->update_count = count( $plugins );
|
3348 |
+
$this->update_current = 0;
|
3349 |
+
foreach ( $plugins as $plugin ) {
|
3350 |
+
$this->update_current++;
|
3351 |
+
|
3352 |
+
/*
|
3353 |
+
[TGMPA - ]
|
3354 |
+
$this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
|
3355 |
+
|
3356 |
+
if ( !isset( $current->response[ $plugin ] ) ) {
|
3357 |
+
$this->skin->set_result('up_to_date');
|
3358 |
+
$this->skin->before();
|
3359 |
+
$this->skin->feedback('up_to_date');
|
3360 |
+
$this->skin->after();
|
3361 |
+
$results[$plugin] = true;
|
3362 |
+
continue;
|
3363 |
+
}
|
3364 |
+
|
3365 |
+
// Get the URL to the zip file.
|
3366 |
+
$r = $current->response[ $plugin ];
|
3367 |
+
|
3368 |
+
$this->skin->plugin_active = is_plugin_active($plugin);
|
3369 |
+
*/
|
3370 |
+
|
3371 |
+
$result = $this->run(
|
3372 |
+
array(
|
3373 |
+
'package' => $plugin, // [TGMPA + ] adjusted.
|
3374 |
+
'destination' => WP_PLUGIN_DIR,
|
3375 |
+
'clear_destination' => false, // [TGMPA + ] adjusted.
|
3376 |
+
'clear_working' => true,
|
3377 |
+
'is_multi' => true,
|
3378 |
+
'hook_extra' => array(
|
3379 |
+
'plugin' => $plugin,
|
3380 |
+
),
|
3381 |
+
)
|
3382 |
+
);
|
3383 |
+
|
3384 |
+
$results[ $plugin ] = $this->result;
|
3385 |
+
|
3386 |
+
// Prevent credentials auth screen from displaying multiple times.
|
3387 |
+
if ( false === $result ) {
|
3388 |
+
break;
|
3389 |
+
}
|
3390 |
+
} //end foreach $plugins
|
3391 |
+
|
3392 |
+
$this->maintenance_mode( false );
|
3393 |
+
|
3394 |
+
/**
|
3395 |
+
* Fires when the bulk upgrader process is complete.
|
3396 |
+
*
|
3397 |
+
* @since WP 3.6.0 / TGMPA 2.5.0
|
3398 |
+
*
|
3399 |
+
* @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
|
3400 |
+
* be a Theme_Upgrader or Core_Upgrade instance.
|
3401 |
+
* @param array $data {
|
3402 |
+
* Array of bulk item update data.
|
3403 |
+
*
|
3404 |
+
* @type string $action Type of action. Default 'update'.
|
3405 |
+
* @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
|
3406 |
+
* @type bool $bulk Whether the update process is a bulk update. Default true.
|
3407 |
+
* @type array $packages Array of plugin, theme, or core packages to update.
|
3408 |
+
* }
|
3409 |
+
*/
|
3410 |
+
do_action(
|
3411 |
+
'upgrader_process_complete', $this, array(
|
3412 |
+
'action' => 'install', // [TGMPA + ] adjusted.
|
3413 |
+
'type' => 'plugin',
|
3414 |
+
'bulk' => true,
|
3415 |
+
'plugins' => $plugins,
|
3416 |
+
)
|
3417 |
+
);
|
3418 |
+
|
3419 |
+
$this->skin->bulk_footer();
|
3420 |
+
|
3421 |
+
$this->skin->footer();
|
3422 |
+
|
3423 |
+
// Cleanup our hooks, in case something else does a upgrade on this connection.
|
3424 |
+
/* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */
|
3425 |
+
|
3426 |
+
// [TGMPA + ] Remove our auto-activation hook.
|
3427 |
+
remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3428 |
+
|
3429 |
+
// Force refresh of plugin update information.
|
3430 |
+
wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
|
3431 |
+
|
3432 |
+
return $results;
|
3433 |
+
}
|
3434 |
+
|
3435 |
+
/**
|
3436 |
+
* Handle a bulk upgrade request.
|
3437 |
+
*
|
3438 |
+
* @since 2.5.0
|
3439 |
+
*
|
3440 |
+
* @see Plugin_Upgrader::bulk_upgrade()
|
3441 |
+
*
|
3442 |
+
* @param array $plugins The local WP file_path's of the plugins which should be upgraded.
|
3443 |
+
* @param array $args Arbitrary passed extra arguments.
|
3444 |
+
* @return string|bool Install confirmation messages on success, false on failure.
|
3445 |
+
*/
|
3446 |
+
public function bulk_upgrade( $plugins, $args = array() ) {
|
3447 |
+
|
3448 |
+
add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3449 |
+
|
3450 |
+
$result = parent::bulk_upgrade( $plugins, $args );
|
3451 |
+
|
3452 |
+
remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
|
3453 |
+
|
3454 |
+
return $result;
|
3455 |
+
}
|
3456 |
+
|
3457 |
+
/**
|
3458 |
+
* Abuse a filter to auto-activate plugins after installation.
|
3459 |
+
*
|
3460 |
+
* Hooked into the 'upgrader_post_install' filter hook.
|
3461 |
+
*
|
3462 |
+
* @since 2.5.0
|
3463 |
+
*
|
3464 |
+
* @param bool $bool The value we need to give back (true).
|
3465 |
+
* @return bool
|
3466 |
+
*/
|
3467 |
+
public function auto_activate( $bool ) {
|
3468 |
+
// Only process the activation of installed plugins if the automatic flag is set to true.
|
3469 |
+
if ( $this->tgmpa->is_automatic ) {
|
3470 |
+
// Flush plugins cache so the headers of the newly installed plugins will be read correctly.
|
3471 |
+
wp_clean_plugins_cache();
|
3472 |
+
|
3473 |
+
// Get the installed plugin file.
|
3474 |
+
$plugin_info = $this->plugin_info();
|
3475 |
+
|
3476 |
+
// Don't try to activate on upgrade of active plugin as WP will do this already.
|
3477 |
+
if ( ! is_plugin_active( $plugin_info ) ) {
|
3478 |
+
$activate = activate_plugin( $plugin_info );
|
3479 |
+
|
3480 |
+
// Adjust the success string based on the activation result.
|
3481 |
+
$this->strings['process_success'] = $this->strings['process_success'] . "<br />\n";
|
3482 |
+
|
3483 |
+
if ( is_wp_error( $activate ) ) {
|
3484 |
+
$this->skin->error( $activate );
|
3485 |
+
$this->strings['process_success'] .= $this->strings['activation_failed'];
|
3486 |
+
} else {
|
3487 |
+
$this->strings['process_success'] .= $this->strings['activation_success'];
|
3488 |
+
}
|
3489 |
+
}
|
3490 |
+
}
|
3491 |
+
|
3492 |
+
return $bool;
|
3493 |
+
}
|
3494 |
+
}
|
3495 |
+
}
|
3496 |
+
|
3497 |
+
if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) {
|
3498 |
+
|
3499 |
+
/**
|
3500 |
+
* Installer skin to set strings for the bulk plugin installations..
|
3501 |
+
*
|
3502 |
+
* Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple
|
3503 |
+
* plugins.
|
3504 |
+
*
|
3505 |
+
* @since 2.2.0
|
3506 |
+
*
|
3507 |
+
* {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to
|
3508 |
+
* TGMPA_Bulk_Installer_Skin.
|
3509 |
+
* This was done to prevent backward compatibility issues with v2.3.6.}}
|
3510 |
+
*
|
3511 |
+
* @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
|
3512 |
+
*
|
3513 |
+
* @package TGM-Plugin-Activation
|
3514 |
+
* @author Thomas Griffin
|
3515 |
+
* @author Gary Jones
|
3516 |
+
*/
|
3517 |
+
class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin {
|
3518 |
+
/**
|
3519 |
+
* Holds plugin info for each individual plugin installation.
|
3520 |
+
*
|
3521 |
+
* @since 2.2.0
|
3522 |
+
*
|
3523 |
+
* @var array
|
3524 |
+
*/
|
3525 |
+
public $plugin_info = array();
|
3526 |
+
|
3527 |
+
/**
|
3528 |
+
* Holds names of plugins that are undergoing bulk installations.
|
3529 |
+
*
|
3530 |
+
* @since 2.2.0
|
3531 |
+
*
|
3532 |
+
* @var array
|
3533 |
+
*/
|
3534 |
+
public $plugin_names = array();
|
3535 |
+
|
3536 |
+
/**
|
3537 |
+
* Integer to use for iteration through each plugin installation.
|
3538 |
+
*
|
3539 |
+
* @since 2.2.0
|
3540 |
+
*
|
3541 |
+
* @var integer
|
3542 |
+
*/
|
3543 |
+
public $i = 0;
|
3544 |
+
|
3545 |
+
/**
|
3546 |
+
* TGMPA instance
|
3547 |
+
*
|
3548 |
+
* @since 2.5.0
|
3549 |
+
*
|
3550 |
+
* @var object
|
3551 |
+
*/
|
3552 |
+
protected $tgmpa;
|
3553 |
+
|
3554 |
+
/**
|
3555 |
+
* Constructor. Parses default args with new ones and extracts them for use.
|
3556 |
+
*
|
3557 |
+
* @since 2.2.0
|
3558 |
+
*
|
3559 |
+
* @param array $args Arguments to pass for use within the class.
|
3560 |
+
*/
|
3561 |
+
public function __construct( $args = array() ) {
|
3562 |
+
// Get TGMPA class instance.
|
3563 |
+
$this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) );
|
3564 |
+
|
3565 |
+
// Parse default and new args.
|
3566 |
+
$defaults = array(
|
3567 |
+
'url' => '',
|
3568 |
+
'nonce' => '',
|
3569 |
+
'names' => array(),
|
3570 |
+
'install_type' => 'install',
|
3571 |
+
);
|
3572 |
+
$args = wp_parse_args( $args, $defaults );
|
3573 |
+
|
3574 |
+
// Set plugin names to $this->plugin_names property.
|
3575 |
+
$this->plugin_names = $args['names'];
|
3576 |
+
|
3577 |
+
// Extract the new args.
|
3578 |
+
parent::__construct( $args );
|
3579 |
+
}
|
3580 |
+
|
3581 |
+
/**
|
3582 |
+
* Sets install skin strings for each individual plugin.
|
3583 |
+
*
|
3584 |
+
* Checks to see if the automatic activation flag is set and uses the
|
3585 |
+
* the proper strings accordingly.
|
3586 |
+
*
|
3587 |
+
* @since 2.2.0
|
3588 |
+
*/
|
3589 |
+
public function add_strings() {
|
3590 |
+
if ( 'update' === $this->options['install_type'] ) {
|
3591 |
+
parent::add_strings();
|
3592 |
+
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
|
3593 |
+
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'navmenu-addon-for-elementor' );
|
3594 |
+
} else {
|
3595 |
+
/* translators: 1: plugin name, 2: error message. */
|
3596 |
+
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'navmenu-addon-for-elementor' );
|
3597 |
+
/* translators: 1: plugin name. */
|
3598 |
+
$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'navmenu-addon-for-elementor' );
|
3599 |
+
|
3600 |
+
if ( $this->tgmpa->is_automatic ) {
|
3601 |
+
// Automatic activation strings.
|
3602 |
+
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'navmenu-addon-for-elementor' );
|
3603 |
+
/* translators: 1: plugin name. */
|
3604 |
+
$this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'navmenu-addon-for-elementor' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'navmenu-addon-for-elementor' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'navmenu-addon-for-elementor' ) . '</span>.</a>';
|
3605 |
+
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'navmenu-addon-for-elementor' );
|
3606 |
+
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
|
3607 |
+
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'navmenu-addon-for-elementor' );
|
3608 |
+
} else {
|
3609 |
+
// Default installation strings.
|
3610 |
+
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'navmenu-addon-for-elementor' );
|
3611 |
+
/* translators: 1: plugin name. */
|
3612 |
+
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'navmenu-addon-for-elementor' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'navmenu-addon-for-elementor' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'navmenu-addon-for-elementor' ) . '</span>.</a>';
|
3613 |
+
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'navmenu-addon-for-elementor' );
|
3614 |
+
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
|
3615 |
+
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'navmenu-addon-for-elementor' );
|
3616 |
+
}
|
3617 |
+
}
|
3618 |
+
}
|
3619 |
+
|
3620 |
+
/**
|
3621 |
+
* Outputs the header strings and necessary JS before each plugin installation.
|
3622 |
+
*
|
3623 |
+
* @since 2.2.0
|
3624 |
+
*
|
3625 |
+
* @param string $title Unused in this implementation.
|
3626 |
+
*/
|
3627 |
+
public function before( $title = '' ) {
|
3628 |
+
if ( empty( $title ) ) {
|
3629 |
+
$title = esc_html( $this->plugin_names[ $this->i ] );
|
3630 |
+
}
|
3631 |
+
parent::before( $title );
|
3632 |
+
}
|
3633 |
+
|
3634 |
+
/**
|
3635 |
+
* Outputs the footer strings and necessary JS after each plugin installation.
|
3636 |
+
*
|
3637 |
+
* Checks for any errors and outputs them if they exist, else output
|
3638 |
+
* success strings.
|
3639 |
+
*
|
3640 |
+
* @since 2.2.0
|
3641 |
+
*
|
3642 |
+
* @param string $title Unused in this implementation.
|
3643 |
+
*/
|
3644 |
+
public function after( $title = '' ) {
|
3645 |
+
if ( empty( $title ) ) {
|
3646 |
+
$title = esc_html( $this->plugin_names[ $this->i ] );
|
3647 |
+
}
|
3648 |
+
parent::after( $title );
|
3649 |
+
|
3650 |
+
$this->i++;
|
3651 |
+
}
|
3652 |
+
|
3653 |
+
/**
|
3654 |
+
* Outputs links after bulk plugin installation is complete.
|
3655 |
+
*
|
3656 |
+
* @since 2.2.0
|
3657 |
+
*/
|
3658 |
+
public function bulk_footer() {
|
3659 |
+
// Serve up the string to say installations (and possibly activations) are complete.
|
3660 |
+
parent::bulk_footer();
|
3661 |
+
|
3662 |
+
// Flush plugins cache so we can make sure that the installed plugins list is always up to date.
|
3663 |
+
wp_clean_plugins_cache();
|
3664 |
+
|
3665 |
+
$this->tgmpa->show_tgmpa_version();
|
3666 |
+
|
3667 |
+
// Display message based on if all plugins are now active or not.
|
3668 |
+
$update_actions = array();
|
3669 |
+
|
3670 |
+
if ( $this->tgmpa->is_tgmpa_complete() ) {
|
3671 |
+
// All plugins are active, so we display the complete string and hide the menu to protect users.
|
3672 |
+
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
|
3673 |
+
$update_actions['dashboard'] = sprintf(
|
3674 |
+
esc_html( $this->tgmpa->strings['complete'] ),
|
3675 |
+
'<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'navmenu-addon-for-elementor' ) . '</a>'
|
3676 |
+
);
|
3677 |
+
} else {
|
3678 |
+
$update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';
|
3679 |
+
}
|
3680 |
+
|
3681 |
+
/**
|
3682 |
+
* Filter the list of action links available following bulk plugin installs/updates.
|
3683 |
+
*
|
3684 |
+
* @since 2.5.0
|
3685 |
+
*
|
3686 |
+
* @param array $update_actions Array of plugin action links.
|
3687 |
+
* @param array $plugin_info Array of information for the last-handled plugin.
|
3688 |
+
*/
|
3689 |
+
$update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
|
3690 |
+
|
3691 |
+
if ( ! empty( $update_actions ) ) {
|
3692 |
+
$this->feedback( implode( ' | ', (array) $update_actions ) );
|
3693 |
+
}
|
3694 |
+
}
|
3695 |
+
|
3696 |
+
/* *********** DEPRECATED METHODS *********** */
|
3697 |
+
|
3698 |
+
/**
|
3699 |
+
* Flush header output buffer.
|
3700 |
+
*
|
3701 |
+
* @since 2.2.0
|
3702 |
+
* @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
|
3703 |
+
* @see Bulk_Upgrader_Skin::flush_output()
|
3704 |
+
*/
|
3705 |
+
public function before_flush_output() {
|
3706 |
+
_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
|
3707 |
+
$this->flush_output();
|
3708 |
+
}
|
3709 |
+
|
3710 |
+
/**
|
3711 |
+
* Flush footer output buffer and iterate $this->i to make sure the
|
3712 |
+
* installation strings reference the correct plugin.
|
3713 |
+
*
|
3714 |
+
* @since 2.2.0
|
3715 |
+
* @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
|
3716 |
+
* @see Bulk_Upgrader_Skin::flush_output()
|
3717 |
+
*/
|
3718 |
+
public function after_flush_output() {
|
3719 |
+
_deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
|
3720 |
+
$this->flush_output();
|
3721 |
+
$this->i++;
|
3722 |
+
}
|
3723 |
+
}
|
3724 |
+
}
|
3725 |
+
}
|
3726 |
+
}
|
3727 |
+
}
|
3728 |
+
|
3729 |
+
if ( ! class_exists( 'TGMPA_Utils' ) ) {
|
3730 |
+
|
3731 |
+
/**
|
3732 |
+
* Generic utilities for TGMPA.
|
3733 |
+
*
|
3734 |
+
* All methods are static, poor-dev name-spacing class wrapper.
|
3735 |
+
*
|
3736 |
+
* Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.
|
3737 |
+
*
|
3738 |
+
* @since 2.5.0
|
3739 |
+
*
|
3740 |
+
* @package TGM-Plugin-Activation
|
3741 |
+
* @author Juliette Reinders Folmer
|
3742 |
+
*/
|
3743 |
+
class TGMPA_Utils {
|
3744 |
+
/**
|
3745 |
+
* Whether the PHP filter extension is enabled.
|
3746 |
+
*
|
3747 |
+
* @see http://php.net/book.filter
|
3748 |
+
*
|
3749 |
+
* @since 2.5.0
|
3750 |
+
*
|
3751 |
+
* @static
|
3752 |
+
*
|
3753 |
+
* @var bool $has_filters True is the extension is enabled.
|
3754 |
+
*/
|
3755 |
+
public static $has_filters;
|
3756 |
+
|
3757 |
+
/**
|
3758 |
+
* Wrap an arbitrary string in <em> tags. Meant to be used in combination with array_map().
|
3759 |
+
*
|
3760 |
+
* @since 2.5.0
|
3761 |
+
*
|
3762 |
+
* @static
|
3763 |
+
*
|
3764 |
+
* @param string $string Text to be wrapped.
|
3765 |
+
* @return string
|
3766 |
+
*/
|
3767 |
+
public static function wrap_in_em( $string ) {
|
3768 |
+
return '<em>' . wp_kses_post( $string ) . '</em>';
|
3769 |
+
}
|
3770 |
+
|
3771 |
+
/**
|
3772 |
+
* Wrap an arbitrary string in <strong> tags. Meant to be used in combination with array_map().
|
3773 |
+
*
|
3774 |
+
* @since 2.5.0
|
3775 |
+
*
|
3776 |
+
* @static
|
3777 |
+
*
|
3778 |
+
* @param string $string Text to be wrapped.
|
3779 |
+
* @return string
|
3780 |
+
*/
|
3781 |
+
public static function wrap_in_strong( $string ) {
|
3782 |
+
return '<strong>' . wp_kses_post( $string ) . '</strong>';
|
3783 |
+
}
|
3784 |
+
|
3785 |
+
/**
|
3786 |
+
* Helper function: Validate a value as boolean
|
3787 |
+
*
|
3788 |
+
* @since 2.5.0
|
3789 |
+
*
|
3790 |
+
* @static
|
3791 |
+
*
|
3792 |
+
* @param mixed $value Arbitrary value.
|
3793 |
+
* @return bool
|
3794 |
+
*/
|
3795 |
+
public static function validate_bool( $value ) {
|
3796 |
+
if ( ! isset( self::$has_filters ) ) {
|
3797 |
+
self::$has_filters = extension_loaded( 'filter' );
|
3798 |
+
}
|
3799 |
+
|
3800 |
+
if ( self::$has_filters ) {
|
3801 |
+
return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
|
3802 |
+
} else {
|
3803 |
+
return self::emulate_filter_bool( $value );
|
3804 |
+
}
|
3805 |
+
}
|
3806 |
+
|
3807 |
+
/**
|
3808 |
+
* Helper function: Cast a value to bool
|
3809 |
+
*
|
3810 |
+
* @since 2.5.0
|
3811 |
+
*
|
3812 |
+
* @static
|
3813 |
+
*
|
3814 |
+
* @param mixed $value Value to cast.
|
3815 |
+
* @return bool
|
3816 |
+
*/
|
3817 |
+
protected static function emulate_filter_bool( $value ) {
|
3818 |
+
// @codingStandardsIgnoreStart
|
3819 |
+
static $true = array(
|
3820 |
+
'1',
|
3821 |
+
'true', 'True', 'TRUE',
|
3822 |
+
'y', 'Y',
|
3823 |
+
'yes', 'Yes', 'YES',
|
3824 |
+
'on', 'On', 'ON',
|
3825 |
+
);
|
3826 |
+
static $false = array(
|
3827 |
+
'0',
|
3828 |
+
'false', 'False', 'FALSE',
|
3829 |
+
'n', 'N',
|
3830 |
+
'no', 'No', 'NO',
|
3831 |
+
'off', 'Off', 'OFF',
|
3832 |
+
);
|
3833 |
+
// @codingStandardsIgnoreEnd
|
3834 |
+
|
3835 |
+
if ( is_bool( $value ) ) {
|
3836 |
+
return $value;
|
3837 |
+
} elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
|
3838 |
+
return (bool) $value;
|
3839 |
+
} elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
|
3840 |
+
return (bool) $value;
|
3841 |
+
} elseif ( is_string( $value ) ) {
|
3842 |
+
$value = trim( $value );
|
3843 |
+
if ( in_array( $value, $true, true ) ) {
|
3844 |
+
return true;
|
3845 |
+
} elseif ( in_array( $value, $false, true ) ) {
|
3846 |
+
return false;
|
3847 |
+
} else {
|
3848 |
+
return false;
|
3849 |
+
}
|
3850 |
+
}
|
3851 |
+
|
3852 |
+
return false;
|
3853 |
+
}
|
3854 |
+
} // End of class TGMPA_Utils
|
3855 |
+
} // End of class_exists wrapper
|
modules/branding/module.info.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
}
|
5 |
|
6 |
return [
|
7 |
-
'title'
|
8 |
-
'required'
|
9 |
'default_activation' => true,
|
10 |
];
|
4 |
}
|
5 |
|
6 |
return [
|
7 |
+
'title' => __( 'Branding', 'navmenu-addon-for-elementor' ),
|
8 |
+
'required' => true,
|
9 |
'default_activation' => true,
|
10 |
];
|
modules/branding/widgets/elementor-branding.php
CHANGED
@@ -52,37 +52,37 @@ class Elementor_Branding extends Widget_Base {
|
|
52 |
$this->add_control(
|
53 |
'el_site_branding',
|
54 |
[
|
55 |
-
'label'
|
56 |
'description' => __( 'Your theme must declare the "add_theme_support( \'custom-logo\')" for the logo to work', 'navmenu-addon-for-elementor' ),
|
57 |
-
'type'
|
58 |
'title' => __( 'Title', 'navmenu-addon-for-elementor' ),
|
59 |
-
'logo'
|
60 |
],
|
61 |
-
'default'
|
62 |
]
|
63 |
);
|
64 |
|
65 |
$this->add_responsive_control(
|
66 |
'align',
|
67 |
[
|
68 |
-
'label'
|
69 |
-
'type'
|
70 |
-
'options'
|
71 |
-
'left'
|
72 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
73 |
-
'icon'
|
74 |
],
|
75 |
'center' => [
|
76 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
77 |
-
'icon'
|
78 |
],
|
79 |
-
'right'
|
80 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
81 |
-
'icon'
|
82 |
],
|
83 |
],
|
84 |
'prefix_class' => 'elementor%s-align-',
|
85 |
-
'default'
|
86 |
]
|
87 |
);
|
88 |
|
@@ -92,20 +92,20 @@ class Elementor_Branding extends Widget_Base {
|
|
92 |
'section_title_style',
|
93 |
[
|
94 |
'label' => __( 'Brand', 'navmenu-addon-for-elementor' ),
|
95 |
-
'tab'
|
96 |
]
|
97 |
);
|
98 |
|
99 |
$this->add_control(
|
100 |
'branding_title_color',
|
101 |
[
|
102 |
-
'label'
|
103 |
-
'type'
|
104 |
'condition' => [
|
105 |
'el_site_branding' => 'title',
|
106 |
],
|
107 |
-
'scheme'
|
108 |
-
'type'
|
109 |
'value' => Scheme_Color::COLOR_1,
|
110 |
],
|
111 |
'default' => '#333333',
|
@@ -118,13 +118,13 @@ class Elementor_Branding extends Widget_Base {
|
|
118 |
$this->add_control(
|
119 |
'branding_title_hover',
|
120 |
[
|
121 |
-
'label'
|
122 |
-
'type'
|
123 |
'condition' => [
|
124 |
'el_site_branding' => 'title',
|
125 |
],
|
126 |
-
'scheme'
|
127 |
-
'type'
|
128 |
'value' => Scheme_Color::COLOR_1,
|
129 |
],
|
130 |
'selectors' => [
|
@@ -136,13 +136,13 @@ class Elementor_Branding extends Widget_Base {
|
|
136 |
$this->add_control(
|
137 |
'title_padding',
|
138 |
[
|
139 |
-
'label'
|
140 |
-
'type'
|
141 |
-
'condition'
|
142 |
'el_site_branding' => 'title',
|
143 |
],
|
144 |
'size_units' => [ 'px', 'em', '%' ],
|
145 |
-
'selectors'
|
146 |
'{{WRAPPER}} .elementor-branding .site-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
147 |
],
|
148 |
]
|
@@ -151,26 +151,26 @@ class Elementor_Branding extends Widget_Base {
|
|
151 |
$this->add_group_control(
|
152 |
Group_Control_Typography::get_type(),
|
153 |
[
|
154 |
-
'name'
|
155 |
-
'label'
|
156 |
'condition' => [
|
157 |
'el_site_branding' => 'title',
|
158 |
],
|
159 |
-
'scheme'
|
160 |
-
'selector'
|
161 |
]
|
162 |
);
|
163 |
|
164 |
$this->add_control(
|
165 |
'logo_padding',
|
166 |
[
|
167 |
-
'label'
|
168 |
-
'type'
|
169 |
-
'condition'
|
170 |
'el_site_branding' => 'logo',
|
171 |
],
|
172 |
'size_units' => [ 'px', 'em', '%' ],
|
173 |
-
'selectors'
|
174 |
'{{WRAPPER}} .elementor-branding .custom-logo' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
175 |
],
|
176 |
]
|
@@ -181,8 +181,8 @@ class Elementor_Branding extends Widget_Base {
|
|
181 |
$this->start_controls_section(
|
182 |
'section_desc_style',
|
183 |
[
|
184 |
-
'label'
|
185 |
-
'tab'
|
186 |
'condition' => [
|
187 |
'el_site_branding' => 'title',
|
188 |
],
|
@@ -192,13 +192,13 @@ class Elementor_Branding extends Widget_Base {
|
|
192 |
$this->add_control(
|
193 |
'branding_description_color',
|
194 |
[
|
195 |
-
'label'
|
196 |
-
'type'
|
197 |
'condition' => [
|
198 |
'el_site_branding' => 'title',
|
199 |
],
|
200 |
-
'scheme'
|
201 |
-
'type'
|
202 |
'value' => Scheme_Color::COLOR_1,
|
203 |
],
|
204 |
'selectors' => [
|
@@ -210,13 +210,13 @@ class Elementor_Branding extends Widget_Base {
|
|
210 |
$this->add_control(
|
211 |
'desc_padding',
|
212 |
[
|
213 |
-
'label'
|
214 |
-
'type'
|
215 |
-
'condition'
|
216 |
'el_site_branding' => 'title',
|
217 |
],
|
218 |
'size_units' => [ 'px', 'em', '%' ],
|
219 |
-
'selectors'
|
220 |
'{{WRAPPER}} .elementor-branding .site-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
221 |
],
|
222 |
]
|
@@ -225,13 +225,13 @@ class Elementor_Branding extends Widget_Base {
|
|
225 |
$this->add_group_control(
|
226 |
Group_Control_Typography::get_type(),
|
227 |
[
|
228 |
-
'name'
|
229 |
-
'label'
|
230 |
'condition' => [
|
231 |
'el_site_branding' => 'title',
|
232 |
],
|
233 |
-
'scheme'
|
234 |
-
'selector'
|
235 |
]
|
236 |
);
|
237 |
|
@@ -241,16 +241,16 @@ class Elementor_Branding extends Widget_Base {
|
|
241 |
'section_branding_borders',
|
242 |
[
|
243 |
'label' => __( 'Branding Border', 'navmenu-addon-for-elementor' ),
|
244 |
-
'tab'
|
245 |
]
|
246 |
);
|
247 |
|
248 |
$this->add_group_control(
|
249 |
Group_Control_Border::get_type(),
|
250 |
[
|
251 |
-
'name'
|
252 |
-
'label'
|
253 |
-
'default'
|
254 |
'selector' => '{{WRAPPER}} .elementor-branding',
|
255 |
]
|
256 |
);
|
@@ -258,10 +258,10 @@ class Elementor_Branding extends Widget_Base {
|
|
258 |
$this->add_control(
|
259 |
'border_radius',
|
260 |
[
|
261 |
-
'label'
|
262 |
-
'type'
|
263 |
'size_units' => [ 'px', '%' ],
|
264 |
-
'selectors'
|
265 |
'{{WRAPPER}} .elementor-branding' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
266 |
],
|
267 |
]
|
52 |
$this->add_control(
|
53 |
'el_site_branding',
|
54 |
[
|
55 |
+
'label' => __( 'Branding Type', 'navmenu-addon-for-elementor' ),
|
56 |
'description' => __( 'Your theme must declare the "add_theme_support( \'custom-logo\')" for the logo to work', 'navmenu-addon-for-elementor' ),
|
57 |
+
'type' => Controls_Manager::SELECT, 'options' => [
|
58 |
'title' => __( 'Title', 'navmenu-addon-for-elementor' ),
|
59 |
+
'logo' => __( 'Logo', 'navmenu-addon-for-elementor' ),
|
60 |
],
|
61 |
+
'default' => 'title',
|
62 |
]
|
63 |
);
|
64 |
|
65 |
$this->add_responsive_control(
|
66 |
'align',
|
67 |
[
|
68 |
+
'label' => __( 'Alignment', 'navmenu-addon-for-elementor' ),
|
69 |
+
'type' => Controls_Manager::CHOOSE,
|
70 |
+
'options' => [
|
71 |
+
'left' => [
|
72 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
73 |
+
'icon' => 'fa fa-align-left',
|
74 |
],
|
75 |
'center' => [
|
76 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
77 |
+
'icon' => 'fa fa-align-center',
|
78 |
],
|
79 |
+
'right' => [
|
80 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
81 |
+
'icon' => 'fa fa-align-right',
|
82 |
],
|
83 |
],
|
84 |
'prefix_class' => 'elementor%s-align-',
|
85 |
+
'default' => '',
|
86 |
]
|
87 |
);
|
88 |
|
92 |
'section_title_style',
|
93 |
[
|
94 |
'label' => __( 'Brand', 'navmenu-addon-for-elementor' ),
|
95 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
96 |
]
|
97 |
);
|
98 |
|
99 |
$this->add_control(
|
100 |
'branding_title_color',
|
101 |
[
|
102 |
+
'label' => __( 'Title Color', 'navmenu-addon-for-elementor' ),
|
103 |
+
'type' => Controls_Manager::COLOR,
|
104 |
'condition' => [
|
105 |
'el_site_branding' => 'title',
|
106 |
],
|
107 |
+
'scheme' => [
|
108 |
+
'type' => Scheme_Color::get_type(),
|
109 |
'value' => Scheme_Color::COLOR_1,
|
110 |
],
|
111 |
'default' => '#333333',
|
118 |
$this->add_control(
|
119 |
'branding_title_hover',
|
120 |
[
|
121 |
+
'label' => __( 'Hover', 'navmenu-addon-for-elementor' ),
|
122 |
+
'type' => Controls_Manager::COLOR,
|
123 |
'condition' => [
|
124 |
'el_site_branding' => 'title',
|
125 |
],
|
126 |
+
'scheme' => [
|
127 |
+
'type' => Scheme_Color::get_type(),
|
128 |
'value' => Scheme_Color::COLOR_1,
|
129 |
],
|
130 |
'selectors' => [
|
136 |
$this->add_control(
|
137 |
'title_padding',
|
138 |
[
|
139 |
+
'label' => __( 'Title Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
140 |
+
'type' => Controls_Manager::DIMENSIONS,
|
141 |
+
'condition' => [
|
142 |
'el_site_branding' => 'title',
|
143 |
],
|
144 |
'size_units' => [ 'px', 'em', '%' ],
|
145 |
+
'selectors' => [
|
146 |
'{{WRAPPER}} .elementor-branding .site-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
147 |
],
|
148 |
]
|
151 |
$this->add_group_control(
|
152 |
Group_Control_Typography::get_type(),
|
153 |
[
|
154 |
+
'name' => 'title_typography',
|
155 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
156 |
'condition' => [
|
157 |
'el_site_branding' => 'title',
|
158 |
],
|
159 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
160 |
+
'selector' => '{{WRAPPER}} .elementor-branding .site-title',
|
161 |
]
|
162 |
);
|
163 |
|
164 |
$this->add_control(
|
165 |
'logo_padding',
|
166 |
[
|
167 |
+
'label' => __( 'Title Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
168 |
+
'type' => Controls_Manager::DIMENSIONS,
|
169 |
+
'condition' => [
|
170 |
'el_site_branding' => 'logo',
|
171 |
],
|
172 |
'size_units' => [ 'px', 'em', '%' ],
|
173 |
+
'selectors' => [
|
174 |
'{{WRAPPER}} .elementor-branding .custom-logo' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
175 |
],
|
176 |
]
|
181 |
$this->start_controls_section(
|
182 |
'section_desc_style',
|
183 |
[
|
184 |
+
'label' => __( 'Description Options', 'navmenu-addon-for-elementor' ),
|
185 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
186 |
'condition' => [
|
187 |
'el_site_branding' => 'title',
|
188 |
],
|
192 |
$this->add_control(
|
193 |
'branding_description_color',
|
194 |
[
|
195 |
+
'label' => __( 'Description Color', 'navmenu-addon-for-elementor' ),
|
196 |
+
'type' => Controls_Manager::COLOR,
|
197 |
'condition' => [
|
198 |
'el_site_branding' => 'title',
|
199 |
],
|
200 |
+
'scheme' => [
|
201 |
+
'type' => Scheme_Color::get_type(),
|
202 |
'value' => Scheme_Color::COLOR_1,
|
203 |
],
|
204 |
'selectors' => [
|
210 |
$this->add_control(
|
211 |
'desc_padding',
|
212 |
[
|
213 |
+
'label' => __( 'Description Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
214 |
+
'type' => Controls_Manager::DIMENSIONS,
|
215 |
+
'condition' => [
|
216 |
'el_site_branding' => 'title',
|
217 |
],
|
218 |
'size_units' => [ 'px', 'em', '%' ],
|
219 |
+
'selectors' => [
|
220 |
'{{WRAPPER}} .elementor-branding .site-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
221 |
],
|
222 |
]
|
225 |
$this->add_group_control(
|
226 |
Group_Control_Typography::get_type(),
|
227 |
[
|
228 |
+
'name' => 'desc_typography',
|
229 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
230 |
'condition' => [
|
231 |
'el_site_branding' => 'title',
|
232 |
],
|
233 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
234 |
+
'selector' => '{{WRAPPER}} .elementor-branding .site-description',
|
235 |
]
|
236 |
);
|
237 |
|
241 |
'section_branding_borders',
|
242 |
[
|
243 |
'label' => __( 'Branding Border', 'navmenu-addon-for-elementor' ),
|
244 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
245 |
]
|
246 |
);
|
247 |
|
248 |
$this->add_group_control(
|
249 |
Group_Control_Border::get_type(),
|
250 |
[
|
251 |
+
'name' => 'border',
|
252 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
253 |
+
'default' => '1px',
|
254 |
'selector' => '{{WRAPPER}} .elementor-branding',
|
255 |
]
|
256 |
);
|
258 |
$this->add_control(
|
259 |
'border_radius',
|
260 |
[
|
261 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
262 |
+
'type' => Controls_Manager::DIMENSIONS,
|
263 |
'size_units' => [ 'px', '%' ],
|
264 |
+
'selectors' => [
|
265 |
'{{WRAPPER}} .elementor-branding' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
266 |
],
|
267 |
]
|
modules/menus/module.info.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
}
|
5 |
|
6 |
return [
|
7 |
-
'title'
|
8 |
-
'required'
|
9 |
'default_activation' => true,
|
10 |
];
|
4 |
}
|
5 |
|
6 |
return [
|
7 |
+
'title' => __( 'Menus', 'navmenu-addon-for-elementor' ),
|
8 |
+
'required' => true,
|
9 |
'default_activation' => true,
|
10 |
];
|
modules/menus/widgets/default-navmenu.php
CHANGED
@@ -52,8 +52,8 @@ class Default_Navmenu extends Widget_Base {
|
|
52 |
$this->add_control(
|
53 |
'el_nav_menu',
|
54 |
[
|
55 |
-
'label'
|
56 |
-
'type'
|
57 |
'default' => '',
|
58 |
]
|
59 |
);
|
@@ -61,60 +61,60 @@ class Default_Navmenu extends Widget_Base {
|
|
61 |
$this->add_control(
|
62 |
'el_menu_location',
|
63 |
[
|
64 |
-
'label'
|
65 |
'description' => __( 'Select a location for your menu. This option facilitate the ability to create up to 2 mobile enabled menu locations', 'navmenu-addon-for-elementor' ),
|
66 |
-
'type'
|
67 |
-
'primary'
|
68 |
'secondary' => __( 'Secondary', 'navmenu-addon-for-elementor' ),
|
69 |
],
|
70 |
-
'default'
|
71 |
]
|
72 |
);
|
73 |
|
74 |
$this->add_responsive_control(
|
75 |
'align',
|
76 |
[
|
77 |
-
'label'
|
78 |
-
'type'
|
79 |
-
'options'
|
80 |
-
'left'
|
81 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
82 |
-
'icon'
|
83 |
],
|
84 |
'center' => [
|
85 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
86 |
-
'icon'
|
87 |
],
|
88 |
-
'right'
|
89 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
90 |
-
'icon'
|
91 |
],
|
92 |
],
|
93 |
'prefix_class' => 'elementor%s-align-',
|
94 |
-
'default'
|
95 |
]
|
96 |
);
|
97 |
|
98 |
$this->add_responsive_control(
|
99 |
'item_align',
|
100 |
[
|
101 |
-
'label'
|
102 |
-
'type'
|
103 |
-
'options'
|
104 |
-
'left'
|
105 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
106 |
-
'icon'
|
107 |
],
|
108 |
'center' => [
|
109 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
110 |
-
'icon'
|
111 |
],
|
112 |
-
'right'
|
113 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
114 |
-
'icon'
|
115 |
],
|
116 |
],
|
117 |
-
'default'
|
118 |
'selectors' => [
|
119 |
'{{WRAPPER}} .elementor-navigation ul li, .elementor-navigation ul ul li' => 'text-align: {{VALUE}};',
|
120 |
],
|
@@ -124,10 +124,10 @@ class Default_Navmenu extends Widget_Base {
|
|
124 |
$this->add_control(
|
125 |
'text_padding',
|
126 |
[
|
127 |
-
'label'
|
128 |
-
'type'
|
129 |
'size_units' => [ 'px', 'em', '%' ],
|
130 |
-
'selectors'
|
131 |
'{{WRAPPER}} .elementor-navigation a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
132 |
],
|
133 |
]
|
@@ -145,23 +145,23 @@ class Default_Navmenu extends Widget_Base {
|
|
145 |
$this->add_responsive_control(
|
146 |
'submenu_align',
|
147 |
[
|
148 |
-
'label'
|
149 |
-
'type'
|
150 |
-
'options'
|
151 |
-
'left'
|
152 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
153 |
-
'icon'
|
154 |
],
|
155 |
'center' => [
|
156 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
157 |
-
'icon'
|
158 |
],
|
159 |
-
'right'
|
160 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
161 |
-
'icon'
|
162 |
],
|
163 |
],
|
164 |
-
'default'
|
165 |
'selectors' => [
|
166 |
'{{WRAPPER}} .elementor-navigation .sub-menu .menu-item a' => 'text-align: {{VALUE}};',
|
167 |
],
|
@@ -171,10 +171,10 @@ class Default_Navmenu extends Widget_Base {
|
|
171 |
$this->add_control(
|
172 |
'sub_padding',
|
173 |
[
|
174 |
-
'label'
|
175 |
-
'type'
|
176 |
'size_units' => [ 'px', 'em', '%' ],
|
177 |
-
'selectors'
|
178 |
'{{WRAPPER}} .elementor-navigation .sub-menu .menu-item a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
179 |
],
|
180 |
]
|
@@ -186,17 +186,17 @@ class Default_Navmenu extends Widget_Base {
|
|
186 |
'section_menu_style',
|
187 |
[
|
188 |
'label' => __( 'Navbar', 'navmenu-addon-for-elementor' ),
|
189 |
-
'tab'
|
190 |
]
|
191 |
);
|
192 |
|
193 |
$this->add_control(
|
194 |
'nav_bar_bg',
|
195 |
[
|
196 |
-
'label'
|
197 |
-
'type'
|
198 |
-
'scheme'
|
199 |
-
'type'
|
200 |
'value' => Scheme_Color::COLOR_1,
|
201 |
],
|
202 |
'default' => '#00215e',
|
@@ -209,10 +209,10 @@ class Default_Navmenu extends Widget_Base {
|
|
209 |
$this->add_control(
|
210 |
'menu_link_color',
|
211 |
[
|
212 |
-
'label'
|
213 |
-
'type'
|
214 |
-
'scheme'
|
215 |
-
'type'
|
216 |
'value' => Scheme_Color::COLOR_1,
|
217 |
],
|
218 |
'default' => '#ffffff',
|
@@ -225,10 +225,10 @@ class Default_Navmenu extends Widget_Base {
|
|
225 |
$this->add_control(
|
226 |
'menu_link_bg',
|
227 |
[
|
228 |
-
'label'
|
229 |
-
'type'
|
230 |
-
'scheme'
|
231 |
-
'type'
|
232 |
'value' => Scheme_Color::COLOR_1,
|
233 |
],
|
234 |
'default' => '#00215e',
|
@@ -241,10 +241,10 @@ class Default_Navmenu extends Widget_Base {
|
|
241 |
$this->add_control(
|
242 |
'menu_link_hover_color',
|
243 |
[
|
244 |
-
'label'
|
245 |
-
'type'
|
246 |
-
'scheme'
|
247 |
-
'type'
|
248 |
'value' => Scheme_Color::COLOR_1,
|
249 |
],
|
250 |
'selectors' => [
|
@@ -256,10 +256,10 @@ class Default_Navmenu extends Widget_Base {
|
|
256 |
$this->add_control(
|
257 |
'link_hover_bg_color',
|
258 |
[
|
259 |
-
'label'
|
260 |
-
'type'
|
261 |
-
'scheme'
|
262 |
-
'type'
|
263 |
'value' => Scheme_Color::COLOR_1,
|
264 |
],
|
265 |
'selectors' => [
|
@@ -271,9 +271,9 @@ class Default_Navmenu extends Widget_Base {
|
|
271 |
$this->add_group_control(
|
272 |
Group_Control_Border::get_type(),
|
273 |
[
|
274 |
-
'name'
|
275 |
-
'label'
|
276 |
-
'default'
|
277 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .menu-item a',
|
278 |
]
|
279 |
);
|
@@ -281,10 +281,10 @@ class Default_Navmenu extends Widget_Base {
|
|
281 |
$this->add_control(
|
282 |
'menu_radius',
|
283 |
[
|
284 |
-
'label'
|
285 |
-
'type'
|
286 |
'size_units' => [ 'px', '%' ],
|
287 |
-
'selectors'
|
288 |
'{{WRAPPER}} .elementor-nav-menu .menu-item a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
289 |
],
|
290 |
]
|
@@ -296,18 +296,18 @@ class Default_Navmenu extends Widget_Base {
|
|
296 |
'active_color',
|
297 |
[
|
298 |
'label' => __( 'Current/Active', 'navmenu-addon-for-elementor' ),
|
299 |
-
'type'
|
300 |
-
'tab'
|
301 |
]
|
302 |
);
|
303 |
|
304 |
$this->add_control(
|
305 |
'menu_link_active_color',
|
306 |
[
|
307 |
-
'label'
|
308 |
-
'type'
|
309 |
-
'scheme'
|
310 |
-
'type'
|
311 |
'value' => Scheme_Color::COLOR_1,
|
312 |
],
|
313 |
'selectors' => [
|
@@ -319,10 +319,10 @@ class Default_Navmenu extends Widget_Base {
|
|
319 |
$this->add_control(
|
320 |
'link_active_bg_color',
|
321 |
[
|
322 |
-
'label'
|
323 |
-
'type'
|
324 |
-
'scheme'
|
325 |
-
'type'
|
326 |
'value' => Scheme_Color::COLOR_1,
|
327 |
],
|
328 |
'selectors' => [
|
@@ -334,10 +334,10 @@ class Default_Navmenu extends Widget_Base {
|
|
334 |
$this->add_control(
|
335 |
'active_hover_color',
|
336 |
[
|
337 |
-
'label'
|
338 |
-
'type'
|
339 |
-
'scheme'
|
340 |
-
'type'
|
341 |
'value' => Scheme_Color::COLOR_1,
|
342 |
],
|
343 |
'selectors' => [
|
@@ -349,10 +349,10 @@ class Default_Navmenu extends Widget_Base {
|
|
349 |
$this->add_control(
|
350 |
'active_hover_bg_color',
|
351 |
[
|
352 |
-
'label'
|
353 |
-
'type'
|
354 |
-
'scheme'
|
355 |
-
'type'
|
356 |
'value' => Scheme_Color::COLOR_1,
|
357 |
],
|
358 |
'selectors' => [
|
@@ -364,9 +364,9 @@ class Default_Navmenu extends Widget_Base {
|
|
364 |
$this->add_group_control(
|
365 |
Group_Control_Border::get_type(),
|
366 |
[
|
367 |
-
'name'
|
368 |
-
'label'
|
369 |
-
'default'
|
370 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .current-menu-item > a, .elementor-nav-menu .current_page_item > a',
|
371 |
]
|
372 |
);
|
@@ -374,10 +374,10 @@ class Default_Navmenu extends Widget_Base {
|
|
374 |
$this->add_control(
|
375 |
'active_radius',
|
376 |
[
|
377 |
-
'label'
|
378 |
-
'type'
|
379 |
'size_units' => [ 'px', '%' ],
|
380 |
-
'selectors'
|
381 |
'{{WRAPPER}} .elementor-nav-menu .current-menu-item > a, .elementor-nav-menu .current_page_item > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
382 |
],
|
383 |
]
|
@@ -389,18 +389,18 @@ class Default_Navmenu extends Widget_Base {
|
|
389 |
'submenu_color',
|
390 |
[
|
391 |
'label' => __( 'Submenu', 'navmenu-addon-for-elementor' ),
|
392 |
-
'type'
|
393 |
-
'tab'
|
394 |
]
|
395 |
);
|
396 |
|
397 |
$this->add_control(
|
398 |
'submenu_link_color',
|
399 |
[
|
400 |
-
'label'
|
401 |
-
'type'
|
402 |
-
'scheme'
|
403 |
-
'type'
|
404 |
'value' => Scheme_Color::COLOR_1,
|
405 |
],
|
406 |
'default' => '#ffffff',
|
@@ -413,10 +413,10 @@ class Default_Navmenu extends Widget_Base {
|
|
413 |
$this->add_control(
|
414 |
'submenu_link_bg',
|
415 |
[
|
416 |
-
'label'
|
417 |
-
'type'
|
418 |
-
'scheme'
|
419 |
-
'type'
|
420 |
'value' => Scheme_Color::COLOR_1,
|
421 |
],
|
422 |
'default' => '#00215e',
|
@@ -429,10 +429,10 @@ class Default_Navmenu extends Widget_Base {
|
|
429 |
$this->add_control(
|
430 |
'submenu_link_hover',
|
431 |
[
|
432 |
-
'label'
|
433 |
-
'type'
|
434 |
-
'scheme'
|
435 |
-
'type'
|
436 |
'value' => Scheme_Color::COLOR_1,
|
437 |
],
|
438 |
'selectors' => [
|
@@ -444,10 +444,10 @@ class Default_Navmenu extends Widget_Base {
|
|
444 |
$this->add_control(
|
445 |
'submenu_hover_bg_color',
|
446 |
[
|
447 |
-
'label'
|
448 |
-
'type'
|
449 |
-
'scheme'
|
450 |
-
'type'
|
451 |
'value' => Scheme_Color::COLOR_1,
|
452 |
],
|
453 |
'selectors' => [
|
@@ -459,9 +459,9 @@ class Default_Navmenu extends Widget_Base {
|
|
459 |
$this->add_group_control(
|
460 |
Group_Control_Border::get_type(),
|
461 |
[
|
462 |
-
'name'
|
463 |
-
'label'
|
464 |
-
'default'
|
465 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .sub-menu .menu-item a',
|
466 |
]
|
467 |
);
|
@@ -469,10 +469,10 @@ class Default_Navmenu extends Widget_Base {
|
|
469 |
$this->add_control(
|
470 |
'submenu_radius',
|
471 |
[
|
472 |
-
'label'
|
473 |
-
'type'
|
474 |
'size_units' => [ 'px', '%' ],
|
475 |
-
'selectors'
|
476 |
'{{WRAPPER}} .elementor-nav-menu .sub-menu .menu-item a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
477 |
],
|
478 |
]
|
@@ -484,21 +484,21 @@ class Default_Navmenu extends Widget_Base {
|
|
484 |
'menu_toggle',
|
485 |
[
|
486 |
'label' => __( 'Mobile Toggle', 'navmenu-addon-for-elementor' ),
|
487 |
-
'type'
|
488 |
-
'tab'
|
489 |
]
|
490 |
);
|
491 |
|
492 |
$this->add_control(
|
493 |
'toggle_icon_color',
|
494 |
[
|
495 |
-
'label'
|
496 |
-
'type'
|
497 |
-
'scheme'
|
498 |
-
'type'
|
499 |
'value' => Scheme_Color::COLOR_1,
|
500 |
],
|
501 |
-
'default'
|
502 |
'selectors' => [
|
503 |
'{{WRAPPER}} .elementor-menu-toggle i.fa.fa-navicon' => 'color: {{VALUE}};',
|
504 |
],
|
@@ -508,13 +508,13 @@ class Default_Navmenu extends Widget_Base {
|
|
508 |
$this->add_control(
|
509 |
'toggle_bg_color',
|
510 |
[
|
511 |
-
'label'
|
512 |
-
'type'
|
513 |
-
'scheme'
|
514 |
-
'type'
|
515 |
'value' => Scheme_Color::COLOR_1,
|
516 |
],
|
517 |
-
'default'
|
518 |
'selectors' => [
|
519 |
'{{WRAPPER}} .elementor-menu-toggle' => 'background-color: {{VALUE}};',
|
520 |
],
|
@@ -524,10 +524,10 @@ class Default_Navmenu extends Widget_Base {
|
|
524 |
$this->add_control(
|
525 |
'toggle_icon_hover',
|
526 |
[
|
527 |
-
'label'
|
528 |
-
'type'
|
529 |
-
'scheme'
|
530 |
-
'type'
|
531 |
'value' => Scheme_Color::COLOR_1,
|
532 |
],
|
533 |
'selectors' => [
|
@@ -539,10 +539,10 @@ class Default_Navmenu extends Widget_Base {
|
|
539 |
$this->add_control(
|
540 |
'toggle_bg_hover',
|
541 |
[
|
542 |
-
'label'
|
543 |
-
'type'
|
544 |
-
'scheme'
|
545 |
-
'type'
|
546 |
'value' => Scheme_Color::COLOR_1,
|
547 |
],
|
548 |
'selectors' => [
|
@@ -554,10 +554,10 @@ class Default_Navmenu extends Widget_Base {
|
|
554 |
$this->add_control(
|
555 |
'toggle_text_padding',
|
556 |
[
|
557 |
-
'label'
|
558 |
-
'type'
|
559 |
'size_units' => [ 'px', 'em', '%' ],
|
560 |
-
'selectors'
|
561 |
'{{WRAPPER}} .elementor-menu-toggle i.fa.fa-navicon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
562 |
],
|
563 |
]
|
@@ -566,9 +566,9 @@ class Default_Navmenu extends Widget_Base {
|
|
566 |
$this->add_group_control(
|
567 |
Group_Control_Border::get_type(),
|
568 |
[
|
569 |
-
'name'
|
570 |
-
'label'
|
571 |
-
'default'
|
572 |
'selector' => '{{WRAPPER}} .elementor-menu-toggle',
|
573 |
]
|
574 |
);
|
@@ -576,10 +576,10 @@ class Default_Navmenu extends Widget_Base {
|
|
576 |
$this->add_control(
|
577 |
'toggle_border_radius',
|
578 |
[
|
579 |
-
'label'
|
580 |
-
'type'
|
581 |
'size_units' => [ 'px', '%' ],
|
582 |
-
'selectors'
|
583 |
'{{WRAPPER}} .elementor-menu-toggle' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
584 |
],
|
585 |
]
|
@@ -591,17 +591,17 @@ class Default_Navmenu extends Widget_Base {
|
|
591 |
'menu_typography',
|
592 |
[
|
593 |
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
594 |
-
'type'
|
595 |
-
'tab'
|
596 |
]
|
597 |
);
|
598 |
|
599 |
$this->add_group_control(
|
600 |
Group_Control_Typography::get_type(),
|
601 |
[
|
602 |
-
'name'
|
603 |
-
'label'
|
604 |
-
'scheme'
|
605 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .menu-item',
|
606 |
]
|
607 |
);
|
@@ -611,7 +611,7 @@ class Default_Navmenu extends Widget_Base {
|
|
611 |
|
612 |
protected function render() {
|
613 |
|
614 |
-
$settings
|
615 |
$menu_location = $settings['el_menu_location'];
|
616 |
// Get menu
|
617 |
$nav_menu = ! empty( $settings['el_nav_menu'] ) ? wp_get_nav_menu_object( $settings['el_nav_menu'] ) : false;
|
@@ -621,15 +621,15 @@ class Default_Navmenu extends Widget_Base {
|
|
621 |
}
|
622 |
|
623 |
$nav_menu_args = array(
|
624 |
-
'fallback_cb'
|
625 |
-
'container'
|
626 |
-
'menu_id'
|
627 |
-
'menu_class'
|
628 |
-
'theme_location'
|
629 |
-
'menu'
|
630 |
-
'echo'
|
631 |
-
'depth'
|
632 |
-
'walker'
|
633 |
);
|
634 |
|
635 |
echo '<div id="elementor-header-' . $menu_location . '" class="elementor-header">';
|
52 |
$this->add_control(
|
53 |
'el_nav_menu',
|
54 |
[
|
55 |
+
'label' => __( 'Select Menu', 'navmenu-addon-for-elementor' ),
|
56 |
+
'type' => Controls_Manager::SELECT, 'options' => navmenu_navbar_menu_choices(),
|
57 |
'default' => '',
|
58 |
]
|
59 |
);
|
61 |
$this->add_control(
|
62 |
'el_menu_location',
|
63 |
[
|
64 |
+
'label' => __( 'Menu Location', 'navmenu-addon-for-elementor' ),
|
65 |
'description' => __( 'Select a location for your menu. This option facilitate the ability to create up to 2 mobile enabled menu locations', 'navmenu-addon-for-elementor' ),
|
66 |
+
'type' => Controls_Manager::SELECT, 'options' => [
|
67 |
+
'primary' => __( 'Primary', 'navmenu-addon-for-elementor' ),
|
68 |
'secondary' => __( 'Secondary', 'navmenu-addon-for-elementor' ),
|
69 |
],
|
70 |
+
'default' => 'primary',
|
71 |
]
|
72 |
);
|
73 |
|
74 |
$this->add_responsive_control(
|
75 |
'align',
|
76 |
[
|
77 |
+
'label' => __( 'Navbar/Toggle Alignment', 'navmenu-addon-for-elementor' ),
|
78 |
+
'type' => Controls_Manager::CHOOSE,
|
79 |
+
'options' => [
|
80 |
+
'left' => [
|
81 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
82 |
+
'icon' => 'fa fa-align-left',
|
83 |
],
|
84 |
'center' => [
|
85 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
86 |
+
'icon' => 'fa fa-align-center',
|
87 |
],
|
88 |
+
'right' => [
|
89 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
90 |
+
'icon' => 'fa fa-align-right',
|
91 |
],
|
92 |
],
|
93 |
'prefix_class' => 'elementor%s-align-',
|
94 |
+
'default' => '',
|
95 |
]
|
96 |
);
|
97 |
|
98 |
$this->add_responsive_control(
|
99 |
'item_align',
|
100 |
[
|
101 |
+
'label' => __( 'Mobile Item Alignment', 'navmenu-addon-for-elementor' ),
|
102 |
+
'type' => Controls_Manager::CHOOSE,
|
103 |
+
'options' => [
|
104 |
+
'left' => [
|
105 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
106 |
+
'icon' => 'fa fa-align-left',
|
107 |
],
|
108 |
'center' => [
|
109 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
110 |
+
'icon' => 'fa fa-align-center',
|
111 |
],
|
112 |
+
'right' => [
|
113 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
114 |
+
'icon' => 'fa fa-align-right',
|
115 |
],
|
116 |
],
|
117 |
+
'default' => '',
|
118 |
'selectors' => [
|
119 |
'{{WRAPPER}} .elementor-navigation ul li, .elementor-navigation ul ul li' => 'text-align: {{VALUE}};',
|
120 |
],
|
124 |
$this->add_control(
|
125 |
'text_padding',
|
126 |
[
|
127 |
+
'label' => __( 'Text Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
128 |
+
'type' => Controls_Manager::DIMENSIONS,
|
129 |
'size_units' => [ 'px', 'em', '%' ],
|
130 |
+
'selectors' => [
|
131 |
'{{WRAPPER}} .elementor-navigation a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
132 |
],
|
133 |
]
|
145 |
$this->add_responsive_control(
|
146 |
'submenu_align',
|
147 |
[
|
148 |
+
'label' => __( 'Item Alignment', 'navmenu-addon-for-elementor' ),
|
149 |
+
'type' => Controls_Manager::CHOOSE,
|
150 |
+
'options' => [
|
151 |
+
'left' => [
|
152 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
153 |
+
'icon' => 'fa fa-align-left',
|
154 |
],
|
155 |
'center' => [
|
156 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
157 |
+
'icon' => 'fa fa-align-center',
|
158 |
],
|
159 |
+
'right' => [
|
160 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
161 |
+
'icon' => 'fa fa-align-right',
|
162 |
],
|
163 |
],
|
164 |
+
'default' => '',
|
165 |
'selectors' => [
|
166 |
'{{WRAPPER}} .elementor-navigation .sub-menu .menu-item a' => 'text-align: {{VALUE}};',
|
167 |
],
|
171 |
$this->add_control(
|
172 |
'sub_padding',
|
173 |
[
|
174 |
+
'label' => __( 'Item Padding', 'navmenu-addon-for-elementor' ),
|
175 |
+
'type' => Controls_Manager::DIMENSIONS,
|
176 |
'size_units' => [ 'px', 'em', '%' ],
|
177 |
+
'selectors' => [
|
178 |
'{{WRAPPER}} .elementor-navigation .sub-menu .menu-item a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
179 |
],
|
180 |
]
|
186 |
'section_menu_style',
|
187 |
[
|
188 |
'label' => __( 'Navbar', 'navmenu-addon-for-elementor' ),
|
189 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
190 |
]
|
191 |
);
|
192 |
|
193 |
$this->add_control(
|
194 |
'nav_bar_bg',
|
195 |
[
|
196 |
+
'label' => __( 'Navbar Background', 'navmenu-addon-for-elementor' ),
|
197 |
+
'type' => Controls_Manager::COLOR,
|
198 |
+
'scheme' => [
|
199 |
+
'type' => Scheme_Color::get_type(),
|
200 |
'value' => Scheme_Color::COLOR_1,
|
201 |
],
|
202 |
'default' => '#00215e',
|
209 |
$this->add_control(
|
210 |
'menu_link_color',
|
211 |
[
|
212 |
+
'label' => __( 'Link Color', 'navmenu-addon-for-elementor' ),
|
213 |
+
'type' => Controls_Manager::COLOR,
|
214 |
+
'scheme' => [
|
215 |
+
'type' => Scheme_Color::get_type(),
|
216 |
'value' => Scheme_Color::COLOR_1,
|
217 |
],
|
218 |
'default' => '#ffffff',
|
225 |
$this->add_control(
|
226 |
'menu_link_bg',
|
227 |
[
|
228 |
+
'label' => __( 'Background', 'navmenu-addon-for-elementor' ),
|
229 |
+
'type' => Controls_Manager::COLOR,
|
230 |
+
'scheme' => [
|
231 |
+
'type' => Scheme_Color::get_type(),
|
232 |
'value' => Scheme_Color::COLOR_1,
|
233 |
],
|
234 |
'default' => '#00215e',
|
241 |
$this->add_control(
|
242 |
'menu_link_hover_color',
|
243 |
[
|
244 |
+
'label' => __( 'Link Color', 'navmenu-addon-for-elementor' ),
|
245 |
+
'type' => Controls_Manager::COLOR,
|
246 |
+
'scheme' => [
|
247 |
+
'type' => Scheme_Color::get_type(),
|
248 |
'value' => Scheme_Color::COLOR_1,
|
249 |
],
|
250 |
'selectors' => [
|
256 |
$this->add_control(
|
257 |
'link_hover_bg_color',
|
258 |
[
|
259 |
+
'label' => __( 'Background Color', 'navmenu-addon-for-elementor' ),
|
260 |
+
'type' => Controls_Manager::COLOR,
|
261 |
+
'scheme' => [
|
262 |
+
'type' => Scheme_Color::get_type(),
|
263 |
'value' => Scheme_Color::COLOR_1,
|
264 |
],
|
265 |
'selectors' => [
|
271 |
$this->add_group_control(
|
272 |
Group_Control_Border::get_type(),
|
273 |
[
|
274 |
+
'name' => 'menu_border',
|
275 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
276 |
+
'default' => '1px',
|
277 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .menu-item a',
|
278 |
]
|
279 |
);
|
281 |
$this->add_control(
|
282 |
'menu_radius',
|
283 |
[
|
284 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
285 |
+
'type' => Controls_Manager::DIMENSIONS,
|
286 |
'size_units' => [ 'px', '%' ],
|
287 |
+
'selectors' => [
|
288 |
'{{WRAPPER}} .elementor-nav-menu .menu-item a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
289 |
],
|
290 |
]
|
296 |
'active_color',
|
297 |
[
|
298 |
'label' => __( 'Current/Active', 'navmenu-addon-for-elementor' ),
|
299 |
+
'type' => Controls_Manager::SECTION,
|
300 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
301 |
]
|
302 |
);
|
303 |
|
304 |
$this->add_control(
|
305 |
'menu_link_active_color',
|
306 |
[
|
307 |
+
'label' => __( 'Active Color', 'navmenu-addon-for-elementor' ),
|
308 |
+
'type' => Controls_Manager::COLOR,
|
309 |
+
'scheme' => [
|
310 |
+
'type' => Scheme_Color::get_type(),
|
311 |
'value' => Scheme_Color::COLOR_1,
|
312 |
],
|
313 |
'selectors' => [
|
319 |
$this->add_control(
|
320 |
'link_active_bg_color',
|
321 |
[
|
322 |
+
'label' => __( 'Active Background', 'navmenu-addon-for-elementor' ),
|
323 |
+
'type' => Controls_Manager::COLOR,
|
324 |
+
'scheme' => [
|
325 |
+
'type' => Scheme_Color::get_type(),
|
326 |
'value' => Scheme_Color::COLOR_1,
|
327 |
],
|
328 |
'selectors' => [
|
334 |
$this->add_control(
|
335 |
'active_hover_color',
|
336 |
[
|
337 |
+
'label' => __( 'Active Link', 'navmenu-addon-for-elementor' ),
|
338 |
+
'type' => Controls_Manager::COLOR,
|
339 |
+
'scheme' => [
|
340 |
+
'type' => Scheme_Color::get_type(),
|
341 |
'value' => Scheme_Color::COLOR_1,
|
342 |
],
|
343 |
'selectors' => [
|
349 |
$this->add_control(
|
350 |
'active_hover_bg_color',
|
351 |
[
|
352 |
+
'label' => __( 'Active Background', 'navmenu-addon-for-elementor' ),
|
353 |
+
'type' => Controls_Manager::COLOR,
|
354 |
+
'scheme' => [
|
355 |
+
'type' => Scheme_Color::get_type(),
|
356 |
'value' => Scheme_Color::COLOR_1,
|
357 |
],
|
358 |
'selectors' => [
|
364 |
$this->add_group_control(
|
365 |
Group_Control_Border::get_type(),
|
366 |
[
|
367 |
+
'name' => 'active_border',
|
368 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
369 |
+
'default' => '1px',
|
370 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .current-menu-item > a, .elementor-nav-menu .current_page_item > a',
|
371 |
]
|
372 |
);
|
374 |
$this->add_control(
|
375 |
'active_radius',
|
376 |
[
|
377 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
378 |
+
'type' => Controls_Manager::DIMENSIONS,
|
379 |
'size_units' => [ 'px', '%' ],
|
380 |
+
'selectors' => [
|
381 |
'{{WRAPPER}} .elementor-nav-menu .current-menu-item > a, .elementor-nav-menu .current_page_item > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
382 |
],
|
383 |
]
|
389 |
'submenu_color',
|
390 |
[
|
391 |
'label' => __( 'Submenu', 'navmenu-addon-for-elementor' ),
|
392 |
+
'type' => Controls_Manager::SECTION,
|
393 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
394 |
]
|
395 |
);
|
396 |
|
397 |
$this->add_control(
|
398 |
'submenu_link_color',
|
399 |
[
|
400 |
+
'label' => __( 'Submenu Links', 'navmenu-addon-for-elementor' ),
|
401 |
+
'type' => Controls_Manager::COLOR,
|
402 |
+
'scheme' => [
|
403 |
+
'type' => Scheme_Color::get_type(),
|
404 |
'value' => Scheme_Color::COLOR_1,
|
405 |
],
|
406 |
'default' => '#ffffff',
|
413 |
$this->add_control(
|
414 |
'submenu_link_bg',
|
415 |
[
|
416 |
+
'label' => __( 'Submenu Background', 'navmenu-addon-for-elementor' ),
|
417 |
+
'type' => Controls_Manager::COLOR,
|
418 |
+
'scheme' => [
|
419 |
+
'type' => Scheme_Color::get_type(),
|
420 |
'value' => Scheme_Color::COLOR_1,
|
421 |
],
|
422 |
'default' => '#00215e',
|
429 |
$this->add_control(
|
430 |
'submenu_link_hover',
|
431 |
[
|
432 |
+
'label' => __( 'Submenu Link Hover', 'navmenu-addon-for-elementor' ),
|
433 |
+
'type' => Controls_Manager::COLOR,
|
434 |
+
'scheme' => [
|
435 |
+
'type' => Scheme_Color::get_type(),
|
436 |
'value' => Scheme_Color::COLOR_1,
|
437 |
],
|
438 |
'selectors' => [
|
444 |
$this->add_control(
|
445 |
'submenu_hover_bg_color',
|
446 |
[
|
447 |
+
'label' => __( 'Submenu Hover BG', 'navmenu-addon-for-elementor' ),
|
448 |
+
'type' => Controls_Manager::COLOR,
|
449 |
+
'scheme' => [
|
450 |
+
'type' => Scheme_Color::get_type(),
|
451 |
'value' => Scheme_Color::COLOR_1,
|
452 |
],
|
453 |
'selectors' => [
|
459 |
$this->add_group_control(
|
460 |
Group_Control_Border::get_type(),
|
461 |
[
|
462 |
+
'name' => 'submenu_border',
|
463 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
464 |
+
'default' => '1px',
|
465 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .sub-menu .menu-item a',
|
466 |
]
|
467 |
);
|
469 |
$this->add_control(
|
470 |
'submenu_radius',
|
471 |
[
|
472 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
473 |
+
'type' => Controls_Manager::DIMENSIONS,
|
474 |
'size_units' => [ 'px', '%' ],
|
475 |
+
'selectors' => [
|
476 |
'{{WRAPPER}} .elementor-nav-menu .sub-menu .menu-item a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
477 |
],
|
478 |
]
|
484 |
'menu_toggle',
|
485 |
[
|
486 |
'label' => __( 'Mobile Toggle', 'navmenu-addon-for-elementor' ),
|
487 |
+
'type' => Controls_Manager::SECTION,
|
488 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
489 |
]
|
490 |
);
|
491 |
|
492 |
$this->add_control(
|
493 |
'toggle_icon_color',
|
494 |
[
|
495 |
+
'label' => __( 'Icon Color', 'navmenu-addon-for-elementor' ),
|
496 |
+
'type' => Controls_Manager::COLOR,
|
497 |
+
'scheme' => [
|
498 |
+
'type' => Scheme_Color::get_type(),
|
499 |
'value' => Scheme_Color::COLOR_1,
|
500 |
],
|
501 |
+
'default' => '#ffffff',
|
502 |
'selectors' => [
|
503 |
'{{WRAPPER}} .elementor-menu-toggle i.fa.fa-navicon' => 'color: {{VALUE}};',
|
504 |
],
|
508 |
$this->add_control(
|
509 |
'toggle_bg_color',
|
510 |
[
|
511 |
+
'label' => __( 'Background Color', 'navmenu-addon-for-elementor' ),
|
512 |
+
'type' => Controls_Manager::COLOR,
|
513 |
+
'scheme' => [
|
514 |
+
'type' => Scheme_Color::get_type(),
|
515 |
'value' => Scheme_Color::COLOR_1,
|
516 |
],
|
517 |
+
'default' => '#333333',
|
518 |
'selectors' => [
|
519 |
'{{WRAPPER}} .elementor-menu-toggle' => 'background-color: {{VALUE}};',
|
520 |
],
|
524 |
$this->add_control(
|
525 |
'toggle_icon_hover',
|
526 |
[
|
527 |
+
'label' => __( 'Icon Hover', 'navmenu-addon-for-elementor' ),
|
528 |
+
'type' => Controls_Manager::COLOR,
|
529 |
+
'scheme' => [
|
530 |
+
'type' => Scheme_Color::get_type(),
|
531 |
'value' => Scheme_Color::COLOR_1,
|
532 |
],
|
533 |
'selectors' => [
|
539 |
$this->add_control(
|
540 |
'toggle_bg_hover',
|
541 |
[
|
542 |
+
'label' => __( 'Background Hover', 'navmenu-addon-for-elementor' ),
|
543 |
+
'type' => Controls_Manager::COLOR,
|
544 |
+
'scheme' => [
|
545 |
+
'type' => Scheme_Color::get_type(),
|
546 |
'value' => Scheme_Color::COLOR_1,
|
547 |
],
|
548 |
'selectors' => [
|
554 |
$this->add_control(
|
555 |
'toggle_text_padding',
|
556 |
[
|
557 |
+
'label' => __( 'Text Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
558 |
+
'type' => Controls_Manager::DIMENSIONS,
|
559 |
'size_units' => [ 'px', 'em', '%' ],
|
560 |
+
'selectors' => [
|
561 |
'{{WRAPPER}} .elementor-menu-toggle i.fa.fa-navicon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
562 |
],
|
563 |
]
|
566 |
$this->add_group_control(
|
567 |
Group_Control_Border::get_type(),
|
568 |
[
|
569 |
+
'name' => 'toggle_border',
|
570 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
571 |
+
'default' => '1px',
|
572 |
'selector' => '{{WRAPPER}} .elementor-menu-toggle',
|
573 |
]
|
574 |
);
|
576 |
$this->add_control(
|
577 |
'toggle_border_radius',
|
578 |
[
|
579 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
580 |
+
'type' => Controls_Manager::DIMENSIONS,
|
581 |
'size_units' => [ 'px', '%' ],
|
582 |
+
'selectors' => [
|
583 |
'{{WRAPPER}} .elementor-menu-toggle' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
584 |
],
|
585 |
]
|
591 |
'menu_typography',
|
592 |
[
|
593 |
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
594 |
+
'type' => Controls_Manager::SECTION,
|
595 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
596 |
]
|
597 |
);
|
598 |
|
599 |
$this->add_group_control(
|
600 |
Group_Control_Typography::get_type(),
|
601 |
[
|
602 |
+
'name' => 'menu_typography',
|
603 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
604 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
605 |
'selector' => '{{WRAPPER}} .elementor-nav-menu .menu-item',
|
606 |
]
|
607 |
);
|
611 |
|
612 |
protected function render() {
|
613 |
|
614 |
+
$settings = $this->get_settings();
|
615 |
$menu_location = $settings['el_menu_location'];
|
616 |
// Get menu
|
617 |
$nav_menu = ! empty( $settings['el_nav_menu'] ) ? wp_get_nav_menu_object( $settings['el_nav_menu'] ) : false;
|
621 |
}
|
622 |
|
623 |
$nav_menu_args = array(
|
624 |
+
'fallback_cb' => false,
|
625 |
+
'container' => false,
|
626 |
+
'menu_id' => 'elementor-navmenu',
|
627 |
+
'menu_class' => 'elementor-nav-menu',
|
628 |
+
'theme_location' => 'default_navmenu', // creating a fake location for better functional control
|
629 |
+
'menu' => $nav_menu,
|
630 |
+
'echo' => true,
|
631 |
+
'depth' => 0,
|
632 |
+
'walker' => '',
|
633 |
);
|
634 |
|
635 |
echo '<div id="elementor-header-' . $menu_location . '" class="elementor-header">';
|
modules/menus/widgets/elementor-branding.php
CHANGED
@@ -50,37 +50,37 @@ class Elementor_Branding extends Widget_Base {
|
|
50 |
$this->add_control(
|
51 |
'el_site_branding',
|
52 |
[
|
53 |
-
'label'
|
54 |
'description' => __( 'Your theme must declare the "add_theme_support( \'custom-logo\')" for the logo to work', 'navmenu-addon-for-elementor' ),
|
55 |
-
'type'
|
56 |
'title' => __( 'Title', 'navmenu-addon-for-elementor' ),
|
57 |
-
'logo'
|
58 |
],
|
59 |
-
'default'
|
60 |
]
|
61 |
);
|
62 |
|
63 |
$this->add_responsive_control(
|
64 |
'align',
|
65 |
[
|
66 |
-
'label'
|
67 |
-
'type'
|
68 |
-
'options'
|
69 |
-
'left'
|
70 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
71 |
-
'icon'
|
72 |
],
|
73 |
'center' => [
|
74 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
75 |
-
'icon'
|
76 |
],
|
77 |
-
'right'
|
78 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
79 |
-
'icon'
|
80 |
],
|
81 |
],
|
82 |
'prefix_class' => 'elementor%s-align-',
|
83 |
-
'default'
|
84 |
]
|
85 |
);
|
86 |
|
@@ -90,20 +90,20 @@ class Elementor_Branding extends Widget_Base {
|
|
90 |
'section_title_style',
|
91 |
[
|
92 |
'label' => __( 'Brand', 'navmenu-addon-for-elementor' ),
|
93 |
-
'tab'
|
94 |
]
|
95 |
);
|
96 |
|
97 |
$this->add_control(
|
98 |
'branding_title_color',
|
99 |
[
|
100 |
-
'label'
|
101 |
-
'type'
|
102 |
'condition' => [
|
103 |
'el_site_branding' => 'title',
|
104 |
],
|
105 |
-
'scheme'
|
106 |
-
'type'
|
107 |
'value' => Scheme_Color::COLOR_1,
|
108 |
],
|
109 |
'default' => '#333333',
|
@@ -116,13 +116,13 @@ class Elementor_Branding extends Widget_Base {
|
|
116 |
$this->add_control(
|
117 |
'branding_title_hover',
|
118 |
[
|
119 |
-
'label'
|
120 |
-
'type'
|
121 |
'condition' => [
|
122 |
'el_site_branding' => 'title',
|
123 |
],
|
124 |
-
'scheme'
|
125 |
-
'type'
|
126 |
'value' => Scheme_Color::COLOR_1,
|
127 |
],
|
128 |
'selectors' => [
|
@@ -134,13 +134,13 @@ class Elementor_Branding extends Widget_Base {
|
|
134 |
$this->add_control(
|
135 |
'title_padding',
|
136 |
[
|
137 |
-
'label'
|
138 |
-
'type'
|
139 |
-
'condition'
|
140 |
'el_site_branding' => 'title',
|
141 |
],
|
142 |
'size_units' => [ 'px', 'em', '%' ],
|
143 |
-
'selectors'
|
144 |
'{{WRAPPER}} .elementor-branding .site-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
145 |
],
|
146 |
]
|
@@ -149,26 +149,26 @@ class Elementor_Branding extends Widget_Base {
|
|
149 |
$this->add_group_control(
|
150 |
Group_Control_Typography::get_type(),
|
151 |
[
|
152 |
-
'name'
|
153 |
-
'label'
|
154 |
'condition' => [
|
155 |
'el_site_branding' => 'title',
|
156 |
],
|
157 |
-
'scheme'
|
158 |
-
'selector'
|
159 |
]
|
160 |
);
|
161 |
|
162 |
$this->add_control(
|
163 |
'logo_padding',
|
164 |
[
|
165 |
-
'label'
|
166 |
-
'type'
|
167 |
-
'condition'
|
168 |
'el_site_branding' => 'logo',
|
169 |
],
|
170 |
'size_units' => [ 'px', 'em', '%' ],
|
171 |
-
'selectors'
|
172 |
'{{WRAPPER}} .elementor-branding .custom-logo' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
173 |
],
|
174 |
]
|
@@ -179,8 +179,8 @@ class Elementor_Branding extends Widget_Base {
|
|
179 |
$this->start_controls_section(
|
180 |
'section_desc_style',
|
181 |
[
|
182 |
-
'label'
|
183 |
-
'tab'
|
184 |
'condition' => [
|
185 |
'el_site_branding' => 'title',
|
186 |
],
|
@@ -190,13 +190,13 @@ class Elementor_Branding extends Widget_Base {
|
|
190 |
$this->add_control(
|
191 |
'branding_description_color',
|
192 |
[
|
193 |
-
'label'
|
194 |
-
'type'
|
195 |
'condition' => [
|
196 |
'el_site_branding' => 'title',
|
197 |
],
|
198 |
-
'scheme'
|
199 |
-
'type'
|
200 |
'value' => Scheme_Color::COLOR_1,
|
201 |
],
|
202 |
'selectors' => [
|
@@ -208,13 +208,13 @@ class Elementor_Branding extends Widget_Base {
|
|
208 |
$this->add_control(
|
209 |
'desc_padding',
|
210 |
[
|
211 |
-
'label'
|
212 |
-
'type'
|
213 |
-
'condition'
|
214 |
'el_site_branding' => 'title',
|
215 |
],
|
216 |
'size_units' => [ 'px', 'em', '%' ],
|
217 |
-
'selectors'
|
218 |
'{{WRAPPER}} .elementor-branding .site-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
219 |
],
|
220 |
]
|
@@ -223,13 +223,13 @@ class Elementor_Branding extends Widget_Base {
|
|
223 |
$this->add_group_control(
|
224 |
Group_Control_Typography::get_type(),
|
225 |
[
|
226 |
-
'name'
|
227 |
-
'label'
|
228 |
'condition' => [
|
229 |
'el_site_branding' => 'title',
|
230 |
],
|
231 |
-
'scheme'
|
232 |
-
'selector'
|
233 |
]
|
234 |
);
|
235 |
|
@@ -239,16 +239,16 @@ class Elementor_Branding extends Widget_Base {
|
|
239 |
'section_branding_borders',
|
240 |
[
|
241 |
'label' => __( 'Branding Border', 'navmenu-addon-for-elementor' ),
|
242 |
-
'tab'
|
243 |
]
|
244 |
);
|
245 |
|
246 |
$this->add_group_control(
|
247 |
Group_Control_Border::get_type(),
|
248 |
[
|
249 |
-
'name'
|
250 |
-
'label'
|
251 |
-
'default'
|
252 |
'selector' => '{{WRAPPER}} .elementor-branding',
|
253 |
]
|
254 |
);
|
@@ -256,10 +256,10 @@ class Elementor_Branding extends Widget_Base {
|
|
256 |
$this->add_control(
|
257 |
'border_radius',
|
258 |
[
|
259 |
-
'label'
|
260 |
-
'type'
|
261 |
'size_units' => [ 'px', '%' ],
|
262 |
-
'selectors'
|
263 |
'{{WRAPPER}} .elementor-branding' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
264 |
],
|
265 |
]
|
50 |
$this->add_control(
|
51 |
'el_site_branding',
|
52 |
[
|
53 |
+
'label' => __( 'Branding Type', 'navmenu-addon-for-elementor' ),
|
54 |
'description' => __( 'Your theme must declare the "add_theme_support( \'custom-logo\')" for the logo to work', 'navmenu-addon-for-elementor' ),
|
55 |
+
'type' => Controls_Manager::SELECT, 'options' => [
|
56 |
'title' => __( 'Title', 'navmenu-addon-for-elementor' ),
|
57 |
+
'logo' => __( 'Logo', 'navmenu-addon-for-elementor' ),
|
58 |
],
|
59 |
+
'default' => 'title',
|
60 |
]
|
61 |
);
|
62 |
|
63 |
$this->add_responsive_control(
|
64 |
'align',
|
65 |
[
|
66 |
+
'label' => __( 'Alignment', 'navmenu-addon-for-elementor' ),
|
67 |
+
'type' => Controls_Manager::CHOOSE,
|
68 |
+
'options' => [
|
69 |
+
'left' => [
|
70 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
71 |
+
'icon' => 'fa fa-align-left',
|
72 |
],
|
73 |
'center' => [
|
74 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
75 |
+
'icon' => 'fa fa-align-center',
|
76 |
],
|
77 |
+
'right' => [
|
78 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
79 |
+
'icon' => 'fa fa-align-right',
|
80 |
],
|
81 |
],
|
82 |
'prefix_class' => 'elementor%s-align-',
|
83 |
+
'default' => '',
|
84 |
]
|
85 |
);
|
86 |
|
90 |
'section_title_style',
|
91 |
[
|
92 |
'label' => __( 'Brand', 'navmenu-addon-for-elementor' ),
|
93 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
94 |
]
|
95 |
);
|
96 |
|
97 |
$this->add_control(
|
98 |
'branding_title_color',
|
99 |
[
|
100 |
+
'label' => __( 'Title Color', 'navmenu-addon-for-elementor' ),
|
101 |
+
'type' => Controls_Manager::COLOR,
|
102 |
'condition' => [
|
103 |
'el_site_branding' => 'title',
|
104 |
],
|
105 |
+
'scheme' => [
|
106 |
+
'type' => Scheme_Color::get_type(),
|
107 |
'value' => Scheme_Color::COLOR_1,
|
108 |
],
|
109 |
'default' => '#333333',
|
116 |
$this->add_control(
|
117 |
'branding_title_hover',
|
118 |
[
|
119 |
+
'label' => __( 'Hover', 'navmenu-addon-for-elementor' ),
|
120 |
+
'type' => Controls_Manager::COLOR,
|
121 |
'condition' => [
|
122 |
'el_site_branding' => 'title',
|
123 |
],
|
124 |
+
'scheme' => [
|
125 |
+
'type' => Scheme_Color::get_type(),
|
126 |
'value' => Scheme_Color::COLOR_1,
|
127 |
],
|
128 |
'selectors' => [
|
134 |
$this->add_control(
|
135 |
'title_padding',
|
136 |
[
|
137 |
+
'label' => __( 'Title Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
138 |
+
'type' => Controls_Manager::DIMENSIONS,
|
139 |
+
'condition' => [
|
140 |
'el_site_branding' => 'title',
|
141 |
],
|
142 |
'size_units' => [ 'px', 'em', '%' ],
|
143 |
+
'selectors' => [
|
144 |
'{{WRAPPER}} .elementor-branding .site-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
145 |
],
|
146 |
]
|
149 |
$this->add_group_control(
|
150 |
Group_Control_Typography::get_type(),
|
151 |
[
|
152 |
+
'name' => 'title_typography',
|
153 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
154 |
'condition' => [
|
155 |
'el_site_branding' => 'title',
|
156 |
],
|
157 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
158 |
+
'selector' => '{{WRAPPER}} .elementor-branding .site-title',
|
159 |
]
|
160 |
);
|
161 |
|
162 |
$this->add_control(
|
163 |
'logo_padding',
|
164 |
[
|
165 |
+
'label' => __( 'Title Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
166 |
+
'type' => Controls_Manager::DIMENSIONS,
|
167 |
+
'condition' => [
|
168 |
'el_site_branding' => 'logo',
|
169 |
],
|
170 |
'size_units' => [ 'px', 'em', '%' ],
|
171 |
+
'selectors' => [
|
172 |
'{{WRAPPER}} .elementor-branding .custom-logo' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
173 |
],
|
174 |
]
|
179 |
$this->start_controls_section(
|
180 |
'section_desc_style',
|
181 |
[
|
182 |
+
'label' => __( 'Description Options', 'navmenu-addon-for-elementor' ),
|
183 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
184 |
'condition' => [
|
185 |
'el_site_branding' => 'title',
|
186 |
],
|
190 |
$this->add_control(
|
191 |
'branding_description_color',
|
192 |
[
|
193 |
+
'label' => __( 'Description Color', 'navmenu-addon-for-elementor' ),
|
194 |
+
'type' => Controls_Manager::COLOR,
|
195 |
'condition' => [
|
196 |
'el_site_branding' => 'title',
|
197 |
],
|
198 |
+
'scheme' => [
|
199 |
+
'type' => Scheme_Color::get_type(),
|
200 |
'value' => Scheme_Color::COLOR_1,
|
201 |
],
|
202 |
'selectors' => [
|
208 |
$this->add_control(
|
209 |
'desc_padding',
|
210 |
[
|
211 |
+
'label' => __( 'Description Padding - Default 1em', 'navmenu-addon-for-elementor' ),
|
212 |
+
'type' => Controls_Manager::DIMENSIONS,
|
213 |
+
'condition' => [
|
214 |
'el_site_branding' => 'title',
|
215 |
],
|
216 |
'size_units' => [ 'px', 'em', '%' ],
|
217 |
+
'selectors' => [
|
218 |
'{{WRAPPER}} .elementor-branding .site-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
219 |
],
|
220 |
]
|
223 |
$this->add_group_control(
|
224 |
Group_Control_Typography::get_type(),
|
225 |
[
|
226 |
+
'name' => 'desc_typography',
|
227 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
228 |
'condition' => [
|
229 |
'el_site_branding' => 'title',
|
230 |
],
|
231 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
232 |
+
'selector' => '{{WRAPPER}} .elementor-branding .site-description',
|
233 |
]
|
234 |
);
|
235 |
|
239 |
'section_branding_borders',
|
240 |
[
|
241 |
'label' => __( 'Branding Border', 'navmenu-addon-for-elementor' ),
|
242 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
243 |
]
|
244 |
);
|
245 |
|
246 |
$this->add_group_control(
|
247 |
Group_Control_Border::get_type(),
|
248 |
[
|
249 |
+
'name' => 'border',
|
250 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
251 |
+
'default' => '1px',
|
252 |
'selector' => '{{WRAPPER}} .elementor-branding',
|
253 |
]
|
254 |
);
|
256 |
$this->add_control(
|
257 |
'border_radius',
|
258 |
[
|
259 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
260 |
+
'type' => Controls_Manager::DIMENSIONS,
|
261 |
'size_units' => [ 'px', '%' ],
|
262 |
+
'selectors' => [
|
263 |
'{{WRAPPER}} .elementor-branding' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
264 |
],
|
265 |
]
|
modules/menus/widgets/elementor-search.php
CHANGED
@@ -50,33 +50,33 @@ class Elementor_Search extends Widget_Base {
|
|
50 |
$this->add_responsive_control(
|
51 |
'align',
|
52 |
[
|
53 |
-
'label'
|
54 |
-
'type'
|
55 |
-
'options'
|
56 |
-
'left'
|
57 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
58 |
-
'icon'
|
59 |
],
|
60 |
'center' => [
|
61 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
62 |
-
'icon'
|
63 |
],
|
64 |
-
'right'
|
65 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
66 |
-
'icon'
|
67 |
],
|
68 |
],
|
69 |
'prefix_class' => 'elementor%s-align-',
|
70 |
-
'default'
|
71 |
]
|
72 |
);
|
73 |
|
74 |
$this->add_group_control(
|
75 |
Group_Control_Typography::get_type(),
|
76 |
[
|
77 |
-
'name'
|
78 |
-
'label'
|
79 |
-
'scheme'
|
80 |
'selector' => '{{WRAPPER}} .elementor-search',
|
81 |
]
|
82 |
);
|
@@ -87,17 +87,17 @@ class Elementor_Search extends Widget_Base {
|
|
87 |
'section_search_style',
|
88 |
[
|
89 |
'label' => __( 'Search', 'navmenu-addon-for-elementor' ),
|
90 |
-
'tab'
|
91 |
]
|
92 |
);
|
93 |
|
94 |
$this->add_control(
|
95 |
'search_text_color',
|
96 |
[
|
97 |
-
'label'
|
98 |
-
'type'
|
99 |
-
'scheme'
|
100 |
-
'type'
|
101 |
'value' => Scheme_Color::COLOR_1,
|
102 |
],
|
103 |
'default' => '#333333',
|
@@ -110,10 +110,10 @@ class Elementor_Search extends Widget_Base {
|
|
110 |
$this->add_control(
|
111 |
'search_bg_color',
|
112 |
[
|
113 |
-
'label'
|
114 |
-
'type'
|
115 |
-
'scheme'
|
116 |
-
'type'
|
117 |
'value' => Scheme_Color::COLOR_1,
|
118 |
],
|
119 |
'default' => '#ffffff',
|
@@ -126,10 +126,10 @@ class Elementor_Search extends Widget_Base {
|
|
126 |
$this->add_control(
|
127 |
'box_padding',
|
128 |
[
|
129 |
-
'label'
|
130 |
-
'type'
|
131 |
'size_units' => [ 'px', 'em', '%' ],
|
132 |
-
'selectors'
|
133 |
'{{WRAPPER}} .elementor-search' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
134 |
],
|
135 |
]
|
@@ -141,16 +141,16 @@ class Elementor_Search extends Widget_Base {
|
|
141 |
'section_search_borders',
|
142 |
[
|
143 |
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
144 |
-
'tab'
|
145 |
]
|
146 |
);
|
147 |
|
148 |
$this->add_group_control(
|
149 |
Group_Control_Border::get_type(),
|
150 |
[
|
151 |
-
'name'
|
152 |
-
'label'
|
153 |
-
'default'
|
154 |
'selector' => '{{WRAPPER}} .elementor-search',
|
155 |
]
|
156 |
);
|
@@ -158,10 +158,10 @@ class Elementor_Search extends Widget_Base {
|
|
158 |
$this->add_control(
|
159 |
'border_radius',
|
160 |
[
|
161 |
-
'label'
|
162 |
-
'type'
|
163 |
'size_units' => [ 'px', '%' ],
|
164 |
-
'selectors'
|
165 |
'{{WRAPPER}} .elementor-search' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
166 |
],
|
167 |
]
|
50 |
$this->add_responsive_control(
|
51 |
'align',
|
52 |
[
|
53 |
+
'label' => __( 'Alignment', 'navmenu-addon-for-elementor' ),
|
54 |
+
'type' => Controls_Manager::CHOOSE,
|
55 |
+
'options' => [
|
56 |
+
'left' => [
|
57 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
58 |
+
'icon' => 'fa fa-align-left',
|
59 |
],
|
60 |
'center' => [
|
61 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
62 |
+
'icon' => 'fa fa-align-center',
|
63 |
],
|
64 |
+
'right' => [
|
65 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
66 |
+
'icon' => 'fa fa-align-right',
|
67 |
],
|
68 |
],
|
69 |
'prefix_class' => 'elementor%s-align-',
|
70 |
+
'default' => '',
|
71 |
]
|
72 |
);
|
73 |
|
74 |
$this->add_group_control(
|
75 |
Group_Control_Typography::get_type(),
|
76 |
[
|
77 |
+
'name' => 'search_typography',
|
78 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
79 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
80 |
'selector' => '{{WRAPPER}} .elementor-search',
|
81 |
]
|
82 |
);
|
87 |
'section_search_style',
|
88 |
[
|
89 |
'label' => __( 'Search', 'navmenu-addon-for-elementor' ),
|
90 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
91 |
]
|
92 |
);
|
93 |
|
94 |
$this->add_control(
|
95 |
'search_text_color',
|
96 |
[
|
97 |
+
'label' => __( 'Box Color', 'navmenu-addon-for-elementor' ),
|
98 |
+
'type' => Controls_Manager::COLOR,
|
99 |
+
'scheme' => [
|
100 |
+
'type' => Scheme_Color::get_type(),
|
101 |
'value' => Scheme_Color::COLOR_1,
|
102 |
],
|
103 |
'default' => '#333333',
|
110 |
$this->add_control(
|
111 |
'search_bg_color',
|
112 |
[
|
113 |
+
'label' => __( 'Box Background', 'navmenu-addon-for-elementor' ),
|
114 |
+
'type' => Controls_Manager::COLOR,
|
115 |
+
'scheme' => [
|
116 |
+
'type' => Scheme_Color::get_type(),
|
117 |
'value' => Scheme_Color::COLOR_1,
|
118 |
],
|
119 |
'default' => '#ffffff',
|
126 |
$this->add_control(
|
127 |
'box_padding',
|
128 |
[
|
129 |
+
'label' => __( 'Search Padding', 'navmenu-addon-for-elementor' ),
|
130 |
+
'type' => Controls_Manager::DIMENSIONS,
|
131 |
'size_units' => [ 'px', 'em', '%' ],
|
132 |
+
'selectors' => [
|
133 |
'{{WRAPPER}} .elementor-search' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
134 |
],
|
135 |
]
|
141 |
'section_search_borders',
|
142 |
[
|
143 |
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
144 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
145 |
]
|
146 |
);
|
147 |
|
148 |
$this->add_group_control(
|
149 |
Group_Control_Border::get_type(),
|
150 |
[
|
151 |
+
'name' => 'border',
|
152 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
153 |
+
'default' => '1px',
|
154 |
'selector' => '{{WRAPPER}} .elementor-search',
|
155 |
]
|
156 |
);
|
158 |
$this->add_control(
|
159 |
'border_radius',
|
160 |
[
|
161 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
162 |
+
'type' => Controls_Manager::DIMENSIONS,
|
163 |
'size_units' => [ 'px', '%' ],
|
164 |
+
'selectors' => [
|
165 |
'{{WRAPPER}} .elementor-search' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
166 |
],
|
167 |
]
|
modules/menus/widgets/mega-menu.php
CHANGED
@@ -51,8 +51,8 @@ class Mega_Menu extends Widget_Base {
|
|
51 |
$this->add_control(
|
52 |
'el_mega_menu',
|
53 |
[
|
54 |
-
'label'
|
55 |
-
'type'
|
56 |
'default' => '',
|
57 |
]
|
58 |
);
|
@@ -60,33 +60,33 @@ class Mega_Menu extends Widget_Base {
|
|
60 |
$this->add_responsive_control(
|
61 |
'align',
|
62 |
[
|
63 |
-
'label'
|
64 |
-
'type'
|
65 |
-
'options'
|
66 |
-
'left'
|
67 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
68 |
-
'icon'
|
69 |
],
|
70 |
'center' => [
|
71 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
72 |
-
'icon'
|
73 |
],
|
74 |
-
'right'
|
75 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
76 |
-
'icon'
|
77 |
],
|
78 |
],
|
79 |
'prefix_class' => 'elementor%s-align-',
|
80 |
-
'default'
|
81 |
]
|
82 |
);
|
83 |
|
84 |
$this->add_group_control(
|
85 |
Group_Control_Typography::get_type(),
|
86 |
[
|
87 |
-
'name'
|
88 |
-
'label'
|
89 |
-
'scheme'
|
90 |
'selector' => '{{WRAPPER}} .cbp-hsmenu',
|
91 |
]
|
92 |
);
|
@@ -103,9 +103,9 @@ class Mega_Menu extends Widget_Base {
|
|
103 |
$this->add_group_control(
|
104 |
Group_Control_Typography::get_type(),
|
105 |
[
|
106 |
-
'name'
|
107 |
-
'label'
|
108 |
-
'scheme'
|
109 |
'selector' => '{{WRAPPER}} .cbp-hssubmenu',
|
110 |
]
|
111 |
);
|
@@ -116,17 +116,17 @@ class Mega_Menu extends Widget_Base {
|
|
116 |
'navbar_style',
|
117 |
[
|
118 |
'label' => __( 'NavBar', 'navmenu-addon-for-elementor' ),
|
119 |
-
'tab'
|
120 |
]
|
121 |
);
|
122 |
|
123 |
$this->add_control(
|
124 |
'navbar_color',
|
125 |
[
|
126 |
-
'label'
|
127 |
-
'type'
|
128 |
-
'scheme'
|
129 |
-
'type'
|
130 |
'value' => Scheme_Color::COLOR_1,
|
131 |
],
|
132 |
'default' => '#ffffff',
|
@@ -139,10 +139,10 @@ class Mega_Menu extends Widget_Base {
|
|
139 |
$this->add_control(
|
140 |
'navbar_bg_color',
|
141 |
[
|
142 |
-
'label'
|
143 |
-
'type'
|
144 |
-
'scheme'
|
145 |
-
'type'
|
146 |
'value' => Scheme_Color::COLOR_1,
|
147 |
],
|
148 |
'default' => '#00275e',
|
@@ -155,10 +155,10 @@ class Mega_Menu extends Widget_Base {
|
|
155 |
$this->add_control(
|
156 |
'navbar_padding',
|
157 |
[
|
158 |
-
'label'
|
159 |
-
'type'
|
160 |
'size_units' => [ 'px', 'em', '%' ],
|
161 |
-
'selectors'
|
162 |
'{{WRAPPER}} .cbp-hsmenu > li > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
163 |
],
|
164 |
]
|
@@ -176,10 +176,10 @@ class Mega_Menu extends Widget_Base {
|
|
176 |
$this->add_control(
|
177 |
'megamenu_color',
|
178 |
[
|
179 |
-
'label'
|
180 |
-
'type'
|
181 |
-
'scheme'
|
182 |
-
'type'
|
183 |
'value' => Scheme_Color::COLOR_1,
|
184 |
],
|
185 |
'default' => '#a2a2a2',
|
@@ -192,10 +192,10 @@ class Mega_Menu extends Widget_Base {
|
|
192 |
$this->add_control(
|
193 |
'megamenu_hover',
|
194 |
[
|
195 |
-
'label'
|
196 |
-
'type'
|
197 |
-
'scheme'
|
198 |
-
'type'
|
199 |
'value' => Scheme_Color::COLOR_1,
|
200 |
],
|
201 |
'default' => '#a2a2a2',
|
@@ -208,10 +208,10 @@ class Mega_Menu extends Widget_Base {
|
|
208 |
$this->add_control(
|
209 |
'megamenu_bg_color',
|
210 |
[
|
211 |
-
'label'
|
212 |
-
'type'
|
213 |
-
'scheme'
|
214 |
-
'type'
|
215 |
'value' => Scheme_Color::COLOR_1,
|
216 |
],
|
217 |
'default' => '#f7f7f7',
|
@@ -236,17 +236,17 @@ class Mega_Menu extends Widget_Base {
|
|
236 |
}
|
237 |
|
238 |
$args = array(
|
239 |
-
'fallback_cb'
|
240 |
-
'container'
|
241 |
-
'before'
|
242 |
-
'after'
|
243 |
-
'menu_id'
|
244 |
-
'menu_class'
|
245 |
-
'theme_location'
|
246 |
-
'menu'
|
247 |
-
'echo'
|
248 |
-
'depth'
|
249 |
-
'walker'
|
250 |
);
|
251 |
?>
|
252 |
|
51 |
$this->add_control(
|
52 |
'el_mega_menu',
|
53 |
[
|
54 |
+
'label' => __( 'Select Menu', 'navmenu-addon-for-elementor' ),
|
55 |
+
'type' => Controls_Manager::SELECT, 'options' => navmenu_navbar_menu_choices(),
|
56 |
'default' => '',
|
57 |
]
|
58 |
);
|
60 |
$this->add_responsive_control(
|
61 |
'align',
|
62 |
[
|
63 |
+
'label' => __( 'Alignment', 'navmenu-addon-for-elementor' ),
|
64 |
+
'type' => Controls_Manager::CHOOSE,
|
65 |
+
'options' => [
|
66 |
+
'left' => [
|
67 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
68 |
+
'icon' => 'fa fa-align-left',
|
69 |
],
|
70 |
'center' => [
|
71 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
72 |
+
'icon' => 'fa fa-align-center',
|
73 |
],
|
74 |
+
'right' => [
|
75 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
76 |
+
'icon' => 'fa fa-align-right',
|
77 |
],
|
78 |
],
|
79 |
'prefix_class' => 'elementor%s-align-',
|
80 |
+
'default' => '',
|
81 |
]
|
82 |
);
|
83 |
|
84 |
$this->add_group_control(
|
85 |
Group_Control_Typography::get_type(),
|
86 |
[
|
87 |
+
'name' => 'navbar_typography',
|
88 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
89 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
90 |
'selector' => '{{WRAPPER}} .cbp-hsmenu',
|
91 |
]
|
92 |
);
|
103 |
$this->add_group_control(
|
104 |
Group_Control_Typography::get_type(),
|
105 |
[
|
106 |
+
'name' => 'megamenu_typography',
|
107 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
108 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
109 |
'selector' => '{{WRAPPER}} .cbp-hssubmenu',
|
110 |
]
|
111 |
);
|
116 |
'navbar_style',
|
117 |
[
|
118 |
'label' => __( 'NavBar', 'navmenu-addon-for-elementor' ),
|
119 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
120 |
]
|
121 |
);
|
122 |
|
123 |
$this->add_control(
|
124 |
'navbar_color',
|
125 |
[
|
126 |
+
'label' => __( 'Color', 'navmenu-addon-for-elementor' ),
|
127 |
+
'type' => Controls_Manager::COLOR,
|
128 |
+
'scheme' => [
|
129 |
+
'type' => Scheme_Color::get_type(),
|
130 |
'value' => Scheme_Color::COLOR_1,
|
131 |
],
|
132 |
'default' => '#ffffff',
|
139 |
$this->add_control(
|
140 |
'navbar_bg_color',
|
141 |
[
|
142 |
+
'label' => __( 'Background', 'navmenu-addon-for-elementor' ),
|
143 |
+
'type' => Controls_Manager::COLOR,
|
144 |
+
'scheme' => [
|
145 |
+
'type' => Scheme_Color::get_type(),
|
146 |
'value' => Scheme_Color::COLOR_1,
|
147 |
],
|
148 |
'default' => '#00275e',
|
155 |
$this->add_control(
|
156 |
'navbar_padding',
|
157 |
[
|
158 |
+
'label' => __( 'Padding', 'navmenu-addon-for-elementor' ),
|
159 |
+
'type' => Controls_Manager::DIMENSIONS,
|
160 |
'size_units' => [ 'px', 'em', '%' ],
|
161 |
+
'selectors' => [
|
162 |
'{{WRAPPER}} .cbp-hsmenu > li > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
163 |
],
|
164 |
]
|
176 |
$this->add_control(
|
177 |
'megamenu_color',
|
178 |
[
|
179 |
+
'label' => __( 'Color', 'navmenu-addon-for-elementor' ),
|
180 |
+
'type' => Controls_Manager::COLOR,
|
181 |
+
'scheme' => [
|
182 |
+
'type' => Scheme_Color::get_type(),
|
183 |
'value' => Scheme_Color::COLOR_1,
|
184 |
],
|
185 |
'default' => '#a2a2a2',
|
192 |
$this->add_control(
|
193 |
'megamenu_hover',
|
194 |
[
|
195 |
+
'label' => __( 'hover', 'navmenu-addon-for-elementor' ),
|
196 |
+
'type' => Controls_Manager::COLOR,
|
197 |
+
'scheme' => [
|
198 |
+
'type' => Scheme_Color::get_type(),
|
199 |
'value' => Scheme_Color::COLOR_1,
|
200 |
],
|
201 |
'default' => '#a2a2a2',
|
208 |
$this->add_control(
|
209 |
'megamenu_bg_color',
|
210 |
[
|
211 |
+
'label' => __( 'Background', 'navmenu-addon-for-elementor' ),
|
212 |
+
'type' => Controls_Manager::COLOR,
|
213 |
+
'scheme' => [
|
214 |
+
'type' => Scheme_Color::get_type(),
|
215 |
'value' => Scheme_Color::COLOR_1,
|
216 |
],
|
217 |
'default' => '#f7f7f7',
|
236 |
}
|
237 |
|
238 |
$args = array(
|
239 |
+
'fallback_cb' => false,
|
240 |
+
'container' => false,
|
241 |
+
'before' => '',
|
242 |
+
'after' => '',
|
243 |
+
'menu_id' => 'mega-menu',
|
244 |
+
'menu_class' => 'cbp-hsmenu',
|
245 |
+
'theme_location' => 'nav_mega_menu', // creating a fake location for better functional control
|
246 |
+
'menu' => $mega_menu,
|
247 |
+
'echo' => true,
|
248 |
+
'depth' => 0,
|
249 |
+
'walker' => '',
|
250 |
);
|
251 |
?>
|
252 |
|
modules/menus/widgets/navmenu-overlay.php
CHANGED
@@ -51,8 +51,8 @@ class Navmenu_Overlay extends Widget_Base {
|
|
51 |
$this->add_control(
|
52 |
'el_overlay_menu',
|
53 |
[
|
54 |
-
'label'
|
55 |
-
'type'
|
56 |
'default' => '',
|
57 |
]
|
58 |
);
|
@@ -60,23 +60,23 @@ class Navmenu_Overlay extends Widget_Base {
|
|
60 |
$this->add_responsive_control(
|
61 |
'item_align',
|
62 |
[
|
63 |
-
'label'
|
64 |
-
'type'
|
65 |
-
'options'
|
66 |
-
'left'
|
67 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
68 |
-
'icon'
|
69 |
],
|
70 |
'center' => [
|
71 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
72 |
-
'icon'
|
73 |
],
|
74 |
-
'right'
|
75 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
76 |
-
'icon'
|
77 |
],
|
78 |
],
|
79 |
-
'default'
|
80 |
'selectors' => [
|
81 |
'{{WRAPPER}} .overlay-navigation ul li, .overlay-navigation ul ul li' => 'text-align: {{VALUE}};',
|
82 |
],
|
@@ -86,9 +86,9 @@ class Navmenu_Overlay extends Widget_Base {
|
|
86 |
$this->add_group_control(
|
87 |
Group_Control_Typography::get_type(),
|
88 |
[
|
89 |
-
'name'
|
90 |
-
'label'
|
91 |
-
'scheme'
|
92 |
'selector' => '{{WRAPPER}} .overlay-navigation a',
|
93 |
]
|
94 |
);
|
@@ -99,17 +99,17 @@ class Navmenu_Overlay extends Widget_Base {
|
|
99 |
'section_style',
|
100 |
[
|
101 |
'label' => __( 'Overlay Style', 'navmenu-addon-for-elementor' ),
|
102 |
-
'tab'
|
103 |
]
|
104 |
);
|
105 |
|
106 |
$this->add_control(
|
107 |
'item_color',
|
108 |
[
|
109 |
-
'label'
|
110 |
-
'type'
|
111 |
-
'scheme'
|
112 |
-
'type'
|
113 |
'value' => Scheme_Color::COLOR_1,
|
114 |
],
|
115 |
'default' => '#ffffff',
|
@@ -122,10 +122,10 @@ class Navmenu_Overlay extends Widget_Base {
|
|
122 |
$this->add_control(
|
123 |
'item_hover',
|
124 |
[
|
125 |
-
'label'
|
126 |
-
'type'
|
127 |
-
'scheme'
|
128 |
-
'type'
|
129 |
'value' => Scheme_Color::COLOR_1,
|
130 |
],
|
131 |
'default' => '#ffffff',
|
@@ -138,10 +138,10 @@ class Navmenu_Overlay extends Widget_Base {
|
|
138 |
$this->add_control(
|
139 |
'overlay_bg_color',
|
140 |
[
|
141 |
-
'label'
|
142 |
-
'type'
|
143 |
-
'scheme'
|
144 |
-
'type'
|
145 |
'value' => Scheme_Color::COLOR_1,
|
146 |
],
|
147 |
'default' => '',
|
@@ -154,10 +154,10 @@ class Navmenu_Overlay extends Widget_Base {
|
|
154 |
$this->add_control(
|
155 |
'section_padding',
|
156 |
[
|
157 |
-
'label'
|
158 |
-
'type'
|
159 |
'size_units' => [ 'px', 'em', '%' ],
|
160 |
-
'selectors'
|
161 |
'{{WRAPPER}} .overlay-navigation ul li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
162 |
],
|
163 |
]
|
@@ -169,17 +169,17 @@ class Navmenu_Overlay extends Widget_Base {
|
|
169 |
'toggle_style',
|
170 |
[
|
171 |
'label' => __( 'Toggle Style', 'navmenu-addon-for-elementor' ),
|
172 |
-
'tab'
|
173 |
]
|
174 |
);
|
175 |
|
176 |
$this->add_control(
|
177 |
'toggle_color',
|
178 |
[
|
179 |
-
'label'
|
180 |
-
'type'
|
181 |
-
'scheme'
|
182 |
-
'type'
|
183 |
'value' => Scheme_Color::COLOR_1,
|
184 |
],
|
185 |
'default' => '#ffffff',
|
@@ -192,10 +192,10 @@ class Navmenu_Overlay extends Widget_Base {
|
|
192 |
$this->add_control(
|
193 |
'toggle_bg_color',
|
194 |
[
|
195 |
-
'label'
|
196 |
-
'type'
|
197 |
-
'scheme'
|
198 |
-
'type'
|
199 |
'value' => Scheme_Color::COLOR_1,
|
200 |
],
|
201 |
'default' => '#000000',
|
@@ -208,10 +208,10 @@ class Navmenu_Overlay extends Widget_Base {
|
|
208 |
$this->add_control(
|
209 |
'border_radius',
|
210 |
[
|
211 |
-
'label'
|
212 |
-
'type'
|
213 |
'size_units' => [ 'px', '%' ],
|
214 |
-
'selectors'
|
215 |
'{{WRAPPER}} #touch-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
216 |
],
|
217 |
]
|
@@ -232,15 +232,15 @@ class Navmenu_Overlay extends Widget_Base {
|
|
232 |
}
|
233 |
|
234 |
$overlay_menu_args = array(
|
235 |
-
'fallback_cb'
|
236 |
-
'container'
|
237 |
-
'menu_id'
|
238 |
-
'menu_class'
|
239 |
-
'theme_location'
|
240 |
-
'menu'
|
241 |
-
'echo'
|
242 |
-
'depth'
|
243 |
-
'walker'
|
244 |
);
|
245 |
?>
|
246 |
<!--<div class="navmenu-overlay">-->
|
51 |
$this->add_control(
|
52 |
'el_overlay_menu',
|
53 |
[
|
54 |
+
'label' => __( 'Select Menu', 'navmenu-addon-for-elementor' ),
|
55 |
+
'type' => Controls_Manager::SELECT, 'options' => navmenu_navbar_menu_choices(),
|
56 |
'default' => '',
|
57 |
]
|
58 |
);
|
60 |
$this->add_responsive_control(
|
61 |
'item_align',
|
62 |
[
|
63 |
+
'label' => __( 'Item Alignment', 'navmenu-addon-for-elementor' ),
|
64 |
+
'type' => Controls_Manager::CHOOSE,
|
65 |
+
'options' => [
|
66 |
+
'left' => [
|
67 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
68 |
+
'icon' => 'fa fa-align-left',
|
69 |
],
|
70 |
'center' => [
|
71 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
72 |
+
'icon' => 'fa fa-align-center',
|
73 |
],
|
74 |
+
'right' => [
|
75 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
76 |
+
'icon' => 'fa fa-align-right',
|
77 |
],
|
78 |
],
|
79 |
+
'default' => 'center',
|
80 |
'selectors' => [
|
81 |
'{{WRAPPER}} .overlay-navigation ul li, .overlay-navigation ul ul li' => 'text-align: {{VALUE}};',
|
82 |
],
|
86 |
$this->add_group_control(
|
87 |
Group_Control_Typography::get_type(),
|
88 |
[
|
89 |
+
'name' => 'search_typography',
|
90 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
91 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
92 |
'selector' => '{{WRAPPER}} .overlay-navigation a',
|
93 |
]
|
94 |
);
|
99 |
'section_style',
|
100 |
[
|
101 |
'label' => __( 'Overlay Style', 'navmenu-addon-for-elementor' ),
|
102 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
103 |
]
|
104 |
);
|
105 |
|
106 |
$this->add_control(
|
107 |
'item_color',
|
108 |
[
|
109 |
+
'label' => __( 'Color', 'navmenu-addon-for-elementor' ),
|
110 |
+
'type' => Controls_Manager::COLOR,
|
111 |
+
'scheme' => [
|
112 |
+
'type' => Scheme_Color::get_type(),
|
113 |
'value' => Scheme_Color::COLOR_1,
|
114 |
],
|
115 |
'default' => '#ffffff',
|
122 |
$this->add_control(
|
123 |
'item_hover',
|
124 |
[
|
125 |
+
'label' => __( 'Hover', 'navmenu-addon-for-elementor' ),
|
126 |
+
'type' => Controls_Manager::COLOR,
|
127 |
+
'scheme' => [
|
128 |
+
'type' => Scheme_Color::get_type(),
|
129 |
'value' => Scheme_Color::COLOR_1,
|
130 |
],
|
131 |
'default' => '#ffffff',
|
138 |
$this->add_control(
|
139 |
'overlay_bg_color',
|
140 |
[
|
141 |
+
'label' => __( 'Overlay Background', 'navmenu-addon-for-elementor' ),
|
142 |
+
'type' => Controls_Manager::COLOR,
|
143 |
+
'scheme' => [
|
144 |
+
'type' => Scheme_Color::get_type(),
|
145 |
'value' => Scheme_Color::COLOR_1,
|
146 |
],
|
147 |
'default' => '',
|
154 |
$this->add_control(
|
155 |
'section_padding',
|
156 |
[
|
157 |
+
'label' => __( 'Padding', 'navmenu-addon-for-elementor' ),
|
158 |
+
'type' => Controls_Manager::DIMENSIONS,
|
159 |
'size_units' => [ 'px', 'em', '%' ],
|
160 |
+
'selectors' => [
|
161 |
'{{WRAPPER}} .overlay-navigation ul li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
162 |
],
|
163 |
]
|
169 |
'toggle_style',
|
170 |
[
|
171 |
'label' => __( 'Toggle Style', 'navmenu-addon-for-elementor' ),
|
172 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
173 |
]
|
174 |
);
|
175 |
|
176 |
$this->add_control(
|
177 |
'toggle_color',
|
178 |
[
|
179 |
+
'label' => __( 'Color', 'navmenu-addon-for-elementor' ),
|
180 |
+
'type' => Controls_Manager::COLOR,
|
181 |
+
'scheme' => [
|
182 |
+
'type' => Scheme_Color::get_type(),
|
183 |
'value' => Scheme_Color::COLOR_1,
|
184 |
],
|
185 |
'default' => '#ffffff',
|
192 |
$this->add_control(
|
193 |
'toggle_bg_color',
|
194 |
[
|
195 |
+
'label' => __( 'Background', 'navmenu-addon-for-elementor' ),
|
196 |
+
'type' => Controls_Manager::COLOR,
|
197 |
+
'scheme' => [
|
198 |
+
'type' => Scheme_Color::get_type(),
|
199 |
'value' => Scheme_Color::COLOR_1,
|
200 |
],
|
201 |
'default' => '#000000',
|
208 |
$this->add_control(
|
209 |
'border_radius',
|
210 |
[
|
211 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
212 |
+
'type' => Controls_Manager::DIMENSIONS,
|
213 |
'size_units' => [ 'px', '%' ],
|
214 |
+
'selectors' => [
|
215 |
'{{WRAPPER}} #touch-menu' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
216 |
],
|
217 |
]
|
232 |
}
|
233 |
|
234 |
$overlay_menu_args = array(
|
235 |
+
'fallback_cb' => false,
|
236 |
+
'container' => false,
|
237 |
+
'menu_id' => '',
|
238 |
+
'menu_class' => '',
|
239 |
+
'theme_location' => 'nav_overlay_menu', // creating a fake location for better functional control
|
240 |
+
'menu' => $overlay_menu,
|
241 |
+
'echo' => true,
|
242 |
+
'depth' => 1,
|
243 |
+
'walker' => '',
|
244 |
);
|
245 |
?>
|
246 |
<!--<div class="navmenu-overlay">-->
|
modules/search/module.info.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
}
|
5 |
|
6 |
return [
|
7 |
-
'title'
|
8 |
-
'required'
|
9 |
'default_activation' => true,
|
10 |
];
|
4 |
}
|
5 |
|
6 |
return [
|
7 |
+
'title' => __( 'Search', 'navmenu-addon-for-elementor' ),
|
8 |
+
'required' => true,
|
9 |
'default_activation' => true,
|
10 |
];
|
modules/search/widgets/elementor-search.php
CHANGED
@@ -52,33 +52,33 @@ class Elementor_Search extends Widget_Base {
|
|
52 |
$this->add_responsive_control(
|
53 |
'align',
|
54 |
[
|
55 |
-
'label'
|
56 |
-
'type'
|
57 |
-
'options'
|
58 |
-
'left'
|
59 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
60 |
-
'icon'
|
61 |
],
|
62 |
'center' => [
|
63 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
64 |
-
'icon'
|
65 |
],
|
66 |
-
'right'
|
67 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
68 |
-
'icon'
|
69 |
],
|
70 |
],
|
71 |
'prefix_class' => 'elementor%s-align-',
|
72 |
-
'default'
|
73 |
]
|
74 |
);
|
75 |
|
76 |
$this->add_group_control(
|
77 |
Group_Control_Typography::get_type(),
|
78 |
[
|
79 |
-
'name'
|
80 |
-
'label'
|
81 |
-
'scheme'
|
82 |
'selector' => '{{WRAPPER}} .elementor-search',
|
83 |
]
|
84 |
);
|
@@ -89,17 +89,17 @@ class Elementor_Search extends Widget_Base {
|
|
89 |
'section_search_style',
|
90 |
[
|
91 |
'label' => __( 'Search', 'navmenu-addon-for-elementor' ),
|
92 |
-
'tab'
|
93 |
]
|
94 |
);
|
95 |
|
96 |
$this->add_control(
|
97 |
'search_text_color',
|
98 |
[
|
99 |
-
'label'
|
100 |
-
'type'
|
101 |
-
'scheme'
|
102 |
-
'type'
|
103 |
'value' => Scheme_Color::COLOR_1,
|
104 |
],
|
105 |
'default' => '#333333',
|
@@ -112,10 +112,10 @@ class Elementor_Search extends Widget_Base {
|
|
112 |
$this->add_control(
|
113 |
'search_bg_color',
|
114 |
[
|
115 |
-
'label'
|
116 |
-
'type'
|
117 |
-
'scheme'
|
118 |
-
'type'
|
119 |
'value' => Scheme_Color::COLOR_1,
|
120 |
],
|
121 |
'default' => '#ffffff',
|
@@ -128,10 +128,10 @@ class Elementor_Search extends Widget_Base {
|
|
128 |
$this->add_control(
|
129 |
'box_padding',
|
130 |
[
|
131 |
-
'label'
|
132 |
-
'type'
|
133 |
'size_units' => [ 'px', 'em', '%' ],
|
134 |
-
'selectors'
|
135 |
'{{WRAPPER}} .elementor-search' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
136 |
],
|
137 |
]
|
@@ -143,16 +143,16 @@ class Elementor_Search extends Widget_Base {
|
|
143 |
'section_search_borders',
|
144 |
[
|
145 |
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
146 |
-
'tab'
|
147 |
]
|
148 |
);
|
149 |
|
150 |
$this->add_group_control(
|
151 |
Group_Control_Border::get_type(),
|
152 |
[
|
153 |
-
'name'
|
154 |
-
'label'
|
155 |
-
'default'
|
156 |
'selector' => '{{WRAPPER}} .elementor-search',
|
157 |
]
|
158 |
);
|
@@ -160,10 +160,10 @@ class Elementor_Search extends Widget_Base {
|
|
160 |
$this->add_control(
|
161 |
'border_radius',
|
162 |
[
|
163 |
-
'label'
|
164 |
-
'type'
|
165 |
'size_units' => [ 'px', '%' ],
|
166 |
-
'selectors'
|
167 |
'{{WRAPPER}} .elementor-search' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
168 |
],
|
169 |
]
|
52 |
$this->add_responsive_control(
|
53 |
'align',
|
54 |
[
|
55 |
+
'label' => __( 'Alignment', 'navmenu-addon-for-elementor' ),
|
56 |
+
'type' => Controls_Manager::CHOOSE,
|
57 |
+
'options' => [
|
58 |
+
'left' => [
|
59 |
'title' => __( 'Left', 'navmenu-addon-for-elementor' ),
|
60 |
+
'icon' => 'fa fa-align-left',
|
61 |
],
|
62 |
'center' => [
|
63 |
'title' => __( 'Center', 'navmenu-addon-for-elementor' ),
|
64 |
+
'icon' => 'fa fa-align-center',
|
65 |
],
|
66 |
+
'right' => [
|
67 |
'title' => __( 'Right', 'navmenu-addon-for-elementor' ),
|
68 |
+
'icon' => 'fa fa-align-right',
|
69 |
],
|
70 |
],
|
71 |
'prefix_class' => 'elementor%s-align-',
|
72 |
+
'default' => '',
|
73 |
]
|
74 |
);
|
75 |
|
76 |
$this->add_group_control(
|
77 |
Group_Control_Typography::get_type(),
|
78 |
[
|
79 |
+
'name' => 'search_typography',
|
80 |
+
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
|
81 |
+
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
|
82 |
'selector' => '{{WRAPPER}} .elementor-search',
|
83 |
]
|
84 |
);
|
89 |
'section_search_style',
|
90 |
[
|
91 |
'label' => __( 'Search', 'navmenu-addon-for-elementor' ),
|
92 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
93 |
]
|
94 |
);
|
95 |
|
96 |
$this->add_control(
|
97 |
'search_text_color',
|
98 |
[
|
99 |
+
'label' => __( 'Box Color', 'navmenu-addon-for-elementor' ),
|
100 |
+
'type' => Controls_Manager::COLOR,
|
101 |
+
'scheme' => [
|
102 |
+
'type' => Scheme_Color::get_type(),
|
103 |
'value' => Scheme_Color::COLOR_1,
|
104 |
],
|
105 |
'default' => '#333333',
|
112 |
$this->add_control(
|
113 |
'search_bg_color',
|
114 |
[
|
115 |
+
'label' => __( 'Box Background', 'navmenu-addon-for-elementor' ),
|
116 |
+
'type' => Controls_Manager::COLOR,
|
117 |
+
'scheme' => [
|
118 |
+
'type' => Scheme_Color::get_type(),
|
119 |
'value' => Scheme_Color::COLOR_1,
|
120 |
],
|
121 |
'default' => '#ffffff',
|
128 |
$this->add_control(
|
129 |
'box_padding',
|
130 |
[
|
131 |
+
'label' => __( 'Search Padding', 'navmenu-addon-for-elementor' ),
|
132 |
+
'type' => Controls_Manager::DIMENSIONS,
|
133 |
'size_units' => [ 'px', 'em', '%' ],
|
134 |
+
'selectors' => [
|
135 |
'{{WRAPPER}} .elementor-search' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
136 |
],
|
137 |
]
|
143 |
'section_search_borders',
|
144 |
[
|
145 |
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
146 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
147 |
]
|
148 |
);
|
149 |
|
150 |
$this->add_group_control(
|
151 |
Group_Control_Border::get_type(),
|
152 |
[
|
153 |
+
'name' => 'border',
|
154 |
+
'label' => __( 'Border', 'navmenu-addon-for-elementor' ),
|
155 |
+
'default' => '1px',
|
156 |
'selector' => '{{WRAPPER}} .elementor-search',
|
157 |
]
|
158 |
);
|
160 |
$this->add_control(
|
161 |
'border_radius',
|
162 |
[
|
163 |
+
'label' => __( 'Border Radius', 'navmenu-addon-for-elementor' ),
|
164 |
+
'type' => Controls_Manager::DIMENSIONS,
|
165 |
'size_units' => [ 'px', '%' ],
|
166 |
+
'selectors' => [
|
167 |
'{{WRAPPER}} .elementor-search' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
168 |
],
|
169 |
]
|
plugin.php
CHANGED
@@ -167,7 +167,7 @@ class Plugin {
|
|
167 |
'ElementorMenusFrontendConfig',
|
168 |
[
|
169 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
170 |
-
'nonce'
|
171 |
]
|
172 |
);
|
173 |
}
|
@@ -256,7 +256,7 @@ class Plugin {
|
|
256 |
'branding-elements',
|
257 |
[
|
258 |
'title' => __( 'Header Elements', 'navmenu-addon-for-elementor' ),
|
259 |
-
'icon'
|
260 |
],
|
261 |
1
|
262 |
);
|
167 |
'ElementorMenusFrontendConfig',
|
168 |
[
|
169 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
170 |
+
'nonce' => wp_create_nonce( 'elementor-menus-frontend' ),
|
171 |
]
|
172 |
);
|
173 |
}
|
256 |
'branding-elements',
|
257 |
[
|
258 |
'title' => __( 'Header Elements', 'navmenu-addon-for-elementor' ),
|
259 |
+
'icon' => 'font',
|
260 |
],
|
261 |
1
|
262 |
);
|
readme.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
**Contributors:** [themeisle](https://profiles.wordpress.org/themeisle), [codeinwp](https://profiles.wordpress.org/codeinwp)
|
4 |
**Tags:** elementor, pagebuilder, page builder, page builder menu, page builder navmenu, menu builder, builder navigation menus, navigation, menus, navmenu, nav menu
|
5 |
**Requires at least:** 4.4
|
6 |
-
**Tested up to:** 4.
|
7 |
**License:** GPLv3
|
8 |
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -53,6 +53,12 @@ Done! :)
|
|
53 |
* For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
|
54 |
|
55 |
## Changelog ##
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
### 1.1.0 - 2017-09-28 ###
|
57 |
|
58 |
* Added Themeisle SDK.
|
3 |
**Contributors:** [themeisle](https://profiles.wordpress.org/themeisle), [codeinwp](https://profiles.wordpress.org/codeinwp)
|
4 |
**Tags:** elementor, pagebuilder, page builder, page builder menu, page builder navmenu, menu builder, builder navigation menus, navigation, menus, navmenu, nav menu
|
5 |
**Requires at least:** 4.4
|
6 |
+
**Tested up to:** 4.9
|
7 |
**License:** GPLv3
|
8 |
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
53 |
* For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
|
54 |
|
55 |
## Changelog ##
|
56 |
+
### 1.1.1 - 2017-11-16 ###
|
57 |
+
|
58 |
+
* Add recommendation for Elementor Addons & Widgets.
|
59 |
+
* Tested up to 4.9.
|
60 |
+
|
61 |
+
|
62 |
### 1.1.0 - 2017-09-28 ###
|
63 |
|
64 |
* Added Themeisle SDK.
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Contributors: themeisle, codeinwp
|
4 |
Tags: elementor, pagebuilder, page builder, page builder menu, page builder navmenu, menu builder, builder navigation menus, navigation, menus, navmenu, nav menu
|
5 |
Requires at least: 4.4
|
6 |
-
Tested up to: 4.
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -53,6 +53,12 @@ Done! :)
|
|
53 |
* For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
|
54 |
|
55 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
= 1.1.0 - 2017-09-28 =
|
57 |
|
58 |
* Added Themeisle SDK.
|
3 |
Contributors: themeisle, codeinwp
|
4 |
Tags: elementor, pagebuilder, page builder, page builder menu, page builder navmenu, menu builder, builder navigation menus, navigation, menus, navmenu, nav menu
|
5 |
Requires at least: 4.4
|
6 |
+
Tested up to: 4.9
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
53 |
* For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
|
54 |
|
55 |
== Changelog ==
|
56 |
+
= 1.1.1 - 2017-11-16 =
|
57 |
+
|
58 |
+
* Add recommendation for Elementor Addons & Widgets.
|
59 |
+
* Tested up to 4.9.
|
60 |
+
|
61 |
+
|
62 |
= 1.1.0 - 2017-09-28 =
|
63 |
|
64 |
* Added Themeisle SDK.
|