templates
4 months ago
Accordion.php
9 months ago
Alerts_Box.php
9 months ago
Blog_Grid.php
6 months ago
Cheat_Sheet.php
6 months ago
Counter.php
6 months ago
Dynamic_Faq.php
1 month ago
Icon_Box.php
6 months ago
Integrations.php
6 months ago
List_Item.php
9 months ago
Tabs.php
6 months ago
Team_Carousel.php
6 months ago
Testimonial.php
6 months ago
Timeline.php
9 months ago
Video_Playlist.php
6 months ago
Video_Popup.php
6 months ago
Integrations.php
238 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Use namespace to avoid conflict |
| 4 | */ |
| 5 | |
| 6 | namespace SPEL\Widgets; |
| 7 | |
| 8 | use Elementor\Group_Control_Background; |
| 9 | use Elementor\Group_Control_Border; |
| 10 | use Elementor\Group_Control_Typography; |
| 11 | use Elementor\Widget_Base; |
| 12 | use Elementor\Controls_Manager; |
| 13 | use Elementor\Repeater; |
| 14 | |
| 15 | // Exit if accessed directly |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Class Team |
| 22 | * @package spider\Widgets |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | class Integrations extends Widget_Base { |
| 26 | |
| 27 | public function get_name() { |
| 28 | return 'docy_integrations'; // ID of the widget (Don't change this name) |
| 29 | } |
| 30 | |
| 31 | public function get_title() { |
| 32 | return esc_html__( 'Integrations', 'spider-elements' ); |
| 33 | } |
| 34 | |
| 35 | public function get_icon() { |
| 36 | return 'eicon-integration spel-icon'; |
| 37 | } |
| 38 | |
| 39 | public function get_keywords() { |
| 40 | return [ 'spider', 'elements', 'logo', 'client logo', 'circle logo' ]; |
| 41 | } |
| 42 | |
| 43 | public function get_categories() { |
| 44 | return [ 'spider-elements' ]; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Name: get_style_depends() |
| 49 | * Desc: Register the required CSS dependencies for the frontend. |
| 50 | */ |
| 51 | public function get_style_depends() { |
| 52 | return [ 'elegant-icon', 'spel-dark-mode', 'spel-main' ]; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Name: get_script_depends() |
| 57 | * Desc: Register the required JS dependencies for the frontend. |
| 58 | */ |
| 59 | public function get_script_depends() { |
| 60 | return [ 'spel-el-widgets' ]; |
| 61 | } |
| 62 | |
| 63 | |
| 64 | /** |
| 65 | * Name: register_controls() |
| 66 | * Desc: Register controls for these widgets |
| 67 | * Params: no params |
| 68 | * Return: @void |
| 69 | * Since: @1.0.0 |
| 70 | * Package: @spider-elements |
| 71 | * Author: spider-themes |
| 72 | */ |
| 73 | protected function register_controls() { |
| 74 | $this->elementor_content_control(); |
| 75 | $this->integration_control(); |
| 76 | $this->integration_style_control(); |
| 77 | } |
| 78 | |
| 79 | |
| 80 | /** |
| 81 | * Name: elementor_content_control() |
| 82 | * Desc: Register the Content Tab output on the Elementor editor. |
| 83 | * Params: no params |
| 84 | * Return: @void |
| 85 | * Since: @1.0.0 |
| 86 | * Package: @spider-elements |
| 87 | * Author: spider-themes |
| 88 | */ |
| 89 | |
| 90 | public function elementor_content_control() { |
| 91 | |
| 92 | // ============================ Select Style ===========================// |
| 93 | $this->start_controls_section( |
| 94 | 'select_style', |
| 95 | [ |
| 96 | 'label' => esc_html__( 'Preset Skins', 'spider-elements' ), |
| 97 | ] |
| 98 | ); |
| 99 | |
| 100 | $this->add_control( |
| 101 | 'style', |
| 102 | [ |
| 103 | 'label' => esc_html__( 'Integration Style', 'spider-elements' ), |
| 104 | 'type' => Controls_Manager::CHOOSE, |
| 105 | 'options' => [ |
| 106 | '1' => [ |
| 107 | 'icon' => 'integration1', |
| 108 | 'title' => esc_html__( '01 : Integration', 'spider-elements' ) |
| 109 | ], |
| 110 | '2' => [ |
| 111 | 'icon' => 'integration2', |
| 112 | 'title' => esc_html__( '02 : Integration', 'spider-elements' ), |
| 113 | ] |
| 114 | ], |
| 115 | 'default' => '1', |
| 116 | ] |
| 117 | ); |
| 118 | |
| 119 | $this->end_controls_section(); // End Select Style |
| 120 | } |
| 121 | |
| 122 | public function integration_control() { |
| 123 | |
| 124 | //start content layout |
| 125 | $this->start_controls_section( |
| 126 | 'integration_sec', [ |
| 127 | 'label' => esc_html__( 'Integrations', 'spider-elements' ), |
| 128 | ] |
| 129 | ); |
| 130 | |
| 131 | $repeater = new \Elementor\Repeater(); |
| 132 | $repeater->add_control( |
| 133 | 'align_items', [ |
| 134 | 'type' => \Elementor\Controls_Manager::HIDDEN, |
| 135 | ] |
| 136 | ); |
| 137 | |
| 138 | $repeater->add_control( |
| 139 | 'integration_image', [ |
| 140 | 'label' => esc_html__( 'Integration Image', 'spider-elements' ), |
| 141 | 'type' => \Elementor\Controls_Manager::MEDIA, |
| 142 | 'default' => [ |
| 143 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 144 | ], |
| 145 | ] |
| 146 | ); |
| 147 | $this->add_control( |
| 148 | 'integration_item', [ |
| 149 | 'label' => esc_html__( 'Integration Item', 'spider-elements' ), |
| 150 | 'type' => \Elementor\Controls_Manager::REPEATER, |
| 151 | 'fields' => $repeater->get_controls(), |
| 152 | 'title_field' => '{{{ align_items }}}', |
| 153 | 'prevent_empty' => false, |
| 154 | ] |
| 155 | ); |
| 156 | |
| 157 | $this->end_controls_section(); |
| 158 | |
| 159 | } |
| 160 | |
| 161 | |
| 162 | /** |
| 163 | * Name: elementor_style_control() |
| 164 | * Desc: Register the Style Tab output on the Elementor editor. |
| 165 | * Params: no params |
| 166 | * Return: @void |
| 167 | * Since: @1.0.0 |
| 168 | * Package: @spider-elements |
| 169 | * Author: spider-themes |
| 170 | */ |
| 171 | public function integration_style_control() { |
| 172 | |
| 173 | $this->start_controls_section( |
| 174 | 'integration_img_style', [ |
| 175 | 'label' => esc_html__( 'Integration Image', 'spider-elements' ), |
| 176 | 'tab' => Controls_Manager::TAB_STYLE, |
| 177 | ] |
| 178 | ); |
| 179 | |
| 180 | $this->add_control( |
| 181 | 'integration_round_bg', |
| 182 | [ |
| 183 | 'label' => esc_html__( 'Background Color', 'spider-elements' ), |
| 184 | 'type' => Controls_Manager::COLOR, |
| 185 | 'selectors' => [ |
| 186 | '{{WRAPPER}} .big-circle .brand-icon' => 'background: {{VALUE}};', |
| 187 | ], |
| 188 | ] |
| 189 | ); |
| 190 | |
| 191 | $this->add_group_control( |
| 192 | Group_Control_Border::get_type(), |
| 193 | [ |
| 194 | 'name' => 'integration_border', |
| 195 | 'label' => esc_html__( 'Border', 'spider-elements' ), |
| 196 | 'selector' => '{{WRAPPER}} .big-circle .brand-icon,{{WRAPPER}} .big-circle', |
| 197 | ] |
| 198 | ); |
| 199 | |
| 200 | $this->add_control( |
| 201 | 'team_img_border_radius', |
| 202 | [ |
| 203 | 'label' => esc_html__( 'Border Radius', 'spider-elements' ), |
| 204 | 'type' => Controls_Manager::DIMENSIONS, |
| 205 | 'size_units' => [ 'px', '%', 'em' ], |
| 206 | |
| 207 | 'selectors' => [ |
| 208 | '{{WRAPPER}} .big-circle .brand-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 209 | ], |
| 210 | ] |
| 211 | ); |
| 212 | |
| 213 | $this->end_controls_section(); |
| 214 | } |
| 215 | |
| 216 | |
| 217 | /** |
| 218 | * Name: elementor_render() |
| 219 | * Desc: Render the widget output on the frontend. |
| 220 | * Params: no params |
| 221 | * Return: @void |
| 222 | * Since: @1.0.0 |
| 223 | * Package: @spider-elements |
| 224 | * Author: spider-themes |
| 225 | */ |
| 226 | protected function render() { |
| 227 | $settings = $this->get_settings_for_display(); |
| 228 | extract( $settings ); //extract all settings array to variables converted to name of key |
| 229 | //================= Template Parts =================// |
| 230 | // Whitelist valid style values to prevent Local File Inclusion |
| 231 | $allowed_styles = array( '1', '2' ); |
| 232 | $style = isset( $settings['style'] ) && in_array( $settings['style'], $allowed_styles, true ) ? $settings['style'] : '1'; |
| 233 | include __DIR__ . "/templates/integration/integration-{$style}.php"; |
| 234 | } |
| 235 | |
| 236 | |
| 237 | } |
| 238 |