theme-elements
6 years ago
accordion.php
6 years ago
audio.php
6 years ago
before-after.php
6 years ago
button.php
6 years ago
carousel-navigation.php
6 years ago
contact-box.php
6 years ago
contact-form.php
6 years ago
custom-list.php
6 years ago
divider.php
6 years ago
gallery.php
6 years ago
gmap.php
6 years ago
heading-modern.php
6 years ago
icon.php
6 years ago
image.php
6 years ago
mailchimp.php
6 years ago
modern-button.php
6 years ago
quote.php
6 years ago
recent-comments.php
6 years ago
recent-posts-grid-carousel.php
6 years ago
recent-posts-land-style.php
6 years ago
recent-posts-masonry.php
6 years ago
recent-posts-tiles-carousel.php
6 years ago
recent-posts-tiles.php
6 years ago
recent-posts-timeline.php
6 years ago
recent-products.php
6 years ago
responsive-table.php
6 years ago
search.php
6 years ago
staff.php
6 years ago
svg.php
6 years ago
tabs.php
6 years ago
testimonial.php
6 years ago
text.php
6 years ago
touch-slider.php
6 years ago
video.php
6 years ago
search.php
201 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 | /** |
| 51 | * Get widget icon. |
| 52 | * |
| 53 | * Retrieve 'Audio' widget icon. |
| 54 | * |
| 55 | * @since 1.0.0 |
| 56 | * @access public |
| 57 | * |
| 58 | * @return string Widget icon. |
| 59 | */ |
| 60 | public function get_icon() { |
| 61 | return 'eicon-search auxin-badge'; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Get widget categories. |
| 66 | * |
| 67 | * Retrieve 'Audio' widget icon. |
| 68 | * |
| 69 | * @since 1.0.0 |
| 70 | * @access public |
| 71 | * |
| 72 | * @return string Widget icon. |
| 73 | */ |
| 74 | public function get_categories() { |
| 75 | return array( 'auxin-core' ); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Register 'Audio' widget controls. |
| 80 | * |
| 81 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 82 | * |
| 83 | * @since 1.0.0 |
| 84 | * @access protected |
| 85 | */ |
| 86 | protected function _register_controls() { |
| 87 | |
| 88 | /*-----------------------------------------------------------------------------------*/ |
| 89 | /* skin_section |
| 90 | /*-----------------------------------------------------------------------------------*/ |
| 91 | |
| 92 | $this->start_controls_section( |
| 93 | 'display_section', |
| 94 | array( |
| 95 | 'label' => __('Display', 'auxin-elements' ) |
| 96 | ) |
| 97 | ); |
| 98 | |
| 99 | $this->add_control( |
| 100 | 'has_submit', |
| 101 | array( |
| 102 | 'label' => __('Display Submit','auxin-elements' ), |
| 103 | 'type' => Controls_Manager::SWITCHER, |
| 104 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 105 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 106 | 'return_value' => 'yes', |
| 107 | 'default' => 'no' |
| 108 | ) |
| 109 | ); |
| 110 | |
| 111 | $this->add_control( |
| 112 | 'has_submit_icon', |
| 113 | array( |
| 114 | 'label' => __('Display Submit Icon','auxin-elements' ), |
| 115 | 'type' => Controls_Manager::SWITCHER, |
| 116 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 117 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 118 | 'return_value' => 'yes', |
| 119 | 'default' => 'yes', |
| 120 | 'condition' => array( |
| 121 | 'has_submit!' => 'yes', |
| 122 | ) |
| 123 | ) |
| 124 | ); |
| 125 | |
| 126 | $this->add_control( |
| 127 | 'has_field', |
| 128 | array( |
| 129 | 'label' => __('Display Field','auxin-elements' ), |
| 130 | 'type' => Controls_Manager::SWITCHER, |
| 131 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 132 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 133 | 'return_value' => 'yes', |
| 134 | 'default' => 'yes' |
| 135 | ) |
| 136 | ); |
| 137 | |
| 138 | $this->add_control( |
| 139 | 'has_form', |
| 140 | array( |
| 141 | 'label' => __('Display Form','auxin-elements' ), |
| 142 | 'type' => Controls_Manager::SWITCHER, |
| 143 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 144 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 145 | 'return_value' => 'yes', |
| 146 | 'default' => 'yes' |
| 147 | ) |
| 148 | ); |
| 149 | |
| 150 | // $this->add_control( |
| 151 | // 'has_toggle_icon', |
| 152 | // array( |
| 153 | // 'label' => __('Display Toggle','auxin-elements' ), |
| 154 | // 'type' => Controls_Manager::SWITCHER, |
| 155 | // 'label_on' => __( 'On', 'auxin-elements' ), |
| 156 | // 'label_off' => __( 'Off', 'auxin-elements' ), |
| 157 | // 'return_value' => 'yes', |
| 158 | // 'default' => 'no' |
| 159 | // ) |
| 160 | // ); |
| 161 | |
| 162 | // $this->add_control( |
| 163 | // 'toggle_icon_class', |
| 164 | // array( |
| 165 | // 'label' => __('Icon for toggle','auxin-elements' ), |
| 166 | // 'type' => Controls_Manager::ICON, |
| 167 | // 'condition' => array( |
| 168 | // 'has_toggle_icon' => 'yes', |
| 169 | // ) |
| 170 | // ) |
| 171 | // ); |
| 172 | |
| 173 | $this->end_controls_section(); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Render image box widget output on the frontend. |
| 178 | * |
| 179 | * Written in PHP and used to generate the final HTML. |
| 180 | * |
| 181 | * @since 1.0.0 |
| 182 | * @access protected |
| 183 | */ |
| 184 | protected function render() { |
| 185 | |
| 186 | $settings = $this->get_settings_for_display(); |
| 187 | |
| 188 | $args = array( |
| 189 | 'has_field' => $settings['has_field'], |
| 190 | 'has_submit' => $settings['has_submit'], |
| 191 | 'has_form' => $settings['has_form'], |
| 192 | 'has_submit_icon' => $settings['has_submit_icon'], |
| 193 | 'has_toggle_icon' => false, |
| 194 | 'toggle_icon_class' => '', |
| 195 | ); |
| 196 | |
| 197 | echo auxin_widget_search_field_callcack( $args ); |
| 198 | } |
| 199 | |
| 200 | } |
| 201 |