Submit
Path:
~
/
home
/
getwphos
/
www
/
radkingpanels
/
wp-content
/
plugins
/
poolax-core
/
addons
/
File Content:
addons-field-functions.php
<?php use \Elementor\Widget_Base; use \Elementor\Controls_Manager; use \Elementor\Group_Control_Typography; use \Elementor\Repeater; use \Elementor\Utils; use \Elementor\Group_Control_Background; use \Elementor\Group_Control_Text_Shadow; use \Elementor\Group_Control_Border; use \Elementor\Group_Control_Box_Shadow; // General Fields // poolax_general_fields($th, $id, $label, $field_type, $default_value, $condition = null); if (!function_exists('poolax_general_fields')) { function poolax_general_fields($th, $id, $label, $field_type, $default_value, $condition = null) { $control_args = [ 'label' => __( $label, 'poolax' ), 'default' => __( $default_value , 'poolax' ), 'label_block' => true, 'rows' => 4, ]; if ($field_type === 'TEXT') { $control_args['type'] = Controls_Manager::TEXT; } elseif ($field_type === 'TEXTAREA') { $control_args['type'] = Controls_Manager::TEXTAREA; } elseif ($field_type === 'HEADING') { $control_args['type'] = Controls_Manager::HEADING; } elseif ($field_type === 'WYSIWYG') { $control_args['type'] = Controls_Manager::WYSIWYG; } elseif ($field_type === 'DIVIDER') { $control_args['type'] = Controls_Manager::DIVIDER; } else{ $control_args['type'] = Controls_Manager::TEXT; } if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } } // Media Fields // poolax_media_fields($th, $id, $label, $condition = null); if (!function_exists('poolax_media_fields')) { function poolax_media_fields($th, $id, $label, $condition = null) { $control_args = [ 'label' => __( $label, 'poolax' ), 'type' => Controls_Manager::MEDIA, 'dynamic' => [ 'active' => true, ], 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ]; if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } } // URL Fields // poolax_url_fields($th, $id, $label, $default_url = '#', $condition = null); if (!function_exists('poolax_url_fields')) { function poolax_url_fields($th, $id, $label, $default_url = '#', $condition = null) { $control_args = [ 'label' => __( $label, 'poolax' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'poolax' ), 'show_external' => true, 'default' => [ 'url' => $default_url, 'is_external' => false, 'nofollow' => false, ], ]; if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } } // SELECT Fields // poolax_select_field($th, $id, $label, $options = [], $condition = null); if (!function_exists('poolax_select_field')) { function poolax_select_field($th, $id, $label, $options = [], $condition = null) { $formatted_options = generate_formatted_options($options); $control_args = [ 'label' => __( $label, 'poolax' ), 'type' => Controls_Manager::SELECT, 'options' => $formatted_options, 'default' => '1', ]; if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } function generate_formatted_options($options) { $formatted_options = []; // Check if options array is empty if (empty($options)) { // If options array is empty, add the default option $formatted_options['1'] = __( 'Option One', 'poolax' ); } // Add the rest of the options foreach ($options as $index => $option_label) { $option_id = $index + 1; // Generate option ID based on index (starting from 1) $formatted_options[$option_id] = __( $option_label, 'poolax' ); } return $formatted_options; } } // Switcher Fields // poolax_switcher_fields($th, $id, $label, $condition = null); if (!function_exists('poolax_switcher_fields')) { function poolax_switcher_fields($th, $id, $label, $condition = null) { $control_args = [ 'label' => __( $label, 'poolax' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'poolax' ), 'label_off' => __( 'No', 'poolax' ), 'return_value' => 'yes', 'default' => 'yes', ]; if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } } // Code Fields // poolax_code_fields($th, $id, $label, $condition = null); if (!function_exists('poolax_code_fields')) { function poolax_code_fields($th, $id, $label, $condition = null) { $control_args = [ 'label' => __( $label, 'poolax' ), 'type' => \Elementor\Controls_Manager::CODE, 'language' => 'html', 'rows' => 7, ]; if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } } // Social Repeater // poolax_social_fields($this, 'social', 'Social List'); if (!function_exists('poolax_social_fields')) { function poolax_social_fields($th, $id, $label, $condition = null) { $repeater = new Repeater(); $repeater->add_control( 'social_icon', [ 'label' => __( 'Social Icon', 'poolax' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fab fa-facebook-f', 'library' => 'solid', ], ] ); $repeater->add_control( 'icon_link', [ 'label' => __( 'Link', 'poolax' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'poolax' ), 'show_external' => true, 'default' => [ 'url' => '#', 'is_external' => false, 'nofollow' => true, ], ] ); $control_args = [ 'label' => __( $label , 'poolax' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'social_icon' => ['value' => 'fab fa-facebook-f', 'library' => 'solid'], 'icon_link' => ['url' => 'https://www.facebook.com', 'is_external' => false, 'nofollow' => true], ], [ 'social_icon' => ['value' => 'fab fa-twitter', 'library' => 'solid'], 'icon_link' => ['url' => 'https://www.twitter.com', 'is_external' => false, 'nofollow' => true], ], [ 'social_icon' => ['value' => 'fab fa-instagram', 'library' => 'solid'], 'icon_link' => ['url' => 'https://www.instagram.com', 'is_external' => false, 'nofollow' => true], ], [ 'social_icon' => ['value' => 'fab fa-linkedin-in', 'library' => 'solid'], 'icon_link' => ['url' => 'https://www.linkedin.com', 'is_external' => false, 'nofollow' => true], ], [ 'social_icon' => ['value' => 'fab fa-pinterest-p', 'library' => 'solid'], 'icon_link' => ['url' => 'https://pinterest.com', 'is_external' => false, 'nofollow' => true], ], ], ]; if (!empty($condition)) { $control_args['condition'] = [ 'layout_style' => $condition, ]; } $th->add_control($id, $control_args); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
header
---
0755
widgets
---
0755
addons-field-functions.php
8608 bytes
0644
addons-style-functions.php
8462 bytes
0644
addons.php
9057 bytes
0644
N4ST4R_ID | Naxtarrr