first commit
This commit is contained in:
79
wp-content/plugins/ht-contactform/include/class/Api.php
Normal file
79
wp-content/plugins/ht-contactform/include/class/Api.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace HtContactForm\Block\Api;
|
||||
|
||||
use Exception;
|
||||
use WP_REST_Server;
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load general WP action hook
|
||||
*/
|
||||
class Api {
|
||||
|
||||
// Declare the property $namespace.
|
||||
private $namespace;
|
||||
|
||||
/**
|
||||
* The Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->namespace = 'htcontactform/v1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Resgister routes
|
||||
*/
|
||||
public function register_routes() {
|
||||
|
||||
register_rest_route( $this->namespace, 'posts',
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'args' => [
|
||||
'wpnonce' => []
|
||||
],
|
||||
'callback' => [ $this, 'get_contactform_post' ],
|
||||
'permission_callback' => [ $this, 'permission_check' ],
|
||||
]
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Api permission check
|
||||
*/
|
||||
public function permission_check() {
|
||||
if( current_user_can( 'edit_posts' ) ){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get category data
|
||||
*/
|
||||
public function get_contactform_post( $request ){
|
||||
|
||||
if ( !wp_verify_nonce( $_REQUEST['wpnonce'], 'htcontactform-nonce') ){
|
||||
return rest_ensure_response([]);
|
||||
}
|
||||
|
||||
$formlist = array();
|
||||
$forms_args = array( 'posts_per_page' => -1, 'post_type'=> 'wpcf7_contact_form' );
|
||||
$forms = get_posts( $forms_args );
|
||||
if( $forms ){
|
||||
foreach ( $forms as $form ){
|
||||
$formlist[$form->ID] = $form->post_title;
|
||||
}
|
||||
}else{
|
||||
$formlist['0'] = __('Form not found','ht-contactform');
|
||||
}
|
||||
return rest_ensure_response( $formlist );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
141
wp-content/plugins/ht-contactform/include/dashboard.php
Normal file
141
wp-content/plugins/ht-contactform/include/dashboard.php
Normal file
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/* Active / Install Button Manager */
|
||||
function htcontactform_plugin_button( $location, $slug ){
|
||||
|
||||
if( htcontactform_is_plugins_active( $location ) ) {
|
||||
if( ! current_user_can( 'activate_plugins' ) ) { return; }
|
||||
|
||||
$activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $location . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $location );
|
||||
|
||||
$button = sprintf( '<a href="%s" class="htcontact-form-btn">%s</a>', $activation_url, __( 'Activate Now', 'ht-contactform' ) );
|
||||
|
||||
$button = sprintf( '<a href="%s" class="htcontact-form-btn"><span class="htcontact-form-btn-text">%s</span><span class="htcontact-form-btn-icon">%s</span></a>', $activation_url, __( 'Enable These Features', 'ht-contactform' ), '<img src="'.HTCONTACTFORM_PL_URL.'assets/images/icon/plus.png" alt="'.esc_attr__('Enable These Features','ht-contactform').'">' );
|
||||
|
||||
} else {
|
||||
if ( ! current_user_can( 'install_plugins' ) ) { return; }
|
||||
$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin='.$slug ), 'install-plugin_'.$slug );
|
||||
|
||||
$button = sprintf( '<a href="%s" class="htcontact-form-btn"><span class="htcontact-form-btn-text">%s</span><span class="htcontact-form-btn-icon">%s</span></a>', $install_url, __( 'Enable These Features', 'ht-contactform' ), '<img src="'.HTCONTACTFORM_PL_URL.'assets/images/icon/plus.png" alt="'.esc_attr__('Enable These Features','ht-contactform').'">' );
|
||||
|
||||
}
|
||||
return $button;
|
||||
|
||||
}
|
||||
|
||||
/*Add Menu*/
|
||||
function htcontactform_add_menu(){
|
||||
global $submenu;
|
||||
|
||||
$menu_parent_hook = add_menu_page(
|
||||
esc_html__( 'HT Contact Form', 'ht-contactform' ),
|
||||
esc_html__( 'HT Contact Form', 'ht-contactform' ),
|
||||
'manage_options',
|
||||
'htcontact-form',
|
||||
'htcontactform_dashboard',
|
||||
'dashicons-email-alt',
|
||||
30
|
||||
);
|
||||
|
||||
add_action( 'load-' . $menu_parent_hook, 'htcontactform_init_hooks' );
|
||||
|
||||
}
|
||||
add_action( 'admin_menu', 'htcontactform_add_menu', 20 );
|
||||
|
||||
/* Menu Hook */
|
||||
function htcontactform_init_hooks() {
|
||||
add_action( 'admin_enqueue_scripts', 'htcontactform_enqueue_scripts' );
|
||||
}
|
||||
|
||||
/* Load Assets*/
|
||||
function htcontactform_enqueue_scripts() {
|
||||
wp_enqueue_style( 'htcontact-form-admin', HTCONTACTFORM_PL_URL.'assets/css/htcontact-form-admin.css', array(), '1.0.0' );
|
||||
|
||||
// Hide All Admin Notices
|
||||
echo '<style>.update-nag, .updated, .error, .is-dismissible { display: none; }</style>';
|
||||
|
||||
}
|
||||
|
||||
/* Extension Features HTML */
|
||||
function htcontactform_dashboard(){
|
||||
?>
|
||||
<div class="htcontact-form-setting-area">
|
||||
|
||||
<div class="htcontact-form-features-area">
|
||||
|
||||
<?php if ( ( htcontactform_is_plugins_active( 'extensions-for-cf7/extensions-for-cf7.php' ) && is_plugin_inactive( 'extensions-for-cf7/extensions-for-cf7.php' ) ) || ! htcontactform_is_plugins_active( 'extensions-for-cf7/extensions-for-cf7.php' ) ) : ?>
|
||||
<div class="htcontact-form-free-features">
|
||||
<h2><?php echo esc_html__( 'Enable These Features', 'ht-contactform' ); ?></h2>
|
||||
<div class="htcontact-form-features">
|
||||
|
||||
<h3><?php echo esc_html__('Contact form 7 database','ht-contactform'); ?></h3>
|
||||
<ul class="htcontact-form-feature-list">
|
||||
<li><?php echo esc_html__('Save contact form submission data and handle it through the dashboard.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Export and import CSV files easily.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Search the contact form submissions time and date wise.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Delete Submission Data.','ht-contactform'); ?></li>
|
||||
</ul>
|
||||
|
||||
<h3><?php echo esc_html__('Contact form 7 conditional field','ht-contactform'); ?></h3>
|
||||
<ul class="htcontact-form-feature-list">
|
||||
<li><?php echo esc_html__('Easily apply conditions to any field to show or hide.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Add multiple AND conditions.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Easily apply conditions with the exact value.','ht-contactform'); ?></li>
|
||||
</ul>
|
||||
|
||||
<h3><?php echo esc_html__('Contact form 7 redirection','ht-contactform'); ?></h3>
|
||||
<ul class="htcontact-form-feature-list">
|
||||
<li><?php echo esc_html__('Easily redirect to any page after form submission.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Redirect the page to a new tab.','ht-contactform'); ?></li>
|
||||
<li><?php echo esc_html__('Add specific JavaScript action.','ht-contactform'); ?></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<?php echo htcontactform_plugin_button( 'extensions-for-cf7/extensions-for-cf7.php', 'extensions-for-cf7' ); ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="htcontact-form-free-features">
|
||||
<h2><?php echo esc_html__( 'Purchase CF7 Pro Extensions', 'ht-contactform' ); ?></h2>
|
||||
<div class="htcontact-form-features">
|
||||
<ul class="htcontact-form-feature-list">
|
||||
<li><?php echo esc_html__( 'Already Submitted Notice', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Repeater Field', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Popup Form Response', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Advanced Telephone', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Acceptance Field', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Drag & Drop File Upload', 'ht-contactform' ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a class="htcontact-form-btn" href="<?php echo esc_url('https://hasthemes.com/plugins/cf7-extensions/?utm_source=htcontactform&utm_medium=htcf7dashboard&utm_campaign=extension');?>" target="_blank">
|
||||
<span class="htcontact-form-btn-text"><?php echo esc_html__('Get Pro Now','ht-contactform'); ?></span>
|
||||
<span class="htcontact-form-btn-icon"><img src="<?php echo HTCONTACTFORM_PL_URL ?>assets/images/icon/plus.png" alt="<?php echo esc_attr__('Get Pro Now','ht-contactform'); ?>"></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="htcontact-form-pro-features">
|
||||
<h2><?php echo esc_html__( 'Purchase CF7 Pro Extensions', 'ht-contactform' ); ?></h2>
|
||||
<div class="htcontact-form-features">
|
||||
<ul class="htcontact-form-feature-list">
|
||||
<li><?php echo esc_html__( 'Already Submitted Notice', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Repeater Field', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Popup Form Response', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Advanced Telephone', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Acceptance Field', 'ht-contactform' ); ?></li>
|
||||
<li><?php echo esc_html__( 'Drag & Drop File Upload', 'ht-contactform' ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="htcontact-form-action-btn">
|
||||
<a class="htcontact-form-btn" href="<?php echo esc_url('https://hasthemes.com/plugins/cf7-extensions/?utm_source=htcontactform&utm_medium=htcf7dashboard&utm_campaign=extension');?>" target="_blank">
|
||||
<span class="htcontact-form-btn-text"><?php echo esc_html__('Get Pro Now','ht-contactform'); ?></span>
|
||||
<span class="htcontact-form-btn-icon"><img src="<?php echo HTCONTACTFORM_PL_URL ?>assets/images/icon/white-plus.png" alt="<?php echo esc_attr__('Get Pro Now','ht-contactform'); ?>"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
715
wp-content/plugins/ht-contactform/include/elementor_widgets.php
Normal file
715
wp-content/plugins/ht-contactform/include/elementor_widgets.php
Normal file
@@ -0,0 +1,715 @@
|
||||
<?php
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class HTContactForm_Elementor_Widget extends Widget_Base {
|
||||
|
||||
public function get_name() {
|
||||
return 'htcontactform-addons';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return __( 'HT Contact Form 7', 'ht-contactform' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eicon-mail';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'general' ];
|
||||
}
|
||||
|
||||
public function htcontactform_forms(){
|
||||
$formlist = array();
|
||||
$forms_args = array( 'posts_per_page' => -1, 'post_type'=> 'wpcf7_contact_form' );
|
||||
$forms = get_posts( $forms_args );
|
||||
if( $forms ){
|
||||
foreach ( $forms as $form ){
|
||||
$formlist[$form->ID] = $form->post_title;
|
||||
}
|
||||
}else{
|
||||
$formlist['0'] = __('Form not found','ht-contactform');
|
||||
}
|
||||
return $formlist;
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
$this->start_controls_section(
|
||||
'contactform_content',
|
||||
[
|
||||
'label' => __( 'Contact Form', 'ht-contactform' ),
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'contact_form_id',
|
||||
[
|
||||
'label' => __( 'Select Form', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => true,
|
||||
'options' => $this->htcontactform_forms(),
|
||||
'default' => '0',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Style tab section
|
||||
$this->start_controls_section(
|
||||
'contactform_form_section_style',
|
||||
[
|
||||
'label' => __( 'Style', 'ht-contactform' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_form_section_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_form_section_margin',
|
||||
[
|
||||
'label' => __( 'Margin', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'contactform_form_section_background',
|
||||
'label' => __( 'Background', 'ht-contactform' ),
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'selector' => '{{WRAPPER}} .htcontact-form-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_form_section_align',
|
||||
[
|
||||
'label' => __( 'Alignment', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => __( 'Left', 'ht-contactform' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => __( 'Center', 'ht-contactform' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => __( 'Right', 'ht-contactform' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'justify' => [
|
||||
'title' => __( 'Justified', 'ht-contactform' ),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
'default' => 'left',
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
// Input Field style tab start
|
||||
$this->start_controls_section(
|
||||
'contactform_contactform_input_style',
|
||||
[
|
||||
'label' => __( 'Input', 'ht-contactform' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'contactform_input_box_height',
|
||||
[
|
||||
'label' => __( 'Height', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 55,
|
||||
],
|
||||
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]' => 'height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]' => 'height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]' => 'height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]' => 'height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]' => 'height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]' => 'height: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_input_box_background',
|
||||
[
|
||||
'label' => __( 'Background Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]' => 'background-color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'contactform_input_box_typography',
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_input_box_text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_input_box_placeholder_color',
|
||||
[
|
||||
'label' => __( 'Placeholder Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'contactform_input_box_border',
|
||||
'label' => __( 'Border', 'ht-contactform' ),
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"], {{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_input_box_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_input_box_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_input_box_margin',
|
||||
[
|
||||
'label' => __( 'Margin', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="text"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="email"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="url"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="number"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="tel"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap input[type*="date"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap .wpcf7-select' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section(); // Input Field style tab end
|
||||
|
||||
// Textarea style tab start
|
||||
$this->start_controls_section(
|
||||
'contactform_textarea_style',
|
||||
[
|
||||
'label' => __( 'Textarea', 'ht-contactform' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->add_control(
|
||||
'contactform_textarea_box_height',
|
||||
[
|
||||
'label' => __( 'Height', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 175,
|
||||
],
|
||||
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_textarea_box_background',
|
||||
[
|
||||
'label' => __( 'Background Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'contactform_textarea_box_typography',
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_textarea_box_text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_textarea_box_placeholder_color',
|
||||
[
|
||||
'label' => __( 'Placeholder Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea::-webkit-input-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea::-moz-placeholder' => 'color: {{VALUE}};',
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea:-ms-input-placeholder' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'contactform_textarea_box_border',
|
||||
'label' => __( 'Border', 'ht-contactform' ),
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_textarea_box_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_textarea_box_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_textarea_box_margin',
|
||||
[
|
||||
'label' => __( 'Margin', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-form-control-wrap textarea' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section(); // Textarea style tab end
|
||||
|
||||
// Label style tab start
|
||||
$this->start_controls_section(
|
||||
'contactform_contactform_label_style',
|
||||
[
|
||||
'label' => __( 'Label', 'ht-contactform' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_label_background',
|
||||
[
|
||||
'label' => __( 'Background Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'contactform_label_text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'contactform_label_typography',
|
||||
'selector' => '{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'contactform_label_border',
|
||||
'label' => __( 'Border', 'ht-contactform' ),
|
||||
'selector' => '{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_label_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_label_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'contactform_label_margin',
|
||||
[
|
||||
'label' => __( 'Margin', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .htcontact-form-wrapper form.wpcf7-form label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_section(); // // Label style tab end
|
||||
|
||||
// Input submit button style tab start
|
||||
$this->start_controls_section(
|
||||
'contactform_inputsubmit_style',
|
||||
[
|
||||
'label' => __( 'Button', 'ht-contactform' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
$this->start_controls_tabs('submit_style_tabs');
|
||||
|
||||
// Button Normal tab start
|
||||
$this->start_controls_tab(
|
||||
'submit_style_normal_tab',
|
||||
[
|
||||
'label' => __( 'Normal', 'ht-contactform' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'input_submit_height',
|
||||
[
|
||||
'label' => __( 'Height', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 55,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit' => 'height: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'input_submit_typography',
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-submit',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'input_submit_text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'input_submit_background_color',
|
||||
[
|
||||
'label' => __( 'Background Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'input_submit_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'input_submit_margin',
|
||||
[
|
||||
'label' => __( 'Margin', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'input_submit_border',
|
||||
'label' => __( 'Border', 'ht-contactform' ),
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-submit',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_responsive_control(
|
||||
'input_submit_border_radius',
|
||||
[
|
||||
'label' => __( 'Border Radius', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
|
||||
],
|
||||
'separator' =>'before',
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'htmega_input_submit_box_shadow',
|
||||
'label' => __( 'Box Shadow', 'ht-contactform' ),
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-submit',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab(); // Button Normal tab end
|
||||
|
||||
// Button Hover tab start
|
||||
$this->start_controls_tab(
|
||||
'submit_style_hover_tab',
|
||||
[
|
||||
'label' => __( 'Hover', 'ht-contactform' ),
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'input_submithover_text_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit:hover' => 'color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'input_submithover_background_color',
|
||||
[
|
||||
'label' => __( 'Background Color', 'ht-contactform' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .wpcf7-form .wpcf7-submit:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'input_submithover_border',
|
||||
'label' => __( 'Border', 'ht-contactform' ),
|
||||
'selector' => '{{WRAPPER}} .wpcf7-form .wpcf7-submit:hover',
|
||||
]
|
||||
);
|
||||
|
||||
$this->end_controls_tab(); // Button Hover tab end
|
||||
|
||||
$this->end_controls_tabs();
|
||||
|
||||
$this->end_controls_section(); // Input submit button style tab end
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function render( $instance = [] ) {
|
||||
|
||||
$settings = $this->get_settings_for_display();
|
||||
$id = $this->get_id();
|
||||
|
||||
$this->add_render_attribute( 'htwpform_attr', 'class', 'htcontact-form-wrapper' );
|
||||
|
||||
$this->add_render_attribute( 'shortcode', 'id', $settings['contact_form_id'] );
|
||||
$shortcode = sprintf( '[contact-form-7 %s]', $this->get_render_attribute_string( 'shortcode' ) );
|
||||
|
||||
?>
|
||||
<div <?php echo $this->get_render_attribute_string('htwpform_attr'); ?> >
|
||||
<?php
|
||||
if( !empty( $settings['contact_form_id'] ) ){
|
||||
echo do_shortcode( $shortcode );
|
||||
}else{
|
||||
echo '<div class="form_no_select">' .__('Please Select contact form.','ht-contactform'). '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register_widget_type( new HTContactForm_Elementor_Widget() );
|
||||
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
* Plugins Install manager JS
|
||||
*/
|
||||
;( function ( $ ) {
|
||||
'use strict';
|
||||
|
||||
// Tab Menu
|
||||
$(".htrp-admin-tabs").on('click', 'a', function(e){
|
||||
e.preventDefault();
|
||||
var $this = $(this),
|
||||
$target = $this.attr('href');
|
||||
|
||||
$this.addClass('htrp-active').parent().siblings().children('a').removeClass('htrp-active');
|
||||
$( '.htrp-admin-tab-pane'+ $target ).addClass('htrp-active').siblings().removeClass('htrp-active');
|
||||
});
|
||||
|
||||
/*
|
||||
* Plugin Installation Manager
|
||||
*/
|
||||
var PluginInstallManager = {
|
||||
|
||||
init: function(){
|
||||
$( document ).on('click','.install-now', PluginInstallManager.installNow );
|
||||
$( document ).on('click','.activate-now', PluginInstallManager.activatePlugin);
|
||||
$( document ).on('wp-plugin-install-success', PluginInstallManager.installingSuccess);
|
||||
$( document ).on('wp-plugin-install-error', PluginInstallManager.installingError);
|
||||
$( document ).on('wp-plugin-installing', PluginInstallManager.installingProcess);
|
||||
},
|
||||
|
||||
/**
|
||||
* Installation Error.
|
||||
*/
|
||||
installingError: function( e, response ) {
|
||||
e.preventDefault();
|
||||
var $card = $( '.htrp-plugin-' + response.slug );
|
||||
$button = $card.find( '.button' );
|
||||
$button.removeClass( 'button-primary' ).addClass( 'disabled' ).html( wp.updates.l10n.installFailedShort );
|
||||
},
|
||||
|
||||
/**
|
||||
* Installing Process
|
||||
*/
|
||||
installingProcess: function(e, args){
|
||||
e.preventDefault();
|
||||
var $card = $( '.htrp-plugin-' + args.slug ),
|
||||
$button = $card.find( '.button' );
|
||||
$button.text( htrp_params.buttontxt.installing ).addClass( 'updating-message' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Plugin Install Now
|
||||
*/
|
||||
installNow: function(e){
|
||||
e.preventDefault();
|
||||
|
||||
var $button = $( e.target ),
|
||||
$plugindata = $button.data('pluginopt');
|
||||
|
||||
if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
|
||||
return;
|
||||
}
|
||||
if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
|
||||
wp.updates.requestFilesystemCredentials( e );
|
||||
$( document ).on( 'credential-modal-cancel', function() {
|
||||
var $message = $( '.install-now.updating-message' );
|
||||
$message.removeClass( 'updating-message' ).text( wp.updates.l10n.installNow );
|
||||
wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
|
||||
});
|
||||
}
|
||||
wp.updates.installPlugin( {
|
||||
slug: $plugindata['slug']
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* After Plugin Install success
|
||||
*/
|
||||
installingSuccess: function( e, response ) {
|
||||
var $message = $( '.htrp-plugin-' + response.slug ).find( '.button' );
|
||||
|
||||
var $plugindata = $message.data('pluginopt');
|
||||
|
||||
$message.removeClass( 'install-now installed button-disabled updated-message' )
|
||||
.addClass( 'updating-message' )
|
||||
.html( htrp_params.buttontxt.activating );
|
||||
|
||||
setTimeout( function() {
|
||||
$.ajax( {
|
||||
url: htrp_params.ajaxurl,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action : htrp_params.text_domain+'_ajax_plugin_activation',
|
||||
location : $plugindata['location'],
|
||||
},
|
||||
} ).done( function( result ) {
|
||||
if ( result.success ) {
|
||||
$message.removeClass( 'button-primary install-now activate-now updating-message' )
|
||||
.attr( 'disabled', 'disabled' )
|
||||
.addClass( 'disabled' )
|
||||
.text( htrp_params.buttontxt.active );
|
||||
|
||||
} else {
|
||||
$message.removeClass( 'updating-message' );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}, 1200 );
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Plugin Activate
|
||||
*/
|
||||
activatePlugin: function( e, response ) {
|
||||
e.preventDefault();
|
||||
|
||||
var $button = $( e.target ),
|
||||
$plugindata = $button.data('pluginopt');
|
||||
|
||||
if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$button.addClass( 'updating-message button-primary' ).html( htrp_params.buttontxt.activating );
|
||||
|
||||
$.ajax( {
|
||||
url: htrp_params.ajaxurl,
|
||||
type: 'POST',
|
||||
data: {
|
||||
action : htrp_params.text_domain+'_ajax_plugin_activation',
|
||||
location : $plugindata['location'],
|
||||
},
|
||||
}).done( function( response ) {
|
||||
if ( response.success ) {
|
||||
$button.removeClass( 'button-primary install-now activate-now updating-message' )
|
||||
.attr( 'disabled', 'disabled' )
|
||||
.addClass( 'disabled' )
|
||||
.text( htrp_params.buttontxt.active );
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize PluginInstallManager
|
||||
*/
|
||||
$( document ).ready( function() {
|
||||
PluginInstallManager.init();
|
||||
});
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,440 @@
|
||||
<?php
|
||||
namespace Hasthemes\HTContact_Form;
|
||||
|
||||
/**
|
||||
* Recommended Plugins handlers class
|
||||
* @version 1.0.2
|
||||
*/
|
||||
class Recommended_Plugins {
|
||||
|
||||
/**
|
||||
* [$_instance]
|
||||
* @var null
|
||||
*/
|
||||
private static $_instance = null;
|
||||
|
||||
/**
|
||||
* [$plugins_allowedtags] allow tag
|
||||
* @var array
|
||||
*/
|
||||
public $plugins_allowedtags = array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'title' => array(),
|
||||
'target' => array(),
|
||||
),
|
||||
'abbr' => array( 'title' => array() ),
|
||||
'acronym' => array( 'title' => array() ),
|
||||
'code' => array(),
|
||||
'pre' => array(),
|
||||
'em' => array(),
|
||||
'strong' => array(),
|
||||
'ul' => array(),
|
||||
'ol' => array(),
|
||||
'li' => array(),
|
||||
'p' => array(),
|
||||
'br' => array(),
|
||||
);
|
||||
|
||||
/**
|
||||
* Veriable Initialize
|
||||
*/
|
||||
public $text_domain = '';
|
||||
public $parent_menu_slug = '';
|
||||
public $menu_label = '';
|
||||
public $menu_page_slug = '';
|
||||
public $menu_capability = '';
|
||||
public $menu_type = '';
|
||||
public $menu_icon = '';
|
||||
public $priority = '';
|
||||
public $hook_suffix = '';
|
||||
public $assets_url = '';
|
||||
public $tab_list = [];
|
||||
|
||||
/**
|
||||
* [instance] Initializes a singleton instance
|
||||
* @return [Recommended_Plugins]
|
||||
*/
|
||||
public static function instance( $args = [] ) {
|
||||
if ( is_null( self::$_instance ) ) {
|
||||
self::$_instance = new self( $args );
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* [__construct] Class construct
|
||||
*/
|
||||
function __construct( $args ) {
|
||||
|
||||
// Initialize properties
|
||||
$this->text_domain = !empty( $args['text_domain'] ) ? $args['text_domain'] : 'htrp';
|
||||
$this->parent_menu_slug = !empty( $args['parent_menu_slug'] ) ? $args['parent_menu_slug'] : 'plugins.php';
|
||||
$this->menu_type = !empty( $args['menu_type'] ) ? $args['menu_type'] : 'submenu';
|
||||
$this->menu_icon = !empty( $args['menu_icon'] ) ? $args['menu_icon'] : 'dashicons-plugins-checked';
|
||||
$this->menu_label = !empty( $args['menu_label'] ) ? $args['menu_label'] : esc_html__( 'Recommendations', $this->text_domain );
|
||||
$this->menu_capability = !empty( $args['menu_capability'] ) ? $args['menu_capability'] : 'manage_options';
|
||||
$this->menu_page_slug = !empty( $args['menu_page_slug'] ) ? $args['menu_page_slug'] : $this->text_domain . '_extensions';
|
||||
$this->priority = !empty( $args['priority'] ) ? $args['priority'] : 100;
|
||||
$this->hook_suffix = !empty( $args['hook_suffix'] ) ? $args['hook_suffix'] : '';
|
||||
$this->assets_url = !empty( $args['assets_url'] ) ? $args['assets_url'] : plugins_url( 'assets', __FILE__ );
|
||||
$this->tab_list = !empty( $args['tab_list'] ) ? $args['assets_url'] : [];
|
||||
|
||||
|
||||
add_action( 'admin_menu', [ $this, 'admin_menu' ], 20 );
|
||||
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
||||
|
||||
// Ajax Action
|
||||
add_action( 'wp_ajax_'.$this->text_domain.'_ajax_plugin_activation', [ $this, 'plugin_activation' ] );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [admin_menu] Add Recommended Menu
|
||||
* @return [void]
|
||||
*/
|
||||
public function admin_menu(){
|
||||
|
||||
if( $this->menu_type === 'submenu' ){
|
||||
add_submenu_page(
|
||||
$this->parent_menu_slug,
|
||||
$this->menu_label,
|
||||
$this->menu_label,
|
||||
$this->menu_capability,
|
||||
$this->menu_page_slug,
|
||||
[ $this, 'render_html' ]
|
||||
);
|
||||
}else{
|
||||
add_menu_page(
|
||||
$this->menu_label,
|
||||
$this->menu_label,
|
||||
$this->menu_capability,
|
||||
$this->menu_page_slug,
|
||||
[ $this,'render_html' ],
|
||||
$this->menu_icon,
|
||||
30
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [enqueue_assets]
|
||||
* @param [string] $hook_suffix Current page hook
|
||||
* @return [void]
|
||||
*/
|
||||
public function enqueue_assets( $hook_suffix ) {
|
||||
if( $this->hook_suffix ){
|
||||
if( $this->hook_suffix == $hook_suffix ){
|
||||
add_thickbox();
|
||||
wp_enqueue_script( 'htrp-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.1.6', true );
|
||||
}
|
||||
} else {
|
||||
add_thickbox();
|
||||
wp_enqueue_script( 'htrp-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.1.6', true );
|
||||
}
|
||||
|
||||
$localize_vars['ajaxurl'] = admin_url('admin-ajax.php');
|
||||
$localize_vars['text_domain'] = sanitize_title_with_dashes( $this->text_domain );
|
||||
$localize_vars['nonce'] = wp_create_nonce('ht-contactform-nonce');
|
||||
$localize_vars['buttontxt'] = array(
|
||||
'buynow' => esc_html__( 'Buy Now', $this->text_domain ),
|
||||
'preview' => esc_html__( 'Preview', $this->text_domain ),
|
||||
'installing' => esc_html__( 'Installing..', $this->text_domain ),
|
||||
'activating' => esc_html__( 'Activating..', $this->text_domain ),
|
||||
'active' => esc_html__( 'Activated', $this->text_domain ),
|
||||
);
|
||||
wp_localize_script( 'htrp-plugin-install-manager', 'htrp_params', $localize_vars );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [add_new_tab]
|
||||
* @param [void] set tab content
|
||||
*/
|
||||
public function add_new_tab( $tab_list ){
|
||||
$this->tab_list[] = $tab_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* [render_html]
|
||||
* @return [void] Render HTML
|
||||
*/
|
||||
public function render_html(){
|
||||
if ( ! function_exists('plugins_api') ){ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); }
|
||||
|
||||
$htplugins_plugin_list = $this->get_plugins();
|
||||
$palscode_plugin_list = $this->get_plugins( 'palscode' );
|
||||
|
||||
$plugin_list = array_merge( $htplugins_plugin_list, $palscode_plugin_list );
|
||||
|
||||
$prepare_plugin = array();
|
||||
foreach ( $plugin_list as $plugin_key => $plugin ) {
|
||||
$prepare_plugin[$plugin['slug']] = $plugin;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php echo get_admin_page_title(); ?></h2>
|
||||
<style>
|
||||
.htrp-admin-tab-pane{
|
||||
display: none;
|
||||
}
|
||||
.htrp-admin-tab-pane.htrp-active{
|
||||
display: block;
|
||||
}
|
||||
.htrp-extension-admin-tab-area .filter-links li>a:focus, .htrp-extension-admin-tab-area .filter-links li>a:hover {
|
||||
color: inherit;
|
||||
box-shadow: none;
|
||||
}
|
||||
.filter-links .htrp-active{
|
||||
box-shadow: none;
|
||||
border-bottom: 4px solid #646970;
|
||||
color: #1d2327;
|
||||
}
|
||||
.downloaded-count{
|
||||
display: block;
|
||||
margin-top:5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="htrp-extension-admin-tab-area wp-filter">
|
||||
<ul class="htrp-admin-tabs filter-links">
|
||||
<?php
|
||||
foreach( $this->tab_list as $tab ){
|
||||
$active_class = isset( $tab['active'] ) && $tab['active'] ? 'htrp-active' : '';
|
||||
?>
|
||||
<li>
|
||||
<a href="#<?php echo esc_attr( sanitize_title_with_dashes( $tab['title'] ) ) ?>" class="<?php echo esc_attr( $active_class ) ?>"><?php echo esc_html( $tab['title'] ) ?></a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$plugins_type = '';
|
||||
foreach( $this->tab_list as $tab ):
|
||||
|
||||
$active_class = isset( $tab['active'] ) && $tab['active'] ? 'htrp-active' : '';
|
||||
$plugins = $tab['plugins'];
|
||||
|
||||
echo '<div id="'.esc_attr( sanitize_title_with_dashes( $tab['title'] ) ).'" class="htrp-admin-tab-pane '.esc_attr( $active_class ).'">';
|
||||
foreach( $plugins as $plugin ):
|
||||
|
||||
$data = array(
|
||||
'slug' => isset( $plugin['slug'] ) ? $plugin['slug'] : '',
|
||||
'location' => isset( $plugin['location'] ) ? $plugin['slug'].'/'.$plugin['location'] : '',
|
||||
'name' => isset( $plugin['name'] ) ? $plugin['name'] : '',
|
||||
);
|
||||
$title = wp_kses( $plugin['name'], $this->plugins_allowedtags );
|
||||
|
||||
if( array_key_exists( $plugin['slug'], $prepare_plugin ) ){
|
||||
$plugins_type = 'free';
|
||||
$image_url = $this->plugin_icon( $plugins_type, $prepare_plugin[$data['slug']]['icons'] );
|
||||
$description = strip_tags( $prepare_plugin[$data['slug']]['description'] );
|
||||
$author_name = wp_kses( $prepare_plugin[$data['slug']]['author'], $this->plugins_allowedtags );
|
||||
$details_link = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .'&TB_iframe=true&width=772&height=577');
|
||||
$target = '_self';
|
||||
$modal_class = 'class="thickbox open-plugin-details-modal"';
|
||||
|
||||
}else{
|
||||
$plugins_type = 'pro';
|
||||
$image_url = $this->plugin_icon( $plugins_type, $plugin['slug'] );
|
||||
$description = isset( $plugin['description'] ) ? $plugin['description'] : '';
|
||||
$author_name = esc_html__( 'HasTheme', $this->text_domain );
|
||||
$author_link = isset( $plugin['author_link'] ) ? $plugin['author_link'] : '';
|
||||
$details_link = isset( $plugin['link'] ) ? $plugin['link'] : '';
|
||||
$button_text = esc_html__('Buy Now', $this->text_domain );
|
||||
$button_classes = 'button button-primary';
|
||||
$target = '_blank';
|
||||
$modal_class = '';
|
||||
}
|
||||
|
||||
if ( ! is_wp_error( $data ) ):
|
||||
|
||||
// Installed but Inactive.
|
||||
if ( file_exists( WP_PLUGIN_DIR . '/' . $data['location'] ) && is_plugin_inactive( $data['location'] ) ) {
|
||||
|
||||
$button_classes = 'button activate-now button-primary';
|
||||
$button_text = esc_html__( 'Activate', $this->text_domain );
|
||||
|
||||
// Not Installed.
|
||||
} elseif ( ! file_exists( WP_PLUGIN_DIR . '/' . $data['location'] ) ) {
|
||||
|
||||
$button_classes = 'button install-now';
|
||||
$button_text = esc_html__( 'Install Now', $this->text_domain );
|
||||
|
||||
// Active.
|
||||
} else {
|
||||
$button_classes = 'button disabled';
|
||||
$button_text = esc_html__( 'Activated', $this->text_domain );
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="plugin-card htrp-plugin-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
|
||||
<div class="plugin-card-top">
|
||||
<div class="name column-name" style="margin-right: 0;">
|
||||
<h3>
|
||||
<a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>" <?php echo $modal_class; ?>>
|
||||
<?php echo esc_html( $title ) ?>
|
||||
<img src="<?php echo esc_url( $image_url ) ?>" class="plugin-icon" alt="<?php echo esc_attr( $title ) ?>">
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="desc column-description" style="margin-right: 0;">
|
||||
<p><?php echo wp_trim_words( $description, 23, '....'); ?></p>
|
||||
<p class="authors">
|
||||
<cite><?php echo esc_html__( 'By ', $this->text_domain ); ?>
|
||||
<?php if( $plugins_type == 'free' ): ?>
|
||||
<?php echo $author_name; ?>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo esc_url( $author_link ); ?>" target="_blank" ><?php echo $author_name; ?></a>
|
||||
<?php endif; ?>
|
||||
</cite>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="plugin-card-bottom">
|
||||
<div class="column-updated">
|
||||
<?php
|
||||
if (! file_exists( WP_PLUGIN_DIR . '/' . $data['location'] ) && $plugins_type == 'pro' ) {
|
||||
echo '<a class="button button-primary" href="'.esc_url( $details_link ).'" target="'.esc_attr( $target ).'">'.esc_html__( 'Buy Now', $this->text_domain ).'</a>';
|
||||
}else{
|
||||
?>
|
||||
<button class="<?php echo esc_attr($button_classes); ?>" data-pluginopt='<?php echo wp_json_encode( $data ); ?>'><?php echo wp_kses_post( $button_text ); ?></button>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="column-downloaded">
|
||||
<a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>" <?php echo $modal_class; ?>><?php echo esc_html__('More Details', $this->text_domain) ?></a>
|
||||
<span class="downloaded-count">
|
||||
<?php
|
||||
if( $plugins_type == 'free' ){
|
||||
/* translators: %s: Number of installations. */
|
||||
printf( __( '%s Active Installations' ), $this->active_install_count( $prepare_plugin[$data['slug']]['active_installs'] ) );
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
echo '</div>';
|
||||
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [get_plugins] Get plugin from wp.org API
|
||||
* @param string $username wo.org username
|
||||
* @return [array] plugin list
|
||||
*/
|
||||
public function get_plugins( $username = 'htplugins' ){
|
||||
$transient_var = 'htrp_htplugins_list_'.$username;
|
||||
$org_plugins_list = get_transient( $transient_var );
|
||||
|
||||
if ( false === $org_plugins_list ) {
|
||||
$plugins_list_by_author = plugins_api( 'query_plugins', array( 'author' => $username, 'per_page' => 100 ) );
|
||||
set_transient( $transient_var, $plugins_list_by_author->plugins, 1 * WEEK_IN_SECONDS );
|
||||
$org_plugins_list = $plugins_list_by_author->plugins;
|
||||
}
|
||||
|
||||
return $org_plugins_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* [plugin_icon] Generate plugin icon
|
||||
* @param string $type plugin type
|
||||
* @param [array|string] $icon
|
||||
* @return [URL] icon URL
|
||||
*/
|
||||
public function plugin_icon( $type, $icon ){
|
||||
if( $type === 'free' ){
|
||||
if ( ! empty( $icon['svg'] ) ) {
|
||||
$plugin_icon_url = $icon['svg'];
|
||||
} elseif ( ! empty( $icon['2x'] ) ) {
|
||||
$plugin_icon_url = $icon['2x'];
|
||||
} elseif ( ! empty( $icon['1x'] ) ) {
|
||||
$plugin_icon_url = $icon['1x'];
|
||||
} else {
|
||||
$plugin_icon_url = $icon['default'];
|
||||
}
|
||||
}else{
|
||||
$plugin_icon_url = $this->assets_url .'/images/extensions/'.$icon.'.png';
|
||||
}
|
||||
|
||||
return $plugin_icon_url;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [active_install_count] Manage Active install count
|
||||
* @param [int] $active_installs
|
||||
* @return [string]
|
||||
*/
|
||||
public function active_install_count( $active_installs ){
|
||||
|
||||
if ( $active_installs >= 1000000 ) {
|
||||
$active_installs_millions = floor( $active_installs / 1000000 );
|
||||
$active_installs_text = sprintf(
|
||||
/* translators: %s: Number of millions. */
|
||||
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
|
||||
number_format_i18n( $active_installs_millions )
|
||||
);
|
||||
} elseif ( 0 === $active_installs ) {
|
||||
$active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
|
||||
} else {
|
||||
$active_installs_text = number_format_i18n( $active_installs ) . '+';
|
||||
}
|
||||
return $active_installs_text;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* [plugin_activation] Plugin activation ajax callable function
|
||||
* @return [JSON]
|
||||
*/
|
||||
public function plugin_activation() {
|
||||
$nonce = sanitize_text_field($_POST['nonce']);
|
||||
if(wp_verify_nonce($nonce, 'ht-contactform-nonce')) {
|
||||
|
||||
if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['location'] ) || ! sanitize_text_field($_POST['location']) ) {
|
||||
wp_send_json_error(
|
||||
array(
|
||||
'success' => false,
|
||||
'message' => esc_html__( 'Plugin Not Found', $this->text_domain ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$plugin_location = ( isset( $_POST['location'] ) ) ? sanitize_text_field( $_POST['location'] ) : '';
|
||||
$activate = activate_plugin( $plugin_location, '', false, true );
|
||||
|
||||
if ( is_wp_error( $activate ) ) {
|
||||
wp_send_json_error(
|
||||
array(
|
||||
'success' => false,
|
||||
'message' => $activate->get_error_message(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
wp_send_json_success(
|
||||
array(
|
||||
'success' => true,
|
||||
'message' => esc_html__( 'Plugin Successfully Activated', $this->text_domain ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
/**
|
||||
* Constructor Parameters
|
||||
*
|
||||
* @param string $text_domain your plugin text domain.
|
||||
* @param string $parent_menu_slug the menu slug name where the "Recommendations" submenu will appear.
|
||||
* @param string $submenu_label To change the submenu name.
|
||||
* @param string $submenu_page_name an unique page name for the submenu.
|
||||
* @param int $priority Submenu priority adjust.
|
||||
* @param string $hook_suffix use it to load this library assets only to the recommedded plugins page. Not into the whol admin area.
|
||||
*
|
||||
*/
|
||||
|
||||
if( class_exists('Hasthemes\HTContact_Form\Recommended_Plugins') ){
|
||||
$recommendations = new Hasthemes\HTContact_Form\Recommended_Plugins(
|
||||
array(
|
||||
'text_domain' => 'ht-contactform',
|
||||
'parent_menu_slug' => 'htcontact-form',
|
||||
'menu_type' => 'submenu',
|
||||
'menu_icon' => 'dashicons-email-alt',
|
||||
'menu_capability' => 'manage_options',
|
||||
'menu_page_slug' => '',
|
||||
'priority' => 300,
|
||||
'assets_url' => HTCONTACTFORM_PL_URL.'/assets',
|
||||
'hook_suffix' => '',
|
||||
)
|
||||
);
|
||||
|
||||
$recommendations->add_new_tab( array(
|
||||
|
||||
'title' => esc_html__( 'Recommended', 'ht-contactform' ),
|
||||
'active' => true,
|
||||
'plugins' => array(
|
||||
|
||||
array(
|
||||
'slug' => 'woolentor-addons',
|
||||
'location' => 'woolentor_addons_elementor.php',
|
||||
'name' => esc_html__( 'WooLentor', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-mega-for-elementor',
|
||||
'location' => 'htmega_addons_elementor.php',
|
||||
'name' => esc_html__( 'HT Mega', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'hashbar-wp-notification-bar',
|
||||
'location' => 'init.php',
|
||||
'name' => esc_html__( 'HashBar', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-slider-for-elementor',
|
||||
'location' => 'ht-slider-for-elementor.php',
|
||||
'name' => esc_html__( 'HT Slider For Elementor', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-wpform',
|
||||
'location' => 'wpform-widget-elementor.php',
|
||||
'name' => esc_html__( 'HT WPForms', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-menu-lite',
|
||||
'location' => 'ht-mega-menu.php',
|
||||
'name' => esc_html__( 'HT Menu', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'insert-headers-and-footers-script',
|
||||
'location' => 'init.php',
|
||||
'name' => esc_html__( 'HT Script', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'wp-plugin-manager',
|
||||
'location' => 'plugin-main.php',
|
||||
'name' => esc_html__( 'WP Plugin Manager', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'wc-builder',
|
||||
'location' => 'wc-builder.php',
|
||||
'name' => esc_html__( 'WC Builder', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'whols',
|
||||
'location' => 'whols.php',
|
||||
'name' => esc_html__( 'Whols', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'just-tables',
|
||||
'location' => 'just-tables.php',
|
||||
'name' => esc_html__( 'JustTables', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'wc-multi-currency',
|
||||
'location' => 'wcmilticurrency.php',
|
||||
'name' => esc_html__( 'Multi Currency', 'ht-contactform' )
|
||||
)
|
||||
)
|
||||
|
||||
) );
|
||||
|
||||
$recommendations->add_new_tab(array(
|
||||
'title' => esc_html__( 'You May Also Like', 'ht-contactform' ),
|
||||
'plugins' => array(
|
||||
|
||||
array(
|
||||
'slug' => 'woolentor-addons-pro',
|
||||
'location' => 'woolentor_addons_pro.php',
|
||||
'name' => esc_html__( 'WooLentor Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/woolentor-pro-woocommerce-page-builder/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'WooLentor is one of the most popular WooCommerce Elementor Addons on WordPress.org. It has been downloaded more than 672,148 times and 60,000 stores are using WooLentor plugin. Why not you?', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'htmega-pro',
|
||||
'location' => 'htmega_pro.php',
|
||||
'name' => esc_html__( 'HT Mega Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/ht-mega-pro/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'HTMega is an absolute addon for elementor that includes 80+ elements & 360 Blocks with unlimited variations. HT Mega brings limitless possibilities. Embellish your site with the elements of HT Mega.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'swatchly-pro',
|
||||
'location' => 'swatchly-pro.php',
|
||||
'name' => esc_html__( 'Product Variation Swatches', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/swatchly-product-variation-swatches-for-woocommerce-products/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'Are you getting frustrated with WooCommerce’s current way of presenting the variants for your products? Well, say goodbye to dropdowns and start showing the product variations in a whole new light with Swatchly.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'whols-pro',
|
||||
'location' => 'whols-pro.php',
|
||||
'name' => esc_html__( 'Whols Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/whols-woocommerce-wholesale-prices/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'Whols is an outstanding WordPress plugin for WooCommerce that allows store owners to set wholesale prices for the products of their online stores. This plugin enables you to show special wholesale prices to the wholesaler. Users can easily request to become a wholesale customer by filling out a simple online registration form. Once the registration is complete, the owner of the store will be able to review the request and approve the request either manually or automatically.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'just-tables-pro',
|
||||
'location' => 'just-tables-pro.php',
|
||||
'name' => esc_html__( 'JustTables Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/wp/justtables/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'JustTables is an incredible WordPress plugin that lets you showcase all your WooCommerce products in a sortable and filterable table view. It allows your customers to easily navigate through different attributes of the products and compare them on a single page. This plugin will be of great help if you are looking for an easy solution that increases the chances of landing a sale on your online store.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'multicurrencypro',
|
||||
'location' => 'multicurrencypro.php',
|
||||
'name' => esc_html__( 'Multi Currency Pro for WooCommerce', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/multi-currency-pro-for-woocommerce/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'Multi-Currency Pro for WooCommerce is a prominent currency switcher plugin for WooCommerce. This plugin allows your website or online store visitors to switch to their preferred currency or their country’s currency.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'cf7-extensions-pro',
|
||||
'location' => 'cf7-extensions-pro.php',
|
||||
'name' => esc_html__( 'Extensions For CF7 Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/cf7-extensions/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'Contact Form7 Extensions plugin is a fantastic WordPress plugin that enriches the functionalities of Contact Form 7.This all-in-one WordPress plugin will help you turn any contact page into a well-organized, engaging tool for communicating with your website visitors by providing tons of advanced features like drag and drop file upload, repeater field, trigger error for already submitted forms, popup form response, country flags and dial codes with a telephone input field and acceptance field, etc. in addition to its basic features.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'hashbar-pro',
|
||||
'location' => 'init.php',
|
||||
'name' => esc_html__( 'HashBar Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/wordpress-notification-bar-plugin/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'HashBar is a WordPress Notification / Alert / Offer Bar plugin which allows you to create unlimited notification bars to notify your customers. This plugin has option to show email subscription form (sometimes it increases up to 500% email subscriber), Offer text and buttons about your promotions. This plugin has the options to add unlimited background colors and images to make your notification bar more professional.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'wp-plugin-manager-pro',
|
||||
'location' => 'plugin-main.php',
|
||||
'name' => esc_html__( 'WP Plugin Manager Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/wp-plugin-manager-pro/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'WP Plugin Manager Pro is a specialized WordPress Plugin that helps you to deactivate unnecessary WordPress Plugins page wise and boosts the speed of your WordPress site to improve the overall site performance.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-script-pro',
|
||||
'location' => 'plugin-main.php',
|
||||
'name' => esc_html__( 'HT Script Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/insert-headers-and-footers-code-ht-script/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'Insert Headers and Footers Code allows you to insert Google Analytics, Facebook Pixel, custom CSS, custom HTML, JavaScript code to your website header and footer without modifying your theme code.This plugin has the option to add any custom code to your theme in one place, no need to edit the theme code. It will save your time and remove the hassle for the theme update.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-menu',
|
||||
'location' => 'ht-mega-menu.php',
|
||||
'name' => esc_html__( 'HT Menu Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/ht-menu-pro/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'WordPress Mega Menu Builder for Elementor', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-slider-addons-pro',
|
||||
'location' => 'ht-slider-addons-pro.php',
|
||||
'name' => esc_html__( 'HT Slider Pro For Elementor', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/ht-slider-pro-for-elementor/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'HT Slider Pro is a plugin to create a slider for WordPress websites easily using the Elementor page builder. 80+ prebuild slides/templates are included in this plugin. There is the option to create a post slider, WooCommerce product slider, Video slider, image slider, etc. Fullscreen, full width and box layout option are included.', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-google-place-review',
|
||||
'location' => 'ht-google-place-review.php',
|
||||
'name' => esc_html__( 'Google Place Review', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/google-place-review-plugin-for-wordpress/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( 'If you are searching for a modern and excellent google places review WordPress plugin to showcase reviews from Google Maps and strengthen trust between you and your site visitors, look no further than HT Google Place Review', 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'was-this-helpful',
|
||||
'location' => 'was-this-helpful.php',
|
||||
'name' => esc_html__( 'Was This Helpful?', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/was-this-helpful/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( "Was this helpful? is a WordPress plugin that allows you to take visitors' feedback on your post/pages or any article. A visitor can share his feedback by like/dislike/yes/no", 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-click-to-call',
|
||||
'location' => 'ht-click-to-call.php',
|
||||
'name' => esc_html__( 'HT Click To Call', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/ht-click-to-call/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( "HT – Click to Call is a lightweight WordPress plugin that allows you to add a floating click to call button on your website. It will offer your website visitors an opportunity to call your business immediately at the right moment, especially when they are interested in your products or services and seeking more information.", 'ht-contactform' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'docus-pro',
|
||||
'location' => 'docus-pro.php',
|
||||
'name' => esc_html__( 'Docus Pro', 'ht-contactform' ),
|
||||
'link' => 'https://hasthemes.com/plugins/docus-pro-youtube-video-playlist/',
|
||||
'author_link'=> 'https://hasthemes.com/',
|
||||
'description'=> esc_html__( "Embedding a YouTube playlist into your website plays a vital role to curate your content into several categories and make your web content more engaging and popular by keeping the visitors on your website for a longer period.", 'ht-contactform' ),
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
$recommendations->add_new_tab(array(
|
||||
'title' => esc_html__( 'Others', 'ht-contactform' ),
|
||||
'plugins' => array(
|
||||
|
||||
array(
|
||||
'slug' => 'really-simple-google-tag-manager',
|
||||
'location' => 'really-simple-google-tag-manager.php',
|
||||
'name' => esc_html__( 'Really Simple Google Tag Manager', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-instagram',
|
||||
'location' => 'ht-instagram.php',
|
||||
'name' => esc_html__( 'HT Feed', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'faster-youtube-embed',
|
||||
'location' => 'faster-youtube-embed.php',
|
||||
'name' => esc_html__( 'Faster YouTube Embed', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'wc-sales-notification',
|
||||
'location' => 'wc-sales-notification.php',
|
||||
'name' => esc_html__( 'WC Sales Notification', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'preview-link-generator',
|
||||
'location' => 'preview-link-generator.php',
|
||||
'name' => esc_html__( 'Preview Link Generator', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'quickswish',
|
||||
'location' => 'quickswish.php',
|
||||
'name' => esc_html__( 'QuickSwish', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'docus',
|
||||
'location' => 'docus.php',
|
||||
'name' => esc_html__( 'Docus – YouTube Video Playlist', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'data-captia',
|
||||
'location' => 'data-captia.php',
|
||||
'name' => esc_html__( 'DataCaptia', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'coupon-zen',
|
||||
'location' => 'coupon-zen.php',
|
||||
'name' => esc_html__( 'Coupon Zen', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'sirve',
|
||||
'location' => 'sirve.php',
|
||||
'name' => esc_html__( 'Sirve – Simple Directory Listing', 'ht-contactform' )
|
||||
),
|
||||
|
||||
array(
|
||||
'slug' => 'ht-social-share',
|
||||
'location' => 'ht-social-share.php',
|
||||
'name' => esc_html__( 'HT Social Share', 'ht-contactform' )
|
||||
),
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user