Changeset 2404450
- Timestamp:
- 10/22/2020 08:33:08 AM (5 years ago)
- Location:
- hqtheme-extra
- Files:
-
- 18 edited
- 1 copied
-
tags/1.0.4 (copied) (copied from hqtheme-extra/trunk)
-
tags/1.0.4/hqtheme-extra.php (modified) (3 diffs)
-
tags/1.0.4/inc/demos/admin-page-templates/templates-template-preview.php (modified) (2 diffs)
-
tags/1.0.4/inc/dependencies.php (modified) (8 diffs)
-
tags/1.0.4/inc/hqlib/assets/css/style.css (modified) (6 diffs)
-
tags/1.0.4/inc/hqlib/assets/js/script.js (modified) (3 diffs)
-
tags/1.0.4/inc/hqlib/hqlib.php (modified) (1 diff)
-
tags/1.0.4/inc/hqlib/license.php (modified) (7 diffs)
-
tags/1.0.4/inc/hqlib/options.php (modified) (1 diff)
-
tags/1.0.4/readme.txt (modified) (1 diff)
-
trunk/hqtheme-extra.php (modified) (3 diffs)
-
trunk/inc/demos/admin-page-templates/templates-template-preview.php (modified) (2 diffs)
-
trunk/inc/dependencies.php (modified) (8 diffs)
-
trunk/inc/hqlib/assets/css/style.css (modified) (6 diffs)
-
trunk/inc/hqlib/assets/js/script.js (modified) (3 diffs)
-
trunk/inc/hqlib/hqlib.php (modified) (1 diff)
-
trunk/inc/hqlib/license.php (modified) (7 diffs)
-
trunk/inc/hqlib/options.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hqtheme-extra/tags/1.0.4/hqtheme-extra.php
r2400862 r2404450 5 5 * 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 6 6 * Description: HQTheme Extra adds extras for Marmot Theme - Ready sites one click import 7 * Version: 1.0. 37 * Version: 1.0.4 8 8 * Requires at least: 5.3 9 9 * Requires PHP: 7.2 … … 57 57 * @var string 58 58 */ 59 const VERSION = '1.0. 3';59 const VERSION = '1.0.4'; 60 60 61 61 // Load Autoloader … … 235 235 wp_safe_redirect(admin_url('themes.php?page=marmot')); 236 236 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')) { 238 240 // Redirect to widget dashboard if HQ Widgets plugin is installed 239 241 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 34 34 <# if ( data.pro && !data.has_active_license ) { #> 35 35 <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> 37 37 <# } else { #> 38 38 <p> … … 119 119 </div> 120 120 <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> 122 122 <div id="theme-install-result" style="display: none;"> 123 123 <div class="inner"> -
hqtheme-extra/tags/1.0.4/inc/dependencies.php
r2400862 r2404450 24 24 'name' => 'Elementor', 25 25 'file' => 'elementor/elementor.php', 26 'constant' => '', 27 'action' => 'elementor/loaded', 26 'constant' => '\ELEMENTOR_VERSION', 28 27 'required' => false, 29 28 'dismiss' => false, … … 43 42 $this->currnet_plugin_name = $currnet_plugin_name; 44 43 $this->check_plugins(); 45 44 46 45 // TODO: Remove after theme approval 47 46 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')) { 49 48 if ($requires_hqtheme) { 50 49 $this->is_dependencies_met = false; … … 56 55 $required_recommended = 'recommends'; 57 56 } 58 if ( $this->is_theme_installed()) {57 if (self::is_theme_installed()) { 59 58 $message = '<h3>' . $this->currnet_plugin_name . ' ' . $required_recommended . ' Marmot theme</h3>' 60 59 . '<ol>' … … 88 87 } 89 88 90 public function is_theme_installed() {89 public static function is_theme_installed() { 91 90 foreach ((array) wp_get_themes() as $theme_dir => $theme) { 92 91 if ('Marmot' === $theme->name || 'Marmot' === $theme->parent_theme) { … … 97 96 } 98 97 99 public function is_theme_active() {98 public static function is_theme_active() { 100 99 $theme = wp_get_theme(); 101 100 … … 112 111 public function check_plugins() { 113 112 foreach (static::$plugins as $plugin_name => $plugin_data) { 114 if (! $this->is_plugin_active($plugin_data)) {113 if (!defined($plugin_data['constant'])) { 115 114 $type = ''; 116 115 if ($plugin_data['required']) { … … 149 148 } 150 149 // 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']); 152 151 } 153 152 } … … 155 154 } 156 155 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 168 156 } -
hqtheme-extra/tags/1.0.4/inc/hqlib/assets/css/style.css
r2400862 r2404450 966 966 .d-flex {display: flex;} 967 967 .d-block {display: block;} 968 .d-iblock {display: inline-block;} 968 969 .flex {flex: 1;} 969 970 .flex-basis-100 {flex-basis: 100%;} … … 1206 1207 min-width: 1px 1207 1208 } 1208 1209 .hqt-hidden { 1210 display: none; 1211 } 1212 .hqt-visible { 1213 display: block; 1214 } 1209 1215 @media (min-width:640px) { 1210 1216 .hqt-col-1-1__sm { … … 1266 1272 min-width: 1px 1267 1273 } 1274 .hqt-hidden__sm { 1275 display: none; 1276 } 1277 .hqt-visible__sm { 1278 display: block; 1279 } 1268 1280 } 1269 1281 … … 1327 1339 min-width: 1px 1328 1340 } 1341 .hqt-hidden__md { 1342 display: none; 1343 } 1344 .hqt-visible__md { 1345 display: block; 1346 } 1329 1347 } 1330 1348 … … 1388 1406 min-width: 1px 1389 1407 } 1408 .hqt-hidden__lg { 1409 display: none; 1410 } 1411 .hqt-visible__lg { 1412 display: block; 1413 } 1390 1414 } 1391 1415 … … 1449 1473 min-width: 1px 1450 1474 } 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 10 10 HQLib.initFieldsConditionalLogic(); 11 11 HQLib.initRepeater(); 12 //HQLib.initAjaxSubmit(); 12 13 $(document).on('hqlib/container/loader/show', HQLib.showLoader); 13 14 $(document).on('hqlib/container/loader/hide', HQLib.hideLoader); … … 122 123 $(container).find('.spinner-wrap').remove(); 123 124 $('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 }); 124 153 } 125 154 }; … … 201 230 $(el).val(select2values[$(el).attr('name')]).trigger("change"); 202 231 }); 203 232 204 233 // Init Datepicker 205 234 $cloned.find('.hqt-form-control.__datetime').each(function (i, el) { -
hqtheme-extra/tags/1.0.4/inc/hqlib/hqlib.php
r2400862 r2404450 53 53 add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']); 54 54 add_action('wp_ajax_hqlib_select2', ['\HQLib\Helper', 'ajax_search']); 55 add_action('wp_ajax_hqlib_save_options', ['\HQLib\Options', 'save_options']); 55 56 add_filter('admin_footer_text', [$this, 'admin_footer_text'], 999); 56 57 } -
hqtheme-extra/tags/1.0.4/inc/hqlib/license.php
r2400862 r2404450 132 132 } 133 133 134 public static function license_ page() {134 public static function license_container() { 135 135 $is_activated = self::is_activated(); 136 136 … … 140 140 ->add_attribute('disabled', $is_activated ? true : false) 141 141 ->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'); 143 143 144 144 $fields[] = $license_field; … … 147 147 ->set_html(self::license_info_box()); 148 148 149 $container = \HQLib\Options\Container::mk('license', _x('License', 'license page', 'hqtheme-extra'), false)149 $container = \HQLib\Options\Container::mk('license', '', false) 150 150 //->disable_title() 151 151 ->add_field($fields) … … 156 156 'class' => 'btn-primary' . ($is_activated ? ' hidden' : ''), 157 157 'name' => 'activate', 158 'label' => _x(' Save License Key', 'license page', 'hqtheme-extra'),158 'label' => _x('Use License Key', 'license page', 'hqtheme-extra'), 159 159 ], 160 160 'deactivate' => [ … … 181 181 wp_localize_script('hqlib-license', 'hqLicenseData', $data); 182 182 183 //add_action('hqt_container_license_after', '\HQLib\License::license_page_after');184 185 183 return $container; 186 184 } … … 207 205 <div class="hqt-row"> 208 206 <div class="hqt-col-1-1"> 207 209 208 <?php 210 209 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&plugin=marmot-enhancer-pro/marmot-enhancer-pro.php&plugin_status=all&paged=1&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 236 217 } else { 237 218 // Get license button … … 251 232 ob_start(); 252 233 ?> 253 <p class="mt-0 mb-2"><?php _ex('With <b>Marmot enhancerPRO</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> 254 235 <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> 256 237 <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 Popupfor 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> 258 239 <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> 260 241 <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> 263 244 </ul> 264 245 <?php -
hqtheme-extra/tags/1.0.4/inc/hqlib/options.php
r2387081 r2404450 15 15 } 16 16 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); ?>"> 19 20 <?php if ($container->is_submitable()) : ?> 20 <form method="post">21 <form class="hqt-form" method="post"> 21 22 <?php 22 23 wp_nonce_field(\HQLib\HQLIB_PREFIX . 'options_nonce', 'hqt_options_nonce'); -
hqtheme-extra/tags/1.0.4/readme.txt
r2400862 r2404450 56 56 * Remove theme recommendation 57 57 58 = 1.0.2 - 2020-09-30 =58 = 1.0.2 - 2020-09-30 = 59 59 * Filesystem class added in library 60 60 * get_terms_objects and get_terms_for_options added in library 61 61 62 = 1.0.3 - 2020-10-01 =62 = 1.0.3 - 2020-10-01 = 63 63 * Added Elementor plugin dependency 64 64 * 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 5 5 * 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 6 6 * Description: HQTheme Extra adds extras for Marmot Theme - Ready sites one click import 7 * Version: 1.0. 37 * Version: 1.0.4 8 8 * Requires at least: 5.3 9 9 * Requires PHP: 7.2 … … 57 57 * @var string 58 58 */ 59 const VERSION = '1.0. 3';59 const VERSION = '1.0.4'; 60 60 61 61 // Load Autoloader … … 235 235 wp_safe_redirect(admin_url('themes.php?page=marmot')); 236 236 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')) { 238 240 // Redirect to widget dashboard if HQ Widgets plugin is installed 239 241 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 34 34 <# if ( data.pro && !data.has_active_license ) { #> 35 35 <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> 37 37 <# } else { #> 38 38 <p> … … 119 119 </div> 120 120 <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> 122 122 <div id="theme-install-result" style="display: none;"> 123 123 <div class="inner"> -
hqtheme-extra/trunk/inc/dependencies.php
r2400862 r2404450 24 24 'name' => 'Elementor', 25 25 'file' => 'elementor/elementor.php', 26 'constant' => '', 27 'action' => 'elementor/loaded', 26 'constant' => '\ELEMENTOR_VERSION', 28 27 'required' => false, 29 28 'dismiss' => false, … … 43 42 $this->currnet_plugin_name = $currnet_plugin_name; 44 43 $this->check_plugins(); 45 44 46 45 // TODO: Remove after theme approval 47 46 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')) { 49 48 if ($requires_hqtheme) { 50 49 $this->is_dependencies_met = false; … … 56 55 $required_recommended = 'recommends'; 57 56 } 58 if ( $this->is_theme_installed()) {57 if (self::is_theme_installed()) { 59 58 $message = '<h3>' . $this->currnet_plugin_name . ' ' . $required_recommended . ' Marmot theme</h3>' 60 59 . '<ol>' … … 88 87 } 89 88 90 public function is_theme_installed() {89 public static function is_theme_installed() { 91 90 foreach ((array) wp_get_themes() as $theme_dir => $theme) { 92 91 if ('Marmot' === $theme->name || 'Marmot' === $theme->parent_theme) { … … 97 96 } 98 97 99 public function is_theme_active() {98 public static function is_theme_active() { 100 99 $theme = wp_get_theme(); 101 100 … … 112 111 public function check_plugins() { 113 112 foreach (static::$plugins as $plugin_name => $plugin_data) { 114 if (! $this->is_plugin_active($plugin_data)) {113 if (!defined($plugin_data['constant'])) { 115 114 $type = ''; 116 115 if ($plugin_data['required']) { … … 149 148 } 150 149 // 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']); 152 151 } 153 152 } … … 155 154 } 156 155 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 168 156 } -
hqtheme-extra/trunk/inc/hqlib/assets/css/style.css
r2400862 r2404450 966 966 .d-flex {display: flex;} 967 967 .d-block {display: block;} 968 .d-iblock {display: inline-block;} 968 969 .flex {flex: 1;} 969 970 .flex-basis-100 {flex-basis: 100%;} … … 1206 1207 min-width: 1px 1207 1208 } 1208 1209 .hqt-hidden { 1210 display: none; 1211 } 1212 .hqt-visible { 1213 display: block; 1214 } 1209 1215 @media (min-width:640px) { 1210 1216 .hqt-col-1-1__sm { … … 1266 1272 min-width: 1px 1267 1273 } 1274 .hqt-hidden__sm { 1275 display: none; 1276 } 1277 .hqt-visible__sm { 1278 display: block; 1279 } 1268 1280 } 1269 1281 … … 1327 1339 min-width: 1px 1328 1340 } 1341 .hqt-hidden__md { 1342 display: none; 1343 } 1344 .hqt-visible__md { 1345 display: block; 1346 } 1329 1347 } 1330 1348 … … 1388 1406 min-width: 1px 1389 1407 } 1408 .hqt-hidden__lg { 1409 display: none; 1410 } 1411 .hqt-visible__lg { 1412 display: block; 1413 } 1390 1414 } 1391 1415 … … 1449 1473 min-width: 1px 1450 1474 } 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 10 10 HQLib.initFieldsConditionalLogic(); 11 11 HQLib.initRepeater(); 12 //HQLib.initAjaxSubmit(); 12 13 $(document).on('hqlib/container/loader/show', HQLib.showLoader); 13 14 $(document).on('hqlib/container/loader/hide', HQLib.hideLoader); … … 122 123 $(container).find('.spinner-wrap').remove(); 123 124 $('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 }); 124 153 } 125 154 }; … … 201 230 $(el).val(select2values[$(el).attr('name')]).trigger("change"); 202 231 }); 203 232 204 233 // Init Datepicker 205 234 $cloned.find('.hqt-form-control.__datetime').each(function (i, el) { -
hqtheme-extra/trunk/inc/hqlib/hqlib.php
r2400862 r2404450 53 53 add_action('admin_enqueue_scripts', [$this, 'admin_enqueue_scripts']); 54 54 add_action('wp_ajax_hqlib_select2', ['\HQLib\Helper', 'ajax_search']); 55 add_action('wp_ajax_hqlib_save_options', ['\HQLib\Options', 'save_options']); 55 56 add_filter('admin_footer_text', [$this, 'admin_footer_text'], 999); 56 57 } -
hqtheme-extra/trunk/inc/hqlib/license.php
r2400862 r2404450 132 132 } 133 133 134 public static function license_ page() {134 public static function license_container() { 135 135 $is_activated = self::is_activated(); 136 136 … … 140 140 ->add_attribute('disabled', $is_activated ? true : false) 141 141 ->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'); 143 143 144 144 $fields[] = $license_field; … … 147 147 ->set_html(self::license_info_box()); 148 148 149 $container = \HQLib\Options\Container::mk('license', _x('License', 'license page', 'hqtheme-extra'), false)149 $container = \HQLib\Options\Container::mk('license', '', false) 150 150 //->disable_title() 151 151 ->add_field($fields) … … 156 156 'class' => 'btn-primary' . ($is_activated ? ' hidden' : ''), 157 157 'name' => 'activate', 158 'label' => _x(' Save License Key', 'license page', 'hqtheme-extra'),158 'label' => _x('Use License Key', 'license page', 'hqtheme-extra'), 159 159 ], 160 160 'deactivate' => [ … … 181 181 wp_localize_script('hqlib-license', 'hqLicenseData', $data); 182 182 183 //add_action('hqt_container_license_after', '\HQLib\License::license_page_after');184 185 183 return $container; 186 184 } … … 207 205 <div class="hqt-row"> 208 206 <div class="hqt-col-1-1"> 207 209 208 <?php 210 209 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&plugin=marmot-enhancer-pro/marmot-enhancer-pro.php&plugin_status=all&paged=1&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 236 217 } else { 237 218 // Get license button … … 251 232 ob_start(); 252 233 ?> 253 <p class="mt-0 mb-2"><?php _ex('With <b>Marmot enhancerPRO</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> 254 235 <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> 256 237 <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 Popupfor 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> 258 239 <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> 260 241 <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> 263 244 </ul> 264 245 <?php -
hqtheme-extra/trunk/inc/hqlib/options.php
r2387081 r2404450 15 15 } 16 16 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); ?>"> 19 20 <?php if ($container->is_submitable()) : ?> 20 <form method="post">21 <form class="hqt-form" method="post"> 21 22 <?php 22 23 wp_nonce_field(\HQLib\HQLIB_PREFIX . 'options_nonce', 'hqt_options_nonce'); -
hqtheme-extra/trunk/readme.txt
r2400862 r2404450 56 56 * Remove theme recommendation 57 57 58 = 1.0.2 - 2020-09-30 =58 = 1.0.2 - 2020-09-30 = 59 59 * Filesystem class added in library 60 60 * get_terms_objects and get_terms_for_options added in library 61 61 62 = 1.0.3 - 2020-10-01 =62 = 1.0.3 - 2020-10-01 = 63 63 * Added Elementor plugin dependency 64 64 * 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.