Version Description
Download this release
Release Info
Developer | unitecms |
Plugin | Unlimited Elements For Elementor (Free Widgets, Addons, Templates) |
Version | 1.4.83 |
Comparing to | |
See all releases |
Code changes from version 1.4.81 to 1.4.83
- inc_php/framework/functions.class.php +64 -6
- inc_php/framework/helper_base.class.php +1 -0
- inc_php/framework/instagram/instagram_api_official.class.php +1 -0
- inc_php/framework/instagram/obj_item.class.php +7 -3
- inc_php/framework/settings.class.php +1 -0
- inc_php/framework/zip.class.php +2 -4
- inc_php/unitecreator_addon.class.php +103 -20
- inc_php/unitecreator_addon_config.class.php +1 -1
- inc_php/unitecreator_addons.class.php +2 -0
- inc_php/unitecreator_dialog_param.class.php +13 -4
- inc_php/unitecreator_helperhtml.class.php +79 -0
- inc_php/unitecreator_output.class.php +1 -1
- inc_php/unitecreator_params_processor.class.php +57 -24
- inc_php/unitecreator_settings.class.php +2 -2
- inc_php/unitecreator_template_engine.class.php +54 -7
- inc_php/unitecreator_unitegallery.class.php +28 -0
- includes.php +2 -1
- js/admin.js +2 -2
- js/manager/unitecreator_manager_actions_inline.js +8 -4
- js/manager/unitecreator_manager_cats.js +6 -1
- js/unitecreator_params_dialog.js +5 -9
- provider/core/plugins/unlimited_elements/copy_paste.class.php +1 -1
- provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php +2 -0
- provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.css +17 -18
- provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js +9 -3
- provider/core/plugins/unlimited_elements/elementor/elementor_background_widget.class.php +12 -3
- provider/core/plugins/unlimited_elements/elementor/elementor_content.class.php +0 -9
- provider/core/plugins/unlimited_elements/elementor/elementor_controls.class.php +124 -36
- provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php +18 -12
- provider/core/plugins/unlimited_elements/elementor/elementor_layout_exporter.class.php +1 -2
- provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php +142 -38
- provider/core/plugins/unlimited_elements/helper_provider_core.class.php +4 -2
- provider/core/plugins/unlimited_elements/settings/general_settings_el.xml +12 -1
- provider/core/plugins/unlimited_elements/template.php +169 -0
- provider/provider_admin.class.php +2 -1
- provider/provider_front.class.php +29 -0
- provider/provider_functions.class.php +1 -1
- provider/provider_helper.class.php +28 -0
- provider/provider_library.class.php +7 -1
- provider/provider_params_processor.class.php +259 -28
- provider/provider_settings.class.php +14 -4
- provider/woocommerce_integrate.class.php +230 -1
- readme.txt +28 -0
- release_log.txt +28 -0
- settings/library.xml +6 -1
- unlimited_elements.php +3 -3
- views/addondefaults.php +2 -0
- views/objects/addon_view.class.php +4 -0
- views/objects/addon_view_childparams.class.php +51 -0
inc_php/framework/functions.class.php
CHANGED
@@ -810,15 +810,28 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
810 |
|
811 |
if (mb_strlen($value, $charset) > $length) {
|
812 |
if ($preserve) {
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
|
818 |
$length = $breakpoint;
|
819 |
}
|
820 |
-
|
821 |
-
|
|
|
|
|
|
|
|
|
822 |
}
|
823 |
|
824 |
return $value;
|
@@ -2365,7 +2378,52 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2365 |
|
2366 |
public static function z___________OTHERS__________(){}
|
2367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2368 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2369 |
|
2370 |
/**
|
2371 |
* encode svg to bg image url
|
810 |
|
811 |
if (mb_strlen($value, $charset) > $length) {
|
812 |
if ($preserve) {
|
813 |
+
|
814 |
+
if(function_exists("mb_strpos")){
|
815 |
+
// If breakpoint is on the last word, return the value without separator.
|
816 |
+
if (false === ($breakpoint = mb_strpos($value, ' ', $length, $charset))) {
|
817 |
+
return $value;
|
818 |
+
}
|
819 |
+
}else{
|
820 |
+
|
821 |
+
if (false === ($breakpoint = strpos($value, ' ', $length))) {
|
822 |
+
return $value;
|
823 |
+
}
|
824 |
+
|
825 |
+
}
|
826 |
|
827 |
$length = $breakpoint;
|
828 |
}
|
829 |
+
|
830 |
+
if(function_exists("mb_substr"))
|
831 |
+
return rtrim(mb_substr($value, 0, $length, $charset)).$separator;
|
832 |
+
else
|
833 |
+
return rtrim(substr($value, 0, $length, $charset)).$separator;
|
834 |
+
|
835 |
}
|
836 |
|
837 |
return $value;
|
2378 |
|
2379 |
public static function z___________OTHERS__________(){}
|
2380 |
|
2381 |
+
/**
|
2382 |
+
* get youtube video id from url, or ID
|
2383 |
+
*/
|
2384 |
+
public static function getYoutubeVideoID($url){
|
2385 |
+
|
2386 |
+
preg_match("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $url, $matches);
|
2387 |
+
|
2388 |
+
if(empty($matches))
|
2389 |
+
return($url);
|
2390 |
+
|
2391 |
+
if(count($matches) < 1)
|
2392 |
+
return("");
|
2393 |
+
|
2394 |
+
$videoID = $matches[1];
|
2395 |
+
|
2396 |
+
return($videoID);
|
2397 |
+
}
|
2398 |
|
2399 |
+
/**
|
2400 |
+
* get vimeo id from url
|
2401 |
+
*/
|
2402 |
+
public static function getVimeoIDFromUrl($url){
|
2403 |
+
|
2404 |
+
|
2405 |
+
if(is_numeric($url))
|
2406 |
+
return($url);
|
2407 |
+
|
2408 |
+
if(strpos($url, "https://") === false)
|
2409 |
+
$url = "https://".$url;
|
2410 |
+
|
2411 |
+
preg_match('%^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$%im', $url, $matches);
|
2412 |
+
|
2413 |
+
if(empty($matches))
|
2414 |
+
return($url);
|
2415 |
+
|
2416 |
+
if(count($matches) < 4)
|
2417 |
+
return($url);
|
2418 |
+
|
2419 |
+
$videoID = $matches[3];
|
2420 |
+
|
2421 |
+
if(is_numeric($videoID) == false)
|
2422 |
+
return($url);
|
2423 |
+
|
2424 |
+
|
2425 |
+
return($videoID);
|
2426 |
+
}
|
2427 |
|
2428 |
/**
|
2429 |
* encode svg to bg image url
|
inc_php/framework/helper_base.class.php
CHANGED
@@ -40,6 +40,7 @@ class UniteHelperBaseUC extends HtmlOutputBaseUC{
|
|
40 |
* echo json ajax response, without message, only data
|
41 |
*/
|
42 |
public static function ajaxResponseData($arrData){
|
|
|
43 |
if(gettype($arrData) == "string")
|
44 |
$arrData = array("data"=>$arrData);
|
45 |
|
40 |
* echo json ajax response, without message, only data
|
41 |
*/
|
42 |
public static function ajaxResponseData($arrData){
|
43 |
+
|
44 |
if(gettype($arrData) == "string")
|
45 |
$arrData = array("data"=>$arrData);
|
46 |
|
inc_php/framework/instagram/instagram_api_official.class.php
CHANGED
@@ -124,6 +124,7 @@ class InstagramAPIOfficialUC{
|
|
124 |
|
125 |
}
|
126 |
|
|
|
127 |
return($response);
|
128 |
}
|
129 |
|
124 |
|
125 |
}
|
126 |
|
127 |
+
|
128 |
return($response);
|
129 |
}
|
130 |
|
inc_php/framework/instagram/obj_item.class.php
CHANGED
@@ -28,6 +28,7 @@ class InstaObjItemUC{
|
|
28 |
public $locationName;
|
29 |
public $arrImages;
|
30 |
public $arrVideos;
|
|
|
31 |
public $videoViews;
|
32 |
public $canViewComments = false;
|
33 |
public $numComments;
|
@@ -287,6 +288,7 @@ class InstaObjItemUC{
|
|
287 |
$arr["isvideo"] = $isVideo;
|
288 |
$arr["video_class"] = $class;
|
289 |
$arr["num_video_views"] = $this->getNumVideoViewsText();
|
|
|
290 |
|
291 |
return($arr);
|
292 |
}
|
@@ -608,7 +610,7 @@ class InstaObjItemUC{
|
|
608 |
* init item by official API
|
609 |
*/
|
610 |
public function initOfficialAPI($item){
|
611 |
-
|
612 |
$mediaType = UniteFunctionsUC::getVal($item, "media_type");
|
613 |
|
614 |
switch($mediaType){
|
@@ -631,16 +633,18 @@ class InstaObjItemUC{
|
|
631 |
$url = $this->arrVideos[self::VIDEO_STANDART]["url"] = $urlImage;
|
632 |
|
633 |
$urlImage = UniteFunctionsUC::getVal($item, "thumbnail_url");
|
|
|
|
|
634 |
}
|
635 |
|
636 |
$this->arrImages[self::IMAGE_LOW]["url"] = $urlImage;
|
637 |
$this->arrImages[self::IMAGE_STANDARD]["url"] = $urlImage;
|
638 |
|
|
|
639 |
$this->captionText = UniteFunctionsUC::getVal($item, "caption");
|
640 |
|
641 |
$this->id = UniteFunctionsUC::getVal($item, "id");
|
642 |
-
|
643 |
-
|
644 |
$this->link = UniteFunctionsUC::getVal($item, "permalink");
|
645 |
|
646 |
$this->isInited = true;
|
28 |
public $locationName;
|
29 |
public $arrImages;
|
30 |
public $arrVideos;
|
31 |
+
public $urlVideo;
|
32 |
public $videoViews;
|
33 |
public $canViewComments = false;
|
34 |
public $numComments;
|
288 |
$arr["isvideo"] = $isVideo;
|
289 |
$arr["video_class"] = $class;
|
290 |
$arr["num_video_views"] = $this->getNumVideoViewsText();
|
291 |
+
$arr["url_video"] = $this->urlVideo;
|
292 |
|
293 |
return($arr);
|
294 |
}
|
610 |
* init item by official API
|
611 |
*/
|
612 |
public function initOfficialAPI($item){
|
613 |
+
|
614 |
$mediaType = UniteFunctionsUC::getVal($item, "media_type");
|
615 |
|
616 |
switch($mediaType){
|
633 |
$url = $this->arrVideos[self::VIDEO_STANDART]["url"] = $urlImage;
|
634 |
|
635 |
$urlImage = UniteFunctionsUC::getVal($item, "thumbnail_url");
|
636 |
+
|
637 |
+
$this->urlVideo = UniteFunctionsUC::getVal($item, "media_url");
|
638 |
}
|
639 |
|
640 |
$this->arrImages[self::IMAGE_LOW]["url"] = $urlImage;
|
641 |
$this->arrImages[self::IMAGE_STANDARD]["url"] = $urlImage;
|
642 |
|
643 |
+
$this->hasCaption = true;
|
644 |
$this->captionText = UniteFunctionsUC::getVal($item, "caption");
|
645 |
|
646 |
$this->id = UniteFunctionsUC::getVal($item, "id");
|
647 |
+
|
|
|
648 |
$this->link = UniteFunctionsUC::getVal($item, "permalink");
|
649 |
|
650 |
$this->isInited = true;
|
inc_php/framework/settings.class.php
CHANGED
@@ -897,6 +897,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
897 |
$setting = $this->modifyBeforeAdd($setting, $modifyType);
|
898 |
}
|
899 |
|
|
|
900 |
$this->addSettingByArray($setting);
|
901 |
}
|
902 |
|
897 |
$setting = $this->modifyBeforeAdd($setting, $modifyType);
|
898 |
}
|
899 |
|
900 |
+
|
901 |
$this->addSettingByArray($setting);
|
902 |
}
|
903 |
|
inc_php/framework/zip.class.php
CHANGED
@@ -637,9 +637,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
637 |
* Extract zip archive
|
638 |
*/
|
639 |
public function extract($src, $dest){
|
640 |
-
|
641 |
-
$content = file_get_contents($src);
|
642 |
-
|
643 |
if($this->isZipArchiveExists() == true){ //zipArchive
|
644 |
$success = $this->extract_zipArchive($src, $dest);
|
645 |
if($success == true)
|
@@ -656,7 +654,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
656 |
if($success == true)
|
657 |
return(true);
|
658 |
}
|
659 |
-
|
660 |
$success = $this->extract_custom($src, $dest);
|
661 |
|
662 |
return($success);
|
637 |
* Extract zip archive
|
638 |
*/
|
639 |
public function extract($src, $dest){
|
640 |
+
|
|
|
|
|
641 |
if($this->isZipArchiveExists() == true){ //zipArchive
|
642 |
$success = $this->extract_zipArchive($src, $dest);
|
643 |
if($success == true)
|
654 |
if($success == true)
|
655 |
return(true);
|
656 |
}
|
657 |
+
|
658 |
$success = $this->extract_custom($src, $dest);
|
659 |
|
660 |
return($success);
|
inc_php/unitecreator_addon.class.php
CHANGED
@@ -19,6 +19,11 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
19 |
const FILENAME_PREVIEW = "preview_addon"; //jpg,png,gif
|
20 |
const FILENAME_ICON_SVG = "preview_icon.svg";
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
private $id = null;
|
23 |
private $isInited = false;
|
24 |
private $title,$type,$html,$htmlItem,$htmlItem2,$css,$cssItem,$js,$updateHash;
|
@@ -34,6 +39,8 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
34 |
private $isInsideGrid = false, $objAddonType;
|
35 |
private $pathAssetsBase, $urlAssetsBase;
|
36 |
private $arrStoredData = array();
|
|
|
|
|
37 |
|
38 |
private static $arrCacheRecords = array();
|
39 |
private static $arrCacheCats = null;
|
@@ -200,6 +207,14 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
200 |
UniteFunctionsUC::throwError("The widget with name: $name already exists");
|
201 |
}
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
|
204 |
/**
|
205 |
* init item by ID
|
@@ -212,7 +227,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
212 |
|
213 |
try{
|
214 |
$record = $this->db->fetchSingle(GlobalsUC::$table_addons,"id={$id}");
|
215 |
-
|
216 |
}catch(Exception $e){
|
217 |
UniteFunctionsUC::throwError("Widget with ID: {$id} not found");
|
218 |
}
|
@@ -418,13 +433,14 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
418 |
* get the items type on init
|
419 |
*/
|
420 |
private function initItemsType(){
|
421 |
-
|
422 |
foreach($this->paramsItems as $param){
|
423 |
$type = UniteFunctionsUC::getVal($param, "type");
|
424 |
if($type == "uc_imagebase")
|
425 |
return(self::ITEMS_TYPE_IMAGE);
|
426 |
}
|
427 |
|
|
|
428 |
return(self::ITEMS_TYPE_DEFAULT);
|
429 |
}
|
430 |
|
@@ -474,6 +490,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
474 |
protected function getItemsSpecialType(){
|
475 |
|
476 |
foreach($this->params as $param){
|
|
|
477 |
$type = UniteFunctionsUC::getVal($param, "type");
|
478 |
switch($type){
|
479 |
case UniteCreatorDialogParam::PARAM_POSTS_LIST:
|
@@ -488,7 +505,18 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
488 |
case UniteCreatorDialogParam::PARAM_DATASET:
|
489 |
return self::ITEMS_TYPE_DATASET;
|
490 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
}
|
|
|
492 |
}
|
493 |
|
494 |
return(null);
|
@@ -502,20 +530,41 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
502 |
|
503 |
//set spacial items type if exists
|
504 |
$specialType = $this->getItemsSpecialType();
|
505 |
-
|
|
|
|
|
506 |
if(!empty($specialType)){
|
507 |
|
508 |
$this->itemsType = $specialType;
|
509 |
|
510 |
-
if($specialType == self::ITEMS_TYPE_FORM || $specialType == self::ITEMS_TYPE_DATASET){
|
|
|
511 |
$this->hasItems = true;
|
512 |
-
|
513 |
}else{
|
514 |
$this->hasItems = false;
|
515 |
$this->options["enable_items"] = false;
|
516 |
}
|
517 |
|
518 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
|
520 |
}
|
521 |
|
@@ -525,7 +574,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
525 |
* init item by db record
|
526 |
*/
|
527 |
public function initByDBRecord($record){
|
528 |
-
|
529 |
//cache db record
|
530 |
$addonName = UniteFunctionsUC::getVal($record, "name");
|
531 |
self::$arrCacheRecords[$addonName] = $record;
|
@@ -616,8 +665,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
616 |
if(!empty($jsonIncludes))
|
617 |
$arrIncludes = json_decode($jsonIncludes);
|
618 |
}
|
619 |
-
|
620 |
$this->options = $this->initAddonOptions($this->options);
|
|
|
621 |
|
622 |
//check params for doubles
|
623 |
$this->params = $this->initParamsFindDoubles($this->params);
|
@@ -625,7 +675,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
625 |
|
626 |
//process params items
|
627 |
$this->paramsItems = $this->operations->checkAddParamTitle($this->paramsItems);
|
628 |
-
|
629 |
//set assets path
|
630 |
$objAddonType = $this->getObjAddonType();
|
631 |
$this->pathAssetsBase = HelperUC::getAssetsPath($objAddonType);
|
@@ -639,12 +689,10 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
639 |
//init if has items
|
640 |
$enableItems = $this->getOption("enable_items");
|
641 |
$this->hasItems = UniteFunctionsUC::strToBool($enableItems);
|
642 |
-
|
643 |
-
|
644 |
if($this->hasItems)
|
645 |
$this->itemsType = $this->initItemsType();
|
646 |
|
647 |
-
|
648 |
//parse includes
|
649 |
if(!empty($arrIncludes)){
|
650 |
|
@@ -663,7 +711,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
663 |
$this->includesJSLib = $this->normalizeIncludeArray($this->includesJSLib);
|
664 |
|
665 |
$this->modifyAfterInit();
|
666 |
-
|
667 |
//set default data
|
668 |
$this->setValuesFromDefaultData();
|
669 |
|
@@ -1022,12 +1070,20 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1022 |
return($this->hasItems);
|
1023 |
}
|
1024 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1025 |
|
1026 |
/**
|
1027 |
* get items type like image / default
|
1028 |
*/
|
1029 |
public function getItemsType(){
|
1030 |
|
|
|
1031 |
return($this->itemsType);
|
1032 |
}
|
1033 |
|
@@ -1634,6 +1690,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1634 |
$arrJsIncludes = array_merge($arrJsIncludes, $arrJs);
|
1635 |
$arrCssIncludes = array_merge($arrCssIncludes, $arrCss);
|
1636 |
}
|
|
|
1637 |
|
1638 |
$output = array();
|
1639 |
$output["js"] = $arrJsIncludes;
|
@@ -1670,6 +1727,29 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1670 |
|
1671 |
private function a______GET_HTML______(){}
|
1672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1673 |
/**
|
1674 |
* get addon config html
|
1675 |
* for vc make another function - get config only
|
@@ -1682,7 +1762,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1682 |
$this->arrHtmlConfigOptions = $options;
|
1683 |
|
1684 |
$arrParams = $this->objProcessor->processParamsForOutput($this->params);
|
1685 |
-
|
1686 |
//add config
|
1687 |
$objSettings = new UniteCreatorSettings();
|
1688 |
|
@@ -1692,17 +1772,17 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1692 |
$objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
|
1693 |
}
|
1694 |
|
|
|
|
|
1695 |
if(!empty($this->params) || $this->hasItems){
|
1696 |
|
1697 |
$objSettings->addSap(esc_html__("General","unlimited-elements-for-elementor"),"config",true);
|
1698 |
|
1699 |
if($this->hasItems == true){
|
1700 |
-
|
1701 |
//$this->itemsType == self::ITEMS_TYPE_IMAGE
|
1702 |
-
|
1703 |
$objSettings->addItemsPanel($this, $source);
|
1704 |
$objSettings->addHr("after_items_hr");
|
1705 |
-
|
1706 |
}
|
1707 |
|
1708 |
$objSettings->initByCreatorParams($arrParams);
|
@@ -1829,6 +1909,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1829 |
$this->getHtmlConfig(true, $isOutputSidebar, $params);
|
1830 |
}
|
1831 |
|
|
|
1832 |
/**
|
1833 |
* get object settings items for config (repeater)
|
1834 |
*/
|
@@ -1852,8 +1933,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1852 |
$objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
|
1853 |
}
|
1854 |
|
|
|
1855 |
$objSettings->initByCreatorParams($this->paramsItems);
|
1856 |
-
|
1857 |
return($objSettings);
|
1858 |
}
|
1859 |
|
@@ -2038,7 +2120,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2038 |
public function getArrItemsForConfig(){
|
2039 |
|
2040 |
$arrItems = $this->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_CONFIG, false);
|
2041 |
-
|
2042 |
return($arrItems);
|
2043 |
}
|
2044 |
|
@@ -2211,7 +2293,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2211 |
|
2212 |
$this->validateInited();
|
2213 |
|
2214 |
-
if($this->hasItems == false)
|
2215 |
return(false);
|
2216 |
|
2217 |
if($arrItems === GlobalsUC::VALUE_EMPTY_ARRAY)
|
@@ -2227,6 +2309,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
2227 |
dmp("Error: ".$errorMessage);
|
2228 |
UniteFunctionsUC::throwError($errorMessage);
|
2229 |
}
|
|
|
2230 |
$this->arrItems = $arrItems;
|
2231 |
}
|
2232 |
|
@@ -3133,7 +3216,7 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
3133 |
public function setValuesFromTestData($slotNum){
|
3134 |
|
3135 |
$arrData = $this->getTestData($slotNum);
|
3136 |
-
|
3137 |
if(empty($arrData))
|
3138 |
return(false);
|
3139 |
|
19 |
const FILENAME_PREVIEW = "preview_addon"; //jpg,png,gif
|
20 |
const FILENAME_ICON_SVG = "preview_icon.svg";
|
21 |
|
22 |
+
const OPERATION_RENDER = "render";
|
23 |
+
const OPERATION_CONFIG = "config";
|
24 |
+
const OPERATION_EDIT = "edit";
|
25 |
+
const OPERATION_WIDGET = "widget";
|
26 |
+
|
27 |
private $id = null;
|
28 |
private $isInited = false;
|
29 |
private $title,$type,$html,$htmlItem,$htmlItem2,$css,$cssItem,$js,$updateHash;
|
39 |
private $isInsideGrid = false, $objAddonType;
|
40 |
private $pathAssetsBase, $urlAssetsBase;
|
41 |
private $arrStoredData = array();
|
42 |
+
private $operationType = null, $specialType;
|
43 |
+
|
44 |
|
45 |
private static $arrCacheRecords = array();
|
46 |
private static $arrCacheCats = null;
|
207 |
UniteFunctionsUC::throwError("The widget with name: $name already exists");
|
208 |
}
|
209 |
|
210 |
+
/**
|
211 |
+
* set loacation
|
212 |
+
*/
|
213 |
+
public function setOperationType($operation){
|
214 |
+
|
215 |
+
$this->operationType = $operation;
|
216 |
+
|
217 |
+
}
|
218 |
|
219 |
/**
|
220 |
* init item by ID
|
227 |
|
228 |
try{
|
229 |
$record = $this->db->fetchSingle(GlobalsUC::$table_addons,"id={$id}");
|
230 |
+
|
231 |
}catch(Exception $e){
|
232 |
UniteFunctionsUC::throwError("Widget with ID: {$id} not found");
|
233 |
}
|
433 |
* get the items type on init
|
434 |
*/
|
435 |
private function initItemsType(){
|
436 |
+
|
437 |
foreach($this->paramsItems as $param){
|
438 |
$type = UniteFunctionsUC::getVal($param, "type");
|
439 |
if($type == "uc_imagebase")
|
440 |
return(self::ITEMS_TYPE_IMAGE);
|
441 |
}
|
442 |
|
443 |
+
|
444 |
return(self::ITEMS_TYPE_DEFAULT);
|
445 |
}
|
446 |
|
490 |
protected function getItemsSpecialType(){
|
491 |
|
492 |
foreach($this->params as $param){
|
493 |
+
|
494 |
$type = UniteFunctionsUC::getVal($param, "type");
|
495 |
switch($type){
|
496 |
case UniteCreatorDialogParam::PARAM_POSTS_LIST:
|
505 |
case UniteCreatorDialogParam::PARAM_DATASET:
|
506 |
return self::ITEMS_TYPE_DATASET;
|
507 |
break;
|
508 |
+
case UniteCreatorDialogParam::PARAM_LISTING:
|
509 |
+
|
510 |
+
if($this->operationType != self::OPERATION_EDIT){
|
511 |
+
|
512 |
+
$useFor = UniteFunctionsUC::getVal($param, "use_for");
|
513 |
+
if($useFor == "gallery")
|
514 |
+
return(self::ITEMS_TYPE_IMAGE);
|
515 |
+
}
|
516 |
+
|
517 |
+
break;
|
518 |
}
|
519 |
+
|
520 |
}
|
521 |
|
522 |
return(null);
|
530 |
|
531 |
//set spacial items type if exists
|
532 |
$specialType = $this->getItemsSpecialType();
|
533 |
+
|
534 |
+
$this->specialType = $specialType;
|
535 |
+
|
536 |
if(!empty($specialType)){
|
537 |
|
538 |
$this->itemsType = $specialType;
|
539 |
|
540 |
+
if($specialType == self::ITEMS_TYPE_FORM || $specialType == self::ITEMS_TYPE_DATASET || $specialType == self::ITEMS_TYPE_IMAGE){
|
541 |
+
|
542 |
$this->hasItems = true;
|
543 |
+
|
544 |
}else{
|
545 |
$this->hasItems = false;
|
546 |
$this->options["enable_items"] = false;
|
547 |
}
|
548 |
|
549 |
}
|
550 |
+
|
551 |
+
//add image fields
|
552 |
+
if($specialType == self::ITEMS_TYPE_IMAGE){
|
553 |
+
|
554 |
+
if($this->operationType == self::OPERATION_WIDGET){
|
555 |
+
$this->hasItems = false;
|
556 |
+
$this->options["enable_items"] = false;
|
557 |
+
}
|
558 |
+
|
559 |
+
|
560 |
+
$paramImageBase = array();
|
561 |
+
$paramImageBase["type"] = "uc_imagebase";
|
562 |
+
$paramImageBase["name"] = "imagebase_fields";
|
563 |
+
$paramImageBase["title"] = "Image Base Fields";
|
564 |
+
|
565 |
+
$this->paramsItems[] = $paramImageBase;
|
566 |
+
}
|
567 |
+
|
568 |
|
569 |
}
|
570 |
|
574 |
* init item by db record
|
575 |
*/
|
576 |
public function initByDBRecord($record){
|
577 |
+
|
578 |
//cache db record
|
579 |
$addonName = UniteFunctionsUC::getVal($record, "name");
|
580 |
self::$arrCacheRecords[$addonName] = $record;
|
665 |
if(!empty($jsonIncludes))
|
666 |
$arrIncludes = json_decode($jsonIncludes);
|
667 |
}
|
668 |
+
|
669 |
$this->options = $this->initAddonOptions($this->options);
|
670 |
+
|
671 |
|
672 |
//check params for doubles
|
673 |
$this->params = $this->initParamsFindDoubles($this->params);
|
675 |
|
676 |
//process params items
|
677 |
$this->paramsItems = $this->operations->checkAddParamTitle($this->paramsItems);
|
678 |
+
|
679 |
//set assets path
|
680 |
$objAddonType = $this->getObjAddonType();
|
681 |
$this->pathAssetsBase = HelperUC::getAssetsPath($objAddonType);
|
689 |
//init if has items
|
690 |
$enableItems = $this->getOption("enable_items");
|
691 |
$this->hasItems = UniteFunctionsUC::strToBool($enableItems);
|
692 |
+
|
|
|
693 |
if($this->hasItems)
|
694 |
$this->itemsType = $this->initItemsType();
|
695 |
|
|
|
696 |
//parse includes
|
697 |
if(!empty($arrIncludes)){
|
698 |
|
711 |
$this->includesJSLib = $this->normalizeIncludeArray($this->includesJSLib);
|
712 |
|
713 |
$this->modifyAfterInit();
|
714 |
+
|
715 |
//set default data
|
716 |
$this->setValuesFromDefaultData();
|
717 |
|
1070 |
return($this->hasItems);
|
1071 |
}
|
1072 |
|
1073 |
+
/**
|
1074 |
+
* get special type
|
1075 |
+
*/
|
1076 |
+
public function getSpecialType(){
|
1077 |
+
|
1078 |
+
return($this->specialType);
|
1079 |
+
}
|
1080 |
|
1081 |
/**
|
1082 |
* get items type like image / default
|
1083 |
*/
|
1084 |
public function getItemsType(){
|
1085 |
|
1086 |
+
|
1087 |
return($this->itemsType);
|
1088 |
}
|
1089 |
|
1690 |
$arrJsIncludes = array_merge($arrJsIncludes, $arrJs);
|
1691 |
$arrCssIncludes = array_merge($arrCssIncludes, $arrCss);
|
1692 |
}
|
1693 |
+
|
1694 |
|
1695 |
$output = array();
|
1696 |
$output["js"] = $arrJsIncludes;
|
1727 |
|
1728 |
private function a______GET_HTML______(){}
|
1729 |
|
1730 |
+
/**
|
1731 |
+
* return true if it has dynamic param with gallery
|
1732 |
+
*/
|
1733 |
+
private function hasDynamicGallery(){
|
1734 |
+
|
1735 |
+
$paramDynamic = $this->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
|
1736 |
+
|
1737 |
+
if(empty($paramDynamic))
|
1738 |
+
return(false);
|
1739 |
+
|
1740 |
+
$useFor = UniteFunctionsUC::getVal($paramDynamic, "use_for");
|
1741 |
+
|
1742 |
+
switch($useFor){
|
1743 |
+
case "gallery":
|
1744 |
+
return(true);
|
1745 |
+
break;
|
1746 |
+
}
|
1747 |
+
|
1748 |
+
return(false);
|
1749 |
+
}
|
1750 |
+
|
1751 |
+
|
1752 |
+
|
1753 |
/**
|
1754 |
* get addon config html
|
1755 |
* for vc make another function - get config only
|
1762 |
$this->arrHtmlConfigOptions = $options;
|
1763 |
|
1764 |
$arrParams = $this->objProcessor->processParamsForOutput($this->params);
|
1765 |
+
|
1766 |
//add config
|
1767 |
$objSettings = new UniteCreatorSettings();
|
1768 |
|
1772 |
$objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
|
1773 |
}
|
1774 |
|
1775 |
+
//choose if add items chooser
|
1776 |
+
|
1777 |
if(!empty($this->params) || $this->hasItems){
|
1778 |
|
1779 |
$objSettings->addSap(esc_html__("General","unlimited-elements-for-elementor"),"config",true);
|
1780 |
|
1781 |
if($this->hasItems == true){
|
1782 |
+
|
1783 |
//$this->itemsType == self::ITEMS_TYPE_IMAGE
|
|
|
1784 |
$objSettings->addItemsPanel($this, $source);
|
1785 |
$objSettings->addHr("after_items_hr");
|
|
|
1786 |
}
|
1787 |
|
1788 |
$objSettings->initByCreatorParams($arrParams);
|
1909 |
$this->getHtmlConfig(true, $isOutputSidebar, $params);
|
1910 |
}
|
1911 |
|
1912 |
+
|
1913 |
/**
|
1914 |
* get object settings items for config (repeater)
|
1915 |
*/
|
1933 |
$objSettings->addGlobalParam("source", "addon", UniteSettingsUC::TYPE_IMAGE);
|
1934 |
}
|
1935 |
|
1936 |
+
|
1937 |
$objSettings->initByCreatorParams($this->paramsItems);
|
1938 |
+
|
1939 |
return($objSettings);
|
1940 |
}
|
1941 |
|
2120 |
public function getArrItemsForConfig(){
|
2121 |
|
2122 |
$arrItems = $this->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_CONFIG, false);
|
2123 |
+
|
2124 |
return($arrItems);
|
2125 |
}
|
2126 |
|
2293 |
|
2294 |
$this->validateInited();
|
2295 |
|
2296 |
+
if($this->hasItems == false && $this->operationType != self::OPERATION_WIDGET)
|
2297 |
return(false);
|
2298 |
|
2299 |
if($arrItems === GlobalsUC::VALUE_EMPTY_ARRAY)
|
2309 |
dmp("Error: ".$errorMessage);
|
2310 |
UniteFunctionsUC::throwError($errorMessage);
|
2311 |
}
|
2312 |
+
|
2313 |
$this->arrItems = $arrItems;
|
2314 |
}
|
2315 |
|
3216 |
public function setValuesFromTestData($slotNum){
|
3217 |
|
3218 |
$arrData = $this->getTestData($slotNum);
|
3219 |
+
|
3220 |
if(empty($arrData))
|
3221 |
return(false);
|
3222 |
|
inc_php/unitecreator_addon_config.class.php
CHANGED
@@ -64,7 +64,7 @@ class UniteCreatorAddonConfig extends HtmlOutputBaseUC{
|
|
64 |
* get item settings html
|
65 |
*/
|
66 |
private function getHtmlSettings($putMode = false){
|
67 |
-
|
68 |
$html = "";
|
69 |
|
70 |
$html .= self::TAB3."<div class='uc-addon-config-settings unite-settings'>".self::BR;
|
64 |
* get item settings html
|
65 |
*/
|
66 |
private function getHtmlSettings($putMode = false){
|
67 |
+
|
68 |
$html = "";
|
69 |
|
70 |
$html .= self::TAB3."<div class='uc-addon-config-settings unite-settings'>".self::BR;
|
inc_php/unitecreator_addons.class.php
CHANGED
@@ -1320,6 +1320,7 @@ class UniteCreatorAddons extends UniteElementsBaseUC{
|
|
1320 |
* save addon defaults from data
|
1321 |
*/
|
1322 |
public function saveAddonDefaultsFromData($data){
|
|
|
1323 |
$this->saveTestAddonData($data, 2);
|
1324 |
}
|
1325 |
|
@@ -1329,6 +1330,7 @@ class UniteCreatorAddons extends UniteElementsBaseUC{
|
|
1329 |
* @param $data
|
1330 |
*/
|
1331 |
public function getTestAddonData($data){
|
|
|
1332 |
$objAddon = $this->initAddonByData($data);
|
1333 |
$slotNum = UniteFunctionsUC::getVal($data, "slotnum");
|
1334 |
|
1320 |
* save addon defaults from data
|
1321 |
*/
|
1322 |
public function saveAddonDefaultsFromData($data){
|
1323 |
+
|
1324 |
$this->saveTestAddonData($data, 2);
|
1325 |
}
|
1326 |
|
1330 |
* @param $data
|
1331 |
*/
|
1332 |
public function getTestAddonData($data){
|
1333 |
+
|
1334 |
$objAddon = $this->initAddonByData($data);
|
1335 |
$slotNum = UniteFunctionsUC::getVal($data, "slotnum");
|
1336 |
|
inc_php/unitecreator_dialog_param.class.php
CHANGED
@@ -816,7 +816,7 @@ class UniteCreatorDialogParamWork{
|
|
816 |
"gallery"=>__("Gallery","unlimited-elements-for-elementor")
|
817 |
);
|
818 |
|
819 |
-
$htmlSelect = HelperHtmlUC::getHTMLSelect($arrItems,"template","name='use_for' class='unite-inputs-select uc-control' data-controlled-selector='.uc-listing-
|
820 |
|
821 |
?>
|
822 |
|
@@ -825,11 +825,20 @@ class UniteCreatorDialogParamWork{
|
|
825 |
<?php echo $htmlSelect?>
|
826 |
|
827 |
<div class="unite-inputs-sap-double"></div>
|
828 |
-
|
829 |
-
<div class="uc-listing-
|
830 |
<?php
|
831 |
|
832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
|
834 |
?>
|
835 |
</div>
|
816 |
"gallery"=>__("Gallery","unlimited-elements-for-elementor")
|
817 |
);
|
818 |
|
819 |
+
$htmlSelect = HelperHtmlUC::getHTMLSelect($arrItems,"template","name='use_for' class='unite-inputs-select uc-control' data-controlled-selector='.uc-listing-param-options'", true);
|
820 |
|
821 |
?>
|
822 |
|
825 |
<?php echo $htmlSelect?>
|
826 |
|
827 |
<div class="unite-inputs-sap-double"></div>
|
828 |
+
|
829 |
+
<div class="uc-listing-param-options" data-control="gallery">
|
830 |
<?php
|
831 |
|
832 |
+
$this->putCheckbox("gallery_enable_video", __("Enable Video Items", "unlimited-elements-for-elementor"));
|
833 |
+
|
834 |
+
?>
|
835 |
+
</div>
|
836 |
+
|
837 |
+
|
838 |
+
<div class="uc-listing-param-options" data-control="template">
|
839 |
+
<?php
|
840 |
+
|
841 |
+
$this->putCheckbox("enable_pagination", __("Enable Pagination", "unlimited-elements-for-elementor"));
|
842 |
|
843 |
?>
|
844 |
</div>
|
inc_php/unitecreator_helperhtml.class.php
CHANGED
@@ -919,6 +919,85 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
919 |
return($arrRating);
|
920 |
}
|
921 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
922 |
|
923 |
} //end class
|
924 |
|
919 |
return($arrRating);
|
920 |
}
|
921 |
|
922 |
+
/**
|
923 |
+
* put unite gallery item html
|
924 |
+
*/
|
925 |
+
public static function getUniteGalleryHtmlItem($item){
|
926 |
+
|
927 |
+
|
928 |
+
$type = UniteFunctionsUC::getVal($item, "type");
|
929 |
+
$title = UniteFunctionsUC::getVal($item, "title");
|
930 |
+
$link = UniteFunctionsUC::getVal($item, "link");
|
931 |
+
$image = UniteFunctionsUC::getVal($item, "image");
|
932 |
+
$thumb = UniteFunctionsUC::getVal($item, "thumb");
|
933 |
+
$description = UniteFunctionsUC::getVal($item, "description");
|
934 |
+
|
935 |
+
$title = htmlspecialchars($title);
|
936 |
+
$description = htmlspecialchars($description);
|
937 |
+
|
938 |
+
$linkStart = "";
|
939 |
+
$linkEnd = "";
|
940 |
+
|
941 |
+
if(!empty($link)){
|
942 |
+
$linkStart = "<a href=\"{$link}\">";
|
943 |
+
$linkEnd = "</a>";
|
944 |
+
}
|
945 |
+
|
946 |
+
$nl = "\n";
|
947 |
+
|
948 |
+
$html = "";
|
949 |
+
|
950 |
+
if($linkStart)
|
951 |
+
$html .= $nl.$linkStart;
|
952 |
+
|
953 |
+
$html .= $nl."<img alt=\"{$title}\"";
|
954 |
+
$html .= $nl." src=\"$thumb\"";
|
955 |
+
|
956 |
+
if(!empty($image))
|
957 |
+
$html .= $nl." data-image=\"$image\"";
|
958 |
+
|
959 |
+
if(!empty($title))
|
960 |
+
$html .= $nl." data-title=\"$title\"";
|
961 |
+
|
962 |
+
if(!empty($description))
|
963 |
+
$html .= $nl." data-description=\"$description\"";
|
964 |
+
|
965 |
+
if($type != "image")
|
966 |
+
$html .= $nl." data-type=\"$type\"";
|
967 |
+
|
968 |
+
|
969 |
+
switch($type){
|
970 |
+
|
971 |
+
case "youtube":
|
972 |
+
case "vimeo":
|
973 |
+
case "wistia":
|
974 |
+
|
975 |
+
$videoID = UniteFunctionsUC::getVal($item, "videoid");
|
976 |
+
|
977 |
+
if(!empty($videoID))
|
978 |
+
$html .= $nl." data-videoid=\"$videoID\"";
|
979 |
+
|
980 |
+
break;
|
981 |
+
case "html5video":
|
982 |
+
|
983 |
+
$urlMp4 = UniteFunctionsUC::getVal($item, "url_mp4");
|
984 |
+
|
985 |
+
if(!empty($urlMp4))
|
986 |
+
$html .= $nl." data-videomp4=\"$urlMp4\"";
|
987 |
+
|
988 |
+
break;
|
989 |
+
}
|
990 |
+
|
991 |
+
$html .= ">"; //image end
|
992 |
+
|
993 |
+
if($type != "image")
|
994 |
+
|
995 |
+
if(!empty($linkEnd))
|
996 |
+
$html .= $linkEnd;
|
997 |
+
|
998 |
+
return($html);
|
999 |
+
}
|
1000 |
+
|
1001 |
|
1002 |
} //end class
|
1003 |
|
inc_php/unitecreator_output.class.php
CHANGED
@@ -1811,7 +1811,7 @@ class UniteCreatorOutputWork extends HtmlOutputBaseUC{
|
|
1811 |
$arrParams = $this->getAddonParams();
|
1812 |
|
1813 |
$arrData = array_merge($arrData, $arrParams);
|
1814 |
-
|
1815 |
//set templates
|
1816 |
$html = $this->addon->getHtml();
|
1817 |
$css = $this->addon->getCss();
|
1811 |
$arrParams = $this->getAddonParams();
|
1812 |
|
1813 |
$arrData = array_merge($arrData, $arrParams);
|
1814 |
+
|
1815 |
//set templates
|
1816 |
$html = $this->addon->getHtml();
|
1817 |
$css = $this->addon->getCss();
|
inc_php/unitecreator_params_processor.class.php
CHANGED
@@ -13,6 +13,8 @@ class UniteCreatorParamsProcessorWork{
|
|
13 |
protected $addon;
|
14 |
private $processType;
|
15 |
private static $counter = 0;
|
|
|
|
|
16 |
|
17 |
const ITEMS_ATTRIBUTE_PREFIX = "uc_items_attribute_";
|
18 |
const KEY_ITEM_INDEX = "_uc_item_index_";
|
@@ -92,6 +94,9 @@ class UniteCreatorParamsProcessorWork{
|
|
92 |
break;
|
93 |
}
|
94 |
|
|
|
|
|
|
|
95 |
$addonType = $this->addon->getType();
|
96 |
|
97 |
if($addonType == "elementor")
|
@@ -176,17 +181,21 @@ class UniteCreatorParamsProcessorWork{
|
|
176 |
if($isResponsive == false)
|
177 |
return($data);
|
178 |
|
179 |
-
$
|
180 |
-
$
|
|
|
|
|
|
|
181 |
|
182 |
$name = UniteFunctionsUC::getVal($param, "name");
|
183 |
|
184 |
$data[$name."_tablet"] = $valueTablet;
|
185 |
$data[$name."_mobile"] = $valueMobile;
|
186 |
-
|
187 |
return($data);
|
188 |
}
|
189 |
-
|
|
|
190 |
private function a________FONTS_________(){}
|
191 |
|
192 |
|
@@ -899,13 +908,15 @@ class UniteCreatorParamsProcessorWork{
|
|
899 |
$data[$name] = $value;
|
900 |
}
|
901 |
|
|
|
|
|
902 |
|
903 |
$sizeFilters = UniteFunctionsUC::getVal($param, "size_filters");
|
904 |
$isNoAttributes = UniteFunctionsUC::getVal($param, "no_attributes");
|
905 |
$isNoImageData = UniteFunctionsUC::getVal($param, "no_image_data");
|
906 |
|
907 |
$data = $this->addOtherImageThumbs($data, $name, $value, $sizeFilters);
|
908 |
-
|
909 |
if($isNoImageData !== true)
|
910 |
$data = $this->addOtherImageData($data, $name, $value);
|
911 |
|
@@ -918,7 +929,6 @@ class UniteCreatorParamsProcessorWork{
|
|
918 |
if(empty($urlThumb))
|
919 |
$data[$keyThumb] = $urlImage;
|
920 |
|
921 |
-
|
922 |
return($data);
|
923 |
}
|
924 |
|
@@ -1025,11 +1035,10 @@ class UniteCreatorParamsProcessorWork{
|
|
1025 |
private function z_________INSTAGRAM_________(){}
|
1026 |
|
1027 |
|
1028 |
-
|
1029 |
/**
|
1030 |
* get instagram data
|
1031 |
*/
|
1032 |
-
|
1033 |
|
1034 |
try{
|
1035 |
|
@@ -1045,18 +1054,18 @@ class UniteCreatorParamsProcessorWork{
|
|
1045 |
|
1046 |
$value = UniteFunctionsUC::getVal($param, $name);
|
1047 |
}
|
1048 |
-
|
1049 |
if(empty($value))
|
1050 |
$value = UniteCreatorSettingsWork::INSTAGRAM_DEFAULT_VALUE;
|
1051 |
-
|
1052 |
$maxItems = UniteFunctionsUC::getVal($param, "max_items");
|
1053 |
|
1054 |
if(!empty($valueMaxItems))
|
1055 |
$maxItems = $valueMaxItems;
|
1056 |
-
|
1057 |
$services = new UniteServicesUC();
|
1058 |
$data = $services->getInstagramData($value, $maxItems);
|
1059 |
-
|
1060 |
return($data);
|
1061 |
|
1062 |
}catch(Exception $e){
|
@@ -1094,16 +1103,17 @@ class UniteCreatorParamsProcessorWork{
|
|
1094 |
* process items variables, based on variable type and item content
|
1095 |
*/
|
1096 |
private function getItemsVariablesProcessed($arrItem, $index, $numItems){
|
1097 |
-
|
1098 |
$arrVars = $this->addon->getVariablesItem();
|
1099 |
$arrVarData = array();
|
1100 |
-
|
1101 |
//get variables output object
|
1102 |
-
|
|
|
1103 |
|
1104 |
$objVarOutput = new UniteCreatorVariablesOutput();
|
1105 |
-
$objVarOutput->init($
|
1106 |
-
|
1107 |
foreach($arrVars as $var){
|
1108 |
$name = UniteFunctionsUC::getVal($var, "name");
|
1109 |
UniteFunctionsUC::validateNotEmpty($name, "variable name");
|
@@ -1431,6 +1441,16 @@ class UniteCreatorParamsProcessorWork{
|
|
1431 |
$url = UniteFunctionsUC::getVal($value, "url");
|
1432 |
$isExternal = UniteFunctionsUC::getVal($value, "is_external");
|
1433 |
$noFollow = UniteFunctionsUC::getVal($value, "nofollow");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1434 |
|
1435 |
$addHtml = "";
|
1436 |
if($isExternal == "on")
|
@@ -1441,6 +1461,8 @@ class UniteCreatorParamsProcessorWork{
|
|
1441 |
|
1442 |
$data[$name] = $url;
|
1443 |
$data[$name."_html_attributes"] = $addHtml;
|
|
|
|
|
1444 |
|
1445 |
return($data);
|
1446 |
}
|
@@ -1497,8 +1519,12 @@ class UniteCreatorParamsProcessorWork{
|
|
1497 |
|
1498 |
if($isResponsive == true){
|
1499 |
|
1500 |
-
$
|
1501 |
-
$
|
|
|
|
|
|
|
|
|
1502 |
|
1503 |
$data = $this->getSliderData_work($data, $valueTablet, $name."_tablet", true);
|
1504 |
$data = $this->getSliderData_work($data, $valueMobile, $name."_mobile", true);
|
@@ -1667,7 +1693,7 @@ class UniteCreatorParamsProcessorWork{
|
|
1667 |
* get main params processed, for output
|
1668 |
*/
|
1669 |
public function getProcessedMainParamsValues($processType){
|
1670 |
-
|
1671 |
$this->validateInited();
|
1672 |
|
1673 |
self::validateProcessType($processType);
|
@@ -1712,14 +1738,22 @@ class UniteCreatorParamsProcessorWork{
|
|
1712 |
}
|
1713 |
|
1714 |
|
|
|
1715 |
/**
|
1716 |
* get item data
|
1717 |
*/
|
1718 |
public function getProcessedItemsData($arrItems, $processType, $forTemplate = true, $filterType = null){
|
1719 |
-
|
1720 |
$this->validateInited();
|
1721 |
self::validateProcessType($processType);
|
1722 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1723 |
$this->setProcessType($processType);
|
1724 |
|
1725 |
if(empty($arrItems))
|
@@ -1765,9 +1799,9 @@ class UniteCreatorParamsProcessorWork{
|
|
1765 |
$elementorID = UniteFunctionsUC::getRandomString(5);
|
1766 |
|
1767 |
$arrParamsNew = $this->addon->setParamsValuesItems($arrItemValues, $arrItemParams);
|
1768 |
-
|
1769 |
$item = $this->getProcessedParamsValues($arrParamsNew, $processType, $filterType);
|
1770 |
-
|
1771 |
if($this->isOutputProcessType($processType) == true){
|
1772 |
$item = $this->processFonts($item, "items", $index);
|
1773 |
}
|
@@ -1805,7 +1839,6 @@ class UniteCreatorParamsProcessorWork{
|
|
1805 |
$arrVarsData = $this->getItemsVariablesProcessed($item, $index, $numItems);
|
1806 |
$item = array_merge($item, $arrVarsData);
|
1807 |
|
1808 |
-
|
1809 |
//add elementor id
|
1810 |
if($itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
|
1811 |
$item["item_repeater_class"] = "elementor-repeater-item-".$elementorID;
|
13 |
protected $addon;
|
14 |
private $processType;
|
15 |
private static $counter = 0;
|
16 |
+
private $arrMainParamsValuesCache = array();
|
17 |
+
|
18 |
|
19 |
const ITEMS_ATTRIBUTE_PREFIX = "uc_items_attribute_";
|
20 |
const KEY_ITEM_INDEX = "_uc_item_index_";
|
94 |
break;
|
95 |
}
|
96 |
|
97 |
+
if($value == "uc_no_editor_items")
|
98 |
+
$value = __("The background items will be shown only in front end","unlimited-elements-for-elementor");
|
99 |
+
|
100 |
$addonType = $this->addon->getType();
|
101 |
|
102 |
if($addonType == "elementor")
|
181 |
if($isResponsive == false)
|
182 |
return($data);
|
183 |
|
184 |
+
$defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
|
185 |
+
$defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
|
186 |
+
|
187 |
+
$valueTablet = UniteFunctionsUC::getVal($param, "value_tablet", $defaultValueTablet);
|
188 |
+
$valueMobile = UniteFunctionsUC::getVal($param, "value_mobile",$defaultValueMobile);
|
189 |
|
190 |
$name = UniteFunctionsUC::getVal($param, "name");
|
191 |
|
192 |
$data[$name."_tablet"] = $valueTablet;
|
193 |
$data[$name."_mobile"] = $valueMobile;
|
194 |
+
|
195 |
return($data);
|
196 |
}
|
197 |
+
|
198 |
+
|
199 |
private function a________FONTS_________(){}
|
200 |
|
201 |
|
908 |
$data[$name] = $value;
|
909 |
}
|
910 |
|
911 |
+
if(is_numeric($value) == false)
|
912 |
+
return($data);
|
913 |
|
914 |
$sizeFilters = UniteFunctionsUC::getVal($param, "size_filters");
|
915 |
$isNoAttributes = UniteFunctionsUC::getVal($param, "no_attributes");
|
916 |
$isNoImageData = UniteFunctionsUC::getVal($param, "no_image_data");
|
917 |
|
918 |
$data = $this->addOtherImageThumbs($data, $name, $value, $sizeFilters);
|
919 |
+
|
920 |
if($isNoImageData !== true)
|
921 |
$data = $this->addOtherImageData($data, $name, $value);
|
922 |
|
929 |
if(empty($urlThumb))
|
930 |
$data[$keyThumb] = $urlImage;
|
931 |
|
|
|
932 |
return($data);
|
933 |
}
|
934 |
|
1035 |
private function z_________INSTAGRAM_________(){}
|
1036 |
|
1037 |
|
|
|
1038 |
/**
|
1039 |
* get instagram data
|
1040 |
*/
|
1041 |
+
protected function getInstagramData($value, $name, $param){
|
1042 |
|
1043 |
try{
|
1044 |
|
1054 |
|
1055 |
$value = UniteFunctionsUC::getVal($param, $name);
|
1056 |
}
|
1057 |
+
|
1058 |
if(empty($value))
|
1059 |
$value = UniteCreatorSettingsWork::INSTAGRAM_DEFAULT_VALUE;
|
1060 |
+
|
1061 |
$maxItems = UniteFunctionsUC::getVal($param, "max_items");
|
1062 |
|
1063 |
if(!empty($valueMaxItems))
|
1064 |
$maxItems = $valueMaxItems;
|
1065 |
+
|
1066 |
$services = new UniteServicesUC();
|
1067 |
$data = $services->getInstagramData($value, $maxItems);
|
1068 |
+
|
1069 |
return($data);
|
1070 |
|
1071 |
}catch(Exception $e){
|
1103 |
* process items variables, based on variable type and item content
|
1104 |
*/
|
1105 |
private function getItemsVariablesProcessed($arrItem, $index, $numItems){
|
1106 |
+
|
1107 |
$arrVars = $this->addon->getVariablesItem();
|
1108 |
$arrVarData = array();
|
1109 |
+
|
1110 |
//get variables output object
|
1111 |
+
if(!empty($this->arrMainParamsValuesCache))
|
1112 |
+
$this->arrMainParamsValuesCache = $this->getProcessedMainParamsValues($this->processType);
|
1113 |
|
1114 |
$objVarOutput = new UniteCreatorVariablesOutput();
|
1115 |
+
$objVarOutput->init($this->arrMainParamsValuesCache);
|
1116 |
+
|
1117 |
foreach($arrVars as $var){
|
1118 |
$name = UniteFunctionsUC::getVal($var, "name");
|
1119 |
UniteFunctionsUC::validateNotEmpty($name, "variable name");
|
1441 |
$url = UniteFunctionsUC::getVal($value, "url");
|
1442 |
$isExternal = UniteFunctionsUC::getVal($value, "is_external");
|
1443 |
$noFollow = UniteFunctionsUC::getVal($value, "nofollow");
|
1444 |
+
|
1445 |
+
$urlFull = $url;
|
1446 |
+
$scheme = parse_url($url, PHP_URL_SCHEME);
|
1447 |
+
|
1448 |
+
if(empty($scheme)){
|
1449 |
+
$urlFull = "https://{$url}";
|
1450 |
+
$urlNoPrefix = $url;
|
1451 |
+
}else
|
1452 |
+
$urlNoPrefix = str_replace($scheme, "", $url);
|
1453 |
+
|
1454 |
|
1455 |
$addHtml = "";
|
1456 |
if($isExternal == "on")
|
1461 |
|
1462 |
$data[$name] = $url;
|
1463 |
$data[$name."_html_attributes"] = $addHtml;
|
1464 |
+
$data[$name."_full"] = $addHtml;
|
1465 |
+
$data[$name."_noprefix"] = $addHtml;
|
1466 |
|
1467 |
return($data);
|
1468 |
}
|
1519 |
|
1520 |
if($isResponsive == true){
|
1521 |
|
1522 |
+
$defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
|
1523 |
+
$defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
|
1524 |
+
|
1525 |
+
$valueTablet = UniteFunctionsUC::getVal($param, "value_tablet", $defaultValueTablet);
|
1526 |
+
$valueMobile = UniteFunctionsUC::getVal($param, "value_mobile", $defaultValueMobile);
|
1527 |
+
|
1528 |
|
1529 |
$data = $this->getSliderData_work($data, $valueTablet, $name."_tablet", true);
|
1530 |
$data = $this->getSliderData_work($data, $valueMobile, $name."_mobile", true);
|
1693 |
* get main params processed, for output
|
1694 |
*/
|
1695 |
public function getProcessedMainParamsValues($processType){
|
1696 |
+
|
1697 |
$this->validateInited();
|
1698 |
|
1699 |
self::validateProcessType($processType);
|
1738 |
}
|
1739 |
|
1740 |
|
1741 |
+
|
1742 |
/**
|
1743 |
* get item data
|
1744 |
*/
|
1745 |
public function getProcessedItemsData($arrItems, $processType, $forTemplate = true, $filterType = null){
|
1746 |
+
|
1747 |
$this->validateInited();
|
1748 |
self::validateProcessType($processType);
|
1749 |
|
1750 |
+
//in case of gallery grouped settings, don't process at all
|
1751 |
+
|
1752 |
+
$specialType = $this->addon->getSpecialType();
|
1753 |
+
if($specialType == UniteCreatorAddon::ITEMS_TYPE_IMAGE)
|
1754 |
+
return($arrItems);
|
1755 |
+
|
1756 |
+
|
1757 |
$this->setProcessType($processType);
|
1758 |
|
1759 |
if(empty($arrItems))
|
1799 |
$elementorID = UniteFunctionsUC::getRandomString(5);
|
1800 |
|
1801 |
$arrParamsNew = $this->addon->setParamsValuesItems($arrItemValues, $arrItemParams);
|
1802 |
+
|
1803 |
$item = $this->getProcessedParamsValues($arrParamsNew, $processType, $filterType);
|
1804 |
+
|
1805 |
if($this->isOutputProcessType($processType) == true){
|
1806 |
$item = $this->processFonts($item, "items", $index);
|
1807 |
}
|
1839 |
$arrVarsData = $this->getItemsVariablesProcessed($item, $index, $numItems);
|
1840 |
$item = array_merge($item, $arrVarsData);
|
1841 |
|
|
|
1842 |
//add elementor id
|
1843 |
if($itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
|
1844 |
$item["item_repeater_class"] = "elementor-repeater-item-".$elementorID;
|
inc_php/unitecreator_settings.class.php
CHANGED
@@ -306,8 +306,8 @@ class UniteCreatorSettingsWork extends UniteSettingsAdvancedUC{
|
|
306 |
|
307 |
$defaultMaxItems = UniteFunctionsUC::getVal($extra, "max_items");
|
308 |
if(is_numeric($defaultMaxItems) == false || $defaultMaxItems < 1)
|
309 |
-
$defaultMaxItems =
|
310 |
-
|
311 |
$objServies = new UniteServicesUC();
|
312 |
$objServies->includeInstagramAPI();
|
313 |
|
306 |
|
307 |
$defaultMaxItems = UniteFunctionsUC::getVal($extra, "max_items");
|
308 |
if(is_numeric($defaultMaxItems) == false || $defaultMaxItems < 1)
|
309 |
+
$defaultMaxItems = 12;
|
310 |
+
|
311 |
$objServies = new UniteServicesUC();
|
312 |
$objServies->includeInstagramAPI();
|
313 |
|
inc_php/unitecreator_template_engine.class.php
CHANGED
@@ -16,6 +16,7 @@ class UniteCreatorTemplateEngineWork{
|
|
16 |
protected $arrItems = array();
|
17 |
protected $addon = null;
|
18 |
protected $objParamsProcessor;
|
|
|
19 |
|
20 |
|
21 |
/**
|
@@ -286,17 +287,33 @@ class UniteCreatorTemplateEngineWork{
|
|
286 |
/**
|
287 |
* filter uc date, clear html first, then replace the date
|
288 |
*/
|
289 |
-
public function filterUCDate($dateStamp, $format = "d F Y, H:i"){
|
290 |
|
291 |
$hasTags = false;
|
292 |
$stamp = $dateStamp;
|
293 |
|
|
|
294 |
if(is_numeric($dateStamp) == false){
|
295 |
$hasTags = true;
|
296 |
$stamp = strip_tags($dateStamp);
|
297 |
$stamp = trim($stamp);
|
298 |
}
|
299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
$strDate = date_i18n($format, $stamp);
|
301 |
|
302 |
if($hasTags == true)
|
@@ -336,7 +353,7 @@ class UniteCreatorTemplateEngineWork{
|
|
336 |
public function put_date_utc($strDate){
|
337 |
|
338 |
$stamp = strtotime($strDate);
|
339 |
-
|
340 |
$strUTC = gmdate('Y/m/d H:i:s', $stamp);
|
341 |
|
342 |
echo UniteProviderFunctionsUC::escCombinedHtml($strUTC);
|
@@ -847,14 +864,44 @@ class UniteCreatorTemplateEngineWork{
|
|
847 |
return("no");
|
848 |
|
849 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
850 |
default:
|
851 |
-
$strTypes = "put_date_range, get_general_setting,
|
852 |
-
run_code_once, get_post_term,
|
853 |
-
is_post_has_term, get_from_sql";
|
854 |
|
855 |
$type = UniteFunctionsUC::sanitizeAttr($type);
|
856 |
|
857 |
-
dmp("ucfunc error: unknown action <b>'$type'</b
|
858 |
break;
|
859 |
}
|
860 |
|
@@ -1026,7 +1073,7 @@ class UniteCreatorTemplateEngineWork{
|
|
1026 |
|
1027 |
$arrOptions = array();
|
1028 |
$arrOptions["debug"] = true;
|
1029 |
-
|
1030 |
$this->twig = new Twig_Environment($loader, $arrOptions);
|
1031 |
$this->twig->addExtension(new Twig_Extension_Debug());
|
1032 |
|
16 |
protected $arrItems = array();
|
17 |
protected $addon = null;
|
18 |
protected $objParamsProcessor;
|
19 |
+
private static $arrSetVarsCache = array();
|
20 |
|
21 |
|
22 |
/**
|
287 |
/**
|
288 |
* filter uc date, clear html first, then replace the date
|
289 |
*/
|
290 |
+
public function filterUCDate($dateStamp, $format = "d F Y, H:i", $formatDateFrom = "d/m/Y"){
|
291 |
|
292 |
$hasTags = false;
|
293 |
$stamp = $dateStamp;
|
294 |
|
295 |
+
//try to stip tags
|
296 |
if(is_numeric($dateStamp) == false){
|
297 |
$hasTags = true;
|
298 |
$stamp = strip_tags($dateStamp);
|
299 |
$stamp = trim($stamp);
|
300 |
}
|
301 |
|
302 |
+
/**
|
303 |
+
* convert from string
|
304 |
+
*/
|
305 |
+
if(is_numeric($stamp) == false){
|
306 |
+
|
307 |
+
$hasTags = false;
|
308 |
+
|
309 |
+
$objDate = DateTime::createFromFormat($formatDateFrom, $stamp);
|
310 |
+
|
311 |
+
if(!empty($objDate))
|
312 |
+
$stamp = @$objDate->getTimeStamp();
|
313 |
+
else
|
314 |
+
$stamp = time();
|
315 |
+
}
|
316 |
+
|
317 |
$strDate = date_i18n($format, $stamp);
|
318 |
|
319 |
if($hasTags == true)
|
353 |
public function put_date_utc($strDate){
|
354 |
|
355 |
$stamp = strtotime($strDate);
|
356 |
+
|
357 |
$strUTC = gmdate('Y/m/d H:i:s', $stamp);
|
358 |
|
359 |
echo UniteProviderFunctionsUC::escCombinedHtml($strUTC);
|
864 |
return("no");
|
865 |
|
866 |
break;
|
867 |
+
case "put_unite_gallery_item":
|
868 |
+
|
869 |
+
$htmlItem = HelperHtmlUC::getUniteGalleryHtmlItem($arg1);
|
870 |
+
|
871 |
+
echo $htmlItem;
|
872 |
+
|
873 |
+
break;
|
874 |
+
case "set": //set and remember
|
875 |
+
self::$arrSetVarsCache[$arg1] = $arg2;
|
876 |
+
break;
|
877 |
+
case "get":
|
878 |
+
|
879 |
+
$var = UniteFunctionsUC::getVal(self::$arrSetVarsCache, $arg1);
|
880 |
+
|
881 |
+
return($var);
|
882 |
+
break;
|
883 |
+
case "get_wc_variations":
|
884 |
+
|
885 |
+
$productID = $arg1;
|
886 |
+
|
887 |
+
$objWoo = new UniteCreatorWooIntegrate();
|
888 |
+
$arrVariations = $objWoo->getProductVariations($productID);
|
889 |
+
|
890 |
+
return($arrVariations);
|
891 |
+
break;
|
892 |
+
case "get_unitegallery_js":
|
893 |
+
|
894 |
+
$objUniteGallery = new UniteCreatorUniteGallery();
|
895 |
+
|
896 |
+
$objJsSettings = $objUniteGallery->getUniteGalleryJsSettings($this->arrParams, $this->addon);
|
897 |
+
|
898 |
+
return($objJsSettings);
|
899 |
+
break;
|
900 |
default:
|
|
|
|
|
|
|
901 |
|
902 |
$type = UniteFunctionsUC::sanitizeAttr($type);
|
903 |
|
904 |
+
dmp("ucfunc error: unknown action <b>'$type'</b>");
|
905 |
break;
|
906 |
}
|
907 |
|
1073 |
|
1074 |
$arrOptions = array();
|
1075 |
$arrOptions["debug"] = true;
|
1076 |
+
|
1077 |
$this->twig = new Twig_Environment($loader, $arrOptions);
|
1078 |
$this->twig->addExtension(new Twig_Extension_Debug());
|
1079 |
|
inc_php/unitecreator_unitegallery.class.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Unlimited Elements
|
4 |
+
* @author unlimited-elements.com
|
5 |
+
* @copyright (C) 2021 Unlimited Elements, All Rights Reserved.
|
6 |
+
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
7 |
+
* */
|
8 |
+
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
9 |
+
|
10 |
+
class UniteCreatorUniteGallery{
|
11 |
+
|
12 |
+
|
13 |
+
/**
|
14 |
+
* get gallery js settings from data
|
15 |
+
*/
|
16 |
+
public function getUniteGalleryJsSettings($data,UniteCreatorAddon $addon){
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
dmp($data);
|
21 |
+
|
22 |
+
|
23 |
+
dmp("get settings from data");
|
24 |
+
exit();
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
}
|
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 |
require_once GlobalsUC::$pathProvider . 'integrations.class.php';
|
89 |
|
90 |
//page builder related
|
12 |
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
13 |
|
14 |
if(!defined("UNLIMITED_ELEMENTS_VERSION"))
|
15 |
+
define("UNLIMITED_ELEMENTS_VERSION", "1.4.83");
|
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 $folderIncludesMain . 'unitecreator_unitegallery.class.php';
|
89 |
require_once GlobalsUC::$pathProvider . 'integrations.class.php';
|
90 |
|
91 |
//page builder related
|
js/admin.js
CHANGED
@@ -845,7 +845,7 @@ function UniteAdminUC(){
|
|
845 |
var inputName = objInput.prop("name");
|
846 |
if(!inputName)
|
847 |
inputName = objInput[0].tagname;
|
848 |
-
|
849 |
trace(objInput);
|
850 |
console.trace();
|
851 |
|
@@ -2573,7 +2573,7 @@ function trace(data,clear){
|
|
2573 |
|
2574 |
if(!g_ucAdmin)
|
2575 |
g_ucAdmin = new UniteAdminUC();
|
2576 |
-
|
2577 |
g_ucAdmin.trace(data,clear);
|
2578 |
}
|
2579 |
|
845 |
var inputName = objInput.prop("name");
|
846 |
if(!inputName)
|
847 |
inputName = objInput[0].tagname;
|
848 |
+
|
849 |
trace(objInput);
|
850 |
console.trace();
|
851 |
|
2573 |
|
2574 |
if(!g_ucAdmin)
|
2575 |
g_ucAdmin = new UniteAdminUC();
|
2576 |
+
|
2577 |
g_ucAdmin.trace(data,clear);
|
2578 |
}
|
2579 |
|
js/manager/unitecreator_manager_actions_inline.js
CHANGED
@@ -169,7 +169,7 @@ function UCManagerActionsInline(){
|
|
169 |
}
|
170 |
|
171 |
urlImage = g_ucAdmin.urlToRelative(urlImage);
|
172 |
-
|
173 |
addItemFromImage(urlImage);
|
174 |
});
|
175 |
|
@@ -307,7 +307,7 @@ function UCManagerActionsInline(){
|
|
307 |
* generate item html
|
308 |
*/
|
309 |
function generateItemHtml(params, id){
|
310 |
-
|
311 |
//set title
|
312 |
var title = generateItemTitle();
|
313 |
var altTitle = getTitleFromParams(params);
|
@@ -326,6 +326,9 @@ function UCManagerActionsInline(){
|
|
326 |
if(!urlImage && g_imageField && params.hasOwnProperty(g_imageField))
|
327 |
urlImage = jQuery.trim(params[g_imageField]);
|
328 |
|
|
|
|
|
|
|
329 |
var descStyle = "";
|
330 |
if(urlImage){
|
331 |
urlImage = g_ucAdmin.urlToFull(urlImage);
|
@@ -433,8 +436,9 @@ function UCManagerActionsInline(){
|
|
433 |
* set thumb field for viewing the thumb
|
434 |
*/
|
435 |
function init_setImageField(){
|
436 |
-
|
437 |
var arrFieldNames = g_objSettings.getFieldNamesByType("image");
|
|
|
438 |
if(arrFieldNames.length == 0)
|
439 |
return(false);
|
440 |
|
@@ -466,7 +470,7 @@ function UCManagerActionsInline(){
|
|
466 |
|
467 |
g_objSettings = new UniteSettingsUC();
|
468 |
g_objSettings.init(g_objSettingsWrapper);
|
469 |
-
|
470 |
init_setImageField();
|
471 |
}
|
472 |
|
169 |
}
|
170 |
|
171 |
urlImage = g_ucAdmin.urlToRelative(urlImage);
|
172 |
+
|
173 |
addItemFromImage(urlImage);
|
174 |
});
|
175 |
|
307 |
* generate item html
|
308 |
*/
|
309 |
function generateItemHtml(params, id){
|
310 |
+
|
311 |
//set title
|
312 |
var title = generateItemTitle();
|
313 |
var altTitle = getTitleFromParams(params);
|
326 |
if(!urlImage && g_imageField && params.hasOwnProperty(g_imageField))
|
327 |
urlImage = jQuery.trim(params[g_imageField]);
|
328 |
|
329 |
+
trace('generateItemHtml');
|
330 |
+
trace(urlImage);
|
331 |
+
|
332 |
var descStyle = "";
|
333 |
if(urlImage){
|
334 |
urlImage = g_ucAdmin.urlToFull(urlImage);
|
436 |
* set thumb field for viewing the thumb
|
437 |
*/
|
438 |
function init_setImageField(){
|
439 |
+
|
440 |
var arrFieldNames = g_objSettings.getFieldNamesByType("image");
|
441 |
+
|
442 |
if(arrFieldNames.length == 0)
|
443 |
return(false);
|
444 |
|
470 |
|
471 |
g_objSettings = new UniteSettingsUC();
|
472 |
g_objSettings.init(g_objSettingsWrapper);
|
473 |
+
|
474 |
init_setImageField();
|
475 |
}
|
476 |
|
js/manager/unitecreator_manager_cats.js
CHANGED
@@ -55,6 +55,7 @@ function UCManagerAdminCats(){
|
|
55 |
initEvents();
|
56 |
|
57 |
//update sortable categories
|
|
|
58 |
g_objListCats.sortable({
|
59 |
axis:'y',
|
60 |
start: function( event, ui ) {
|
@@ -64,7 +65,11 @@ function UCManagerAdminCats(){
|
|
64 |
updateCatOrder();
|
65 |
//save sorting order
|
66 |
}
|
67 |
-
});
|
|
|
|
|
|
|
|
|
68 |
|
69 |
initAddCategoryDialog();
|
70 |
|
55 |
initEvents();
|
56 |
|
57 |
//update sortable categories
|
58 |
+
try{
|
59 |
g_objListCats.sortable({
|
60 |
axis:'y',
|
61 |
start: function( event, ui ) {
|
65 |
updateCatOrder();
|
66 |
//save sorting order
|
67 |
}
|
68 |
+
});
|
69 |
+
}catch(error){
|
70 |
+
trace("error occured in jquery sortable!");
|
71 |
+
trace(error);
|
72 |
+
}
|
73 |
|
74 |
initAddCategoryDialog();
|
75 |
|
js/unitecreator_params_dialog.js
CHANGED
@@ -690,7 +690,7 @@ function UniteCreatorParamsDialog(){
|
|
690 |
|
691 |
clearDropdownParam(objTable);
|
692 |
|
693 |
-
if(
|
694 |
dropdownParamAddRow(objTable);
|
695 |
else{
|
696 |
|
@@ -860,9 +860,9 @@ function UniteCreatorParamsDialog(){
|
|
860 |
|
861 |
//fill
|
862 |
objDropdownParam.onFillInputData = function(objTable, objData){
|
863 |
-
|
864 |
-
if(objData.options)
|
865 |
fillDropdownParamOptions(objTable, objData.options, objData.default_value);
|
|
|
866 |
}
|
867 |
|
868 |
|
@@ -1420,7 +1420,7 @@ function UniteCreatorParamsDialog(){
|
|
1420 |
var trueValue = g_ucAdmin.getVal(objParam, "true_value");
|
1421 |
|
1422 |
var falseName = g_ucAdmin.getVal(objParam, "false_name");
|
1423 |
-
var falseValue =
|
1424 |
|
1425 |
var options = {};
|
1426 |
options[trueName] = trueValue;
|
@@ -1909,11 +1909,7 @@ function UniteCreatorParamsDialog(){
|
|
1909 |
|
1910 |
var objChild = jQuery(child);
|
1911 |
var childValue = objChild.data("control");
|
1912 |
-
|
1913 |
-
trace(objChild);
|
1914 |
-
trace(childValue);
|
1915 |
-
trace(value);
|
1916 |
-
|
1917 |
if(childValue == value)
|
1918 |
objChild.show();
|
1919 |
else
|
690 |
|
691 |
clearDropdownParam(objTable);
|
692 |
|
693 |
+
if(jQuery.isEmptyObject(options))
|
694 |
dropdownParamAddRow(objTable);
|
695 |
else{
|
696 |
|
860 |
|
861 |
//fill
|
862 |
objDropdownParam.onFillInputData = function(objTable, objData){
|
863 |
+
|
|
|
864 |
fillDropdownParamOptions(objTable, objData.options, objData.default_value);
|
865 |
+
|
866 |
}
|
867 |
|
868 |
|
1420 |
var trueValue = g_ucAdmin.getVal(objParam, "true_value");
|
1421 |
|
1422 |
var falseName = g_ucAdmin.getVal(objParam, "false_name");
|
1423 |
+
var falseValue = "";
|
1424 |
|
1425 |
var options = {};
|
1426 |
options[trueName] = trueValue;
|
1909 |
|
1910 |
var objChild = jQuery(child);
|
1911 |
var childValue = objChild.data("control");
|
1912 |
+
|
|
|
|
|
|
|
|
|
1913 |
if(childValue == value)
|
1914 |
objChild.show();
|
1915 |
else
|
provider/core/plugins/unlimited_elements/copy_paste.class.php
CHANGED
@@ -180,7 +180,7 @@ class UniteCreatorElementorCopyPaste{
|
|
180 |
* get section zip from data
|
181 |
*/
|
182 |
public function getSectionZipFromData($data){
|
183 |
-
|
184 |
try{
|
185 |
|
186 |
$postID = UniteFunctionsUC::getVal($data, "postid");
|
180 |
* get section zip from data
|
181 |
*/
|
182 |
public function getSectionZipFromData($data){
|
183 |
+
|
184 |
try{
|
185 |
|
186 |
$postID = UniteFunctionsUC::getVal($data, "postid");
|
provider/core/plugins/unlimited_elements/dialog_param_elementor.class.php
CHANGED
@@ -387,6 +387,8 @@ class UniteCreatorDialogParamElementor extends UniteCreatorDialogParam{
|
|
387 |
$arrUnits["px_percent"] = __("PX, %","unlimited-elements-for-elementor");
|
388 |
$arrUnits["px_percent_em"] = __("PX, %, EM","unlimited-elements-for-elementor");
|
389 |
$arrUnits["vh_px"] = __("VH, PX","unlimited-elements-for-elementor");
|
|
|
|
|
390 |
|
391 |
|
392 |
$arrUnits = array_flip($arrUnits);
|
387 |
$arrUnits["px_percent"] = __("PX, %","unlimited-elements-for-elementor");
|
388 |
$arrUnits["px_percent_em"] = __("PX, %, EM","unlimited-elements-for-elementor");
|
389 |
$arrUnits["vh_px"] = __("VH, PX","unlimited-elements-for-elementor");
|
390 |
+
$arrUnits["px_vh"] = __("PX, VH","unlimited-elements-for-elementor");
|
391 |
+
$arrUnits["px_vh_percent"] = __("PX, VH, %","unlimited-elements-for-elementor");
|
392 |
|
393 |
|
394 |
$arrUnits = array_flip($arrUnits);
|
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.css
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
@CHARSET "ISO-8859-1";
|
2 |
|
3 |
-
|
4 |
-
.uc-button-edit-html{
|
5 |
margin-top:5px;
|
6 |
}
|
7 |
|
8 |
-
.uc-elementor-control-disabled input[type='text']{
|
9 |
background-color:#f9f9f9;
|
10 |
color:#928D8C;
|
11 |
}
|
12 |
|
13 |
-
.unite-setting-post-type{
|
14 |
height:70px;
|
15 |
min-width:135px !important;
|
16 |
}
|
@@ -18,17 +17,17 @@
|
|
18 |
|
19 |
/* --- icons --- */
|
20 |
|
21 |
-
.uc-default-widget-icon::after{
|
22 |
background-image:url('../images/widget-icon.svg');
|
23 |
}
|
24 |
|
25 |
-
.ue-widget-icon{
|
26 |
min-width:40px;
|
27 |
-
min-height:
|
28 |
display:inline-block;
|
29 |
}
|
30 |
|
31 |
-
.ue-widget-icon::after{
|
32 |
xcontent:"UE";
|
33 |
content:url(../images/logo-mini.svg);
|
34 |
opacity:0.5;
|
@@ -45,22 +44,22 @@
|
|
45 |
padding-right:4px;
|
46 |
}
|
47 |
|
48 |
-
.ue-widget-icon.ue-dark-mode::after{
|
49 |
filter: brightness(4);
|
50 |
}
|
51 |
|
52 |
-
.ue-wi-svg::after{
|
53 |
height:44px;
|
54 |
background-size:auto 34px;
|
55 |
background-position:center bottom;
|
56 |
background-repeat:no-repeat;
|
57 |
}
|
58 |
|
59 |
-
.ue-wi-svg::before{
|
60 |
opacity:0;
|
61 |
}
|
62 |
|
63 |
-
.elementor-element-wrapper:hover .ue-widget-icon.uc-wi-preview::after{
|
64 |
content:"";
|
65 |
display:block;
|
66 |
position:absolute;
|
@@ -94,12 +93,12 @@
|
|
94 |
opacity:1;
|
95 |
}
|
96 |
|
97 |
-
.elementor-element-wrapper:hover .ue-widget-icon.ue-dark-mode.uc-wi-preview::after{
|
98 |
background-color:#404349;
|
99 |
box-shadow: inset 0 -22px 6px -6px rgba(64, 67, 73, 0.9);
|
100 |
}
|
101 |
|
102 |
-
.uc-panel-ajax-loader{
|
103 |
display:inline-block;
|
104 |
background-image:url(../images/loader.gif);
|
105 |
background-repeat:no-repeat;
|
@@ -114,23 +113,23 @@
|
|
114 |
}
|
115 |
|
116 |
/* button edit post */
|
117 |
-
.uc-button-edit-wrapper{
|
118 |
padding-top:5px;
|
119 |
padding-right:5px;
|
120 |
text-align:right;
|
121 |
}
|
122 |
|
123 |
-
.uc-button-edit-wrapper a{
|
124 |
font-size:11px !important;
|
125 |
font-weight:normal !important;
|
126 |
color:#6d7882 !important;
|
127 |
}
|
128 |
|
129 |
-
.uc-button-edit-wrapper a:hover{
|
130 |
text-decoration:underline;
|
131 |
}
|
132 |
|
133 |
-
.uc-notification-control{
|
134 |
background-color:#fef8ee;
|
135 |
border-left:2px solid #f0b848;
|
136 |
padding:10px;
|
1 |
@CHARSET "ISO-8859-1";
|
2 |
|
3 |
+
.elementor-panel .uc-button-edit-html{
|
|
|
4 |
margin-top:5px;
|
5 |
}
|
6 |
|
7 |
+
.elementor-panel .uc-elementor-control-disabled input[type='text']{
|
8 |
background-color:#f9f9f9;
|
9 |
color:#928D8C;
|
10 |
}
|
11 |
|
12 |
+
.elementor-panel .unite-setting-post-type{
|
13 |
height:70px;
|
14 |
min-width:135px !important;
|
15 |
}
|
17 |
|
18 |
/* --- icons --- */
|
19 |
|
20 |
+
.elementor-panel .uc-default-widget-icon::after{
|
21 |
background-image:url('../images/widget-icon.svg');
|
22 |
}
|
23 |
|
24 |
+
.elementor-panel .ue-widget-icon{
|
25 |
min-width:40px;
|
26 |
+
min-height:23px;
|
27 |
display:inline-block;
|
28 |
}
|
29 |
|
30 |
+
.elementor-panel .ue-widget-icon::after{
|
31 |
xcontent:"UE";
|
32 |
content:url(../images/logo-mini.svg);
|
33 |
opacity:0.5;
|
44 |
padding-right:4px;
|
45 |
}
|
46 |
|
47 |
+
.elementor-panel .ue-widget-icon.ue-dark-mode::after{
|
48 |
filter: brightness(4);
|
49 |
}
|
50 |
|
51 |
+
.elementor-panel .ue-wi-svg::after{
|
52 |
height:44px;
|
53 |
background-size:auto 34px;
|
54 |
background-position:center bottom;
|
55 |
background-repeat:no-repeat;
|
56 |
}
|
57 |
|
58 |
+
.elementor-panel .ue-wi-svg::before{
|
59 |
opacity:0;
|
60 |
}
|
61 |
|
62 |
+
.elementor-panel .elementor-element-wrapper:hover .ue-widget-icon.uc-wi-preview::after{
|
63 |
content:"";
|
64 |
display:block;
|
65 |
position:absolute;
|
93 |
opacity:1;
|
94 |
}
|
95 |
|
96 |
+
.elementor-panel .elementor-element-wrapper:hover .ue-widget-icon.ue-dark-mode.uc-wi-preview::after{
|
97 |
background-color:#404349;
|
98 |
box-shadow: inset 0 -22px 6px -6px rgba(64, 67, 73, 0.9);
|
99 |
}
|
100 |
|
101 |
+
.elementor-panel .uc-panel-ajax-loader{
|
102 |
display:inline-block;
|
103 |
background-image:url(../images/loader.gif);
|
104 |
background-repeat:no-repeat;
|
113 |
}
|
114 |
|
115 |
/* button edit post */
|
116 |
+
.elementor-panel .uc-button-edit-wrapper{
|
117 |
padding-top:5px;
|
118 |
padding-right:5px;
|
119 |
text-align:right;
|
120 |
}
|
121 |
|
122 |
+
.elementor-panel .uc-button-edit-wrapper a{
|
123 |
font-size:11px !important;
|
124 |
font-weight:normal !important;
|
125 |
color:#6d7882 !important;
|
126 |
}
|
127 |
|
128 |
+
.elementor-panel .uc-button-edit-wrapper a:hover{
|
129 |
text-decoration:underline;
|
130 |
}
|
131 |
|
132 |
+
.elementor-panel .uc-notification-control{
|
133 |
background-color:#fef8ee;
|
134 |
border-left:2px solid #f0b848;
|
135 |
padding:10px;
|
provider/core/plugins/unlimited_elements/elementor/assets/uc_editor_admin.js
CHANGED
@@ -1278,7 +1278,7 @@ function UniteCreatorElementorEditorAdmin(){
|
|
1278 |
* get settings from elementor
|
1279 |
*/
|
1280 |
function getSettingsFromElementor(id){
|
1281 |
-
|
1282 |
var data = elementor.config.data;
|
1283 |
|
1284 |
var objSettings = searchElementorData(data, id);
|
@@ -1328,7 +1328,7 @@ function UniteCreatorElementorEditorAdmin(){
|
|
1328 |
funcError(textStatus);
|
1329 |
}
|
1330 |
}
|
1331 |
-
|
1332 |
jQuery.ajax(ajaxOptions);
|
1333 |
|
1334 |
}
|
@@ -1350,7 +1350,13 @@ function UniteCreatorElementorEditorAdmin(){
|
|
1350 |
|
1351 |
var shortKey = key.replace(type+"_", "");
|
1352 |
|
1353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1354 |
}
|
1355 |
|
1356 |
return(objSettingsData);
|
1278 |
* get settings from elementor
|
1279 |
*/
|
1280 |
function getSettingsFromElementor(id){
|
1281 |
+
|
1282 |
var data = elementor.config.data;
|
1283 |
|
1284 |
var objSettings = searchElementorData(data, id);
|
1328 |
funcError(textStatus);
|
1329 |
}
|
1330 |
}
|
1331 |
+
|
1332 |
jQuery.ajax(ajaxOptions);
|
1333 |
|
1334 |
}
|
1350 |
|
1351 |
var shortKey = key.replace(type+"_", "");
|
1352 |
|
1353 |
+
var objData = objSettings[key];
|
1354 |
+
|
1355 |
+
if(typeof objData == "object" && objData.hasOwnProperty("model") && objData.hasOwnProperty("_byId")){
|
1356 |
+
objData = [{"title":"uc_no_editor_items"}];
|
1357 |
+
}
|
1358 |
+
|
1359 |
+
objSettingsData[shortKey] = objData;
|
1360 |
}
|
1361 |
|
1362 |
return(objSettingsData);
|
provider/core/plugins/unlimited_elements/elementor/elementor_background_widget.class.php
CHANGED
@@ -90,6 +90,14 @@ class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget
|
|
90 |
|
91 |
$params = $this->objAddon->getProcessedMainParams();
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
if(empty($params)){
|
94 |
|
95 |
$this->addNoParamsBGHeading();
|
@@ -100,9 +108,6 @@ class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget
|
|
100 |
|
101 |
$params = $this->addDynamicAttributes($params);
|
102 |
|
103 |
-
//if($isGeneralSection == true && $isItemsEnabled == true && $itemsType == "image")
|
104 |
-
//$this->addGalleryControlUC();
|
105 |
-
|
106 |
foreach($params as $param){
|
107 |
|
108 |
$type = UniteFunctionsUC::getVal($param, "type");
|
@@ -114,8 +119,12 @@ class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget
|
|
114 |
$this->addElementorParamUC($param);
|
115 |
}
|
116 |
|
|
|
|
|
|
|
117 |
}
|
118 |
|
|
|
119 |
/**
|
120 |
* get background settings by section settings
|
121 |
*/
|
90 |
|
91 |
$params = $this->objAddon->getProcessedMainParams();
|
92 |
|
93 |
+
$isItemsEnabled = $this->objAddon->isHasItems();
|
94 |
+
$itemsType = $this->objAddon->getItemsType();
|
95 |
+
|
96 |
+
$isAddItems = false;
|
97 |
+
if($isItemsEnabled == true && $itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
|
98 |
+
$isAddItems = true;
|
99 |
+
|
100 |
+
|
101 |
if(empty($params)){
|
102 |
|
103 |
$this->addNoParamsBGHeading();
|
108 |
|
109 |
$params = $this->addDynamicAttributes($params);
|
110 |
|
|
|
|
|
|
|
111 |
foreach($params as $param){
|
112 |
|
113 |
$type = UniteFunctionsUC::getVal($param, "type");
|
119 |
$this->addElementorParamUC($param);
|
120 |
}
|
121 |
|
122 |
+
if($isAddItems == true)
|
123 |
+
$this->addItemsControlsUC($itemsType);
|
124 |
+
|
125 |
}
|
126 |
|
127 |
+
|
128 |
/**
|
129 |
* get background settings by section settings
|
130 |
*/
|
provider/core/plugins/unlimited_elements/elementor/elementor_content.class.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
4 |
-
|
5 |
-
class UniteCreatorElementorContnet{
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
provider/core/plugins/unlimited_elements/elementor/elementor_controls.class.php
CHANGED
@@ -10,11 +10,52 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
10 |
class UniteCreatorElementorControls{
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* add repeater control
|
15 |
*/
|
16 |
-
public function addGalleryImageVideoRepeater($objControls, $textPrefix, $name){
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
$repeater = new Repeater();
|
19 |
|
20 |
$objControls->start_controls_section(
|
@@ -26,36 +67,25 @@ class UniteCreatorElementorControls{
|
|
26 |
|
27 |
// ---- item type ---------
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
'
|
37 |
-
'
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
41 |
)
|
42 |
-
|
43 |
-
|
44 |
|
45 |
-
//--------- image --------
|
46 |
-
|
47 |
-
$repeater->add_control(
|
48 |
-
'image',
|
49 |
-
array(
|
50 |
-
'label' => __( 'Choose Image', 'unlimited-elements-for-elementor' ),
|
51 |
-
'type' => Controls_Manager::MEDIA,
|
52 |
-
'default' => array(
|
53 |
-
'url' => Utils::get_placeholder_image_src(),
|
54 |
-
),
|
55 |
-
'condition'=>array('item_type'=>'image')
|
56 |
-
)
|
57 |
-
);
|
58 |
-
|
59 |
//--------- youtube url --------
|
60 |
|
61 |
$repeater->add_control(
|
@@ -64,7 +94,8 @@ class UniteCreatorElementorControls{
|
|
64 |
'label' => __( 'Youtube Url or ID', 'unlimited-elements-for-elementor' ),
|
65 |
'type' => Controls_Manager::TEXT,
|
66 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
67 |
-
'description'=>'For example: https://www.youtube.com/watch?v=
|
|
|
68 |
'label_block'=>true,
|
69 |
'condition'=>array('item_type'=>'youtube')
|
70 |
)
|
@@ -79,6 +110,7 @@ class UniteCreatorElementorControls{
|
|
79 |
'type' => Controls_Manager::TEXT,
|
80 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
81 |
'description'=>__('For example: 581014653, or https://vimeo.com/581014653','unlimited-elements-for-elementor'),
|
|
|
82 |
'label_block'=>true,
|
83 |
'condition'=>array('item_type'=>'vimeo')
|
84 |
)
|
@@ -93,6 +125,7 @@ class UniteCreatorElementorControls{
|
|
93 |
'type' => Controls_Manager::TEXT,
|
94 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
95 |
'description'=>__('For example: 9oedgxuciv','unlimited-elements-for-elementor'),
|
|
|
96 |
'label_block'=>true,
|
97 |
'condition'=>array('item_type'=>'wistia')
|
98 |
)
|
@@ -106,12 +139,43 @@ class UniteCreatorElementorControls{
|
|
106 |
'label' => __( 'MP4 Video Url', 'unlimited-elements-for-elementor' ),
|
107 |
'type' => Controls_Manager::TEXT,
|
108 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
109 |
-
'description'=>__('Enter url of the mp4 video in current or external site','unlimited-elements-for-elementor'),
|
|
|
110 |
'label_block'=>true,
|
111 |
'condition'=>array('item_type'=>'html5')
|
112 |
)
|
113 |
);
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
//--------- title --------
|
116 |
|
117 |
$repeater->add_control(
|
@@ -121,7 +185,9 @@ class UniteCreatorElementorControls{
|
|
121 |
'type' => Controls_Manager::TEXT,
|
122 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
123 |
'label_block'=>true,
|
124 |
-
'separator'=>'before'
|
|
|
|
|
125 |
)
|
126 |
);
|
127 |
|
@@ -131,20 +197,42 @@ class UniteCreatorElementorControls{
|
|
131 |
'description',
|
132 |
array(
|
133 |
'label' => __( 'Item Description', 'unlimited-elements-for-elementor' ),
|
134 |
-
'type' => Controls_Manager::
|
135 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
136 |
-
'label_block'=>true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
)
|
138 |
);
|
139 |
|
140 |
|
|
|
141 |
$objControls->add_control(
|
142 |
$name.'_items',
|
143 |
array(
|
144 |
'label' => __( 'Gallery Items', 'unlimited-elements-for-elementor' ),
|
145 |
'type' => Controls_Manager::REPEATER,
|
146 |
'fields' => $repeater->get_controls(),
|
147 |
-
'default' =>
|
148 |
'title_field' => '{{{ title }}}',
|
149 |
)
|
150 |
);
|
10 |
class UniteCreatorElementorControls{
|
11 |
|
12 |
|
13 |
+
|
14 |
+
/**
|
15 |
+
* get repeater default items
|
16 |
+
*/
|
17 |
+
private function getRepeaterDefaultItems($objAddon){
|
18 |
+
|
19 |
+
$arrSourceItems = $objAddon->getArrItemsNonProcessed();
|
20 |
+
|
21 |
+
if(empty($arrSourceItems))
|
22 |
+
return(array());
|
23 |
+
|
24 |
+
$urlAssets = $objAddon->getUrlAssets();
|
25 |
+
|
26 |
+
$arrItems = array();
|
27 |
+
|
28 |
+
foreach($arrSourceItems as $item){
|
29 |
+
|
30 |
+
$urlImage = UniteFunctionsUC::getVal($item, "image");
|
31 |
+
$title = UniteFunctionsUC::getVal($item, "title");
|
32 |
+
|
33 |
+
if(empty($urlImage))
|
34 |
+
continue;
|
35 |
+
|
36 |
+
if(!empty($urlAssets))
|
37 |
+
$urlImage = HelperUC::convertFromUrlAssets($urlImage, $urlAssets);
|
38 |
+
|
39 |
+
$outputItem = array();
|
40 |
+
$outputItem["image"] = array("url"=>$urlImage);
|
41 |
+
$outputItem["title"] = $title;
|
42 |
+
|
43 |
+
$arrItems[] = $outputItem;
|
44 |
+
}
|
45 |
+
|
46 |
+
return($arrItems);
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
/**
|
51 |
* add repeater control
|
52 |
*/
|
53 |
+
public function addGalleryImageVideoRepeater($objControls, $textPrefix, $name, $listingParam, $objAddon){
|
54 |
+
|
55 |
+
$isEnableVideo = UniteFunctionsUC::getVal($listingParam, "gallery_enable_video");
|
56 |
+
|
57 |
+
$arrDefaultItems = $this->getRepeaterDefaultItems($objAddon);
|
58 |
+
|
59 |
$repeater = new Repeater();
|
60 |
|
61 |
$objControls->start_controls_section(
|
67 |
|
68 |
// ---- item type ---------
|
69 |
|
70 |
+
if($isEnableVideo == true):
|
71 |
+
|
72 |
+
$repeater->add_control(
|
73 |
+
'item_type',
|
74 |
+
array(
|
75 |
+
'label' => __( 'Item Type', 'unlimited-elements-for-elementor' ),
|
76 |
+
'type' => Controls_Manager::SELECT,
|
77 |
+
'default' => 'image',
|
78 |
+
'options' => array(
|
79 |
+
'image' => __( 'Image', 'unlimited-elements-for-elementor' ),
|
80 |
+
'youtube' => __( 'Youtube', 'unlimited-elements-for-elementor' ),
|
81 |
+
'vimeo' => __( 'Vimeo', 'unlimited-elements-for-elementor' ),
|
82 |
+
'wistia' => __( 'Wistia', 'unlimited-elements-for-elementor' ),
|
83 |
+
'html5' => __( 'HTML5 Video', 'unlimited-elements-for-elementor' )
|
84 |
+
)
|
85 |
)
|
86 |
+
);
|
87 |
+
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
//--------- youtube url --------
|
90 |
|
91 |
$repeater->add_control(
|
94 |
'label' => __( 'Youtube Url or ID', 'unlimited-elements-for-elementor' ),
|
95 |
'type' => Controls_Manager::TEXT,
|
96 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
97 |
+
'description'=>'For example: https://www.youtube.com/watch?v=qrO4YZeyl0I or qrO4YZeyl0I',
|
98 |
+
'separator'=>'before',
|
99 |
'label_block'=>true,
|
100 |
'condition'=>array('item_type'=>'youtube')
|
101 |
)
|
110 |
'type' => Controls_Manager::TEXT,
|
111 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
112 |
'description'=>__('For example: 581014653, or https://vimeo.com/581014653','unlimited-elements-for-elementor'),
|
113 |
+
'separator'=>'before',
|
114 |
'label_block'=>true,
|
115 |
'condition'=>array('item_type'=>'vimeo')
|
116 |
)
|
125 |
'type' => Controls_Manager::TEXT,
|
126 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
127 |
'description'=>__('For example: 9oedgxuciv','unlimited-elements-for-elementor'),
|
128 |
+
'separator'=>'before',
|
129 |
'label_block'=>true,
|
130 |
'condition'=>array('item_type'=>'wistia')
|
131 |
)
|
139 |
'label' => __( 'MP4 Video Url', 'unlimited-elements-for-elementor' ),
|
140 |
'type' => Controls_Manager::TEXT,
|
141 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
142 |
+
'description'=>__('Enter url of the mp4 video in current or external site. Example: http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4','unlimited-elements-for-elementor'),
|
143 |
+
'separator'=>'before',
|
144 |
'label_block'=>true,
|
145 |
'condition'=>array('item_type'=>'html5')
|
146 |
)
|
147 |
);
|
148 |
|
149 |
+
endif; //enable video
|
150 |
+
|
151 |
+
|
152 |
+
//--------- image --------
|
153 |
+
|
154 |
+
$repeater->add_control(
|
155 |
+
'image',
|
156 |
+
array(
|
157 |
+
'label' => __( 'Choose Image', 'unlimited-elements-for-elementor' ),
|
158 |
+
'type' => Controls_Manager::MEDIA,
|
159 |
+
'separator'=>'before',
|
160 |
+
'default' => array(
|
161 |
+
'url' => Utils::get_placeholder_image_src(),
|
162 |
+
),
|
163 |
+
'dynamic'=>array('active'=>true),
|
164 |
+
'recursive'=>true
|
165 |
+
)
|
166 |
+
);
|
167 |
+
|
168 |
+
//--------- image heading --------
|
169 |
+
if($isEnableVideo == true)
|
170 |
+
$repeater->add_control(
|
171 |
+
'image_heading_text',
|
172 |
+
array(
|
173 |
+
'label' => __( 'This image will be used for gallery thumbnail and video placeholder', 'unlimited-elements-for-elementor' ),
|
174 |
+
'type' => Controls_Manager::HEADING,
|
175 |
+
'condition'=>array('item_type!'=>'image')
|
176 |
+
)
|
177 |
+
);
|
178 |
+
|
179 |
//--------- title --------
|
180 |
|
181 |
$repeater->add_control(
|
185 |
'type' => Controls_Manager::TEXT,
|
186 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
187 |
'label_block'=>true,
|
188 |
+
'separator'=>'before',
|
189 |
+
'dynamic'=>array('active'=>true),
|
190 |
+
'recursive'=>true
|
191 |
)
|
192 |
);
|
193 |
|
197 |
'description',
|
198 |
array(
|
199 |
'label' => __( 'Item Description', 'unlimited-elements-for-elementor' ),
|
200 |
+
'type' => Controls_Manager::TEXTAREA,
|
201 |
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
202 |
+
'label_block'=>true,
|
203 |
+
'dynamic'=>array('active'=>true),
|
204 |
+
'recursive'=>true
|
205 |
+
)
|
206 |
+
);
|
207 |
+
|
208 |
+
$arrControl["recursive"] = true;
|
209 |
+
|
210 |
+
//--------- link --------
|
211 |
+
|
212 |
+
$repeater->add_control(
|
213 |
+
'link',
|
214 |
+
array(
|
215 |
+
'label' => __( 'Item Link', 'unlimited-elements-for-elementor' ),
|
216 |
+
'type' => Controls_Manager::URL,
|
217 |
+
'default' => array(
|
218 |
+
'url' => '',
|
219 |
+
'is_external' => true,
|
220 |
+
'nofollow' => false),
|
221 |
+
'label_block'=>true,
|
222 |
+
'dynamic'=>array('active'=>true),
|
223 |
+
'recursive'=>true
|
224 |
)
|
225 |
);
|
226 |
|
227 |
|
228 |
+
|
229 |
$objControls->add_control(
|
230 |
$name.'_items',
|
231 |
array(
|
232 |
'label' => __( 'Gallery Items', 'unlimited-elements-for-elementor' ),
|
233 |
'type' => Controls_Manager::REPEATER,
|
234 |
'fields' => $repeater->get_controls(),
|
235 |
+
'default' => $arrDefaultItems,
|
236 |
'title_field' => '{{{ title }}}',
|
237 |
)
|
238 |
);
|
provider/core/plugins/unlimited_elements/elementor/elementor_integrate.class.php
CHANGED
@@ -306,7 +306,7 @@ class UniteCreatorElementorIntegrate{
|
|
306 |
self::logMemoryUsage("before widgets registered");
|
307 |
|
308 |
self::$numRegistered = 0;
|
309 |
-
|
310 |
if(self::$isConsolidated)
|
311 |
$this->registerWidgets_categories();
|
312 |
else{
|
@@ -512,9 +512,9 @@ class UniteCreatorElementorIntegrate{
|
|
512 |
return(false);
|
513 |
|
514 |
foreach($params as $param){
|
515 |
-
|
516 |
$type = UniteFunctionsUC::getVal($param, "type");
|
517 |
-
if($type != UniteCreatorDialogParam::PARAM_POSTS_LIST)
|
518 |
continue;
|
519 |
|
520 |
//post list only
|
@@ -1371,13 +1371,14 @@ class UniteCreatorElementorIntegrate{
|
|
1371 |
* check allow pagination for single page pagination
|
1372 |
*/
|
1373 |
public function checkAllowWidgetPagination($filterValue, $wp_query){
|
1374 |
-
|
1375 |
if(is_admin() == true || is_archive() == true || is_front_page() == true)
|
1376 |
return($filterValue);
|
1377 |
-
|
|
|
1378 |
if(empty(self::$arrPostsWidgetNames))
|
1379 |
return($filterValue);
|
1380 |
-
|
1381 |
$postID = $wp_query->queried_object_id;
|
1382 |
|
1383 |
if(empty($postID))
|
@@ -1389,7 +1390,7 @@ class UniteCreatorElementorIntegrate{
|
|
1389 |
return($filterValue);
|
1390 |
|
1391 |
$editorData = $document->get_elements_data();
|
1392 |
-
|
1393 |
Plugin::$instance->db->iterate_data($editorData, function( $element ) use ( &$filterValue ) {
|
1394 |
|
1395 |
$widgetName = UniteFunctionsUC::getVal($element, "widgetType");
|
@@ -1397,8 +1398,10 @@ class UniteCreatorElementorIntegrate{
|
|
1397 |
if(!empty($widgetName)){
|
1398 |
|
1399 |
$widgetName = str_replace("ucaddon_", "", $widgetName);
|
1400 |
-
|
1401 |
-
|
|
|
|
|
1402 |
|
1403 |
$settings = UniteFunctionsUC::getVal($element, "settings");
|
1404 |
|
@@ -1444,7 +1447,7 @@ class UniteCreatorElementorIntegrate{
|
|
1444 |
* check and add dynamic loop styles before render
|
1445 |
*/
|
1446 |
public function onBeforeRenderElement($element){
|
1447 |
-
|
1448 |
if(!empty(GlobalsUnlimitedElements::$renderingDynamicData))
|
1449 |
HelperProviderCoreUC_EL::putDynamicLoopElementStyle($element);
|
1450 |
|
@@ -1475,8 +1478,11 @@ class UniteCreatorElementorIntegrate{
|
|
1475 |
|
1476 |
$arrSettingsValues = HelperProviderCoreUC_EL::getGeneralSettingsValues();
|
1477 |
|
1478 |
-
self::$isConsolidated = UniteFunctionsUC::getVal($arrSettingsValues, "consolidate_addons");
|
1479 |
-
self::$isConsolidated = UniteFunctionsUC::strToBool(self::$isConsolidated);
|
|
|
|
|
|
|
1480 |
|
1481 |
$enableExportImport = HelperProviderCoreUC_EL::getGeneralSetting("enable_import_export");
|
1482 |
$enableExportImport = UniteFunctionsUC::strToBool($enableExportImport);
|
306 |
self::logMemoryUsage("before widgets registered");
|
307 |
|
308 |
self::$numRegistered = 0;
|
309 |
+
|
310 |
if(self::$isConsolidated)
|
311 |
$this->registerWidgets_categories();
|
312 |
else{
|
512 |
return(false);
|
513 |
|
514 |
foreach($params as $param){
|
515 |
+
|
516 |
$type = UniteFunctionsUC::getVal($param, "type");
|
517 |
+
if($type != UniteCreatorDialogParam::PARAM_POSTS_LIST && $type != UniteCreatorDialogParam::PARAM_LISTING)
|
518 |
continue;
|
519 |
|
520 |
//post list only
|
1371 |
* check allow pagination for single page pagination
|
1372 |
*/
|
1373 |
public function checkAllowWidgetPagination($filterValue, $wp_query){
|
1374 |
+
|
1375 |
if(is_admin() == true || is_archive() == true || is_front_page() == true)
|
1376 |
return($filterValue);
|
1377 |
+
|
1378 |
+
|
1379 |
if(empty(self::$arrPostsWidgetNames))
|
1380 |
return($filterValue);
|
1381 |
+
|
1382 |
$postID = $wp_query->queried_object_id;
|
1383 |
|
1384 |
if(empty($postID))
|
1390 |
return($filterValue);
|
1391 |
|
1392 |
$editorData = $document->get_elements_data();
|
1393 |
+
|
1394 |
Plugin::$instance->db->iterate_data($editorData, function( $element ) use ( &$filterValue ) {
|
1395 |
|
1396 |
$widgetName = UniteFunctionsUC::getVal($element, "widgetType");
|
1398 |
if(!empty($widgetName)){
|
1399 |
|
1400 |
$widgetName = str_replace("ucaddon_", "", $widgetName);
|
1401 |
+
|
1402 |
+
$isPostWidget = isset(self::$arrPostsWidgetNames[$widgetName]);
|
1403 |
+
|
1404 |
+
if($isPostWidget){
|
1405 |
|
1406 |
$settings = UniteFunctionsUC::getVal($element, "settings");
|
1407 |
|
1447 |
* check and add dynamic loop styles before render
|
1448 |
*/
|
1449 |
public function onBeforeRenderElement($element){
|
1450 |
+
|
1451 |
if(!empty(GlobalsUnlimitedElements::$renderingDynamicData))
|
1452 |
HelperProviderCoreUC_EL::putDynamicLoopElementStyle($element);
|
1453 |
|
1478 |
|
1479 |
$arrSettingsValues = HelperProviderCoreUC_EL::getGeneralSettingsValues();
|
1480 |
|
1481 |
+
//self::$isConsolidated = UniteFunctionsUC::getVal($arrSettingsValues, "consolidate_addons");
|
1482 |
+
//self::$isConsolidated = UniteFunctionsUC::strToBool(self::$isConsolidated);
|
1483 |
+
|
1484 |
+
//consolidation always false
|
1485 |
+
self::$isConsolidated = false;
|
1486 |
|
1487 |
$enableExportImport = HelperProviderCoreUC_EL::getGeneralSetting("enable_import_export");
|
1488 |
$enableExportImport = UniteFunctionsUC::strToBool($enableExportImport);
|
provider/core/plugins/unlimited_elements/elementor/elementor_layout_exporter.class.php
CHANGED
@@ -503,7 +503,6 @@ class UniteCreatorLayoutsExporterElementor extends UniteCreatorLayoutsExporter{
|
|
503 |
if(empty($arrPageLayout) || is_array($arrPageLayout) == false)
|
504 |
UniteFunctionsUC::throwError("No page elementor layout found");
|
505 |
|
506 |
-
|
507 |
//insert the section
|
508 |
|
509 |
$arrPageLayoutNEW = array();
|
@@ -1055,7 +1054,7 @@ class UniteCreatorLayoutsExporterElementor extends UniteCreatorLayoutsExporter{
|
|
1055 |
}
|
1056 |
|
1057 |
$arrContent = $this->modifyExportDeleteGlobals($arrContent);
|
1058 |
-
|
1059 |
$this->putLayoutFile_elementor($arrContent);
|
1060 |
|
1061 |
//make zip
|
503 |
if(empty($arrPageLayout) || is_array($arrPageLayout) == false)
|
504 |
UniteFunctionsUC::throwError("No page elementor layout found");
|
505 |
|
|
|
506 |
//insert the section
|
507 |
|
508 |
$arrPageLayoutNEW = array();
|
1054 |
}
|
1055 |
|
1056 |
$arrContent = $this->modifyExportDeleteGlobals($arrContent);
|
1057 |
+
|
1058 |
$this->putLayoutFile_elementor($arrContent);
|
1059 |
|
1060 |
//make zip
|
provider/core/plugins/unlimited_elements/elementor/elementor_widget.class.php
CHANGED
@@ -19,7 +19,7 @@ use Elementor\Utils;
|
|
19 |
|
20 |
class UniteCreatorElementorWidget extends Widget_Base {
|
21 |
|
22 |
-
|
23 |
|
24 |
private $isConsolidated = false;
|
25 |
private $objCat, $arrAddons;
|
@@ -122,9 +122,11 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
122 |
|
123 |
if(empty($addonName))
|
124 |
UniteFunctionsUC::throwError("Widget name is empty");
|
125 |
-
|
126 |
$this->objAddon = new UniteCreatorAddon();
|
127 |
|
|
|
|
|
128 |
$record = UniteFunctionsUC::getVal(UniteCreatorElementorIntegrate::$arrAddonsRecords, $addonName);
|
129 |
|
130 |
if(!empty($record))
|
@@ -478,7 +480,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
478 |
|
479 |
if($itemsType == "image")
|
480 |
return(false);
|
481 |
-
|
482 |
$itemsLabel = esc_html__("Items", "unlimited-elements-for-elementor");
|
483 |
|
484 |
$itemsTitle = $this->objAddon->getOption("items_section_title");
|
@@ -490,12 +492,16 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
490 |
|
491 |
if(!empty($itemsTitle))
|
492 |
$itemsLabel = $itemsTitle;
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
|
|
|
|
|
|
|
|
499 |
|
500 |
//add heading label text
|
501 |
if(!empty($itemsHeading)){
|
@@ -547,13 +553,25 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
547 |
|
548 |
|
549 |
$arrControl = $this->getControlArrayUC($param, true);
|
550 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
|
|
|
552 |
//add some child params
|
553 |
$this->checkAddRelatedControls($param, $repeater);
|
554 |
|
555 |
}
|
556 |
|
|
|
557 |
$arrItemsControl = array();
|
558 |
$arrItemsControl["type"] = Controls_Manager::REPEATER;
|
559 |
$arrItemsControl["fields"] = $repeater->get_controls();
|
@@ -571,10 +589,26 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
571 |
$arrItemsData = array();
|
572 |
|
573 |
$arrItemsControl["default"] = $arrItemsData;
|
574 |
-
|
575 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
|
577 |
-
$this->
|
|
|
|
|
578 |
}
|
579 |
|
580 |
/**
|
@@ -610,15 +644,14 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
610 |
|
611 |
$arrCondition = array();
|
612 |
|
613 |
-
if(!empty($elementorCondition) && is_array($elementorCondition))
|
614 |
$arrCondition = $elementorCondition;
|
615 |
-
}
|
616 |
|
617 |
-
if($
|
618 |
-
$
|
619 |
|
620 |
$arrCondition[$conditionAttribute] = $conditionValue;
|
621 |
-
|
622 |
return($arrCondition);
|
623 |
}
|
624 |
|
@@ -868,6 +901,12 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
868 |
}
|
869 |
*/
|
870 |
|
|
|
|
|
|
|
|
|
|
|
|
|
871 |
break;
|
872 |
case UniteCreatorDialogParam::PARAM_IMAGE:
|
873 |
|
@@ -1180,11 +1219,20 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1180 |
$arrControl["size_units"] = array("vh","px");
|
1181 |
$rangeUnit = "vh";
|
1182 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1183 |
case "px_percent_em":
|
1184 |
default:
|
1185 |
$arrControl["size_units"] = array("px","%","em");
|
1186 |
$rangeUnit = "px";
|
1187 |
break;
|
|
|
1188 |
}
|
1189 |
|
1190 |
//set range
|
@@ -1252,8 +1300,8 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1252 |
if($isResponsive == true){
|
1253 |
$arrControl["uc_responsive"] = true;
|
1254 |
|
1255 |
-
$defaultTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
|
1256 |
-
$defaultMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
|
1257 |
|
1258 |
$arrControl["desktop_default"] = $defaultValue;
|
1259 |
$arrControl["tablet_default"] = $defaultTablet;
|
@@ -1339,10 +1387,12 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1339 |
|
1340 |
break;
|
1341 |
case UniteCreatorDialogParam::PARAM_GALLERY:
|
1342 |
-
|
1343 |
-
if(
|
1344 |
-
|
1345 |
-
|
|
|
|
|
1346 |
}
|
1347 |
|
1348 |
$param["add_dynamic"] = true;
|
@@ -1724,26 +1774,47 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
1724 |
}
|
1725 |
|
1726 |
/**
|
1727 |
-
* get gallery
|
1728 |
*/
|
1729 |
-
|
1730 |
-
|
1731 |
-
//get internal defaults
|
1732 |
|
1733 |
$arrItems = $this->objAddon->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_OUTPUT);
|
1734 |
if(empty($arrItems))
|
1735 |
$arrItems = array();
|
1736 |
-
|
1737 |
$arrDefaults = array();
|
1738 |
|
|
|
|
|
1739 |
foreach($arrItems as $arrItem){
|
1740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1741 |
|
1742 |
-
$urlImage
|
|
|
1743 |
|
1744 |
-
$
|
|
|
|
|
|
|
1745 |
}
|
1746 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1747 |
$param = array();
|
1748 |
$param["type"] = "uc_gallery";
|
1749 |
$param["title"] = __("Add Images","unlimited-elements-for-elementor");
|
@@ -2075,7 +2146,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2075 |
$this->addGalleryControlUC();
|
2076 |
|
2077 |
//add dynamic to all the addons, not only dynamic
|
2078 |
-
$params = $this->addDynamicAttributes($params);
|
2079 |
|
2080 |
foreach($params as $param){
|
2081 |
|
@@ -2190,7 +2261,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2190 |
$this->addAdvancedSectionControls($showMore, $isItemsEnabled);
|
2191 |
|
2192 |
}
|
2193 |
-
|
2194 |
private function a__________DYNAMIC_SECTIONS_________(){}
|
2195 |
|
2196 |
|
@@ -2211,7 +2282,6 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2211 |
if($isForGallery == true)
|
2212 |
$textPrefix = __("Gallery ","unlimited-elements-for-elementor");
|
2213 |
|
2214 |
-
|
2215 |
//add post section
|
2216 |
$this->start_controls_section(
|
2217 |
'uc_section_listing_posts_query', array(
|
@@ -2261,9 +2331,29 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
2261 |
}
|
2262 |
|
2263 |
//add the gallery repeater
|
2264 |
-
if($isForGallery == true)
|
2265 |
-
|
2266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2267 |
|
2268 |
}
|
2269 |
|
@@ -3147,7 +3237,9 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
3147 |
|
3148 |
$arrMainParamValues = $this->getArrMainParamValuesUC($arrValues, $objAddon);
|
3149 |
|
|
|
3150 |
$arrPostListParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
|
|
|
3151 |
if(!empty($arrPostListParam)){
|
3152 |
|
3153 |
$paginationType = UniteFunctionsUC::getVal($arrMainParamValues, "pagination_type");
|
@@ -3156,6 +3248,17 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
3156 |
$arrMainParamValues[$postListName."_pagination_type"] = $paginationType;
|
3157 |
}
|
3158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3159 |
//check if inside editor
|
3160 |
$isEditMode = $this->isEditMode();
|
3161 |
|
@@ -3248,6 +3351,7 @@ class UniteCreatorElementorWidget extends Widget_Base {
|
|
3248 |
return(false);
|
3249 |
}
|
3250 |
|
|
|
3251 |
if($this->isConsolidated == false){
|
3252 |
|
3253 |
$this->ucRenderByAddon($this->objAddon);
|
19 |
|
20 |
class UniteCreatorElementorWidget extends Widget_Base {
|
21 |
|
22 |
+
protected $objAddon;
|
23 |
|
24 |
private $isConsolidated = false;
|
25 |
private $objCat, $arrAddons;
|
122 |
|
123 |
if(empty($addonName))
|
124 |
UniteFunctionsUC::throwError("Widget name is empty");
|
125 |
+
|
126 |
$this->objAddon = new UniteCreatorAddon();
|
127 |
|
128 |
+
$this->objAddon->setOperationType(UniteCreatorAddon::OPERATION_WIDGET);
|
129 |
+
|
130 |
$record = UniteFunctionsUC::getVal(UniteCreatorElementorIntegrate::$arrAddonsRecords, $addonName);
|
131 |
|
132 |
if(!empty($record))
|
480 |
|
481 |
if($itemsType == "image")
|
482 |
return(false);
|
483 |
+
|
484 |
$itemsLabel = esc_html__("Items", "unlimited-elements-for-elementor");
|
485 |
|
486 |
$itemsTitle = $this->objAddon->getOption("items_section_title");
|
492 |
|
493 |
if(!empty($itemsTitle))
|
494 |
$itemsLabel = $itemsTitle;
|
495 |
+
|
496 |
+
if($this->isBGWidget == false){
|
497 |
+
|
498 |
+
$this->start_controls_section(
|
499 |
+
'section_items', array(
|
500 |
+
'label' => $itemsLabel,
|
501 |
+
)
|
502 |
+
);
|
503 |
+
|
504 |
+
}
|
505 |
|
506 |
//add heading label text
|
507 |
if(!empty($itemsHeading)){
|
553 |
|
554 |
|
555 |
$arrControl = $this->getControlArrayUC($param, true);
|
556 |
+
|
557 |
+
//add control (responsive or not)
|
558 |
+
if(isset($arrControl["uc_responsive"])){
|
559 |
+
|
560 |
+
unset($arrControl["uc_responsive"]);
|
561 |
+
$repeater->add_responsive_control($name, $arrControl);
|
562 |
+
|
563 |
+
}else{
|
564 |
+
|
565 |
+
$repeater->add_control($name, $arrControl);
|
566 |
+
}
|
567 |
|
568 |
+
|
569 |
//add some child params
|
570 |
$this->checkAddRelatedControls($param, $repeater);
|
571 |
|
572 |
}
|
573 |
|
574 |
+
|
575 |
$arrItemsControl = array();
|
576 |
$arrItemsControl["type"] = Controls_Manager::REPEATER;
|
577 |
$arrItemsControl["fields"] = $repeater->get_controls();
|
589 |
$arrItemsData = array();
|
590 |
|
591 |
$arrItemsControl["default"] = $arrItemsData;
|
592 |
+
|
593 |
+
$controlName = 'uc_items';
|
594 |
+
|
595 |
+
if($this->isBGWidget == true){
|
596 |
+
|
597 |
+
$alias = $this->objAddon->getAlias();
|
598 |
+
$condition = array(UniteCreatorElementorIntegrate::CONTROL_BACKGROUND_TYPE=>$alias);
|
599 |
+
|
600 |
+
$controlName = $alias."_".$controlName;
|
601 |
+
|
602 |
+
$arrItemsControl["condition"] = $condition;
|
603 |
+
|
604 |
+
}
|
605 |
+
|
606 |
+
|
607 |
+
$this->objControls->add_control($controlName, $arrItemsControl);
|
608 |
|
609 |
+
if($this->isBGWidget == false)
|
610 |
+
$this->end_controls_section();
|
611 |
+
|
612 |
}
|
613 |
|
614 |
/**
|
644 |
|
645 |
$arrCondition = array();
|
646 |
|
647 |
+
if(!empty($elementorCondition) && is_array($elementorCondition))
|
648 |
$arrCondition = $elementorCondition;
|
|
|
649 |
|
650 |
+
if($conditionOperator == "not_equal")
|
651 |
+
$conditionAttribute .= "!";
|
652 |
|
653 |
$arrCondition[$conditionAttribute] = $conditionValue;
|
654 |
+
|
655 |
return($arrCondition);
|
656 |
}
|
657 |
|
901 |
}
|
902 |
*/
|
903 |
|
904 |
+
break;
|
905 |
+
case UniteCreatorDialogParam::PARAM_HEADING:
|
906 |
+
|
907 |
+
$arrControl["label"] = $defaultValue;
|
908 |
+
unset($arrControl["default"]);
|
909 |
+
|
910 |
break;
|
911 |
case UniteCreatorDialogParam::PARAM_IMAGE:
|
912 |
|
1219 |
$arrControl["size_units"] = array("vh","px");
|
1220 |
$rangeUnit = "vh";
|
1221 |
break;
|
1222 |
+
case "px_vh":
|
1223 |
+
$arrControl["size_units"] = array("px","vh");
|
1224 |
+
$rangeUnit = "px";
|
1225 |
+
break;
|
1226 |
+
case "px_vh_percent":
|
1227 |
+
$arrControl["size_units"] = array("px","vh","%");
|
1228 |
+
$rangeUnit = "px";
|
1229 |
+
break;
|
1230 |
case "px_percent_em":
|
1231 |
default:
|
1232 |
$arrControl["size_units"] = array("px","%","em");
|
1233 |
$rangeUnit = "px";
|
1234 |
break;
|
1235 |
+
|
1236 |
}
|
1237 |
|
1238 |
//set range
|
1300 |
if($isResponsive == true){
|
1301 |
$arrControl["uc_responsive"] = true;
|
1302 |
|
1303 |
+
$defaultTablet = UniteFunctionsUC::getVal($param, "default_value_tablet",$defaultValue);
|
1304 |
+
$defaultMobile = UniteFunctionsUC::getVal($param, "default_value_mobile",$defaultValue);
|
1305 |
|
1306 |
$arrControl["desktop_default"] = $defaultValue;
|
1307 |
$arrControl["tablet_default"] = $defaultTablet;
|
1387 |
|
1388 |
break;
|
1389 |
case UniteCreatorDialogParam::PARAM_GALLERY:
|
1390 |
+
|
1391 |
+
if(empty($defaultValue)){
|
1392 |
+
|
1393 |
+
$arrDefaults = $this->getGalleryParamDefaultItems();
|
1394 |
+
|
1395 |
+
$arrControl["default"] = $arrDefaults;
|
1396 |
}
|
1397 |
|
1398 |
$param["add_dynamic"] = true;
|
1774 |
}
|
1775 |
|
1776 |
/**
|
1777 |
+
* get gallery param default items
|
1778 |
*/
|
1779 |
+
private function getGalleryParamDefaultItems(){
|
|
|
|
|
1780 |
|
1781 |
$arrItems = $this->objAddon->getProcessedItemsData(UniteCreatorParamsProcessor::PROCESS_TYPE_OUTPUT);
|
1782 |
if(empty($arrItems))
|
1783 |
$arrItems = array();
|
1784 |
+
|
1785 |
$arrDefaults = array();
|
1786 |
|
1787 |
+
$urlAssets = $this->objAddon->getUrlAssets();
|
1788 |
+
|
1789 |
foreach($arrItems as $arrItem){
|
1790 |
+
|
1791 |
+
$urlImage = UniteFunctionsUC::getVal($arrItem, "image");
|
1792 |
+
|
1793 |
+
if(is_array($urlImage)){
|
1794 |
+
$urlImage = UniteFunctionsUC::getVal($urlImage, "item");
|
1795 |
+
$urlImage = UniteFunctionsUC::getVal($urlImage, "image");
|
1796 |
+
}
|
1797 |
|
1798 |
+
if(empty($urlImage))
|
1799 |
+
continue;
|
1800 |
|
1801 |
+
if(!empty($urlAssets))
|
1802 |
+
$urlImage = HelperUC::convertFromUrlAssets($urlImage, $urlAssets);
|
1803 |
+
|
1804 |
+
$arrDefaults[] = array("url"=>$urlImage,"id"=>null);
|
1805 |
}
|
1806 |
|
1807 |
+
return($arrDefaults);
|
1808 |
+
}
|
1809 |
+
|
1810 |
+
/**
|
1811 |
+
* get gallery control
|
1812 |
+
*/
|
1813 |
+
protected function getGalleryParamUC(){
|
1814 |
+
|
1815 |
+
//get internal defaults
|
1816 |
+
$arrDefaults = $this->getGalleryParamDefaultItems();
|
1817 |
+
|
1818 |
$param = array();
|
1819 |
$param["type"] = "uc_gallery";
|
1820 |
$param["title"] = __("Add Images","unlimited-elements-for-elementor");
|
2146 |
$this->addGalleryControlUC();
|
2147 |
|
2148 |
//add dynamic to all the addons, not only dynamic
|
2149 |
+
$params = $this->addDynamicAttributes($params);
|
2150 |
|
2151 |
foreach($params as $param){
|
2152 |
|
2261 |
$this->addAdvancedSectionControls($showMore, $isItemsEnabled);
|
2262 |
|
2263 |
}
|
2264 |
+
|
2265 |
private function a__________DYNAMIC_SECTIONS_________(){}
|
2266 |
|
2267 |
|
2282 |
if($isForGallery == true)
|
2283 |
$textPrefix = __("Gallery ","unlimited-elements-for-elementor");
|
2284 |
|
|
|
2285 |
//add post section
|
2286 |
$this->start_controls_section(
|
2287 |
'uc_section_listing_posts_query', array(
|
2331 |
}
|
2332 |
|
2333 |
//add the gallery repeater
|
2334 |
+
if($isForGallery == true){
|
2335 |
+
|
2336 |
+
$objUEControls->addGalleryImageVideoRepeater($this, $textPrefix, $name, $listingParam, $this->objAddon);
|
2337 |
+
|
2338 |
+
//add instagram param
|
2339 |
+
|
2340 |
+
$this->start_controls_section(
|
2341 |
+
'uc_section_listing_instagram', array(
|
2342 |
+
'label' => __("Instagram Source", "unlimited-elements-for-elementor"),
|
2343 |
+
'condition'=>array($name."_source"=>"instagram")
|
2344 |
+
)
|
2345 |
+
);
|
2346 |
+
|
2347 |
+
|
2348 |
+
$instagramParam = $listingParam;
|
2349 |
+
|
2350 |
+
$instagramParam["type"] = UniteCreatorDialogParam::PARAM_INSTAGRAM;
|
2351 |
+
$instagramParam["name"] = $name."_instagram";
|
2352 |
+
|
2353 |
+
$this->addElementorParamUC($instagramParam);
|
2354 |
+
|
2355 |
+
$this->end_controls_section();
|
2356 |
+
}
|
2357 |
|
2358 |
}
|
2359 |
|
3237 |
|
3238 |
$arrMainParamValues = $this->getArrMainParamValuesUC($arrValues, $objAddon);
|
3239 |
|
3240 |
+
//transfer the pagination type
|
3241 |
$arrPostListParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_POSTS_LIST);
|
3242 |
+
|
3243 |
if(!empty($arrPostListParam)){
|
3244 |
|
3245 |
$paginationType = UniteFunctionsUC::getVal($arrMainParamValues, "pagination_type");
|
3248 |
$arrMainParamValues[$postListName."_pagination_type"] = $paginationType;
|
3249 |
}
|
3250 |
|
3251 |
+
$arrListingParam = $objAddon->getParamByType(UniteCreatorDialogParam::PARAM_LISTING);
|
3252 |
+
if(!empty($arrListingParam)){
|
3253 |
+
|
3254 |
+
$paginationType = UniteFunctionsUC::getVal($arrMainParamValues, "pagination_type");
|
3255 |
+
$postListingName = UniteFunctionsUC::getVal($arrListingParam, "name");
|
3256 |
+
|
3257 |
+
$arrMainParamValues[$postListingName."_posts_pagination_type"] = $paginationType;
|
3258 |
+
$arrMainParamValues[$postListingName."_products_pagination_type"] = $paginationType;
|
3259 |
+
}
|
3260 |
+
|
3261 |
+
|
3262 |
//check if inside editor
|
3263 |
$isEditMode = $this->isEditMode();
|
3264 |
|
3351 |
return(false);
|
3352 |
}
|
3353 |
|
3354 |
+
|
3355 |
if($this->isConsolidated == false){
|
3356 |
|
3357 |
$this->ucRenderByAddon($this->objAddon);
|
provider/core/plugins/unlimited_elements/helper_provider_core.class.php
CHANGED
@@ -581,8 +581,10 @@ class HelperProviderCoreUC_EL{
|
|
581 |
|
582 |
if(empty($arrControls))
|
583 |
return(false);
|
|
|
|
|
584 |
|
585 |
-
$settings = @$element->parse_dynamic_settings( $dynamicSettings, $arrControls);
|
586 |
|
587 |
if(empty($settings))
|
588 |
return(false);
|
@@ -693,7 +695,7 @@ class HelperProviderCoreUC_EL{
|
|
693 |
//set path and url
|
694 |
self::$pathCore = dirname(__FILE__)."/";
|
695 |
self::$urlCore = HelperUC::pathToFullUrl(self::$pathCore);
|
696 |
-
|
697 |
self::$filepathGeneralSettings = self::$pathCore."settings/general_settings_el.xml";
|
698 |
|
699 |
GlobalsProviderUC::$pluginName = "unlimited_elementor";
|
581 |
|
582 |
if(empty($arrControls))
|
583 |
return(false);
|
584 |
+
|
585 |
+
unset($dynamicSettings["link"]);
|
586 |
|
587 |
+
$settings = @$element->parse_dynamic_settings( $dynamicSettings, $arrControls);
|
588 |
|
589 |
if(empty($settings))
|
590 |
return(false);
|
695 |
//set path and url
|
696 |
self::$pathCore = dirname(__FILE__)."/";
|
697 |
self::$urlCore = HelperUC::pathToFullUrl(self::$pathCore);
|
698 |
+
|
699 |
self::$filepathGeneralSettings = self::$pathCore."settings/general_settings_el.xml";
|
700 |
|
701 |
GlobalsProviderUC::$pluginName = "unlimited_elementor";
|
provider/core/plugins/unlimited_elements/settings/general_settings_el.xml
CHANGED
@@ -166,7 +166,7 @@
|
|
166 |
|
167 |
<field name="memory_limit_text_desc"
|
168 |
type="statictext"
|
169 |
-
label="In case of
|
170 |
</field>
|
171 |
|
172 |
<field name="enable_memory_usage_test"
|
@@ -176,6 +176,17 @@
|
|
176 |
description="Use it when you have some memory crash. <br> When enabling it it will log every addon and field register operation <br> and sugniffically slow down the editor work. Use it only for testing and turn it off after.">
|
177 |
</field>
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
<field name="memory_usage_button"
|
180 |
type="button"
|
181 |
value="Show Memory Usage Log"
|
166 |
|
167 |
<field name="memory_limit_text_desc"
|
168 |
type="statictext"
|
169 |
+
label="In case of insufficient memory, you can increase WordPress memory limit wp config file (wp-config.php)">
|
170 |
</field>
|
171 |
|
172 |
<field name="enable_memory_usage_test"
|
176 |
description="Use it when you have some memory crash. <br> When enabling it it will log every addon and field register operation <br> and sugniffically slow down the editor work. Use it only for testing and turn it off after.">
|
177 |
</field>
|
178 |
|
179 |
+
<field name="before_show_php_message"
|
180 |
+
type="hr">
|
181 |
+
</field>
|
182 |
+
|
183 |
+
<field name="show_php_error"
|
184 |
+
type="boolean"
|
185 |
+
default="false"
|
186 |
+
label="Show PHP Error Message"
|
187 |
+
description="Use it when you see some text about php error and want to see it.">
|
188 |
+
</field>
|
189 |
+
|
190 |
<field name="memory_usage_button"
|
191 |
type="button"
|
192 |
value="Show Memory Usage Log"
|
provider/core/plugins/unlimited_elements/template.php
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
4 |
+
|
5 |
+
class UCEmptyTemplate{
|
6 |
+
|
7 |
+
const SHOW_DEBUG = false;
|
8 |
+
|
9 |
+
private $templateID;
|
10 |
+
|
11 |
+
|
12 |
+
/**
|
13 |
+
* construct
|
14 |
+
*/
|
15 |
+
public function __construct(){
|
16 |
+
$this->init();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* put error message
|
21 |
+
*/
|
22 |
+
private function putErrorMessage($message = null){
|
23 |
+
|
24 |
+
if(self::SHOW_DEBUG == true)
|
25 |
+
dmp($message);
|
26 |
+
|
27 |
+
dmp("no output");
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* render header debug
|
33 |
+
*/
|
34 |
+
private function renderHeader(){
|
35 |
+
?>
|
36 |
+
<header class="site-header">
|
37 |
+
<p class="site-title">
|
38 |
+
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
39 |
+
<?php bloginfo( 'name' ); ?>
|
40 |
+
</a>
|
41 |
+
</p>
|
42 |
+
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
|
43 |
+
</header>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* render regular post body
|
49 |
+
*/
|
50 |
+
private function renderRegularBody(){
|
51 |
+
|
52 |
+
$this->renderHeader();
|
53 |
+
|
54 |
+
if ( have_posts() ) :
|
55 |
+
|
56 |
+
while ( have_posts() ) :
|
57 |
+
|
58 |
+
the_post();
|
59 |
+
the_content();
|
60 |
+
|
61 |
+
endwhile;
|
62 |
+
endif;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* validate that template exists
|
67 |
+
*/
|
68 |
+
private function validateTemplateExists(){
|
69 |
+
|
70 |
+
if(empty($this->templateID))
|
71 |
+
UniteFunctionsUC::throwError("no template found");
|
72 |
+
|
73 |
+
$template = get_post($this->templateID);
|
74 |
+
if(empty($template))
|
75 |
+
UniteFunctionsUC::throwError("template not found");
|
76 |
+
|
77 |
+
$postType = $template->post_type;
|
78 |
+
|
79 |
+
if($postType != "elementor_library")
|
80 |
+
UniteFunctionsUC::throwError("bad template");
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* render header part
|
86 |
+
*/
|
87 |
+
private function renderHeaderPart(){
|
88 |
+
?>
|
89 |
+
<!DOCTYPE html>
|
90 |
+
<html <?php language_attributes(); ?>>
|
91 |
+
<head>
|
92 |
+
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
93 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
94 |
+
<link rel="profile" href="https://gmpg.org/xfn/11">
|
95 |
+
<?php wp_head(); ?>
|
96 |
+
</head>
|
97 |
+
<body <?php body_class(); ?>>
|
98 |
+
|
99 |
+
<?php
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* render footer part
|
104 |
+
*/
|
105 |
+
private function renderFooter(){
|
106 |
+
wp_footer();
|
107 |
+
|
108 |
+
?>
|
109 |
+
</body>
|
110 |
+
</html>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* render template
|
116 |
+
*/
|
117 |
+
private function renderTemplate(){
|
118 |
+
|
119 |
+
$this->validateTemplateExists();
|
120 |
+
|
121 |
+
$content = HelperProviderCoreUC_EL::getElementorTemplate($this->templateID);
|
122 |
+
|
123 |
+
$this->renderHeaderPart();
|
124 |
+
|
125 |
+
//$this->renderRegularBody();
|
126 |
+
|
127 |
+
echo $content;
|
128 |
+
|
129 |
+
$this->renderFooter();
|
130 |
+
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
/**
|
136 |
+
* init the template
|
137 |
+
*/
|
138 |
+
private function init(){
|
139 |
+
|
140 |
+
try{
|
141 |
+
|
142 |
+
show_admin_bar(false);
|
143 |
+
|
144 |
+
$renderTemplateID = UniteFunctionsUC::getGetVar("ucrendertemplate","",UniteFunctionsUC::SANITIZE_ID);
|
145 |
+
|
146 |
+
if(empty($renderTemplateID))
|
147 |
+
UniteFunctionsUC::throwError("template id not found");
|
148 |
+
|
149 |
+
if(is_singular() == false)
|
150 |
+
UniteFunctionsUC::throwError("not singlular");
|
151 |
+
|
152 |
+
$this->templateID = $renderTemplateID;
|
153 |
+
|
154 |
+
$this->renderTemplate();
|
155 |
+
|
156 |
+
|
157 |
+
}catch(Exception $e){
|
158 |
+
|
159 |
+
$message = $e->getMessage();
|
160 |
+
|
161 |
+
$this->putErrorMessage($message);
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
new UCEmptyTemplate();
|
provider/provider_admin.class.php
CHANGED
@@ -1008,8 +1008,9 @@ defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
|
1008 |
|
1009 |
add_action("init", array($this,"checkRankmathAjaxCollision"));
|
1010 |
|
1011 |
-
|
1012 |
$this->addAction("admin_init", "onAdminInit");
|
|
|
|
|
1013 |
}
|
1014 |
|
1015 |
|
1008 |
|
1009 |
add_action("init", array($this,"checkRankmathAjaxCollision"));
|
1010 |
|
|
|
1011 |
$this->addAction("admin_init", "onAdminInit");
|
1012 |
+
|
1013 |
+
|
1014 |
}
|
1015 |
|
1016 |
|
provider/provider_front.class.php
CHANGED
@@ -45,6 +45,28 @@ class UniteProviderFrontUC{
|
|
45 |
return($tag);
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
/**
|
49 |
*
|
50 |
* the constructor
|
@@ -65,6 +87,13 @@ class UniteProviderFrontUC{
|
|
65 |
//modify output <script> tag, add module to it
|
66 |
$this->addFilter("script_loader_tag", 'onScriptTagOutput',10,3);
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
|
45 |
return($tag);
|
46 |
}
|
47 |
|
48 |
+
/**
|
49 |
+
* on template include
|
50 |
+
*/
|
51 |
+
public function onTemplateInclude($template){
|
52 |
+
|
53 |
+
if(is_singular() == false)
|
54 |
+
return($template);
|
55 |
+
|
56 |
+
$renderTemplateID = UniteFunctionsUC::getGetVar("ucrendertemplate","",UniteFunctionsUC::SANITIZE_ID);
|
57 |
+
|
58 |
+
if(empty($renderTemplateID))
|
59 |
+
return($template);
|
60 |
+
|
61 |
+
if(defined("ELEMENTOR_PATH") == false)
|
62 |
+
return($template);
|
63 |
+
|
64 |
+
$pathTemplate = HelperProviderCoreUC_EL::$pathCore."template.php";
|
65 |
+
|
66 |
+
|
67 |
+
return($pathTemplate);
|
68 |
+
}
|
69 |
+
|
70 |
/**
|
71 |
*
|
72 |
* the constructor
|
87 |
//modify output <script> tag, add module to it
|
88 |
$this->addFilter("script_loader_tag", 'onScriptTagOutput',10,3);
|
89 |
|
90 |
+
if(GlobalsUC::$inDev == true){
|
91 |
+
|
92 |
+
//set elementor canvas accorging "GET" variable
|
93 |
+
$this->addFilter("template_include", "onTemplateInclude");
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
}
|
98 |
|
99 |
|
provider/provider_functions.class.php
CHANGED
@@ -572,7 +572,7 @@ class UniteProviderFunctionsUC{
|
|
572 |
* veryfy nonce
|
573 |
*/
|
574 |
public static function verifyNonce($nonce){
|
575 |
-
|
576 |
$verified = wp_verify_nonce($nonce, GlobalsUC::PLUGIN_NAME."_actions");
|
577 |
if($verified == false)
|
578 |
UniteFunctionsUC::throwError("Action security failed, please repeat action");
|
572 |
* veryfy nonce
|
573 |
*/
|
574 |
public static function verifyNonce($nonce){
|
575 |
+
|
576 |
$verified = wp_verify_nonce($nonce, GlobalsUC::PLUGIN_NAME."_actions");
|
577 |
if($verified == false)
|
578 |
UniteFunctionsUC::throwError("Action security failed, please repeat action");
|
provider/provider_helper.class.php
CHANGED
@@ -299,6 +299,29 @@ class HelperProviderUC{
|
|
299 |
UniteCreatorWooIntegrate::initActions();
|
300 |
}
|
301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
|
303 |
/**
|
304 |
* global init function that common to the admin and front
|
@@ -312,6 +335,11 @@ class HelperProviderUC{
|
|
312 |
|
313 |
add_action("plugins_loaded",array("HelperProviderUC", "onPluginsLoaded"));
|
314 |
|
|
|
|
|
|
|
|
|
|
|
315 |
|
316 |
|
317 |
//add_action("wp_loaded", array("HelperProviderUC", "onWPLoaded"));
|
299 |
UniteCreatorWooIntegrate::initActions();
|
300 |
}
|
301 |
|
302 |
+
/**
|
303 |
+
* on php error message
|
304 |
+
*/
|
305 |
+
public static function onPHPErrorMessage($message, $error){
|
306 |
+
|
307 |
+
$errorMessage = UniteFunctionsUC::getVal($error, "message");
|
308 |
+
|
309 |
+
$file = UniteFunctionsUC::getVal($error, "file");
|
310 |
+
$line = UniteFunctionsUC::getVal($error, "line");
|
311 |
+
|
312 |
+
if(is_string($errorMessage))
|
313 |
+
$message .= "Unlimited Elements Troubleshooting: \n<br><pre>{$errorMessage}</pre>";
|
314 |
+
|
315 |
+
if(!empty($file))
|
316 |
+
$message .= "in : <b>$file</b>";
|
317 |
+
|
318 |
+
if(!empty($line))
|
319 |
+
$message .= " on line <b>$line</b>";
|
320 |
+
|
321 |
+
return($message);
|
322 |
+
}
|
323 |
+
|
324 |
+
|
325 |
|
326 |
/**
|
327 |
* global init function that common to the admin and front
|
335 |
|
336 |
add_action("plugins_loaded",array("HelperProviderUC", "onPluginsLoaded"));
|
337 |
|
338 |
+
$showPHPError = HelperProviderCoreUC_EL::getGeneralSetting("show_php_error");
|
339 |
+
$showPHPError = UniteFunctionsUC::strToBool($showPHPError);
|
340 |
+
|
341 |
+
if($showPHPError == true)
|
342 |
+
add_filter("wp_php_error_message", array("HelperProviderUC","onPHPErrorMessage"),100,2);
|
343 |
|
344 |
|
345 |
//add_action("wp_loaded", array("HelperProviderUC", "onWPLoaded"));
|
provider/provider_library.class.php
CHANGED
@@ -2,11 +2,12 @@
|
|
2 |
|
3 |
class UniteCreatorLibrary extends UniteCreatorLibraryWork{
|
4 |
|
|
|
5 |
/**
|
6 |
* get platform include by handle
|
7 |
*/
|
8 |
protected function getUrlPlatformInclude($handle){
|
9 |
-
|
10 |
$urlInclude = null;
|
11 |
|
12 |
switch($handle){
|
@@ -16,6 +17,11 @@ class UniteCreatorLibrary extends UniteCreatorLibraryWork{
|
|
16 |
case "jquery-migrate":
|
17 |
$urlInclude = UniteProviderFunctionsUC::getUrlJQueryMigrateInclude();
|
18 |
break;
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
return($urlInclude);
|
2 |
|
3 |
class UniteCreatorLibrary extends UniteCreatorLibraryWork{
|
4 |
|
5 |
+
|
6 |
/**
|
7 |
* get platform include by handle
|
8 |
*/
|
9 |
protected function getUrlPlatformInclude($handle){
|
10 |
+
|
11 |
$urlInclude = null;
|
12 |
|
13 |
switch($handle){
|
17 |
case "jquery-migrate":
|
18 |
$urlInclude = UniteProviderFunctionsUC::getUrlJQueryMigrateInclude();
|
19 |
break;
|
20 |
+
case "ue_remote_controls":
|
21 |
+
|
22 |
+
$urlInclude = GlobalsUC::$url_assets."aaa_remote/ue_remote_controls.js";
|
23 |
+
|
24 |
+
break;
|
25 |
}
|
26 |
|
27 |
return($urlInclude);
|
provider/provider_params_processor.class.php
CHANGED
@@ -85,7 +85,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
85 |
|
86 |
//change the hypen to underscore
|
87 |
$thumbName = $name."_thumb_".$size;
|
88 |
-
if($size == "medium")
|
89 |
$thumbName = $name."_thumb";
|
90 |
|
91 |
$thumbName = str_replace("-", "_", $thumbName);
|
@@ -111,7 +111,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
111 |
|
112 |
$data[$thumbName] = $urlThumb;
|
113 |
$data[$thumbName."_width"] = $thumbWidth;
|
114 |
-
$data[$thumbName."_height"] = $thumbHeight;
|
|
|
115 |
}
|
116 |
|
117 |
return($data);
|
@@ -705,6 +706,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
705 |
//check the single page pagination
|
706 |
$paginationType = UniteFunctionsUC::getVal($value, $name."_pagination_type");
|
707 |
|
|
|
708 |
if(empty($paginationType))
|
709 |
return($args);
|
710 |
|
@@ -716,7 +718,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
716 |
if(empty($page)){
|
717 |
$page = get_query_var("paged", null);
|
718 |
}
|
719 |
-
|
720 |
if(empty($page))
|
721 |
return($args);
|
722 |
|
@@ -1584,7 +1586,7 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1584 |
dmp("The Query Is:");
|
1585 |
dmp($args);
|
1586 |
}
|
1587 |
-
|
1588 |
$query = new WP_Query($args);
|
1589 |
|
1590 |
if($showDebugQuery == true && $debugType == "show_query"){
|
@@ -1897,8 +1899,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1897 |
/**
|
1898 |
* get gallery item title
|
1899 |
*/
|
1900 |
-
private function getGalleryItem_title($source, $data, $name, $post){
|
1901 |
-
|
1902 |
switch($source){
|
1903 |
case "post_title":
|
1904 |
$title = $post->post_title;
|
@@ -1921,6 +1923,12 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1921 |
case "image_description":
|
1922 |
$title = UniteFunctionsUC::getVal($data, $name."_description");
|
1923 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
1924 |
default:
|
1925 |
case "image_auto":
|
1926 |
|
@@ -1934,19 +1942,121 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1934 |
|
1935 |
break;
|
1936 |
}
|
|
|
1937 |
|
1938 |
return($title);
|
1939 |
}
|
1940 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1941 |
|
1942 |
/**
|
1943 |
* get gallery item
|
1944 |
*/
|
1945 |
private function getGalleryItem($id, $url = null, $arrParams = null){
|
1946 |
|
1947 |
-
|
1948 |
$data = array();
|
1949 |
-
|
1950 |
$arrFilters = UniteFunctionsUC::getVal($arrParams, "size_filters");
|
1951 |
|
1952 |
$thumbSize = UniteFunctionsUC::getVal($arrParams, "thumb_size");
|
@@ -1955,7 +2065,11 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1955 |
$titleSource = UniteFunctionsUC::getVal($arrParams, "title_source");
|
1956 |
$descriptionSource = UniteFunctionsUC::getVal($arrParams, "description_source");
|
1957 |
$post = UniteFunctionsUC::getVal($arrParams, "post");
|
|
|
1958 |
|
|
|
|
|
|
|
1959 |
$name = "image";
|
1960 |
|
1961 |
$param = array();
|
@@ -1966,11 +2080,18 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1966 |
//no extra data needed
|
1967 |
if( strpos($titleSource,"post_") !== false && strpos($descriptionSource, "post_") !== false)
|
1968 |
$param["no_image_data"] = true;
|
|
|
|
|
|
|
1969 |
|
|
|
1970 |
$value = $id;
|
1971 |
if(empty($value))
|
1972 |
$value = $url;
|
1973 |
|
|
|
|
|
|
|
1974 |
if(empty($value)){
|
1975 |
|
1976 |
$item["image"] = GlobalsUC::$url_no_image_placeholder;
|
@@ -1980,22 +2101,26 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
1980 |
$item["image_height"] = 600;
|
1981 |
$item["thumb_width"] = 600;
|
1982 |
$item["thumb_height"] = 600;
|
1983 |
-
|
1984 |
-
$title = $this->getGalleryItem_title($titleSource, $data, $name, $post);
|
1985 |
-
$description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post);
|
1986 |
|
1987 |
-
|
|
|
|
|
|
|
1988 |
$title = $post->post_title;
|
1989 |
|
1990 |
$item["title"] = $title;
|
1991 |
$item["description"] = $description;
|
1992 |
-
|
|
|
|
|
|
|
|
|
|
|
1993 |
$item["imageid"] = 0;
|
1994 |
|
1995 |
return($item);
|
1996 |
}
|
1997 |
|
1998 |
-
|
1999 |
$data = $this->getProcessedParamsValue_image($data, $value, $param);
|
2000 |
|
2001 |
$arrItem = array();
|
@@ -2008,7 +2133,10 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2008 |
if(!isset($data[$keyImage]))
|
2009 |
$keyImage = $name;
|
2010 |
|
2011 |
-
|
|
|
|
|
|
|
2012 |
$item["image"] = UniteFunctionsUC::getVal($data, $keyImage);
|
2013 |
$item["thumb"] = UniteFunctionsUC::getVal($data, $keyThumb);
|
2014 |
|
@@ -2018,11 +2146,18 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2018 |
$item["thumb_width"] = UniteFunctionsUC::getVal($data, $keyThumb."_width");
|
2019 |
$item["thumb_height"] = UniteFunctionsUC::getVal($data, $keyThumb."_height");
|
2020 |
|
2021 |
-
$title = $this->getGalleryItem_title($titleSource, $data, $name, $post);
|
2022 |
-
$description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post);
|
2023 |
|
2024 |
$item["title"] = $title;
|
2025 |
$item["description"] = $description;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026 |
$item["imageid"] = $id;
|
2027 |
|
2028 |
return($item);
|
@@ -2040,6 +2175,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2040 |
$thumbSize = UniteFunctionsUC::getVal($value, $name."_thumb_size");
|
2041 |
$imageSize = UniteFunctionsUC::getVal($value, $name."_image_size");
|
2042 |
|
|
|
|
|
|
|
2043 |
$arrFilters = array();
|
2044 |
if(!empty($thumbSize))
|
2045 |
$arrFilters[] = $thumbSize;
|
@@ -2063,22 +2201,28 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2063 |
|
2064 |
$titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_post");
|
2065 |
$descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_post");
|
2066 |
-
|
2067 |
break;
|
2068 |
case "gallery":
|
2069 |
$titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_gallery");
|
2070 |
$descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_gallery");
|
2071 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
2072 |
}
|
2073 |
|
2074 |
$params["title_source"] = $titleSource;
|
2075 |
$params["description_source"] = $descriptionSource;
|
2076 |
|
2077 |
-
|
2078 |
$output = array();
|
2079 |
foreach($arrItems as $item){
|
2080 |
|
2081 |
switch($source){
|
|
|
2082 |
case "posts":
|
2083 |
|
2084 |
$postID = $item->ID;
|
@@ -2098,14 +2242,42 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2098 |
$id = UniteFunctionsUC::getVal($item, "id");
|
2099 |
$url = UniteFunctionsUC::getVal($item, "url");
|
2100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2101 |
$galleryItem = $this->getGalleryItem($id, $url,$params);
|
2102 |
-
|
2103 |
break;
|
2104 |
case "current_post_meta":
|
2105 |
|
2106 |
//item is ID
|
2107 |
$galleryItem = $this->getGalleryItem($item,null,$params);
|
2108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2109 |
break;
|
2110 |
default:
|
2111 |
UniteFunctionsUC::throwError("group gallery error: unknown type: $source");
|
@@ -2115,10 +2287,8 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2115 |
if(!empty($galleryItem))
|
2116 |
$output[] = $galleryItem;
|
2117 |
|
2118 |
-
|
2119 |
}
|
2120 |
-
|
2121 |
-
|
2122 |
return($output);
|
2123 |
}
|
2124 |
|
@@ -2191,6 +2361,23 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2191 |
return($arrIDs);
|
2192 |
}
|
2193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2194 |
|
2195 |
/**
|
2196 |
* get listing data
|
@@ -2205,6 +2392,9 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2205 |
|
2206 |
$source = UniteFunctionsUC::getVal($value, $name."_source");
|
2207 |
|
|
|
|
|
|
|
2208 |
$templateID = UniteFunctionsUC::getVal($value, $name."_template_templateid");
|
2209 |
|
2210 |
$data[$name."_source"] = $source;
|
@@ -2243,26 +2433,60 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2243 |
|
2244 |
break;
|
2245 |
case "gallery":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2246 |
|
2247 |
-
$data[$name."_items"] = UniteFunctionsUC::getVal($value, $name."_gallery");
|
2248 |
-
|
2249 |
break;
|
2250 |
case "current_post_meta": //meta field with image id's
|
2251 |
|
2252 |
$data[$name."_items"] = $this->getGroupedData_getArrImageIDsFromMeta($value, $name);
|
2253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2254 |
break;
|
2255 |
default:
|
2256 |
-
UniteFunctionsUC::throwError("Wrong
|
2257 |
break;
|
2258 |
}
|
2259 |
|
2260 |
if($isForGallery == true){
|
2261 |
|
2262 |
$arrItems = $data[$name."_items"];
|
2263 |
-
|
2264 |
-
$data[$name."_items"] = $this->getGroupedData_convertForGallery($arrItems, $source, $value, $param);
|
2265 |
|
|
|
|
|
|
|
2266 |
return($data);
|
2267 |
}
|
2268 |
|
@@ -2602,6 +2826,13 @@ class UniteCreatorParamsProcessor extends UniteCreatorParamsProcessorWork{
|
|
2602 |
|
2603 |
$arrMetaQuery = $this->addMetaQueryItem($arrMetaQuery, $metaKey, $metaValue, $metaCompare);
|
2604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2605 |
break;
|
2606 |
default:
|
2607 |
dmp("wrong include by: $includeby");
|
85 |
|
86 |
//change the hypen to underscore
|
87 |
$thumbName = $name."_thumb_".$size;
|
88 |
+
if($size == "medium" && empty($filterSizes))
|
89 |
$thumbName = $name."_thumb";
|
90 |
|
91 |
$thumbName = str_replace("-", "_", $thumbName);
|
111 |
|
112 |
$data[$thumbName] = $urlThumb;
|
113 |
$data[$thumbName."_width"] = $thumbWidth;
|
114 |
+
$data[$thumbName."_height"] = $thumbHeight;
|
115 |
+
|
116 |
}
|
117 |
|
118 |
return($data);
|
706 |
//check the single page pagination
|
707 |
$paginationType = UniteFunctionsUC::getVal($value, $name."_pagination_type");
|
708 |
|
709 |
+
|
710 |
if(empty($paginationType))
|
711 |
return($args);
|
712 |
|
718 |
if(empty($page)){
|
719 |
$page = get_query_var("paged", null);
|
720 |
}
|
721 |
+
|
722 |
if(empty($page))
|
723 |
return($args);
|
724 |
|
1586 |
dmp("The Query Is:");
|
1587 |
dmp($args);
|
1588 |
}
|
1589 |
+
|
1590 |
$query = new WP_Query($args);
|
1591 |
|
1592 |
if($showDebugQuery == true && $debugType == "show_query"){
|
1899 |
/**
|
1900 |
* get gallery item title
|
1901 |
*/
|
1902 |
+
private function getGalleryItem_title($source, $data, $name, $post, $item){
|
1903 |
+
|
1904 |
switch($source){
|
1905 |
case "post_title":
|
1906 |
$title = $post->post_title;
|
1923 |
case "image_description":
|
1924 |
$title = UniteFunctionsUC::getVal($data, $name."_description");
|
1925 |
break;
|
1926 |
+
case "item_title":
|
1927 |
+
$title = UniteFunctionsUC::getVal($item, "title");
|
1928 |
+
break;
|
1929 |
+
case "item_description":
|
1930 |
+
$title = UniteFunctionsUC::getVal($item, "description");
|
1931 |
+
break;
|
1932 |
default:
|
1933 |
case "image_auto":
|
1934 |
|
1942 |
|
1943 |
break;
|
1944 |
}
|
1945 |
+
|
1946 |
|
1947 |
return($title);
|
1948 |
}
|
1949 |
|
1950 |
+
/**
|
1951 |
+
* get gallery item data
|
1952 |
+
*/
|
1953 |
+
private function getGalleryItem_sourceItemData($item, $sourceItem){
|
1954 |
+
|
1955 |
+
$itemType = UniteFunctionsUC::getVal($sourceItem, "item_type", "image");
|
1956 |
+
|
1957 |
+
switch($itemType){
|
1958 |
+
case "image":
|
1959 |
+
break;
|
1960 |
+
case "youtube":
|
1961 |
+
|
1962 |
+
$urlYoutube = UniteFunctionsUC::getVal($sourceItem, "url_youtube");
|
1963 |
+
|
1964 |
+
$videoID = UniteFunctionsUC::getYoutubeVideoID($urlYoutube);
|
1965 |
+
|
1966 |
+
$item["type"] = "youtube";
|
1967 |
+
$item["videoid"] = $videoID;
|
1968 |
+
|
1969 |
+
break;
|
1970 |
+
case "html5":
|
1971 |
+
|
1972 |
+
$urlMp4 = UniteFunctionsUC::getVal($sourceItem, "url_html5");
|
1973 |
+
|
1974 |
+
$item["type"] = "html5video";
|
1975 |
+
$item["url_mp4"] = $urlMp4;
|
1976 |
+
|
1977 |
+
break;
|
1978 |
+
case "vimeo":
|
1979 |
+
|
1980 |
+
$videoID = UniteFunctionsUC::getVal($sourceItem, "vimeo_id");
|
1981 |
+
|
1982 |
+
$videoID = UniteFunctionsUC::getVimeoIDFromUrl($videoID);
|
1983 |
+
|
1984 |
+
$item["type"] = "vimeo";
|
1985 |
+
$item["videoid"] = $videoID;
|
1986 |
+
break;
|
1987 |
+
case "wistia":
|
1988 |
+
|
1989 |
+
$videoID = UniteFunctionsUC::getVal($sourceItem, "wistia_id");
|
1990 |
+
|
1991 |
+
$item["type"] = "wistia";
|
1992 |
+
$item["videoid"] = $videoID;
|
1993 |
+
|
1994 |
+
break;
|
1995 |
+
default:
|
1996 |
+
|
1997 |
+
dmp("wrong gallery item type: $itemType");
|
1998 |
+
dmp($sourceItem);
|
1999 |
+
|
2000 |
+
break;
|
2001 |
+
}
|
2002 |
+
|
2003 |
+
//get the link url
|
2004 |
+
$link = UniteFunctionsUC::getVal($sourceItem, "link");
|
2005 |
+
if(is_array($link))
|
2006 |
+
$link = UniteFunctionsUC::getVal($link, "url");
|
2007 |
+
|
2008 |
+
if(empty($link))
|
2009 |
+
$link = "";
|
2010 |
+
|
2011 |
+
$item["link"] = $link;
|
2012 |
+
|
2013 |
+
|
2014 |
+
return($item);
|
2015 |
+
}
|
2016 |
+
|
2017 |
+
|
2018 |
+
/**
|
2019 |
+
* get gallery item from instagram
|
2020 |
+
*/
|
2021 |
+
private function getGalleryItem_instagram($instaItem, $isEnableVideo){
|
2022 |
+
|
2023 |
+
$isVideo = UniteFunctionsUC::getVal($instaItem, "isvideo");
|
2024 |
+
$isVideo = UniteFunctionsUC::strToBool($isVideo);
|
2025 |
+
|
2026 |
+
$item["type"] = "image";
|
2027 |
+
$item["image"] = UniteFunctionsUC::getVal($instaItem, "image");
|
2028 |
+
$item["thumb"] = UniteFunctionsUC::getVal($instaItem, "thumb");
|
2029 |
+
|
2030 |
+
if($isVideo == true && $isEnableVideo == true){
|
2031 |
+
|
2032 |
+
$urlVideo = UniteFunctionsUC::getVal($instaItem, "url_video");
|
2033 |
+
|
2034 |
+
$item["type"] = "html5video";
|
2035 |
+
$item["url_mp4"] = $urlVideo;
|
2036 |
+
}
|
2037 |
+
|
2038 |
+
$imageSize = 1080;
|
2039 |
+
|
2040 |
+
$item["image_width"] = $imageSize;
|
2041 |
+
$item["image_height"] = $imageSize;
|
2042 |
+
$item["thumb_width"] = $imageSize;
|
2043 |
+
$item["thumb_height"] = $imageSize;
|
2044 |
+
|
2045 |
+
$item["title"] = UniteFunctionsUC::getVal($instaItem, "caption");
|
2046 |
+
$item["description"] = "";
|
2047 |
+
$item["link"] = UniteFunctionsUC::getVal($instaItem, "link");
|
2048 |
+
$item["imageid"] = 0;
|
2049 |
+
|
2050 |
+
return($item);
|
2051 |
+
}
|
2052 |
|
2053 |
/**
|
2054 |
* get gallery item
|
2055 |
*/
|
2056 |
private function getGalleryItem($id, $url = null, $arrParams = null){
|
2057 |
|
|
|
2058 |
$data = array();
|
2059 |
+
|
2060 |
$arrFilters = UniteFunctionsUC::getVal($arrParams, "size_filters");
|
2061 |
|
2062 |
$thumbSize = UniteFunctionsUC::getVal($arrParams, "thumb_size");
|
2065 |
$titleSource = UniteFunctionsUC::getVal($arrParams, "title_source");
|
2066 |
$descriptionSource = UniteFunctionsUC::getVal($arrParams, "description_source");
|
2067 |
$post = UniteFunctionsUC::getVal($arrParams, "post");
|
2068 |
+
$sourceItem = UniteFunctionsUC::getVal($arrParams, "item");
|
2069 |
|
2070 |
+
$isAddItemsData = UniteFunctionsUC::getVal($arrParams, "add_item_data");
|
2071 |
+
$isAddItemsData = UniteFunctionsUC::strToBool($isAddItemsData);
|
2072 |
+
|
2073 |
$name = "image";
|
2074 |
|
2075 |
$param = array();
|
2080 |
//no extra data needed
|
2081 |
if( strpos($titleSource,"post_") !== false && strpos($descriptionSource, "post_") !== false)
|
2082 |
$param["no_image_data"] = true;
|
2083 |
+
else
|
2084 |
+
if($titleSource == "item_title" && $descriptionSource == "item_description")
|
2085 |
+
$param["no_image_data"] = true;
|
2086 |
|
2087 |
+
|
2088 |
$value = $id;
|
2089 |
if(empty($value))
|
2090 |
$value = $url;
|
2091 |
|
2092 |
+
$item = array();
|
2093 |
+
$item["type"] = "image";
|
2094 |
+
|
2095 |
if(empty($value)){
|
2096 |
|
2097 |
$item["image"] = GlobalsUC::$url_no_image_placeholder;
|
2101 |
$item["image_height"] = 600;
|
2102 |
$item["thumb_width"] = 600;
|
2103 |
$item["thumb_height"] = 600;
|
|
|
|
|
|
|
2104 |
|
2105 |
+
$title = $this->getGalleryItem_title($titleSource, $data, $name, $post, $sourceItem);
|
2106 |
+
$description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post, $sourceItem);
|
2107 |
+
|
2108 |
+
if(empty($title) && !empty($post))
|
2109 |
$title = $post->post_title;
|
2110 |
|
2111 |
$item["title"] = $title;
|
2112 |
$item["description"] = $description;
|
2113 |
+
|
2114 |
+
$item["link"] = "";
|
2115 |
+
|
2116 |
+
if(!empty($post))
|
2117 |
+
$item["link"] = $post->guid;
|
2118 |
+
|
2119 |
$item["imageid"] = 0;
|
2120 |
|
2121 |
return($item);
|
2122 |
}
|
2123 |
|
|
|
2124 |
$data = $this->getProcessedParamsValue_image($data, $value, $param);
|
2125 |
|
2126 |
$arrItem = array();
|
2133 |
if(!isset($data[$keyImage]))
|
2134 |
$keyImage = $name;
|
2135 |
|
2136 |
+
//add extra data
|
2137 |
+
if($isAddItemsData == true)
|
2138 |
+
$item = $this->getGalleryItem_sourceItemData($item, $sourceItem);
|
2139 |
+
|
2140 |
$item["image"] = UniteFunctionsUC::getVal($data, $keyImage);
|
2141 |
$item["thumb"] = UniteFunctionsUC::getVal($data, $keyThumb);
|
2142 |
|
2146 |
$item["thumb_width"] = UniteFunctionsUC::getVal($data, $keyThumb."_width");
|
2147 |
$item["thumb_height"] = UniteFunctionsUC::getVal($data, $keyThumb."_height");
|
2148 |
|
2149 |
+
$title = $this->getGalleryItem_title($titleSource, $data, $name, $post, $sourceItem);
|
2150 |
+
$description = $this->getGalleryItem_title($descriptionSource, $data, $name, $post, $sourceItem);
|
2151 |
|
2152 |
$item["title"] = $title;
|
2153 |
$item["description"] = $description;
|
2154 |
+
|
2155 |
+
if(!isset($item["link"])){
|
2156 |
+
$item["link"] = "";
|
2157 |
+
if(!empty($post))
|
2158 |
+
$item["link"] = $post->guid;
|
2159 |
+
}
|
2160 |
+
|
2161 |
$item["imageid"] = $id;
|
2162 |
|
2163 |
return($item);
|
2175 |
$thumbSize = UniteFunctionsUC::getVal($value, $name."_thumb_size");
|
2176 |
$imageSize = UniteFunctionsUC::getVal($value, $name."_image_size");
|
2177 |
|
2178 |
+
$isEnableVideo = UniteFunctionsUC::getVal($param, "gallery_enable_video");
|
2179 |
+
$isEnableVideo = UniteFunctionsUC::strToBool($isEnableVideo);
|
2180 |
+
|
2181 |
$arrFilters = array();
|
2182 |
if(!empty($thumbSize))
|
2183 |
$arrFilters[] = $thumbSize;
|
2201 |
|
2202 |
$titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_post");
|
2203 |
$descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_post");
|
2204 |
+
|
2205 |
break;
|
2206 |
case "gallery":
|
2207 |
$titleSource = UniteFunctionsUC::getVal($value, $name."_title_source_gallery");
|
2208 |
$descriptionSource = UniteFunctionsUC::getVal($value, $name."_description_source_gallery");
|
2209 |
break;
|
2210 |
+
case "image_video_repeater":
|
2211 |
+
|
2212 |
+
$titleSource = "item_title";
|
2213 |
+
$descriptionSource = "item_description";
|
2214 |
+
|
2215 |
+
break;
|
2216 |
}
|
2217 |
|
2218 |
$params["title_source"] = $titleSource;
|
2219 |
$params["description_source"] = $descriptionSource;
|
2220 |
|
|
|
2221 |
$output = array();
|
2222 |
foreach($arrItems as $item){
|
2223 |
|
2224 |
switch($source){
|
2225 |
+
case "products":
|
2226 |
case "posts":
|
2227 |
|
2228 |
$postID = $item->ID;
|
2242 |
$id = UniteFunctionsUC::getVal($item, "id");
|
2243 |
$url = UniteFunctionsUC::getVal($item, "url");
|
2244 |
|
2245 |
+
//for default items
|
2246 |
+
if(empty($id) && empty($url)){
|
2247 |
+
$url = UniteFunctionsUC::getVal($item, "image");
|
2248 |
+
|
2249 |
+
if(!empty($url)){
|
2250 |
+
$params["item"] = $item;
|
2251 |
+
$params["title_source"] = "item_title";
|
2252 |
+
}
|
2253 |
+
}
|
2254 |
+
|
2255 |
$galleryItem = $this->getGalleryItem($id, $url,$params);
|
2256 |
+
|
2257 |
break;
|
2258 |
case "current_post_meta":
|
2259 |
|
2260 |
//item is ID
|
2261 |
$galleryItem = $this->getGalleryItem($item,null,$params);
|
2262 |
|
2263 |
+
break;
|
2264 |
+
case "image_video_repeater":
|
2265 |
+
|
2266 |
+
$image = UniteFunctionsUC::getVal($item, "image");
|
2267 |
+
|
2268 |
+
$url = UniteFunctionsUC::getVal($image, "url");
|
2269 |
+
$id = UniteFunctionsUC::getVal($image, "id");
|
2270 |
+
|
2271 |
+
$params["add_item_data"] = true;
|
2272 |
+
$params["item"] = $item;
|
2273 |
+
|
2274 |
+
$galleryItem = $this->getGalleryItem($id, $url, $params);
|
2275 |
+
|
2276 |
+
break;
|
2277 |
+
case "instagram":
|
2278 |
+
|
2279 |
+
$galleryItem = $this->getGalleryItem_instagram($item, $isEnableVideo);
|
2280 |
+
|
2281 |
break;
|
2282 |
default:
|
2283 |
UniteFunctionsUC::throwError("group gallery error: unknown type: $source");
|
2287 |
if(!empty($galleryItem))
|
2288 |
$output[] = $galleryItem;
|
2289 |
|
|
|
2290 |
}
|
2291 |
+
|
|
|
2292 |
return($output);
|
2293 |
}
|
2294 |
|
2361 |
return($arrIDs);
|
2362 |
}
|
2363 |
|
2364 |
+
/**
|
2365 |
+
* try to get gallery items from addon items
|
2366 |
+
*/
|
2367 |
+
private function getGalleryItemsFromDefaultItems(){
|
2368 |
+
|
2369 |
+
$arrItems = $this->addon->getArrItemsNonProcessed();
|
2370 |
+
|
2371 |
+
if(empty($arrItems))
|
2372 |
+
return(array());
|
2373 |
+
|
2374 |
+
$firstItem = $arrItems[0];
|
2375 |
+
if(isset($firstItem["image"]) == false)
|
2376 |
+
return(array());
|
2377 |
+
|
2378 |
+
return($arrItems);
|
2379 |
+
}
|
2380 |
+
|
2381 |
|
2382 |
/**
|
2383 |
* get listing data
|
2392 |
|
2393 |
$source = UniteFunctionsUC::getVal($value, $name."_source");
|
2394 |
|
2395 |
+
if(empty($source) && $isForGallery == true)
|
2396 |
+
$source = "gallery";
|
2397 |
+
|
2398 |
$templateID = UniteFunctionsUC::getVal($value, $name."_template_templateid");
|
2399 |
|
2400 |
$data[$name."_source"] = $source;
|
2433 |
|
2434 |
break;
|
2435 |
case "gallery":
|
2436 |
+
|
2437 |
+
$arrGalleryItems = UniteFunctionsUC::getVal($value, $name."_gallery");
|
2438 |
+
|
2439 |
+
//output defaults
|
2440 |
+
if(empty($arrGalleryItems))
|
2441 |
+
$arrGalleryItems = $this->getGalleryItemsFromDefaultItems();
|
2442 |
+
|
2443 |
+
$data[$name."_items"] = $arrGalleryItems;
|
2444 |
|
|
|
|
|
2445 |
break;
|
2446 |
case "current_post_meta": //meta field with image id's
|
2447 |
|
2448 |
$data[$name."_items"] = $this->getGroupedData_getArrImageIDsFromMeta($value, $name);
|
2449 |
|
2450 |
+
break;
|
2451 |
+
case "image_video_repeater":
|
2452 |
+
|
2453 |
+
$data[$name."_items"] = UniteFunctionsUC::getVal($value, $name."_items");
|
2454 |
+
|
2455 |
+
//do nothing, convert later
|
2456 |
+
|
2457 |
+
break;
|
2458 |
+
case "instagram":
|
2459 |
+
|
2460 |
+
$paramInstagram = $param;
|
2461 |
+
$paramInstagram["name"] = $paramInstagram["name"]."_instagram";
|
2462 |
+
|
2463 |
+
$arrInstagramData = $this->getInstagramData($value, $name."_instagram", $paramInstagram);
|
2464 |
+
|
2465 |
+
$error = UniteFunctionsUC::getVal($arrInstagramData, "error");
|
2466 |
+
if(!empty($error))
|
2467 |
+
UniteFunctionsUC::throwError($error);
|
2468 |
+
|
2469 |
+
$arrInstagramItems = UniteFunctionsUC::getVal($arrInstagramData, "items");
|
2470 |
+
|
2471 |
+
|
2472 |
+
if(empty($arrInstagramItems))
|
2473 |
+
$arrInstagramItems = array();
|
2474 |
+
|
2475 |
+
$data[$name."_items"] = $arrInstagramItems;
|
2476 |
+
|
2477 |
break;
|
2478 |
default:
|
2479 |
+
UniteFunctionsUC::throwError("Wrong dynamic content source: $source");
|
2480 |
break;
|
2481 |
}
|
2482 |
|
2483 |
if($isForGallery == true){
|
2484 |
|
2485 |
$arrItems = $data[$name."_items"];
|
|
|
|
|
2486 |
|
2487 |
+
$data[$name."_items"] = $this->getGroupedData_convertForGallery($arrItems, $source, $value, $param);
|
2488 |
+
|
2489 |
+
|
2490 |
return($data);
|
2491 |
}
|
2492 |
|
2826 |
|
2827 |
$arrMetaQuery = $this->addMetaQueryItem($arrMetaQuery, $metaKey, $metaValue, $metaCompare);
|
2828 |
|
2829 |
+
break;
|
2830 |
+
case "children_of_current":
|
2831 |
+
|
2832 |
+
$parentTermID = UniteFunctionsWPUC::getCurrentTermID();
|
2833 |
+
|
2834 |
+
$args["parent"] = $parentTermID;
|
2835 |
+
|
2836 |
break;
|
2837 |
default:
|
2838 |
dmp("wrong include by: $includeby");
|
provider/provider_settings.class.php
CHANGED
@@ -439,7 +439,8 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
439 |
|
440 |
$arrIncludeBy = array();
|
441 |
$arrIncludeBy["spacific_terms"] = __("Specific Terms","unlimited-elements-for-elementor");
|
442 |
-
$arrIncludeBy["parents"] = __("
|
|
|
443 |
$arrIncludeBy["search"] = __("By Search Text","unlimited-elements-for-elementor");
|
444 |
$arrIncludeBy["childless"] = __("Only Childless","unlimited-elements-for-elementor");
|
445 |
$arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
|
@@ -2038,7 +2039,9 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
2038 |
//add template picker
|
2039 |
$useFor = UniteFunctionsUC::getVal($param, "use_for");
|
2040 |
$isForGallery = ($useFor == "gallery");
|
2041 |
-
|
|
|
|
|
2042 |
//set text prefix
|
2043 |
$textPrefix = __("Items ","unlimited-elements-for-elementor");
|
2044 |
if($isForGallery == true)
|
@@ -2059,8 +2062,16 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
2059 |
|
2060 |
$arrSource = array();
|
2061 |
|
|
|
2062 |
if($isForGallery == true){
|
2063 |
$arrSource["gallery"] = __("Gallery", "unlimited-elements-for-elementor");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2064 |
}
|
2065 |
|
2066 |
$arrSource["posts"] = __("Posts", "unlimited-elements-for-elementor");
|
@@ -2069,10 +2080,9 @@ class UniteCreatorSettings extends UniteCreatorSettingsWork{
|
|
2069 |
if($isWooActive == true)
|
2070 |
$arrSource["products"] = __("Products", "unlimited-elements-for-elementor");
|
2071 |
|
2072 |
-
|
2073 |
if($isForGallery == true){
|
2074 |
$arrSource["current_post_meta"] = __("Current Post Metafield", "unlimited-elements-for-elementor");
|
2075 |
-
$arrSource["image_video_repeater"] = __("Image And Video Items", "unlimited-elements-for-elementor");
|
2076 |
}
|
2077 |
|
2078 |
//$arrSource["terms"] = __("Terms", "unlimited-elements-for-elementor");
|
439 |
|
440 |
$arrIncludeBy = array();
|
441 |
$arrIncludeBy["spacific_terms"] = __("Specific Terms","unlimited-elements-for-elementor");
|
442 |
+
$arrIncludeBy["parents"] = __("Children Of","unlimited-elements-for-elementor");
|
443 |
+
$arrIncludeBy["children_of_current"] = __("Children Of Current Term","unlimited-elements-for-elementor");
|
444 |
$arrIncludeBy["search"] = __("By Search Text","unlimited-elements-for-elementor");
|
445 |
$arrIncludeBy["childless"] = __("Only Childless","unlimited-elements-for-elementor");
|
446 |
$arrIncludeBy["no_parent"] = __("Not a Child of Other Term","unlimited-elements-for-elementor");
|
2039 |
//add template picker
|
2040 |
$useFor = UniteFunctionsUC::getVal($param, "use_for");
|
2041 |
$isForGallery = ($useFor == "gallery");
|
2042 |
+
$isEnableVideoItems = UniteFunctionsUC::getVal($param, "gallery_enable_video");
|
2043 |
+
$isEnableVideoItems = UniteFunctionsUC::strToBool($isEnableVideoItems);
|
2044 |
+
|
2045 |
//set text prefix
|
2046 |
$textPrefix = __("Items ","unlimited-elements-for-elementor");
|
2047 |
if($isForGallery == true)
|
2062 |
|
2063 |
$arrSource = array();
|
2064 |
|
2065 |
+
|
2066 |
if($isForGallery == true){
|
2067 |
$arrSource["gallery"] = __("Gallery", "unlimited-elements-for-elementor");
|
2068 |
+
|
2069 |
+
if($isEnableVideoItems == true)
|
2070 |
+
$arrSource["image_video_repeater"] = __("Image And Video Items", "unlimited-elements-for-elementor");
|
2071 |
+
else
|
2072 |
+
$arrSource["image_video_repeater"] = __("Image Items", "unlimited-elements-for-elementor");
|
2073 |
+
|
2074 |
+
$arrSource["instagram"] = __("Instagram", "unlimited-elements-for-elementor");
|
2075 |
}
|
2076 |
|
2077 |
$arrSource["posts"] = __("Posts", "unlimited-elements-for-elementor");
|
2080 |
if($isWooActive == true)
|
2081 |
$arrSource["products"] = __("Products", "unlimited-elements-for-elementor");
|
2082 |
|
2083 |
+
|
2084 |
if($isForGallery == true){
|
2085 |
$arrSource["current_post_meta"] = __("Current Post Metafield", "unlimited-elements-for-elementor");
|
|
|
2086 |
}
|
2087 |
|
2088 |
//$arrSource["terms"] = __("Terms", "unlimited-elements-for-elementor");
|
provider/woocommerce_integrate.class.php
CHANGED
@@ -119,6 +119,29 @@ class UniteCreatorWooIntegrate{
|
|
119 |
return(self::$instance);
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
/**
|
123 |
* add add to cart data
|
124 |
*/
|
@@ -255,6 +278,213 @@ class UniteCreatorWooIntegrate{
|
|
255 |
return($arrProperties);
|
256 |
}
|
257 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
/**
|
260 |
* get product data
|
@@ -365,7 +595,6 @@ class UniteCreatorWooIntegrate{
|
|
365 |
$arrKeys[] = "woo_link_addcart_checkout";
|
366 |
$arrKeys[] = "woo_addcart_ajax_attributes";
|
367 |
|
368 |
-
|
369 |
return($arrKeys);
|
370 |
}
|
371 |
|
119 |
return(self::$instance);
|
120 |
}
|
121 |
|
122 |
+
/**
|
123 |
+
* add to cart for variation
|
124 |
+
*/
|
125 |
+
private function addAddToCartForVariation($arrVariation){
|
126 |
+
|
127 |
+
$variationID = UniteFunctionsUC::getVal($arrVariation, "variation_id");
|
128 |
+
$sku = UniteFunctionsUC::getVal($arrVariation, "sku");
|
129 |
+
|
130 |
+
$params = "add-to-cart={$variationID}";
|
131 |
+
|
132 |
+
$urlAddCart = UniteFunctionsUC::addUrlParams($this->urlCurrentPage, $params);
|
133 |
+
|
134 |
+
$arrVariation["link_addcart_cart"] = UniteFunctionsUC::addUrlParams($this->urlCart, $params);
|
135 |
+
$arrVariation["link_addcart_checkout"] = UniteFunctionsUC::addUrlParams($this->urlCheckout, $params);
|
136 |
+
|
137 |
+
//add html ajax add to cart
|
138 |
+
$addCartAttributes = "href=\"{$urlAddCart}\" data-quantity=\"1\" class=\"uc-button-addcart product_type_simple add_to_cart_button ajax_add_to_cart\" data-product_id=\"{$variationID}\" data-product_sku=\"{$sku}\" rel=\"nofollow\"";
|
139 |
+
|
140 |
+
$arrVariation["addcart_ajax_attributes"] = $addCartAttributes;
|
141 |
+
|
142 |
+
return($arrVariation);
|
143 |
+
}
|
144 |
+
|
145 |
/**
|
146 |
* add add to cart data
|
147 |
*/
|
278 |
return($arrProperties);
|
279 |
}
|
280 |
|
281 |
+
/**
|
282 |
+
* get attribute simple title
|
283 |
+
*/
|
284 |
+
private function getVariationAttributeTitle($slug, $value, $arrTitles){
|
285 |
+
|
286 |
+
$key = $slug."_".$value;
|
287 |
+
|
288 |
+
$title = UniteFunctionsUC::getVal($arrTitles, $key);
|
289 |
+
|
290 |
+
if(empty($title))
|
291 |
+
$title = UniteFunctionsUC::getVal($arrTitles, $slug);
|
292 |
+
|
293 |
+
//if not found - return simple text
|
294 |
+
if(empty($title)){
|
295 |
+
|
296 |
+
$slug = str_replace("attribute_", "", $slug);
|
297 |
+
|
298 |
+
$title = array("attr"=>$slug,"title"=>$value);
|
299 |
+
|
300 |
+
return($title);
|
301 |
+
}
|
302 |
+
|
303 |
+
if(is_array($title))
|
304 |
+
return($title);
|
305 |
+
|
306 |
+
//string type
|
307 |
+
|
308 |
+
$slug = str_replace("attribute_", "", $slug);
|
309 |
+
|
310 |
+
$arrTitle = array("attr"=>$title,"title"=>$value);
|
311 |
+
|
312 |
+
return($arrTitle);
|
313 |
+
}
|
314 |
+
|
315 |
+
/**
|
316 |
+
* add titles for variation
|
317 |
+
*/
|
318 |
+
private function addTitlesForVariation($arrVariation, $arrAttributeTitles){
|
319 |
+
|
320 |
+
$simpleTitle = "";
|
321 |
+
$titleKey = "";
|
322 |
+
$arrTitleParts = array();
|
323 |
+
|
324 |
+
$arrAttributes = UniteFunctionsUC::getVal($arrVariation, "attributes");
|
325 |
+
|
326 |
+
if(empty($arrAttributes))
|
327 |
+
return($arrVariation);
|
328 |
+
|
329 |
+
foreach($arrAttributes as $slug=>$value){
|
330 |
+
|
331 |
+
$arrTitle = $this->getVariationAttributeTitle($slug, $value, $arrAttributeTitles);
|
332 |
+
|
333 |
+
$attrTitle = UniteFunctionsUC::getVal($arrTitle, "attr");
|
334 |
+
$valueTitle = UniteFunctionsUC::getVal($arrTitle, "title");
|
335 |
+
|
336 |
+
if(!empty($simpleTitle))
|
337 |
+
$simpleTitle .= ", ";
|
338 |
+
|
339 |
+
$arrTitleParts[] = $arrTitle;
|
340 |
+
|
341 |
+
$simpleTitle .= $attrTitle." - ".$valueTitle;
|
342 |
+
|
343 |
+
//make the key
|
344 |
+
$value = strtolower($value);
|
345 |
+
$slug = str_replace("attribute_", "", $slug);
|
346 |
+
|
347 |
+
if(!empty($titleKey))
|
348 |
+
$titleKey .= "_";
|
349 |
+
|
350 |
+
$titleKey .= $slug."_".$value;
|
351 |
+
}
|
352 |
+
|
353 |
+
$arrVariation["title"] = $simpleTitle;
|
354 |
+
$arrVariation["title_key"] = $titleKey;
|
355 |
+
$arrVariation["title_parts"] = $arrTitleParts;
|
356 |
+
|
357 |
+
return($arrVariation);
|
358 |
+
}
|
359 |
+
|
360 |
+
|
361 |
+
/**
|
362 |
+
* modify variation for output
|
363 |
+
*/
|
364 |
+
private function modifyVariationForOutput($arrVariation, $arrAttributeTitles){
|
365 |
+
|
366 |
+
//add links
|
367 |
+
|
368 |
+
$arrVariation = $this->addAddToCartForVariation($arrVariation);
|
369 |
+
|
370 |
+
//add titles
|
371 |
+
|
372 |
+
$arrVariation = $this->addTitlesForVariation($arrVariation, $arrAttributeTitles);
|
373 |
+
|
374 |
+
return($arrVariation);
|
375 |
+
}
|
376 |
+
|
377 |
+
|
378 |
+
/**
|
379 |
+
* get attributes titles - in case that they are taxonomies
|
380 |
+
*/
|
381 |
+
private function getAttributeTitles_simple($arrOutput, $objAttribute){
|
382 |
+
|
383 |
+
$name = $objAttribute->get_name();
|
384 |
+
|
385 |
+
$slug = "attribute_".strtolower($name);
|
386 |
+
|
387 |
+
$arrOutput[$slug] = $name;
|
388 |
+
|
389 |
+
return($arrOutput);
|
390 |
+
}
|
391 |
+
|
392 |
+
|
393 |
+
/**
|
394 |
+
* get attributes titles - in case that they are taxonomies
|
395 |
+
*/
|
396 |
+
private function getAttributeTitles_tax($arrOutput, $objAttribute, $product){
|
397 |
+
|
398 |
+
$attribute_taxonomy = $objAttribute->get_taxonomy_object();
|
399 |
+
$attribute_values = wc_get_product_terms( $product->get_id(), $objAttribute->get_name(), array( 'fields' => 'all' ) );
|
400 |
+
|
401 |
+
$attribute_taxonomy = (array)$attribute_taxonomy;
|
402 |
+
|
403 |
+
if(empty($attribute_values))
|
404 |
+
return($arrOutput);
|
405 |
+
|
406 |
+
$attributeLabel = UniteFunctionsUC::getVal($attribute_taxonomy, "attribute_label");
|
407 |
+
|
408 |
+
foreach($attribute_values as $term){
|
409 |
+
|
410 |
+
$slug = $term->slug;
|
411 |
+
$taxonomy = $term->taxonomy;
|
412 |
+
|
413 |
+
$name = "attribute_".$taxonomy."_".$slug;
|
414 |
+
|
415 |
+
$termTitle = $term->name;
|
416 |
+
|
417 |
+
$title = array("attr"=>$attributeLabel,"title"=>$termTitle);
|
418 |
+
|
419 |
+
$arrOutput[$name] = $title;
|
420 |
+
|
421 |
+
} //foreach terms
|
422 |
+
|
423 |
+
return($arrOutput);
|
424 |
+
}
|
425 |
+
|
426 |
+
|
427 |
+
/**
|
428 |
+
* get product attribute names
|
429 |
+
*
|
430 |
+
*/
|
431 |
+
private function getProductAttributeNames($product){
|
432 |
+
|
433 |
+
$arrAttributes = $product->get_attributes();
|
434 |
+
|
435 |
+
$arrOutput = array();
|
436 |
+
|
437 |
+
foreach($arrAttributes as $objAttribute){
|
438 |
+
|
439 |
+
$isTax = $objAttribute->is_taxonomy();
|
440 |
+
|
441 |
+
if($isTax == true)
|
442 |
+
$arrOutput = $this->getAttributeTitles_tax($arrOutput, $objAttribute, $product);
|
443 |
+
else
|
444 |
+
$arrOutput = $this->getAttributeTitles_simple($arrOutput, $objAttribute, $product);
|
445 |
+
|
446 |
+
} //foreach attributes
|
447 |
+
|
448 |
+
return($arrOutput);
|
449 |
+
}
|
450 |
+
|
451 |
+
|
452 |
+
/**
|
453 |
+
* get variations array
|
454 |
+
*/
|
455 |
+
public function getProductVariations($productID){
|
456 |
+
|
457 |
+
if(function_exists("wc_get_product") == false)
|
458 |
+
return(array());
|
459 |
+
|
460 |
+
$product = wc_get_product($productID);
|
461 |
+
|
462 |
+
if(empty($product))
|
463 |
+
return(array());
|
464 |
+
|
465 |
+
$type = $product->get_type();
|
466 |
+
|
467 |
+
if($type != "variable")
|
468 |
+
return(array());
|
469 |
+
|
470 |
+
$variations = $product->get_available_variations();
|
471 |
+
|
472 |
+
if(empty($variations) || is_array($variations) == false)
|
473 |
+
return(array());
|
474 |
+
|
475 |
+
$arrAttributeTitles = $this->getProductAttributeNames($product);
|
476 |
+
|
477 |
+
//add add to cart links
|
478 |
+
foreach($variations as $key=>$arrVariation){
|
479 |
+
|
480 |
+
$arrVariation = $this->modifyVariationForOutput($arrVariation, $arrAttributeTitles);
|
481 |
+
|
482 |
+
$variations[$key] = $arrVariation;
|
483 |
+
}
|
484 |
+
|
485 |
+
return($variations);
|
486 |
+
}
|
487 |
+
|
488 |
|
489 |
/**
|
490 |
* get product data
|
595 |
$arrKeys[] = "woo_link_addcart_checkout";
|
596 |
$arrKeys[] = "woo_addcart_ajax_attributes";
|
597 |
|
|
|
598 |
return($arrKeys);
|
599 |
}
|
600 |
|
readme.txt
CHANGED
@@ -471,6 +471,34 @@ Note : This plugin works with Elementor. Make sure you have [Elementor](https://
|
|
471 |
|
472 |
== Changelog ==
|
473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
version 1.4.81 = 2021-08-17:
|
475 |
|
476 |
* Feature: added json select (lottie) for image attribute type
|
471 |
|
472 |
== Changelog ==
|
473 |
|
474 |
+
version 1.4.83 = 2021-09-22:
|
475 |
+
|
476 |
+
-Fix: fixed styles mishmash inside elementor editor navigator
|
477 |
+
-Fix: fixed dissapearing carousels after refresh bug
|
478 |
+
-Fix: fixed dynamic grid pagination not changed
|
479 |
+
|
480 |
+
|
481 |
+
version 1.4.82 = 2021-09-20:
|
482 |
+
|
483 |
+
-Feature: added troubleshooting setting - show php error message
|
484 |
+
-Feature: added px, vh, % options for slider attribute
|
485 |
+
-Feature: added dynamic group attributes for galleries, including image and video
|
486 |
+
-Feature: added option to convert one date string to another with ucdate filter
|
487 |
+
-Feature: added option to use items in background widgets
|
488 |
+
-Feature: added ucfunc("set") and ucfunc("get") functions in twig for remember and retrieve variables
|
489 |
+
-Feature: added include by option: "children of current term" to category selection options
|
490 |
+
-Feature: added option to pull woo product variations in twig
|
491 |
+
-Feature: added placeholder: link_withprefix, link_noprefix for link attribute
|
492 |
+
-Fix: fixed error when exists dynamic link in dynamic loop widgets
|
493 |
+
-Fix: enabled pagination in a single type in dynamic template grid
|
494 |
+
-Fix: the "not equal" attributes condition now works
|
495 |
+
-Fix: fixed not editable empty dropdown attribute in widget editor
|
496 |
+
-Fix: fixed mb_string absence php bug
|
497 |
+
-Fix: fixed heading attribute label
|
498 |
+
-Fix: fixed responsive elementor controls in widget items
|
499 |
+
|
500 |
+
|
501 |
+
|
502 |
version 1.4.81 = 2021-08-17:
|
503 |
|
504 |
* Feature: added json select (lottie) for image attribute type
|
release_log.txt
CHANGED
@@ -1,4 +1,32 @@
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
version 1.4.81:
|
4 |
|
1 |
|
2 |
+
version 1.4.83:
|
3 |
+
|
4 |
+
-bug fix: fixed styles mishmash inside elementor editor navigator
|
5 |
+
-bug fix: fixed dissapearing carousels after refresh bug
|
6 |
+
-bug fix: fixed dynamic grid pagination not changed
|
7 |
+
|
8 |
+
|
9 |
+
version 1.4.82:
|
10 |
+
|
11 |
+
-feature: added troubleshooting setting - show php error message
|
12 |
+
-bug fix: fixed mb_string absence php bug
|
13 |
+
-bug fix: fixed heading attribute label
|
14 |
+
-bug fix: fixed responsive elementor controls in widget items
|
15 |
+
-feature: added px, vh, % options for slider attribute
|
16 |
+
-feature: added dynamic group attributes for galleries, including image and video
|
17 |
+
-feature: added option to convert one date string to another with ucdate filter
|
18 |
+
-feature: added option to use items in background widgets
|
19 |
+
-feature: added ucfunc("set") and ucfunc("get") functions in twig for remember and retrieve variables
|
20 |
+
-feature: added include by option: "children of current term" to category selection options
|
21 |
+
-feature: added option to pull woo product variations in twig
|
22 |
+
-bug fix: fixed error when exists dynamic link in dynamic loop widgets
|
23 |
+
-bug fix: enabled pagination in a single type in dynamic template grid
|
24 |
+
-feature: added placeholder: link_withprefix, link_noprefix for link attribute
|
25 |
+
-bug fix: the "not equal" attributes condition now works
|
26 |
+
-bug fix: fixed not editable empty dropdown attribute in widget editor
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
|
31 |
version 1.4.81:
|
32 |
|
settings/library.xml
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<include handle="jquery" local="jquery-1.11.1.min.js"></include>
|
6 |
</js>
|
7 |
</item>
|
8 |
-
<item name="mootools" title="Mootools">
|
9 |
<js>
|
10 |
<include handle="mootools" hidden="true" local="MooTools-Core-1.5.2.js"></include>
|
11 |
</js>
|
@@ -72,5 +72,10 @@
|
|
72 |
<include handle="fancybox" local="fancybox3/jquery.fancybox.min.css"></include>
|
73 |
</css>
|
74 |
</item>
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
</library>
|
5 |
<include handle="jquery" local="jquery-1.11.1.min.js"></include>
|
6 |
</js>
|
7 |
</item>
|
8 |
+
<item name="mootools" title="Mootools" hidden="true">
|
9 |
<js>
|
10 |
<include handle="mootools" hidden="true" local="MooTools-Core-1.5.2.js"></include>
|
11 |
</js>
|
72 |
<include handle="fancybox" local="fancybox3/jquery.fancybox.min.css"></include>
|
73 |
</css>
|
74 |
</item>
|
75 |
+
<item name="remote" title="UE Remote">
|
76 |
+
<js>
|
77 |
+
<include handle="ue_remote_controls" local="ue_remote_controls.js"></include>
|
78 |
+
</js>
|
79 |
+
</item>
|
80 |
|
81 |
</library>
|
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 Website 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.4.
|
12 |
-
Elementor Pro tested up to: 3.
|
13 |
*/
|
14 |
|
15 |
if(!defined("UNLIMITED_ELEMENTS_INC"))
|
4 |
Plugin URI: http://unlimited-elements.com
|
5 |
Description: Unlimited Elements - Huge Widgets Pack for Elementor Website Builder, with html/css/js widget creator and editor
|
6 |
Author: Unlimited Elements
|
7 |
+
Version: 1.4.83
|
8 |
Author URI: http://unlimited-elements.com
|
9 |
Text Domain: unlimited-elements-for-elementor
|
10 |
Domain Path: /languages
|
11 |
+
Elementor tested up to: 3.4.4
|
12 |
+
Elementor Pro tested up to: 3.4.1
|
13 |
*/
|
14 |
|
15 |
if(!defined("UNLIMITED_ELEMENTS_INC"))
|
views/addondefaults.php
CHANGED
@@ -80,6 +80,8 @@ class UniteCreatorAddonDefaultsView{
|
|
80 |
$this->addonID = $addonID;
|
81 |
|
82 |
$addon = new UniteCreatorAddon();
|
|
|
|
|
83 |
$addon->initByID($addonID);
|
84 |
|
85 |
$this->addon = $addon;
|
80 |
$this->addonID = $addonID;
|
81 |
|
82 |
$addon = new UniteCreatorAddon();
|
83 |
+
$addon->setOperationType(UniteCreatorAddon::OPERATION_CONFIG);
|
84 |
+
|
85 |
$addon->initByID($addonID);
|
86 |
|
87 |
$this->addon = $addon;
|
views/objects/addon_view.class.php
CHANGED
@@ -19,6 +19,7 @@ class UniteCreatorAddonView{
|
|
19 |
protected $objAddon;
|
20 |
protected $settingsItemOutput, $settingsJSOutput, $objAddonType, $addonType;
|
21 |
protected $showToolbar = true, $showHeader = true;
|
|
|
22 |
|
23 |
//show defenitions
|
24 |
protected $putAllTabs = true, $arrTabsToPut = array();
|
@@ -225,6 +226,9 @@ class UniteCreatorAddonView{
|
|
225 |
UniteFunctionsUC::throwError("Widget ID not given");
|
226 |
|
227 |
$this->objAddon = new UniteCreatorAddon();
|
|
|
|
|
|
|
228 |
$this->objAddon->initByID($addonID);
|
229 |
|
230 |
$this->addonType = $this->objAddon->getType();
|
19 |
protected $objAddon;
|
20 |
protected $settingsItemOutput, $settingsJSOutput, $objAddonType, $addonType;
|
21 |
protected $showToolbar = true, $showHeader = true;
|
22 |
+
protected $addonLocation;
|
23 |
|
24 |
//show defenitions
|
25 |
protected $putAllTabs = true, $arrTabsToPut = array();
|
226 |
UniteFunctionsUC::throwError("Widget ID not given");
|
227 |
|
228 |
$this->objAddon = new UniteCreatorAddon();
|
229 |
+
|
230 |
+
$this->objAddon->setOperationType(UniteCreatorAddon::OPERATION_EDIT);
|
231 |
+
|
232 |
$this->objAddon->initByID($addonID);
|
233 |
|
234 |
$this->addonType = $this->objAddon->getType();
|
views/objects/addon_view_childparams.class.php
CHANGED
@@ -278,8 +278,13 @@ class UniteCreatorAddonViewChildParams{
|
|
278 |
{# use the ucdate filter to convert timestamps to dates preserving wordpress format#}
|
279 |
{{ your_timestamp|ucdate(\"m/d/Y\") }}
|
280 |
|
|
|
|
|
|
|
|
|
281 |
{# to show data from - to range like 4-5 Mar 2021 use this function#}
|
282 |
{{ucfunc(\"put_date_range\",1617187095,1619187095)}}
|
|
|
283 |
";
|
284 |
|
285 |
$arrParams[] = $this->createChildParam_code($key, $text);
|
@@ -356,6 +361,19 @@ class UniteCreatorAddonViewChildParams{
|
|
356 |
";
|
357 |
|
358 |
$arrParams[] = $this->createChildParam_code($key, $text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
|
360 |
|
361 |
//----- output ------
|
@@ -871,6 +889,36 @@ function {{uc_id}}_start(){
|
|
871 |
|
872 |
return($arrParam);
|
873 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
874 |
|
875 |
|
876 |
/**
|
@@ -889,6 +937,7 @@ function {{uc_id}}_start(){
|
|
889 |
return($arrParams);
|
890 |
|
891 |
$arrParams[] = $this->createWooPostParam_getChildProducts();
|
|
|
892 |
|
893 |
foreach($arrKeys as $key){
|
894 |
|
@@ -1267,6 +1316,8 @@ function {{uc_id}}_start(){
|
|
1267 |
|
1268 |
$arrParams[] = $this->createAddParam();
|
1269 |
$arrParams[] = $this->createAddParam("html_attributes|raw");
|
|
|
|
|
1270 |
|
1271 |
return($arrParams);
|
1272 |
}
|
278 |
{# use the ucdate filter to convert timestamps to dates preserving wordpress format#}
|
279 |
{{ your_timestamp|ucdate(\"m/d/Y\") }}
|
280 |
|
281 |
+
{# also, use the ucdate filter to convert strings from one format to another #}
|
282 |
+
{{ your_date_string|ucdate(\"m/d/Y\",\"d-m-Y\") }}
|
283 |
+
|
284 |
+
|
285 |
{# to show data from - to range like 4-5 Mar 2021 use this function#}
|
286 |
{{ucfunc(\"put_date_range\",1617187095,1619187095)}}
|
287 |
+
|
288 |
";
|
289 |
|
290 |
$arrParams[] = $this->createChildParam_code($key, $text);
|
361 |
";
|
362 |
|
363 |
$arrParams[] = $this->createChildParam_code($key, $text);
|
364 |
+
|
365 |
+
//----- set and get ------
|
366 |
+
|
367 |
+
$key = "set(), get()";
|
368 |
+
$text = "
|
369 |
+
{# remember variable in html editor, and use it in other editors, via get #}
|
370 |
+
|
371 |
+
{{ ucfunc(\"set\",\"my-var\", var) }}
|
372 |
+
|
373 |
+
{% set var2 = ucfunc(\"get\",\"my-var\") %}
|
374 |
+
";
|
375 |
+
|
376 |
+
$arrParams[] = $this->createChildParam_code($key, $text);
|
377 |
|
378 |
|
379 |
//----- output ------
|
889 |
|
890 |
return($arrParam);
|
891 |
}
|
892 |
+
|
893 |
+
/**
|
894 |
+
* create add child products param
|
895 |
+
*/
|
896 |
+
private function createWooPostParam_putVariations(){
|
897 |
+
|
898 |
+
$strCode = "";
|
899 |
+
$strCode .= "{# The variations exists only at variable products #}\n\n";
|
900 |
+
|
901 |
+
$strCode .= "{% set variations = ucfunc(\"get_wc_variations\",[param_prefix].id) %}\n\n";
|
902 |
+
|
903 |
+
$strCode .= "{% for variation in variations %}\n\n";
|
904 |
+
|
905 |
+
$strCode .= " Title: <b>{{ variation.title }}</b> <br>\n\n";
|
906 |
+
$strCode .= " Title key for rename: <b>{{ variation.title_key }}</b><br>\n\n";
|
907 |
+
$strCode .= " Title parts for self combine: {{ printVar(variation.title_parts) }}<br>\n\n";
|
908 |
+
$strCode .= " Price Html: {{variation.price_html|raw}}<br>\n\n";
|
909 |
+
$strCode .= " Sku: <b>{{variation.sku}}</b><br>\n\n";
|
910 |
+
$strCode .= " ID: <b>{{variation.variation_id}}</b><br>\n\n";
|
911 |
+
$strCode .= " Link add to cart: {{variation.link_addcart_cart}}<br>\n\n";
|
912 |
+
|
913 |
+
$strCode .= " {# For other fields please look at output of this function #}<br>\n ";
|
914 |
+
$strCode .= " {{ printVar(variation) }} <br>\n\n ";
|
915 |
+
|
916 |
+
$strCode .= "{% endfor %}\n";
|
917 |
+
|
918 |
+
$arrParam = $this->createChildParam("putWooVariations", null, array("raw_insert_text"=>$strCode));
|
919 |
+
|
920 |
+
return($arrParam);
|
921 |
+
}
|
922 |
|
923 |
|
924 |
/**
|
937 |
return($arrParams);
|
938 |
|
939 |
$arrParams[] = $this->createWooPostParam_getChildProducts();
|
940 |
+
$arrParams[] = $this->createWooPostParam_putVariations();
|
941 |
|
942 |
foreach($arrKeys as $key){
|
943 |
|
1316 |
|
1317 |
$arrParams[] = $this->createAddParam();
|
1318 |
$arrParams[] = $this->createAddParam("html_attributes|raw");
|
1319 |
+
$arrParams[] = $this->createAddParam("withprefix");
|
1320 |
+
$arrParams[] = $this->createAddParam("noprefix");
|
1321 |
|
1322 |
return($arrParams);
|
1323 |
}
|