File: /home/globfdxw/www/wp-content/plugins/bearsthemes-addons/widgets/give-totals/skins/skin-pumori.php
<?php
namespace BearsthemesAddons\Widgets\Give_Totals\Skins;
use Elementor\Widget_Base;
use Elementor\Skin_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
use Give\Helpers\Form\Template;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Skin_Pumori extends Skin_Base {
protected function _register_controls_actions() {
add_action( 'elementor/element/be-give-totals/section_layout/before_section_end', [ $this, 'register_layout_section_controls' ] );
add_action( 'elementor/element/be-give-totals/section_design_layout/after_section_end', [ $this, 'register_design_give_total_section_controls' ] );
add_action( 'elementor/element/be-give-totals/section_design_layout/after_section_end', [ $this, 'register_design_give_form_section_controls' ] );
}
public function get_id() {
return 'skin-pumori';
}
public function get_title() {
return __( 'Pumori', 'bearsthemes-addons' );
}
public function register_layout_section_controls( Widget_Base $widget ) {
$this->parent = $widget;
$this->parent->start_injection( [
'at' => 'before',
'of' => 'total_goal',
] );
$this->add_control(
'header_title',
[
'label' => __( 'Title', 'bearsthemes-addons' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'We Need Donations', 'bearsthemes-addons' ),
]
);
$this->add_control(
'header_desc',
[
'label' => __( 'Description', 'bearsthemes-addons' ),
'type' => Controls_Manager::TEXTAREA,
'default' => __( 'Alienum phaedrum torquatos nec eu, vis detrax culis ex, nihis in mei.', 'bearsthemes-addons' ),
]
);
$this->parent->end_injection();
$this->parent->start_injection( [
'at' => 'before',
'of' => 'form_id',
] );
$this->add_control(
'form_sub_title',
[
'label' => __( 'Sub Title', 'bearsthemes-addons' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Please Select', 'bearsthemes-addons' ),
]
);
$this->add_control(
'form_title',
[
'label' => __( 'Title', 'bearsthemes-addons' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'AMOUNT TO DONATE', 'bearsthemes-addons' ),
]
);
$this->add_control(
'form_desc',
[
'label' => __( 'Description', 'bearsthemes-addons' ),
'type' => Controls_Manager::TEXTAREA,
'default' => __( 'All donations are tax deductable.', 'bearsthemes-addons' ),
]
);
$this->parent->end_injection();
}
public function register_design_give_total_section_controls( Widget_Base $widget ) {
$this->parent = $widget;
$this->start_controls_section(
'section_design_give_totals',
[
'label' => __( 'Give Total', 'bearsthemes-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'heading_header_box_style',
[
'label' => __( 'Box', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'header_background',
[
'label' => __( 'Background Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-header' => 'background-color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'header_padding',
[
'label' => __( 'Padding', 'bearsthemes-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .elementor-gt-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
],
]
);
$this->add_control(
'heading_header_title_style',
[
'label' => __( 'Title', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'header_title_color',
[
'label' => __( 'Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-header__title' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'header_title_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .elementor-gt-header__title',
]
);
$this->add_control(
'heading_header_desc_style',
[
'label' => __( 'Description', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'header_desc_color',
[
'label' => __( 'Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-header__desc' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'header_desc_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .elementor-gt-header__desc',
]
);
$this->add_control(
'heading_goal_progress_style',
[
'label' => __( 'Goal Progress', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'goal_progress_primary_color',
[
'label' => __( 'Primary Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .give-goal-progress .income,
{{WRAPPER}} .give-goal-progress .goal-text' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'goal_progress_primary_typography',
'label' => __( 'Primary Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .give-goal-progress .income,
{{WRAPPER}} .give-goal-progress .goal-text',
]
);
$this->add_control(
'goal_progress_color',
[
'label' => __( 'Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .give-goal-progress' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'goal_progress_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .give-goal-progress',
]
);
$this->end_controls_section();
}
public function register_design_give_form_section_controls( Widget_Base $widget ) {
$this->parent = $widget;
$this->start_controls_section(
'section_design_give_form',
[
'label' => __( 'Give Form', 'bearsthemes-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'heading_form_box_style',
[
'label' => __( 'Box', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'form_background',
[
'label' => __( 'Background Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-form' => 'background-color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'form_padding',
[
'label' => __( 'Padding', 'bearsthemes-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .elementor-gt-form' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
],
]
);
$this->add_control(
'heading_form_sub_title_style',
[
'label' => __( 'Sub Title', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'form_Subtitle_color',
[
'label' => __( 'Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-form__sub-title' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_sub_title_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .elementor-gt-form__sub-title',
]
);
$this->add_control(
'heading_form_title_style',
[
'label' => __( 'Title', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'form_title_color',
[
'label' => __( 'Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-form__title' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_title_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .elementor-gt-form__title',
]
);
$this->add_control(
'heading_form_desc_style',
[
'label' => __( 'Description', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'form_desc_color',
[
'label' => __( 'Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-form__desc' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_desc_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} .elementor-gt-form__desc',
]
);
$this->add_control(
'heading_form',
[
'label' => __( 'Give Form (Apply On Legacy)', 'bearsthemes-addons' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'form_main_color',
[
'label' => __( 'Main Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-form form[id*=give-form] .give-btn-modal:hover,
{{WRAPPER}} .elementor-gt-form form[id*=give-form] #give-donation-level-button-wrap .give-btn:not(.give-default-level)' => 'background-color: {{VALUE}};',
'{{WRAPPER}} .elementor-gt-form form[id*=give-form] #give-donation-level-button-wrap .give-btn:not(.give-default-level)' => 'border-color: {{VALUE}};',
'.give-form[data-style="elementor-give-totals--pumori"] .give-submit:hover' => 'background-color: {{VALUE}};',
],
'condition' => [
'form_id!'=> '',
],
]
);
$this->add_control(
'form_secondary_color',
[
'label' => __( 'Secondary Color', 'bearsthemes-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .elementor-gt-form form[id*=give-form] .give-total-wrap #give-amount,
{{WRAPPER}} .elementor-gt-form form[id*=give-form] #give-donation-level-button-wrap .give-btn:not(.give-default-level),
{{WRAPPER}} .elementor-gt-form form[id*=give-form] .give-btn-modal:hover' => 'color: {{VALUE}};',
'{{WRAPPER}} .elementor-gt-form form[id*=give-form] .give-total-wrap .give-currency-symbol,
{{WRAPPER}} .elementor-gt-form form[id*=give-form] #give-donation-level-button-wrap .give-btn.give-default-level,
{{WRAPPER}} .elementor-gt-form form[id*=give-form] .give-btn-modal' => 'background-color: {{VALUE}};',
'{{WRAPPER}} .elementor-gt-form form[id*=give-form] #give-donation-level-button-wrap .give-btn.give-default-level' => 'border-color: {{VALUE}};',
'.give-form[data-style="elementor-give-totals--pumori"] #give-gateway-radio-list > li label:hover,
.give-form[data-style="elementor-give-totals--pumori"] #give-gateway-radio-list > li.give-gateway-option-selected label,
.give-form[data-style="elementor-give-totals--pumori"] #give_terms_agreement label:hover,
.give-form[data-style="elementor-give-totals--pumori"] #give_terms_agreement input[type=checkbox]:checked + label,
.give-form[data-style="elementor-give-totals--pumori"] .give_terms_links:hover,
.give-form[data-style="elementor-give-totals--pumori"] #give-final-total-wrap .give-final-total-amount,
.give-form[data-style="elementor-give-totals--pumori"] .give-submit:hover' => 'color: {{VALUE}};',
'.give-form[data-style="elementor-give-totals--pumori"] #give-gateway-radio-list > li.give-gateway-option-selected label:after,
.give-form[data-style="elementor-give-totals--pumori"] #give_terms_agreement input[type=checkbox]:checked + label:before,
.give-form[data-style="elementor-give-totals--pumori"] #give-final-total-wrap .give-donation-total-label,
.give-form[data-style="elementor-give-totals--pumori"] .give-submit' => 'background-color: {{VALUE}};',
'.give-form[data-style="elementor-give-totals--pumori"] #give_terms_agreement input[type=checkbox]:checked + label:before' => 'border-color: {{VALUE}};',
],
'condition' => [
'form_id!'=> '',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'form_typography',
'label' => __( 'Typography', 'bearsthemes-addons' ),
'default' => '',
'selector' => '{{WRAPPER}} form[id*=give-form],
{{WRAPPER}} form[id*=give-form] #give-donation-level-button-wrap .give-btn,
.give-form[data-style="elementor-give-totals--pumori"]',
'condition' => [
'form_id!'=> '',
],
]
);
$this->end_controls_section();
}
public function render() {
$settings = $this->parent->get_settings_for_display();
$total_earnings = get_option( 'give_earnings_total', false );
if( '' !== $settings['custom_total_earnings'] ) {
$total_earnings = $settings['total_earnings'];
}
$args = array(
'total_earnings' => $total_earnings, // integer.
'total_goal' => $settings['total_goal'], // integer.
'ids' => $settings['ids'], // integer|array.
'cats' => $settings['category'], // integer|array.
'tags' => 0, // integer|array.
'message' => '', // apply_filters( 'give_totals_message', __( 'Hey! We\'ve raised {total} of the {total_goal} we are trying to raise for this campaign!', 'bearsthemes-addons' ) ),
'link' => '', // URL.
'link_text' => __( 'Donate Now', 'bearsthemes-addons' ), // string,
'progress_bar' => true, // boolean.
'show_text' => true, // boolean.
'show_bar' => true, // boolean.
'income_text' => __( 'Raised so far', 'bearsthemes-addons' ),
'goal_text' => __( 'Our Goal', 'bearsthemes-addons' ),
'custom_goal_progress' => $settings['custom_goal_progress'],
);
$bar_opts = array(
'type' => 'line',
'strokewidth' => 1,
'easing' => $settings['goal_progress_easing'],
'duration' => absint( $settings['goal_progress_duration']['size'] ),
'color' => $settings['goal_progress_color_from'],
'trailcolor' => $settings['goal_progress_trailcolor'],
'trailwidth' => 1,
'tocolor' => $settings['goal_progress_color_to'],
'width' => '100%',
'height' => '27px',
);
$this->parent->render_loop_header();
?>
<div class="elementor-gt-header">
<?php
if( $this->parent->get_instance_value_skin('header_title') ) {
echo '<h2 class="elementor-gt-header__title">' . $this->parent->get_instance_value_skin('header_title') . '</h2>';
}
if( $this->parent->get_instance_value_skin('header_desc') ) {
echo '<div class="elementor-gt-header__desc">' . $this->parent->get_instance_value_skin('header_desc') . '</div>';
}
echo bearsthemes_addons_give_totals ( $args, $bar_opts );
?>
</div>
<div class="elementor-gt-form">
<div class="elementor-gt-form__text">
<?php
if( $this->parent->get_instance_value_skin('form_sub_title') ) {
echo '<h3 class="elementor-gt-form__sub-title">' . $this->parent->get_instance_value_skin('form_sub_title') . '</h3>';
}
if( $this->parent->get_instance_value_skin('form_title') ) {
echo '<h2 class="elementor-gt-form__title">' . $this->parent->get_instance_value_skin('form_title') . '</h2>';
}
if( $this->parent->get_instance_value_skin('form_desc') ) {
echo '<div class="elementor-gt-form__desc">' . $this->parent->get_instance_value_skin('form_desc') . '</div>';
}
?>
</div>
<?php
if( !empty( $settings['form_id'] ) ) {
if( !Template::getActiveID($settings['form_id']) ) {
echo do_shortcode('[give_form id="' . $settings['form_id'] . '"]');
} else {
// Maybe display the form donate button.
$atts = array(
'id' => $settings['form_id'], // integer.
'show_title' => false, // boolean.
'show_goal' => false, // boolean.
'show_content' => 'none', //above, below, or none
'display_style' => 'modal', //modal, button, and reveal
'continue_button_title' => '' //string
);
add_filter('give_form_html_tags', function($form_html_tags, $form) {
$form_html_tags['data-style'] = 'elementor-give-totals--pumori';
return $form_html_tags;
}, 10, 2);
echo give_get_donation_form( $atts );
}
}
?>
</div>
<?php
$this->parent->render_loop_footer();
}
protected function content_template() {
}
}