PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.7.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.7.2
4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / core / elementor-controls / image-choose.php
shopengine / core / elementor-controls Last commit date
assets 1 year ago ajax-select2.php 1 year ago control-manager.php 1 year ago image-choose.php 4 years ago init.php 3 years ago
image-choose.php
95 lines
1 <?php
2 namespace ShopEngine\Core\Elementor_Controls;
3
4 defined( 'ABSPATH' ) || exit;
5
6 class Image_Choose extends \Elementor\Base_Data_Control {
7
8 /**
9 * Get choose control type.
10 *
11 * Retrieve the control type, in this case `choose`.
12 *
13 * @since 1.0.0
14 * @access public
15 *
16 * @return string Control type.
17 */
18 public function get_type() {
19 return 'imagechoose';
20 }
21
22 /**
23 * Enqueue ontrol scripts and styles.
24 *
25 * @since 1.0.0
26 * @access public
27 */
28 public function enqueue() {
29 // styles
30 wp_register_style( 'shopengine-css-image-choose-control', Init::get_url() . 'assets/css/imagechoose.css', [], '1.0.0' );
31 wp_enqueue_style( 'shopengine-css-image-choose-control' );
32
33 // script
34 wp_register_script( 'shopengine-js-image-choose-control', Init::get_url() . 'assets/js/imagechoose.js' );
35 wp_enqueue_script( 'shopengine-js-image-choose-control' );
36 }
37
38 /**
39 * Render choose control output in the editor.
40 *
41 * Used to generate the control HTML in the editor using Underscore JS
42 * template. The variables for the class are available using `data` JS
43 * object.
44 *
45 * @since 1.0.0
46 * @access public
47 */
48 public function content_template() {
49 $control_uid = $this->get_control_uid( '{{value}}' );
50 ?>
51 <div class="elementor-control-field">
52 <label class="elementor-control-title">{{{ data.label }}}</label>
53 <div class="elementor-control-input-wrapper">
54 <div class="elementor-image-choices">
55 <# _.each( data.options, function( options, value ) { #>
56 <div class="image-choose-label-block"
57 style="width:{{ options.width }}">
58 <input id="<?php echo esc_attr($control_uid); ?>" type="radio" name="elementor-choose-{{ data.name }}-{{ data._cid }}" value="{{ value }}">
59 <label class="elementor-image-choices-label" for="<?php echo esc_attr($control_uid); ?>" title="{{ options.title }}">
60 <img class="imagesmall" src="{{ options.imagesmall }}" alt="{{ options.title }}" />
61 <span class="imagelarge">
62 <img src="{{ options.imagelarge }}" alt="{{ options.title }}" />
63 </span>
64 <span class="elementor-screen-only">{{{ options.title }}}</span>
65 </label>
66 </div>
67 <# } ); #>
68 </div>
69 </div>
70 </div>
71
72 <# if ( data.description ) { #>
73 <div class="elementor-control-field-description">{{{ data.description }}}</div>
74 <# } #>
75 <?php
76 }
77
78 /**
79 * Get choose control default settings.
80 *
81 * Retrieve the default settings of the choose control. Used to return the
82 * default settings while initializing the choose control.
83 *
84 * @since 1.0.0
85 * @access protected
86 *
87 * @return array Control default settings.
88 */
89 protected function get_default_settings() {
90 return [
91 'label_block' => true,
92 'options' => []
93 ];
94 }
95 }