| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/pia/wp-content/plugins/happy-elementor-addons-pro/controls/ |
Upload File : |
<?php
/**
* Image Selector Control Class
*
* @package Happy_Addons_Pro
*/
namespace Happy_Addons_Pro\Controls;
use \Elementor\Base_Data_Control;
class Image_Selector extends Base_Data_Control {
/**
* Control identifier
*/
const TYPE = 'ha-image-selector';
/**
* Set control type.
*/
public function get_type() {
return self::TYPE;
}
/**
* Enqueue control scripts and styles.
*/
public function enqueue() {
wp_enqueue_style(
'hapro-editor-css',
HAPPY_ADDONS_PRO_ASSETS.'/admin/css/editor.min.css',
[],
HAPPY_ADDONS_PRO_VERSION
);
}
/**
* Set default settings
*/
protected function get_default_settings() {
return [
'label_block' => true,
'toggle' => true,
'col' => 3,
'options' => [],
];
}
/**
* control field markup
*/
public function content_template() {
$control_uid = $this->get_control_uid('{{ value }}');
?>
<div class="elementor-control-field">
<label class="elementor-control-title">{{{ data.label }}}</label>
<div class="ha-control-image-selector-wrapper">
<# _.each( data.options, function( options, value ) { #>
<input id="<?php echo $control_uid; ?>" type="radio" name="ha-image-selector-{{ data.name }}-{{ data._cid }}" value="{{ value }}" data-setting="{{ data.name }}">
<label class="ha-image-selector-label tooltip-target col-{{{ data.col }}}" for="<?php echo $control_uid; ?>" data-tooltip="{{ options.title }}" title="{{ options.title }}">
<img src="{{ options.url }}" alt="{{ options.title }}">
<span class="elementor-screen-only">{{{ options.title }}}</span>
</label>
<# } ); #>
</div>
</div>
<# if ( data.description ) { #>
<div class="elementor-control-field-description">{{{ data.description }}}</div>
<# } #>
<?php
}
}