/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
archub-elementor-addons
/
elementor
/
widgets
/
Upload File
HOME
<?php namespace LiquidElementor\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Image_Size; use Elementor\Group_Control_Typography; use Elementor\Scheme_Color; use Elementor\Scheme_Typography; use Elementor\Utils; use Elementor\Control_Media; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Text_Shadow; use Elementor\Group_Control_Background; use Elementor\Repeater; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor heading widget. * * Elementor widget that displays an eye-catching headlines. * * @since 1.0.0 */ class LD_List extends Widget_Base { /** * Get widget name. * * Retrieve heading widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'ld_list'; } /** * Get widget title. * * Retrieve heading widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return __( 'Liquid Custom Lists', 'archub-elementor-addons' ); } /** * Get widget icon. * * Retrieve heading widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-bullet-list lqd-element'; } /** * Get widget categories. * * Retrieve the list of categories the heading widget belongs to. * * Used to determine where to display the widget in the editor. * * @since 1.0.0 * @access public * * @return array Widget categories. */ public function get_categories() { return [ 'hub-core' ]; } /** * Get widget keywords. * * Retrieve the list of keywords the widget belongs to. * * @since 1.0.0 * @access public * * @return array Widget keywords. */ public function get_keywords() { return [ 'list' ]; } /** * Register heading 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() { // General Section $this->start_controls_section( 'general_section', [ 'label' => __( 'General', 'archub-elementor-addons' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'inline', [ 'label' => __( 'Inline List?', 'archub-elementor-addons' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'archub-elementor-addons' ), 'label_off' => __( 'Off', 'archub-elementor-addons' ), 'return_value' => 'inline-nav', 'default' => '', ] ); $repeater = new Repeater(); $repeater->add_control( 'list_item', [ 'label' => __( 'List Item', 'archub-elementor-addons' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'List Item' , 'archub-elementor-addons' ), 'label_block' => true, ] ); $this->add_control( 'list', [ 'label' => __( 'Items', 'archub-elementor-addons' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'list_title' => __( 'Title #1', 'archub-elementor-addons' ), ], [ 'list_title' => __( 'Title #2', 'archub-elementor-addons' ), ], [ 'list_title' => __( 'Title #3', 'archub-elementor-addons' ), ], ], 'title_field' => '{{{ list_item }}}', 'separator' => 'before' ] ); $this->add_control( 'items_spacing', [ 'label' => __( 'Spacing', 'archub-elementor-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'selectors' => [ '{{WRAPPER}} .bullet-list-ul:not(.inline-nav) li' => 'margin-bottom: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .bullet-list-ul.inline-nav li + li' => 'margin-inline-start: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'content_section', [ 'label' => __( 'Style', 'archub-elementor-addons' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'label' => __( 'Typography', 'archub-elementor-addons' ), 'selector' => '{{WRAPPER}} li', ] ); $this->add_control( 'primary_color', [ 'label' => __( 'Primary Color', 'archub-elementor-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .lqd-bullet-list li:before' => 'background: {{VALUE}}', ], ] ); $this->add_control( 'txt_color', [ 'label' => __( 'Text Color', 'archub-elementor-addons' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .lqd-bullet-list li' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'bullet_size', [ 'label' => __( 'Bullet Size', 'archub-elementor-addons' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 5, ], 'selectors' => [ '{{WRAPPER}} .lqd-bullet-list li:before' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};' ], ] ); $this->end_controls_section(); } /** * Render heading 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(); $classes = array( 'bullet-list-ul', 'reset-ul', $settings['inline'] === 'inline-nav' ? 'inline-nav' : '', ); ?> <div class="lqd-bullet-list"> <ul class="<?php echo ld_helper()->sanitize_html_classes( $classes ); ?>"> <?php foreach ($settings['list'] as $item): ?> <li class="d-flex align-items-center"><?php echo esc_html( $item['list_item'] ); ?></li> <?php endforeach; ?> </ul> </div> <?php } }