whoami7 - Manager
:
/
home
/
n170823s
/
www
/
nvqlevel2.co.uk
/
wp-content
/
plugins
/
rselements
/
widgets
/
button
/
Upload File:
files >> /home/n170823s/www/nvqlevel2.co.uk/wp-content/plugins/rselements/widgets/button/button.php
<?php /** * Elementor RS Button Widget. * * Elementor widget that inserts an embbedable content into the page, from any given URL. * * @since 1.0.0 */ use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Core\Schemes\Typography; use Elementor\Group_Control_Border; use Elementor\Group_Control_Background; use Elementor\register_controls; defined( 'ABSPATH' ) || die(); class Rsaddon_pro_Button_Widget extends \Elementor\Widget_Base { /** * Get widget name. * * Retrieve counter widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'rs-button'; } /** * Get widget title. * * Retrieve counter widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'RS Button', 'rsaddon' ); } /** * Get widget icon. * * Retrieve counter widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'glyph-icon flaticon-menu'; } /** * Retrieve the list of scripts the counter widget depended on. * * Used to set scripts dependencies required to run the widget. * * @since 1.3.0 * @access public * * @return array Widget scripts dependencies. */ public function get_categories() { return [ 'rsaddon_category' ]; } /** * Get widget keywords. * * Retrieve the list of keywords the widget belongs to. * * @since 2.1.0 * @access public * * @return array Widget keywords. */ public function get_keywords() { return [ 'button' ]; } /** * Register counter widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function register_controls() { $this->start_controls_section( 'section_button', [ 'label' => esc_html__( 'Content', 'rsaddon' ), ] ); $this->add_control( 'button_style', [ 'label' => esc_html__( 'Select Style', 'rsaddon' ), 'type' => Controls_Manager::SELECT, 'default' => '1', 'options' => [ '1' => 'Style 1', '2' => 'Style 2', ], ] ); $this->add_control( 'btn_text', [ 'label' => esc_html__( 'Button Text', 'rsaddon' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'Sample', 'placeholder' => esc_html__( 'Button Text', 'rsaddon' ), 'separator' => 'before', ] ); $this->add_control( 'btn_link', [ 'label' => esc_html__( ' Button Link', 'rsaddon' ), 'type' => Controls_Manager::URL, 'label_block' => true, ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'rsaddon' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'rsaddon' ), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'rsaddon' ), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'rsaddon' ), 'icon' => 'fa fa-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justify', 'rsaddon' ), 'icon' => 'fa fa-align-justify', ], ], 'toggle' => true, 'selectors' => [ '{{WRAPPER}} .rs-view-btn' => 'text-align: {{VALUE}}' ] ] ); $this->end_controls_section(); $this->start_controls_section( '_section_style_button', [ 'label' => esc_html__( 'Button', 'rsaddon' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( '_tabs_button' ); $this->start_controls_tab( 'style_normal_tab', [ 'label' => esc_html__( 'Normal', 'rsaddon' ), ] ); $this->add_control( 'btn_text_color', [ 'label' => esc_html__( 'Text Color', 'rsaddon' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .rs-view-btn a' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'link_padding', [ 'label' => esc_html__( 'Padding', 'rsaddon' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .rs-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'bg_colors', [ 'label' => esc_html__( 'Background Color', 'rsaddon' ), 'type' => Controls_Manager::COLOR, 'selectors' => ['{{WRAPPER}} .rs-view-btn a' => 'background: {{VALUE}};',], ] ); $this->add_control( 'border_colors', [ 'label' => esc_html__( 'Border Color', 'rsaddon' ), 'type' => Controls_Manager::COLOR, 'selectors' => ['{{WRAPPER}} .rs-view-btn a' => 'border-color: {{VALUE}};',], ] ); $this->add_responsive_control( 'border_radius', [ 'label' => esc_html__( 'Border Radius', 'rsaddon' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .rs-view-btn a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'btn_typography', 'selector' => '{{WRAPPER}} .rs-view-btn a', 'scheme' => Typography::TYPOGRAPHY_4, ] ); $this->end_controls_tab(); $this->start_controls_tab( 'style_hover_tab', [ 'label' => esc_html__( 'Hover', 'rsaddon' ), ] ); $this->add_control( 'btn_text_hover_color', [ 'label' => esc_html__( 'Text Color', 'rsaddon' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .rs-view-btn a:hover' => 'color: {{VALUE}};', '{{WRAPPER}} .rs-btn.rs-btn-style2:hover:before' => 'background: {{VALUE}};', '{{WRAPPER}} .rs-btn.rs-btn-style2:hover:after' => 'background: {{VALUE}};', ], ] ); $this->add_control( 'border_colors_hovers', [ 'label' => esc_html__( 'Border Color', 'rsaddon' ), 'type' => Controls_Manager::COLOR, 'selectors' => ['{{WRAPPER}} .rs-view-btn a:hover' => 'border-color: {{VALUE}};',], ] ); $this->add_control( 'bg_hover_colors', [ 'label' => esc_html__( 'Background Color', 'rsaddon' ), 'type' => Controls_Manager::COLOR, 'selectors' => ['{{WRAPPER}} .rs-view-btn a:hover' => 'background: {{VALUE}};',], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Render counter widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 1.0.0 * @access protected */ /** * Render counter widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $this->add_inline_editing_attributes( 'btn_text', 'basic' ); $this->add_render_attribute( 'btn_text', 'class', 'btn_text' ); ?> <div class="rs-view-btn"> <?php $target = $settings['btn_link']['is_external'] ? 'target=_blank' : '';?> <a class="rs-btn rs-btnblack rs-btn-style<?php echo esc_attr( $settings['button_style'] ); ?>" href="<?php echo esc_url($settings['btn_link']['url']);?>" <?php echo esc_attr($target);?>> <span class="rs_btn__text"><span <?php echo wp_kses_post($this->print_render_attribute_string('btn_text'));?>><?php echo esc_html($settings['btn_text']);?></span></span> </a> </div> <?php } }
Copyright ©2021 || Defacer Indonesia