* @copyright 2007-2022 Leotheme * @license http://leotheme.com - prestashop template provider */ namespace LeoElements; use LeoElements\Leo_Helper; if ( ! defined( '_PS_VERSION_' ) ) { exit; // Exit if accessed directly. } /** * Elementor settings controls. * * Elementor settings controls handler class responsible for creating the final * HTML for various input field types used in Elementor settings pages. * * @since 1.0.0 */ class Settings_Controls { /** * Render settings control. * * Generates the final HTML on the frontend for any given field based on * the field type (text, select, checkbox, raw HTML, etc.). * * @since 1.0.0 * @access public * @static * * @param array $field Optional. Field data. Default is an empty array. */ public static function render( $field = [] ) { if ( empty( $field ) || empty( $field['id'] ) ) { return; } $defaults = [ 'type' => '', 'attributes' => [], 'std' => '', 'desc' => '', ]; $field = array_merge( $defaults, $field ); $method_name = $field['type']; if ( ! method_exists( __CLASS__, $method_name ) ) { $method_name = 'text'; } self::$method_name( $field ); } /** * Render text control. * * Generates the final HTML for text controls. * * @since 2.0.0 * @access private * @static * * @param array $field Field data. */ private static function text( array $field ) { if ( empty( $field['attributes']['class'] ) ) { $field['attributes']['class'] = 'regular-text'; } $attributes = Utils::render_html_attributes( $field['attributes'] ); ?> />
$option_value ) : ?>