Version Description
Download this release
Release Info
Developer | unitecms |
Plugin | Unlimited Elements For Elementor (Free Widgets, Addons, Templates) |
Version | 1.4.73 |
Comparing to | |
See all releases |
Code changes from version 1.4.70 to 1.4.73
- assets_libraries/filters/ue_filters.js +412 -0
- inc_php/framework/functions.class.php +55 -1
- inc_php/framework/settings_output.class.php +3 -0
- inc_php/unitecreator_addon.class.php +5 -3
- inc_php/unitecreator_addons.class.php +1 -0
- inc_php/unitecreator_client_text.php +1 -0
- inc_php/unitecreator_dialog_param.class.php +61 -4
- inc_php/unitecreator_filters_process.class.php +274 -118
- inc_php/unitecreator_globals.class.php +1 -1
- inc_php/unitecreator_helper.class.php +1 -1
- inc_php/unitecreator_helperhtml.class.php +47 -0
- inc_php/unitecreator_output.class.php +41 -7
- inc_php/unitecreator_params_processor.class.php +17 -7
- inc_php/unitecreator_settings.class.php +29 -2
- inc_php/unitecreator_template_engine.class.php +128 -31
- includes.php +1 -1
- js/settings.js +57 -3
- js/unitecreator_addon_config.js +16 -7
- js/unitecreator_admin.js +18 -5
- js/unitecreator_includes.js +60 -1
- js/unitecreator_params_dialog.js +77 -19
- provider/acf_integrate.class.php +14 -7
- provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js +11 -5
- provider/core/plugins/unlimited_elements/elementor/elementor_dynamic_visibility.class.php +425 -0
- provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php +53 -2
- provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +120 -31
- provider/core/plugins/unlimited_elements/elementor/pagination.class.php +37 -92
- provider/core/plugins/unlimited_elements/globals.class.php +0 -3
- provider/core/plugins/unlimited_elements/helper_provider_core.class.php +138 -0
- provider/core/plugins/unlimited_elements/plugin.php +1 -0
- provider/core/plugins/unlimited_elements/provider_core_front.class.php +7 -1
- provider/core/plugins/unlimited_elements/settings/general_settings_el.xml +8 -0
- provider/core/plugins/unlimited_elements/views/settingselementor.php +4 -0
- provider/functions_wordpress.class.php +153 -13
- provider/provider_dialog_param.class.php +2 -1
- provider/provider_functions.class.php +6 -1
- provider/provider_globals.class.php +10 -0
- provider/provider_helper.class.php +1 -1
- provider/provider_operations.class.php +1 -0
- provider/provider_params_processor.class.php +314 -17
- provider/provider_settings.class.php +99 -17
- provider/provider_template_engine.class.php +0 -1
- provider/woocommerce_integrate.class.php +12 -2
- readme.txt +33 -0
- release_log.txt +32 -0
- unlimited_elements.php +3 -3
- views/objects/addon_view.class.php +28 -0
- views/objects/addon_view_childparams.class.php +48 -8
assets_libraries/filters/ue_filters.js
ADDED
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
function UEListingFilters(){
|
3 |
+
|
4 |
+
var g_objFilters, g_objListing, g_listingData, g_urlBase;
|
5 |
+
|
6 |
+
var g_types = {
|
7 |
+
CHECKBOX:"checkbox"
|
8 |
+
};
|
9 |
+
|
10 |
+
|
11 |
+
/**
|
12 |
+
* console log some string
|
13 |
+
*/
|
14 |
+
function trace(str){
|
15 |
+
console.log(str);
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* get object property
|
20 |
+
*/
|
21 |
+
function getVal(obj, name, defaultValue){
|
22 |
+
|
23 |
+
if(!defaultValue)
|
24 |
+
var defaultValue = "";
|
25 |
+
|
26 |
+
var val = "";
|
27 |
+
|
28 |
+
if(!obj || typeof obj != "object")
|
29 |
+
val = defaultValue;
|
30 |
+
else if(obj.hasOwnProperty(name) == false){
|
31 |
+
val = defaultValue;
|
32 |
+
}else{
|
33 |
+
val = obj[name];
|
34 |
+
}
|
35 |
+
|
36 |
+
return(val);
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
/**
|
41 |
+
* get filter type
|
42 |
+
*/
|
43 |
+
function getFilterType(objFilter){
|
44 |
+
|
45 |
+
if(objFilter.is(":checkbox"))
|
46 |
+
return(g_types.CHECKBOX);
|
47 |
+
|
48 |
+
return(null);
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* clear filter
|
54 |
+
*/
|
55 |
+
function clearFilter(objFilter){
|
56 |
+
|
57 |
+
var type = getFilterType(objFilter);
|
58 |
+
|
59 |
+
switch(type){
|
60 |
+
case g_types.CHECKBOX:
|
61 |
+
objFilter.prop("checked", false);
|
62 |
+
break;
|
63 |
+
}
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* clear filters
|
70 |
+
*/
|
71 |
+
function clearFilters(checkActive){
|
72 |
+
|
73 |
+
jQuery.each(g_objFilters,function(index, filter){
|
74 |
+
|
75 |
+
var objFilter = jQuery(filter);
|
76 |
+
|
77 |
+
if(checkActive == true){
|
78 |
+
|
79 |
+
var isActive = objFilter.data("active");
|
80 |
+
if(isActive == "yes")
|
81 |
+
return(true);
|
82 |
+
}
|
83 |
+
|
84 |
+
clearFilter(objFilter);
|
85 |
+
|
86 |
+
});
|
87 |
+
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* get filter data
|
92 |
+
*/
|
93 |
+
function getFilterData(objFilter){
|
94 |
+
|
95 |
+
var objData = {};
|
96 |
+
|
97 |
+
var type = getFilterType(objFilter);
|
98 |
+
|
99 |
+
var type = objFilter.data("type");
|
100 |
+
|
101 |
+
objData["type"] = type;
|
102 |
+
|
103 |
+
switch(type){
|
104 |
+
case "term":
|
105 |
+
var taxonomy = objFilter.data("taxonomy");
|
106 |
+
var term = objFilter.data("term");
|
107 |
+
|
108 |
+
objData["taxonomy"] = taxonomy;
|
109 |
+
objData["term"] = term;
|
110 |
+
break;
|
111 |
+
default:
|
112 |
+
throw new Error("getFilterData error: wrong data type: "+type);
|
113 |
+
break;
|
114 |
+
}
|
115 |
+
|
116 |
+
return(objData);
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* check if the filter selected
|
121 |
+
*/
|
122 |
+
function isFilterSelected(objFilter){
|
123 |
+
|
124 |
+
var type = getFilterType(objFilter);
|
125 |
+
|
126 |
+
switch(type){
|
127 |
+
case g_types.CHECKBOX:
|
128 |
+
|
129 |
+
var isSelected = objFilter.is(":checked");
|
130 |
+
|
131 |
+
return(isSelected);
|
132 |
+
|
133 |
+
break;
|
134 |
+
default:
|
135 |
+
throw new Error("isFilterSelected error. wrong type: "+type);
|
136 |
+
break;
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
return(false);
|
141 |
+
}
|
142 |
+
|
143 |
+
|
144 |
+
/**
|
145 |
+
* get all selected filters
|
146 |
+
*/
|
147 |
+
function getSelectedFilters(){
|
148 |
+
|
149 |
+
var objSelected = [];
|
150 |
+
|
151 |
+
jQuery.each(g_objFilters, function(index, filter){
|
152 |
+
|
153 |
+
var objFilter = jQuery(filter);
|
154 |
+
|
155 |
+
var isSelected = isFilterSelected(objFilter);
|
156 |
+
|
157 |
+
if(isSelected == true)
|
158 |
+
objSelected.push(objFilter);
|
159 |
+
|
160 |
+
});
|
161 |
+
|
162 |
+
|
163 |
+
return(objSelected);
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
/**
|
168 |
+
* get filters data array
|
169 |
+
*/
|
170 |
+
function getArrFilterData(){
|
171 |
+
|
172 |
+
var objFilters = getSelectedFilters();
|
173 |
+
|
174 |
+
if(objFilters.length == 0)
|
175 |
+
return([]);
|
176 |
+
|
177 |
+
var arrData = [];
|
178 |
+
|
179 |
+
jQuery.each(objFilters, function(index, filter){
|
180 |
+
|
181 |
+
var objFilter = jQuery(filter);
|
182 |
+
|
183 |
+
var objFilterData = getFilterData(objFilter);
|
184 |
+
|
185 |
+
arrData.push(objFilterData);
|
186 |
+
});
|
187 |
+
|
188 |
+
return(arrData);
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* consolidate filters data
|
193 |
+
*/
|
194 |
+
function consolidateFiltersData(arrData){
|
195 |
+
|
196 |
+
if(arrData.length == 0)
|
197 |
+
return([]);
|
198 |
+
|
199 |
+
//consolidate by taxonomies
|
200 |
+
|
201 |
+
var objTax = {};
|
202 |
+
|
203 |
+
jQuery.each(arrData, function(index, item){
|
204 |
+
|
205 |
+
switch(item.type){
|
206 |
+
case "term":
|
207 |
+
|
208 |
+
var taxonomy = item.taxonomy;
|
209 |
+
var term = item.term;
|
210 |
+
|
211 |
+
if(objTax.hasOwnProperty(taxonomy) == false)
|
212 |
+
objTax[taxonomy] = [];
|
213 |
+
|
214 |
+
objTax[taxonomy].push(term);
|
215 |
+
|
216 |
+
break;
|
217 |
+
default:
|
218 |
+
throw new Error("consolidateFiltersData error: wrong type: "+item.type);
|
219 |
+
break;
|
220 |
+
}
|
221 |
+
|
222 |
+
});
|
223 |
+
|
224 |
+
var arrConsolidated = {};
|
225 |
+
arrConsolidated["terms"] = objTax;
|
226 |
+
|
227 |
+
return(arrConsolidated);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* build terms query
|
232 |
+
*/
|
233 |
+
function buildQuery_terms(objTax){
|
234 |
+
|
235 |
+
var query = "";
|
236 |
+
|
237 |
+
jQuery.each(objTax, function(taxonomy, arrTerms){
|
238 |
+
|
239 |
+
var strTerms = arrTerms.join(".");
|
240 |
+
if(!strTerms)
|
241 |
+
return(true);
|
242 |
+
|
243 |
+
//separator
|
244 |
+
|
245 |
+
if(query)
|
246 |
+
taxonomy += ";";
|
247 |
+
|
248 |
+
//query
|
249 |
+
|
250 |
+
query += taxonomy + "~" + strTerms;
|
251 |
+
});
|
252 |
+
|
253 |
+
return(query);
|
254 |
+
}
|
255 |
+
|
256 |
+
|
257 |
+
/**
|
258 |
+
* build url query from the filters
|
259 |
+
* example:
|
260 |
+
* ucfilters=product_cat~shoes,dress;cat~123,43;
|
261 |
+
*/
|
262 |
+
function buildUrlQuery(){
|
263 |
+
|
264 |
+
var arrData = getArrFilterData();
|
265 |
+
|
266 |
+
if(arrData.length == 0)
|
267 |
+
return("");
|
268 |
+
|
269 |
+
var queryFilters = "";
|
270 |
+
|
271 |
+
var arrConsolidated = consolidateFiltersData(arrData);
|
272 |
+
|
273 |
+
jQuery.each(arrConsolidated, function(type, objItem){
|
274 |
+
|
275 |
+
switch(type){
|
276 |
+
case "terms":
|
277 |
+
var queryTerms = buildQuery_terms(objItem);
|
278 |
+
|
279 |
+
if(queryFilters)
|
280 |
+
queryFilters += ";";
|
281 |
+
|
282 |
+
queryFilters += queryTerms;
|
283 |
+
break;
|
284 |
+
}
|
285 |
+
|
286 |
+
});
|
287 |
+
|
288 |
+
//return query
|
289 |
+
|
290 |
+
var query = "ucfilters=" + queryFilters;
|
291 |
+
|
292 |
+
return(query);
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* get redirect url
|
297 |
+
*/
|
298 |
+
function getRedirectUrl(query){
|
299 |
+
|
300 |
+
if(!g_urlBase)
|
301 |
+
throw new Error("getRedirectUrl error - empty url");
|
302 |
+
|
303 |
+
var url = g_urlBase;
|
304 |
+
|
305 |
+
if(!query)
|
306 |
+
return(url);
|
307 |
+
|
308 |
+
var posQ = url.indexOf("?");
|
309 |
+
|
310 |
+
if(posQ == -1)
|
311 |
+
url += "?";
|
312 |
+
else
|
313 |
+
url += "&";
|
314 |
+
|
315 |
+
url += query;
|
316 |
+
|
317 |
+
return(url);
|
318 |
+
}
|
319 |
+
|
320 |
+
|
321 |
+
/**
|
322 |
+
* on filters change - refresh the page with the new query
|
323 |
+
*/
|
324 |
+
function onFiltersChange(){
|
325 |
+
|
326 |
+
var query = buildUrlQuery();
|
327 |
+
|
328 |
+
var url = getRedirectUrl(query);
|
329 |
+
|
330 |
+
if(!url)
|
331 |
+
throw new error("onFiltersChange error - empty redirect url");
|
332 |
+
|
333 |
+
location.href = url;
|
334 |
+
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
/**
|
339 |
+
* init events
|
340 |
+
*/
|
341 |
+
function initEvents(){
|
342 |
+
|
343 |
+
var objCheckboxes = g_objFilters.filter("input[type=checkbox]");
|
344 |
+
|
345 |
+
objCheckboxes.on("click", onFiltersChange);
|
346 |
+
|
347 |
+
}
|
348 |
+
|
349 |
+
|
350 |
+
/**
|
351 |
+
* init
|
352 |
+
*/
|
353 |
+
function init(){
|
354 |
+
|
355 |
+
g_objFilters = jQuery(".uc-listing-filter");
|
356 |
+
|
357 |
+
if(g_objFilters.length == 0){
|
358 |
+
return(false);
|
359 |
+
}
|
360 |
+
|
361 |
+
//init the listing
|
362 |
+
|
363 |
+
g_objListing = jQuery(".uc-filterable-listing");
|
364 |
+
|
365 |
+
if(g_objListing.length == 0){
|
366 |
+
trace("fitlers not loaded, no listing available on page");
|
367 |
+
return(false);
|
368 |
+
}
|
369 |
+
|
370 |
+
//get first listing
|
371 |
+
if(g_objListing.length > 1)
|
372 |
+
g_objListing = jQuery(g_objListing[0]);
|
373 |
+
|
374 |
+
g_listingData = g_objListing.data("ucfilters");
|
375 |
+
if(!g_listingData)
|
376 |
+
g_listingData = {};
|
377 |
+
|
378 |
+
g_urlBase = getVal(g_listingData, "urlbase");
|
379 |
+
|
380 |
+
if(!g_urlBase){
|
381 |
+
trace("ue filters error - base url not inited");
|
382 |
+
return(false);
|
383 |
+
}
|
384 |
+
|
385 |
+
trace("filters are active!");
|
386 |
+
|
387 |
+
clearFilters(true);
|
388 |
+
|
389 |
+
initEvents();
|
390 |
+
|
391 |
+
}
|
392 |
+
|
393 |
+
|
394 |
+
/**
|
395 |
+
* init the class
|
396 |
+
*/
|
397 |
+
function construct(){
|
398 |
+
|
399 |
+
if(!jQuery){
|
400 |
+
trace("Filters not loaded, jQuery not loaded");
|
401 |
+
return(false);
|
402 |
+
}
|
403 |
+
|
404 |
+
jQuery("document").ready(init);
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
construct();
|
409 |
+
}
|
410 |
+
|
411 |
+
new UEListingFilters();
|
412 |
+
|
inc_php/framework/functions.class.php
CHANGED
@@ -168,6 +168,22 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
168 |
return($arrNew);
|
169 |
}
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
/**
|
173 |
* Convert std class to array, with all sons
|
@@ -1347,6 +1363,23 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1347 |
return($url);
|
1348 |
}
|
1349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1350 |
public static function z___________VALIDATIONS_________(){}
|
1351 |
|
1352 |
/**
|
@@ -1535,6 +1568,26 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1535 |
|
1536 |
}
|
1537 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1538 |
|
1539 |
/**
|
1540 |
* validate that the value is alphanumeric
|
@@ -2114,9 +2167,10 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2114 |
}
|
2115 |
|
2116 |
|
2117 |
-
|
2118 |
public static function z___________OTHERS__________(){}
|
2119 |
|
|
|
|
|
2120 |
/**
|
2121 |
* encode svg to bg image url
|
2122 |
*/
|
168 |
return($arrNew);
|
169 |
}
|
170 |
|
171 |
+
/**
|
172 |
+
* remove some of the assoc array fields
|
173 |
+
* fields is simple array - field1, field2, field3
|
174 |
+
*/
|
175 |
+
public static function removeArrItemsByKeys($arrItems, $keysToRemove){
|
176 |
+
|
177 |
+
foreach($keysToRemove as $key){
|
178 |
+
|
179 |
+
if(array_key_exists($key, $arrItems))
|
180 |
+
unset($arrItems[$key]);
|
181 |
+
|
182 |
+
}
|
183 |
+
|
184 |
+
return($arrItems);
|
185 |
+
}
|
186 |
+
|
187 |
|
188 |
/**
|
189 |
* Convert std class to array, with all sons
|
1363 |
return($url);
|
1364 |
}
|
1365 |
|
1366 |
+
/**
|
1367 |
+
* get base url from any url
|
1368 |
+
*/
|
1369 |
+
public static function getBaseUrl($url){
|
1370 |
+
|
1371 |
+
$arrUrl = parse_url($url);
|
1372 |
+
|
1373 |
+
$scheme = UniteFunctionsUC::getVal($arrUrl, "scheme","http");
|
1374 |
+
$host = UniteFunctionsUC::getVal($arrUrl, "host");
|
1375 |
+
$path = UniteFunctionsUC::getVal($arrUrl, "path");
|
1376 |
+
|
1377 |
+
$url = "{$scheme}://{$host}{$path}";
|
1378 |
+
|
1379 |
+
return($url);
|
1380 |
+
}
|
1381 |
+
|
1382 |
+
|
1383 |
public static function z___________VALIDATIONS_________(){}
|
1384 |
|
1385 |
/**
|
1568 |
|
1569 |
}
|
1570 |
|
1571 |
+
/**
|
1572 |
+
* return if the array is id's array
|
1573 |
+
*/
|
1574 |
+
public static function isValidIDsArray($arr){
|
1575 |
+
|
1576 |
+
if(is_array($arr) == false)
|
1577 |
+
return(false);
|
1578 |
+
|
1579 |
+
if(empty($arr))
|
1580 |
+
return(true);
|
1581 |
+
|
1582 |
+
foreach($arr as $key=>$value){
|
1583 |
+
|
1584 |
+
if(is_numeric($key) == false || is_numeric($value) == false)
|
1585 |
+
return(false);
|
1586 |
+
}
|
1587 |
+
|
1588 |
+
return(true);
|
1589 |
+
}
|
1590 |
+
|
1591 |
|
1592 |
/**
|
1593 |
* validate that the value is alphanumeric
|
2167 |
}
|
2168 |
|
2169 |
|
|
|
2170 |
public static function z___________OTHERS__________(){}
|
2171 |
|
2172 |
+
|
2173 |
+
|
2174 |
/**
|
2175 |
* encode svg to bg image url
|
2176 |
*/
|
inc_php/framework/settings_output.class.php
CHANGED
@@ -192,6 +192,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
192 |
//set hidden
|
193 |
$isHidden = isset($setting["hidden"]);
|
194 |
|
|
|
|
|
|
|
195 |
//operate saps
|
196 |
if($this->showSaps == true && $this->sapsType == self::SAPS_TYPE_INLINE){
|
197 |
|
192 |
//set hidden
|
193 |
$isHidden = isset($setting["hidden"]);
|
194 |
|
195 |
+
if($isHidden == true && $setting["hidden"] === "false")
|
196 |
+
$isHidden = false;
|
197 |
+
|
198 |
//operate saps
|
199 |
if($this->showSaps == true && $this->sapsType == self::SAPS_TYPE_INLINE){
|
200 |
|
inc_php/unitecreator_addon.class.php
CHANGED
@@ -2118,8 +2118,10 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2118 |
if(!is_array($arrValues))
|
2119 |
UniteFunctionsUC::throwError("The values shoud be array");
|
2120 |
|
|
|
2121 |
foreach($arrParams as $key => $param){
|
2122 |
|
|
|
2123 |
$name = UniteFunctionsUC::getVal($param, "name");
|
2124 |
|
2125 |
if(empty($name))
|
@@ -2134,16 +2136,16 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2134 |
$value = $this->objProcessor->getSpecialParamValue($type, $name, $value, $arrValues);
|
2135 |
|
2136 |
$param["value"] = $value;
|
2137 |
-
|
2138 |
$param = $this->setResponsiveParamValues($param, $name, $arrValues);
|
2139 |
|
2140 |
$param = $this->objProcessor->setExtraParamsValues($type, $param, $name, $arrValues);
|
2141 |
-
|
2142 |
//set responsive values
|
2143 |
$arrParams[$key] = $param;
|
2144 |
|
2145 |
}
|
2146 |
-
|
2147 |
return($arrParams);
|
2148 |
}
|
2149 |
|
2118 |
if(!is_array($arrValues))
|
2119 |
UniteFunctionsUC::throwError("The values shoud be array");
|
2120 |
|
2121 |
+
|
2122 |
foreach($arrParams as $key => $param){
|
2123 |
|
2124 |
+
|
2125 |
$name = UniteFunctionsUC::getVal($param, "name");
|
2126 |
|
2127 |
if(empty($name))
|
2136 |
$value = $this->objProcessor->getSpecialParamValue($type, $name, $value, $arrValues);
|
2137 |
|
2138 |
$param["value"] = $value;
|
2139 |
+
|
2140 |
$param = $this->setResponsiveParamValues($param, $name, $arrValues);
|
2141 |
|
2142 |
$param = $this->objProcessor->setExtraParamsValues($type, $param, $name, $arrValues);
|
2143 |
+
|
2144 |
//set responsive values
|
2145 |
$arrParams[$key] = $param;
|
2146 |
|
2147 |
}
|
2148 |
+
|
2149 |
return($arrParams);
|
2150 |
}
|
2151 |
|
inc_php/unitecreator_addons.class.php
CHANGED
@@ -137,6 +137,7 @@ class UniteCreatorAddons extends UniteElementsBaseUC{
|
|
137 |
if(!empty($arrWhere))
|
138 |
$where = implode(" and ", $arrWhere);
|
139 |
|
|
|
140 |
$response = $this->db->fetch(GlobalsUc::$table_addons, $where, $order);
|
141 |
|
142 |
return($response);
|
137 |
if(!empty($arrWhere))
|
138 |
$where = implode(" and ", $arrWhere);
|
139 |
|
140 |
+
|
141 |
$response = $this->db->fetch(GlobalsUc::$table_addons, $where, $order);
|
142 |
|
143 |
return($response);
|
inc_php/unitecreator_client_text.php
CHANGED
@@ -72,6 +72,7 @@ GlobalsUC::$arrClientSideText = array(
|
|
72 |
"uc_textarea"=>esc_html__("Text Area","unlimited-elements-for-elementor"),
|
73 |
"uc_checkbox"=>esc_html__("Checkbox","unlimited-elements-for-elementor"),
|
74 |
"uc_dropdown"=>esc_html__("Dropdown","unlimited-elements-for-elementor"),
|
|
|
75 |
"uc_radioboolean"=>esc_html__("Radio Boolean","unlimited-elements-for-elementor"),
|
76 |
"uc_typography"=>esc_html__("Typography","unlimited-elements-for-elementor"),
|
77 |
"uc_link"=>esc_html__("Link","unlimited-elements-for-elementor"),
|
72 |
"uc_textarea"=>esc_html__("Text Area","unlimited-elements-for-elementor"),
|
73 |
"uc_checkbox"=>esc_html__("Checkbox","unlimited-elements-for-elementor"),
|
74 |
"uc_dropdown"=>esc_html__("Dropdown","unlimited-elements-for-elementor"),
|
75 |
+
"uc_multiple_select"=>esc_html__("Multiple Select","unlimited-elements-for-elementor"),
|
76 |
"uc_radioboolean"=>esc_html__("Radio Boolean","unlimited-elements-for-elementor"),
|
77 |
"uc_typography"=>esc_html__("Typography","unlimited-elements-for-elementor"),
|
78 |
"uc_link"=>esc_html__("Link","unlimited-elements-for-elementor"),
|
inc_php/unitecreator_dialog_param.class.php
CHANGED
@@ -20,6 +20,7 @@ class UniteCreatorDialogParamWork{
|
|
20 |
const PARAM_NUMBER = "uc_number";
|
21 |
const PARAM_RADIOBOOLEAN = "uc_radioboolean";
|
22 |
const PARAM_DROPDOWN = "uc_dropdown";
|
|
|
23 |
const PARAM_HR = "uc_hr";
|
24 |
const PARAM_CONTENT = "uc_content";
|
25 |
const PARAM_POST = "uc_post";
|
@@ -27,6 +28,7 @@ class UniteCreatorDialogParamWork{
|
|
27 |
const PARAM_POSTS_LIST = "uc_posts_list";
|
28 |
const PARAM_POST_TERMS = "uc_post_terms";
|
29 |
const PARAM_WOO_CATS = "uc_woo_categories";
|
|
|
30 |
|
31 |
const PARAM_USERS = "uc_users";
|
32 |
const PARAM_TEMPLATE = "uc_template";
|
@@ -151,6 +153,7 @@ class UniteCreatorDialogParamWork{
|
|
151 |
$this->arrProParams[self::PARAM_BACKGROUND] = true;
|
152 |
$this->arrProParams[self::PARAM_BORDER] = true;
|
153 |
$this->arrProParams[self::PARAM_SLIDER] = true;
|
|
|
154 |
|
155 |
}
|
156 |
|
@@ -166,7 +169,8 @@ class UniteCreatorDialogParamWork{
|
|
166 |
$this->addParam("uc_textarea", esc_html__("Text Area", "unlimited-elements-for-elementor"));
|
167 |
$this->addParam(self::PARAM_EDITOR, esc_html__("Editor", "unlimited-elements-for-elementor"));
|
168 |
$this->addParam("uc_checkbox", esc_html__("Checkbox", "unlimited-elements-for-elementor"));
|
169 |
-
$this->addParam(
|
|
|
170 |
$this->addParam(self::PARAM_COLORPICKER, esc_html__("Color Picker", "unlimited-elements-for-elementor"));
|
171 |
$this->addParam(self::PARAM_LINK, esc_html__("Link", "unlimited-elements-for-elementor"));
|
172 |
$this->addParam(self::PARAM_IMAGE, esc_html__("Image", "unlimited-elements-for-elementor"));
|
@@ -183,6 +187,8 @@ class UniteCreatorDialogParamWork{
|
|
183 |
$this->addParam(self::PARAM_POSTS_LIST, esc_html__("Posts List", "unlimited-elements-for-elementor"));
|
184 |
$this->addParam(self::PARAM_POST_TERMS, esc_html__("Posts Terms", "unlimited-elements-for-elementor"));
|
185 |
$this->addParam(self::PARAM_WOO_CATS, esc_html__("WooCommerce Categories", "unlimited-elements-for-elementor"));
|
|
|
|
|
186 |
$this->addParam(self::PARAM_USERS, esc_html__("Users List", "unlimited-elements-for-elementor"));
|
187 |
$this->addParam(self::PARAM_TEMPLATE, esc_html__("Elementor Template", "unlimited-elements-for-elementor"));
|
188 |
$this->addParam(self::PARAM_MENU, esc_html__("Menu", "unlimited-elements-for-elementor"));
|
@@ -727,8 +733,14 @@ class UniteCreatorDialogParamWork{
|
|
727 |
<?php
|
728 |
$this->putCheckbox("use_custom_fields", __("Use Custom Fields", "unlimited-elements-for-elementor"));
|
729 |
?>
|
|
|
|
|
|
|
|
|
|
|
730 |
|
731 |
<br><br>
|
|
|
732 |
<hr>
|
733 |
|
734 |
<?php
|
@@ -745,6 +757,15 @@ class UniteCreatorDialogParamWork{
|
|
745 |
|
746 |
}
|
747 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
748 |
|
749 |
/**
|
750 |
* put post list param
|
@@ -793,7 +814,19 @@ class UniteCreatorDialogParamWork{
|
|
793 |
$this->putCheckbox("show_image_sizes", __("Show Image Sizes Select", "unlimited-elements-for-elementor"));
|
794 |
?>
|
795 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
796 |
<hr>
|
|
|
|
|
797 |
<?php
|
798 |
|
799 |
$this->putStyleCheckbox();
|
@@ -888,12 +921,26 @@ class UniteCreatorDialogParamWork{
|
|
888 |
|
889 |
}
|
890 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
891 |
/**
|
892 |
* put dropdown items table
|
893 |
*/
|
894 |
-
protected function putDropdownItems(){
|
|
|
|
|
|
|
|
|
|
|
895 |
?>
|
896 |
-
<table data-inputtype="table_dropdown" class='uc-table-dropdown-items uc-table-dropdown-full'>
|
897 |
<thead>
|
898 |
<tr>
|
899 |
<th></th>
|
@@ -1157,9 +1204,12 @@ class UniteCreatorDialogParamWork{
|
|
1157 |
case "uc_checkbox":
|
1158 |
$this->putRadioYesNo("is_checked", esc_html__("Checked By Default", "unlimited-elements-for-elementor"), false, "Yes", "No", true);
|
1159 |
break;
|
1160 |
-
case
|
1161 |
$this->putDropDownParam();
|
1162 |
break;
|
|
|
|
|
|
|
1163 |
case self::PARAM_LINK:
|
1164 |
$this->putDefaultValueParam(false, "", false);
|
1165 |
break;
|
@@ -1199,6 +1249,9 @@ class UniteCreatorDialogParamWork{
|
|
1199 |
case self::PARAM_WOO_CATS:
|
1200 |
$this->putWooCatsParam();
|
1201 |
break;
|
|
|
|
|
|
|
1202 |
case self::PARAM_FORM:
|
1203 |
$this->putFormParam();
|
1204 |
break;
|
@@ -1587,6 +1640,7 @@ class UniteCreatorDialogParamWork{
|
|
1587 |
self::PARAM_TEXTAREA,
|
1588 |
self::PARAM_CHECKBOX,
|
1589 |
self::PARAM_DROPDOWN,
|
|
|
1590 |
self::PARAM_SLIDER,
|
1591 |
self::PARAM_COLORPICKER,
|
1592 |
self::PARAM_LINK,
|
@@ -1601,6 +1655,7 @@ class UniteCreatorDialogParamWork{
|
|
1601 |
self::PARAM_INSTAGRAM,
|
1602 |
);
|
1603 |
|
|
|
1604 |
//add dataset
|
1605 |
$arrDatasets = $this->objDatasets->getDatasetTypeNames();
|
1606 |
if(!empty($arrDatasets))
|
@@ -1620,6 +1675,7 @@ class UniteCreatorDialogParamWork{
|
|
1620 |
self::PARAM_TEXTAREA,
|
1621 |
self::PARAM_CHECKBOX,
|
1622 |
self::PARAM_DROPDOWN,
|
|
|
1623 |
self::PARAM_COLORPICKER,
|
1624 |
self::PARAM_SLIDER,
|
1625 |
self::PARAM_TEMPLATE,
|
@@ -1634,6 +1690,7 @@ class UniteCreatorDialogParamWork{
|
|
1634 |
self::PARAM_PADDING
|
1635 |
);
|
1636 |
|
|
|
1637 |
$this->arrParamsItems = UniteFunctionsUC::arrayToAssoc($this->arrParamsItems);
|
1638 |
}
|
1639 |
|
20 |
const PARAM_NUMBER = "uc_number";
|
21 |
const PARAM_RADIOBOOLEAN = "uc_radioboolean";
|
22 |
const PARAM_DROPDOWN = "uc_dropdown";
|
23 |
+
const PARAM_MULTIPLE_SELECT = "uc_multiple_select";
|
24 |
const PARAM_HR = "uc_hr";
|
25 |
const PARAM_CONTENT = "uc_content";
|
26 |
const PARAM_POST = "uc_post";
|
28 |
const PARAM_POSTS_LIST = "uc_posts_list";
|
29 |
const PARAM_POST_TERMS = "uc_post_terms";
|
30 |
const PARAM_WOO_CATS = "uc_woo_categories";
|
31 |
+
const PARAM_LISTING = "uc_listing";
|
32 |
|
33 |
const PARAM_USERS = "uc_users";
|
34 |
const PARAM_TEMPLATE = "uc_template";
|
153 |
$this->arrProParams[self::PARAM_BACKGROUND] = true;
|
154 |
$this->arrProParams[self::PARAM_BORDER] = true;
|
155 |
$this->arrProParams[self::PARAM_SLIDER] = true;
|
156 |
+
$this->arrProParams[self::PARAM_LISTING] = true;
|
157 |
|
158 |
}
|
159 |
|
169 |
$this->addParam("uc_textarea", esc_html__("Text Area", "unlimited-elements-for-elementor"));
|
170 |
$this->addParam(self::PARAM_EDITOR, esc_html__("Editor", "unlimited-elements-for-elementor"));
|
171 |
$this->addParam("uc_checkbox", esc_html__("Checkbox", "unlimited-elements-for-elementor"));
|
172 |
+
$this->addParam(self::PARAM_DROPDOWN, esc_html__("Dropdown", "unlimited-elements-for-elementor"));
|
173 |
+
$this->addParam(self::PARAM_MULTIPLE_SELECT, esc_html__("Multiple Select", "unlimited-elements-for-elementor"));
|
174 |
$this->addParam(self::PARAM_COLORPICKER, esc_html__("Color Picker", "unlimited-elements-for-elementor"));
|
175 |
$this->addParam(self::PARAM_LINK, esc_html__("Link", "unlimited-elements-for-elementor"));
|
176 |
$this->addParam(self::PARAM_IMAGE, esc_html__("Image", "unlimited-elements-for-elementor"));
|
187 |
$this->addParam(self::PARAM_POSTS_LIST, esc_html__("Posts List", "unlimited-elements-for-elementor"));
|
188 |
$this->addParam(self::PARAM_POST_TERMS, esc_html__("Posts Terms", "unlimited-elements-for-elementor"));
|
189 |
$this->addParam(self::PARAM_WOO_CATS, esc_html__("WooCommerce Categories", "unlimited-elements-for-elementor"));
|
190 |
+
$this->addParam(self::PARAM_LISTING, esc_html__("Listing", "unlimited-elements-for-elementor"));
|
191 |
+
|
192 |
$this->addParam(self::PARAM_USERS, esc_html__("Users List", "unlimited-elements-for-elementor"));
|
193 |
$this->addParam(self::PARAM_TEMPLATE, esc_html__("Elementor Template", "unlimited-elements-for-elementor"));
|
194 |
$this->addParam(self::PARAM_MENU, esc_html__("Menu", "unlimited-elements-for-elementor"));
|
733 |
<?php
|
734 |
$this->putCheckbox("use_custom_fields", __("Use Custom Fields", "unlimited-elements-for-elementor"));
|
735 |
?>
|
736 |
+
<div class="vert_sap20"></div>
|
737 |
+
|
738 |
+
<?php
|
739 |
+
$this->putCheckbox("for_woocommerce", __("For WooCommerce Terms", "unlimited-elements-for-elementor"));
|
740 |
+
?>
|
741 |
|
742 |
<br><br>
|
743 |
+
|
744 |
<hr>
|
745 |
|
746 |
<?php
|
757 |
|
758 |
}
|
759 |
|
760 |
+
/**
|
761 |
+
* put listing param
|
762 |
+
*/
|
763 |
+
private function putListingParam(){
|
764 |
+
|
765 |
+
esc_html_e("Put listing attributes here", "unlimited-elements-for-elementor");
|
766 |
+
|
767 |
+
}
|
768 |
+
|
769 |
|
770 |
/**
|
771 |
* put post list param
|
814 |
$this->putCheckbox("show_image_sizes", __("Show Image Sizes Select", "unlimited-elements-for-elementor"));
|
815 |
?>
|
816 |
|
817 |
+
<?php if(GlobalsUC::$inDev == true):?>
|
818 |
+
<div class="vert_sap10"></div>
|
819 |
+
|
820 |
+
<?php
|
821 |
+
$this->putCheckbox("is_filterable", __("Enable Filterable Options", "unlimited-elements-for-elementor"));
|
822 |
+
?>
|
823 |
+
<?php endif?>
|
824 |
+
|
825 |
+
<div class="vert_sap10"></div>
|
826 |
+
|
827 |
<hr>
|
828 |
+
|
829 |
+
<div class="vert_sap10"></div>
|
830 |
<?php
|
831 |
|
832 |
$this->putStyleCheckbox();
|
921 |
|
922 |
}
|
923 |
|
924 |
+
/**
|
925 |
+
* put multiple select param
|
926 |
+
*/
|
927 |
+
private function putMultipleSelectParam(){
|
928 |
+
|
929 |
+
$this->putDropdownItems(true);
|
930 |
+
|
931 |
+
}
|
932 |
+
|
933 |
/**
|
934 |
* put dropdown items table
|
935 |
*/
|
936 |
+
protected function putDropdownItems($isMultiple = false){
|
937 |
+
|
938 |
+
$addParams = "";
|
939 |
+
if($isMultiple == true)
|
940 |
+
$addParams = "data-ismultiple=\"true\"";
|
941 |
+
|
942 |
?>
|
943 |
+
<table data-inputtype="table_dropdown" <?php echo $addParams?> class='uc-table-dropdown-items uc-table-dropdown-full'>
|
944 |
<thead>
|
945 |
<tr>
|
946 |
<th></th>
|
1204 |
case "uc_checkbox":
|
1205 |
$this->putRadioYesNo("is_checked", esc_html__("Checked By Default", "unlimited-elements-for-elementor"), false, "Yes", "No", true);
|
1206 |
break;
|
1207 |
+
case self::PARAM_DROPDOWN:
|
1208 |
$this->putDropDownParam();
|
1209 |
break;
|
1210 |
+
case self::PARAM_MULTIPLE_SELECT:
|
1211 |
+
$this->putMultipleSelectParam();
|
1212 |
+
break;
|
1213 |
case self::PARAM_LINK:
|
1214 |
$this->putDefaultValueParam(false, "", false);
|
1215 |
break;
|
1249 |
case self::PARAM_WOO_CATS:
|
1250 |
$this->putWooCatsParam();
|
1251 |
break;
|
1252 |
+
case self::PARAM_LISTING:
|
1253 |
+
$this->putListingParam();
|
1254 |
+
break;
|
1255 |
case self::PARAM_FORM:
|
1256 |
$this->putFormParam();
|
1257 |
break;
|
1640 |
self::PARAM_TEXTAREA,
|
1641 |
self::PARAM_CHECKBOX,
|
1642 |
self::PARAM_DROPDOWN,
|
1643 |
+
self::PARAM_MULTIPLE_SELECT,
|
1644 |
self::PARAM_SLIDER,
|
1645 |
self::PARAM_COLORPICKER,
|
1646 |
self::PARAM_LINK,
|
1655 |
self::PARAM_INSTAGRAM,
|
1656 |
);
|
1657 |
|
1658 |
+
|
1659 |
//add dataset
|
1660 |
$arrDatasets = $this->objDatasets->getDatasetTypeNames();
|
1661 |
if(!empty($arrDatasets))
|
1675 |
self::PARAM_TEXTAREA,
|
1676 |
self::PARAM_CHECKBOX,
|
1677 |
self::PARAM_DROPDOWN,
|
1678 |
+
self::PARAM_MULTIPLE_SELECT,
|
1679 |
self::PARAM_COLORPICKER,
|
1680 |
self::PARAM_SLIDER,
|
1681 |
self::PARAM_TEMPLATE,
|
1690 |
self::PARAM_PADDING
|
1691 |
);
|
1692 |
|
1693 |
+
|
1694 |
$this->arrParamsItems = UniteFunctionsUC::arrayToAssoc($this->arrParamsItems);
|
1695 |
}
|
1696 |
|
inc_php/unitecreator_filters_process.class.php
CHANGED
@@ -10,16 +10,14 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
10 |
class UniteCreatorFiltersProcess{
|
11 |
|
12 |
private static $filters = null;
|
13 |
-
|
14 |
-
|
15 |
-
* put current widget data
|
16 |
-
*/
|
17 |
-
public function putCurrentWidgetData(){
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
/**
|
25 |
* get request array
|
@@ -33,21 +31,99 @@ class UniteCreatorFiltersProcess{
|
|
33 |
return($request);
|
34 |
}
|
35 |
|
|
|
|
|
36 |
/**
|
37 |
-
*
|
38 |
*/
|
39 |
-
private function
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
-
$
|
42 |
|
43 |
-
|
|
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
self::$
|
50 |
|
|
|
51 |
}
|
52 |
|
53 |
|
@@ -60,23 +136,38 @@ class UniteCreatorFiltersProcess{
|
|
60 |
return(self::$filters);
|
61 |
|
62 |
self::$filters = array();
|
63 |
-
|
64 |
-
$
|
|
|
|
|
|
|
65 |
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
foreach($
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
}
|
77 |
-
|
78 |
}
|
|
|
|
|
79 |
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
return(self::$filters);
|
82 |
}
|
@@ -119,10 +210,10 @@ class UniteCreatorFiltersProcess{
|
|
119 |
|
120 |
if($arrActiveFilters === null)
|
121 |
$arrActiveFilters = $this->getRequestFilters();
|
122 |
-
|
123 |
if(empty($arrActiveFilters))
|
124 |
return(false);
|
125 |
-
|
126 |
$taxonomy = $term->taxonomy;
|
127 |
|
128 |
$selectedTermID = UniteFunctionsUC::getVal($arrActiveFilters, $taxonomy);
|
@@ -136,6 +227,158 @@ class UniteCreatorFiltersProcess{
|
|
136 |
return(false);
|
137 |
}
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
/**
|
140 |
* put ajax scripts
|
141 |
*/
|
@@ -237,92 +480,5 @@ jQuery(document).ready(function(){
|
|
237 |
<?php
|
238 |
}
|
239 |
|
240 |
-
/**
|
241 |
-
* put filters by tabs
|
242 |
-
*/
|
243 |
-
public function putFiltersTabs(){
|
244 |
-
|
245 |
-
$arrActiveFilters = self::getRequestFilters();
|
246 |
-
|
247 |
-
$taxonomy = "category";
|
248 |
-
|
249 |
-
$terms = get_terms($taxonomy);
|
250 |
-
|
251 |
-
$isAjax = true;
|
252 |
-
|
253 |
-
?>
|
254 |
-
|
255 |
-
<style>
|
256 |
-
.uc-filters{
|
257 |
-
list-style:none;
|
258 |
-
margin:0px;
|
259 |
-
padding:0px;
|
260 |
-
display:flex;
|
261 |
-
box-sizing:border-box;
|
262 |
-
margin-top:20px;
|
263 |
-
margin-bottom:20px;
|
264 |
-
}
|
265 |
-
.uc-filters li{
|
266 |
-
margin:0px;
|
267 |
-
padding:0px;
|
268 |
-
}
|
269 |
-
.uc-filters li a{
|
270 |
-
padding:10px;
|
271 |
-
border:1px solid black;
|
272 |
-
}
|
273 |
-
.uc-filters li.active a{
|
274 |
-
background-color:gold;
|
275 |
-
}
|
276 |
-
</style>
|
277 |
-
|
278 |
-
<ul class="uc-filters">
|
279 |
-
<?php
|
280 |
-
$isFirst = true;
|
281 |
-
foreach($terms as $term):
|
282 |
-
|
283 |
-
$isTermActive = $this->isTermActive($term, $arrActiveFilters);
|
284 |
-
|
285 |
-
$classActive = "";
|
286 |
-
|
287 |
-
$termID = $term->term_id;
|
288 |
-
$name = $term->name;
|
289 |
-
$slug = $term->slug;
|
290 |
-
|
291 |
-
$urlFilter = $this->getUrlFilter_term($term, $taxonomy);
|
292 |
-
|
293 |
-
$htmlAttribAddition = "";
|
294 |
-
if($isAjax == true){
|
295 |
-
$htmlAttribAddition = 'class="uc-filter-ajax"';
|
296 |
-
}
|
297 |
-
|
298 |
-
if($isTermActive == true)
|
299 |
-
$classActive = " active";
|
300 |
-
|
301 |
-
$isFirst = false;
|
302 |
-
?>
|
303 |
-
<li class="<?php echo $classActive?>">
|
304 |
-
<a href="<?php echo $urlFilter?>" <?php echo $htmlAttribAddition?>><?php echo $name?></a>
|
305 |
-
</li>
|
306 |
-
|
307 |
-
<?php endforeach?>
|
308 |
-
</ul>
|
309 |
-
|
310 |
-
<?php
|
311 |
-
|
312 |
-
if($isAjax == true)
|
313 |
-
$this->putScriptsAjax();
|
314 |
-
|
315 |
-
}
|
316 |
-
|
317 |
-
/**
|
318 |
-
* init elementor ajax
|
319 |
-
*/
|
320 |
-
public function initElementorAjaxActions(){
|
321 |
-
|
322 |
-
|
323 |
-
dmp("init ajax");
|
324 |
-
exit();
|
325 |
-
|
326 |
-
}
|
327 |
|
328 |
}
|
10 |
class UniteCreatorFiltersProcess{
|
11 |
|
12 |
private static $filters = null;
|
13 |
+
private static $arrInputFiltersCache = null;
|
14 |
+
private static $arrFiltersAssocCache = null;
|
|
|
|
|
|
|
15 |
|
16 |
+
private static $isFilesAdded = false;
|
17 |
+
private static $showDebug = false;
|
18 |
+
|
19 |
+
const TYPE_TERMS = "terms";
|
20 |
+
|
21 |
|
22 |
/**
|
23 |
* get request array
|
31 |
return($request);
|
32 |
}
|
33 |
|
34 |
+
|
35 |
+
|
36 |
/**
|
37 |
+
* get filters array from input
|
38 |
*/
|
39 |
+
private function getArrInputFilters(){
|
40 |
+
|
41 |
+
if(!empty(self::$arrInputFiltersCache))
|
42 |
+
return(self::$arrInputFiltersCache);
|
43 |
+
|
44 |
+
$request = $this->getArrRequest();
|
45 |
|
46 |
+
$strFilters = UniteFunctionsUC::getVal($request, "ucfilters");
|
47 |
|
48 |
+
if(empty($strFilters))
|
49 |
+
return(null);
|
50 |
|
51 |
+
if(self::$showDebug == true){
|
52 |
+
|
53 |
+
dmp("input filters found: $strFilters");
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
$strFilters = trim($strFilters);
|
58 |
+
|
59 |
+
$arrFilters = explode(";", $strFilters);
|
60 |
+
|
61 |
+
//fill the terms
|
62 |
+
$arrTerms = array();
|
63 |
+
|
64 |
+
foreach($arrFilters as $strFilter){
|
65 |
+
|
66 |
+
$arrFilter = explode("~", $strFilter);
|
67 |
+
|
68 |
+
if(count($arrFilter) != 2)
|
69 |
+
continue;
|
70 |
+
|
71 |
+
$key = $arrFilter[0];
|
72 |
+
$strValues = $arrFilter[1];
|
73 |
+
|
74 |
+
$arrVales = explode(".", $strValues);
|
75 |
+
|
76 |
+
$type = self::TYPE_TERMS;
|
77 |
+
|
78 |
+
switch($type){
|
79 |
+
case self::TYPE_TERMS:
|
80 |
+
$arrTerms[$key] = $arrVales;
|
81 |
+
break;
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
$arrOutput = array();
|
87 |
+
|
88 |
+
if(!empty($arrTerms))
|
89 |
+
$arrOutput[self::TYPE_TERMS] = $arrTerms;
|
90 |
+
|
91 |
+
self::$arrInputFiltersCache = $arrOutput;
|
92 |
+
|
93 |
+
return($arrOutput);
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* get input filters in assoc mode
|
98 |
+
*/
|
99 |
+
private function getInputFiltersAssoc(){
|
100 |
+
|
101 |
+
if(!empty(self::$arrFiltersAssocCache))
|
102 |
+
return(self::$arrFiltersAssocCache);
|
103 |
+
|
104 |
+
$arrFilters = $this->getArrInputFilters();
|
105 |
+
|
106 |
+
$output = array();
|
107 |
+
|
108 |
+
$terms = UniteFunctionsUC::getVal($arrFilters, "terms");
|
109 |
+
|
110 |
+
if(empty($terms))
|
111 |
+
$terms = array();
|
112 |
+
|
113 |
+
foreach($terms as $taxonomy=>$arrTermSlugs){
|
114 |
+
|
115 |
+
foreach($arrTermSlugs as $slug){
|
116 |
+
|
117 |
+
$key = "term_{$taxonomy}_{$slug}";
|
118 |
+
|
119 |
+
$output[$key] = true;
|
120 |
+
|
121 |
+
}
|
122 |
+
}
|
123 |
|
124 |
+
self::$arrFiltersAssocCache = $output;
|
125 |
|
126 |
+
return($output);
|
127 |
}
|
128 |
|
129 |
|
136 |
return(self::$filters);
|
137 |
|
138 |
self::$filters = array();
|
139 |
+
|
140 |
+
$arrInputFilters = $this->getArrInputFilters();
|
141 |
+
|
142 |
+
if(empty($arrInputFilters))
|
143 |
+
return(self::$filters);
|
144 |
|
145 |
+
$arrTerms = UniteFunctionsUC::getVal($arrInputFilters, self::TYPE_TERMS);
|
146 |
+
|
147 |
+
if(empty($arrTerms))
|
148 |
+
$arrTerms = array();
|
149 |
+
|
150 |
+
//collect term filters
|
151 |
+
|
152 |
+
$arrFilterTerms = array();
|
153 |
|
154 |
+
foreach($arrTerms as $taxonomy=>$arrTerms){
|
155 |
|
156 |
+
$prefix = "";
|
157 |
+
if($taxonomy != "category")
|
158 |
+
$prefix = $taxonomy."--";
|
159 |
+
|
160 |
+
foreach($arrTerms as $term)
|
161 |
+
$arrFilterTerms[] = $prefix.$term;
|
|
|
|
|
162 |
}
|
163 |
+
|
164 |
+
//put to output
|
165 |
|
166 |
+
if(!empty($arrFilterTerms)){
|
167 |
+
self::$filters["category"] = $arrFilterTerms;
|
168 |
+
self::$filters["category_relation"] = "OR";
|
169 |
+
|
170 |
+
}
|
171 |
|
172 |
return(self::$filters);
|
173 |
}
|
210 |
|
211 |
if($arrActiveFilters === null)
|
212 |
$arrActiveFilters = $this->getRequestFilters();
|
213 |
+
|
214 |
if(empty($arrActiveFilters))
|
215 |
return(false);
|
216 |
+
|
217 |
$taxonomy = $term->taxonomy;
|
218 |
|
219 |
$selectedTermID = UniteFunctionsUC::getVal($arrActiveFilters, $taxonomy);
|
227 |
return(false);
|
228 |
}
|
229 |
|
230 |
+
|
231 |
+
private function _______WIDGET__________(){}
|
232 |
+
|
233 |
+
|
234 |
+
/**
|
235 |
+
* include the filters js files
|
236 |
+
*/
|
237 |
+
private function includeJSFiles(){
|
238 |
+
|
239 |
+
if(self::$isFilesAdded == true)
|
240 |
+
return(false);
|
241 |
+
|
242 |
+
$urlFiltersJS = GlobalsUC::$url_assets_libraries."filters/ue_filters.js";
|
243 |
+
HelperUC::addScriptAbsoluteUrl($urlFiltersJS, "ue_filters");
|
244 |
+
|
245 |
+
|
246 |
+
self::$isFilesAdded = true;
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
/**
|
251 |
+
* put checkbox filters test
|
252 |
+
*/
|
253 |
+
public function putCheckboxFiltersTest($data){
|
254 |
+
|
255 |
+
$arrActiveFilters = $this->getInputFiltersAssoc();
|
256 |
+
|
257 |
+
$this->includeJSFiles();
|
258 |
+
|
259 |
+
$taxonomy = UniteFunctionsUC::getVal($data, "taxonomy", "category");
|
260 |
+
|
261 |
+
$terms = get_terms($taxonomy);
|
262 |
+
|
263 |
+
if(empty($terms))
|
264 |
+
return(false);
|
265 |
+
|
266 |
+
$html = "";
|
267 |
+
foreach($terms as $term){
|
268 |
+
|
269 |
+
$arrTerm = (array)$term;
|
270 |
+
|
271 |
+
$termID = UniteFunctionsUC::getVal($arrTerm, "term_id");
|
272 |
+
$name = UniteFunctionsUC::getVal($arrTerm, "name");
|
273 |
+
$slug = UniteFunctionsUC::getVal($arrTerm, "slug");
|
274 |
+
$count = UniteFunctionsUC::getVal($arrTerm, "count");
|
275 |
+
|
276 |
+
$activeKey = "term_{$taxonomy}_{$slug}";
|
277 |
+
|
278 |
+
$addAttr = "";
|
279 |
+
|
280 |
+
if(isset($arrActiveFilters[$activeKey])){
|
281 |
+
$addAttr = " checked='checked' data-active='yes'";
|
282 |
+
}
|
283 |
+
|
284 |
+
$slug = htmlspecialchars($slug);
|
285 |
+
|
286 |
+
$checkboxName = "ucfilter_term__{$taxonomy}--{$slug}";
|
287 |
+
|
288 |
+
$html .= "<label class='ucfilters-label-checkbox'>$name ($count)
|
289 |
+
<input type='checkbox' class='uc-listing-filter uc-filter-checkbox'
|
290 |
+
name='{$checkboxName}'
|
291 |
+
data-type='term'
|
292 |
+
data-taxonomy='{$taxonomy}'
|
293 |
+
data-term='{$slug}'
|
294 |
+
{$addAttr}
|
295 |
+
>
|
296 |
+
</label>";
|
297 |
+
|
298 |
+
}
|
299 |
+
|
300 |
+
echo $html;
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* get base page url
|
305 |
+
*/
|
306 |
+
private function getBasePageUrl(){
|
307 |
+
|
308 |
+
$url = UniteFunctionsUC::getBaseUrl(GlobalsUC::$current_page_url);
|
309 |
+
|
310 |
+
//strip pagination
|
311 |
+
if(strpos($url, "/page/") !== false){
|
312 |
+
$numPage = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
313 |
+
$url = str_replace("/page/$numPage/", "/", $url);
|
314 |
+
|
315 |
+
}
|
316 |
+
|
317 |
+
return($url);
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
* add widget variables
|
322 |
+
* uc_listing_addclass, uc_listing_attributes
|
323 |
+
*
|
324 |
+
*/
|
325 |
+
public function addWidgetFilterableVariables($data){
|
326 |
+
|
327 |
+
$urlBase = $this->getBasePageUrl();
|
328 |
+
|
329 |
+
$arrData = array();
|
330 |
+
$arrData["urlbase"] = $urlBase;
|
331 |
+
|
332 |
+
$strAttributes = UniteFunctionsUC::jsonEncodeForHtmlData($arrData,"ucfilters");
|
333 |
+
|
334 |
+
$data["uc_listing_attributes"] = $strAttributes;
|
335 |
+
$data["uc_listing_addclass"] = " uc-filterable-listing";
|
336 |
+
|
337 |
+
return($data);
|
338 |
+
}
|
339 |
+
|
340 |
+
private function _______ARCHIVE_QUERY__________(){}
|
341 |
+
|
342 |
+
|
343 |
+
/**
|
344 |
+
* modify post query
|
345 |
+
* Enter description here ...
|
346 |
+
*/
|
347 |
+
public function checkModifyMainQuery($query){
|
348 |
+
|
349 |
+
if(is_single())
|
350 |
+
return(false);
|
351 |
+
|
352 |
+
$arrFilters = $this->getRequestFilters();
|
353 |
+
|
354 |
+
if(empty($arrFilters))
|
355 |
+
return(true);
|
356 |
+
|
357 |
+
$args = UniteFunctionsWPUC::getPostsArgs($arrFilters, true);
|
358 |
+
|
359 |
+
if(empty($args))
|
360 |
+
return(false);
|
361 |
+
|
362 |
+
$query->query_vars = array_merge($query->query_vars, $args);
|
363 |
+
|
364 |
+
}
|
365 |
+
|
366 |
+
|
367 |
+
/**
|
368 |
+
* init wordpress front filters
|
369 |
+
*/
|
370 |
+
public function initWPFrontFilters(){
|
371 |
+
|
372 |
+
if(GlobalsUC::$inDev == false)
|
373 |
+
return(false);
|
374 |
+
|
375 |
+
add_action("parse_request", array($this, "checkModifyMainQuery"));
|
376 |
+
|
377 |
+
}
|
378 |
+
|
379 |
+
|
380 |
+
private function _______TEMP__________(){}
|
381 |
+
|
382 |
/**
|
383 |
* put ajax scripts
|
384 |
*/
|
480 |
<?php
|
481 |
}
|
482 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
483 |
|
484 |
}
|
inc_php/unitecreator_globals.class.php
CHANGED
@@ -89,6 +89,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
89 |
public static $table_addons;
|
90 |
public static $table_categories;
|
91 |
public static $table_layouts;
|
|
|
92 |
|
93 |
public static $pathSettings;
|
94 |
public static $filepathItemSettings;
|
@@ -299,4 +300,3 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
299 |
//init the globals
|
300 |
GlobalsUC::initGlobals();
|
301 |
|
302 |
-
?>
|
89 |
public static $table_addons;
|
90 |
public static $table_categories;
|
91 |
public static $table_layouts;
|
92 |
+
public static $table_prefix;
|
93 |
|
94 |
public static $pathSettings;
|
95 |
public static $filepathItemSettings;
|
300 |
//init the globals
|
301 |
GlobalsUC::initGlobals();
|
302 |
|
|
inc_php/unitecreator_helper.class.php
CHANGED
@@ -1298,7 +1298,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1298 |
$handle = GlobalsUC::PLUGIN_NAME."-".$scriptName;
|
1299 |
|
1300 |
$url = GlobalsUC::$urlPlugin .$folder."/".$scriptName.".js";
|
1301 |
-
|
1302 |
UniteProviderFunctionsUC::addScript($handle, $url, $inFooter);
|
1303 |
}
|
1304 |
|
1298 |
$handle = GlobalsUC::PLUGIN_NAME."-".$scriptName;
|
1299 |
|
1300 |
$url = GlobalsUC::$urlPlugin .$folder."/".$scriptName.".js";
|
1301 |
+
|
1302 |
UniteProviderFunctionsUC::addScript($handle, $url, $inFooter);
|
1303 |
}
|
1304 |
|
inc_php/unitecreator_helperhtml.class.php
CHANGED
@@ -835,6 +835,53 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
835 |
return($output);
|
836 |
}
|
837 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
838 |
|
839 |
|
840 |
} //end class
|
835 |
return($output);
|
836 |
}
|
837 |
|
838 |
+
/**
|
839 |
+
* get rating array from rating number. used to help to draw stars
|
840 |
+
*/
|
841 |
+
public static function getRatingArray($rating){
|
842 |
+
|
843 |
+
$arrRating = array();
|
844 |
+
|
845 |
+
$empty = array(
|
846 |
+
"type"=>"empty",
|
847 |
+
"class"=>"far fa-star",
|
848 |
+
);
|
849 |
+
$full = array(
|
850 |
+
"type"=>"full",
|
851 |
+
"class"=>"fas fa-star",
|
852 |
+
);
|
853 |
+
$half = array(
|
854 |
+
"type"=>"half",
|
855 |
+
"class"=>"fas fa-star-half-alt",
|
856 |
+
);
|
857 |
+
|
858 |
+
|
859 |
+
for($i=1;$i<=5;$i++){
|
860 |
+
|
861 |
+
$low = floor($rating);
|
862 |
+
|
863 |
+
if($rating == 0){
|
864 |
+
$arrRating[] = $empty;
|
865 |
+
continue;
|
866 |
+
}
|
867 |
+
|
868 |
+
if($rating < $i && $rating > ($i-1)){
|
869 |
+
$arrRating[] = $half;
|
870 |
+
continue;
|
871 |
+
}
|
872 |
+
|
873 |
+
|
874 |
+
if($i <= $low){
|
875 |
+
$arrRating[] = $full;
|
876 |
+
continue;
|
877 |
+
}
|
878 |
+
|
879 |
+
$arrRating[] = $empty;
|
880 |
+
}
|
881 |
+
|
882 |
+
|
883 |
+
return($arrRating);
|
884 |
+
}
|
885 |
|
886 |
|
887 |
} //end class
|
inc_php/unitecreator_output.class.php
CHANGED
@@ -190,7 +190,6 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
190 |
|
191 |
foreach($arrIncludes as $handle => $include){
|
192 |
|
193 |
-
|
194 |
$urlInclude = $include;
|
195 |
|
196 |
if(is_array($include)){
|
@@ -209,13 +208,29 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
209 |
|
210 |
$urlInclude = HelperUC::urlToSSLCheck($urlInclude);
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
$arrIncludeNew = array();
|
213 |
$arrIncludeNew["url"] = $urlInclude;
|
214 |
$arrIncludeNew["type"] = $type;
|
215 |
-
|
216 |
if(!empty($handle))
|
217 |
$arrIncludeNew["handle"] = $handle;
|
218 |
|
|
|
|
|
|
|
219 |
$arrIncludesProcessed[] = $arrIncludeNew;
|
220 |
|
221 |
}
|
@@ -264,6 +279,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
264 |
$arrLibJs = $arrLibraries["js"];
|
265 |
|
266 |
$arrIncludesJS = $this->addon->getJSIncludes();
|
|
|
267 |
$arrIncludesJS = array_merge($arrLibJs, $arrIncludesJS);
|
268 |
$arrIncludesJS = $this->processIncludesList($arrIncludesJS, "js");
|
269 |
|
@@ -364,6 +380,8 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
364 |
$type = $include["type"];
|
365 |
$url = $include["url"];
|
366 |
$handle = UniteFunctionsUC::getVal($include, "handle");
|
|
|
|
|
367 |
|
368 |
if(empty($handle))
|
369 |
$handle = HelperUC::getUrlHandle($url, $addonName);
|
@@ -373,11 +391,16 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
373 |
continue;
|
374 |
}
|
375 |
$this->cacheInclude($url, $handle, $type);
|
|
|
|
|
|
|
|
|
|
|
376 |
|
377 |
switch($type){
|
378 |
case "js":
|
379 |
|
380 |
-
UniteProviderFunctionsUC::addScript($handle, $url, false, $
|
381 |
break;
|
382 |
case "css":
|
383 |
UniteProviderFunctionsUC::addStyle($handle, $url);
|
@@ -1295,9 +1318,20 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1295 |
|
1296 |
$num = $index+1;
|
1297 |
|
1298 |
-
$
|
|
|
|
|
|
|
|
|
|
|
1299 |
|
1300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1301 |
|
1302 |
if($isShowMeta == false)
|
1303 |
continue;
|
@@ -1320,7 +1354,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1320 |
*/
|
1321 |
private function putDebugDataHtml($arrData, $arrItemData){
|
1322 |
|
1323 |
-
echo "<div style='font-size:16px;color:black;text-decoration:none;'>";
|
1324 |
|
1325 |
dmp("<b>Widget Debug Data</b> (turned on by setting in widget advanced section)<br>");
|
1326 |
|
@@ -1667,7 +1701,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1667 |
$arrParams = $this->getAddonParams();
|
1668 |
|
1669 |
$arrData = array_merge($arrData, $arrParams);
|
1670 |
-
|
1671 |
//set templates
|
1672 |
$html = $this->addon->getHtml();
|
1673 |
$css = $this->addon->getCss();
|
190 |
|
191 |
foreach($arrIncludes as $handle => $include){
|
192 |
|
|
|
193 |
$urlInclude = $include;
|
194 |
|
195 |
if(is_array($include)){
|
208 |
|
209 |
$urlInclude = HelperUC::urlToSSLCheck($urlInclude);
|
210 |
|
211 |
+
$deps = array();
|
212 |
+
|
213 |
+
//process params
|
214 |
+
$params = UniteFunctionsUC::getVal($include, "params");
|
215 |
+
if(!empty($params)){
|
216 |
+
$includeAfterFrontend = UniteFunctionsUC::getVal($params, "include_after_elementor_frontend");
|
217 |
+
$includeAfterFrontend = UniteFunctionsUC::strToBool($includeAfterFrontend);
|
218 |
+
|
219 |
+
if($includeAfterFrontend == true)
|
220 |
+
$deps[]= "elementor-frontend";
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
$arrIncludeNew = array();
|
225 |
$arrIncludeNew["url"] = $urlInclude;
|
226 |
$arrIncludeNew["type"] = $type;
|
227 |
+
|
228 |
if(!empty($handle))
|
229 |
$arrIncludeNew["handle"] = $handle;
|
230 |
|
231 |
+
if(!empty($deps))
|
232 |
+
$arrIncludeNew["deps"] = $deps;
|
233 |
+
|
234 |
$arrIncludesProcessed[] = $arrIncludeNew;
|
235 |
|
236 |
}
|
279 |
$arrLibJs = $arrLibraries["js"];
|
280 |
|
281 |
$arrIncludesJS = $this->addon->getJSIncludes();
|
282 |
+
|
283 |
$arrIncludesJS = array_merge($arrLibJs, $arrIncludesJS);
|
284 |
$arrIncludesJS = $this->processIncludesList($arrIncludesJS, "js");
|
285 |
|
380 |
$type = $include["type"];
|
381 |
$url = $include["url"];
|
382 |
$handle = UniteFunctionsUC::getVal($include, "handle");
|
383 |
+
$deps = UniteFunctionsUC::getVal($include, "deps");
|
384 |
+
|
385 |
|
386 |
if(empty($handle))
|
387 |
$handle = HelperUC::getUrlHandle($url, $addonName);
|
391 |
continue;
|
392 |
}
|
393 |
$this->cacheInclude($url, $handle, $type);
|
394 |
+
|
395 |
+
$arrIncludeDep = $arrDep;
|
396 |
+
|
397 |
+
if(!empty($deps))
|
398 |
+
$arrIncludeDep = array_merge($arrIncludeDep, $deps);
|
399 |
|
400 |
switch($type){
|
401 |
case "js":
|
402 |
|
403 |
+
UniteProviderFunctionsUC::addScript($handle, $url, false, $arrIncludeDep);
|
404 |
break;
|
405 |
case "css":
|
406 |
UniteProviderFunctionsUC::addStyle($handle, $url);
|
1318 |
|
1319 |
$num = $index+1;
|
1320 |
|
1321 |
+
$post = get_post($id);
|
1322 |
+
|
1323 |
+
$status = $post->post_status;
|
1324 |
+
|
1325 |
+
$arrTermsNames = UniteFunctionsWPUC::getPostTermsTitles($post);
|
1326 |
+
$strTerms = implode(",", $arrTermsNames);
|
1327 |
|
1328 |
+
$htmlAfterAlias = "";
|
1329 |
+
if($status != "publish")
|
1330 |
+
$htmlAfterAlias = ", [$status post]";
|
1331 |
+
|
1332 |
+
$text = "{$num}. <b>$title</b> (<i style='font-size:13px;'>$alias{$htmlAfterAlias}, $id | $strTerms </i>)";
|
1333 |
+
|
1334 |
+
dmp($text);
|
1335 |
|
1336 |
if($isShowMeta == false)
|
1337 |
continue;
|
1354 |
*/
|
1355 |
private function putDebugDataHtml($arrData, $arrItemData){
|
1356 |
|
1357 |
+
echo "<div style='font-size:16px;color:black;text-decoration:none;background-color:white;'>";
|
1358 |
|
1359 |
dmp("<b>Widget Debug Data</b> (turned on by setting in widget advanced section)<br>");
|
1360 |
|
1701 |
$arrParams = $this->getAddonParams();
|
1702 |
|
1703 |
$arrData = array_merge($arrData, $arrParams);
|
1704 |
+
|
1705 |
//set templates
|
1706 |
$html = $this->addon->getHtml();
|
1707 |
$css = $this->addon->getCss();
|
inc_php/unitecreator_params_processor.class.php
CHANGED
@@ -111,7 +111,10 @@ class UniteCreatorParamsProcessorWork{
|
|
111 |
|
112 |
if(empty($options))
|
113 |
return($value);
|
114 |
-
|
|
|
|
|
|
|
115 |
$key = array_search($value, $options, true);
|
116 |
if($key !== false)
|
117 |
return($value);
|
@@ -1106,14 +1109,19 @@ class UniteCreatorParamsProcessorWork{
|
|
1106 |
|
1107 |
if(isset($param["value"]))
|
1108 |
$param["value"] = $this->convertValueByType($param["value"], $type, $param);
|
1109 |
-
|
1110 |
if(isset($param["default_value"]))
|
1111 |
$param["default_value"] = $this->convertValueByType($param["default_value"], $type, $param);
|
1112 |
|
1113 |
//make sure that the value is part of the options
|
1114 |
-
if(isset($param["value"]) &&
|
|
|
|
|
|
|
|
|
1115 |
$param["value"] = $this->convertValueFromOptions($param["value"], $param["options"], $param["default_value"]);
|
1116 |
-
|
|
|
1117 |
$arrParams[$key] = $param;
|
1118 |
}
|
1119 |
|
@@ -1421,7 +1429,7 @@ class UniteCreatorParamsProcessorWork{
|
|
1421 |
* get processe param data, function with override
|
1422 |
*/
|
1423 |
protected function getProcessedParamData($data, $value, $param, $processType){
|
1424 |
-
|
1425 |
$type = UniteFunctionsUC::getVal($param, "type");
|
1426 |
$name = UniteFunctionsUC::getVal($param, "name");
|
1427 |
|
@@ -1505,7 +1513,8 @@ class UniteCreatorParamsProcessorWork{
|
|
1505 |
self::validateProcessType($processType);
|
1506 |
|
1507 |
$arrParams = $this->processParamsForOutput($arrParams);
|
1508 |
-
|
|
|
1509 |
$data = array();
|
1510 |
|
1511 |
foreach($arrParams as $param){
|
@@ -1525,7 +1534,7 @@ class UniteCreatorParamsProcessorWork{
|
|
1525 |
$value = UniteFunctionsUC::getVal($param, "value");
|
1526 |
|
1527 |
$value = $this->convertValueByType($value, $type, $param);
|
1528 |
-
|
1529 |
if(empty($name))
|
1530 |
continue;
|
1531 |
|
@@ -1590,6 +1599,7 @@ class UniteCreatorParamsProcessorWork{
|
|
1590 |
|
1591 |
$arrParams = $this->getProcessedParamsValues($objParams, $processType);
|
1592 |
|
|
|
1593 |
$arrVars = $this->getMainVariablesProcessed($arrParams);
|
1594 |
|
1595 |
if($this->isOutputProcessType($processType) == true){
|
111 |
|
112 |
if(empty($options))
|
113 |
return($value);
|
114 |
+
|
115 |
+
if(is_array($value))
|
116 |
+
return($value);
|
117 |
+
|
118 |
$key = array_search($value, $options, true);
|
119 |
if($key !== false)
|
120 |
return($value);
|
1109 |
|
1110 |
if(isset($param["value"]))
|
1111 |
$param["value"] = $this->convertValueByType($param["value"], $type, $param);
|
1112 |
+
|
1113 |
if(isset($param["default_value"]))
|
1114 |
$param["default_value"] = $this->convertValueByType($param["default_value"], $type, $param);
|
1115 |
|
1116 |
//make sure that the value is part of the options
|
1117 |
+
if(isset($param["value"]) &&
|
1118 |
+
isset($param["default_value"]) &&
|
1119 |
+
isset($param["options"]) &&
|
1120 |
+
!empty($param["options"]) ){
|
1121 |
+
|
1122 |
$param["value"] = $this->convertValueFromOptions($param["value"], $param["options"], $param["default_value"]);
|
1123 |
+
}
|
1124 |
+
|
1125 |
$arrParams[$key] = $param;
|
1126 |
}
|
1127 |
|
1429 |
* get processe param data, function with override
|
1430 |
*/
|
1431 |
protected function getProcessedParamData($data, $value, $param, $processType){
|
1432 |
+
|
1433 |
$type = UniteFunctionsUC::getVal($param, "type");
|
1434 |
$name = UniteFunctionsUC::getVal($param, "name");
|
1435 |
|
1513 |
self::validateProcessType($processType);
|
1514 |
|
1515 |
$arrParams = $this->processParamsForOutput($arrParams);
|
1516 |
+
|
1517 |
+
|
1518 |
$data = array();
|
1519 |
|
1520 |
foreach($arrParams as $param){
|
1534 |
$value = UniteFunctionsUC::getVal($param, "value");
|
1535 |
|
1536 |
$value = $this->convertValueByType($value, $type, $param);
|
1537 |
+
|
1538 |
if(empty($name))
|
1539 |
continue;
|
1540 |
|
1599 |
|
1600 |
$arrParams = $this->getProcessedParamsValues($objParams, $processType);
|
1601 |
|
1602 |
+
|
1603 |
$arrVars = $this->getMainVariablesProcessed($arrParams);
|
1604 |
|
1605 |
if($this->isOutputProcessType($processType) == true){
|
inc_php/unitecreator_settings.class.php
CHANGED
@@ -218,7 +218,15 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
218 |
dmp("addPostsListPicker - function for override");
|
219 |
exit();
|
220 |
}
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
/**
|
224 |
* add post terms settings
|
@@ -484,6 +492,7 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
484 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
485 |
case UniteCreatorDialogParam::PARAM_USERS:
|
486 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
|
|
487 |
|
488 |
return(true);
|
489 |
break;
|
@@ -638,6 +647,13 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
638 |
|
639 |
$this->addSelect($name, $options, $title, $value, $extra);
|
640 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
641 |
case "uc_colorpicker":
|
642 |
$this->addColorPicker($name, $value, $title, $extra);
|
643 |
break;
|
@@ -696,11 +712,22 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
696 |
$this->addPostsListPicker($name,$value,$title,$extra);
|
697 |
break;
|
698 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
|
|
|
|
|
|
699 |
$this->addPostTermsPicker($name,$value,$title,$extra);
|
700 |
break;
|
701 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
702 |
$this->addWooCatsPicker($name,$value,$title,$extra);
|
703 |
-
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
case UniteCreatorDialogParam::PARAM_USERS:
|
705 |
$this->addUsersPicker($name,$value,$title,$extra);
|
706 |
break;
|
218 |
dmp("addPostsListPicker - function for override");
|
219 |
exit();
|
220 |
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* add listing picker, function for override
|
224 |
+
*/
|
225 |
+
protected function addListingPicker($name,$value,$title,$extra){
|
226 |
+
|
227 |
+
dmp("addListingPicker - function for override");
|
228 |
+
exit();
|
229 |
+
}
|
230 |
|
231 |
/**
|
232 |
* add post terms settings
|
492 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
493 |
case UniteCreatorDialogParam::PARAM_USERS:
|
494 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
495 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
496 |
|
497 |
return(true);
|
498 |
break;
|
647 |
|
648 |
$this->addSelect($name, $options, $title, $value, $extra);
|
649 |
break;
|
650 |
+
case UniteCreatorDialogParam::PARAM_MULTIPLE_SELECT:
|
651 |
+
|
652 |
+
$options = UniteFunctionsUC::getVal($param, "options");
|
653 |
+
|
654 |
+
$this->addMultiSelect($name, $options, $title, $value, $extra);
|
655 |
+
|
656 |
+
break;
|
657 |
case "uc_colorpicker":
|
658 |
$this->addColorPicker($name, $value, $title, $extra);
|
659 |
break;
|
712 |
$this->addPostsListPicker($name,$value,$title,$extra);
|
713 |
break;
|
714 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
715 |
+
|
716 |
+
$extra["for_woocommerce"] = UniteFunctionsUC::getVal($param, "for_woocommerce");
|
717 |
+
|
718 |
$this->addPostTermsPicker($name,$value,$title,$extra);
|
719 |
break;
|
720 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
721 |
$this->addWooCatsPicker($name,$value,$title,$extra);
|
722 |
+
break;
|
723 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
724 |
+
|
725 |
+
$this->addListingPicker($name,$value,$title,$extra);
|
726 |
+
|
727 |
+
break;
|
728 |
+
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
729 |
+
$this->addWooCatsPicker($name,$value,$title,$extra);
|
730 |
+
break;
|
731 |
case UniteCreatorDialogParam::PARAM_USERS:
|
732 |
$this->addUsersPicker($name,$value,$title,$extra);
|
733 |
break;
|
inc_php/unitecreator_template_engine.class.php
CHANGED
@@ -79,7 +79,7 @@ class UniteCreatorTemplateEngineWork{
|
|
79 |
|
80 |
foreach($this->arrItems as $index => $itemParams)
|
81 |
$this->outputItem($index, $itemParams, $templateName, $sap, $newLine);
|
82 |
-
|
83 |
}
|
84 |
|
85 |
|
@@ -104,11 +104,19 @@ class UniteCreatorTemplateEngineWork{
|
|
104 |
/**
|
105 |
* get the items for iteration
|
106 |
*/
|
107 |
-
public function getItems(){
|
108 |
|
109 |
$arrItems = array();
|
110 |
-
foreach($this->arrItems as $item)
|
111 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
return($arrItems);
|
114 |
}
|
@@ -116,10 +124,10 @@ class UniteCreatorTemplateEngineWork{
|
|
116 |
/**
|
117 |
* put items json for js
|
118 |
*/
|
119 |
-
public function putItemsJson(){
|
120 |
-
|
121 |
//modify items for output
|
122 |
-
$arrItems = $this->getItems();
|
123 |
|
124 |
//json encode
|
125 |
$jsonItems = UniteFunctionsUC::jsonEncodeForClientSide($arrItems);
|
@@ -127,6 +135,22 @@ class UniteCreatorTemplateEngineWork{
|
|
127 |
echo $jsonItems;
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
/**
|
131 |
* put items 2
|
132 |
*/
|
@@ -489,21 +513,6 @@ class UniteCreatorTemplateEngineWork{
|
|
489 |
//function for override
|
490 |
}
|
491 |
|
492 |
-
/**
|
493 |
-
* put woo commerce filter
|
494 |
-
*/
|
495 |
-
public function putWooFilter($filterName = null){
|
496 |
-
|
497 |
-
if(empty($filterName))
|
498 |
-
UniteFunctionsUC::throwError("putWooFilter error: No Filter provided");
|
499 |
-
|
500 |
-
$isActive = UniteCreatorWooIntegrate::isWooActive();
|
501 |
-
|
502 |
-
$objWooIntegrate = UniteCreatorWooIntegrate::getInstance();
|
503 |
-
|
504 |
-
$objWooIntegrate->putHtmlFilter($filterName);
|
505 |
-
|
506 |
-
}
|
507 |
|
508 |
/**
|
509 |
* get woo child product
|
@@ -619,6 +628,61 @@ class UniteCreatorTemplateEngineWork{
|
|
619 |
$objPagination->putPaginationWidgetHtml($args);
|
620 |
}
|
621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
/**
|
623 |
* number format for woocommerce
|
624 |
*/
|
@@ -635,6 +699,20 @@ class UniteCreatorTemplateEngineWork{
|
|
635 |
|
636 |
return($price);
|
637 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
|
639 |
/**
|
640 |
* get listing item data
|
@@ -695,19 +773,31 @@ class UniteCreatorTemplateEngineWork{
|
|
695 |
|
696 |
}
|
697 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
698 |
/**
|
699 |
* put test html
|
700 |
*/
|
701 |
-
public function putTestHTML($type = null){
|
702 |
|
703 |
$objFilters = new UniteCreatorFiltersProcess();
|
|
|
704 |
|
705 |
switch($type){
|
706 |
-
case "
|
707 |
-
|
|
|
|
|
708 |
break;
|
709 |
default:
|
710 |
-
$
|
711 |
break;
|
712 |
}
|
713 |
|
@@ -724,6 +814,8 @@ class UniteCreatorTemplateEngineWork{
|
|
724 |
$putItemsFunction = new Twig_SimpleFunction('put_items', array($this,"putItems"));
|
725 |
$putItemsFunction2 = new Twig_SimpleFunction('put_items2', array($this,"putItems2"));
|
726 |
$putItemsJsonFunction = new Twig_SimpleFunction('put_items_json', array($this,"putItemsJson"));
|
|
|
|
|
727 |
$getItems = new Twig_SimpleFunction('get_items', array($this,"getItems"));
|
728 |
$putGetDataFunction = new Twig_SimpleFunction('get_data', array($this,"getData"));
|
729 |
|
@@ -746,6 +838,8 @@ class UniteCreatorTemplateEngineWork{
|
|
746 |
$getPostTags = new Twig_SimpleFunction('getPostTags', array($this,"getPostTags"));
|
747 |
$getPostData = new Twig_SimpleFunction('getPostData', array($this,"getPostData"));
|
748 |
$putPagination = new Twig_SimpleFunction('putPagination', array($this,"putPagination"));
|
|
|
|
|
749 |
|
750 |
$putPostImageAttributes = new Twig_SimpleFunction('putPostImageAttributes', array($this,"putPostImageAttributes"));
|
751 |
|
@@ -760,9 +854,7 @@ class UniteCreatorTemplateEngineWork{
|
|
760 |
$getPostTerms = new Twig_SimpleFunction('getPostTerms', array($this,"getPostTerms"));
|
761 |
$getPostAuthor = new Twig_SimpleFunction('getPostAuthor', array($this,"getPostAuthor"));
|
762 |
$getUserData = new Twig_SimpleFunction('getUserData', array($this,"getUserData"));
|
763 |
-
$putWooFilter = new Twig_SimpleFunction('putWooFilter', array($this,"putWooFilter"));
|
764 |
$getWooChildProducts = new Twig_SimpleFunction('getWooChildProducts', array($this,"getWooChildProducts"));
|
765 |
-
|
766 |
$getListingItemData = new Twig_SimpleFunction('getListingItemData', array($this,"getListingItemData"));
|
767 |
|
768 |
$printTermCustomFields = new Twig_SimpleFunction('printTermCustomFields', array($this,"printTermCustomFields"));
|
@@ -773,7 +865,8 @@ class UniteCreatorTemplateEngineWork{
|
|
773 |
$filterWPAutop = new Twig_SimpleFilter("wpautop", array($this, "filterWPAutop"));
|
774 |
$filterUCDate = new Twig_SimpleFilter("ucdate", array($this, "filterUCDate"));
|
775 |
$filterPriceNumberFormat = new Twig_SimpleFilter("price_number_format", array($this, "filterPriceNumberFormat"));
|
776 |
-
|
|
|
777 |
$putTestHtml = new Twig_SimpleFunction('putTestHTML', array($this,"putTestHTML"));
|
778 |
|
779 |
|
@@ -806,16 +899,19 @@ class UniteCreatorTemplateEngineWork{
|
|
806 |
$this->twig->addFunction($getPostData);
|
807 |
$this->twig->addFunction($printVar);
|
808 |
$this->twig->addFunction($printJsonVar);
|
809 |
-
$this->twig->addFunction($printJsonHtmlData);
|
810 |
$this->twig->addFunction($putPagination);
|
|
|
|
|
811 |
|
812 |
$this->twig->addFunction($getPostTerms);
|
813 |
$this->twig->addFunction($getPostAuthor);
|
814 |
$this->twig->addFunction($getUserData);
|
815 |
-
$this->twig->addFunction($putWooFilter);
|
816 |
$this->twig->addFunction($getWooChildProducts);
|
817 |
$this->twig->addFunction($getTermCustomFields);
|
818 |
$this->twig->addFunction($putItemsJsonFunction);
|
|
|
|
|
819 |
$this->twig->addFunction($getItems);
|
820 |
$this->twig->addFunction($putPostImageAttributes);
|
821 |
|
@@ -828,6 +924,7 @@ class UniteCreatorTemplateEngineWork{
|
|
828 |
$this->twig->addFilter($filterWPAutop);
|
829 |
$this->twig->addFilter($filterUCDate);
|
830 |
$this->twig->addFilter($filterPriceNumberFormat);
|
|
|
831 |
|
832 |
|
833 |
//pro functions
|
79 |
|
80 |
foreach($this->arrItems as $index => $itemParams)
|
81 |
$this->outputItem($index, $itemParams, $templateName, $sap, $newLine);
|
82 |
+
|
83 |
}
|
84 |
|
85 |
|
104 |
/**
|
105 |
* get the items for iteration
|
106 |
*/
|
107 |
+
public function getItems($type = null){
|
108 |
|
109 |
$arrItems = array();
|
110 |
+
foreach($this->arrItems as $item){
|
111 |
+
$item = $item["item"];
|
112 |
+
if($type == "clean"){
|
113 |
+
unset($item["item_repeater_class"]);
|
114 |
+
unset($item["item_index"]);
|
115 |
+
unset($item["item_id"]);
|
116 |
+
}
|
117 |
+
|
118 |
+
$arrItems[] = $item;
|
119 |
+
}
|
120 |
|
121 |
return($arrItems);
|
122 |
}
|
124 |
/**
|
125 |
* put items json for js
|
126 |
*/
|
127 |
+
public function putItemsJson($type = null){
|
128 |
+
|
129 |
//modify items for output
|
130 |
+
$arrItems = $this->getItems($type);
|
131 |
|
132 |
//json encode
|
133 |
$jsonItems = UniteFunctionsUC::jsonEncodeForClientSide($arrItems);
|
135 |
echo $jsonItems;
|
136 |
}
|
137 |
|
138 |
+
/**
|
139 |
+
* put data json for js
|
140 |
+
*/
|
141 |
+
public function putAttributesJson($type = null){
|
142 |
+
|
143 |
+
$arrAttr = $this->arrParams;
|
144 |
+
|
145 |
+
if($type == "clean")
|
146 |
+
$arrAttr = UniteFunctionsUC::removeArrItemsByKeys($arrAttr, GlobalsProviderUC::$arrAttrConstantKeys);
|
147 |
+
|
148 |
+
$jsonAttr = UniteFunctionsUC::jsonEncodeForClientSide($arrAttr);
|
149 |
+
|
150 |
+
echo $jsonAttr;
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
/**
|
155 |
* put items 2
|
156 |
*/
|
513 |
//function for override
|
514 |
}
|
515 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
|
517 |
/**
|
518 |
* get woo child product
|
628 |
$objPagination->putPaginationWidgetHtml($args);
|
629 |
}
|
630 |
|
631 |
+
/**
|
632 |
+
* put listing loop
|
633 |
+
*/
|
634 |
+
public function putListingItemTemplate($item, $templateID){
|
635 |
+
|
636 |
+
HelperProviderCoreUC_EL::putListingItemTemplate($item, $templateID);
|
637 |
+
|
638 |
+
}
|
639 |
+
|
640 |
+
|
641 |
+
/**
|
642 |
+
* put listing template
|
643 |
+
*/
|
644 |
+
/*
|
645 |
+
public function putListingTemplate_posts($paramName, $templateID){
|
646 |
+
|
647 |
+
global $wp_query;
|
648 |
+
|
649 |
+
$originalPost = $GLOBALS['post'];
|
650 |
+
|
651 |
+
//backup the original querified object
|
652 |
+
$originalQueriedObject = $wp_query->queried_object;
|
653 |
+
$originalQueriedObjectID = $wp_query->queried_object_id;
|
654 |
+
|
655 |
+
foreach($this->arrItems as $item){
|
656 |
+
|
657 |
+
$item = UniteFunctionsUC::getVal($item, "item");
|
658 |
+
|
659 |
+
$postItem = UniteFunctionsUC::getVal($item, $paramName);
|
660 |
+
if(empty($postItem))
|
661 |
+
UniteFunctionsUC::throwError("Posts List attribute: $paramName not found. please write the correct post list attribute name.");
|
662 |
+
|
663 |
+
$postID = $postItem->ID;
|
664 |
+
|
665 |
+
|
666 |
+
//set the post qieried object
|
667 |
+
$wp_query->queried_object = $postItem;
|
668 |
+
$wp_query->queried_object_id = $postID;
|
669 |
+
|
670 |
+
$GLOBALS['post'] = $postItem;
|
671 |
+
|
672 |
+
$output = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( 1753 );
|
673 |
+
|
674 |
+
echo $output;
|
675 |
+
}
|
676 |
+
|
677 |
+
//restore the original queried object
|
678 |
+
$wp_query->queried_object = $originalQueriedObject;
|
679 |
+
$wp_query->queried_object_id = $originalQueriedObjectID;
|
680 |
+
$GLOBALS['post'] = $originalPost;
|
681 |
+
|
682 |
+
}
|
683 |
+
|
684 |
+
*/
|
685 |
+
|
686 |
/**
|
687 |
* number format for woocommerce
|
688 |
*/
|
699 |
|
700 |
return($price);
|
701 |
}
|
702 |
+
|
703 |
+
/**
|
704 |
+
* number format for woocommerce
|
705 |
+
*/
|
706 |
+
public function filterWcPrice($price){
|
707 |
+
|
708 |
+
if(function_exists("wc_price") == false)
|
709 |
+
return($price);
|
710 |
+
|
711 |
+
$newPrice = wc_price($price);
|
712 |
+
|
713 |
+
return($newPrice);
|
714 |
+
}
|
715 |
+
|
716 |
|
717 |
/**
|
718 |
* get listing item data
|
773 |
|
774 |
}
|
775 |
|
776 |
+
/**
|
777 |
+
* output elementor template by id
|
778 |
+
*/
|
779 |
+
public function putElementorTemplate($templateID){
|
780 |
+
|
781 |
+
HelperProviderCoreUC_EL::putElementorTemplate($templateID);
|
782 |
+
|
783 |
+
}
|
784 |
+
|
785 |
/**
|
786 |
* put test html
|
787 |
*/
|
788 |
+
public function putTestHTML($type = null, $data = null){
|
789 |
|
790 |
$objFilters = new UniteCreatorFiltersProcess();
|
791 |
+
//$objFilters->putFiltersTabs();
|
792 |
|
793 |
switch($type){
|
794 |
+
case "filter_checkbox":
|
795 |
+
|
796 |
+
$objFilters->putCheckboxFiltersTest($data);
|
797 |
+
|
798 |
break;
|
799 |
default:
|
800 |
+
dmp("putTestHTML - type not found: $type");
|
801 |
break;
|
802 |
}
|
803 |
|
814 |
$putItemsFunction = new Twig_SimpleFunction('put_items', array($this,"putItems"));
|
815 |
$putItemsFunction2 = new Twig_SimpleFunction('put_items2', array($this,"putItems2"));
|
816 |
$putItemsJsonFunction = new Twig_SimpleFunction('put_items_json', array($this,"putItemsJson"));
|
817 |
+
$putAttributesJson = new Twig_SimpleFunction('put_attributes_json', array($this,"putAttributesJson"));
|
818 |
+
|
819 |
$getItems = new Twig_SimpleFunction('get_items', array($this,"getItems"));
|
820 |
$putGetDataFunction = new Twig_SimpleFunction('get_data', array($this,"getData"));
|
821 |
|
838 |
$getPostTags = new Twig_SimpleFunction('getPostTags', array($this,"getPostTags"));
|
839 |
$getPostData = new Twig_SimpleFunction('getPostData', array($this,"getPostData"));
|
840 |
$putPagination = new Twig_SimpleFunction('putPagination', array($this,"putPagination"));
|
841 |
+
$putListingItemTemplate = new Twig_SimpleFunction('putListingItemTemplate', array($this,"putListingItemTemplate"));
|
842 |
+
$putElementorTemplate = new Twig_SimpleFunction('putElementorTemplate', array($this,"putElementorTemplate"));
|
843 |
|
844 |
$putPostImageAttributes = new Twig_SimpleFunction('putPostImageAttributes', array($this,"putPostImageAttributes"));
|
845 |
|
854 |
$getPostTerms = new Twig_SimpleFunction('getPostTerms', array($this,"getPostTerms"));
|
855 |
$getPostAuthor = new Twig_SimpleFunction('getPostAuthor', array($this,"getPostAuthor"));
|
856 |
$getUserData = new Twig_SimpleFunction('getUserData', array($this,"getUserData"));
|
|
|
857 |
$getWooChildProducts = new Twig_SimpleFunction('getWooChildProducts', array($this,"getWooChildProducts"));
|
|
|
858 |
$getListingItemData = new Twig_SimpleFunction('getListingItemData', array($this,"getListingItemData"));
|
859 |
|
860 |
$printTermCustomFields = new Twig_SimpleFunction('printTermCustomFields', array($this,"printTermCustomFields"));
|
865 |
$filterWPAutop = new Twig_SimpleFilter("wpautop", array($this, "filterWPAutop"));
|
866 |
$filterUCDate = new Twig_SimpleFilter("ucdate", array($this, "filterUCDate"));
|
867 |
$filterPriceNumberFormat = new Twig_SimpleFilter("price_number_format", array($this, "filterPriceNumberFormat"));
|
868 |
+
$filterWcPrice = new Twig_SimpleFilter("wc_price", array($this, "filterWcPrice"));
|
869 |
+
|
870 |
$putTestHtml = new Twig_SimpleFunction('putTestHTML', array($this,"putTestHTML"));
|
871 |
|
872 |
|
899 |
$this->twig->addFunction($getPostData);
|
900 |
$this->twig->addFunction($printVar);
|
901 |
$this->twig->addFunction($printJsonVar);
|
902 |
+
$this->twig->addFunction($printJsonHtmlData);
|
903 |
$this->twig->addFunction($putPagination);
|
904 |
+
$this->twig->addFunction($putListingItemTemplate);
|
905 |
+
$this->twig->addFunction($putElementorTemplate);
|
906 |
|
907 |
$this->twig->addFunction($getPostTerms);
|
908 |
$this->twig->addFunction($getPostAuthor);
|
909 |
$this->twig->addFunction($getUserData);
|
|
|
910 |
$this->twig->addFunction($getWooChildProducts);
|
911 |
$this->twig->addFunction($getTermCustomFields);
|
912 |
$this->twig->addFunction($putItemsJsonFunction);
|
913 |
+
$this->twig->addFunction($putAttributesJson);
|
914 |
+
|
915 |
$this->twig->addFunction($getItems);
|
916 |
$this->twig->addFunction($putPostImageAttributes);
|
917 |
|
924 |
$this->twig->addFilter($filterWPAutop);
|
925 |
$this->twig->addFilter($filterUCDate);
|
926 |
$this->twig->addFilter($filterPriceNumberFormat);
|
927 |
+
$this->twig->addFilter($filterWcPrice);
|
928 |
|
929 |
|
930 |
//pro functions
|
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.
|
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.73");
|
16 |
|
17 |
$currentFile = __FILE__;
|
18 |
$currentFolder = dirname($currentFile);
|
js/settings.js
CHANGED
@@ -406,7 +406,7 @@ function UniteSettingsUC(){
|
|
406 |
/**
|
407 |
* get settings values object by the parent
|
408 |
*/
|
409 |
-
this.getSettingsValues = function(controlsOnly){
|
410 |
|
411 |
validateInited();
|
412 |
|
@@ -419,7 +419,7 @@ function UniteSettingsUC(){
|
|
419 |
else{
|
420 |
var objInputs = getObjInputs().not(".unite-setting-transparent");
|
421 |
}
|
422 |
-
|
423 |
jQuery.each(objInputs, function(index, input){
|
424 |
|
425 |
var objInput = jQuery(input);
|
@@ -430,7 +430,16 @@ function UniteSettingsUC(){
|
|
430 |
|
431 |
if(value == g_vars.NOT_UPDATE_OPTION)
|
432 |
return(true);
|
433 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
inputID = objInput.prop("id");
|
435 |
|
436 |
//set additional vars
|
@@ -463,6 +472,51 @@ function UniteSettingsUC(){
|
|
463 |
};
|
464 |
|
465 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
/**
|
467 |
* clear input
|
468 |
*/
|
406 |
/**
|
407 |
* get settings values object by the parent
|
408 |
*/
|
409 |
+
this.getSettingsValues = function(controlsOnly, isChangedOnly){
|
410 |
|
411 |
validateInited();
|
412 |
|
419 |
else{
|
420 |
var objInputs = getObjInputs().not(".unite-setting-transparent");
|
421 |
}
|
422 |
+
|
423 |
jQuery.each(objInputs, function(index, input){
|
424 |
|
425 |
var objInput = jQuery(input);
|
430 |
|
431 |
if(value == g_vars.NOT_UPDATE_OPTION)
|
432 |
return(true);
|
433 |
+
|
434 |
+
//remain only changed values from default values
|
435 |
+
if(isChangedOnly === true){
|
436 |
+
var defaultValue = getInputDefaultValue(objInput);
|
437 |
+
|
438 |
+
if(defaultValue === value)
|
439 |
+
return(true);
|
440 |
+
}
|
441 |
+
|
442 |
+
|
443 |
inputID = objInput.prop("id");
|
444 |
|
445 |
//set additional vars
|
472 |
};
|
473 |
|
474 |
|
475 |
+
/**
|
476 |
+
* get default value
|
477 |
+
*/
|
478 |
+
function getInputDefaultValue(objInput){
|
479 |
+
|
480 |
+
var type = getInputType(objInput);
|
481 |
+
var name = getInputName(objInput);
|
482 |
+
|
483 |
+
var dataname = "default";
|
484 |
+
var checkboxDataName = "defaultchecked";
|
485 |
+
|
486 |
+
var defaultValue;
|
487 |
+
|
488 |
+
switch(type){
|
489 |
+
default:
|
490 |
+
if(!name)
|
491 |
+
return(false);
|
492 |
+
|
493 |
+
defaultValue = objInput.data(dataname);
|
494 |
+
|
495 |
+
if(typeof defaultValue == "object")
|
496 |
+
defaultValue = JSON.stringify(defaultValue);
|
497 |
+
|
498 |
+
if(type == "select"){
|
499 |
+
if(defaultValue === true)
|
500 |
+
defaultValue = "true";
|
501 |
+
if(defaultValue === false)
|
502 |
+
defaultValue = "false";
|
503 |
+
}
|
504 |
+
|
505 |
+
break;
|
506 |
+
case "radio":
|
507 |
+
case "checkbox":
|
508 |
+
defaultValue = objInput.data(checkboxDataName);
|
509 |
+
defaultValue = g_ucAdmin.strToBool(defaultValue);
|
510 |
+
break;
|
511 |
+
}
|
512 |
+
|
513 |
+
if(jQuery.isNumeric(defaultValue))
|
514 |
+
defaultValue = defaultValue.toString();
|
515 |
+
|
516 |
+
return(defaultValue);
|
517 |
+
}
|
518 |
+
|
519 |
+
|
520 |
/**
|
521 |
* clear input
|
522 |
*/
|
js/unitecreator_addon_config.js
CHANGED
@@ -338,11 +338,18 @@ function UniteCreatorAddonConfig(){
|
|
338 |
/**
|
339 |
* get data object
|
340 |
*/
|
341 |
-
this.getObjData = function(){
|
342 |
|
343 |
validateInited();
|
344 |
-
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
|
347 |
var objExtra = {};
|
348 |
objExtra["title"] = g_options.title;
|
@@ -354,7 +361,7 @@ function UniteCreatorAddonConfig(){
|
|
354 |
objData["name"] = g_addonName;
|
355 |
objData["addontype"] = g_addonType;
|
356 |
objData["extra"] = objExtra;
|
357 |
-
|
358 |
return(objData);
|
359 |
};
|
360 |
|
@@ -372,9 +379,9 @@ function UniteCreatorAddonConfig(){
|
|
372 |
/**
|
373 |
* get json data from the settings
|
374 |
*/
|
375 |
-
function getJsonData(){
|
376 |
|
377 |
-
var objData = t.getObjData();
|
378 |
|
379 |
var strData = JSON.stringify(objData);
|
380 |
|
@@ -455,8 +462,10 @@ function UniteCreatorAddonConfig(){
|
|
455 |
*/
|
456 |
function getPreviewUrl(){
|
457 |
|
458 |
-
var jsonData = getJsonData();
|
|
|
459 |
jsonData = encodeURIComponent(jsonData);
|
|
|
460 |
var params = "data="+jsonData+"";
|
461 |
var urlPreview = g_ucAdmin.getUrlAjax("show_preview", params);
|
462 |
|
338 |
/**
|
339 |
* get data object
|
340 |
*/
|
341 |
+
this.getObjData = function(isChangedOnly){
|
342 |
|
343 |
validateInited();
|
344 |
+
|
345 |
+
if(isChangedOnly === true){
|
346 |
+
|
347 |
+
var objValues = g_objSettings.getSettingsValues(false, true);
|
348 |
+
|
349 |
+
}else{
|
350 |
+
|
351 |
+
var objValues = g_objSettings.getSettingsValues();
|
352 |
+
}
|
353 |
|
354 |
var objExtra = {};
|
355 |
objExtra["title"] = g_options.title;
|
361 |
objData["name"] = g_addonName;
|
362 |
objData["addontype"] = g_addonType;
|
363 |
objData["extra"] = objExtra;
|
364 |
+
|
365 |
return(objData);
|
366 |
};
|
367 |
|
379 |
/**
|
380 |
* get json data from the settings
|
381 |
*/
|
382 |
+
function getJsonData(isChangedOnly){
|
383 |
|
384 |
+
var objData = t.getObjData(isChangedOnly);
|
385 |
|
386 |
var strData = JSON.stringify(objData);
|
387 |
|
462 |
*/
|
463 |
function getPreviewUrl(){
|
464 |
|
465 |
+
var jsonData = getJsonData(true);
|
466 |
+
|
467 |
jsonData = encodeURIComponent(jsonData);
|
468 |
+
|
469 |
var params = "data="+jsonData+"";
|
470 |
var urlPreview = g_ucAdmin.getUrlAjax("show_preview", params);
|
471 |
|
js/unitecreator_admin.js
CHANGED
@@ -573,7 +573,7 @@ function UniteCreatorAdmin(){
|
|
573 |
jQuery("#uc_tab_itemattr .unite_settings_wrapper").hide();
|
574 |
|
575 |
var itemTabText = param["items_panel_text"];
|
576 |
-
|
577 |
jQuery(".uc-postsitems-related").remove();
|
578 |
jQuery("#uc_tab_itemattr").append("<div class='uc-postsitems-related'>"+itemTabText+"</div>");
|
579 |
|
@@ -758,12 +758,22 @@ function UniteCreatorAdmin(){
|
|
758 |
//modify params for js
|
759 |
if(hasItems == true){
|
760 |
|
761 |
-
//put extra js functions
|
762 |
-
var textPutItemsJson = "
|
|
|
763 |
textPutItemsJson += "\nvar objItems = JSON.parse(strJsonItems);";
|
764 |
-
textPutItemsJson += "\nconsole.log(objItems)";
|
765 |
|
766 |
var paramPutItemJs = {type:"uc_function", name:"put_items_json()","raw_insert_text":textPutItemsJson};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
|
768 |
var textGetItems = "{# Generate javascript array from items using twig#}";
|
769 |
textGetItems += "\n{% set itemsForJs = get_items() %}";
|
@@ -779,8 +789,10 @@ function UniteCreatorAdmin(){
|
|
779 |
"raw_insert_text":textGetItems
|
780 |
};
|
781 |
|
782 |
-
arrParamsForJS.unshift(
|
783 |
arrParamsForJS.unshift(paramPutItemJs);
|
|
|
|
|
784 |
}
|
785 |
|
786 |
arrParamsForJS = paramsPanelMainSync_addEndingParamsJS(arrParamsForJS);
|
@@ -1804,6 +1816,7 @@ function UniteCreatorAdmin(){
|
|
1804 |
case "main":
|
1805 |
var arrData = g_paramsEditorMain.getParamsData("control", true);
|
1806 |
break;
|
|
|
1807 |
case "item":
|
1808 |
var arrData = g_paramsEditorItems.getParamsData("control", true);
|
1809 |
break;
|
573 |
jQuery("#uc_tab_itemattr .unite_settings_wrapper").hide();
|
574 |
|
575 |
var itemTabText = param["items_panel_text"];
|
576 |
+
|
577 |
jQuery(".uc-postsitems-related").remove();
|
578 |
jQuery("#uc_tab_itemattr").append("<div class='uc-postsitems-related'>"+itemTabText+"</div>");
|
579 |
|
758 |
//modify params for js
|
759 |
if(hasItems == true){
|
760 |
|
761 |
+
//put extra js functions - put_items_json
|
762 |
+
var textPutItemsJson = "{#use put_items_json(\"clean\") to remove extra data#}";
|
763 |
+
textPutItemsJson += "\nvar strJsonItems = {{put_items_json()}};";
|
764 |
textPutItemsJson += "\nvar objItems = JSON.parse(strJsonItems);";
|
765 |
+
textPutItemsJson += "\nconsole.log(objItems);";
|
766 |
|
767 |
var paramPutItemJs = {type:"uc_function", name:"put_items_json()","raw_insert_text":textPutItemsJson};
|
768 |
+
|
769 |
+
//put extra js functions - put_attributes_json
|
770 |
+
var textPutAttributesJson = "{#use put_attributes_json(\"clean\") to remove extra data#}";
|
771 |
+
textPutAttributesJson += "\nvar strJsonAttributes = {{put_attributes_json()}};";
|
772 |
+
textPutAttributesJson += "\nvar objAttributes = JSON.parse(strJsonAttributes);";
|
773 |
+
textPutAttributesJson += "\nconsole.log(objAttributes);";
|
774 |
+
|
775 |
+
var paramPutAttributesJs = {type:"uc_function", name:"put_attributes_json()","raw_insert_text":textPutAttributesJson};
|
776 |
+
|
777 |
|
778 |
var textGetItems = "{# Generate javascript array from items using twig#}";
|
779 |
textGetItems += "\n{% set itemsForJs = get_items() %}";
|
789 |
"raw_insert_text":textGetItems
|
790 |
};
|
791 |
|
792 |
+
arrParamsForJS.unshift(paramPutAttributesJs);
|
793 |
arrParamsForJS.unshift(paramPutItemJs);
|
794 |
+
arrParamsForJS.unshift(paramGetItemJs);
|
795 |
+
|
796 |
}
|
797 |
|
798 |
arrParamsForJS = paramsPanelMainSync_addEndingParamsJS(arrParamsForJS);
|
1816 |
case "main":
|
1817 |
var arrData = g_paramsEditorMain.getParamsData("control", true);
|
1818 |
break;
|
1819 |
+
case "items":
|
1820 |
case "item":
|
1821 |
var arrData = g_paramsEditorItems.getParamsData("control", true);
|
1822 |
break;
|
js/unitecreator_includes.js
CHANGED
@@ -166,6 +166,11 @@ function UniteCreatorIncludes(){
|
|
166 |
if(objCondition)
|
167 |
objHtml.data("condition", objCondition);
|
168 |
|
|
|
|
|
|
|
|
|
|
|
169 |
return(objHtml)
|
170 |
}
|
171 |
|
@@ -314,6 +319,13 @@ function UniteCreatorIncludes(){
|
|
314 |
if(!data.condition && typeof data.condition != "object")
|
315 |
data.condition = null;
|
316 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
return(data);
|
318 |
}
|
319 |
|
@@ -380,8 +392,9 @@ function UniteCreatorIncludes(){
|
|
380 |
* init include list
|
381 |
*/
|
382 |
function initIncludeList(objList){
|
383 |
-
var data = objList.data("init");
|
384 |
|
|
|
|
|
385 |
if(!data || typeof data != "object" || data.length == 0){
|
386 |
addIncludesListItem(objList);
|
387 |
return(false);
|
@@ -456,6 +469,26 @@ function UniteCreatorIncludes(){
|
|
456 |
|
457 |
}
|
458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
}
|
460 |
|
461 |
|
@@ -529,12 +562,22 @@ function UniteCreatorIncludes(){
|
|
529 |
function openIncludeSettingsDialog(){
|
530 |
|
531 |
var objRow = jQuery(this).parents("li");
|
|
|
|
|
|
|
|
|
532 |
|
533 |
var data = getIncludeData(objRow);
|
534 |
|
535 |
var objDialog = jQuery("#uc_dialog_unclude_settings");
|
536 |
objDialog.data("objRow", objRow);
|
537 |
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
var buttonOpts = {};
|
539 |
|
540 |
buttonOpts[g_uctext.update] = function(){
|
@@ -542,6 +585,20 @@ function UniteCreatorIncludes(){
|
|
542 |
var paramValue = jQuery("#uc_dialog_include_values").val();
|
543 |
|
544 |
updateInputCondition(objRow, paramName, paramValue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
objDialog.dialog("close");
|
546 |
}
|
547 |
|
@@ -559,7 +616,9 @@ function UniteCreatorIncludes(){
|
|
559 |
minWidth:700,
|
560 |
modal:true,
|
561 |
open:function(){
|
|
|
562 |
var arrParams = g_parent.getControlParams();
|
|
|
563 |
dialogSettings_fillParams(arrParams, data);
|
564 |
}
|
565 |
});
|
166 |
if(objCondition)
|
167 |
objHtml.data("condition", objCondition);
|
168 |
|
169 |
+
//update params
|
170 |
+
var objParams = g_ucAdmin.getVal(item, "params");
|
171 |
+
if(objParams)
|
172 |
+
objHtml.data("params",objParams);
|
173 |
+
|
174 |
return(objHtml)
|
175 |
}
|
176 |
|
319 |
if(!data.condition && typeof data.condition != "object")
|
320 |
data.condition = null;
|
321 |
|
322 |
+
//get params
|
323 |
+
var objParams = objRow.data("params");
|
324 |
+
if(!objParams)
|
325 |
+
objParams = null;
|
326 |
+
|
327 |
+
data.params = objParams;
|
328 |
+
|
329 |
return(data);
|
330 |
}
|
331 |
|
392 |
* init include list
|
393 |
*/
|
394 |
function initIncludeList(objList){
|
|
|
395 |
|
396 |
+
var data = objList.data("init");
|
397 |
+
|
398 |
if(!data || typeof data != "object" || data.length == 0){
|
399 |
addIncludesListItem(objList);
|
400 |
return(false);
|
469 |
|
470 |
}
|
471 |
|
472 |
+
//checkboxes
|
473 |
+
var objCheckboxes = objDialog.find("input[type='checkbox']");
|
474 |
+
|
475 |
+
var objParams = g_ucAdmin.getVal(objData, "params");
|
476 |
+
if(!objParams)
|
477 |
+
objParams = null;
|
478 |
+
|
479 |
+
jQuery.each(objCheckboxes,function(index, checkbox){
|
480 |
+
|
481 |
+
var objCheckbox = jQuery(checkbox);
|
482 |
+
|
483 |
+
var name = objCheckbox.prop("name");
|
484 |
+
|
485 |
+
var value = g_ucAdmin.getVal(objParams, name);
|
486 |
+
value = g_ucAdmin.strToBool(value);
|
487 |
+
|
488 |
+
objCheckbox.prop("checked", value);
|
489 |
+
|
490 |
+
});
|
491 |
+
|
492 |
}
|
493 |
|
494 |
|
562 |
function openIncludeSettingsDialog(){
|
563 |
|
564 |
var objRow = jQuery(this).parents("li");
|
565 |
+
var objList = objRow.parents("ul");
|
566 |
+
|
567 |
+
var listType = objList.data("type");
|
568 |
+
|
569 |
|
570 |
var data = getIncludeData(objRow);
|
571 |
|
572 |
var objDialog = jQuery("#uc_dialog_unclude_settings");
|
573 |
objDialog.data("objRow", objRow);
|
574 |
|
575 |
+
if(listType == "js"){
|
576 |
+
objDialog.addClass("uc-include-type-js");
|
577 |
+
}else{
|
578 |
+
objDialog.removeClass("uc-include-type-js");
|
579 |
+
}
|
580 |
+
|
581 |
var buttonOpts = {};
|
582 |
|
583 |
buttonOpts[g_uctext.update] = function(){
|
585 |
var paramValue = jQuery("#uc_dialog_include_values").val();
|
586 |
|
587 |
updateInputCondition(objRow, paramName, paramValue);
|
588 |
+
|
589 |
+
var rowParams = {};
|
590 |
+
var objCheckboxes = objDialog.find("input[type='checkbox']");
|
591 |
+
jQuery.each(objCheckboxes,function(index, checkbox){
|
592 |
+
var objCheckbox = jQuery(checkbox);
|
593 |
+
var name = objCheckbox.prop("name");
|
594 |
+
var isChecked = objCheckbox.is(":checked");
|
595 |
+
|
596 |
+
if(isChecked == true)
|
597 |
+
rowParams[name] = true;
|
598 |
+
});
|
599 |
+
|
600 |
+
objRow.data("params", rowParams);
|
601 |
+
|
602 |
objDialog.dialog("close");
|
603 |
}
|
604 |
|
616 |
minWidth:700,
|
617 |
modal:true,
|
618 |
open:function(){
|
619 |
+
|
620 |
var arrParams = g_parent.getControlParams();
|
621 |
+
|
622 |
dialogSettings_fillParams(arrParams, data);
|
623 |
}
|
624 |
});
|
js/unitecreator_params_dialog.js
CHANGED
@@ -581,8 +581,8 @@ function UniteCreatorParamsDialog(){
|
|
581 |
html += "<td><input type=\"text\" value=\""+valueName+"\" class='uc-dropdown-item-name'></td>";
|
582 |
html += "<td><input type=\"text\" value=\""+valueValue+"\" class='uc-dropdown-item-value'></td>";
|
583 |
html += "<td>";
|
584 |
-
html += "<div class='uc-dropdown-icon uc-dropdown-item-delete' title=\"
|
585 |
-
html += "<div class='uc-dropdown-icon uc-dropdown-item-add' title=\"
|
586 |
html += "<div class='uc-dropdown-icon uc-dropdown-item-default"+selectedClass+"' title=\"Default Item\"></div>";
|
587 |
html += "</td>";
|
588 |
html += "</tr>";
|
@@ -614,10 +614,16 @@ function UniteCreatorParamsDialog(){
|
|
614 |
*/
|
615 |
function getDropdownParamData(objTable){
|
616 |
|
|
|
|
|
617 |
var rows = objTable.find(" tbody tr");
|
618 |
|
619 |
var objOptions = {};
|
620 |
-
|
|
|
|
|
|
|
|
|
621 |
|
622 |
jQuery.each(rows, function(index, row){
|
623 |
var objRow = jQuery(row);
|
@@ -632,12 +638,20 @@ function UniteCreatorParamsDialog(){
|
|
632 |
if(optionName == "")
|
633 |
return(true);
|
634 |
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
640 |
|
|
|
|
|
641 |
objOptions[optionName] = optionValue;
|
642 |
|
643 |
});
|
@@ -670,7 +684,7 @@ function UniteCreatorParamsDialog(){
|
|
670 |
* fill dropdown param options
|
671 |
*/
|
672 |
function fillDropdownParamOptions(objTable, options, defaultValue){
|
673 |
-
|
674 |
if(objTable.length == 0)
|
675 |
throw new Error("dropdown parameter not found");
|
676 |
|
@@ -681,7 +695,13 @@ function UniteCreatorParamsDialog(){
|
|
681 |
else{
|
682 |
|
683 |
jQuery.each(options, function(optionName, optionValue){
|
684 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
685 |
dropdownParamAddRow(objTable, null, {name: optionName, value: optionValue , isDefault:isDefault});
|
686 |
});
|
687 |
}
|
@@ -786,15 +806,26 @@ function UniteCreatorParamsDialog(){
|
|
786 |
|
787 |
//default icon click
|
788 |
objTableDropdown.on("click", ".uc-dropdown-item-default", function(){
|
789 |
-
|
790 |
var objIcon = jQuery(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
if(objIcon.hasClass("uc-selected"))
|
792 |
return(false);
|
793 |
|
794 |
-
|
795 |
|
796 |
objIcon.addClass("uc-selected");
|
797 |
|
|
|
798 |
});
|
799 |
|
800 |
|
@@ -821,12 +852,15 @@ function UniteCreatorParamsDialog(){
|
|
821 |
|
822 |
//get
|
823 |
objDropdownParam.onGetInputData = function(objInput){
|
|
|
824 |
var objParamData = getDropdownParamData(objInput);
|
|
|
825 |
return(objParamData);
|
826 |
}
|
827 |
|
828 |
//fill
|
829 |
objDropdownParam.onFillInputData = function(objTable, objData){
|
|
|
830 |
if(objData.options)
|
831 |
fillDropdownParamOptions(objTable, objData.options, objData.default_value);
|
832 |
}
|
@@ -1366,7 +1400,7 @@ function UniteCreatorParamsDialog(){
|
|
1366 |
|
1367 |
//get param
|
1368 |
var arrParams = g_objWrapper.data("condition_params");
|
1369 |
-
|
1370 |
var objParam = g_ucAdmin.getVal(arrParams, paramName);
|
1371 |
|
1372 |
//set or remove not selected mode
|
@@ -1378,8 +1412,24 @@ function UniteCreatorParamsDialog(){
|
|
1378 |
objRow.removeClass("uc-no-attribute-selected");
|
1379 |
|
1380 |
//fill values select
|
1381 |
-
var
|
1382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1383 |
var selectName = objSelectValues.prop("name");
|
1384 |
|
1385 |
var currentValue = null;
|
@@ -1411,7 +1461,7 @@ function UniteCreatorParamsDialog(){
|
|
1411 |
function fillConditionSelectRow(objSelect, arrParams){
|
1412 |
|
1413 |
var selectName = objSelect.prop("name");
|
1414 |
-
|
1415 |
var currentValue = g_ucAdmin.getVal(g_objData, selectName);
|
1416 |
if(!currentValue)
|
1417 |
currentValue = "";
|
@@ -1419,7 +1469,8 @@ function UniteCreatorParamsDialog(){
|
|
1419 |
objSelect.html("");
|
1420 |
|
1421 |
g_ucAdmin.addOptionToSelect(objSelect, "", "[Select Attribute]");
|
1422 |
-
|
|
|
1423 |
jQuery.each(arrParams, function(index, param){
|
1424 |
|
1425 |
var name = g_ucAdmin.getVal(param, "name");
|
@@ -1429,10 +1480,16 @@ function UniteCreatorParamsDialog(){
|
|
1429 |
return(true);
|
1430 |
|
1431 |
g_ucAdmin.addOptionToSelect(objSelect, name, title);
|
|
|
|
|
|
|
1432 |
});
|
1433 |
|
|
|
|
|
|
|
1434 |
setTimeout(function(){
|
1435 |
-
|
1436 |
objSelect.data("init_value",true);
|
1437 |
objSelect.val(currentValue).trigger("change");
|
1438 |
|
@@ -1460,6 +1517,7 @@ function UniteCreatorParamsDialog(){
|
|
1460 |
|
1461 |
fillConditionSelectRow(objSelect, arrParams);
|
1462 |
});
|
|
|
1463 |
}
|
1464 |
|
1465 |
/**
|
@@ -1468,7 +1526,8 @@ function UniteCreatorParamsDialog(){
|
|
1468 |
function handleConditionsOnOpen(){
|
1469 |
|
1470 |
var objConditionsWrapper = g_objWrapper.find(".uc-dialog-conditions-content");
|
1471 |
-
|
|
|
1472 |
var arrParams = g_objParent.getControlParams(g_currentOpenedType);
|
1473 |
var hasParams = (jQuery.isEmptyObject(arrParams) == false);
|
1474 |
|
@@ -1705,7 +1764,6 @@ function UniteCreatorParamsDialog(){
|
|
1705 |
if(dialogID != "uc_dialog_param_main")
|
1706 |
return(false);
|
1707 |
|
1708 |
-
//trace(g_objWrapper);
|
1709 |
var objInputs = jQuery("#uc_tabparam_main_uc_editor textarea[name='default_value']").add(
|
1710 |
"#uc_tabparam_main_uc_textarea textarea[name='default_value']").add(
|
1711 |
"#uc_tabparam_main_uc_content textarea[name='default_value']").add(
|
581 |
html += "<td><input type=\"text\" value=\""+valueName+"\" class='uc-dropdown-item-name'></td>";
|
582 |
html += "<td><input type=\"text\" value=\""+valueValue+"\" class='uc-dropdown-item-value'></td>";
|
583 |
html += "<td>";
|
584 |
+
html += "<div class='uc-dropdown-icon uc-dropdown-item-delete' title=\"Delete Item\"></div>";
|
585 |
+
html += "<div class='uc-dropdown-icon uc-dropdown-item-add' title=\"Add Item\"></div>";
|
586 |
html += "<div class='uc-dropdown-icon uc-dropdown-item-default"+selectedClass+"' title=\"Default Item\"></div>";
|
587 |
html += "</td>";
|
588 |
html += "</tr>";
|
614 |
*/
|
615 |
function getDropdownParamData(objTable){
|
616 |
|
617 |
+
var isMultiple = objTable.data("ismultiple");
|
618 |
+
|
619 |
var rows = objTable.find(" tbody tr");
|
620 |
|
621 |
var objOptions = {};
|
622 |
+
if(isMultiple === true)
|
623 |
+
var defaultOption = [];
|
624 |
+
else
|
625 |
+
var defaultOption = "";
|
626 |
+
|
627 |
|
628 |
jQuery.each(rows, function(index, row){
|
629 |
var objRow = jQuery(row);
|
638 |
if(optionName == "")
|
639 |
return(true);
|
640 |
|
641 |
+
//set default option
|
642 |
+
if(isMultiple !== true){
|
643 |
+
if(defaultOption == "")
|
644 |
+
defaultOption = optionValue;
|
645 |
+
|
646 |
+
if(isDefault == true)
|
647 |
+
defaultOption = optionValue;
|
648 |
+
}else{ //multiple
|
649 |
+
|
650 |
+
if(isDefault == true)
|
651 |
+
defaultOption.push(optionValue);
|
652 |
|
653 |
+
}
|
654 |
+
|
655 |
objOptions[optionName] = optionValue;
|
656 |
|
657 |
});
|
684 |
* fill dropdown param options
|
685 |
*/
|
686 |
function fillDropdownParamOptions(objTable, options, defaultValue){
|
687 |
+
|
688 |
if(objTable.length == 0)
|
689 |
throw new Error("dropdown parameter not found");
|
690 |
|
695 |
else{
|
696 |
|
697 |
jQuery.each(options, function(optionName, optionValue){
|
698 |
+
|
699 |
+
if(jQuery.isArray(defaultValue)){
|
700 |
+
var isDefault = (jQuery.inArray(optionValue, defaultValue) !== -1);
|
701 |
+
}else{
|
702 |
+
var isDefault = (optionValue == defaultValue);
|
703 |
+
}
|
704 |
+
|
705 |
dropdownParamAddRow(objTable, null, {name: optionName, value: optionValue , isDefault:isDefault});
|
706 |
});
|
707 |
}
|
806 |
|
807 |
//default icon click
|
808 |
objTableDropdown.on("click", ".uc-dropdown-item-default", function(){
|
809 |
+
|
810 |
var objIcon = jQuery(this);
|
811 |
+
var objParentTable = objIcon.parents(".uc-table-dropdown-items");
|
812 |
+
|
813 |
+
var isMultiple = objParentTable.data("ismultiple");
|
814 |
+
|
815 |
+
if(isMultiple === true){ //multiple trigger - just toggle the class
|
816 |
+
|
817 |
+
objIcon.toggleClass("uc-selected");
|
818 |
+
return(true);
|
819 |
+
}
|
820 |
+
|
821 |
if(objIcon.hasClass("uc-selected"))
|
822 |
return(false);
|
823 |
|
824 |
+
objParentTable.find(".uc-dropdown-item-default").removeClass("uc-selected");
|
825 |
|
826 |
objIcon.addClass("uc-selected");
|
827 |
|
828 |
+
|
829 |
});
|
830 |
|
831 |
|
852 |
|
853 |
//get
|
854 |
objDropdownParam.onGetInputData = function(objInput){
|
855 |
+
|
856 |
var objParamData = getDropdownParamData(objInput);
|
857 |
+
|
858 |
return(objParamData);
|
859 |
}
|
860 |
|
861 |
//fill
|
862 |
objDropdownParam.onFillInputData = function(objTable, objData){
|
863 |
+
|
864 |
if(objData.options)
|
865 |
fillDropdownParamOptions(objTable, objData.options, objData.default_value);
|
866 |
}
|
1400 |
|
1401 |
//get param
|
1402 |
var arrParams = g_objWrapper.data("condition_params");
|
1403 |
+
|
1404 |
var objParam = g_ucAdmin.getVal(arrParams, paramName);
|
1405 |
|
1406 |
//set or remove not selected mode
|
1412 |
objRow.removeClass("uc-no-attribute-selected");
|
1413 |
|
1414 |
//fill values select
|
1415 |
+
var paramType = g_ucAdmin.getVal(objParam, "type");
|
1416 |
|
1417 |
+
if(paramType == "uc_radioboolean"){
|
1418 |
+
|
1419 |
+
var trueName = g_ucAdmin.getVal(objParam, "true_name");
|
1420 |
+
var trueValue = g_ucAdmin.getVal(objParam, "true_value");
|
1421 |
+
|
1422 |
+
var falseName = g_ucAdmin.getVal(objParam, "false_name");
|
1423 |
+
var falseValue = g_ucAdmin.getVal(objParam, "false_value");
|
1424 |
+
|
1425 |
+
var options = {};
|
1426 |
+
options[trueName] = trueValue;
|
1427 |
+
options[falseName] = falseValue;
|
1428 |
+
|
1429 |
+
}else{ //select and dropdown
|
1430 |
+
var options = g_ucAdmin.getVal(objParam, "options");
|
1431 |
+
}
|
1432 |
+
|
1433 |
var selectName = objSelectValues.prop("name");
|
1434 |
|
1435 |
var currentValue = null;
|
1461 |
function fillConditionSelectRow(objSelect, arrParams){
|
1462 |
|
1463 |
var selectName = objSelect.prop("name");
|
1464 |
+
|
1465 |
var currentValue = g_ucAdmin.getVal(g_objData, selectName);
|
1466 |
if(!currentValue)
|
1467 |
currentValue = "";
|
1469 |
objSelect.html("");
|
1470 |
|
1471 |
g_ucAdmin.addOptionToSelect(objSelect, "", "[Select Attribute]");
|
1472 |
+
|
1473 |
+
var isFound = false;
|
1474 |
jQuery.each(arrParams, function(index, param){
|
1475 |
|
1476 |
var name = g_ucAdmin.getVal(param, "name");
|
1480 |
return(true);
|
1481 |
|
1482 |
g_ucAdmin.addOptionToSelect(objSelect, name, title);
|
1483 |
+
|
1484 |
+
if(currentValue == name)
|
1485 |
+
isFound = true;
|
1486 |
});
|
1487 |
|
1488 |
+
if(isFound == false)
|
1489 |
+
currentValue = "";
|
1490 |
+
|
1491 |
setTimeout(function(){
|
1492 |
+
|
1493 |
objSelect.data("init_value",true);
|
1494 |
objSelect.val(currentValue).trigger("change");
|
1495 |
|
1517 |
|
1518 |
fillConditionSelectRow(objSelect, arrParams);
|
1519 |
});
|
1520 |
+
|
1521 |
}
|
1522 |
|
1523 |
/**
|
1526 |
function handleConditionsOnOpen(){
|
1527 |
|
1528 |
var objConditionsWrapper = g_objWrapper.find(".uc-dialog-conditions-content");
|
1529 |
+
var objSelects = g_objWrapper.find(".uc-dialog-condition-attribute");
|
1530 |
+
|
1531 |
var arrParams = g_objParent.getControlParams(g_currentOpenedType);
|
1532 |
var hasParams = (jQuery.isEmptyObject(arrParams) == false);
|
1533 |
|
1764 |
if(dialogID != "uc_dialog_param_main")
|
1765 |
return(false);
|
1766 |
|
|
|
1767 |
var objInputs = jQuery("#uc_tabparam_main_uc_editor textarea[name='default_value']").add(
|
1768 |
"#uc_tabparam_main_uc_textarea textarea[name='default_value']").add(
|
1769 |
"#uc_tabparam_main_uc_content textarea[name='default_value']").add(
|
provider/acf_integrate.class.php
CHANGED
@@ -438,8 +438,11 @@ class UniteCreatorAcfIntegrate{
|
|
438 |
|
439 |
break;
|
440 |
default:
|
441 |
-
|
442 |
-
$
|
|
|
|
|
|
|
443 |
|
444 |
//dmp("assoc");dmp($data); exit();
|
445 |
|
@@ -517,7 +520,7 @@ class UniteCreatorAcfIntegrate{
|
|
517 |
$arrOutput = array();
|
518 |
|
519 |
foreach($arrData as $key => $item){
|
520 |
-
|
521 |
//simple value
|
522 |
if(is_array($item) == false){
|
523 |
|
@@ -530,15 +533,17 @@ class UniteCreatorAcfIntegrate{
|
|
530 |
$arrOutput[$key] = $item;
|
531 |
continue;
|
532 |
}
|
|
|
|
|
533 |
|
534 |
$firstItem = UniteFunctionsUC::getArrFirstValue($item);
|
535 |
|
536 |
-
if(is_array($firstItem) == false){
|
537 |
$arrOutput[$key] = $item;
|
538 |
continue;
|
539 |
}
|
540 |
|
541 |
-
//what's rest is assoc array, wich is clone :)
|
542 |
|
543 |
//add them to output
|
544 |
foreach($item as $itemKey => $subItem){
|
@@ -561,15 +566,16 @@ class UniteCreatorAcfIntegrate{
|
|
561 |
|
562 |
switch($objName){
|
563 |
case "post":
|
|
|
564 |
$arrData = get_fields($postID);
|
565 |
-
|
566 |
$arrData = $this->modifyFieldsData($arrData);
|
567 |
|
568 |
break;
|
569 |
case "term":
|
570 |
|
571 |
$termID = "term_".$postID;
|
572 |
-
|
573 |
$arrData = get_fields($termID);
|
574 |
|
575 |
break;
|
@@ -634,6 +640,7 @@ class UniteCreatorAcfIntegrate{
|
|
634 |
$arrOutput[$key] = $type;
|
635 |
}
|
636 |
|
|
|
637 |
/*
|
638 |
UniteFunctionsUC::showTrace();
|
639 |
dmp($arrOutput);
|
438 |
|
439 |
break;
|
440 |
default:
|
441 |
+
|
442 |
+
if(is_array($data))
|
443 |
+
$arrValues[$key] = $data;
|
444 |
+
else
|
445 |
+
$arrValues[$key] = ""; //another object
|
446 |
|
447 |
//dmp("assoc");dmp($data); exit();
|
448 |
|
520 |
$arrOutput = array();
|
521 |
|
522 |
foreach($arrData as $key => $item){
|
523 |
+
|
524 |
//simple value
|
525 |
if(is_array($item) == false){
|
526 |
|
533 |
$arrOutput[$key] = $item;
|
534 |
continue;
|
535 |
}
|
536 |
+
|
537 |
+
$isAssocArray = UniteFunctionsUC::isAssocArray($item);
|
538 |
|
539 |
$firstItem = UniteFunctionsUC::getArrFirstValue($item);
|
540 |
|
541 |
+
if(is_array($firstItem) == false && $isAssocArray == false){
|
542 |
$arrOutput[$key] = $item;
|
543 |
continue;
|
544 |
}
|
545 |
|
546 |
+
//what's rest is assoc array, wich is clone or group:)
|
547 |
|
548 |
//add them to output
|
549 |
foreach($item as $itemKey => $subItem){
|
566 |
|
567 |
switch($objName){
|
568 |
case "post":
|
569 |
+
|
570 |
$arrData = get_fields($postID);
|
571 |
+
|
572 |
$arrData = $this->modifyFieldsData($arrData);
|
573 |
|
574 |
break;
|
575 |
case "term":
|
576 |
|
577 |
$termID = "term_".$postID;
|
578 |
+
|
579 |
$arrData = get_fields($termID);
|
580 |
|
581 |
break;
|
640 |
$arrOutput[$key] = $type;
|
641 |
}
|
642 |
|
643 |
+
|
644 |
/*
|
645 |
UniteFunctionsUC::showTrace();
|
646 |
dmp($arrOutput);
|
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js
CHANGED
@@ -178,7 +178,7 @@ function UniteCreatorElementorEditorAdmin(){
|
|
178 |
|
179 |
var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
|
180 |
if(isCurrentTaxRelevant == false && firstVisibleOption){
|
181 |
-
|
182 |
selectPostTaxonomy.val(firstVisibleOption).trigger("change");
|
183 |
}
|
184 |
|
@@ -227,9 +227,15 @@ function UniteCreatorElementorEditorAdmin(){
|
|
227 |
placeholder:placeholder
|
228 |
});
|
229 |
|
230 |
-
if(jQuery.isEmptyObject(selectedCatID) == false)
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
|
235 |
/**
|
@@ -585,7 +591,7 @@ function UniteCreatorElementorEditorAdmin(){
|
|
585 |
|
586 |
if(isSingle === true)
|
587 |
objSelect.removeAttr("multiple");
|
588 |
-
|
589 |
var initValue = getVal(widgetSettings, settingName);
|
590 |
|
591 |
//treat single number
|
178 |
|
179 |
var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
|
180 |
if(isCurrentTaxRelevant == false && firstVisibleOption){
|
181 |
+
|
182 |
selectPostTaxonomy.val(firstVisibleOption).trigger("change");
|
183 |
}
|
184 |
|
227 |
placeholder:placeholder
|
228 |
});
|
229 |
|
230 |
+
if(jQuery.isEmptyObject(selectedCatID) == false){
|
231 |
+
|
232 |
+
objSelectPostCategory.val(selectedCatID);
|
233 |
+
|
234 |
+
//var newSelectedCatID = objSelectPostCategory.select2("val");
|
235 |
+
|
236 |
+
objSelectPostCategory.trigger("change");
|
237 |
+
|
238 |
+
}
|
239 |
}
|
240 |
|
241 |
/**
|
591 |
|
592 |
if(isSingle === true)
|
593 |
objSelect.removeAttr("multiple");
|
594 |
+
|
595 |
var initValue = getVal(widgetSettings, settingName);
|
596 |
|
597 |
//treat single number
|
provider/core/plugins/unlimited_elements/elementor/elementor_dynamic_visibility.class.php
ADDED
@@ -0,0 +1,425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
4 |
+
|
5 |
+
class UniteCreatorDynamicVisibility{
|
6 |
+
|
7 |
+
const PREFIX = "uc_dynamic_visibility_";
|
8 |
+
private $arrSettings;
|
9 |
+
private $arrHiddenIDs = array();
|
10 |
+
private $showDebug = false;
|
11 |
+
private $arrDebug;
|
12 |
+
|
13 |
+
|
14 |
+
/**
|
15 |
+
* get setting by key
|
16 |
+
*/
|
17 |
+
private function getSetting($key){
|
18 |
+
|
19 |
+
$value = UniteFunctionsUC::getVal($this->arrSettings, self::PREFIX.$key);
|
20 |
+
|
21 |
+
return($value);
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* add debug string
|
26 |
+
*/
|
27 |
+
private function addDebug($strDebug, $strDebug2 = null){
|
28 |
+
|
29 |
+
$this->arrDebug[] = $strDebug;
|
30 |
+
|
31 |
+
if(!empty($strDebug))
|
32 |
+
$this->arrDebug[] = $strDebug2;
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
private function addDebugOptions($arrOptions){
|
37 |
+
|
38 |
+
$this->arrDebug[] = array(
|
39 |
+
"debug_type"=>"options",
|
40 |
+
"options"=>$arrOptions
|
41 |
+
);
|
42 |
+
|
43 |
+
return(false);
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* print debug
|
48 |
+
*/
|
49 |
+
private function printDebug($element){
|
50 |
+
|
51 |
+
//return(false);
|
52 |
+
|
53 |
+
dmp($this->arrDebug);
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
/**
|
59 |
+
* is hide by archive term ids
|
60 |
+
*/
|
61 |
+
private function isShowElement_archiveTermIDs($condition){
|
62 |
+
|
63 |
+
$termIDs = UniteFunctionsUC::getVal($condition, "term_ids");
|
64 |
+
|
65 |
+
$isIncludeChildren = UniteFunctionsUC::getVal($condition, "include_children");
|
66 |
+
$isIncludeChildren = UniteFunctionsUC::strToBool($isIncludeChildren);
|
67 |
+
|
68 |
+
$showType = UniteFunctionsUC::getVal($condition, "terms_show");
|
69 |
+
|
70 |
+
$isShow = ($showType !== "hide");
|
71 |
+
|
72 |
+
$showValue = true;
|
73 |
+
$hideValue = false;
|
74 |
+
|
75 |
+
if($isShow == false){
|
76 |
+
$showValue = false;
|
77 |
+
$hideValue = true;
|
78 |
+
}
|
79 |
+
|
80 |
+
if($this->showDebug == true){
|
81 |
+
|
82 |
+
$this->addDebug("Show by archive term IDs.");
|
83 |
+
|
84 |
+
$this->addDebugOptions(array(
|
85 |
+
"include children"=>$isIncludeChildren,
|
86 |
+
"show"=>$isShow,
|
87 |
+
"terms ids"=>$termIDs
|
88 |
+
));
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
if(empty($termIDs)){
|
93 |
+
|
94 |
+
if($this->showDebug == true)
|
95 |
+
$this->addDebug("empty term ids, hide element");
|
96 |
+
|
97 |
+
return(false); //if not given term ids - always show
|
98 |
+
}
|
99 |
+
|
100 |
+
//not archive - hide
|
101 |
+
if(is_archive() == false){
|
102 |
+
|
103 |
+
if($this->showDebug == true)
|
104 |
+
$this->addDebug("the page is not archive, hide element");
|
105 |
+
|
106 |
+
return(false);
|
107 |
+
}
|
108 |
+
|
109 |
+
$objTerm = get_queried_object();
|
110 |
+
|
111 |
+
//not term current obj - hide
|
112 |
+
if($objTerm instanceof WP_Term == false){
|
113 |
+
|
114 |
+
if($this->showDebug == true)
|
115 |
+
$this->addDebug("Not a term related page, hide element");
|
116 |
+
|
117 |
+
return(false);
|
118 |
+
}
|
119 |
+
|
120 |
+
//not term - hide
|
121 |
+
if(isset($objTerm->term_id) == false){
|
122 |
+
|
123 |
+
if($this->showDebug == true)
|
124 |
+
$this->addDebug("no term id found, wrong term loaded, hide element");
|
125 |
+
|
126 |
+
return(false);
|
127 |
+
}
|
128 |
+
|
129 |
+
//check current term
|
130 |
+
if($isIncludeChildren == true)
|
131 |
+
$arrCurrentTermIDs = UniteFunctionsWPUC::getTermParentIDs($objTerm);
|
132 |
+
else
|
133 |
+
$arrCurrentTermIDs = array($objTerm->term_id);
|
134 |
+
|
135 |
+
if($this->showDebug == true)
|
136 |
+
$this->addDebug("current term ids:", $arrCurrentTermIDs);
|
137 |
+
|
138 |
+
//if current or parent of the current found between the given, don't hide
|
139 |
+
foreach($arrCurrentTermIDs as $currentID){
|
140 |
+
|
141 |
+
$isFound = (array_search($currentID, $termIDs) !== false);
|
142 |
+
|
143 |
+
if($isFound == true){
|
144 |
+
|
145 |
+
if($this->showDebug == true)
|
146 |
+
$this->addDebug("term found", $showValue?"show element":"hide element");
|
147 |
+
|
148 |
+
return($showValue);
|
149 |
+
}
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
if($this->showDebug == true)
|
154 |
+
$this->addDebug("term not found", $hideValue?"hide element":"show element");
|
155 |
+
|
156 |
+
return($hideValue); //hide in other cases
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* return if show element by condition
|
161 |
+
*/
|
162 |
+
private function isShowElementByCondition($condition){
|
163 |
+
|
164 |
+
if(empty($condition))
|
165 |
+
return(true);
|
166 |
+
|
167 |
+
$type = UniteFunctionsUC::getVal($condition, "condition_type");
|
168 |
+
|
169 |
+
switch($type){
|
170 |
+
case "archive_terms":
|
171 |
+
|
172 |
+
$isShow = $this->isShowElement_archiveTermIDs($condition);
|
173 |
+
|
174 |
+
return($isShow);
|
175 |
+
break;
|
176 |
+
default:
|
177 |
+
return(true);
|
178 |
+
break;
|
179 |
+
}
|
180 |
+
|
181 |
+
return(true);
|
182 |
+
}
|
183 |
+
|
184 |
+
|
185 |
+
/**
|
186 |
+
* check if hide element or not
|
187 |
+
*/
|
188 |
+
private function isShowElement($type){
|
189 |
+
|
190 |
+
$arrConditions = $this->getSetting("conditions");
|
191 |
+
|
192 |
+
if(empty($arrConditions) || is_array($arrConditions) == false)
|
193 |
+
return(true);
|
194 |
+
|
195 |
+
$isShowTotal = true;
|
196 |
+
|
197 |
+
foreach($arrConditions as $conditionOptions){
|
198 |
+
|
199 |
+
$isShow = $this->isShowElementByCondition($conditionOptions);
|
200 |
+
|
201 |
+
if($isShow == false)
|
202 |
+
$isShowTotal = false;
|
203 |
+
}
|
204 |
+
|
205 |
+
return($isShowTotal);
|
206 |
+
}
|
207 |
+
|
208 |
+
|
209 |
+
/**
|
210 |
+
* get all relevant settings
|
211 |
+
*/
|
212 |
+
private function getRelevantSettings(){
|
213 |
+
|
214 |
+
$arrSettingKeys = array(
|
215 |
+
self::PREFIX."show_debug",
|
216 |
+
self::PREFIX."conditions"
|
217 |
+
);
|
218 |
+
|
219 |
+
$output = array();
|
220 |
+
foreach($this->arrSettings as $key=>$setting){
|
221 |
+
|
222 |
+
if(array_search($key, $arrSettingKeys) === false)
|
223 |
+
continue;
|
224 |
+
|
225 |
+
$output[$key] = $setting;
|
226 |
+
}
|
227 |
+
|
228 |
+
return($output);
|
229 |
+
}
|
230 |
+
|
231 |
+
|
232 |
+
/**
|
233 |
+
* print debug settings
|
234 |
+
*/
|
235 |
+
private function printSettingsDebug(){
|
236 |
+
|
237 |
+
dmp("UE Visibility Conditions Settings");
|
238 |
+
$arrSettings = $this->getRelevantSettings();
|
239 |
+
|
240 |
+
dmp($arrSettings);
|
241 |
+
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
|
246 |
+
/**
|
247 |
+
* on before render
|
248 |
+
*/
|
249 |
+
public function onBeforeRenderElement($element){
|
250 |
+
|
251 |
+
$this->arrSettings = $element->get_settings_for_display();
|
252 |
+
|
253 |
+
$conditions = $this->getSetting("conditions");
|
254 |
+
if(empty($conditions))
|
255 |
+
return(true);
|
256 |
+
|
257 |
+
|
258 |
+
$this->arrDebug = array();
|
259 |
+
$this->showDebug = false;
|
260 |
+
|
261 |
+
$showDebug = $this->getSetting("show_debug");
|
262 |
+
$this->showDebug = ($showDebug == "yes");
|
263 |
+
|
264 |
+
if($this->showDebug){
|
265 |
+
$this->printSettingsDebug();
|
266 |
+
}
|
267 |
+
|
268 |
+
$isShow = $this->isShowElement($conditions);
|
269 |
+
|
270 |
+
if($this->showDebug == true && !empty($this->arrDebug))
|
271 |
+
$this->printDebug($element);
|
272 |
+
|
273 |
+
if($isShow == true)
|
274 |
+
return(false);
|
275 |
+
|
276 |
+
$elementID = $element->get_id();
|
277 |
+
|
278 |
+
$this->arrHiddenIDs[$elementID] = true;
|
279 |
+
|
280 |
+
//start hiding
|
281 |
+
|
282 |
+
ob_start();
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
/**
|
287 |
+
* on after render element
|
288 |
+
*/
|
289 |
+
public function onAfterRenderElement($element){
|
290 |
+
|
291 |
+
$elementID = $element->get_id();
|
292 |
+
|
293 |
+
$isHidden = isset($this->arrHiddenIDs[$elementID]);
|
294 |
+
|
295 |
+
if($isHidden == false)
|
296 |
+
return(true);
|
297 |
+
|
298 |
+
//finish hiding
|
299 |
+
|
300 |
+
ob_end_clean();
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
+
/**
|
305 |
+
* add visibility controls section
|
306 |
+
*/
|
307 |
+
public function addVisibilityControls($objControls){
|
308 |
+
|
309 |
+
$objControls->start_controls_section(
|
310 |
+
'section_visibility_uc',
|
311 |
+
[
|
312 |
+
'label' => __( 'UE Visibility Conditions', 'unlimited_elements' ),
|
313 |
+
'tab' => "advanced",
|
314 |
+
]
|
315 |
+
);
|
316 |
+
|
317 |
+
|
318 |
+
$repeater = new \Elementor\Repeater();
|
319 |
+
|
320 |
+
//condition type
|
321 |
+
|
322 |
+
$prefix = self::PREFIX;
|
323 |
+
|
324 |
+
$repeater->add_control(
|
325 |
+
'condition_type',
|
326 |
+
array(
|
327 |
+
'label' => __( 'Visibility By', 'unlimited-elements-for-elementor' ),
|
328 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
329 |
+
'default' => 'none',
|
330 |
+
'options' => array(
|
331 |
+
'none' => __( 'Always Visible', 'unlimited-elements-for-elementor' ),
|
332 |
+
'archive_terms' => __( 'Archive Page Terms', 'unlimited-elements-for-elementor' )
|
333 |
+
),
|
334 |
+
'separator'=>"after"
|
335 |
+
)
|
336 |
+
);
|
337 |
+
|
338 |
+
//------------- ARCHIVE TERMS --------------
|
339 |
+
|
340 |
+
$conditionTerms = array('condition_type' => "archive_terms");
|
341 |
+
|
342 |
+
$repeater->add_control(
|
343 |
+
'terms_show',
|
344 |
+
array(
|
345 |
+
'label' => __( 'Show or Hide', 'unlimited-elements-for-elementor' ),
|
346 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
347 |
+
'default' => 'show',
|
348 |
+
'options' => array(
|
349 |
+
'show' => __( 'Show', 'unlimited-elements-for-elementor' ),
|
350 |
+
'hide' => __( 'Hide', 'unlimited-elements-for-elementor' )
|
351 |
+
),
|
352 |
+
'condition'=>$conditionTerms
|
353 |
+
)
|
354 |
+
);
|
355 |
+
|
356 |
+
//--term heading
|
357 |
+
|
358 |
+
$repeater->add_control(
|
359 |
+
'by_terms_heading',
|
360 |
+
array(
|
361 |
+
'label' => __( 'When current page is archive and current term match the seleced', 'unlimited-elements-for-elementor' ),
|
362 |
+
'type' => \Elementor\Controls_Manager::HEADING,
|
363 |
+
'condition' => $conditionTerms
|
364 |
+
)
|
365 |
+
);
|
366 |
+
|
367 |
+
//--term ids
|
368 |
+
|
369 |
+
$arrControl = HelperProviderCoreUC_EL::getElementorControl_TermsPickerControl(__("Select Term", "unlimited-elements-for-elementor"));
|
370 |
+
$arrControl["condition"] = $conditionTerms;
|
371 |
+
|
372 |
+
$repeater->add_control(
|
373 |
+
'term_ids',
|
374 |
+
$arrControl
|
375 |
+
);
|
376 |
+
|
377 |
+
$repeater->add_control(
|
378 |
+
'terms_include_children',
|
379 |
+
array(
|
380 |
+
'label' => __( 'Or Their Children', 'unlimited-elements-for-elementor' ),
|
381 |
+
'type' => \Elementor\Controls_Manager::SWITCHER,
|
382 |
+
'label_on' => __( 'Yes', 'unlimited-elements-for-elementor' ),
|
383 |
+
'label_off' => __( 'No', 'unlimited-elements-for-elementor' ),
|
384 |
+
'return_value' => 'yes',
|
385 |
+
'default' => 'yes',
|
386 |
+
'condition'=>$conditionTerms
|
387 |
+
)
|
388 |
+
);
|
389 |
+
|
390 |
+
//------ add the repeater
|
391 |
+
|
392 |
+
$objControls->add_control(
|
393 |
+
$prefix.'conditions',
|
394 |
+
[
|
395 |
+
'label' => __( 'Repeater List', 'unlimited-elements-for-elementor' ),
|
396 |
+
'type' => \Elementor\Controls_Manager::REPEATER,
|
397 |
+
'fields' => $repeater->get_controls(),
|
398 |
+
'default' => [],
|
399 |
+
'title_field' => '',
|
400 |
+
]
|
401 |
+
);
|
402 |
+
|
403 |
+
|
404 |
+
//------------- DEBUG --------------
|
405 |
+
|
406 |
+
$objControls->add_control(
|
407 |
+
$prefix.'show_debug',
|
408 |
+
array(
|
409 |
+
'label' => __( 'Show Debug Text', 'unlimited-elements-for-elementor' ),
|
410 |
+
'type' => \Elementor\Controls_Manager::SWITCHER,
|
411 |
+
'label_on' => __( 'Yes', 'unlimited-elements-for-elementor' ),
|
412 |
+
'label_off' => __( 'No', 'unlimited-elements-for-elementor' ),
|
413 |
+
'return_value' => 'yes',
|
414 |
+
'default' => '',
|
415 |
+
'separator'=>"before"
|
416 |
+
)
|
417 |
+
);
|
418 |
+
|
419 |
+
|
420 |
+
$objControls->end_controls_section();
|
421 |
+
}
|
422 |
+
|
423 |
+
|
424 |
+
|
425 |
+
}
|
provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php
CHANGED
@@ -21,6 +21,7 @@ class UniteCreatorElementorIntegrate{
|
|
21 |
private $enableImportTemplate = true;
|
22 |
private $enableExportTemplate = true;
|
23 |
private $enableBackgroundWidgets = false;
|
|
|
24 |
|
25 |
public static $isConsolidated = false;
|
26 |
|
@@ -51,6 +52,7 @@ class UniteCreatorElementorIntegrate{
|
|
51 |
public static $isOutputPage = false;
|
52 |
private $isPluginFilesIncluded = false;
|
53 |
private $objBackgroundWidget;
|
|
|
54 |
|
55 |
public static $enableEditHTMLButton = true;
|
56 |
|
@@ -619,7 +621,45 @@ class UniteCreatorElementorIntegrate{
|
|
619 |
|
620 |
}
|
621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
private function a____________BACKGROUND_WIDGETS___________(){}
|
624 |
|
625 |
|
@@ -867,6 +907,8 @@ class UniteCreatorElementorIntegrate{
|
|
867 |
|
868 |
}
|
869 |
|
|
|
|
|
870 |
/**
|
871 |
* get editor page scripts
|
872 |
*/
|
@@ -1384,7 +1426,6 @@ class UniteCreatorElementorIntegrate{
|
|
1384 |
*/
|
1385 |
public function initElementorIntegration(){
|
1386 |
|
1387 |
-
|
1388 |
$isEnabled = HelperProviderCoreUC_EL::getGeneralSetting("el_enable");
|
1389 |
$isEnabled = UniteFunctionsUC::strToBool($isEnabled);
|
1390 |
if($isEnabled == false)
|
@@ -1402,7 +1443,7 @@ class UniteCreatorElementorIntegrate{
|
|
1402 |
|
1403 |
//set if edit mode for widget output
|
1404 |
self::$isEditMode = HelperUC::isElementorEditMode();
|
1405 |
-
|
1406 |
$arrSettingsValues = HelperProviderCoreUC_EL::getGeneralSettingsValues();
|
1407 |
|
1408 |
self::$isConsolidated = UniteFunctionsUC::getVal($arrSettingsValues, "consolidate_addons");
|
@@ -1414,6 +1455,13 @@ class UniteCreatorElementorIntegrate{
|
|
1414 |
$enableBackgrounds = HelperProviderCoreUC_EL::getGeneralSetting("enable_backgrounds");
|
1415 |
$enableBackgrounds = UniteFunctionsUC::strToBool($enableBackgrounds);
|
1416 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1417 |
|
1418 |
if($enableExportImport == false){
|
1419 |
$this->enableExportTemplate = false;
|
@@ -1436,6 +1484,9 @@ class UniteCreatorElementorIntegrate{
|
|
1436 |
if($enableBackgrounds == true)
|
1437 |
$this->initBackgroundWidgets();
|
1438 |
|
|
|
|
|
|
|
1439 |
add_action('elementor/init', array($this, 'onElementorInit'));
|
1440 |
|
1441 |
//fix some frontend bug with double render
|
21 |
private $enableImportTemplate = true;
|
22 |
private $enableExportTemplate = true;
|
23 |
private $enableBackgroundWidgets = false;
|
24 |
+
private $enableDynamicVisibility = false;
|
25 |
|
26 |
public static $isConsolidated = false;
|
27 |
|
52 |
public static $isOutputPage = false;
|
53 |
private $isPluginFilesIncluded = false;
|
54 |
private $objBackgroundWidget;
|
55 |
+
private $objDynamicVisibility;
|
56 |
|
57 |
public static $enableEditHTMLButton = true;
|
58 |
|
621 |
|
622 |
}
|
623 |
|
624 |
+
private function a____________DYNAMIC_VISIBILITY___________(){}
|
625 |
+
|
626 |
+
/**
|
627 |
+
* add dynamic visibility controls
|
628 |
+
*/
|
629 |
+
public function addDynamicVisibilityControls($objControls){
|
630 |
+
|
631 |
+
$this->objDynamicVisibility->addVisibilityControls($objControls);
|
632 |
+
|
633 |
+
}
|
634 |
+
|
635 |
+
|
636 |
+
/**
|
637 |
+
* init dynamic visibility
|
638 |
+
*/
|
639 |
+
private function initDynamicVisibility(){
|
640 |
+
|
641 |
+
$this->enableDynamicVisibility = true;
|
642 |
+
$this->objDynamicVisibility = new UniteCreatorDynamicVisibility();
|
643 |
+
|
644 |
+
add_action("elementor/element/section/section_advanced/after_section_end", array($this, "addDynamicVisibilityControls"));
|
645 |
+
|
646 |
+
//filtering content
|
647 |
+
if(self::$isEditMode == true)
|
648 |
+
return(false);
|
649 |
+
|
650 |
+
add_action("elementor/frontend/section/before_render", array($this->objDynamicVisibility, "onBeforeRenderElement"));
|
651 |
+
add_action("elementor/frontend/section/after_render", array($this->objDynamicVisibility, "onAfterRenderElement"));
|
652 |
|
653 |
+
|
654 |
+
//dmp("init filtering");
|
655 |
+
// filter sections
|
656 |
+
//$this->loader->addAction( "elementor/frontend/section/before_render", $pluginPublic, 'filterSectionContentBefore', 10, 1 );
|
657 |
+
//$this->loader->addAction( "elementor/frontend/section/after_render", $pluginPublic, 'filterSectionContentAfter', 10, 1 );
|
658 |
+
|
659 |
+
|
660 |
+
}
|
661 |
+
|
662 |
+
|
663 |
private function a____________BACKGROUND_WIDGETS___________(){}
|
664 |
|
665 |
|
907 |
|
908 |
}
|
909 |
|
910 |
+
|
911 |
+
|
912 |
/**
|
913 |
* get editor page scripts
|
914 |
*/
|
1426 |
*/
|
1427 |
public function initElementorIntegration(){
|
1428 |
|
|
|
1429 |
$isEnabled = HelperProviderCoreUC_EL::getGeneralSetting("el_enable");
|
1430 |
$isEnabled = UniteFunctionsUC::strToBool($isEnabled);
|
1431 |
if($isEnabled == false)
|
1443 |
|
1444 |
//set if edit mode for widget output
|
1445 |
self::$isEditMode = HelperUC::isElementorEditMode();
|
1446 |
+
|
1447 |
$arrSettingsValues = HelperProviderCoreUC_EL::getGeneralSettingsValues();
|
1448 |
|
1449 |
self::$isConsolidated = UniteFunctionsUC::getVal($arrSettingsValues, "consolidate_addons");
|
1455 |
$enableBackgrounds = HelperProviderCoreUC_EL::getGeneralSetting("enable_backgrounds");
|
1456 |
$enableBackgrounds = UniteFunctionsUC::strToBool($enableBackgrounds);
|
1457 |
|
1458 |
+
//remove me
|
1459 |
+
$enableDynamicVisibility = false;
|
1460 |
+
|
1461 |
+
if(GlobalsUC::$inDev == true){
|
1462 |
+
$enableDynamicVisibility = HelperProviderCoreUC_EL::getGeneralSetting("enable_dynamic_visibility");
|
1463 |
+
$enableDynamicVisibility = UniteFunctionsUC::strToBool($enableDynamicVisibility);
|
1464 |
+
}
|
1465 |
|
1466 |
if($enableExportImport == false){
|
1467 |
$this->enableExportTemplate = false;
|
1484 |
if($enableBackgrounds == true)
|
1485 |
$this->initBackgroundWidgets();
|
1486 |
|
1487 |
+
if($enableDynamicVisibility == true)
|
1488 |
+
$this->initDynamicVisibility();
|
1489 |
+
|
1490 |
add_action('elementor/init', array($this, 'onElementorInit'));
|
1491 |
|
1492 |
//fix some frontend bug with double render
|
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php
CHANGED
@@ -11,7 +11,7 @@ use Elementor\Group_Control_Background;
|
|
11 |
use Elementor\Group_Control_Text_Shadow;
|
12 |
use Elementor\Group_Control_Box_Shadow;
|
13 |
use Elementor\Group_Control_Css_Filter;
|
14 |
-
use Elementor\
|
15 |
use Elementor\Core\Schemes;
|
16 |
use Elementor\Repeater;
|
17 |
use Elementor\Utils;
|
@@ -445,8 +445,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
445 |
|
446 |
return $arrItemsData;
|
447 |
}
|
448 |
-
|
449 |
-
|
450 |
/**
|
451 |
* add items controls
|
452 |
*/
|
@@ -469,14 +468,29 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
469 |
$titleField = null;
|
470 |
|
471 |
foreach($paramsItems as $param){
|
472 |
-
|
473 |
$name = UniteFunctionsUC::getVal($param, "name");
|
|
|
|
|
474 |
if($name == "title")
|
475 |
$titleField = $name;
|
476 |
|
477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
|
|
|
479 |
$repeater->add_control($name, $arrControl);
|
|
|
|
|
|
|
|
|
480 |
}
|
481 |
|
482 |
$arrItemsControl = array();
|
@@ -648,6 +662,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
648 |
$controlType = Controls_Manager::SELECT;
|
649 |
|
650 |
break;
|
|
|
|
|
651 |
case "select2":
|
652 |
$controlType = Controls_Manager::SELECT2;
|
653 |
$arrControl["label_block"] = true;
|
@@ -727,6 +743,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
727 |
|
728 |
dmp("param not found");
|
729 |
dmp($param);
|
|
|
730 |
UniteFunctionsUC::throwError("Wrong param type: ".$type);
|
731 |
break;
|
732 |
}
|
@@ -761,15 +778,26 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
761 |
$arrControl["addparams"] = $addParams;
|
762 |
|
763 |
case "select2":
|
|
|
764 |
case UniteCreatorDialogParam::PARAM_DROPDOWN:
|
765 |
|
766 |
$options = UniteFunctionsUC::getVal($param, "options", array());
|
767 |
$options = array_flip($options);
|
768 |
$arrControl["options"] = $options;
|
769 |
|
770 |
-
if($isMultiple == true)
|
771 |
$arrControl["multiple"] = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
772 |
|
|
|
773 |
$isResponsive = UniteFunctionsUC::getVal($param, "is_responsive");
|
774 |
|
775 |
if($isResponsive == true){
|
@@ -1249,12 +1277,16 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1249 |
//condition
|
1250 |
if(!empty($elementorCondition)){
|
1251 |
$arrControl["condition"] = $elementorCondition;
|
|
|
1252 |
}
|
1253 |
|
1254 |
//label block
|
1255 |
if($labelBlock === true)
|
1256 |
$arrControl["label_block"] = true;
|
1257 |
-
|
|
|
|
|
|
|
1258 |
return($arrControl);
|
1259 |
}
|
1260 |
|
@@ -1336,12 +1368,11 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1336 |
$arrControl = array();
|
1337 |
$arrControl["name"] = $controlName;
|
1338 |
$arrControl["selector"] = $selector;
|
1339 |
-
$arrControl["scheme"] =
|
1340 |
|
1341 |
if(!empty($title))
|
1342 |
$arrControl["label"] = $title;
|
1343 |
|
1344 |
-
|
1345 |
$this->objControls->add_group_control(Group_Control_Typography::get_type(), $arrControl);
|
1346 |
|
1347 |
}
|
@@ -1376,11 +1407,12 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1376 |
case UniteCreatorDialogParam::PARAM_USERS:
|
1377 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
1378 |
case UniteCreatorDialogParam::PARAM_MENU:
|
|
|
1379 |
|
1380 |
$settings = new UniteCreatorSettings();
|
1381 |
-
|
1382 |
$arrChildParams = $settings->getMultipleCreatorParams($param);
|
1383 |
-
|
1384 |
foreach($arrChildParams as $childParam)
|
1385 |
$this->addElementorParamUC($childParam,$objControls);
|
1386 |
|
@@ -1389,9 +1421,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1389 |
|
1390 |
$param["all_cats_mode"] = true;
|
1391 |
|
1392 |
-
//add current posts settings
|
1393 |
-
$isArchiveLocation = UniteFunctionsWPUC::isArchiveLocation();
|
1394 |
-
|
1395 |
$param["add_current_posts"] = true;
|
1396 |
|
1397 |
$settings = new UniteCreatorSettings();
|
@@ -1633,10 +1663,10 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1633 |
/**
|
1634 |
* add pagination controls
|
1635 |
*/
|
1636 |
-
protected function addPaginationControls(){
|
1637 |
-
|
1638 |
$objPagination = new UniteCreatorElementorPagination();
|
1639 |
-
$objPagination->addElementorSectionControls($this);
|
1640 |
|
1641 |
}
|
1642 |
|
@@ -1769,6 +1799,52 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1769 |
return($arrOutput);
|
1770 |
}
|
1771 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1772 |
|
1773 |
/**
|
1774 |
* register controls with not consolidated addon
|
@@ -1807,7 +1883,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1807 |
$hasPostsList = false;
|
1808 |
$postListParam = null;
|
1809 |
|
1810 |
-
|
|
|
|
|
1811 |
//foreach the categories
|
1812 |
foreach($arrCatsAndParams as $catID => $arrCat){
|
1813 |
|
@@ -1852,10 +1930,15 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1852 |
|
1853 |
if($showImageSizes == true)
|
1854 |
$this->addImageSizesControl($postListParam, $this->objControls);
|
1855 |
-
|
1856 |
continue;
|
1857 |
}
|
1858 |
|
|
|
|
|
|
|
|
|
|
|
1859 |
$this->addElementorParamUC($param);
|
1860 |
}
|
1861 |
|
@@ -1873,18 +1956,22 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1873 |
$labelPosts = esc_html__("Products Query", "unlimited-elements-for-elementor");
|
1874 |
else
|
1875 |
$labelPosts = esc_html__("Posts Query", "unlimited-elements-for-elementor");
|
1876 |
-
|
1877 |
$this->start_controls_section(
|
1878 |
'section_query', array(
|
1879 |
'label' => $labelPosts,
|
1880 |
)
|
1881 |
);
|
1882 |
-
|
1883 |
$this->addElementorParamUC($postListParam);
|
1884 |
|
1885 |
$this->end_controls_section();
|
1886 |
}
|
1887 |
-
|
|
|
|
|
|
|
|
|
1888 |
//add no attributes section
|
1889 |
if($isNoSettings == true){
|
1890 |
|
@@ -1915,11 +2002,13 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1915 |
if($isFontsEnabled == true)
|
1916 |
$this->addFontControlsUC();
|
1917 |
|
|
|
1918 |
//add pagination section if needed
|
1919 |
-
|
1920 |
-
|
1921 |
-
$this->addPaginationControls();
|
1922 |
-
|
|
|
1923 |
//add debug controls
|
1924 |
$this->addAdvancedSectionControls($hasPostsList, $isItemsEnabled);
|
1925 |
|
@@ -2712,9 +2801,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2712 |
return("");
|
2713 |
|
2714 |
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
2715 |
-
|
2716 |
-
//validate post source, enable only on current
|
2717 |
|
|
|
2718 |
if($isArchivePage == true){
|
2719 |
|
2720 |
$postListName = UniteFunctionsUC::getVal($arrPostListParam, "name");
|
@@ -2754,7 +2842,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2754 |
}
|
2755 |
|
2756 |
$arrValues = $this->getSettingsValuesUC();
|
2757 |
-
|
2758 |
HelperUC::addDebug("widget values", $arrValues);
|
2759 |
|
2760 |
$arrFonts = $this->getArrFonts($arrValues);
|
@@ -2776,6 +2864,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2776 |
|
2777 |
$arrMainParamValues = $this->getArrMainParamValuesUC($arrValues, $objAddon);
|
2778 |
|
|
|
2779 |
$arrPostListParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
|
2780 |
if(!empty($arrPostListParam)){
|
2781 |
|
@@ -2787,10 +2876,10 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2787 |
|
2788 |
//check if inside editor
|
2789 |
$isEditMode = $this->isEditMode();
|
2790 |
-
|
2791 |
$objAddon->setParamsValues($arrMainParamValues);
|
2792 |
$objAddon->setArrFonts($arrFonts);
|
2793 |
-
|
2794 |
if($hasItems == true)
|
2795 |
$objAddon->setArrItems($arrItems);
|
2796 |
|
11 |
use Elementor\Group_Control_Text_Shadow;
|
12 |
use Elementor\Group_Control_Box_Shadow;
|
13 |
use Elementor\Group_Control_Css_Filter;
|
14 |
+
use Elementor\Core\Schemes\Typography;
|
15 |
use Elementor\Core\Schemes;
|
16 |
use Elementor\Repeater;
|
17 |
use Elementor\Utils;
|
445 |
|
446 |
return $arrItemsData;
|
447 |
}
|
448 |
+
|
|
|
449 |
/**
|
450 |
* add items controls
|
451 |
*/
|
468 |
$titleField = null;
|
469 |
|
470 |
foreach($paramsItems as $param){
|
471 |
+
|
472 |
$name = UniteFunctionsUC::getVal($param, "name");
|
473 |
+
$type = UniteFunctionsUC::getVal($param, "type");
|
474 |
+
|
475 |
if($name == "title")
|
476 |
$titleField = $name;
|
477 |
|
478 |
+
switch($type){
|
479 |
+
case UniteCreatorDialogParam::PARAM_TEMPLATE: //convert template to text param
|
480 |
+
$param["type"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
481 |
+
$param["name"] .= "_templateid";
|
482 |
+
$param["placeholder"] = "Put ID only, like 745";
|
483 |
+
$param["label_block"] = true;
|
484 |
+
$name .= "_templateid";
|
485 |
+
break;
|
486 |
+
}
|
487 |
|
488 |
+
$arrControl = $this->getControlArrayUC($param, true);
|
489 |
$repeater->add_control($name, $arrControl);
|
490 |
+
|
491 |
+
//add some child params
|
492 |
+
$this->checkAddRelatedControls($param, $repeater);
|
493 |
+
|
494 |
}
|
495 |
|
496 |
$arrItemsControl = array();
|
662 |
$controlType = Controls_Manager::SELECT;
|
663 |
|
664 |
break;
|
665 |
+
case UniteCreatorDialogParam::PARAM_MULTIPLE_SELECT:
|
666 |
+
$isMultiple = true;
|
667 |
case "select2":
|
668 |
$controlType = Controls_Manager::SELECT2;
|
669 |
$arrControl["label_block"] = true;
|
743 |
|
744 |
dmp("param not found");
|
745 |
dmp($param);
|
746 |
+
UniteFunctionsUC::showTrace();
|
747 |
UniteFunctionsUC::throwError("Wrong param type: ".$type);
|
748 |
break;
|
749 |
}
|
778 |
$arrControl["addparams"] = $addParams;
|
779 |
|
780 |
case "select2":
|
781 |
+
case UniteCreatorDialogParam::PARAM_MULTIPLE_SELECT:
|
782 |
case UniteCreatorDialogParam::PARAM_DROPDOWN:
|
783 |
|
784 |
$options = UniteFunctionsUC::getVal($param, "options", array());
|
785 |
$options = array_flip($options);
|
786 |
$arrControl["options"] = $options;
|
787 |
|
788 |
+
if($isMultiple == true){
|
789 |
$arrControl["multiple"] = true;
|
790 |
+
|
791 |
+
if(is_array($value) == false){
|
792 |
+
if(empty($value))
|
793 |
+
$arrControl["default"] = array();
|
794 |
+
else
|
795 |
+
$arrControl["default"] = array($value);
|
796 |
+
}
|
797 |
+
|
798 |
+
}
|
799 |
|
800 |
+
|
801 |
$isResponsive = UniteFunctionsUC::getVal($param, "is_responsive");
|
802 |
|
803 |
if($isResponsive == true){
|
1277 |
//condition
|
1278 |
if(!empty($elementorCondition)){
|
1279 |
$arrControl["condition"] = $elementorCondition;
|
1280 |
+
|
1281 |
}
|
1282 |
|
1283 |
//label block
|
1284 |
if($labelBlock === true)
|
1285 |
$arrControl["label_block"] = true;
|
1286 |
+
|
1287 |
+
//if($type == "uc_select_special" && $arrControl["placeholder"] = "All--Terms" && $defaultValue != "post"){
|
1288 |
+
//dmp($arrControl);exit();}
|
1289 |
+
|
1290 |
return($arrControl);
|
1291 |
}
|
1292 |
|
1368 |
$arrControl = array();
|
1369 |
$arrControl["name"] = $controlName;
|
1370 |
$arrControl["selector"] = $selector;
|
1371 |
+
$arrControl["scheme"] = Typography::TYPOGRAPHY_3;
|
1372 |
|
1373 |
if(!empty($title))
|
1374 |
$arrControl["label"] = $title;
|
1375 |
|
|
|
1376 |
$this->objControls->add_group_control(Group_Control_Typography::get_type(), $arrControl);
|
1377 |
|
1378 |
}
|
1407 |
case UniteCreatorDialogParam::PARAM_USERS:
|
1408 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
1409 |
case UniteCreatorDialogParam::PARAM_MENU:
|
1410 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
1411 |
|
1412 |
$settings = new UniteCreatorSettings();
|
1413 |
+
|
1414 |
$arrChildParams = $settings->getMultipleCreatorParams($param);
|
1415 |
+
|
1416 |
foreach($arrChildParams as $childParam)
|
1417 |
$this->addElementorParamUC($childParam,$objControls);
|
1418 |
|
1421 |
|
1422 |
$param["all_cats_mode"] = true;
|
1423 |
|
1424 |
+
//add current posts settings
|
|
|
|
|
1425 |
$param["add_current_posts"] = true;
|
1426 |
|
1427 |
$settings = new UniteCreatorSettings();
|
1663 |
/**
|
1664 |
* add pagination controls
|
1665 |
*/
|
1666 |
+
protected function addPaginationControls($postListParam = null){
|
1667 |
+
|
1668 |
$objPagination = new UniteCreatorElementorPagination();
|
1669 |
+
$objPagination->addElementorSectionControls($this, $postListParam);
|
1670 |
|
1671 |
}
|
1672 |
|
1799 |
return($arrOutput);
|
1800 |
}
|
1801 |
|
1802 |
+
/**
|
1803 |
+
* put listing sections
|
1804 |
+
*/
|
1805 |
+
private function putListingSections($listingParam){
|
1806 |
+
|
1807 |
+
$name = UniteFunctionsUC::getVal($listingParam, "name");
|
1808 |
+
|
1809 |
+
//add post section
|
1810 |
+
$this->start_controls_section(
|
1811 |
+
'uc_section_listing_posts_query', array(
|
1812 |
+
'label' => __("Listing Posts Query", "unlimited-elements-for-elementor"),
|
1813 |
+
'condition'=>array($name."_source"=>"posts")
|
1814 |
+
)
|
1815 |
+
);
|
1816 |
+
|
1817 |
+
|
1818 |
+
$postParam = $listingParam;
|
1819 |
+
|
1820 |
+
$postParam["type"] = UniteCreatorDialogParam::PARAM_POSTS_LIST;
|
1821 |
+
$postParam["name"] = $name."_posts";
|
1822 |
+
|
1823 |
+
$this->addElementorParamUC($postParam);
|
1824 |
+
|
1825 |
+
|
1826 |
+
$this->end_controls_section();
|
1827 |
+
|
1828 |
+
//add term section
|
1829 |
+
|
1830 |
+
$this->start_controls_section(
|
1831 |
+
'uc_section_listing_terms_query', array(
|
1832 |
+
'label' => __("Listing Terms Query", "unlimited-elements-for-elementor"),
|
1833 |
+
'condition'=>array($name."_source"=>"terms")
|
1834 |
+
)
|
1835 |
+
);
|
1836 |
+
|
1837 |
+
$termsParam = $listingParam;
|
1838 |
+
|
1839 |
+
$termsParam["type"] = UniteCreatorDialogParam::PARAM_POST_TERMS;
|
1840 |
+
$termsParam["name"] = $name."_terms";
|
1841 |
+
|
1842 |
+
$this->addElementorParamUC($termsParam);
|
1843 |
+
|
1844 |
+
$this->end_controls_section();
|
1845 |
+
|
1846 |
+
}
|
1847 |
+
|
1848 |
|
1849 |
/**
|
1850 |
* register controls with not consolidated addon
|
1883 |
$hasPostsList = false;
|
1884 |
$postListParam = null;
|
1885 |
|
1886 |
+
$hasListing = false;
|
1887 |
+
$listingParam = null;
|
1888 |
+
|
1889 |
//foreach the categories
|
1890 |
foreach($arrCatsAndParams as $catID => $arrCat){
|
1891 |
|
1930 |
|
1931 |
if($showImageSizes == true)
|
1932 |
$this->addImageSizesControl($postListParam, $this->objControls);
|
1933 |
+
|
1934 |
continue;
|
1935 |
}
|
1936 |
|
1937 |
+
if($type == UniteCreatorDialogParam::PARAM_LISTING){
|
1938 |
+
$hasListing = true;
|
1939 |
+
$listingParam = $param;
|
1940 |
+
}
|
1941 |
+
|
1942 |
$this->addElementorParamUC($param);
|
1943 |
}
|
1944 |
|
1956 |
$labelPosts = esc_html__("Products Query", "unlimited-elements-for-elementor");
|
1957 |
else
|
1958 |
$labelPosts = esc_html__("Posts Query", "unlimited-elements-for-elementor");
|
1959 |
+
|
1960 |
$this->start_controls_section(
|
1961 |
'section_query', array(
|
1962 |
'label' => $labelPosts,
|
1963 |
)
|
1964 |
);
|
1965 |
+
|
1966 |
$this->addElementorParamUC($postListParam);
|
1967 |
|
1968 |
$this->end_controls_section();
|
1969 |
}
|
1970 |
+
|
1971 |
+
if($hasListing == true){
|
1972 |
+
$this->putListingSections($listingParam);
|
1973 |
+
}
|
1974 |
+
|
1975 |
//add no attributes section
|
1976 |
if($isNoSettings == true){
|
1977 |
|
2002 |
if($isFontsEnabled == true)
|
2003 |
$this->addFontControlsUC();
|
2004 |
|
2005 |
+
|
2006 |
//add pagination section if needed
|
2007 |
+
if($hasPostsList == true){
|
2008 |
+
|
2009 |
+
$this->addPaginationControls($postListParam);
|
2010 |
+
}
|
2011 |
+
|
2012 |
//add debug controls
|
2013 |
$this->addAdvancedSectionControls($hasPostsList, $isItemsEnabled);
|
2014 |
|
2801 |
return("");
|
2802 |
|
2803 |
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
|
|
|
|
2804 |
|
2805 |
+
//validate post source, enable only on current
|
2806 |
if($isArchivePage == true){
|
2807 |
|
2808 |
$postListName = UniteFunctionsUC::getVal($arrPostListParam, "name");
|
2842 |
}
|
2843 |
|
2844 |
$arrValues = $this->getSettingsValuesUC();
|
2845 |
+
|
2846 |
HelperUC::addDebug("widget values", $arrValues);
|
2847 |
|
2848 |
$arrFonts = $this->getArrFonts($arrValues);
|
2864 |
|
2865 |
$arrMainParamValues = $this->getArrMainParamValuesUC($arrValues, $objAddon);
|
2866 |
|
2867 |
+
|
2868 |
$arrPostListParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
|
2869 |
if(!empty($arrPostListParam)){
|
2870 |
|
2876 |
|
2877 |
//check if inside editor
|
2878 |
$isEditMode = $this->isEditMode();
|
2879 |
+
|
2880 |
$objAddon->setParamsValues($arrMainParamValues);
|
2881 |
$objAddon->setArrFonts($arrFonts);
|
2882 |
+
|
2883 |
if($hasItems == true)
|
2884 |
$objAddon->setArrItems($arrItems);
|
2885 |
|
provider/core/plugins/unlimited_elements/elementor/pagination.class.php
CHANGED
@@ -16,11 +16,18 @@ class UniteCreatorElementorPagination{
|
|
16 |
/**
|
17 |
* add content controls
|
18 |
*/
|
19 |
-
private function addElementorControls_content($widget){
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
$widget->start_controls_section(
|
22 |
'section_pagination', array(
|
23 |
-
'label' =>
|
24 |
)
|
25 |
);
|
26 |
|
@@ -48,92 +55,28 @@ class UniteCreatorElementorPagination{
|
|
48 |
]
|
49 |
);
|
50 |
|
51 |
-
|
52 |
-
$widget->add_control(
|
53 |
-
'pagination_page_limit',
|
54 |
-
[
|
55 |
-
'label' => __( 'Page Limit', "unlimited-elements-for-elementor"),
|
56 |
-
'default' => '5',
|
57 |
-
'condition' => [
|
58 |
-
'pagination_type!' => '',
|
59 |
-
],
|
60 |
-
]
|
61 |
-
);
|
62 |
-
|
63 |
-
$widget->add_control(
|
64 |
-
'pagination_numbers_shorten',
|
65 |
-
[
|
66 |
-
'label' => __( 'Shorten', "unlimited-elements-for-elementor"),
|
67 |
-
'type' => \Elementor\Controls_Manager::SWITCHER,
|
68 |
-
'default' => '',
|
69 |
-
'condition' => [
|
70 |
-
'pagination_type' => [
|
71 |
-
'numbers',
|
72 |
-
'numbers_and_prev_next',
|
73 |
-
],
|
74 |
-
],
|
75 |
-
]
|
76 |
-
);
|
77 |
-
|
78 |
-
$widget->add_control(
|
79 |
-
'pagination_prev_label',
|
80 |
-
[
|
81 |
-
'label' => __( 'Previous Label', "unlimited-elements-for-elementor"),
|
82 |
-
'default' => __( '« Previous', "unlimited-elements-for-elementor"),
|
83 |
-
'condition' => [
|
84 |
-
'pagination_type' => [
|
85 |
-
'prev_next',
|
86 |
-
'numbers_and_prev_next',
|
87 |
-
],
|
88 |
-
],
|
89 |
-
]
|
90 |
-
);
|
91 |
-
|
92 |
-
$widget->add_control(
|
93 |
-
'pagination_next_label',
|
94 |
-
[
|
95 |
-
'label' => __( 'Next Label', "unlimited-elements-for-elementor"),
|
96 |
-
'default' => __( 'Next »', "unlimited-elements-for-elementor"),
|
97 |
-
'condition' => [
|
98 |
-
'pagination_type' => [
|
99 |
-
'prev_next',
|
100 |
-
'numbers_and_prev_next',
|
101 |
-
],
|
102 |
-
],
|
103 |
-
]
|
104 |
-
);
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
'
|
112 |
-
|
113 |
-
'
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
'
|
119 |
-
'icon' => 'fa fa-align-center',
|
120 |
-
],
|
121 |
-
'right' => [
|
122 |
-
'title' => __( 'Right', "unlimited-elements-for-elementor"),
|
123 |
-
'icon' => 'fa fa-align-right',
|
124 |
],
|
125 |
-
]
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
'pagination_type!' => '',
|
132 |
-
],
|
133 |
-
]
|
134 |
-
);
|
135 |
-
*/
|
136 |
-
|
137 |
|
138 |
$widget->end_controls_section();
|
139 |
}
|
@@ -269,9 +212,9 @@ class UniteCreatorElementorPagination{
|
|
269 |
/**
|
270 |
* add elementor controls
|
271 |
*/
|
272 |
-
public function addElementorSectionControls($widget){
|
273 |
|
274 |
-
$this->addElementorControls_content($widget);
|
275 |
|
276 |
//$this->addElementorControls_styles($widget);
|
277 |
|
@@ -393,6 +336,7 @@ class UniteCreatorElementorPagination{
|
|
393 |
*/
|
394 |
public function putPaginationWidgetHtml($args){
|
395 |
|
|
|
396 |
$putPrevNext = UniteFunctionsUC::getVal($args, "put_prev_next_buttons");
|
397 |
$putPrevNext = UniteFunctionsUC::strToBool($putPrevNext);
|
398 |
|
@@ -443,14 +387,15 @@ class UniteCreatorElementorPagination{
|
|
443 |
//$options["current"] = 3;
|
444 |
|
445 |
//-------- put pagination html
|
446 |
-
|
447 |
-
$isArchivePage =
|
|
|
448 |
if($isArchivePage == true){
|
449 |
|
450 |
$options = $this->getArchivePageOptions($options);
|
451 |
-
|
452 |
$pagination = get_the_posts_pagination($options);
|
453 |
-
|
|
|
454 |
|
455 |
//skip for home pages
|
456 |
if(is_home() == true)
|
16 |
/**
|
17 |
* add content controls
|
18 |
*/
|
19 |
+
private function addElementorControls_content($widget,$postListParam){
|
20 |
|
21 |
+
$isFilterable = UniteFunctionsUC::getVal($postListParam, "is_filterable");
|
22 |
+
$isFilterable = UniteFunctionsUC::strToBool($isFilterable);
|
23 |
+
|
24 |
+
$textSection = esc_html__("Posts Pagination", "unlimited-elements-for-elementor");
|
25 |
+
if($isFilterable == true)
|
26 |
+
$textSection = esc_html__("Posts Pagination and Filter", "unlimited-elements-for-elementor");
|
27 |
+
|
28 |
$widget->start_controls_section(
|
29 |
'section_pagination', array(
|
30 |
+
'label' => $textSection,
|
31 |
)
|
32 |
);
|
33 |
|
55 |
]
|
56 |
);
|
57 |
|
58 |
+
//add filter enabled controls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
+
if($isFilterable == true){
|
61 |
+
|
62 |
+
$paramName = UniteFunctionsUC::getVal($postListParam, "name");
|
63 |
+
|
64 |
+
$widget->add_control(
|
65 |
+
$paramName.'_filterable',
|
66 |
+
[
|
67 |
+
'label' => __( 'Filterable', "unlimited-elements-for-elementor"),
|
68 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
69 |
+
'default' => '',
|
70 |
+
'options' => [
|
71 |
+
'' => __( 'None', "unlimited-elements-for-elementor"),
|
72 |
+
'using_widget' => __( 'Using Post Filters Widgets', "unlimited-elements-for-elementor"),
|
|
|
|
|
|
|
|
|
|
|
73 |
],
|
74 |
+
]
|
75 |
+
);
|
76 |
+
|
77 |
+
|
78 |
+
}
|
79 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
$widget->end_controls_section();
|
82 |
}
|
212 |
/**
|
213 |
* add elementor controls
|
214 |
*/
|
215 |
+
public function addElementorSectionControls($widget, $postListParam = null){
|
216 |
|
217 |
+
$this->addElementorControls_content($widget,$postListParam);
|
218 |
|
219 |
//$this->addElementorControls_styles($widget);
|
220 |
|
336 |
*/
|
337 |
public function putPaginationWidgetHtml($args){
|
338 |
|
339 |
+
|
340 |
$putPrevNext = UniteFunctionsUC::getVal($args, "put_prev_next_buttons");
|
341 |
$putPrevNext = UniteFunctionsUC::strToBool($putPrevNext);
|
342 |
|
387 |
//$options["current"] = 3;
|
388 |
|
389 |
//-------- put pagination html
|
390 |
+
|
391 |
+
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
392 |
+
|
393 |
if($isArchivePage == true){
|
394 |
|
395 |
$options = $this->getArchivePageOptions($options);
|
|
|
396 |
$pagination = get_the_posts_pagination($options);
|
397 |
+
|
398 |
+
}else{ //on single
|
399 |
|
400 |
//skip for home pages
|
401 |
if(is_home() == true)
|
provider/core/plugins/unlimited_elements/globals.class.php
CHANGED
@@ -67,9 +67,6 @@ class GlobalsUnlimitedElements{
|
|
67 |
|
68 |
self::$urlTemplatesList = admin_url("edit.php?post_type=elementor_library&tabs_group=library");
|
69 |
|
70 |
-
if(Globalsuc::$inDev == true)
|
71 |
-
self::$enableCPT = true;
|
72 |
-
|
73 |
|
74 |
}
|
75 |
|
67 |
|
68 |
self::$urlTemplatesList = admin_url("edit.php?post_type=elementor_library&tabs_group=library");
|
69 |
|
|
|
|
|
|
|
70 |
|
71 |
}
|
72 |
|
provider/core/plugins/unlimited_elements/helper_provider_core.class.php
CHANGED
@@ -287,6 +287,144 @@ class HelperProviderCoreUC_EL{
|
|
287 |
return($arrAnimationsNew);
|
288 |
}
|
289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
/**
|
292 |
* global init
|
287 |
return($arrAnimationsNew);
|
288 |
}
|
289 |
|
290 |
+
/**
|
291 |
+
* get terms picker control
|
292 |
+
*/
|
293 |
+
public static function getElementorControl_TermsPickerControl($label,$description = null, $condition = null){
|
294 |
+
|
295 |
+
$arrControl = array();
|
296 |
+
$arrControl["type"] = "uc_select_special";
|
297 |
+
$arrControl["label"] = $label;
|
298 |
+
$arrControl["default"] = "";
|
299 |
+
$arrControl["options"] = array();
|
300 |
+
$arrControl["label_block"] = true;
|
301 |
+
|
302 |
+
$placeholder = "All--Terms";
|
303 |
+
|
304 |
+
$loaderText = __("Loading Data...", "unlimited-elements-for-elementor");
|
305 |
+
$loaderText = UniteFunctionsUC::encodeContent($loaderText);
|
306 |
+
|
307 |
+
$arrControl["placeholder"] = "All--Terms";
|
308 |
+
|
309 |
+
if(!empty($description))
|
310 |
+
$arrControl["description"] = $description;
|
311 |
+
|
312 |
+
if(!empty($condition))
|
313 |
+
$arrControl["condition"] = $condition;
|
314 |
+
|
315 |
+
$addParams = " data-settingtype=post_ids data-datatype=terms data-placeholdertext={$placeholder} data-loadertext=$loaderText data-taxonomyname=taxonomy_taxonomy class=unite-setting-special-select";
|
316 |
+
|
317 |
+
$arrControl["addparams"] = $addParams;
|
318 |
+
|
319 |
+
return($arrControl);
|
320 |
+
}
|
321 |
+
|
322 |
+
private static function ______LISTING________(){}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* get listing item title
|
326 |
+
*/
|
327 |
+
private static function getListingItemTitle($type, $item){
|
328 |
+
|
329 |
+
switch($type){
|
330 |
+
case "post":
|
331 |
+
$title = $item->post_title;
|
332 |
+
break;
|
333 |
+
case "term":
|
334 |
+
$title = $item->name;
|
335 |
+
break;
|
336 |
+
default:
|
337 |
+
$title = "item";
|
338 |
+
break;
|
339 |
+
}
|
340 |
+
|
341 |
+
return($title);
|
342 |
+
}
|
343 |
+
|
344 |
+
/**
|
345 |
+
* put elementor template
|
346 |
+
*/
|
347 |
+
public static function putElementorTemplate($templateID){
|
348 |
+
|
349 |
+
if(empty($templateID) || is_numeric($templateID) == false)
|
350 |
+
return(false);
|
351 |
+
|
352 |
+
$output = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $templateID );
|
353 |
+
echo $output;
|
354 |
+
|
355 |
+
}
|
356 |
+
|
357 |
+
|
358 |
+
/**
|
359 |
+
* put the post listing template
|
360 |
+
*/
|
361 |
+
public static function putListingItemTemplate_post($post, $templateID){
|
362 |
+
|
363 |
+
if(empty($templateID))
|
364 |
+
return(false);
|
365 |
+
|
366 |
+
global $wp_query;
|
367 |
+
|
368 |
+
$originalPost = $GLOBALS['post'];
|
369 |
+
|
370 |
+
//backup the original querified object
|
371 |
+
$originalQueriedObject = $wp_query->queried_object;
|
372 |
+
$originalQueriedObjectID = $wp_query->queried_object_id;
|
373 |
+
|
374 |
+
$postID = $post->ID;
|
375 |
+
|
376 |
+
//set the post qieried object
|
377 |
+
|
378 |
+
$wp_query->queried_object = $post;
|
379 |
+
$wp_query->queried_object_id = $postID;
|
380 |
+
|
381 |
+
$GLOBALS['post'] = $post;
|
382 |
+
|
383 |
+
self::putElementorTemplate($templateID);
|
384 |
+
|
385 |
+
//restore the original queried object
|
386 |
+
$wp_query->queried_object = $originalQueriedObject;
|
387 |
+
$wp_query->queried_object_id = $originalQueriedObjectID;
|
388 |
+
$GLOBALS['post'] = $originalPost;
|
389 |
+
|
390 |
+
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* put listing loop
|
395 |
+
*/
|
396 |
+
public static function putListingItemTemplate($item, $templateID){
|
397 |
+
|
398 |
+
//set type
|
399 |
+
|
400 |
+
$type = null;
|
401 |
+
|
402 |
+
if($item instanceof WP_Post)
|
403 |
+
$type = "post";
|
404 |
+
else if($item instanceof WP_Term)
|
405 |
+
$type = "term";
|
406 |
+
|
407 |
+
if(empty($type)){
|
408 |
+
dmp("wrong listing type, can't output");
|
409 |
+
return(false);
|
410 |
+
}
|
411 |
+
|
412 |
+
|
413 |
+
if(empty($templateID)){
|
414 |
+
|
415 |
+
$title = self::getListingItemTitle($type, $item);
|
416 |
+
|
417 |
+
dmp("$type - $title - no template id");
|
418 |
+
return(false);
|
419 |
+
}
|
420 |
+
|
421 |
+
//template output
|
422 |
+
if($type == "post")
|
423 |
+
self::putListingItemTemplate_post($item, $templateID);
|
424 |
+
else
|
425 |
+
echo "output term";
|
426 |
+
|
427 |
+
}
|
428 |
|
429 |
/**
|
430 |
* global init
|
provider/core/plugins/unlimited_elements/plugin.php
CHANGED
@@ -86,6 +86,7 @@ class UnlimitedElementsPluginUC extends UniteCreatorPluginBase{
|
|
86 |
require_once $this->pathPlugin . 'helper_provider_core.class.php';
|
87 |
require_once $this->pathPlugin . 'elementor/elementor_integrate.class.php';
|
88 |
require_once $this->pathPlugin . 'elementor/pagination.class.php';
|
|
|
89 |
|
90 |
if(is_admin()){
|
91 |
require_once $this->pathPlugin . 'elementor/elementor_layout_exporter.class.php';
|
86 |
require_once $this->pathPlugin . 'helper_provider_core.class.php';
|
87 |
require_once $this->pathPlugin . 'elementor/elementor_integrate.class.php';
|
88 |
require_once $this->pathPlugin . 'elementor/pagination.class.php';
|
89 |
+
require_once $this->pathPlugin . "elementor/elementor_dynamic_visibility.class.php";
|
90 |
|
91 |
if(is_admin()){
|
92 |
require_once $this->pathPlugin . 'elementor/elementor_layout_exporter.class.php';
|
provider/core/plugins/unlimited_elements/provider_core_front.class.php
CHANGED
@@ -5,8 +5,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
5 |
|
6 |
class UniteProviderCoreFrontUC_Elementor extends UniteProviderFrontUC{
|
7 |
|
|
|
8 |
|
9 |
-
|
10 |
/**
|
11 |
*
|
12 |
* the constructor
|
@@ -15,6 +15,12 @@ class UniteProviderCoreFrontUC_Elementor extends UniteProviderFrontUC{
|
|
15 |
|
16 |
HelperProviderCoreUC_EL::globalInit();
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/*
|
19 |
$disableFilters = HelperProviderCoreUC_EL::getGeneralSetting("disable_autop_filters");
|
20 |
$disableFilters = UniteFunctionsUC::strToBool($disableFilters);
|
5 |
|
6 |
class UniteProviderCoreFrontUC_Elementor extends UniteProviderFrontUC{
|
7 |
|
8 |
+
private $objFiltersProcess;
|
9 |
|
|
|
10 |
/**
|
11 |
*
|
12 |
* the constructor
|
15 |
|
16 |
HelperProviderCoreUC_EL::globalInit();
|
17 |
|
18 |
+
//run front filters process
|
19 |
+
|
20 |
+
$this->objFiltersProcess = new UniteCreatorFiltersProcess();
|
21 |
+
$this->objFiltersProcess->initWPFrontFilters();
|
22 |
+
|
23 |
+
|
24 |
/*
|
25 |
$disableFilters = HelperProviderCoreUC_EL::getGeneralSetting("disable_autop_filters");
|
26 |
$disableFilters = UniteFunctionsUC::strToBool($disableFilters);
|
provider/core/plugins/unlimited_elements/settings/general_settings_el.xml
CHANGED
@@ -75,6 +75,14 @@
|
|
75 |
label=" Show "Edit HTML" Button in Widget Settings"
|
76 |
description="Show "Edit HTML" button in elementor panel widget settings">
|
77 |
</field>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
<field type="bulk_control_end"/>
|
80 |
|
75 |
label=" Show "Edit HTML" Button in Widget Settings"
|
76 |
description="Show "Edit HTML" button in elementor panel widget settings">
|
77 |
</field>
|
78 |
+
|
79 |
+
<field name="enable_dynamic_visibility"
|
80 |
+
type="boolean"
|
81 |
+
default="false"
|
82 |
+
label=" Enable Dynamic Visibility"
|
83 |
+
hidden="true"
|
84 |
+
description="">
|
85 |
+
</field>
|
86 |
|
87 |
<field type="bulk_control_end"/>
|
88 |
|
provider/core/plugins/unlimited_elements/views/settingselementor.php
CHANGED
@@ -42,6 +42,10 @@ class UniteCreatorViewElementorSettings extends UniteCreatorSettingsView{
|
|
42 |
|
43 |
$objSettings = $this->modifyConsolidateAddonsSetting($objSettings);
|
44 |
|
|
|
|
|
|
|
|
|
45 |
return($objSettings);
|
46 |
}
|
47 |
|
42 |
|
43 |
$objSettings = $this->modifyConsolidateAddonsSetting($objSettings);
|
44 |
|
45 |
+
//show the setting that was hidden in first place
|
46 |
+
if(GlobalsUC::$inDev == true)
|
47 |
+
$objSettings->updateSettingProperty("enable_dynamic_visibility", "hidden", "false");
|
48 |
+
|
49 |
return($objSettings);
|
50 |
}
|
51 |
|
provider/functions_wordpress.class.php
CHANGED
@@ -10,6 +10,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
10 |
private static $db;
|
11 |
private static $objAcfIntegrate;
|
12 |
private static $cacheTermCustomFields = array();
|
|
|
13 |
|
14 |
private static $arrTaxCache;
|
15 |
private static $arrUrlThumbCache = array();
|
@@ -344,6 +345,34 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
344 |
|
345 |
public static function a_______TAXANOMIES_______(){}
|
346 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
/**
|
348 |
* get term by slug
|
349 |
*/
|
@@ -602,9 +631,37 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
602 |
|
603 |
|
604 |
return($arrDataOutput);
|
605 |
-
|
606 |
}
|
607 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
608 |
|
609 |
|
610 |
/**
|
@@ -650,6 +707,43 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
650 |
return($arrTaxNew);
|
651 |
}
|
652 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
653 |
|
654 |
public static function a_________CATEGORIES_AND_TAGS___________(){}
|
655 |
|
@@ -1161,7 +1255,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1161 |
/**
|
1162 |
* get post meta data
|
1163 |
*/
|
1164 |
-
public static function getPostMetaKeys($postID, $prefix = null){
|
1165 |
|
1166 |
$postMeta = get_post_meta($postID);
|
1167 |
|
@@ -1175,7 +1269,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1175 |
|
1176 |
$firstSign = $key[0];
|
1177 |
|
1178 |
-
if($firstSign == "_")
|
1179 |
continue;
|
1180 |
|
1181 |
if(!empty($prefix))
|
@@ -1381,7 +1475,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1381 |
else
|
1382 |
$arrCategories = explode(",", $category);
|
1383 |
|
1384 |
-
|
1385 |
foreach($arrCategories as $cat){
|
1386 |
|
1387 |
//check for empty category - mean all categories
|
@@ -1403,19 +1496,33 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1403 |
|
1404 |
//add the search item
|
1405 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1406 |
$arrSearchItem = array();
|
1407 |
$arrSearchItem["taxonomy"] = $taxName;
|
1408 |
-
$arrSearchItem["field"] =
|
1409 |
$arrSearchItem["terms"] = $catID;
|
1410 |
$arrSearchItem["include_children"] = $isIncludeChildren;
|
1411 |
|
1412 |
if($isExclude == true){
|
1413 |
$arrSearchItem["operator"] = "NOT IN";
|
1414 |
}
|
1415 |
-
|
1416 |
$arrQuery[] = $arrSearchItem;
|
1417 |
}
|
1418 |
-
|
1419 |
return($arrQuery);
|
1420 |
}
|
1421 |
|
@@ -1430,15 +1537,38 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1430 |
if($category == "all" && empty($excludeCategory))
|
1431 |
return(null);
|
1432 |
|
|
|
1433 |
//get the query
|
1434 |
$arrQuery = array();
|
|
|
1435 |
|
1436 |
if(!empty($category))
|
1437 |
$arrQuery = self::getPosts_getTaxQuery_getArrQuery($arrQuery, $category, $categoryRelation, $isIncludeChildren, false);
|
1438 |
|
|
|
|
|
1439 |
if(!empty($excludeCategory))
|
1440 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1441 |
|
|
|
1442 |
if(empty($arrQuery))
|
1443 |
return(null);
|
1444 |
|
@@ -1446,7 +1576,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1446 |
return($arrQuery);
|
1447 |
|
1448 |
//check and add relation
|
1449 |
-
if($categoryRelation === "OR" &&
|
1450 |
$arrQuery["relation"] = "OR";
|
1451 |
|
1452 |
return($arrQuery);
|
@@ -1479,11 +1609,11 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1479 |
* get posts arguments by filters
|
1480 |
* filters: search, category, category_relation, posttype, orderby, limit
|
1481 |
*/
|
1482 |
-
public static function getPostsArgs($filters){
|
1483 |
|
1484 |
$args = array();
|
1485 |
|
1486 |
-
$category = UniteFunctionsUC::getVal($filters, "category");
|
1487 |
$categoryRelation = UniteFunctionsUC::getVal($filters, "category_relation");
|
1488 |
$categoryIncludeChildren = UniteFunctionsUC::getVal($filters, "category_include_children");
|
1489 |
|
@@ -1491,9 +1621,16 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1491 |
|
1492 |
$categoryExcludeChildren = UniteFunctionsUC::getVal($filters, "category_exclude_children");
|
1493 |
$categoryExcludeChildren = UniteFunctionsUC::strToBool($categoryExcludeChildren);
|
1494 |
-
|
1495 |
$arrTax = self::getPosts_getTaxQuery($category, $categoryRelation, $categoryIncludeChildren, $excludeCategory, $categoryExcludeChildren);
|
1496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1497 |
$search = UniteFunctionsUC::getVal($filters, "search");
|
1498 |
if(!empty($search))
|
1499 |
$args["s"] = $search;
|
@@ -1562,7 +1699,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1562 |
public static function getPosts($filters){
|
1563 |
|
1564 |
$args = self::getPostsArgs($filters);
|
1565 |
-
|
1566 |
$arrPosts = get_posts($args);
|
1567 |
|
1568 |
if(empty($arrPosts))
|
@@ -2598,6 +2735,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2598 |
*/
|
2599 |
public static function isArchiveLocation(){
|
2600 |
|
|
|
|
|
|
|
2601 |
if(( is_archive() || is_tax() || is_home() || is_search() ))
|
2602 |
return(true);
|
2603 |
|
10 |
private static $db;
|
11 |
private static $objAcfIntegrate;
|
12 |
private static $cacheTermCustomFields = array();
|
13 |
+
private static $cacheTermParents = array();
|
14 |
|
15 |
private static $arrTaxCache;
|
16 |
private static $arrUrlThumbCache = array();
|
345 |
|
346 |
public static function a_______TAXANOMIES_______(){}
|
347 |
|
348 |
+
/**
|
349 |
+
* get term parent ids, including current term id
|
350 |
+
*/
|
351 |
+
public static function getTermParentIDs($objTerm){
|
352 |
+
|
353 |
+
$currentTermID = $objTerm->term_id;
|
354 |
+
|
355 |
+
$cacheKey = "term_".$currentTermID;
|
356 |
+
|
357 |
+
if(isset(self::$cacheTermParents[$cacheKey]))
|
358 |
+
return(self::$cacheTermParents[$cacheKey]);
|
359 |
+
|
360 |
+
$arrCurrentIDs = array($currentTermID);
|
361 |
+
|
362 |
+
if(!isset($objTerm->parent) || $objTerm->parent === 0){
|
363 |
+
self::$cacheTermParents[$cacheKey] = $arrCurrentIDs;
|
364 |
+
return($arrCurrentIDs);
|
365 |
+
}
|
366 |
+
|
367 |
+
$parents = get_ancestors( $currentTermID, $objTerm->taxonomy, 'taxonomy' );
|
368 |
+
if(!empty($parents))
|
369 |
+
$arrCurrentIDs = array_merge($arrCurrentIDs, $parents);
|
370 |
+
|
371 |
+
self::$cacheTermParents[$cacheKey] = $arrCurrentIDs;
|
372 |
+
|
373 |
+
return($arrCurrentIDs);
|
374 |
+
}
|
375 |
+
|
376 |
/**
|
377 |
* get term by slug
|
378 |
*/
|
631 |
|
632 |
|
633 |
return($arrDataOutput);
|
|
|
634 |
}
|
635 |
|
636 |
+
/**
|
637 |
+
* get post terms titles
|
638 |
+
*/
|
639 |
+
public static function getPostTermsTitles($post){
|
640 |
+
|
641 |
+
$arrTermsWithTax = self::getPostTerms($post);
|
642 |
+
|
643 |
+
if(empty($arrTermsWithTax))
|
644 |
+
return(array());
|
645 |
+
|
646 |
+
$arrTitles = array();
|
647 |
+
|
648 |
+
foreach($arrTermsWithTax as $taxanomy=>$arrTerms){
|
649 |
+
|
650 |
+
if(empty($arrTerms))
|
651 |
+
continue;
|
652 |
+
|
653 |
+
foreach($arrTerms as $term){
|
654 |
+
|
655 |
+
$name = UniteFunctionsUC::getVal($term, "name");
|
656 |
+
if(empty($name))
|
657 |
+
continue;
|
658 |
+
|
659 |
+
$arrTitles[] = $name;
|
660 |
+
}
|
661 |
+
}
|
662 |
+
|
663 |
+
return($arrTitles);
|
664 |
+
}
|
665 |
|
666 |
|
667 |
/**
|
707 |
return($arrTaxNew);
|
708 |
}
|
709 |
|
710 |
+
/**
|
711 |
+
* update terms counts (indexes)
|
712 |
+
*/
|
713 |
+
public static function updateTermsIndexes(){
|
714 |
+
|
715 |
+
$db = HelperUC::getDB();
|
716 |
+
|
717 |
+
$tableTerms = GlobalsUC::$table_prefix."term_taxonomy";
|
718 |
+
|
719 |
+
$arrTerms = $db->fetch($tableTerms);
|
720 |
+
|
721 |
+
$arrTax = array();
|
722 |
+
|
723 |
+
foreach($arrTerms as $term){
|
724 |
+
|
725 |
+
$termID = UniteFunctionsUC::getVal($term, "term_id");
|
726 |
+
$taxonomy = UniteFunctionsUC::getVal($term, "taxonomy");
|
727 |
+
|
728 |
+
if(strpos($taxonomy, "translation_") !== false)
|
729 |
+
continue;
|
730 |
+
|
731 |
+
if(strpos($taxonomy, "elementor_") !== false)
|
732 |
+
continue;
|
733 |
+
|
734 |
+
if(!isset($arrTax[$taxonomy]))
|
735 |
+
$arrTax[$taxonomy] = array();
|
736 |
+
|
737 |
+
$arrTax[$taxonomy][] = $termID;
|
738 |
+
}
|
739 |
+
|
740 |
+
//do the update count
|
741 |
+
foreach($arrTax as $taxonomy=>$arrTerms){
|
742 |
+
@wp_update_term_count_now( $arrTerms, $taxonomy);
|
743 |
+
}
|
744 |
+
|
745 |
+
}
|
746 |
+
|
747 |
|
748 |
public static function a_________CATEGORIES_AND_TAGS___________(){}
|
749 |
|
1255 |
/**
|
1256 |
* get post meta data
|
1257 |
*/
|
1258 |
+
public static function getPostMetaKeys($postID, $prefix = null, $includeUnderscore = false){
|
1259 |
|
1260 |
$postMeta = get_post_meta($postID);
|
1261 |
|
1269 |
|
1270 |
$firstSign = $key[0];
|
1271 |
|
1272 |
+
if($firstSign == "_" && $includeUnderscore == false)
|
1273 |
continue;
|
1274 |
|
1275 |
if(!empty($prefix))
|
1475 |
else
|
1476 |
$arrCategories = explode(",", $category);
|
1477 |
|
|
|
1478 |
foreach($arrCategories as $cat){
|
1479 |
|
1480 |
//check for empty category - mean all categories
|
1496 |
|
1497 |
//add the search item
|
1498 |
|
1499 |
+
$field = "id";
|
1500 |
+
if(is_numeric($catID) == false)
|
1501 |
+
$field = "slug";
|
1502 |
+
|
1503 |
+
//check for special chars
|
1504 |
+
|
1505 |
+
$lastChar = substr($catID, -1);
|
1506 |
+
switch($lastChar){
|
1507 |
+
case "*": //force include children
|
1508 |
+
$isIncludeChildren = true;
|
1509 |
+
$catID = substr($catID, 0, -1); //remove last char
|
1510 |
+
break;
|
1511 |
+
}
|
1512 |
+
|
1513 |
$arrSearchItem = array();
|
1514 |
$arrSearchItem["taxonomy"] = $taxName;
|
1515 |
+
$arrSearchItem["field"] = $field;
|
1516 |
$arrSearchItem["terms"] = $catID;
|
1517 |
$arrSearchItem["include_children"] = $isIncludeChildren;
|
1518 |
|
1519 |
if($isExclude == true){
|
1520 |
$arrSearchItem["operator"] = "NOT IN";
|
1521 |
}
|
1522 |
+
|
1523 |
$arrQuery[] = $arrSearchItem;
|
1524 |
}
|
1525 |
+
|
1526 |
return($arrQuery);
|
1527 |
}
|
1528 |
|
1537 |
if($category == "all" && empty($excludeCategory))
|
1538 |
return(null);
|
1539 |
|
1540 |
+
|
1541 |
//get the query
|
1542 |
$arrQuery = array();
|
1543 |
+
$arrQueryExclude = array();
|
1544 |
|
1545 |
if(!empty($category))
|
1546 |
$arrQuery = self::getPosts_getTaxQuery_getArrQuery($arrQuery, $category, $categoryRelation, $isIncludeChildren, false);
|
1547 |
|
1548 |
+
$numQueryItems = count($arrQuery);
|
1549 |
+
|
1550 |
if(!empty($excludeCategory))
|
1551 |
+
$arrQueryExclude = self::getPosts_getTaxQuery_getArrQuery($arrQueryExclude, $excludeCategory, $categoryRelation, $isExcludeChildren, true);
|
1552 |
+
|
1553 |
+
//make nested - if both filled
|
1554 |
+
if(!empty($arrQueryExclude) && !empty($arrQuery) && $numQueryItems > 1 && $categoryRelation === "OR"){
|
1555 |
+
|
1556 |
+
//check and add relation
|
1557 |
+
$arrQuery["relation"] = "OR";
|
1558 |
+
|
1559 |
+
$arrQueryCombined = array();
|
1560 |
+
$arrQueryCombined[] = $arrQuery;
|
1561 |
+
$arrQueryCombined[] = $arrQueryExclude;
|
1562 |
+
|
1563 |
+
return($arrQueryCombined);
|
1564 |
+
}
|
1565 |
+
|
1566 |
+
|
1567 |
+
//in case there is exclude only
|
1568 |
+
if(!empty($arrQueryExclude))
|
1569 |
+
$arrQuery = array_merge($arrQuery, $arrQueryExclude);
|
1570 |
|
1571 |
+
//for single query
|
1572 |
if(empty($arrQuery))
|
1573 |
return(null);
|
1574 |
|
1576 |
return($arrQuery);
|
1577 |
|
1578 |
//check and add relation
|
1579 |
+
if($categoryRelation === "OR" && $numQueryItems > 1)
|
1580 |
$arrQuery["relation"] = "OR";
|
1581 |
|
1582 |
return($arrQuery);
|
1609 |
* get posts arguments by filters
|
1610 |
* filters: search, category, category_relation, posttype, orderby, limit
|
1611 |
*/
|
1612 |
+
public static function getPostsArgs($filters, $isTaxonly = false){
|
1613 |
|
1614 |
$args = array();
|
1615 |
|
1616 |
+
$category = UniteFunctionsUC::getVal($filters, "category");
|
1617 |
$categoryRelation = UniteFunctionsUC::getVal($filters, "category_relation");
|
1618 |
$categoryIncludeChildren = UniteFunctionsUC::getVal($filters, "category_include_children");
|
1619 |
|
1621 |
|
1622 |
$categoryExcludeChildren = UniteFunctionsUC::getVal($filters, "category_exclude_children");
|
1623 |
$categoryExcludeChildren = UniteFunctionsUC::strToBool($categoryExcludeChildren);
|
1624 |
+
|
1625 |
$arrTax = self::getPosts_getTaxQuery($category, $categoryRelation, $categoryIncludeChildren, $excludeCategory, $categoryExcludeChildren);
|
1626 |
|
1627 |
+
if($isTaxonly === true){
|
1628 |
+
if(!empty($arrTax))
|
1629 |
+
$args["tax_query"] = $arrTax;
|
1630 |
+
return($args);
|
1631 |
+
}
|
1632 |
+
|
1633 |
+
|
1634 |
$search = UniteFunctionsUC::getVal($filters, "search");
|
1635 |
if(!empty($search))
|
1636 |
$args["s"] = $search;
|
1699 |
public static function getPosts($filters){
|
1700 |
|
1701 |
$args = self::getPostsArgs($filters);
|
1702 |
+
|
1703 |
$arrPosts = get_posts($args);
|
1704 |
|
1705 |
if(empty($arrPosts))
|
2735 |
*/
|
2736 |
public static function isArchiveLocation(){
|
2737 |
|
2738 |
+
if(is_single())
|
2739 |
+
return(false);
|
2740 |
+
|
2741 |
if(( is_archive() || is_tax() || is_home() || is_search() ))
|
2742 |
return(true);
|
2743 |
|
provider/provider_dialog_param.class.php
CHANGED
@@ -43,6 +43,7 @@ class UniteCreatorDialogParam extends UniteCreatorDialogParamWork{
|
|
43 |
$this->arrParams[] = self::PARAM_WOO_CATS;
|
44 |
$this->arrParams[] = self::PARAM_USERS;
|
45 |
$this->arrParams[] = self::PARAM_TEMPLATE;
|
|
|
46 |
$this->arrParams[] = self::PARAM_TYPOGRAPHY;
|
47 |
$this->arrParams[] = self::PARAM_MARGINS;
|
48 |
$this->arrParams[] = self::PARAM_PADDING;
|
@@ -55,7 +56,7 @@ class UniteCreatorDialogParam extends UniteCreatorDialogParamWork{
|
|
55 |
$this->arrParams[] = self::PARAM_BORDER_DIMENTIONS;
|
56 |
$this->arrParams[] = self::PARAM_CSS_FILTERS;
|
57 |
$this->arrParams[] = self::PARAM_HOVER_ANIMATIONS;
|
58 |
-
|
59 |
$this->arrParams = $this->filterMainParams($this->arrParams);
|
60 |
}
|
61 |
|
43 |
$this->arrParams[] = self::PARAM_WOO_CATS;
|
44 |
$this->arrParams[] = self::PARAM_USERS;
|
45 |
$this->arrParams[] = self::PARAM_TEMPLATE;
|
46 |
+
$this->arrParams[] = self::PARAM_LISTING;
|
47 |
$this->arrParams[] = self::PARAM_TYPOGRAPHY;
|
48 |
$this->arrParams[] = self::PARAM_MARGINS;
|
49 |
$this->arrParams[] = self::PARAM_PADDING;
|
56 |
$this->arrParams[] = self::PARAM_BORDER_DIMENTIONS;
|
57 |
$this->arrParams[] = self::PARAM_CSS_FILTERS;
|
58 |
$this->arrParams[] = self::PARAM_HOVER_ANIMATIONS;
|
59 |
+
|
60 |
$this->arrParams = $this->filterMainParams($this->arrParams);
|
61 |
}
|
62 |
|
provider/provider_functions.class.php
CHANGED
@@ -22,6 +22,8 @@ class UniteProviderFunctionsUC{
|
|
22 |
$tablePrefix = $wpdb->prefix;
|
23 |
|
24 |
self::$tablePrefix = $tablePrefix;
|
|
|
|
|
25 |
self::$tablePosts = $tablePrefix."posts";
|
26 |
self::$tablePostMeta = $tablePrefix."postmeta";
|
27 |
|
@@ -215,7 +217,7 @@ class UniteProviderFunctionsUC{
|
|
215 |
$version = UNLIMITED_ELEMENTS_VERSION;
|
216 |
if(GlobalsUC::$inDev == true)
|
217 |
$version = time();
|
218 |
-
|
219 |
wp_register_script($handle , $url, $deps, $version, $inFooter);
|
220 |
wp_enqueue_script($handle);
|
221 |
}
|
@@ -516,6 +518,9 @@ class UniteProviderFunctionsUC{
|
|
516 |
|
517 |
$data["uc_lang"] = $activeLanguage;
|
518 |
}
|
|
|
|
|
|
|
519 |
|
520 |
return($data);
|
521 |
}
|
22 |
$tablePrefix = $wpdb->prefix;
|
23 |
|
24 |
self::$tablePrefix = $tablePrefix;
|
25 |
+
GlobalsUC::$table_prefix = $tablePrefix;
|
26 |
+
|
27 |
self::$tablePosts = $tablePrefix."posts";
|
28 |
self::$tablePostMeta = $tablePrefix."postmeta";
|
29 |
|
217 |
$version = UNLIMITED_ELEMENTS_VERSION;
|
218 |
if(GlobalsUC::$inDev == true)
|
219 |
$version = time();
|
220 |
+
|
221 |
wp_register_script($handle , $url, $deps, $version, $inFooter);
|
222 |
wp_enqueue_script($handle);
|
223 |
}
|
518 |
|
519 |
$data["uc_lang"] = $activeLanguage;
|
520 |
}
|
521 |
+
|
522 |
+
$isInsideEditor = UniteCreatorElementorIntegrate::$isEditMode;
|
523 |
+
$data["uc_inside_editor"] = $isInsideEditor?"yes":"no";
|
524 |
|
525 |
return($data);
|
526 |
}
|
provider/provider_globals.class.php
CHANGED
@@ -41,6 +41,16 @@ class GlobalsProviderUC{
|
|
41 |
"elementor_icons"
|
42 |
);
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
const POST_ADDITION_CUSTOMFIELDS = "customfields";
|
45 |
const POST_ADDITION_CATEGORY = "category";
|
46 |
const POST_ADDITION_WOO = "woo";
|
41 |
"elementor_icons"
|
42 |
);
|
43 |
|
44 |
+
public static $arrAttrConstantKeys = array( //keys of constants that are added to the attributes
|
45 |
+
"uc_serial",
|
46 |
+
"uc_id",
|
47 |
+
"uc_assets_url",
|
48 |
+
"uc_url_home",
|
49 |
+
"uc_url_blog",
|
50 |
+
"uc_lang",
|
51 |
+
"uc_num_items"
|
52 |
+
);
|
53 |
+
|
54 |
const POST_ADDITION_CUSTOMFIELDS = "customfields";
|
55 |
const POST_ADDITION_CATEGORY = "category";
|
56 |
const POST_ADDITION_WOO = "woo";
|
provider/provider_helper.class.php
CHANGED
@@ -181,7 +181,7 @@ class HelperProviderUC{
|
|
181 |
* modify memory limit setting
|
182 |
*/
|
183 |
public static function modifyGeneralSettings_memoryLimit($objSettings){
|
184 |
-
|
185 |
//modify memory limit
|
186 |
|
187 |
$memoryLimit = ini_get('memory_limit');
|
181 |
* modify memory limit setting
|
182 |
*/
|
183 |
public static function modifyGeneralSettings_memoryLimit($objSettings){
|
184 |
+
|
185 |
//modify memory limit
|
186 |
|
187 |
$memoryLimit = ini_get('memory_limit');
|
provider/provider_operations.class.php
CHANGED
@@ -271,4 +271,5 @@ class ProviderOperationsUC extends UCOperations{
|
|
271 |
}
|
272 |
|
273 |
|
|
|
274 |
}
|
271 |
}
|
272 |
|
273 |
|
274 |
+
|
275 |
}
|
provider/provider_params_processor.class.php
CHANGED
@@ -243,6 +243,155 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
243 |
|
244 |
protected function z_______________POSTS____________(){}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
|
247 |
/**
|
248 |
* get post category taxonomy
|
@@ -664,6 +813,14 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
664 |
$isForWoo = UniteFunctionsUC::getVal($param, "for_woocommerce_products");
|
665 |
$isForWoo = UniteFunctionsUC::strToBool($isForWoo);
|
666 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
667 |
$isRelatedPosts = $source == "related";
|
668 |
if(is_single() == false)
|
669 |
$isRelatedPosts = false;
|
@@ -671,7 +828,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
671 |
$arrMetaQuery = array();
|
672 |
|
673 |
$getRelatedProducts = false;
|
674 |
-
|
|
|
675 |
//get post type
|
676 |
$postType = UniteFunctionsUC::getVal($value, "{$name}_posttype", "post");
|
677 |
if($isForWoo)
|
@@ -856,9 +1014,12 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
856 |
|
857 |
$filters = $this->getPostListData_addOrderBy($filters, $value, $name);
|
858 |
|
859 |
-
if(GlobalsUC::$inDev == true)
|
860 |
-
|
861 |
-
|
|
|
|
|
|
|
862 |
//add debug for further use
|
863 |
HelperUC::addDebug("Post Filters", $filters);
|
864 |
|
@@ -914,6 +1075,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
914 |
$arrIDsOnSale = array();
|
915 |
$arrRecentProducts = array();
|
916 |
$arrIDsPopular = array();
|
|
|
|
|
|
|
|
|
917 |
|
918 |
foreach($arrIncludeBy as $includeby){
|
919 |
|
@@ -1056,6 +1221,16 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1056 |
}
|
1057 |
|
1058 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1059 |
}
|
1060 |
|
1061 |
}
|
@@ -1072,6 +1247,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1072 |
}
|
1073 |
|
1074 |
if(!empty($arrIDsPopular)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1075 |
|
1076 |
//set order
|
1077 |
$args["orderby"] = "post__in";
|
@@ -1080,10 +1272,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1080 |
if($orderDir == "ASC")
|
1081 |
$arrIDsPopular = array_reverse($arrIDsPopular);
|
1082 |
|
1083 |
-
unset($args["order"]);
|
1084 |
-
|
1085 |
-
$arrPostInIDs = $arrIDsPopular;
|
1086 |
}
|
|
|
1087 |
|
1088 |
if(!empty($arrPostInIDs))
|
1089 |
$args["post__in"] = $arrPostInIDs;
|
@@ -1373,6 +1564,82 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1373 |
|
1374 |
}
|
1375 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1376 |
|
1377 |
/**
|
1378 |
* get post list data
|
@@ -1380,7 +1647,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1380 |
private function getPostListData($value, $name, $processType, $param, $data){
|
1381 |
|
1382 |
if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
|
1383 |
-
return(
|
1384 |
|
1385 |
HelperUC::addDebug("getPostList values", $value);
|
1386 |
HelperUC::addDebug("getPostList param", $param);
|
@@ -1388,7 +1655,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1388 |
$source = UniteFunctionsUC::getVal($value, "{$name}_source");
|
1389 |
|
1390 |
$arrPosts = array();
|
1391 |
-
|
1392 |
switch($source){
|
1393 |
case "manual":
|
1394 |
|
@@ -1438,16 +1705,39 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1438 |
$imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
|
1439 |
$arrImageSizes["desktop"] = $imageSize;
|
1440 |
}
|
|
|
|
|
1441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1442 |
|
1443 |
$arrData = array();
|
1444 |
foreach($arrPosts as $post){
|
1445 |
|
1446 |
$arrData[] = $this->getPostDataByObj($post, $arrPostAdditions, $arrImageSizes);
|
1447 |
}
|
1448 |
-
|
1449 |
|
1450 |
-
|
|
|
|
|
1451 |
}
|
1452 |
|
1453 |
protected function z_______________FILTERS____________(){}
|
@@ -2059,16 +2349,19 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2059 |
/**
|
2060 |
* get template data
|
2061 |
*/
|
2062 |
-
private function getElementorTemplateData($value, $name, $processType, $param){
|
2063 |
-
|
2064 |
$templateID = UniteFunctionsUC::getVal($value, $name."_templateid");
|
2065 |
|
2066 |
if(empty($templateID))
|
2067 |
-
return(
|
2068 |
|
2069 |
$shortcode = "[elementor-template id=\"$templateID\"]";
|
2070 |
|
2071 |
-
|
|
|
|
|
|
|
2072 |
}
|
2073 |
|
2074 |
protected function z_______________GET_PARAMS____________(){}
|
@@ -2086,7 +2379,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2086 |
//special params
|
2087 |
switch($type){
|
2088 |
case UniteCreatorDialogParam::PARAM_POSTS_LIST:
|
2089 |
-
$data
|
|
|
|
|
|
|
2090 |
break;
|
2091 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
2092 |
$data[$name] = $this->getWPTermsData($value, $name, $processType, $param);
|
@@ -2098,7 +2394,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2098 |
$data[$name] = $this->getWPUsersData($value, $name, $processType, $param);
|
2099 |
break;
|
2100 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
2101 |
-
$data
|
2102 |
break;
|
2103 |
default:
|
2104 |
$data = parent::getProcessedParamData($data, $value, $param, $processType);
|
@@ -2140,6 +2436,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2140 |
|
2141 |
switch($paramType){
|
2142 |
case UniteCreatorDialogParam::PARAM_POSTS_LIST:
|
|
|
2143 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
2144 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
2145 |
case UniteCreatorDialogParam::PARAM_USERS:
|
243 |
|
244 |
protected function z_______________POSTS____________(){}
|
245 |
|
246 |
+
/**
|
247 |
+
* get post ids from post meta
|
248 |
+
*/
|
249 |
+
private function getPostListData_getIDsFromPostMeta($value, $name, $showDebugQuery){
|
250 |
+
|
251 |
+
$postIDs = UniteFunctionsUC::getVal($value, $name."_includeby_postmeta_postid");
|
252 |
+
|
253 |
+
$metaName = UniteFunctionsUC::getVal($value, $name."_includeby_postmeta_metafield");
|
254 |
+
|
255 |
+
$errorMessagePrefix = "Get post ids from meta error: ";
|
256 |
+
|
257 |
+
if(empty($metaName)){
|
258 |
+
|
259 |
+
if($showDebugQuery == true)
|
260 |
+
dmp($errorMessagePrefix." no meta field selected");
|
261 |
+
|
262 |
+
return(null);
|
263 |
+
}
|
264 |
+
|
265 |
+
if(!empty($postIDs)){
|
266 |
+
if(is_array($postIDs))
|
267 |
+
$postID = $postIDs[0];
|
268 |
+
else
|
269 |
+
$postID = $postIDs;
|
270 |
+
}
|
271 |
+
else{ //current post
|
272 |
+
|
273 |
+
$post = get_post();
|
274 |
+
if(empty($post)){
|
275 |
+
|
276 |
+
if($showDebugQuery == true)
|
277 |
+
dmp($errorMessagePrefix." no post found");
|
278 |
+
return(null);
|
279 |
+
}
|
280 |
+
|
281 |
+
$postID = $post->ID;
|
282 |
+
}
|
283 |
+
|
284 |
+
if(empty($postID)){
|
285 |
+
|
286 |
+
if($showDebugQuery == true)
|
287 |
+
dmp($errorMessagePrefix." no post found");
|
288 |
+
|
289 |
+
return(null);
|
290 |
+
}
|
291 |
+
|
292 |
+
//show the post title
|
293 |
+
if($showDebugQuery == true){
|
294 |
+
|
295 |
+
$post = get_post($postID);
|
296 |
+
$title = $post->post_title;
|
297 |
+
$postType = $post->post_type;
|
298 |
+
|
299 |
+
dmp("Getting post id's from meta fields from post: <b>$postID - $title ($postType) </b>");
|
300 |
+
}
|
301 |
+
|
302 |
+
$arrPostIDs = get_post_meta($postID, $metaName, true);
|
303 |
+
|
304 |
+
if(is_array($arrPostIDs) == false){
|
305 |
+
$arrPostIDs = explode(",", $arrPostIDs);
|
306 |
+
}
|
307 |
+
|
308 |
+
$isValidIDs = UniteFunctionsUC::isValidIDsArray($arrPostIDs);
|
309 |
+
|
310 |
+
if(empty($arrPostIDs) || $isValidIDs == false){
|
311 |
+
|
312 |
+
if($showDebugQuery){
|
313 |
+
|
314 |
+
$metaKeys = UniteFunctionsWPUC::getPostMetaKeys($postID, null, true);
|
315 |
+
if(empty($metaKeys))
|
316 |
+
$metaKeys = array();
|
317 |
+
|
318 |
+
dmp($errorMessagePrefix." no post ids found");
|
319 |
+
|
320 |
+
if(array_search($metaName, $metaKeys) === false){
|
321 |
+
dmp("maybe you intent to use one of those meta keys:");
|
322 |
+
dmp($metaKeys);
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
return(null);
|
327 |
+
}
|
328 |
+
|
329 |
+
if($showDebugQuery == true){
|
330 |
+
$strPosts = implode(",", $arrPostIDs);
|
331 |
+
dmp("Found post ids : $strPosts");
|
332 |
+
}
|
333 |
+
|
334 |
+
return($arrPostIDs);
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
/**
|
339 |
+
* get post ids from php function
|
340 |
+
*/
|
341 |
+
private function getPostListData_getIDsFromPHPFunction($value, $name, $showDebugQuery){
|
342 |
+
|
343 |
+
$functionName = UniteFunctionsUC::getVal($value, $name."_includeby_function_name");
|
344 |
+
|
345 |
+
$errorTextPrefix = "get post id's by PHP Function error: ";
|
346 |
+
|
347 |
+
if(empty($functionName)){
|
348 |
+
|
349 |
+
if($showDebugQuery)
|
350 |
+
dmp($errorTextPrefix."no functon name given");
|
351 |
+
|
352 |
+
return(null);
|
353 |
+
}
|
354 |
+
|
355 |
+
if(is_string($functionName) == false)
|
356 |
+
return(false);
|
357 |
+
|
358 |
+
if(strpos($functionName, "get") !== 0){
|
359 |
+
|
360 |
+
if($showDebugQuery)
|
361 |
+
dmp($errorTextPrefix."function <b>$functionName</b> should start with 'get'. like getMyPersonalPosts()");
|
362 |
+
|
363 |
+
return(null);
|
364 |
+
}
|
365 |
+
|
366 |
+
if(function_exists($functionName) == false){
|
367 |
+
|
368 |
+
if($showDebugQuery)
|
369 |
+
dmp($errorTextPrefix."function <b>$functionName</b> not exists.");
|
370 |
+
|
371 |
+
return(null);
|
372 |
+
}
|
373 |
+
|
374 |
+
$argument = UniteFunctionsUC::getVal($value, $name."_includeby_function_addparam");
|
375 |
+
|
376 |
+
$arrIDs = call_user_func_array($functionName, array($argument));
|
377 |
+
|
378 |
+
$isValid = UniteFunctionsUC::isValidIDsArray($arrIDs);
|
379 |
+
|
380 |
+
if($isValid == false){
|
381 |
+
|
382 |
+
if($showDebugQuery)
|
383 |
+
dmp($errorTextPrefix."function <b>$functionName</b> returns invalid id's array.");
|
384 |
+
|
385 |
+
return(null);
|
386 |
+
}
|
387 |
+
|
388 |
+
if($showDebugQuery == true){
|
389 |
+
dmp("php function <b>$functionName(\"$argument\")</b> output: ");
|
390 |
+
dmp($arrIDs);
|
391 |
+
}
|
392 |
+
|
393 |
+
return($arrIDs);
|
394 |
+
}
|
395 |
|
396 |
/**
|
397 |
* get post category taxonomy
|
813 |
$isForWoo = UniteFunctionsUC::getVal($param, "for_woocommerce_products");
|
814 |
$isForWoo = UniteFunctionsUC::strToBool($isForWoo);
|
815 |
|
816 |
+
//set if use get/post filters
|
817 |
+
$isFilterable = false;
|
818 |
+
|
819 |
+
$filterableOption = UniteFunctionsUC::getVal($value, $name."_filterable");
|
820 |
+
if($filterableOption == "using_widget")
|
821 |
+
$isFilterable = true;
|
822 |
+
|
823 |
+
|
824 |
$isRelatedPosts = $source == "related";
|
825 |
if(is_single() == false)
|
826 |
$isRelatedPosts = false;
|
828 |
$arrMetaQuery = array();
|
829 |
|
830 |
$getRelatedProducts = false;
|
831 |
+
|
832 |
+
|
833 |
//get post type
|
834 |
$postType = UniteFunctionsUC::getVal($value, "{$name}_posttype", "post");
|
835 |
if($isForWoo)
|
1014 |
|
1015 |
$filters = $this->getPostListData_addOrderBy($filters, $value, $name);
|
1016 |
|
1017 |
+
if(GlobalsUC::$inDev == true){
|
1018 |
+
|
1019 |
+
if($isFilterable == true)
|
1020 |
+
$filters = $this->getPostListData_getPostGetFilters_filters($filters);
|
1021 |
+
}
|
1022 |
+
|
1023 |
//add debug for further use
|
1024 |
HelperUC::addDebug("Post Filters", $filters);
|
1025 |
|
1075 |
$arrIDsOnSale = array();
|
1076 |
$arrRecentProducts = array();
|
1077 |
$arrIDsPopular = array();
|
1078 |
+
$arrIDsPHPFunction = array();
|
1079 |
+
$arrIDsPostMeta = array();
|
1080 |
+
|
1081 |
+
$makePostINOrder = false;
|
1082 |
|
1083 |
foreach($arrIncludeBy as $includeby){
|
1084 |
|
1221 |
}
|
1222 |
|
1223 |
break;
|
1224 |
+
case "php_function":
|
1225 |
+
|
1226 |
+
$arrIDsPHPFunction = $this->getPostListData_getIDsFromPHPFunction($value, $name, $showDebugQuery);
|
1227 |
+
|
1228 |
+
break;
|
1229 |
+
case "ids_from_meta":
|
1230 |
+
|
1231 |
+
$arrIDsPostMeta = $this->getPostListData_getIDsFromPostMeta($value, $name, $showDebugQuery);
|
1232 |
+
|
1233 |
+
break;
|
1234 |
}
|
1235 |
|
1236 |
}
|
1247 |
}
|
1248 |
|
1249 |
if(!empty($arrIDsPopular)){
|
1250 |
+
$makePostINOrder = true;
|
1251 |
+
$arrPostInIDs = $arrIDsPopular;
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
if(!empty($arrIDsPHPFunction)){
|
1255 |
+
$arrPostInIDs = $arrIDsPHPFunction;
|
1256 |
+
$makePostINOrder = true;
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
if(!empty($arrIDsPostMeta)){
|
1260 |
+
$arrPostInIDs = $arrIDsPostMeta;
|
1261 |
+
$makePostINOrder = true;
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
//make order as "post__id"
|
1265 |
+
|
1266 |
+
if($makePostINOrder == true){
|
1267 |
|
1268 |
//set order
|
1269 |
$args["orderby"] = "post__in";
|
1272 |
if($orderDir == "ASC")
|
1273 |
$arrIDsPopular = array_reverse($arrIDsPopular);
|
1274 |
|
1275 |
+
unset($args["order"]);
|
|
|
|
|
1276 |
}
|
1277 |
+
|
1278 |
|
1279 |
if(!empty($arrPostInIDs))
|
1280 |
$args["post__in"] = $arrPostInIDs;
|
1564 |
|
1565 |
}
|
1566 |
|
1567 |
+
/**
|
1568 |
+
* get listing data
|
1569 |
+
*/
|
1570 |
+
private function getListingData($value, $name, $processType, $param, $data){
|
1571 |
+
|
1572 |
+
if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
|
1573 |
+
return($data);
|
1574 |
+
|
1575 |
+
$source = UniteFunctionsUC::getVal($value, $name."_source");
|
1576 |
+
|
1577 |
+
$templateID = UniteFunctionsUC::getVal($value, $name."_template_templateid");
|
1578 |
+
|
1579 |
+
$data[$name."_source"] = $source;
|
1580 |
+
$data[$name."_templateid"] = $templateID;
|
1581 |
+
|
1582 |
+
unset($data[$name]);
|
1583 |
+
|
1584 |
+
|
1585 |
+
switch($source){
|
1586 |
+
case "posts":
|
1587 |
+
|
1588 |
+
$paramPosts = $param;
|
1589 |
+
|
1590 |
+
$paramPosts["name"] = $paramPosts["name"]."_posts";
|
1591 |
+
$paramPosts["name_listing"] = $name;
|
1592 |
+
$paramPosts["use_for_listing"] = true;
|
1593 |
+
|
1594 |
+
$data = $this->getPostListData($value, $paramPosts["name"], $processType, $paramPosts, $data);
|
1595 |
+
|
1596 |
+
break;
|
1597 |
+
case "terms":
|
1598 |
+
|
1599 |
+
dmp("get terms");
|
1600 |
+
|
1601 |
+
break;
|
1602 |
+
default:
|
1603 |
+
UniteFunctionsUC::throwError("Wrong listing source: $source");
|
1604 |
+
break;
|
1605 |
+
}
|
1606 |
+
|
1607 |
+
//modify items output
|
1608 |
+
$arrItems = UniteFunctionsUC::getVal($data, $name."_items");
|
1609 |
+
|
1610 |
+
if(empty($arrItems))
|
1611 |
+
$arrItems = array();
|
1612 |
+
|
1613 |
+
foreach($arrItems as $index => $item){
|
1614 |
+
|
1615 |
+
switch($source){
|
1616 |
+
case "posts":
|
1617 |
+
$title = $item->post_title;
|
1618 |
+
break;
|
1619 |
+
case "terms":
|
1620 |
+
break;
|
1621 |
+
default:
|
1622 |
+
$key = $index++;
|
1623 |
+
$title = "item_{$index}";
|
1624 |
+
break;
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
$title = $item->post_title;
|
1628 |
+
|
1629 |
+
$newItem = array(
|
1630 |
+
"title"=>$title,
|
1631 |
+
"object"=>$item
|
1632 |
+
);
|
1633 |
+
|
1634 |
+
$arrItems[$index] = $newItem;
|
1635 |
+
}
|
1636 |
+
|
1637 |
+
$data[$name."_items"] = $arrItems;
|
1638 |
+
|
1639 |
+
return($data);
|
1640 |
+
}
|
1641 |
+
|
1642 |
+
|
1643 |
|
1644 |
/**
|
1645 |
* get post list data
|
1647 |
private function getPostListData($value, $name, $processType, $param, $data){
|
1648 |
|
1649 |
if($processType != self::PROCESS_TYPE_OUTPUT && $processType != self::PROCESS_TYPE_OUTPUT_BACK)
|
1650 |
+
return($data);
|
1651 |
|
1652 |
HelperUC::addDebug("getPostList values", $value);
|
1653 |
HelperUC::addDebug("getPostList param", $param);
|
1655 |
$source = UniteFunctionsUC::getVal($value, "{$name}_source");
|
1656 |
|
1657 |
$arrPosts = array();
|
1658 |
+
|
1659 |
switch($source){
|
1660 |
case "manual":
|
1661 |
|
1705 |
$imageSize = UniteFunctionsUC::getVal($value, "{$name}_imagesize","medium_large");
|
1706 |
$arrImageSizes["desktop"] = $imageSize;
|
1707 |
}
|
1708 |
+
|
1709 |
+
//add filterable params like uc_listing_addclass, uc_listing_attributes
|
1710 |
|
1711 |
+
$isFilterable = UniteFunctionsUC::getVal($value, $name."_filterable");
|
1712 |
+
$isFilterable = ($isFilterable == "using_widget");
|
1713 |
+
|
1714 |
+
if($isFilterable == true){
|
1715 |
+
|
1716 |
+
$objFilters = new UniteCreatorFiltersProcess();
|
1717 |
+
$data = $objFilters->addWidgetFilterableVariables($data);
|
1718 |
+
}
|
1719 |
+
|
1720 |
+
//prepare listing output. no items prepare for the listing
|
1721 |
+
|
1722 |
+
$useForListing = UniteFunctionsUC::getVal($param, "use_for_listing");
|
1723 |
+
$useForListing = UniteFunctionsUC::strToBool($useForListing);
|
1724 |
+
|
1725 |
+
if($useForListing == true){
|
1726 |
+
$nameListing = UniteFunctionsUC::getVal($param, "name_listing");
|
1727 |
+
|
1728 |
+
$data[$nameListing."_items"] = $arrPosts;
|
1729 |
+
return($data);
|
1730 |
+
}
|
1731 |
|
1732 |
$arrData = array();
|
1733 |
foreach($arrPosts as $post){
|
1734 |
|
1735 |
$arrData[] = $this->getPostDataByObj($post, $arrPostAdditions, $arrImageSizes);
|
1736 |
}
|
|
|
1737 |
|
1738 |
+
$data[$name] = $arrData;
|
1739 |
+
|
1740 |
+
return($data);
|
1741 |
}
|
1742 |
|
1743 |
protected function z_______________FILTERS____________(){}
|
2349 |
/**
|
2350 |
* get template data
|
2351 |
*/
|
2352 |
+
private function getElementorTemplateData($value, $name, $processType, $param, $data){
|
2353 |
+
|
2354 |
$templateID = UniteFunctionsUC::getVal($value, $name."_templateid");
|
2355 |
|
2356 |
if(empty($templateID))
|
2357 |
+
return($data);
|
2358 |
|
2359 |
$shortcode = "[elementor-template id=\"$templateID\"]";
|
2360 |
|
2361 |
+
$data[$name] = $shortcode;
|
2362 |
+
$data[$name."_templateid"] = $templateID;
|
2363 |
+
|
2364 |
+
return($data);
|
2365 |
}
|
2366 |
|
2367 |
protected function z_______________GET_PARAMS____________(){}
|
2379 |
//special params
|
2380 |
switch($type){
|
2381 |
case UniteCreatorDialogParam::PARAM_POSTS_LIST:
|
2382 |
+
$data = $this->getPostListData($value, $name, $processType, $param, $data);
|
2383 |
+
break;
|
2384 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
2385 |
+
$data = $this->getListingData($value, $name, $processType, $param, $data);
|
2386 |
break;
|
2387 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
2388 |
$data[$name] = $this->getWPTermsData($value, $name, $processType, $param);
|
2394 |
$data[$name] = $this->getWPUsersData($value, $name, $processType, $param);
|
2395 |
break;
|
2396 |
case UniteCreatorDialogParam::PARAM_TEMPLATE:
|
2397 |
+
$data = $this->getElementorTemplateData($value, $name, $processType, $param, $data);
|
2398 |
break;
|
2399 |
default:
|
2400 |
$data = parent::getProcessedParamData($data, $value, $param, $processType);
|
2436 |
|
2437 |
switch($paramType){
|
2438 |
case UniteCreatorDialogParam::PARAM_POSTS_LIST:
|
2439 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
2440 |
case UniteCreatorDialogParam::PARAM_POST_TERMS:
|
2441 |
case UniteCreatorDialogParam::PARAM_WOO_CATS:
|
2442 |
case UniteCreatorDialogParam::PARAM_USERS:
|
provider/provider_settings.class.php
CHANGED
@@ -248,7 +248,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
248 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
249 |
$params["elementor_condition"] = $arrConditionCustom;
|
250 |
|
251 |
-
$this->addHr("
|
252 |
|
253 |
//---- max items -----
|
254 |
|
@@ -265,7 +265,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
265 |
$params = array();
|
266 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
267 |
|
268 |
-
$this->addHr("
|
269 |
|
270 |
//---- orderby -----
|
271 |
|
@@ -292,7 +292,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
292 |
$params = array();
|
293 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
294 |
|
295 |
-
$this->addHr("
|
296 |
|
297 |
//---- meta keys addition -----
|
298 |
|
@@ -310,7 +310,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
310 |
$params = array();
|
311 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
312 |
|
313 |
-
$this->addHr("
|
314 |
|
315 |
//---- show debug -----
|
316 |
|
@@ -363,8 +363,14 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
363 |
*/
|
364 |
protected function addPostTermsPicker($name, $value, $title, $extra){
|
365 |
|
|
|
|
|
|
|
366 |
$arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
|
367 |
|
|
|
|
|
|
|
368 |
$taxData = $this->addPostTermsPicker_getArrTaxonomies($arrPostTypesWithTax);
|
369 |
|
370 |
$arrPostTypesTaxonomies = $taxData["post_type_tax"];
|
@@ -408,14 +414,17 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
408 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
409 |
|
410 |
$arrTax = UniteFunctionsUC::getVal($arrPostTypesTaxonomies, $postType, array());
|
411 |
-
|
412 |
if(!empty($arrTax))
|
413 |
$arrTax = array_flip($arrTax);
|
414 |
|
415 |
$taxonomy = UniteFunctionsUC::getVal($value, $name."_taxonomy");
|
416 |
if(empty($taxonomy))
|
417 |
$taxonomy = UniteFunctionsUC::getArrFirstValue($arrTax);
|
418 |
-
|
|
|
|
|
|
|
419 |
$this->addSelect($name."_taxonomy", $arrTaxonomiesSimple, __("Select Taxonomy", "unlimited-elements-for-elementor"), $taxonomy, $params);
|
420 |
|
421 |
// --------- add include by -------------
|
@@ -428,6 +437,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
428 |
$arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
|
429 |
$arrIncludeBy["meta"] = __("Term Meta","unlimited-elements-for-elementor");
|
430 |
|
|
|
431 |
$arrIncludeBy = array_flip($arrIncludeBy);
|
432 |
|
433 |
$params = array();
|
@@ -435,7 +445,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
435 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
436 |
|
437 |
$this->addMultiSelect($name."_includeby", $arrIncludeBy, esc_html__("Include By", "unlimited-elements-for-elementor"), "", $params);
|
438 |
-
|
|
|
439 |
// --------- include by meta key -------------
|
440 |
|
441 |
$params = array();
|
@@ -482,7 +493,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
482 |
$addAttrib = "data-taxonomyname='{$name}_taxonomy'";
|
483 |
|
484 |
$this->addPostIDSelect($name."_include_specific", __("Select Specific Terms", "unlimited-elements-for-elementor"), $elementorCondition, "terms", $addAttrib, $params);
|
485 |
-
|
486 |
// --------- add terms parents -------------
|
487 |
|
488 |
$params = array();
|
@@ -520,7 +531,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
520 |
|
521 |
$params = array();
|
522 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
523 |
-
$this->addHr("
|
524 |
|
525 |
// --------- add exclude by -------------
|
526 |
|
@@ -1200,7 +1211,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1200 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1201 |
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1202 |
|
1203 |
-
$this->addHr("
|
1204 |
|
1205 |
// --------- Include BY some options -------------
|
1206 |
|
@@ -1220,6 +1231,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1220 |
|
1221 |
$arrIncludeBy["meta"] = __("Post Meta", "unlimited-elements-for-elementor");
|
1222 |
$arrIncludeBy["most_viewed"] = __("Most Viewed", "unlimited-elements-for-elementor");
|
|
|
|
|
1223 |
|
1224 |
|
1225 |
if($isForWooProducts == true){
|
@@ -1252,7 +1265,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1252 |
|
1253 |
$params["elementor_condition"] = $arrConditionIncludeBy;
|
1254 |
|
1255 |
-
$this->addHr("
|
1256 |
|
1257 |
//---- Include By Author -----
|
1258 |
|
@@ -1311,7 +1324,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1311 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1312 |
$params["elementor_condition"] = $arrConditionIncludeByDate;
|
1313 |
|
1314 |
-
$this->addHr("
|
1315 |
|
1316 |
//---- Include By Post Parent -----
|
1317 |
|
@@ -1369,6 +1382,48 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1369 |
|
1370 |
$this->addTextBox($name."_includeby_metavalue", "", esc_html__("Include by Meta Value", "unlimited-elements-for-elementor"), $params);
|
1371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1372 |
// --------- include by most viewed -------------
|
1373 |
|
1374 |
$isWPPExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
|
@@ -1417,7 +1472,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1417 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1418 |
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1419 |
|
1420 |
-
$this->addHr("
|
1421 |
|
1422 |
|
1423 |
//----- add categories -------
|
@@ -1497,7 +1552,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1497 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1498 |
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1499 |
|
1500 |
-
$this->addHr("
|
1501 |
|
1502 |
|
1503 |
// --------- add exclude by -------------
|
@@ -1596,7 +1651,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1596 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1597 |
$params["elementor_condition"] = $arrNotManualElementorCondition;
|
1598 |
|
1599 |
-
$this->addHr("
|
1600 |
|
1601 |
//------- Post Status --------
|
1602 |
|
@@ -1637,7 +1692,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1637 |
$params = array();
|
1638 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1639 |
|
1640 |
-
$this->addHr("
|
1641 |
|
1642 |
|
1643 |
//----- orderby --------
|
@@ -1692,7 +1747,7 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1692 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1693 |
|
1694 |
|
1695 |
-
$this->addHr("
|
1696 |
|
1697 |
|
1698 |
//---- query id -----
|
@@ -1743,5 +1798,32 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1743 |
}
|
1744 |
|
1745 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1746 |
|
1747 |
}
|
248 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
249 |
$params["elementor_condition"] = $arrConditionCustom;
|
250 |
|
251 |
+
$this->addHr($name."_hr_before_max", $params);
|
252 |
|
253 |
//---- max items -----
|
254 |
|
265 |
$params = array();
|
266 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
267 |
|
268 |
+
$this->addHr($name."_hr_before_orderby", $params);
|
269 |
|
270 |
//---- orderby -----
|
271 |
|
292 |
$params = array();
|
293 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
294 |
|
295 |
+
$this->addHr($name."_hr_before_metakeys", $params);
|
296 |
|
297 |
//---- meta keys addition -----
|
298 |
|
310 |
$params = array();
|
311 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
312 |
|
313 |
+
$this->addHr($name."_hr_before_debug", $params);
|
314 |
|
315 |
//---- show debug -----
|
316 |
|
363 |
*/
|
364 |
protected function addPostTermsPicker($name, $value, $title, $extra){
|
365 |
|
366 |
+
$isForWooCommerce = UniteFunctionsUC::getVal($extra, "for_woocommerce");
|
367 |
+
$isForWooCommerce = UniteFunctionsUC::strToBool($isForWooCommerce);
|
368 |
+
|
369 |
$arrPostTypesWithTax = UniteFunctionsWPUC::getPostTypesWithTaxomonies(GlobalsProviderUC::$arrFilterPostTypes, false);
|
370 |
|
371 |
+
if($isForWooCommerce == true)
|
372 |
+
$arrPostTypesWithTax = array("product" => $arrPostTypesWithTax["product"]);
|
373 |
+
|
374 |
$taxData = $this->addPostTermsPicker_getArrTaxonomies($arrPostTypesWithTax);
|
375 |
|
376 |
$arrPostTypesTaxonomies = $taxData["post_type_tax"];
|
414 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
415 |
|
416 |
$arrTax = UniteFunctionsUC::getVal($arrPostTypesTaxonomies, $postType, array());
|
417 |
+
|
418 |
if(!empty($arrTax))
|
419 |
$arrTax = array_flip($arrTax);
|
420 |
|
421 |
$taxonomy = UniteFunctionsUC::getVal($value, $name."_taxonomy");
|
422 |
if(empty($taxonomy))
|
423 |
$taxonomy = UniteFunctionsUC::getArrFirstValue($arrTax);
|
424 |
+
|
425 |
+
if($isForWooCommerce)
|
426 |
+
$taxonomy = "product_cat";
|
427 |
+
|
428 |
$this->addSelect($name."_taxonomy", $arrTaxonomiesSimple, __("Select Taxonomy", "unlimited-elements-for-elementor"), $taxonomy, $params);
|
429 |
|
430 |
// --------- add include by -------------
|
437 |
$arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
|
438 |
$arrIncludeBy["meta"] = __("Term Meta","unlimited-elements-for-elementor");
|
439 |
|
440 |
+
|
441 |
$arrIncludeBy = array_flip($arrIncludeBy);
|
442 |
|
443 |
$params = array();
|
445 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
446 |
|
447 |
$this->addMultiSelect($name."_includeby", $arrIncludeBy, esc_html__("Include By", "unlimited-elements-for-elementor"), "", $params);
|
448 |
+
|
449 |
+
|
450 |
// --------- include by meta key -------------
|
451 |
|
452 |
$params = array();
|
493 |
$addAttrib = "data-taxonomyname='{$name}_taxonomy'";
|
494 |
|
495 |
$this->addPostIDSelect($name."_include_specific", __("Select Specific Terms", "unlimited-elements-for-elementor"), $elementorCondition, "terms", $addAttrib, $params);
|
496 |
+
|
497 |
// --------- add terms parents -------------
|
498 |
|
499 |
$params = array();
|
531 |
|
532 |
$params = array();
|
533 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
534 |
+
$this->addHr($name."_after_include_by",$params);
|
535 |
|
536 |
// --------- add exclude by -------------
|
537 |
|
1211 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1212 |
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1213 |
|
1214 |
+
$this->addHr($name."_post_before_include",$params);
|
1215 |
|
1216 |
// --------- Include BY some options -------------
|
1217 |
|
1231 |
|
1232 |
$arrIncludeBy["meta"] = __("Post Meta", "unlimited-elements-for-elementor");
|
1233 |
$arrIncludeBy["most_viewed"] = __("Most Viewed", "unlimited-elements-for-elementor");
|
1234 |
+
$arrIncludeBy["php_function"] = __("IDs from PHP function","unlimited-elements-for-elementor");
|
1235 |
+
$arrIncludeBy["ids_from_meta"] = __("IDs from Post Meta","unlimited-elements-for-elementor");
|
1236 |
|
1237 |
|
1238 |
if($isForWooProducts == true){
|
1265 |
|
1266 |
$params["elementor_condition"] = $arrConditionIncludeBy;
|
1267 |
|
1268 |
+
$this->addHr($name."_after_include_by",$params);
|
1269 |
|
1270 |
//---- Include By Author -----
|
1271 |
|
1324 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1325 |
$params["elementor_condition"] = $arrConditionIncludeByDate;
|
1326 |
|
1327 |
+
$this->addHr($name."_hr_after_date",$params);
|
1328 |
|
1329 |
//---- Include By Post Parent -----
|
1330 |
|
1382 |
|
1383 |
$this->addTextBox($name."_includeby_metavalue", "", esc_html__("Include by Meta Value", "unlimited-elements-for-elementor"), $params);
|
1384 |
|
1385 |
+
// --------- include by PHP Function -------------
|
1386 |
+
|
1387 |
+
$arrConditionIncludeFunction = $arrConditionIncludeBy;
|
1388 |
+
$arrConditionIncludeFunction[$name."_includeby"] = "php_function";
|
1389 |
+
|
1390 |
+
|
1391 |
+
$params = array();
|
1392 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1393 |
+
$params["placeholder"] = __("getMyIDs","unlimited-elements-for-elementor");
|
1394 |
+
$params["description"] = __("Get post id's array from php function. \n For example: function getMyIDs(\$arg){return(array(\"32\",\"58\")). This function MUST begin with 'get'. }");
|
1395 |
+
$params["elementor_condition"] = $arrConditionIncludeFunction;
|
1396 |
+
|
1397 |
+
$this->addTextBox($name."_includeby_function_name", "", esc_html__("PHP Function Name", "unlimited-elements-for-elementor"), $params);
|
1398 |
+
|
1399 |
+
// --------- include by PHP Function Add Parameter-------------
|
1400 |
+
|
1401 |
+
$params = array();
|
1402 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1403 |
+
$params["placeholder"] = __("yourtext","unlimited-elements-for-elementor");
|
1404 |
+
$params["description"] = __("Optional. Some argument to be passed to this function. For some \"IF\" statement.","unlimited-elements-for-elementor");
|
1405 |
+
$params["elementor_condition"] = $arrConditionIncludeFunction;
|
1406 |
+
|
1407 |
+
$this->addTextBox($name."_includeby_function_addparam", "", esc_html__("PHP Function Argument", "unlimited-elements-for-elementor"), $params);
|
1408 |
+
|
1409 |
+
// --------- include by id's from meta -------------
|
1410 |
+
|
1411 |
+
$textIDsFromMeta = __("Select Post (leave empty for current post)","unlimited-elements-for-elementor");
|
1412 |
+
$arrConditionIncludePostMeta = $arrConditionIncludeBy;
|
1413 |
+
$arrConditionIncludePostMeta[$name."_includeby"] = "ids_from_meta";
|
1414 |
+
|
1415 |
+
$this->addPostIDSelect($name."_includeby_postmeta_postid", $textIDsFromMeta, $arrConditionIncludePostMeta, false,"data-issingle='true'");
|
1416 |
+
|
1417 |
+
// --------- include by id's from meta field name -------------
|
1418 |
+
|
1419 |
+
$params = array();
|
1420 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1421 |
+
$params["description"] = __("Choose meta field name that has the post id's on it. Good for acf relationship for example","unlimited-elements-for-elementor");
|
1422 |
+
$params["elementor_condition"] = $arrConditionIncludePostMeta;
|
1423 |
+
|
1424 |
+
$this->addTextBox($name."_includeby_postmeta_metafield", "", esc_html__("Meta Field Name", "unlimited-elements-for-elementor"), $params);
|
1425 |
+
|
1426 |
+
|
1427 |
// --------- include by most viewed -------------
|
1428 |
|
1429 |
$isWPPExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
|
1472 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1473 |
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1474 |
|
1475 |
+
$this->addHr($name."_before_categories",$params);
|
1476 |
|
1477 |
|
1478 |
//----- add categories -------
|
1552 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1553 |
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1554 |
|
1555 |
+
$this->addHr($name."_before_exclude_by",$params);
|
1556 |
|
1557 |
|
1558 |
// --------- add exclude by -------------
|
1651 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1652 |
$params["elementor_condition"] = $arrNotManualElementorCondition;
|
1653 |
|
1654 |
+
$this->addHr($name."_post_after_exclude",$params);
|
1655 |
|
1656 |
//------- Post Status --------
|
1657 |
|
1692 |
$params = array();
|
1693 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1694 |
|
1695 |
+
$this->addHr($name."_hr_before_orderby",$params);
|
1696 |
|
1697 |
|
1698 |
//----- orderby --------
|
1747 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1748 |
|
1749 |
|
1750 |
+
$this->addHr($name."_hr_after_order_dir", $params);
|
1751 |
|
1752 |
|
1753 |
//---- query id -----
|
1798 |
}
|
1799 |
|
1800 |
|
1801 |
+
/**
|
1802 |
+
* add listing picker, function for override
|
1803 |
+
*/
|
1804 |
+
protected function addListingPicker($name,$value,$title,$extra){
|
1805 |
+
|
1806 |
+
$params = array();
|
1807 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEMPLATE;
|
1808 |
+
|
1809 |
+
$this->addTextBox($name."_template", "", __("Listing Item Template","unlimited-elements-for-elementor"), $params);
|
1810 |
+
|
1811 |
+
//-------------------
|
1812 |
+
|
1813 |
+
$params = array();
|
1814 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
1815 |
+
|
1816 |
+
$arrSource = array();
|
1817 |
+
$arrSource["posts"] = __("Posts", "unlimited-elements-for-elementor");
|
1818 |
+
//$arrSource["terms"] = __("Terms", "unlimited-elements-for-elementor");
|
1819 |
+
|
1820 |
+
$arrSource = array_flip($arrSource);
|
1821 |
+
|
1822 |
+
$this->addSelect($name."_source", $arrSource, __("Listing Items Source", "unlimited-elements-for-elementor"), "posts", $params);
|
1823 |
+
|
1824 |
+
|
1825 |
+
}
|
1826 |
+
|
1827 |
+
|
1828 |
|
1829 |
}
|
provider/provider_template_engine.class.php
CHANGED
@@ -167,7 +167,6 @@ class UniteCreatorTemplateEngine extends UniteCreatorTemplateEngineWork{
|
|
167 |
echo UniteProviderFunctionsUC::escCombinedHtml($htmlTags);
|
168 |
}
|
169 |
|
170 |
-
|
171 |
|
172 |
/**
|
173 |
* add extra functions to twig
|
167 |
echo UniteProviderFunctionsUC::escCombinedHtml($htmlTags);
|
168 |
}
|
169 |
|
|
|
170 |
|
171 |
/**
|
172 |
* add extra functions to twig
|
provider/woocommerce_integrate.class.php
CHANGED
@@ -298,6 +298,14 @@ class UniteCreatorWooIntegrate{
|
|
298 |
$arrProduct["woo_".$propertyName] = $value;
|
299 |
}
|
300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
//add prices of variations
|
302 |
|
303 |
if($type == self::PRODUCT_TYPE_VARIABLE){
|
@@ -328,7 +336,8 @@ class UniteCreatorWooIntegrate{
|
|
328 |
//add currency
|
329 |
$arrProduct["woo_currency"] = $this->currency;
|
330 |
$arrProduct["woo_currency_symbol"] = $this->currencySymbol;
|
331 |
-
|
|
|
332 |
//put add to cart link
|
333 |
$arrProduct = $this->addAddToCartData($arrProduct, $productID, $productSku);
|
334 |
|
@@ -348,7 +357,8 @@ class UniteCreatorWooIntegrate{
|
|
348 |
|
349 |
$arrKeys += $arrProperties;
|
350 |
|
351 |
-
$arrKeys[] = "
|
|
|
352 |
$arrKeys[] = "woo_currency";
|
353 |
$arrKeys[] = "woo_currency_symbol";
|
354 |
$arrKeys[] = "woo_link_addcart_cart";
|
298 |
$arrProduct["woo_".$propertyName] = $value;
|
299 |
}
|
300 |
|
301 |
+
//make the rating stars array
|
302 |
+
$arrWooStars = array();
|
303 |
+
$rating = UniteFunctionsUC::getVal($arrData, "average_rating");
|
304 |
+
$rating = floatval($rating);
|
305 |
+
|
306 |
+
$arrWooStars = HelperHtmlUC::getRatingArray($rating);
|
307 |
+
$arrProduct["woo_rating_stars"] = $arrWooStars;
|
308 |
+
|
309 |
//add prices of variations
|
310 |
|
311 |
if($type == self::PRODUCT_TYPE_VARIABLE){
|
336 |
//add currency
|
337 |
$arrProduct["woo_currency"] = $this->currency;
|
338 |
$arrProduct["woo_currency_symbol"] = $this->currencySymbol;
|
339 |
+
|
340 |
+
|
341 |
//put add to cart link
|
342 |
$arrProduct = $this->addAddToCartData($arrProduct, $productID, $productSku);
|
343 |
|
357 |
|
358 |
$arrKeys += $arrProperties;
|
359 |
|
360 |
+
$arrKeys[] = "woo_rating_stars";
|
361 |
+
$arrKeys[] = "woo_discount_percent";
|
362 |
$arrKeys[] = "woo_currency";
|
363 |
$arrKeys[] = "woo_currency_symbol";
|
364 |
$arrKeys[] = "woo_link_addcart_cart";
|
readme.txt
CHANGED
@@ -521,6 +521,39 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
|
|
521 |
|
522 |
== Changelog ==
|
523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
version 1.4.70 = 2021-04-14
|
525 |
|
526 |
* Feature: added show widget data debug options
|
521 |
|
522 |
== Changelog ==
|
523 |
|
524 |
+
|
525 |
+
version 1.4.73 = 2021-05-20
|
526 |
+
|
527 |
+
* Feature: added twig function: "put_attributes_json" that available in js tab in widget editor
|
528 |
+
* Feature: added constant - uc_inside_editor - for distinquish between editor and site front
|
529 |
+
* Feature: added multiple select attribute
|
530 |
+
* Feature: added listing attribute support
|
531 |
+
* Fix: fixed "request too long" message on a widget preview - shortened preview url
|
532 |
+
* Fix: fixed several bugs with condition field in widgets editor
|
533 |
+
* Fix: fixed hidden image size select on item attributes
|
534 |
+
* Fix: fixed acf group field output
|
535 |
+
* Fix: fixed elementor template in items, changed to specific function
|
536 |
+
|
537 |
+
|
538 |
+
version 1.4.72 = 2021-05-02
|
539 |
+
|
540 |
+
* Feature: added rating stars helper placeholder for woocommerce
|
541 |
+
* Feature: added option to include js file after elementor-frontend
|
542 |
+
* Fix: fixed new typography deprecation message
|
543 |
+
|
544 |
+
|
545 |
+
version 1.4.71 = 2021-04-22
|
546 |
+
|
547 |
+
* Feature: added option to take post id's from php function in post selection
|
548 |
+
* Feature: added option for get posts by meta field that located in current or different post
|
549 |
+
* Feature: added twig filter: wc_price for native price filtering
|
550 |
+
* Feature: added post terms titles to post data debug
|
551 |
+
* Change: added option for woocommerce categories in terms selection
|
552 |
+
* Fix: fixed price issues in woocommerce related grids
|
553 |
+
* Fix: fixed include and exclude terms mismatch with nested tax query
|
554 |
+
* Fix: fixed pagination on search pages
|
555 |
+
|
556 |
+
|
557 |
version 1.4.70 = 2021-04-14
|
558 |
|
559 |
* Feature: added show widget data debug options
|
release_log.txt
CHANGED
@@ -1,4 +1,36 @@
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
version 1.4.70
|
4 |
|
1 |
|
2 |
+
version 1.4.73
|
3 |
+
|
4 |
+
-bug fix: fixed acf group field output
|
5 |
+
-feature: added twig function: "put_attributes_json" that available in js tab in widget editor
|
6 |
+
-feature: added constant - uc_inside_editor - for distinquish between editor and site front
|
7 |
+
-bug fix: fixed "request too long" message on a widget preview - shortened preview url
|
8 |
+
-bug fix: fixed several bugs with condition field in widgets editor
|
9 |
+
-bug fix: fixed hidden image size select on item attributes
|
10 |
+
-feature: added multiple select attribute
|
11 |
+
-feature: added listing attribute support
|
12 |
+
-bug fix: fixed elementor template in items, changed to specific function
|
13 |
+
|
14 |
+
|
15 |
+
version 1.4.72
|
16 |
+
|
17 |
+
-feature: added rating stars helper placeholder for woocommerce
|
18 |
+
-feature: added option to include js file after elementor-frontend
|
19 |
+
-bug fix: fixed new typography deprecation message
|
20 |
+
|
21 |
+
|
22 |
+
version 1.4.71
|
23 |
+
|
24 |
+
-change: added option for woocommerce categories in terms selection
|
25 |
+
-feature: added option to take post id's from php function in post selection
|
26 |
+
-bug fix: fixed price issues in woocommerce related grids
|
27 |
+
-feature: added option for get posts by meta field that located in current or different post
|
28 |
+
-feature: added twig filter: wc_price for native price filtering
|
29 |
+
-feature: added post terms titles to post data debug
|
30 |
+
-bug fix: fixed include and exclude terms mismatch with nested tax query
|
31 |
+
-bug fix: fixed pagination on search pages
|
32 |
+
|
33 |
+
|
34 |
|
35 |
version 1.4.70
|
36 |
|
unlimited_elements.php
CHANGED
@@ -4,12 +4,12 @@ Plugin Name: Unlimited Elements for Elementor
|
|
4 |
Plugin URI: http://unlimited-elements.com
|
5 |
Description: Unlimited Elements - Huge Widgets Pack for Elementor Page Builder, with html/css/js widget creator and editor
|
6 |
Author: Unlimited Elements
|
7 |
-
Version: 1.4.
|
8 |
Author URI: http://unlimited-elements.com
|
9 |
Text Domain: unlimited-elements-for-elementor
|
10 |
Domain Path: /languages
|
11 |
-
Elementor tested up to: 3.
|
12 |
-
Elementor Pro tested up to: 3.2.
|
13 |
*/
|
14 |
|
15 |
if(!defined("UNLIMITED_ELEMENTS_INC"))
|
4 |
Plugin URI: http://unlimited-elements.com
|
5 |
Description: Unlimited Elements - Huge Widgets Pack for Elementor Page Builder, with html/css/js widget creator and editor
|
6 |
Author: Unlimited Elements
|
7 |
+
Version: 1.4.73
|
8 |
Author URI: http://unlimited-elements.com
|
9 |
Text Domain: unlimited-elements-for-elementor
|
10 |
Domain Path: /languages
|
11 |
+
Elementor tested up to: 3.2.2
|
12 |
+
Elementor Pro tested up to: 3.2.2
|
13 |
*/
|
14 |
|
15 |
if(!defined("UNLIMITED_ELEMENTS_INC"))
|
views/objects/addon_view.class.php
CHANGED
@@ -610,6 +610,16 @@ class UniteCreatorAddonView{
|
|
610 |
</span>
|
611 |
|
612 |
<?php HelperHtmlUC::putDialogControlFieldsNotice() ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
613 |
</div>
|
614 |
</div>
|
615 |
|
@@ -1203,6 +1213,21 @@ class UniteCreatorAddonView{
|
|
1203 |
|
1204 |
}
|
1205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1206 |
/**
|
1207 |
* add param for form item
|
1208 |
*/
|
@@ -1401,6 +1426,8 @@ class UniteCreatorAddonView{
|
|
1401 |
protected function getAddParamKeys(){
|
1402 |
|
1403 |
$arrAddKeys = array();
|
|
|
|
|
1404 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_NUMBER] = $this->getAddParams_responsive();
|
1405 |
|
1406 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_FORM] = $this->getAddParams_form();
|
@@ -1416,6 +1443,7 @@ class UniteCreatorAddonView{
|
|
1416 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_SLIDER] = $this->objChildParams->getAddParams_slider();
|
1417 |
|
1418 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_MENU] = $this->objChildParams->getAddParams_menu();
|
|
|
1419 |
|
1420 |
return($arrAddKeys);
|
1421 |
}
|
610 |
</span>
|
611 |
|
612 |
<?php HelperHtmlUC::putDialogControlFieldsNotice() ?>
|
613 |
+
|
614 |
+
<div class="vert_sap10"></div>
|
615 |
+
|
616 |
+
<label>
|
617 |
+
<input id="uc_dialog_include_after_elementor_frontend" type="checkbox" name="include_after_elementor_frontend">
|
618 |
+
|
619 |
+
<?php _e("Include after elementor-frontend.js", "unlimited-elements-for-elementor")?>
|
620 |
+
|
621 |
+
</label>
|
622 |
+
|
623 |
</div>
|
624 |
</div>
|
625 |
|
1213 |
|
1214 |
}
|
1215 |
|
1216 |
+
/**
|
1217 |
+
* add simple array
|
1218 |
+
*/
|
1219 |
+
protected function getAddParams_array(){
|
1220 |
+
|
1221 |
+
$strText = "{% for value in [param_prefix] %}\n";
|
1222 |
+
$strText .= " {{value}}\n";
|
1223 |
+
$strText .= "{% endfor %}\n";
|
1224 |
+
|
1225 |
+
$arrParams = array();
|
1226 |
+
$arrParams[] = $this->createChildParam(null, null, array("raw_insert_text"=>$strText));
|
1227 |
+
|
1228 |
+
return($arrParams);
|
1229 |
+
}
|
1230 |
+
|
1231 |
/**
|
1232 |
* add param for form item
|
1233 |
*/
|
1426 |
protected function getAddParamKeys(){
|
1427 |
|
1428 |
$arrAddKeys = array();
|
1429 |
+
|
1430 |
+
$arrAddKeys[UniteCreatorDialogParam::PARAM_MULTIPLE_SELECT] = $this->getAddParams_array();
|
1431 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_NUMBER] = $this->getAddParams_responsive();
|
1432 |
|
1433 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_FORM] = $this->getAddParams_form();
|
1443 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_SLIDER] = $this->objChildParams->getAddParams_slider();
|
1444 |
|
1445 |
$arrAddKeys[UniteCreatorDialogParam::PARAM_MENU] = $this->objChildParams->getAddParams_menu();
|
1446 |
+
$arrAddKeys[UniteCreatorDialogParam::PARAM_TEMPLATE] = $this->objChildParams->getAddParams_template();
|
1447 |
|
1448 |
return($arrAddKeys);
|
1449 |
}
|
views/objects/addon_view_childparams.class.php
CHANGED
@@ -273,6 +273,14 @@ class UniteCreatorAddonViewChildParams{
|
|
273 |
";
|
274 |
|
275 |
$arrParams[] = $this->createChildParam_code($key, $text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
|
278 |
//----- default value ------
|
@@ -359,7 +367,7 @@ jQuery(document).ready(function(){
|
|
359 |
|
360 |
$strCode = "";
|
361 |
$strCode .= "{% for cat in [param_prefix].categories %}\n";
|
362 |
-
|
363 |
$strCode .= " <span> {{cat.id}} , {{cat.name}} , {{cat.slug}} , {{cat.description}}, {{cat.link}} </span> <br>\n\n ";
|
364 |
|
365 |
$strCode .= " {# also you can use category custom fields #} \n";
|
@@ -508,7 +516,7 @@ jQuery(document).ready(function(){
|
|
508 |
private function getCustomFieldKeyText($type, $key){
|
509 |
|
510 |
//complex code (repeater)
|
511 |
-
|
512 |
if(is_array($type)){
|
513 |
|
514 |
$strCode = "";
|
@@ -544,9 +552,9 @@ jQuery(document).ready(function(){
|
|
544 |
//--- simple array code
|
545 |
|
546 |
if($type == "array"){
|
547 |
-
|
548 |
$strCode = "";
|
549 |
-
$strCode .= "{% for
|
550 |
$strCode .= "<span> {{item}} </span>\n";
|
551 |
$strCode .= "{% endfor %}\n";
|
552 |
|
@@ -813,15 +821,30 @@ jQuery(document).ready(function(){
|
|
813 |
|
814 |
$arrParams[] = $this->createWooPostParam_getChildProducts();
|
815 |
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
820 |
}
|
821 |
|
822 |
return($arrParams);
|
823 |
}
|
824 |
|
|
|
825 |
/**
|
826 |
* add woo commerce post param without post id
|
827 |
*/
|
@@ -1188,6 +1211,23 @@ jQuery(document).ready(function(){
|
|
1188 |
|
1189 |
return($arrParams);
|
1190 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1191 |
|
1192 |
|
1193 |
/**
|
273 |
";
|
274 |
|
275 |
$arrParams[] = $this->createChildParam_code($key, $text);
|
276 |
+
|
277 |
+
$key = "Date Filter - |ucdate";
|
278 |
+
$text = "
|
279 |
+
{# use the ucdate filter to convert timestamps to dates preserving wordpress format#}
|
280 |
+
{{ your_timestamp|ucdate(\"m/d/Y\") }}
|
281 |
+
";
|
282 |
+
|
283 |
+
$arrParams[] = $this->createChildParam_code($key, $text);
|
284 |
|
285 |
|
286 |
//----- default value ------
|
367 |
|
368 |
$strCode = "";
|
369 |
$strCode .= "{% for cat in [param_prefix].categories %}\n";
|
370 |
+
|
371 |
$strCode .= " <span> {{cat.id}} , {{cat.name}} , {{cat.slug}} , {{cat.description}}, {{cat.link}} </span> <br>\n\n ";
|
372 |
|
373 |
$strCode .= " {# also you can use category custom fields #} \n";
|
516 |
private function getCustomFieldKeyText($type, $key){
|
517 |
|
518 |
//complex code (repeater)
|
519 |
+
|
520 |
if(is_array($type)){
|
521 |
|
522 |
$strCode = "";
|
552 |
//--- simple array code
|
553 |
|
554 |
if($type == "array"){
|
555 |
+
|
556 |
$strCode = "";
|
557 |
+
$strCode .= "{% for item in [param_prefix].{$key} %}\n";
|
558 |
$strCode .= "<span> {{item}} </span>\n";
|
559 |
$strCode .= "{% endfor %}\n";
|
560 |
|
821 |
|
822 |
$arrParams[] = $this->createWooPostParam_getChildProducts();
|
823 |
|
824 |
+
foreach($arrKeys as $key){
|
825 |
+
|
826 |
+
switch($key){
|
827 |
+
case "woo_sale_price":
|
828 |
+
case "woo_regular_price":
|
829 |
+
case "woo_price":
|
830 |
+
case "woo_price_to":
|
831 |
+
case "woo_price_from":
|
832 |
+
case "woo_sale_price_to":
|
833 |
+
case "woo_sale_price_from":
|
834 |
+
case "woo_regular_price_from":
|
835 |
+
case "woo_regular_price_to":
|
836 |
+
$arrParams[] = $this->createChildParam($key,null,array("raw_insert_text"=>"{{[param_name]|wc_price|raw}}"));
|
837 |
+
break;
|
838 |
+
default:
|
839 |
+
$arrParams[] = $this->createChildParam($key);
|
840 |
+
break;
|
841 |
+
}
|
842 |
}
|
843 |
|
844 |
return($arrParams);
|
845 |
}
|
846 |
|
847 |
+
|
848 |
/**
|
849 |
* add woo commerce post param without post id
|
850 |
*/
|
1211 |
|
1212 |
return($arrParams);
|
1213 |
}
|
1214 |
+
|
1215 |
+
|
1216 |
+
/**
|
1217 |
+
* get post child params
|
1218 |
+
*/
|
1219 |
+
public function getAddParams_template(){
|
1220 |
+
|
1221 |
+
$arrParams = array();
|
1222 |
+
|
1223 |
+
$strCode = "{{putElementorTemplate([param_prefix]_templateid)}}";
|
1224 |
+
|
1225 |
+
$arrParam = $this->createChildParam(null, null, array("raw_insert_text"=>$strCode));
|
1226 |
+
|
1227 |
+
$arrParams[] = $arrParam;
|
1228 |
+
|
1229 |
+
return($arrParams);
|
1230 |
+
}
|
1231 |
|
1232 |
|
1233 |
/**
|