芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/themes/rehub-theme/rehub-elementor/wpsm-tabevery.php
general_controls(); } protected function general_controls() { $this->start_controls_section( 'general_section', [ 'label' => esc_html__( 'Content', 'rehub-theme' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ]); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'title', [ 'label' => esc_html__( 'Tab title', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => 'Tab title', 'label_block' => true, ]); $repeater->add_control( 'content_template', [ 'label' => esc_html__( 'Elementor Templates', 'rehub-theme' ), 'type' => Controls_Manager::SELECT, 'default' => '0', 'options' => rh_get_local_el_templates(), 'label_block' => 'true', ] ); $repeater->add_control( 'tabajax', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Ajax loading?', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), 'return_value' => '1', ]); $repeater->add_control( 'tabicon', [ 'label' => __( 'Icon', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::ICONS, ] ); $repeater->add_control( 'tabiconmargin', [ 'label' => __('Icon margins', 'rehub-theme'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 1, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .tabiconwrapper' => 'margin-left: {{SIZE}}{{UNIT}};margin-right: {{SIZE}}{{UNIT}};', ], 'condition' => array( 'tabicon!' => '', ), ] ); $repeater->add_control( 'tabiconright', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Right aligh for icon', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), 'return_value' => '1', ]); $repeater->add_control( 'content', [ 'label' => esc_html__( 'Additional Content', 'rehub-theme' ), 'type' => Controls_Manager::WYSIWYG, 'show_label' => false, ] ); $this->add_control( 'TabsEvery', [ 'label' => esc_html__( 'TabsEvery', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ title }}}', ]); $this->end_controls_section(); $this->start_controls_section( 'tabstyle_section', [ 'label' => esc_html__( 'Style', 'rehub-theme' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ]); $this->add_control( 'tabstack', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Enable stack for tabs', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), 'return_value' => '1', 'selectors' => [ '{{WRAPPER}} .tabs-menu li' => 'float:none', ], ]); $this->add_control( 'tabstackblock', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Enable Inline block', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), 'return_value' => '1', 'selectors' => [ '{{WRAPPER}} .tabs-menu' => 'display:inline-block', ], 'condition' => array( 'tabstack' => '1', ), ]); $this->add_responsive_control( 'rhtabwidth', [ 'label' => __('Tab section width', 'rehub-theme'), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => '100', 'unit' => '%', ], 'size_units' => [ '%', 'px'], 'range' => [ '%' => [ 'min' => 1, 'max' => 100, ], 'px' => [ 'min' => 10, 'max' => 500, ], ], 'selectors' => [ '{{WRAPPER}} .tabs-menu' => 'width: {{SIZE}}{{UNIT}};', ], 'condition' => array( 'tabstack' => '1', ), ] ); $this->add_control( 'tabmobilescroll', [ 'type' => Controls_Manager::SWITCHER, 'label' => esc_html__( 'Enable tab scroll on mobile?', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), 'return_value' => '1', 'condition' => array( 'tabstack!' => '1', ), 'selectors' => [ '{{WRAPPER}} .tabs-menu li' => 'float:none; display:inline-block', ], ]); $this->add_control( 'tabpadding', [ 'label' => __( 'Padding', 'rehub-theme' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .tabs-menu li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'tabmargin', [ 'label' => __( 'Margin', 'rehub-theme' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .tabs-menu li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'tabborderradius', [ 'label' => __( 'Border radius', 'rehub-theme' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .tabs-menu li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'tabs_a_style' ); $this->start_controls_tab( 'tab_reg_sec', [ 'label' => esc_html__( 'Regular tab', 'rehub-theme' ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'tabtypography', 'label' => esc_html__( 'Title Typography', 'rehub-theme' ), 'selector' => '{{WRAPPER}} .tabs-menu li', ] ); $this->add_control( 'tabcolor', [ 'label' => esc_html__( 'Set text color', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tabs-menu li' => 'color: {{VALUE}}', ], ]); $this->add_control( 'tabrhhr1', [ 'label' => __( 'Background control', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'tabbgcolor', 'label' => esc_html__( 'Set background', 'rehub-theme' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .tabs-menu li', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'tabborder', 'label' => __( 'Border', 'rehub-theme' ), 'selector' => '{{WRAPPER}} .tabs-menu li', ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'tabbox_shadow', 'label' => __( 'Box Shadow', 'rehub-theme' ), 'selector' => '{{WRAPPER}} .tabs-menu li', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_act_sec', [ 'label' => esc_html__( 'Active tab', 'rehub-theme' ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'tabtypographyhover', 'label' => esc_html__( 'Title Typography', 'rehub-theme' ), 'selector' => '{{WRAPPER}} .tabs-menu li.current, {{WRAPPER}} .tabs-menu li:hover', ] ); $this->add_control( 'tabactivecolor', [ 'label' => esc_html__( 'Set text color', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .tabs-menu li.current' => 'color: {{VALUE}}', '{{WRAPPER}} .tabs-menu li:hover' => 'color: {{VALUE}}', ], ]); $this->add_control( 'tabrhhr2', [ 'label' => __( 'Background control', 'rehub-theme' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'tabactivebgcolor', 'label' => esc_html__( 'Set background', 'rehub-theme' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .tabs-menu li.current, {{WRAPPER}} .tabs-menu li:hover', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'tabborderhover', 'label' => __( 'Border', 'rehub-theme' ), 'selector' => '{{WRAPPER}} .tabs-menu li.current, {{WRAPPER}} .tabs-menu li:hover', ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'tabboxhover_shadow', 'label' => __( 'Box Shadow', 'rehub-theme' ), 'selector' => '{{WRAPPER}} .tabs-menu li.current, {{WRAPPER}} .tabs-menu li:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /* Widget output Rendering */ protected function render() { $settings = $this->get_settings_for_display(); ?>
$item ):?> get_repeater_setting_key( 'tab_item', 'TabsEvery', $index ); $this->add_render_attribute( $tab_content_setting_key, [ 'data-tab' => intval($index + 1), 'class' => array( 'elementor-tab-title', ($index == 0) ? 'current elementor-active' : '', 'elementor-repeater-item-' . $item['_id'], (!empty($item['tabajax']) && !empty($item["content_template"])) ? 'rh-el-onclick load-block-'.$item["content_template"].'' : '', ), ] ); ?>
get_render_attribute_string( $tab_content_setting_key ); ?>>
'true' ] ); ?>
'true' ] ); ?>
$item ):?>
frontend->get_builder_content_for_display( $item['content_template'] );?>
widgets_manager->register( new WPSM_TabsEvery_Widget );