Unlimited Elements For Elementor (Free Widgets, Addons, Templates) - Version 1.4.88

Version Description

Download this release

Release Info

Developer unitecms
Plugin Icon 128x128 Unlimited Elements For Elementor (Free Widgets, Addons, Templates)
Version 1.4.88
Comparing to
See all releases

Code changes from version 1.4.85 to 1.4.88

assets_libraries/filters/ue_filters.js CHANGED
@@ -5,17 +5,17 @@ function UEDynamicFilters(){
5
  var g_urlAjax, g_lastGridAjaxCall, g_cache = {};
6
 
7
  var g_types = {
8
- CHECKBOX:"checkbox",
9
  PAGINATION:"pagination",
10
- LOADMORE:"loadmore"
 
 
11
  };
12
 
13
  var g_vars = {
14
  CLASS_DIV_DEBUG:"uc-div-ajax-debug",
15
  CLASS_GRID:"uc-filterable-grid",
16
- DEBUG_AJAX_OPTIONS: false,
17
  handleTrashold:null,
18
- next_ajax_loadmore:false
19
  };
20
 
21
  var g_options = {
@@ -108,6 +108,73 @@ function UEDynamicFilters(){
108
  return(false);
109
  };
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * get closest grid to some object
113
  */
@@ -118,7 +185,7 @@ function UEDynamicFilters(){
118
  return(g_objGrid);
119
 
120
  //in case there are nothing:
121
- var objGrids = jQuery("."+ g_vars.CLASS_GRID);
122
 
123
  if(objGrids.length == 0)
124
  return(null);
@@ -127,9 +194,25 @@ function UEDynamicFilters(){
127
  var objSection = objSource.parents("section");
128
 
129
  var objGrid = objSection.find("."+ g_vars.CLASS_GRID);
130
-
131
  if(objGrid.length == 1)
132
  return(objGrid);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
  var objPrevSection = objSection;
135
  var objNextSection = objSection;
@@ -162,13 +245,61 @@ function UEDynamicFilters(){
162
  function bindFilterToGrid(objGrid, objFilter){
163
 
164
  var arrFilters = objGrid.data("filters");
 
165
 
166
  if(!arrFilters)
167
  arrFilters = [];
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  arrFilters.push(objFilter);
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  objGrid.data("filters", arrFilters);
 
172
 
173
  }
174
 
@@ -233,146 +364,50 @@ function UEDynamicFilters(){
233
  return(output);
234
  }
235
 
236
-
237
-
238
- function ________FILTERS_______________(){}
239
-
240
-
241
- /**
242
- * get filter type
243
- */
244
- function getFilterType(objFilter){
245
-
246
- if(objFilter.hasClass("uc-filter-pagination"))
247
- return(g_types.PAGINATION);
248
-
249
- if(objFilter.is(":checkbox"))
250
- return(g_types.CHECKBOX);
251
-
252
- if(objFilter.hasClass("uc-filter-load-more"))
253
- return(g_types.LOADMORE);
254
-
255
- trace(objFilter);
256
- throw new Error("wrong filter type");
257
-
258
- return(null);
259
- }
260
-
261
-
262
  /**
263
- * clear filter
264
  */
265
- function clearFilter(objFilter){
266
 
267
- var type = getFilterType(objFilter);
268
 
269
- switch(type){
270
- case g_types.CHECKBOX:
271
- objFilter.prop("checked", false);
272
- break;
 
273
  }
274
 
 
 
275
  }
276
 
 
277
 
278
- /**
279
- * clear filters
280
- */
281
- function clearFilters(checkActive){
282
-
283
- jQuery.each(g_objFilters,function(index, filter){
284
-
285
- var objFilter = jQuery(filter);
286
-
287
- if(checkActive == true){
288
-
289
- var isActive = objFilter.data("active");
290
- if(isActive == "yes")
291
- return(true);
292
- }
293
-
294
- clearFilter(objFilter);
295
-
296
- });
297
-
298
- }
299
 
300
  /**
301
- * get filter data
302
  */
303
- function getFilterData(objFilter){
304
-
305
- var objData = {};
306
-
307
- var type = getFilterType(objFilter);
308
-
309
- var type = objFilter.data("type");
310
-
311
- objData["type"] = type;
312
 
313
- switch(type){
314
- case "term":
315
- var taxonomy = objFilter.data("taxonomy");
316
- var term = objFilter.data("term");
317
 
318
- objData["taxonomy"] = taxonomy;
319
- objData["term"] = term;
320
- break;
321
- default:
322
- throw new Error("getFilterData error: wrong data type: "+type);
323
- break;
324
- }
325
 
326
- return(objData);
327
- }
328
-
329
- /**
330
- * check if the filter selected
331
- */
332
- function isFilterSelected(objFilter){
333
 
334
- var type = getFilterType(objFilter);
335
-
336
- switch(type){
337
- case g_types.CHECKBOX:
338
-
339
- var isSelected = objFilter.is(":checked");
340
-
341
- return(isSelected);
342
-
343
- break;
344
- default:
345
- throw new Error("isFilterSelected error. wrong type: "+type);
346
- break;
347
- }
348
 
 
 
349
 
350
- return(false);
351
  }
352
 
353
 
354
- /**
355
- * get all selected filters
356
- */
357
- function getSelectedFilters(){
358
-
359
- var objSelected = [];
360
-
361
- jQuery.each(g_objFilters, function(index, filter){
362
-
363
- var objFilter = jQuery(filter);
364
-
365
- var isSelected = isFilterSelected(objFilter);
366
-
367
- if(isSelected == true)
368
- objSelected.push(objFilter);
369
-
370
- });
371
-
372
-
373
- return(objSelected);
374
- }
375
-
376
 
377
  function ________PAGINATION_FILTER______(){}
378
 
@@ -418,9 +453,7 @@ function UEDynamicFilters(){
418
  throw new Error("Grid not found!");
419
 
420
  //run the ajax, prevent default
421
-
422
- g_vars.next_ajax_loadmore = false;
423
-
424
  refreshAjaxGrid(objGrid);
425
 
426
  event.preventDefault();
@@ -428,20 +461,29 @@ function UEDynamicFilters(){
428
  }
429
 
430
  function ________LOAD_MORE_______________(){}
431
-
432
 
433
  /**
434
  * get current load more page
435
  */
436
- function getLoadMorePage(objFilter){
437
 
438
  var objData = objFilter.find(".uc-filter-load-more__data");
439
 
440
  var nextPage = objData.data("nextpage");
441
  if(!nextPage)
442
- return(null);
 
 
 
 
 
 
 
 
 
443
 
444
- return(nextPage);
445
  }
446
 
447
 
@@ -465,7 +507,7 @@ function UEDynamicFilters(){
465
  * do the load more operation
466
  */
467
  function onLoadMoreClick(){
468
-
469
  var objLink = jQuery(this);
470
 
471
  var objLoadMore = objLink.parents(".uc-filter-load-more");
@@ -483,43 +525,146 @@ function UEDynamicFilters(){
483
  throw new Error("Grid not found!");
484
 
485
  //run the ajax, prevent default
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
 
487
- g_vars.next_ajax_loadmore = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
 
489
  refreshAjaxGrid(objGrid);
490
 
491
  }
492
 
493
 
 
494
 
495
 
496
- function ________DATA_______________(){}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
497
 
498
-
499
  /**
500
- * get filters data array
501
  */
502
- function getArrFilterData(){
503
 
504
- var objFilters = getSelectedFilters();
 
505
 
506
- if(objFilters.length == 0)
507
- return([]);
508
 
509
- var arrData = [];
 
510
 
511
- jQuery.each(objFilters, function(index, filter){
512
-
513
- var objFilter = jQuery(filter);
514
-
515
- var objFilterData = getFilterData(objFilter);
516
-
517
- arrData.push(objFilterData);
518
- });
519
 
520
- return(arrData);
521
  }
522
 
 
 
 
 
523
  /**
524
  * consolidate filters data
525
  */
@@ -561,93 +706,58 @@ function UEDynamicFilters(){
561
 
562
  /**
563
  * build terms query
 
564
  */
565
- function buildQuery_terms(objTax){
566
 
567
  var query = "";
568
-
569
- jQuery.each(objTax, function(taxonomy, arrTerms){
 
 
570
 
571
- var strTerms = arrTerms.join(".");
572
- if(!strTerms)
573
- return(true);
574
-
575
- //separator
576
 
577
- if(query)
578
- taxonomy += ";";
 
579
 
580
- //query
 
581
 
582
- query += taxonomy + "~" + strTerms;
583
  });
584
 
585
- return(query);
586
- }
587
-
588
-
589
- /**
590
- * build url query from the filters
591
- * example:
592
- * ucfilters=product_cat~shoes,dress;cat~123,43;
593
- */
594
- function buildUrlQuery(){
595
-
596
- var arrData = getArrFilterData();
597
-
598
- if(arrData.length == 0)
599
- return("");
600
-
601
- var queryFilters = "";
602
 
603
- var arrConsolidated = consolidateFiltersData(arrData);
 
604
 
605
- jQuery.each(arrConsolidated, function(type, objItem){
606
 
607
- switch(type){
608
- case "terms":
609
- var queryTerms = buildQuery_terms(objItem);
610
-
611
- if(queryFilters)
612
- queryFilters += ";";
613
-
614
- queryFilters += queryTerms;
615
- break;
616
  }
617
 
 
 
 
 
 
 
 
618
  });
619
 
620
- //return query
621
-
622
- var query = "ucfilters=" + queryFilters;
623
 
624
  return(query);
625
  }
626
 
627
- /**
628
- * get redirect url
629
- */
630
- function getRedirectUrl(query){
631
-
632
- if(!g_urlBase)
633
- throw new Error("getRedirectUrl error - empty url");
634
-
635
- var url = g_urlBase;
636
-
637
- if(!query)
638
- return(url);
639
-
640
- var posQ = url.indexOf("?");
641
-
642
- if(posQ == -1)
643
- url += "?";
644
- else
645
- url += "&";
646
-
647
- url += query;
648
-
649
- return(url);
650
- }
651
 
652
  function ________AJAX_CACHE_________(){}
653
 
@@ -741,7 +851,7 @@ function UEDynamicFilters(){
741
  /**
742
  * set html grid from ajax response
743
  */
744
- function operateAjax_setHtmlGrid(response, objGrid){
745
 
746
  if(objGrid.length == 0)
747
  return(false);
@@ -750,7 +860,7 @@ function UEDynamicFilters(){
750
 
751
  var htmlItems = getVal(response, "html_items");
752
 
753
- if(g_vars.next_ajax_loadmore === true){
754
 
755
  objItemsWrapper.append(htmlItems);
756
 
@@ -832,17 +942,17 @@ function UEDynamicFilters(){
832
  /**
833
  * operate the response
834
  */
835
- function operateAjaxRefreshResponse(response, objGrid, objFilters){
836
 
837
- operateAjax_setHtmlGrid(response, objGrid);
838
 
839
  operateAjax_setHtmlWidgets(response, objFilters);
840
 
841
  objGrid.trigger("uc_ajax_refreshed");
842
 
843
  //scroll to top
844
- if(g_vars.next_ajax_loadmore == false){
845
-
846
  setTimeout(function(){
847
 
848
  scrollToGridTop(objGrid);
@@ -850,10 +960,7 @@ function UEDynamicFilters(){
850
  },200);
851
 
852
  }
853
-
854
- //reset the load more setting
855
- g_vars.next_ajax_loadmore = false;
856
-
857
  }
858
 
859
 
@@ -886,6 +993,15 @@ function UEDynamicFilters(){
886
 
887
  function ________AJAX_______________(){}
888
 
 
 
 
 
 
 
 
 
 
889
  /**
890
  * show ajax error, should be something visible
891
  */
@@ -1087,7 +1203,7 @@ function UEDynamicFilters(){
1087
  * set ajax loader
1088
  */
1089
  function showAjaxLoader(objElement){
1090
-
1091
  objElement.addClass("uc-ajax-loading");
1092
  }
1093
 
@@ -1113,8 +1229,10 @@ function UEDynamicFilters(){
1113
 
1114
  jQuery.each(objElements,function(index, objElement){
1115
 
1116
- if(isShow == true)
 
1117
  showAjaxLoader(objElement);
 
1118
  else
1119
  hideAjaxLoader(objElement);
1120
  });
@@ -1125,8 +1243,8 @@ function UEDynamicFilters(){
1125
  /**
1126
  * refresh ajax grid
1127
  */
1128
- function refreshAjaxGrid(objGrid){
1129
-
1130
  //get all grid filters
1131
  var objFilters = objGrid.data("filters");
1132
 
@@ -1140,7 +1258,7 @@ function UEDynamicFilters(){
1140
 
1141
  if(!objAjaxOptions)
1142
  return(false);
1143
-
1144
  var ajaxUrl = objAjaxOptions["ajax_url"];
1145
 
1146
  if(g_vars.DEBUG_AJAX_OPTIONS == true){
@@ -1150,50 +1268,39 @@ function UEDynamicFilters(){
1150
  return(false);
1151
  }
1152
 
1153
- //do the ajax call
1154
- if(g_vars.next_ajax_loadmore == false)
1155
  showAjaxLoader(objGrid);
1156
 
1157
- showMultipleAjaxLoaders(objFilters, true);
 
 
 
 
 
1158
 
1159
  g_lastGridAjaxCall = objGrid;
1160
 
1161
  ajaxRequest(ajaxUrl,null,null, function(response){
1162
 
1163
- if(g_vars.next_ajax_loadmore == false)
1164
  hideAjaxLoader(objGrid);
1165
 
1166
  showMultipleAjaxLoaders(objFilters, false);
1167
 
1168
- operateAjaxRefreshResponse(response, objGrid, objFilters);
1169
 
1170
  });
1171
  }
1172
 
1173
 
1174
  function ________RUN_______________(){}
1175
-
1176
- /**
1177
- * on filters change - refresh the page with the new query
1178
- */
1179
- function onFiltersChange(objGrid){
1180
-
1181
- var query = buildUrlQuery();
1182
-
1183
- var url = getRedirectUrl(query);
1184
 
1185
- if(!url)
1186
- throw new error("onFiltersChange error - empty redirect url");
1187
-
1188
- location.href = url;
1189
- }
1190
-
1191
 
1192
  /**
1193
  * get grid ajax options
1194
  */
1195
  function getGridAjaxOptions(objFilters, objGrid){
1196
-
1197
  if(!objFilters)
1198
  return(false);
1199
 
@@ -1203,6 +1310,8 @@ function UEDynamicFilters(){
1203
 
1204
  var urlFiltersAddition = "";
1205
  var page = null;
 
 
1206
 
1207
  //get ajax options
1208
  jQuery.each(objFilters, function(index, objFilter){
@@ -1219,11 +1328,26 @@ function UEDynamicFilters(){
1219
  break;
1220
  case g_types.LOADMORE:
1221
 
1222
- page = getLoadMorePage(objFilter);
1223
-
 
 
1224
  if(!page)
1225
  urlAjax = null;
1226
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
1227
  default:
1228
  throw new Error("Unknown filter type: "+type);
1229
  break;
@@ -1231,13 +1355,23 @@ function UEDynamicFilters(){
1231
 
1232
  //add widget id of the filter to refresh
1233
 
1234
- var filterWidgetID = getElementWidgetID(objFilter);
 
1235
 
1236
- if(strRefreshIDs)
1237
- strRefreshIDs += ",";
 
 
 
 
 
 
 
 
 
1238
 
1239
- strRefreshIDs += filterWidgetID;
1240
- });
1241
 
1242
  if(urlAjax == null)
1243
  return(null);
@@ -1254,6 +1388,15 @@ function UEDynamicFilters(){
1254
  if(page)
1255
  urlAjax += "&ucpage="+page;
1256
 
 
 
 
 
 
 
 
 
 
1257
  //add refresh ids
1258
  if(strRefreshIDs)
1259
  urlAjax += "&addelids="+strRefreshIDs;
@@ -1269,19 +1412,6 @@ function UEDynamicFilters(){
1269
  function ________INIT_______________(){}
1270
 
1271
 
1272
-
1273
- /**
1274
- * init events
1275
- */
1276
- function initEvents(){
1277
-
1278
- var objCheckboxes = g_objFilters.filter("input[type=checkbox]");
1279
-
1280
- objCheckboxes.on("click", onFiltersChange);
1281
-
1282
- }
1283
-
1284
-
1285
  /**
1286
  * init listing object
1287
  */
@@ -1343,7 +1473,7 @@ function UEDynamicFilters(){
1343
  function initFilter(objFilter){
1344
 
1345
  var objGrid = getClosestGrid(objFilter);
1346
-
1347
  if(!objGrid)
1348
  return(null);
1349
 
@@ -1352,14 +1482,15 @@ function UEDynamicFilters(){
1352
  if(isAjax == false)
1353
  return(false);
1354
 
1355
- //bind grid to pagination
1356
  objFilter.data("grid", objGrid);
1357
 
1358
- //bind pagination to grid
1359
  bindFilterToGrid(objGrid, objFilter);
1360
 
1361
  }
1362
 
 
1363
  /**
1364
  * init filter events by types
1365
  */
@@ -1371,9 +1502,8 @@ function UEDynamicFilters(){
1371
  //init the events
1372
  var objParent = objFilters.parents(".elementor");
1373
 
1374
- for(var index in arrTypes){
1375
- var type = arrTypes[index];
1376
-
1377
  switch(type){
1378
  case g_types.PAGINATION:
1379
  objParent.on("click",".uc-filter-pagination a", onAjaxPaginationLinkClick);
@@ -1383,23 +1513,37 @@ function UEDynamicFilters(){
1383
  //load more
1384
  objParent.on("click",".uc-filter-load-more__link", onLoadMoreClick);
1385
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1386
  }
1387
  }
1388
 
1389
  }
1390
-
1391
-
1392
  /**
1393
  * init pagination filter
1394
  */
1395
  function initFilters(){
1396
-
1397
  var objFilters = jQuery(".uc-grid-filter,.uc-filter-pagination");
1398
 
1399
  if(objFilters.length == 0)
1400
  return(false);
1401
 
1402
- var arrTypes = [];
1403
 
1404
  jQuery.each(objFilters, function(index, filter){
1405
 
@@ -1408,7 +1552,8 @@ function UEDynamicFilters(){
1408
  initFilter(objFilter);
1409
 
1410
  var type = getFilterType(objFilter);
1411
- arrTypes.push(type);
 
1412
 
1413
  });
1414
 
@@ -1416,8 +1561,43 @@ function UEDynamicFilters(){
1416
 
1417
  }
1418
 
 
 
 
 
 
 
 
 
 
1419
 
1420
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1421
 
1422
 
1423
  /**
@@ -1432,14 +1612,25 @@ function UEDynamicFilters(){
1432
 
1433
  //init the grid object
1434
  initGridObject();
1435
-
1436
- initFilters();
1437
 
1438
- //initLoadmoreFilters();
1439
-
1440
- //clearFilters(true);
1441
- //initEvents();
1442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1443
  }
1444
 
1445
 
@@ -1460,5 +1651,5 @@ function UEDynamicFilters(){
1460
  construct();
1461
  }
1462
 
1463
- new UEDynamicFilters();
1464
 
5
  var g_urlAjax, g_lastGridAjaxCall, g_cache = {};
6
 
7
  var g_types = {
 
8
  PAGINATION:"pagination",
9
+ LOADMORE:"loadmore",
10
+ TERMS_LIST:"terms_list",
11
+ CHECKBOX: "checkbox"
12
  };
13
 
14
  var g_vars = {
15
  CLASS_DIV_DEBUG:"uc-div-ajax-debug",
16
  CLASS_GRID:"uc-filterable-grid",
 
17
  handleTrashold:null,
18
+ DEBUG_AJAX_OPTIONS: false
19
  };
20
 
21
  var g_options = {
108
  return(false);
109
  };
110
 
111
+ /**
112
+ * get offsets distance
113
+ */
114
+ function getOffsetsDistance(offset1, offset2){
115
+
116
+ var dx = offset2.left-offset1.left;
117
+ var dy = offset2.top-offset1.top;
118
+
119
+ return Math.sqrt(dx*dx+dy*dy);
120
+ }
121
+
122
+
123
+ /**
124
+ * get closest object by offset
125
+ */
126
+ function getClosestByOffset(objParents, objElement, isVertical){
127
+
128
+ var objClosest = null;
129
+ var minDiff = 1000000;
130
+
131
+ var elementOffset = objElement.offset();
132
+
133
+ jQuery.each(objParents, function(index, parent){
134
+
135
+ var objParent = jQuery(parent);
136
+
137
+ var distance = 0;
138
+ var parentOffset = objParent.offset();
139
+
140
+ if(isVertical == true){
141
+
142
+ var offsetY = elementOffset.top;
143
+ var parentY = parentOffset.top;
144
+
145
+ //get bottom of the parent
146
+ if(parentY < offsetY)
147
+ parentY += objParent.height();
148
+
149
+ var distance = Math.abs(offsetY - parentY);
150
+
151
+ }else{
152
+
153
+ var parentOffset = objParent.offset();
154
+
155
+ var distance = getOffsetsDistance(parentOffset, elementOffset);
156
+ }
157
+
158
+ if(distance < minDiff){
159
+ minDiff = distance;
160
+ objClosest = objParent;
161
+ }
162
+
163
+ });
164
+
165
+ return(objClosest);
166
+ }
167
+
168
+ /**
169
+ * get all grids
170
+ */
171
+ function getAllGrids(){
172
+
173
+ var objGrids = jQuery("."+ g_vars.CLASS_GRID);
174
+
175
+ return(objGrids);
176
+ }
177
+
178
  /**
179
  * get closest grid to some object
180
  */
185
  return(g_objGrid);
186
 
187
  //in case there are nothing:
188
+ var objGrids = getAllGrids();
189
 
190
  if(objGrids.length == 0)
191
  return(null);
194
  var objSection = objSource.parents("section");
195
 
196
  var objGrid = objSection.find("."+ g_vars.CLASS_GRID);
197
+
198
  if(objGrid.length == 1)
199
  return(objGrid);
200
+
201
+ //get closest by offset
202
+ var type = getFilterType(objSource);
203
+
204
+ switch(type){
205
+ case g_types.LOADMORE:
206
+ case g_types.PAGINATION:
207
+ var objSingleGrid = getClosestByOffset(objGrid, objSource, true);
208
+
209
+ return(objSingleGrid);
210
+
211
+ break;
212
+ }
213
+
214
+
215
+ //get by next or prev section
216
 
217
  var objPrevSection = objSection;
218
  var objNextSection = objSection;
245
  function bindFilterToGrid(objGrid, objFilter){
246
 
247
  var arrFilters = objGrid.data("filters");
248
+ var objTypes = objGrid.data("filter_types");
249
 
250
  if(!arrFilters)
251
  arrFilters = [];
252
 
253
+ if(!objTypes)
254
+ objTypes = {};
255
+
256
+ var type = getFilterType(objFilter);
257
+
258
+ //validate double types
259
+
260
+ if(objTypes.hasOwnProperty(type)){
261
+
262
+ switch(type){
263
+ case g_types.LOADMORE:
264
+
265
+ trace("Double filter not allowed");
266
+ trace("existing Filters:");
267
+ trace(arrFilters);
268
+
269
+ trace("Second Filter");
270
+ trace(objFilter);
271
+
272
+ trace("Grid:");
273
+ trace(objGrid);
274
+
275
+ showElementError(objFilter, "Double load more button for one grid not allowed")
276
+ return(false);
277
+ break;
278
+ }
279
+
280
+ }
281
+
282
+ objTypes[type] = true;
283
+
284
  arrFilters.push(objFilter);
285
 
286
+ //add init after filters
287
+ var isInitAfter = objFilter.data("initafter");
288
+
289
+ if(isInitAfter === true){
290
+
291
+ var arrFiltersInitAfter = objGrid.data("filters_init_after");
292
+
293
+ if(!arrFiltersInitAfter)
294
+ arrFiltersInitAfter = [];
295
+
296
+ arrFiltersInitAfter.push(objFilter);
297
+
298
+ objGrid.data("filters_init_after", arrFiltersInitAfter);
299
+ }
300
+
301
  objGrid.data("filters", arrFilters);
302
+ objGrid.data("filter_types", objTypes);
303
 
304
  }
305
 
364
  return(output);
365
  }
366
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
  /**
368
+ * show element error above it
369
  */
370
+ function showElementError(objElement, error){
371
 
372
+ var objParent = objElement.parent();
373
 
374
+ var objError = objParent.find(".uc-filers-error-message");
375
+ if(objError.length == 0){
376
+ objParent.append("<div class='uc-filers-error-message' style='color:red;position:absolute;top:-24px;left:0px;'></div>");
377
+ var objError = objParent.find(".uc-filers-error-message");
378
+ objParent.css("border","1px solid red !important");
379
  }
380
 
381
+ objError.append(error);
382
+
383
  }
384
 
385
+ function ________FILTERS_______________(){}
386
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
 
388
  /**
389
+ * get filter type
390
  */
391
+ function getFilterType(objFilter){
 
 
 
 
 
 
 
 
392
 
393
+ if(objFilter.hasClass("uc-filter-pagination"))
394
+ return(g_types.PAGINATION);
 
 
395
 
396
+ if(objFilter.hasClass("uc-filter-load-more"))
397
+ return(g_types.LOADMORE);
 
 
 
 
 
398
 
399
+ var filterType = objFilter.data("filtertype")
 
 
 
 
 
 
400
 
401
+ if(filterType)
402
+ return(filterType);
 
 
 
 
 
 
 
 
 
 
 
 
403
 
404
+ trace(objFilter);
405
+ throw new Error("wrong filter type");
406
 
407
+ return(null);
408
  }
409
 
410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
 
412
  function ________PAGINATION_FILTER______(){}
413
 
453
  throw new Error("Grid not found!");
454
 
455
  //run the ajax, prevent default
456
+
 
 
457
  refreshAjaxGrid(objGrid);
458
 
459
  event.preventDefault();
461
  }
462
 
463
  function ________LOAD_MORE_______________(){}
464
+
465
 
466
  /**
467
  * get current load more page
468
  */
469
+ function getLoadMoreUrlData(objFilter){
470
 
471
  var objData = objFilter.find(".uc-filter-load-more__data");
472
 
473
  var nextPage = objData.data("nextpage");
474
  if(!nextPage)
475
+ nextPage = null;
476
+
477
+ var numItems = objFilter.data("numitems");
478
+
479
+ if(!numItems)
480
+ numItems = null;
481
+
482
+ var data = {};
483
+ data.page = nextPage;
484
+ data.numItems = numItems;
485
 
486
+ return(data);
487
  }
488
 
489
 
507
  * do the load more operation
508
  */
509
  function onLoadMoreClick(){
510
+
511
  var objLink = jQuery(this);
512
 
513
  var objLoadMore = objLink.parents(".uc-filter-load-more");
525
  throw new Error("Grid not found!");
526
 
527
  //run the ajax, prevent default
528
+
529
+ refreshAjaxGrid(objGrid, true);
530
+
531
+ }
532
+
533
+ function ________CHECKBOX_______________(){}
534
+
535
+ /**
536
+ * init checkbox filter - uncheck all checkboxes if checked by cache
537
+ */
538
+ function initCheckboxFilter(){
539
+
540
+ var objChecks = jQuery(".ue-filter-checkbox__check");
541
+
542
+ objChecks.each(function(index, check){
543
+
544
+ var objCheck = jQuery(check);
545
+
546
+ var hasAttr = objCheck.attr("checked");
547
+
548
+ if(!hasAttr)
549
+ objCheck.prop("checked",false);
550
+
551
+ });
552
+
553
+ }
554
+
555
+
556
+ /**
557
+ * add checkbox terms to terms list
558
+ */
559
+ function addCheckboxTerms(objFilter, arrTerms){
560
+
561
+ var objChecks = jQuery(".ue-filter-checkbox__check");
562
+
563
+ jQuery.each(objChecks, function(index, check){
564
+
565
+ var objCheck = jQuery(check);
566
+
567
+ var isChecked = objCheck.is(":checked");
568
+
569
+ if(isChecked == false)
570
+ return(true);
571
+
572
+ var slug = objCheck.data("slug");
573
+ var taxonomy = objCheck.data("taxonomy");
574
+
575
+ var objTerm = {
576
+ "slug": slug,
577
+ "taxonomy": taxonomy
578
+ };
579
+
580
+ arrTerms.push(objTerm);
581
+
582
+ });
583
 
584
+ return(arrTerms);
585
+ }
586
+
587
+
588
+ /**
589
+ * on checkbox change
590
+ */
591
+ function onCheckboxChange(){
592
+
593
+ var objLink = jQuery(this);
594
+ var objCheckboxFilter = objLink.parents(".uc-grid-filter");
595
+ setNoRefreshFilter(objCheckboxFilter);
596
+
597
+ //refresh grid
598
+ var objGrid = objCheckboxFilter.data("grid");
599
 
600
  refreshAjaxGrid(objGrid);
601
 
602
  }
603
 
604
 
605
+ function ________TERMS_LIST_______________(){}
606
 
607
 
608
+ /**
609
+ * on terms list click
610
+ */
611
+ function onTermsLinkClick(event){
612
+
613
+ var className = "uc-selected";
614
+
615
+ event.preventDefault();
616
+
617
+ var objLink = jQuery(this);
618
+
619
+ var objTermsFilter = objLink.parents(".uc-grid-filter");
620
+
621
+ //set not refresh next iteration, because of the clicked
622
+ setNoRefreshFilter(objTermsFilter);
623
+
624
+ var objActiveLinks = objLink.siblings("."+className).not(objLink);
625
+
626
+ objActiveLinks.removeClass(className);
627
+ objLink.addClass(className);
628
+
629
+ var objGrid = objTermsFilter.data("grid");
630
+
631
+ if(!objGrid || objGrid.length == 0)
632
+ throw new Error("Grid not found");
633
+
634
+ //refresh grid
635
+ refreshAjaxGrid(objGrid);
636
+
637
+ }
638
+
639
 
 
640
  /**
641
+ * get terms list term id
642
  */
643
+ function getTermsListSelectedTerm(objFilter){
644
 
645
+ if(!objFilter)
646
+ return(null);
647
 
648
+ var objSelected = objFilter.find(".uc-selected");
 
649
 
650
+ if(objSelected.length == 0)
651
+ return(null);
652
 
653
+ var slug = objSelected.data("slug");
654
+ var taxonomy = objSelected.data("taxonomy");
655
+
656
+ var objTerm = {
657
+ "slug": slug,
658
+ "taxonomy": taxonomy
659
+ };
 
660
 
661
+ return(objTerm);
662
  }
663
 
664
+
665
+ function ________DATA_______________(){}
666
+
667
+
668
  /**
669
  * consolidate filters data
670
  */
706
 
707
  /**
708
  * build terms query
709
+ * ucterms=product_cat~shoes.dress;cat~123.43;
710
  */
711
+ function buildTermsQuery(arrTerms){
712
 
713
  var query = "";
714
+
715
+ //break by taxonomy
716
+ var arrTax = {};
717
+ jQuery.each(arrTerms, function(index, objTerm){
718
 
719
+ var taxonomy = objTerm["taxonomy"];
720
+ var slug = objTerm["slug"];
 
 
 
721
 
722
+ var objTax = getVal(arrTax, taxonomy);
723
+ if(!objTax)
724
+ objTax = {};
725
 
726
+ objTax[slug] = true;
727
+ arrTax[taxonomy] = objTax;
728
 
 
729
  });
730
 
731
+ //combine the query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
 
733
+ if(!arrTax)
734
+ return(null);
735
 
736
+ jQuery.each(arrTax,function(taxonomy,objSlugs){
737
 
738
+ var strSlugs = "";
739
+
740
+ for (var slug in objSlugs){
741
+
742
+ if(strSlugs)
743
+ strSlugs += ".";
744
+
745
+ strSlugs += slug;
 
746
  }
747
 
748
+ var strTax = taxonomy+"~"+strSlugs;
749
+
750
+ if(query)
751
+ query += ";";
752
+
753
+ query += strTax;
754
+
755
  });
756
 
 
 
 
757
 
758
  return(query);
759
  }
760
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761
 
762
  function ________AJAX_CACHE_________(){}
763
 
851
  /**
852
  * set html grid from ajax response
853
  */
854
+ function operateAjax_setHtmlGrid(response, objGrid, isLoadMore){
855
 
856
  if(objGrid.length == 0)
857
  return(false);
860
 
861
  var htmlItems = getVal(response, "html_items");
862
 
863
+ if(isLoadMore === true){
864
 
865
  objItemsWrapper.append(htmlItems);
866
 
942
  /**
943
  * operate the response
944
  */
945
+ function operateAjaxRefreshResponse(response, objGrid, objFilters, isLoadMore){
946
 
947
+ operateAjax_setHtmlGrid(response, objGrid, isLoadMore);
948
 
949
  operateAjax_setHtmlWidgets(response, objFilters);
950
 
951
  objGrid.trigger("uc_ajax_refreshed");
952
 
953
  //scroll to top
954
+ if(isLoadMore == false){
955
+
956
  setTimeout(function(){
957
 
958
  scrollToGridTop(objGrid);
960
  },200);
961
 
962
  }
963
+
 
 
 
964
  }
965
 
966
 
993
 
994
  function ________AJAX_______________(){}
995
 
996
+ /**
997
+ * set this filter not to refresh next time
998
+ */
999
+ function setNoRefreshFilter(objFilter){
1000
+
1001
+ objFilter.data("uc_norefresh",true);
1002
+
1003
+ }
1004
+
1005
  /**
1006
  * show ajax error, should be something visible
1007
  */
1203
  * set ajax loader
1204
  */
1205
  function showAjaxLoader(objElement){
1206
+
1207
  objElement.addClass("uc-ajax-loading");
1208
  }
1209
 
1229
 
1230
  jQuery.each(objElements,function(index, objElement){
1231
 
1232
+ if(isShow == true){
1233
+
1234
  showAjaxLoader(objElement);
1235
+ }
1236
  else
1237
  hideAjaxLoader(objElement);
1238
  });
1243
  /**
1244
  * refresh ajax grid
1245
  */
1246
+ function refreshAjaxGrid(objGrid, isLoadMore){
1247
+
1248
  //get all grid filters
1249
  var objFilters = objGrid.data("filters");
1250
 
1258
 
1259
  if(!objAjaxOptions)
1260
  return(false);
1261
+
1262
  var ajaxUrl = objAjaxOptions["ajax_url"];
1263
 
1264
  if(g_vars.DEBUG_AJAX_OPTIONS == true){
1268
  return(false);
1269
  }
1270
 
1271
+ if(isLoadMore !== true)
 
1272
  showAjaxLoader(objGrid);
1273
 
1274
+ var objFiltersToReload = objFilters.filter(function(objFilter){
1275
+
1276
+ return objFilter.hasClass("uc-ajax-refresh-soon");
1277
+ });
1278
+
1279
+ showMultipleAjaxLoaders(objFiltersToReload, true);
1280
 
1281
  g_lastGridAjaxCall = objGrid;
1282
 
1283
  ajaxRequest(ajaxUrl,null,null, function(response){
1284
 
1285
+ if(isLoadMore !== true)
1286
  hideAjaxLoader(objGrid);
1287
 
1288
  showMultipleAjaxLoaders(objFilters, false);
1289
 
1290
+ operateAjaxRefreshResponse(response, objGrid, objFilters, isLoadMore);
1291
 
1292
  });
1293
  }
1294
 
1295
 
1296
  function ________RUN_______________(){}
 
 
 
 
 
 
 
 
 
1297
 
 
 
 
 
 
 
1298
 
1299
  /**
1300
  * get grid ajax options
1301
  */
1302
  function getGridAjaxOptions(objFilters, objGrid){
1303
+
1304
  if(!objFilters)
1305
  return(false);
1306
 
1310
 
1311
  var urlFiltersAddition = "";
1312
  var page = null;
1313
+ var numItems = null;
1314
+ var arrTerms = [];
1315
 
1316
  //get ajax options
1317
  jQuery.each(objFilters, function(index, objFilter){
1328
  break;
1329
  case g_types.LOADMORE:
1330
 
1331
+ var loadMoreData = getLoadMoreUrlData(objFilter);
1332
+ page = loadMoreData.page;
1333
+ numItems = loadMoreData.numItems;
1334
+
1335
  if(!page)
1336
  urlAjax = null;
1337
  break;
1338
+ case g_types.TERMS_LIST:
1339
+
1340
+ var objTerm = getTermsListSelectedTerm(objFilter);
1341
+
1342
+ if(objTerm)
1343
+ arrTerms.push(objTerm);
1344
+
1345
+ break;
1346
+ case g_types.CHECKBOX:
1347
+
1348
+ arrTerms = addCheckboxTerms(objFilter, arrTerms);
1349
+
1350
+ break;
1351
  default:
1352
  throw new Error("Unknown filter type: "+type);
1353
  break;
1355
 
1356
  //add widget id of the filter to refresh
1357
 
1358
+ var isNoRefresh = objFilter.data("uc_norefresh");
1359
+ objFilter.data("uc_norefresh",false);
1360
 
1361
+ if(isNoRefresh !== true){
1362
+ var filterWidgetID = getElementWidgetID(objFilter);
1363
+
1364
+ if(strRefreshIDs)
1365
+ strRefreshIDs += ",";
1366
+
1367
+ strRefreshIDs += filterWidgetID;
1368
+
1369
+ objFilter.addClass("uc-ajax-refresh-soon");
1370
+
1371
+ }
1372
 
1373
+
1374
+ }); //end filters iteration
1375
 
1376
  if(urlAjax == null)
1377
  return(null);
1388
  if(page)
1389
  urlAjax += "&ucpage="+page;
1390
 
1391
+ if(numItems)
1392
+ urlAjax += "&uccount="+numItems;
1393
+
1394
+ if(arrTerms.length){
1395
+ var strTerms = buildTermsQuery(arrTerms);
1396
+ if(strTerms)
1397
+ urlAjax += "&ucterms="+strTerms;
1398
+ }
1399
+
1400
  //add refresh ids
1401
  if(strRefreshIDs)
1402
  urlAjax += "&addelids="+strRefreshIDs;
1412
  function ________INIT_______________(){}
1413
 
1414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1415
  /**
1416
  * init listing object
1417
  */
1473
  function initFilter(objFilter){
1474
 
1475
  var objGrid = getClosestGrid(objFilter);
1476
+
1477
  if(!objGrid)
1478
  return(null);
1479
 
1482
  if(isAjax == false)
1483
  return(false);
1484
 
1485
+ //bind grid to filter
1486
  objFilter.data("grid", objGrid);
1487
 
1488
+ //bind filter to grid
1489
  bindFilterToGrid(objGrid, objFilter);
1490
 
1491
  }
1492
 
1493
+
1494
  /**
1495
  * init filter events by types
1496
  */
1502
  //init the events
1503
  var objParent = objFilters.parents(".elementor");
1504
 
1505
+ for(var type in arrTypes){
1506
+
 
1507
  switch(type){
1508
  case g_types.PAGINATION:
1509
  objParent.on("click",".uc-filter-pagination a", onAjaxPaginationLinkClick);
1513
  //load more
1514
  objParent.on("click",".uc-filter-load-more__link", onLoadMoreClick);
1515
  break;
1516
+ case g_types.TERMS_LIST:
1517
+
1518
+ objParent.on("click",".ue_taxonomy a.ue_taxonomy_item", onTermsLinkClick);
1519
+
1520
+ break;
1521
+ case g_types.CHECKBOX:
1522
+
1523
+ initCheckboxFilter();
1524
+
1525
+ objParent.on("change",".ue-filter-checkbox__check", onCheckboxChange);
1526
+
1527
+ break;
1528
+ default:
1529
+ trace("init by type - unrecognized type: "+type);
1530
+ break;
1531
  }
1532
  }
1533
 
1534
  }
1535
+
 
1536
  /**
1537
  * init pagination filter
1538
  */
1539
  function initFilters(){
1540
+
1541
  var objFilters = jQuery(".uc-grid-filter,.uc-filter-pagination");
1542
 
1543
  if(objFilters.length == 0)
1544
  return(false);
1545
 
1546
+ var arrTypes = {};
1547
 
1548
  jQuery.each(objFilters, function(index, filter){
1549
 
1552
  initFilter(objFilter);
1553
 
1554
  var type = getFilterType(objFilter);
1555
+
1556
+ arrTypes[type] = true;
1557
 
1558
  });
1559
 
1561
 
1562
  }
1563
 
1564
+ /**
1565
+ * ajax init grid filters
1566
+ */
1567
+ function ajaxInitGridFilters(objGrid){
1568
+
1569
+ trace("ajax init");
1570
+
1571
+
1572
+ }
1573
 
1574
+ /**
1575
+ * check and call ajax init filters
1576
+ */
1577
+ function ajaxInitFilters(){
1578
+
1579
+ var objGrids = getAllGrids();
1580
+
1581
+ if(objGrids.length == 0)
1582
+ return(false);
1583
+
1584
+ jQuery.each(objGrids, function(index, grid){
1585
+
1586
+ var objGrid = jQuery(grid);
1587
+
1588
+ var objInitFilters = objGrid.data("ajax_init_filters");
1589
+
1590
+ /*
1591
+ trace("check for init after");
1592
+ trace(objInitFilters);
1593
+ */
1594
+
1595
+ //ajaxInitGridFilters(objGrid);
1596
+
1597
+ });
1598
+
1599
+
1600
+ }
1601
 
1602
 
1603
  /**
1612
 
1613
  //init the grid object
1614
  initGridObject();
 
 
1615
 
1616
+ initFilters();
 
 
 
1617
 
1618
+ //ajaxInitFilters();
1619
+
1620
+ }
1621
+
1622
+ /**
1623
+ * is element in viewport
1624
+ */
1625
+ this.isElementInViewport = function(objElement) {
1626
+
1627
+ var elementTop = objElement.offset().top;
1628
+ var elementBottom = elementTop + objElement.outerHeight();
1629
+
1630
+ var viewportTop = jQuery(window).scrollTop();
1631
+ var viewportBottom = viewportTop + jQuery(window).height();
1632
+
1633
+ return (elementBottom > viewportTop && elementTop < viewportBottom);
1634
  }
1635
 
1636
 
1651
  construct();
1652
  }
1653
 
1654
+ g_ucDynamicFilters = new UEDynamicFilters();
1655
 
assets_libraries/remote/ue-remote-controls.js CHANGED
@@ -156,6 +156,16 @@ function UERemoteCarouselAPI(){
156
  throw new Error("The owl carousel API is not inited");
157
  }
158
 
 
 
 
 
 
 
 
 
 
 
159
  /**
160
  do some action
161
  */
@@ -194,15 +204,11 @@ function UERemoteCarouselAPI(){
194
  return(false);
195
 
196
  break;
197
- case "change_item":
198
 
199
- g_owlCarousel.trigger('to.owl.carousel', [arg1, null, true]);
200
 
201
- break;
202
- case "get_total_items":
203
-
204
- var owlTotalItems = g_owlCarousel.find(".owl-item:not(.cloned)").length;
205
- return(owlTotalItems);
206
 
207
  break;
208
  case "get_progress_time":
@@ -218,7 +224,7 @@ function UERemoteCarouselAPI(){
218
 
219
  break;
220
  case 'get_num_current':
221
-
222
  var currentItem = g_owl.relative(g_owl.current());
223
 
224
  return(currentItem);
@@ -241,18 +247,19 @@ function UERemoteCarouselAPI(){
241
  return(owlCurrentItem);
242
 
243
  break;
244
- case 'set_slide':
245
 
246
- var owlTotalItems = g_owlCarousel.find(".owl-item:not(.cloned)").length;
 
247
 
248
- if (arg1 >= owlTotalItems){
249
- g_owlCarousel.trigger('to.owl.carousel', [owlTotalItems - 1, 500, true]);
250
- } else if (arg1 < 0){
251
- g_owlCarousel.trigger('to.owl.carousel', [0, 500, true]);
252
- } else {
253
- g_owlCarousel.trigger('to.owl.carousel', [arg1, 500, true]);
254
- }
255
-
256
  break;
257
  default:
258
  throw new Error("Carousel API: Wrong action: "+action);
@@ -284,12 +291,12 @@ function UERemoteCarouselAPI(){
284
  g_owlCarousel.on("changed.owl.carousel", func);
285
 
286
  break;
287
- case "translate":
288
 
289
  g_owlCarousel.on("translate.owl.carousel", func);
290
 
291
  break;
292
- case "translated":
293
 
294
  g_owlCarousel.on("translated.owl.carousel", func);
295
 
156
  throw new Error("The owl carousel API is not inited");
157
  }
158
 
159
+ /**
160
+ * get total items
161
+ */
162
+ function getTotalItems(){
163
+
164
+ var total = g_owlCarousel.find(".owl-item:not(.cloned)").length;
165
+
166
+ return(total);
167
+ }
168
+
169
  /**
170
  do some action
171
  */
204
  return(false);
205
 
206
  break;
207
+ case "get_total_items":
208
 
209
+ var total = getTotalItems()
210
 
211
+ return(total);
 
 
 
 
212
 
213
  break;
214
  case "get_progress_time":
224
 
225
  break;
226
  case 'get_num_current':
227
+
228
  var currentItem = g_owl.relative(g_owl.current());
229
 
230
  return(currentItem);
247
  return(owlCurrentItem);
248
 
249
  break;
250
+ case 'change_item':
251
 
252
+ var total = getTotalItems()
253
+ var slideNum = arg1;
254
 
255
+ if(slideNum >= total)
256
+ slideNum = (total-1);
257
+ else
258
+ if(slideNum < 0)
259
+ slideNum = 0;
260
+
261
+ g_owlCarousel.trigger('to.owl.carousel', [slideNum, null, true]);
262
+
263
  break;
264
  default:
265
  throw new Error("Carousel API: Wrong action: "+action);
291
  g_owlCarousel.on("changed.owl.carousel", func);
292
 
293
  break;
294
+ case "transition_start":
295
 
296
  g_owlCarousel.on("translate.owl.carousel", func);
297
 
298
  break;
299
+ case "transition_end":
300
 
301
  g_owlCarousel.on("translated.owl.carousel", func);
302
 
css/unitecreator_styles.css CHANGED
@@ -1017,7 +1017,7 @@
1017
  display:none;
1018
  }
1019
 
1020
- .uc-dialog-param .uc-dialog-conditions-empty{
1021
 
1022
  color:#AE3232; /* red */
1023
  display:none;
1017
  display:none;
1018
  }
1019
 
1020
+ .uc-dialog-conditions-empty{
1021
 
1022
  color:#AE3232; /* red */
1023
  display:none;
inc_php/framework/zip.class.php CHANGED
@@ -158,7 +158,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
158
  * write some file
159
  */
160
  protected function writeFile($str, $filepath){
161
-
162
  //create folder if not exists
163
  $this->checkCreateDir($filepath);
164
 
@@ -228,17 +228,34 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
228
  protected function extract_zipArchive($src, $dest){
229
 
230
  $zip = new ZipArchive();
231
- if ($zip->open($src)===true){
232
- $extracted = @$zip->extractTo($dest);
233
- $zip->close();
234
 
235
- if($extracted == false)
236
- return(false);
237
-
238
- return true;
 
 
 
 
 
 
 
 
239
  }
240
- return false;
 
 
 
 
 
 
 
 
241
  }
 
242
 
243
  private function a_MAKEZIP_CUSTOM(){}
244
 
@@ -554,7 +571,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
554
  @set_time_limit(ini_get('max_execution_time'));
555
  }
556
  while ((($fhStart = strpos($data, $this->_ctrlDirHeader, $fhStart + 46)) !== false));
557
-
558
  $this->_metadata = array_values($entries);
559
 
560
  return true;
@@ -594,7 +611,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
594
  */
595
  protected function extract_custom($src, $dest){
596
 
597
-
598
  $this->_data = null;
599
  $this->_metadata = null;
600
 
@@ -608,7 +624,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
608
  $success = $this->extract_custom_readZipInfo($this->_data);
609
  if(!$success)
610
  UniteFunctionsUC::throwError('Get ZIP Information failed');
611
-
612
 
613
  for ($i = 0, $n = count($this->_metadata); $i < $n; $i++)
614
  {
@@ -637,11 +653,15 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
637
  * Extract zip archive
638
  */
639
  public function extract($src, $dest){
640
-
641
  if($this->isZipArchiveExists() == true){ //zipArchive
642
- $success = $this->extract_zipArchive($src, $dest);
643
- if($success == true)
644
- return(true);
 
 
 
 
645
  }
646
 
647
  if($this->isNativeSupportExists() == true){ //native
158
  * write some file
159
  */
160
  protected function writeFile($str, $filepath){
161
+
162
  //create folder if not exists
163
  $this->checkCreateDir($filepath);
164
 
228
  protected function extract_zipArchive($src, $dest){
229
 
230
  $zip = new ZipArchive();
231
+
232
+ $result = $zip->open($src);
233
+ if($result !== true){
234
 
235
+ switch ($result) {
236
+ case ZipArchive::ER_NOZIP:
237
+ UniteFunctionsCDCP::throwError('not a zip archive');
238
+ case ZipArchive::ER_INCONS :
239
+ UniteFunctionsCDCP::throwError('consistency check failed');
240
+ case ZipArchive::ER_CRC :
241
+ UniteFunctionsCDCP::throwError('checksum failed');
242
+ default:
243
+ UniteFunctionsCDCP::throwError('error ' . $result);
244
+ }
245
+
246
+ return(false);
247
  }
248
+
249
+
250
+ $extracted = @$zip->extractTo($dest);
251
+ $zip->close();
252
+
253
+ if($extracted == false)
254
+ return(false);
255
+
256
+ return(true);
257
  }
258
+
259
 
260
  private function a_MAKEZIP_CUSTOM(){}
261
 
571
  @set_time_limit(ini_get('max_execution_time'));
572
  }
573
  while ((($fhStart = strpos($data, $this->_ctrlDirHeader, $fhStart + 46)) !== false));
574
+
575
  $this->_metadata = array_values($entries);
576
 
577
  return true;
611
  */
612
  protected function extract_custom($src, $dest){
613
 
 
614
  $this->_data = null;
615
  $this->_metadata = null;
616
 
624
  $success = $this->extract_custom_readZipInfo($this->_data);
625
  if(!$success)
626
  UniteFunctionsUC::throwError('Get ZIP Information failed');
627
+
628
 
629
  for ($i = 0, $n = count($this->_metadata); $i < $n; $i++)
630
  {
653
  * Extract zip archive
654
  */
655
  public function extract($src, $dest){
656
+
657
  if($this->isZipArchiveExists() == true){ //zipArchive
658
+
659
+ $success = $this->extract_zipArchive($src, $dest);
660
+
661
+ if($success == false){
662
+ UniteFunctionsCDCP::throwError("Can't extract zip");
663
+ }
664
+
665
  }
666
 
667
  if($this->isNativeSupportExists() == true){ //native
inc_php/unitecreator_dialog_param.class.php CHANGED
@@ -516,34 +516,10 @@ class UniteCreatorDialogParamWork{
516
  /**
517
  * put radio boolean param
518
  */
519
- private function putRadioBooleanParam(){
520
- ?>
521
- <table data-inputtype="radio_boolean" class='uc-table-dropdown-items uc-table-dropdown-full'>
522
- <thead>
523
- <tr>
524
- <th width="100px"><?php esc_html_e("Item Text", "unlimited-elements-for-elementor")?></th>
525
- <th width="100px"><?php esc_html_e("Item Value", "unlimited-elements-for-elementor")?></th>
526
- </tr>
527
- </thead>
528
- <tbody>
529
- <tr>
530
- <td><input type="text" name="true_name" value="Yes" data-initval="Yes" class='uc-dropdown-item-name'></td>
531
- <td><input type="text" name="true_value" value="true" data-initval="true" class='uc-dropdown-item-value'></td>
532
- <td>
533
- <div class='uc-dropdown-icon uc-dropdown-item-default uc-selected' title="<?php esc_html_e("Default Item", "unlimited-elements-for-elementor")?>"></div>
534
- </td>
535
- </tr>
536
- <tr>
537
- <td><input type="text" name="false_name" value="No" data-initval="No" class='uc-dropdown-item-name'></td>
538
- <td><input type="text" name="false_value" value="false" data-initval="false" class='uc-dropdown-item-value'></td>
539
- <td>
540
- <div class='uc-dropdown-icon uc-dropdown-item-default' title="<?php esc_html_e("Default Item", "unlimited-elements-for-elementor")?>"></div>
541
- </td>
542
- </tr>
543
-
544
- </tbody>
545
- </table>
546
- <?php
547
  }
548
 
549
 
@@ -773,6 +749,12 @@ class UniteCreatorDialogParamWork{
773
 
774
  esc_html_e("Post terms are post categories / tags and other custom types. Also called as taxonomies ", "unlimited-elements-for-elementor");
775
 
 
 
 
 
 
 
776
  ?>
777
  <br>
778
  <br>
@@ -788,6 +770,13 @@ class UniteCreatorDialogParamWork{
788
  $this->putCheckbox("for_woocommerce", __("For WooCommerce Terms", "unlimited-elements-for-elementor"));
789
  ?>
790
 
 
 
 
 
 
 
 
791
  <br><br>
792
 
793
  <hr>
@@ -1565,9 +1554,8 @@ class UniteCreatorDialogParamWork{
1565
  * put condition
1566
  */
1567
  private function putHtmlConditionLeft(){
1568
-
1569
- HelperHtmlUC::putHtmlConditions($this->type);
1570
-
1571
  }
1572
 
1573
 
516
  /**
517
  * put radio boolean param
518
  */
519
+ protected function putRadioBooleanParam(){
520
+
521
+ dmp("function for override");
522
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  }
524
 
525
 
749
 
750
  esc_html_e("Post terms are post categories / tags and other custom types. Also called as taxonomies ", "unlimited-elements-for-elementor");
751
 
752
+ $arrFilterType = array();
753
+ $arrFilterType["none"] = __("No","unlimited-elements-for-elementor");
754
+ $arrFilterType["filter_option"] = __("Has Filter Option","unlimited-elements-for-elementor");
755
+
756
+ $selectFilter = HelperHtmlUC::getHTMLSelect($arrFilterType,"none","name='filter_type'", true);
757
+
758
  ?>
759
  <br>
760
  <br>
770
  $this->putCheckbox("for_woocommerce", __("For WooCommerce Terms", "unlimited-elements-for-elementor"));
771
  ?>
772
 
773
+ <div class="vert_sap20"></div>
774
+
775
+ <label class="unite-inputs-label-inline-free">
776
+ <?php _e("Posts Filter Options")?> :
777
+ </label>
778
+ <?php echo $selectFilter?>
779
+
780
  <br><br>
781
 
782
  <hr>
1554
  * put condition
1555
  */
1556
  private function putHtmlConditionLeft(){
1557
+
1558
+ HelperHtmlUC::putHtmlConditions($this->type);
 
1559
  }
1560
 
1561
 
inc_php/unitecreator_filters_process.class.php CHANGED
@@ -10,6 +10,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
10
  class UniteCreatorFiltersProcess{
11
 
12
  const DEBUG_MAIN_QUERY = false;
 
13
 
14
  private static $filters = null;
15
  private static $arrInputFiltersCache = null;
@@ -19,6 +20,7 @@ class UniteCreatorFiltersProcess{
19
  private static $isScriptAdded = false;
20
  private static $isFilesAdded = false;
21
  private static $isStyleAdded = false;
 
22
 
23
  private static $showDebug = false;
24
  private static $originalQueryVars = null;
@@ -64,7 +66,7 @@ class UniteCreatorFiltersProcess{
64
  /**
65
  * parse filters string
66
  */
67
- private function parseStrFilters($strFilters){
68
 
69
  $strFilters = trim($strFilters);
70
 
@@ -114,25 +116,35 @@ class UniteCreatorFiltersProcess{
114
 
115
  $request = $this->getArrRequest();
116
 
117
- $strFilters = UniteFunctionsUC::getVal($request, "ucfilters");
118
-
119
  $arrOutput = array();
120
 
121
  //parse filters
122
 
123
- if(!empty($strFilters)){
124
  if(self::$showDebug == true)
125
- dmp("input filters found: $strFilters");
126
 
127
- $arrOutput = $this->parseStrFilters($strFilters);
128
  }
129
-
 
 
130
  $page = UniteFunctionsUC::getVal($request, "ucpage");
131
  $page = (int)$page;
132
 
133
  if(!empty($page))
134
  $arrOutput["page"] = $page;
135
 
 
 
 
 
 
 
 
 
136
  self::$arrInputFiltersCache = $arrOutput;
137
 
138
  return($arrOutput);
@@ -148,7 +160,7 @@ class UniteCreatorFiltersProcess{
148
  return(self::$arrFiltersAssocCache);
149
 
150
  $arrFilters = $this->getArrInputFilters();
151
-
152
  $output = array();
153
 
154
  $terms = UniteFunctionsUC::getVal($arrFilters, "terms");
@@ -177,25 +189,25 @@ class UniteCreatorFiltersProcess{
177
  * get filters arguments
178
  */
179
  public function getRequestFilters(){
180
-
181
  if(self::$filters !== null)
182
  return(self::$filters);
183
 
184
  self::$filters = array();
185
 
186
  $arrInputFilters = $this->getArrInputFilters();
187
-
188
 
189
  if(empty($arrInputFilters))
190
  return(self::$filters);
191
 
192
  $arrTerms = UniteFunctionsUC::getVal($arrInputFilters, self::TYPE_TERMS);
193
 
194
- if(empty($arrTerms))
195
- $arrTerms = array();
196
-
197
  //collect term filters
198
-
 
199
  $arrFilterTerms = array();
200
 
201
  foreach($arrTerms as $taxonomy=>$arrTerms){
@@ -207,7 +219,7 @@ class UniteCreatorFiltersProcess{
207
  foreach($arrTerms as $term)
208
  $arrFilterTerms[] = $prefix.$term;
209
  }
210
-
211
  //put to output
212
 
213
  if(!empty($arrFilterTerms)){
@@ -215,6 +227,8 @@ class UniteCreatorFiltersProcess{
215
  self::$filters["category_relation"] = "OR";
216
  }
217
 
 
 
218
  //get the page
219
 
220
  $page = UniteFunctionsUC::getVal($arrInputFilters, "page");
@@ -222,6 +236,13 @@ class UniteCreatorFiltersProcess{
222
  if(!empty($page))
223
  self::$filters["page"] = $page;
224
 
 
 
 
 
 
 
 
225
 
226
  return(self::$filters);
227
  }
@@ -278,7 +299,7 @@ class UniteCreatorFiltersProcess{
278
 
279
  if($arrActiveFilters === null)
280
  $arrActiveFilters = $this->getRequestFilters();
281
-
282
  if(empty($arrActiveFilters))
283
  return(false);
284
 
@@ -393,22 +414,62 @@ class UniteCreatorFiltersProcess{
393
  /**
394
  * get offset
395
  */
396
- private function processRequestFilters_getOffset($args, $page){
397
-
398
  if(empty($page))
399
  return(null);
400
-
401
  $perPage = UniteFunctionsUC::getVal($args, "posts_per_page");
402
 
403
  if(empty($perPage))
404
- return(null);
405
 
406
- $offset = ($page-1)*$perPage;
 
407
 
408
- if(empty($offset))
409
- return(null);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
 
411
- return($offset);
 
 
412
  }
413
 
414
 
@@ -416,7 +477,7 @@ class UniteCreatorFiltersProcess{
416
  * process request filters
417
  */
418
  public function processRequestFilters($args){
419
-
420
  $isUnderAjax = $this->isUnderAjax();
421
 
422
  if($isUnderAjax == false)
@@ -424,15 +485,32 @@ class UniteCreatorFiltersProcess{
424
 
425
  $arrFilters = $this->getRequestFilters();
426
 
427
- //---- set offset ----
428
 
429
  $page = UniteFunctionsUC::getVal($arrFilters, "page");
 
 
430
  if(!empty($page)){
431
- $offset = $this->processRequestFilters_getOffset($args, $page);
432
- if(!empty($offset))
433
- $args["offset"] = $offset;
434
  }
435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  return($args);
437
  }
438
 
@@ -620,6 +698,7 @@ class UniteCreatorFiltersProcess{
620
  //validate by response code
621
 
622
  $responseCode = http_response_code();
 
623
  if($responseCode != 200){
624
  http_response_code(200);
625
  UniteFunctionsUC::throwError("Request not allowed, please make sure the pagination is allowed for the ajax grid");
@@ -884,6 +963,27 @@ class UniteCreatorFiltersProcess{
884
  return($arrData);
885
  }
886
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
887
 
888
  private function _______ARCHIVE_QUERY__________(){}
889
 
@@ -931,6 +1031,26 @@ class UniteCreatorFiltersProcess{
931
 
932
  }
933
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
934
  /**
935
  * test the request filter
936
  */
@@ -974,8 +1094,8 @@ class UniteCreatorFiltersProcess{
974
  return(false);
975
 
976
  add_action("wp", array($this, "operateAjaxResponse"));
977
-
978
- add_action("parse_request", array($this, "checkModifyMainQuery"));
979
 
980
  }
981
 
10
  class UniteCreatorFiltersProcess{
11
 
12
  const DEBUG_MAIN_QUERY = false;
13
+ const DEBUG_FILTER = false;
14
 
15
  private static $filters = null;
16
  private static $arrInputFiltersCache = null;
20
  private static $isScriptAdded = false;
21
  private static $isFilesAdded = false;
22
  private static $isStyleAdded = false;
23
+ private static $isAjaxCache = null;
24
 
25
  private static $showDebug = false;
26
  private static $originalQueryVars = null;
66
  /**
67
  * parse filters string
68
  */
69
+ private function parseStrTerms($strFilters){
70
 
71
  $strFilters = trim($strFilters);
72
 
116
 
117
  $request = $this->getArrRequest();
118
 
119
+ $strTerms = UniteFunctionsUC::getVal($request, "ucterms");
120
+
121
  $arrOutput = array();
122
 
123
  //parse filters
124
 
125
+ if(!empty($strTerms)){
126
  if(self::$showDebug == true)
127
+ dmp("input filters found: $strTerms");
128
 
129
+ $arrOutput = $this->parseStrTerms($strTerms);
130
  }
131
+
132
+ //page
133
+
134
  $page = UniteFunctionsUC::getVal($request, "ucpage");
135
  $page = (int)$page;
136
 
137
  if(!empty($page))
138
  $arrOutput["page"] = $page;
139
 
140
+ //num items
141
+
142
+ $numItems = UniteFunctionsUC::getVal($request, "uccount");
143
+ $numItems = (int)$numItems;
144
+
145
+ if(!empty($numItems))
146
+ $arrOutput["num_items"] = $numItems;
147
+
148
  self::$arrInputFiltersCache = $arrOutput;
149
 
150
  return($arrOutput);
160
  return(self::$arrFiltersAssocCache);
161
 
162
  $arrFilters = $this->getArrInputFilters();
163
+
164
  $output = array();
165
 
166
  $terms = UniteFunctionsUC::getVal($arrFilters, "terms");
189
  * get filters arguments
190
  */
191
  public function getRequestFilters(){
192
+
193
  if(self::$filters !== null)
194
  return(self::$filters);
195
 
196
  self::$filters = array();
197
 
198
  $arrInputFilters = $this->getArrInputFilters();
 
199
 
200
  if(empty($arrInputFilters))
201
  return(self::$filters);
202
 
203
  $arrTerms = UniteFunctionsUC::getVal($arrInputFilters, self::TYPE_TERMS);
204
 
205
+ if(!empty($arrTerms))
206
+ self::$filters["terms"] = $arrTerms;
207
+
208
  //collect term filters
209
+
210
+ /*
211
  $arrFilterTerms = array();
212
 
213
  foreach($arrTerms as $taxonomy=>$arrTerms){
219
  foreach($arrTerms as $term)
220
  $arrFilterTerms[] = $prefix.$term;
221
  }
222
+
223
  //put to output
224
 
225
  if(!empty($arrFilterTerms)){
227
  self::$filters["category_relation"] = "OR";
228
  }
229
 
230
+ */
231
+
232
  //get the page
233
 
234
  $page = UniteFunctionsUC::getVal($arrInputFilters, "page");
236
  if(!empty($page))
237
  self::$filters["page"] = $page;
238
 
239
+ //get num items
240
+
241
+ $numItems = UniteFunctionsUC::getVal($arrInputFilters, "num_items");
242
+
243
+ if(!empty($numItems))
244
+ self::$filters["num_items"] = $numItems;
245
+
246
 
247
  return(self::$filters);
248
  }
299
 
300
  if($arrActiveFilters === null)
301
  $arrActiveFilters = $this->getRequestFilters();
302
+
303
  if(empty($arrActiveFilters))
304
  return(false);
305
 
414
  /**
415
  * get offset
416
  */
417
+ private function processRequestFilters_setPaging($args, $page, $numItems){
418
+
419
  if(empty($page))
420
  return(null);
421
+
422
  $perPage = UniteFunctionsUC::getVal($args, "posts_per_page");
423
 
424
  if(empty($perPage))
425
+ return($args);
426
 
427
+ $offset = null;
428
+ $postsPerPage = null;
429
 
430
+ //set posts per page and offset
431
+ if(!empty($numItems) && $page > 1){
432
+
433
+ if($page == 2)
434
+ $offset = $perPage;
435
+ else if($page > 2)
436
+ $offset = $perPage+($page-2)*$numItems;
437
+
438
+ $postsPerPage = $numItems;
439
+
440
+ }else{ //no num items
441
+ $offset = ($page-1)*$perPage;
442
+ }
443
+
444
+ if(!empty($offset))
445
+ $args["offset"] = $offset;
446
+
447
+ if(!empty($postsPerPage))
448
+ $args["posts_per_page"] = $postsPerPage;
449
+
450
+ return($args);
451
+ }
452
+
453
+ /**
454
+ * get tax query from terms array
455
+ */
456
+ private function getTaxQuery($arrTax){
457
+
458
+ $arrQuery = array();
459
+
460
+ foreach($arrTax as $taxonomy=>$arrTerms){
461
+
462
+ $item = array();
463
+ $item["taxonomy"] = $taxonomy;
464
+ $item["field"] = "slug";
465
+ $item["terms"] = $arrTerms;
466
+
467
+ $arrQuery[] = $item;
468
+ }
469
 
470
+ $arrQuery["relation"] = "AND";
471
+
472
+ return($arrQuery);
473
  }
474
 
475
 
477
  * process request filters
478
  */
479
  public function processRequestFilters($args){
480
+
481
  $isUnderAjax = $this->isUnderAjax();
482
 
483
  if($isUnderAjax == false)
485
 
486
  $arrFilters = $this->getRequestFilters();
487
 
488
+ //---- set offset and count ----
489
 
490
  $page = UniteFunctionsUC::getVal($arrFilters, "page");
491
+ $numItems = UniteFunctionsUC::getVal($arrFilters, "num_items");
492
+
493
  if(!empty($page)){
494
+ $args = $this->processRequestFilters_setPaging($args, $page, $numItems);
 
 
495
  }
496
 
497
+ $arrTerms = UniteFunctionsUC::getVal($arrFilters, "terms");
498
+ if(!empty($arrTerms)){
499
+
500
+ $arrTaxQuery = $this->getTaxQuery($arrTerms);
501
+
502
+ if(!empty($arrTaxQuery))
503
+ $args["tax_query"] = $arrTaxQuery;
504
+ }
505
+
506
+ if(self::DEBUG_FILTER == true){
507
+ dmp("debug!!!");
508
+ dmp($args);
509
+ dmp($arrFilters);
510
+ exit();
511
+ }
512
+
513
+
514
  return($args);
515
  }
516
 
698
  //validate by response code
699
 
700
  $responseCode = http_response_code();
701
+
702
  if($responseCode != 200){
703
  http_response_code(200);
704
  UniteFunctionsUC::throwError("Request not allowed, please make sure the pagination is allowed for the ajax grid");
963
  return($arrData);
964
  }
965
 
966
+ private function _______EDITOR_ARGUMENTS__________(){}
967
+
968
+ /**
969
+ * get editor filter arguments
970
+ */
971
+ public function addEditorFilterArguments($data, $isInitAfter){
972
+
973
+ $arguments = "";
974
+ $style = "";
975
+
976
+ if($isInitAfter == true){
977
+ $arguments = " data-initafter=\"true\"";
978
+ $style = " xvisibility:hidden;background-color:green;";
979
+ }
980
+
981
+ $data["filter_arguments"] = $arguments;
982
+ $data["filter_style"] = $style;
983
+
984
+ return($data);
985
+ }
986
+
987
 
988
  private function _______ARCHIVE_QUERY__________(){}
989
 
1031
 
1032
  }
1033
 
1034
+ /**
1035
+ * is ajax request
1036
+ */
1037
+ public function isFrontAjaxRequest(){
1038
+
1039
+ if(self::$isAjaxCache !== null)
1040
+ return(self::$isAjaxCache);
1041
+
1042
+ $frontAjaxAction = UniteFunctionsUC::getPostGetVariable("ucfrontajaxaction","",UniteFunctionsUC::SANITIZE_KEY);
1043
+
1044
+ if($frontAjaxAction == "getfiltersdata"){
1045
+ self::$isAjaxCache = true;
1046
+ return(true);
1047
+ }
1048
+
1049
+ self::$isAjaxCache = false;
1050
+
1051
+ return(false);
1052
+ }
1053
+
1054
  /**
1055
  * test the request filter
1056
  */
1094
  return(false);
1095
 
1096
  add_action("wp", array($this, "operateAjaxResponse"));
1097
+
1098
+ //add_action("parse_request", array($this, "checkModifyMainQuery"));
1099
 
1100
  }
1101
 
inc_php/unitecreator_globals.class.php CHANGED
@@ -186,7 +186,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
186
  self::$current_host = self::$current_protocol.self::$current_host;
187
 
188
  self::$current_page_url = self::$current_host.UniteFunctionsUC::getVal($_SERVER, "REQUEST_URI");
189
-
 
190
  self::$pathPluginRel = basename(self::$pathPlugin)."/";
191
  self::$pathWPLanguages = self::$pathPluginRel."languages/";
192
 
186
  self::$current_host = self::$current_protocol.self::$current_host;
187
 
188
  self::$current_page_url = self::$current_host.UniteFunctionsUC::getVal($_SERVER, "REQUEST_URI");
189
+
190
+
191
  self::$pathPluginRel = basename(self::$pathPlugin)."/";
192
  self::$pathWPLanguages = self::$pathPluginRel."languages/";
193
 
inc_php/unitecreator_helperhtml.class.php CHANGED
@@ -1015,7 +1015,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
1015
  </label>
1016
  <input id="<?php echo $checkboxID?>" type="checkbox" name="enable_condition" class="uc-control" data-controlled-selector=".uc-dialog-conditions-content">
1017
 
1018
-
1019
  <div class="uc-dialog-conditions-content">
1020
 
1021
  <div class="unite-inputs-sap"></div>
1015
  </label>
1016
  <input id="<?php echo $checkboxID?>" type="checkbox" name="enable_condition" class="uc-control" data-controlled-selector=".uc-dialog-conditions-content">
1017
 
 
1018
  <div class="uc-dialog-conditions-content">
1019
 
1020
  <div class="unite-inputs-sap"></div>
inc_php/unitecreator_params_editor.class.php CHANGED
@@ -56,10 +56,12 @@ class UniteCreatorParamsEditor{
56
 
57
  <div class="unite-inputs-sap"></div>
58
 
 
59
  <?php
60
  if(GlobalsUC::$inDev)
61
  HelperHtmlUC::putHtmlConditions("section")
62
  ?>
 
63
 
64
  <div class="unite-inputs-sap"></div>
65
  <br>
56
 
57
  <div class="unite-inputs-sap"></div>
58
 
59
+ <div class="uc-dialog-param">
60
  <?php
61
  if(GlobalsUC::$inDev)
62
  HelperHtmlUC::putHtmlConditions("section")
63
  ?>
64
+ </div>
65
 
66
  <div class="unite-inputs-sap"></div>
67
  <br>
inc_php/unitecreator_params_processor.class.php CHANGED
@@ -84,19 +84,19 @@ class UniteCreatorParamsProcessorWork{
84
  if(empty($value))
85
  return($value);
86
 
87
- if(is_string($value))
 
88
  $value = $this->convertFromUrlAssets($value);
89
-
90
- switch($type){
91
- case "uc_image":
92
- case "uc_mp3":
93
- $value = HelperUC::URLtoFull($value);
94
- break;
 
 
95
  }
96
-
97
- if($value == "uc_no_editor_items")
98
- $value = __("The background items will be shown only in front end","unlimited-elements-for-elementor");
99
-
100
  $addonType = $this->addon->getType();
101
 
102
  if($addonType == "elementor")
@@ -719,7 +719,7 @@ class UniteCreatorParamsProcessorWork{
719
 
720
  if(empty($data))
721
  $data = array();
722
-
723
  //get by param
724
  $param = array();
725
  $param["name"] = $name;
@@ -885,7 +885,7 @@ class UniteCreatorParamsProcessorWork{
885
  * @param $param
886
  */
887
  protected function getProcessedParamsValue_image($data, $value, $param){
888
-
889
  $mediaType = UniteFunctionsUC::getVal($param, "media_type");
890
 
891
  $name = $param["name"];
@@ -896,7 +896,20 @@ class UniteCreatorParamsProcessorWork{
896
 
897
  return($data);
898
  }
899
-
 
 
 
 
 
 
 
 
 
 
 
 
 
900
  $urlImage = $value; //in case that the value is image id
901
  if(is_numeric($value)){
902
  $urlImage = UniteProviderFunctionsUC::getImageUrlFromImageID($value);
@@ -1545,11 +1558,13 @@ class UniteCreatorParamsProcessorWork{
1545
  $name = UniteFunctionsUC::getVal($param, "name");
1546
 
1547
  $isOutputProcessType = $this->isOutputProcessType($processType);
1548
-
1549
  //special params - all types
1550
  switch($type){
 
1551
  case UniteCreatorDialogParam::PARAM_NUMBER:
1552
-
 
1553
  $data = $this->getProcessedParamsValue_responsive($data, $param);
1554
  break;
1555
  case UniteCreatorDialogParam::PARAM_IMAGE:
84
  if(empty($value))
85
  return($value);
86
 
87
+ if(is_string($value)){
88
+
89
  $value = $this->convertFromUrlAssets($value);
90
+
91
+ switch($type){
92
+ case "uc_image":
93
+ case "uc_mp3":
94
+ $value = HelperUC::URLtoFull($value);
95
+ break;
96
+ }
97
+
98
  }
99
+
 
 
 
100
  $addonType = $this->addon->getType();
101
 
102
  if($addonType == "elementor")
719
 
720
  if(empty($data))
721
  $data = array();
722
+
723
  //get by param
724
  $param = array();
725
  $param["name"] = $name;
885
  * @param $param
886
  */
887
  protected function getProcessedParamsValue_image($data, $value, $param){
888
+
889
  $mediaType = UniteFunctionsUC::getVal($param, "media_type");
890
 
891
  $name = $param["name"];
896
 
897
  return($data);
898
  }
899
+
900
+ //try to get image id from array
901
+ if(is_array($value)){
902
+
903
+ if(isset($value["id"]))
904
+ $value = $value["id"];
905
+
906
+ if(isset($value["url"]))
907
+ $value = $value["url"];
908
+
909
+ if(empty($value))
910
+ return($data);
911
+ }
912
+
913
  $urlImage = $value; //in case that the value is image id
914
  if(is_numeric($value)){
915
  $urlImage = UniteProviderFunctionsUC::getImageUrlFromImageID($value);
1558
  $name = UniteFunctionsUC::getVal($param, "name");
1559
 
1560
  $isOutputProcessType = $this->isOutputProcessType($processType);
1561
+
1562
  //special params - all types
1563
  switch($type){
1564
+ case UniteCreatorDialogParam::PARAM_DROPDOWN:
1565
  case UniteCreatorDialogParam::PARAM_NUMBER:
1566
+ case UniteCreatorDialogParam::PARAM_RADIOBOOLEAN:
1567
+
1568
  $data = $this->getProcessedParamsValue_responsive($data, $param);
1569
  break;
1570
  case UniteCreatorDialogParam::PARAM_IMAGE:
inc_php/unitecreator_settings.class.php CHANGED
@@ -728,8 +728,9 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
728
  $this->addPostsListPicker($name,$value,$title,$extra);
729
  break;
730
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
731
-
732
  $extra["for_woocommerce"] = UniteFunctionsUC::getVal($param, "for_woocommerce");
 
733
 
734
  $this->addPostTermsPicker($name,$value,$title,$extra);
735
  break;
728
  $this->addPostsListPicker($name,$value,$title,$extra);
729
  break;
730
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
731
+
732
  $extra["for_woocommerce"] = UniteFunctionsUC::getVal($param, "for_woocommerce");
733
+ $extra["filter_type"] = UniteFunctionsUC::getVal($param, "filter_type");
734
 
735
  $this->addPostTermsPicker($name,$value,$title,$extra);
736
  break;
includes.php CHANGED
@@ -12,7 +12,7 @@ if(!defined('UNLIMITED_ELEMENTS_INC'))
12
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
13
 
14
  if(!defined("UNLIMITED_ELEMENTS_VERSION"))
15
- define("UNLIMITED_ELEMENTS_VERSION", "1.4.85");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
12
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
13
 
14
  if(!defined("UNLIMITED_ELEMENTS_VERSION"))
15
+ define("UNLIMITED_ELEMENTS_VERSION", "1.4.88");
16
 
17
  $currentFile = __FILE__;
18
  $currentFolder = dirname($currentFile);
js/unitecreator_params_dialog.js CHANGED
@@ -1566,6 +1566,7 @@ function UniteCreatorParamsDialog(){
1566
  objLinkAdd.hide();
1567
  }
1568
 
 
1569
  /**
1570
  * init more conditions
1571
  */
@@ -1590,7 +1591,7 @@ function UniteCreatorParamsDialog(){
1590
 
1591
  if(objTableConditions.length == 0)
1592
  return(false);
1593
-
1594
  onEvent(events.OPEN, handleConditionsOnOpen);
1595
 
1596
  g_objWrapper.on("change",".uc-dialog-condition-attribute", onSelectConditionsAttributeChange);
@@ -1604,9 +1605,28 @@ function UniteCreatorParamsDialog(){
1604
  /**
1605
  * init sections conditions
1606
  */
1607
- this.initSectionsConditions = function(){
 
 
1608
 
1609
- trace("init sections conditions");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1610
 
1611
  }
1612
 
@@ -2100,7 +2120,7 @@ function UniteCreatorParamsDialog(){
2100
  * init the params dialog
2101
  */
2102
  this.init = function(objWrapper, objParent){
2103
-
2104
  g_objWrapper = objWrapper;
2105
 
2106
  if(objParent)
1566
  objLinkAdd.hide();
1567
  }
1568
 
1569
+
1570
  /**
1571
  * init more conditions
1572
  */
1591
 
1592
  if(objTableConditions.length == 0)
1593
  return(false);
1594
+
1595
  onEvent(events.OPEN, handleConditionsOnOpen);
1596
 
1597
  g_objWrapper.on("change",".uc-dialog-condition-attribute", onSelectConditionsAttributeChange);
1605
  /**
1606
  * init sections conditions
1607
  */
1608
+ this.initSectionsConditions = function(objWrapper, objParent){
1609
+
1610
+ g_objWrapper = objWrapper;
1611
 
1612
+ g_objParent = objParent;
1613
+
1614
+ var objContent = objWrapper.find(".uc-dialog-conditions-content");
1615
+
1616
+ objContent.hide();
1617
+
1618
+ initControls();
1619
+
1620
+ initConditions();
1621
+ }
1622
+
1623
+
1624
+ /**
1625
+ * handle sections conditions
1626
+ */
1627
+ this.handleSectionConditions = function(){
1628
+
1629
+ triggerEvent(events.OPEN);
1630
 
1631
  }
1632
 
2120
  * init the params dialog
2121
  */
2122
  this.init = function(objWrapper, objParent){
2123
+
2124
  g_objWrapper = objWrapper;
2125
 
2126
  if(objParent)
js/unitecreator_params_editor.js CHANGED
@@ -7,6 +7,7 @@ function UniteCreatorParamsEditor(){
7
  var g_objWrapper, g_objTableBody, g_objEmptyParams, g_type;
8
  var g_objDialog = new UniteCreatorParamsDialog(), g_buttonAddParam;
9
  var g_buttonAddImageBase, g_objLastParam, g_objCatsWrapper, g_objCopyCatSection;
 
10
 
11
  if(!g_ucAdmin)
12
  var g_ucAdmin = new UniteAdminUC();
@@ -1045,6 +1046,11 @@ function UniteCreatorParamsEditor(){
1045
  //move icons
1046
  g_objWrapper.on("click", ".uc-attr-list-sections__icon-move", onMoveParamsClick);
1047
 
 
 
 
 
 
1048
  }
1049
 
1050
 
@@ -1082,6 +1088,20 @@ function UniteCreatorParamsEditor(){
1082
  });
1083
 
1084
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1085
 
1086
  function ______________COPY_CATEGORY______________(){}
1087
 
@@ -1323,7 +1343,9 @@ function UniteCreatorParamsEditor(){
1323
 
1324
  objInput.focus();
1325
 
1326
-
 
 
1327
  }, dialogOptions);
1328
 
1329
  }
@@ -1341,6 +1363,47 @@ function UniteCreatorParamsEditor(){
1341
 
1342
  }
1343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1344
 
1345
  /**
1346
  * add the section
@@ -1359,6 +1422,10 @@ function UniteCreatorParamsEditor(){
1359
 
1360
  catTitle = jQuery.trim(catTitle);
1361
 
 
 
 
 
1362
  if(!catTitle){
1363
  var textError = objError.data("error_empty");
1364
  objError.show().html(textError);
@@ -1375,10 +1442,15 @@ function UniteCreatorParamsEditor(){
1375
  var catID = objDialog.data("catid");
1376
  renameCategory(catID, catTitle);
1377
 
 
 
1378
  }else{ //add
1379
 
1380
  var tab = objDialog.data("tab");
1381
- addCatToTab(tab, catTitle);
 
 
 
1382
  }
1383
 
1384
 
@@ -1636,9 +1708,7 @@ function UniteCreatorParamsEditor(){
1636
  if(g_temp.hasCats == true){
1637
 
1638
  initCatsEvents();
1639
-
1640
- var objDialogSpecial = new UniteCreatorParamsDialog();
1641
- objDialogSpecial.initSectionsConditions();
1642
  }
1643
 
1644
  }
@@ -1731,6 +1801,17 @@ function UniteCreatorParamsEditor(){
1731
  }
1732
 
1733
 
 
 
 
 
 
 
 
 
 
 
 
1734
  /**
1735
  * init the params editor by wrapper and params
1736
  */
7
  var g_objWrapper, g_objTableBody, g_objEmptyParams, g_type;
8
  var g_objDialog = new UniteCreatorParamsDialog(), g_buttonAddParam;
9
  var g_buttonAddImageBase, g_objLastParam, g_objCatsWrapper, g_objCopyCatSection;
10
+ var g_objParamsDialogSpecial;
11
 
12
  if(!g_ucAdmin)
13
  var g_ucAdmin = new UniteAdminUC();
1046
  //move icons
1047
  g_objWrapper.on("click", ".uc-attr-list-sections__icon-move", onMoveParamsClick);
1048
 
1049
+ var objCatsDialog = jQuery("#uc_dialog_attribute_category_addsection");
1050
+
1051
+ g_objParamsDialogSpecial = new UniteCreatorParamsDialog();
1052
+ g_objParamsDialogSpecial.initSectionsConditions(objCatsDialog, t);
1053
+
1054
  }
1055
 
1056
 
1088
  });
1089
 
1090
  }
1091
+
1092
+ /**
1093
+ * update category extra data
1094
+ */
1095
+ function updateCatData(catID, catData){
1096
+
1097
+ var objCat = getCatByID(catID);
1098
+
1099
+ if(!objCat)
1100
+ return(false);
1101
+
1102
+ objCat.data("catdata", catData);
1103
+
1104
+ }
1105
 
1106
  function ______________COPY_CATEGORY______________(){}
1107
 
1343
 
1344
  objInput.focus();
1345
 
1346
+ //handle conditions
1347
+ g_objParamsDialogSpecial.handleSectionConditions();
1348
+
1349
  }, dialogOptions);
1350
 
1351
  }
1363
 
1364
  }
1365
 
1366
+ /**
1367
+ * get dialog cat extra data (conditions values);
1368
+ */
1369
+ function getDialogCatData(objDialog){
1370
+
1371
+ var objData = {};
1372
+
1373
+ var objWrapper = objDialog.find(".uc-dialog-param");
1374
+
1375
+ if(objWrapper.length == 0)
1376
+ return(false);
1377
+
1378
+ var objInputs = objWrapper.find("input,select");
1379
+
1380
+ jQuery.each(objInputs, function(index, input){
1381
+
1382
+ var objInput = jQuery(input);
1383
+ var type = g_ucAdmin.getInputType(objInput);
1384
+
1385
+ //get value
1386
+ switch(type){
1387
+ case "checkbox":
1388
+ var value = objInput.is(":checked");
1389
+ break;
1390
+ case "select":
1391
+ var value = objInput.val();
1392
+ break;
1393
+ default:
1394
+ trace(objInput);
1395
+ throw new Error("Wrong input type: "+type);
1396
+ break;
1397
+ }
1398
+
1399
+ var name = objInput.prop("name");
1400
+
1401
+ objData[name] = value;
1402
+ });
1403
+
1404
+
1405
+ return(objData);
1406
+ }
1407
 
1408
  /**
1409
  * add the section
1422
 
1423
  catTitle = jQuery.trim(catTitle);
1424
 
1425
+ var catData = getDialogCatData(objDialog);
1426
+
1427
+ trace(catData);
1428
+
1429
  if(!catTitle){
1430
  var textError = objError.data("error_empty");
1431
  objError.show().html(textError);
1442
  var catID = objDialog.data("catid");
1443
  renameCategory(catID, catTitle);
1444
 
1445
+ updateCatData(catID, catData);
1446
+
1447
  }else{ //add
1448
 
1449
  var tab = objDialog.data("tab");
1450
+ var catID = addCatToTab(tab, catTitle);
1451
+
1452
+ updateCatData(catID, catData);
1453
+
1454
  }
1455
 
1456
 
1708
  if(g_temp.hasCats == true){
1709
 
1710
  initCatsEvents();
1711
+
 
 
1712
  }
1713
 
1714
  }
1801
  }
1802
 
1803
 
1804
+ /**
1805
+ * get control attributes with their values
1806
+ */
1807
+ this.getControlParams = function(){
1808
+
1809
+ var arrData = t.getParamsData("control", true);
1810
+
1811
+ return(arrData);
1812
+ };
1813
+
1814
+
1815
  /**
1816
  * init the params editor by wrapper and params
1817
  */
js/unitecreator_params_panel.js CHANGED
@@ -161,16 +161,16 @@ function UniteCreatorParamsPanel(){
161
  function addAddParams(objParentParam, arrAddKeys, filter){
162
 
163
  var parentName = objParentParam["name"];
164
-
165
  jQuery.each(arrAddKeys,function(index, objAddParam){
166
 
167
  var condition = g_ucAdmin.getVal(objAddParam, "condition");
168
-
169
  //filter by condition
170
  if(condition == "responsive"){
171
  var isResponsive = g_ucAdmin.getVal(objParentParam, "is_responsive");
172
  isResponsive = g_ucAdmin.strToBool(isResponsive);
173
-
174
  if(isResponsive == false)
175
  return(true);
176
  }
161
  function addAddParams(objParentParam, arrAddKeys, filter){
162
 
163
  var parentName = objParentParam["name"];
164
+
165
  jQuery.each(arrAddKeys,function(index, objAddParam){
166
 
167
  var condition = g_ucAdmin.getVal(objAddParam, "condition");
168
+
169
  //filter by condition
170
  if(condition == "responsive"){
171
  var isResponsive = g_ucAdmin.getVal(objParentParam, "is_responsive");
172
  isResponsive = g_ucAdmin.strToBool(isResponsive);
173
+
174
  if(isResponsive == false)
175
  return(true);
176
  }
provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php CHANGED
@@ -473,7 +473,44 @@ class UniteCreatorDialogParamElementor extends UniteCreatorDialogParam{
473
 
474
  <?php
475
  }
476
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
 
478
  /**
479
  * background param
473
 
474
  <?php
475
  }
476
+
477
+ /**
478
+ * put radio boolean param
479
+ */
480
+ protected function putRadioBooleanParam(){
481
+ ?>
482
+ <table data-inputtype="radio_boolean" class='uc-table-dropdown-items uc-table-dropdown-full'>
483
+ <thead>
484
+ <tr>
485
+ <th width="100px"><?php esc_html_e("Item Text", "unlimited-elements-for-elementor")?></th>
486
+ <th width="100px"><?php esc_html_e("Item Value", "unlimited-elements-for-elementor")?></th>
487
+ </tr>
488
+ </thead>
489
+ <tbody>
490
+ <tr>
491
+ <td><input type="text" name="true_name" value="Yes" data-initval="Yes" class='uc-dropdown-item-name'></td>
492
+ <td><input type="text" name="true_value" value="true" data-initval="true" class='uc-dropdown-item-value'></td>
493
+ <td>
494
+ <div class='uc-dropdown-icon uc-dropdown-item-default uc-selected' title="<?php esc_html_e("Default Item", "unlimited-elements-for-elementor")?>"></div>
495
+ </td>
496
+ </tr>
497
+ <tr>
498
+ <td><input type="text" name="false_name" value="No" data-initval="No" class='uc-dropdown-item-name'></td>
499
+ <td><input type="text" name="false_value" value="false" data-initval="false" class='uc-dropdown-item-value'></td>
500
+ <td>
501
+ <div class='uc-dropdown-icon uc-dropdown-item-default' title="<?php esc_html_e("Default Item", "unlimited-elements-for-elementor")?>"></div>
502
+ </td>
503
+ </tr>
504
+
505
+ </tbody>
506
+ </table>
507
+ <?php
508
+
509
+ $this->addResponsiveInputs("slider");
510
+
511
+
512
+ }
513
+
514
 
515
  /**
516
  * background param
provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php CHANGED
@@ -1373,15 +1373,33 @@ class UniteCreatorElementorIntegrate{
1373
  * check allow pagination for single page pagination
1374
  */
1375
  public function checkAllowWidgetPagination($filterValue, $wp_query){
1376
-
1377
- if(is_admin() == true || is_archive() == true || is_front_page() == true)
1378
- return($filterValue);
1379
 
 
 
1380
 
1381
- if(empty(self::$arrPostsWidgetNames))
1382
- return($filterValue);
1383
-
1384
- $postID = $wp_query->queried_object_id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1385
 
1386
  if(empty($postID))
1387
  return($filterValue);
1373
  * check allow pagination for single page pagination
1374
  */
1375
  public function checkAllowWidgetPagination($filterValue, $wp_query){
1376
+
1377
+ $objFilters = new UniteCreatorFiltersProcess();
1378
+ $isAjaxRequest = $objFilters->isFrontAjaxRequest();
1379
 
1380
+ //get post id from request
1381
+ if($isAjaxRequest){
1382
 
1383
+ $postID = UniteFunctionsUC::getPostGetVariable("layoutid","",UniteFunctionsUC::SANITIZE_KEY);
1384
+ if(empty($postID))
1385
+ return($filterValue);
1386
+
1387
+ if(is_numeric($postID) == false)
1388
+ return(false);
1389
+
1390
+ }else{
1391
+
1392
+ //get post id from query
1393
+
1394
+ if(is_admin() == true || is_archive() == true || is_front_page() == true)
1395
+ return($filterValue);
1396
+
1397
+ if(empty(self::$arrPostsWidgetNames))
1398
+ return($filterValue);
1399
+
1400
+ $postID = $wp_query->queried_object_id;
1401
+
1402
+ }
1403
 
1404
  if(empty($postID))
1405
  return($filterValue);
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php CHANGED
@@ -29,7 +29,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
29
  protected $isBGWidget = false;
30
  protected $objControls;
31
  protected $isAddSapBefore = false;
32
-
 
33
 
34
  const DEBUG_SETTINGS_VALUES = false;
35
 
@@ -2171,48 +2172,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
2171
 
2172
  $activeTab = null;
2173
 
2174
- foreach($params as $param){
2175
 
2176
- //add tab
2177
- $tabName = UniteFunctionsUC::getVal($param, "tabname");
2178
- $tabName = trim($tabName);
2179
-
2180
- //handle tabs
2181
- if(!empty($tabName)){
2182
-
2183
- if(empty($activeTab)){
2184
- $tabsID = "tabs_".UniteFunctionsUC::getRandomString();
2185
- $this->start_controls_tabs($tabsID);
2186
-
2187
- }
2188
-
2189
- //start new tab or switch tab
2190
- if($activeTab != $tabName){
2191
-
2192
- if(!empty($activeTab)){
2193
- $this->end_controls_tab();
2194
- }
2195
-
2196
- $tabID = "tab_".UniteFunctionsUC::getRandomString();
2197
- $this->start_controls_tab($tabID, array("label"=>$tabName));
2198
-
2199
- }
2200
-
2201
- $activeTab = $tabName;
2202
-
2203
- }else{ //if no tab, close tabs
2204
-
2205
- if(!empty($activeTab)){
2206
-
2207
- $this->end_controls_tab();
2208
- $this->end_controls_tabs();
2209
-
2210
- $activeTab = null;
2211
- }
2212
-
2213
- }
2214
-
2215
-
2216
  $type = UniteFunctionsUC::getVal($param, "type");
2217
  if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
2218
  $hasPostsList = true;
@@ -2240,15 +2201,67 @@ class UniteCreatorElementorWidget extends Widget_Base {
2240
  }
2241
  }
2242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2243
  $this->addElementorParamUC($param);
 
 
2244
  } //end params foreach
2245
 
2246
- if(!empty($activeTab)){
2247
-
 
2248
  $this->end_controls_tab();
2249
  $this->end_controls_tabs();
2250
- $activeTab = null;
2251
- }
2252
 
2253
 
2254
  //add free version notification
@@ -2260,7 +2273,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
2260
 
2261
  } //end sections foreach
2262
 
2263
-
2264
  //add query controls section (post list) if exists
2265
  if($hasPostsList == true){
2266
 
29
  protected $isBGWidget = false;
30
  protected $objControls;
31
  protected $isAddSapBefore = false;
32
+ protected $tabsCounter = 1;
33
+
34
 
35
  const DEBUG_SETTINGS_VALUES = false;
36
 
2172
 
2173
  $activeTab = null;
2174
 
2175
+ foreach($params as $index => $param){
2176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2177
  $type = UniteFunctionsUC::getVal($param, "type");
2178
  if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
2179
  $hasPostsList = true;
2201
  }
2202
  }
2203
 
2204
+ $tabName = UniteFunctionsUC::getVal($param, "tabname");
2205
+ $tabName = trim($tabName);
2206
+
2207
+ /**
2208
+ * end tabs, if opened and no active tab
2209
+ */
2210
+ if(!empty($activeTab) && empty($tabName)){
2211
+ $this->end_controls_tab();
2212
+ $this->end_controls_tabs();
2213
+ $activeTab = null;
2214
+ }
2215
+
2216
+ //check and add tabs
2217
+
2218
+ if(!empty($tabName)){
2219
+
2220
+ //if empty active tab - start tabs area
2221
+ if(empty($activeTab)){
2222
+
2223
+ $numTab = $this->tabsCounter++;
2224
+
2225
+ $tabsID = "uctabs{$numTab}";
2226
+ $tabID = "uctab{$numTab}";
2227
+
2228
+ $this->start_controls_tabs($tabsID);
2229
+ $this->start_controls_tab($tabID, array("label"=>$tabName));
2230
+
2231
+ $activeTab = $tabName;
2232
+
2233
+ }else{
2234
+
2235
+ //open another tab, if changed
2236
+
2237
+ if($activeTab != $tabName){
2238
+ $numTab = $this->tabsCounter++;
2239
+
2240
+ $tabID = "uctab{$numTab}";
2241
+
2242
+ $this->end_controls_tab();
2243
+ $this->start_controls_tab($tabID, array("label"=>$tabName));
2244
+ $activeTab = $tabName;
2245
+ }
2246
+
2247
+ }//else
2248
+
2249
+
2250
+ }//not emtpy tabName
2251
+
2252
+
2253
  $this->addElementorParamUC($param);
2254
+
2255
+
2256
  } //end params foreach
2257
 
2258
+ //if inside some tab, in last option - close tabs
2259
+ if(!empty($activeTab)){
2260
+
2261
  $this->end_controls_tab();
2262
  $this->end_controls_tabs();
2263
+ $activeTab = null;
2264
+ }
2265
 
2266
 
2267
  //add free version notification
2273
 
2274
  } //end sections foreach
2275
 
2276
+
2277
  //add query controls section (post list) if exists
2278
  if($hasPostsList == true){
2279
 
provider/core/plugins/unlimited_elements/elementor/pagination.class.php CHANGED
@@ -141,7 +141,7 @@ class UniteCreatorElementorPagination{
141
  );
142
 
143
  $widget->start_controls_tabs( 'pagination_colors' );
144
-
145
  $widget->start_controls_tab(
146
  'pagination_color_normal',
147
  [
@@ -161,7 +161,7 @@ class UniteCreatorElementorPagination{
161
  );
162
 
163
  $widget->end_controls_tab();
164
-
165
  $widget->start_controls_tab(
166
  'pagination_color_hover',
167
  [
@@ -304,11 +304,26 @@ class UniteCreatorElementorPagination{
304
  return($options);
305
  }
306
 
 
307
  /**
308
  * get current page
309
  */
310
  private function getCurrentPage(){
311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  $currentPage = 1;
313
  if(!empty(GlobalsProviderUC::$lastPostQuery_page))
314
  $currentPage = GlobalsProviderUC::$lastPostQuery_page;
@@ -318,7 +333,7 @@ class UniteCreatorElementorPagination{
318
 
319
  if(empty($currentPage))
320
  $currentPage = 1;
321
-
322
  return($currentPage);
323
  }
324
 
@@ -326,10 +341,10 @@ class UniteCreatorElementorPagination{
326
  * get total pages from current query
327
  */
328
  private function getTotalPages(){
329
-
330
  if(empty(GlobalsProviderUC::$lastPostQuery))
331
  return(0);
332
-
333
  $numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
334
  if($numPages <= 1)
335
  return(0);
@@ -360,12 +375,27 @@ class UniteCreatorElementorPagination{
360
 
361
  global $wp_rewrite;
362
  $isUsingPermalinks = $wp_rewrite->using_permalinks();
 
 
363
  if( $isUsingPermalinks == true){ //with permalinks - add /2
364
 
365
- $options['base'] = trailingslashit( get_permalink() ) . '%_%';
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  $options['format'] = user_trailingslashit( '%#%', 'single_paged' );
367
 
368
- if(is_front_page())
369
  $options['format'] = user_trailingslashit( 'page/%#%', 'single_paged' );
370
 
371
  }else{ //if not permalinks
@@ -379,9 +409,9 @@ class UniteCreatorElementorPagination{
379
  if(!empty(GlobalsProviderUC::$lastPostQuery_page))
380
  $currentPage = GlobalsProviderUC::$lastPostQuery_page;
381
  else{
382
- $currentPage = get_query_var("page");
383
  }
384
-
385
  if(empty($currentPage))
386
  $currentPage = 1;
387
 
@@ -390,19 +420,53 @@ class UniteCreatorElementorPagination{
390
  return($options);
391
  }
392
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
  /**
394
  * get last request paging data
395
  */
396
  private function getPagingData(){
397
 
398
  $currentPage = $this->getCurrentPage();
399
-
400
  $totalPages = $this->getTotalPages();
401
 
402
- $hasMore = false;
403
- if(!empty($currentPage) && !empty($totalPages) && $currentPage < $totalPages)
404
- $hasMore = true;
405
-
 
 
 
 
 
 
 
406
  $nextPage = $currentPage+1;
407
 
408
  $output = array();
@@ -472,20 +536,54 @@ class UniteCreatorElementorPagination{
472
  //$options["current"] = 3;
473
 
474
  //-------- put pagination html
475
-
476
  $isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
477
 
478
- if($isArchivePage == true){
 
 
479
 
 
 
480
  $options = $this->getArchivePageOptions($options);
481
  $pagination = get_the_posts_pagination($options);
482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
  }else{ //on single
484
 
485
  //skip for home pages
486
-
487
  $options = $this->getSinglePageOptions($options);
488
 
 
 
 
 
 
 
489
  if(isset($options["current"]) == false){
490
 
491
  if($isDebug == true){
@@ -507,8 +605,11 @@ class UniteCreatorElementorPagination{
507
  }
508
 
509
  if($isDebug == true){
 
510
  dmp("<b>Pagination Options</b>: ");
511
  dmp($options);
 
 
512
  }
513
 
514
  echo $pagination;
141
  );
142
 
143
  $widget->start_controls_tabs( 'pagination_colors' );
144
+
145
  $widget->start_controls_tab(
146
  'pagination_color_normal',
147
  [
161
  );
162
 
163
  $widget->end_controls_tab();
164
+
165
  $widget->start_controls_tab(
166
  'pagination_color_hover',
167
  [
304
  return($options);
305
  }
306
 
307
+
308
  /**
309
  * get current page
310
  */
311
  private function getCurrentPage(){
312
 
313
+ //return by ucpage in case ajax request
314
+
315
+ $objFilters = new UniteCreatorFiltersProcess();
316
+ $isFrontAjax = $objFilters->isFrontAjaxRequest();
317
+
318
+ if($isFrontAjax == true){
319
+
320
+ $ucpage = UniteFunctionsUC::getGetVar("ucpage","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
321
+ $ucpage = (int)$ucpage;
322
+
323
+ if(!empty($ucpage))
324
+ return($ucpage);
325
+ }
326
+
327
  $currentPage = 1;
328
  if(!empty(GlobalsProviderUC::$lastPostQuery_page))
329
  $currentPage = GlobalsProviderUC::$lastPostQuery_page;
333
 
334
  if(empty($currentPage))
335
  $currentPage = 1;
336
+
337
  return($currentPage);
338
  }
339
 
341
  * get total pages from current query
342
  */
343
  private function getTotalPages(){
344
+
345
  if(empty(GlobalsProviderUC::$lastPostQuery))
346
  return(0);
347
+
348
  $numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
349
  if($numPages <= 1)
350
  return(0);
375
 
376
  global $wp_rewrite;
377
  $isUsingPermalinks = $wp_rewrite->using_permalinks();
378
+
379
+
380
  if( $isUsingPermalinks == true){ //with permalinks - add /2
381
 
382
+ $permalink = get_permalink();
383
+
384
+ $isFront = is_front_page();
385
+ $isArchive = is_archive();
386
+
387
+ if($isFront == true)
388
+ $permalink = GlobalsUC::$url_base;
389
+
390
+ $urlCurrentPage = UniteFunctionsWPUC::getUrlCurrentPage(true);
391
+
392
+ if($isArchive == true)
393
+ $permalink = $urlCurrentPage;
394
+
395
+ $options['base'] = trailingslashit( $permalink ) . '%_%';
396
  $options['format'] = user_trailingslashit( '%#%', 'single_paged' );
397
 
398
+ if($isFront || $isArchive)
399
  $options['format'] = user_trailingslashit( 'page/%#%', 'single_paged' );
400
 
401
  }else{ //if not permalinks
409
  if(!empty(GlobalsProviderUC::$lastPostQuery_page))
410
  $currentPage = GlobalsProviderUC::$lastPostQuery_page;
411
  else{
412
+ $currentPage = get_query_var("paged");
413
  }
414
+
415
  if(empty($currentPage))
416
  $currentPage = 1;
417
 
420
  return($options);
421
  }
422
 
423
+ /**
424
+ * get has more by last post query
425
+ */
426
+ private function isHasMoreByLastQuery(){
427
+
428
+ //define has more by last post query
429
+ $foundPosts = GlobalsProviderUC::$lastPostQuery->found_posts;
430
+
431
+ if(empty($foundPosts))
432
+ return(false);
433
+
434
+ $numPosts = GlobalsProviderUC::$lastPostQuery->post_count;
435
+
436
+ $queryVars = GlobalsProviderUC::$lastPostQuery->query_vars;
437
+
438
+ $offset = UniteFunctionsUC::getVal($queryVars, "offset");
439
+
440
+ if(empty($offset))
441
+ $offset = 0;
442
+
443
+ $lastPost = $offset + $numPosts;
444
+ if($lastPost >= $foundPosts)
445
+ return(false);
446
+
447
+ return(true);
448
+ }
449
+
450
+
451
  /**
452
  * get last request paging data
453
  */
454
  private function getPagingData(){
455
 
456
  $currentPage = $this->getCurrentPage();
 
457
  $totalPages = $this->getTotalPages();
458
 
459
+ if(GlobalsProviderUC::$lastPostQuery){
460
+
461
+ $hasMore = $this->isHasMoreByLastQuery();
462
+
463
+ }else{
464
+
465
+ $hasMore = false;
466
+ if(!empty($currentPage) && !empty($totalPages) && $currentPage < $totalPages)
467
+ $hasMore = true;
468
+ }
469
+
470
  $nextPage = $currentPage+1;
471
 
472
  $output = array();
536
  //$options["current"] = 3;
537
 
538
  //-------- put pagination html
539
+
540
  $isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
541
 
542
+ if($isArchivePage == true && !empty(GlobalsProviderUC::$lastPostQuery_type) && GlobalsProviderUC::$lastPostQuery_type != GlobalsProviderUC::QUERY_TYPE_CURRENT)
543
+ $isArchivePage = false;
544
+
545
 
546
+ if($isArchivePage == true){
547
+
548
  $options = $this->getArchivePageOptions($options);
549
  $pagination = get_the_posts_pagination($options);
550
 
551
+ //put debug
552
+ if($isDebug == true){
553
+ echo "<div class='uc-pagination-debug'>";
554
+ dmP("Archive Pagination");
555
+
556
+ global $wp_query;
557
+
558
+ if(!empty($wp_query)){
559
+
560
+ $queryVars = $wp_query->query_vars;
561
+
562
+ $queryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($queryVars);
563
+
564
+ dmp("Current query vars");
565
+ dmp($queryVars);
566
+
567
+ dmp("max pages: ".$wp_query->max_num_pages);
568
+
569
+ //$currentPage = $this->getCurrentPage();
570
+ //dmp("current page: ".$currentPage);
571
+
572
+ }
573
+
574
+ }
575
+
576
  }else{ //on single
577
 
578
  //skip for home pages
 
579
  $options = $this->getSinglePageOptions($options);
580
 
581
+ if($isDebug == true){
582
+ echo "<div class='uc-pagination-debug'>";
583
+
584
+ dmp("custom query pagination");
585
+ }
586
+
587
  if(isset($options["current"]) == false){
588
 
589
  if($isDebug == true){
605
  }
606
 
607
  if($isDebug == true){
608
+
609
  dmp("<b>Pagination Options</b>: ");
610
  dmp($options);
611
+
612
+ echo "</div>";
613
  }
614
 
615
  echo $pagination;
provider/functions_wordpress.class.php CHANGED
@@ -405,6 +405,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
405
  $data["name"] = $term->name;
406
  $data["slug"] = $term->slug;
407
  $data["description"] = $term->description;
 
408
 
409
  if(isset($term->parent))
410
  $data["parent_id"] = $term->parent;
@@ -450,7 +451,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
450
  $slug = $termData["slug"];
451
  if(empty($slug))
452
  $slug = "{$taxonomyName}_{$counter}";
453
-
454
  $arrTermData[$slug] = $termData;
455
  }
456
 
@@ -3125,14 +3126,27 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
3125
  /**
3126
  * get current page url
3127
  */
3128
- public static function getUrlCurrentPage(){
3129
 
3130
  global $wp;
3131
  $urlPage = home_url($wp->request);
 
 
 
 
 
 
 
 
 
 
 
3132
 
3133
  return($urlPage);
3134
  }
3135
 
 
 
3136
  /**
3137
  * get permalist with check of https
3138
  */
405
  $data["name"] = $term->name;
406
  $data["slug"] = $term->slug;
407
  $data["description"] = $term->description;
408
+ $data["taxonomy"] = $term->taxonomy;
409
 
410
  if(isset($term->parent))
411
  $data["parent_id"] = $term->parent;
451
  $slug = $termData["slug"];
452
  if(empty($slug))
453
  $slug = "{$taxonomyName}_{$counter}";
454
+
455
  $arrTermData[$slug] = $termData;
456
  }
457
 
3126
  /**
3127
  * get current page url
3128
  */
3129
+ public static function getUrlCurrentPage($isClear = false){
3130
 
3131
  global $wp;
3132
  $urlPage = home_url($wp->request);
3133
+
3134
+ if($isClear == false)
3135
+ return($urlPage);
3136
+
3137
+ $page = get_query_var("paged");
3138
+
3139
+ if(empty($page))
3140
+ return($urlPage);
3141
+
3142
+ $urlPage = str_replace("/page/$page", "/", $urlPage);
3143
+
3144
 
3145
  return($urlPage);
3146
  }
3147
 
3148
+
3149
+
3150
  /**
3151
  * get permalist with check of https
3152
  */
provider/provider_front.class.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
 
3
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
4
 
1
  <?php
2
+ /**
3
+ * @package Unlimited Elements
4
+ * @author unlimited-elements.com
5
+ * @copyright (C) 2012 Unite CMS, All Rights Reserved.
6
+ * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
+ * */
8
 
9
  defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
10
 
provider/provider_globals.class.php CHANGED
@@ -28,6 +28,13 @@ class GlobalsProviderUC{
28
 
29
  public static $lastPostQuery = null;
30
  public static $lastPostQuery_page = null;
 
 
 
 
 
 
 
31
  public static $arrFetchedPostIDs = array();
32
 
33
  public static $arrFilterPostTypes = array( //filter post types that will not show
28
 
29
  public static $lastPostQuery = null;
30
  public static $lastPostQuery_page = null;
31
+ public static $lastPostQuery_type = null;
32
+
33
+ const QUERY_TYPE_CURRENT = "current";
34
+ const QUERY_TYPE_CUSTOM = "custom";
35
+ const QUERY_TYPE_MANUAL = "manual";
36
+
37
+
38
  public static $arrFetchedPostIDs = array();
39
 
40
  public static $arrFilterPostTypes = array( //filter post types that will not show
provider/provider_params_processor.class.php CHANGED
@@ -11,6 +11,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
11
 
12
  private static $arrPostTypeTaxCache = array();
13
 
 
14
  /**
15
  * add other image thumbs based of the platform
16
  */
@@ -197,6 +198,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
197
  $item["description"] = UniteFunctionsUC::getVal($arrTerm, "description");
198
  $item["link"] = UniteFunctionsUC::getVal($arrTerm, "link");
199
  $item["parent_id"] = UniteFunctionsUC::getVal($arrTerm, "parent_id");
 
200
 
201
  $index++;
202
 
@@ -558,6 +560,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
558
 
559
  $content = UniteFunctionsUC::getVal($arrPost, "post_content");
560
 
 
 
 
561
  $arrData["content"] = $content;
562
 
563
  $arrData["link"] = UniteFunctionsWPUC::getPermalink($post);
@@ -706,12 +711,17 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
706
  //check the single page pagination
707
  $paginationType = UniteFunctionsUC::getVal($value, $name."_pagination_type");
708
 
709
-
710
  if(empty($paginationType))
711
  return($args);
712
 
713
- if(is_archive() == true || is_home() == true)
714
- return($args);
 
 
 
 
 
 
715
 
716
  $page = get_query_var("page", null);
717
 
@@ -732,7 +742,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
732
 
733
  //save the last page for the pagination output
734
  GlobalsProviderUC::$lastPostQuery_page = $page;
735
-
736
  return($args);
737
  }
738
 
@@ -1562,9 +1572,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1562
  $args["post__in"] = array("0"); //no posts at all
1563
  }
1564
  }
1565
-
1566
  $args = $this->getPostListData_getPostGetFilters_pagination($args, $value, $name, $data);
1567
-
1568
  $args = $this->getPostListData_getCustomQueryFilters($args, $value, $name, $data);
1569
 
1570
  HelperUC::addDebug("Posts Query", $args);
@@ -1575,7 +1585,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1575
  echo "<div class='uc-debug-query-wrapper'>"; //start debug wrapper
1576
 
1577
  dmp("The Query Is:");
1578
- dmp($args);
1579
  }
1580
 
1581
  $query = new WP_Query($args);
@@ -1591,23 +1601,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1591
  dmp("The finals query vars:");
1592
  dmp($originalQueryVars);
1593
 
1594
- global $wp_filter;
1595
- $actionsTermArgs = UniteFunctionsUC::getVal($wp_filter, "get_terms_args");
1596
-
1597
- $arrActions = UniteFunctionsWPUC::getFilterCallbacks("posts_pre_query");
1598
-
1599
- dmp("Query modify callbacks ( posts_pre_query ):");
1600
- dmp($arrActions);
1601
-
1602
- $arrActions = UniteFunctionsWPUC::getFilterCallbacks("posts_orderby");
1603
 
1604
- dmp("Query modify callbacks ( posts_orderby ):");
1605
- dmp($arrActions);
1606
- }
1607
-
1608
- //show text
1609
- if($showDebugQuery == true && $debugType == "show_debug_text"){
1610
- HelperUC::showDebug();
1611
  }
1612
 
1613
 
@@ -1633,7 +1628,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1633
  }
1634
 
1635
  //save last query and page
1636
- $this->saveLastQueryAndPage($query);
1637
 
1638
  //remember duplicate posts
1639
  if($isAvoidDuplicates == true){
@@ -1653,13 +1648,46 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1653
  return($arrPosts);
1654
  }
1655
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1656
  /**
1657
  * save last query and page
1658
  */
1659
- private function saveLastQueryAndPage($query){
1660
 
1661
  GlobalsProviderUC::$lastPostQuery = $query;
1662
  GlobalsProviderUC::$lastPostQuery_page = 1;
 
1663
 
1664
  $queryVars = $query->query;
1665
 
@@ -1686,6 +1714,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1686
  */
1687
  private function getPostListData_currentPosts($value, $name, $data){
1688
 
 
1689
  //add debug for further use
1690
  HelperUC::addDebug("Getting Current Posts");
1691
 
@@ -1720,13 +1749,19 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1720
 
1721
  $currentQueryVars = $this->getPostListData_getCustomQueryFilters($currentQueryVars, $value, $name, $data);
1722
 
 
1723
  $showDebugQuery = UniteFunctionsUC::getVal($value, "{$name}_show_query_debug");
1724
  $showDebugQuery = UniteFunctionsUC::strToBool($showDebugQuery);
1725
 
1726
  $debugType = null;
1727
-
 
1728
  if($showDebugQuery == true){
1729
 
 
 
 
 
1730
  echo "<div class='uc-debug-query-wrapper'>"; //start debug wrapper
1731
 
1732
  dmp("Current Posts. The Query Is:");
@@ -1739,27 +1774,41 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1739
  }
1740
 
1741
  $query = $wp_query;
 
1742
  if($currentQueryVars !== $wp_query->query_vars){
1743
 
1744
  HelperUC::addDebug("New Query", $currentQueryVars);
1745
 
1746
  $query = new WP_Query( $currentQueryVars );
1747
  }
1748
-
1749
- if($debugType == "show_query")
1750
- dmp($query->request);
1751
-
1752
 
1753
  HelperUC::addDebug("Query Vars", $currentQueryVars);
1754
 
1755
  //save last query
1756
- $this->saveLastQueryAndPage($query);
1757
 
1758
  $arrPosts = $query->posts;
1759
 
1760
  if(empty($arrPosts))
1761
  $arrPosts = array();
1762
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1763
  if($showDebugQuery == true){
1764
  dmp("Found Posts: ".count($arrPosts));
1765
 
@@ -1832,8 +1881,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
1832
  $arrPosts = UniteFunctionsWPUC::orderPostsByIDs($arrPosts, $postIDs);
1833
 
1834
  //save last query
1835
- GlobalsProviderUC::$lastPostQuery = $query;
1836
-
1837
  HelperUC::addDebug("posts found: ".count($arrPosts));
1838
 
1839
  if($showDebugQuery == true){
@@ -3098,16 +3147,13 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3098
 
3099
  $originalQueryVars = $term_query->query_vars;
3100
  $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
3101
-
3102
  dmp("The Query Request Is:");
3103
  dmp($term_query->request);
3104
 
3105
  dmp("The finals query vars:");
3106
  dmp($originalQueryVars);
3107
 
3108
- global $wp_filter;
3109
- $actionsTermArgs = UniteFunctionsUC::getVal($wp_filter, "get_terms_args");
3110
-
3111
  $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_args");
3112
 
3113
  dmp("Query modify callbacks ( get_terms_args ):");
@@ -3127,14 +3173,55 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3127
 
3128
  if(!empty($arrExcludeSlugs) && is_array($arrExcludeSlugs))
3129
  $arrTermsObjects = UniteFunctionsWPUC::getTerms_filterBySlugs($arrTermsObjects, $arrExcludeSlugs);
3130
-
3131
  $arrTerms = UniteFunctionsWPUC::getTermsObjectsData($arrTermsObjects, $taxonomy);
3132
-
3133
  $arrTerms = $this->modifyArrTermsForOutput($arrTerms, $taxonomy, $useCustomFields);
3134
 
3135
  return($arrTerms);
3136
  }
3137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3138
 
3139
  protected function z_______________USERS____________(){}
3140
 
@@ -3382,7 +3469,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
3382
  $data = $this->getListingData($value, $name, $processType, $param, $data);
3383
  break;
3384
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
3385
- $data[$name] = $this->getWPTermsData($value, $name, $processType, $param);
 
 
3386
  break;
3387
  case UniteCreatorDialogParam::PARAM_WOO_CATS:
3388
  $data[$name] = $this->getWooCatsData($value, $name, $processType, $param);
11
 
12
  private static $arrPostTypeTaxCache = array();
13
 
14
+
15
  /**
16
  * add other image thumbs based of the platform
17
  */
198
  $item["description"] = UniteFunctionsUC::getVal($arrTerm, "description");
199
  $item["link"] = UniteFunctionsUC::getVal($arrTerm, "link");
200
  $item["parent_id"] = UniteFunctionsUC::getVal($arrTerm, "parent_id");
201
+ $item["taxonomy"] = UniteFunctionsUC::getVal($arrTerm, "taxonomy");
202
 
203
  $index++;
204
 
560
 
561
  $content = UniteFunctionsUC::getVal($arrPost, "post_content");
562
 
563
+ //modify the content
564
+ $content = apply_filters("the_content", $content);
565
+
566
  $arrData["content"] = $content;
567
 
568
  $arrData["link"] = UniteFunctionsWPUC::getPermalink($post);
711
  //check the single page pagination
712
  $paginationType = UniteFunctionsUC::getVal($value, $name."_pagination_type");
713
 
 
714
  if(empty($paginationType))
715
  return($args);
716
 
717
+ $objFilters = new UniteCreatorFiltersProcess();
718
+ $isFrontAjax = $objFilters->isFrontAjaxRequest();
719
+
720
+ if($isFrontAjax == false){
721
+
722
+ if(is_archive() == true || is_home() == true)
723
+ return($args);
724
+ }
725
 
726
  $page = get_query_var("page", null);
727
 
742
 
743
  //save the last page for the pagination output
744
  GlobalsProviderUC::$lastPostQuery_page = $page;
745
+
746
  return($args);
747
  }
748
 
1572
  $args["post__in"] = array("0"); //no posts at all
1573
  }
1574
  }
1575
+
1576
  $args = $this->getPostListData_getPostGetFilters_pagination($args, $value, $name, $data);
1577
+
1578
  $args = $this->getPostListData_getCustomQueryFilters($args, $value, $name, $data);
1579
 
1580
  HelperUC::addDebug("Posts Query", $args);
1585
  echo "<div class='uc-debug-query-wrapper'>"; //start debug wrapper
1586
 
1587
  dmp("The Query Is:");
1588
+ dmp($args);
1589
  }
1590
 
1591
  $query = new WP_Query($args);
1601
  dmp("The finals query vars:");
1602
  dmp($originalQueryVars);
1603
 
1604
+ $this->showPostsDebugCallbacks($isForWoo);
 
 
 
 
 
 
 
 
1605
 
 
 
 
 
 
 
 
1606
  }
1607
 
1608
 
1628
  }
1629
 
1630
  //save last query and page
1631
+ $this->saveLastQueryAndPage($query,GlobalsProviderUC::QUERY_TYPE_CUSTOM);
1632
 
1633
  //remember duplicate posts
1634
  if($isAvoidDuplicates == true){
1648
  return($arrPosts);
1649
  }
1650
 
1651
+ /**
1652
+ * show modify callbacks for debug
1653
+ */
1654
+ private function showPostsDebugCallbacks($isForWoo = false){
1655
+
1656
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("posts_pre_query");
1657
+
1658
+ dmp("Query modify callbacks ( posts_pre_query ):");
1659
+ dmp($arrActions);
1660
+
1661
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("posts_orderby");
1662
+
1663
+ dmp("Query modify callbacks ( posts_orderby ):");
1664
+ dmp($arrActions);
1665
+
1666
+ if($isForWoo == true){
1667
+
1668
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("loop_shop_per_page");
1669
+
1670
+ dmp("Query modify callbacks ( loop_shop_per_page ):");
1671
+ dmp($arrActions);
1672
+
1673
+ $arrActions = UniteFunctionsWPUC::getFilterCallbacks("loop_shop_columns");
1674
+
1675
+ dmp("Query modify callbacks ( loop_shop_columns ):");
1676
+ dmp($arrActions);
1677
+
1678
+ //products change
1679
+ }
1680
+
1681
+ }
1682
+
1683
  /**
1684
  * save last query and page
1685
  */
1686
+ private function saveLastQueryAndPage($query, $type){
1687
 
1688
  GlobalsProviderUC::$lastPostQuery = $query;
1689
  GlobalsProviderUC::$lastPostQuery_page = 1;
1690
+ GlobalsProviderUC::$lastPostQuery_type = $type;
1691
 
1692
  $queryVars = $query->query;
1693
 
1714
  */
1715
  private function getPostListData_currentPosts($value, $name, $data){
1716
 
1717
+
1718
  //add debug for further use
1719
  HelperUC::addDebug("Getting Current Posts");
1720
 
1749
 
1750
  $currentQueryVars = $this->getPostListData_getCustomQueryFilters($currentQueryVars, $value, $name, $data);
1751
 
1752
+
1753
  $showDebugQuery = UniteFunctionsUC::getVal($value, "{$name}_show_query_debug");
1754
  $showDebugQuery = UniteFunctionsUC::strToBool($showDebugQuery);
1755
 
1756
  $debugType = null;
1757
+
1758
+ $isForWoo = false;
1759
  if($showDebugQuery == true){
1760
 
1761
+ $postType = UniteFunctionsUC::getVal($currentQueryVars, "post_type");
1762
+ if($postType == "product")
1763
+ $isForWoo = true;
1764
+
1765
  echo "<div class='uc-debug-query-wrapper'>"; //start debug wrapper
1766
 
1767
  dmp("Current Posts. The Query Is:");
1774
  }
1775
 
1776
  $query = $wp_query;
1777
+
1778
  if($currentQueryVars !== $wp_query->query_vars){
1779
 
1780
  HelperUC::addDebug("New Query", $currentQueryVars);
1781
 
1782
  $query = new WP_Query( $currentQueryVars );
1783
  }
1784
+
 
 
 
1785
 
1786
  HelperUC::addDebug("Query Vars", $currentQueryVars);
1787
 
1788
  //save last query
1789
+ $this->saveLastQueryAndPage($query, GlobalsProviderUC::QUERY_TYPE_CURRENT);
1790
 
1791
  $arrPosts = $query->posts;
1792
 
1793
  if(empty($arrPosts))
1794
  $arrPosts = array();
1795
 
1796
+ if($showDebugQuery == true && $debugType == "show_query"){
1797
+
1798
+ $originalQueryVars = $query->query_vars;
1799
+ $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
1800
+
1801
+ dmp("The Query Request Is:");
1802
+ dmp($query->request);
1803
+
1804
+ dmp("The finals query vars:");
1805
+ dmp($originalQueryVars);
1806
+
1807
+ $this->showPostsDebugCallbacks($isForWoo);
1808
+
1809
+ }
1810
+
1811
+
1812
  if($showDebugQuery == true){
1813
  dmp("Found Posts: ".count($arrPosts));
1814
 
1881
  $arrPosts = UniteFunctionsWPUC::orderPostsByIDs($arrPosts, $postIDs);
1882
 
1883
  //save last query
1884
+ $this->saveLastQueryAndPage($query,GlobalsProviderUC::QUERY_TYPE_MANUAL);
1885
+
1886
  HelperUC::addDebug("posts found: ".count($arrPosts));
1887
 
1888
  if($showDebugQuery == true){
3147
 
3148
  $originalQueryVars = $term_query->query_vars;
3149
  $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
3150
+
3151
  dmp("The Query Request Is:");
3152
  dmp($term_query->request);
3153
 
3154
  dmp("The finals query vars:");
3155
  dmp($originalQueryVars);
3156
 
 
 
 
3157
  $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_args");
3158
 
3159
  dmp("Query modify callbacks ( get_terms_args ):");
3173
 
3174
  if(!empty($arrExcludeSlugs) && is_array($arrExcludeSlugs))
3175
  $arrTermsObjects = UniteFunctionsWPUC::getTerms_filterBySlugs($arrTermsObjects, $arrExcludeSlugs);
3176
+
3177
  $arrTerms = UniteFunctionsWPUC::getTermsObjectsData($arrTermsObjects, $taxonomy);
3178
+
3179
  $arrTerms = $this->modifyArrTermsForOutput($arrTerms, $taxonomy, $useCustomFields);
3180
 
3181
  return($arrTerms);
3182
  }
3183
 
3184
+ /**
3185
+ * get terms smart data, accordion if it's filter or not
3186
+ */
3187
+ private function getTermsSmartData($data, $value, $name, $processType, $param){
3188
+
3189
+ //check if filter
3190
+
3191
+ $filterExists = false;
3192
+ $isFilter = false;
3193
+ $isInitAfter = false;
3194
+
3195
+ if(!$value)
3196
+ $value = array();
3197
+
3198
+ if(array_key_exists($name."_is_filter", $value)){
3199
+
3200
+ $filterExists = true;
3201
+ $isFilter = UniteFunctionsUC::getVal($value, $name."_is_filter");
3202
+ $isFilter = UniteFunctionsUC::strToBool($isFilter);
3203
+
3204
+ $isInitAfter = UniteFunctionsUC::getVal($value, $name."_init_after_grid");
3205
+ $isInitAfter = UniteFunctionsUC::strToBool($isInitAfter);
3206
+ }
3207
+
3208
+ $arrTerms = $this->getWPTermsData($value, $name, $processType, $param);
3209
+
3210
+ $data[$name] = $arrTerms;
3211
+
3212
+ if($filterExists == true){
3213
+ $data["is_filter"] = $isFilter?"true":"false";
3214
+ }
3215
+
3216
+ //add fitler arguments
3217
+ $objFilters = new UniteCreatorFiltersProcess();
3218
+ $data = $objFilters->addEditorFilterArguments($data, $isInitAfter);
3219
+
3220
+
3221
+
3222
+ return($data);
3223
+ }
3224
+
3225
 
3226
  protected function z_______________USERS____________(){}
3227
 
3469
  $data = $this->getListingData($value, $name, $processType, $param, $data);
3470
  break;
3471
  case UniteCreatorDialogParam::PARAM_POST_TERMS:
3472
+
3473
+ $data = $this->getTermsSmartData($data, $value, $name, $processType, $param);
3474
+
3475
  break;
3476
  case UniteCreatorDialogParam::PARAM_WOO_CATS:
3477
  $data[$name] = $this->getWooCatsData($value, $name, $processType, $param);
provider/provider_settings.class.php CHANGED
@@ -375,18 +375,56 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
375
 
376
  $isForWooCommerce = UniteFunctionsUC::getVal($extra, "for_woocommerce");
377
  $isForWooCommerce = UniteFunctionsUC::strToBool($isForWooCommerce);
 
 
 
 
 
 
 
378
 
379
  $arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
380
 
381
  if($isForWooCommerce == true)
382
  $arrPostTypesWithTax = array("product" => $arrPostTypesWithTax["product"]);
383
-
 
 
384
  $taxData = $this->addPostTermsPicker_getArrTaxonomies($arrPostTypesWithTax);
385
 
386
  $arrPostTypesTaxonomies = $taxData["post_type_tax"];
387
 
388
  $arrTaxonomiesSimple = $taxData["taxonomies_simple"];
389
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  //----- add post types ---------
391
 
392
  //prepare post types array
@@ -1855,7 +1893,6 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
1855
  $arrType = array();
1856
  $arrType["basic"] = __("Basic", "unlimited-elements-for-elementor");
1857
  $arrType["show_query"] = __("Full", "unlimited-elements-for-elementor");
1858
- $arrType["show_debug_text"] = __("Show Debug Text", "unlimited-elements-for-elementor");
1859
 
1860
  $arrType = array_flip($arrType);
1861
 
375
 
376
  $isForWooCommerce = UniteFunctionsUC::getVal($extra, "for_woocommerce");
377
  $isForWooCommerce = UniteFunctionsUC::strToBool($isForWooCommerce);
378
+
379
+ $filterType = UniteFunctionsUC::getVal($extra, "filter_type");
380
+
381
+ $addFilterOptions = false;
382
+ if($filterType == "filter_option")
383
+ $addFilterOptions = true;
384
+
385
 
386
  $arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
387
 
388
  if($isForWooCommerce == true)
389
  $arrPostTypesWithTax = array("product" => $arrPostTypesWithTax["product"]);
390
+
391
+
392
+
393
  $taxData = $this->addPostTermsPicker_getArrTaxonomies($arrPostTypesWithTax);
394
 
395
  $arrPostTypesTaxonomies = $taxData["post_type_tax"];
396
 
397
  $arrTaxonomiesSimple = $taxData["taxonomies_simple"];
398
+
399
+ // ------ add filter options -----
400
+
401
+ if($addFilterOptions == true){
402
+
403
+ $params = array();
404
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
405
+ $params["description"] = __("If turned on, the widget will be used as a filter for ajax posts", "unlimited-elements-for-elementor");
406
+
407
+ $this->addRadioBoolean($name."_is_filter", __("Use As Posts Filter", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
408
+
409
+ //---------- show when ---------
410
+
411
+ $params = array();
412
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_RADIOBOOLEAN;
413
+ $params["description"] = __("Show the widget by ajax request after the grid has loaded, only relevant terms from the chosen, according chosen grid posts.", "unlimited-elements-for-elementor");
414
+
415
+ $this->addRadioBoolean($name."_init_after_grid", __("Init After Grid", "unlimited-elements-for-elementor"), false, "Yes", "No", $params);
416
+
417
+
418
+
419
+ //---------- add hr ---------
420
+
421
+ $params = array();
422
+ $params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
423
+ $this->addHr($name."_after_filter_checkbox",$params);
424
+
425
+ }
426
+
427
+
428
  //----- add post types ---------
429
 
430
  //prepare post types array
1893
  $arrType = array();
1894
  $arrType["basic"] = __("Basic", "unlimited-elements-for-elementor");
1895
  $arrType["show_query"] = __("Full", "unlimited-elements-for-elementor");
 
1896
 
1897
  $arrType = array_flip($arrType);
1898
 
readme.txt CHANGED
@@ -91,17 +91,20 @@ Fully compatible and integrated with Toolset custom post types and fields.
91
 
92
  <h3>Creative Widgets for Elementor</h3>
93
  <ol>
94
- <li><a href="https://unlimited-elements.com/lordicon-animated-icons-widget-for-elementor/">Lordicon: Animated Icons Widget for Elementor (Free)</a> - The most powerful animated icon library with 1500+ free and premium animated Lottie animations.</li>
95
- <li><a href="https://unlimited-elements.com/material-bullets-widget-for-elementor">Material Bullets Widget for Elementor (Free)</a> - Display feature lists with custom icons and styles. Each list item can have its own icon title and text. Use the bullets widget to display features and highlights on your Elementor website.</li>
96
- <li><a href="https://unlimited-elements.com/animated-hamburger-icon-for-elementor/">Animated Hamburger Icon Widget for Elementor (Free)</a> - Use the animated hamburger icon widget to toggle Elementor pro popus. You can even put a menu in a popup and create a full screen menu.</li>
97
  <li><a href="https://unlimited-elements.com/blob-shape-widget-for-elementor/">Blob Shapes Widget for Elementor (Free)</a> - Create Blob Shapes with animated morphing effects. This free Elementor widget will help you make your images into random, unique, and organic-looking blob shapes. </li>
98
  <li><a href="https://unlimited-elements.com/timeline-bullets-widget-for-elementor/">Timeline Bullets Widget for Elementor (Free)</a> - List your features or services using bullet points in a timeline layout to make it easier for users to read the important information.</li>
 
 
 
99
  <li><a href="https://unlimited-elements.com/image-tooltip-widget-for-elementor/">Image Tooltip Widget for Elementor (Free)</a> - The easiest way to set a tooltip to any Image on the page with a short text description or any HTML code.</li>
 
 
100
  <li><a href="https://unlimited-elements.com/svg-animation-widget-for-elementor">SVG Animation Widget for Elementor (Free)</a> - The SVG animation widget for Elementor makes it easy -to create impressive SVG animations for your websitet, without any coding skills just copy paste your SVG code and your animated icon is ready.</li>
101
- <li><a href="https://unlimited-elements.com/flip-box-widget-for-elementor/">Flip Box Widget for Elementor (Free)</a> - Make your content more interesting with the Elementor Flip Box widget. Use the animated Flip Boxes to highlight any content inside your page with a flip effect.</li>
102
  <li><a href="https://unlimited-elements.com/animated-mouse-scroll-icon-widget-for-elementor/">Animated Mouse Scroll Icon Widget for Elementor (Free)</a> - The Animated Mouse Scroll Icon is a small micro animation that indicates to user they needs to scroll the page. You can make the icon an anchor point which scroll down to any section when clicked on.
103
  </li>
104
- <li><a href="https://unlimited-elements.com/number-box-widget-widget-for-elementor/">Number Box Widget for Elementor (Free)</a> - Create stunning number blocks with various styles. The Number Box widget for Elementor helps you display content for step by step diagrams and instructions.</li>
 
 
105
  <li><a href="https://unlimited-elements.com/icon-accordion-widget-for-elementor/">Icon Accordion Widget for Elementor (Pro)</a> - Advanced accordion addon for Elementor page builder offers multiple styles to create interactive collapsable content with multiple layouts on your page.</li>
106
  <li><a href="https://unlimited-elements.com/image-shapes-for-elementor-page-builder/">Image Shapes Widget for Elementor (Pro)</a> - The Image Shapes Elementor Widget allows you to make complex shape addons by clipping images using CSS to make various element layouts: circle, ellipse, polygon and more.</li>
107
  <li><a href="https://unlimited-elements.com/image-particle-widget-for-elementor/">Particle Image Widget for Elementor (Pro)</a> - Create a dispersion interactive mouse aware distortion effect for any image using the Particle Image widget for Elementor.</li>
@@ -109,36 +112,34 @@ Fully compatible and integrated with Toolset custom post types and fields.
109
  <li><a href="https://unlimited-elements.com/background-switcher-widget-for-elementor/">Background Switcher Widget for Elementor (Pro)</a> - The background switcher addon lets you set up cool content boxes. When you hover over a box it will change the background for the whole section. </li>
110
  <li><a href="https://unlimited-elements.com/before-after-image-comparison-widget-for-elementor/">Before After Widget for Elementor (Pro)</a> - The Before After widget is an image comparison addon for Elementor. This widget allows you to create the effect for comparing two before and after images.</li>
111
  <li><a href="https://unlimited-elements.com/audio-player-widget-for-elementor/">Audio Player Widget for Elementor (Pro)</a> - MP3 Music Player is a very easy to use Audio Player for Elementor. It gives you the ability to add unlimited audio tracks to any page using our Elementor addon let users listen to music on your website. </li>
112
- <li><a href="https://unlimited-elements.com/interactive-circle-infographic-widget-for-elementor/">Interactive Circle Infographic Widget for Elementor (Pro)</a> - The Circle Infographic widget for Elementor is a simple and engaging way to present data, processes, concepts, structures and more. Helps your audience understand an entire cycle using a circular interactive tab layout.
113
-
114
- </li>
115
  <li><a href="https://unlimited-elements.com/hotspots-for-elementor-page-builder/">Hotspots Widget for Elementor (Pro)</a> - Add hotspots to your images with a tooltip an option for opening a built in popup. Each hotspot popup can contain and image and description text.</li>
116
  <li><a href="https://unlimited-elements.com/icon-tabs-widget-for-elementor">Icon Tabs Widget for Elementor (Pro)</a> - The Tab Widget for Elementor will help you show your text on your page divided into horizontal or vertical tabs. Customize your tabs using icons and make the content on your website interactive and fun to read.</li>
117
  <li><a href="https://unlimited-elements.com/image-accordion-widget-for-elementor/">Image Accordion Widget for Elementor (Pro)</a> - Our image accordion addon for Elementor highlights your images with amazing hover effects and interactive layouts.</li>
118
  <li><a href="https://unlimited-elements.com/shape-bullets-widget-for-elementor/">Shape Bullets Widget for Elementor (Pro)</a> - The Shape Bullets Widget for Elementor, creates an easy-to-manage bulleted list of items. Each item can be highlighted by its own icon.
119
  </li>
120
- <li><a href="https://unlimited-elements.com/audio-playlist-widget-for-elementor">Audio Playlist Widget for Elementor (Pro)</a> - Create MP3 Audio Playlists inside of Elementor. Use this widget to add the ability to create unlimited numbers of playlists, albums, and audio tracks.</li>
121
  <li><a href="https://unlimited-elements.com/image-reveal-on-scroll-widget-for-elementor">Image Reveal On Scroll Widget for Elementor (Pro)</a> - The Image Reveal on Scroll widget adds an awesome reveal on scroll effect to your images to spice up your Elementor website design.</li>
122
  </ol>
123
 
124
  <h3>Post Widgets for Elementor</h3>
125
  <ol>
126
- <li><a href="https://unlimited-elements.com/post-accordions-for-elementor/">Post Accordion Widget for Elementor (Free)</a></li>
127
  <li><a href="https://unlimited-elements.com/post-pagination-widget-for-elementor/">Post Pagination Widget for Elementor (Free)</a></li>
128
  <li><a href="https://unlimited-elements.com/post-blocks-widget-for-elementor">Post Blocks Widget for Elementor (Free)</a></li>
129
  <li><a href="https://unlimited-elements.com/post-list-widget-for-elementor">Post List Widget for Elementor (Free)</a></li>
 
130
  <li><a href="https://unlimited-elements.com/post-news-ticker-widget-for-elementor">Post Ticker Widget for Elementor (Free)</a></li>
131
  <li><a href="https://unlimited-elements.com/post-tabs-for-elementor/">Post Tabs Widget for Elementor (Free)</a></li>
132
  <li><a href="https://unlimited-elements.com/card-post-carousel-widget-for-elementor">Card Post Carousel Widget for Elementor (Free)</a></li>
 
 
133
  <li><a href="https://unlimited-elements.com/post-gallery-widget-for-elementor">Post Gallery Widget for Elementor (Pro)</a></li>
134
  <li><a href="https://unlimited-elements.com/elementor-author-list-widget/">Author List Widget for Elementor (Pro)</a></li>
135
  <li><a href="https://unlimited-elements.com/masonry-post-grid-widget-for-elementor">Masonry Post Grid Widget for Elementor (Pro)</a></li>
136
  <li><a href="https://unlimited-elements.com/taxonomy-terms-widget-for-elementor/">Taxonomy Terms Widget for Elementor (Pro)</a></li>
137
  <li><a href="https://unlimited-elements.com/post-tiles-widget-for-elementor">Post Tile Widget for Elementor (Pro)</a></li>
138
- <li><a href="https://unlimited-elements.com/post-magazine-grid-widget-for-elementor/">Post Magazine Grid Widget for Elementor (Pro)</a></li>
139
  <li><a href="https://unlimited-elements.com/post-timeline-widget-for-elementor/">Post Timeline Widget for Elementor (Pro)</a></li>
140
  <li><a href="https://unlimited-elements.com/post-sliders/">Post Slider Widget for Elementor (Pro)</a></li>
141
- <li><a href="https://unlimited-elements.com/blog-card-slider-widget-for-elementor">Post Card Slider Widget for Elementor (Pro)</a></li>
142
  <li><a href="https://unlimited-elements.com/post-carousels-for-elementor/">Post Carousel Widget for Elementor (Pro)</a></li>
143
  <li><a href="https://unlimited-elements.com/post-scroll-widget-for-elementor">Post Scroll Widget for Elementor (Pro)</a></li>
144
  <li><a href="https://unlimited-elements.com/post-grid">Post Grid Widget for Elementor (Pro)</a></li>
@@ -446,6 +447,8 @@ https://github.com/ykob/shape-overlays</li>
446
 
447
 
448
 
 
 
449
  == Installation ==
450
 
451
  Note : This plugin works with Elementor. Make sure you have [Elementor](https://wordpress.org/plugins/elementor/) installed.
@@ -456,6 +459,31 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
456
 
457
  == Changelog ==
458
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
  version 1.4.85 = 2021-10-13:
460
 
461
  -bug fix: small bug fix - headers sent bug
91
 
92
  <h3>Creative Widgets for Elementor</h3>
93
  <ol>
 
 
 
94
  <li><a href="https://unlimited-elements.com/blob-shape-widget-for-elementor/">Blob Shapes Widget for Elementor (Free)</a> - Create Blob Shapes with animated morphing effects. This free Elementor widget will help you make your images into random, unique, and organic-looking blob shapes. </li>
95
  <li><a href="https://unlimited-elements.com/timeline-bullets-widget-for-elementor/">Timeline Bullets Widget for Elementor (Free)</a> - List your features or services using bullet points in a timeline layout to make it easier for users to read the important information.</li>
96
+ <li><a href="https://unlimited-elements.com/animated-hamburger-icon-for-elementor/">Animated Hamburger Icon Widget for Elementor (Free)</a> - Use the animated hamburger icon widget to toggle Elementor pro popus. You can even put a menu in a popup and create a full screen menu.</li>
97
+ <li><a href="https://unlimited-elements.com/flip-box-widget-for-elementor/">Flip Box Widget for Elementor (Free)</a> - Make your content more interesting with the Elementor Flip Box widget. Use the animated Flip Boxes to highlight any content inside your page with a flip effect.</li>
98
+ <li><a href="https://unlimited-elements.com/lordicon-animated-icons-widget-for-elementor/">Lordicon: Animated Icons Widget for Elementor (Free)</a> - The most powerful animated icon library with 1500+ free and premium animated Lottie animations.</li>
99
  <li><a href="https://unlimited-elements.com/image-tooltip-widget-for-elementor/">Image Tooltip Widget for Elementor (Free)</a> - The easiest way to set a tooltip to any Image on the page with a short text description or any HTML code.</li>
100
+ <li><a href="https://unlimited-elements.com/number-box-widget-widget-for-elementor/">Number Box Widget for Elementor (Free)</a> - Create stunning number blocks with various styles. The Number Box widget for Elementor helps you display content for step by step diagrams and instructions.</li>
101
+ <li><a href="https://unlimited-elements.com/material-bullets-widget-for-elementor">Material Bullets Widget for Elementor (Free)</a> - Display feature lists with custom icons and styles. Each list item can have its own icon title and text. Use the bullets widget to display features and highlights on your Elementor website.</li>
102
  <li><a href="https://unlimited-elements.com/svg-animation-widget-for-elementor">SVG Animation Widget for Elementor (Free)</a> - The SVG animation widget for Elementor makes it easy -to create impressive SVG animations for your websitet, without any coding skills just copy paste your SVG code and your animated icon is ready.</li>
 
103
  <li><a href="https://unlimited-elements.com/animated-mouse-scroll-icon-widget-for-elementor/">Animated Mouse Scroll Icon Widget for Elementor (Free)</a> - The Animated Mouse Scroll Icon is a small micro animation that indicates to user they needs to scroll the page. You can make the icon an anchor point which scroll down to any section when clicked on.
104
  </li>
105
+ <li><a href="https://unlimited-elements.com/interactive-circle-infographic-widget-for-elementor/">Interactive Circle Infographic Widget for Elementor (Pro)</a> - The Circle Infographic widget for Elementor is a simple and engaging way to present data, processes, concepts, structures and more. Helps your audience understand an entire cycle using a circular interactive tab layout.
106
+
107
+ </li>
108
  <li><a href="https://unlimited-elements.com/icon-accordion-widget-for-elementor/">Icon Accordion Widget for Elementor (Pro)</a> - Advanced accordion addon for Elementor page builder offers multiple styles to create interactive collapsable content with multiple layouts on your page.</li>
109
  <li><a href="https://unlimited-elements.com/image-shapes-for-elementor-page-builder/">Image Shapes Widget for Elementor (Pro)</a> - The Image Shapes Elementor Widget allows you to make complex shape addons by clipping images using CSS to make various element layouts: circle, ellipse, polygon and more.</li>
110
  <li><a href="https://unlimited-elements.com/image-particle-widget-for-elementor/">Particle Image Widget for Elementor (Pro)</a> - Create a dispersion interactive mouse aware distortion effect for any image using the Particle Image widget for Elementor.</li>
112
  <li><a href="https://unlimited-elements.com/background-switcher-widget-for-elementor/">Background Switcher Widget for Elementor (Pro)</a> - The background switcher addon lets you set up cool content boxes. When you hover over a box it will change the background for the whole section. </li>
113
  <li><a href="https://unlimited-elements.com/before-after-image-comparison-widget-for-elementor/">Before After Widget for Elementor (Pro)</a> - The Before After widget is an image comparison addon for Elementor. This widget allows you to create the effect for comparing two before and after images.</li>
114
  <li><a href="https://unlimited-elements.com/audio-player-widget-for-elementor/">Audio Player Widget for Elementor (Pro)</a> - MP3 Music Player is a very easy to use Audio Player for Elementor. It gives you the ability to add unlimited audio tracks to any page using our Elementor addon let users listen to music on your website. </li>
115
+ <li><a href="https://unlimited-elements.com/audio-playlist-widget-for-elementor">Audio Playlist Widget for Elementor (Pro)</a> - Create MP3 Audio Playlists inside of Elementor. Use this widget to add the ability to create unlimited numbers of playlists, albums, and audio tracks.</li>
 
 
116
  <li><a href="https://unlimited-elements.com/hotspots-for-elementor-page-builder/">Hotspots Widget for Elementor (Pro)</a> - Add hotspots to your images with a tooltip an option for opening a built in popup. Each hotspot popup can contain and image and description text.</li>
117
  <li><a href="https://unlimited-elements.com/icon-tabs-widget-for-elementor">Icon Tabs Widget for Elementor (Pro)</a> - The Tab Widget for Elementor will help you show your text on your page divided into horizontal or vertical tabs. Customize your tabs using icons and make the content on your website interactive and fun to read.</li>
118
  <li><a href="https://unlimited-elements.com/image-accordion-widget-for-elementor/">Image Accordion Widget for Elementor (Pro)</a> - Our image accordion addon for Elementor highlights your images with amazing hover effects and interactive layouts.</li>
119
  <li><a href="https://unlimited-elements.com/shape-bullets-widget-for-elementor/">Shape Bullets Widget for Elementor (Pro)</a> - The Shape Bullets Widget for Elementor, creates an easy-to-manage bulleted list of items. Each item can be highlighted by its own icon.
120
  </li>
 
121
  <li><a href="https://unlimited-elements.com/image-reveal-on-scroll-widget-for-elementor">Image Reveal On Scroll Widget for Elementor (Pro)</a> - The Image Reveal on Scroll widget adds an awesome reveal on scroll effect to your images to spice up your Elementor website design.</li>
122
  </ol>
123
 
124
  <h3>Post Widgets for Elementor</h3>
125
  <ol>
 
126
  <li><a href="https://unlimited-elements.com/post-pagination-widget-for-elementor/">Post Pagination Widget for Elementor (Free)</a></li>
127
  <li><a href="https://unlimited-elements.com/post-blocks-widget-for-elementor">Post Blocks Widget for Elementor (Free)</a></li>
128
  <li><a href="https://unlimited-elements.com/post-list-widget-for-elementor">Post List Widget for Elementor (Free)</a></li>
129
+ <li><a href="https://unlimited-elements.com/load-more-infinite-scroll-widget-for-elementor/">Load More / Infinite Scroll Widget for Elementor (Free)</a> - Add a load more button to your post or product grids. You can even make an infinite scroll effect that works with AJAX.</li>
130
  <li><a href="https://unlimited-elements.com/post-news-ticker-widget-for-elementor">Post Ticker Widget for Elementor (Free)</a></li>
131
  <li><a href="https://unlimited-elements.com/post-tabs-for-elementor/">Post Tabs Widget for Elementor (Free)</a></li>
132
  <li><a href="https://unlimited-elements.com/card-post-carousel-widget-for-elementor">Card Post Carousel Widget for Elementor (Free)</a></li>
133
+ <li><a href="https://unlimited-elements.com/post-accordions-for-elementor/">Post Accordion Widget for Elementor (Free)</a></li>
134
+ <li><a href="https://unlimited-elements.com/post-magazine-grid-widget-for-elementor/">Post Magazine Grid Widget for Elementor (Pro)</a></li>
135
  <li><a href="https://unlimited-elements.com/post-gallery-widget-for-elementor">Post Gallery Widget for Elementor (Pro)</a></li>
136
  <li><a href="https://unlimited-elements.com/elementor-author-list-widget/">Author List Widget for Elementor (Pro)</a></li>
137
  <li><a href="https://unlimited-elements.com/masonry-post-grid-widget-for-elementor">Masonry Post Grid Widget for Elementor (Pro)</a></li>
138
  <li><a href="https://unlimited-elements.com/taxonomy-terms-widget-for-elementor/">Taxonomy Terms Widget for Elementor (Pro)</a></li>
139
  <li><a href="https://unlimited-elements.com/post-tiles-widget-for-elementor">Post Tile Widget for Elementor (Pro)</a></li>
140
+ <li><a href="https://unlimited-elements.com/blog-card-slider-widget-for-elementor">Post Card Slider Widget for Elementor (Pro)</a></li>
141
  <li><a href="https://unlimited-elements.com/post-timeline-widget-for-elementor/">Post Timeline Widget for Elementor (Pro)</a></li>
142
  <li><a href="https://unlimited-elements.com/post-sliders/">Post Slider Widget for Elementor (Pro)</a></li>
 
143
  <li><a href="https://unlimited-elements.com/post-carousels-for-elementor/">Post Carousel Widget for Elementor (Pro)</a></li>
144
  <li><a href="https://unlimited-elements.com/post-scroll-widget-for-elementor">Post Scroll Widget for Elementor (Pro)</a></li>
145
  <li><a href="https://unlimited-elements.com/post-grid">Post Grid Widget for Elementor (Pro)</a></li>
447
 
448
 
449
 
450
+
451
+
452
  == Installation ==
453
 
454
  Note : This plugin works with Elementor. Make sure you have [Elementor](https://wordpress.org/plugins/elementor/) installed.
459
 
460
  == Changelog ==
461
 
462
+ version 1.4.86 = 2021-11-08:
463
+
464
+ -Fix: fixed gutenberg support in widgets
465
+ -Fix: fixed all the pagination issues in archive page
466
+
467
+
468
+ version 1.4.86 = 2021-11-01:
469
+
470
+ -Fix: fixed some load more last issues
471
+ -Feature: added code for taxonomy terms filter
472
+ -Feature: added code for checkbox filter
473
+
474
+
475
+ version 1.4.86 = 2021-10-29:
476
+
477
+ -Feature: improved current query debug - full type
478
+ -Feature: added dropdown responsive placeholders
479
+ -Feature: added radio boolean attribute responsive controls
480
+
481
+ -Fix: fixed controls tabs functionality
482
+ -Fix: fixed load more custom image bug
483
+ -Fix: fixed double load more in a page mishmash bug
484
+ -Fix: fixed all load more issues
485
+
486
+
487
  version 1.4.85 = 2021-10-13:
488
 
489
  -bug fix: small bug fix - headers sent bug
release_log.txt CHANGED
@@ -1,4 +1,32 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  version 1.4.84:
3
 
4
  -bug fix: fixed conflicting wordpress codemirror script
1
 
2
+ version 1.4.88:
3
+
4
+ -bug fix: fixed gutenberg support in widgets
5
+ -bug fix: fixed all the pagination issues in archive page
6
+
7
+ version 1.4.87:
8
+
9
+ -bug fix: fixed some load more last issues
10
+ -feature: added code for taxonomy terms filter
11
+ -feature: added code for checkbox filter
12
+
13
+
14
+ version 1.4.86:
15
+
16
+ -feature: improved current query debug - full type
17
+ -feature: added dropdown responsive placeholders
18
+ -feature: added radio boolean attribute responsive controls
19
+
20
+ -bug fix: fixed controls tabs functionality
21
+ -bug fix: fixed load more custom image bug
22
+ -bug fix: fixed double load more in a page mishmash bug
23
+ -bug fix: fixed all load more issues
24
+
25
+
26
+ version 1.4.85:
27
+
28
+ -bug fix: fixed headers already started bug
29
+
30
  version 1.4.84:
31
 
32
  -bug fix: fixed conflicting wordpress codemirror script
unlimited_elements.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Unlimited Elements for Elementor
4
  Plugin URI: http://unlimited-elements.com
5
  Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
6
  Author: Unlimited Elements
7
- Version: 1.4.85
8
  Author URI: http://unlimited-elements.com
9
  Text Domain: unlimited-elements-for-elementor
10
  Domain Path: /languages
4
  Plugin URI: http://unlimited-elements.com
5
  Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
6
  Author: Unlimited Elements
7
+ Version: 1.4.88
8
  Author URI: http://unlimited-elements.com
9
  Text Domain: unlimited-elements-for-elementor
10
  Domain Path: /languages
views/objects/addon_view.class.php CHANGED
@@ -1519,6 +1519,8 @@ class UniteCreatorAddonView{
1519
  $arrAddKeys[UniteCreatorDialogParam::PARAM_ICON_LIBRARY] = $this->objChildParams->getAddParams_iconLibrary();
1520
  $arrAddKeys[UniteCreatorDialogParam::PARAM_LINK] = $this->objChildParams->getAddParams_link();
1521
  $arrAddKeys[UniteCreatorDialogParam::PARAM_SLIDER] = $this->objChildParams->getAddParams_slider();
 
 
1522
 
1523
  $arrAddKeys[UniteCreatorDialogParam::PARAM_MENU] = $this->objChildParams->getAddParams_menu();
1524
  $arrAddKeys[UniteCreatorDialogParam::PARAM_TEMPLATE] = $this->objChildParams->getAddParams_template();
1519
  $arrAddKeys[UniteCreatorDialogParam::PARAM_ICON_LIBRARY] = $this->objChildParams->getAddParams_iconLibrary();
1520
  $arrAddKeys[UniteCreatorDialogParam::PARAM_LINK] = $this->objChildParams->getAddParams_link();
1521
  $arrAddKeys[UniteCreatorDialogParam::PARAM_SLIDER] = $this->objChildParams->getAddParams_slider();
1522
+ $arrAddKeys[UniteCreatorDialogParam::PARAM_DROPDOWN] = $this->objChildParams->getAddParams_dropdown();
1523
+ $arrAddKeys[UniteCreatorDialogParam::PARAM_RADIOBOOLEAN] = $this->objChildParams->getAddParams_dropdown();
1524
 
1525
  $arrAddKeys[UniteCreatorDialogParam::PARAM_MENU] = $this->objChildParams->getAddParams_menu();
1526
  $arrAddKeys[UniteCreatorDialogParam::PARAM_TEMPLATE] = $this->objChildParams->getAddParams_template();
views/objects/addon_view_childparams.class.php CHANGED
@@ -1340,6 +1340,24 @@ function {{uc_id}}_start(){
1340
  return($arrParams);
1341
  }
1342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1343
  /**
1344
  * get post child params
1345
  */
1340
  return($arrParams);
1341
  }
1342
 
1343
+ /**
1344
+ * get post child params
1345
+ */
1346
+ public function getAddParams_dropdown(){
1347
+
1348
+ $arrParams = array();
1349
+
1350
+ $arrParams[] = $this->createAddParam();
1351
+
1352
+ $addParams = array("condition"=>"responsive");
1353
+
1354
+ $arrParams[] = $this->createAddParam("tablet", $addParams);
1355
+ $arrParams[] = $this->createAddParam("mobile", $addParams);
1356
+
1357
+ return($arrParams);
1358
+ }
1359
+
1360
+
1361
  /**
1362
  * get post child params
1363
  */