Version Description
Folder order when adding a media library file to posts/pages fix, and infrastructure improvments
Download this release
Release Info
Developer | galdub |
Plugin | Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager |
Version | 2.3.5 |
Comparing to | |
See all releases |
Code changes from version 2.3.4 to 2.3.5
- assets/css/design.css +13 -53
- assets/css/media.css +0 -1
- assets/js/custom.js +41 -43
- folders.php +22 -8
- includes/class-review-box.php +1 -0
- includes/folders.class.php +310 -307
- readme.txt +7 -4
- templates/admin/admin-content.php +1 -1
- templates/admin/folder-deactivate-form.php +395 -400
- templates/admin/general-settings.php +185 -186
- templates/admin/help.php +1 -0
assets/css/design.css
CHANGED
@@ -1,16 +1,12 @@
|
|
1 |
.wcp-custom-menu {
|
2 |
padding-left: 0px;
|
3 |
-
|
4 |
}
|
5 |
-
|
6 |
.wcp-custom-menu {
|
7 |
position: relative;
|
8 |
}
|
9 |
-
|
10 |
.wcp-container ul {
|
11 |
list-style: none;
|
12 |
}
|
13 |
-
|
14 |
.wcp-container .route {
|
15 |
position: relative;
|
16 |
list-style-type: none;
|
@@ -25,7 +21,6 @@
|
|
25 |
z-index: -1;
|
26 |
background: transparent;
|
27 |
}
|
28 |
-
|
29 |
.wcp-container .route span {
|
30 |
position: absolute;
|
31 |
top: 2px;
|
@@ -37,7 +32,6 @@
|
|
37 |
font-size: 20px;
|
38 |
background: no-repeat;
|
39 |
}
|
40 |
-
|
41 |
.wcp-container .route .title {
|
42 |
position: absolute;
|
43 |
border: 0;
|
@@ -57,11 +51,9 @@
|
|
57 |
-moz-border-radius: 4px;
|
58 |
overflow: hidden;
|
59 |
}
|
60 |
-
|
61 |
.wcp-container .first-title {
|
62 |
margin-left: 10px;
|
63 |
}
|
64 |
-
|
65 |
.wcp-container .space {
|
66 |
position: relative;
|
67 |
list-style-type: none;
|
@@ -73,45 +65,36 @@
|
|
73 |
height: 100%;
|
74 |
z-index: 1;
|
75 |
}
|
76 |
-
|
77 |
.wcp-container .first-space {
|
78 |
margin-left: 10px;
|
79 |
top: 10px;
|
80 |
}
|
81 |
-
|
82 |
i.fa-caret-right {
|
83 |
transition: 0.1s;
|
84 |
-webkit-transition: 0.1s;
|
85 |
-moz-transition: 0.1s;
|
86 |
}
|
87 |
-
|
88 |
li.active > span > i.fa-caret-right {
|
89 |
transform: rotate(90deg);
|
90 |
-webkit-transform: rotate(90deg);
|
91 |
-moz-transform: rotate(90deg);
|
92 |
}
|
93 |
-
|
94 |
li.active > span > i.fa-folder:before {
|
95 |
content: "\f07c";
|
96 |
}
|
97 |
-
|
98 |
.has-sub-tree > ul.ui-sortable li {
|
99 |
display: none;
|
100 |
}
|
101 |
-
|
102 |
.has-sub-tree.active > ul.ui-sortable > li {
|
103 |
display: block;
|
104 |
}
|
105 |
-
|
106 |
.nav-icon {
|
107 |
display: none;
|
108 |
left: -20px !important;
|
109 |
}
|
110 |
-
|
111 |
.has-sub-tree > .nav-icon {
|
112 |
display: block;
|
113 |
}
|
114 |
-
|
115 |
.wcp-content {
|
116 |
position: fixed !important;
|
117 |
top: 32px;
|
@@ -121,6 +104,7 @@ li.active > span > i.fa-folder:before {
|
|
121 |
box-sizing: border-box;
|
122 |
z-index: 1;
|
123 |
direction: ltr;
|
|
|
124 |
transition: all 0.15s linear;
|
125 |
-webkit-transition: all 0.15s linear;
|
126 |
-moz-transition: all 0.15s linear;
|
@@ -214,7 +198,6 @@ html[dir="rtl"] body.wp-admin #wpcontent {
|
|
214 |
.wcp-form-data .form-field {
|
215 |
padding: 0 0 10px 0;
|
216 |
}
|
217 |
-
|
218 |
.wcp-form-data .form-field input, .wcp-form-data .form-field select {
|
219 |
width: 100%;
|
220 |
}
|
@@ -420,11 +403,9 @@ span.total-count {
|
|
420 |
-webkit-transform: rotate(90deg);
|
421 |
-moz-transform: rotate(90deg);
|
422 |
}
|
423 |
-
|
424 |
.route.active > .ui-icon > .folder-icon-folder:before {
|
425 |
content: "\e90c";
|
426 |
}
|
427 |
-
|
428 |
.wcp-container .route span.total-count {
|
429 |
position: relative;
|
430 |
font-size: 8px;
|
@@ -470,13 +451,13 @@ span.total-count {
|
|
470 |
margin-right: 5px;
|
471 |
}
|
472 |
.wcp-container .route .dynamic-menu ul > li > a > span span {
|
473 |
-
top: auto;
|
474 |
-
height: auto;
|
475 |
-
width: auto;
|
476 |
-
margin: 0;
|
477 |
-
left: auto;
|
478 |
-
vertical-align: baseline;
|
479 |
-
display: inline;
|
480 |
}
|
481 |
.dynamic-menu li.new-folder {
|
482 |
border-bottom: solid 1px #d8d8d8;
|
@@ -568,7 +549,6 @@ td.wcp_move.column-wcp_move {
|
|
568 |
.ui-draggable-dragging {
|
569 |
z-index: 1051 !important;
|
570 |
}
|
571 |
-
|
572 |
.wcp-hover-list {
|
573 |
background: #008ec2 !important;
|
574 |
color: #fff;
|
@@ -606,7 +586,6 @@ span.wcp-item {
|
|
606 |
.tree-structure .folder-view:hover {
|
607 |
background: #008ec2;
|
608 |
color: #ffffff;
|
609 |
-
|
610 |
}
|
611 |
.wcp-drop-hover-list a.folder-view:before {
|
612 |
width: 100%;
|
@@ -683,7 +662,6 @@ span.wcp-item {
|
|
683 |
border-right: 1px solid #ccc;
|
684 |
cursor: col-resize;
|
685 |
}
|
686 |
-
|
687 |
div#custom-menu {
|
688 |
padding-bottom: 120px;
|
689 |
padding-left: 4px;
|
@@ -721,10 +699,9 @@ div#custom-menu {
|
|
721 |
.wcp-container .route.is-high > h3 > span.star-icon {
|
722 |
display: block;
|
723 |
}
|
724 |
-
|
725 |
content: "\e907";
|
726 |
}
|
727 |
-
|
728 |
.tree-structure li {
|
729 |
display: block;
|
730 |
width: 16.667%;
|
@@ -834,6 +811,9 @@ body.upload-php.eml-grid #wpbody {
|
|
834 |
right: auto !important;;
|
835 |
height: auto;
|
836 |
}
|
|
|
|
|
|
|
837 |
span.upgrade-message {
|
838 |
padding: 0px 0 10px;
|
839 |
background: #fff;
|
@@ -846,14 +826,12 @@ span.upgrade-message a.pink, span.upgrade-message span.pink {
|
|
846 |
text-decoration: none;
|
847 |
font-weight: bold;
|
848 |
}
|
849 |
-
|
850 |
.media-toolbar.sticky-media {
|
851 |
position: fixed;
|
852 |
top: 32px;
|
853 |
right: 18px !important;
|
854 |
left: auto;
|
855 |
}
|
856 |
-
|
857 |
.media-position {
|
858 |
width: 1px;
|
859 |
height: 1px;
|
@@ -910,7 +888,6 @@ span.upgrade-message a.pink, span.upgrade-message span.pink {
|
|
910 |
.hide-folders-area .wcp-container {
|
911 |
display: none;
|
912 |
}
|
913 |
-
|
914 |
.wcp-hide-show-buttons .toggle-buttons.active {
|
915 |
display: block;
|
916 |
}
|
@@ -938,7 +915,6 @@ button.button.organize-button:hover, button.button.organize-button:focus {
|
|
938 |
color: #ffffff;
|
939 |
/*border: solid 1px #bc0f50;*/
|
940 |
}
|
941 |
-
|
942 |
button.button.organize-button:hover:after {
|
943 |
content: "";
|
944 |
width: 100%;
|
@@ -1004,14 +980,12 @@ span.media-info-message {
|
|
1004 |
line-height: 20px;
|
1005 |
font-weight: bold;
|
1006 |
color: #f51366;
|
1007 |
-
padding: 0 0 0
|
1008 |
display: none !important;;
|
1009 |
}
|
1010 |
span.media-info-message.active {
|
1011 |
display: block !important;
|
1012 |
}
|
1013 |
-
|
1014 |
-
|
1015 |
/* custom popup css */
|
1016 |
.folder-popup-form {
|
1017 |
position: fixed;
|
@@ -1061,11 +1035,9 @@ span.media-info-message.active {
|
|
1061 |
-webkit-animation: fa-spin 0.75s infinite linear;
|
1062 |
animation: fa-spin 0.75s infinite linear;
|
1063 |
}
|
1064 |
-
|
1065 |
[data-tooltip] {
|
1066 |
position: relative; /* opinion 1 */
|
1067 |
}
|
1068 |
-
|
1069 |
/* Applies to all tooltips */
|
1070 |
[data-tooltip]::before,
|
1071 |
[data-tooltip]::after {
|
@@ -1085,11 +1057,9 @@ span.media-info-message.active {
|
|
1085 |
}
|
1086 |
[data-tooltip]::after {
|
1087 |
content: attr(data-tooltip); /* magic! */
|
1088 |
-
|
1089 |
/* most of the rest of this is opinion */
|
1090 |
font-family: Helvetica, sans-serif;
|
1091 |
text-align: center;
|
1092 |
-
|
1093 |
/*
|
1094 |
Let the content set the size of the tooltips
|
1095 |
but this will also keep them from being obnoxious
|
@@ -1106,7 +1076,6 @@ span.media-info-message.active {
|
|
1106 |
color: #fff;
|
1107 |
z-index: 1000; /* absurdity 2 */
|
1108 |
}
|
1109 |
-
|
1110 |
/* Make the tooltips respond to hover */
|
1111 |
[data-tooltip]:hover::before,
|
1112 |
[data-tooltip]:hover::after {
|
@@ -1131,7 +1100,6 @@ span.media-info-message.active {
|
|
1131 |
left: 50%;
|
1132 |
transform: translate(-50%, -.5em);
|
1133 |
}
|
1134 |
-
|
1135 |
#remove-folder-item {
|
1136 |
width: 126px !important;
|
1137 |
}
|
@@ -1220,7 +1188,6 @@ span.media-info-message.active {
|
|
1220 |
.folder-form-errors.active {
|
1221 |
display: block;
|
1222 |
}
|
1223 |
-
|
1224 |
.sticky-menu #adminmenuwrap {
|
1225 |
position: relative !important;
|
1226 |
}
|
@@ -1245,7 +1212,6 @@ span.folder-loader-ajax {
|
|
1245 |
transform: scale(1);
|
1246 |
}
|
1247 |
}
|
1248 |
-
|
1249 |
@keyframes scaleAnimation {
|
1250 |
0% {
|
1251 |
opacity: 0;
|
@@ -1326,12 +1292,10 @@ span.folder-loader-ajax {
|
|
1326 |
stroke-dasharray: 151px 151px;
|
1327 |
stroke: #2CE0A7;
|
1328 |
}
|
1329 |
-
|
1330 |
#successAnimationCheck {
|
1331 |
stroke-dasharray: 36px 36px;
|
1332 |
stroke: #2CE0A7;
|
1333 |
}
|
1334 |
-
|
1335 |
#successAnimationResult {
|
1336 |
fill: #2CE0A7;
|
1337 |
opacity: 0;
|
@@ -1352,7 +1316,6 @@ svg#successAnimation {
|
|
1352 |
.folder-loader-ajax img.active {
|
1353 |
display: inline-block;
|
1354 |
}
|
1355 |
-
|
1356 |
#successAnimation.animated {
|
1357 |
-webkit-animation: 1s ease-out 0s 1 both scaleAnimation;
|
1358 |
animation: 1s ease-out 0s 1 both scaleAnimation;
|
@@ -1389,7 +1352,6 @@ svg#successAnimation {
|
|
1389 |
width: 25%;
|
1390 |
}
|
1391 |
}
|
1392 |
-
|
1393 |
@media screen and (max-width: 780px) {
|
1394 |
.wcp-content {
|
1395 |
left: 0px;
|
@@ -1401,8 +1363,6 @@ svg#successAnimation {
|
|
1401 |
width: 33.33%;
|
1402 |
}
|
1403 |
}
|
1404 |
-
|
1405 |
-
|
1406 |
@media screen and (max-width: 640px) {
|
1407 |
.wcp-content {
|
1408 |
left: 0px;
|
1 |
.wcp-custom-menu {
|
2 |
padding-left: 0px;
|
|
|
3 |
}
|
|
|
4 |
.wcp-custom-menu {
|
5 |
position: relative;
|
6 |
}
|
|
|
7 |
.wcp-container ul {
|
8 |
list-style: none;
|
9 |
}
|
|
|
10 |
.wcp-container .route {
|
11 |
position: relative;
|
12 |
list-style-type: none;
|
21 |
z-index: -1;
|
22 |
background: transparent;
|
23 |
}
|
|
|
24 |
.wcp-container .route span {
|
25 |
position: absolute;
|
26 |
top: 2px;
|
32 |
font-size: 20px;
|
33 |
background: no-repeat;
|
34 |
}
|
|
|
35 |
.wcp-container .route .title {
|
36 |
position: absolute;
|
37 |
border: 0;
|
51 |
-moz-border-radius: 4px;
|
52 |
overflow: hidden;
|
53 |
}
|
|
|
54 |
.wcp-container .first-title {
|
55 |
margin-left: 10px;
|
56 |
}
|
|
|
57 |
.wcp-container .space {
|
58 |
position: relative;
|
59 |
list-style-type: none;
|
65 |
height: 100%;
|
66 |
z-index: 1;
|
67 |
}
|
|
|
68 |
.wcp-container .first-space {
|
69 |
margin-left: 10px;
|
70 |
top: 10px;
|
71 |
}
|
|
|
72 |
i.fa-caret-right {
|
73 |
transition: 0.1s;
|
74 |
-webkit-transition: 0.1s;
|
75 |
-moz-transition: 0.1s;
|
76 |
}
|
|
|
77 |
li.active > span > i.fa-caret-right {
|
78 |
transform: rotate(90deg);
|
79 |
-webkit-transform: rotate(90deg);
|
80 |
-moz-transform: rotate(90deg);
|
81 |
}
|
|
|
82 |
li.active > span > i.fa-folder:before {
|
83 |
content: "\f07c";
|
84 |
}
|
|
|
85 |
.has-sub-tree > ul.ui-sortable li {
|
86 |
display: none;
|
87 |
}
|
|
|
88 |
.has-sub-tree.active > ul.ui-sortable > li {
|
89 |
display: block;
|
90 |
}
|
|
|
91 |
.nav-icon {
|
92 |
display: none;
|
93 |
left: -20px !important;
|
94 |
}
|
|
|
95 |
.has-sub-tree > .nav-icon {
|
96 |
display: block;
|
97 |
}
|
|
|
98 |
.wcp-content {
|
99 |
position: fixed !important;
|
100 |
top: 32px;
|
104 |
box-sizing: border-box;
|
105 |
z-index: 1;
|
106 |
direction: ltr;
|
107 |
+
direction: ltr;
|
108 |
transition: all 0.15s linear;
|
109 |
-webkit-transition: all 0.15s linear;
|
110 |
-moz-transition: all 0.15s linear;
|
198 |
.wcp-form-data .form-field {
|
199 |
padding: 0 0 10px 0;
|
200 |
}
|
|
|
201 |
.wcp-form-data .form-field input, .wcp-form-data .form-field select {
|
202 |
width: 100%;
|
203 |
}
|
403 |
-webkit-transform: rotate(90deg);
|
404 |
-moz-transform: rotate(90deg);
|
405 |
}
|
|
|
406 |
.route.active > .ui-icon > .folder-icon-folder:before {
|
407 |
content: "\e90c";
|
408 |
}
|
|
|
409 |
.wcp-container .route span.total-count {
|
410 |
position: relative;
|
411 |
font-size: 8px;
|
451 |
margin-right: 5px;
|
452 |
}
|
453 |
.wcp-container .route .dynamic-menu ul > li > a > span span {
|
454 |
+
top: auto;
|
455 |
+
height: auto;
|
456 |
+
width: auto;
|
457 |
+
margin: 0;
|
458 |
+
left: auto;
|
459 |
+
vertical-align: baseline;
|
460 |
+
display: inline;
|
461 |
}
|
462 |
.dynamic-menu li.new-folder {
|
463 |
border-bottom: solid 1px #d8d8d8;
|
549 |
.ui-draggable-dragging {
|
550 |
z-index: 1051 !important;
|
551 |
}
|
|
|
552 |
.wcp-hover-list {
|
553 |
background: #008ec2 !important;
|
554 |
color: #fff;
|
586 |
.tree-structure .folder-view:hover {
|
587 |
background: #008ec2;
|
588 |
color: #ffffff;
|
|
|
589 |
}
|
590 |
.wcp-drop-hover-list a.folder-view:before {
|
591 |
width: 100%;
|
662 |
border-right: 1px solid #ccc;
|
663 |
cursor: col-resize;
|
664 |
}
|
|
|
665 |
div#custom-menu {
|
666 |
padding-bottom: 120px;
|
667 |
padding-left: 4px;
|
699 |
.wcp-container .route.is-high > h3 > span.star-icon {
|
700 |
display: block;
|
701 |
}
|
702 |
+
.wcp-container .route span.star-icon:after {
|
703 |
content: "\e907";
|
704 |
}
|
|
|
705 |
.tree-structure li {
|
706 |
display: block;
|
707 |
width: 16.667%;
|
811 |
right: auto !important;;
|
812 |
height: auto;
|
813 |
}
|
814 |
+
#footer-thankyou {
|
815 |
+
display: none;
|
816 |
+
}
|
817 |
span.upgrade-message {
|
818 |
padding: 0px 0 10px;
|
819 |
background: #fff;
|
826 |
text-decoration: none;
|
827 |
font-weight: bold;
|
828 |
}
|
|
|
829 |
.media-toolbar.sticky-media {
|
830 |
position: fixed;
|
831 |
top: 32px;
|
832 |
right: 18px !important;
|
833 |
left: auto;
|
834 |
}
|
|
|
835 |
.media-position {
|
836 |
width: 1px;
|
837 |
height: 1px;
|
888 |
.hide-folders-area .wcp-container {
|
889 |
display: none;
|
890 |
}
|
|
|
891 |
.wcp-hide-show-buttons .toggle-buttons.active {
|
892 |
display: block;
|
893 |
}
|
915 |
color: #ffffff;
|
916 |
/*border: solid 1px #bc0f50;*/
|
917 |
}
|
|
|
918 |
button.button.organize-button:hover:after {
|
919 |
content: "";
|
920 |
width: 100%;
|
980 |
line-height: 20px;
|
981 |
font-weight: bold;
|
982 |
color: #f51366;
|
983 |
+
padding: 0 0 10px 0;
|
984 |
display: none !important;;
|
985 |
}
|
986 |
span.media-info-message.active {
|
987 |
display: block !important;
|
988 |
}
|
|
|
|
|
989 |
/* custom popup css */
|
990 |
.folder-popup-form {
|
991 |
position: fixed;
|
1035 |
-webkit-animation: fa-spin 0.75s infinite linear;
|
1036 |
animation: fa-spin 0.75s infinite linear;
|
1037 |
}
|
|
|
1038 |
[data-tooltip] {
|
1039 |
position: relative; /* opinion 1 */
|
1040 |
}
|
|
|
1041 |
/* Applies to all tooltips */
|
1042 |
[data-tooltip]::before,
|
1043 |
[data-tooltip]::after {
|
1057 |
}
|
1058 |
[data-tooltip]::after {
|
1059 |
content: attr(data-tooltip); /* magic! */
|
|
|
1060 |
/* most of the rest of this is opinion */
|
1061 |
font-family: Helvetica, sans-serif;
|
1062 |
text-align: center;
|
|
|
1063 |
/*
|
1064 |
Let the content set the size of the tooltips
|
1065 |
but this will also keep them from being obnoxious
|
1076 |
color: #fff;
|
1077 |
z-index: 1000; /* absurdity 2 */
|
1078 |
}
|
|
|
1079 |
/* Make the tooltips respond to hover */
|
1080 |
[data-tooltip]:hover::before,
|
1081 |
[data-tooltip]:hover::after {
|
1100 |
left: 50%;
|
1101 |
transform: translate(-50%, -.5em);
|
1102 |
}
|
|
|
1103 |
#remove-folder-item {
|
1104 |
width: 126px !important;
|
1105 |
}
|
1188 |
.folder-form-errors.active {
|
1189 |
display: block;
|
1190 |
}
|
|
|
1191 |
.sticky-menu #adminmenuwrap {
|
1192 |
position: relative !important;
|
1193 |
}
|
1212 |
transform: scale(1);
|
1213 |
}
|
1214 |
}
|
|
|
1215 |
@keyframes scaleAnimation {
|
1216 |
0% {
|
1217 |
opacity: 0;
|
1292 |
stroke-dasharray: 151px 151px;
|
1293 |
stroke: #2CE0A7;
|
1294 |
}
|
|
|
1295 |
#successAnimationCheck {
|
1296 |
stroke-dasharray: 36px 36px;
|
1297 |
stroke: #2CE0A7;
|
1298 |
}
|
|
|
1299 |
#successAnimationResult {
|
1300 |
fill: #2CE0A7;
|
1301 |
opacity: 0;
|
1316 |
.folder-loader-ajax img.active {
|
1317 |
display: inline-block;
|
1318 |
}
|
|
|
1319 |
#successAnimation.animated {
|
1320 |
-webkit-animation: 1s ease-out 0s 1 both scaleAnimation;
|
1321 |
animation: 1s ease-out 0s 1 both scaleAnimation;
|
1352 |
width: 25%;
|
1353 |
}
|
1354 |
}
|
|
|
1355 |
@media screen and (max-width: 780px) {
|
1356 |
.wcp-content {
|
1357 |
left: 0px;
|
1363 |
width: 33.33%;
|
1364 |
}
|
1365 |
}
|
|
|
|
|
1366 |
@media screen and (max-width: 640px) {
|
1367 |
.wcp-content {
|
1368 |
left: 0px;
|
assets/css/media.css
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
width: 66%;
|
4 |
}
|
5 |
.media-modal-content .media-frame select.attachment-filters {
|
6 |
-
width: auto;
|
7 |
width: 28% !important;
|
8 |
}
|
9 |
#media-attachment-taxonomy-filter {
|
3 |
width: 66%;
|
4 |
}
|
5 |
.media-modal-content .media-frame select.attachment-filters {
|
|
|
6 |
width: 28% !important;
|
7 |
}
|
8 |
#media-attachment-taxonomy-filter {
|
assets/js/custom.js
CHANGED
@@ -74,7 +74,7 @@ jQuery(document).ready(function(){
|
|
74 |
add_menu_to_list();
|
75 |
jQuery(".folder-popup-form").hide();
|
76 |
jQuery(".folder-popup-form").removeClass("disabled");
|
77 |
-
|
78 |
if(jQuery("#media-attachment-taxonomy-filter").length) {
|
79 |
fileFolderID = result.term_id;
|
80 |
resetMediaData(0);
|
@@ -120,7 +120,7 @@ jQuery(document).ready(function(){
|
|
120 |
add_menu_to_list();
|
121 |
jQuery(".folder-popup-form").hide();
|
122 |
jQuery(".folder-popup-form").removeClass("disabled");
|
123 |
-
|
124 |
if(jQuery("#media-attachment-taxonomy-filter").length) {
|
125 |
resetMediaData(0)
|
126 |
}
|
@@ -259,14 +259,14 @@ function triggerInlineUpdate() {
|
|
259 |
}
|
260 |
|
261 |
function ajaxAnimation() {
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
}
|
271 |
|
272 |
function addFolder() {
|
@@ -381,7 +381,7 @@ function resetMediaAndPosts() {
|
|
381 |
jQuery(".folder-loader-ajax").addClass("active");
|
382 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", false, function (res) {
|
383 |
if (!jQuery(".tree-structure").length) {
|
384 |
-
|
385 |
}
|
386 |
add_active_item_to_list();
|
387 |
add_menu_to_list();
|
@@ -527,11 +527,9 @@ jQuery(document).ready(function(){
|
|
527 |
folderCurrentURL = wcp_settings.page_url + jQuery(this).closest("li.route").data("slug");
|
528 |
jQuery(".form-loader-count").css("width", "100%");
|
529 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
530 |
-
|
531 |
if (!jQuery(".tree-structure").length) {
|
532 |
-
|
533 |
}
|
534 |
-
|
535 |
//add_menu_to_list();
|
536 |
triggerInlineUpdate();
|
537 |
});
|
@@ -560,11 +558,11 @@ jQuery(document).ready(function(){
|
|
560 |
jQuery(".wcp-container .route").removeClass("active-item");
|
561 |
if(!jQuery("#media-attachment-taxonomy-filter").length) {
|
562 |
folderCurrentURL = wcp_settings.page_url;
|
563 |
-
|
564 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
565 |
|
566 |
if (!jQuery(".tree-structure").length) {
|
567 |
-
|
568 |
}
|
569 |
|
570 |
triggerInlineUpdate();
|
@@ -599,7 +597,7 @@ jQuery(document).ready(function(){
|
|
599 |
res = jQuery.parseJSON(res);
|
600 |
if(res.status == "1") {
|
601 |
resetMediaAndPosts();
|
602 |
-
|
603 |
} else {
|
604 |
jQuery(".folder-popup-form").hide();
|
605 |
jQuery(".folder-popup-form").removeClass("disabled");
|
@@ -621,7 +619,7 @@ jQuery(document).ready(function(){
|
|
621 |
if(res.status == "1") {
|
622 |
// window.location.reload();
|
623 |
resetMediaAndPosts();
|
624 |
-
|
625 |
} else {
|
626 |
jQuery(".folder-popup-form").hide();
|
627 |
jQuery(".folder-popup-form").removeClass("disabled");
|
@@ -647,7 +645,7 @@ jQuery(document).ready(function(){
|
|
647 |
success: function (res) {
|
648 |
// window.location.reload();
|
649 |
resetMediaAndPosts();
|
650 |
-
|
651 |
}
|
652 |
});
|
653 |
}
|
@@ -697,11 +695,11 @@ jQuery(document).ready(function(){
|
|
697 |
jQuery(".header-posts a").addClass("active-item");
|
698 |
if(!jQuery("#media-attachment-taxonomy-filter").length) {
|
699 |
folderCurrentURL = wcp_settings.page_url;
|
700 |
-
|
701 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
702 |
|
703 |
if (!jQuery(".tree-structure").length) {
|
704 |
-
|
705 |
}
|
706 |
add_active_item_to_list();
|
707 |
triggerInlineUpdate();
|
@@ -721,11 +719,11 @@ jQuery(document).ready(function(){
|
|
721 |
jQuery(".un-categorised-items").addClass("active-item");
|
722 |
if(!jQuery("#media-attachment-taxonomy-filter").length) {
|
723 |
folderCurrentURL = wcp_settings.page_url+"-1";
|
724 |
-
|
725 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
726 |
|
727 |
if (!jQuery(".tree-structure").length) {
|
728 |
-
|
729 |
}
|
730 |
add_active_item_to_list();
|
731 |
triggerInlineUpdate();
|
@@ -760,7 +758,7 @@ jQuery(document).ready(function(){
|
|
760 |
success: function (res) {
|
761 |
//window.location.reload();
|
762 |
resetMediaAndPosts();
|
763 |
-
|
764 |
}
|
765 |
});
|
766 |
}
|
@@ -773,7 +771,7 @@ jQuery(document).ready(function(){
|
|
773 |
success: function (res) {
|
774 |
//window.location.reload();
|
775 |
resetMediaAndPosts();
|
776 |
-
|
777 |
}
|
778 |
});
|
779 |
} else if (ui.draggable.hasClass('attachment')) {
|
@@ -792,7 +790,7 @@ jQuery(document).ready(function(){
|
|
792 |
success: function (res) {
|
793 |
// window.location.reload();
|
794 |
resetMediaAndPosts();
|
795 |
-
|
796 |
}
|
797 |
});
|
798 |
}
|
@@ -864,7 +862,7 @@ jQuery(document).ready(function(){
|
|
864 |
success: function (res) {
|
865 |
// window.location.reload();
|
866 |
resetMediaAndPosts();
|
867 |
-
|
868 |
}
|
869 |
});
|
870 |
}
|
@@ -878,7 +876,7 @@ jQuery(document).ready(function(){
|
|
878 |
success: function (res) {
|
879 |
// window.location.reload();
|
880 |
resetMediaAndPosts();
|
881 |
-
|
882 |
}
|
883 |
});
|
884 |
} else if( ui.draggable.hasClass( 'attachment' ) ){
|
@@ -897,7 +895,7 @@ jQuery(document).ready(function(){
|
|
897 |
success: function (res) {
|
898 |
// window.location.reload();
|
899 |
resetMediaAndPosts();
|
900 |
-
|
901 |
}
|
902 |
});
|
903 |
}
|
@@ -1051,11 +1049,11 @@ jQuery(document).ready(function(){
|
|
1051 |
jQuery(".dynamic-menu").remove();
|
1052 |
jQuery(".active-menu").removeClass("active-menu");
|
1053 |
menuHtml = "<div class='dynamic-menu'><ul>" +
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
jQuery(this).after(menuHtml);
|
1060 |
jQuery(this).parents("li.route").addClass("active-menu");
|
1061 |
return false;
|
@@ -1105,7 +1103,7 @@ jQuery(document).ready(function(){
|
|
1105 |
jQuery("#wcp_folder_"+res.id).removeClass("is-high");
|
1106 |
}
|
1107 |
add_menu_to_list();
|
1108 |
-
|
1109 |
} else {
|
1110 |
jQuery(".folder-popup-form").hide();
|
1111 |
jQuery(".folder-popup-form").removeClass("disabled");
|
@@ -1206,7 +1204,7 @@ jQuery(document).ready(function(){
|
|
1206 |
jQuery(".form-loader-count").css("width", "0");
|
1207 |
add_menu_to_list();
|
1208 |
resetMediaAndPosts();
|
1209 |
-
|
1210 |
} else {
|
1211 |
jQuery(".folder-popup-form").hide();
|
1212 |
jQuery(".folder-popup-form").removeClass("disabled");
|
@@ -1254,7 +1252,7 @@ jQuery(document).ready(function(){
|
|
1254 |
jQuery("#error-folder-popup").show();
|
1255 |
} else {
|
1256 |
add_menu_to_list();
|
1257 |
-
|
1258 |
}
|
1259 |
}
|
1260 |
});
|
@@ -1270,11 +1268,11 @@ jQuery(document).ready(function(){
|
|
1270 |
jQuery(".dynamic-menu").remove();
|
1271 |
jQuery(".active-menu").removeClass("active-menu");
|
1272 |
menuHtml = "<div class='dynamic-menu'><ul>" +
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
jQuery(this).closest("h3.title").after(menuHtml);
|
1279 |
jQuery(this).parents("li.route").addClass("active-menu");
|
1280 |
});
|
@@ -1315,7 +1313,7 @@ jQuery(document).ready(function(){
|
|
1315 |
folderStatus = 1;
|
1316 |
}
|
1317 |
// add_menu_to_list();
|
1318 |
-
|
1319 |
}
|
1320 |
}
|
1321 |
});
|
74 |
add_menu_to_list();
|
75 |
jQuery(".folder-popup-form").hide();
|
76 |
jQuery(".folder-popup-form").removeClass("disabled");
|
77 |
+
ajaxAnimation();
|
78 |
if(jQuery("#media-attachment-taxonomy-filter").length) {
|
79 |
fileFolderID = result.term_id;
|
80 |
resetMediaData(0);
|
120 |
add_menu_to_list();
|
121 |
jQuery(".folder-popup-form").hide();
|
122 |
jQuery(".folder-popup-form").removeClass("disabled");
|
123 |
+
ajaxAnimation();
|
124 |
if(jQuery("#media-attachment-taxonomy-filter").length) {
|
125 |
resetMediaData(0)
|
126 |
}
|
259 |
}
|
260 |
|
261 |
function ajaxAnimation() {
|
262 |
+
jQuery(".folder-loader-ajax").addClass("active");
|
263 |
+
jQuery(".folder-loader-ajax img").removeClass("active");
|
264 |
+
jQuery(".folder-loader-ajax svg#successAnimation").addClass("active").addClass("animated");
|
265 |
+
setTimeout(function(){
|
266 |
+
jQuery(".folder-loader-ajax").removeClass("active");
|
267 |
+
jQuery(".folder-loader-ajax img").addClass("active");
|
268 |
+
jQuery(".folder-loader-ajax svg#successAnimation").removeClass("active").removeClass("animated");
|
269 |
+
}, 2000);
|
270 |
}
|
271 |
|
272 |
function addFolder() {
|
381 |
jQuery(".folder-loader-ajax").addClass("active");
|
382 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", false, function (res) {
|
383 |
if (!jQuery(".tree-structure").length) {
|
384 |
+
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
385 |
}
|
386 |
add_active_item_to_list();
|
387 |
add_menu_to_list();
|
527 |
folderCurrentURL = wcp_settings.page_url + jQuery(this).closest("li.route").data("slug");
|
528 |
jQuery(".form-loader-count").css("width", "100%");
|
529 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
|
|
530 |
if (!jQuery(".tree-structure").length) {
|
531 |
+
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
532 |
}
|
|
|
533 |
//add_menu_to_list();
|
534 |
triggerInlineUpdate();
|
535 |
});
|
558 |
jQuery(".wcp-container .route").removeClass("active-item");
|
559 |
if(!jQuery("#media-attachment-taxonomy-filter").length) {
|
560 |
folderCurrentURL = wcp_settings.page_url;
|
561 |
+
jQuery(".form-loader-count").css("width", "100%");
|
562 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
563 |
|
564 |
if (!jQuery(".tree-structure").length) {
|
565 |
+
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
566 |
}
|
567 |
|
568 |
triggerInlineUpdate();
|
597 |
res = jQuery.parseJSON(res);
|
598 |
if(res.status == "1") {
|
599 |
resetMediaAndPosts();
|
600 |
+
ajaxAnimation();
|
601 |
} else {
|
602 |
jQuery(".folder-popup-form").hide();
|
603 |
jQuery(".folder-popup-form").removeClass("disabled");
|
619 |
if(res.status == "1") {
|
620 |
// window.location.reload();
|
621 |
resetMediaAndPosts();
|
622 |
+
ajaxAnimation();
|
623 |
} else {
|
624 |
jQuery(".folder-popup-form").hide();
|
625 |
jQuery(".folder-popup-form").removeClass("disabled");
|
645 |
success: function (res) {
|
646 |
// window.location.reload();
|
647 |
resetMediaAndPosts();
|
648 |
+
ajaxAnimation();
|
649 |
}
|
650 |
});
|
651 |
}
|
695 |
jQuery(".header-posts a").addClass("active-item");
|
696 |
if(!jQuery("#media-attachment-taxonomy-filter").length) {
|
697 |
folderCurrentURL = wcp_settings.page_url;
|
698 |
+
jQuery(".form-loader-count").css("width", "100%");
|
699 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
700 |
|
701 |
if (!jQuery(".tree-structure").length) {
|
702 |
+
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
703 |
}
|
704 |
add_active_item_to_list();
|
705 |
triggerInlineUpdate();
|
719 |
jQuery(".un-categorised-items").addClass("active-item");
|
720 |
if(!jQuery("#media-attachment-taxonomy-filter").length) {
|
721 |
folderCurrentURL = wcp_settings.page_url+"-1";
|
722 |
+
jQuery(".form-loader-count").css("width", "100%");
|
723 |
jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", function () {
|
724 |
|
725 |
if (!jQuery(".tree-structure").length) {
|
726 |
+
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
727 |
}
|
728 |
add_active_item_to_list();
|
729 |
triggerInlineUpdate();
|
758 |
success: function (res) {
|
759 |
//window.location.reload();
|
760 |
resetMediaAndPosts();
|
761 |
+
ajaxAnimation();
|
762 |
}
|
763 |
});
|
764 |
}
|
771 |
success: function (res) {
|
772 |
//window.location.reload();
|
773 |
resetMediaAndPosts();
|
774 |
+
ajaxAnimation();
|
775 |
}
|
776 |
});
|
777 |
} else if (ui.draggable.hasClass('attachment')) {
|
790 |
success: function (res) {
|
791 |
// window.location.reload();
|
792 |
resetMediaAndPosts();
|
793 |
+
ajaxAnimation();
|
794 |
}
|
795 |
});
|
796 |
}
|
862 |
success: function (res) {
|
863 |
// window.location.reload();
|
864 |
resetMediaAndPosts();
|
865 |
+
ajaxAnimation();
|
866 |
}
|
867 |
});
|
868 |
}
|
876 |
success: function (res) {
|
877 |
// window.location.reload();
|
878 |
resetMediaAndPosts();
|
879 |
+
ajaxAnimation();
|
880 |
}
|
881 |
});
|
882 |
} else if( ui.draggable.hasClass( 'attachment' ) ){
|
895 |
success: function (res) {
|
896 |
// window.location.reload();
|
897 |
resetMediaAndPosts();
|
898 |
+
ajaxAnimation();
|
899 |
}
|
900 |
});
|
901 |
}
|
1049 |
jQuery(".dynamic-menu").remove();
|
1050 |
jQuery(".active-menu").removeClass("active-menu");
|
1051 |
menuHtml = "<div class='dynamic-menu'><ul>" +
|
1052 |
+
"<li class='new-folder'><a href='javascript:;'><span class='folder-icon-create_new_folder'></span> New Folder</a></li>" +
|
1053 |
+
"<li class='rename-folder'><a href='javascript:;'><span class='folder-icon-border_color'><span class='path1'></span><span class='path2'></span></span> Rename</a></li>" +
|
1054 |
+
"<li class='mark-folder'><a href='javascript:;'><span class='folder-icon-star_rate'></span>" + ((isHigh) ? " Remove Star" : "Add a Star") + "</a></li>" +
|
1055 |
+
"<li class='remove-folder'><a href='javascript:;'><span class='folder-icon-delete'></span> Delete</a></li>" +
|
1056 |
+
"</ul></div>";
|
1057 |
jQuery(this).after(menuHtml);
|
1058 |
jQuery(this).parents("li.route").addClass("active-menu");
|
1059 |
return false;
|
1103 |
jQuery("#wcp_folder_"+res.id).removeClass("is-high");
|
1104 |
}
|
1105 |
add_menu_to_list();
|
1106 |
+
ajaxAnimation();
|
1107 |
} else {
|
1108 |
jQuery(".folder-popup-form").hide();
|
1109 |
jQuery(".folder-popup-form").removeClass("disabled");
|
1204 |
jQuery(".form-loader-count").css("width", "0");
|
1205 |
add_menu_to_list();
|
1206 |
resetMediaAndPosts();
|
1207 |
+
ajaxAnimation();
|
1208 |
} else {
|
1209 |
jQuery(".folder-popup-form").hide();
|
1210 |
jQuery(".folder-popup-form").removeClass("disabled");
|
1252 |
jQuery("#error-folder-popup").show();
|
1253 |
} else {
|
1254 |
add_menu_to_list();
|
1255 |
+
ajaxAnimation();
|
1256 |
}
|
1257 |
}
|
1258 |
});
|
1268 |
jQuery(".dynamic-menu").remove();
|
1269 |
jQuery(".active-menu").removeClass("active-menu");
|
1270 |
menuHtml = "<div class='dynamic-menu'><ul>" +
|
1271 |
+
"<li class='new-folder'><a href='javascript:;'><span class='folder-icon-create_new_folder'></span> New Folder</a></li>" +
|
1272 |
+
"<li class='rename-folder'><a href='javascript:;'><span class='folder-icon-border_color'><span class='path1'></span><span class='path2'></span></span> Rename</a></li>" +
|
1273 |
+
"<li class='mark-folder'><a href='javascript:;'><span class='folder-icon-star_rate'></span>" + ((isHigh) ? " Remove Star" : "Add a Star") + "</a></li>" +
|
1274 |
+
"<li class='remove-folder'><a href='javascript:;'><span class='folder-icon-delete'></span> Delete</a></li>" +
|
1275 |
+
"</ul></div>";
|
1276 |
jQuery(this).closest("h3.title").after(menuHtml);
|
1277 |
jQuery(this).parents("li.route").addClass("active-menu");
|
1278 |
});
|
1313 |
folderStatus = 1;
|
1314 |
}
|
1315 |
// add_menu_to_list();
|
1316 |
+
ajaxAnimation();
|
1317 |
}
|
1318 |
}
|
1319 |
});
|
folders.php
CHANGED
@@ -2,20 +2,34 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Folders
|
4 |
* Description: Arrange media, pages, custom post types and posts into folders
|
5 |
-
* Version: 2.3.
|
6 |
* Author: Premio
|
7 |
* Author URI: https://premio.io/downloads/folders/
|
8 |
*/
|
9 |
|
10 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
11 |
|
12 |
-
|
13 |
-
define('
|
14 |
-
|
15 |
-
|
16 |
-
define(
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
|
21 |
register_activation_hook( __FILE__, array( 'WCP_Folders', 'activate' ) );
|
2 |
/**
|
3 |
* Plugin Name: Folders
|
4 |
* Description: Arrange media, pages, custom post types and posts into folders
|
5 |
+
* Version: 2.3.5
|
6 |
* Author: Premio
|
7 |
* Author URI: https://premio.io/downloads/folders/
|
8 |
*/
|
9 |
|
10 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
11 |
|
12 |
+
if(!defined("WCP_FOLDERS_PLUGIN_FILE")) {
|
13 |
+
define('WCP_FOLDERS_PLUGIN_FILE', __FILE__);
|
14 |
+
}
|
15 |
+
if(!defined("WCP_FOLDERS_PLUGIN_BASE")) {
|
16 |
+
define('WCP_FOLDERS_PLUGIN_BASE', plugin_basename(WCP_FOLDERS_PLUGIN_FILE));
|
17 |
+
}
|
18 |
+
if(!defined("WCP_FOLDER")) {
|
19 |
+
define('WCP_FOLDER', 'folders');
|
20 |
+
}
|
21 |
+
if(!defined("WCP_FOLDER_VAR")) {
|
22 |
+
define('WCP_FOLDER_VAR', 'folders_settings');
|
23 |
+
}
|
24 |
+
if(!defined("WCP_DS")) {
|
25 |
+
define("WCP_DS", DIRECTORY_SEPARATOR);
|
26 |
+
}
|
27 |
+
if(!defined("WCP_FOLDER_URL")) {
|
28 |
+
define('WCP_FOLDER_URL', plugin_dir_url(__FILE__));
|
29 |
+
}
|
30 |
+
if(!defined("WCP_FOLDER_VERSION")) {
|
31 |
+
define('WCP_FOLDER_VERSION', "2.3.5");
|
32 |
+
}
|
33 |
|
34 |
include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
|
35 |
register_activation_hook( __FILE__, array( 'WCP_Folders', 'activate' ) );
|
includes/class-review-box.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
class folders_review_box {
|
3 |
|
4 |
public $plugin_name = "Folders";
|
1 |
<?php
|
2 |
+
/* Free/Pro Class name change */
|
3 |
class folders_review_box {
|
4 |
|
5 |
public $plugin_name = "Folders";
|
includes/folders.class.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
3 |
-
|
4 |
class WCP_Folders
|
5 |
{
|
6 |
|
7 |
private static $instance;
|
8 |
|
9 |
-
|
10 |
|
11 |
private static $folders;
|
12 |
|
@@ -131,7 +131,7 @@ class WCP_Folders
|
|
131 |
#media-attachment-taxonomy-filter, .post-upload-ui .folder_for_media { border-color: <?php echo esc_attr($customize_folders['dropdown_color']) ?>; color: <?php echo esc_attr($customize_folders['dropdown_color']) ?> }
|
132 |
.folder_for_media option {color:#000000;}
|
133 |
.folder_for_media option:first-child {
|
134 |
-
|
135 |
}
|
136 |
<?php
|
137 |
}
|
@@ -164,7 +164,6 @@ class WCP_Folders
|
|
164 |
if (!isset($_REQUEST['media_folder'])) {
|
165 |
if (isset($default_folders[$typenow]) && !empty($default_folders[$typenow])) {
|
166 |
$admin_url .= $default_folders[$typenow];
|
167 |
-
// wp_redirect($admin_url);
|
168 |
?>
|
169 |
<script>
|
170 |
window.location = '<?php echo $admin_url ?>';
|
@@ -236,8 +235,7 @@ class WCP_Folders
|
|
236 |
if(self::is_for_this_post_type('attachment')) {
|
237 |
$post_type = self::get_custom_post_type('attachment');
|
238 |
global $typenow, $current_screen;
|
239 |
-
|
240 |
-
// echo "<pre>"; print_r($current_screen); die;
|
241 |
if(!class_exists('WCP_Tree')) {
|
242 |
$files = array(
|
243 |
'WCP_Tree' => WCP_DS . "includes" . WCP_DS . "tree.class.php"
|
@@ -249,18 +247,19 @@ class WCP_Folders
|
|
249 |
}
|
250 |
}
|
251 |
}
|
|
|
252 |
$options = WCP_Tree::get_folder_option_data($post_type);?>
|
253 |
<p class="attachments-category"><?php esc_html_e("Select a folder (Optional)", WCP_FOLDER) ?></p>
|
254 |
<p class="attachments-category"><?php esc_html_e("First select the folder, and the upload the files", WCP_FOLDER) ?><br/></p>
|
255 |
-
|
256 |
-
|
257 |
<option value="-1">- <?php esc_html_e('Uncategorized', WCP_FOLDER) ?></option>
|
258 |
<?php echo $options ?>
|
259 |
<?php if($typenow == "attachment" && isset($current_screen->base) && $current_screen->base == "upload") {?>
|
260 |
<option value="add-folder"><?php esc_html_e('+ Create a New Folder', WCP_FOLDER) ?></option>
|
261 |
<?php } ?>
|
262 |
</select>
|
263 |
-
|
264 |
<?php
|
265 |
}
|
266 |
}
|
@@ -275,25 +274,25 @@ class WCP_Folders
|
|
275 |
$postData = filter_input_array(INPUT_POST);
|
276 |
$errorCounter = 0;
|
277 |
if (!isset($postData['status']) || empty($postData['status'])) {
|
278 |
-
$response['message'] =
|
279 |
$errorCounter++;
|
280 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
281 |
-
$response['message'] =
|
282 |
$errorCounter++;
|
283 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
284 |
-
$response['message'] =
|
285 |
$errorCounter++;
|
286 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
287 |
-
$response['message'] =
|
288 |
$errorCounter++;
|
289 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
290 |
-
$response['message'] =
|
291 |
$errorCounter++;
|
292 |
} else {
|
293 |
$type = self::sanitize_options($postData['type']);
|
294 |
$nonce = self::sanitize_options($postData['nonce']);
|
295 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
296 |
-
$response['message'] =
|
297 |
$errorCounter++;
|
298 |
}
|
299 |
}
|
@@ -318,25 +317,25 @@ class WCP_Folders
|
|
318 |
$postData = filter_input_array(INPUT_POST);
|
319 |
$errorCounter = 0;
|
320 |
if (!isset($postData['status']) || empty($postData['status'])) {
|
321 |
-
$response['message'] =
|
322 |
$errorCounter++;
|
323 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
324 |
-
$response['message'] =
|
325 |
$errorCounter++;
|
326 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
327 |
-
$response['message'] =
|
328 |
$errorCounter++;
|
329 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
330 |
-
$response['message'] =
|
331 |
$errorCounter++;
|
332 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
333 |
-
$response['message'] =
|
334 |
$errorCounter++;
|
335 |
} else {
|
336 |
$type = self::sanitize_options($postData['type']);
|
337 |
$nonce = self::sanitize_options($postData['nonce']);
|
338 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
339 |
-
$response['message'] =
|
340 |
$errorCounter++;
|
341 |
}
|
342 |
}
|
@@ -360,16 +359,16 @@ class WCP_Folders
|
|
360 |
$postData = filter_input_array(INPUT_POST);
|
361 |
$errorCounter = 0;
|
362 |
if (!isset($postData['post_id']) || empty($postData['post_id'])) {
|
363 |
-
$response['message'] =
|
364 |
$errorCounter++;
|
365 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
366 |
-
$response['message'] =
|
367 |
$errorCounter++;
|
368 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
369 |
-
$response['message'] =
|
370 |
$errorCounter++;
|
371 |
} else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
|
372 |
-
$response['message'] =
|
373 |
$errorCounter++;
|
374 |
}
|
375 |
if ($errorCounter == 0) {
|
@@ -442,12 +441,11 @@ class WCP_Folders
|
|
442 |
$empty_items = self::get_total_empty_posts($post_type);
|
443 |
|
444 |
$post_type = self::get_custom_post_type($post_type);
|
445 |
-
|
446 |
$taxonomies = self::get_terms_hierarchical($post_type);
|
447 |
|
448 |
$response = array(
|
449 |
'status' => 1,
|
450 |
-
// 'data' => $terms_data,
|
451 |
'total_items' => $total_posts,
|
452 |
'taxonomies' => $taxonomies,
|
453 |
'empty_items' => $empty_items
|
@@ -471,13 +469,10 @@ class WCP_Folders
|
|
471 |
|
472 |
$post_type = self::get_custom_post_type($post_type);
|
473 |
|
474 |
-
// $terms_data = WCP_Tree::get_full_tree_data($post_type);
|
475 |
-
|
476 |
$taxonomies = self::get_terms_hierarchical($post_type);
|
477 |
|
478 |
$response = array(
|
479 |
'status' => 1,
|
480 |
-
// 'data' => $terms_data,
|
481 |
'total_items' => $total_posts,
|
482 |
'empty_items' => $empty_items,
|
483 |
'taxonomies' => $taxonomies
|
@@ -525,13 +520,41 @@ class WCP_Folders
|
|
525 |
return $args;
|
526 |
}
|
527 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
public function output_backbone_view_filters() {
|
|
|
529 |
wp_enqueue_script( 'folders-media', WCP_FOLDER_URL.'assets/js/media.js', array( 'media-editor', 'media-views' ), WCP_FOLDER_VERSION, true );
|
530 |
wp_localize_script( 'folders-media', 'folders_media_options', array(
|
531 |
'terms' => self::get_terms_hierarchical('media_folder'),
|
532 |
'taxonomy' => get_taxonomy('media_folder'),
|
533 |
'ajax_url' => admin_url("admin-ajax.php")
|
534 |
));
|
|
|
535 |
wp_enqueue_style( 'folders-media', WCP_FOLDER_URL . 'assets/css/media.css' , array(), WCP_FOLDER_VERSION);
|
536 |
}
|
537 |
|
@@ -692,13 +715,14 @@ class WCP_Folders
|
|
692 |
}
|
693 |
|
694 |
wp_dropdown_categories( array(
|
695 |
-
'show_option_all' =>
|
696 |
-
'show_option_none' =>
|
697 |
'option_none_value' => -1,
|
698 |
'orderby' => 'meta_value_num',
|
699 |
'order' => 'ASC',
|
700 |
'show_count' => true,
|
701 |
'hide_empty' => false,
|
|
|
702 |
'echo' => true,
|
703 |
'selected' => $current_term,
|
704 |
'hierarchical' => true,
|
@@ -742,12 +766,12 @@ class WCP_Folders
|
|
742 |
$response['errors'] = array();
|
743 |
$response['message'] = "";
|
744 |
$errorArray = [];
|
745 |
-
$errorMessage =
|
746 |
$postData = filter_input_array(INPUT_POST);
|
747 |
if(!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
|
748 |
$error = array(
|
749 |
"key" => "textarea_text",
|
750 |
-
"message" =>
|
751 |
);
|
752 |
$errorArray[] = $error;
|
753 |
}
|
@@ -768,14 +792,14 @@ class WCP_Folders
|
|
768 |
if(!isset($postData['folder_help_nonce']) || trim($postData['folder_help_nonce']) == "") {
|
769 |
$error = array(
|
770 |
"key" => "nonce",
|
771 |
-
"message" =>
|
772 |
);
|
773 |
$errorArray[] = $error;
|
774 |
} else {
|
775 |
if(!wp_verify_nonce($postData['folder_help_nonce'], 'wcp_folder_help_nonce')) {
|
776 |
$error = array(
|
777 |
"key" => "nonce",
|
778 |
-
"message" =>
|
779 |
);
|
780 |
$errorArray[] = $error;
|
781 |
}
|
@@ -838,13 +862,13 @@ class WCP_Folders
|
|
838 |
$errorCounter++;
|
839 |
$response['message'] = "Please provide reason";
|
840 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
841 |
-
$response['message'] =
|
842 |
$errorCounter++;
|
843 |
$response['valid'] = 0;
|
844 |
} else {
|
845 |
$nonce = self::sanitize_options($postData['nonce']);
|
846 |
if(!wp_verify_nonce($nonce, 'wcp_folder_deactivate_nonce')) {
|
847 |
-
$response['message'] =
|
848 |
$errorCounter++;
|
849 |
$response['valid'] = 0;
|
850 |
}
|
@@ -872,6 +896,7 @@ class WCP_Folders
|
|
872 |
</tr>
|
873 |
<tr>
|
874 |
<th>Plugin Version</th>
|
|
|
875 |
<td><?php echo esc_attr(WCP_FOLDER_VERSION) ?></td>
|
876 |
</tr>
|
877 |
<tr>
|
@@ -902,12 +927,7 @@ class WCP_Folders
|
|
902 |
$response['status'] = 1;
|
903 |
}
|
904 |
echo json_encode($response);
|
905 |
-
|
906 |
-
}
|
907 |
-
|
908 |
-
public function check_has_valid_key()
|
909 |
-
{
|
910 |
-
return 0;
|
911 |
}
|
912 |
|
913 |
public static function total_term_folders()
|
@@ -922,21 +942,6 @@ class WCP_Folders
|
|
922 |
return $total;
|
923 |
}
|
924 |
|
925 |
-
public function get_license_key_information($licenseKey)
|
926 |
-
{
|
927 |
-
return array();
|
928 |
-
}
|
929 |
-
|
930 |
-
public function get_license_key_data($licenseKey = '')
|
931 |
-
{
|
932 |
-
return array();
|
933 |
-
}
|
934 |
-
|
935 |
-
public function check_for_license_key()
|
936 |
-
{
|
937 |
-
return false;
|
938 |
-
}
|
939 |
-
|
940 |
public function wcp_remove_post_item()
|
941 |
{
|
942 |
$response = array();
|
@@ -963,22 +968,22 @@ class WCP_Folders
|
|
963 |
$postData = filter_input_array(INPUT_POST);
|
964 |
$errorCounter = 0;
|
965 |
if (!isset($postData['type']) || empty($postData['type'])) {
|
966 |
-
$response['message'] =
|
967 |
$errorCounter++;
|
968 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
969 |
-
$response['message'] =
|
970 |
$errorCounter++;
|
971 |
} else if (!current_user_can("manage_categories") || ($postData['type'] == "page" && !current_user_can("edit_pages"))) {
|
972 |
-
$response['message'] =
|
973 |
$errorCounter++;
|
974 |
} else if (!current_user_can("manage_categories") || ($postData['type'] != "page" && !current_user_can("edit_posts"))) {
|
975 |
-
$response['message'] =
|
976 |
$errorCounter++;
|
977 |
} else {
|
978 |
$type = self::sanitize_options($postData['type']);
|
979 |
$nonce = self::sanitize_options($postData['nonce']);
|
980 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
981 |
-
$response['message'] =
|
982 |
$errorCounter++;
|
983 |
}
|
984 |
}
|
@@ -1009,25 +1014,25 @@ class WCP_Folders
|
|
1009 |
$postData = filter_input_array(INPUT_POST);
|
1010 |
$errorCounter = 0;
|
1011 |
if (!isset($postData['width']) || empty($postData['width'])) {
|
1012 |
-
$response['message'] =
|
1013 |
$errorCounter++;
|
1014 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1015 |
-
$response['message'] =
|
1016 |
$errorCounter++;
|
1017 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1018 |
-
$response['message'] =
|
1019 |
$errorCounter++;
|
1020 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
1021 |
-
$response['message'] =
|
1022 |
$errorCounter++;
|
1023 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
1024 |
-
$response['message'] =
|
1025 |
$errorCounter++;
|
1026 |
} else {
|
1027 |
$type = self::sanitize_options($postData['type']);
|
1028 |
$nonce = self::sanitize_options($postData['nonce']);
|
1029 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
1030 |
-
$response['message'] =
|
1031 |
$errorCounter++;
|
1032 |
}
|
1033 |
}
|
@@ -1052,27 +1057,27 @@ class WCP_Folders
|
|
1052 |
$postData = filter_input_array(INPUT_POST);
|
1053 |
$errorCounter = 0;
|
1054 |
if (!isset($postData['post_ids']) || empty($postData['post_ids'])) {
|
1055 |
-
$response['message'] =
|
1056 |
$errorCounter++;
|
1057 |
} else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
|
1058 |
-
$response['message'] =
|
1059 |
$errorCounter++;
|
1060 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1061 |
-
$response['message'] =
|
1062 |
$errorCounter++;
|
1063 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1064 |
-
$response['message'] =
|
1065 |
$errorCounter++;
|
1066 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
1067 |
-
$response['message'] =
|
1068 |
$errorCounter++;
|
1069 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
1070 |
-
$response['message'] =
|
1071 |
$errorCounter++;
|
1072 |
} else {
|
1073 |
$folder_id = self::sanitize_options($postData['folder_id']);
|
1074 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$folder_id)) {
|
1075 |
-
$response['message'] =
|
1076 |
$errorCounter++;
|
1077 |
}
|
1078 |
}
|
@@ -1123,26 +1128,26 @@ class WCP_Folders
|
|
1123 |
$errorCounter = 0;
|
1124 |
if (!isset($postData['post_id']) || empty($postData['post_id'])) {
|
1125 |
$errorCounter++;
|
1126 |
-
$response['message'] =
|
1127 |
} else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
|
1128 |
$errorCounter++;
|
1129 |
-
$response['message'] =
|
1130 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1131 |
$errorCounter++;
|
1132 |
-
$response['message'] =
|
1133 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1134 |
-
$response['message'] =
|
1135 |
$errorCounter++;
|
1136 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
1137 |
-
$response['message'] =
|
1138 |
$errorCounter++;
|
1139 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
1140 |
-
$response['message'] =
|
1141 |
$errorCounter++;
|
1142 |
} else {
|
1143 |
$term_id = self::sanitize_options($postData['folder_id']);
|
1144 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
|
1145 |
-
$response['message'] =
|
1146 |
$errorCounter++;
|
1147 |
}
|
1148 |
}
|
@@ -1185,18 +1190,18 @@ class WCP_Folders
|
|
1185 |
$postData = filter_input_array(INPUT_POST);
|
1186 |
$errorCounter = 0;
|
1187 |
if (!current_user_can("manage_categories")) {
|
1188 |
-
$response['message'] =
|
1189 |
$errorCounter++;
|
1190 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1191 |
$errorCounter++;
|
1192 |
-
$response['message'] =
|
1193 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1194 |
-
$response['message'] =
|
1195 |
$errorCounter++;
|
1196 |
} else {
|
1197 |
$term_id = self::sanitize_options($postData['term_id']);
|
1198 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_highlight_term_'.$term_id)) {
|
1199 |
-
$response['message'] =
|
1200 |
$errorCounter++;
|
1201 |
}
|
1202 |
}
|
@@ -1228,21 +1233,21 @@ class WCP_Folders
|
|
1228 |
$postData = filter_input_array(INPUT_POST);
|
1229 |
$errorCounter = 0;
|
1230 |
if (!current_user_can("manage_categories")) {
|
1231 |
-
$response['message'] =
|
1232 |
$errorCounter++;
|
1233 |
} else if (!isset($postData['term_ids']) || empty($postData['term_ids'])) {
|
1234 |
$errorCounter++;
|
1235 |
-
$response['message'] =
|
1236 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1237 |
$errorCounter++;
|
1238 |
-
$response['message'] =
|
1239 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1240 |
-
$response['message'] =
|
1241 |
$errorCounter++;
|
1242 |
} else {
|
1243 |
$type = self::sanitize_options($postData['type']);
|
1244 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
|
1245 |
-
$response['message'] =
|
1246 |
$errorCounter++;
|
1247 |
}
|
1248 |
}
|
@@ -1260,6 +1265,7 @@ class WCP_Folders
|
|
1260 |
}
|
1261 |
$response['status'] = 1;
|
1262 |
$folder_type = self::get_custom_post_type($type);
|
|
|
1263 |
$response['options'] = WCP_Tree::get_option_data_for_select($folder_type);
|
1264 |
}
|
1265 |
echo json_encode($response);
|
@@ -1276,18 +1282,18 @@ class WCP_Folders
|
|
1276 |
$postData = filter_input_array(INPUT_POST);
|
1277 |
$errorCounter = 0;
|
1278 |
if (!current_user_can("manage_categories")) {
|
1279 |
-
$response['message'] =
|
1280 |
$errorCounter++;
|
1281 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1282 |
-
$response['message'] =
|
1283 |
$errorCounter++;
|
1284 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1285 |
-
$response['message'] = "Unable to create folder, Your request is not valid";
|
1286 |
$errorCounter++;
|
1287 |
} else {
|
1288 |
$term_id = self::sanitize_options($postData['term_id']);
|
1289 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
|
1290 |
-
$response['message'] =
|
1291 |
$errorCounter++;
|
1292 |
}
|
1293 |
}
|
@@ -1316,24 +1322,24 @@ class WCP_Folders
|
|
1316 |
$postData = filter_input_array(INPUT_POST);
|
1317 |
$errorCounter = 0;
|
1318 |
if (!current_user_can("manage_categories")) {
|
1319 |
-
$response['message'] =
|
1320 |
$errorCounter++;
|
1321 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1322 |
-
$response['message'] =
|
1323 |
$errorCounter++;
|
1324 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1325 |
-
$response['message'] =
|
1326 |
$errorCounter++;
|
1327 |
} else if (!isset($postData['parent_id'])) {
|
1328 |
-
$response['message'] =
|
1329 |
$errorCounter++;
|
1330 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1331 |
-
$response['message'] =
|
1332 |
$errorCounter++;
|
1333 |
} else {
|
1334 |
$term_id = self::sanitize_options($postData['term_id']);
|
1335 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
|
1336 |
-
$response['message'] =
|
1337 |
$errorCounter++;
|
1338 |
}
|
1339 |
}
|
@@ -1362,15 +1368,15 @@ class WCP_Folders
|
|
1362 |
$postData = filter_input_array(INPUT_POST);
|
1363 |
$errorCounter = 0;
|
1364 |
if (!isset($postData['type']) || empty($postData['type'])) {
|
1365 |
-
$response['message'] =
|
1366 |
$errorCounter++;
|
1367 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1368 |
-
$response['message'] =
|
1369 |
$errorCounter++;
|
1370 |
} else {
|
1371 |
$type = self::sanitize_options($postData['type']);
|
1372 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
|
1373 |
-
$response['message'] =
|
1374 |
$errorCounter++;
|
1375 |
}
|
1376 |
}
|
@@ -1447,21 +1453,21 @@ class WCP_Folders
|
|
1447 |
$postData = filter_input_array(INPUT_POST);
|
1448 |
$errorCounter = 0;
|
1449 |
if (!current_user_can("manage_categories")) {
|
1450 |
-
$error =
|
1451 |
$errorCounter++;
|
1452 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1453 |
-
$error =
|
1454 |
$errorCounter++;
|
1455 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1456 |
-
$error =
|
1457 |
$errorCounter++;
|
1458 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1459 |
-
$error = "Unable to delete folder, Your request is not valid";
|
1460 |
$errorCounter++;
|
1461 |
} else {
|
1462 |
$term_id = self::sanitize_options($postData['term_id']);
|
1463 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_delete_term_'.$term_id)) {
|
1464 |
-
$error = "Unable to delete folder, Your request is not valid";
|
1465 |
$errorCounter++;
|
1466 |
}
|
1467 |
}
|
@@ -1514,24 +1520,24 @@ class WCP_Folders
|
|
1514 |
$postData = $_REQUEST;
|
1515 |
$errorCounter = 0;
|
1516 |
if (!current_user_can("manage_categories")) {
|
1517 |
-
$error =
|
1518 |
$errorCounter++;
|
1519 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1520 |
-
$error =
|
1521 |
$errorCounter++;
|
1522 |
} else if (!isset($postData['name']) || empty($postData['name'])) {
|
1523 |
-
$error =
|
1524 |
$errorCounter++;
|
1525 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1526 |
-
$error =
|
1527 |
$errorCounter++;
|
1528 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1529 |
-
$error =
|
1530 |
$errorCounter++;
|
1531 |
} else {
|
1532 |
$term_id = self::sanitize_options($postData['term_id']);
|
1533 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_rename_term_'.$term_id)) {
|
1534 |
-
$error =
|
1535 |
$errorCounter++;
|
1536 |
}
|
1537 |
}
|
@@ -1552,7 +1558,7 @@ class WCP_Folders
|
|
1552 |
$response['status'] = 1;
|
1553 |
$response['term_title'] = $postData['name'];
|
1554 |
} else {
|
1555 |
-
$response['message'] =
|
1556 |
}
|
1557 |
} else {
|
1558 |
$response['error'] = 1;
|
@@ -1592,23 +1598,23 @@ class WCP_Folders
|
|
1592 |
$postData = $_REQUEST;
|
1593 |
$errorCounter = 0;
|
1594 |
if (!current_user_can("manage_categories")) {
|
1595 |
-
$error =
|
1596 |
$errorCounter++;
|
1597 |
} else if (!isset($postData['name']) || empty($postData['name'])) {
|
1598 |
-
$error =
|
1599 |
$errorCounter++;
|
1600 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1601 |
-
$error =
|
1602 |
$errorCounter++;
|
1603 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1604 |
$response['login'] = 0;
|
1605 |
-
$error =
|
1606 |
$errorCounter++;
|
1607 |
} else {
|
1608 |
$type = self::sanitize_options($postData['type']);
|
1609 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
|
1610 |
$response['login'] = 0;
|
1611 |
-
$error =
|
1612 |
$errorCounter++;
|
1613 |
}
|
1614 |
}
|
@@ -1642,7 +1648,8 @@ class WCP_Folders
|
|
1642 |
$rename_nonce = wp_create_nonce('wcp_folder_rename_term_'.$result['term_id']);
|
1643 |
$highlight_nonce = wp_create_nonce('wcp_folder_highlight_term_'.$result['term_id']);
|
1644 |
$term_nonce = wp_create_nonce('wcp_folder_term_'.$result['term_id']);
|
1645 |
-
|
|
|
1646 |
$string .= "</ul></li>";
|
1647 |
$response['term_data'] = $string;
|
1648 |
$response['parent_id'] = $parent;
|
@@ -1657,11 +1664,11 @@ class WCP_Folders
|
|
1657 |
$response['is_key_active'] = $is_active;
|
1658 |
$response['folders'] = $folders;
|
1659 |
} else {
|
1660 |
-
$response['message'] =
|
1661 |
}
|
1662 |
} else {
|
1663 |
$response['error'] = 1;
|
1664 |
-
$response['message'] =
|
1665 |
}
|
1666 |
} else {
|
1667 |
$response['error'] = 1;
|
@@ -1752,6 +1759,7 @@ class WCP_Folders
|
|
1752 |
$total_empty = self::get_total_empty_posts($typenow);
|
1753 |
|
1754 |
$folder_type = self::get_custom_post_type($typenow);
|
|
|
1755 |
$terms_data = WCP_Tree::get_full_tree_data($folder_type);
|
1756 |
$terms_html = WCP_Tree::get_option_data_for_select($folder_type);
|
1757 |
$form_html = WCP_Forms::get_form_html($terms_html);
|
@@ -1779,33 +1787,6 @@ class WCP_Folders
|
|
1779 |
}
|
1780 |
}
|
1781 |
|
1782 |
-
public function get_total_empty_posts($post_type = "")
|
1783 |
-
{
|
1784 |
-
$taxonomy = self::get_custom_post_type($post_type);
|
1785 |
-
$args = array(
|
1786 |
-
'posts_per_page' => -1,
|
1787 |
-
'post_type' => $post_type,
|
1788 |
-
'post_status' => 'inherit'
|
1789 |
-
);
|
1790 |
-
if ($post_type != "attachment") {
|
1791 |
-
$args['post_status'] = array('publish', 'draft', 'future', 'private');
|
1792 |
-
}
|
1793 |
-
$args['tax_query'] = array(
|
1794 |
-
array(
|
1795 |
-
'taxonomy' => $taxonomy,
|
1796 |
-
'operator' => 'NOT EXISTS',
|
1797 |
-
),
|
1798 |
-
);
|
1799 |
-
|
1800 |
-
$result = get_posts($args);
|
1801 |
-
|
1802 |
-
if(!empty($result)) {
|
1803 |
-
return (count($result));
|
1804 |
-
} else {
|
1805 |
-
return 0;
|
1806 |
-
}
|
1807 |
-
}
|
1808 |
-
|
1809 |
public function autoload()
|
1810 |
{
|
1811 |
$files = array(
|
@@ -1852,20 +1833,20 @@ class WCP_Folders
|
|
1852 |
if (!empty($posts)) {
|
1853 |
foreach ($posts as $post_type) {
|
1854 |
$labels = array(
|
1855 |
-
'name' =>
|
1856 |
-
'singular_name' =>
|
1857 |
-
'all_items' =>
|
1858 |
-
'edit_item' =>
|
1859 |
-
'update_item' =>
|
1860 |
-
'add_new_item' =>
|
1861 |
-
'new_item_name' =>
|
1862 |
-
'menu_name' =>
|
1863 |
-
'search_items' =>
|
1864 |
-
'parent_item' =>
|
1865 |
);
|
1866 |
|
1867 |
$args = array(
|
1868 |
-
'label' =>
|
1869 |
'labels' => $labels,
|
1870 |
'show_tagcloud' => false,
|
1871 |
'hierarchical' => true,
|
@@ -1876,7 +1857,7 @@ class WCP_Folders
|
|
1876 |
'show_admin_column' => true,
|
1877 |
'update_count_callback' => '_update_generic_term_count',
|
1878 |
'query_var' => true,
|
1879 |
-
'rewrite' => false
|
1880 |
);
|
1881 |
|
1882 |
$folder_post_type = self::get_custom_post_type($post_type);
|
@@ -2080,7 +2061,6 @@ class WCP_Folders
|
|
2080 |
global $typenow;
|
2081 |
add_filter('views_edit-' . $typenow, array($this, 'wcp_check_for_child_folders'));
|
2082 |
}
|
2083 |
-
|
2084 |
}
|
2085 |
|
2086 |
function wcp_check_for_child_folders($content)
|
@@ -2146,6 +2126,7 @@ class WCP_Folders
|
|
2146 |
{
|
2147 |
if (self::is_active_for_screen()) {
|
2148 |
global $typenow;
|
|
|
2149 |
wp_register_script('wcp-folders-alert', plugin_dir_url(dirname(__FILE__)) . 'assets/js/livequery.min.js', array(), WCP_FOLDER_VERSION);
|
2150 |
wp_register_script('wcp-folders-custom', plugin_dir_url(dirname(__FILE__)) . 'assets/js/custom.js', array('jquery', 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'backbone'), WCP_FOLDER_VERSION);
|
2151 |
|
@@ -2166,6 +2147,7 @@ class WCP_Folders
|
|
2166 |
$is_active = 0;
|
2167 |
$folders = self::total_term_folders();
|
2168 |
}
|
|
|
2169 |
$register_url = admin_url("admin.php?page=wcp_folders_upgrade");
|
2170 |
|
2171 |
$is_rtl = 0;
|
@@ -2199,7 +2181,6 @@ class WCP_Folders
|
|
2199 |
'taxonomy_status' => $taxonomy_status,
|
2200 |
'selected_taxonomy' => $selected_taxonomy
|
2201 |
));
|
2202 |
-
|
2203 |
wp_enqueue_script('wcp-folders-alert');
|
2204 |
wp_enqueue_script('wcp-folders-custom');
|
2205 |
|
@@ -2210,15 +2191,18 @@ class WCP_Folders
|
|
2210 |
|
2211 |
public function plugin_action_links($links)
|
2212 |
{
|
2213 |
-
array_unshift($links, '<a href="' . admin_url("admin.php?page=wcp_folders_settings") . '" >' .
|
2214 |
-
$links['need_help'] = '<a target="_blank" href="https://premio.io/help/folders/?utm_source=pluginspage" >'.__( 'Need help?', WCP_FOLDER
|
2215 |
-
|
|
|
|
|
2216 |
return $links;
|
2217 |
}
|
2218 |
|
2219 |
public static function get_instance()
|
2220 |
{
|
2221 |
if (empty(self::$instance)) {
|
|
|
2222 |
self::$instance = new WCP_Folders();
|
2223 |
}
|
2224 |
return self::$instance;
|
@@ -2226,10 +2210,9 @@ class WCP_Folders
|
|
2226 |
|
2227 |
public function check_and_set_post_type() {
|
2228 |
$options = get_option(WCP_FOLDER_VAR);
|
2229 |
-
$options = is_array($options)?$options:array();
|
2230 |
$old_plugin_status = 0;
|
2231 |
$post_array = array();
|
2232 |
-
if (!empty($options)) {
|
2233 |
foreach ($options as $key=>$val) {
|
2234 |
if (!(strpos($key, 'folders4') === false) && $old_plugin_status == 0) {
|
2235 |
$old_plugin_status = 1;
|
@@ -2275,16 +2258,143 @@ class WCP_Folders
|
|
2275 |
|
2276 |
self::check_and_set_post_type();
|
2277 |
|
2278 |
-
|
2279 |
-
|
2280 |
-
$option = get_option("folder_redirect_status", true);
|
2281 |
if ($option == 1) {
|
2282 |
-
update_option("folder_redirect_status",
|
2283 |
wp_redirect(admin_url("admin.php?page=wcp_folders_settings"));
|
2284 |
exit;
|
2285 |
}
|
2286 |
}
|
2287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2288 |
public static function get_font_list(){
|
2289 |
return array(
|
2290 |
// System fonts.
|
@@ -3209,153 +3319,46 @@ class WCP_Folders
|
|
3209 |
);
|
3210 |
}
|
3211 |
|
3212 |
-
function
|
3213 |
-
{
|
3214 |
-
global $typenow;
|
3215 |
-
$type = $typenow;
|
3216 |
-
if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
|
3217 |
-
$type = self::sanitize_options($_REQUEST['post_type']);
|
3218 |
-
}
|
3219 |
-
|
3220 |
-
$options = get_option("folders_settings");
|
3221 |
-
|
3222 |
-
// echo "<pre>"; print_r($defaults);
|
3223 |
-
if (is_array($options) && in_array($type, $options)) {
|
3224 |
-
$columns = array(
|
3225 |
-
'wcp_move' => '<div class="wcp-move-multiple wcp-col" title="' . esc_html__('Move selected items', WCP_FOLDER) . '"><span class="dashicons dashicons-move"></span><div class="wcp-items"></div></div>',
|
3226 |
-
) + $defaults;
|
3227 |
-
return $columns;
|
3228 |
-
}
|
3229 |
-
return $defaults;
|
3230 |
-
}
|
3231 |
-
|
3232 |
-
function wcp_manage_columns_content($column_name, $post_ID)
|
3233 |
-
{
|
3234 |
-
$postIDs = self::$postIds;
|
3235 |
-
if(!is_array($postIDs)) {
|
3236 |
-
$postIDs = array();
|
3237 |
-
}
|
3238 |
-
if(!in_array($post_ID, $postIDs)) {
|
3239 |
-
$postIDs[] = $post_ID;
|
3240 |
-
self::$postIds = $postIDs;
|
3241 |
-
global $typenow;
|
3242 |
-
$type = $typenow;
|
3243 |
-
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
|
3244 |
-
$type = self::sanitize_options($_REQUEST['post_type']);
|
3245 |
-
}
|
3246 |
-
|
3247 |
-
$options = get_option("folders_settings");
|
3248 |
-
if (is_array($options) && in_array($type, $options)) {
|
3249 |
-
if ($column_name == 'wcp_move') {
|
3250 |
-
$title = get_the_title();
|
3251 |
-
if (strlen($title) > 20) {
|
3252 |
-
$title = substr($title, 0, 20) . "...";
|
3253 |
-
}
|
3254 |
-
echo "<div class='wcp-move-file' data-id='{$post_ID}'><span class='wcp-move dashicons dashicons-move' data-id='{$post_ID}'></span><span class='wcp-item' data-object-id='{$post_ID}'>" . $title . "</span></div>";
|
3255 |
-
}
|
3256 |
-
}
|
3257 |
-
}
|
3258 |
-
}
|
3259 |
-
|
3260 |
-
function taxonomy_archive_exclude_children($query)
|
3261 |
{
|
3262 |
-
$options = get_option(
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
3270 |
-
|
3271 |
-
|
3272 |
-
|
|
|
|
|
3273 |
}
|
3274 |
}
|
3275 |
}
|
3276 |
}
|
3277 |
}
|
3278 |
|
3279 |
-
|
|
|
3280 |
{
|
3281 |
-
|
3282 |
-
|
3283 |
-
$menu_title = esc_html__('Folders Settings', WCP_FOLDER);
|
3284 |
-
$capability = 'manage_options';
|
3285 |
-
$menu_slug = 'wcp_folders_settings';
|
3286 |
-
$callback = array($this, "wcp_folders_settings");
|
3287 |
-
$icon_url = 'dashicons-category';
|
3288 |
-
$position = 99;
|
3289 |
-
|
3290 |
-
add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callback, $icon_url, $position);
|
3291 |
-
|
3292 |
-
add_submenu_page(
|
3293 |
-
$menu_slug,
|
3294 |
-
esc_html__('Upgrade to Pro', WCP_FOLDER),
|
3295 |
-
esc_html__('Upgrade to Pro', WCP_FOLDER),
|
3296 |
-
'manage_options',
|
3297 |
-
'wcp_folders_upgrade',
|
3298 |
-
array($this, 'wcp_folders_upgrade')
|
3299 |
-
);
|
3300 |
-
|
3301 |
-
self::check_and_set_post_type();
|
3302 |
-
|
3303 |
-
$show_menu = get_option("folders_show_in_menu", true);
|
3304 |
-
if ($show_menu == "on") {
|
3305 |
-
self::create_menu_for_folders();
|
3306 |
-
}
|
3307 |
}
|
3308 |
|
3309 |
-
public function
|
3310 |
{
|
3311 |
-
|
3312 |
-
include_once dirname(dirname(__FILE__)) . "/templates/admin/upgrade-to-pro.php";
|
3313 |
}
|
3314 |
|
3315 |
-
public function
|
3316 |
{
|
3317 |
-
|
3318 |
-
$is_shown = get_option("folder_update_message");
|
3319 |
-
if($is_shown === false) {
|
3320 |
-
include_once dirname(dirname(__FILE__)) . "/templates/admin/update.php";
|
3321 |
-
} else {
|
3322 |
-
$options = get_option('folders_settings');
|
3323 |
-
$options = (empty($options) || !is_array($options)) ?array():$options;
|
3324 |
-
$post_types = get_post_types( array( 'public' => true ), 'objects' );
|
3325 |
-
$terms_data = array();
|
3326 |
-
foreach ($post_types as $post_type) {
|
3327 |
-
if(in_array($post_type->name, $options)) {
|
3328 |
-
$term = $post_type->name;
|
3329 |
-
$term = self::get_custom_post_type($term);
|
3330 |
-
$categories = self::get_terms_hierarchical($term);
|
3331 |
-
$terms_data[$post_type->name] = $categories;
|
3332 |
-
} else {
|
3333 |
-
$terms_data[$post_type->name] = array();
|
3334 |
-
}
|
3335 |
-
}
|
3336 |
-
$fonts = self::get_font_list();
|
3337 |
-
include_once dirname(dirname(__FILE__)) . "/templates/admin/general-settings.php";
|
3338 |
-
}
|
3339 |
-
|
3340 |
}
|
3341 |
|
3342 |
-
public function
|
3343 |
{
|
3344 |
-
|
3345 |
-
$options = is_array($options)?$options:array();
|
3346 |
-
foreach ($options as $option) {
|
3347 |
-
$post_type = self::get_custom_post_type($option);
|
3348 |
-
$terms = get_terms($post_type, array(
|
3349 |
-
'hide_empty' => false,
|
3350 |
-
)
|
3351 |
-
);
|
3352 |
-
foreach ($terms as $term) {
|
3353 |
-
$order = get_term_meta($term->term_id, "wcp_custom_order", true);
|
3354 |
-
if (empty($order) || $order == null) {
|
3355 |
-
update_term_meta($term->term_id, "wcp_custom_order", "1");
|
3356 |
-
}
|
3357 |
-
|
3358 |
-
}
|
3359 |
-
}
|
3360 |
}
|
3361 |
}
|
1 |
<?php
|
2 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
3 |
+
/* Free/Pro Class name change */
|
4 |
class WCP_Folders
|
5 |
{
|
6 |
|
7 |
private static $instance;
|
8 |
|
9 |
+
private static $license_key_data = null;
|
10 |
|
11 |
private static $folders;
|
12 |
|
131 |
#media-attachment-taxonomy-filter, .post-upload-ui .folder_for_media { border-color: <?php echo esc_attr($customize_folders['dropdown_color']) ?>; color: <?php echo esc_attr($customize_folders['dropdown_color']) ?> }
|
132 |
.folder_for_media option {color:#000000;}
|
133 |
.folder_for_media option:first-child {
|
134 |
+
font-weight: bold;
|
135 |
}
|
136 |
<?php
|
137 |
}
|
164 |
if (!isset($_REQUEST['media_folder'])) {
|
165 |
if (isset($default_folders[$typenow]) && !empty($default_folders[$typenow])) {
|
166 |
$admin_url .= $default_folders[$typenow];
|
|
|
167 |
?>
|
168 |
<script>
|
169 |
window.location = '<?php echo $admin_url ?>';
|
235 |
if(self::is_for_this_post_type('attachment')) {
|
236 |
$post_type = self::get_custom_post_type('attachment');
|
237 |
global $typenow, $current_screen;
|
238 |
+
/* Free/Pro Class name change */
|
|
|
239 |
if(!class_exists('WCP_Tree')) {
|
240 |
$files = array(
|
241 |
'WCP_Tree' => WCP_DS . "includes" . WCP_DS . "tree.class.php"
|
247 |
}
|
248 |
}
|
249 |
}
|
250 |
+
/* Free/Pro Class name change */
|
251 |
$options = WCP_Tree::get_folder_option_data($post_type);?>
|
252 |
<p class="attachments-category"><?php esc_html_e("Select a folder (Optional)", WCP_FOLDER) ?></p>
|
253 |
<p class="attachments-category"><?php esc_html_e("First select the folder, and the upload the files", WCP_FOLDER) ?><br/></p>
|
254 |
+
<p>
|
255 |
+
<select name="folder_for_media" class="folder_for_media">
|
256 |
<option value="-1">- <?php esc_html_e('Uncategorized', WCP_FOLDER) ?></option>
|
257 |
<?php echo $options ?>
|
258 |
<?php if($typenow == "attachment" && isset($current_screen->base) && $current_screen->base == "upload") {?>
|
259 |
<option value="add-folder"><?php esc_html_e('+ Create a New Folder', WCP_FOLDER) ?></option>
|
260 |
<?php } ?>
|
261 |
</select>
|
262 |
+
</p>
|
263 |
<?php
|
264 |
}
|
265 |
}
|
274 |
$postData = filter_input_array(INPUT_POST);
|
275 |
$errorCounter = 0;
|
276 |
if (!isset($postData['status']) || empty($postData['status'])) {
|
277 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
278 |
$errorCounter++;
|
279 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
280 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
281 |
$errorCounter++;
|
282 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
283 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
284 |
$errorCounter++;
|
285 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
286 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
287 |
$errorCounter++;
|
288 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
289 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
290 |
$errorCounter++;
|
291 |
} else {
|
292 |
$type = self::sanitize_options($postData['type']);
|
293 |
$nonce = self::sanitize_options($postData['nonce']);
|
294 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
295 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
296 |
$errorCounter++;
|
297 |
}
|
298 |
}
|
317 |
$postData = filter_input_array(INPUT_POST);
|
318 |
$errorCounter = 0;
|
319 |
if (!isset($postData['status']) || empty($postData['status'])) {
|
320 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
321 |
$errorCounter++;
|
322 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
323 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
324 |
$errorCounter++;
|
325 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
326 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
327 |
$errorCounter++;
|
328 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
329 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
330 |
$errorCounter++;
|
331 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
332 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
333 |
$errorCounter++;
|
334 |
} else {
|
335 |
$type = self::sanitize_options($postData['type']);
|
336 |
$nonce = self::sanitize_options($postData['nonce']);
|
337 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
338 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
339 |
$errorCounter++;
|
340 |
}
|
341 |
}
|
359 |
$postData = filter_input_array(INPUT_POST);
|
360 |
$errorCounter = 0;
|
361 |
if (!isset($postData['post_id']) || empty($postData['post_id'])) {
|
362 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
363 |
$errorCounter++;
|
364 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
365 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
366 |
$errorCounter++;
|
367 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
368 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
369 |
$errorCounter++;
|
370 |
} else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
|
371 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
372 |
$errorCounter++;
|
373 |
}
|
374 |
if ($errorCounter == 0) {
|
441 |
$empty_items = self::get_total_empty_posts($post_type);
|
442 |
|
443 |
$post_type = self::get_custom_post_type($post_type);
|
444 |
+
|
445 |
$taxonomies = self::get_terms_hierarchical($post_type);
|
446 |
|
447 |
$response = array(
|
448 |
'status' => 1,
|
|
|
449 |
'total_items' => $total_posts,
|
450 |
'taxonomies' => $taxonomies,
|
451 |
'empty_items' => $empty_items
|
469 |
|
470 |
$post_type = self::get_custom_post_type($post_type);
|
471 |
|
|
|
|
|
472 |
$taxonomies = self::get_terms_hierarchical($post_type);
|
473 |
|
474 |
$response = array(
|
475 |
'status' => 1,
|
|
|
476 |
'total_items' => $total_posts,
|
477 |
'empty_items' => $empty_items,
|
478 |
'taxonomies' => $taxonomies
|
520 |
return $args;
|
521 |
}
|
522 |
|
523 |
+
public function get_total_empty_posts($post_type = "")
|
524 |
+
{
|
525 |
+
$taxonomy = self::get_custom_post_type($post_type);
|
526 |
+
$args = array(
|
527 |
+
'posts_per_page' => -1,
|
528 |
+
'post_type' => $post_type,
|
529 |
+
'post_status' => 'inherit'
|
530 |
+
);
|
531 |
+
if ($post_type != "attachment") {
|
532 |
+
$args['post_status'] = array('publish', 'draft', 'future', 'private');
|
533 |
+
}
|
534 |
+
$args['tax_query'] = array(
|
535 |
+
array(
|
536 |
+
'taxonomy' => $taxonomy,
|
537 |
+
'operator' => 'NOT EXISTS',
|
538 |
+
),
|
539 |
+
);
|
540 |
+
$result = get_posts($args);
|
541 |
+
|
542 |
+
if(!empty($result)) {
|
543 |
+
return (count($result));
|
544 |
+
} else {
|
545 |
+
return 0;
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
public function output_backbone_view_filters() {
|
550 |
+
/* Free/Pro URL Change */
|
551 |
wp_enqueue_script( 'folders-media', WCP_FOLDER_URL.'assets/js/media.js', array( 'media-editor', 'media-views' ), WCP_FOLDER_VERSION, true );
|
552 |
wp_localize_script( 'folders-media', 'folders_media_options', array(
|
553 |
'terms' => self::get_terms_hierarchical('media_folder'),
|
554 |
'taxonomy' => get_taxonomy('media_folder'),
|
555 |
'ajax_url' => admin_url("admin-ajax.php")
|
556 |
));
|
557 |
+
/* Free/Pro URL Change */
|
558 |
wp_enqueue_style( 'folders-media', WCP_FOLDER_URL . 'assets/css/media.css' , array(), WCP_FOLDER_VERSION);
|
559 |
}
|
560 |
|
715 |
}
|
716 |
|
717 |
wp_dropdown_categories( array(
|
718 |
+
'show_option_all' => esc_attr__( 'All Folders', WCP_FOLDER),
|
719 |
+
'show_option_none' => esc_attr__( '(Unassigned)', WCP_FOLDER),
|
720 |
'option_none_value' => -1,
|
721 |
'orderby' => 'meta_value_num',
|
722 |
'order' => 'ASC',
|
723 |
'show_count' => true,
|
724 |
'hide_empty' => false,
|
725 |
+
'update_count_callback' => '_update_generic_term_count',
|
726 |
'echo' => true,
|
727 |
'selected' => $current_term,
|
728 |
'hierarchical' => true,
|
766 |
$response['errors'] = array();
|
767 |
$response['message'] = "";
|
768 |
$errorArray = [];
|
769 |
+
$errorMessage = esc_attr__("%s is required", WCP_FOLDER);
|
770 |
$postData = filter_input_array(INPUT_POST);
|
771 |
if(!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
|
772 |
$error = array(
|
773 |
"key" => "textarea_text",
|
774 |
+
"message" => esc_attr__("Please enter your message",WCP_FOLDER)
|
775 |
);
|
776 |
$errorArray[] = $error;
|
777 |
}
|
792 |
if(!isset($postData['folder_help_nonce']) || trim($postData['folder_help_nonce']) == "") {
|
793 |
$error = array(
|
794 |
"key" => "nonce",
|
795 |
+
"message" => esc_attr__("Your request is not valid", WCP_FOLDER)
|
796 |
);
|
797 |
$errorArray[] = $error;
|
798 |
} else {
|
799 |
if(!wp_verify_nonce($postData['folder_help_nonce'], 'wcp_folder_help_nonce')) {
|
800 |
$error = array(
|
801 |
"key" => "nonce",
|
802 |
+
"message" => esc_attr__("Your request is not valid", WCP_FOLDER)
|
803 |
);
|
804 |
$errorArray[] = $error;
|
805 |
}
|
862 |
$errorCounter++;
|
863 |
$response['message'] = "Please provide reason";
|
864 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
865 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
866 |
$errorCounter++;
|
867 |
$response['valid'] = 0;
|
868 |
} else {
|
869 |
$nonce = self::sanitize_options($postData['nonce']);
|
870 |
if(!wp_verify_nonce($nonce, 'wcp_folder_deactivate_nonce')) {
|
871 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
872 |
$errorCounter++;
|
873 |
$response['valid'] = 0;
|
874 |
}
|
896 |
</tr>
|
897 |
<tr>
|
898 |
<th>Plugin Version</th>
|
899 |
+
<!-- Free Pro Version Change -->
|
900 |
<td><?php echo esc_attr(WCP_FOLDER_VERSION) ?></td>
|
901 |
</tr>
|
902 |
<tr>
|
927 |
$response['status'] = 1;
|
928 |
}
|
929 |
echo json_encode($response);
|
930 |
+
wp_die();
|
|
|
|
|
|
|
|
|
|
|
931 |
}
|
932 |
|
933 |
public static function total_term_folders()
|
942 |
return $total;
|
943 |
}
|
944 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
945 |
public function wcp_remove_post_item()
|
946 |
{
|
947 |
$response = array();
|
968 |
$postData = filter_input_array(INPUT_POST);
|
969 |
$errorCounter = 0;
|
970 |
if (!isset($postData['type']) || empty($postData['type'])) {
|
971 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
972 |
$errorCounter++;
|
973 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
974 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
975 |
$errorCounter++;
|
976 |
} else if (!current_user_can("manage_categories") || ($postData['type'] == "page" && !current_user_can("edit_pages"))) {
|
977 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
978 |
$errorCounter++;
|
979 |
} else if (!current_user_can("manage_categories") || ($postData['type'] != "page" && !current_user_can("edit_posts"))) {
|
980 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
981 |
$errorCounter++;
|
982 |
} else {
|
983 |
$type = self::sanitize_options($postData['type']);
|
984 |
$nonce = self::sanitize_options($postData['nonce']);
|
985 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
986 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
987 |
$errorCounter++;
|
988 |
}
|
989 |
}
|
1014 |
$postData = filter_input_array(INPUT_POST);
|
1015 |
$errorCounter = 0;
|
1016 |
if (!isset($postData['width']) || empty($postData['width'])) {
|
1017 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1018 |
$errorCounter++;
|
1019 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1020 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1021 |
$errorCounter++;
|
1022 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1023 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1024 |
$errorCounter++;
|
1025 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
1026 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
1027 |
$errorCounter++;
|
1028 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
1029 |
+
$response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
|
1030 |
$errorCounter++;
|
1031 |
} else {
|
1032 |
$type = self::sanitize_options($postData['type']);
|
1033 |
$nonce = self::sanitize_options($postData['nonce']);
|
1034 |
if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
|
1035 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1036 |
$errorCounter++;
|
1037 |
}
|
1038 |
}
|
1057 |
$postData = filter_input_array(INPUT_POST);
|
1058 |
$errorCounter = 0;
|
1059 |
if (!isset($postData['post_ids']) || empty($postData['post_ids'])) {
|
1060 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1061 |
$errorCounter++;
|
1062 |
} else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
|
1063 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1064 |
$errorCounter++;
|
1065 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1066 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1067 |
$errorCounter++;
|
1068 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1069 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1070 |
$errorCounter++;
|
1071 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
1072 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1073 |
$errorCounter++;
|
1074 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
1075 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1076 |
$errorCounter++;
|
1077 |
} else {
|
1078 |
$folder_id = self::sanitize_options($postData['folder_id']);
|
1079 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$folder_id)) {
|
1080 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1081 |
$errorCounter++;
|
1082 |
}
|
1083 |
}
|
1128 |
$errorCounter = 0;
|
1129 |
if (!isset($postData['post_id']) || empty($postData['post_id'])) {
|
1130 |
$errorCounter++;
|
1131 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1132 |
} else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
|
1133 |
$errorCounter++;
|
1134 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1135 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1136 |
$errorCounter++;
|
1137 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1138 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1139 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1140 |
$errorCounter++;
|
1141 |
} else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
|
1142 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1143 |
$errorCounter++;
|
1144 |
} else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
|
1145 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1146 |
$errorCounter++;
|
1147 |
} else {
|
1148 |
$term_id = self::sanitize_options($postData['folder_id']);
|
1149 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
|
1150 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1151 |
$errorCounter++;
|
1152 |
}
|
1153 |
}
|
1190 |
$postData = filter_input_array(INPUT_POST);
|
1191 |
$errorCounter = 0;
|
1192 |
if (!current_user_can("manage_categories")) {
|
1193 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1194 |
$errorCounter++;
|
1195 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1196 |
$errorCounter++;
|
1197 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1198 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1199 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1200 |
$errorCounter++;
|
1201 |
} else {
|
1202 |
$term_id = self::sanitize_options($postData['term_id']);
|
1203 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_highlight_term_'.$term_id)) {
|
1204 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1205 |
$errorCounter++;
|
1206 |
}
|
1207 |
}
|
1233 |
$postData = filter_input_array(INPUT_POST);
|
1234 |
$errorCounter = 0;
|
1235 |
if (!current_user_can("manage_categories")) {
|
1236 |
+
$response['message'] = esc_attr__("You have not permission to update folder order", WCP_FOLDER);
|
1237 |
$errorCounter++;
|
1238 |
} else if (!isset($postData['term_ids']) || empty($postData['term_ids'])) {
|
1239 |
$errorCounter++;
|
1240 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1241 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1242 |
$errorCounter++;
|
1243 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1244 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1245 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1246 |
$errorCounter++;
|
1247 |
} else {
|
1248 |
$type = self::sanitize_options($postData['type']);
|
1249 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
|
1250 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1251 |
$errorCounter++;
|
1252 |
}
|
1253 |
}
|
1265 |
}
|
1266 |
$response['status'] = 1;
|
1267 |
$folder_type = self::get_custom_post_type($type);
|
1268 |
+
/* Free/Pro Class name change */
|
1269 |
$response['options'] = WCP_Tree::get_option_data_for_select($folder_type);
|
1270 |
}
|
1271 |
echo json_encode($response);
|
1282 |
$postData = filter_input_array(INPUT_POST);
|
1283 |
$errorCounter = 0;
|
1284 |
if (!current_user_can("manage_categories")) {
|
1285 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1286 |
$errorCounter++;
|
1287 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1288 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1289 |
$errorCounter++;
|
1290 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1291 |
+
$response['message'] = esc_attr__("Unable to create folder, Your request is not valid", WCP_FOLDER);
|
1292 |
$errorCounter++;
|
1293 |
} else {
|
1294 |
$term_id = self::sanitize_options($postData['term_id']);
|
1295 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
|
1296 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1297 |
$errorCounter++;
|
1298 |
}
|
1299 |
}
|
1322 |
$postData = filter_input_array(INPUT_POST);
|
1323 |
$errorCounter = 0;
|
1324 |
if (!current_user_can("manage_categories")) {
|
1325 |
+
$response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1326 |
$errorCounter++;
|
1327 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1328 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1329 |
$errorCounter++;
|
1330 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1331 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1332 |
$errorCounter++;
|
1333 |
} else if (!isset($postData['parent_id'])) {
|
1334 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1335 |
$errorCounter++;
|
1336 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1337 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1338 |
$errorCounter++;
|
1339 |
} else {
|
1340 |
$term_id = self::sanitize_options($postData['term_id']);
|
1341 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
|
1342 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1343 |
$errorCounter++;
|
1344 |
}
|
1345 |
}
|
1368 |
$postData = filter_input_array(INPUT_POST);
|
1369 |
$errorCounter = 0;
|
1370 |
if (!isset($postData['type']) || empty($postData['type'])) {
|
1371 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1372 |
$errorCounter++;
|
1373 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1374 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1375 |
$errorCounter++;
|
1376 |
} else {
|
1377 |
$type = self::sanitize_options($postData['type']);
|
1378 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
|
1379 |
+
$response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1380 |
$errorCounter++;
|
1381 |
}
|
1382 |
}
|
1453 |
$postData = filter_input_array(INPUT_POST);
|
1454 |
$errorCounter = 0;
|
1455 |
if (!current_user_can("manage_categories")) {
|
1456 |
+
$error = esc_attr__("You have not permission to remove folder", WCP_FOLDER);
|
1457 |
$errorCounter++;
|
1458 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1459 |
+
$error = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1460 |
$errorCounter++;
|
1461 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1462 |
+
$error = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1463 |
$errorCounter++;
|
1464 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1465 |
+
$error = esc_attr__("Unable to delete folder, Your request is not valid", WCP_FOLDER);
|
1466 |
$errorCounter++;
|
1467 |
} else {
|
1468 |
$term_id = self::sanitize_options($postData['term_id']);
|
1469 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_delete_term_'.$term_id)) {
|
1470 |
+
$error = esc_attr__("Unable to delete folder, Your request is not valid", WCP_FOLDER);
|
1471 |
$errorCounter++;
|
1472 |
}
|
1473 |
}
|
1520 |
$postData = $_REQUEST;
|
1521 |
$errorCounter = 0;
|
1522 |
if (!current_user_can("manage_categories")) {
|
1523 |
+
$error = esc_attr__("You have not permission to update folder", WCP_FOLDER);
|
1524 |
$errorCounter++;
|
1525 |
} else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
|
1526 |
+
$error = esc_attr__("Unable to rename folder, Your request is not valid", WCP_FOLDER);
|
1527 |
$errorCounter++;
|
1528 |
} else if (!isset($postData['name']) || empty($postData['name'])) {
|
1529 |
+
$error = esc_attr__("Folder name can no be empty", WCP_FOLDER);
|
1530 |
$errorCounter++;
|
1531 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1532 |
+
$error = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1533 |
$errorCounter++;
|
1534 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1535 |
+
$error = esc_attr__("Unable to rename folder, Your request is not valid", WCP_FOLDER);
|
1536 |
$errorCounter++;
|
1537 |
} else {
|
1538 |
$term_id = self::sanitize_options($postData['term_id']);
|
1539 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_rename_term_'.$term_id)) {
|
1540 |
+
$error = esc_attr__("Unable to rename folder, Your request is not valid", WCP_FOLDER);
|
1541 |
$errorCounter++;
|
1542 |
}
|
1543 |
}
|
1558 |
$response['status'] = 1;
|
1559 |
$response['term_title'] = $postData['name'];
|
1560 |
} else {
|
1561 |
+
$response['message'] = esc_attr__("Unable to rename folder", WCP_FOLDER);
|
1562 |
}
|
1563 |
} else {
|
1564 |
$response['error'] = 1;
|
1598 |
$postData = $_REQUEST;
|
1599 |
$errorCounter = 0;
|
1600 |
if (!current_user_can("manage_categories")) {
|
1601 |
+
$error = esc_attr__("You have not permission to add folder", WCP_FOLDER);
|
1602 |
$errorCounter++;
|
1603 |
} else if (!isset($postData['name']) || empty($postData['name'])) {
|
1604 |
+
$error = esc_attr__("Folder name can no be empty", WCP_FOLDER);
|
1605 |
$errorCounter++;
|
1606 |
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
1607 |
+
$error = esc_attr__("Your request is not valid", WCP_FOLDER);
|
1608 |
$errorCounter++;
|
1609 |
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
1610 |
$response['login'] = 0;
|
1611 |
+
$error = esc_attr__("Unable to create folder, Your request is not valid", WCP_FOLDER);
|
1612 |
$errorCounter++;
|
1613 |
} else {
|
1614 |
$type = self::sanitize_options($postData['type']);
|
1615 |
if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
|
1616 |
$response['login'] = 0;
|
1617 |
+
$error = esc_attr__("Unable to create folder, Your request is not valid", WCP_FOLDER);
|
1618 |
$errorCounter++;
|
1619 |
}
|
1620 |
}
|
1648 |
$rename_nonce = wp_create_nonce('wcp_folder_rename_term_'.$result['term_id']);
|
1649 |
$highlight_nonce = wp_create_nonce('wcp_folder_highlight_term_'.$result['term_id']);
|
1650 |
$term_nonce = wp_create_nonce('wcp_folder_term_'.$result['term_id']);
|
1651 |
+
/* Free/Pro URL Change */
|
1652 |
+
$string = "<li data-nonce='{$term_nonce}' data-star='{$highlight_nonce}' data-rename='{$rename_nonce}' data-delete='{$delete_nonce}' data-slug='{$slug}' class='ui-state-default route' id='wcp_folder_{$result['term_id']}' data-folder-id='{$result['term_id']}'><h3 class='title' title='{$postData['name']}' id='title_{$result['term_id']}'><span class='ui-icon'><i class='wcp-icon folder-icon-folder'></i><img src='".esc_url(WCP_FOLDER_URL."assets/images/move-option.png")."' class='move-folder-icon' ><input type='checkbox' class='checkbox' value='{$result['term_id']}' /></span><span class='title-text'>{$postData['name']}</span> <span class='update-inline-record'></span><span class='star-icon'></span> </h3><span class='nav-icon'><i class='wcp-icon folder-icon-arrow_right'></i></span> <ul class='space' id='space_{$result['term_id']}'>";
|
1653 |
$string .= "</ul></li>";
|
1654 |
$response['term_data'] = $string;
|
1655 |
$response['parent_id'] = $parent;
|
1664 |
$response['is_key_active'] = $is_active;
|
1665 |
$response['folders'] = $folders;
|
1666 |
} else {
|
1667 |
+
$response['message'] = esc_attr__("Error during server request", WCP_FOLDER);
|
1668 |
}
|
1669 |
} else {
|
1670 |
$response['error'] = 1;
|
1671 |
+
$response['message'] = esc_attr__("Folder name already exists", WCP_FOLDER);
|
1672 |
}
|
1673 |
} else {
|
1674 |
$response['error'] = 1;
|
1759 |
$total_empty = self::get_total_empty_posts($typenow);
|
1760 |
|
1761 |
$folder_type = self::get_custom_post_type($typenow);
|
1762 |
+
/* Do not change: Free/Pro Class name change */
|
1763 |
$terms_data = WCP_Tree::get_full_tree_data($folder_type);
|
1764 |
$terms_html = WCP_Tree::get_option_data_for_select($folder_type);
|
1765 |
$form_html = WCP_Forms::get_form_html($terms_html);
|
1787 |
}
|
1788 |
}
|
1789 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1790 |
public function autoload()
|
1791 |
{
|
1792 |
$files = array(
|
1833 |
if (!empty($posts)) {
|
1834 |
foreach ($posts as $post_type) {
|
1835 |
$labels = array(
|
1836 |
+
'name' => esc_html__('Folders', WCP_FOLDER),
|
1837 |
+
'singular_name' => esc_html__('Folder', WCP_FOLDER),
|
1838 |
+
'all_items' => esc_html__('All Folders', WCP_FOLDER),
|
1839 |
+
'edit_item' => esc_html__('Edit Folder', WCP_FOLDER),
|
1840 |
+
'update_item' => esc_html__('Update Folder', WCP_FOLDER),
|
1841 |
+
'add_new_item' => esc_html__('Add New Folder', WCP_FOLDER),
|
1842 |
+
'new_item_name' => esc_html__('Add Folder Name', WCP_FOLDER),
|
1843 |
+
'menu_name' => esc_html__('Folders', WCP_FOLDER),
|
1844 |
+
'search_items' => esc_html__('Search Folders', WCP_FOLDER),
|
1845 |
+
'parent_item' => esc_html__('Parent Folder', WCP_FOLDER),
|
1846 |
);
|
1847 |
|
1848 |
$args = array(
|
1849 |
+
'label' => esc_html__('Folder', WCP_FOLDER),
|
1850 |
'labels' => $labels,
|
1851 |
'show_tagcloud' => false,
|
1852 |
'hierarchical' => true,
|
1857 |
'show_admin_column' => true,
|
1858 |
'update_count_callback' => '_update_generic_term_count',
|
1859 |
'query_var' => true,
|
1860 |
+
'rewrite' => false
|
1861 |
);
|
1862 |
|
1863 |
$folder_post_type = self::get_custom_post_type($post_type);
|
2061 |
global $typenow;
|
2062 |
add_filter('views_edit-' . $typenow, array($this, 'wcp_check_for_child_folders'));
|
2063 |
}
|
|
|
2064 |
}
|
2065 |
|
2066 |
function wcp_check_for_child_folders($content)
|
2126 |
{
|
2127 |
if (self::is_active_for_screen()) {
|
2128 |
global $typenow;
|
2129 |
+
/* Free/Pro Version change */
|
2130 |
wp_register_script('wcp-folders-alert', plugin_dir_url(dirname(__FILE__)) . 'assets/js/livequery.min.js', array(), WCP_FOLDER_VERSION);
|
2131 |
wp_register_script('wcp-folders-custom', plugin_dir_url(dirname(__FILE__)) . 'assets/js/custom.js', array('jquery', 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'backbone'), WCP_FOLDER_VERSION);
|
2132 |
|
2147 |
$is_active = 0;
|
2148 |
$folders = self::total_term_folders();
|
2149 |
}
|
2150 |
+
/* For free: upgrade URL, for Pro: Register Key URL */
|
2151 |
$register_url = admin_url("admin.php?page=wcp_folders_upgrade");
|
2152 |
|
2153 |
$is_rtl = 0;
|
2181 |
'taxonomy_status' => $taxonomy_status,
|
2182 |
'selected_taxonomy' => $selected_taxonomy
|
2183 |
));
|
|
|
2184 |
wp_enqueue_script('wcp-folders-alert');
|
2185 |
wp_enqueue_script('wcp-folders-custom');
|
2186 |
|
2191 |
|
2192 |
public function plugin_action_links($links)
|
2193 |
{
|
2194 |
+
array_unshift($links, '<a href="' . admin_url("admin.php?page=wcp_folders_settings") . '" >' . esc_html__('Settings', WCP_FOLDER) . '</a>');
|
2195 |
+
$links['need_help'] = '<a target="_blank" href="https://premio.io/help/folders/?utm_source=pluginspage" >'.__( 'Need help?', WCP_FOLDER).'</a>';
|
2196 |
+
|
2197 |
+
/* PRO link for only for FREE*/
|
2198 |
+
$links['pro'] = '<a class="wcp-folder-upgrade-button" href="'.admin_url("admin.php?page=wcp_folders_upgrade").'" >'.__( 'Upgrade', WCP_FOLDER).'</a>';
|
2199 |
return $links;
|
2200 |
}
|
2201 |
|
2202 |
public static function get_instance()
|
2203 |
{
|
2204 |
if (empty(self::$instance)) {
|
2205 |
+
/* Do not change Class name here */
|
2206 |
self::$instance = new WCP_Folders();
|
2207 |
}
|
2208 |
return self::$instance;
|
2210 |
|
2211 |
public function check_and_set_post_type() {
|
2212 |
$options = get_option(WCP_FOLDER_VAR);
|
|
|
2213 |
$old_plugin_status = 0;
|
2214 |
$post_array = array();
|
2215 |
+
if (!empty($options) && is_array($options)) {
|
2216 |
foreach ($options as $key=>$val) {
|
2217 |
if (!(strpos($key, 'folders4') === false) && $old_plugin_status == 0) {
|
2218 |
$old_plugin_status = 1;
|
2258 |
|
2259 |
self::check_and_set_post_type();
|
2260 |
|
2261 |
+
$option = get_option("folder_redirect_status");
|
|
|
|
|
2262 |
if ($option == 1) {
|
2263 |
+
update_option("folder_redirect_status", 2);
|
2264 |
wp_redirect(admin_url("admin.php?page=wcp_folders_settings"));
|
2265 |
exit;
|
2266 |
}
|
2267 |
}
|
2268 |
|
2269 |
+
function wcp_manage_columns_head($defaults, $d = "")
|
2270 |
+
{
|
2271 |
+
global $typenow;
|
2272 |
+
$type = $typenow;
|
2273 |
+
if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
|
2274 |
+
$type = self::sanitize_options($_REQUEST['post_type']);
|
2275 |
+
}
|
2276 |
+
|
2277 |
+
$options = get_option("folders_settings");
|
2278 |
+
if (is_array($options) && in_array($type, $options)) {
|
2279 |
+
$columns = array(
|
2280 |
+
'wcp_move' => '<div class="wcp-move-multiple wcp-col" title="' . esc_attr__('Move selected items', WCP_FOLDER) . '"><span class="dashicons dashicons-move"></span><div class="wcp-items"></div></div>',
|
2281 |
+
) + $defaults;
|
2282 |
+
return $columns;
|
2283 |
+
}
|
2284 |
+
return $defaults;
|
2285 |
+
}
|
2286 |
+
|
2287 |
+
function wcp_manage_columns_content($column_name, $post_ID)
|
2288 |
+
{
|
2289 |
+
$postIDs = self::$postIds;
|
2290 |
+
if(!is_array($postIDs)) {
|
2291 |
+
$postIDs = array();
|
2292 |
+
}
|
2293 |
+
if(!in_array($post_ID, $postIDs)) {
|
2294 |
+
$postIDs[] = $post_ID;
|
2295 |
+
self::$postIds = $postIDs;
|
2296 |
+
global $typenow;
|
2297 |
+
$type = $typenow;
|
2298 |
+
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
|
2299 |
+
$type = self::sanitize_options($_REQUEST['post_type']);
|
2300 |
+
}
|
2301 |
+
|
2302 |
+
$options = get_option("folders_settings");
|
2303 |
+
if (is_array($options) && in_array($type, $options)) {
|
2304 |
+
if ($column_name == 'wcp_move') {
|
2305 |
+
$title = get_the_title();
|
2306 |
+
if (strlen($title) > 20) {
|
2307 |
+
$title = substr($title, 0, 20) . "...";
|
2308 |
+
}
|
2309 |
+
echo "<div class='wcp-move-file' data-id='{$post_ID}'><span class='wcp-move dashicons dashicons-move' data-id='{$post_ID}'></span><span class='wcp-item' data-object-id='{$post_ID}'>" . $title . "</span></div>";
|
2310 |
+
}
|
2311 |
+
}
|
2312 |
+
}
|
2313 |
+
}
|
2314 |
+
|
2315 |
+
function taxonomy_archive_exclude_children($query)
|
2316 |
+
{
|
2317 |
+
$options = get_option("folders_settings");
|
2318 |
+
if (!empty($options)) {
|
2319 |
+
$taxonomy_slugs = array();
|
2320 |
+
foreach ($options as $option) {
|
2321 |
+
$taxonomy_slugs[] = self::get_custom_post_type($option);
|
2322 |
+
}
|
2323 |
+
if (!empty($taxonomy_slugs)) {
|
2324 |
+
$i = 0;
|
2325 |
+
foreach ($query->tax_query->queries as $tax_query_item) {
|
2326 |
+
if (empty($taxonomy_slugs) || (isset($tax_query_item['taxonomy']) && in_array($tax_query_item['taxonomy'], $taxonomy_slugs))) {
|
2327 |
+
$query->tax_query->queries[$i]['include_children'] = 0;
|
2328 |
+
}
|
2329 |
+
}
|
2330 |
+
}
|
2331 |
+
}
|
2332 |
+
}
|
2333 |
+
|
2334 |
+
public function admin_menu()
|
2335 |
+
{
|
2336 |
+
// Add menu item for settings page
|
2337 |
+
$page_title = esc_attr__('Folders', WCP_FOLDER);
|
2338 |
+
$menu_title = esc_attr__('Folders Settings', WCP_FOLDER);
|
2339 |
+
$capability = 'manage_options';
|
2340 |
+
$menu_slug = 'wcp_folders_settings';
|
2341 |
+
$callback = array($this, "wcp_folders_settings");
|
2342 |
+
$icon_url = 'dashicons-category';
|
2343 |
+
$position = 99;
|
2344 |
+
|
2345 |
+
add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callback, $icon_url, $position);
|
2346 |
+
|
2347 |
+
/* Do not Change Free/Pro Change for menu */
|
2348 |
+
add_submenu_page(
|
2349 |
+
$menu_slug,
|
2350 |
+
esc_html__('Upgrade to Pro', WCP_FOLDER),
|
2351 |
+
esc_html__('Upgrade to Pro', WCP_FOLDER),
|
2352 |
+
'manage_options',
|
2353 |
+
'wcp_folders_upgrade',
|
2354 |
+
array($this, 'wcp_folders_upgrade_or_register')
|
2355 |
+
);
|
2356 |
+
|
2357 |
+
self::check_and_set_post_type();
|
2358 |
+
|
2359 |
+
$show_menu = get_option("folders_show_in_menu", true);
|
2360 |
+
if ($show_menu == "on") {
|
2361 |
+
self::create_menu_for_folders();
|
2362 |
+
}
|
2363 |
+
}
|
2364 |
+
|
2365 |
+
public function wcp_folders_upgrade_or_register()
|
2366 |
+
{
|
2367 |
+
self::set_default_values_if_not_exists();
|
2368 |
+
include_once dirname(dirname(__FILE__)) . "/templates/admin/upgrade-to-pro.php";
|
2369 |
+
}
|
2370 |
+
|
2371 |
+
public function wcp_folders_settings()
|
2372 |
+
{
|
2373 |
+
self::set_default_values_if_not_exists();
|
2374 |
+
/* Only in Free, Get Folders update confirmation popup */
|
2375 |
+
$is_shown = get_option("folder_update_message");
|
2376 |
+
if($is_shown === false) {
|
2377 |
+
include_once dirname(dirname(__FILE__)) . "/templates/admin/update.php";
|
2378 |
+
} else {
|
2379 |
+
$options = get_option('folders_settings');
|
2380 |
+
$options = (empty($options) || !is_array($options)) ?array():$options;
|
2381 |
+
$post_types = get_post_types( array( 'public' => true ), 'objects' );
|
2382 |
+
$terms_data = array();
|
2383 |
+
foreach ($post_types as $post_type) {
|
2384 |
+
if(in_array($post_type->name, $options)) {
|
2385 |
+
$term = $post_type->name;
|
2386 |
+
$term = self::get_custom_post_type($term);
|
2387 |
+
$categories = self::get_terms_hierarchical($term);
|
2388 |
+
$terms_data[$post_type->name] = $categories;
|
2389 |
+
} else {
|
2390 |
+
$terms_data[$post_type->name] = array();
|
2391 |
+
}
|
2392 |
+
}
|
2393 |
+
$fonts = self::get_font_list();
|
2394 |
+
include_once dirname(dirname(__FILE__)) . "/templates/admin/general-settings.php";
|
2395 |
+
}
|
2396 |
+
}
|
2397 |
+
|
2398 |
public static function get_font_list(){
|
2399 |
return array(
|
2400 |
// System fonts.
|
3319 |
);
|
3320 |
}
|
3321 |
|
3322 |
+
public function set_default_values_if_not_exists()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3323 |
{
|
3324 |
+
$options = get_option(WCP_FOLDER_VAR);
|
3325 |
+
$options = empty($options) || !is_array($options) ? array() : $options;
|
3326 |
+
foreach ($options as $option) {
|
3327 |
+
$post_type = self::get_custom_post_type($option);
|
3328 |
+
$terms = get_terms($post_type, array(
|
3329 |
+
'hide_empty' => false,
|
3330 |
+
)
|
3331 |
+
);
|
3332 |
+
if (!empty($terms)) {
|
3333 |
+
foreach ($terms as $term) {
|
3334 |
+
$order = get_term_meta($term->term_id, "wcp_custom_order", true);
|
3335 |
+
if (empty($order) || $order == null) {
|
3336 |
+
update_term_meta($term->term_id, "wcp_custom_order", "1");
|
3337 |
}
|
3338 |
}
|
3339 |
}
|
3340 |
}
|
3341 |
}
|
3342 |
|
3343 |
+
/* Free and Pro major changes */
|
3344 |
+
public function check_has_valid_key()
|
3345 |
{
|
3346 |
+
/* Free/Pro: checking for key, for Free return 0, for Pro check for Key */
|
3347 |
+
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3348 |
}
|
3349 |
|
3350 |
+
public function get_license_key_information($licenseKey)
|
3351 |
{
|
3352 |
+
return array();
|
|
|
3353 |
}
|
3354 |
|
3355 |
+
public function get_license_key_data($licenseKey = '')
|
3356 |
{
|
3357 |
+
return array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3358 |
}
|
3359 |
|
3360 |
+
public function check_for_license_key()
|
3361 |
{
|
3362 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3363 |
}
|
3364 |
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
|
|
3 |
Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
|
4 |
Requires at least: 3.0.0
|
5 |
Tested up to: 5.3
|
6 |
-
Stable tag: 2.3.
|
7 |
Plugin URI: https://premio.io/downloads/folders/
|
8 |
|
9 |
Folders is a WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
|
@@ -100,11 +100,11 @@ Download this plugin today for free and get 10 folders to organize your WP conte
|
|
100 |
|
101 |
== Installation ==
|
102 |
|
103 |
-
Step 1: Download and
|
104 |
|
105 |
-
Step 2: In the “Folder Settings” menu, select
|
106 |
|
107 |
-
Step 3:
|
108 |
|
109 |
== Frequently Asked Questions ==
|
110 |
|
@@ -138,6 +138,9 @@ A live demo for the Folders plugin is available at <a href="https://demo.premio.
|
|
138 |
|
139 |
== Changelog ==
|
140 |
|
|
|
|
|
|
|
141 |
= 2.3.4 =
|
142 |
Thrive Themes Architect bug fixed
|
143 |
|
3 |
Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
|
4 |
Requires at least: 3.0.0
|
5 |
Tested up to: 5.3
|
6 |
+
Stable tag: 2.3.5
|
7 |
Plugin URI: https://premio.io/downloads/folders/
|
8 |
|
9 |
Folders is a WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
|
100 |
|
101 |
== Installation ==
|
102 |
|
103 |
+
Step 1: Download, install and activate the Folders plugin
|
104 |
|
105 |
+
Step 2: In the “Folder Settings” menu, select if you want Folders to appear in your media library, pages, posts or any custom post
|
106 |
|
107 |
+
Step 3: Create new folders and drag & drop elements into your new folders
|
108 |
|
109 |
== Frequently Asked Questions ==
|
110 |
|
138 |
|
139 |
== Changelog ==
|
140 |
|
141 |
+
= 2.3.5 =
|
142 |
+
Folder order when adding a media library file to posts/pages fix, and infrastructure improvments
|
143 |
+
|
144 |
= 2.3.4 =
|
145 |
Thrive Themes Architect bug fixed
|
146 |
|
templates/admin/admin-content.php
CHANGED
@@ -97,7 +97,7 @@ $class_name = isset($display_status) && $display_status == "hide"?"hide-folders-
|
|
97 |
$active_class = (isset($display_status) && $display_status == "hide")?"":"active";
|
98 |
$active_class_2 = (isset($display_status) && $display_status == "hide")?"active":"";
|
99 |
|
100 |
-
|
101 |
$post_type = WCP_Folders::get_custom_post_type($typenow);
|
102 |
$active = "";
|
103 |
$active_all_class = "";
|
97 |
$active_class = (isset($display_status) && $display_status == "hide")?"":"active";
|
98 |
$active_class_2 = (isset($display_status) && $display_status == "hide")?"active":"";
|
99 |
|
100 |
+
/* Do not change here, Free/Pro Class name */
|
101 |
$post_type = WCP_Folders::get_custom_post_type($typenow);
|
102 |
$active = "";
|
103 |
$active_all_class = "";
|
templates/admin/folder-deactivate-form.php
CHANGED
@@ -1,426 +1,421 @@
|
|
1 |
<?php
|
2 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
3 |
?>
|
4 |
-
<style>
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
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 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
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 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
<h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', WCP_FOLDER); ?></h3>
|
310 |
-
<div class="form-control">
|
311 |
-
<input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", WCP_FOLDER) ?>" id="folder-deactivate-email_id">
|
312 |
</div>
|
313 |
-
<div class="
|
314 |
-
<
|
315 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
</div>
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
value="Skip & Deactivate">
|
324 |
-
|
325 |
-
<div class="action-btns">
|
326 |
<span class="folder-spinner">
|
327 |
<img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt="">
|
328 |
</span>
|
329 |
-
|
330 |
-
|
|
|
331 |
</div>
|
332 |
-
</
|
333 |
-
</
|
334 |
</div>
|
335 |
-
</div>
|
336 |
|
337 |
|
338 |
-
<script>
|
339 |
-
|
340 |
|
341 |
-
|
342 |
|
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 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
} else {
|
374 |
-
$(".folder-popup-allow-deactivate").attr("disabled", false);
|
375 |
-
}
|
376 |
-
});
|
377 |
-
$(document).on('submit', '#folder-deactivate-form', function (event) {
|
378 |
-
event.preventDefault();
|
379 |
-
|
380 |
-
var _reason = jQuery('#folder-comment').val();
|
381 |
-
var _email_id = jQuery('#folder-deactivate-email_id').val();
|
382 |
-
|
383 |
-
$.ajax({
|
384 |
-
url: ajaxurl,
|
385 |
-
type: 'POST',
|
386 |
-
data: {
|
387 |
-
action: 'folder_plugin_deactivate',
|
388 |
-
reason: _reason,
|
389 |
-
email_id: _email_id,
|
390 |
-
nonce: '<?php echo esc_attr(wp_create_nonce('wcp_folder_deactivate_nonce')) ?>'
|
391 |
-
},
|
392 |
-
beforeSend: function () {
|
393 |
-
$(".folder-spinner").show();
|
394 |
-
$(".folder-popup-allow-deactivate").attr("disabled", "disabled");
|
395 |
-
}
|
396 |
-
}).done(function (res) {
|
397 |
-
console.log(res);
|
398 |
-
res = jQuery.parseJSON(res);
|
399 |
-
if(res.valid == "0") {
|
400 |
-
alert(res.message);
|
401 |
-
window.location.reload(true);
|
402 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
$(".folder-spinner").hide();
|
404 |
$(".folder-popup-allow-deactivate").removeAttr("disabled");
|
405 |
window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href');
|
406 |
-
}
|
|
|
|
|
|
|
|
|
407 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
});
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
})
|
413 |
-
|
414 |
-
function close_popup() {
|
415 |
-
$('.folder-popup-overlay').removeClass('folder-active');
|
416 |
-
$('#folder-deactivate-form').trigger("reset");
|
417 |
-
$(".folder-popup-allow-deactivate").attr('disabled', 'disabled');
|
418 |
-
$(".folder-reason-input").hide();
|
419 |
-
$('body').removeClass('folder-hidden');
|
420 |
-
$('.message.error-message').hide();
|
421 |
-
}
|
422 |
-
});
|
423 |
-
|
424 |
-
})(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code.
|
425 |
-
</script>
|
426 |
<?php include_once dirname(__FILE__)."/help.php" ?>
|
1 |
<?php
|
2 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
3 |
?>
|
4 |
+
<style>
|
5 |
+
.folder-hidden {
|
6 |
+
overflow: hidden;
|
7 |
+
}
|
8 |
+
|
9 |
+
.folder-popup-overlay .folder-internal-message {
|
10 |
+
margin: 3px 0 3px 22px;
|
11 |
+
display: none;
|
12 |
+
}
|
13 |
+
|
14 |
+
.folder-reason-input {
|
15 |
+
margin: 3px 0 3px 22px;
|
16 |
+
display: none;
|
17 |
+
}
|
18 |
+
|
19 |
+
.folder-reason-input input[type="text"] {
|
20 |
+
width: 100%;
|
21 |
+
display: block;
|
22 |
+
}
|
23 |
+
|
24 |
+
.folder-popup-overlay {
|
25 |
+
background: rgba(0, 0, 0, .8);
|
26 |
+
position: fixed;
|
27 |
+
top: 0;
|
28 |
+
left: 0;
|
29 |
+
height: 100%;
|
30 |
+
width: 100%;
|
31 |
+
z-index: 1000;
|
32 |
+
overflow: auto;
|
33 |
+
visibility: hidden;
|
34 |
+
opacity: 0;
|
35 |
+
transition: opacity 0.3s ease-in-out :
|
36 |
+
}
|
37 |
+
|
38 |
+
.folder-popup-overlay.folder-active {
|
39 |
+
opacity: 1;
|
40 |
+
visibility: visible;
|
41 |
+
}
|
42 |
+
|
43 |
+
.folder-serveypanel {
|
44 |
+
width: 600px;
|
45 |
+
background: #fff;
|
46 |
+
margin: 65px auto 0;
|
47 |
+
}
|
48 |
+
|
49 |
+
.folder-popup-header {
|
50 |
+
background: #f1f1f1;
|
51 |
+
padding: 20px;
|
52 |
+
border-bottom: 1px solid #ccc;
|
53 |
+
}
|
54 |
+
|
55 |
+
.folder-popup-header h2 {
|
56 |
+
margin: 0;
|
57 |
+
}
|
58 |
+
|
59 |
+
.folder-popup-body {
|
60 |
+
padding: 10px 20px;
|
61 |
+
}
|
62 |
+
|
63 |
+
.folder-popup-footer {
|
64 |
+
background: #f9f3f3;
|
65 |
+
padding: 10px 20px;
|
66 |
+
border-top: 1px solid #ccc;
|
67 |
+
}
|
68 |
+
|
69 |
+
.folder-popup-footer:after {
|
70 |
+
content: "";
|
71 |
+
display: table;
|
72 |
+
clear: both;
|
73 |
+
}
|
74 |
+
|
75 |
+
.action-btns {
|
76 |
+
float: right;
|
77 |
+
}
|
78 |
+
|
79 |
+
.folder-anonymous {
|
80 |
+
display: none;
|
81 |
+
}
|
82 |
+
|
83 |
+
.attention, .error-message {
|
84 |
+
color: red;
|
85 |
+
font-weight: 600;
|
86 |
+
display: none;
|
87 |
+
}
|
88 |
+
|
89 |
+
.folder-spinner {
|
90 |
+
display: none;
|
91 |
+
}
|
92 |
+
|
93 |
+
.folder-spinner img {
|
94 |
+
margin-top: 3px;
|
95 |
+
}
|
96 |
+
|
97 |
+
.folder-hidden-input {
|
98 |
+
padding: 10px 0 0;
|
99 |
+
display: none;
|
100 |
+
}
|
101 |
+
|
102 |
+
.folder-hidden-input input[type='text'] {
|
103 |
+
padding: 0 10px;
|
104 |
+
width: 100%;
|
105 |
+
height: 26px;
|
106 |
+
line-height: 26px;
|
107 |
+
}
|
108 |
+
|
109 |
+
.folder-hidden-input textarea {
|
110 |
+
padding: 10px;
|
111 |
+
width: 100%;
|
112 |
+
height: 100px;
|
113 |
+
margin: 0 0 10px 0;
|
114 |
+
}
|
115 |
+
|
116 |
+
span.folder-error-message {
|
117 |
+
color: #dd0000;
|
118 |
+
font-weight: 600;
|
119 |
+
}
|
120 |
+
|
121 |
+
.form-control textarea {
|
122 |
+
width: 100%;
|
123 |
+
height: 100px;
|
124 |
+
margin-bottom: 10px;
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
.folder-help-btn {
|
129 |
+
position: fixed;
|
130 |
+
right: 20px;
|
131 |
+
bottom: 20px;
|
132 |
+
z-index: 1001
|
133 |
+
}
|
134 |
+
|
135 |
+
.folder-help-btn a {
|
136 |
+
display: block;
|
137 |
+
border: 3px solid #FFF;
|
138 |
+
width: 50px;
|
139 |
+
height: 50px;
|
140 |
+
-webkit-border-radius: 50%;
|
141 |
+
-moz-border-radius: 50%;
|
142 |
+
border-radius: 50%;
|
143 |
+
position: relative
|
144 |
+
}
|
145 |
+
|
146 |
+
.folder-help-btn a img {
|
147 |
+
width: 100%;
|
148 |
+
height: auto;
|
149 |
+
display: block;
|
150 |
+
-webkit-border-radius: 50%;
|
151 |
+
-moz-border-radius: 50%;
|
152 |
+
border-radius: 50%
|
153 |
+
}
|
154 |
+
|
155 |
+
.folder-help-form {
|
156 |
+
position: fixed;
|
157 |
+
right: 85px;
|
158 |
+
border: 1px solid #e9edf0;
|
159 |
+
bottom: 25px;
|
160 |
+
background: #fff;
|
161 |
+
-webkit-border-radius: 10px;
|
162 |
+
-moz-border-radius: 10px;
|
163 |
+
border-radius: 10px;
|
164 |
+
width: 320px;
|
165 |
+
z-index: 1001;
|
166 |
+
direction: ltr;
|
167 |
+
opacity: 0;
|
168 |
+
transition: .4s;
|
169 |
+
-webkit-transition: .4s;
|
170 |
+
-moz-transition: .4s;
|
171 |
+
display: none;
|
172 |
+
}
|
173 |
+
|
174 |
+
.folder-help-form.active {
|
175 |
+
opacity: 1;
|
176 |
+
pointer-events: inherit;
|
177 |
+
display: block;
|
178 |
+
}
|
179 |
+
|
180 |
+
.folder-help-header {
|
181 |
+
background: #f4f4f4;
|
182 |
+
border-bottom: solid 1px #e9edf0;
|
183 |
+
padding: 5px 20px;
|
184 |
+
-webkit-border-radius: 10px;
|
185 |
+
-moz-border-radius: 10px;
|
186 |
+
border-radius: 10px 10px 0 0;
|
187 |
+
font-size: 16px;
|
188 |
+
text-align: right
|
189 |
+
}
|
190 |
+
|
191 |
+
.folder-help-header b {
|
192 |
+
float: left
|
193 |
+
}
|
194 |
+
|
195 |
+
.folder-help-content {
|
196 |
+
margin-bottom: 10px;
|
197 |
+
padding: 20px 20px 10px
|
198 |
+
}
|
199 |
+
|
200 |
+
.folder-help-form p {
|
201 |
+
margin: 0 0 1em
|
202 |
+
}
|
203 |
+
|
204 |
+
.folder-form-field {
|
205 |
+
margin-bottom: 10px
|
206 |
+
}
|
207 |
+
|
208 |
+
.folder-form-field input, .folder-form-field textarea {
|
209 |
+
-webkit-border-radius: 5px;
|
210 |
+
-moz-border-radius: 5px;
|
211 |
+
border-radius: 5px;
|
212 |
+
padding: 5px;
|
213 |
+
width: 100%;
|
214 |
+
box-sizing: border-box;
|
215 |
+
border: 1px solid #c5c5c5
|
216 |
+
}
|
217 |
+
|
218 |
+
.folder-form-field textarea {
|
219 |
+
width: 100%;
|
220 |
+
height: 100px;
|
221 |
+
margin-bottom: 10px;
|
222 |
+
}
|
223 |
+
|
224 |
+
.folder-help-button {
|
225 |
+
border: none;
|
226 |
+
padding: 8px 0;
|
227 |
+
width: 100%;
|
228 |
+
background: #ff6624;
|
229 |
+
color: #fff;
|
230 |
+
border-radius: 18px
|
231 |
+
}
|
232 |
+
|
233 |
+
.folder-help-form .error-message {
|
234 |
+
font-weight: 400;
|
235 |
+
font-size: 14px;
|
236 |
+
display: block;
|
237 |
+
}
|
238 |
+
|
239 |
+
.folder-help-form input.input-error, .folder-help-form textarea.input-error {
|
240 |
+
border-color: #dc3232
|
241 |
+
}
|
242 |
+
|
243 |
+
.folder-help-btn span.tooltiptext {
|
244 |
+
position: absolute;
|
245 |
+
background: #000;
|
246 |
+
font-size: 12px;
|
247 |
+
color: #fff;
|
248 |
+
top: -35px;
|
249 |
+
width: 140%;
|
250 |
+
text-align: center;
|
251 |
+
left: -20%;
|
252 |
+
border-radius: 5px;
|
253 |
+
direction: ltr
|
254 |
+
}
|
255 |
+
|
256 |
+
p.error-p, p.success-p {
|
257 |
+
margin: 0;
|
258 |
+
font-size: 14px;
|
259 |
+
text-align: center
|
260 |
+
}
|
261 |
+
|
262 |
+
.folder-help-btn span.tooltiptext:after {
|
263 |
+
bottom: -20px;
|
264 |
+
content: "";
|
265 |
+
transform: translateX(-50%);
|
266 |
+
height: 10px;
|
267 |
+
width: 0px;
|
268 |
+
border-width: 10px 5px 0;
|
269 |
+
border-style: solid;
|
270 |
+
border-color: #000 transparent transparent;
|
271 |
+
left: 50%;
|
272 |
+
position: absolute
|
273 |
+
}
|
274 |
+
.folder-help-btn {
|
275 |
+
display: none;
|
276 |
+
}
|
277 |
+
|
278 |
+
p.success-p {
|
279 |
+
color: green
|
280 |
+
}
|
281 |
+
|
282 |
+
p.error-p {
|
283 |
+
color: #dc3232
|
284 |
+
}
|
285 |
+
|
286 |
+
html[dir=rtl] .folder-help-btn {
|
287 |
+
left: 20px;
|
288 |
+
right: auto
|
289 |
+
}
|
290 |
+
|
291 |
+
html[dir=rtl] .folder-help-form {
|
292 |
+
left: 85px;
|
293 |
+
right: auto
|
294 |
+
}
|
295 |
+
.folder-popup-body h3 {
|
296 |
+
line-height: 24px;
|
297 |
+
}
|
298 |
+
.folder-popup-overlay .form-control input {
|
299 |
+
width: 100%;
|
300 |
+
margin: 0 0 15px 0;
|
301 |
+
}
|
302 |
+
</style>
|
303 |
+
|
304 |
+
<div class="folder-popup-overlay">
|
305 |
+
<div class="folder-serveypanel">
|
306 |
+
<form action="#" method="post" id="folder-deactivate-form">
|
307 |
+
<div class="folder-popup-header">
|
308 |
+
<h2><?php esc_html_e('Quick feedback about Folders', WCP_FOLDER); ?> 🙏</h2>
|
|
|
|
|
|
|
309 |
</div>
|
310 |
+
<div class="folder-popup-body">
|
311 |
+
<h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', WCP_FOLDER); ?></h3>
|
312 |
+
<div class="form-control">
|
313 |
+
<input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", WCP_FOLDER) ?>" id="folder-deactivate-email_id">
|
314 |
+
</div>
|
315 |
+
<div class="form-control">
|
316 |
+
<label></label>
|
317 |
+
<textarea placeholder="<?php esc_html_e("Your comment", WCP_FOLDER) ?>" id="folder-comment"></textarea>
|
318 |
+
</div>
|
319 |
+
<?php esc_html_e("Having any problem with the Folders plugins?", WCP_FOLDER) ?><a class='folder-deactivate-button' href='javascript:;'><?php esc_html_e("Click here", WCP_FOLDER) ?></a><?php esc_html_e(" to contact our support now", WCP_FOLDER) ?>
|
320 |
</div>
|
321 |
+
<div class="folder-popup-footer">
|
322 |
+
<label class="folder-anonymous"><input type="checkbox"/><?php esc_html_e('Anonymous feedback', WCP_FOLDER); ?>
|
323 |
+
</label>
|
324 |
+
<input type="button" class="button button-secondary button-skip folder-popup-skip-feedback" value="Skip & Deactivate">
|
325 |
+
|
326 |
+
<div class="action-btns">
|
|
|
|
|
|
|
327 |
<span class="folder-spinner">
|
328 |
<img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt="">
|
329 |
</span>
|
330 |
+
<input type="submit" class="button button-secondary button-deactivate folder-popup-allow-deactivate" value="Submit & Deactivate" disabled="disabled">
|
331 |
+
<a href="#" class="button button-primary folder-popup-button-close"><?php esc_attr_e('Cancel', WCP_FOLDER); ?></a>
|
332 |
+
</div>
|
333 |
</div>
|
334 |
+
</form>
|
335 |
+
</div>
|
336 |
</div>
|
|
|
337 |
|
338 |
|
339 |
+
<script>
|
340 |
+
(function ($) {
|
341 |
|
342 |
+
$(function () {
|
343 |
|
344 |
+
$(document).on("click", ".folder-deactivate-button", function(e){
|
345 |
+
e.stopPropagation();
|
346 |
+
jQuery(".folder-popup-button-close").trigger("click");
|
347 |
+
jQuery(".folder-help-btn").toggle();
|
348 |
+
jQuery(".folder-help-form").toggleClass("active");
|
349 |
+
jQuery("#user_email").focus();
|
350 |
+
});
|
351 |
|
352 |
+
/* Diffrent folder slug for Free/Pro */
|
353 |
+
var folderPluginSlug = 'folders';
|
354 |
+
// Code to fire when the DOM is ready.
|
355 |
|
356 |
+
$(document).on('click', 'tr[data-slug="' + folderPluginSlug + '"] .deactivate', function (e) {
|
357 |
+
e.preventDefault();
|
358 |
|
359 |
+
$('.folder-popup-overlay').addClass('folder-active');
|
360 |
+
$('body').addClass('folder-hidden');
|
361 |
+
});
|
362 |
+
$(document).on('click', '.folder-popup-button-close', function () {
|
363 |
+
close_popup();
|
364 |
+
});
|
365 |
+
$(document).on('click', ".folder-serveypanel,tr[data-slug='" + folderPluginSlug + "'] .deactivate", function (e) {
|
366 |
+
e.stopPropagation();
|
367 |
+
});
|
368 |
|
369 |
+
$(document).click(function () {
|
370 |
+
close_popup();
|
371 |
+
});
|
372 |
+
$(document).on("keyup", "#folder-comment", function(){
|
373 |
+
if($.trim($(this).val()) == "") {
|
374 |
+
$(".folder-popup-allow-deactivate").attr("disabled", true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
} else {
|
376 |
+
$(".folder-popup-allow-deactivate").attr("disabled", false);
|
377 |
+
}
|
378 |
+
});
|
379 |
+
$(document).on('submit', '#folder-deactivate-form', function (event) {
|
380 |
+
event.preventDefault();
|
381 |
+
|
382 |
+
var _reason = jQuery('#folder-comment').val();
|
383 |
+
var _email_id = jQuery('#folder-deactivate-email_id').val();
|
384 |
+
|
385 |
+
$.ajax({
|
386 |
+
url: ajaxurl,
|
387 |
+
type: 'POST',
|
388 |
+
data: {
|
389 |
+
action: 'folder_plugin_deactivate',
|
390 |
+
reason: _reason,
|
391 |
+
email_id: _email_id,
|
392 |
+
nonce: '<?php echo esc_attr(wp_create_nonce('wcp_folder_deactivate_nonce')) ?>'
|
393 |
+
},
|
394 |
+
beforeSend: function () {
|
395 |
+
$(".folder-spinner").show();
|
396 |
+
$(".folder-popup-allow-deactivate").attr("disabled", "disabled");
|
397 |
+
}
|
398 |
+
}).done(function (res) {
|
399 |
$(".folder-spinner").hide();
|
400 |
$(".folder-popup-allow-deactivate").removeAttr("disabled");
|
401 |
window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href');
|
402 |
+
});
|
403 |
+
});
|
404 |
+
|
405 |
+
$('.folder-popup-skip-feedback').on('click', function (e) {
|
406 |
+
window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href');
|
407 |
});
|
408 |
+
|
409 |
+
function close_popup() {
|
410 |
+
$('.folder-popup-overlay').removeClass('folder-active');
|
411 |
+
$('#folder-deactivate-form').trigger("reset");
|
412 |
+
$(".folder-popup-allow-deactivate").attr('disabled', 'disabled');
|
413 |
+
$(".folder-reason-input").hide();
|
414 |
+
$('body').removeClass('folder-hidden');
|
415 |
+
$('.message.error-message').hide();
|
416 |
+
}
|
417 |
});
|
418 |
|
419 |
+
})(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code.
|
420 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
<?php include_once dirname(__FILE__)."/help.php" ?>
|
templates/admin/general-settings.php
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
3 |
?>
|
|
|
4 |
<link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css' type='text/css' media='all' />
|
5 |
<link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/folder-icon.css' type='text/css' media='all' />
|
6 |
<link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/spectrum.min.css' type='text/css' media='all' />
|
@@ -106,93 +107,96 @@ defined('ABSPATH') or wp_die('Nope, not accessing this');
|
|
106 |
<div class="accordion-content" style="display: block">
|
107 |
<div class="accordion-left">
|
108 |
<table class="form-table">
|
109 |
-
<?php
|
110 |
-
$post_types = get_post_types( array( 'public' => true ), 'objects' );
|
111 |
-
$post_array = array("page", "post", "attachment");
|
112 |
-
foreach ( $post_types as $post_type ) : ?>
|
113 |
<?php
|
114 |
-
|
115 |
-
$
|
116 |
-
$
|
117 |
-
if(in_array($post_type->name, $post_array)){
|
118 |
-
?>
|
119 |
-
<tr>
|
120 |
-
<th width="220px">
|
121 |
-
<label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label>
|
122 |
-
</th>
|
123 |
-
<td>
|
124 |
-
<input type="checkbox" class="folder-select" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/>
|
125 |
-
</td>
|
126 |
-
<th class="default-folder">
|
127 |
-
<label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', WCP_FOLDER ) ?></label>
|
128 |
-
</th>
|
129 |
-
<td>
|
130 |
-
<select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?>">
|
131 |
-
<option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option>
|
132 |
-
<option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option>
|
133 |
-
<?php
|
134 |
-
if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) {
|
135 |
-
foreach ($terms_data[$post_type->name] as $term) {
|
136 |
-
$selected = ($selected_id == $term->slug)?"selected":"";
|
137 |
-
echo "<option ".esc_attr($selected)." value='".esc_attr($term->slug)."'>".esc_attr($term->name)."</option>";
|
138 |
-
}
|
139 |
-
} ?>
|
140 |
-
</select>
|
141 |
-
</td>
|
142 |
-
</tr>
|
143 |
-
<?php
|
144 |
-
} else { ?>
|
145 |
-
<tr>
|
146 |
-
<th>
|
147 |
-
<label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label>
|
148 |
-
</th>
|
149 |
-
<td>
|
150 |
-
<input type="checkbox" class="folder-select" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/>
|
151 |
-
</td>
|
152 |
-
<th class="default-folder">
|
153 |
-
<label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', WCP_FOLDER ) ?></label>
|
154 |
-
</th>
|
155 |
-
<td>
|
156 |
-
<select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?>">
|
157 |
-
<option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option>
|
158 |
-
<option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option>
|
159 |
-
<?php
|
160 |
-
if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) {
|
161 |
-
foreach ($terms_data[$post_type->name] as $term) {
|
162 |
-
$selected = ($selected_id == $term->slug)?"selected":"";
|
163 |
-
echo "<option ".esc_attr($selected)." value='".esc_attr($term->slug)."'>".esc_attr($term->name)."</option>";
|
164 |
-
}
|
165 |
-
} ?>
|
166 |
-
</select>
|
167 |
-
</td>
|
168 |
-
</tr>
|
169 |
-
<?php } endforeach; ?>
|
170 |
-
<tr>
|
171 |
-
<th>
|
172 |
-
<label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Show Folders in Menu:', WCP_FOLDER ); ?></label>
|
173 |
-
</th>
|
174 |
-
<td>
|
175 |
-
<?php $val = get_option("folders_show_in_menu"); ?>
|
176 |
-
<input type="hidden" name="folders_show_in_menu" value="off" />
|
177 |
-
<input type="checkbox" name="folders_show_in_menu" value="on" <?php echo ($val == "on")?"checked='checked'":"" ?>/>
|
178 |
-
</td>
|
179 |
-
</tr>
|
180 |
-
<tr>
|
181 |
-
<td colspan="2" style="padding: 10px 0">
|
182 |
<?php
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
<input type="hidden" name="folders_settings1[premio_folder_option]" value="yes" />
|
197 |
</div>
|
198 |
<div class="accordion-right">
|
@@ -210,105 +214,104 @@ defined('ABSPATH') or wp_die('Nope, not accessing this');
|
|
210 |
<div class="accordion-content">
|
211 |
<div class="accordion-left">
|
212 |
<table class="form-table">
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
</td>
|
226 |
-
</tr>
|
227 |
-
<?php
|
228 |
-
$color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color'])?"#F51366":$customize_folders['bulk_organize_button_color'];
|
229 |
-
?>
|
230 |
-
<tr>
|
231 |
-
<th>
|
232 |
-
<label for="bulk_organize_button_color" >Bulk Organize button color</label>
|
233 |
-
</th>
|
234 |
-
<td>
|
235 |
-
<input type="text" class="color-field" name="customize_folders[bulk_organize_button_color]" id="bulk_organize_button_color" value="<?php echo esc_attr($color) ?>" />
|
236 |
-
</td>
|
237 |
-
</tr>
|
238 |
-
<?php
|
239 |
-
$color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color'])?"#F51366":$customize_folders['dropdown_color'];
|
240 |
-
?>
|
241 |
-
<tr>
|
242 |
-
<th>
|
243 |
-
<label for="dropdown_color" >Dropdown color</label>
|
244 |
-
</th>
|
245 |
-
<td>
|
246 |
-
<input type="text" class="color-field" name="customize_folders[dropdown_color]" id="dropdown_color" value="<?php echo esc_attr($color) ?>" />
|
247 |
-
</td>
|
248 |
-
</tr>
|
249 |
-
<?php
|
250 |
-
$color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color'])?"#008ec2":$customize_folders['folder_bg_color'];
|
251 |
-
?>
|
252 |
-
<tr>
|
253 |
-
<th>
|
254 |
-
<label for="folder_bg_color" >Folders background color</label>
|
255 |
-
</th>
|
256 |
-
<td>
|
257 |
-
<input type="text" class="color-field" name="customize_folders[folder_bg_color]" id="folder_bg_color" value="<?php echo esc_attr($color) ?>" />
|
258 |
-
</td>
|
259 |
-
</tr>
|
260 |
-
<tr>
|
261 |
-
<th>
|
262 |
-
<label for="folder_font" >Folders font</label>
|
263 |
-
</th>
|
264 |
-
<td colspan="2">
|
265 |
-
<?php
|
266 |
-
$font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font'])?"":$customize_folders['folder_font'];
|
267 |
-
$index = 0;
|
268 |
-
?>
|
269 |
-
<select name="customize_folders[folder_font]" id="folder_font" >
|
270 |
-
<?php $group = '';
|
271 |
-
foreach ($fonts as $key => $value):
|
272 |
-
$title = $key;
|
273 |
-
if($index == 0) {
|
274 |
-
$key = "";
|
275 |
-
}
|
276 |
-
$index++;
|
277 |
-
if ($value != $group) {
|
278 |
-
echo '<optgroup label="' . $value . '">';
|
279 |
-
$group = $value;
|
280 |
-
}
|
281 |
-
?>
|
282 |
-
<option value="<?php echo $key; ?>" <?php selected($font, $key); ?>><?php echo $title; ?></option>
|
283 |
-
<?php endforeach; ?>
|
284 |
-
</select>
|
285 |
-
</td>
|
286 |
-
</tr>
|
287 |
-
<tr>
|
288 |
-
<th>
|
289 |
-
<label for="folder_size" >Folders size</label>
|
290 |
-
</th>
|
291 |
-
<td colspan="2">
|
292 |
-
<?php
|
293 |
-
$sizes = array(
|
294 |
-
"12" => "Small",
|
295 |
-
"16" => "Medium",
|
296 |
-
"20" => "Large"
|
297 |
-
);
|
298 |
-
$size = !isset($customize_folders['folder_size'])||empty($customize_folders['folder_size'])?"16":$customize_folders['folder_size'];
|
299 |
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
<?php
|
303 |
-
|
304 |
-
|
305 |
-
echo "<option ".$selected." value='".$key."'>".$value."</option>";
|
306 |
-
}
|
307 |
?>
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
</div>
|
313 |
<div class="accordion-right">
|
314 |
<div class="preview-text">
|
@@ -370,8 +373,4 @@ defined('ABSPATH') or wp_die('Nope, not accessing this');
|
|
370 |
</div>
|
371 |
<?php submit_button(); ?>
|
372 |
</form>
|
373 |
-
</div>
|
374 |
-
<script>
|
375 |
-
jQuery(document).ready(function(){
|
376 |
-
});
|
377 |
-
</script>
|
1 |
<?php
|
2 |
defined('ABSPATH') or wp_die('Nope, not accessing this');
|
3 |
?>
|
4 |
+
<!-- do not change here, Free/Pro URL Change -->
|
5 |
<link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css' type='text/css' media='all' />
|
6 |
<link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/folder-icon.css' type='text/css' media='all' />
|
7 |
<link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/spectrum.min.css' type='text/css' media='all' />
|
107 |
<div class="accordion-content" style="display: block">
|
108 |
<div class="accordion-left">
|
109 |
<table class="form-table">
|
|
|
|
|
|
|
|
|
110 |
<?php
|
111 |
+
$post_types = get_post_types( array( 'public' => true ), 'objects' );
|
112 |
+
$post_array = array("page", "post", "attachment");
|
113 |
+
foreach ( $post_types as $post_type ) : ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
<?php
|
115 |
+
if ( ! $post_type->show_ui) continue;
|
116 |
+
$is_checked = !in_array( $post_type->name, $options )?"hide-option":"";
|
117 |
+
$selected_id = (isset($default_folders[$post_type->name]))?$default_folders[$post_type->name]:"all";
|
118 |
+
if(in_array($post_type->name, $post_array)){
|
119 |
+
?>
|
120 |
+
<tr>
|
121 |
+
<th width="220px">
|
122 |
+
<label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label>
|
123 |
+
</th>
|
124 |
+
<td>
|
125 |
+
<input type="checkbox" class="folder-select" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/>
|
126 |
+
</td>
|
127 |
+
<th class="default-folder">
|
128 |
+
<label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', WCP_FOLDER ) ?></label>
|
129 |
+
</th>
|
130 |
+
<td>
|
131 |
+
<select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?>">
|
132 |
+
<option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option>
|
133 |
+
<option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option>
|
134 |
+
<?php
|
135 |
+
if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) {
|
136 |
+
foreach ($terms_data[$post_type->name] as $term) {
|
137 |
+
$selected = ($selected_id == $term->slug)?"selected":"";
|
138 |
+
echo "<option ".esc_attr($selected)." value='".esc_attr($term->slug)."'>".esc_attr($term->name)."</option>";
|
139 |
+
}
|
140 |
+
} ?>
|
141 |
+
</select>
|
142 |
+
</td>
|
143 |
+
</tr>
|
144 |
+
<?php
|
145 |
+
} else { ?>
|
146 |
+
<tr>
|
147 |
+
<th>
|
148 |
+
<label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label>
|
149 |
+
</th>
|
150 |
+
<td>
|
151 |
+
<input type="checkbox" class="folder-select" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/>
|
152 |
+
</td>
|
153 |
+
<th class="default-folder">
|
154 |
+
<label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', WCP_FOLDER ) ?></label>
|
155 |
+
</th>
|
156 |
+
<td>
|
157 |
+
<select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?>">
|
158 |
+
<option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option>
|
159 |
+
<option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option>
|
160 |
+
<?php
|
161 |
+
if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) {
|
162 |
+
foreach ($terms_data[$post_type->name] as $term) {
|
163 |
+
$selected = ($selected_id == $term->slug)?"selected":"";
|
164 |
+
echo "<option ".esc_attr($selected)." value='".esc_attr($term->slug)."'>".esc_attr($term->name)."</option>";
|
165 |
+
}
|
166 |
+
} ?>
|
167 |
+
</select>
|
168 |
+
</td>
|
169 |
+
</tr>
|
170 |
+
<?php } endforeach; ?>
|
171 |
+
<tr>
|
172 |
+
<th>
|
173 |
+
<label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Show Folders in Menu:', WCP_FOLDER ); ?></label>
|
174 |
+
</th>
|
175 |
+
<td>
|
176 |
+
<?php $val = get_option("folders_show_in_menu"); ?>
|
177 |
+
<input type="hidden" name="folders_show_in_menu" value="off" />
|
178 |
+
<input type="checkbox" name="folders_show_in_menu" value="on" <?php echo ($val == "on")?"checked='checked'":"" ?>/>
|
179 |
+
</td>
|
180 |
+
</tr>
|
181 |
+
<!-- Do not make changes here, Only for Free -->
|
182 |
+
|
183 |
+
<tr>
|
184 |
+
<td colspan="2" style="padding: 10px 0">
|
185 |
+
<?php
|
186 |
+
$total_folders = get_option("folder_old_plugin_folder_status");
|
187 |
+
if($total_folders == false || $total_folders < 10) {
|
188 |
+
$total_folders = 10;
|
189 |
+
}
|
190 |
+
$total = WCP_Folders::get_total_term_folders();
|
191 |
+
if($total > $total_folders) {
|
192 |
+
$total_folders = $total;
|
193 |
+
}
|
194 |
+
?>
|
195 |
+
<span class="upgrade-message">You have used <span class='pink'><?php echo esc_attr($total) ?></span>/<?php echo esc_attr($total_folders) ?> Folders. <a class="pink" href="<?php echo esc_url(admin_url("admin.php?page=wcp_folders_upgrade")) ?>"><?php esc_html_e("Upgrade", WCP_FOLDER) ?></a></span>
|
196 |
+
</td>
|
197 |
+
</tr>
|
198 |
+
|
199 |
+
</table>
|
200 |
<input type="hidden" name="folders_settings1[premio_folder_option]" value="yes" />
|
201 |
</div>
|
202 |
<div class="accordion-right">
|
214 |
<div class="accordion-content">
|
215 |
<div class="accordion-left">
|
216 |
<table class="form-table">
|
217 |
+
<?php
|
218 |
+
$color = !isset($customize_folders['new_folder_color'])||empty($customize_folders['new_folder_color'])?"#F51366":$customize_folders['new_folder_color'];
|
219 |
+
?>
|
220 |
+
<tr>
|
221 |
+
<th width="220px">
|
222 |
+
<label for="new_folder_color" >New Folder button color</label>
|
223 |
+
</th>
|
224 |
+
<td width="32px">
|
225 |
+
<input type="text" class="color-field" name="customize_folders[new_folder_color]" id="new_folder_color" value="<?php echo esc_attr($color) ?>" />
|
226 |
+
</td>
|
227 |
+
<td rowspan="4" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
+
</td>
|
230 |
+
</tr>
|
231 |
+
<?php
|
232 |
+
$color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color'])?"#F51366":$customize_folders['bulk_organize_button_color'];
|
233 |
+
?>
|
234 |
+
<tr>
|
235 |
+
<th>
|
236 |
+
<label for="bulk_organize_button_color" >Bulk Organize button color</label>
|
237 |
+
</th>
|
238 |
+
<td>
|
239 |
+
<input type="text" class="color-field" name="customize_folders[bulk_organize_button_color]" id="bulk_organize_button_color" value="<?php echo esc_attr($color) ?>" />
|
240 |
+
</td>
|
241 |
+
</tr>
|
242 |
+
<?php
|
243 |
+
$color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color'])?"#F51366":$customize_folders['dropdown_color'];
|
244 |
+
?>
|
245 |
+
<tr>
|
246 |
+
<th>
|
247 |
+
<label for="dropdown_color" >Dropdown color</label>
|
248 |
+
</th>
|
249 |
+
<td>
|
250 |
+
<input type="text" class="color-field" name="customize_folders[dropdown_color]" id="dropdown_color" value="<?php echo esc_attr($color) ?>" />
|
251 |
+
</td>
|
252 |
+
</tr>
|
253 |
+
<?php
|
254 |
+
$color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color'])?"#008ec2":$customize_folders['folder_bg_color'];
|
255 |
+
?>
|
256 |
+
<tr>
|
257 |
+
<th>
|
258 |
+
<label for="folder_bg_color" >Folders background color</label>
|
259 |
+
</th>
|
260 |
+
<td>
|
261 |
+
<input type="text" class="color-field" name="customize_folders[folder_bg_color]" id="folder_bg_color" value="<?php echo esc_attr($color) ?>" />
|
262 |
+
</td>
|
263 |
+
</tr>
|
264 |
+
<tr>
|
265 |
+
<th>
|
266 |
+
<label for="folder_font" >Folders font</label>
|
267 |
+
</th>
|
268 |
+
<td colspan="2">
|
269 |
<?php
|
270 |
+
$font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font'])?"":$customize_folders['folder_font'];
|
271 |
+
$index = 0;
|
|
|
|
|
272 |
?>
|
273 |
+
<select name="customize_folders[folder_font]" id="folder_font" >
|
274 |
+
<?php $group = '';
|
275 |
+
foreach ($fonts as $key => $value):
|
276 |
+
$title = $key;
|
277 |
+
if($index == 0) {
|
278 |
+
$key = "";
|
279 |
+
}
|
280 |
+
$index++;
|
281 |
+
if ($value != $group) {
|
282 |
+
echo '<optgroup label="' . $value . '">';
|
283 |
+
$group = $value;
|
284 |
+
}
|
285 |
+
?>
|
286 |
+
<option value="<?php echo $key; ?>" <?php selected($font, $key); ?>><?php echo $title; ?></option>
|
287 |
+
<?php endforeach; ?>
|
288 |
+
</select>
|
289 |
+
</td>
|
290 |
+
</tr>
|
291 |
+
<tr>
|
292 |
+
<th>
|
293 |
+
<label for="folder_size" >Folders size</label>
|
294 |
+
</th>
|
295 |
+
<td colspan="2">
|
296 |
+
<?php
|
297 |
+
$sizes = array(
|
298 |
+
"12" => "Small",
|
299 |
+
"16" => "Medium",
|
300 |
+
"20" => "Large"
|
301 |
+
);
|
302 |
+
$size = !isset($customize_folders['folder_size'])||empty($customize_folders['folder_size'])?"16":$customize_folders['folder_size'];
|
303 |
+
?>
|
304 |
+
<select name="customize_folders[folder_size]" id="folder_size" >
|
305 |
+
<?php
|
306 |
+
foreach ($sizes as $key=>$value) {
|
307 |
+
$selected = ($key == $size)?"selected":"";
|
308 |
+
echo "<option ".$selected." value='".$key."'>".$value."</option>";
|
309 |
+
}
|
310 |
+
?>
|
311 |
+
</select>
|
312 |
+
</td>
|
313 |
+
</tr>
|
314 |
+
</table>
|
315 |
</div>
|
316 |
<div class="accordion-right">
|
317 |
<div class="preview-text">
|
373 |
</div>
|
374 |
<?php submit_button(); ?>
|
375 |
</form>
|
376 |
+
</div>
|
|
|
|
|
|
|
|
templates/admin/help.php
CHANGED
@@ -23,6 +23,7 @@ defined('ABSPATH') or wp_die('Nope, not accessing this');
|
|
23 |
</form>
|
24 |
</div>
|
25 |
<div class="folder-help-btn">
|
|
|
26 |
<a class="folder-help-tooltip" href="javascript:;"><img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/owner.png") ?>" alt="<?php esc_html_e("Need help?", WCP_FOLDER) ?>" /></a>
|
27 |
</div>
|
28 |
<script>
|
23 |
</form>
|
24 |
</div>
|
25 |
<div class="folder-help-btn">
|
26 |
+
<!-- Free/Pro Only URL Change -->
|
27 |
<a class="folder-help-tooltip" href="javascript:;"><img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/owner.png") ?>" alt="<?php esc_html_e("Need help?", WCP_FOLDER) ?>" /></a>
|
28 |
</div>
|
29 |
<script>
|