Plugin Directory

Changeset 3444776


Ignore:
Timestamp:
01/22/2026 11:35:20 AM (7 weeks ago)
Author:
unitecms
Message:

updated to 2.0.5 version.

Location:
unlimited-elements-for-elementor/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • unlimited-elements-for-elementor/trunk/assets_libraries/filters/ue_filters.js

    r3442278 r3444776  
    18601860     */
    18611861    function getFilterElementData(objElement){
    1862        
     1862               
    18631863        var id = objElement.data("id");
    18641864        var title = objElement.data("title");
    18651865        var key = objElement.data("key");
    18661866        var type = objElement.data("type");
     1867       
     1868        if(!id && !key)
     1869            return(null);
     1870       
    18671871       
    18681872        switch(type){
     
    36363640        if(numItems)
    36373641            urlAjax += "&uccount="+numItems;
    3638    
     3642               
    36393643        if(arrTerms.length){
    36403644           
     
    39984002
    39994003        var objUrlKeys = getVal(g_filtersData, "urlkeys");
     4004       
    40004005        var taxSap = getVal(objUrlKeys, "tax_sap");
    40014006        if(taxSap)
  • unlimited-elements-for-elementor/trunk/changelog.txt

    r3442278 r3444776  
    22
    33== Changelog ==
     4
     5= 2.0.5 - 2026-01-22 =
     6
     7* Fix: made some fix for wpml in main category
     8* Fix: fixed special characters in google sheets
     9* Fix: fixed filters "All" empty posts issue
     10
    411
    512= 2.0.4 - 2026-01-19 =
  • unlimited-elements-for-elementor/trunk/inc_php/framework/google/sheets/sheet_values.class.php

    r3317018 r3444776  
    6565            }
    6666
    67             $safeText = htmlspecialchars($rawText);
     67            // Allow HTML from Sheets while stripping potentially unsafe JS.
     68            $safeText = UniteFunctionsUC::sanitizeHTMLRemoveJS($rawText);
    6869            if(!empty($styles)) {
    6970                $styleAttr = htmlspecialchars(implode(";", $styles));
  • unlimited-elements-for-elementor/trunk/inc_php/framework/settings_output.class.php

    r3429507 r3444776  
    138138        }
    139139
    140         uelm_echo(' data-default="' . esc_attr($defaultValue) . '" data-initval="' . esc_attr($value) . '" ');
     140        uelm_echo(' data-test="' . esc_attr($defaultValue) . '" data-default="' . esc_attr($defaultValue) . '" data-initval="' . esc_attr($value) . '" ');
    141141
    142142        $this->getGroupSelectorAddAttr($setting);
  • unlimited-elements-for-elementor/trunk/inc_php/framework/zip.class.php

    r3442278 r3444776  
    9898    private function addItem($basePath, $path){
    9999
    100         //normalize paths - remove trailing slashes for consistent comparison
    101         $basePath = rtrim($basePath, "/\\");
    102         $path = rtrim($path, "/\\");
    103        
    104         //calculate relative path
    105100        $rel_path = str_replace($basePath . "/", "", $path);
    106         $rel_path = str_replace($basePath . "\\", "", $rel_path);
    107        
    108         //if still starts with basePath (Windows paths or other edge cases), use basename
    109         if($rel_path == $path || strpos($rel_path, $basePath) === 0){
    110             $rel_path = str_replace($basePath, "", $rel_path);
    111             $rel_path = ltrim($rel_path, "/\\");
    112         }
    113        
    114         //ensure relative path doesn't start with dot or slash (prevent "./file" or "/file")
    115         $rel_path = ltrim($rel_path, "./\\");
    116101
    117102        if(is_dir($path)){    //directory
     
    125110            $files = scandir($path);
    126111            foreach($files as $file){
    127                 //skip hidden files and directories (starting with dot)
    128                 if($file == "." || $file == ".." || $file == ".svn" || (strlen($file) > 0 && $file[0] == "."))
     112                if($file == "." || $file == ".." || $file == ".svn")
    129113                    continue;
    130114                $filepath = $path . "/" . $file;
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_addons.class.php

    r3442278 r3444776  
    596596
    597597            $tmpAddon = $this->initAddonByData($addonData);
    598 
     598           
     599            if(method_exists($tmpAddon, "getParamsDefaults")){
     600                $defaults = $tmpAddon->getParamsDefaults();
     601            } elseif(method_exists($tmpAddon, "getParamsManager")
     602                     && method_exists($tmpAddon->getParamsManager(), "getDefaultsAssoc")) {
     603                $defaults = $tmpAddon->getParamsManager()->getDefaultsAssoc();
     604            }
     605           
     606            // using test_slot2 for items only: 
    599607            $td = $tmpAddon->getTestData(2);         
    600             $defaults = UniteFunctionsUC::getVal($td, "config", array());
    601608            $defaultItems = UniteFunctionsUC::getVal($td, "items");
    602 
    603             if(empty($defaults)){
    604                 if(method_exists($tmpAddon, "getParamsDefaults")){
    605                     $defaults = $tmpAddon->getParamsDefaults();
    606                 } elseif(method_exists($tmpAddon, "getParamsManager")
    607                     && method_exists($tmpAddon->getParamsManager(), "getDefaultsAssoc")) {
    608                     $defaults = $tmpAddon->getParamsManager()->getDefaultsAssoc();
     609            $defaults_tst = UniteFunctionsUC::getVal($td, "config", array());
     610            foreach($defaults_tst as $k => $v) {
     611                if(substr($k, 0, 5) == 'post_') {
     612                    $defaults[$k] = $v;
    609613                }
    610614            }
     
    836840            // 1) try defaults slot #2 (saved via saveAddonDefaultsFromData)
    837841            $td           = $objAddon->getTestData(2); // ['config'=>..., 'items'=>...]
    838             $defaults     = UniteFunctionsUC::getVal($td, "config", array());
     842            // using test_slot2 for items only: $defaults     = UniteFunctionsUC::getVal($td, "config", array());
    839843            $defaultItems = UniteFunctionsUC::getVal($td, "items");
    840844
    841             // 2) if slot empty — take schema defaults
     845            // 2) if slot empty take schema defaults
    842846            if (empty($defaults)) {
    843847                if (method_exists($objAddon, "getParamsDefaults")) {
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_filters_process.class.php

    r3442278 r3444776  
    595595       
    596596        $strTerms = UniteFunctionsUC::getVal($request, "ucterms");
     597       
     598        if($strTerms === "undefined:undefined")
     599            $strTerms = null;
    597600       
    598601        $arrOutput = array();
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_output.class.php

    r3429507 r3444776  
    6060       
    6161    private $htmlDebug = "";
     62
     63    private $processedItemsData = false;
    6264
    6365
     
    570572    private function ______CSS_SELECTORS_______(){}
    571573
    572     /**
    573      * process css selector of number param
    574      */
     574    /*
    575575    private function processParamCSSSelector_number($param, $selectors){
    576576
     
    595595        return $style;
    596596    }
    597 
    598     /**
    599      * process css selector of background param
    600      */
     597    */
     598
     599    /**
     600     * process css selector of number param
     601     */
     602    private function processParamCSSSelector_number($param, $selectors){
     603        $value = UniteFunctionsUC::getVal($param, "value");
     604       
     605        $isOldFormat = is_array($value) && !empty($value);
     606       
     607        if($isOldFormat){
     608            $values = array(
     609                "desktop" => $value,
     610                "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"),
     611                "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"),
     612            );
     613        } else {
     614            $values = array(
     615                "desktop" => UniteFunctionsUC::getVal($param, "value"),
     616                "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"),
     617                "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"),
     618            );
     619        }
     620
     621        $style = "";
     622
     623        foreach($values as $device => $value){
     624            if(empty($value) === true)
     625                continue;
     626
     627            foreach($selectors as $selector => $selectorValue){
     628                $css = $this->prepareCSSSelectorValueCSS($selectorValue, $value);
     629                $style .= $this->prepareCSSSelectorStyle($selector, $css, $device);
     630            }
     631        }
     632
     633        return $style;
     634    }
     635
     636    /*
    601637    private function processParamCSSSelector_background($param, $selectors){
    602638
     
    659695        return $style;
    660696    }
    661 
    662     /**
    663      * process css selector of border param
    664      */
     697    */
     698
     699    /*
     700     * process css selector of background param
     701    */
     702    private function processParamCSSSelector_background($param, $selectors){
     703        $name = UniteFunctionsUC::getVal($param, "name");
     704        $value = UniteFunctionsUC::getVal($param, "value");
     705
     706        $isOldFormat = is_array($value) && !empty($value);
     707       
     708        if($isOldFormat){
     709            $type = UniteFunctionsUC::getVal($value, $name . "_type");
     710        } else {
     711            $type = UniteFunctionsUC::getVal($param, "background_type");
     712            $value = $param;
     713        }
     714
     715        $selector = $this->combineCSSSelectors($selectors);
     716
     717        $style = '';
     718
     719        switch($type){
     720            case "solid":
     721                $regularFields = array(
     722                    $name . "_solid_color" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "color"),
     723                    $name . "_solid_image_attachment" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "attachment"),
     724                );
     725
     726                $responsiveFields = array(
     727                    $name . "_solid_image" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "image"),
     728                    $name . "_solid_image_position" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "position"),
     729                    $name . "_solid_image_repeat" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "repeat"),
     730                    $name . "_solid_image_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "size"),
     731                );
     732
     733                // Нужно преобразовать ключи для нового формата
     734                if(!$isOldFormat){
     735                    // Для нового формата ключи без префикса name
     736                    $regularFields = array(
     737                        "solid_color" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "color"),
     738                        "solid_image_attachment" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "attachment"),
     739                    );
     740
     741                    $responsiveFields = array(
     742                        "solid_bg_image" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "image"),
     743                        "solid_bg_image_position" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "position"),
     744                        "solid_bg_image_repeat" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "repeat"),
     745                        "solid_bg_image_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "size"),
     746                    );
     747                }
     748
     749                $style .= $this->prepareCSSSelectorFieldsStyle($regularFields, $selector, $value);
     750                $style .= $this->prepareCSSSelectorResponsiveFieldsStyle($responsiveFields, $selector, $value);
     751            break;
     752            case "gradient":
     753                // Определяем префиксы ключей в зависимости от формата
     754                $prefix = $isOldFormat ? $name . "_" : "";
     755               
     756                $color1 = UniteFunctionsUC::getVal($value, $prefix . "gradient_color1");
     757                $stop1 = UniteFunctionsUC::getVal($value, $prefix . "gradient1_stop");
     758                $color2 = UniteFunctionsUC::getVal($value, $prefix . "gradient_color2");
     759                $stop2 = UniteFunctionsUC::getVal($value, $prefix . "gradient2_stop");
     760                $gradientType = UniteFunctionsUC::getVal($value, $prefix . "gradient_type");
     761                $angle = UniteFunctionsUC::getVal($value, $prefix . "gradient_angle");
     762                $position = UniteFunctionsUC::getVal($value, $prefix . "gradient_position");
     763
     764                $stop1 = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $stop1);
     765                $stop2 = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $stop2);
     766                $angle = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $angle);
     767
     768                if($color1 !== "" && $stop1 !== "" && $color2 !== "" && $stop2 !== "" && $gradientType !== "" && $angle !== "" && $position !== ""){
     769                    $selectorValue = ($gradientType === "radial")
     770                        ? HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "radial-gradient")
     771                        : HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BACKGROUND, "linear-gradient");
     772
     773                    $css = $this->processCSSSelectorReplaces($selectorValue, array(
     774                        "{{angle}}" => $angle,
     775                        "{{position}}" => $position,
     776                        "{{color1}}" => $color1,
     777                        "{{stop1}}" => $stop1,
     778                        "{{color2}}" => $color2,
     779                        "{{stop2}}" => $stop2,
     780                    ));
     781
     782                    $style .= $this->prepareCSSSelectorStyle($selector, $css);
     783                }
     784            break;
     785        }
     786
     787        return $style;
     788    }
     789
     790    /*
    665791    private function processParamCSSSelector_border($param, $selectors){
    666792
     
    668794        $type = UniteFunctionsUC::getVal($value, "type", "none");
    669795        $color = UniteFunctionsUC::getVal($value, "color", "#000000");
     796
     797        // echo json_encode($param) . ' ==[2]';
    670798
    671799        if($type === "none")
     
    701829        return $style;
    702830    }
    703 
    704     /**
    705      * process css selector of dimentions param
    706      */
     831    */
     832
     833    private function processParamCSSSelector_border($param, $selectors){
     834        $value = UniteFunctionsUC::getVal($param, "value");
     835       
     836        $isOldFormat = is_array($value) && !empty($value);
     837       
     838        if($isOldFormat){
     839            // from block settings
     840            $type = UniteFunctionsUC::getVal($value, "type", "none");
     841            $color = UniteFunctionsUC::getVal($value, "color", "#000000");
     842        } else {
     843            // from block defaults
     844            $type = UniteFunctionsUC::getVal($param, "border_type", "none");
     845            $color = UniteFunctionsUC::getVal($param, "border_color", "#000000");
     846            $value = $param; // для единообразия
     847        }
     848
     849        if($type === "none")
     850            return null;
     851
     852        $style = "";
     853        $selector = $this->combineCSSSelectors($selectors);
     854
     855        // border-style
     856        $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BORDER, "style");
     857        $css = $this->prepareCSSSelectorValueCSS($selectorValue, $type);
     858        $style .= $this->prepareCSSSelectorStyle($selector, $css);
     859
     860        // border-color
     861        $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BORDER, "color");
     862        $css = $this->prepareCSSSelectorValueCSS($selectorValue, $color);
     863        $style .= $this->prepareCSSSelectorStyle($selector, $css);
     864
     865        // border-width (responsive)
     866        $widths = array();
     867       
     868        if($isOldFormat){
     869            $widths = array(
     870                "desktop" => UniteFunctionsUC::getVal($value, "width"),
     871                "tablet" => UniteFunctionsUC::getVal($value, "width_tablet"),
     872                "mobile" => UniteFunctionsUC::getVal($value, "width_mobile"),
     873            );
     874        } else {
     875            // Новый формат: width_desktop_top, width_tablet_top, width_mobile_top
     876            $widths = array(
     877                "desktop" => array(
     878                    "top" => UniteFunctionsUC::getVal($value, "width_desktop_top"),
     879                    "right" => UniteFunctionsUC::getVal($value, "width_desktop_right"),
     880                    "bottom" => UniteFunctionsUC::getVal($value, "width_desktop_bottom"),
     881                    "left" => UniteFunctionsUC::getVal($value, "width_desktop_left"),
     882                    "unit" => "px"
     883                ),
     884                "tablet" => array(
     885                    "top" => UniteFunctionsUC::getVal($value, "width_tablet_top"),
     886                    "right" => UniteFunctionsUC::getVal($value, "width_tablet_right"),
     887                    "bottom" => UniteFunctionsUC::getVal($value, "width_tablet_bottom"),
     888                    "left" => UniteFunctionsUC::getVal($value, "width_tablet_left"),
     889                    "unit" => "px"
     890                ),
     891                "mobile" => array(
     892                    "top" => UniteFunctionsUC::getVal($value, "width_mobile_top"),
     893                    "right" => UniteFunctionsUC::getVal($value, "width_mobile_right"),
     894                    "bottom" => UniteFunctionsUC::getVal($value, "width_mobile_bottom"),
     895                    "left" => UniteFunctionsUC::getVal($value, "width_mobile_left"),
     896                    "unit" => "px"
     897                ),
     898            );
     899        }
     900
     901        $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BORDER, "width");
     902
     903        foreach($widths as $device => $widthValue){
     904            if(empty($widthValue) === true)
     905                continue;
     906
     907            $css = $this->prepareCSSSelectorDimentionsCSS($selectorValue, $widthValue);
     908            $style .= $this->prepareCSSSelectorStyle($selector, $css, $device);
     909        }
     910
     911        return $style;
     912    }
     913
     914    /*
    707915    private function processParamCSSSelector_dimentions($param, $selectors, $type){
    708916
     
    727935        return $style;
    728936    }
    729 
    730     /**
    731      * process css selector of slider param
    732      */
    733     private function processParamCSSSelector_slider($param, $selectors){
    734 
    735         $values = array(
    736             "desktop" => UniteFunctionsUC::getVal($param, "value"),
    737             "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"),
    738             "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"),
    739         );
    740 
    741         $style = "";
    742 
    743         foreach($values as $device => $value){
    744             if(empty($value) === true)
    745                 continue;
    746 
    747             foreach($selectors as $selector => $selectorValue){
    748                 $css = $this->prepareCSSSelectorSliderCSS($selectorValue, $value);
    749                 $style .= $this->prepareCSSSelectorStyle($selector, $css, $device);
    750             }
    751         }
    752 
    753         return $style;
    754     }
    755 
    756     /**
    757      * process css selector of typography param
    758      */
     937    */
     938
     939    /**
     940     * process css selector of dimentions param
     941     */
     942    private function processParamCSSSelector_dimentions($param, $selectors, $type){
     943        $value = UniteFunctionsUC::getVal($param, "value");
     944       
     945        $isOldFormat = is_array($value) && !empty($value);
     946       
     947        if($isOldFormat){
     948            $values = array(
     949                "desktop" => $value,
     950                "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"),
     951                "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"),
     952            );
     953        } else {
     954            $values = array(
     955                "desktop" => UniteFunctionsUC::getVal($param, "value"),
     956                "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"),
     957                "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"),
     958            );
     959        }
     960
     961        $style = "";
     962        $selector = $this->combineCSSSelectors($selectors);
     963        $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam($type);
     964
     965        foreach($values as $device => $value){
     966            if(empty($value) === true)
     967                continue;
     968
     969            $css = $this->prepareCSSSelectorDimentionsCSS($selectorValue, $value);
     970            $style .= $this->prepareCSSSelectorStyle($selector, $css, $device);
     971        }
     972
     973        return $style;
     974    }
     975
     976    /**
     977     * process css selector of slider param
     978     */
     979    private function processParamCSSSelector_slider($param, $selectors){
     980        $name = UniteFunctionsUC::getVal($param, "name");
     981        $value = UniteFunctionsUC::getVal($param, "value");
     982       
     983        $isOldFormat = is_array($value) && isset($value["size"]);
     984       
     985        if($isOldFormat){
     986            $tabletValue = UniteFunctionsUC::getVal($param, "value_tablet");
     987            $mobileValue = UniteFunctionsUC::getVal($param, "value_mobile");
     988           
     989            $values = array(
     990                "desktop" => $value,
     991                "tablet" => is_array($tabletValue) && isset($tabletValue["size"]) ? $tabletValue : null,
     992                "mobile" => is_array($mobileValue) && isset($mobileValue["size"]) ? $mobileValue : null,
     993            );
     994        } else {
     995            $defaultValue = UniteFunctionsUC::getVal($param, "default_value");
     996            $defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
     997            $defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
     998           
     999            $desktopValue = UniteFunctionsUC::getVal($param, "value");
     1000            if(empty($desktopValue) && $desktopValue !== "0") $desktopValue = $defaultValue;
     1001           
     1002            $tabletValue = UniteFunctionsUC::getVal($param, "value_tablet");
     1003            if(empty($tabletValue) && $tabletValue !== "0") $tabletValue = $defaultValueTablet;
     1004           
     1005            $mobileValue = UniteFunctionsUC::getVal($param, "value_mobile");
     1006            if(empty($mobileValue) && $mobileValue !== "0") $mobileValue = $defaultValueMobile;
     1007           
     1008            $desktopUnit = UniteFunctionsUC::getVal($param, "unit");
     1009            $tabletUnit = UniteFunctionsUC::getVal($param, "unit_tablet");
     1010            $mobileUnit = UniteFunctionsUC::getVal($param, "unit_mobile");
     1011           
     1012            $defaultUnit = UniteFunctionsUC::getVal($param, "units");
     1013            if(empty($defaultUnit)) $defaultUnit = "px";
     1014
     1015            if(strpos($defaultUnit, "_") !== false){
     1016                $unitsArray = explode("_", $defaultUnit);
     1017                $defaultUnit = $unitsArray[0];
     1018            }
     1019           
     1020            if(empty($desktopUnit)) $desktopUnit = $defaultUnit;
     1021            if(empty($tabletUnit)) $tabletUnit = $desktopUnit;
     1022            if(empty($mobileUnit)) $mobileUnit = $desktopUnit;
     1023           
     1024            $values = array(
     1025                "desktop" => (!empty($desktopValue) || $desktopValue === "0") ? array("size" => (int)$desktopValue, "unit" => $desktopUnit) : null,
     1026                "tablet" => (!empty($tabletValue) || $tabletValue === "0") ? array("size" => (int)$tabletValue, "unit" => $tabletUnit) : null,
     1027                "mobile" => (!empty($mobileValue) || $mobileValue === "0") ? array("size" => (int)$mobileValue, "unit" => $mobileUnit) : null,
     1028            );
     1029        }
     1030
     1031        $style = "";
     1032
     1033        // $style .= "/* =[12] " . json_encode($param) . " */ ";
     1034
     1035        foreach($values as $device => $value){
     1036            if($value === null || (is_array($value) && empty($value)))
     1037                continue;
     1038               
     1039            if(is_array($value) && (!isset($value["size"]) || $value["size"] === ""))
     1040                continue;
     1041
     1042            foreach($selectors as $selector => $selectorValue){
     1043                $css = $this->prepareCSSSelectorSliderCSS($selectorValue, $value);
     1044                $style .= $this->prepareCSSSelectorStyle($selector, $css, $device);
     1045            }
     1046        }
     1047
     1048        return $style;
     1049    }
     1050
     1051    /**
     1052     * process css selector of typography param
     1053     */
     1054    private function processParamCSSSelector_typography($param, $selectors){
     1055        $value = UniteFunctionsUC::getVal($param, "value");
     1056       
     1057        // Проверяем, является ли $value массивом с данными (старый формат)
     1058        $isOldFormat = is_array($value) && !empty($value);
     1059       
     1060        if(!$isOldFormat){
     1061            // Новый формат: значения прямо в $param
     1062            $value = $param;
     1063        }
     1064
     1065        $style = "";
     1066        $selector = $this->combineCSSSelectors($selectors);
     1067
     1068        // import font family
     1069        $fontFamily = UniteFunctionsUC::getVal($value, "font_family");
     1070
     1071        if(empty($fontFamily) === false){
     1072            $fontData = HelperUC::getFontPanelData();
     1073            $googleFonts = UniteFunctionsUC::getVal($fontData, "arrGoogleFonts");
     1074
     1075            if(empty($googleFonts[$fontFamily]) === false){
     1076                $fontUrl = HelperHtmlUC::getGoogleFontUrl($googleFonts[$fontFamily]);
     1077
     1078                $this->addon->addCssInclude($fontUrl);
     1079            }
     1080        }
     1081
     1082        $regularFields = array(
     1083            "font_family" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "family"),
     1084            "font_style" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "style"),
     1085            "font_weight" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "weight"),
     1086            "text_decoration" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "decoration"),
     1087            "text_transform" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "transform"),
     1088        );
     1089
     1090        $responsiveFields = array(
     1091            "font_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "size"),
     1092            "line_height" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "line-height"),
     1093            "letter_spacing" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "letter-spacing"),
     1094            "word_spacing" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "word-spacing"),
     1095        );
     1096
     1097        $style .= $this->prepareCSSSelectorFieldsStyle($regularFields, $selector, $value);
     1098        $style .= $this->prepareCSSSelectorResponsiveFieldsStyle($responsiveFields, $selector, $value);
     1099
     1100        return $style;
     1101    }
     1102
     1103    /*
    7591104    private function processParamCSSSelector_typography($param, $selectors){
    7601105
     
    7981143        return $style;
    7991144    }
    800 
    801     /**
    802      * process css selector of text shadow param
    803      */
     1145    */
     1146
     1147    /**
     1148     * process css selector of text shadow param
     1149     */
     1150    private function processParamCSSSelector_textShadow($param, $selectors){
     1151        $value = UniteFunctionsUC::getVal($param, "value");
     1152       
     1153        // Проверяем, является ли $value массивом с данными (старый формат)
     1154        $isOldFormat = is_array($value) && !empty($value);
     1155       
     1156        if(!$isOldFormat){
     1157            // Новый формат: значения прямо в $param
     1158            $value = $param;
     1159        }
     1160
     1161        $x = UniteFunctionsUC::getVal($value, "x");
     1162        $y = UniteFunctionsUC::getVal($value, "y");
     1163        $blur = UniteFunctionsUC::getVal($value, "blur");
     1164        $color = UniteFunctionsUC::getVal($value, "color");
     1165
     1166        $x = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $x);
     1167        $y = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $y);
     1168        $blur = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $blur);
     1169
     1170        $css = "";
     1171
     1172        if($x !== "" && $y !== "" && $blur !== "" && $color !== ""){
     1173            $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TEXTSHADOW);
     1174
     1175            $css = $this->processCSSSelectorReplaces($selectorValue, array(
     1176                "{{x}}" => $x,
     1177                "{{y}}" => $y,
     1178                "{{blur}}" => $blur,
     1179                "{{color}}" => $color,
     1180            ));
     1181        }
     1182
     1183        $selector = $this->combineCSSSelectors($selectors);
     1184        $style = $this->prepareCSSSelectorStyle($selector, $css);
     1185
     1186        return $style;
     1187    }
     1188
     1189    /*
    8041190    private function processParamCSSSelector_textShadow($param, $selectors){
    8051191
     
    8321218        return $style;
    8331219    }
    834 
    835 
    836 
     1220    */
     1221
     1222    private function processParamCSSSelector_textStroke($param, $selectors){
     1223        $value = UniteFunctionsUC::getVal($param, "value");
     1224       
     1225        // Проверяем, является ли $value массивом с данными (старый формат)
     1226        $isOldFormat = is_array($value) && !empty($value);
     1227       
     1228        if(!$isOldFormat){
     1229            // Новый формат: значения прямо в $param
     1230            $value = $param;
     1231        }
     1232
     1233        $width = UniteFunctionsUC::getVal($value, "width");
     1234        $color = UniteFunctionsUC::getVal($value, "color");
     1235
     1236        // Prepare CSS for stroke width
     1237        $width = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $width);
     1238
     1239        $css = "";
     1240
     1241        // If both width and color are available, apply the text stroke
     1242        if($width !== "" && $color !== ""){
     1243            $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TEXTSTROKE);
     1244
     1245            $css = $this->processCSSSelectorReplaces($selectorValue, array(
     1246                "{{width}}" => $width,
     1247                "{{color}}" => $color,
     1248            ));
     1249        }
     1250
     1251        // Combine the selectors and prepare the style
     1252        $selector = $this->combineCSSSelectors($selectors);
     1253        $style = $this->prepareCSSSelectorStyle($selector, $css);
     1254
     1255        return $style;
     1256    }
     1257
     1258    /*
    8371259    private function processParamCSSSelector_textStroke($param, $selectors){
    8381260
     
    8611283
    8621284        return $style;
    863     }
    864 
    865 
    866 
    867 
    868     /**
    869      * process css selector of box shadow param
    870      */
     1285    }   
     1286    */
     1287
     1288    /**
     1289     * process css selector of box shadow param
     1290     */
     1291    private function processParamCSSSelector_boxShadow($param, $selectors){
     1292        $value = UniteFunctionsUC::getVal($param, "value");
     1293       
     1294        // Проверяем, является ли $value массивом с данными (старый формат)
     1295        $isOldFormat = is_array($value) && !empty($value);
     1296       
     1297        if(!$isOldFormat){
     1298            // Новый формат: значения прямо в $param
     1299            $value = $param;
     1300        }
     1301
     1302        $x = UniteFunctionsUC::getVal($value, "x");
     1303        $y = UniteFunctionsUC::getVal($value, "y");
     1304        $blur = UniteFunctionsUC::getVal($value, "blur");
     1305        $spread = UniteFunctionsUC::getVal($value, "spread");
     1306        $color = UniteFunctionsUC::getVal($value, "color");
     1307        $position = UniteFunctionsUC::getVal($value, "position");
     1308
     1309        $x = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $x);
     1310        $y = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $y);
     1311        $blur = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $blur);
     1312        $spread = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $spread);
     1313
     1314        $css = "";
     1315
     1316        if($x !== "" && $y !== "" && $blur !== "" && $spread !== "" && $color !== "" && $position !== ""){
     1317            $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_BOXSHADOW);
     1318
     1319            $css = $this->processCSSSelectorReplaces($selectorValue, array(
     1320                "{{x}}" => $x,
     1321                "{{y}}" => $y,
     1322                "{{blur}}" => $blur,
     1323                "{{spread}}" => $spread,
     1324                "{{color}}" => $color,
     1325                "{{position}}" => $position,
     1326            ));
     1327        }
     1328
     1329        $selector = $this->combineCSSSelectors($selectors);
     1330        $style = $this->prepareCSSSelectorStyle($selector, $css);
     1331
     1332        return $style;
     1333    }
     1334
     1335    /*
    8711336    private function processParamCSSSelector_boxShadow($param, $selectors){
    8721337
     
    9041369        return $style;
    9051370    }
    906 
    907     /**
    908      * process css selector of css filters param
    909      */
     1371    */
     1372
     1373    /**
     1374     * process css selector of css filters param
     1375     */
     1376    private function processParamCSSSelector_cssFilters($param, $selectors){
     1377        $value = UniteFunctionsUC::getVal($param, "value");
     1378       
     1379        // Проверяем, является ли $value массивом с данными (старый формат)
     1380        $isOldFormat = is_array($value) && !empty($value);
     1381       
     1382        if(!$isOldFormat){
     1383            // Новый формат: значения прямо в $param
     1384            $value = $param;
     1385        }
     1386
     1387        $blur = UniteFunctionsUC::getVal($value, "blur");
     1388        $brightness = UniteFunctionsUC::getVal($value, "brightness");
     1389        $contrast = UniteFunctionsUC::getVal($value, "contrast");
     1390        $saturation = UniteFunctionsUC::getVal($value, "saturation");
     1391        $hue = UniteFunctionsUC::getVal($value, "hue");
     1392
     1393        $blur = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $blur);
     1394        $brightness = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $brightness);
     1395        $contrast = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $contrast);
     1396        $saturation = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $saturation);
     1397        $hue = $this->prepareCSSSelectorSliderCSS(self::SELECTOR_VALUE_PLACEHOLDER, $hue);
     1398
     1399        $css = "";
     1400
     1401        if($blur !== "" && $brightness !== "" && $contrast !== "" && $saturation !== "" && $hue !== ""){
     1402            $selectorValue = HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_CSS_FILTERS);
     1403
     1404            $css = $this->processCSSSelectorReplaces($selectorValue, array(
     1405                "{{blur}}" => $blur,
     1406                "{{brightness}}" => $brightness,
     1407                "{{contrast}}" => $contrast,
     1408                "{{saturate}}" => $saturation,
     1409                "{{hue}}" => $hue,
     1410            ));
     1411        }
     1412
     1413        $selector = $this->combineCSSSelectors($selectors);
     1414        $style = $this->prepareCSSSelectorStyle($selector, $css);
     1415
     1416        return $style;
     1417    }
     1418
     1419    /*
    9101420    private function processParamCSSSelector_cssFilters($param, $selectors){
    9111421
     
    9421452        return $style;
    9431453    }
    944 
    945     /**
    946      * process css selector based on value
    947      */
     1454    */
     1455
     1456    /**
     1457     * process css selector based on value
     1458     */
     1459    private function processParamCSSSelector_value($param, $selectors){
     1460        $value = UniteFunctionsUC::getVal($param, "value");
     1461        $name = UniteFunctionsUC::getVal($param, "name");
     1462       
     1463        $isOldFormat = is_array($value) && !empty($value);
     1464       
     1465        if($isOldFormat){
     1466            $values = array(
     1467                "desktop" => $value,
     1468                "tablet" => UniteFunctionsUC::getVal($param, "value_tablet"),
     1469                "mobile" => UniteFunctionsUC::getVal($param, "value_mobile"),
     1470            );
     1471        } else {
     1472            // Получаем значения или используем default_value
     1473            $defaultValue = UniteFunctionsUC::getVal($param, "default_value");
     1474            $defaultValueTablet = UniteFunctionsUC::getVal($param, "default_value_tablet");
     1475            $defaultValueMobile = UniteFunctionsUC::getVal($param, "default_value_mobile");
     1476           
     1477            $desktopValue = UniteFunctionsUC::getVal($param, "value");
     1478            if(empty($desktopValue) && $desktopValue !== "0") $desktopValue = $defaultValue;
     1479           
     1480            $tabletValue = UniteFunctionsUC::getVal($param, "value_tablet");
     1481            if(empty($tabletValue) && $tabletValue !== "0") $tabletValue = $defaultValueTablet;
     1482           
     1483            $mobileValue = UniteFunctionsUC::getVal($param, "value_mobile");
     1484            if(empty($mobileValue) && $mobileValue !== "0") $mobileValue = $defaultValueMobile;
     1485           
     1486            $values = array(
     1487                "desktop" => $desktopValue,
     1488                "tablet" => $tabletValue,
     1489                "mobile" => $mobileValue,
     1490            );
     1491        }
     1492
     1493        $options = UniteFunctionsUC::getVal($param, "options");
     1494
     1495        if(empty($options) === false){
     1496            $phpFilter = UniteFunctionsUC::getVal($param, "php_filter_name");
     1497
     1498            if(empty($phpFilter) === false)
     1499                $options = array_flip($options);
     1500
     1501            foreach($values as $device => $value){
     1502                if(in_array($value, $options) === false)
     1503                    unset($values[$device]);
     1504            }
     1505        }
     1506
     1507        $style = "";
     1508
     1509        // $style .= "/* " . json_encode($param) . " */ /* " . $name . ": start */ ";
     1510
     1511        foreach($values as $device => $value){
     1512            // Улучшенная проверка пустых значений
     1513            if($value === null || $value === "")
     1514                continue;
     1515
     1516            foreach($selectors as $selector => $selectorValue){
     1517                $css = $this->prepareCSSSelectorValueCSS($selectorValue, $value);
     1518                $style .= $this->prepareCSSSelectorStyle($selector, $css, $device);
     1519            }
     1520        }
     1521
     1522        // $style .= "/* " . $name . ": end */ ";
     1523
     1524        return $style;
     1525    }
     1526
     1527    /*
    9481528    private function processParamCSSSelector_value($param, $selectors){
    9491529
     
    9851565        return $style;
    9861566    }
     1567    */
     1568
     1569
    9871570
    9881571    /**
     
    11901773
    11911774        foreach($selectors as $index => $selector){
    1192             $selectors[$index] = "." . $wrapperId . " " . trim($selector);
     1775            $selectors[$index] = ".ue-widget-root." . $wrapperId . " " . trim($selector);
    11931776        }
    11941777
     
    12591842        foreach($params as $param){
    12601843            $passed = UEParamsManager::isParamPassesConditions($params, $param);
    1261             if($passed === false)
     1844            if($passed === false) {
    12621845                continue;
     1846            }
     1847               
    12631848
    12641849            // param's cat disabled
     
    12721857
    12731858            $style = $this->processParamCSSSelector($param);
     1859
    12741860            if(empty($style) === false)
    12751861                $styles .= $style;
    12761862        }
    12771863
    1278         // -------------------- ADVANCED --------------------
     1864        return $styles;
     1865    }
     1866
     1867    /**
     1868     * process advanced tab css selectors
     1869    */
     1870    public function getAdvancedTabCssSelectors() {
     1871
     1872        $styles = '';
     1873
    12791874        $wrapperId = $this->getWidgetWrapperID();
    12801875        $paramsTmp = $this->getAddonParams();
     1876
     1877        // Get default values for advanced parameters
     1878        $allParams = $this->addon->getParams();
     1879        $advancedDefaults = array();
     1880
     1881        foreach($allParams as $param) {
     1882            $paramName = UniteFunctionsUC::getVal($param, 'name');
     1883           
     1884            // Only process advanced_ parameters
     1885            if (strpos($paramName, 'advanced_') === 0) {
     1886                $defaultValue = UniteFunctionsUC::getVal($param, 'default_value');
     1887               
     1888                // Check if default value exists and is not empty
     1889                if ($defaultValue !== null && $defaultValue !== '' && $defaultValue !== false) {
     1890                    // Only add if not already set by user
     1891                    $currentValue = UniteFunctionsUC::getVal($paramsTmp, $paramName);
     1892                    if ($currentValue === '' || $currentValue === null) {
     1893                        $advancedDefaults[$paramName] = $defaultValue;
     1894                    }
     1895                }
     1896            }
     1897        }
     1898
     1899        // Merge defaults with user-set values (user values take precedence)
     1900        if (!empty($advancedDefaults)) {
     1901            $paramsTmp = array_merge($advancedDefaults, $paramsTmp);
     1902        }
     1903
    12811904        $advanced_styles = '';
    12821905
     
    15542177            }
    15552178        }
    1556 
    1557         $styles .= ' /* debug 2 */';
    1558 
     2179       
    15592180        return $styles;
    15602181    }
     
    16292250        $styles .= $this->processItemsSelectors();
    16302251
    1631         $styles .= ' /* debug 3 */';
     2252        $styles .= $this->getAdvancedTabCssSelectors();
    16322253
    16332254        if(empty($styles) === true)
    16342255            return null;
    16352256
    1636         // UniteProviderFunctionsUC::printCustomStyle($styles);
    1637 
    16382257        return $styles;
    16392258    }
    16402259
     2260    private function getProcessedItemsData() {
     2261        if(empty($this->processedItemsData)) {
     2262            $this->processedItemsData = $this->addon->getProcessedItemsData($this->processType);
     2263        }
     2264        return $this->processedItemsData;
     2265    }
     2266
    16412267    /**
    16422268     * process items selectors
     
    16472273
    16482274        $items = $this->addon->getArrItemsNonProcessed();
     2275        $itemsProcessed = $this->getProcessedItemsData();
    16492276        $params = $this->addon->getProcessedItemsParams();
     2277
     2278        // $styles = '/* =[8] ' . json_encode($items) . ' =[9] */';
    16502279
    16512280        if (empty($items) === true || empty($params) === true)
    16522281            return $styles;
    16532282
    1654         foreach($items as $item){
    1655             $itemId = UniteFunctionsUC::getVal($item, "_generated_id");
    1656             $itemParams = array();
     2283        foreach($items as $k => $item){
     2284            $itemData = $itemsProcessed[$k]['item'];
     2285            $itemId = UniteFunctionsUC::getVal($itemData, "_generated_id");
     2286            $itemParams = array();
    16572287
    16582288            foreach($params as $param){
     
    16642294
    16652295            $itemStyles = $this->processParamsCSSSelector($itemParams);
    1666             $itemStyles = $this->processCSSSelectorReplaces($itemStyles, array("{{current_item}}" => ".elementor-repeater-item-" . $itemId));
     2296           
     2297            $itemStyles = $this->processCSSSelectorReplaces($itemStyles, array("{{current_item}}" => ".elementor-repeater-item-" . $itemId));
    16672298
    16682299            $styles .= $itemStyles;
    16692300
    1670             $styles .= ' /* debug 4 */';
    16712301        }
    16722302
     
    28313461     */
    28323462    private function getAddonParams(){
    2833 
    2834         if(!empty($this->paramsCache))
     3463        if(!empty($this->paramsCache)) {
    28353464            return($this->paramsCache);
     3465        }
    28363466
    28373467        $this->paramsCache = $this->addon->getProcessedMainParamsValues($this->processType);
    28383468
     3469        $allParamDefs = $this->addon->getParams();
     3470
    28393471        return($this->paramsCache);
     3472
    28403473    }
    28413474
     
    31273760
    31283761                        if(is_string($dataValue) && $dataValue === "uc_items"){
    3129                             $arrItemData = $this->addon->getProcessedItemsData($this->processType);
     3762                            // $arrItemData = $this->addon->getProcessedItemsData($this->processType);
     3763                            $arrItemData = $this->getProcessedItemsData();
    31303764                        }elseif(is_array($dataValue)){
    31313765                            $arrItemData = $dataValue;
     
    31383772                    break;
    31393773                    default:
    3140                         $arrItemData = $this->addon->getProcessedItemsData($this->processType);
     3774                        // $arrItemData = $this->addon->getProcessedItemsData($this->processType);
     3775                        $arrItemData = $this->getProcessedItemsData();
    31413776                    break;
    31423777                }
  • unlimited-elements-for-elementor/trunk/includes.php

    r3442278 r3444776  
    1313
    1414if(!defined("UNLIMITED_ELEMENTS_VERSION"))
    15     define("UNLIMITED_ELEMENTS_VERSION", "2.0.4");
     15    define("UNLIMITED_ELEMENTS_VERSION", "2.0.5");
    1616
    1717//disable elementor support for debugging purposes. keep it commented
  • unlimited-elements-for-elementor/trunk/js/settings.js

    r3429507 r3444776  
    1717   
    1818    var g_debug_selectors = null;
    19     //var g_debug_selectors = "item_border_width";  //enter input name
    2019   
    2120    var g_vars = {
     
    9291
    9392    this.setCacheValues = function(values){
    94         g_temp.cacheValues = (values && typeof values === "object") ? values : {};
     93
     94        if (!this._instanceCache) {
     95            // local cache for this settings instance (for each repeater item)
     96            this._instanceCache = {};
     97        }
     98        if (values && typeof values === "object") {
     99            jQuery.extend(true, this._instanceCache, values);
     100        }
     101       
     102        if (!g_temp.cacheValues || typeof g_temp.cacheValues !== "object") {
     103            g_temp.cacheValues = {};
     104        }
     105        if (values && typeof values === "object") {
     106            jQuery.extend(true, g_temp.cacheValues, values);
     107        }
    95108    };
    96109
     
    117130
    118131
    119         this.__________OTHER_EXTERNAL__________ = function(){};
    120 
     132    this.__________OTHER_EXTERNAL__________ = function(){};
    121133
    122134    /**
     
    354366        const type = getInputType(objInput);
    355367
     368        // Instance cache (for repeater items)
     369        if (t._instanceCache && Object.prototype.hasOwnProperty.call(t._instanceCache, name)) {
     370            return forcePlannedValueByType(type, t._instanceCache[name], objInput, name);
     371        }
     372       
     373        // Global cache
    356374        if (g_temp.cacheValues && Object.prototype.hasOwnProperty.call(g_temp.cacheValues, name)) {
    357375            return forcePlannedValueByType(type, g_temp.cacheValues[name], objInput, name);
     
    385403            return(g_vars.NOT_UPDATE_OPTION);
    386404
     405        if (!isInputFullyInited(objInput)) {
     406            // if not inited get from cache
     407            return getPlannedInitValue(objInput);
     408        }
     409
    387410        var flagUpdate = true;
    388411
     
    512535            if (isInputFullyInited(objInput)) {
    513536               
    514                 if (objInput.closest(".unite-setting-row").hasClass("unite-setting-hidden") === true) {
    515                     //console.log('hidden: ' + name);   
     537                if (objInput.closest(".unite-setting-row").hasClass("unite-setting-hidden") === true)
    516538                    return;
    517                 }
    518539
    519540                value = getSettingInputValue(objInput);
     
    734755            break;
    735756            case "repeater":
    736                 setRepeaterValues(objInput, null, true);
     757                var repeaterName = getInputName(objInput);
     758                var hasCachedData = false;
     759               
     760                if (t._instanceCache && t._instanceCache.hasOwnProperty(repeaterName)) {
     761                    var cachedValue = t._instanceCache[repeaterName];
     762                    hasCachedData = Array.isArray(cachedValue) && cachedValue.length > 0;
     763                } else if (g_temp.cacheValues && g_temp.cacheValues.hasOwnProperty(repeaterName)) {
     764                    var cachedValue = g_temp.cacheValues[repeaterName];
     765                    hasCachedData = Array.isArray(cachedValue) && cachedValue.length > 0;
     766                }
     767               
     768                if (!hasCachedData) {
     769                    setRepeaterValues(objInput, null, true);
     770                }
    737771            break;
    738772            case "col_layout":
     
    918952            break;
    919953            case "repeater":
    920                 setRepeaterValues(objInput, value);
     954
     955                if (!objInput.data('repeater-inited')) {
     956                    initRepeater(objInput, t.onSettingChange);
     957                }
     958               
     959                setRepeaterValues(objInput, value);
    921960            break;
    922961            case "multiselect":
     
    10191058            if (objValues.hasOwnProperty(name)) {
    10201059                var value = objValues[name];
    1021 
    10221060                setInputValue(objInput, value, objValues);
    10231061            }
     
    12951333    }
    12961334
    1297     /*
    1298     * init input once
    1299     */
    13001335    function initInputOnce(objInput, funcChange){
    1301        
    13021336        if (_initedInputsOnce.has(objInput[0])) return;
    13031337       
    13041338        if (!funcChange)
    13051339            funcChange = t.onSettingChange;
    1306        
     1340
    13071341        var type = getInputType(objInput);
    1308                
    13091342        var basicType = getInputBasicType(objInput);       
    13101343       
     
    13141347            trace(objInput);
    13151348        }
    1316                
     1349       
    13171350        //no need to init items panel from here
    13181351        if(type == "items"){
     
    13201353            return(false);
    13211354        }
    1322        
    13231355       
    13241356        // init by type
     
    14151447            break;
    14161448        }
    1417        
    14181449
    14191450        t.disableTriggerChange();
     
    14221453            const name = getInputName(objInput);
    14231454
    1424             if (!g_temp.cacheValues || typeof g_temp.cacheValues !== 'object') {
    1425                 g_temp.cacheValues = {};
     1455            var cacheToUse = t._instanceCache || g_temp.cacheValues;
     1456           
     1457            if (!cacheToUse || typeof cacheToUse !== 'object') {
     1458                if (!t._instanceCache) t._instanceCache = {};
     1459                cacheToUse = t._instanceCache;
    14261460            }
    14271461
    1428             if (name && !Object.prototype.hasOwnProperty.call(g_temp.cacheValues, name)) {
     1462            if (name && !Object.prototype.hasOwnProperty.call(cacheToUse, name)) {
    14291463                const plannedValue = getPlannedInitValue(objInput);
    14301464
    14311465                if (plannedValue !== g_vars.NOT_UPDATE_OPTION) {
    1432                     g_temp.cacheValues[name] = plannedValue;
     1466                    cacheToUse[name] = plannedValue;
    14331467                }
    14341468            }
     
    14361470            clearInput(objInput, "initval", "initchecked", true);
    14371471
    1438             if (name && Object.prototype.hasOwnProperty.call(g_temp.cacheValues, name)) {
    1439                 setInputValue(objInput, g_temp.cacheValues[name], g_temp.cacheValues);
     1472            if (name && Object.prototype.hasOwnProperty.call(cacheToUse, name)) {
     1473                var cachedValue = cacheToUse[name];
     1474                var inputType = getInputType(objInput);
     1475               
     1476                if (inputType !== 'repeater' || !Array.isArray(cachedValue) || cachedValue.length !== 0) {
     1477                    setInputValue(objInput, cachedValue, cacheToUse);
     1478                }
    14401479            }
    14411480
     
    14711510
    14721511                    let type = getInputType($input);
    1473                                        
    14741512                    if(type == 'repeater') {
    14751513                        initInputOnce($input, t.onSettingChange);
     
    17661804        options = options || {};
    17671805
     1806        if (!this._instanceCache) {
     1807            this._instanceCache = {};
     1808        }
     1809
     1810        // for repeater item
    17681811        if (options.cacheValues && typeof options.cacheValues === "object") {
    1769             g_temp.cacheValues = options.cacheValues;
    1770         } else {
    1771             g_temp.cacheValues = {}
     1812            jQuery.extend(true, this._instanceCache, options.cacheValues);
     1813        }
     1814
     1815        // for parent block
     1816        if (!options.isRepeaterItem && options.cacheValues) {
     1817            if (!g_temp.cacheValues || typeof g_temp.cacheValues !== "object") {
     1818                g_temp.cacheValues = {};
     1819            }
     1820            jQuery.extend(true, g_temp.cacheValues, options.cacheValues);
    17721821        }
    17731822
     
    18131862        initAnimationsSelector();
    18141863        initGlobalEvents();
    1815 
    18161864
    18171865        t.updateEvents();
     
    19091957    function getRangeSliderValue(objWrapper) {
    19101958        var data = {};
    1911 
    19121959        data["size"] = objWrapper.find(".unite-setting-range-input").val();
    19131960        data["unit"] = getUnitsPickerValue(objWrapper);
     
    32083255
    32093256        var objType = iconPicker_getObjIconsType(type);
    3210         // var isAddNew = g_ucAdmin.getVal(objType, "add_new");
    32113257
    32123258        var htmlDialog = "<div id=\"" + dialogID + "\" class=\"unite-iconpicker-dialog unite-inputs unite-picker-type-" + type + "\" style=\"display:none\">";
     
    40634109     */
    40644110    function initItemsPanel(){
    4065                
     4111
    40664112        var objItemsWrapper = g_objParent.find(".uc-setting-items-panel");
    40674113        if(objItemsWrapper.length == 0)
     
    42804326     * init repeaters
    42814327     */
    4282     function initRepeaters() {
    4283         var objRepeaters = g_objWrapper.find(".unite-setting-repeater");
    4284 
    4285         if (objRepeaters.length === 0)
    4286             return;
    4287 
    4288         g_temp.isRepeaterExists = true;
    4289     }
     4328    function initRepeaters() {
     4329        var objRepeaters = g_objWrapper.find(".unite-setting-repeater");
     4330
     4331        if (objRepeaters.length === 0)
     4332            return;
     4333
     4334        g_temp.isRepeaterExists = true;
     4335    }
    42904336
    42914337    /**
    42924338     * init repeater
    42934339     */
    4294 /**
    4295      * init repeater
    4296      */
    42974340    function initRepeater(objWrapper, funcChange) {
     4341        if (objWrapper.data('repeater-inited')) {
     4342            return;
     4343        }
     4344        objWrapper.data('repeater-inited', true);
     4345
     4346        var name = getInputName(objWrapper);
    42984347       
    42994348        if (objWrapper && objWrapper.sortable && typeof objWrapper.sortable === 'function') {
     
    43484397        var cachedValue = null;
    43494398
    4350         if (g_temp.cacheValues && g_temp.cacheValues.hasOwnProperty(name)) {
     4399        if (t._instanceCache && t._instanceCache.hasOwnProperty(name)) {
     4400            cachedValue = t._instanceCache[name];
     4401        } else if (g_temp.cacheValues && g_temp.cacheValues.hasOwnProperty(name)) {
    43514402            cachedValue = g_temp.cacheValues[name];
    43524403        }
     
    44634514        // init item settings
    44644515        var objSettings = new UniteSettingsUC();
    4465         objSettings.init(objItemSettingsWrapper, { cacheValues: itemValues });
     4516        objSettings.init(objItemSettingsWrapper, { cacheValues: itemValues, isRepeaterItem: true });
    44664517        objSettings.setValues && objSettings.setValues(itemValues);
    4467 
    44684518        objItem.data("objsettings", objSettings);
    44694519
     
    45574607     */
    45584608    function setRepeaterValues(objWrapper, values, useDefault) {
     4609
    45594610        destroyRepeaterItems(objWrapper);
    45604611
     
    46004651        var checkedValue = objWrapper.data("checkedvalue");
    46014652
    4602         checkedValue = g_ucAdmin.strToBool(checkedValue);
    4603         value = g_ucAdmin.strToBool(value);
    4604 
    4605         objWrapper.toggleClass("unite-checked", value === checkedValue);
     4653        // checkedValue = g_ucAdmin.strToBool(checkedValue);
     4654        // value = g_ucAdmin.strToBool(value);
     4655
     4656        objWrapper.toggleClass("unite-checked", value == checkedValue);
    46064657    }
    46074658
     
    46464697     */
    46474698    function getControlActionMultiple(parent, control, arrParents) {
    4648         if (g_temp.cacheValues === null)
    4649             g_temp.cacheValues = t.getSettingsValues(true);
     4699        if (g_temp.cacheValues === null) {
     4700            g_temp.cacheValues = t.getSettingsValues();
     4701        }
     4702           
    46504703
    46514704        var action = null;
     
    48184871                        if (isShow === true && isHidden === true) {
    48194872                            value = objInput.data("previous-value") || value;
    4820 
    48214873                            setInputValue(objInput, value);
    48224874
     
    50155067     */
    50165068    function getUnitsPickerForElement(objElement) {
    5017         return objElement.closest(".unite-setting-row").find(".unite-units-picker");
     5069        return objElement.closest(".unite-setting-row, .unite-setting-range").find(".unite-units-picker");
    50185070    }
    50195071
     
    50225074     */
    50235075    function getUnitsPickerValue(objElement) {
    5024         return getUnitsPickerForElement(objElement).val() || "px";
     5076        return getUnitsPickerForElement(objElement).val() || "px";
    50255077    }
    50265078
     
    50955147                break;
    50965148            }
    5097            
    50985149           
    50995150            //-- debug selector css
     
    51255176                if (g_selectorWrapperID) {
    51265177                    let selectorId = jQuery('#' + g_selectorWrapperID + ' .ue-widget-root').attr('id');
    5127                     selector = "." + selectorId + " " + selector;
     5178                    selector = ".ue-widget-root." + selectorId + " " + selector;
    51285179                }
    51295180                   
     
    54745525       
    54755526        var replaces = getInputSelectorReplaces(objInput, isDebug);
    5476        
     5527
    54775528        if(isDebug){
    54785529            trace("replacers");
  • unlimited-elements-for-elementor/trunk/js/unitecreator_addon_config.js

    r3429507 r3444776  
    661661    this.init = function(objWrapper, isPreviewMode){
    662662       
    663        
    664663        if(g_objWrapper)
    665664            throw new Error("the config is alrady inited, can't init it twice");
     
    688687        parseInputOptions(objOptions);
    689688       
     689       
    690690        //set settings events
    691        
    692691        g_objSettings.init(g_objSettingsContainer);
    693                    
     692                               
    694693        initEvens();
    695694               
  • unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/gutenberg/assets/gutenberg_integrate.js

    r3429507 r3444776  
    354354            }
    355355
    356             return mapToCss(oldMap);
     356            let ret = mapToCss(oldMap);
     357
     358            return ret;
    357359        }
    358360
     
    401403
    402404                const mergedCss = mergeCss(prevCss, css);
    403                
     405
    404406                $style.text(mergedCss);
    405407                lastSelectorsCssRef.current = mergedCss;
     
    514516            }
    515517
    516             ucSettings.init($settingsElement);
     518            // get values before init
     519            var values = getSettings();
     520
     521            if (values === null) {
     522                try {
     523                    // get defaults from data-itemvalues
     524                    var defaultValues = {};
     525                   
     526                    $settingsElement.find('.unite-setting-repeater').each(function() {
     527                        var $repeater = jQuery(this);
     528                        var repeaterName = $repeater.attr('name') || $repeater.data('name');
     529                        var defaultItems = $repeater.data('itemvalues');
     530                       
     531                        if (repeaterName && defaultItems && Array.isArray(defaultItems) && defaultItems.length > 0) {
     532                            defaultValues[repeaterName] = defaultItems;
     533                            debug('from integrate: loaded default items for', repeaterName);
     534                            debug(defaultItems);
     535                        }
     536                    });
     537                   
     538                    // if defaults exists then use it
     539                    if (Object.keys(defaultValues).length > 0) {
     540                        values = defaultValues;
     541                    }
     542                   
     543                } catch (e) {
     544                    console.warn('Failed to get default settings before init', e);
     545                    values = null;
     546                }
     547            }
     548
     549            ucSettings.init($settingsElement, { cacheValues: values });
    517550            initedSettingsElementRef.current = elem;
    518551
     
    583616            });
    584617
    585             var values = getSettings();
    586618            if (values !== null) {
     619                debug('from integrate: setting cache after init');
     620                debug(values);
    587621                ucSettings.setCacheValues(values);
    588             }
     622               
     623                // save attrs for the new block
     624                if (!props.attributes.data) {
     625                    props.setAttributes({ data: JSON.stringify(values) });
     626                }
     627            }
    589628
    590629            settingsInitedRef.current = true;
     
    776815
    777816            attachSettingsObserver();
    778             // startSettingsWatchdog();
    779 
    780817            loadWidgetContent();
    781818
  • unlimited-elements-for-elementor/trunk/provider/provider_params_processor.class.php

    r3442278 r3444776  
    587587        if(empty($mainCategoryID))
    588588            $mainCategoryID = UniteFunctionsUC::getVal($arrMeta, "rank_math_primary_category");
    589                
     589
     590        if (!empty($mainCategoryID)) {
     591            $mainCategoryID = apply_filters('wpml_object_id', $mainCategoryID, 'category', true);
     592        }       
     593           
    590594        if(empty($mainCategoryID)){
    591595
     
    24012405       
    24022406        $disableOtherHooks = UniteFunctionsUC::getVal($value, "{$name}_disable_other_hooks");
    2403                
     2407       
    24042408        //disable by url
    24052409        if(GlobalsUC::$showQueryDebugByUrl == true && HelperUC::hasPermissionsFromQuery("uctestquery_clear"))
    24062410            $disableOtherHooks = "yes";
    24072411       
    2408        
    24092412        if($disableOtherHooks === "yes" && GlobalsProviderUC::$isUnderAjax == true){
    24102413           
     
    24472450        }
    24482451       
    2449        
    24502452        //clear some hook by url - for debug
    24512453               
     
    24532455                   
    24542456            $filterToDisable = HelperUC::getQueryVarWithPermission("uctestquery_clearhook");
    2455                        
     2457           
    24562458            if(!empty($filterToDisable)){
    24572459               
  • unlimited-elements-for-elementor/trunk/provider/provider_params_processor_multisource.class.php

    r3429507 r3444776  
    294294        $type = UniteFunctionsUC::getVal($params, "type");
    295295        $data = UniteCreatorAPIIntegrations::getInstance()->getDataForMultisource($type, $params);
    296        
    297        
     296
    298297        return $data;
    299298    }
  • unlimited-elements-for-elementor/trunk/provider/provider_settings.class.php

    r3429507 r3444776  
    8080        $params["html"] = "<div class='uc-edit-template-button'><a href='javascript:void(0)' class='uc-edit-template-button__link unite-setting-special-select' data-settingtype='template_button' style='display:none' data-selectid='{$name}_templateid' target='_blank'>Edit Template</a></div>";
    8181
    82 
    83 
    84         $this->addTextBox($name."_templateid_button", "", $title , $params);
     82        if(GlobalsProviderUC::$renderPlatform != GlobalsProviderUC::RENDER_PLATFORM_GUTENBERG)
     83            $this->addTextBox($name."_templateid_button", "", $title , $params);
    8584
    8685    }
     
    23002299        $params["is_multiple"] = true;
    23012300        $params["elementor_condition"] = $arrConditionIncludeAuthor;
    2302        
     2301
    23032302        $this->addMultiSelect($name . "_excludeby_authors", $arrAuthors, __("Exclude By Author", "unlimited-elements-for-elementor"), "", $params);
    23042303
  • unlimited-elements-for-elementor/trunk/readme.txt

    r3442278 r3444776  
    940940
    941941== Changelog ==
     942
     943version 2.0.5:
     944
     945
     946= 2.0.5 - 2026-01-22 =
     947
     948* Fix: made some fix for wpml in main category
     949* Fix: fixed special characters in google sheets
     950* Fix: fixed filters "All" empty posts issue
    942951
    943952
  • unlimited-elements-for-elementor/trunk/release_log.txt

    r3442278 r3444776  
     1
     2
     3version 2.0.5:
     4
     5* Fix: made some fix for wpml in main category
     6* Fix: fixed special characters in google sheets
     7* Fix: fixed filters "All" empty posts issue
    18
    29
  • unlimited-elements-for-elementor/trunk/unlimited_elements.php

    r3432094 r3444776  
    55* Description: Elementor all-in-one addons pack with the best widgets for Elementor, offering 100+ free widgets, templates, and tools to create stunning websites!
    66* Author: Unlimited Elements
    7 * Version: 2.0.3
     7* Version: 2.0.5
    88* Author URI: http://unlimited-elements.com
    99* Text Domain: unlimited-elements-for-elementor
Note: See TracChangeset for help on using the changeset viewer.