Plugin Directory

Changeset 2404450


Ignore:
Timestamp:
10/22/2020 08:33:08 AM (5 years ago)
Author:
hqtheme
Message:

Improving activation and configuration flow

Location:
hqtheme-extra
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hqtheme-extra/tags/1.0.4/hqtheme-extra.php

    r2400862 r2404450  
    55 * Plugin URI:        https://marmot.hqwebs.net/marmot/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=plugin-uri
    66 * Description:       HQTheme Extra adds extras for Marmot Theme - Ready sites one click import
    7  * Version:           1.0.3
     7 * Version:           1.0.4
    88 * Requires at least: 5.3
    99 * Requires PHP:      7.2
     
    5757 * @var string
    5858 */
    59 const VERSION = '1.0.3';
     59const VERSION = '1.0.4';
    6060
    6161// Load Autoloader
     
    235235            wp_safe_redirect(admin_url('themes.php?page=marmot'));
    236236            exit;
    237         } elseif (\HQLib\is_plugin_active('hq-widgets-for-elementor/hq-widgets-for-elementor.php') && \HQLib\is_plugin_active('elementor/elementor.php')) {
     237        } elseif (
     238                defined('\HQWidgetsForElementor\VERSION') &&
     239                defined('\ELEMENTOR_VERSION')) {
    238240            // Redirect to widget dashboard if HQ Widgets plugin is installed
    239241            wp_safe_redirect(admin_url('admin.php?page=hq-elementor-widgets'));
  • hqtheme-extra/tags/1.0.4/inc/demos/admin-page-templates/templates-template-preview.php

    r2400862 r2404450  
    3434                <# if ( data.pro && !data.has_active_license ) { #>
    3535                <p><?php _ex('In order to import PRO demo you need to have active license key.', 'admin demo preview', 'hqtheme-extra'); ?></p>
    36                 <a href="<?php echo admin_url('admin.php?page=marmot-theme-options&tab=license'); ?>" class="button button-primary"><?php echo esc_html_x('Enter License Key', 'admin demo preview', 'hqtheme-extra') ?></a>
     36                <a href="<?php echo admin_url('admin.php?page=marmot-theme-license'); ?>" class="button button-primary"><?php echo esc_html_x('Enter License Key', 'admin demo preview', 'hqtheme-extra') ?></a>
    3737                <# } else { #>
    3838                <p>
     
    119119    </div>
    120120    <div class="wp-full-overlay-main">
    121         <iframe src="{{{data.demo_url}}}" title="<?php echo esc_attr_x('Preview', 'admin demo preview', 'hqtheme-extra') ?>"></iframe>
     121        <iframe src="{{{data.demo_url}}}" title="<?php echo esc_attr_x('Preview', 'admin demo preview', 'hqtheme-extra') ?>" style="background: #fff;"></iframe>
    122122        <div id="theme-install-result" style="display: none;">
    123123            <div class="inner">
  • hqtheme-extra/tags/1.0.4/inc/dependencies.php

    r2400862 r2404450  
    2424            'name' => 'Elementor',
    2525            'file' => 'elementor/elementor.php',
    26             'constant' => '',
    27             'action' => 'elementor/loaded',
     26            'constant' => '\ELEMENTOR_VERSION',
    2827            'required' => false,
    2928            'dismiss' => false,
     
    4342        $this->currnet_plugin_name = $currnet_plugin_name;
    4443        $this->check_plugins();
    45        
     44
    4645        // TODO: Remove after theme approval
    4746        return;
    48         if (!$this->is_theme_active() && !\HQLib\is_plugin_active('marmot-enhancer-pro/marmot-enhancer-pro.php')) {
     47        if (!self::is_theme_active() && !defined('\HQPro\VERSION')) {
    4948            if ($requires_hqtheme) {
    5049                $this->is_dependencies_met = false;
     
    5655                    $required_recommended = 'recommends';
    5756                }
    58                 if ($this->is_theme_installed()) {
     57                if (self::is_theme_installed()) {
    5958                    $message = '<h3>' . $this->currnet_plugin_name . ' ' . $required_recommended . ' Marmot theme</h3>'
    6059                            . '<ol>'
     
    8887    }
    8988
    90     public function is_theme_installed() {
     89    public static function is_theme_installed() {
    9190        foreach ((array) wp_get_themes() as $theme_dir => $theme) {
    9291            if ('Marmot' === $theme->name || 'Marmot' === $theme->parent_theme) {
     
    9796    }
    9897
    99     public function is_theme_active() {
     98    public static function is_theme_active() {
    10099        $theme = wp_get_theme();
    101100
     
    112111    public function check_plugins() {
    113112        foreach (static::$plugins as $plugin_name => $plugin_data) {
    114             if (!$this->is_plugin_active($plugin_data)) {
     113            if (!defined($plugin_data['constant'])) {
    115114                $type = '';
    116115                if ($plugin_data['required']) {
     
    149148                    }
    150149                    // Add notice
    151                     Admin_Notifications::instance()->add_notice('plugin_' . $plugin_name, $type, $message, $plugin_data['dismiss']);
     150                    //Admin_Notifications::instance()->add_notice('plugin_' . $plugin_name, $type, $message, $plugin_data['dismiss']);
    152151                }
    153152            }
     
    155154    }
    156155
    157     public function is_plugin_active($plugin) {
    158         if (!empty($plugin['action']) && did_action($plugin['action'])) {
    159             return true;
    160         } elseif (!empty($plugin['constant']) && defined($plugin['action'])) {
    161             return true;
    162         } elseif (\HQLib\is_plugin_active($plugin['file'])) {
    163             return true;
    164         }
    165         return false;
    166     }
    167 
    168156}
  • hqtheme-extra/tags/1.0.4/inc/hqlib/assets/css/style.css

    r2400862 r2404450  
    966966.d-flex {display: flex;}
    967967.d-block {display: block;}
     968.d-iblock {display: inline-block;}
    968969.flex {flex: 1;}
    969970.flex-basis-100 {flex-basis: 100%;}
     
    12061207    min-width: 1px
    12071208}
    1208 
     1209.hqt-hidden {
     1210    display: none;
     1211}
     1212.hqt-visible {
     1213    display: block;
     1214}
    12091215@media (min-width:640px) {
    12101216    .hqt-col-1-1__sm {
     
    12661272        min-width: 1px
    12671273    }
     1274    .hqt-hidden__sm {
     1275        display: none;
     1276    }
     1277    .hqt-visible__sm {
     1278        display: block;
     1279    }
    12681280}
    12691281
     
    13271339        min-width: 1px
    13281340    }
     1341    .hqt-hidden__md {
     1342        display: none;
     1343    }
     1344    .hqt-visible__md {
     1345        display: block;
     1346    }
    13291347}
    13301348
     
    13881406        min-width: 1px
    13891407    }
     1408    .hqt-hidden__lg {
     1409        display: none;
     1410    }
     1411    .hqt-visible__lg {
     1412        display: block;
     1413    }
    13901414}
    13911415
     
    14491473        min-width: 1px
    14501474    }
    1451 }
     1475    .hqt-hidden__xl {
     1476        display: none;
     1477    }
     1478    .hqt-visible__xl {
     1479        display: block;
     1480    }
     1481}
  • hqtheme-extra/tags/1.0.4/inc/hqlib/assets/js/script.js

    r2387081 r2404450  
    1010            HQLib.initFieldsConditionalLogic();
    1111            HQLib.initRepeater();
     12            //HQLib.initAjaxSubmit();
    1213            $(document).on('hqlib/container/loader/show', HQLib.showLoader);
    1314            $(document).on('hqlib/container/loader/hide', HQLib.hideLoader);
     
    122123            $(container).find('.spinner-wrap').remove();
    123124            $('body').removeClass('loading-content');
     125        },
     126        initAjaxSubmit: function () {
     127            $('.hqt-container > form.hqt-form').each(function () {
     128                var $form = $(this);
     129                $form.submit(function (e) {
     130                    if (typeof window.FormData === 'function') {
     131                        e.preventDefault();
     132                        HQLib.formSubmit($form);
     133                    }
     134                });
     135            });
     136        },
     137        formSubmit: function (form) {
     138            var $form = $(form);
     139            var formData = $form.serializeArray();
     140            formData.push({name: 'action', value: 'hqlib_save_options'});
     141
     142            $.ajax({
     143                url: ajaxurl,
     144                type: 'POST',
     145                dataType: 'json',
     146                data: formData,
     147                beforeSend: function () {}
     148            }).fail(function (jqXHR) {
     149                console.log(jqXHR);
     150            }).done(function (result) {
     151                console.log(result);
     152            });
    124153        }
    125154    };
     
    201230                $(el).val(select2values[$(el).attr('name')]).trigger("change");
    202231            });
    203            
     232
    204233            // Init Datepicker
    205234            $cloned.find('.hqt-form-control.__datetime').each(function (i, el) {
  • hqtheme-extra/tags/1.0.4/inc/hqlib/hqlib.php

    r2400862 r2404450  
    5353        add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']);
    5454        add_action('wp_ajax_hqlib_select2', ['\HQLib\Helper', 'ajax_search']);
     55        add_action('wp_ajax_hqlib_save_options', ['\HQLib\Options', 'save_options']);
    5556        add_filter('admin_footer_text', [$this, 'admin_footer_text'], 999);
    5657    }
  • hqtheme-extra/tags/1.0.4/inc/hqlib/license.php

    r2400862 r2404450  
    132132    }
    133133
    134     public static function license_page() {
     134    public static function license_container() {
    135135        $is_activated = self::is_activated();
    136136
     
    140140                ->add_attribute('disabled', $is_activated ? true : false)
    141141                ->set_content_before(self::license_status_section())
    142                 ->set_description('Use your purchase code for Marmot PRO');
     142                ->set_description('Use your Envato Item Purchase Code for Marmot Theme');
    143143
    144144        $fields[] = $license_field;
     
    147147                ->set_html(self::license_info_box());
    148148
    149         $container = \HQLib\Options\Container::mk('license', _x('License', 'license page', 'hqtheme-extra'), false)
     149        $container = \HQLib\Options\Container::mk('license', '', false)
    150150                //->disable_title()
    151151                ->add_field($fields)
     
    156156                'class' => 'btn-primary' . ($is_activated ? ' hidden' : ''),
    157157                'name' => 'activate',
    158                 'label' => _x('Save License Key', 'license page', 'hqtheme-extra'),
     158                'label' => _x('Use License Key', 'license page', 'hqtheme-extra'),
    159159            ],
    160160            'deactivate' => [
     
    181181        wp_localize_script('hqlib-license', 'hqLicenseData', $data);
    182182
    183         //add_action('hqt_container_license_after', '\HQLib\License::license_page_after');
    184 
    185183        return $container;
    186184    }
     
    207205        <div class="hqt-row">
    208206            <div class="hqt-col-1-1">
     207
    209208                <?php
    210209                if (self::is_activated()) {
    211                     if (\HQLib\is_plugin_active('marmot-enhancer-pro/marmot-enhancer-pro.php')) {
    212                         // Start using premium features (Button)
    213                         ?>
    214                         <h2 class="mt-0 mb-3"><?php _ex('You\'re ready to go!', 'license info', 'hqtheme-extra'); ?></h2>
    215                         <p class="mt-0 mb-2"><?php _ex('Start building your website like a Pro! Enjoy all the premium features - import awesome templates with a click, create stunning popups, attach custom headers and footers on each page, use advanced widgets for Elementor with <b>Dynamic Tags</b>, create unique WooCommerce checkout flow and more, and more...', 'license info', 'hqtheme-extra'); ?></p>
    216                         <a href="<?php echo admin_url('themes.php?page=marmot'); ?>" class="btn btn-border mt-3"><?php _ex('Start Using Premium Features', 'license info', 'hqtheme-extra'); ?></a>
    217                         <a href="<?php echo admin_url('themes.php?page=marmot-ready-sites'); ?>" class="btn btn-danger-border mt-3 ml-2"><?php _ex('View Demos', 'license info', 'hqtheme-extra'); ?></a>
    218                         <?php
    219                     } elseif (\HQLib\is_plugin_installed('marmot-enhancer-pro/marmot-enhancer-pro.php')) {
    220                         // Button Activate
    221                         $activation_url = wp_nonce_url('plugins.php?action=activate&amp;plugin=marmot-enhancer-pro/marmot-enhancer-pro.php&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_marmot-enhancer-pro/marmot-enhancer-pro.php');
    222                         ?>
    223                         <h2 class="mt-0 mb-3"><?php _ex('You\'re almost done!', 'license info', 'hqtheme-extra'); ?></h2>
    224                         <p class="mt-0 mb-2"><?php _ex('Thank you for installing <b>Marmot Enhancer PRO</b>! You are one step away from ability to create awesome website. All you need to do is to activate the plugin and start enjoying all the premium features - import awesome templates with a click, create stunning popups, attach custom headers and footers on each page, use advanced widgets for Elementor with <b>Dynamic Tags</b>, create unique WooCommerce checkout flow and more, and more...', 'license info', 'hqtheme-extra'); ?></p>
    225                         <a href="<?php echo $activation_url; ?>" class="btn btn-primary mt-3"><?php _ex('Activate Marmot Enhancer PRO', 'license info', 'hqtheme-extra'); ?></a>
    226                         <?php
    227                     } else {
    228                         // Install Marmot Enhancer PRO (Button)(WHY)
    229                         $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=marmot-enhancer-pro'), 'install-plugin_marmot-enhancer-pro');
    230                         ?>
    231                         <h2 class="mt-0 mb-3"><?php _ex('Marmot Enhancer PRO Missing ;(', 'license info', 'hqtheme-extra'); ?></h2>
    232                         <?php echo self::enhancer_pro_features(); ?>
    233                         <a href="<?php echo $install_url; ?>" class="btn btn-primary mt-3"><?php _ex('Install Marmot Enhancer PRO', 'license info', 'hqtheme-extra'); ?></a>
    234                         <?php
    235                     }
     210                    ?>
     211                    <h2 class="mt-0 mb-3"><?php _ex('You\'re ready to go!', 'license info', 'hqtheme-extra'); ?></h2>
     212                    <p class="mt-0 mb-2"><?php _ex('Start building your website like a Pro! Enjoy all the premium features - import awesome templates with a click, create stunning popups, attach custom headers and footers on each page, use advanced widgets for Elementor with <b>Dynamic Tags</b>, create unique WooCommerce checkout flow and more, and more...', 'license info', 'hqtheme-extra'); ?></p>
     213                    <a href="<?php echo admin_url('themes.php?page=marmot'); ?>" class="btn btn-border mt-3"><?php _ex('Start Using Premium Features', 'license info', 'hqtheme-extra'); ?></a>
     214                    <a href="<?php echo admin_url('themes.php?page=marmot-ready-sites'); ?>" class="btn btn-danger-border mt-3 ml-2"><?php _ex('Import Demo', 'license info', 'hqtheme-extra'); ?></a>
     215                   
     216                    <?php
    236217                } else {
    237218                    // Get license button
     
    251232        ob_start();
    252233        ?>
    253         <p class="mt-0 mb-2"><?php _ex('With <b>Marmot enhancer PRO</b> you get access to incredible plugins and features for powerful WordPress designing.', 'admin pro features', 'hqtheme-extra'); ?></p>
     234        <p class="mt-0 mb-2"><?php _ex('With <b>Marmot PRO</b> you get access to incredible plugins and features for powerful WordPress designing.', 'admin pro features', 'hqtheme-extra'); ?></p>
    254235        <ul class="hqt-list list-border m-0">
    255             <li><?php _ex('Dynamic Tags give you opportunity to display content from the current page or post, changing dynamically according to the post type it’s on', 'admin pro features', 'hqtheme-extra'); ?></li>
     236            <li><?php _ex('Access to all PRO demos, features and plugins, including <b>Element Pack</b>, <b>Revolution Slider</b> and <b>Layer Slider</b>', 'admin pro features', 'hqtheme-extra'); ?></li>           
    256237            <li><?php _ex('Attach custom headers and footers on each page, post, product, archive or custom post type', 'admin pro features', 'hqtheme-extra'); ?></li>
    257             <li><?php echo sprintf(_x('Create stunning popups with <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/hq-popup-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_content=license-details', 'HQ Popup for Elementor'); ?></li>
     238            <li><?php echo sprintf(_x('Create stunning popups with <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/popups-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_content=license-details', 'Popups System for Elementor'); ?></li>
    258239            <li><?php _ex('Use advanced widgets for Elementor', 'admin pro features', 'hqtheme-extra'); ?></li>
    259             <li><?php _ex('Customize your WooCommerce checkout flow', 'admin pro features', 'hqtheme-extra'); ?></li>
     240            <li><?php echo sprintf(_x('Customize your <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/woocommerce-integration/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_content=license-details', 'WooCommerce checkout flow'); ?></li>
    260241            <li><?php _ex('Control content visibility with Dynamic conditions', 'admin pro features', 'hqtheme-extra'); ?></li>
    261             <li><?php _ex('Access to all PRO demos, features and plugins, including <b>Element Pack</b> and <b>Layer Slider</b>', 'admin pro features', 'hqtheme-extra'); ?></li>
    262             <li><?php echo sprintf(_x('and more... <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/hq-popup-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=learn-more', _x('Learn More', 'admin', 'hqtheme-extra')); ?></li>
     242            <li><?php _ex('Dynamic Tags give you opportunity to display content from the current page or post, changing dynamically according to the post type it’s on', 'admin pro features', 'hqtheme-extra'); ?></li>           
     243            <li><?php echo sprintf(_x('and more... <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/features/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=learn-more', _x('View all features', 'admin', 'hqtheme-extra')); ?></li>
    263244        </ul>
    264245        <?php
  • hqtheme-extra/tags/1.0.4/inc/hqlib/options.php

    r2387081 r2404450  
    1515        }
    1616        do_action('hqt_container_' . $container_key . '_before');
    17         ?>
    18         <div class="hqt-container">
     17        $containerClasses = array_merge(['hqt-container'], (array) apply_filters('hqt_container_' . $container_key . '_classes', []));
     18        ?>
     19        <div class="<?php echo implode(' ', $containerClasses); ?>">
    1920            <?php if ($container->is_submitable()) : ?>
    20                 <form method="post">
     21                <form class="hqt-form" method="post">
    2122                    <?php
    2223                    wp_nonce_field(\HQLib\HQLIB_PREFIX . 'options_nonce', 'hqt_options_nonce');
  • hqtheme-extra/tags/1.0.4/readme.txt

    r2400862 r2404450  
    5656* Remove theme recommendation
    5757
    58 = 1.0.2- 2020-09-30 =
     58= 1.0.2 - 2020-09-30 =
    5959* Filesystem class added in library
    6060* get_terms_objects and get_terms_for_options added in library
    6161
    62 = 1.0.3- 2020-10-01 =
     62= 1.0.3 - 2020-10-01 =
    6363* Added Elementor plugin dependency
    6464* updating site urls
     65
     66= 1.0.4 - 2020-10-22- =
     67* Improving activation and configuration flow
  • hqtheme-extra/trunk/hqtheme-extra.php

    r2400862 r2404450  
    55 * Plugin URI:        https://marmot.hqwebs.net/marmot/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=plugin-uri
    66 * Description:       HQTheme Extra adds extras for Marmot Theme - Ready sites one click import
    7  * Version:           1.0.3
     7 * Version:           1.0.4
    88 * Requires at least: 5.3
    99 * Requires PHP:      7.2
     
    5757 * @var string
    5858 */
    59 const VERSION = '1.0.3';
     59const VERSION = '1.0.4';
    6060
    6161// Load Autoloader
     
    235235            wp_safe_redirect(admin_url('themes.php?page=marmot'));
    236236            exit;
    237         } elseif (\HQLib\is_plugin_active('hq-widgets-for-elementor/hq-widgets-for-elementor.php') && \HQLib\is_plugin_active('elementor/elementor.php')) {
     237        } elseif (
     238                defined('\HQWidgetsForElementor\VERSION') &&
     239                defined('\ELEMENTOR_VERSION')) {
    238240            // Redirect to widget dashboard if HQ Widgets plugin is installed
    239241            wp_safe_redirect(admin_url('admin.php?page=hq-elementor-widgets'));
  • hqtheme-extra/trunk/inc/demos/admin-page-templates/templates-template-preview.php

    r2400862 r2404450  
    3434                <# if ( data.pro && !data.has_active_license ) { #>
    3535                <p><?php _ex('In order to import PRO demo you need to have active license key.', 'admin demo preview', 'hqtheme-extra'); ?></p>
    36                 <a href="<?php echo admin_url('admin.php?page=marmot-theme-options&tab=license'); ?>" class="button button-primary"><?php echo esc_html_x('Enter License Key', 'admin demo preview', 'hqtheme-extra') ?></a>
     36                <a href="<?php echo admin_url('admin.php?page=marmot-theme-license'); ?>" class="button button-primary"><?php echo esc_html_x('Enter License Key', 'admin demo preview', 'hqtheme-extra') ?></a>
    3737                <# } else { #>
    3838                <p>
     
    119119    </div>
    120120    <div class="wp-full-overlay-main">
    121         <iframe src="{{{data.demo_url}}}" title="<?php echo esc_attr_x('Preview', 'admin demo preview', 'hqtheme-extra') ?>"></iframe>
     121        <iframe src="{{{data.demo_url}}}" title="<?php echo esc_attr_x('Preview', 'admin demo preview', 'hqtheme-extra') ?>" style="background: #fff;"></iframe>
    122122        <div id="theme-install-result" style="display: none;">
    123123            <div class="inner">
  • hqtheme-extra/trunk/inc/dependencies.php

    r2400862 r2404450  
    2424            'name' => 'Elementor',
    2525            'file' => 'elementor/elementor.php',
    26             'constant' => '',
    27             'action' => 'elementor/loaded',
     26            'constant' => '\ELEMENTOR_VERSION',
    2827            'required' => false,
    2928            'dismiss' => false,
     
    4342        $this->currnet_plugin_name = $currnet_plugin_name;
    4443        $this->check_plugins();
    45        
     44
    4645        // TODO: Remove after theme approval
    4746        return;
    48         if (!$this->is_theme_active() && !\HQLib\is_plugin_active('marmot-enhancer-pro/marmot-enhancer-pro.php')) {
     47        if (!self::is_theme_active() && !defined('\HQPro\VERSION')) {
    4948            if ($requires_hqtheme) {
    5049                $this->is_dependencies_met = false;
     
    5655                    $required_recommended = 'recommends';
    5756                }
    58                 if ($this->is_theme_installed()) {
     57                if (self::is_theme_installed()) {
    5958                    $message = '<h3>' . $this->currnet_plugin_name . ' ' . $required_recommended . ' Marmot theme</h3>'
    6059                            . '<ol>'
     
    8887    }
    8988
    90     public function is_theme_installed() {
     89    public static function is_theme_installed() {
    9190        foreach ((array) wp_get_themes() as $theme_dir => $theme) {
    9291            if ('Marmot' === $theme->name || 'Marmot' === $theme->parent_theme) {
     
    9796    }
    9897
    99     public function is_theme_active() {
     98    public static function is_theme_active() {
    10099        $theme = wp_get_theme();
    101100
     
    112111    public function check_plugins() {
    113112        foreach (static::$plugins as $plugin_name => $plugin_data) {
    114             if (!$this->is_plugin_active($plugin_data)) {
     113            if (!defined($plugin_data['constant'])) {
    115114                $type = '';
    116115                if ($plugin_data['required']) {
     
    149148                    }
    150149                    // Add notice
    151                     Admin_Notifications::instance()->add_notice('plugin_' . $plugin_name, $type, $message, $plugin_data['dismiss']);
     150                    //Admin_Notifications::instance()->add_notice('plugin_' . $plugin_name, $type, $message, $plugin_data['dismiss']);
    152151                }
    153152            }
     
    155154    }
    156155
    157     public function is_plugin_active($plugin) {
    158         if (!empty($plugin['action']) && did_action($plugin['action'])) {
    159             return true;
    160         } elseif (!empty($plugin['constant']) && defined($plugin['action'])) {
    161             return true;
    162         } elseif (\HQLib\is_plugin_active($plugin['file'])) {
    163             return true;
    164         }
    165         return false;
    166     }
    167 
    168156}
  • hqtheme-extra/trunk/inc/hqlib/assets/css/style.css

    r2400862 r2404450  
    966966.d-flex {display: flex;}
    967967.d-block {display: block;}
     968.d-iblock {display: inline-block;}
    968969.flex {flex: 1;}
    969970.flex-basis-100 {flex-basis: 100%;}
     
    12061207    min-width: 1px
    12071208}
    1208 
     1209.hqt-hidden {
     1210    display: none;
     1211}
     1212.hqt-visible {
     1213    display: block;
     1214}
    12091215@media (min-width:640px) {
    12101216    .hqt-col-1-1__sm {
     
    12661272        min-width: 1px
    12671273    }
     1274    .hqt-hidden__sm {
     1275        display: none;
     1276    }
     1277    .hqt-visible__sm {
     1278        display: block;
     1279    }
    12681280}
    12691281
     
    13271339        min-width: 1px
    13281340    }
     1341    .hqt-hidden__md {
     1342        display: none;
     1343    }
     1344    .hqt-visible__md {
     1345        display: block;
     1346    }
    13291347}
    13301348
     
    13881406        min-width: 1px
    13891407    }
     1408    .hqt-hidden__lg {
     1409        display: none;
     1410    }
     1411    .hqt-visible__lg {
     1412        display: block;
     1413    }
    13901414}
    13911415
     
    14491473        min-width: 1px
    14501474    }
    1451 }
     1475    .hqt-hidden__xl {
     1476        display: none;
     1477    }
     1478    .hqt-visible__xl {
     1479        display: block;
     1480    }
     1481}
  • hqtheme-extra/trunk/inc/hqlib/assets/js/script.js

    r2387081 r2404450  
    1010            HQLib.initFieldsConditionalLogic();
    1111            HQLib.initRepeater();
     12            //HQLib.initAjaxSubmit();
    1213            $(document).on('hqlib/container/loader/show', HQLib.showLoader);
    1314            $(document).on('hqlib/container/loader/hide', HQLib.hideLoader);
     
    122123            $(container).find('.spinner-wrap').remove();
    123124            $('body').removeClass('loading-content');
     125        },
     126        initAjaxSubmit: function () {
     127            $('.hqt-container > form.hqt-form').each(function () {
     128                var $form = $(this);
     129                $form.submit(function (e) {
     130                    if (typeof window.FormData === 'function') {
     131                        e.preventDefault();
     132                        HQLib.formSubmit($form);
     133                    }
     134                });
     135            });
     136        },
     137        formSubmit: function (form) {
     138            var $form = $(form);
     139            var formData = $form.serializeArray();
     140            formData.push({name: 'action', value: 'hqlib_save_options'});
     141
     142            $.ajax({
     143                url: ajaxurl,
     144                type: 'POST',
     145                dataType: 'json',
     146                data: formData,
     147                beforeSend: function () {}
     148            }).fail(function (jqXHR) {
     149                console.log(jqXHR);
     150            }).done(function (result) {
     151                console.log(result);
     152            });
    124153        }
    125154    };
     
    201230                $(el).val(select2values[$(el).attr('name')]).trigger("change");
    202231            });
    203            
     232
    204233            // Init Datepicker
    205234            $cloned.find('.hqt-form-control.__datetime').each(function (i, el) {
  • hqtheme-extra/trunk/inc/hqlib/hqlib.php

    r2400862 r2404450  
    5353        add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']);
    5454        add_action('wp_ajax_hqlib_select2', ['\HQLib\Helper', 'ajax_search']);
     55        add_action('wp_ajax_hqlib_save_options', ['\HQLib\Options', 'save_options']);
    5556        add_filter('admin_footer_text', [$this, 'admin_footer_text'], 999);
    5657    }
  • hqtheme-extra/trunk/inc/hqlib/license.php

    r2400862 r2404450  
    132132    }
    133133
    134     public static function license_page() {
     134    public static function license_container() {
    135135        $is_activated = self::is_activated();
    136136
     
    140140                ->add_attribute('disabled', $is_activated ? true : false)
    141141                ->set_content_before(self::license_status_section())
    142                 ->set_description('Use your purchase code for Marmot PRO');
     142                ->set_description('Use your Envato Item Purchase Code for Marmot Theme');
    143143
    144144        $fields[] = $license_field;
     
    147147                ->set_html(self::license_info_box());
    148148
    149         $container = \HQLib\Options\Container::mk('license', _x('License', 'license page', 'hqtheme-extra'), false)
     149        $container = \HQLib\Options\Container::mk('license', '', false)
    150150                //->disable_title()
    151151                ->add_field($fields)
     
    156156                'class' => 'btn-primary' . ($is_activated ? ' hidden' : ''),
    157157                'name' => 'activate',
    158                 'label' => _x('Save License Key', 'license page', 'hqtheme-extra'),
     158                'label' => _x('Use License Key', 'license page', 'hqtheme-extra'),
    159159            ],
    160160            'deactivate' => [
     
    181181        wp_localize_script('hqlib-license', 'hqLicenseData', $data);
    182182
    183         //add_action('hqt_container_license_after', '\HQLib\License::license_page_after');
    184 
    185183        return $container;
    186184    }
     
    207205        <div class="hqt-row">
    208206            <div class="hqt-col-1-1">
     207
    209208                <?php
    210209                if (self::is_activated()) {
    211                     if (\HQLib\is_plugin_active('marmot-enhancer-pro/marmot-enhancer-pro.php')) {
    212                         // Start using premium features (Button)
    213                         ?>
    214                         <h2 class="mt-0 mb-3"><?php _ex('You\'re ready to go!', 'license info', 'hqtheme-extra'); ?></h2>
    215                         <p class="mt-0 mb-2"><?php _ex('Start building your website like a Pro! Enjoy all the premium features - import awesome templates with a click, create stunning popups, attach custom headers and footers on each page, use advanced widgets for Elementor with <b>Dynamic Tags</b>, create unique WooCommerce checkout flow and more, and more...', 'license info', 'hqtheme-extra'); ?></p>
    216                         <a href="<?php echo admin_url('themes.php?page=marmot'); ?>" class="btn btn-border mt-3"><?php _ex('Start Using Premium Features', 'license info', 'hqtheme-extra'); ?></a>
    217                         <a href="<?php echo admin_url('themes.php?page=marmot-ready-sites'); ?>" class="btn btn-danger-border mt-3 ml-2"><?php _ex('View Demos', 'license info', 'hqtheme-extra'); ?></a>
    218                         <?php
    219                     } elseif (\HQLib\is_plugin_installed('marmot-enhancer-pro/marmot-enhancer-pro.php')) {
    220                         // Button Activate
    221                         $activation_url = wp_nonce_url('plugins.php?action=activate&amp;plugin=marmot-enhancer-pro/marmot-enhancer-pro.php&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_marmot-enhancer-pro/marmot-enhancer-pro.php');
    222                         ?>
    223                         <h2 class="mt-0 mb-3"><?php _ex('You\'re almost done!', 'license info', 'hqtheme-extra'); ?></h2>
    224                         <p class="mt-0 mb-2"><?php _ex('Thank you for installing <b>Marmot Enhancer PRO</b>! You are one step away from ability to create awesome website. All you need to do is to activate the plugin and start enjoying all the premium features - import awesome templates with a click, create stunning popups, attach custom headers and footers on each page, use advanced widgets for Elementor with <b>Dynamic Tags</b>, create unique WooCommerce checkout flow and more, and more...', 'license info', 'hqtheme-extra'); ?></p>
    225                         <a href="<?php echo $activation_url; ?>" class="btn btn-primary mt-3"><?php _ex('Activate Marmot Enhancer PRO', 'license info', 'hqtheme-extra'); ?></a>
    226                         <?php
    227                     } else {
    228                         // Install Marmot Enhancer PRO (Button)(WHY)
    229                         $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=marmot-enhancer-pro'), 'install-plugin_marmot-enhancer-pro');
    230                         ?>
    231                         <h2 class="mt-0 mb-3"><?php _ex('Marmot Enhancer PRO Missing ;(', 'license info', 'hqtheme-extra'); ?></h2>
    232                         <?php echo self::enhancer_pro_features(); ?>
    233                         <a href="<?php echo $install_url; ?>" class="btn btn-primary mt-3"><?php _ex('Install Marmot Enhancer PRO', 'license info', 'hqtheme-extra'); ?></a>
    234                         <?php
    235                     }
     210                    ?>
     211                    <h2 class="mt-0 mb-3"><?php _ex('You\'re ready to go!', 'license info', 'hqtheme-extra'); ?></h2>
     212                    <p class="mt-0 mb-2"><?php _ex('Start building your website like a Pro! Enjoy all the premium features - import awesome templates with a click, create stunning popups, attach custom headers and footers on each page, use advanced widgets for Elementor with <b>Dynamic Tags</b>, create unique WooCommerce checkout flow and more, and more...', 'license info', 'hqtheme-extra'); ?></p>
     213                    <a href="<?php echo admin_url('themes.php?page=marmot'); ?>" class="btn btn-border mt-3"><?php _ex('Start Using Premium Features', 'license info', 'hqtheme-extra'); ?></a>
     214                    <a href="<?php echo admin_url('themes.php?page=marmot-ready-sites'); ?>" class="btn btn-danger-border mt-3 ml-2"><?php _ex('Import Demo', 'license info', 'hqtheme-extra'); ?></a>
     215                   
     216                    <?php
    236217                } else {
    237218                    // Get license button
     
    251232        ob_start();
    252233        ?>
    253         <p class="mt-0 mb-2"><?php _ex('With <b>Marmot enhancer PRO</b> you get access to incredible plugins and features for powerful WordPress designing.', 'admin pro features', 'hqtheme-extra'); ?></p>
     234        <p class="mt-0 mb-2"><?php _ex('With <b>Marmot PRO</b> you get access to incredible plugins and features for powerful WordPress designing.', 'admin pro features', 'hqtheme-extra'); ?></p>
    254235        <ul class="hqt-list list-border m-0">
    255             <li><?php _ex('Dynamic Tags give you opportunity to display content from the current page or post, changing dynamically according to the post type it’s on', 'admin pro features', 'hqtheme-extra'); ?></li>
     236            <li><?php _ex('Access to all PRO demos, features and plugins, including <b>Element Pack</b>, <b>Revolution Slider</b> and <b>Layer Slider</b>', 'admin pro features', 'hqtheme-extra'); ?></li>           
    256237            <li><?php _ex('Attach custom headers and footers on each page, post, product, archive or custom post type', 'admin pro features', 'hqtheme-extra'); ?></li>
    257             <li><?php echo sprintf(_x('Create stunning popups with <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/hq-popup-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_content=license-details', 'HQ Popup for Elementor'); ?></li>
     238            <li><?php echo sprintf(_x('Create stunning popups with <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/popups-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_content=license-details', 'Popups System for Elementor'); ?></li>
    258239            <li><?php _ex('Use advanced widgets for Elementor', 'admin pro features', 'hqtheme-extra'); ?></li>
    259             <li><?php _ex('Customize your WooCommerce checkout flow', 'admin pro features', 'hqtheme-extra'); ?></li>
     240            <li><?php echo sprintf(_x('Customize your <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/woocommerce-integration/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_content=license-details', 'WooCommerce checkout flow'); ?></li>
    260241            <li><?php _ex('Control content visibility with Dynamic conditions', 'admin pro features', 'hqtheme-extra'); ?></li>
    261             <li><?php _ex('Access to all PRO demos, features and plugins, including <b>Element Pack</b> and <b>Layer Slider</b>', 'admin pro features', 'hqtheme-extra'); ?></li>
    262             <li><?php echo sprintf(_x('and more... <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/hq-popup-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=learn-more', _x('Learn More', 'admin', 'hqtheme-extra')); ?></li>
     242            <li><?php _ex('Dynamic Tags give you opportunity to display content from the current page or post, changing dynamically according to the post type it’s on', 'admin pro features', 'hqtheme-extra'); ?></li>           
     243            <li><?php echo sprintf(_x('and more... <a href="%s" target="_blank">%s</a>', 'admin pro features', 'hqtheme-extra'), THEME_SITE_URL . '/features/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hqtheme-extra&utm_content=learn-more', _x('View all features', 'admin', 'hqtheme-extra')); ?></li>
    263244        </ul>
    264245        <?php
  • hqtheme-extra/trunk/inc/hqlib/options.php

    r2387081 r2404450  
    1515        }
    1616        do_action('hqt_container_' . $container_key . '_before');
    17         ?>
    18         <div class="hqt-container">
     17        $containerClasses = array_merge(['hqt-container'], (array) apply_filters('hqt_container_' . $container_key . '_classes', []));
     18        ?>
     19        <div class="<?php echo implode(' ', $containerClasses); ?>">
    1920            <?php if ($container->is_submitable()) : ?>
    20                 <form method="post">
     21                <form class="hqt-form" method="post">
    2122                    <?php
    2223                    wp_nonce_field(\HQLib\HQLIB_PREFIX . 'options_nonce', 'hqt_options_nonce');
  • hqtheme-extra/trunk/readme.txt

    r2400862 r2404450  
    5656* Remove theme recommendation
    5757
    58 = 1.0.2- 2020-09-30 =
     58= 1.0.2 - 2020-09-30 =
    5959* Filesystem class added in library
    6060* get_terms_objects and get_terms_for_options added in library
    6161
    62 = 1.0.3- 2020-10-01 =
     62= 1.0.3 - 2020-10-01 =
    6363* Added Elementor plugin dependency
    6464* updating site urls
     65
     66= 1.0.4 - 2020-10-22- =
     67* Improving activation and configuration flow
Note: See TracChangeset for help on using the changeset viewer.