theme-elements
6 months ago
accordion.php
6 months ago
audio.php
6 months ago
before-after.php
6 months ago
button.php
6 months ago
carousel-navigation.php
6 months ago
circle-chart.php
6 months ago
contact-box.php
6 months ago
contact-form.php
6 months ago
custom-list.php
6 months ago
divider.php
6 months ago
gallery.php
6 months ago
gmap.php
6 months ago
heading-modern.php
6 months ago
icon.php
6 months ago
image.php
6 months ago
mailchimp.php
6 months ago
modern-button.php
6 months ago
products-grid.php
6 months ago
quote.php
6 months ago
recent-comments.php
6 months ago
recent-posts-grid-carousel.php
6 months ago
recent-posts-land-style.php
6 months ago
recent-posts-masonry.php
6 months ago
recent-posts-tiles-carousel.php
6 months ago
recent-posts-tiles.php
6 months ago
recent-posts-timeline.php
6 months ago
recent-products.php
6 months ago
responsive-table.php
6 months ago
search.php
6 months ago
staff.php
6 months ago
svg.php
6 months ago
tabs.php
6 months ago
testimonial.php
6 months ago
text.php
6 months ago
touch-slider.php
6 months ago
video.php
6 months ago
search.php
206 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; // Exit if accessed directly. |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * Elementor 'Audio' widget. |
| 15 | * |
| 16 | * Elementor widget that displays an 'Audio' with lightbox. |
| 17 | * |
| 18 | * @since 1.0.0 |
| 19 | */ |
| 20 | class Search extends Widget_Base { |
| 21 | |
| 22 | /** |
| 23 | * Get widget name. |
| 24 | * |
| 25 | * Retrieve 'Audio' widget name. |
| 26 | * |
| 27 | * @since 1.0.0 |
| 28 | * @access public |
| 29 | * |
| 30 | * @return string Widget name. |
| 31 | */ |
| 32 | public function get_name() { |
| 33 | return 'aux_search'; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Get widget title. |
| 38 | * |
| 39 | * Retrieve 'Audio' widget title. |
| 40 | * |
| 41 | * @since 1.0.0 |
| 42 | * @access public |
| 43 | * |
| 44 | * @return string Widget title. |
| 45 | */ |
| 46 | public function get_title() { |
| 47 | return __('Search', 'auxin-elements' ); |
| 48 | } |
| 49 | |
| 50 | public function has_widget_inner_wrapper(): bool { |
| 51 | return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | /** |
| 56 | * Get widget icon. |
| 57 | * |
| 58 | * Retrieve 'Audio' widget icon. |
| 59 | * |
| 60 | * @since 1.0.0 |
| 61 | * @access public |
| 62 | * |
| 63 | * @return string Widget icon. |
| 64 | */ |
| 65 | public function get_icon() { |
| 66 | return 'eicon-search auxin-badge'; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Get widget categories. |
| 71 | * |
| 72 | * Retrieve 'Audio' widget icon. |
| 73 | * |
| 74 | * @since 1.0.0 |
| 75 | * @access public |
| 76 | * |
| 77 | * @return string Widget icon. |
| 78 | */ |
| 79 | public function get_categories() { |
| 80 | return array( 'auxin-core' ); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Register 'Audio' widget controls. |
| 85 | * |
| 86 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 87 | * |
| 88 | * @since 1.0.0 |
| 89 | * @access protected |
| 90 | */ |
| 91 | protected function register_controls() { |
| 92 | |
| 93 | /*-----------------------------------------------------------------------------------*/ |
| 94 | /* skin_section |
| 95 | /*-----------------------------------------------------------------------------------*/ |
| 96 | |
| 97 | $this->start_controls_section( |
| 98 | 'display_section', |
| 99 | array( |
| 100 | 'label' => __('Display', 'auxin-elements' ) |
| 101 | ) |
| 102 | ); |
| 103 | |
| 104 | $this->add_control( |
| 105 | 'has_submit', |
| 106 | array( |
| 107 | 'label' => __('Display Submit','auxin-elements' ), |
| 108 | 'type' => Controls_Manager::SWITCHER, |
| 109 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 110 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 111 | 'return_value' => 'yes', |
| 112 | 'default' => 'no' |
| 113 | ) |
| 114 | ); |
| 115 | |
| 116 | $this->add_control( |
| 117 | 'has_submit_icon', |
| 118 | array( |
| 119 | 'label' => __('Display Submit Icon','auxin-elements' ), |
| 120 | 'type' => Controls_Manager::SWITCHER, |
| 121 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 122 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 123 | 'return_value' => 'yes', |
| 124 | 'default' => 'yes', |
| 125 | 'condition' => array( |
| 126 | 'has_submit!' => 'yes', |
| 127 | ) |
| 128 | ) |
| 129 | ); |
| 130 | |
| 131 | $this->add_control( |
| 132 | 'has_field', |
| 133 | array( |
| 134 | 'label' => __('Display Field','auxin-elements' ), |
| 135 | 'type' => Controls_Manager::SWITCHER, |
| 136 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 137 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 138 | 'return_value' => 'yes', |
| 139 | 'default' => 'yes' |
| 140 | ) |
| 141 | ); |
| 142 | |
| 143 | $this->add_control( |
| 144 | 'has_form', |
| 145 | array( |
| 146 | 'label' => __('Display Form','auxin-elements' ), |
| 147 | 'type' => Controls_Manager::SWITCHER, |
| 148 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 149 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 150 | 'return_value' => 'yes', |
| 151 | 'default' => 'yes' |
| 152 | ) |
| 153 | ); |
| 154 | |
| 155 | // $this->add_control( |
| 156 | // 'has_toggle_icon', |
| 157 | // array( |
| 158 | // 'label' => __('Display Toggle','auxin-elements' ), |
| 159 | // 'type' => Controls_Manager::SWITCHER, |
| 160 | // 'label_on' => __( 'On', 'auxin-elements' ), |
| 161 | // 'label_off' => __( 'Off', 'auxin-elements' ), |
| 162 | // 'return_value' => 'yes', |
| 163 | // 'default' => 'no' |
| 164 | // ) |
| 165 | // ); |
| 166 | |
| 167 | // $this->add_control( |
| 168 | // 'toggle_icon_class', |
| 169 | // array( |
| 170 | // 'label' => __('Icon for toggle','auxin-elements' ), |
| 171 | // 'type' => Controls_Manager::ICON, |
| 172 | // 'condition' => array( |
| 173 | // 'has_toggle_icon' => 'yes', |
| 174 | // ) |
| 175 | // ) |
| 176 | // ); |
| 177 | |
| 178 | $this->end_controls_section(); |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Render image box widget output on the frontend. |
| 183 | * |
| 184 | * Written in PHP and used to generate the final HTML. |
| 185 | * |
| 186 | * @since 1.0.0 |
| 187 | * @access protected |
| 188 | */ |
| 189 | protected function render() { |
| 190 | |
| 191 | $settings = $this->get_settings_for_display(); |
| 192 | |
| 193 | $args = array( |
| 194 | 'has_field' => $settings['has_field'], |
| 195 | 'has_submit' => $settings['has_submit'], |
| 196 | 'has_form' => $settings['has_form'], |
| 197 | 'has_submit_icon' => $settings['has_submit_icon'], |
| 198 | 'has_toggle_icon' => false, |
| 199 | 'toggle_icon_class' => '', |
| 200 | ); |
| 201 | |
| 202 | echo auxin_widget_search_field_callcack( $args ); |
| 203 | } |
| 204 | |
| 205 | } |
| 206 |