Version Description
Download this release
Release Info
Developer | nsinelnikov |
Plugin | Ultimate Member – User Profile & Membership Plugin |
Version | 2.0.35 |
Comparing to | |
See all releases |
Code changes from version 2.0.34 to 2.0.35
- includes/admin/assets/js/um-admin-ajax.js +28 -35
- includes/admin/assets/js/um-admin-builder.js +17 -19
- includes/admin/assets/js/um-admin-dashboard.js +0 -3
- includes/admin/assets/js/um-admin-dragdrop.js +10 -12
- includes/admin/assets/js/um-admin-field.js +2 -2
- includes/admin/assets/js/um-admin-form.js +24 -30
- includes/admin/assets/js/um-admin-forms.js +242 -242
- includes/admin/assets/js/um-admin-global.js +8 -8
- includes/admin/assets/js/um-admin-modal.js +19 -26
- includes/admin/assets/js/um-admin-nav-menu.js +28 -28
- includes/admin/assets/js/um-admin-role-wrapper.js +16 -16
- includes/admin/assets/js/um-admin-scripts.js +54 -99
- includes/admin/assets/js/um-admin-settings.js +28 -28
- includes/admin/core/class-admin-enqueue.php +34 -41
- includes/class-extensions.php +229 -229
- languages/ultimate-member-en_US.mo +0 -0
- languages/ultimate-member-en_US.po +15 -7
- readme.txt +6 -1
- ultimate-member.php +1 -1
includes/admin/assets/js/um-admin-ajax.js
CHANGED
@@ -1,32 +1,33 @@
|
|
1 |
jQuery(document).ready(function() {
|
2 |
|
3 |
-
jQuery(document).ajaxStart(function(){
|
4 |
jQuery('.tipsy').hide();
|
5 |
});
|
6 |
-
|
7 |
-
jQuery(document).on('click', 'a[data-silent_action^="um_"]',function(){
|
8 |
-
|
9 |
-
if ( typeof jQuery(this).attr('disabled') !== 'undefined' )
|
10 |
return false;
|
11 |
-
|
12 |
-
in_row = '';
|
13 |
-
in_sub_row = '';
|
14 |
-
in_column = '';
|
15 |
-
in_group = '';
|
16 |
-
|
17 |
-
if ( jQuery('.um-col-demon-settings').data('in_column') ) {
|
18 |
-
in_row = jQuery('.um-col-demon-settings').data('in_row');
|
19 |
-
in_sub_row = jQuery('.um-col-demon-settings').data('in_sub_row');
|
20 |
-
in_column = jQuery('.um-col-demon-settings').data('in_column');
|
21 |
-
in_group = jQuery('.um-col-demon-settings').data('in_group');
|
22 |
}
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
jQuery('.tipsy').hide();
|
29 |
-
|
30 |
um_admin_remove_modal();
|
31 |
jQuery.ajax({
|
32 |
url: wp.ajax.settings.url,
|
@@ -42,24 +43,16 @@ jQuery(document).ready(function() {
|
|
42 |
in_group: in_group,
|
43 |
nonce: um_admin_scripts.nonce
|
44 |
},
|
45 |
-
success: function(data){
|
46 |
-
|
47 |
-
jQuery('.um-col-demon-settings').data('in_row', '');
|
48 |
-
jQuery('.um-col-demon-settings').data('in_sub_row', '');
|
49 |
-
jQuery('.um-col-demon-settings').data('in_column', '');
|
50 |
-
jQuery('.um-col-demon-settings').data('in_group', '');
|
51 |
-
|
52 |
um_admin_modal_responsive();
|
53 |
um_admin_update_builder();
|
54 |
-
|
55 |
},
|
56 |
-
error: function(data){
|
57 |
|
58 |
}
|
59 |
});
|
60 |
-
|
61 |
return false;
|
62 |
-
|
63 |
});
|
64 |
-
|
65 |
-
});
|
1 |
jQuery(document).ready(function() {
|
2 |
|
3 |
+
jQuery(document).ajaxStart( function() {
|
4 |
jQuery('.tipsy').hide();
|
5 |
});
|
6 |
+
|
7 |
+
jQuery( document.body ).on('click', 'a[data-silent_action^="um_"]', function() {
|
8 |
+
if ( typeof jQuery(this).attr('disabled') !== 'undefined' ) {
|
|
|
9 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
11 |
+
|
12 |
+
var in_row = '';
|
13 |
+
var in_sub_row = '';
|
14 |
+
var in_column = '';
|
15 |
+
var in_group = '';
|
16 |
+
|
17 |
+
var demon_settings = jQuery('.um-col-demon-settings');
|
18 |
+
if ( demon_settings.data('in_column') ) {
|
19 |
+
in_row = demon_settings.data('in_row');
|
20 |
+
in_sub_row = demon_settings.data('in_sub_row');
|
21 |
+
in_column = demon_settings.data('in_column');
|
22 |
+
in_group = demon_settings.data('in_group');
|
23 |
+
}
|
24 |
+
|
25 |
+
var act_id = jQuery(this).data('silent_action');
|
26 |
+
var arg1 = jQuery(this).data('arg1');
|
27 |
+
var arg2 = jQuery(this).data('arg2');
|
28 |
+
|
29 |
jQuery('.tipsy').hide();
|
30 |
+
|
31 |
um_admin_remove_modal();
|
32 |
jQuery.ajax({
|
33 |
url: wp.ajax.settings.url,
|
43 |
in_group: in_group,
|
44 |
nonce: um_admin_scripts.nonce
|
45 |
},
|
46 |
+
success: function( data ) {
|
47 |
+
demon_settings.data('in_row', '').data('in_sub_row', '').data('in_column', '').data('in_group', '');
|
|
|
|
|
|
|
|
|
|
|
48 |
um_admin_modal_responsive();
|
49 |
um_admin_update_builder();
|
|
|
50 |
},
|
51 |
+
error: function( data ) {
|
52 |
|
53 |
}
|
54 |
});
|
55 |
+
|
56 |
return false;
|
|
|
57 |
});
|
58 |
+
});
|
|
includes/admin/assets/js/um-admin-builder.js
CHANGED
@@ -1,12 +1,11 @@
|
|
1 |
/**
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
function um_admin_update_builder() {
|
|
|
7 |
|
8 |
-
form_id = jQuery('.um-admin-builder').data('form_id');
|
9 |
-
|
10 |
jQuery('.tipsy').hide();
|
11 |
|
12 |
jQuery.ajax({
|
@@ -17,31 +16,30 @@ function um_admin_update_builder() {
|
|
17 |
form_id: form_id,
|
18 |
nonce: um_admin_scripts.nonce
|
19 |
},
|
20 |
-
success: function(data){
|
21 |
-
|
22 |
-
jQuery('.um-admin-drag-ajax').html(data);
|
23 |
-
|
24 |
jQuery('.tipsy').hide();
|
25 |
|
26 |
/* trigger columns at start */
|
27 |
allow_update_via_col_click = false;
|
28 |
-
jQuery('.um-admin-drag-ctrls.columns a.active').each(function(){
|
29 |
jQuery(this).trigger('click');
|
30 |
-
}).promise().done( function(){
|
31 |
-
|
32 |
-
|
33 |
|
|
|
34 |
},
|
35 |
-
error: function(data){
|
36 |
|
37 |
}
|
38 |
});
|
39 |
-
|
40 |
-
return false;
|
41 |
|
|
|
42 |
}
|
43 |
|
44 |
-
jQuery(document).ready(function() {
|
45 |
-
if ( um_admin_builder_data.hide_footer )
|
46 |
jQuery('#wpfooter').hide();
|
|
|
47 |
});
|
1 |
/**
|
2 |
+
* This function updates the builder area with fields
|
3 |
+
*
|
4 |
+
* @returns {boolean}
|
5 |
+
*/
|
6 |
function um_admin_update_builder() {
|
7 |
+
var form_id = jQuery('.um-admin-builder').data('form_id');
|
8 |
|
|
|
|
|
9 |
jQuery('.tipsy').hide();
|
10 |
|
11 |
jQuery.ajax({
|
16 |
form_id: form_id,
|
17 |
nonce: um_admin_scripts.nonce
|
18 |
},
|
19 |
+
success: function( data ) {
|
20 |
+
jQuery('.um-admin-drag-ajax').html( data );
|
|
|
|
|
21 |
jQuery('.tipsy').hide();
|
22 |
|
23 |
/* trigger columns at start */
|
24 |
allow_update_via_col_click = false;
|
25 |
+
jQuery('.um-admin-drag-ctrls.columns a.active').each( function() {
|
26 |
jQuery(this).trigger('click');
|
27 |
+
}).promise().done( function(){
|
28 |
+
allow_update_via_col_click = true;
|
29 |
+
});
|
30 |
|
31 |
+
UM_Rows_Refresh();
|
32 |
},
|
33 |
+
error: function( data ) {
|
34 |
|
35 |
}
|
36 |
});
|
|
|
|
|
37 |
|
38 |
+
return false;
|
39 |
}
|
40 |
|
41 |
+
jQuery( document ).ready( function() {
|
42 |
+
if ( um_admin_builder_data.hide_footer ) {
|
43 |
jQuery('#wpfooter').hide();
|
44 |
+
}
|
45 |
});
|
includes/admin/assets/js/um-admin-dashboard.js
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function() {
|
2 |
-
|
3 |
-
});
|
|
|
|
|
|
includes/admin/assets/js/um-admin-dragdrop.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
-
function UM_Drag_and_Drop(){
|
2 |
-
|
3 |
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable({
|
4 |
items: '.um-admin-drag-fld',
|
5 |
connectWith: '.um-admin-drag-col,.um-admin-drag-group',
|
@@ -89,10 +88,9 @@ function UM_Drag_and_Drop(){
|
|
89 |
|
90 |
}
|
91 |
}).disableSelection();
|
92 |
-
|
93 |
}
|
94 |
|
95 |
-
function UM_update_rows(){
|
96 |
var c = 0;
|
97 |
jQuery('a[data-remove_element="um-admin-drag-row"]').remove();
|
98 |
jQuery('.um-admin-drag-row').each(function(){
|
@@ -279,13 +277,14 @@ function UM_Add_Icon(){
|
|
279 |
}
|
280 |
|
281 |
jQuery(document).ready(function() {
|
282 |
-
|
283 |
-
|
|
|
284 |
|
285 |
UM_Drag_and_Drop();
|
286 |
|
287 |
/* add field to respected area */
|
288 |
-
jQuery(document).on('click', 'a.um-admin-drag-add-field', function(){
|
289 |
in_row = jQuery(this).parents('.um-admin-drag-row').index();
|
290 |
in_sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
291 |
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 1 ) {
|
@@ -317,7 +316,7 @@ jQuery(document).ready(function() {
|
|
317 |
});
|
318 |
|
319 |
/* add row */
|
320 |
-
jQuery(document).on('click', '*[data-row_action="add_row"]', function(){
|
321 |
var dragg = jQuery('.um-admin-drag-ajax');
|
322 |
dragg.append( '<div class="um-admin-drag-row">' + jQuery('.um-col-demon-row').html() + '</div>' );
|
323 |
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 ) );
|
@@ -328,7 +327,7 @@ jQuery(document).ready(function() {
|
|
328 |
});
|
329 |
|
330 |
/* add sub row */
|
331 |
-
jQuery(document).on('click', '*[data-row_action="add_subrow"]', function(){
|
332 |
var dragg = jQuery(this).parents('.um-admin-drag-row').find('.um-admin-drag-rowsubs');
|
333 |
dragg.append( '<div class="um-admin-drag-rowsub">' + jQuery('.um-col-demon-subrow').html() + '</div>' );
|
334 |
UM_update_subrows();
|
@@ -336,7 +335,7 @@ jQuery(document).ready(function() {
|
|
336 |
});
|
337 |
|
338 |
/* remove element */
|
339 |
-
jQuery(document).on('click', 'a[data-remove_element^="um-"]',function(){
|
340 |
element = jQuery(this).data('remove_element');
|
341 |
|
342 |
jQuery(this).parents('.' +element).find('.um-admin-drag-fld').each(function(){
|
@@ -349,7 +348,7 @@ jQuery(document).ready(function() {
|
|
349 |
});
|
350 |
|
351 |
/* dynamically change columns */
|
352 |
-
jQuery(document).on('click', '.um-admin-drag-ctrls.columns a', function(){
|
353 |
|
354 |
var row = jQuery(this).parents('.um-admin-drag-rowsub');
|
355 |
var tab = jQuery(this);
|
@@ -406,5 +405,4 @@ jQuery(document).ready(function() {
|
|
406 |
}).promise().done( function(){ allow_update_via_col_click = true; } );
|
407 |
|
408 |
UM_Rows_Refresh();
|
409 |
-
|
410 |
});
|
1 |
+
function UM_Drag_and_Drop() {
|
|
|
2 |
jQuery('.um-admin-drag-col,.um-admin-drag-group').sortable({
|
3 |
items: '.um-admin-drag-fld',
|
4 |
connectWith: '.um-admin-drag-col,.um-admin-drag-group',
|
88 |
|
89 |
}
|
90 |
}).disableSelection();
|
|
|
91 |
}
|
92 |
|
93 |
+
function UM_update_rows() {
|
94 |
var c = 0;
|
95 |
jQuery('a[data-remove_element="um-admin-drag-row"]').remove();
|
96 |
jQuery('.um-admin-drag-row').each(function(){
|
277 |
}
|
278 |
|
279 |
jQuery(document).ready(function() {
|
280 |
+
if ( !jQuery('.um-admin-drag').length ) {
|
281 |
+
return false;
|
282 |
+
}
|
283 |
|
284 |
UM_Drag_and_Drop();
|
285 |
|
286 |
/* add field to respected area */
|
287 |
+
jQuery( document.body ).on('click', 'a.um-admin-drag-add-field', function() {
|
288 |
in_row = jQuery(this).parents('.um-admin-drag-row').index();
|
289 |
in_sub_row = jQuery(this).parents('.um-admin-drag-rowsub').index();
|
290 |
if ( jQuery(this).parents('.um-admin-drag-rowsub').find('.um-admin-drag-col').length == 1 ) {
|
316 |
});
|
317 |
|
318 |
/* add row */
|
319 |
+
jQuery(document.body).on('click', '*[data-row_action="add_row"]', function(){
|
320 |
var dragg = jQuery('.um-admin-drag-ajax');
|
321 |
dragg.append( '<div class="um-admin-drag-row">' + jQuery('.um-col-demon-row').html() + '</div>' );
|
322 |
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 ) );
|
327 |
});
|
328 |
|
329 |
/* add sub row */
|
330 |
+
jQuery(document.body).on('click', '*[data-row_action="add_subrow"]', function(){
|
331 |
var dragg = jQuery(this).parents('.um-admin-drag-row').find('.um-admin-drag-rowsubs');
|
332 |
dragg.append( '<div class="um-admin-drag-rowsub">' + jQuery('.um-col-demon-subrow').html() + '</div>' );
|
333 |
UM_update_subrows();
|
335 |
});
|
336 |
|
337 |
/* remove element */
|
338 |
+
jQuery(document.body).on('click', 'a[data-remove_element^="um-"]',function(){
|
339 |
element = jQuery(this).data('remove_element');
|
340 |
|
341 |
jQuery(this).parents('.' +element).find('.um-admin-drag-fld').each(function(){
|
348 |
});
|
349 |
|
350 |
/* dynamically change columns */
|
351 |
+
jQuery(document.body).on('click', '.um-admin-drag-ctrls.columns a', function(){
|
352 |
|
353 |
var row = jQuery(this).parents('.um-admin-drag-rowsub');
|
354 |
var tab = jQuery(this);
|
405 |
}).promise().done( function(){ allow_update_via_col_click = true; } );
|
406 |
|
407 |
UM_Rows_Refresh();
|
|
|
408 |
});
|
includes/admin/assets/js/um-admin-field.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
jQuery(document).ready(function() {
|
2 |
|
3 |
/* Remove field permanently */
|
4 |
-
jQuery(document).on('click', '.um-admin-btns a span.remove', function(e){
|
5 |
e.preventDefault();
|
6 |
|
7 |
if ( confirm( 'This will permanently delete this custom field from database' ) ) {
|
@@ -34,7 +34,7 @@ jQuery(document).ready(function() {
|
|
34 |
|
35 |
|
36 |
/* Add a Field */
|
37 |
-
jQuery(document).on('submit', 'form.um_add_field', function(e){
|
38 |
|
39 |
e.preventDefault();
|
40 |
var conditions = jQuery('.um-admin-cur-condition');
|
1 |
jQuery(document).ready(function() {
|
2 |
|
3 |
/* Remove field permanently */
|
4 |
+
jQuery(document.body).on('click', '.um-admin-btns a span.remove', function(e){
|
5 |
e.preventDefault();
|
6 |
|
7 |
if ( confirm( 'This will permanently delete this custom field from database' ) ) {
|
34 |
|
35 |
|
36 |
/* Add a Field */
|
37 |
+
jQuery(document.body).on('submit', 'form.um_add_field', function(e){
|
38 |
|
39 |
e.preventDefault();
|
40 |
var conditions = jQuery('.um-admin-cur-condition');
|
includes/admin/assets/js/um-admin-form.js
CHANGED
@@ -1,38 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery(document).ready(function() {
|
2 |
-
|
3 |
/* Default form tab */
|
4 |
if ( jQuery('.um-admin-boxed-links').length > 0 ) {
|
5 |
-
|
6 |
var tab = jQuery('.um-admin-boxed-links a[data-role="'+jQuery('input#form__um_mode').val()+'"]');
|
7 |
-
|
8 |
-
tab.parents('.um-admin-boxed-links').find('a').removeClass('um-admin-activebg');
|
9 |
-
tab.addClass('um-admin-activebg');
|
10 |
-
jQuery('.um-admin div#side-sortables').show();
|
11 |
-
jQuery('div[id^="um-admin-form"]').hide();
|
12 |
-
jQuery('#submitdiv').show();
|
13 |
-
jQuery('div#um-admin-form-mode,div#um-admin-form-title,div#um-admin-form-builder,div#um-admin-form-shortcode').show();
|
14 |
-
jQuery('div[id^="um-admin-form-'+tab.data('role')+'"]').show();
|
15 |
-
jQuery('.empty-container').css({'border' : 'none'});
|
16 |
-
jQuery('.um-admin-builder').removeClass().addClass( 'um-admin-builder ' + jQuery('input#form__um_mode').val() );
|
17 |
-
|
18 |
}
|
19 |
-
|
20 |
-
/* Creating new form button */
|
21 |
-
jQuery('.um-admin-boxed-links:not(.is-core-form) a').click(function(){
|
22 |
-
|
23 |
-
var tab = jQuery(this);
|
24 |
-
|
25 |
-
tab.parents('.um-admin-boxed-links').find('a').removeClass('um-admin-activebg');
|
26 |
-
tab.addClass('um-admin-activebg');
|
27 |
-
jQuery('.um-admin div#side-sortables').show();
|
28 |
-
jQuery('div[id^="um-admin-form"]').hide();
|
29 |
-
jQuery('#submitdiv').show();
|
30 |
-
jQuery('div#um-admin-form-mode,div#um-admin-form-title,div#um-admin-form-builder,div#um-admin-form-shortcode').show();
|
31 |
-
jQuery('div[id^="um-admin-form-'+tab.data('role')+'"]').show();
|
32 |
-
jQuery('input#form__um_mode').val( tab.data('role') );
|
33 |
-
jQuery('.empty-container').css({'border' : 'none'});
|
34 |
-
jQuery('.um-admin-builder').removeClass().addClass( 'um-admin-builder ' + jQuery('input#form__um_mode').val() );
|
35 |
|
36 |
-
});
|
37 |
|
|
|
|
|
|
|
|
|
38 |
});
|
1 |
+
function um_form_select_tab( tab, set_val ) {
|
2 |
+
var mode_block = jQuery('input#form__um_mode');
|
3 |
+
tab.parents('.um-admin-boxed-links').find('a').removeClass('um-admin-activebg');
|
4 |
+
tab.addClass('um-admin-activebg');
|
5 |
+
|
6 |
+
jQuery('.um-admin div#side-sortables').show();
|
7 |
+
jQuery('div[id^="um-admin-form"]').hide();
|
8 |
+
jQuery('#submitdiv').show();
|
9 |
+
jQuery('div#um-admin-form-mode,div#um-admin-form-title,div#um-admin-form-builder,div#um-admin-form-shortcode').show();
|
10 |
+
jQuery('div[id^="um-admin-form-' + tab.data('role') + '"]').show();
|
11 |
+
|
12 |
+
if ( set_val ) {
|
13 |
+
mode_block.val( tab.data('role') );
|
14 |
+
}
|
15 |
+
|
16 |
+
jQuery('.empty-container').css({'border' : 'none'});
|
17 |
+
jQuery('.um-admin-builder').removeClass().addClass( 'um-admin-builder ' + mode_block.val() );
|
18 |
+
}
|
19 |
+
|
20 |
jQuery(document).ready(function() {
|
|
|
21 |
/* Default form tab */
|
22 |
if ( jQuery('.um-admin-boxed-links').length > 0 ) {
|
|
|
23 |
var tab = jQuery('.um-admin-boxed-links a[data-role="'+jQuery('input#form__um_mode').val()+'"]');
|
24 |
+
um_form_select_tab( tab, false );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
|
|
27 |
|
28 |
+
/* Creating new form button */
|
29 |
+
jQuery('.um-admin-boxed-links:not(.is-core-form) a').click( function() {
|
30 |
+
um_form_select_tab( jQuery(this), true );
|
31 |
+
});
|
32 |
});
|
includes/admin/assets/js/um-admin-forms.js
CHANGED
@@ -1,248 +1,248 @@
|
|
1 |
jQuery(document).ready( function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
/**
|
4 |
-
* Multi-selects field
|
5 |
-
*/
|
6 |
-
jQuery( 'body' ).on( 'click', '.um-select-delete', function() {
|
7 |
-
jQuery( this ).parents( 'li.um-multi-selects-option-line' ).remove();
|
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 |
-
own_condition = ( condition_field.val() != value );
|
239 |
-
}
|
240 |
-
} else if ( tagName == 'select' ) {
|
241 |
-
own_condition = ( condition_field.val() != value );
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
return ( own_condition && parent_condition );
|
246 |
-
}
|
247 |
|
248 |
});
|
1 |
jQuery(document).ready( function() {
|
2 |
+
/**
|
3 |
+
* Multi-selects field
|
4 |
+
*/
|
5 |
+
jQuery( document.body ).on( 'click', '.um-select-delete', function() {
|
6 |
+
jQuery( this ).parents( 'li.um-multi-selects-option-line' ).remove();
|
7 |
+
});
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
jQuery( '.um-multi-selects-add-option' ).click( function() {
|
11 |
+
var list = jQuery(this).siblings('ul.um-multi-selects-list');
|
12 |
+
|
13 |
+
var field_id = list.data('field_id');
|
14 |
+
var k = 0;
|
15 |
+
if ( list.find( 'li:last select.um-forms-field' ).length > 0 ) {
|
16 |
+
k = list.find( 'li:last select.um-forms-field' ).attr('id').split("-");
|
17 |
+
k = k[1]*1 + 1;
|
18 |
+
}
|
19 |
|
20 |
+
var selector_html = jQuery( '<div>' ).append( list.siblings('.um-hidden-multi-selects').clone() ).html();
|
21 |
+
|
22 |
+
var classes = list.find('li:last').attr('class');
|
23 |
+
|
24 |
+
list.append(
|
25 |
+
'<li class="' + classes + '"><span class="um-field-wrapper">' + selector_html +
|
26 |
+
'</span><span class="um-field-control"><a href="javascript:void(0);" class="um-select-delete">' + php_data.texts.remove + '</a></span></li>'
|
27 |
+
);
|
28 |
+
|
29 |
+
list.find('li:last .um-hidden-multi-selects').attr('name', jQuery(this).data('name') ).
|
30 |
+
addClass('um-forms-field um-long-field').removeClass('um-hidden-multi-selects').attr('id', list.data('id_attr') + '-' + k);
|
31 |
+
|
32 |
+
});
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Multi-text field
|
37 |
+
*/
|
38 |
+
jQuery( document.body ).on( 'click', '.um-text-delete', function() {
|
39 |
+
jQuery(this).parents('li.um-multi-text-option-line').remove();
|
40 |
+
});
|
41 |
+
|
42 |
+
|
43 |
+
jQuery( '.um-multi-text-add-option' ).click( function() {
|
44 |
+
var list = jQuery(this).siblings( 'ul.um-multi-text-list' );
|
45 |
+
|
46 |
+
var field_id = list.data( 'field_id' );
|
47 |
+
var k = 0;
|
48 |
+
if ( list.find( 'li:last input.um-forms-field' ).length > 0 ) {
|
49 |
+
k = list.find( 'li:last input.um-forms-field' ).attr('id').split("-");
|
50 |
+
k = k[1]*1 + 1;
|
51 |
+
}
|
52 |
+
|
53 |
+
var text_html = jQuery( '<div>' ).append( list.siblings('.um-hidden-multi-text').clone() ).html();
|
54 |
+
|
55 |
+
var classes = list.find('li:last').attr('class');
|
56 |
+
|
57 |
+
list.append(
|
58 |
+
'<li class="' + classes + '"><span class="um-field-wrapper">' + text_html +
|
59 |
+
'</span><span class="um-field-control"><a href="javascript:void(0);" class="um-text-delete">' + php_data.texts.remove + '</a></span></li>'
|
60 |
+
);
|
61 |
+
|
62 |
+
list.find('li:last .um-hidden-multi-text').attr('name', jQuery(this).data('name') ).
|
63 |
+
addClass('um-forms-field um-long-field').removeClass('um-hidden-multi-text').attr('id', list.data('id_attr') + '-' + k);
|
64 |
+
});
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Media uploader
|
69 |
+
*/
|
70 |
+
jQuery( '.um-media-upload' ).each( function() {
|
71 |
+
var field = jQuery(this).find( '.um-forms-field' );
|
72 |
+
var default_value = field.data('default');
|
73 |
+
|
74 |
+
if ( field.val() != '' && field.val() != default_value ) {
|
75 |
+
field.siblings('.um-set-image').hide();
|
76 |
+
field.siblings('.um-clear-image').show();
|
77 |
+
field.siblings('.icon_preview').show();
|
78 |
+
} else {
|
79 |
+
if ( field.val() == default_value ) {
|
80 |
+
field.siblings('.icon_preview').show();
|
81 |
+
}
|
82 |
+
field.siblings('.um-set-image').show();
|
83 |
+
field.siblings('.um-clear-image').hide();
|
84 |
+
}
|
85 |
+
});
|
86 |
+
|
87 |
+
|
88 |
+
if ( typeof wp !== 'undefined' && wp.media && wp.media.editor ) {
|
89 |
+
var frame;
|
90 |
+
|
91 |
+
jQuery( '.um-set-image' ).click( function(e) {
|
92 |
+
var button = jQuery(this);
|
93 |
+
|
94 |
+
e.preventDefault();
|
95 |
+
|
96 |
+
// If the media frame already exists, reopen it.
|
97 |
+
if ( frame ) {
|
98 |
+
frame.remove();
|
99 |
+
/*frame.open();
|
100 |
+
return;*/
|
101 |
+
}
|
102 |
+
|
103 |
+
// Create a new media frame
|
104 |
+
frame = wp.media({
|
105 |
+
title: button.data('upload_frame'),
|
106 |
+
button: {
|
107 |
+
text: php_data.texts.select
|
108 |
+
},
|
109 |
+
multiple: false // Set to true to allow multiple files to be selected
|
110 |
+
});
|
111 |
+
|
112 |
+
// When an image is selected in the media frame...
|
113 |
+
frame.on( 'select', function() {
|
114 |
+
// Get media attachment details from the frame state
|
115 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
116 |
+
|
117 |
+
// Send the attachment URL to our custom image input field.
|
118 |
+
button.siblings('.icon_preview').attr( 'src', attachment.url ).show();
|
119 |
+
|
120 |
+
button.siblings('.um-forms-field').val( attachment.url );
|
121 |
+
button.siblings('.um-media-upload-data-id').val(attachment.id);
|
122 |
+
button.siblings('.um-media-upload-data-width').val(attachment.width);
|
123 |
+
button.siblings('.um-media-upload-data-height').val(attachment.height);
|
124 |
+
button.siblings('.um-media-upload-data-thumbnail').val(attachment.thumbnail);
|
125 |
+
button.siblings('.um-media-upload-data-url').trigger('change');
|
126 |
+
button.siblings('.um-media-upload-url').val(attachment.url);
|
127 |
+
|
128 |
+
button.siblings('.um-clear-image').show();
|
129 |
+
button.hide();
|
130 |
+
|
131 |
+
jQuery( document ).trigger( 'um_media_upload_select', [button, attachment] );
|
132 |
+
});
|
133 |
+
|
134 |
+
frame.open();
|
135 |
+
});
|
136 |
+
|
137 |
+
jQuery('.icon_preview').click( function(e) {
|
138 |
+
jQuery(this).siblings('.um-set-image').trigger('click');
|
139 |
+
});
|
140 |
+
|
141 |
+
jQuery('.um-clear-image').click( function(e) {
|
142 |
+
var clear_button = jQuery(this);
|
143 |
+
var default_image_url = clear_button.siblings('.um-forms-field').data('default');
|
144 |
+
clear_button.siblings('.um-set-image').show();
|
145 |
+
clear_button.hide();
|
146 |
+
clear_button.siblings('.icon_preview').attr( 'src', default_image_url );
|
147 |
+
clear_button.siblings('.um-media-upload-data-id').val('');
|
148 |
+
clear_button.siblings('.um-media-upload-data-width').val('');
|
149 |
+
clear_button.siblings('.um-media-upload-data-height').val('');
|
150 |
+
clear_button.siblings('.um-media-upload-data-thumbnail').val('');
|
151 |
+
clear_button.siblings('.um-forms-field').val( default_image_url );
|
152 |
+
clear_button.siblings('.um-media-upload-data-url').trigger('change');
|
153 |
+
clear_button.siblings('.um-media-upload-url').val( default_image_url );
|
154 |
+
|
155 |
+
jQuery( document ).trigger( 'um_media_upload_clear', clear_button );
|
156 |
+
});
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* On option fields change
|
162 |
+
*/
|
163 |
+
jQuery( document.body ).on('change', '.um-forms-field', function() {
|
164 |
+
if ( jQuery('.um-forms-line[data-conditional*=\'"' + jQuery(this).data('field_id') + '",\']').length > 0 ) {
|
165 |
+
run_check_conditions();
|
166 |
+
}
|
167 |
+
});
|
168 |
+
|
169 |
+
|
170 |
+
//first load hide unconditional fields
|
171 |
+
run_check_conditions();
|
172 |
+
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Run conditional logic
|
176 |
+
*/
|
177 |
+
function run_check_conditions() {
|
178 |
+
jQuery( '.um-forms-line' ).removeClass('um-forms-line-conditioned').each( function() {
|
179 |
+
if ( typeof jQuery(this).data('conditional') === 'undefined' || jQuery(this).hasClass('um-forms-line-conditioned') )
|
180 |
+
return;
|
181 |
+
|
182 |
+
if ( check_condition( jQuery(this) ) ) {
|
183 |
+
jQuery(this).show();
|
184 |
+
} else {
|
185 |
+
jQuery(this).hide();
|
186 |
+
}
|
187 |
+
});
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Conditional logic
|
193 |
+
*
|
194 |
+
* true - show field
|
195 |
+
* false - hide field
|
196 |
+
*
|
197 |
+
* @returns {boolean}
|
198 |
+
*/
|
199 |
+
function check_condition( form_line ) {
|
200 |
+
|
201 |
+
form_line.addClass( 'um-forms-line-conditioned' );
|
202 |
+
|
203 |
+
var conditional = form_line.data('conditional');
|
204 |
+
var condition = conditional[1];
|
205 |
+
var value = conditional[2];
|
206 |
+
|
207 |
+
var prefix = form_line.data( 'prefix' );
|
208 |
+
//var prefix = form_line.parents( '.um-form-table' ).data( 'prefix' );
|
209 |
+
|
210 |
+
var condition_field = jQuery( '#' + prefix + '_' + conditional[0] );
|
211 |
+
var parent_condition = true;
|
212 |
+
if ( typeof condition_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
|
213 |
+
parent_condition = check_condition( condition_field.parents('.um-forms-line') );
|
214 |
+
}
|
215 |
+
|
216 |
+
var own_condition = false;
|
217 |
+
if ( condition == '=' ) {
|
218 |
+
var tagName = condition_field.prop("tagName").toLowerCase();
|
219 |
+
|
220 |
+
if ( tagName == 'input' ) {
|
221 |
+
var input_type = condition_field.attr('type');
|
222 |
+
if ( input_type == 'checkbox' ) {
|
223 |
+
own_condition = ( value == '1' ) ? condition_field.is(':checked') : ! condition_field.is(':checked');
|
224 |
+
} else {
|
225 |
+
own_condition = ( condition_field.val() == value );
|
226 |
+
}
|
227 |
+
} else if ( tagName == 'select' ) {
|
228 |
+
own_condition = ( condition_field.val() == value );
|
229 |
+
}
|
230 |
+
} else if ( condition == '!=' ) {
|
231 |
+
var tagName = condition_field.prop("tagName").toLowerCase();
|
232 |
+
|
233 |
+
if ( tagName == 'input' ) {
|
234 |
+
var input_type = condition_field.attr('type');
|
235 |
+
if ( input_type == 'checkbox' ) {
|
236 |
+
own_condition = ( value == '1' ) ? ! condition_field.is(':checked') : condition_field.is(':checked');
|
237 |
+
} else {
|
238 |
+
own_condition = ( condition_field.val() != value );
|
239 |
+
}
|
240 |
+
} else if ( tagName == 'select' ) {
|
241 |
+
own_condition = ( condition_field.val() != value );
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
return ( own_condition && parent_condition );
|
246 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
});
|
includes/admin/assets/js/um-admin-global.js
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
jQuery(document).ready(function() {
|
2 |
|
3 |
|
4 |
-
jQuery(document).on('click', '#um_add_review_love', function (e) {
|
5 |
jQuery(this).parents('#um_start_review_notice').hide();
|
6 |
jQuery('.um_hidden_notice[data-key="love"]').show();
|
7 |
});
|
8 |
|
9 |
|
10 |
-
jQuery(document).on('click', '#um_add_review_good', function (e) {
|
11 |
jQuery(this).parents('#um_start_review_notice').hide();
|
12 |
jQuery('.um_hidden_notice[data-key="good"]').show();
|
13 |
});
|
14 |
|
15 |
|
16 |
-
jQuery(document).on('click', '#um_add_review_bad', function (e) {
|
17 |
jQuery(this).parents('#um_start_review_notice').hide();
|
18 |
jQuery('.um_hidden_notice[data-key="bad"]').show();
|
19 |
});
|
20 |
|
21 |
|
22 |
-
jQuery(document).on('click', '.um_review_link', function (e) {
|
23 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
24 |
});
|
25 |
|
26 |
|
27 |
-
jQuery(document).on('click', '.um_secondary_dimiss', function (e) {
|
28 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
29 |
});
|
30 |
|
31 |
-
jQuery(document).on('click', '.um_opt_in_link', function (e) {
|
32 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
33 |
});
|
34 |
|
35 |
|
36 |
-
jQuery(document).on('click', '#um_opt_in_start', function (e) {
|
37 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
38 |
});
|
39 |
|
40 |
|
41 |
-
jQuery(document).on( 'click', '.um-admin-notice.is-dismissible .notice-dismiss', function(e) {
|
42 |
var notice_key = jQuery(this).parents('.um-admin-notice').data('key');
|
43 |
|
44 |
wp.ajax.send( 'um_dismiss_notice', {
|
1 |
jQuery(document).ready(function() {
|
2 |
|
3 |
|
4 |
+
jQuery(document.body).on('click', '#um_add_review_love', function (e) {
|
5 |
jQuery(this).parents('#um_start_review_notice').hide();
|
6 |
jQuery('.um_hidden_notice[data-key="love"]').show();
|
7 |
});
|
8 |
|
9 |
|
10 |
+
jQuery(document.body).on('click', '#um_add_review_good', function (e) {
|
11 |
jQuery(this).parents('#um_start_review_notice').hide();
|
12 |
jQuery('.um_hidden_notice[data-key="good"]').show();
|
13 |
});
|
14 |
|
15 |
|
16 |
+
jQuery(document.body).on('click', '#um_add_review_bad', function (e) {
|
17 |
jQuery(this).parents('#um_start_review_notice').hide();
|
18 |
jQuery('.um_hidden_notice[data-key="bad"]').show();
|
19 |
});
|
20 |
|
21 |
|
22 |
+
jQuery(document.body).on('click', '.um_review_link', function (e) {
|
23 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
24 |
});
|
25 |
|
26 |
|
27 |
+
jQuery(document.body).on('click', '.um_secondary_dimiss', function (e) {
|
28 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
29 |
});
|
30 |
|
31 |
+
jQuery(document.body).on('click', '.um_opt_in_link', function (e) {
|
32 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
33 |
});
|
34 |
|
35 |
|
36 |
+
jQuery(document.body).on('click', '#um_opt_in_start', function (e) {
|
37 |
jQuery(this).parents('.um-admin-notice').find( '.notice-dismiss' ).trigger('click');
|
38 |
});
|
39 |
|
40 |
|
41 |
+
jQuery(document.body).on( 'click', '.um-admin-notice.is-dismissible .notice-dismiss', function(e) {
|
42 |
var notice_key = jQuery(this).parents('.um-admin-notice').data('key');
|
43 |
|
44 |
wp.ajax.send( 'um_dismiss_notice', {
|
includes/admin/assets/js/um-admin-modal.js
CHANGED
@@ -1,25 +1,20 @@
|
|
1 |
function um_admin_live_update_scripts() {
|
|
|
|
|
|
|
2 |
|
3 |
-
/*jQuery('.um-admin-modal-body:visible select').select2({
|
4 |
-
allowClear: false,
|
5 |
-
minimumResultsForSearch: 10
|
6 |
-
});*/
|
7 |
-
|
8 |
-
jQuery('.um-adm-conditional').each(function(){jQuery(this).trigger('change');});
|
9 |
if ( jQuery('.um-admin-colorpicker').length ) {
|
10 |
jQuery('.um-admin-colorpicker').wpColorPicker();
|
11 |
}
|
12 |
-
|
13 |
}
|
14 |
|
15 |
-
function um_admin_new_modal( id, ajax, size ){
|
16 |
-
|
17 |
var modal = jQuery('body').find('.um-admin-overlay');
|
18 |
-
|
19 |
jQuery('.tipsy').hide();
|
20 |
-
|
21 |
um_admin_remove_modal();
|
22 |
-
|
23 |
jQuery('body').addClass('um-admin-modal-open').append('<div class="um-admin-overlay" /><div class="um-admin-modal" />');
|
24 |
jQuery('#' + id).prependTo('.um-admin-modal');
|
25 |
jQuery('#' + id).show();
|
@@ -34,11 +29,9 @@ function um_admin_new_modal( id, ajax, size ){
|
|
34 |
} else {
|
35 |
um_admin_modal_responsive();
|
36 |
}
|
37 |
-
|
38 |
}
|
39 |
|
40 |
function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
|
41 |
-
|
42 |
in_row = '';
|
43 |
in_sub_row = '';
|
44 |
in_column = '';
|
@@ -180,7 +173,7 @@ jQuery(document).ready(function() {
|
|
180 |
/**
|
181 |
disable link
|
182 |
**/
|
183 |
-
jQuery(document).on('click', '.um-admin-builder a, .um-admin-modal a', function(e){
|
184 |
e.preventDefault();
|
185 |
return false;
|
186 |
});
|
@@ -188,7 +181,7 @@ jQuery(document).ready(function() {
|
|
188 |
/**
|
189 |
toggle area
|
190 |
**/
|
191 |
-
jQuery(document).on('click', '.um-admin-btn-toggle a', function(e){
|
192 |
var content = jQuery(this).parent().find('.um-admin-btn-content');
|
193 |
var link = jQuery(this);
|
194 |
if ( content.is(':hidden') ) {
|
@@ -208,7 +201,7 @@ jQuery(document).ready(function() {
|
|
208 |
/**
|
209 |
clone a condition
|
210 |
**/
|
211 |
-
jQuery(document).on('click', '.um-admin-new-condition', function() {
|
212 |
|
213 |
if ( jQuery(this).hasClass('disabled') )
|
214 |
return false;
|
@@ -252,7 +245,7 @@ jQuery(document).ready(function() {
|
|
252 |
/**
|
253 |
reset conditions
|
254 |
**/
|
255 |
-
jQuery(document).on('click', '.um-admin-reset-conditions a', function(){
|
256 |
var content = jQuery(this).parents('.um-admin-btn-content');
|
257 |
content.find('.um-admin-cur-condition').slice(1).remove();
|
258 |
content.find('input[type=text]').val('');
|
@@ -265,7 +258,7 @@ jQuery(document).ready(function() {
|
|
265 |
/**
|
266 |
remove a condition
|
267 |
**/
|
268 |
-
jQuery(document).on('click', '.um-admin-remove-condition', function(){
|
269 |
var condition = jQuery(this).parents('.um-admin-cur-condition');
|
270 |
jQuery('.um-admin-new-condition').removeClass('disabled');
|
271 |
jQuery('.tipsy').remove();
|
@@ -290,14 +283,14 @@ jQuery(document).ready(function() {
|
|
290 |
/**
|
291 |
remove modal via action
|
292 |
**/
|
293 |
-
jQuery(document).on('click', '.um-admin-overlay, a[data-action="UM_remove_modal"]', function(){
|
294 |
um_admin_remove_modal();
|
295 |
});
|
296 |
|
297 |
/**
|
298 |
fire new modal
|
299 |
**/
|
300 |
-
jQuery(document).on('click', 'a[data-modal^="UM_"], span[data-modal^="UM_"]', function(e){
|
301 |
|
302 |
e.preventDefault();
|
303 |
|
@@ -327,7 +320,7 @@ jQuery(document).ready(function() {
|
|
327 |
/**
|
328 |
choose font icon
|
329 |
**/
|
330 |
-
jQuery(document).on('click', '.um-admin-icons span', function(){
|
331 |
var icon = jQuery(this).attr('data-code');
|
332 |
jQuery(this).parent().find('span').removeClass('highlighted');
|
333 |
jQuery(this).addClass('highlighted');
|
@@ -337,7 +330,7 @@ jQuery(document).ready(function() {
|
|
337 |
/**
|
338 |
submit font icon
|
339 |
**/
|
340 |
-
jQuery(document).on('click', '#UM_fonticons a.um-admin-modal-back:not(.um-admin-modal-cancel)', function(){
|
341 |
var v_id = '';
|
342 |
var icon_selected = jQuery(this).attr('data-code');
|
343 |
if (icon_selected != ''){
|
@@ -359,7 +352,7 @@ jQuery(document).ready(function() {
|
|
359 |
/**
|
360 |
restore font icon
|
361 |
**/
|
362 |
-
jQuery(document).on('click', 'span.um-admin-icon-clear', function(){
|
363 |
var element = jQuery(this).parents('p');
|
364 |
jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
365 |
element.find('input[type=hidden]').val('');
|
@@ -374,7 +367,7 @@ jQuery(document).ready(function() {
|
|
374 |
/**
|
375 |
search font icons
|
376 |
**/
|
377 |
-
jQuery(document).on('keyup blur', '#_icon_search', function(){
|
378 |
if ( jQuery(this).val().toLowerCase() != '' ) {
|
379 |
jQuery('.um-admin-icons span').hide();
|
380 |
jQuery('.um-admin-icons span[data-code*="'+jQuery(this).val().toLowerCase()+'"]').show();
|
@@ -388,7 +381,7 @@ jQuery(document).ready(function() {
|
|
388 |
/**
|
389 |
* Retrieve options from a callback function
|
390 |
*/
|
391 |
-
jQuery(document).on('blur',"#_custom_dropdown_options_source", function(){
|
392 |
var me = jQuery(this);
|
393 |
var _options = jQuery('textarea[id=_options]');
|
394 |
|
1 |
function um_admin_live_update_scripts() {
|
2 |
+
jQuery('.um-adm-conditional').each( function() {
|
3 |
+
jQuery(this).trigger('change');
|
4 |
+
});
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
if ( jQuery('.um-admin-colorpicker').length ) {
|
7 |
jQuery('.um-admin-colorpicker').wpColorPicker();
|
8 |
}
|
|
|
9 |
}
|
10 |
|
11 |
+
function um_admin_new_modal( id, ajax, size ) {
|
|
|
12 |
var modal = jQuery('body').find('.um-admin-overlay');
|
13 |
+
|
14 |
jQuery('.tipsy').hide();
|
15 |
+
|
16 |
um_admin_remove_modal();
|
17 |
+
|
18 |
jQuery('body').addClass('um-admin-modal-open').append('<div class="um-admin-overlay" /><div class="um-admin-modal" />');
|
19 |
jQuery('#' + id).prependTo('.um-admin-modal');
|
20 |
jQuery('#' + id).show();
|
29 |
} else {
|
30 |
um_admin_modal_responsive();
|
31 |
}
|
|
|
32 |
}
|
33 |
|
34 |
function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
|
|
|
35 |
in_row = '';
|
36 |
in_sub_row = '';
|
37 |
in_column = '';
|
173 |
/**
|
174 |
disable link
|
175 |
**/
|
176 |
+
jQuery(document.body).on('click', '.um-admin-builder a, .um-admin-modal a', function(e){
|
177 |
e.preventDefault();
|
178 |
return false;
|
179 |
});
|
181 |
/**
|
182 |
toggle area
|
183 |
**/
|
184 |
+
jQuery(document.body).on('click', '.um-admin-btn-toggle a', function(e){
|
185 |
var content = jQuery(this).parent().find('.um-admin-btn-content');
|
186 |
var link = jQuery(this);
|
187 |
if ( content.is(':hidden') ) {
|
201 |
/**
|
202 |
clone a condition
|
203 |
**/
|
204 |
+
jQuery(document.body).on('click', '.um-admin-new-condition', function() {
|
205 |
|
206 |
if ( jQuery(this).hasClass('disabled') )
|
207 |
return false;
|
245 |
/**
|
246 |
reset conditions
|
247 |
**/
|
248 |
+
jQuery(document.body).on('click', '.um-admin-reset-conditions a', function(){
|
249 |
var content = jQuery(this).parents('.um-admin-btn-content');
|
250 |
content.find('.um-admin-cur-condition').slice(1).remove();
|
251 |
content.find('input[type=text]').val('');
|
258 |
/**
|
259 |
remove a condition
|
260 |
**/
|
261 |
+
jQuery(document.body).on('click', '.um-admin-remove-condition', function(){
|
262 |
var condition = jQuery(this).parents('.um-admin-cur-condition');
|
263 |
jQuery('.um-admin-new-condition').removeClass('disabled');
|
264 |
jQuery('.tipsy').remove();
|
283 |
/**
|
284 |
remove modal via action
|
285 |
**/
|
286 |
+
jQuery(document.body).on('click', '.um-admin-overlay, a[data-action="UM_remove_modal"]', function(){
|
287 |
um_admin_remove_modal();
|
288 |
});
|
289 |
|
290 |
/**
|
291 |
fire new modal
|
292 |
**/
|
293 |
+
jQuery(document.body).on('click', 'a[data-modal^="UM_"], span[data-modal^="UM_"]', function(e){
|
294 |
|
295 |
e.preventDefault();
|
296 |
|
320 |
/**
|
321 |
choose font icon
|
322 |
**/
|
323 |
+
jQuery(document.body).on('click', '.um-admin-icons span', function(){
|
324 |
var icon = jQuery(this).attr('data-code');
|
325 |
jQuery(this).parent().find('span').removeClass('highlighted');
|
326 |
jQuery(this).addClass('highlighted');
|
330 |
/**
|
331 |
submit font icon
|
332 |
**/
|
333 |
+
jQuery(document.body).on('click', '#UM_fonticons a.um-admin-modal-back:not(.um-admin-modal-cancel)', function(){
|
334 |
var v_id = '';
|
335 |
var icon_selected = jQuery(this).attr('data-code');
|
336 |
if (icon_selected != ''){
|
352 |
/**
|
353 |
restore font icon
|
354 |
**/
|
355 |
+
jQuery(document.body).on('click', 'span.um-admin-icon-clear', function(){
|
356 |
var element = jQuery(this).parents('p');
|
357 |
jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
358 |
element.find('input[type=hidden]').val('');
|
367 |
/**
|
368 |
search font icons
|
369 |
**/
|
370 |
+
jQuery(document.body).on('keyup blur', '#_icon_search', function(){
|
371 |
if ( jQuery(this).val().toLowerCase() != '' ) {
|
372 |
jQuery('.um-admin-icons span').hide();
|
373 |
jQuery('.um-admin-icons span[data-code*="'+jQuery(this).val().toLowerCase()+'"]').show();
|
381 |
/**
|
382 |
* Retrieve options from a callback function
|
383 |
*/
|
384 |
+
jQuery(document.body).on('blur',"#_custom_dropdown_options_source", function(){
|
385 |
var me = jQuery(this);
|
386 |
var _options = jQuery('textarea[id=_options]');
|
387 |
|
includes/admin/assets/js/um-admin-nav-menu.js
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
2 |
-
|
3 |
|
4 |
-
|
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 |
});
|
1 |
jQuery(document).ready(function ($) {
|
2 |
+
var template = wp.template( 'um-nav-menus-fields' );
|
3 |
|
4 |
+
$( document.body ).on( 'menu-item-added', function ( e, $menuMarkup ) {
|
5 |
+
var id = $( $menuMarkup ).attr('id').substr(10);
|
6 |
|
7 |
+
var template_content = template({
|
8 |
+
menuItemID: id,
|
9 |
+
restriction_data:{
|
10 |
+
um_nav_public:0,
|
11 |
+
um_nav_roles:[]
|
12 |
+
}
|
13 |
+
});
|
14 |
|
15 |
+
if ( $( $menuMarkup ).find( 'fieldset.field-move' ).length > 0 ) {
|
16 |
+
$( $menuMarkup ).find( 'fieldset.field-move' ).before( template_content );
|
17 |
+
} else {
|
18 |
+
$( $menuMarkup ).find( '.menu-item-actions' ).before( template_content );
|
19 |
+
}
|
20 |
+
});
|
21 |
|
22 |
|
23 |
+
$( 'ul#menu-to-edit > li' ).each( function(){
|
24 |
+
var id = $(this).attr('id').substr(10);
|
25 |
+
var template_content = template({
|
26 |
+
menuItemID: id,
|
27 |
+
restriction_data: um_menu_restriction_data[ id ]
|
28 |
+
});
|
29 |
|
30 |
+
if ( $( this ).find( 'fieldset.field-move' ).length > 0 ) {
|
31 |
+
$( this ).find( 'fieldset.field-move' ).before( template_content );
|
32 |
+
} else {
|
33 |
+
$( this ).find( '.menu-item-actions' ).before( template_content );
|
34 |
+
}
|
35 |
+
});
|
36 |
});
|
includes/admin/assets/js/um-admin-role-wrapper.js
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
jQuery( document ).ready( function() {
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
|
21 |
});
|
1 |
jQuery( document ).ready( function() {
|
2 |
|
3 |
+
jQuery( '#role' ).change( function() {
|
4 |
+
if ( jQuery.inArray( jQuery(this).val().substr(3), um_roles ) !== -1 ) {
|
5 |
+
jQuery( '#um_role_selector_wrapper' ).hide();
|
6 |
+
jQuery( '#um-role' ).val('');
|
7 |
+
} else {
|
8 |
+
jQuery( '#um_role_selector_wrapper' ).show();
|
9 |
+
}
|
10 |
+
}).trigger('change');
|
11 |
|
12 |
+
jQuery( '#adduser-role' ).change( function() {
|
13 |
+
if ( jQuery.inArray( jQuery(this).val().substr(3), um_roles ) !== -1 ) {
|
14 |
+
jQuery( '#um_role_existing_selector_wrapper' ).hide();
|
15 |
+
jQuery( '#um-role' ).val('');
|
16 |
+
} else {
|
17 |
+
jQuery( '#um_role_existing_selector_wrapper' ).show();
|
18 |
+
}
|
19 |
+
}).trigger('change');
|
20 |
|
21 |
});
|
includes/admin/assets/js/um-admin-scripts.js
CHANGED
@@ -12,35 +12,10 @@ function um_init_tooltips() {
|
|
12 |
|
13 |
jQuery(document).ready(function() {
|
14 |
|
15 |
-
/**
|
16 |
-
clone a field dropdown
|
17 |
-
**/
|
18 |
-
jQuery(document).on( 'click', '#um_add_review_love', function(e){
|
19 |
-
jQuery(this).parents('#um_start_review_notice').hide();
|
20 |
-
jQuery('.um_hidden_notice[data-key="love"]').show();
|
21 |
-
});
|
22 |
-
|
23 |
-
/**
|
24 |
-
clone a field dropdown
|
25 |
-
**/
|
26 |
-
jQuery(document).on( 'click', '#um_add_review_good', function(e){
|
27 |
-
jQuery(this).parents('#um_start_review_notice').hide();
|
28 |
-
jQuery('.um_hidden_notice[data-key="good"]').show();
|
29 |
-
});
|
30 |
-
|
31 |
-
/**
|
32 |
-
clone a field dropdown
|
33 |
-
**/
|
34 |
-
jQuery(document).on( 'click', '#um_add_review_bad', function(e){
|
35 |
-
jQuery(this).parents('#um_start_review_notice').hide();
|
36 |
-
jQuery('.um_hidden_notice[data-key="bad"]').show();
|
37 |
-
});
|
38 |
-
|
39 |
-
|
40 |
/**
|
41 |
clone a field dropdown
|
42 |
**/
|
43 |
-
jQuery(document).on('click', '.um-admin-clone', function(e){
|
44 |
e.preventDefault();
|
45 |
var container = jQuery(this).parents('.um-admin-field');
|
46 |
var parent = jQuery(this).parents('p').find('.um-admin-field:last-child');
|
@@ -59,7 +34,7 @@ jQuery(document).ready(function() {
|
|
59 |
/**
|
60 |
remove a field dropdown
|
61 |
**/
|
62 |
-
jQuery(document).on('click', '.um-admin-clone-remove', function(e){
|
63 |
e.preventDefault();
|
64 |
var container = jQuery(this).parents('.um-admin-field');
|
65 |
jQuery('.tipsy').remove();
|
@@ -74,7 +49,6 @@ jQuery(document).ready(function() {
|
|
74 |
/**
|
75 |
Ajax link
|
76 |
**/
|
77 |
-
|
78 |
jQuery('.um-admin-ajaxlink').click(function(e){
|
79 |
e.preventDefault();
|
80 |
return false;
|
@@ -83,8 +57,7 @@ jQuery(document).ready(function() {
|
|
83 |
/**
|
84 |
On/Off Buttons
|
85 |
**/
|
86 |
-
|
87 |
-
jQuery(document).on('click', '.um-admin-yesno span.btn', function(){
|
88 |
if (!jQuery(this).parents('p').hasClass('disabled-on-off')){
|
89 |
if ( jQuery(this).parent().find('input[type=hidden]').val() == 0 ){
|
90 |
update_val = 1;
|
@@ -104,20 +77,7 @@ jQuery(document).ready(function() {
|
|
104 |
if ( jQuery('.um-admin-colorpicker').length ) {
|
105 |
jQuery('.um-admin-colorpicker').wpColorPicker();
|
106 |
}
|
107 |
-
|
108 |
-
/* /!**
|
109 |
-
Select Dropdowns
|
110 |
-
**!/
|
111 |
-
|
112 |
-
jQuery(".umaf-selectjs").select2({
|
113 |
-
allowClear: false,
|
114 |
-
minimumResultsForSearch: 10
|
115 |
-
});
|
116 |
-
|
117 |
-
jQuery('.um-admin-field select').select2({
|
118 |
-
allowClear: true,
|
119 |
-
minimumResultsForSearch: 10
|
120 |
-
});*/
|
121 |
|
122 |
/**
|
123 |
Tooltips
|
@@ -130,58 +90,58 @@ jQuery(document).ready(function() {
|
|
130 |
jQuery('.um-admin-tipsy-e').tipsy({gravity: 'e', opacity: 1, live: 'a.live' });
|
131 |
jQuery('.um-admin-tipsy-s').tipsy({gravity: 's', opacity: 1, live: 'a.live' });
|
132 |
}
|
|
|
133 |
|
134 |
/**
|
135 |
Conditional fields
|
136 |
**/
|
137 |
-
|
138 |
-
jQuery(document).on('change', '.um-adm-conditional', function(){
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
|
147 |
if ( jQuery(this).data('cond1') ) {
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
}
|
161 |
|
162 |
if ( jQuery(this).data('cond2') ) {
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
}
|
176 |
|
177 |
if ( jQuery(this).data('cond3') ) {
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
}
|
186 |
|
187 |
});jQuery('.um-adm-conditional').each(function(){jQuery(this).trigger('change');});
|
@@ -212,11 +172,6 @@ jQuery(document).ready(function() {
|
|
212 |
}
|
213 |
|
214 |
});jQuery('.um-conditional-radio-group input[type=radio]:checked').each(function(){jQuery(this).trigger('click');});
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
|
221 |
|
222 |
|
@@ -226,19 +181,19 @@ jQuery(document).ready(function() {
|
|
226 |
**/
|
227 |
|
228 |
jQuery('.um-nav-mode').each( function() {
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
});
|
235 |
|
236 |
|
237 |
-
jQuery(document).on('change', '.um-nav-mode select', function(){
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
});
|
244 |
});
|
12 |
|
13 |
jQuery(document).ready(function() {
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
clone a field dropdown
|
17 |
**/
|
18 |
+
jQuery(document.body).on('click', '.um-admin-clone', function(e){
|
19 |
e.preventDefault();
|
20 |
var container = jQuery(this).parents('.um-admin-field');
|
21 |
var parent = jQuery(this).parents('p').find('.um-admin-field:last-child');
|
34 |
/**
|
35 |
remove a field dropdown
|
36 |
**/
|
37 |
+
jQuery(document.body).on('click', '.um-admin-clone-remove', function(e){
|
38 |
e.preventDefault();
|
39 |
var container = jQuery(this).parents('.um-admin-field');
|
40 |
jQuery('.tipsy').remove();
|
49 |
/**
|
50 |
Ajax link
|
51 |
**/
|
|
|
52 |
jQuery('.um-admin-ajaxlink').click(function(e){
|
53 |
e.preventDefault();
|
54 |
return false;
|
57 |
/**
|
58 |
On/Off Buttons
|
59 |
**/
|
60 |
+
jQuery(document.body).on('click', '.um-admin-yesno span.btn', function(){
|
|
|
61 |
if (!jQuery(this).parents('p').hasClass('disabled-on-off')){
|
62 |
if ( jQuery(this).parent().find('input[type=hidden]').val() == 0 ){
|
63 |
update_val = 1;
|
77 |
if ( jQuery('.um-admin-colorpicker').length ) {
|
78 |
jQuery('.um-admin-colorpicker').wpColorPicker();
|
79 |
}
|
80 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
/**
|
83 |
Tooltips
|
90 |
jQuery('.um-admin-tipsy-e').tipsy({gravity: 'e', opacity: 1, live: 'a.live' });
|
91 |
jQuery('.um-admin-tipsy-s').tipsy({gravity: 's', opacity: 1, live: 'a.live' });
|
92 |
}
|
93 |
+
|
94 |
|
95 |
/**
|
96 |
Conditional fields
|
97 |
**/
|
98 |
+
jQuery( document.body ).on('change', '.um-adm-conditional', function(){
|
|
|
99 |
|
100 |
+
var value;
|
101 |
+
if ( jQuery(this).attr("type") == 'checkbox' ) {
|
102 |
+
value = jQuery(this).is(':checked') ? 1 : 0;
|
103 |
+
} else {
|
104 |
+
value = jQuery(this).val();
|
105 |
+
}
|
106 |
|
107 |
if ( jQuery(this).data('cond1') ) {
|
108 |
+
if ( value == jQuery(this).data('cond1') ) {
|
109 |
+
jQuery('.' + jQuery(this).data('cond1-show') ).show();
|
110 |
+
jQuery('.' + jQuery(this).data('cond1-hide') ).hide();
|
111 |
+
|
112 |
+
if ( jQuery(this).data('cond1-show') == '_roles' ) {
|
113 |
+
return false;
|
114 |
+
}
|
115 |
+
|
116 |
+
} else {
|
117 |
+
jQuery('.' + jQuery(this).data('cond1-show') ).hide();
|
118 |
+
jQuery('.' + jQuery(this).data('cond1-hide') ).show();
|
119 |
+
}
|
120 |
}
|
121 |
|
122 |
if ( jQuery(this).data('cond2') ) {
|
123 |
+
if ( value == jQuery(this).data('cond2') ) {
|
124 |
+
jQuery('.' + jQuery(this).data('cond2-show') ).show();
|
125 |
+
jQuery('.' + jQuery(this).data('cond2-hide') ).hide();
|
126 |
+
|
127 |
+
if ( jQuery(this).data('cond2-show') == '_roles' ) {
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
|
131 |
+
} else {
|
132 |
+
jQuery('.' + jQuery(this).data('cond2-show') ).hide();
|
133 |
+
jQuery('.' + jQuery(this).data('cond2-hide') ).show();
|
134 |
+
}
|
135 |
}
|
136 |
|
137 |
if ( jQuery(this).data('cond3') ) {
|
138 |
+
if ( value == jQuery(this).data('cond3') ) {
|
139 |
+
jQuery('.' + jQuery(this).data('cond3-show') ).show();
|
140 |
+
jQuery('.' + jQuery(this).data('cond3-hide') ).hide();
|
141 |
+
} else {
|
142 |
+
jQuery('.' + jQuery(this).data('cond3-show') ).hide();
|
143 |
+
jQuery('.' + jQuery(this).data('cond3-hide') ).show();
|
144 |
+
}
|
145 |
}
|
146 |
|
147 |
});jQuery('.um-adm-conditional').each(function(){jQuery(this).trigger('change');});
|
172 |
}
|
173 |
|
174 |
});jQuery('.um-conditional-radio-group input[type=radio]:checked').each(function(){jQuery(this).trigger('click');});
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
|
177 |
|
181 |
**/
|
182 |
|
183 |
jQuery('.um-nav-mode').each( function() {
|
184 |
+
if ( jQuery(this).find('select').val() == 2 ) {
|
185 |
+
jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').show();
|
186 |
+
} else {
|
187 |
+
jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').hide();
|
188 |
+
}
|
189 |
});
|
190 |
|
191 |
|
192 |
+
jQuery( document.body ).on('change', '.um-nav-mode select', function(){
|
193 |
+
if ( jQuery(this).val() == 2 ) {
|
194 |
+
jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').show();
|
195 |
+
} else {
|
196 |
+
jQuery(this).parents('.um-nav-edit').find('.um-nav-roles').hide();
|
197 |
+
}
|
198 |
});
|
199 |
});
|
includes/admin/assets/js/um-admin-settings.js
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
jQuery( document ).ready( function() {
|
2 |
-
|
3 |
-
|
4 |
-
|
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 |
});
|
1 |
jQuery( document ).ready( function() {
|
2 |
+
/**
|
3 |
+
* Licenses
|
4 |
+
*/
|
5 |
+
jQuery( document.body ).on( 'click', '.um_license_deactivate', function() {
|
6 |
+
jQuery(this).siblings('.um-option-field').val('');
|
7 |
+
jQuery(this).parents('form.um-settings-form').submit();
|
8 |
+
});
|
9 |
|
10 |
|
11 |
+
/**
|
12 |
+
* Not licenses page
|
13 |
+
*/
|
14 |
+
if ( jQuery( '#licenses_settings' ).length === 0 ) {
|
15 |
+
var changed = false;
|
16 |
|
17 |
+
jQuery( 'input, textarea, select' ).change( function() {
|
18 |
+
changed = true;
|
19 |
+
});
|
20 |
|
21 |
+
jQuery( '#um-settings-wrap .um-nav-tab-wrapper a, #um-settings-wrap .subsubsub a' ).click( function() {
|
22 |
+
if ( changed ) {
|
23 |
+
window.onbeforeunload = function() {
|
24 |
+
return php_data.onbeforeunload_text;
|
25 |
+
};
|
26 |
+
} else {
|
27 |
+
window.onbeforeunload = '';
|
28 |
+
}
|
29 |
+
});
|
30 |
|
31 |
+
jQuery( '.submit input' ).click( function() {
|
32 |
+
window.onbeforeunload = '';
|
33 |
+
});
|
34 |
+
}
|
35 |
});
|
includes/admin/core/class-admin-enqueue.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
2 |
namespace um\admin\core;
|
3 |
|
|
|
4 |
// Exit if accessed directly.
|
5 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
|
|
|
7 |
if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
8 |
|
9 |
|
@@ -53,12 +55,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
53 |
* Load js for Add/Edit User form
|
54 |
*/
|
55 |
function load_role_wrapper() {
|
56 |
-
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', '', ultimatemember_version, true );
|
57 |
-
wp_enqueue_script( 'um_admin_role_wrapper' );
|
58 |
-
|
59 |
$localize_roles_data = get_option( 'um_roles' );
|
60 |
-
|
61 |
-
|
62 |
}
|
63 |
|
64 |
|
@@ -71,11 +71,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
71 |
*/
|
72 |
function enter_title_here( $title ) {
|
73 |
$screen = get_current_screen();
|
74 |
-
if ( 'um_directory' == $screen->post_type ){
|
75 |
-
$title = 'e.g. Member Directory';
|
76 |
-
}
|
77 |
-
|
78 |
-
$title = 'e.g. New Registration Form';
|
79 |
}
|
80 |
return $title;
|
81 |
}
|
@@ -100,10 +99,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
100 |
* Load Form
|
101 |
*/
|
102 |
function load_form() {
|
103 |
-
wp_register_style( 'um_admin_form', $this->css_url . 'um-admin-form.css' );
|
104 |
wp_enqueue_style( 'um_admin_form' );
|
105 |
|
106 |
-
wp_register_script( 'um_admin_form', $this->js_url . 'um-admin-form.js', '',
|
107 |
wp_enqueue_script( 'um_admin_form' );
|
108 |
}
|
109 |
|
@@ -112,10 +111,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
112 |
* Load Forms
|
113 |
*/
|
114 |
function load_forms() {
|
115 |
-
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css' );
|
116 |
wp_enqueue_style( 'um_admin_forms' );
|
117 |
|
118 |
-
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', '',
|
119 |
wp_enqueue_script( 'um_admin_forms' );
|
120 |
|
121 |
$localize_data = array(
|
@@ -133,11 +132,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
133 |
* Load dashboard
|
134 |
*/
|
135 |
function load_dashboard() {
|
136 |
-
wp_register_style( 'um_admin_dashboard', $this->css_url . 'um-admin-dashboard.css' );
|
137 |
wp_enqueue_style( 'um_admin_dashboard' );
|
138 |
-
|
139 |
-
wp_register_script( 'um_admin_dashboard', $this->js_url . 'um-admin-dashboard.js', '', '', true );
|
140 |
-
wp_enqueue_script( 'um_admin_dashboard' );
|
141 |
}
|
142 |
|
143 |
|
@@ -145,10 +141,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
145 |
* Load settings
|
146 |
*/
|
147 |
function load_settings() {
|
148 |
-
wp_register_style( 'um_admin_settings', $this->css_url . 'um-admin-settings.css' );
|
149 |
wp_enqueue_style( 'um_admin_settings' );
|
150 |
|
151 |
-
wp_register_script( 'um_admin_settings', $this->js_url . 'um-admin-settings.js', '',
|
152 |
wp_enqueue_script( 'um_admin_settings' );
|
153 |
|
154 |
$localize_data = array(
|
@@ -167,10 +163,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
167 |
* Load modal
|
168 |
*/
|
169 |
function load_modal() {
|
170 |
-
wp_register_style( 'um_admin_modal', $this->css_url . 'um-admin-modal.css' );
|
171 |
wp_enqueue_style( 'um_admin_modal' );
|
172 |
|
173 |
-
wp_register_script( 'um_admin_modal', $this->js_url . 'um-admin-modal.js', array('jquery', 'wp-util'
|
174 |
wp_enqueue_script( 'um_admin_modal' );
|
175 |
}
|
176 |
|
@@ -179,7 +175,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
179 |
* Field Processing
|
180 |
*/
|
181 |
function load_field() {
|
182 |
-
wp_register_script( 'um_admin_field', $this->js_url . 'um-admin-field.js', array('jquery', 'wp-util'),
|
183 |
wp_enqueue_script( 'um_admin_field' );
|
184 |
}
|
185 |
|
@@ -188,7 +184,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
188 |
* Load Builder
|
189 |
*/
|
190 |
function load_builder() {
|
191 |
-
wp_register_script( 'um_admin_builder', $this->js_url . 'um-admin-builder.js', array('jquery', 'wp-util'),
|
192 |
wp_enqueue_script( 'um_admin_builder' );
|
193 |
|
194 |
//hide footer text on add/edit UM Forms
|
@@ -207,11 +203,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
207 |
);
|
208 |
wp_localize_script( 'um_admin_builder', 'um_admin_builder_data', $localize_data );
|
209 |
|
210 |
-
wp_register_script( 'um_admin_dragdrop', $this->js_url . 'um-admin-dragdrop.js', array('jquery', 'wp-util'),
|
211 |
wp_enqueue_script( 'um_admin_dragdrop' );
|
212 |
|
213 |
-
|
214 |
-
wp_register_style( 'um_admin_builder', $this->css_url . 'um-admin-builder.css' );
|
215 |
wp_enqueue_style( 'um_admin_builder' );
|
216 |
}
|
217 |
|
@@ -220,9 +215,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
220 |
* Load core WP styles/scripts
|
221 |
*/
|
222 |
function load_core_wp() {
|
223 |
-
wp_enqueue_style( 'wp-color-picker' );
|
224 |
-
wp_enqueue_script( 'wp-color-picker' );
|
225 |
-
|
226 |
wp_enqueue_script( 'jquery-ui-draggable' );
|
227 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
228 |
|
@@ -234,13 +226,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
234 |
* Load Admin Styles
|
235 |
*/
|
236 |
function load_css() {
|
237 |
-
wp_register_style( 'um_admin_menu', $this->css_url . 'um-admin-menu.css' );
|
238 |
wp_enqueue_style( 'um_admin_menu' );
|
239 |
|
240 |
-
wp_register_style( 'um_admin_columns', $this->css_url . 'um-admin-columns.css' );
|
241 |
wp_enqueue_style( 'um_admin_columns' );
|
242 |
|
243 |
-
wp_register_style( 'um_admin_misc', $this->css_url . 'um-admin-misc.css' );
|
244 |
wp_enqueue_style( 'um_admin_misc' );
|
245 |
}
|
246 |
|
@@ -249,7 +241,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
249 |
* Load functions js
|
250 |
*/
|
251 |
function load_functions() {
|
252 |
-
wp_register_script( '
|
|
|
253 |
wp_enqueue_script( 'um_functions' );
|
254 |
}
|
255 |
|
@@ -258,10 +251,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
258 |
* Load Fonticons
|
259 |
*/
|
260 |
function load_fonticons() {
|
261 |
-
wp_register_style( 'um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css' );
|
262 |
wp_enqueue_style( 'um_fonticons_ii' );
|
263 |
|
264 |
-
wp_register_style( 'um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css' );
|
265 |
wp_enqueue_style( 'um_fonticons_fa' );
|
266 |
}
|
267 |
|
@@ -273,7 +266,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
273 |
wp_register_script( 'um_admin_global', $this->js_url . 'um-admin-global.js', array('jquery'), ultimatemember_version, true );
|
274 |
wp_enqueue_script( 'um_admin_global' );
|
275 |
|
276 |
-
wp_register_style( 'um_admin_global', $this->css_url . 'um-admin-global.css' );
|
277 |
wp_enqueue_style( 'um_admin_global' );
|
278 |
}
|
279 |
|
@@ -282,7 +275,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
282 |
* Load jQuery custom code
|
283 |
*/
|
284 |
function load_custom_scripts() {
|
285 |
-
wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', array('jquery','wp-util', 'wp-color-picker'),
|
286 |
wp_enqueue_script( 'um_admin_scripts' );
|
287 |
}
|
288 |
|
@@ -291,7 +284,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
291 |
* Load jQuery custom code
|
292 |
*/
|
293 |
function load_nav_manus_scripts() {
|
294 |
-
wp_register_script( 'um_admin_nav_manus', $this->js_url . 'um-admin-nav-menu.js', array('jquery','wp-util'),
|
295 |
wp_enqueue_script( 'um_admin_nav_manus' );
|
296 |
}
|
297 |
|
@@ -300,7 +293,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
300 |
* Load AJAX
|
301 |
*/
|
302 |
function load_ajax_js() {
|
303 |
-
wp_register_script( 'um_admin_ajax', $this->js_url . 'um-admin-ajax.js', array('jquery','wp-util'),
|
304 |
wp_enqueue_script( 'um_admin_ajax' );
|
305 |
}
|
306 |
|
@@ -380,7 +373,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
|
380 |
wp_enqueue_style( 'um_default_css' );
|
381 |
|
382 |
if ( is_rtl() ) {
|
383 |
-
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css' );
|
384 |
wp_enqueue_style( 'um_admin_rtl' );
|
385 |
}
|
386 |
|
1 |
<?php
|
2 |
namespace um\admin\core;
|
3 |
|
4 |
+
|
5 |
// Exit if accessed directly.
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
8 |
+
|
9 |
if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
10 |
|
11 |
|
55 |
* Load js for Add/Edit User form
|
56 |
*/
|
57 |
function load_role_wrapper() {
|
58 |
+
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', array( 'jquery' ), ultimatemember_version, true );
|
|
|
|
|
59 |
$localize_roles_data = get_option( 'um_roles' );
|
60 |
+
wp_localize_script( 'um_admin_role_wrapper', 'um_roles', $localize_roles_data );
|
61 |
+
wp_enqueue_script( 'um_admin_role_wrapper' );
|
62 |
}
|
63 |
|
64 |
|
71 |
*/
|
72 |
function enter_title_here( $title ) {
|
73 |
$screen = get_current_screen();
|
74 |
+
if ( 'um_directory' == $screen->post_type ) {
|
75 |
+
$title = __( 'e.g. Member Directory', 'ultimate-member' );
|
76 |
+
} elseif ( 'um_form' == $screen->post_type ) {
|
77 |
+
$title = __( 'e.g. New Registration Form', 'ultimate-member' );
|
|
|
78 |
}
|
79 |
return $title;
|
80 |
}
|
99 |
* Load Form
|
100 |
*/
|
101 |
function load_form() {
|
102 |
+
wp_register_style( 'um_admin_form', $this->css_url . 'um-admin-form.css', array(), ultimatemember_version );
|
103 |
wp_enqueue_style( 'um_admin_form' );
|
104 |
|
105 |
+
wp_register_script( 'um_admin_form', $this->js_url . 'um-admin-form.js', array( 'jquery' ), ultimatemember_version, true );
|
106 |
wp_enqueue_script( 'um_admin_form' );
|
107 |
}
|
108 |
|
111 |
* Load Forms
|
112 |
*/
|
113 |
function load_forms() {
|
114 |
+
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css', array( 'wp-color-picker' ), ultimatemember_version );
|
115 |
wp_enqueue_style( 'um_admin_forms' );
|
116 |
|
117 |
+
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery' ), ultimatemember_version, true );
|
118 |
wp_enqueue_script( 'um_admin_forms' );
|
119 |
|
120 |
$localize_data = array(
|
132 |
* Load dashboard
|
133 |
*/
|
134 |
function load_dashboard() {
|
135 |
+
wp_register_style( 'um_admin_dashboard', $this->css_url . 'um-admin-dashboard.css', array(), ultimatemember_version );
|
136 |
wp_enqueue_style( 'um_admin_dashboard' );
|
|
|
|
|
|
|
137 |
}
|
138 |
|
139 |
|
141 |
* Load settings
|
142 |
*/
|
143 |
function load_settings() {
|
144 |
+
wp_register_style( 'um_admin_settings', $this->css_url . 'um-admin-settings.css', array(), ultimatemember_version );
|
145 |
wp_enqueue_style( 'um_admin_settings' );
|
146 |
|
147 |
+
wp_register_script( 'um_admin_settings', $this->js_url . 'um-admin-settings.js', array( 'jquery' ), ultimatemember_version, true );
|
148 |
wp_enqueue_script( 'um_admin_settings' );
|
149 |
|
150 |
$localize_data = array(
|
163 |
* Load modal
|
164 |
*/
|
165 |
function load_modal() {
|
166 |
+
wp_register_style( 'um_admin_modal', $this->css_url . 'um-admin-modal.css', array( 'wp-color-picker' ), ultimatemember_version );
|
167 |
wp_enqueue_style( 'um_admin_modal' );
|
168 |
|
169 |
+
wp_register_script( 'um_admin_modal', $this->js_url . 'um-admin-modal.js', array( 'jquery', 'wp-util', 'wp-color-picker' ), ultimatemember_version, true );
|
170 |
wp_enqueue_script( 'um_admin_modal' );
|
171 |
}
|
172 |
|
175 |
* Field Processing
|
176 |
*/
|
177 |
function load_field() {
|
178 |
+
wp_register_script( 'um_admin_field', $this->js_url . 'um-admin-field.js', array('jquery', 'wp-util'), ultimatemember_version, true );
|
179 |
wp_enqueue_script( 'um_admin_field' );
|
180 |
}
|
181 |
|
184 |
* Load Builder
|
185 |
*/
|
186 |
function load_builder() {
|
187 |
+
wp_register_script( 'um_admin_builder', $this->js_url . 'um-admin-builder.js', array('jquery', 'wp-util'), ultimatemember_version, true );
|
188 |
wp_enqueue_script( 'um_admin_builder' );
|
189 |
|
190 |
//hide footer text on add/edit UM Forms
|
203 |
);
|
204 |
wp_localize_script( 'um_admin_builder', 'um_admin_builder_data', $localize_data );
|
205 |
|
206 |
+
wp_register_script( 'um_admin_dragdrop', $this->js_url . 'um-admin-dragdrop.js', array('jquery', 'wp-util'), ultimatemember_version, true );
|
207 |
wp_enqueue_script( 'um_admin_dragdrop' );
|
208 |
|
209 |
+
wp_register_style( 'um_admin_builder', $this->css_url . 'um-admin-builder.css', array(), ultimatemember_version );
|
|
|
210 |
wp_enqueue_style( 'um_admin_builder' );
|
211 |
}
|
212 |
|
215 |
* Load core WP styles/scripts
|
216 |
*/
|
217 |
function load_core_wp() {
|
|
|
|
|
|
|
218 |
wp_enqueue_script( 'jquery-ui-draggable' );
|
219 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
220 |
|
226 |
* Load Admin Styles
|
227 |
*/
|
228 |
function load_css() {
|
229 |
+
wp_register_style( 'um_admin_menu', $this->css_url . 'um-admin-menu.css', array(), ultimatemember_version );
|
230 |
wp_enqueue_style( 'um_admin_menu' );
|
231 |
|
232 |
+
wp_register_style( 'um_admin_columns', $this->css_url . 'um-admin-columns.css', array(), ultimatemember_version );
|
233 |
wp_enqueue_style( 'um_admin_columns' );
|
234 |
|
235 |
+
wp_register_style( 'um_admin_misc', $this->css_url . 'um-admin-misc.css', array(), ultimatemember_version );
|
236 |
wp_enqueue_style( 'um_admin_misc' );
|
237 |
}
|
238 |
|
241 |
* Load functions js
|
242 |
*/
|
243 |
function load_functions() {
|
244 |
+
wp_register_script( 'um_scrollbar', um_url . 'assets/js/um-scrollbar.js', array( 'jquery' ), ultimatemember_version, true );
|
245 |
+
wp_register_script( 'um_functions', um_url . 'assets/js/um-functions.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true );
|
246 |
wp_enqueue_script( 'um_functions' );
|
247 |
}
|
248 |
|
251 |
* Load Fonticons
|
252 |
*/
|
253 |
function load_fonticons() {
|
254 |
+
wp_register_style( 'um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css', array(), ultimatemember_version );
|
255 |
wp_enqueue_style( 'um_fonticons_ii' );
|
256 |
|
257 |
+
wp_register_style( 'um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css', array(), ultimatemember_version );
|
258 |
wp_enqueue_style( 'um_fonticons_fa' );
|
259 |
}
|
260 |
|
266 |
wp_register_script( 'um_admin_global', $this->js_url . 'um-admin-global.js', array('jquery'), ultimatemember_version, true );
|
267 |
wp_enqueue_script( 'um_admin_global' );
|
268 |
|
269 |
+
wp_register_style( 'um_admin_global', $this->css_url . 'um-admin-global.css', array(), ultimatemember_version );
|
270 |
wp_enqueue_style( 'um_admin_global' );
|
271 |
}
|
272 |
|
275 |
* Load jQuery custom code
|
276 |
*/
|
277 |
function load_custom_scripts() {
|
278 |
+
wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', array('jquery','wp-util', 'wp-color-picker'), ultimatemember_version, true );
|
279 |
wp_enqueue_script( 'um_admin_scripts' );
|
280 |
}
|
281 |
|
284 |
* Load jQuery custom code
|
285 |
*/
|
286 |
function load_nav_manus_scripts() {
|
287 |
+
wp_register_script( 'um_admin_nav_manus', $this->js_url . 'um-admin-nav-menu.js', array('jquery','wp-util'), ultimatemember_version, true );
|
288 |
wp_enqueue_script( 'um_admin_nav_manus' );
|
289 |
}
|
290 |
|
293 |
* Load AJAX
|
294 |
*/
|
295 |
function load_ajax_js() {
|
296 |
+
wp_register_script( 'um_admin_ajax', $this->js_url . 'um-admin-ajax.js', array('jquery','wp-util'), ultimatemember_version, true );
|
297 |
wp_enqueue_script( 'um_admin_ajax' );
|
298 |
}
|
299 |
|
373 |
wp_enqueue_style( 'um_default_css' );
|
374 |
|
375 |
if ( is_rtl() ) {
|
376 |
+
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css', array(), ultimatemember_version );
|
377 |
wp_enqueue_style( 'um_admin_rtl' );
|
378 |
}
|
379 |
|
includes/class-extensions.php
CHANGED
@@ -1,230 +1,230 @@
|
|
1 |
-
<?php
|
2 |
-
namespace um;
|
3 |
-
|
4 |
-
// Exit if executed directly
|
5 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
-
|
7 |
-
|
8 |
-
if ( ! class_exists( 'um\Extensions' ) ) {
|
9 |
-
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Class Extensions
|
13 |
-
*
|
14 |
-
* @package um
|
15 |
-
*
|
16 |
-
* @method void bbpress_activation()
|
17 |
-
*/
|
18 |
-
class Extensions {
|
19 |
-
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Extensions list
|
23 |
-
*
|
24 |
-
* @var array
|
25 |
-
*/
|
26 |
-
var $list = array();
|
27 |
-
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Extensions data
|
31 |
-
*
|
32 |
-
* @var array
|
33 |
-
*/
|
34 |
-
var $plugin_data = array();
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Extensions constructor.
|
39 |
-
*/
|
40 |
-
function __construct() {
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
/**
|
46 |
-
*
|
47 |
-
*/
|
48 |
-
function check_dependencies() {
|
49 |
-
$extensions = $this->get_list();
|
50 |
-
|
51 |
-
foreach ( $extensions as $slug ) {
|
52 |
-
$extension = $this->get_info( $slug );
|
53 |
-
|
54 |
-
list( $run, $slug, $message ) = apply_filters_ref_array( 'um_extension_custom_dependencies', array( true, $slug, '' ) );
|
55 |
-
|
56 |
-
if ( $run ) {
|
57 |
-
$compare_version_result = UM()->dependencies()->compare_versions( $extension['min_core_version'], $extension['version'], $slug, $extension['title'] );
|
58 |
-
|
59 |
-
if ( true !== $compare_version_result ) {
|
60 |
-
UM()->notices()->add_notice( "{$slug}_dependencies", array(
|
61 |
-
'class' => 'error',
|
62 |
-
'message' => '<p>' . $compare_version_result . '</p>',
|
63 |
-
), 1 );
|
64 |
-
}
|
65 |
-
} elseif ( ! $run && ! empty( $message ) ) {
|
66 |
-
UM()->notices()->add_notice( "{$slug}_dependencies", array(
|
67 |
-
'class' => 'error',
|
68 |
-
'message' => $message,
|
69 |
-
), 1 );
|
70 |
-
}
|
71 |
-
|
72 |
-
if ( $run ) {
|
73 |
-
UM()->call_class( "um_ext\um_{$slug}\Init" );
|
74 |
-
}
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
|
79 |
-
/**
|
80 |
-
* @param $settings
|
81 |
-
*
|
82 |
-
* @return mixed
|
83 |
-
*/
|
84 |
-
function license_options( $settings ) {
|
85 |
-
|
86 |
-
$extensions = $this->get_list();
|
87 |
-
|
88 |
-
if ( empty( $extensions ) ) {
|
89 |
-
return $settings;
|
90 |
-
}
|
91 |
-
|
92 |
-
foreach ( $extensions as $slug ) {
|
93 |
-
$extension = $this->get_info( $slug );
|
94 |
-
|
95 |
-
if ( isset( $extension['plan'] ) && $extension['plan'] == 'free' ) {
|
96 |
-
continue;
|
97 |
-
}
|
98 |
-
|
99 |
-
$settings['licenses']['fields'][] = array(
|
100 |
-
'id' => "um_{$slug}_license_key",
|
101 |
-
'label' => sprintf( __( '%s License Key', 'ultimate-member' ), $extension['title'] ),
|
102 |
-
'item_name' => $extension['item_name'],
|
103 |
-
'author' => 'Ultimate Member',
|
104 |
-
'version' => $extension['version'],
|
105 |
-
);
|
106 |
-
}
|
107 |
-
|
108 |
-
return $settings;
|
109 |
-
}
|
110 |
-
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Loading Extensions localizations
|
114 |
-
*/
|
115 |
-
function localization() {
|
116 |
-
$extensions = $this->get_list();
|
117 |
-
|
118 |
-
foreach ( $extensions as $slug ) {
|
119 |
-
$extension = $this->get_info( $slug );
|
120 |
-
|
121 |
-
$locale = ( get_locale() != '' ) ? get_locale() : 'en_US';
|
122 |
-
load_textdomain( $extension['textdomain'], WP_LANG_DIR . '/plugins/' . $extension['textdomain'] . '-' . $locale . '.mo');
|
123 |
-
load_plugin_textdomain( $extension['textdomain'], false, dirname( $extension['plugin'] ) . '/languages/' );
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
/**
|
129 |
-
* @param $slug
|
130 |
-
*
|
131 |
-
* @return string
|
132 |
-
*/
|
133 |
-
function get_version( $slug ) {
|
134 |
-
|
135 |
-
$version = '';
|
136 |
-
|
137 |
-
return $version;
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
/**
|
142 |
-
* @param $slug
|
143 |
-
* @param bool $field
|
144 |
-
*
|
145 |
-
* @return array|bool
|
146 |
-
*/
|
147 |
-
function get_info( $slug, $field = false ) {
|
148 |
-
if ( ! $field ) {
|
149 |
-
return ! empty( $this->plugin_data[ $slug ] ) ? $this->plugin_data[ $slug ] : array();
|
150 |
-
} else {
|
151 |
-
return ! empty( $this->plugin_data[ $slug ][ $field ] ) ? $this->plugin_data[ $slug ][ $field ] : false;
|
152 |
-
}
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
/**
|
157 |
-
* @param string $slug
|
158 |
-
* @param array $plugin_data
|
159 |
-
*/
|
160 |
-
function add( $slug, $plugin_data ) {
|
161 |
-
$this->list[] = $slug;
|
162 |
-
$this->plugin_data[ $slug ] = $plugin_data;
|
163 |
-
}
|
164 |
-
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Activate Extension Process
|
168 |
-
* Common functions in activation
|
169 |
-
*
|
170 |
-
* @param $slug
|
171 |
-
*/
|
172 |
-
function activate( $slug ) {
|
173 |
-
$plugin_data = $this->get_info( $slug );
|
174 |
-
|
175 |
-
//if extension wasn't inited, init it firstly via "um_{$slug}_add" function
|
176 |
-
//"um_{$slug}_add" must be in the preset structure of UM extension
|
177 |
-
if ( empty( $plugin_data ) && function_exists( "um_{$slug}_add" ) ) {
|
178 |
-
call_user_func( "um_{$slug}_add" );
|
179 |
-
$plugin_data = $this->get_info( $slug );
|
180 |
-
}
|
181 |
-
|
182 |
-
//first install
|
183 |
-
$version = get_option( "um_{$slug}_version" );
|
184 |
-
if ( ! $version ) {
|
185 |
-
update_option( "um_{$slug}_last_version_upgrade", $plugin_data['version'] );
|
186 |
-
}
|
187 |
-
|
188 |
-
if ( $version != $plugin_data['version'] ) {
|
189 |
-
update_option( "um_{$slug}_version", $plugin_data['version'] );
|
190 |
-
}
|
191 |
-
|
192 |
-
|
193 |
-
//start setup
|
194 |
-
UM()->extension( $slug )->setup()->start();
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
/**
|
199 |
-
* @return array
|
200 |
-
*/
|
201 |
-
function get_list() {
|
202 |
-
return $this->list;
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
function get_packages( $slug ) {
|
207 |
-
$plugin_info = $this->get_info( $slug );
|
208 |
-
$packages_dir = $plugin_info['path'] . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'packages';
|
209 |
-
|
210 |
-
$update_versions = array();
|
211 |
-
$handle = opendir( $packages_dir );
|
212 |
-
if ( $handle ) {
|
213 |
-
while ( false !== ( $filename = readdir( $handle ) ) ) {
|
214 |
-
if ( $filename != '.' && $filename != '..' ) {
|
215 |
-
if ( is_dir( $packages_dir . DIRECTORY_SEPARATOR . $filename ) ) {
|
216 |
-
$update_versions[] = $filename;
|
217 |
-
}
|
218 |
-
}
|
219 |
-
}
|
220 |
-
closedir( $handle );
|
221 |
-
|
222 |
-
usort( $update_versions, array( UM()->admin_upgrade(), 'version_compare_sort' ) );
|
223 |
-
}
|
224 |
-
|
225 |
-
return $update_versions;
|
226 |
-
}
|
227 |
-
|
228 |
-
|
229 |
-
}
|
230 |
}
|
1 |
+
<?php
|
2 |
+
namespace um;
|
3 |
+
|
4 |
+
// Exit if executed directly
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
+
|
7 |
+
|
8 |
+
if ( ! class_exists( 'um\Extensions' ) ) {
|
9 |
+
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Class Extensions
|
13 |
+
*
|
14 |
+
* @package um
|
15 |
+
*
|
16 |
+
* @method void bbpress_activation()
|
17 |
+
*/
|
18 |
+
class Extensions {
|
19 |
+
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Extensions list
|
23 |
+
*
|
24 |
+
* @var array
|
25 |
+
*/
|
26 |
+
var $list = array();
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Extensions data
|
31 |
+
*
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
var $plugin_data = array();
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Extensions constructor.
|
39 |
+
*/
|
40 |
+
function __construct() {
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/**
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
function check_dependencies() {
|
49 |
+
$extensions = $this->get_list();
|
50 |
+
|
51 |
+
foreach ( $extensions as $slug ) {
|
52 |
+
$extension = $this->get_info( $slug );
|
53 |
+
|
54 |
+
list( $run, $slug, $message ) = apply_filters_ref_array( 'um_extension_custom_dependencies', array( true, $slug, '' ) );
|
55 |
+
|
56 |
+
if ( $run ) {
|
57 |
+
$compare_version_result = UM()->dependencies()->compare_versions( $extension['min_core_version'], $extension['version'], $slug, $extension['title'] );
|
58 |
+
|
59 |
+
if ( true !== $compare_version_result ) {
|
60 |
+
UM()->notices()->add_notice( "{$slug}_dependencies", array(
|
61 |
+
'class' => 'error',
|
62 |
+
'message' => '<p>' . $compare_version_result . '</p>',
|
63 |
+
), 1 );
|
64 |
+
}
|
65 |
+
} elseif ( ! $run && ! empty( $message ) ) {
|
66 |
+
UM()->notices()->add_notice( "{$slug}_dependencies", array(
|
67 |
+
'class' => 'error',
|
68 |
+
'message' => $message,
|
69 |
+
), 1 );
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( $run ) {
|
73 |
+
UM()->call_class( "um_ext\um_{$slug}\Init" );
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @param $settings
|
81 |
+
*
|
82 |
+
* @return mixed
|
83 |
+
*/
|
84 |
+
function license_options( $settings ) {
|
85 |
+
|
86 |
+
$extensions = $this->get_list();
|
87 |
+
|
88 |
+
if ( empty( $extensions ) ) {
|
89 |
+
return $settings;
|
90 |
+
}
|
91 |
+
|
92 |
+
foreach ( $extensions as $slug ) {
|
93 |
+
$extension = $this->get_info( $slug );
|
94 |
+
|
95 |
+
if ( isset( $extension['plan'] ) && $extension['plan'] == 'free' ) {
|
96 |
+
continue;
|
97 |
+
}
|
98 |
+
|
99 |
+
$settings['licenses']['fields'][] = array(
|
100 |
+
'id' => "um_{$slug}_license_key",
|
101 |
+
'label' => sprintf( __( '%s License Key', 'ultimate-member' ), $extension['title'] ),
|
102 |
+
'item_name' => $extension['item_name'],
|
103 |
+
'author' => 'Ultimate Member',
|
104 |
+
'version' => $extension['version'],
|
105 |
+
);
|
106 |
+
}
|
107 |
+
|
108 |
+
return $settings;
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Loading Extensions localizations
|
114 |
+
*/
|
115 |
+
function localization() {
|
116 |
+
$extensions = $this->get_list();
|
117 |
+
|
118 |
+
foreach ( $extensions as $slug ) {
|
119 |
+
$extension = $this->get_info( $slug );
|
120 |
+
|
121 |
+
$locale = ( get_locale() != '' ) ? get_locale() : 'en_US';
|
122 |
+
load_textdomain( $extension['textdomain'], WP_LANG_DIR . '/plugins/' . $extension['textdomain'] . '-' . $locale . '.mo');
|
123 |
+
load_plugin_textdomain( $extension['textdomain'], false, dirname( $extension['plugin'] ) . '/languages/' );
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
/**
|
129 |
+
* @param $slug
|
130 |
+
*
|
131 |
+
* @return string
|
132 |
+
*/
|
133 |
+
function get_version( $slug ) {
|
134 |
+
|
135 |
+
$version = '';
|
136 |
+
|
137 |
+
return $version;
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
/**
|
142 |
+
* @param $slug
|
143 |
+
* @param bool $field
|
144 |
+
*
|
145 |
+
* @return array|bool
|
146 |
+
*/
|
147 |
+
function get_info( $slug, $field = false ) {
|
148 |
+
if ( ! $field ) {
|
149 |
+
return ! empty( $this->plugin_data[ $slug ] ) ? $this->plugin_data[ $slug ] : array();
|
150 |
+
} else {
|
151 |
+
return ! empty( $this->plugin_data[ $slug ][ $field ] ) ? $this->plugin_data[ $slug ][ $field ] : false;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
/**
|
157 |
+
* @param string $slug
|
158 |
+
* @param array $plugin_data
|
159 |
+
*/
|
160 |
+
function add( $slug, $plugin_data ) {
|
161 |
+
$this->list[] = $slug;
|
162 |
+
$this->plugin_data[ $slug ] = $plugin_data;
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Activate Extension Process
|
168 |
+
* Common functions in activation
|
169 |
+
*
|
170 |
+
* @param $slug
|
171 |
+
*/
|
172 |
+
function activate( $slug ) {
|
173 |
+
$plugin_data = $this->get_info( $slug );
|
174 |
+
|
175 |
+
//if extension wasn't inited, init it firstly via "um_{$slug}_add" function
|
176 |
+
//"um_{$slug}_add" must be in the preset structure of UM extension
|
177 |
+
if ( empty( $plugin_data ) && function_exists( "um_{$slug}_add" ) ) {
|
178 |
+
call_user_func( "um_{$slug}_add" );
|
179 |
+
$plugin_data = $this->get_info( $slug );
|
180 |
+
}
|
181 |
+
|
182 |
+
//first install
|
183 |
+
$version = get_option( "um_{$slug}_version" );
|
184 |
+
if ( ! $version ) {
|
185 |
+
update_option( "um_{$slug}_last_version_upgrade", $plugin_data['version'] );
|
186 |
+
}
|
187 |
+
|
188 |
+
if ( $version != $plugin_data['version'] ) {
|
189 |
+
update_option( "um_{$slug}_version", $plugin_data['version'] );
|
190 |
+
}
|
191 |
+
|
192 |
+
|
193 |
+
//start setup
|
194 |
+
UM()->extension( $slug )->setup()->start();
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
/**
|
199 |
+
* @return array
|
200 |
+
*/
|
201 |
+
function get_list() {
|
202 |
+
return $this->list;
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
function get_packages( $slug ) {
|
207 |
+
$plugin_info = $this->get_info( $slug );
|
208 |
+
$packages_dir = $plugin_info['path'] . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'packages';
|
209 |
+
|
210 |
+
$update_versions = array();
|
211 |
+
$handle = opendir( $packages_dir );
|
212 |
+
if ( $handle ) {
|
213 |
+
while ( false !== ( $filename = readdir( $handle ) ) ) {
|
214 |
+
if ( $filename != '.' && $filename != '..' ) {
|
215 |
+
if ( is_dir( $packages_dir . DIRECTORY_SEPARATOR . $filename ) ) {
|
216 |
+
$update_versions[] = $filename;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
closedir( $handle );
|
221 |
+
|
222 |
+
usort( $update_versions, array( UM()->admin_upgrade(), 'version_compare_sort' ) );
|
223 |
+
}
|
224 |
+
|
225 |
+
return $update_versions;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
}
|
230 |
}
|
languages/ultimate-member-en_US.mo
CHANGED
Binary file
|
languages/ultimate-member-en_US.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Ultimate Member\n"
|
4 |
-
"POT-Creation-Date: 2018-12-
|
5 |
-
"PO-Revision-Date: 2018-12-
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: \n"
|
8 |
"Language: en_US\n"
|
@@ -249,8 +249,16 @@ msgstr ""
|
|
249 |
msgid "Yes"
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: includes/admin/core/class-admin-enqueue.php:
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
#: includes/admin/core/class-admin-forms.php:823
|
255 |
#: includes/admin/core/class-admin-forms.php:837
|
256 |
#: includes/admin/core/class-admin-forms.php:942
|
@@ -260,13 +268,13 @@ msgstr ""
|
|
260 |
msgid "Remove"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: includes/admin/core/class-admin-enqueue.php:
|
264 |
-
#: includes/admin/core/class-admin-enqueue.php:
|
265 |
#: includes/admin/core/class-admin-forms.php:1019
|
266 |
msgid "Select"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: includes/admin/core/class-admin-enqueue.php:
|
270 |
msgid "Are sure, maybe some settings not saved"
|
271 |
msgstr ""
|
272 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Ultimate Member\n"
|
4 |
+
"POT-Creation-Date: 2018-12-09 15:45+0200\n"
|
5 |
+
"PO-Revision-Date: 2018-12-09 15:45+0200\n"
|
6 |
"Last-Translator: \n"
|
7 |
"Language-Team: \n"
|
8 |
"Language: en_US\n"
|
249 |
msgid "Yes"
|
250 |
msgstr ""
|
251 |
|
252 |
+
#: includes/admin/core/class-admin-enqueue.php:75
|
253 |
+
msgid "e.g. Member Directory"
|
254 |
+
msgstr ""
|
255 |
+
|
256 |
+
#: includes/admin/core/class-admin-enqueue.php:77
|
257 |
+
msgid "e.g. New Registration Form"
|
258 |
+
msgstr ""
|
259 |
+
|
260 |
+
#: includes/admin/core/class-admin-enqueue.php:122
|
261 |
+
#: includes/admin/core/class-admin-enqueue.php:153
|
262 |
#: includes/admin/core/class-admin-forms.php:823
|
263 |
#: includes/admin/core/class-admin-forms.php:837
|
264 |
#: includes/admin/core/class-admin-forms.php:942
|
268 |
msgid "Remove"
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: includes/admin/core/class-admin-enqueue.php:123
|
272 |
+
#: includes/admin/core/class-admin-enqueue.php:154
|
273 |
#: includes/admin/core/class-admin-forms.php:1019
|
274 |
msgid "Select"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: includes/admin/core/class-admin-enqueue.php:151
|
278 |
msgid "Are sure, maybe some settings not saved"
|
279 |
msgstr ""
|
280 |
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Donate link:
|
|
6 |
Tags: community, member, membership, user-profile, user-registration
|
7 |
Requires at least: 4.7
|
8 |
Tested up to: 5.0
|
9 |
-
Stable tag: 2.0.
|
10 |
License: GNU Version 2 or Any Later Version
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
12 |
|
@@ -137,6 +137,11 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
|
137 |
|
138 |
= Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
|
139 |
|
|
|
|
|
|
|
|
|
|
|
140 |
= 2.0.34: December 7, 2018 =
|
141 |
|
142 |
* Enhancements:
|
6 |
Tags: community, member, membership, user-profile, user-registration
|
7 |
Requires at least: 4.7
|
8 |
Tested up to: 5.0
|
9 |
+
Stable tag: 2.0.35
|
10 |
License: GNU Version 2 or Any Later Version
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
12 |
|
137 |
|
138 |
= Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
|
139 |
|
140 |
+
= 2.0.35: December 9, 2018 =
|
141 |
+
|
142 |
+
* Bugfixes:
|
143 |
+
- Fixed JS/CSS enqueue at wp-admin
|
144 |
+
|
145 |
= 2.0.34: December 7, 2018 =
|
146 |
|
147 |
* Enhancements:
|
ultimate-member.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Ultimate Member
|
4 |
Plugin URI: http://ultimatemember.com/
|
5 |
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
6 |
-
Version: 2.0.
|
7 |
Author: Ultimate Member
|
8 |
Author URI: http://ultimatemember.com/
|
9 |
Text Domain: ultimate-member
|
3 |
Plugin Name: Ultimate Member
|
4 |
Plugin URI: http://ultimatemember.com/
|
5 |
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
6 |
+
Version: 2.0.35
|
7 |
Author: Ultimate Member
|
8 |
Author URI: http://ultimatemember.com/
|
9 |
Text Domain: ultimate-member
|