Plugin Directory

Changeset 2237695


Ignore:
Timestamp:
02/03/2020 02:21:23 PM (6 years ago)
Author:
thmarx
Message:

release 3.1.0

Location:
experience-manager/trunk
Files:
8 added
3 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • experience-manager/trunk/css/experience-manager.css

    r2096995 r2237695  
    3030    display: none;
    3131}
     32[data-tma-divi-default="no"] {
     33    display: none;
     34}
  • experience-manager/trunk/css/tma-settings.css

    r2096995 r2237695  
     1.overflow_hidden {
     2    overflow: hidden
     3}
     4
    15/* The switch - the box around the slider */
    26.switch {
     
    4448    transition: .4s;
    4549}
     50fieldset:disabled .slider:before {
     51    position: absolute;
     52    content: "";
     53    height: 26px;
     54    width: 26px;
     55    left: 4px;
     56    bottom: 4px;
     57    background-color: darkgray;
     58    -webkit-transition: .4s;
     59    transition: .4s;
     60}
    4661
    4762input:checked + .slider {
  • experience-manager/trunk/experience-manager.php

    r2235008 r2237695  
    1414}
    1515
    16 define("TMA_EXPERIENCE_MANAGER_VERSION", "3.0.0");
     16define("TMA_EXPERIENCE_MANAGER_VERSION", "3.1.0");
    1717define("TMA_EXPERIENCE_MANAGER_SEGMENT_MATCHING_ALL", "all");
    1818define("TMA_EXPERIENCE_MANAGER_SEGMENT_MATCHING_ANY", "any");
     
    4040add_action("init", "tma_webtools_init");
    4141add_action("rest_api_init", "tma_webtools_rest_init");
    42 add_action("plugins_loaded", "tma_webtools_plugins_loaded");
     42//add_action("plugins_loaded", "tma_webtools_plugins_loaded");
     43add_action("init", "tma_webtools_plugins_loaded");
    4344
    4445function tma_webtools_plugins_loaded() {
    4546    tma_exm_log("load editor plugins");
    4647
    47     if (\TMA\ExperienceManager\Plugins::getInstance()->elementor()) {
    48         \TMA\ExperienceManager\Elementor_Integration::getInstance();
    49         \TMA\ExperienceManager\Elementor_Preview::getInstance();
    50        
    51 //      \TMA\ExperienceManager\ElementorPopupIntegration::getInstance()->init();
    52     }
    53     if (\TMA\ExperienceManager\Plugins::getInstance()->popup_maker()) {
    54         \TMA\ExperienceManager\TMA_PopupMakerIntegration::getInstance()->init();
    55     }
    56     if (\TMA\ExperienceManager\Plugins::getInstance()->advanced_ads()) {
    57         \TMA\ExperienceManager\TMA_AdvancedAdsIntegration::getInstance()->init();
    58     }
    59     if (\TMA\ExperienceManager\Plugins::getInstance()->gutenberg()) {
    60         new \TMA\ExperienceManager\Gutenberg_Integration();
    61     }
     48    \TMA\ExperienceManager\Modules\Integrations::getInstance()->init();
    6249
    63     require_once 'includes/modules/events/class.ecommerce_events.php';
     50//  require_once 'includes/modules/events/class.ecommerce_events.php';
    6451}
    6552
     
    7461   
    7562    tma_exm_log("tma_webtools_init");
    76     wp_register_style('experience-manager', plugins_url('css/experience-manager.css', __FILE__));
    77     wp_enqueue_style('experience-manager');
    78     // has to be global
    79     // Settings
    80 //  require_once 'includes/frontend/class.tma_script_helper.php';
    81     //require_once 'includes/frontend/class.shortcode_tma_content.php';
     63    if (!is_admin()) {
     64        wp_register_style('experience-manager', plugins_url('css/experience-manager.css', __FILE__));
     65        wp_enqueue_style('experience-manager');
     66       
     67        wp_register_script("experience-manager-hooks", plugins_url('assets/hook.js', __FILE__), [], "1.0.0", false);
     68//      wp_enqueue_script("experience-manager-hooks", plugins_url('assets/hook.js', __FILE__), [], "1.0.0", false);
     69    }
     70   
    8271    require_once 'includes/frontend/template_tags.php';
    8372
  • experience-manager/trunk/includes/backend/class.tma_settings.php

    r2235008 r2237695  
    6060                'title' => __('Basic Settings', 'wedevs')
    6161            ),
    62             array(
    63                 'id' => 'tma_webtools_option_targeting',
    64                 'title' => __('Targeting', 'wedevs')
    65             )
     62//          array(
     63//              'id' => 'tma_webtools_option_targeting',
     64//              'title' => __('Targeting', 'wedevs')
     65//          )
    6666        );
    6767
     
    126126                    'type' => 'toggle'
    127127                ),
     128                /*
    128129                array(
    129130                    'name' => 'webtools_score',
     
    132133                    'type' => 'toggle'
    133134                )
     135                 */
    134136            ),
    135             'tma_webtools_option_targeting' => array(
    136                 /*
    137                 array(
    138                     'name' => 'webtools_backend_mode',
    139                     'label' => __("Backend mode?", "tma-webtools"),
    140                     'desc' => __("Experimental: If enabled, the targeting is done in the backend.", "tma-webtools"),
    141                     'type' => 'toggle'
    142                 ),
    143                  */
    144                 array(
    145                     'name' => 'webtools_shortcode_single_item_per_group',
    146                     'label' => __("Single item per group?", "tma-webtools"),
    147                     'desc' => __("If enabled, only the first matching group is delivered.", "tma-webtools"),
    148                     'type' => 'toggle'
    149                 )
    150             )
     137//          'tma_webtools_option_targeting' => array(
     138//              /*
     139//              array(
     140//                  'name' => 'webtools_backend_mode',
     141//                  'label' => __("Backend mode?", "tma-webtools"),
     142//                  'desc' => __("Experimental: If enabled, the targeting is done in the backend.", "tma-webtools"),
     143//                  'type' => 'toggle'
     144//              ),
     145//               */
     146//              array(
     147//                  'name' => 'webtools_shortcode_single_item_per_group',
     148//                  'label' => __("Single item per group?", "tma-webtools"),
     149//                  'desc' => __("If enabled, only the first matching group is delivered.", "tma-webtools"),
     150//                  'type' => 'toggle'
     151//              )
     152//          )
    151153        );
    152154
  • experience-manager/trunk/includes/class.plugins.php

    r2215120 r2237695  
    3939        return in_array('elementor/elementor.php', $this->plugins);
    4040    }
     41    public function divi() {
     42        return function_exists("et_setup_theme");
     43    }
    4144
    4245    public function popup_maker() {
  • experience-manager/trunk/includes/modules/editors/class.integration.php

    r2201127 r2237695  
    1919    }
    2020
    21     protected function is_visible($settings) {
    22         $visible = TRUE;
    23 //      var_dump($settings);
    24         // frontend
    25         if (!$this->isActivated($settings)) {
    26             return true;
    27         }
    28 //      var_dump($settings);
    29         $group = $this->getGroup($settings);
    30         if (!$this->matching($settings)) {
    31             // segmentation activated AND not matching AND not group default OR group content already added
    32             if ($this->isGroupDefault($settings) && $this->contentAdded($group)) {
    33                 $visible = FALSE;
    34             } else if (!$this->isGroupDefault($settings)) {
    35                 $visible = FALSE;
    36             }
    37         } else if ($this->singleItemPerGroup() && $this->contentAdded($group)) {
    38             // segmentation activated & only single item per group & group content already added
    39             $visible = FALSE;
    40         }
    41         if ($visible) {
    42             $this->addGroupContent($group);
    43         }
    44        
    45 
    46         $visible = apply_filters("experience-manager/modules/editors/visible", $visible, $settings);
    47        
    48         return $visible;
    49     }
    50 
    51     protected function singleItemPerGroup() {
    52         return $this->onlySingleItemPerGroup === true;
    53     }
    54 
    55     protected function addGroupContent($group) {
    56         $_REQUEST["tmagroup_" . $group] = true;
    57     }
    58 
    59     protected function contentAdded($group) {
    60         if (array_key_exists("tmagroup_".$group, $_REQUEST)) {
    61             return filter_var($_REQUEST["tmagroup_" . $group], FILTER_VALIDATE_BOOLEAN);
    62         }
    63         return false;
    64     }
    65    
    6621    protected function isActivated($args) {
    6722        return (is_array($args)
     
    12782        $attr_segments = array_map('trim', $attr_segments);
    12883        if ($matching_mode === ShortCode_TMA_CONTENT::$match_mode_all) {
    129 //          $matching = ShortCode_TMA_CONTENT::matching_mode_all(ShortCode_TMA_CONTENT::array_flat($segments), $attr_segments);
    13084            $matching = tma_exm_array_match_all($attr_segments, $segments);
    13185        } else if ($matching_mode === ShortCode_TMA_CONTENT::$match_mode_any) {
    132 //          $matching = ShortCode_TMA_CONTENT::matching_mode_any(ShortCode_TMA_CONTENT::array_flat($segments), $attr_segments);
    13386            $matching = tma_exm_array_match_any($attr_segments, $segments);
    13487        } else if ($matching_mode === ShortCode_TMA_CONTENT::$match_mode_none) {
    135 //          $matching = !ShortCode_TMA_CONTENT::matching_mode_any(ShortCode_TMA_CONTENT::array_flat($segments), $attr_segments);
    13688            $matching = !tma_exm_array_match_all($attr_segments, $segments);
    13789        }
  • experience-manager/trunk/includes/modules/editors/elementor/class.elementor_integration.php

    r2200549 r2237695  
    5656        }
    5757        if (!$in_edit) {
    58             if (tma_exm_is_frontend_mode_enabled() && Elementor_Integration::_isActivated($settings)) {
     58            if (Elementor_Integration::_isActivated($settings)) {
    5959                if ($settings['tma_default'] === "no") {
    60                     $attrs["class"] = 'tma-hide';
    61                 }
    62             } else {
    63                 if ($this->is_widget_visible($element) === FALSE) {
    6460                    $attrs["class"] = 'tma-hide';
    6561                }
     
    10096    function isActivated($args) {
    10197        return Elementor_Integration::_isActivated($args);
    102     }
    103 
    104     protected function isGroupDefault($args) {
    105         return (is_array($args) && !empty($args['tma_default']) && $args['tma_default'] === "yes");
    106     }
    107 
    108     function is_widget_visible($widget) {
    109         $visible = TRUE;
    110         $args = $widget->get_settings();
    111 //      var_dump($args);
    112         if (\Elementor\Plugin::$instance->editor->is_edit_mode()) {
    113             $visible = TRUE;
    114         } else {
    115             $visible = $this->is_visible($args);
    116         }
    117         return $visible;
    11898    }
    11999
     
    198178
    199179}
    200 
    201 //$tma_elementor_integration = new Elementor_Integration();
  • experience-manager/trunk/includes/modules/editors/gutenberg/class.gutenberg_integration.php

    r2096995 r2237695  
    2727    public function __construct() {
    2828
    29         add_action( 'enqueue_block_editor_assets', array( $this, 'register_block_assets' ) );
     29        add_action('enqueue_block_editor_assets', array($this, 'register_block_assets'));
    3030    }
    3131
     
    3939     */
    4040    public function register_block_assets() {
    41         $block_js = 'assets/gutenberg/script.js';
    42         $block_css = 'assets/gutenberg/style.css';
    43 
     41        $block_js = 'assets/gutenberg/index.js';
    4442        // Script
    4543        wp_register_script(
     
    4745                TMA_EXPERIENCE_MANAGER_URL . $block_js,
    4846                array(
    49                     'wp-i18n',
    50                     'wp-blocks',
    51                     'wp-components',
    52                     'wp-hooks',
    53                     'wp-element',
    54                     'wp-editor'
     47                    'lodash', 'wp-components', 'wp-compose', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'
    5548                ),
    5649                filemtime(TMA_EXPERIENCE_MANAGER_DIR . $block_js)
    5750        );
    58 
    59         // Common stlyes
    60         wp_register_style(
    61                 'targeting-block-style',
    62                 TMA_EXPERIENCE_MANAGER_URL . $block_css,
    63                 array(
    64                     'wp-blocks',
    65                 ),
    66                 filemtime(TMA_EXPERIENCE_MANAGER_DIR . $block_css)
    67         );
    68 
    69         wp_enqueue_style('targeting-block-style');
    7051        wp_enqueue_script('targeting-block-js');
    7152    }
    7253
    7354}
    74 
    75 //$tma_elementor_integration = new Elementor_Integration();
  • experience-manager/trunk/js/experience-manager-frontend.js

    r2200549 r2237695  
    1616 */
    1717(function ($) {
    18 
    19 
    2018    function tma_webtools_update(segments) {
     19       
     20        EXM_Hook.call("experience-manager/frontend/update/before", {});
     21       
    2122        let flat_segments = segments.user_segments.map(segment => "" + segment.wpid);
    2223        webtools.Frontend.update(flat_segments);
     
    2425
    2526    webtools.domReady(function (event) {
    26        
    2727        webtools.Request.get(TMA_CONFIG.rest_url + "experience-manager/v1/segments").then(function (response) {
    2828            response.json().then(tma_webtools_update);
  • experience-manager/trunk/modules/class.settings-api.php

    r2096995 r2237695  
    143143                    'max'               => isset( $option['max'] ) ? $option['max'] : '',
    144144                    'step'              => isset( $option['step'] ) ? $option['step'] : '',
     145                    'disable'            => isset( $option['disable'] ) ? $option['disable'] : FALSE,
    145146                );
    146147
     
    245246        $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
    246247
    247         $html  = '<fieldset>';
    248         $html  .= sprintf( '<label for="wpuf-%1$s[%2$s]" class="switch">', $args['section'], $args['id'] );
    249         $html  .= sprintf( '<input type="checkbox" class="slider" id="wpuf-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
     248        $disabled = "";
     249        if (isset($args['disable']) && $args['disable']) {
     250            $disabled = "disabled";
     251        }
     252       
     253        $html  = '<fieldset ' . $disabled . ' class="overflow_hidden">';
     254        $html  .= sprintf( '<label for="wpuf-%1$s[%2$s]" class="switch overflow_hidden">', $args['section'], $args['id'] );
     255        $html  .= sprintf( '<input type="checkbox" class="slider overflow_hidden" id="wpuf-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
    250256        $html  .= sprintf( '<span class="slider"></span>');
    251257        $html  .= sprintf( '</label>');
  • experience-manager/trunk/readme.txt

    r2235008 r2237695  
    44Requires at least: 4.4.1
    55Tested up to: 5.3.2
    6 Stable tag: 3.0.0
     6Stable tag: 3.1.0
     7Version: 3.1.0
    78License: GPLv2 or later
    89
     
    6465== Changelog ==
    6566
     673.1.0
     68 * Add possibility to disable integrations into other plugins
     69    Attention: By default all integrations are disabled and must be activated first.
     70 * Support for the DIVI PageBuilder was added
     71 * Gutenberg class name issue fixed
     72
    66733.0.0
    6774 * Generate unique id for cart tracking
  • experience-manager/trunk/tma-autoload.php

    r2235008 r2237695  
    2121    "TMA\ExperienceManager\TMA_Widget_Targeting" => "includes/widgets/class.widget_targeting.php",
    2222   
     23    // Integrations
     24    "TMA\ExperienceManager\Modules\Integrations" => "includes/modules/class.integrations.php",
    2325    // Popup Maker
    2426    "TMA\ExperienceManager\TMA_PopupMakerIntegration" => "includes/modules/messages/popup-maker/class.popup-maker.php",
     
    3234    // Gutenberg
    3335    "TMA\ExperienceManager\Gutenberg_Integration" => "includes/modules/editors/gutenberg/class.gutenberg_integration.php",
     36    // DIVI
     37    "TMA\ExperienceManager\Modules\Editors\Divi\DiviBuilder_Integration" => "includes/modules/editors/divi/class.divibuilder_integration.php",
    3438   
    3539    // Audience Editor
  • experience-manager/trunk/tma-scripts.php

    r2192435 r2237695  
    2626         */
    2727        if (tma_exm_is_frontend_mode_enabled() /*&& !is_user_logged_in()*/) {
    28             wp_enqueue_script('experience-manager-frontend', TMA_EXPERIENCE_MANAGER_URL . 'js/experience-manager-frontend.js', array("jquery", "webtools-frontend"), "1");
     28            wp_enqueue_script('experience-manager-frontend', TMA_EXPERIENCE_MANAGER_URL . 'js/experience-manager-frontend.js', array("jquery", "webtools-frontend", "experience-manager-hooks"), "1");
    2929        } else if (/*!is_user_logged_in() && */function_exists("has_blocks") && has_blocks()) {
    30             wp_enqueue_script('experience-manager-frontend', TMA_EXPERIENCE_MANAGER_URL . 'js/experience-manager-frontend.js', array("jquery", "webtools-frontend"), "1");
     30            wp_enqueue_script('experience-manager-frontend', TMA_EXPERIENCE_MANAGER_URL . 'js/experience-manager-frontend.js', array("jquery", "webtools-frontend", "experience-manager-hooks"), "1");
    3131        }
    3232    }
Note: See TracChangeset for help on using the changeset viewer.