mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 22:54:03 +09:00
- wp-admin assets refactoring (in process);
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
.um-admin td, .um-admin th {
|
||||
-webkit-font-smoothing: antialiased !important;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
@@ -415,3 +415,134 @@ textarea.um-forms-field.um-small-field {
|
||||
margin: 0 0 0 4px;
|
||||
color: #a00;
|
||||
}
|
||||
|
||||
.wp-picker-container input.wp-color-picker[type="text"] {
|
||||
width: 68px !important;
|
||||
float: left !important;
|
||||
padding: 2px 4px !important;
|
||||
border-width: 1px !important;
|
||||
}
|
||||
|
||||
/* Select2 4.0*/
|
||||
body.um-admin .select2.select2-container .select2-selection{
|
||||
display: block !important;
|
||||
height: 28px !important;
|
||||
padding: 0 0 0 12px !important;
|
||||
overflow: hidden !important;
|
||||
position: relative !important;
|
||||
white-space: nowrap !important;
|
||||
line-height: 25px !important;
|
||||
color: #666 !important;
|
||||
font-size: 13px !important;
|
||||
text-align: left !important;
|
||||
text-decoration: none !important;
|
||||
-moz-border-radius: 2px !important;
|
||||
-webkit-border-radius: 2px !important;
|
||||
border-radius: 2px !important;
|
||||
background-clip: padding-box !important;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background: none !important;
|
||||
background-color: #fff !important;
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow b[role=presentation]{
|
||||
display:none;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow:before{
|
||||
content: "\f3d0" !important;
|
||||
font-size: 27px !important;
|
||||
font-family: "Ionicons" !important;
|
||||
width: 100% !important;
|
||||
display: block;
|
||||
height: 100%;
|
||||
line-height: 28px;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow {
|
||||
display: inline-block !important;
|
||||
width: 34px !important;
|
||||
height: 100% !important;
|
||||
position: absolute !important;
|
||||
right: 0 !important;
|
||||
top: 0 !important;
|
||||
-moz-border-radius: 0 2px 2px 0 !important;
|
||||
-webkit-border-radius: 0 2px 2px 0 !important;
|
||||
border-radius: 0 2px 2px 0 !important;
|
||||
background-clip: padding-box !important;
|
||||
text-align: center !important;
|
||||
background: transparent !important;
|
||||
border-left: 0 !important;
|
||||
}
|
||||
body.um-admin .select2-container.select2-container--open .select2-dropdown{
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
body.um-admin .select2-results li{
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
font-size: 13px;
|
||||
margin: 5px !important;
|
||||
padding: 3px 0 !important;
|
||||
color: #666 !important;
|
||||
}
|
||||
body.um-admin .select2-results li {
|
||||
padding: 3px 7px 4px !important;
|
||||
cursor: pointer;
|
||||
min-height: 1em !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 25px;
|
||||
}
|
||||
body.um-admin .select2-results li.select2-results__option.select2-results__option--highlighted{
|
||||
background: none !important;
|
||||
background: #f4f4f4 !important;
|
||||
color: #666 !important;
|
||||
}
|
||||
body.um-admin .select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background: transparent !important;
|
||||
}
|
||||
body.um-admin .select2-selection__clear {
|
||||
right: 10px;
|
||||
font-size: 25px;
|
||||
color: #aaaaaa !important;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
body.um-admin .select2.select2-container .select2-selection.select2-selection--multiple {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--multiple .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
margin-top: 0px;
|
||||
margin-right: 5px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-search--inline {
|
||||
line-height: 37px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop-active {
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
- Form Inputs
|
||||
*/
|
||||
|
||||
.wp-picker-container input.wp-color-picker[type="text"] {
|
||||
width: 68px !important;
|
||||
float: left !important;
|
||||
padding: 2px 4px !important;
|
||||
border-width: 1px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,6 @@
|
||||
- modal
|
||||
*/
|
||||
|
||||
.um-admin-modal * {
|
||||
-webkit-font-smoothing: antialiased !important;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.um-admin-modal input[type=submit].button-primary,
|
||||
.um-admin-modal a.button-primary,
|
||||
.um-admin-modal a.button {
|
||||
@@ -46,7 +41,7 @@
|
||||
display: none;
|
||||
z-index: 10001;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
width: 730px;
|
||||
margin-left: -365px;
|
||||
}
|
||||
@@ -316,4 +311,4 @@ span.um-admin-icon-clear{
|
||||
}
|
||||
span.um-admin-icon-clear.show {display: inline-block}
|
||||
span.um-admin-icon-clear:hover {color: #777}
|
||||
span.um-admin-icon-clear i {font-size: 20px;vertical-align: middle;}
|
||||
span.um-admin-icon-clear i {font-size: 20px;vertical-align: middle;}
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
/*body.um-admin .select2-container {margin-right: 2px!important;}
|
||||
|
||||
body.um-admin .select2-drop,
|
||||
body.um-admin .select2-drop.select2-drop-above,
|
||||
body.um-admin .select2-drop-active,
|
||||
body.um-admin .select2-container-multi .select2-choices
|
||||
{border: 1px solid #ddd !important}
|
||||
|
||||
body.um-admin .select2-container .select2-choice
|
||||
{
|
||||
height: 27px !important;
|
||||
line-height: 27px !important;
|
||||
border: 1px solid #ddd !important;
|
||||
color: #888 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-choice > .select2-chosen {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-choice {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-choice .select2-arrow:before {
|
||||
font-size: 23px !important;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-search-choice-close:before {
|
||||
font-size: 20px !important;
|
||||
color: #aaa;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container-multi .select2-search-choice-close:before {
|
||||
font-size: 15px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-search input[type=text] {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-results li {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-results .select2-no-results,
|
||||
body.um-admin .select2-results .select2-searching,
|
||||
body.um-admin .select2-results .select2-selection-limit {
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container-multi .select2-choices .select2-search-choice {
|
||||
line-height: 13px !important;
|
||||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop-mask {
|
||||
z-index: 10020 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop {
|
||||
z-index: 999999 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-search {
|
||||
z-index: 10040 !important;
|
||||
}*/
|
||||
|
||||
/* Select2 4.0*/
|
||||
body.um-admin .select2.select2-container .select2-selection{
|
||||
display: block !important;
|
||||
height: 28px !important;
|
||||
padding: 0 0 0 12px !important;
|
||||
overflow: hidden !important;
|
||||
position: relative !important;
|
||||
white-space: nowrap !important;
|
||||
line-height: 25px !important;
|
||||
color: #666 !important;
|
||||
font-size: 13px !important;
|
||||
text-align: left !important;
|
||||
text-decoration: none !important;
|
||||
-moz-border-radius: 2px !important;
|
||||
-webkit-border-radius: 2px !important;
|
||||
border-radius: 2px !important;
|
||||
background-clip: padding-box !important;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background: none !important;
|
||||
background-color: #fff !important;
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow b[role=presentation]{
|
||||
display:none;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow:before{
|
||||
content: "\f3d0" !important;
|
||||
font-size: 27px !important;
|
||||
font-family: "Ionicons" !important;
|
||||
width: 100% !important;
|
||||
display: block;
|
||||
height: 100%;
|
||||
line-height: 28px;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
body.um-admin .select2.select2-container .select2-selection .select2-selection__arrow {
|
||||
display: inline-block !important;
|
||||
width: 34px !important;
|
||||
height: 100% !important;
|
||||
position: absolute !important;
|
||||
right: 0 !important;
|
||||
top: 0 !important;
|
||||
-moz-border-radius: 0 2px 2px 0 !important;
|
||||
-webkit-border-radius: 0 2px 2px 0 !important;
|
||||
border-radius: 0 2px 2px 0 !important;
|
||||
background-clip: padding-box !important;
|
||||
text-align: center !important;
|
||||
background: transparent !important;
|
||||
border-left: 0 !important;
|
||||
}
|
||||
body.um-admin .select2-container.select2-container--open .select2-dropdown{
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
body.um-admin .select2-results li{
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
font-size: 13px;
|
||||
margin: 5px !important;
|
||||
padding: 3px 0 !important;
|
||||
color: #666 !important;
|
||||
}
|
||||
body.um-admin .select2-results li {
|
||||
padding: 3px 7px 4px !important;
|
||||
cursor: pointer;
|
||||
min-height: 1em !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 25px;
|
||||
}
|
||||
body.um-admin .select2-results li.select2-results__option.select2-results__option--highlighted{
|
||||
background: none !important;
|
||||
background: #f4f4f4 !important;
|
||||
color: #666 !important;
|
||||
}
|
||||
body.um-admin .select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background: transparent !important;
|
||||
}
|
||||
body.um-admin .select2-selection__clear {
|
||||
right: 10px;
|
||||
font-size: 25px;
|
||||
color: #aaaaaa !important;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
||||
box-sizing: border-box;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
body.um-admin .select2.select2-container .select2-selection.select2-selection--multiple {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-selection--multiple .select2-selection__clear {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
margin-top: 0px;
|
||||
margin-right: 5px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container--default .select2-results__option[aria-selected=true] {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-container .select2-search--inline {
|
||||
line-height: 37px !important;
|
||||
}
|
||||
|
||||
body.um-admin .select2-drop-active {
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
@@ -1,248 +0,0 @@
|
||||
.um-settings-section .description {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.um-block-notice {
|
||||
background: #fff;
|
||||
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
|
||||
font-size:13px;
|
||||
padding: 20px;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.um-notification-status {
|
||||
margin-right: 18px;
|
||||
font-size: 28px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.um-notification-status {
|
||||
color: #a00;
|
||||
float:left;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.um-notification-status.um-notification-is-active {
|
||||
color: #46b450;
|
||||
}
|
||||
|
||||
.um-email-configure span {
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.um-long-field {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.um-medium-field {
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.um-small-field {
|
||||
width:25%;
|
||||
}
|
||||
|
||||
.column-configure {
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-core_version {
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-theme_version {
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-status {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
th.column-email.column-primary {
|
||||
padding-left: 48px;
|
||||
}
|
||||
|
||||
.um-nav-tab-wrapper {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#um-settings-emails {
|
||||
float:left;
|
||||
width:calc( 100% - 20px );
|
||||
margin-right: 20px;
|
||||
}
|
||||
#um-settings-form {
|
||||
float:left;
|
||||
width:calc( 100% - 10px );
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#um-settings-form .subsubsub {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
.um-settings-line .multi-checkbox-line {
|
||||
float:left;
|
||||
width:100%;
|
||||
clear: both;
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.um-settings-line .multi-checkbox-column {
|
||||
float:left;
|
||||
margin: 0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.um-settings-line .multi-checkbox-column label {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
.wrap-licenses .form-table,
|
||||
.wrap-licenses thead,
|
||||
.wrap-licenses tbody,
|
||||
.wrap-licenses tfoot,
|
||||
.wrap-licenses tr,
|
||||
.wrap-licenses td,
|
||||
.wrap-licenses th,
|
||||
.wrap-licenses caption {
|
||||
display: block;
|
||||
}
|
||||
.wrap-licenses .form-table tr {
|
||||
float: left;
|
||||
margin: 0 15px 15px 0;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
width: 30.5%;
|
||||
max-width: 350px;
|
||||
padding: 14px;
|
||||
min-height: 240px;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wrap-licenses .form-table th {
|
||||
background: #f9f9f9;
|
||||
padding: 14px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: -14px -14px 20px;
|
||||
width: 100%;
|
||||
}
|
||||
.wrap-licenses .form-table td {
|
||||
padding: 0;
|
||||
}
|
||||
.wrap-licenses td input.regular-text {
|
||||
margin: 0 0 8px;
|
||||
width: 100%;
|
||||
}
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] {
|
||||
position: absolute;
|
||||
background: #fafafa;
|
||||
padding: 14px;
|
||||
border-top: 1px solid #eee;
|
||||
margin: 20px -14px -14px;
|
||||
min-height: 67px;
|
||||
width: 100%;
|
||||
bottom: 14px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] a {
|
||||
color: #444;
|
||||
}
|
||||
.wrap-licenses .edd-license-data[class*="edd-license-"] a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice {
|
||||
background-color: #00a0d2;
|
||||
color: #fff;
|
||||
border-color: #00a0d2;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.edd-license-expired {
|
||||
background-color: #e24e4e;
|
||||
color: #fff;
|
||||
border-color: #e24e4e;
|
||||
}
|
||||
|
||||
.wrap-licenses .edd-license-data.edd-license-valid {
|
||||
background-color: #5abc55;
|
||||
color: #fff;
|
||||
border-color: #5abc55;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.edd-license-error,
|
||||
.wrap-licenses .edd-license-data.edd-license-missing,
|
||||
.wrap-licenses .edd-license-data.edd-license-invalid,
|
||||
.wrap-licenses .edd-license-data.edd-license-site_inactive,
|
||||
.wrap-licenses .edd-license-data.edd-license-item_name_mismatch {
|
||||
background-color: #ffebcd;
|
||||
border-color: #ffebcd;
|
||||
}
|
||||
.wrap-licenses .edd-license-data p {
|
||||
font-size: 13px;
|
||||
margin-top: 0;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice a,
|
||||
.wrap-licenses .edd-license-data.edd-license-expired a {
|
||||
color: #fff;
|
||||
}
|
||||
.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover,
|
||||
.wrap-licenses .edd-license-data.edd-license-expired a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.wrap-licenses ~ p.submit {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 980px) {
|
||||
.wrap-licenses .form-table tr {
|
||||
width:calc( 50% - 15px );
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.wrap-licenses .form-table tr {
|
||||
width:100%;
|
||||
margin-right: 0;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
|
||||
.um-settings-line .multi-checkbox-column {
|
||||
width:100% !important;
|
||||
}
|
||||
.um-settings-line .multi-checkbox-column label {
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
.um-medium-field {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.um-small-field {
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-core_version {
|
||||
width: auto;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.wp-list-table.templates .column-theme_version {
|
||||
width: auto;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.um_setting_ajax_button_response.complete {
|
||||
color:darkgreen;
|
||||
font-style: italic;
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.3 KiB |
@@ -1,80 +0,0 @@
|
||||
function um_builder_delete_field_ajax( callback ) {
|
||||
if ( UM.admin.builder.fieldsToDelete.length > 0 ) {
|
||||
let fieldDelete = UM.admin.builder.fieldsToDelete.shift();
|
||||
let arg1 = jQuery( fieldDelete ).find('[data-silent_action="um_admin_remove_field"]').data('arg1');
|
||||
let arg2 = jQuery( fieldDelete ).find('[data-silent_action="um_admin_remove_field"]').data('arg2');
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : 'um_admin_remove_field',
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
success: function( data ) {
|
||||
um_builder_delete_field_ajax( callback );
|
||||
},
|
||||
error: function( data ) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery( document.body ).on('click', 'a[data-silent_action^="um_"]', function() {
|
||||
if ( typeof jQuery(this).attr('disabled') !== 'undefined' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var act_id = jQuery(this).data('silent_action');
|
||||
var arg1 = jQuery(this).data('arg1');
|
||||
var arg2 = jQuery(this).data('arg2');
|
||||
|
||||
var in_row = '';
|
||||
var in_sub_row = '';
|
||||
var in_column = '';
|
||||
var in_group = '';
|
||||
|
||||
var demon_settings = jQuery('.um-col-demon-settings');
|
||||
if ( demon_settings.data('in_column') ) {
|
||||
in_row = demon_settings.data('in_row');
|
||||
in_sub_row = demon_settings.data('in_sub_row');
|
||||
in_column = demon_settings.data('in_column');
|
||||
in_group = demon_settings.data('in_group');
|
||||
}
|
||||
|
||||
um_admin_remove_modal();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : act_id,
|
||||
arg1 : arg1,
|
||||
arg2 : arg2,
|
||||
in_row: in_row,
|
||||
in_sub_row: in_sub_row,
|
||||
in_column: in_column,
|
||||
in_group: in_group,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
success: function( data ) {
|
||||
demon_settings.data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
||||
um_admin_modal_responsive();
|
||||
um_admin_update_builder();
|
||||
},
|
||||
error: function( data ) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
@@ -1,467 +0,0 @@
|
||||
if ( typeof (window.UM) !== 'object' ) {
|
||||
window.UM = {};
|
||||
}
|
||||
|
||||
if ( typeof (window.UM.admin) !== 'object' ) {
|
||||
window.UM.admin = {};
|
||||
}
|
||||
|
||||
UM.admin.builder = {
|
||||
deleteProcess: [],
|
||||
fieldsToDelete: [],
|
||||
}
|
||||
|
||||
function UM_Drag_and_Drop() {
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable({
|
||||
items: '.um-admin-drag-fld',
|
||||
connectWith: '.um-admin-drag-col,.um-admin-drag-group',
|
||||
placeholder: "um-fld-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
update: function(event, ui){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
if ( ui.item.hasClass('um-field-type-group') && ui.item.parents('.um-field-type-group').length > 0 ) {
|
||||
|
||||
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable('cancel');
|
||||
|
||||
jQuery('#publish').prop('disabled', false);
|
||||
|
||||
} else {
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.um-admin-drag-rowsubs').sortable({
|
||||
items: '.um-admin-drag-rowsub',
|
||||
placeholder: "um-rowsub-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
zIndex: 9999999999,
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
UM_update_subrows();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
jQuery('.um-admin-drag-rowsub').sortable({
|
||||
items: '.um-admin-drag-col',
|
||||
zIndex: 9999999999,
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
row = jQuery(this);
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
if ( row.find('.um-admin-drag-col').length == 3 ) {row.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
jQuery('.um-admin-drag-ajax').sortable({
|
||||
items: '.um-admin-drag-row',
|
||||
handle: ".um-admin-drag-row-start",
|
||||
zIndex: 9999999999,
|
||||
placeholder: "um-row-placeholder",
|
||||
forcePlaceholderSize:true,
|
||||
out: function(){
|
||||
UM.common.tipsy.hide();
|
||||
},
|
||||
update: function(){
|
||||
|
||||
jQuery('#publish').attr('disabled','disabled');
|
||||
|
||||
UM_update_rows();
|
||||
|
||||
UM_Change_Field_Col();
|
||||
|
||||
UM_Change_Field_Grp();
|
||||
|
||||
UM_Rows_Refresh();
|
||||
|
||||
}
|
||||
}).disableSelection();
|
||||
}
|
||||
|
||||
function UM_update_rows() {
|
||||
var c = 0;
|
||||
jQuery('a[data-remove_element="um-admin-drag-row"]').remove();
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c++;
|
||||
row = jQuery(this);
|
||||
if ( c != 1 ) {
|
||||
row.find('.um-admin-drag-row-icons').append( '<a href="#" class="um-tip-n" title="Delete Row" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function UM_update_subrows(){
|
||||
jQuery('a[data-remove_element="um-admin-drag-rowsub"]').remove();
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c = 0;
|
||||
jQuery(this).find('.um-admin-drag-rowsub').each(function(){
|
||||
c++;
|
||||
row = jQuery(this);
|
||||
if ( c != 1 ) {
|
||||
row.find('.um-admin-drag-rowsub-icons').append('<a href="#" class="um-tip-n" title="Delete Row" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Change_Field_Col(){
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld').each(function(){
|
||||
cols = jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length;
|
||||
col = jQuery(this).parents('.um-admin-drag-col');
|
||||
if ( col.hasClass('cols-last') ) {
|
||||
if ( cols == 1 ) {
|
||||
saved_col = 1;
|
||||
}
|
||||
if ( cols == 3 ) {
|
||||
saved_col = 3;
|
||||
} else if ( cols == 2 ) {
|
||||
saved_col = 2;
|
||||
}
|
||||
} else if ( col.hasClass('cols-middle') && cols == 3 ) {
|
||||
saved_col = 2;
|
||||
} else {
|
||||
saved_col = 1;
|
||||
}
|
||||
|
||||
jQuery(this).data('column', saved_col);
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Change_Field_Grp(){
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld:not(.um-field-type-group)').each(function(){
|
||||
if ( jQuery(this).parents('.um-admin-drag-group').length == 0 ){
|
||||
jQuery(this).data('group', '');
|
||||
} else {
|
||||
jQuery(this).data('group', jQuery(this).parents('.um-admin-drag-fld.um-field-type-group').data('key') );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function UM_Rows_Refresh(){
|
||||
|
||||
jQuery('.um_update_order_fields').empty();
|
||||
|
||||
/* ROWS */
|
||||
var c = 0;
|
||||
jQuery('.um-admin-drag-row').each(function(){
|
||||
c++;
|
||||
|
||||
row = jQuery(this);
|
||||
|
||||
col_num = '';
|
||||
row.find('.um-admin-drag-rowsub').each(function(){
|
||||
|
||||
subrow = jQuery(this);
|
||||
|
||||
subrow.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
subrow.find('.um-admin-drag-col').addClass('cols-' + subrow.find('.um-admin-drag-col').length );
|
||||
subrow.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
if ( subrow.find('.um-admin-drag-col').length == 3 ) {subrow.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
if ( !col_num ) {
|
||||
col_num = subrow.find('.um-admin-drag-col').length;
|
||||
} else {
|
||||
col_num = col_num + ':' + subrow.find('.um-admin-drag-col').length;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_rowcols_'+c+'_cols" id="_um_rowcols_'+c+'_cols" value="'+col_num+'" />');
|
||||
|
||||
sub_rows_count = row.find('.um-admin-drag-rowsub').length;
|
||||
|
||||
var origin_id = jQuery(this).attr('data-original');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_row_'+c+'" id="_um_row_'+c+'" value="_um_row_'+c+'" />');
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_roworigin_'+c+'_val" id="_um_roworigin_'+c+'_val" value="'+origin_id+'" />');
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="_um_rowsub_'+c+'_rows" id="_um_rowsub_'+c+'_rows" value="'+sub_rows_count+'" />');
|
||||
|
||||
jQuery(this).attr('data-original', '_um_row_'+c );
|
||||
|
||||
});
|
||||
|
||||
/* FIELDS */
|
||||
var order;
|
||||
order = 0;
|
||||
jQuery('.um-admin-drag-col .um-admin-drag-fld').each(function(){
|
||||
|
||||
if ( !jQuery(this).hasClass('group') ) {
|
||||
var group = jQuery(this).data('group');
|
||||
if ( group != '' ) {
|
||||
if ( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group').find( jQuery(this) ).length == 0 ) {
|
||||
jQuery(this).appendTo( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group') );
|
||||
} else {
|
||||
//jQuery(this).prependTo( jQuery('.um-admin-drag-fld.um-field-type-group.' + group ).find('.um-admin-drag-group') );
|
||||
}
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_group_'+jQuery(this).data('key')+'" id="um_group_'+jQuery(this).data('key')+'" value="'+group+'" />');
|
||||
} else {
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_group_'+jQuery(this).data('key')+'" id="um_group_'+jQuery(this).data('key')+'" value="" />');
|
||||
}
|
||||
}
|
||||
|
||||
order++;
|
||||
|
||||
row = jQuery(this).parents('.um-admin-drag-row').index()+1;
|
||||
row = '_um_row_'+row;
|
||||
|
||||
saved_col = jQuery(this).data('column');
|
||||
|
||||
if ( saved_col == 3 ){
|
||||
jQuery(this).appendTo( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col:eq(2)') );
|
||||
}
|
||||
if ( saved_col == 2 ){
|
||||
jQuery(this).appendTo( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col:eq(1)') );
|
||||
}
|
||||
|
||||
sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_position_'+jQuery(this).data('key')+'" id="um_position_'+jQuery(this).data('key')+'" value="'+order+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_row_'+jQuery(this).data('key')+'" id="um_row_'+jQuery(this).data('key')+'" value="'+row+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_subrow_'+jQuery(this).data('key')+'" id="um_subrow_'+jQuery(this).data('key')+'" value="'+sub_row+'" />');
|
||||
|
||||
jQuery('.um_update_order_fields').append('<input type="hidden" name="um_col_'+jQuery(this).data('key')+'" id="um_col_'+jQuery(this).data('key')+'" value="'+saved_col+'" />');
|
||||
|
||||
});
|
||||
|
||||
UM_Drag_and_Drop();
|
||||
|
||||
UM_Add_Icon();
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: jQuery( '.um_update_order' ).serialize(),
|
||||
success: function(){
|
||||
jQuery('#publish').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function UM_Add_Icon(){
|
||||
|
||||
var add_icon_html = '<a href="#" class="um-admin-drag-add-field um-tip-n" title="Add Field" data-modal="UM_fields" data-modal-size="normal" data-dynamic-content="um_admin_show_fields" data-arg2="'+jQuery('.um-admin-drag-ajax').data('form_id')+'" data-arg1=""><i class="um-icon-plus"></i></a>';
|
||||
|
||||
jQuery('.um-admin-drag-col').each(function(){
|
||||
if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) {
|
||||
jQuery(this).append(add_icon_html);
|
||||
} else {
|
||||
jQuery(this).find('.um-admin-drag-add-field').remove();
|
||||
jQuery(this).append(add_icon_html);
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.um-admin-drag-group').each(function(){
|
||||
if ( jQuery(this).find('.um-admin-drag-add-field').length == 0 ) {
|
||||
jQuery(this).append(add_icon_html);
|
||||
} else {
|
||||
jQuery(this).find('.um-admin-drag-add-field').remove();
|
||||
jQuery(this).append(add_icon_html);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
if ( !jQuery('.um-admin-drag').length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UM_Drag_and_Drop();
|
||||
|
||||
/* add field to respected area */
|
||||
jQuery( document.body ).on('click', 'a.um-admin-drag-add-field', function() {
|
||||
in_row = jQuery(this).parents('.um-admin-drag-row').index();
|
||||
in_sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 1 ) {
|
||||
in_column = 1;
|
||||
} else {
|
||||
if ( jQuery(this).parents('.um-admin-drag-col').hasClass('cols-middle')){
|
||||
in_column = 2;
|
||||
} else if ( jQuery(this).parents('.um-admin-drag-col').hasClass('cols-last') ) {
|
||||
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 3 ) {
|
||||
in_column = 3;
|
||||
} else {
|
||||
in_column = 2;
|
||||
}
|
||||
} else {
|
||||
in_column = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( jQuery(this).parents('.um-admin-drag-group').length ) {
|
||||
in_group = jQuery(this).parents('.um-admin-drag-fld.um-field-type-group').data('key');
|
||||
} else {
|
||||
in_group = '';
|
||||
}
|
||||
|
||||
jQuery('.um-col-demon-settings').data('in_row', in_row);
|
||||
jQuery('.um-col-demon-settings').data('in_sub_row', in_sub_row);
|
||||
jQuery('.um-col-demon-settings').data('in_column', in_column);
|
||||
jQuery('.um-col-demon-settings').data('in_group', in_group);
|
||||
});
|
||||
|
||||
/* add row */
|
||||
jQuery(document.body).on('click', '*[data-row_action="add_row"]', function(){
|
||||
var dragg = jQuery('.um-admin-drag-ajax');
|
||||
dragg.append( '<div class="um-admin-drag-row">' + jQuery('.um-col-demon-row').html() + '</div>' );
|
||||
dragg.find('.um-admin-drag-row:last').find('.um-admin-drag-row-icons').find('a.um-admin-drag-row-edit').attr('data-arg3', '_um_row_' + ( dragg.find('.um-admin-drag-row').length ) );
|
||||
dragg.find('.um-admin-drag-row:last').attr('data-original', '_um_row_' + ( dragg.find('.um-admin-drag-row').length ) );
|
||||
UM_update_rows();
|
||||
UM_update_subrows();
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
/* add sub row */
|
||||
jQuery(document.body).on('click', '*[data-row_action="add_subrow"]', function(){
|
||||
var dragg = jQuery(this).parents('.um-admin-drag-row').find('.um-admin-drag-rowsubs');
|
||||
dragg.append( '<div class="um-admin-drag-rowsub">' + jQuery('.um-col-demon-subrow').html() + '</div>' );
|
||||
UM_update_subrows();
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
|
||||
/* remove element: Row, Subrow */
|
||||
jQuery(document.body).on('click', 'a[data-remove_element^="um-"]',function(){
|
||||
let deleteButton = jQuery(this);
|
||||
let element = jQuery(this).data('remove_element');
|
||||
let loadingWrapper = jQuery(this).parents('.' + element ).children('.um-admin-row-loading');
|
||||
|
||||
let row = jQuery(this).parents('.um-admin-drag-row').index();
|
||||
let subrow = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
||||
|
||||
let fieldPosition= {row,subrow};
|
||||
let deleteExists= false;
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
deleteExists = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if ( deleteExists ) {
|
||||
return;
|
||||
}
|
||||
|
||||
loadingWrapper.show();
|
||||
|
||||
UM.admin.builder.deleteProcess.push({row,subrow});
|
||||
|
||||
UM.admin.builder.fieldsToDelete = jQuery(this).parents('.' +element).find('.um-admin-drag-fld').toArray();
|
||||
|
||||
if ( UM.admin.builder.fieldsToDelete.length > 0 ) {
|
||||
um_builder_delete_field_ajax( function () {
|
||||
UM.common.tipsy.hide();
|
||||
deleteButton.parents('.' +element).remove();
|
||||
UM_Rows_Refresh();
|
||||
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
UM.admin.builder.deleteProcess.splice(i, 1);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
loadingWrapper.hide();
|
||||
} );
|
||||
} else {
|
||||
UM.common.tipsy.hide();
|
||||
jQuery(this).parents('.' +element).remove();
|
||||
UM_Rows_Refresh();
|
||||
|
||||
jQuery.each( UM.admin.builder.deleteProcess, function(i) {
|
||||
if ( fieldPosition.row === UM.admin.builder.deleteProcess[i].row && fieldPosition.subrow === UM.admin.builder.deleteProcess[i].subrow ) {
|
||||
UM.admin.builder.deleteProcess.splice(i, 1);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
loadingWrapper.hide();
|
||||
}
|
||||
});
|
||||
|
||||
/* dynamically change columns */
|
||||
jQuery(document.body).on('click', '.um-admin-drag-ctrls.columns a', function(){
|
||||
|
||||
var row = jQuery(this).parents('.um-admin-drag-rowsub');
|
||||
var tab = jQuery(this);
|
||||
var tabs = jQuery(this).parent();
|
||||
tabs.find('a').removeClass('active');
|
||||
tab.addClass('active');
|
||||
var existing_cols = row.find('.um-admin-drag-col').length;
|
||||
var required_cols = tab.data('cols');
|
||||
var needed_cols = required_cols - existing_cols;
|
||||
|
||||
if ( needed_cols > 0 ) {
|
||||
|
||||
for (i = 0; i < needed_cols; i++){
|
||||
row.find('.um-admin-drag-col-dynamic').append('<div class="um-admin-drag-col"></div>');
|
||||
}
|
||||
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
|
||||
if ( row.find('.um-admin-drag-col').length == 3 ) {row.find('.um-admin-drag-col:eq(1)').addClass('cols-middle');}
|
||||
|
||||
} else if ( needed_cols < 0 ) {
|
||||
|
||||
needed_cols = needed_cols + 3;
|
||||
if ( needed_cols == 2 ) {
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-last').html() );
|
||||
row.find('.um-admin-drag-col.cols-last').remove();
|
||||
}
|
||||
if ( needed_cols == 1 ) {
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-last').html() );
|
||||
row.find('.um-admin-drag-col:first').append( row.find('.um-admin-drag-col.cols-middle').html() );
|
||||
row.find('.um-admin-drag-col.cols-last').remove();
|
||||
row.find('.um-admin-drag-col.cols-middle').remove();
|
||||
}
|
||||
|
||||
row.find('.um-admin-drag-col').removeClass('cols-1 cols-2 cols-3 cols-last cols-middle');
|
||||
row.find('.um-admin-drag-col').addClass('cols-' + row.find('.um-admin-drag-col:visible').length );
|
||||
row.find('.um-admin-drag-col:last').addClass('cols-last');
|
||||
|
||||
}
|
||||
|
||||
if ( allow_update_via_col_click == true ) {
|
||||
UM_Change_Field_Col();
|
||||
UM_Rows_Refresh();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/* trigger columns at start */
|
||||
allow_update_via_col_click = false;
|
||||
jQuery('.um-admin-drag-ctrls.columns a.active').each(function(){
|
||||
jQuery(this).trigger('click');
|
||||
}).promise().done( function(){ allow_update_via_col_click = true; } );
|
||||
|
||||
UM_Rows_Refresh();
|
||||
});
|
||||
@@ -1,109 +0,0 @@
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/* Remove field permanently */
|
||||
jQuery(document.body).on('click', '.um-admin-btns a span.remove', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
if ( confirm( wp.i18n.__( 'This will permanently delete this custom field from a database and from all forms on your site. Are you sure?', 'ultimate-member' ) ) ) {
|
||||
|
||||
jQuery(this).parents('a').remove();
|
||||
|
||||
var arg1 = jQuery(this).parents('a').data('arg1');
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_do_ajax_action',
|
||||
act_id : 'um_admin_remove_field_global',
|
||||
arg1 : arg1,
|
||||
nonce: um_admin_scripts.nonce
|
||||
|
||||
},
|
||||
success: function(data) {
|
||||
jQuery('#um-admin-form-builder .' + arg1).remove();
|
||||
},
|
||||
error: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
/* Add a Field */
|
||||
jQuery(document.body).on('submit', 'form.um_add_field', function(e){
|
||||
e.preventDefault();
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
//need fields refactor
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
if ( jQuery( this ).find('[id^="_conditional_action"]').val() === '' ||
|
||||
jQuery( this ).find('[id^="_conditional_field"]').val() === '' ||
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').val() ==='' )
|
||||
{
|
||||
jQuery(conditions[i]).find('.um-admin-remove-condition').trigger('click');
|
||||
}
|
||||
} );
|
||||
conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
var id = i === 0 ? '' : i;
|
||||
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
var form = jQuery(this);
|
||||
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form.serialize(),
|
||||
beforeSend: function(){
|
||||
form.css({'opacity': 0.5});
|
||||
jQuery('.um-admin-error').removeClass('um-admin-error');
|
||||
form.find('.um-admin-error-block').hide();
|
||||
form.find('.um-admin-success-block').hide();
|
||||
},
|
||||
complete: function(){
|
||||
form.css({'opacity': 1});
|
||||
},
|
||||
success: function( response ){
|
||||
if ( response.success ) {
|
||||
let data = response.data;
|
||||
if ( data.error ) {
|
||||
let c = 0;
|
||||
jQuery.each( data.error, function(i, v){
|
||||
c++;
|
||||
if ( 1 === c ) {
|
||||
form.find('#' + i).addClass('um-admin-error').trigger('focus');
|
||||
form.find('.um-admin-error-block').show().html(v);
|
||||
}
|
||||
});
|
||||
|
||||
um_admin_modal_responsive();
|
||||
} else {
|
||||
jQuery('.um-col-demon-settings').data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
||||
UM.common.tipsy.hide();
|
||||
um_admin_remove_modal();
|
||||
um_admin_update_builder();
|
||||
}
|
||||
} else {
|
||||
console.log( response );
|
||||
}
|
||||
},
|
||||
error: function( response ){
|
||||
console.log( response );
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
@@ -228,115 +228,7 @@ function um_admin_modal_add_attr( id, value ) {
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
/**
|
||||
disable link
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-builder a, .um-admin-modal a:not(.um-preview-upload)', function(e){
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
toggle area
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-btn-toggle a', function(e){
|
||||
var content = jQuery(this).parent().find('.um-admin-btn-content');
|
||||
var link = jQuery(this);
|
||||
if ( content.is(':hidden') ) {
|
||||
content.show();
|
||||
link.find('i').removeClass().addClass('um-icon-minus');
|
||||
link.addClass('active');
|
||||
} else {
|
||||
content.hide();
|
||||
link.find('i').removeClass().addClass('um-icon-plus');
|
||||
link.removeClass('active');
|
||||
}
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
clone a condition
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-new-condition', function() {
|
||||
|
||||
if ( jQuery(this).hasClass('disabled') )
|
||||
return false;
|
||||
|
||||
var content = jQuery(this).parents('.um-admin-btn-content'),
|
||||
length = content.find('.um-admin-cur-condition').length;
|
||||
|
||||
if ( length < 5 ) {
|
||||
//content.find('select').select2('destroy');
|
||||
|
||||
var template = jQuery('.um-admin-btn-content').find('.um-admin-cur-condition-template').clone();
|
||||
template.find('input[type=text]').val('');
|
||||
template.find('select').val('');
|
||||
|
||||
template.appendTo( content );
|
||||
jQuery(template).removeClass("um-admin-cur-condition-template");
|
||||
jQuery(template).addClass("um-admin-cur-condition");
|
||||
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
} else {
|
||||
jQuery(this).addClass('disabled');
|
||||
alert( 'You already have 5 rules' );
|
||||
}
|
||||
//need fields refactor
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
id = i === 0 ? '' : i;
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
reset conditions
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-reset-conditions a', function(){
|
||||
var content = jQuery(this).parents('.um-admin-btn-content');
|
||||
content.find('.um-admin-cur-condition').slice(1).remove();
|
||||
content.find('input[type=text]').val('');
|
||||
content.find('select').val('');
|
||||
jQuery('.um-admin-new-condition').removeClass('disabled');
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
/**
|
||||
remove a condition
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-remove-condition', function(){
|
||||
var condition = jQuery(this).parents('.um-admin-cur-condition');
|
||||
jQuery('.um-admin-new-condition').removeClass('disabled');
|
||||
UM.common.tipsy.hide();
|
||||
condition.remove();
|
||||
//need fields refactor
|
||||
var conditions = jQuery('.um-admin-cur-condition');
|
||||
jQuery(conditions).each( function ( i ) {
|
||||
id = i === 0 ? '' : i;
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('name', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_action"]').attr('id', '_conditional_action' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('name', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_field"]').attr('id', '_conditional_field' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('name', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_operator"]').attr('id', '_conditional_operator' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('name', '_conditional_value' + id);
|
||||
jQuery( this ).find('[id^="_conditional_value"]').attr('id', '_conditional_value' + id);
|
||||
} );
|
||||
um_admin_live_update_scripts();
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
/**
|
||||
remove modal via action
|
||||
@@ -375,15 +267,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
choose font icon
|
||||
**/
|
||||
jQuery(document.body).on('click', '.um-admin-icons span', function(){
|
||||
var icon = jQuery(this).attr('data-code');
|
||||
jQuery(this).parent().find('span').removeClass('highlighted');
|
||||
jQuery(this).addClass('highlighted');
|
||||
jQuery('#UM_fonticons').find('a.um-admin-modal-back').attr("data-code", icon);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
submit font icon
|
||||
@@ -436,41 +320,5 @@ jQuery(document).ready(function() {
|
||||
um_admin_modal_responsive();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve options from a callback function
|
||||
*/
|
||||
jQuery(document.body).on('blur',"#_custom_dropdown_options_source", function(){
|
||||
var me = jQuery(this);
|
||||
var _options = jQuery('textarea[id=_options]');
|
||||
|
||||
if( me.val() != '' ){
|
||||
var um_option_callback = me.val();
|
||||
jQuery.ajax({
|
||||
url: wp.ajax.settings.url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action:'um_populate_dropdown_options',
|
||||
um_option_callback: um_option_callback,
|
||||
nonce: um_admin_scripts.nonce
|
||||
},
|
||||
complete: function(){
|
||||
|
||||
},
|
||||
success: function( response ){
|
||||
var arr_opts = [];
|
||||
|
||||
for (var key in response.data ){
|
||||
arr_opts.push( response.data[ key ] );
|
||||
}
|
||||
|
||||
_options.val( arr_opts.join('\n') );
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}); // end jQuery(document).ready
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
jQuery( document ).ready( function() {
|
||||
|
||||
|
||||
/**
|
||||
* Licenses
|
||||
*/
|
||||
jQuery( document.body ).on( 'click', '.um_license_deactivate', function() {
|
||||
jQuery(this).siblings('.um-option-field').val('');
|
||||
if ( jQuery(this).siblings('#submit').length ) {
|
||||
// clear = true for passing the empty field value to the license form submission
|
||||
jQuery(this).siblings('#submit').trigger('click',[ true ]);
|
||||
} else {
|
||||
jQuery(this).parents('form.um-settings-form').trigger('submit');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
jQuery( document.body ).on( 'click', '.um-settings-form #submit', function( e, clear ) {
|
||||
if ( ! clear && '' === jQuery(this).siblings('.um-option-field').val() ) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Not licenses page
|
||||
*/
|
||||
if ( jQuery( '#licenses_settings' ).length === 0 ) {
|
||||
var changed = false;
|
||||
|
||||
jQuery( 'input, textarea, select' ).on('change', function() {
|
||||
changed = true;
|
||||
});
|
||||
|
||||
jQuery( '#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a' ).on( 'click', function() {
|
||||
if ( changed ) {
|
||||
window.onbeforeunload = function() {
|
||||
return wp.i18n.__( 'Are sure, maybe some settings not saved', 'ultimate-member' );
|
||||
};
|
||||
} else {
|
||||
window.onbeforeunload = '';
|
||||
}
|
||||
});
|
||||
|
||||
jQuery( '.submit input' ).on( 'click', function() {
|
||||
window.onbeforeunload = '';
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -65,12 +65,8 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 );
|
||||
|
||||
add_action( 'admin_head', array( &$this, 'admin_head' ), 9 );
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
||||
|
||||
add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
|
||||
|
||||
add_action( 'load-customize.php', array( &$this, 'navmenu_scripts' ) );
|
||||
add_action( 'load-edit.php', array( &$this, 'posts_page' ) );
|
||||
|
||||
@@ -295,7 +291,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -305,6 +300,14 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
|
||||
$this->register_jquery_ui();
|
||||
|
||||
// Scripts for frontend preview.
|
||||
UM()->frontend()->enqueue()->load_css();
|
||||
UM()->frontend()->enqueue()->load_modal();
|
||||
UM()->frontend()->enqueue()->load_responsive();
|
||||
|
||||
wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
|
||||
//scripts for FRONTEND PREVIEW
|
||||
wp_register_script( 'um_jquery_form', $this->front_js_baseurl . 'um-jquery-form' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_fileupload', $this->front_js_baseurl . 'um-fileupload.js', array( 'jquery' ), UM_VERSION, true );
|
||||
@@ -346,48 +349,12 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter title placeholder
|
||||
*
|
||||
* @param $title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function enter_title_here( $title ) {
|
||||
$screen = get_current_screen();
|
||||
if ( 'um_directory' === $screen->post_type ) {
|
||||
$title = __( 'e.g. Member Directory', 'ultimate-member' );
|
||||
} elseif ( 'um_form' === $screen->post_type ) {
|
||||
$title = __( 'e.g. New Registration Form', 'ultimate-member' );
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runs on admin head
|
||||
*/
|
||||
public function admin_head() {
|
||||
if ( UM()->admin()->screen()->is_own_post_type() ) { ?>
|
||||
<style type="text/css">
|
||||
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#slugdiv,
|
||||
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#minor-publishing,
|
||||
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#screen-meta-links
|
||||
{display:none}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Forms
|
||||
*/
|
||||
public function load_forms() {
|
||||
$suffix = self::get_suffix();
|
||||
|
||||
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker', 'um_ui', 'select2' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_forms' );
|
||||
|
||||
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery', 'wp-i18n', self::$select2_handle, 'jquery-ui-draggable', 'jquery-ui-sortable' ), UM_VERSION, true );
|
||||
|
||||
wp_localize_script(
|
||||
@@ -407,29 +374,26 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
);
|
||||
|
||||
wp_enqueue_script( 'um_admin_forms' );
|
||||
|
||||
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker', 'um_ui', 'select2' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_forms' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load modal
|
||||
*/
|
||||
public function load_modal() {
|
||||
wp_register_style( 'um_admin_modal', $this->css_url . 'um-admin-modal.css', array( 'wp-color-picker' ), ultimatemember_version );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
$suffix = self::get_suffix();
|
||||
$js_url = self::get_url( 'js' );
|
||||
$css_url = self::get_url( 'css' );
|
||||
|
||||
wp_register_script( 'um_admin_modal', $this->js_url . 'um-admin-modal.js', array( 'jquery', 'editor', 'wp-util', 'wp-color-picker', 'wp-tinymce', 'wp-i18n', 'um_admin_common' ), ultimatemember_version, true );
|
||||
wp_register_script( 'um_admin_modal', $js_url . 'admin/modal' . $suffix . '.js', array( 'jquery', 'editor', 'wp-util', 'wp-color-picker', 'wp-tinymce', 'wp-i18n', 'um_admin_common' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_admin_modal' );
|
||||
|
||||
wp_register_style( 'um_admin_modal', $css_url . 'admin/modal' . $suffix . '.css', array( 'wp-color-picker' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Field Processing
|
||||
*/
|
||||
public function load_field() {
|
||||
wp_register_script( 'um_admin_field', $this->js_url . 'um-admin-field.js', array( 'jquery', 'wp-util', 'wp-i18n' ), ultimatemember_version, true );
|
||||
wp_enqueue_script( 'um_admin_field' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Builder
|
||||
*/
|
||||
@@ -443,43 +407,10 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_register_script( 'um_admin_builder', $js_url . 'admin/builder' . $suffix . '.js', array( 'um_common', 'jquery-ui-draggable', 'jquery-ui-sortable' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_admin_builder' );
|
||||
|
||||
wp_register_script( 'um_admin_dragdrop', $this->js_url . 'um-admin-dragdrop.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true );
|
||||
wp_enqueue_script( 'um_admin_dragdrop' );
|
||||
|
||||
wp_register_style( 'um_admin_builder', $css_url . 'admin/builder' . $suffix . '.css', array( 'um_ui' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_builder' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load core WP styles/scripts
|
||||
*/
|
||||
public function load_core_wp() {
|
||||
wp_enqueue_script( 'jquery-ui-draggable' );
|
||||
wp_enqueue_script( 'jquery-ui-sortable' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Admin Styles
|
||||
*/
|
||||
public function load_css() {
|
||||
wp_register_style( 'um_admin_columns', $this->css_url . 'um-admin-columns.css', array(), ultimatemember_version );
|
||||
wp_enqueue_style( 'um_admin_columns' );
|
||||
|
||||
wp_register_style( 'um_admin_misc', $this->css_url . 'um-admin-misc.css', array(), ultimatemember_version );
|
||||
wp_enqueue_style( 'um_admin_misc' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load functions js
|
||||
*/
|
||||
public function load_functions() {
|
||||
wp_register_script( 'um_functions', UM_URL . 'assets/js/um-functions.js', array( 'jquery', 'jquery-masonry', 'wp-util' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_functions' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load global css
|
||||
*/
|
||||
@@ -517,15 +448,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_enqueue_style( 'um_admin_global' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load AJAX
|
||||
*/
|
||||
public function load_ajax_js() {
|
||||
wp_register_script( 'um_admin_ajax', $this->js_url . 'um-admin-ajax.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true );
|
||||
wp_enqueue_script( 'um_admin_ajax' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Gutenberg scripts
|
||||
*/
|
||||
@@ -567,7 +489,6 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
do_action( 'um_load_gutenberg_js' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add Gutenberg category for UM shortcodes.
|
||||
*
|
||||
@@ -606,37 +527,18 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
$this->load_global_scripts();
|
||||
|
||||
if ( UM()->admin()->screen()->is_own_screen() ) {
|
||||
wp_register_script( 'um_admin_common', $js_url . 'admin/common' . $suffix . '.js', array( 'jquery', 'wp-i18n', 'wp-color-picker', 'jquery-ui-tooltip', 'um_datetime', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION, true );
|
||||
wp_register_script( 'um_admin_common', $js_url . 'admin/common' . $suffix . '.js', array( 'jquery', 'wp-i18n', 'wp-color-picker', 'jquery-ui-tooltip', 'um_common', 'um_datetime', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION, true );
|
||||
wp_enqueue_script( 'um_admin_common' );
|
||||
|
||||
wp_register_style( 'um_admin_common', $css_url . 'admin/common' . $suffix . '.css', array( 'um_common', 'um_ui', 'dashicons', 'um_datetime_date', 'um_datetime_time' ), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_common' );
|
||||
|
||||
/*if ( get_post_type() != 'shop_order' ) {
|
||||
UM()->enqueue()->wp_enqueue_scripts();
|
||||
}*/
|
||||
|
||||
// $modal_deps = array( 'um-admin-scripts' );
|
||||
if ( $this->um_cpt_form_screen ) {
|
||||
$this->load_builder();
|
||||
// $modal_deps[] = 'um-responsive';
|
||||
$this->load_modal();
|
||||
}
|
||||
|
||||
$this->load_functions();
|
||||
$this->load_forms();
|
||||
$this->load_modal();
|
||||
$this->load_field();
|
||||
$this->load_css();
|
||||
$this->load_core_wp();
|
||||
$this->load_ajax_js();
|
||||
|
||||
// Scripts for frontend preview.
|
||||
UM()->frontend()->enqueue()->load_css();
|
||||
UM()->frontend()->enqueue()->load_modal();
|
||||
UM()->frontend()->enqueue()->load_responsive();
|
||||
|
||||
wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
|
||||
if ( is_rtl() ) {
|
||||
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css', array(), ultimatemember_version );
|
||||
@@ -647,6 +549,8 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
if ( 'users.php' === $hook ) {
|
||||
wp_register_style( 'um_admin_users', $css_url . 'admin/users' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_enqueue_style( 'um_admin_users' );
|
||||
|
||||
$this->load_modal();
|
||||
} elseif ( 'user-new.php' === $hook || 'user-edit.php' === $hook ) {
|
||||
wp_register_script( 'um_admin_role_wrapper', $js_url . 'admin/user' . $suffix . '.js', array( 'jquery', 'wp-hooks' ), UM_VERSION, true );
|
||||
$localize_roles_data = get_option( 'um_roles', array() );
|
||||
|
||||
@@ -71,6 +71,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
add_action( 'admin_head', array( &$this, 'admin_head' ), 9 );
|
||||
add_action( 'admin_footer', array( &$this, 'load_modal_content' ), 9 );
|
||||
|
||||
add_action( 'admin_init', array( &$this, 'remove_meta_box' ), 0 );
|
||||
add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ), 10, 2 );
|
||||
|
||||
add_action( 'load-post.php', array( &$this, 'add_metabox' ), 9 );
|
||||
add_action( 'load-post-new.php', array( &$this, 'add_metabox' ), 9 );
|
||||
|
||||
@@ -85,6 +88,34 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
add_filter( 'um_member_directory_meta_value_before_save', array( UM()->member_directory(), 'before_save_data' ), 10, 3 );
|
||||
}
|
||||
|
||||
public function remove_meta_box() {
|
||||
remove_meta_box( 'submitdiv', 'um_form', 'core' );
|
||||
remove_meta_box( 'slugdiv', 'um_form', 'core' );
|
||||
|
||||
remove_meta_box( 'submitdiv', 'um_directory', 'core' );
|
||||
remove_meta_box( 'slugdiv', 'um_directory', 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter title placeholder
|
||||
*
|
||||
* @param string $title
|
||||
* @param WP_Post $post
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function enter_title_here( $title, $post ) {
|
||||
if ( ! isset( $post->post_type ) ) {
|
||||
return $title;
|
||||
}
|
||||
|
||||
if ( 'um_directory' === $post->post_type ) {
|
||||
$title = __( 'e.g. Member Directory', 'ultimate-member' );
|
||||
} elseif ( 'um_form' === $post->post_type ) {
|
||||
$title = __( 'e.g. New Registration Form', 'ultimate-member' );
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide Woocommerce Shop page restrict content metabox
|
||||
@@ -161,13 +192,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
global $current_screen;
|
||||
|
||||
if ( $current_screen->id == 'um_form' ) {
|
||||
add_action( 'add_meta_boxes', array(&$this, 'add_metabox_form'), 1 );
|
||||
add_action( 'save_post', array(&$this, 'save_metabox_form'), 10, 2 );
|
||||
add_action( 'add_meta_boxes', array( &$this, 'add_metabox_form' ), 1 );
|
||||
add_action( 'save_post', array( &$this, 'save_metabox_form' ), 10, 2 );
|
||||
}
|
||||
|
||||
if ( $current_screen->id == 'um_directory' ) {
|
||||
add_action( 'add_meta_boxes', array(&$this, 'add_metabox_directory'), 1 );
|
||||
add_action( 'save_post', array(&$this, 'save_metabox_directory'), 10, 2 );
|
||||
add_action( 'add_meta_boxes', array( &$this, 'add_metabox_directory' ), 1 );
|
||||
add_action( 'save_post', array( &$this, 'save_metabox_directory' ), 10, 2 );
|
||||
}
|
||||
|
||||
//restrict content metabox
|
||||
@@ -825,14 +856,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
/**
|
||||
* Add directory metabox
|
||||
*/
|
||||
function add_metabox_directory() {
|
||||
public function add_metabox_directory() {
|
||||
add_meta_box('submitdiv', __( 'Publish', 'ultimate-member' ), array( &$this, 'custom_submitdiv' ), 'um_directory', 'side', 'high' );
|
||||
add_meta_box( 'um-admin-form-general', __( 'General Options', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-sorting', __( 'Sorting', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-profile', __( 'Profile Card', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-search', __( 'Search Options', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-pagination', __( 'Results & Pagination', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-shortcode', __( 'Shortcode', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'side', 'default' );
|
||||
add_meta_box( 'um-admin-form-appearance', __( 'Styling: General', 'ultimate-member' ), array( &$this, 'load_metabox_directory'), 'um_directory', 'side', 'default' );
|
||||
add_meta_box( 'um-admin-form-appearance', __( 'Styling: General', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'side', 'default' );
|
||||
}
|
||||
|
||||
|
||||
@@ -989,7 +1021,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
/**
|
||||
* Add form metabox
|
||||
*/
|
||||
function add_metabox_form() {
|
||||
public function add_metabox_form() {
|
||||
|
||||
add_meta_box( 'submitdiv', __( 'Publish', 'ultimate-member' ), array( $this, 'custom_submitdiv' ), 'um_form', 'side', 'high' );
|
||||
|
||||
add_meta_box( 'um-admin-form-mode', __( 'Select Form Type', 'ultimate-member' ), array( &$this, 'load_metabox_form' ), 'um_form', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-builder', __( 'Form Builder', 'ultimate-member' ), array( &$this, 'load_metabox_form' ), 'um_form', 'normal', 'default' );
|
||||
@@ -1061,6 +1095,57 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
do_action( 'um_admin_custom_login_metaboxes' );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function custom_submitdiv() {
|
||||
global $post, $current_screen;
|
||||
?>
|
||||
|
||||
<div class="submitbox" id="submitpost">
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action( 'post_submitbox_start' ); ?>
|
||||
<div id="delete-action">
|
||||
<?php if ( current_user_can( 'delete_post', $post->ID ) ) {
|
||||
if ( ! EMPTY_TRASH_DAYS ) {
|
||||
$delete_text = __( 'Delete Permanently', 'ultimate-member' );
|
||||
} else {
|
||||
$delete_text = __( 'Move to Trash', 'ultimate-member' );
|
||||
} ?>
|
||||
<a class="submitdelete deletion" href="<?php echo esc_url( get_delete_post_link( $post->ID ) ); ?>"> <?php echo esc_html( $delete_text ); ?> </a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<span class="spinner"></span>
|
||||
<?php if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {
|
||||
|
||||
$post_type = $post->post_type; // get current post_type
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
$can_publish = current_user_can( $post_type_object->cap->publish_posts );
|
||||
|
||||
if ( $can_publish ) { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Create', 'ultimate-member' ) ?>" />
|
||||
<?php submit_button( __( 'Create', 'ultimate-member' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
|
||||
<?php }
|
||||
} else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update', 'ultimate-member' ); ?>" />
|
||||
<?php submit_button( __( 'Update', 'ultimate-member' ), 'primary button-large', 'save', false, array( 'accesskey' => 'p' ) ); ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
if ( isset( $current_screen->base ) && 'post' === $current_screen->base && isset( $current_screen->action ) && 'add' === $current_screen->action ) {
|
||||
if ( isset( $_GET['um_mode'] ) ) {
|
||||
$mode = sanitize_key( $_GET['um_mode'] ); ?>
|
||||
<input type="hidden" name="form[_um_mode]" id="form__um_mode" value="<?php echo esc_attr( $mode ); ?>" />
|
||||
<?php }
|
||||
}?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Save directory metabox
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user