Version Description
Download this release
Release Info
Developer | unitecms |
Plugin | Unlimited Elements For Elementor (Free Widgets, Addons, Templates) |
Version | 1.4.70 |
Comparing to | |
See all releases |
Code changes from version 1.4.69 to 1.4.70
- css/unitecreator_styles.css +37 -0
- images/icon_link.svg +55 -0
- inc_php/framework/instagram/obj_item.class.php +20 -8
- inc_php/unitecreator_addon.class.php +13 -1
- inc_php/unitecreator_addons.class.php +4 -0
- inc_php/unitecreator_client_text.php +3 -1
- inc_php/unitecreator_dialog_param.class.php +43 -31
- inc_php/unitecreator_output.class.php +106 -15
- inc_php/unitecreator_params_processor.class.php +1 -1
- includes.php +2 -1
- js/unitecreator_params_dialog.js +141 -11
- js/unitecreator_params_editor.js +43 -1
- provider/core/plugins/unlimited_elements/elementor/dynamic_tags/tag_current_timestamp.php +37 -0
- provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php +17 -1
- provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +87 -9
- provider/functions_wordpress.class.php +28 -1
- provider/integrations.class.php +146 -0
- provider/provider_helper.class.php +26 -0
- provider/provider_params_processor.class.php +119 -12
- provider/provider_settings.class.php +94 -18
- readme.txt +14 -0
- release_log.txt +14 -0
- unlimited_elements.php +1 -1
css/unitecreator_styles.css
CHANGED
@@ -729,6 +729,22 @@
|
|
729 |
}
|
730 |
}
|
731 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
732 |
.----------------PARAMS_DIALOG------------- {}
|
733 |
|
734 |
|
@@ -959,6 +975,27 @@
|
|
959 |
padding-bottom:5px;
|
960 |
}
|
961 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
962 |
.----------------THIRD_PARTY------------- {}
|
963 |
|
964 |
.select2-dropdown{
|
729 |
}
|
730 |
}
|
731 |
|
732 |
+
.uc-table-params .uc-text-condition{
|
733 |
+
xbackground-color:yellow;
|
734 |
+
background-image:url('../images/icon_link.svg');
|
735 |
+
background-repeat:no-repeat;
|
736 |
+
padding-left:16px;
|
737 |
+
background-position:left 8px;
|
738 |
+
background-size:12px;
|
739 |
+
color:#000000;
|
740 |
+
xpadding-top:4px;
|
741 |
+
position:relative;
|
742 |
+
top:7px;
|
743 |
+
|
744 |
+
}
|
745 |
+
|
746 |
+
|
747 |
+
|
748 |
.----------------PARAMS_DIALOG------------- {}
|
749 |
|
750 |
|
975 |
padding-bottom:5px;
|
976 |
}
|
977 |
|
978 |
+
.uc-dialog-param .uc-noparents-mode .uc-dialog-conditions-inputs{
|
979 |
+
display:none;
|
980 |
+
}
|
981 |
+
|
982 |
+
.uc-dialog-param .uc-dialog-conditions-empty{
|
983 |
+
|
984 |
+
color:#AE3232; /* red */
|
985 |
+
display:none;
|
986 |
+
}
|
987 |
+
|
988 |
+
.uc-dialog-param .uc-noparents-mode .uc-dialog-conditions-empty{
|
989 |
+
display:block;
|
990 |
+
}
|
991 |
+
|
992 |
+
|
993 |
+
.uc-dialog-param .uc-no-attribute-selected .uc-dialog-condition-operator,
|
994 |
+
.uc-dialog-param .uc-no-attribute-selected .uc-dialog-condition-value{
|
995 |
+
display:none;
|
996 |
+
}
|
997 |
+
|
998 |
+
|
999 |
.----------------THIRD_PARTY------------- {}
|
1000 |
|
1001 |
.select2-dropdown{
|
images/icon_link.svg
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 477.389 477.389" style="enable-background:new 0 0 477.389 477.389;" xml:space="preserve">
|
5 |
+
<g>
|
6 |
+
<g>
|
7 |
+
<path d="M451.209,68.647c-16.787-16.799-39.564-26.234-63.312-26.226v0c-23.739-0.056-46.516,9.376-63.266,26.197L209.056,184.194
|
8 |
+
c-22.867,22.903-31.609,56.356-22.869,87.518c2.559,9.072,11.988,14.352,21.06,11.793c9.072-2.559,14.352-11.988,11.793-21.06
|
9 |
+
c-5.388-19.271,0.018-39.95,14.148-54.118L348.763,92.768c21.608-21.613,56.646-21.617,78.259-0.008
|
10 |
+
c21.613,21.608,21.617,56.646,0.009,78.259L311.456,286.594c-7.574,7.584-17.193,12.797-27.682,15.002
|
11 |
+
c-9.228,1.921-15.151,10.959-13.23,20.187c1.652,7.935,8.657,13.613,16.762,13.588c1.193,0.001,2.383-0.125,3.55-0.375
|
12 |
+
c16.951-3.575,32.494-12.007,44.732-24.269l115.576-115.558C486.114,160.243,486.134,103.598,451.209,68.647z"/>
|
13 |
+
</g>
|
14 |
+
</g>
|
15 |
+
<g>
|
16 |
+
<g>
|
17 |
+
<path d="M290.702,206.142c-2.559-9.072-11.988-14.352-21.06-11.793s-14.352,11.988-11.793,21.06
|
18 |
+
c5.388,19.271-0.018,39.95-14.148,54.118L128.125,385.103c-21.608,21.613-56.646,21.617-78.259,0.008
|
19 |
+
c-21.613-21.608-21.617-56.646-0.009-78.259l115.576-115.593c7.562-7.582,17.17-12.795,27.648-15.002
|
20 |
+
c9.243-1.849,15.237-10.84,13.388-20.082s-10.84-15.237-20.082-13.388c-0.113,0.023-0.225,0.046-0.337,0.071
|
21 |
+
c-16.954,3.579-32.502,12.011-44.749,24.269L25.725,282.703c-34.676,35.211-34.242,91.865,0.969,126.541
|
22 |
+
c34.827,34.297,90.731,34.301,125.563,0.008l115.575-115.593C290.7,270.756,299.442,237.303,290.702,206.142z"/>
|
23 |
+
</g>
|
24 |
+
</g>
|
25 |
+
<g>
|
26 |
+
</g>
|
27 |
+
<g>
|
28 |
+
</g>
|
29 |
+
<g>
|
30 |
+
</g>
|
31 |
+
<g>
|
32 |
+
</g>
|
33 |
+
<g>
|
34 |
+
</g>
|
35 |
+
<g>
|
36 |
+
</g>
|
37 |
+
<g>
|
38 |
+
</g>
|
39 |
+
<g>
|
40 |
+
</g>
|
41 |
+
<g>
|
42 |
+
</g>
|
43 |
+
<g>
|
44 |
+
</g>
|
45 |
+
<g>
|
46 |
+
</g>
|
47 |
+
<g>
|
48 |
+
</g>
|
49 |
+
<g>
|
50 |
+
</g>
|
51 |
+
<g>
|
52 |
+
</g>
|
53 |
+
<g>
|
54 |
+
</g>
|
55 |
+
</svg>
|
inc_php/framework/instagram/obj_item.class.php
CHANGED
@@ -11,6 +11,7 @@ class InstaObjItemUC{
|
|
11 |
|
12 |
const TYPE_VIDEO = "video";
|
13 |
const TYPE_IMAGE = "image";
|
|
|
14 |
|
15 |
const IMAGE_LOW = "low_resolution";
|
16 |
const IMAGE_STANDARD = "standard_resolution";
|
@@ -493,12 +494,15 @@ class InstaObjItemUC{
|
|
493 |
$isVideo = UniteFunctionsUC::getVal($item, "is_video");
|
494 |
$isVideo = UniteFunctionsUC::strToBool($isVideo);
|
495 |
|
|
|
|
|
496 |
if($isVideo == true){
|
497 |
$this->type = self::TYPE_VIDEO;
|
498 |
}
|
499 |
-
else
|
500 |
$this->type = self::TYPE_IMAGE;
|
501 |
-
|
|
|
502 |
if($this->type != self::TYPE_VIDEO)
|
503 |
return(false);
|
504 |
|
@@ -604,13 +608,21 @@ class InstaObjItemUC{
|
|
604 |
* init item by official API
|
605 |
*/
|
606 |
public function initOfficialAPI($item){
|
607 |
-
|
608 |
$mediaType = UniteFunctionsUC::getVal($item, "media_type");
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
|
615 |
$urlImage = UniteFunctionsUC::getVal($item, "media_url");
|
616 |
|
11 |
|
12 |
const TYPE_VIDEO = "video";
|
13 |
const TYPE_IMAGE = "image";
|
14 |
+
const TYPE_ALBOM = "albom";
|
15 |
|
16 |
const IMAGE_LOW = "low_resolution";
|
17 |
const IMAGE_STANDARD = "standard_resolution";
|
494 |
$isVideo = UniteFunctionsUC::getVal($item, "is_video");
|
495 |
$isVideo = UniteFunctionsUC::strToBool($isVideo);
|
496 |
|
497 |
+
$mediaType = UniteFunctionsUC::getVal($item, "media_type");
|
498 |
+
|
499 |
if($isVideo == true){
|
500 |
$this->type = self::TYPE_VIDEO;
|
501 |
}
|
502 |
+
else{
|
503 |
$this->type = self::TYPE_IMAGE;
|
504 |
+
}
|
505 |
+
|
506 |
if($this->type != self::TYPE_VIDEO)
|
507 |
return(false);
|
508 |
|
608 |
* init item by official API
|
609 |
*/
|
610 |
public function initOfficialAPI($item){
|
611 |
+
|
612 |
$mediaType = UniteFunctionsUC::getVal($item, "media_type");
|
613 |
+
|
614 |
+
switch($mediaType){
|
615 |
+
default:
|
616 |
+
case "IMAGE":
|
617 |
+
$this->type = self::TYPE_IMAGE;
|
618 |
+
break;
|
619 |
+
case "CAROUSEL_ALBUM":
|
620 |
+
$this->type = self::TYPE_ALBOM;
|
621 |
+
break;
|
622 |
+
case "VIDEO":
|
623 |
+
$this->type = self::TYPE_VIDEO;
|
624 |
+
break;
|
625 |
+
}
|
626 |
|
627 |
$urlImage = UniteFunctionsUC::getVal($item, "media_url");
|
628 |
|
inc_php/unitecreator_addon.class.php
CHANGED
@@ -134,19 +134,31 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
134 |
|
135 |
$arrParams = $this->objProcessor->initProcessParams($arrParams);
|
136 |
|
|
|
|
|
|
|
|
|
137 |
$arrNames = array();
|
138 |
foreach($arrParams as $param){
|
|
|
139 |
$name = UniteFunctionsUC::getVal($param, "name");
|
140 |
if(empty($name))
|
141 |
UniteFunctionsUC::throwError("Empty param name found");
|
142 |
|
143 |
if(isset($arrNames[$name])){
|
144 |
-
$message = "Duplicate $type
|
145 |
if(in_array($name, array("link","image","thumb","title","enable_link")))
|
146 |
$message .= ". <br> The <b>$name</b> param is included in the image base params";
|
147 |
|
148 |
UniteFunctionsUC::throwError($message);
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
$arrNames[$name] = true;
|
152 |
}
|
134 |
|
135 |
$arrParams = $this->objProcessor->initProcessParams($arrParams);
|
136 |
|
137 |
+
$arrElementorTakenNames = array(
|
138 |
+
"animation_duration"=>true
|
139 |
+
);
|
140 |
+
|
141 |
$arrNames = array();
|
142 |
foreach($arrParams as $param){
|
143 |
+
|
144 |
$name = UniteFunctionsUC::getVal($param, "name");
|
145 |
if(empty($name))
|
146 |
UniteFunctionsUC::throwError("Empty param name found");
|
147 |
|
148 |
if(isset($arrNames[$name])){
|
149 |
+
$message = "Duplicate $type attribute name found: <b> $name </b>";
|
150 |
if(in_array($name, array("link","image","thumb","title","enable_link")))
|
151 |
$message .= ". <br> The <b>$name</b> param is included in the image base params";
|
152 |
|
153 |
UniteFunctionsUC::throwError($message);
|
154 |
}
|
155 |
+
|
156 |
+
//check for elementor taken name
|
157 |
+
if(isset($arrElementorTakenNames[$name])){
|
158 |
+
|
159 |
+
$message = "The attribute name: <b> $name </b> is taken by elementor built in attribute. Please use different name";
|
160 |
+
UniteFunctionsUC::throwError($message);
|
161 |
+
}
|
162 |
|
163 |
$arrNames[$name] = true;
|
164 |
}
|
inc_php/unitecreator_addons.class.php
CHANGED
@@ -1561,6 +1561,10 @@ class UniteCreatorAddons extends UniteElementsBaseUC{
|
|
1561 |
if(empty($position))
|
1562 |
$position = $objAddon->getParamPosition($paramName, $isMain);
|
1563 |
|
|
|
|
|
|
|
|
|
1564 |
//update addons
|
1565 |
|
1566 |
foreach($targetAddonIDs as $addonID){
|
1561 |
if(empty($position))
|
1562 |
$position = $objAddon->getParamPosition($paramName, $isMain);
|
1563 |
|
1564 |
+
//clear category data
|
1565 |
+
unset($paramData["__attr_catid__"]);
|
1566 |
+
|
1567 |
+
|
1568 |
//update addons
|
1569 |
|
1570 |
foreach($targetAddonIDs as $addonID){
|
inc_php/unitecreator_client_text.php
CHANGED
@@ -153,7 +153,9 @@ GlobalsUC::$arrClientSideText = array(
|
|
153 |
"copy_section"=>esc_html__("Copy Section", "unlimited-elements-for-elementor"),
|
154 |
"delete_section"=>esc_html__("Delete Section", "unlimited-elements-for-elementor"),
|
155 |
"delete_section_error"=>esc_html("This section is not empty.\\nYou can delete only empty sections."),
|
156 |
-
"delete_default_section_error"=>esc_html("You can not delete this section.")
|
|
|
|
|
157 |
);
|
158 |
|
159 |
$filepathProviderClientText = GlobalsUC::$pathProvider."provider_client_text.php";
|
153 |
"copy_section"=>esc_html__("Copy Section", "unlimited-elements-for-elementor"),
|
154 |
"delete_section"=>esc_html__("Delete Section", "unlimited-elements-for-elementor"),
|
155 |
"delete_section_error"=>esc_html("This section is not empty.\\nYou can delete only empty sections."),
|
156 |
+
"delete_default_section_error"=>esc_html("You can not delete this section."),
|
157 |
+
"empty_text"=>esc_html("Empty Text"),
|
158 |
+
"display_condition"=>esc_html("Display Condition")
|
159 |
);
|
160 |
|
161 |
$filepathProviderClientText = GlobalsUC::$pathProvider."provider_client_text.php";
|
inc_php/unitecreator_dialog_param.class.php
CHANGED
@@ -78,7 +78,7 @@ class UniteCreatorDialogParamWork{
|
|
78 |
protected $option_arrTexts = array();
|
79 |
protected $option_putDecsription = true;
|
80 |
protected $option_allowFontEditCheckbox = true;
|
81 |
-
protected $option_putCondition =
|
82 |
|
83 |
|
84 |
/**
|
@@ -789,6 +789,10 @@ class UniteCreatorDialogParamWork{
|
|
789 |
?>
|
790 |
<div class="vert_sap10"></div>
|
791 |
|
|
|
|
|
|
|
|
|
792 |
<hr>
|
793 |
<?php
|
794 |
|
@@ -1356,40 +1360,51 @@ class UniteCreatorDialogParamWork{
|
|
1356 |
$tableID = "uc_dialog_left_condition_table".$this->type;
|
1357 |
|
1358 |
?>
|
|
|
1359 |
<div class="unite-inputs-sap"></div>
|
1360 |
|
1361 |
<label for="<?php echo $checkboxID?>" class="unite-inputs-label-inline-free">
|
1362 |
<?php esc_html_e("Enable Condition", "unlimited-elements-for-elementor")?>:
|
1363 |
</label>
|
1364 |
-
<input id="<?php echo $checkboxID?>" type="checkbox" name="enable_condition" class="uc-control" data-controlled-selector=".uc-
|
1365 |
|
1366 |
-
<div class="unite-inputs-sap"></div>
|
1367 |
|
1368 |
-
<
|
1369 |
-
|
1370 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1371 |
|
1372 |
-
|
1373 |
-
<tr>
|
1374 |
-
<td>
|
1375 |
-
<select class="uc-dialog-condition-attribute" name="condition_attribute">
|
1376 |
-
<option>default</option>
|
1377 |
-
</select>
|
1378 |
-
|
1379 |
-
</td>
|
1380 |
-
<td>
|
1381 |
-
<select class="uc-dialog-condition-operator" name="condition_operator">
|
1382 |
-
<option value="equal"><?php _e("Equal","unlimited-elements-for-elementor")?></option>
|
1383 |
-
<option value="not_equal"><?php _e("Not Equal","unlimited-elements-for-elementor")?></option>
|
1384 |
-
</select>
|
1385 |
-
</td>
|
1386 |
-
<td>
|
1387 |
-
<select class="uc-dialog-condition-value" name="condition_value">
|
1388 |
-
<option>default</option>
|
1389 |
-
</select>
|
1390 |
-
</td>
|
1391 |
-
</tr>
|
1392 |
-
</table>
|
1393 |
|
1394 |
<?php
|
1395 |
}
|
@@ -1708,10 +1723,7 @@ class UniteCreatorDialogParamWork{
|
|
1708 |
|
1709 |
switch($this->type){
|
1710 |
case self::TYPE_MAIN:
|
1711 |
-
|
1712 |
-
if(GlobalsUC::$inDev == true)
|
1713 |
-
$this->option_putCondition = true;
|
1714 |
-
|
1715 |
$this->initMainParams();
|
1716 |
$this->initItemParams();
|
1717 |
break;
|
78 |
protected $option_arrTexts = array();
|
79 |
protected $option_putDecsription = true;
|
80 |
protected $option_allowFontEditCheckbox = true;
|
81 |
+
protected $option_putCondition = true;
|
82 |
|
83 |
|
84 |
/**
|
789 |
?>
|
790 |
<div class="vert_sap10"></div>
|
791 |
|
792 |
+
<?php
|
793 |
+
$this->putCheckbox("show_image_sizes", __("Show Image Sizes Select", "unlimited-elements-for-elementor"));
|
794 |
+
?>
|
795 |
+
|
796 |
<hr>
|
797 |
<?php
|
798 |
|
1360 |
$tableID = "uc_dialog_left_condition_table".$this->type;
|
1361 |
|
1362 |
?>
|
1363 |
+
|
1364 |
<div class="unite-inputs-sap"></div>
|
1365 |
|
1366 |
<label for="<?php echo $checkboxID?>" class="unite-inputs-label-inline-free">
|
1367 |
<?php esc_html_e("Enable Condition", "unlimited-elements-for-elementor")?>:
|
1368 |
</label>
|
1369 |
+
<input id="<?php echo $checkboxID?>" type="checkbox" name="enable_condition" class="uc-control" data-controlled-selector=".uc-dialog-conditions-content">
|
1370 |
|
|
|
1371 |
|
1372 |
+
<div class="uc-dialog-conditions-content">
|
1373 |
+
|
1374 |
+
<div class="unite-inputs-sap"></div>
|
1375 |
+
|
1376 |
+
<div class="uc-dialog-conditions-empty">
|
1377 |
+
|
1378 |
+
<?php _e("No parent attribute (dropdown, checkbox or radio) exists in this category")?>
|
1379 |
+
</div>
|
1380 |
+
|
1381 |
+
<div class="uc-dialog-conditions-inputs">
|
1382 |
+
|
1383 |
+
<label class="unite-inputs-label">
|
1384 |
+
<?php _e("Show When", "unlimited-elements-for-elementor")?>:
|
1385 |
+
</label>
|
1386 |
+
|
1387 |
+
<table class="uc-table-dialog-conditions">
|
1388 |
+
<tr>
|
1389 |
+
<td>
|
1390 |
+
<select class="uc-dialog-condition-attribute" name="condition_attribute"></select>
|
1391 |
+
|
1392 |
+
</td>
|
1393 |
+
<td>
|
1394 |
+
<select class="uc-dialog-condition-operator" name="condition_operator">
|
1395 |
+
<option value="equal"><?php _e("Equal","unlimited-elements-for-elementor")?></option>
|
1396 |
+
<option value="not_equal"><?php _e("Not Equal","unlimited-elements-for-elementor")?></option>
|
1397 |
+
</select>
|
1398 |
+
</td>
|
1399 |
+
<td>
|
1400 |
+
<select class="uc-dialog-condition-value" name="condition_value"></select>
|
1401 |
+
</td>
|
1402 |
+
</tr>
|
1403 |
+
</table>
|
1404 |
+
|
1405 |
+
</div>
|
1406 |
|
1407 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1408 |
|
1409 |
<?php
|
1410 |
}
|
1723 |
|
1724 |
switch($this->type){
|
1725 |
case self::TYPE_MAIN:
|
1726 |
+
|
|
|
|
|
|
|
1727 |
$this->initMainParams();
|
1728 |
$this->initItemParams();
|
1729 |
break;
|
inc_php/unitecreator_output.class.php
CHANGED
@@ -30,6 +30,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
30 |
private $isModePreview = false;
|
31 |
private $arrOptions;
|
32 |
private $isShowDebugData = false;
|
|
|
33 |
|
34 |
private static $arrUrlCacheCss = array();
|
35 |
private static $arrHandleCacheCss = array();
|
@@ -1183,8 +1184,9 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1183 |
|
1184 |
/**
|
1185 |
* modify data array for show
|
|
|
1186 |
*/
|
1187 |
-
private function modifyDataArrayForShow($arrData){
|
1188 |
|
1189 |
if(is_array($arrData) == false)
|
1190 |
return($arrData);
|
@@ -1200,6 +1202,11 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1200 |
$key = " $key";
|
1201 |
|
1202 |
$arrDataNew[$key] = $value;
|
|
|
|
|
|
|
|
|
|
|
1203 |
}
|
1204 |
|
1205 |
return($arrDataNew);
|
@@ -1232,32 +1239,103 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1232 |
return($arrItemsForShow);
|
1233 |
}
|
1234 |
|
|
|
1235 |
|
1236 |
/**
|
1237 |
-
* put debug data
|
1238 |
*/
|
1239 |
-
private function
|
1240 |
|
1241 |
-
|
1242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1243 |
|
1244 |
-
dmp("<b>Widget
|
1245 |
-
dmp($arrData);
|
1246 |
|
1247 |
-
if(empty($arrItemData))
|
|
|
1248 |
return(false);
|
|
|
1249 |
|
1250 |
$arrItemData = $this->modifyItemsDataForShow($arrItemData);
|
|
|
|
|
1251 |
|
1252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1253 |
|
1254 |
-
dmp($arrItemData);
|
1255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1256 |
|
1257 |
-
|
1258 |
-
//dmp("put the debug data");
|
1259 |
|
1260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1261 |
|
1262 |
}
|
1263 |
|
@@ -1273,11 +1351,14 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1273 |
/**
|
1274 |
* set to show debug data of the addon
|
1275 |
*/
|
1276 |
-
public function showDebugData($isShow = true){
|
1277 |
|
1278 |
$this->isShowDebugData = $isShow;
|
|
|
|
|
1279 |
}
|
1280 |
|
|
|
1281 |
/**
|
1282 |
* get only processed html template
|
1283 |
*/
|
@@ -1607,6 +1688,8 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1607 |
|
1608 |
$arrItemData = null;
|
1609 |
|
|
|
|
|
1610 |
//set items template
|
1611 |
if($this->isItemsExists == false){
|
1612 |
|
@@ -1628,7 +1711,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1628 |
case "post": //move posts data from main to items
|
1629 |
|
1630 |
$paramPostsList = $this->addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
|
1631 |
-
|
1632 |
if(empty($paramPostsList))
|
1633 |
UniteFunctionsUC::throwError("Some posts list param should be found");
|
1634 |
|
@@ -1693,6 +1776,14 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1693 |
|
1694 |
}
|
1695 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1696 |
//show debug data
|
1697 |
if($this->isShowDebugData == true)
|
1698 |
$this->putDebugDataHtml($arrData, $arrItemData);
|
30 |
private $isModePreview = false;
|
31 |
private $arrOptions;
|
32 |
private $isShowDebugData = false;
|
33 |
+
private $debugDataType = "";
|
34 |
|
35 |
private static $arrUrlCacheCss = array();
|
36 |
private static $arrHandleCacheCss = array();
|
1184 |
|
1185 |
/**
|
1186 |
* modify data array for show
|
1187 |
+
* convert single array like in post meta
|
1188 |
*/
|
1189 |
+
private function modifyDataArrayForShow($arrData, $convertSingleArray = false){
|
1190 |
|
1191 |
if(is_array($arrData) == false)
|
1192 |
return($arrData);
|
1202 |
$key = " $key";
|
1203 |
|
1204 |
$arrDataNew[$key] = $value;
|
1205 |
+
|
1206 |
+
//convert single array
|
1207 |
+
if($convertSingleArray == true && is_array($value) && count($value) == 1 && isset($value[0]))
|
1208 |
+
$arrDataNew[$key] = $value[0];
|
1209 |
+
|
1210 |
}
|
1211 |
|
1212 |
return($arrDataNew);
|
1239 |
return($arrItemsForShow);
|
1240 |
}
|
1241 |
|
1242 |
+
private function ___________DEBUG_DATA___________(){}
|
1243 |
|
1244 |
/**
|
1245 |
+
* put debug data html
|
1246 |
*/
|
1247 |
+
private function putDebugDataHtml_default($arrData, $arrItemData){
|
1248 |
|
1249 |
+
$isShowData = $this->debugDataType != "items_only";
|
1250 |
+
|
1251 |
+
if($isShowData == true){
|
1252 |
+
|
1253 |
+
//modify the data
|
1254 |
+
$arrData = $this->modifyDataArrayForShow($arrData);
|
1255 |
+
|
1256 |
+
dmp($arrData);
|
1257 |
+
}
|
1258 |
|
1259 |
+
dmp("<b>Widget Items Data</b>");
|
|
|
1260 |
|
1261 |
+
if(empty($arrItemData)){
|
1262 |
+
dmp("no items found");
|
1263 |
return(false);
|
1264 |
+
}
|
1265 |
|
1266 |
$arrItemData = $this->modifyItemsDataForShow($arrItemData);
|
1267 |
+
|
1268 |
+
dmp($arrItemData);
|
1269 |
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
/**
|
1273 |
+
* put debug data - posts
|
1274 |
+
*/
|
1275 |
+
private function putDebugDataHtml_posts($arrItemData){
|
1276 |
+
|
1277 |
+
$numPosts = count($arrItemData);
|
1278 |
+
|
1279 |
+
dmp("Found $numPosts posts.");
|
1280 |
+
|
1281 |
+
if(empty($arrItemData))
|
1282 |
+
return(false);
|
1283 |
+
|
1284 |
+
$isShowMeta = ($this->debugDataType == "post_meta");
|
1285 |
+
|
1286 |
+
foreach($arrItemData as $index => $item){
|
1287 |
+
|
1288 |
+
$item = UniteFunctionsUC::getVal($item, "item");
|
1289 |
+
|
1290 |
+
$postData = UniteFunctionsUC::getArrFirstValue($item);
|
1291 |
+
|
1292 |
+
$title = UniteFunctionsUC::getVal($postData, "title");
|
1293 |
+
$alias = UniteFunctionsUC::getVal($postData, "alias");
|
1294 |
+
$id = UniteFunctionsUC::getVal($postData, "id");
|
1295 |
+
|
1296 |
+
$num = $index+1;
|
1297 |
+
|
1298 |
+
$text = "{$num}. <b>$title</b> (<i style='font-size:13px;'>$alias, $id</i>)";
|
1299 |
+
|
1300 |
+
dmp($text);
|
1301 |
+
|
1302 |
+
if($isShowMeta == false)
|
1303 |
+
continue;
|
1304 |
+
|
1305 |
+
$postMeta = get_post_meta($id, "", false);
|
1306 |
+
|
1307 |
+
$postMeta = $this->modifyDataArrayForShow($postMeta, true);
|
1308 |
+
|
1309 |
+
dmp($postMeta);
|
1310 |
+
|
1311 |
+
//$postMeta = get_post_meta($post_id)
|
1312 |
+
|
1313 |
+
}
|
1314 |
|
|
|
1315 |
|
1316 |
+
}
|
1317 |
+
|
1318 |
+
/**
|
1319 |
+
* put debug data
|
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 |
+
|
1327 |
+
switch($this->debugDataType){
|
1328 |
+
case "post_titles":
|
1329 |
+
case "post_meta":
|
1330 |
+
$this->putDebugDataHtml_posts($arrItemData);
|
1331 |
+
|
1332 |
+
break;
|
1333 |
+
default:
|
1334 |
+
$this->putDebugDataHtml_default($arrData, $arrItemData);
|
1335 |
+
break;
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
echo "</div>";
|
1339 |
|
1340 |
}
|
1341 |
|
1351 |
/**
|
1352 |
* set to show debug data of the addon
|
1353 |
*/
|
1354 |
+
public function showDebugData($isShow = true, $dataType = null){
|
1355 |
|
1356 |
$this->isShowDebugData = $isShow;
|
1357 |
+
$this->debugDataType = $dataType;
|
1358 |
+
|
1359 |
}
|
1360 |
|
1361 |
+
|
1362 |
/**
|
1363 |
* get only processed html template
|
1364 |
*/
|
1688 |
|
1689 |
$arrItemData = null;
|
1690 |
|
1691 |
+
$paramPostsList = null;
|
1692 |
+
|
1693 |
//set items template
|
1694 |
if($this->isItemsExists == false){
|
1695 |
|
1711 |
case "post": //move posts data from main to items
|
1712 |
|
1713 |
$paramPostsList = $this->addon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
|
1714 |
+
|
1715 |
if(empty($paramPostsList))
|
1716 |
UniteFunctionsUC::throwError("Some posts list param should be found");
|
1717 |
|
1776 |
|
1777 |
}
|
1778 |
|
1779 |
+
if(!empty($paramPostsList)){
|
1780 |
+
$postListValue = UniteFunctionsUC::getVal($paramPostsList, "value");
|
1781 |
+
|
1782 |
+
if(!empty($paramPostsList) && is_array($paramPostsList))
|
1783 |
+
$arrData = array_merge($arrData, $postListValue);
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
|
1787 |
//show debug data
|
1788 |
if($this->isShowDebugData == true)
|
1789 |
$this->putDebugDataHtml($arrData, $arrItemData);
|
inc_php/unitecreator_params_processor.class.php
CHANGED
@@ -757,7 +757,7 @@ class UniteCreatorParamsProcessorWork{
|
|
757 |
* add image attributes
|
758 |
*/
|
759 |
private function addImageAttributes($data, $name, $param){
|
760 |
-
|
761 |
$addImageSizes = UniteFunctionsUC::getVal($param, "add_image_sizes");
|
762 |
$addImageSizes = UniteFunctionsUC::strToBool($addImageSizes);
|
763 |
|
757 |
* add image attributes
|
758 |
*/
|
759 |
private function addImageAttributes($data, $name, $param){
|
760 |
+
|
761 |
$addImageSizes = UniteFunctionsUC::getVal($param, "add_image_sizes");
|
762 |
$addImageSizes = UniteFunctionsUC::strToBool($addImageSizes);
|
763 |
|
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);
|
@@ -85,6 +85,7 @@ require_once GlobalsUC::$pathProvider."provider_dialog_param.class.php";
|
|
85 |
require_once $folderIncludesMain . 'unitecreator_form.class.php';
|
86 |
require_once $folderIncludesMain . 'unitecreator_addon_validator.class.php';
|
87 |
require_once $folderIncludesMain . 'unitecreator_filters_process.class.php';
|
|
|
88 |
|
89 |
//page builder related
|
90 |
|
12 |
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
13 |
|
14 |
if(!defined("UNLIMITED_ELEMENTS_VERSION"))
|
15 |
+
define("UNLIMITED_ELEMENTS_VERSION", "1.4.70");
|
16 |
|
17 |
$currentFile = __FILE__;
|
18 |
$currentFolder = dirname($currentFile);
|
85 |
require_once $folderIncludesMain . 'unitecreator_form.class.php';
|
86 |
require_once $folderIncludesMain . 'unitecreator_addon_validator.class.php';
|
87 |
require_once $folderIncludesMain . 'unitecreator_filters_process.class.php';
|
88 |
+
require_once GlobalsUC::$pathProvider . 'integrations.class.php';
|
89 |
|
90 |
//page builder related
|
91 |
|
js/unitecreator_params_dialog.js
CHANGED
@@ -5,7 +5,7 @@ function UniteCreatorParamsDialog(){
|
|
5 |
var t = this;
|
6 |
var g_objWrapper, g_objSelectType, g_objTabContentWrapper, g_objLeftArea, g_objRightArea;
|
7 |
var g_objError, g_objParamTitle, g_objParamName;
|
8 |
-
var g_objTexts, g_objParent, g_objData, g_objSettings, g_currentOpenedType;
|
9 |
|
10 |
var g_arrSpecialInputs = {}; //array of special inputs
|
11 |
|
@@ -414,8 +414,12 @@ function UniteCreatorParamsDialog(){
|
|
414 |
var paramType = null;
|
415 |
|
416 |
g_currentOpenedType = dialogType;
|
417 |
-
|
|
|
418 |
if(isEdit == true){
|
|
|
|
|
|
|
419 |
actionTitle = g_objTexts.update_button;
|
420 |
|
421 |
var paramTitle = objData.name;
|
@@ -439,7 +443,6 @@ function UniteCreatorParamsDialog(){
|
|
439 |
//set wrapper type class
|
440 |
if(dialogType == "items"){
|
441 |
g_objWrapper.addClass("uc-param-type-item");
|
442 |
-
trace("add class");
|
443 |
}
|
444 |
else
|
445 |
g_objWrapper.removeClass("uc-param-type-item");
|
@@ -493,9 +496,7 @@ function UniteCreatorParamsDialog(){
|
|
493 |
title: dialogTitle,
|
494 |
modal:true,
|
495 |
open:function(){
|
496 |
-
|
497 |
-
triggerEvent(events.OPEN);
|
498 |
-
|
499 |
if(isEdit == false){
|
500 |
clearParamDialog();
|
501 |
g_objData = null;
|
@@ -514,6 +515,8 @@ function UniteCreatorParamsDialog(){
|
|
514 |
g_objParamName.focus();
|
515 |
}
|
516 |
|
|
|
|
|
517 |
}
|
518 |
});
|
519 |
|
@@ -1344,19 +1347,143 @@ function UniteCreatorParamsDialog(){
|
|
1344 |
function ____________CONDITIONS____________(){};
|
1345 |
|
1346 |
/**
|
1347 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1348 |
*/
|
1349 |
-
function
|
1350 |
|
1351 |
var objSelects = g_objWrapper.find(".uc-dialog-condition-attribute");
|
|
|
|
|
1352 |
|
1353 |
if(objSelects.length == 0)
|
1354 |
return(false);
|
1355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1356 |
var arrParams = g_objParent.getControlParams(g_currentOpenedType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1357 |
|
1358 |
-
|
1359 |
|
|
|
1360 |
}
|
1361 |
|
1362 |
|
@@ -1370,7 +1497,10 @@ function UniteCreatorParamsDialog(){
|
|
1370 |
if(objTableConditions.length == 0)
|
1371 |
return(false);
|
1372 |
|
1373 |
-
onEvent(events.OPEN,
|
|
|
|
|
|
|
1374 |
}
|
1375 |
|
1376 |
function ____________EVENTS____________(){};
|
5 |
var t = this;
|
6 |
var g_objWrapper, g_objSelectType, g_objTabContentWrapper, g_objLeftArea, g_objRightArea;
|
7 |
var g_objError, g_objParamTitle, g_objParamName;
|
8 |
+
var g_objTexts, g_objParent, g_objData, g_objSettings, g_currentOpenedType, g_currentOpenedName;
|
9 |
|
10 |
var g_arrSpecialInputs = {}; //array of special inputs
|
11 |
|
414 |
var paramType = null;
|
415 |
|
416 |
g_currentOpenedType = dialogType;
|
417 |
+
g_currentOpenedName = null;
|
418 |
+
|
419 |
if(isEdit == true){
|
420 |
+
|
421 |
+
g_currentOpenedName = objData.name;
|
422 |
+
|
423 |
actionTitle = g_objTexts.update_button;
|
424 |
|
425 |
var paramTitle = objData.name;
|
443 |
//set wrapper type class
|
444 |
if(dialogType == "items"){
|
445 |
g_objWrapper.addClass("uc-param-type-item");
|
|
|
446 |
}
|
447 |
else
|
448 |
g_objWrapper.removeClass("uc-param-type-item");
|
496 |
title: dialogTitle,
|
497 |
modal:true,
|
498 |
open:function(){
|
499 |
+
|
|
|
|
|
500 |
if(isEdit == false){
|
501 |
clearParamDialog();
|
502 |
g_objData = null;
|
515 |
g_objParamName.focus();
|
516 |
}
|
517 |
|
518 |
+
triggerEvent(events.OPEN);
|
519 |
+
|
520 |
}
|
521 |
});
|
522 |
|
1347 |
function ____________CONDITIONS____________(){};
|
1348 |
|
1349 |
/**
|
1350 |
+
* on select change conditions attribute
|
1351 |
+
* fill condition values select
|
1352 |
+
*/
|
1353 |
+
function onSelectConditionsAttributeChange(){
|
1354 |
+
|
1355 |
+
var objSelect = jQuery(this);
|
1356 |
+
|
1357 |
+
var paramName = objSelect.val();
|
1358 |
+
|
1359 |
+
var objRow = objSelect.parents("tr");
|
1360 |
+
var objSelectValues = objRow.find(".uc-dialog-condition-value");
|
1361 |
+
|
1362 |
+
var isInitValues = objSelect.data("init_value");
|
1363 |
+
objSelect.data("init_value",false);
|
1364 |
+
|
1365 |
+
objSelectValues.html("");
|
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
|
1373 |
+
if(!paramName || !objParam){
|
1374 |
+
objRow.addClass("uc-no-attribute-selected");
|
1375 |
+
return(false);
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
objRow.removeClass("uc-no-attribute-selected");
|
1379 |
+
|
1380 |
+
//fill values select
|
1381 |
+
var options = g_ucAdmin.getVal(objParam, "options");
|
1382 |
+
|
1383 |
+
var selectName = objSelectValues.prop("name");
|
1384 |
+
|
1385 |
+
var currentValue = null;
|
1386 |
+
|
1387 |
+
if(isInitValues === true)
|
1388 |
+
var currentValue = g_ucAdmin.getVal(g_objData, selectName);
|
1389 |
+
|
1390 |
+
var isExists = false;
|
1391 |
+
|
1392 |
+
jQuery.each(options,function(text, value){
|
1393 |
+
|
1394 |
+
if(currentValue === null)
|
1395 |
+
currentValue = value;
|
1396 |
+
|
1397 |
+
if(currentValue === value)
|
1398 |
+
isExists = true;
|
1399 |
+
|
1400 |
+
g_ucAdmin.addOptionToSelect(objSelectValues, value, text);
|
1401 |
+
});
|
1402 |
+
|
1403 |
+
if(currentValue && isExists == true)
|
1404 |
+
objSelectValues.val(currentValue);
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
|
1408 |
+
/**
|
1409 |
+
* fill conditions select row
|
1410 |
+
*/
|
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 = "";
|
1418 |
+
|
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");
|
1426 |
+
var title = g_ucAdmin.getVal(param, "title");
|
1427 |
+
|
1428 |
+
if(name == g_currentOpenedName)
|
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 |
+
|
1439 |
+
},100);
|
1440 |
+
|
1441 |
+
|
1442 |
+
|
1443 |
+
}
|
1444 |
+
|
1445 |
+
|
1446 |
+
/**
|
1447 |
+
* fill conditions selects
|
1448 |
*/
|
1449 |
+
function fillConditionsSelects(arrParams){
|
1450 |
|
1451 |
var objSelects = g_objWrapper.find(".uc-dialog-condition-attribute");
|
1452 |
+
if(objSelects.length == 0)
|
1453 |
+
return(false);
|
1454 |
|
1455 |
if(objSelects.length == 0)
|
1456 |
return(false);
|
1457 |
+
|
1458 |
+
jQuery.each(objSelects, function(index, select){
|
1459 |
+
var objSelect = jQuery(select);
|
1460 |
+
|
1461 |
+
fillConditionSelectRow(objSelect, arrParams);
|
1462 |
+
});
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
/**
|
1466 |
+
* if no params - set empty class. if params exists - fill the selects
|
1467 |
+
*/
|
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 |
+
|
1475 |
+
//show empty mode
|
1476 |
+
if(hasParams == false){
|
1477 |
+
objSelects.html("");
|
1478 |
+
objConditionsWrapper.addClass("uc-noparents-mode");
|
1479 |
+
return(false);
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
objConditionsWrapper.removeClass("uc-noparents-mode");
|
1483 |
|
1484 |
+
g_objWrapper.data("condition_params", arrParams);
|
1485 |
|
1486 |
+
fillConditionsSelects(arrParams);
|
1487 |
}
|
1488 |
|
1489 |
|
1497 |
if(objTableConditions.length == 0)
|
1498 |
return(false);
|
1499 |
|
1500 |
+
onEvent(events.OPEN, handleConditionsOnOpen);
|
1501 |
+
|
1502 |
+
g_objWrapper.on("change",".uc-dialog-condition-attribute", onSelectConditionsAttributeChange);
|
1503 |
+
|
1504 |
}
|
1505 |
|
1506 |
function ____________EVENTS____________(){};
|
js/unitecreator_params_editor.js
CHANGED
@@ -250,6 +250,7 @@ function UniteCreatorParamsEditor(){
|
|
250 |
var textRowAdd = "";
|
251 |
var linkClass = "";
|
252 |
var linkTitle = "";
|
|
|
253 |
if(paramError){
|
254 |
linkTitle = "title='"+paramError+"'";
|
255 |
linkClass = " unite-color-red";
|
@@ -257,11 +258,47 @@ function UniteCreatorParamsEditor(){
|
|
257 |
}
|
258 |
|
259 |
var isAdminLabel = g_ucAdmin.getVal(objParam, "admin_label", false, g_ucAdmin.getvalopt.FORCE_BOOLEAN);
|
|
|
260 |
var adminLabelClass = (isAdminLabel == true)?" label-active":"";
|
|
|
|
|
|
|
261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
html += " <td class='uc-hide-on-movemode'><div class='uc-table-row-handle'></div><div class='uc-table-admin-label"+adminLabelClass+"' title='Admin Label'></div></td>";
|
263 |
html += " <td class='uc-show-on-movemode'> <input type='checkbox' class='uc-check-param-move' data-name='" + objParam.name + "'> </td>";
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
html += " <td "+textRowAdd+">" + objParam.name + "</td>";
|
266 |
html += " <td "+textRowAdd+">" + typeTitle + "</td>";
|
267 |
html += " <td>"
|
@@ -1328,10 +1365,15 @@ function UniteCreatorParamsEditor(){
|
|
1328 |
if(!catID)
|
1329 |
catID = currentCatID;
|
1330 |
|
|
|
|
|
|
|
|
|
1331 |
objRow.data("catid", catID);
|
1332 |
|
1333 |
if(catID != currentCatID && objCatIDs.hasOwnProperty(catID))
|
1334 |
objRow.hide();
|
|
|
1335 |
}
|
1336 |
|
1337 |
g_objLastParam = objParam;
|
250 |
var textRowAdd = "";
|
251 |
var linkClass = "";
|
252 |
var linkTitle = "";
|
253 |
+
|
254 |
if(paramError){
|
255 |
linkTitle = "title='"+paramError+"'";
|
256 |
linkClass = " unite-color-red";
|
258 |
}
|
259 |
|
260 |
var isAdminLabel = g_ucAdmin.getVal(objParam, "admin_label", false, g_ucAdmin.getvalopt.FORCE_BOOLEAN);
|
261 |
+
|
262 |
var adminLabelClass = (isAdminLabel == true)?" label-active":"";
|
263 |
+
|
264 |
+
//conditoin
|
265 |
+
var enableCondition = g_ucAdmin.getVal(objParam, "enable_condition", false, g_ucAdmin.getvalopt.FORCE_BOOLEAN);
|
266 |
|
267 |
+
var conditionText = null;
|
268 |
+
|
269 |
+
if(enableCondition == true){
|
270 |
+
var conditionAttribute = g_ucAdmin.getVal(objParam, "condition_attribute");
|
271 |
+
if(!conditionAttribute)
|
272 |
+
enableCondition = false;
|
273 |
+
|
274 |
+
var conditionOperator = g_ucAdmin.getVal(objParam, "condition_operator");
|
275 |
+
var conditionValue = g_ucAdmin.getVal(objParam, "condition_value");
|
276 |
+
|
277 |
+
conditionText = conditionAttribute;
|
278 |
+
|
279 |
+
if(conditionOperator == "equal")
|
280 |
+
conditionText += " = ";
|
281 |
+
else
|
282 |
+
conditionText += " != ";
|
283 |
+
|
284 |
+
conditionText += conditionValue;
|
285 |
+
if(!conditionValue)
|
286 |
+
conditionText += "'["+g_uctext["empty_text"]+"]'";
|
287 |
+
}
|
288 |
+
|
289 |
+
//icon move
|
290 |
html += " <td class='uc-hide-on-movemode'><div class='uc-table-row-handle'></div><div class='uc-table-admin-label"+adminLabelClass+"' title='Admin Label'></div></td>";
|
291 |
html += " <td class='uc-show-on-movemode'> <input type='checkbox' class='uc-check-param-move' data-name='" + objParam.name + "'> </td>";
|
292 |
+
|
293 |
+
//title link
|
294 |
+
html += " <td>";
|
295 |
+
html += "<a class='uc-button-edit-param"+linkClass+"' "+linkTitle+" href='javascript:void(0)'>" + objParam.title + "</a>";
|
296 |
+
|
297 |
+
if(enableCondition)
|
298 |
+
html += "<div class='uc-text-condition' title='"+g_uctext["display_condition"]+"'>" + conditionText + "</div>";
|
299 |
+
|
300 |
+
html += "</td>";
|
301 |
+
|
302 |
html += " <td "+textRowAdd+">" + objParam.name + "</td>";
|
303 |
html += " <td "+textRowAdd+">" + typeTitle + "</td>";
|
304 |
html += " <td>"
|
1365 |
if(!catID)
|
1366 |
catID = currentCatID;
|
1367 |
|
1368 |
+
//if wrong category - update the param for current category
|
1369 |
+
if(objCatIDs.hasOwnProperty(catID) == false)
|
1370 |
+
catID = currentCatID;
|
1371 |
+
|
1372 |
objRow.data("catid", catID);
|
1373 |
|
1374 |
if(catID != currentCatID && objCatIDs.hasOwnProperty(catID))
|
1375 |
objRow.hide();
|
1376 |
+
|
1377 |
}
|
1378 |
|
1379 |
g_objLastParam = objParam;
|
provider/core/plugins/unlimited_elements/elementor/dynamic_tags/tag_current_timestamp.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use Elementor\Controls_Manager;
|
4 |
+
use ElementorPro\Modules\DynamicTags\Tags\Base\Tag;
|
5 |
+
use ElementorPro\Modules\DynamicTags\Module;
|
6 |
+
|
7 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
+
exit; // Exit if accessed directly
|
9 |
+
}
|
10 |
+
|
11 |
+
class UnlimitedElementsDynamicTag_TimeStamp extends Tag {
|
12 |
+
|
13 |
+
public function get_name() {
|
14 |
+
return 'uc-current-timestamp';
|
15 |
+
}
|
16 |
+
|
17 |
+
public function get_title() {
|
18 |
+
return __( 'Current Time Stamp', 'unlimited-elements-for-elementor' );
|
19 |
+
}
|
20 |
+
|
21 |
+
public function get_group() {
|
22 |
+
return Module::SITE_GROUP;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function get_categories() {
|
26 |
+
return [ Module::TEXT_CATEGORY ];
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
public function render() {
|
31 |
+
|
32 |
+
$stamp = time();
|
33 |
+
|
34 |
+
echo $stamp;
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php
CHANGED
@@ -26,6 +26,7 @@ class UniteCreatorElementorIntegrate{
|
|
26 |
|
27 |
private $pathPlugin;
|
28 |
private $pathControls;
|
|
|
29 |
private $arrAddons;
|
30 |
|
31 |
private $arrCatsRecords = array();
|
@@ -65,6 +66,7 @@ class UniteCreatorElementorIntegrate{
|
|
65 |
|
66 |
$this->pathPlugin = __DIR__."/";
|
67 |
$this->pathControls = $this->pathPlugin."controls/";
|
|
|
68 |
|
69 |
self::$isLogMemory = $this->getIsLogMemory();
|
70 |
|
@@ -475,7 +477,19 @@ class UniteCreatorElementorIntegrate{
|
|
475 |
self::logMemoryUsage("End registering widget controls, num registered: ".UniteCreatorElementorIntegrate::$counterControls, true);
|
476 |
|
477 |
}
|
478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
/**
|
480 |
* collect posts widget names by record
|
481 |
* for later pagination enable check
|
@@ -1417,6 +1431,8 @@ class UniteCreatorElementorIntegrate{
|
|
1417 |
|
1418 |
add_action('elementor/frontend/after_enqueue_scripts', array($this, 'onFrontendAfterRegisterControls'));
|
1419 |
|
|
|
|
|
1420 |
if($enableBackgrounds == true)
|
1421 |
$this->initBackgroundWidgets();
|
1422 |
|
26 |
|
27 |
private $pathPlugin;
|
28 |
private $pathControls;
|
29 |
+
private $pathDynamicTags;
|
30 |
private $arrAddons;
|
31 |
|
32 |
private $arrCatsRecords = array();
|
66 |
|
67 |
$this->pathPlugin = __DIR__."/";
|
68 |
$this->pathControls = $this->pathPlugin."controls/";
|
69 |
+
$this->pathDynamicTags = $this->pathPlugin."dynamic_tags/";
|
70 |
|
71 |
self::$isLogMemory = $this->getIsLogMemory();
|
72 |
|
477 |
self::logMemoryUsage("End registering widget controls, num registered: ".UniteCreatorElementorIntegrate::$counterControls, true);
|
478 |
|
479 |
}
|
480 |
+
|
481 |
+
/**
|
482 |
+
* register dynamic tags
|
483 |
+
*/
|
484 |
+
public function onRegisterDynamicTags($dynamicTags){
|
485 |
+
|
486 |
+
//add hr control
|
487 |
+
require $this->pathDynamicTags."tag_current_timestamp.php";
|
488 |
+
|
489 |
+
$dynamicTags->register_tag("UnlimitedElementsDynamicTag_TimeStamp");
|
490 |
+
|
491 |
+
}
|
492 |
+
|
493 |
/**
|
494 |
* collect posts widget names by record
|
495 |
* for later pagination enable check
|
1431 |
|
1432 |
add_action('elementor/frontend/after_enqueue_scripts', array($this, 'onFrontendAfterRegisterControls'));
|
1433 |
|
1434 |
+
//add_action("elementor/dynamic_tags/register_tags", array($this, "onRegisterDynamicTags"));
|
1435 |
+
|
1436 |
if($enableBackgrounds == true)
|
1437 |
$this->initBackgroundWidgets();
|
1438 |
|
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php
CHANGED
@@ -246,7 +246,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
246 |
* put scripts
|
247 |
*/
|
248 |
public function get_script_depends() {
|
249 |
-
|
250 |
$isEditMode = $this->isEditMode();
|
251 |
|
252 |
if($isEditMode == true)
|
@@ -521,6 +521,28 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
521 |
return($arrValue);
|
522 |
}
|
523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
|
525 |
/**
|
526 |
* get control array from param
|
@@ -544,6 +566,13 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
544 |
$description = trim($description);
|
545 |
$placeholder = trim($placeholder);
|
546 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
if(isset($param["value"]))
|
548 |
$value = $param["value"];
|
549 |
|
@@ -1222,8 +1251,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1222 |
$arrControl["condition"] = $elementorCondition;
|
1223 |
}
|
1224 |
|
1225 |
-
|
1226 |
-
|
1227 |
//label block
|
1228 |
if($labelBlock === true)
|
1229 |
$arrControl["label_block"] = true;
|
@@ -1427,6 +1454,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1427 |
*/
|
1428 |
private function addImageSizesControl($paramImage, $objControls){
|
1429 |
|
|
|
1430 |
$title = UniteFunctionsUC::getVal($paramImage, "title");
|
1431 |
$name = UniteFunctionsUC::getVal($paramImage, "name");
|
1432 |
|
@@ -1436,8 +1464,16 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1436 |
|
1437 |
$param = array();
|
1438 |
$param["type"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
1439 |
-
|
1440 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1441 |
$param["options"] = $arrSizes;
|
1442 |
$param["default_value"] = "medium_large";
|
1443 |
|
@@ -1607,7 +1643,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1607 |
/**
|
1608 |
* add advanced section widget controls
|
1609 |
*/
|
1610 |
-
protected function addAdvancedSectionControls(){
|
1611 |
|
1612 |
$this->start_controls_section("unlimited_advanced_features", array(
|
1613 |
"label"=>__("Advanced", 'unlimited_elements'),
|
@@ -1630,6 +1666,37 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1630 |
)
|
1631 |
);
|
1632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1633 |
do_action("ue_widget_advanced_controls", $this);
|
1634 |
|
1635 |
$this->end_controls_section();
|
@@ -1779,6 +1846,13 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1779 |
if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
|
1780 |
$hasPostsList = true;
|
1781 |
$postListParam = $param;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1782 |
continue;
|
1783 |
}
|
1784 |
|
@@ -1847,7 +1921,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1847 |
$this->addPaginationControls();
|
1848 |
|
1849 |
//add debug controls
|
1850 |
-
$this->addAdvancedSectionControls();
|
1851 |
|
1852 |
}
|
1853 |
|
@@ -2726,8 +2800,12 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2726 |
$isShowDebugData = UniteFunctionsUC::getVal($arrValues, "show_widget_debug_data");
|
2727 |
$isShowDebugData = UniteFunctionsUC::strToBool($isShowDebugData);
|
2728 |
|
2729 |
-
if($isShowDebugData == true)
|
2730 |
-
|
|
|
|
|
|
|
|
|
2731 |
|
2732 |
$output->initByAddon($objAddon);
|
2733 |
|
246 |
* put scripts
|
247 |
*/
|
248 |
public function get_script_depends() {
|
249 |
+
|
250 |
$isEditMode = $this->isEditMode();
|
251 |
|
252 |
if($isEditMode == true)
|
521 |
return($arrValue);
|
522 |
}
|
523 |
|
524 |
+
/**
|
525 |
+
* get elementor condition from the param
|
526 |
+
*/
|
527 |
+
private function getControlArrayUC_getCondition($param){
|
528 |
+
|
529 |
+
$conditionAttribute = UniteFunctionsUC::getVal($param, "condition_attribute");
|
530 |
+
$conditionOperator = UniteFunctionsUC::getVal($param, "condition_operator");
|
531 |
+
$conditionValue = UniteFunctionsUC::getVal($param, "condition_value");
|
532 |
+
|
533 |
+
if(empty($conditionAttribute))
|
534 |
+
return(null);
|
535 |
+
|
536 |
+
$arrCondition = array();
|
537 |
+
|
538 |
+
if($conditionAttribute == "not_equal")
|
539 |
+
$conditionValue = "!".$conditionValue;
|
540 |
+
|
541 |
+
$arrCondition[$conditionAttribute] = $conditionValue;
|
542 |
+
|
543 |
+
return($arrCondition);
|
544 |
+
}
|
545 |
+
|
546 |
|
547 |
/**
|
548 |
* get control array from param
|
566 |
$description = trim($description);
|
567 |
$placeholder = trim($placeholder);
|
568 |
|
569 |
+
$enableCondition = UniteFunctionsUC::getVal($param, "enable_condition");
|
570 |
+
$enableCondition = UniteFunctionsUC::strToBool($enableCondition);
|
571 |
+
|
572 |
+
//set condition
|
573 |
+
if(empty($elementorCondition) && $enableCondition == true)
|
574 |
+
$elementorCondition = $this->getControlArrayUC_getCondition($param);
|
575 |
+
|
576 |
if(isset($param["value"]))
|
577 |
$value = $param["value"];
|
578 |
|
1251 |
$arrControl["condition"] = $elementorCondition;
|
1252 |
}
|
1253 |
|
|
|
|
|
1254 |
//label block
|
1255 |
if($labelBlock === true)
|
1256 |
$arrControl["label_block"] = true;
|
1454 |
*/
|
1455 |
private function addImageSizesControl($paramImage, $objControls){
|
1456 |
|
1457 |
+
$type = UniteFunctionsUC::getVal($paramImage, "type");
|
1458 |
$title = UniteFunctionsUC::getVal($paramImage, "title");
|
1459 |
$name = UniteFunctionsUC::getVal($paramImage, "name");
|
1460 |
|
1464 |
|
1465 |
$param = array();
|
1466 |
$param["type"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
1467 |
+
|
1468 |
+
if($type == UniteCreatorDialogParam::PARAM_POSTS_LIST){
|
1469 |
+
$param["title"] = $title .= " ".__("Image Size","unlimited-elements-for-elementor");
|
1470 |
+
$param["name"] = $name .= "_imagesize";
|
1471 |
+
}
|
1472 |
+
else{
|
1473 |
+
$param["title"] = $title .= " ".__("Size","unlimited-elements-for-elementor");
|
1474 |
+
$param["name"] = $name .= "_size";
|
1475 |
+
}
|
1476 |
+
|
1477 |
$param["options"] = $arrSizes;
|
1478 |
$param["default_value"] = "medium_large";
|
1479 |
|
1643 |
/**
|
1644 |
* add advanced section widget controls
|
1645 |
*/
|
1646 |
+
protected function addAdvancedSectionControls($hasPostsList = false, $isItemsEnabled = false){
|
1647 |
|
1648 |
$this->start_controls_section("unlimited_advanced_features", array(
|
1649 |
"label"=>__("Advanced", 'unlimited_elements'),
|
1666 |
)
|
1667 |
);
|
1668 |
|
1669 |
+
$debugTypeOptions = array();
|
1670 |
+
$debugTypeOptions["default"] = __( 'Default', 'unlimited-elements-for-elementor' );
|
1671 |
+
|
1672 |
+
if($hasPostsList == true)
|
1673 |
+
$isItemsEnabled = true;
|
1674 |
+
|
1675 |
+
if($isItemsEnabled == true)
|
1676 |
+
$debugTypeOptions["items_only"] = __( 'Items Only', 'unlimited-elements-for-elementor' );
|
1677 |
+
|
1678 |
+
if($hasPostsList == true){
|
1679 |
+
$debugTypeOptions["post_titles"] = __( 'Posts Titles', 'unlimited-elements-for-elementor' );
|
1680 |
+
$debugTypeOptions["post_meta"] = __( 'Posts Titles and Meta', 'unlimited-elements-for-elementor' );
|
1681 |
+
}
|
1682 |
+
|
1683 |
+
$hasDebugType = (count($debugTypeOptions) > 1);
|
1684 |
+
|
1685 |
+
//show post enabled selection
|
1686 |
+
if($hasDebugType == true){
|
1687 |
+
|
1688 |
+
$this->add_control(
|
1689 |
+
'widget_debug_data_type',
|
1690 |
+
array(
|
1691 |
+
'label' => __( 'Debug Data Type', 'unlimited-elements-for-elementor' ),
|
1692 |
+
'type' => Controls_Manager::SELECT,
|
1693 |
+
'default' => 'default',
|
1694 |
+
'condition'=>array("show_widget_debug_data"=>"true"),
|
1695 |
+
'options' => $debugTypeOptions,
|
1696 |
+
)
|
1697 |
+
);
|
1698 |
+
}
|
1699 |
+
|
1700 |
do_action("ue_widget_advanced_controls", $this);
|
1701 |
|
1702 |
$this->end_controls_section();
|
1846 |
if($type === UniteCreatorDialogParam::PARAM_POSTS_LIST){
|
1847 |
$hasPostsList = true;
|
1848 |
$postListParam = $param;
|
1849 |
+
|
1850 |
+
$showImageSizes = UniteFunctionsUC::getVal($postListParam, "show_image_sizes");
|
1851 |
+
$showImageSizes = UniteFunctionsUC::strToBool($showImageSizes);
|
1852 |
+
|
1853 |
+
if($showImageSizes == true)
|
1854 |
+
$this->addImageSizesControl($postListParam, $this->objControls);
|
1855 |
+
|
1856 |
continue;
|
1857 |
}
|
1858 |
|
1921 |
$this->addPaginationControls();
|
1922 |
|
1923 |
//add debug controls
|
1924 |
+
$this->addAdvancedSectionControls($hasPostsList, $isItemsEnabled);
|
1925 |
|
1926 |
}
|
1927 |
|
2800 |
$isShowDebugData = UniteFunctionsUC::getVal($arrValues, "show_widget_debug_data");
|
2801 |
$isShowDebugData = UniteFunctionsUC::strToBool($isShowDebugData);
|
2802 |
|
2803 |
+
if($isShowDebugData == true){
|
2804 |
+
|
2805 |
+
$debugDataType = UniteFunctionsUC::getVal($arrValues, "widget_debug_data_type");
|
2806 |
+
|
2807 |
+
$output->showDebugData(true, $debugDataType);
|
2808 |
+
}
|
2809 |
|
2810 |
$output->initByAddon($objAddon);
|
2811 |
|
provider/functions_wordpress.class.php
CHANGED
@@ -927,6 +927,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
927 |
$arr[self::SORTBY_NONE] = __("Unsorted", "unlimited-elements-for-elementor");
|
928 |
$arr[self::SORTBY_MENU_ORDER] = __("Menu Order", "unlimited-elements-for-elementor");
|
929 |
$arr[self::SORTBY_PARENT] = __("Parent Post", "unlimited-elements-for-elementor");
|
|
|
|
|
930 |
$arr[self::SORTBY_META_VALUE] = __("Custom Field Value", "unlimited-elements-for-elementor");
|
931 |
$arr[self::SORTBY_META_VALUE_NUM] = __("Custom Field Value (numeric)", "unlimited-elements-for-elementor");
|
932 |
|
@@ -1955,6 +1957,32 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1955 |
|
1956 |
public static function a__________ATTACHMENT________(){}
|
1957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1958 |
/**
|
1959 |
* get post thumb id from post id
|
1960 |
*/
|
@@ -1963,7 +1991,6 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1963 |
return($thumbID);
|
1964 |
}
|
1965 |
|
1966 |
-
|
1967 |
/**
|
1968 |
*
|
1969 |
* get attachment image url
|
927 |
$arr[self::SORTBY_NONE] = __("Unsorted", "unlimited-elements-for-elementor");
|
928 |
$arr[self::SORTBY_MENU_ORDER] = __("Menu Order", "unlimited-elements-for-elementor");
|
929 |
$arr[self::SORTBY_PARENT] = __("Parent Post", "unlimited-elements-for-elementor");
|
930 |
+
$arr["post__in"] = __("Preserve Posts In Order", "unlimited-elements-for-elementor");
|
931 |
+
|
932 |
$arr[self::SORTBY_META_VALUE] = __("Custom Field Value", "unlimited-elements-for-elementor");
|
933 |
$arr[self::SORTBY_META_VALUE_NUM] = __("Custom Field Value (numeric)", "unlimited-elements-for-elementor");
|
934 |
|
1957 |
|
1958 |
public static function a__________ATTACHMENT________(){}
|
1959 |
|
1960 |
+
/**
|
1961 |
+
* get first image id from content
|
1962 |
+
*/
|
1963 |
+
public static function getFirstImageIDFromContent($content){
|
1964 |
+
|
1965 |
+
$strSearch = "class=\"wp-image-";
|
1966 |
+
|
1967 |
+
$posImageClass = strpos($content, $strSearch);
|
1968 |
+
|
1969 |
+
if($posImageClass === false)
|
1970 |
+
return(null);
|
1971 |
+
|
1972 |
+
$posSearch2 = $posImageClass + strlen($strSearch);
|
1973 |
+
|
1974 |
+
$posIDEnd = strpos($content, "\"", $posSearch2);
|
1975 |
+
|
1976 |
+
if($posIDEnd === false)
|
1977 |
+
return(null);
|
1978 |
+
|
1979 |
+
$imageID = substr($content, $posSearch2, $posIDEnd-$posSearch2);
|
1980 |
+
|
1981 |
+
$imageID = (int)$imageID;
|
1982 |
+
|
1983 |
+
return($imageID);
|
1984 |
+
}
|
1985 |
+
|
1986 |
/**
|
1987 |
* get post thumb id from post id
|
1988 |
*/
|
1991 |
return($thumbID);
|
1992 |
}
|
1993 |
|
|
|
1994 |
/**
|
1995 |
*
|
1996 |
* get attachment image url
|
provider/integrations.class.php
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Unlimited Elements
|
5 |
+
* @author UniteCMS http://unitecms.net
|
6 |
+
* @copyright Copyright (c) 2016 UniteCMS
|
7 |
+
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
8 |
+
*/
|
9 |
+
|
10 |
+
//no direct accees
|
11 |
+
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
12 |
+
|
13 |
+
class UniteCreatorPluginIntegrations{
|
14 |
+
|
15 |
+
/* wp popular posts */
|
16 |
+
|
17 |
+
/**
|
18 |
+
* return if exists wp popular posts
|
19 |
+
*/
|
20 |
+
public static function isWPPopularPostsExists(){
|
21 |
+
|
22 |
+
$isExists = defined("WPP_VERSION") && defined("WPP_MIN_PHP_VERSION");
|
23 |
+
|
24 |
+
return($isExists);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* get popular posts
|
29 |
+
* args - post_type, cat, limit, range
|
30 |
+
*/
|
31 |
+
public function WPP_getPopularPosts($args, $addDebug = false){
|
32 |
+
|
33 |
+
$isExists = self::isWPPopularPostsExists();
|
34 |
+
|
35 |
+
if($isExists == false)
|
36 |
+
return(false);
|
37 |
+
|
38 |
+
$postType = UniteFunctionsUC::getVal($args, "post_type");
|
39 |
+
|
40 |
+
if(is_array($postType))
|
41 |
+
$postType = $postType[0];
|
42 |
+
|
43 |
+
if(empty($postType))
|
44 |
+
$postType = "post";
|
45 |
+
|
46 |
+
$limit = UniteFunctionsUC::getVal($args, "limit", 5);
|
47 |
+
$range = UniteFunctionsUC::getVal($args, "range", "last7days");
|
48 |
+
$cat = UniteFunctionsUC::getVal($args, "cat", "");
|
49 |
+
|
50 |
+
if(is_array($cat))
|
51 |
+
$cat = $cat[0];
|
52 |
+
|
53 |
+
$params = array();
|
54 |
+
$params["post_type"] = $postType;
|
55 |
+
$params["limit"] = $limit;
|
56 |
+
$params["range"] = $range;
|
57 |
+
|
58 |
+
if(!empty($cat))
|
59 |
+
$params["cat"] = $cat;
|
60 |
+
|
61 |
+
|
62 |
+
$query = new \WordPressPopularPosts\Query($params);
|
63 |
+
|
64 |
+
$arrPosts = $query->get_posts();
|
65 |
+
|
66 |
+
if(empty($arrPosts))
|
67 |
+
$arrPosts = array();
|
68 |
+
|
69 |
+
$arrPosts = UniteFunctionsUC::convertStdClassToArray($arrPosts);
|
70 |
+
|
71 |
+
$strDebug = "";
|
72 |
+
$arrPostIDs = array();
|
73 |
+
|
74 |
+
if($addDebug == true){
|
75 |
+
|
76 |
+
$strDebug .= "Popular posts query arguments:";
|
77 |
+
$strDebug .= "<pre>";
|
78 |
+
$strDebug .= print_r($params, true);
|
79 |
+
$strDebug .= "</pre>";
|
80 |
+
|
81 |
+
$numPosts = count($arrPosts);
|
82 |
+
if(!empty($numPosts))
|
83 |
+
$strDebug .= "Found $numPosts posts: <br>";
|
84 |
+
}
|
85 |
+
|
86 |
+
foreach($arrPosts as $index => $post){
|
87 |
+
|
88 |
+
$num = $index+1;
|
89 |
+
|
90 |
+
$id = UniteFunctionsUC::getVal($post, "id");
|
91 |
+
$title = UniteFunctionsUC::getVal($post, "title");
|
92 |
+
$pageviews = UniteFunctionsUC::getVal($post, "pageviews");
|
93 |
+
|
94 |
+
if($addDebug == true)
|
95 |
+
$strDebug .= "{$num}. $title ($id): $pageviews views <br>";
|
96 |
+
|
97 |
+
$arrPostIDs[] = $id;
|
98 |
+
}
|
99 |
+
|
100 |
+
if(empty($arrPosts) && $addDebug == true)
|
101 |
+
$strDebug .= "No popular posts found <br>";
|
102 |
+
|
103 |
+
//empty the selection if not found
|
104 |
+
if(empty($arrPostIDs))
|
105 |
+
$arrPostIDs = array("0");
|
106 |
+
|
107 |
+
$output = array();
|
108 |
+
$output["post_ids"] = $arrPostIDs;
|
109 |
+
$output["debug"] = $strDebug;
|
110 |
+
|
111 |
+
return($output);
|
112 |
+
|
113 |
+
|
114 |
+
// Return cached results
|
115 |
+
/*
|
116 |
+
if ( $this->config['tools']['cache']['active'] ) {
|
117 |
+
$key = 'wpp_' . md5(json_encode($params));
|
118 |
+
$query = \WordPressPopularPosts\Cache::get($key);
|
119 |
+
|
120 |
+
if ( false === $query ) {
|
121 |
+
$query = new Query($params);
|
122 |
+
|
123 |
+
$time_value = $this->config['tools']['cache']['interval']['value'];
|
124 |
+
$time_unit = $this->config['tools']['cache']['interval']['time'];
|
125 |
+
|
126 |
+
// No popular posts found, check again in 1 minute
|
127 |
+
if ( ! $query->get_posts() ) {
|
128 |
+
$time_value = 1;
|
129 |
+
$time_unit = 'minute';
|
130 |
+
}
|
131 |
+
|
132 |
+
\WordPressPopularPosts\Cache::set(
|
133 |
+
$key,
|
134 |
+
$query,
|
135 |
+
$time_value,
|
136 |
+
$time_unit
|
137 |
+
);
|
138 |
+
}
|
139 |
+
} // Get real-time popular posts
|
140 |
+
|
141 |
+
*/
|
142 |
+
|
143 |
+
return $query;
|
144 |
+
}
|
145 |
+
|
146 |
+
}
|
provider/provider_helper.class.php
CHANGED
@@ -17,6 +17,32 @@ class HelperProviderUC{
|
|
17 |
return($isActivated);
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
/**
|
22 |
* get date select
|
17 |
return($isActivated);
|
18 |
}
|
19 |
|
20 |
+
/**
|
21 |
+
* get data for meta compare select
|
22 |
+
*/
|
23 |
+
public static function getArrMetaCompareSelect(){
|
24 |
+
|
25 |
+
$arrItems = array();
|
26 |
+
$arrItems["="] = "Equals";
|
27 |
+
$arrItems["!="] = "Not Equals";
|
28 |
+
$arrItems[">"] = "More Then";
|
29 |
+
$arrItems["<"] = "Less Then";
|
30 |
+
$arrItems[">="] = "More Or Equal";
|
31 |
+
$arrItems["<="] = "Less Or Equal";
|
32 |
+
$arrItems["LIKE"] = "LIKE";
|
33 |
+
$arrItems["NOT LIKE"] = "NOT LIKE";
|
34 |
+
|
35 |
+
$arrItems["IN"] = "IN";
|
36 |
+
$arrItems["NOT IN"] = "NOT IN";
|
37 |
+
$arrItems["BETWEEN"] = "BETWEEN";
|
38 |
+
$arrItems["NOT BETWEEN"] = "NOT BETWEEN";
|
39 |
+
|
40 |
+
$arrItems["EXISTS"] = "EXISTS";
|
41 |
+
$arrItems["NOT EXISTS"] = "NOT EXISTS";
|
42 |
+
|
43 |
+
return($arrItems);
|
44 |
+
}
|
45 |
+
|
46 |
|
47 |
/**
|
48 |
* get date select
|
provider/provider_params_processor.class.php
CHANGED
@@ -97,7 +97,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
97 |
$thumbHeight = UniteFunctionsUC::getVal($arrSize, "height");
|
98 |
|
99 |
$thumbWidth = trim($thumbWidth);
|
100 |
-
|
101 |
$urlThumb = UniteFunctionsWPUC::getUrlAttachmentImage($imageID, $size);
|
102 |
if(empty($urlThumb))
|
103 |
$urlThumb = $urlFull;
|
@@ -347,7 +347,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
347 |
/**
|
348 |
* get post data
|
349 |
*/
|
350 |
-
private function getPostDataByObj($post, $arrPostAdditions = array()){
|
351 |
|
352 |
try{
|
353 |
|
@@ -360,9 +360,12 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
360 |
$arrData["title"] = UniteFunctionsUC::getVal($arrPost, "post_title");
|
361 |
$arrData["alias"] = UniteFunctionsUC::getVal($arrPost, "post_name");
|
362 |
$arrData["author_id"] = UniteFunctionsUC::getVal($arrPost, "post_author");
|
363 |
-
$arrData["content"] = UniteFunctionsUC::getVal($arrPost, "post_content");
|
364 |
-
$arrData["link"] = UniteFunctionsWPUC::getPermalink($post);
|
365 |
|
|
|
|
|
|
|
|
|
|
|
366 |
|
367 |
//get intro
|
368 |
$intro = UniteFunctionsUC::getVal($arrPost, "post_excerpt");
|
@@ -398,8 +401,32 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
398 |
|
399 |
$featuredImageID = UniteFunctionsWPUC::getFeaturedImageID($postID);
|
400 |
|
401 |
-
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
if(is_array($arrPostAdditions) == false)
|
405 |
$arrPostAdditions = array();
|
@@ -886,6 +913,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
886 |
$arrProductsCrossSells = array();
|
887 |
$arrIDsOnSale = array();
|
888 |
$arrRecentProducts = array();
|
|
|
889 |
|
890 |
foreach($arrIncludeBy as $includeby){
|
891 |
|
@@ -976,25 +1004,91 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
976 |
}
|
977 |
|
978 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
979 |
}
|
980 |
|
981 |
}
|
982 |
|
983 |
//include id's
|
984 |
$arrPostInIDs = UniteFunctionsUC::mergeArraysUnique($arrProductsCrossSells, $arrProductsUpSells, $arrRecentProducts);
|
985 |
-
|
986 |
if(!empty($arrIDsOnSale)){
|
987 |
|
988 |
if(!empty($arrPostInIDs)) //intersect with previous id's
|
989 |
$arrPostInIDs = array_intersect($arrPostInIDs, $arrIDsOnSale);
|
990 |
else
|
991 |
$arrPostInIDs = $arrIDsOnSale;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
992 |
|
|
|
|
|
|
|
993 |
}
|
994 |
|
995 |
if(!empty($arrPostInIDs))
|
996 |
$args["post__in"] = $arrPostInIDs;
|
997 |
|
|
|
998 |
//------ get woo related products ------
|
999 |
|
1000 |
if($getRelatedProducts == true){
|
@@ -1029,8 +1123,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1029 |
$args["suppress_filters"] = false;
|
1030 |
|
1031 |
//add post status
|
1032 |
-
$arrStatuses = UniteFunctionsUC::getVal($value, "{$name}
|
1033 |
-
|
1034 |
if(empty($arrStatuses))
|
1035 |
$arrStatuses = "publish";
|
1036 |
|
@@ -1328,15 +1422,28 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1328 |
|
1329 |
$useCategory = UniteFunctionsUC::getVal($param, "use_category");
|
1330 |
$useCategory = UniteFunctionsUC::strToBool($useCategory);
|
1331 |
-
|
1332 |
-
$arrPostAdditions = HelperProviderUC::getPostDataAdditions($useCustomFields, $useCategory);
|
1333 |
|
|
|
|
|
1334 |
HelperUC::addDebug("post additions", $arrPostAdditions);
|
1335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1336 |
$arrData = array();
|
1337 |
foreach($arrPosts as $post){
|
1338 |
|
1339 |
-
$arrData[] = $this->getPostDataByObj($post, $arrPostAdditions);
|
1340 |
}
|
1341 |
|
1342 |
|
97 |
$thumbHeight = UniteFunctionsUC::getVal($arrSize, "height");
|
98 |
|
99 |
$thumbWidth = trim($thumbWidth);
|
100 |
+
|
101 |
$urlThumb = UniteFunctionsWPUC::getUrlAttachmentImage($imageID, $size);
|
102 |
if(empty($urlThumb))
|
103 |
$urlThumb = $urlFull;
|
347 |
/**
|
348 |
* get post data
|
349 |
*/
|
350 |
+
private function getPostDataByObj($post, $arrPostAdditions = array(), $arrImageSizes = null){
|
351 |
|
352 |
try{
|
353 |
|
360 |
$arrData["title"] = UniteFunctionsUC::getVal($arrPost, "post_title");
|
361 |
$arrData["alias"] = UniteFunctionsUC::getVal($arrPost, "post_name");
|
362 |
$arrData["author_id"] = UniteFunctionsUC::getVal($arrPost, "post_author");
|
|
|
|
|
363 |
|
364 |
+
$content = UniteFunctionsUC::getVal($arrPost, "post_content");
|
365 |
+
|
366 |
+
$arrData["content"] = $content;
|
367 |
+
|
368 |
+
$arrData["link"] = UniteFunctionsWPUC::getPermalink($post);
|
369 |
|
370 |
//get intro
|
371 |
$intro = UniteFunctionsUC::getVal($arrPost, "post_excerpt");
|
401 |
|
402 |
$featuredImageID = UniteFunctionsWPUC::getFeaturedImageID($postID);
|
403 |
|
404 |
+
//try to get featured image from content
|
405 |
+
if(empty($featuredImageID)){
|
406 |
+
|
407 |
+
$imageID = UniteFunctionsWPUC::getFirstImageIDFromContent($content);
|
408 |
+
|
409 |
+
if(!empty($imageID))
|
410 |
+
$featuredImageID = $imageID;
|
411 |
+
}
|
412 |
+
|
413 |
+
if(!empty($featuredImageID)){
|
414 |
+
|
415 |
+
$imageArgs = array();
|
416 |
+
$imageArgs["name"] = "image";
|
417 |
+
|
418 |
+
if(!empty($arrImageSizes)){
|
419 |
+
$sizeDesktop = UniteFunctionsUC::getVal($arrImageSizes, "desktop");
|
420 |
+
|
421 |
+
if(!empty($sizeDesktop)){
|
422 |
+
$imageArgs["add_image_sizes"] = true;
|
423 |
+
$imageArgs["value_size"] = $sizeDesktop;
|
424 |
+
}
|
425 |
+
|
426 |
+
}
|
427 |
+
|
428 |
+
$arrData = $this->getProcessedParamsValue_image($arrData, $featuredImageID, $imageArgs);
|
429 |
+
}
|
430 |
|
431 |
if(is_array($arrPostAdditions) == false)
|
432 |
$arrPostAdditions = array();
|
913 |
$arrProductsCrossSells = array();
|
914 |
$arrIDsOnSale = array();
|
915 |
$arrRecentProducts = array();
|
916 |
+
$arrIDsPopular = array();
|
917 |
|
918 |
foreach($arrIncludeBy as $includeby){
|
919 |
|
1004 |
}
|
1005 |
|
1006 |
break;
|
1007 |
+
case "meta":
|
1008 |
+
|
1009 |
+
$metaKey = UniteFunctionsUC::getVal($value, "{$name}_includeby_metakey");
|
1010 |
+
$metaCompare = UniteFunctionsUC::getVal($value, "{$name}_includeby_metacompare");
|
1011 |
+
$metaValue = UniteFunctionsUC::getVal($value, "{$name}_includeby_metavalue");
|
1012 |
+
|
1013 |
+
if(!empty($metaKey)){
|
1014 |
+
|
1015 |
+
$arrMetaQuery[] = array(
|
1016 |
+
'key' => $metaKey,
|
1017 |
+
'value' => $metaValue,
|
1018 |
+
'compare'=>$metaCompare
|
1019 |
+
);
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
break;
|
1023 |
+
case "most_viewed":
|
1024 |
+
|
1025 |
+
$isWPPPluginExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
|
1026 |
+
|
1027 |
+
if($showDebugQuery == true && $isWPPPluginExists == false){
|
1028 |
+
dmp("Select Most Viewed posts posible only if you install 'WordPress Popular Posts' plugin. Please install it");
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
if($isWPPPluginExists){
|
1032 |
+
|
1033 |
+
$objIntegrations = new UniteCreatorPluginIntegrations();
|
1034 |
+
|
1035 |
+
$wppRange = UniteFunctionsUC::getVal($value, "{$name}_includeby_mostviewed_range");
|
1036 |
+
|
1037 |
+
$wpp_args = array(
|
1038 |
+
"post_type"=>$postType,
|
1039 |
+
"limit"=>$limit,
|
1040 |
+
"range"=>$wppRange
|
1041 |
+
);
|
1042 |
+
if(!empty($category))
|
1043 |
+
$wpp_args["cat"] = $category;
|
1044 |
+
|
1045 |
+
$response = $objIntegrations->WPP_getPopularPosts($wpp_args, $showDebugQuery);
|
1046 |
+
|
1047 |
+
$arrIDsPopular = UniteFunctionsUC::getVal($response, "post_ids");
|
1048 |
+
|
1049 |
+
$debugWPP = UniteFunctionsUC::getVal($response, "debug");
|
1050 |
+
|
1051 |
+
if($showDebugQuery == true && !empty($debugWPP)){
|
1052 |
+
dmp("Pupular Posts Data: ");
|
1053 |
+
dmp($debugWPP);
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
break;
|
1059 |
}
|
1060 |
|
1061 |
}
|
1062 |
|
1063 |
//include id's
|
1064 |
$arrPostInIDs = UniteFunctionsUC::mergeArraysUnique($arrProductsCrossSells, $arrProductsUpSells, $arrRecentProducts);
|
1065 |
+
|
1066 |
if(!empty($arrIDsOnSale)){
|
1067 |
|
1068 |
if(!empty($arrPostInIDs)) //intersect with previous id's
|
1069 |
$arrPostInIDs = array_intersect($arrPostInIDs, $arrIDsOnSale);
|
1070 |
else
|
1071 |
$arrPostInIDs = $arrIDsOnSale;
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
if(!empty($arrIDsPopular)){
|
1075 |
+
|
1076 |
+
//set order
|
1077 |
+
$args["orderby"] = "post__in";
|
1078 |
+
|
1079 |
+
$orderDir = UniteFunctionsUC::getVal($args, "order");
|
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;
|
1090 |
|
1091 |
+
|
1092 |
//------ get woo related products ------
|
1093 |
|
1094 |
if($getRelatedProducts == true){
|
1123 |
$args["suppress_filters"] = false;
|
1124 |
|
1125 |
//add post status
|
1126 |
+
$arrStatuses = UniteFunctionsUC::getVal($value, "{$name}_status");
|
1127 |
+
|
1128 |
if(empty($arrStatuses))
|
1129 |
$arrStatuses = "publish";
|
1130 |
|
1422 |
|
1423 |
$useCategory = UniteFunctionsUC::getVal($param, "use_category");
|
1424 |
$useCategory = UniteFunctionsUC::strToBool($useCategory);
|
|
|
|
|
1425 |
|
1426 |
+
$arrPostAdditions = HelperProviderUC::getPostDataAdditions($useCustomFields, $useCategory);
|
1427 |
+
|
1428 |
HelperUC::addDebug("post additions", $arrPostAdditions);
|
1429 |
|
1430 |
+
//image sizes
|
1431 |
+
$showImageSizes = UniteFunctionsUC::getVal($param, "show_image_sizes");
|
1432 |
+
$showImageSizes = UniteFunctionsUC::strToBool($showImageSizes);
|
1433 |
+
|
1434 |
+
$arrImageSizes = null;
|
1435 |
+
|
1436 |
+
if($showImageSizes == true){
|
1437 |
+
|
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 |
|
provider/provider_settings.class.php
CHANGED
@@ -451,24 +451,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
451 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
452 |
$params["elementor_condition"] = array($name."_includeby"=>"meta");
|
453 |
$params["description"] = __("Get only those terms that has the meta key/value. For IN, NOT IN, BETWEEN, NOT BETWEEN compares, use coma saparated values");
|
454 |
-
|
455 |
-
$arrItems =
|
456 |
-
$arrItems["="] = "Equals";
|
457 |
-
$arrItems["!="] = "Not Equals";
|
458 |
-
$arrItems[">"] = "More Then";
|
459 |
-
$arrItems["<"] = "Less Then";
|
460 |
-
$arrItems[">="] = "More Or Equal";
|
461 |
-
$arrItems["<="] = "Less Or Equal";
|
462 |
-
$arrItems["LIKE"] = "LIKE";
|
463 |
-
$arrItems["NOT LIKE"] = "NOT LIKE";
|
464 |
-
|
465 |
-
$arrItems["IN"] = "IN";
|
466 |
-
$arrItems["NOT IN"] = "NOT IN";
|
467 |
-
$arrItems["BETWEEN"] = "BETWEEN";
|
468 |
-
$arrItems["NOT BETWEEN"] = "NOT BETWEEN";
|
469 |
-
|
470 |
-
$arrItems["EXISTS"] = "EXISTS";
|
471 |
-
$arrItems["NOT EXISTS"] = "NOT EXISTS";
|
472 |
|
473 |
$arrItems = array_flip($arrItems);
|
474 |
|
@@ -1234,6 +1218,10 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1234 |
$arrIncludeBy["parent"] = __("Post Parent", "unlimited-elements-for-elementor");
|
1235 |
}
|
1236 |
|
|
|
|
|
|
|
|
|
1237 |
if($isForWooProducts == true){
|
1238 |
$arrIncludeBy["products_on_sale"] = __("Products On Sale Only (woo)","unlimited-elements-for-elementor");
|
1239 |
$arrIncludeBy["up_sells"] = __("Up Sells Products (woo)","unlimited-elements-for-elementor");
|
@@ -1343,6 +1331,94 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
1343 |
|
1344 |
$this->addStaticText("Recently viewed by the current site visitor, taken from cookie: woocommerce_recently_viewed. Works only if active wordpress widget: \"Recently Viewed Products\" ", $name."_includeby_recenttext", $params);
|
1345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1346 |
|
1347 |
//----- add categories -------
|
1348 |
|
451 |
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
452 |
$params["elementor_condition"] = array($name."_includeby"=>"meta");
|
453 |
$params["description"] = __("Get only those terms that has the meta key/value. For IN, NOT IN, BETWEEN, NOT BETWEEN compares, use coma saparated values");
|
454 |
+
|
455 |
+
$arrItems = HelperProviderUC::getArrMetaCompareSelect();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
|
457 |
$arrItems = array_flip($arrItems);
|
458 |
|
1218 |
$arrIncludeBy["parent"] = __("Post Parent", "unlimited-elements-for-elementor");
|
1219 |
}
|
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){
|
1226 |
$arrIncludeBy["products_on_sale"] = __("Products On Sale Only (woo)","unlimited-elements-for-elementor");
|
1227 |
$arrIncludeBy["up_sells"] = __("Up Sells Products (woo)","unlimited-elements-for-elementor");
|
1331 |
|
1332 |
$this->addStaticText("Recently viewed by the current site visitor, taken from cookie: woocommerce_recently_viewed. Works only if active wordpress widget: \"Recently Viewed Products\" ", $name."_includeby_recenttext", $params);
|
1333 |
|
1334 |
+
//-------- include by Post Meta --------
|
1335 |
+
|
1336 |
+
// --------- include by meta key -------------
|
1337 |
+
|
1338 |
+
$params = array();
|
1339 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1340 |
+
$params["placeholder"] = __("Meta Key","unlimited-elements-for-elementor");
|
1341 |
+
|
1342 |
+
$arrConditionIncludeMeta = $arrConditionIncludeBy;
|
1343 |
+
$arrConditionIncludeMeta[$name."_includeby"] = "meta";
|
1344 |
+
|
1345 |
+
$params["elementor_condition"] = $arrConditionIncludeMeta;
|
1346 |
+
|
1347 |
+
$this->addTextBox($name."_includeby_metakey", "", esc_html__("Include by Meta Key", "unlimited-elements-for-elementor"), $params);
|
1348 |
+
|
1349 |
+
// --------- include by meta compare -------------
|
1350 |
+
|
1351 |
+
$params = array();
|
1352 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
1353 |
+
$params["description"] = __("Get only those terms that has the meta key/value. For IN, NOT IN, BETWEEN, NOT BETWEEN compares, use coma saparated values");
|
1354 |
+
$params["elementor_condition"] = $arrConditionIncludeMeta;
|
1355 |
+
|
1356 |
+
$arrItems = HelperProviderUC::getArrMetaCompareSelect();
|
1357 |
+
|
1358 |
+
$arrItems = array_flip($arrItems);
|
1359 |
+
|
1360 |
+
$this->addSelect($name."_includeby_metacompare", $arrItems, esc_html__("Include by Meta Compare", "unlimited-elements-for-elementor"), "=", $params);
|
1361 |
+
|
1362 |
+
// --------- include by meta value -------------
|
1363 |
+
|
1364 |
+
$params = array();
|
1365 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
|
1366 |
+
$params["placeholder"] = __("Meta Value","unlimited-elements-for-elementor");
|
1367 |
+
$params["add_dynamic"] = true;
|
1368 |
+
$params["elementor_condition"] = $arrConditionIncludeMeta;
|
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();
|
1375 |
+
|
1376 |
+
$params = array();
|
1377 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_STATIC_TEXT;
|
1378 |
+
|
1379 |
+
$arrConditionIncludeViewsCounter = $arrConditionIncludeBy;
|
1380 |
+
$arrConditionIncludeViewsCounter[$name."_includeby"] = "most_viewed";
|
1381 |
+
|
1382 |
+
$params["elementor_condition"] = $arrConditionIncludeViewsCounter;
|
1383 |
+
|
1384 |
+
$text = __("Select most viewed posts, integration with plugin: 'WordPress Popular Posts' that should be installed", "unlimited-elements-for-elementor");
|
1385 |
+
|
1386 |
+
if($isWPPExists == true)
|
1387 |
+
$text = __("'WordPress Popular Posts' plugin activated.", "unlimited-elements-for-elementor");
|
1388 |
+
|
1389 |
+
$this->addStaticText($text, $name."_text_includemostviewed", $params);
|
1390 |
+
|
1391 |
+
// --------- most viewed range -------------
|
1392 |
+
|
1393 |
+
if($isWPPExists == true){
|
1394 |
+
|
1395 |
+
$params = array();
|
1396 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
|
1397 |
+
$params["elementor_condition"] = $arrConditionIncludeViewsCounter;
|
1398 |
+
$params["description"] = "Besides range, it supports single post type and single category, and order direction query options";
|
1399 |
+
|
1400 |
+
$arrItems = array("last30days"=>"Last 30 Days",
|
1401 |
+
"last7days"=>"Last 7 Days",
|
1402 |
+
"last24hours"=>"Last 24 Hours",
|
1403 |
+
"daily"=>"Daily",
|
1404 |
+
"weekly"=>"Weekly",
|
1405 |
+
"monthly"=>"Monthly",
|
1406 |
+
"all"=>"All");
|
1407 |
+
|
1408 |
+
$arrItems = array_flip($arrItems);
|
1409 |
+
|
1410 |
+
$this->addSelect($name."_includeby_mostviewed_range", $arrItems, esc_html__("Most Viewed Time Range", "unlimited-elements-for-elementor"), "last30days", $params);
|
1411 |
+
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
// --------- add hr before categories -------------
|
1415 |
+
|
1416 |
+
$params = array();
|
1417 |
+
$params["origtype"] = UniteCreatorDialogParam::PARAM_HR;
|
1418 |
+
$params["elementor_condition"] = $arrCustomOnlyCondition;
|
1419 |
+
|
1420 |
+
$this->addHr("before_categories",$params);
|
1421 |
+
|
1422 |
|
1423 |
//----- add categories -------
|
1424 |
|
readme.txt
CHANGED
@@ -521,6 +521,20 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
|
|
521 |
|
522 |
== Changelog ==
|
523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
version 1.4.69 = 2021-04-04
|
525 |
|
526 |
* Feature: added extra query debug options for custom post types selector
|
521 |
|
522 |
== Changelog ==
|
523 |
|
524 |
+
version 1.4.70 = 2021-04-14
|
525 |
+
|
526 |
+
* Feature: added show widget data debug options
|
527 |
+
* Feature: added option for filter post by post meta
|
528 |
+
* Feature: added option for simple condition for attributes
|
529 |
+
* Feature: added integration with wordpress popular post plugin for most viewed posts selection
|
530 |
+
* Feature: added post list variables for data debug
|
531 |
+
* Feature: added image sizes selector for post list
|
532 |
+
* Feature: get thumbnailID from content in case that it's missing in post
|
533 |
+
* Fix: when bulk moving attribute it now always goes to general category
|
534 |
+
* Fix: fixed filter posts by status
|
535 |
+
* Fix: fixed instagram media albom
|
536 |
+
|
537 |
+
|
538 |
version 1.4.69 = 2021-04-04
|
539 |
|
540 |
* Feature: added extra query debug options for custom post types selector
|
release_log.txt
CHANGED
@@ -1,5 +1,19 @@
|
|
1 |
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
version 1.4.69
|
4 |
|
5 |
-Bug fix: fixed border radius attribute from width to radius
|
1 |
|
2 |
|
3 |
+
version 1.4.70
|
4 |
+
|
5 |
+
-bug fix: when bulk moving attribute it now always goes to general category
|
6 |
+
-bug fix: fixed filter posts by status
|
7 |
+
-bug fix: fixed instagram media albom
|
8 |
+
-feature: added show widget data debug options
|
9 |
+
-feature: added option for filter post by post meta
|
10 |
+
-feature: added option for simple condition for attributes
|
11 |
+
-feature: added integration with wordpress popular post plugin for most viewed posts selection
|
12 |
+
-feature: added post list variables for data debug
|
13 |
+
-feature: added image sizes selector for post list
|
14 |
+
-feature: get thumbnailID from content in case that it's missing in post
|
15 |
+
|
16 |
+
|
17 |
version 1.4.69
|
18 |
|
19 |
-Bug fix: fixed border radius attribute from width to radius
|
unlimited_elements.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Unlimited Elements for Elementor
|
|
4 |
Plugin URI: http://unlimited-elements.com
|
5 |
Description: Unlimited Elements - Huge Widgets Pack for Elementor 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
|
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.70
|
8 |
Author URI: http://unlimited-elements.com
|
9 |
Text Domain: unlimited-elements-for-elementor
|
10 |
Domain Path: /languages
|