File manager - Edit - /home/premiey/www/wp-includes/images/media/traits.tar
Back
quiz-control.php 0000666 00000042710 15165313306 0007736 0 ustar 00 <?php namespace MetForm\Traits; use \Elementor\Controls_Manager; use \Elementor\Repeater; use \Elementor\Utils; defined( 'ABSPATH' ) || exit; /* * This is a global widget control trait. * There are some different fucntions for different control section. * For registering any widget just use this trait and call control section function which you want to use. */ trait Quiz_Control{ protected function get_form_type(){ $post_id = get_the_ID(); $form_type = isset(\MetForm\Core\Forms\Action::instance()->get_all_data($post_id)['form_type']) ? \MetForm\Core\Forms\Action::instance()->get_all_data($post_id)['form_type'] : 'contact_form'; return $form_type; } protected function quiz_controls($param = []) { $this->add_control( 'mf_input_label_status', [ 'label' => esc_html__( 'Label', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'yes', ] ); $this->add_control( 'mf_input_name', [ 'label' => esc_html__( 'Name', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_name(), 'title' => esc_html__( 'Enter name of the input', 'metform' ), 'description' => esc_html__('Name is must required. Enter name without space or any special character. use only underscore/ hyphen (_/-) for multiple word. Name must be different.', 'metform'), 'frontend_available' => true, ] ); $this->add_control( 'mf_input_label', [ 'label' => esc_html__( 'Label', 'metform' ), 'type' => Controls_Manager::TEXTAREA, 'rows' => 2, 'default' => esc_html__( 'Question', 'metform' ), 'title' => esc_html__( 'Enter question', 'metform' ), 'placeholder' => esc_html__( 'Enter question', 'metform' ), ] ); $this->add_control( 'mf_quiz_point', [ 'label' => esc_html__( 'Point', 'metform' ), 'type' => Controls_Manager::NUMBER, 'default' => 0, 'min' => 0, 'title' => esc_html__( 'Enter point', 'metform' ), 'placeholder' => esc_html__( 'Enter point', 'metform' ), 'description' => esc_html__( "Note: if the point and the negative point both are set at zero, we won't consider it a question.", 'metform' ), ] ); if(in_array('text', $param)){ $this->add_control( 'mf_quiz_add_answer', [ 'label' => esc_html__( 'Add answer for the question?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => 'Yes', 'label_off' => 'No', 'return_value' => 'yes', ] ); $this->add_control( 'mf_quiz_question_answer', [ 'label' => esc_html__( 'Answer:', 'metform' ), 'type' => Controls_Manager::TEXTAREA, 'rows' => 2, 'title' => esc_html__( 'Enter answer', 'metform' ), 'placeholder' => esc_html__( 'Enter answer', 'metform' ), 'condition' => [ 'mf_quiz_add_answer' => 'yes', ], ] ); $this->add_control( 'mf_quiz_add_negative_point', [ 'label' => esc_html__( 'Add negative point?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => 'Yes', 'label_off' => 'No', 'return_value' => 'yes', 'condition' => [ 'mf_quiz_add_answer' => 'yes', ], ] ); } if(!in_array("text", $param)){ $this->add_control( 'mf_quiz_add_negative_point', [ 'label' => esc_html__( 'Add negative point?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'label_on' => 'Yes', 'label_off' => 'No', 'return_value' => 'yes', ] ); } $this->add_control( 'mf_quiz_negative_point', [ 'label' => esc_html__( 'Negative point', 'metform' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'default' => 0, 'step' => 0.5, 'title' => esc_html__( 'Enter negative point', 'metform' ), 'condition' => [ 'mf_quiz_add_negative_point' => 'yes', ], ] ); if(in_array("text", $param)){ $this->add_control( 'mf_input_placeholder', [ 'label' => esc_html__( 'Placeholder', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_title(), 'title' => esc_html__( 'Enter placeholder', 'metform' ), ] ); } $this->add_control( 'mf_input_help_text', [ 'label' => esc_html__( 'Help Text : ', 'metform' ), 'type' => Controls_Manager::TEXTAREA, 'rows' => 3, 'placeholder' => esc_html__( 'Type your help text', 'metform' ), ] ); if(in_array('radio', $param) || in_array('checkbox', $param) || in_array('toggle-select', $param)){ $this->add_control( 'mf_input_display_option', [ 'label' => esc_html__( 'Option Display : ', 'metform' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'inline-block' => esc_html__( 'Horizontal', 'metform' ), 'block' => esc_html__( 'Vertical', 'metform' ), ], 'default' => 'inline-block', 'selectors' => [ '{{WRAPPER}} .mf-radio-option' => 'display: {{VALUE}};', '{{WRAPPER}} .mf-checkbox-option' => 'display: {{VALUE}};', '{{WRAPPER}} .mf-toggle-select-option' => 'display: {{VALUE}};', ], 'description' => esc_html__('Option display style.', 'metform'), ] ); } if(in_array('image-select', $param)){ $this->add_control( 'mf_input_display_option', [ 'label' => esc_html__( 'Option Display : ', 'metform' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'inline-flex' => esc_html__( 'Horizontal', 'metform' ), 'inline-block' => esc_html__( 'Vertical', 'metform' ), ], 'default' => 'inline-flex', 'selectors' => [ '{{WRAPPER}} .mf-image-select' => 'display: {{VALUE}};', ], 'description' => esc_html__('Image select option display style.', 'metform'), ] ); } if(in_array('select', $param)){ $this->add_control( 'mf_input_data_type', [ 'label' => esc_html__('Data Type', 'metform'), 'type' => Controls_Manager::HIDDEN, 'default' => 'custom' ] ); $this->add_control( 'mf_input_placeholder', [ 'label' => esc_html__( 'Placeholder', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_title(), 'title' => esc_html__( 'Enter placeholder', 'metform' ), ] ); } if(in_array('radio', $param) || in_array('checkbox', $param)){ $this->add_control( 'mf_input_option_text_position', [ 'label' => esc_html__( 'Option Text Position : ', 'metform' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'after' => esc_html__( 'After', 'metform' ), 'before' => esc_html__( 'Before', 'metform' ), ], 'default' => 'after', 'description' => esc_html__('Where do you want to option?', 'metform'), ] ); } if(in_array('image-select', $param) || in_array('toggle-select', $param)){ $this->add_control( 'mf_input_options_multiselect', [ 'label' => esc_html__( 'Type : ', 'metform' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'radio' => esc_html__( 'Single Answer', 'metform' ), 'checkbox' => esc_html__( 'Multiple Answer', 'metform' ), ], 'default' => 'radio', ] ); } if(in_array('radio', $param) || in_array('checkbox', $param) || in_array('select', $param)){ $input_fields = new Repeater(); $input_fields->add_control( 'mf_input_option_text', [ 'label' => esc_html__( 'Option Text', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Option Text' , 'metform' ), 'label_block' => true, 'description' => esc_html__('Select option text that will be show to user.', 'metform'), ] ); $input_fields->add_control( 'mf_input_option_value', [ 'label' => esc_html__( 'Option Value', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Option Value' , 'metform' ), 'label_block' => true, ] ); $input_fields->add_control( 'mf_input_option_status', [ 'label' => esc_html__( 'Option Status', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => '', ] ); $input_fields->add_control( 'mf_input_option_selected', [ 'label' => esc_html__( 'Select it default ? ', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => '', ] ); $input_fields->add_control( 'mf_quiz_question_answer', [ 'label' => esc_html__( 'Select as answer?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'yes' => esc_html__( 'Yes', 'metform' ), '' => esc_html__( 'No', 'metform' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'mf_input_list', [ 'label' => esc_html__( 'Options', 'metform' ), 'type' => Controls_Manager::REPEATER, 'fields' => $input_fields->get_controls(), 'default' => [ [ 'mf_input_option_text' => 'Option 1', 'mf_input_option_value' => 'value-1', 'mf_input_option_status' => '', ], [ 'mf_input_option_text' => 'Option 2', 'mf_input_option_value' => 'value-2', 'mf_input_option_status' => '', ], [ 'mf_input_option_text' => 'Option 3', 'mf_input_option_value' => 'value-3', 'mf_input_option_status' => '', ], ], 'title_field' => '{{{ mf_input_option_text }}}', 'description' => esc_html__('You can add/edit here your selector options.', 'metform'), 'frontend_available' => true, ] ); } if(in_array('multi-select', $param)){ $this->add_control( 'mf_input_placeholder', [ 'label' => esc_html__( 'Placeholder', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_title(), 'title' => esc_html__( 'Enter here place holder', 'metform' ), ] ); $input_fields = new Repeater(); $input_fields->add_control( 'label', [ 'label' => esc_html__( 'Option Text', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Input Text' , 'metform' ), 'label_block' => true, 'description' => esc_html__('Select option text that will be show to user.', 'metform'), ] ); $input_fields->add_control( 'value', [ 'label' => esc_html__( 'Option Value', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Input Value' , 'metform' ), 'label_block' => true, 'description' => esc_html__('Select list value that will be store/mail to desired person.', 'metform'), ] ); $input_fields->add_control( 'mf_input_option_status', [ 'label' => esc_html__( 'Status', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => '', ] ); $input_fields->add_control( 'mf_input_option_selected', [ 'label' => esc_html__( 'Select it default ? ', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => '', ] ); $input_fields->add_control( 'mf_quiz_question_answer', [ 'label' => esc_html__( 'Select as answer?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'yes' => esc_html__( 'Yes', 'metform' ), '' => esc_html__( 'No', 'metform' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'mf_input_list', [ 'label' => esc_html__( 'Options', 'metform' ), 'type' => Controls_Manager::REPEATER, 'fields' => $input_fields->get_controls(), 'title_field' => '{{{ label }}}', 'default' => [ [ 'label' => 'Item 1', 'value' => 'value-1', 'mf_input_option_status' => '', ], [ 'label' => 'Item 2', 'value' => 'value-2', 'mf_input_option_status' => '', ], [ 'label' => 'Item 3', 'value' => 'value-3', 'mf_input_option_status' => '', ], ], 'description' => esc_html__('You can add/edit here your selector options.', 'metform'), 'frontend_available' => true, ] ); } if(in_array('toggle-select', $param)){ $input_fields = new Repeater(); $input_fields->add_control( 'mf_input_option_text', [ 'label' => esc_html__( 'Toggle for select', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'toggle', 'metform' ), 'placeholder' => esc_html__( 'Enter toggle text', 'metform' ), ] ); $input_fields->add_control( 'mf_input_option_value', [ 'label' => esc_html__( 'Option Value', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'value' , 'metform' ), 'label_block' => true, ] ); $input_fields->add_control( 'mf_input_option_status', [ 'label' => esc_html__( 'Option Status', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => '', ] ); $input_fields->add_control( 'mf_input_option_default_value', [ 'label' => esc_html__( 'Select it default ?', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'no', ] ); $input_fields->add_control( 'mf_quiz_question_answer', [ 'label' => esc_html__( 'Select as answer?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'yes' => esc_html__( 'Yes', 'metform' ), '' => esc_html__( 'No', 'metform' ), 'return_value' => 'yes', 'default' => '', ] ); $input_fields->add_control( 'mf_input_icon_status', [ 'label' => esc_html__( 'Add Icon', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'metform' ), 'label_off' => esc_html__( 'Hide', 'metform' ), 'return_value' => 'yes', 'default' => '', 'separator' => 'before', ] ); $input_fields->add_control( 'mf_input_icon', [ 'label' =>esc_html__( 'Icon', 'metform' ), 'type' => Controls_Manager::ICONS, 'label_block' => true, 'default' => [ 'value' => 'fas fa-star', 'library' => 'solid', ], 'condition' => [ 'mf_input_icon_status' => 'yes', ], ] ); $input_fields->add_control( 'mf_input_icon_align', [ 'label' =>esc_html__( 'Icon Position', 'metform' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' =>esc_html__( 'Before', 'metform' ), 'right' =>esc_html__( 'After', 'metform' ), ], 'condition' => [ 'mf_input_icon_status' => 'yes', ], ] ); $this->add_control( 'mf_input_list', [ 'label' => esc_html__( 'Toggle select Options', 'metform' ), 'type' => Controls_Manager::REPEATER, 'fields' => $input_fields->get_controls(), 'default' => [ [ 'mf_input_option_text' => 'toggle-1', 'mf_input_option_value' => 'toggle-1', 'mf_input_option_status' => '', ], [ 'mf_input_option_text' => 'toggle-2', 'mf_input_option_value' => 'toggle-2', 'mf_input_option_status' => '', ], [ 'mf_input_option_text' => 'toggle-3', 'mf_input_option_value' => 'toggle-3', 'mf_input_option_status' => '', ], ], 'title_field' => '{{{ mf_input_option_text }}}', 'description' => esc_html__('You can add/edit here your selector options.', 'metform'), 'frontend_available' => true, ] ); } if(in_array('image-select', $param)){ $input_fields = new Repeater(); $input_fields->add_control( 'mf_image_select_title', [ 'label' => esc_html__( 'Title', 'metform' ), 'type' => Controls_Manager::TEXT, ] ); $input_fields->add_control( 'mf_input_option_text', [ 'label' => esc_html__( 'Thumbnail', 'metform' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $input_fields->add_control( 'mf_input_option_img_hover', [ 'label' => esc_html__( 'Preview (Optional)', 'metform' ), 'type' => Controls_Manager::MEDIA, ] ); $input_fields->add_control( 'mf_input_option_value', [ 'label' => esc_html__( 'Option Value', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Option Value' , 'metform' ), 'label_block' => true, ] ); $input_fields->add_control( 'mf_input_option_status', [ 'label' => esc_html__( 'Option Status', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => '', ] ); $input_fields->add_control( 'mf_input_option_default_value', [ 'label' => esc_html__( 'Select it default ?', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => 'no', ] ); $input_fields->add_control( 'mf_quiz_question_answer', [ 'label' => esc_html__( 'Select as answer?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'yes' => esc_html__( 'Yes', 'metform' ), '' => esc_html__( 'No', 'metform' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'mf_input_list', [ 'label' => esc_html__( 'Image select Options', 'metform' ), 'type' => Controls_Manager::REPEATER, 'fields' => $input_fields->get_controls(), 'default' => [ [ 'mf_input_option_value' => 'image-1', 'mf_input_option_status' => '', ], [ 'mf_input_option_value' => 'image-2', 'mf_input_option_status' => '', ], [ 'mf_input_option_value' => 'image-3', 'mf_input_option_status' => '', ], ], 'title_field' => '{{{ mf_image_select_title }}}', 'description' => esc_html__('You can add/edit here your selector options.', 'metform'), 'frontend_available' => true, ] ); } } } conditional-controls.php 0000666 00000010472 15165313306 0011434 0 ustar 00 <?php namespace MetForm\Traits; use \Elementor\Controls_Manager; use \Elementor\Repeater; defined( 'ABSPATH' ) || exit; /* * This is a global conditional widget control trait. * There are some different fucntions for different control section. * For registering any conditional widget just use this trait and call control section function which you want to use. */ trait Conditional_Controls{ public function input_conditional_control(){ if(!class_exists('\MetForm_Pro\Base\Package')){ return; } $this->start_controls_section( 'condition_section', [ 'label' => esc_html__( 'Conditional logic', 'metform' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'mf_conditional_logic_form_enable', [ 'label' => esc_html__( 'Enable', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'description' => esc_html__( 'This feature only works on the frontend.', 'metform' ), 'label_on' => 'Yes', 'label_off' => 'No', 'return_value' => 'yes', 'frontend_available' => true ] ); $this->add_control( 'mf_conditional_logic_form_and_or_operators', [ 'label' => esc_html__( 'Condition match criteria', 'metform' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'frontend_available' => true, 'options' => [ 'and' => esc_html__( 'AND', 'metform' ), 'or' => esc_html__( 'OR', 'metform' ), ], 'default' => 'and', 'condition' => [ 'mf_conditional_logic_form_enable' => 'yes', ], ] ); $this->add_control( 'mf_conditional_logic_form_action', [ 'label' => esc_html__( 'Action', 'metform' ), 'label_block' => true, 'frontend_available' => true, 'type' => Controls_Manager::SELECT, 'multiple' => true, 'options' => [ 'show' => 'Show this field', 'hide' => 'Hide this field', ], 'default' => 'show', 'condition' => [ 'mf_conditional_logic_form_enable' => 'yes', ], ] ); $repeater = new Repeater(); $repeater->add_control( 'mf_conditional_logic_form_if', [ 'label' => esc_html__( 'If', 'metform' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Input field name', 'metform' ), ] ); $repeater->add_control( 'mf_conditional_logic_form_comparison_operators', [ 'label' => esc_html__( 'Match ( comparison )', 'metform' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'options' => [ 'not-empty' => esc_html__( 'not empty', 'metform' ), 'empty' => esc_html__( 'empty', 'metform' ), '==' => esc_html__( 'equals', 'metform' ), '!=' => esc_html__( 'not equals', 'metform' ), '>' => esc_html__( 'greater than', 'metform' ), '>=' => esc_html__( 'greater than equal', 'metform' ), '<' => esc_html__( 'smaller than', 'metform' ), '<=' => esc_html__( 'smaller than equal', 'metform' ), ], 'default' => 'not-empty', ] ); $repeater->add_control( 'mf_conditional_logic_form_value', [ 'label' => esc_html__( 'Match value', 'metform' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__( '50', 'metform' ), 'condition' => [ 'mf_conditional_logic_form_comparison_operators' => ['==','!=','>','>=','<','<=','contains'], ], ] ); $repeater->add_control( 'mf_conditional_logic_form_set_value', [ 'label' => esc_html__( 'Value for set', 'metform' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Enter value for set', 'metform' ), 'description' => esc_html__( 'E.g 100, name, anything', 'metform' ), 'condition' => [ 'mf_conditional_logic_form_action' => 'set_value', ], ] ); $this->add_control( 'mf_conditional_logic_form_list', array( 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'frontend_available' => true, 'condition' => [ 'mf_conditional_logic_form_enable' => 'yes', ], 'title_field' => '{{{ mf_conditional_logic_form_if }}} {{{ mf_conditional_logic_form_comparison_operators }}} {{{ (mf_conditional_logic_form_comparison_operators == "empty" || mf_conditional_logic_form_comparison_operators == "not-empty") ? "" : mf_conditional_logic_form_value }}}', ) ); $this->end_controls_section(); } } button-controls.php 0000666 00000032647 15165313306 0010454 0 ustar 00 <?php namespace MetForm\Traits; use \Elementor\Controls_Manager; use \Elementor\Group_Control_Background; use \Elementor\Group_Control_Box_Shadow; use \Elementor\Group_Control_Typography; use \Elementor\Repeater; use \Elementor\Group_Control_Text_Shadow; defined( 'ABSPATH' ) || exit; trait Button_Controls{ protected function button_content_control(){ $this->add_control( 'mf_btn_text', [ 'label' =>esc_html__( 'Label', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_title(), 'placeholder' => $this->get_title(), 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'mf_btn_section_settings', [ 'label' => esc_html__( 'Settings', 'metform' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'mf_btn_align', [ 'label' =>esc_html__( 'Button alignment', 'metform' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'metform' ), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'metform' ), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'metform' ), 'icon' => 'fa fa-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'metform' ), 'icon' => 'fa fa-align-justify', ], ], 'prefix_class' => 'mf-btn-%s-', 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .mf-btn-wraper' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'mf_btn_icon', [ 'label' =>esc_html__( 'Icon', 'metform' ), 'type' => Controls_Manager::ICONS, 'label_block' => true, ] ); $this->add_control( 'mf_btn_icon_align', [ 'label' =>esc_html__( 'Icon Position', 'metform' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' =>esc_html__( 'Before', 'metform' ), 'right' =>esc_html__( 'After', 'metform' ), ], 'condition' => [ 'mf_btn_icon!' => '', ], ] ); $this->add_control( 'mf_btn_class', [ 'label' => esc_html__( 'Class', 'metform' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Class Name', 'metform' ), ] ); $this->add_control( 'mf_btn_id', [ 'label' => esc_html__( 'id', 'metform' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'ID', 'metform' ), ] ); } protected function hidden_input_content_control(){ $hidden_input = new Repeater(); $hidden_input->add_control( 'mf_hidden_input_name', [ 'label' => esc_html__( 'Input Name : ', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => 'mf-hidden-input-name', ] ); $hidden_input->add_control( 'mf_hidden_input_value', [ 'label' => esc_html__( 'Input Value', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => 'mf_hidden_input_value', ] ); $hidden_input->add_control( 'mf_hidden_input_class', [ 'label' => esc_html__( 'Input Class', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => 'mf_hidden_input_class', ] ); $this->add_control( 'mf_hidden_input', [ 'label' => esc_html__( 'Input List', 'metform' ), 'type' => Controls_Manager::REPEATER, 'fields' => $hidden_input->get_controls(), 'title_field' => '{{{ mf_hidden_input_name }}}', ] ); } protected function button_style_control(){ $this->add_responsive_control( 'mf_btn_text_padding', [ 'label' =>esc_html__( 'Padding', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'default' => [ 'top' => '15', 'right' => '20', 'bottom' => '15', 'left' => '20', 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .metform-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_btn_typography', 'label' =>esc_html__( 'Typography', 'metform' ), 'selector' => '{{WRAPPER}} .metform-btn', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'mf_btn_shadow', 'selector' => '{{WRAPPER}} .metform-btn', ] ); $this->start_controls_tabs( 'mf_btn_tabs_style' ); $this->start_controls_tab( 'mf_btn_tabnormal', [ 'label' =>esc_html__( 'Normal', 'metform' ), ] ); $this->add_responsive_control( 'mf_btn_text_color', [ 'label' =>esc_html__( 'Text Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .metform-btn' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'mf_btn_bg_color', 'selector' => '{{WRAPPER}} .metform-btn', ) ); $this->end_controls_tab(); $this->start_controls_tab( 'mf_btn_tab_button_hover', [ 'label' =>esc_html__( 'Hover', 'metform' ), ] ); $this->add_responsive_control( 'mf_btn_hover_color', [ 'label' =>esc_html__( 'Text Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .metform-btn:hover' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), array( 'name' => 'mf_btn_bg_hover_color', 'default' => '#337ab7', 'selector' => '{{WRAPPER}} .metform-btn:hover', ) ); $this->end_controls_tab(); $this->end_controls_tabs(); } protected function button_border_control(){ $this->add_responsive_control( 'mf_btn_border_style', [ 'label' => esc_html_x( 'Border Type', 'Border Control', 'metform' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => esc_html__( 'None', 'metform' ), 'solid' => esc_html_x( 'Solid', 'Border Control', 'metform' ), 'double' => esc_html_x( 'Double', 'Border Control', 'metform' ), 'dotted' => esc_html_x( 'Dotted', 'Border Control', 'metform' ), 'dashed' => esc_html_x( 'Dashed', 'Border Control', 'metform' ), 'groove' => esc_html_x( 'Groove', 'Border Control', 'metform' ), ], 'default' => 'none', 'selectors' => [ '{{WRAPPER}} .metform-btn' => 'border-style: {{VALUE}};', ], ] ); $this->add_responsive_control( 'mf_btn_border_dimensions', [ 'label' => esc_html_x( 'Width', 'Border Control', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'condition' => [ 'mf_btn_border_style!' => 'none' ], 'selectors' => [ '{{WRAPPER}} .metform-btn' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'xs_tabs_button_border_style' ); $this->start_controls_tab( 'mf_btn_tab_border_normal', [ 'label' =>esc_html__( 'Normal', 'metform' ), 'condition' => [ 'mf_btn_border_style!' => 'none' ], ] ); $this->add_responsive_control( 'mf_btn_border_color', [ 'label' => esc_html_x( 'Color', 'Border Control', 'metform' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .metform-btn' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'mf_btn_tab_button_border_hover', [ 'label' =>esc_html__( 'Hover', 'metform' ), 'condition' => [ 'mf_btn_border_style!' => 'none' ], ] ); $this->add_responsive_control( 'mf_btn_hover_border_color', [ 'label' => esc_html_x( 'Color', 'Border Control', 'metform' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'condition' => [ 'mf_btn_border_style!' => 'none' ], 'selectors' => [ '{{WRAPPER}} .metform-btn:hover' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'mf_btn_border_radius', [ 'label' =>esc_html__( 'Border Radius', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%'], 'default' => [ 'top' => '5', 'right' => '5', 'bottom' => '5' , 'left' => '5', ], 'selectors' => [ '{{WRAPPER}} .metform-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); } protected function button_shadow_control(){ $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'mf_btn_box_shadow_group', 'selector' => '{{WRAPPER}} .metform-btn', ] ); } protected function button_icon_control(){ $this->start_controls_tabs( 'mf_icon_btn_tabs_style' ); $this->start_controls_tab( 'mf_icon_btn_tab_normal', [ 'label' =>esc_html__( 'Normal', 'metform' ), ] ); $this->add_control( 'mf_btn_normal_icon_color', [ 'label' => esc_html__( 'Icon Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .mf-btn-wraper svg' => 'fill: {{VALUE}}', '{{WRAPPER}} .mf-btn-wraper i' => 'color: {{VALUE}}' ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'mf_icon_btn_tab_button_hover', [ 'label' =>esc_html__( 'Hover', 'metform' ), ] ); $this->add_control( 'mf_btn_hover_icon_color', [ 'label' => esc_html__( 'Icon Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'default' => '#FFFFFF', 'selectors' => [ '{{WRAPPER}} .metform-btn:hover svg' => 'fill: {{VALUE}}', '{{WRAPPER}} .metform-btn:hover i' => 'color: {{VALUE}}' ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'mf_btn_normal_icon_font_size', array( 'label' => esc_html__( 'Font Size', 'metform' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', 'rem', ), 'range' => array( 'px' => array( 'min' => 1, 'max' => 100, ), ), 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => array( '{{WRAPPER}} .mf-btn-wraper svg ' => 'width: {{SIZE}}{{UNIT}}', '{{WRAPPER}} .mf-btn-wraper i ' => 'font-size: {{SIZE}}{{UNIT}}' ), ) ); $this->add_responsive_control( 'mf_btn_normal_icon_padding', [ 'label' => esc_html__( 'Padding', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'default' => [ 'unit' => 'px', 'size' => 5, ], 'selectors' => [ '{{WRAPPER}} .metform-btn > svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .metform-btn > i' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'mf_btn_normal_icon_vertical_align', array( 'label' => esc_html__( 'Vertical Align', 'metform' ), 'type' => Controls_Manager::SLIDER, 'size_units' => array( 'px', 'em', 'rem', ), 'range' => array( 'px' => array( 'min' => -20, 'max' => 20, ), 'em' => array( 'min' => -5, 'max' => 5, ), 'rem' => array( 'min' => -5, 'max' => 5, ), ), 'selectors' => array( '{{WRAPPER}} .metform-btn > svg' => ' -webkit-transform: translateY({{SIZE}}{{UNIT}}); -ms-transform: translateY({{SIZE}}{{UNIT}}); transform: translateY({{SIZE}}{{UNIT}})', '{{WRAPPER}} .metform-btn > i' => ' -webkit-transform: translateY({{SIZE}}{{UNIT}}); -ms-transform: translateY({{SIZE}}{{UNIT}}); transform: translateY({{SIZE}}{{UNIT}})', ), ) ); } } singleton.php 0000666 00000000415 15165313306 0007266 0 ustar 00 <?php namespace MetForm\Traits; trait Singleton { private static $instance; public static function instance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; } } common-controls.php 0000666 00000110414 15165313306 0010416 0 ustar 00 <?php namespace MetForm\Traits; use \Elementor\Controls_Manager; use \Elementor\Group_Control_Border; use \Elementor\Group_Control_Background; use \Elementor\Group_Control_Box_Shadow; use \Elementor\Group_Control_Typography; defined( 'ABSPATH' ) || exit; /* * This is a global widget control trait. * There are some different fucntions for different control section. * For registering any widget just use this trait and call control section function which you want to use. */ trait Common_Controls{ protected function input_content_controls($param = [], $widget_name = ''){ $this->add_control( 'mf_input_label_status', [ 'label' => esc_html__( 'Show Label', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'on' => esc_html__( 'Show', 'metform' ), 'off' => esc_html__( 'Hide', 'metform' ), 'return_value' => 'yes', 'default' => 'yes', 'description' => esc_html__('for adding label on input turn it on. Don\'t want to use label? turn it off.', 'metform'), ] ); $this->add_control( 'mf_input_label_display_property', [ 'label' => esc_html__( 'Position', 'metform' ), 'type' => Controls_Manager::SELECT, 'default' => 'block', 'options' => [ 'block' => esc_html__( 'Top', 'metform' ), 'inline-block' => esc_html__( 'Left', 'metform' ), ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'display: {{VALUE}}', ], 'condition' => [ 'mf_input_label_status' => 'yes', ], 'description' => esc_html__('Select label position. where you want to see it. top of the input or left of the input.', 'metform'), ] ); $this->add_control( 'mf_input_label', [ 'label' => esc_html__( 'Label : ', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_title(), 'title' => esc_html__( 'Enter here label of input', 'metform' ), 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); if(in_array('NO_NAME', $param)){ $this->add_control( 'mf_input_name', [ 'label' => esc_html__( 'Name : ', 'metform' ), 'type' => Controls_Manager::HIDDEN, 'default' => $this->get_name(), 'frontend_available' => true, ] ); } if(!in_array('NO_NAME', $param) && !in_array('FIXED_NAME', $param)){ $this->add_control( 'mf_input_name', [ 'label' => esc_html__( 'Name', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_name(), 'title' => esc_html__( 'Enter here name of the input', 'metform' ), 'description' => esc_html__('Name is must required. Enter name without space or any special character. use only underscore/ hyphen (_/-) for multiple word. Name must be different.', 'metform'), 'frontend_available' => true, ] ); } if(in_array('FIXED_NAME', $param)){ $this->add_control( 'mf_input_name_declaration', [ 'label' => esc_html__( 'Fixed Field Name : ', 'metform' ), 'type' => Controls_Manager::RAW_HTML, 'raw' => '<p style="margin-top: 3px;"><strong>'. $widget_name .'</strong></p>', ] ); } if( !in_array('NO_PLACEHOLDER', $param) ){ $this->add_control( 'mf_input_placeholder', [ 'label' => esc_html__( 'Place holder', 'metform' ), 'type' => Controls_Manager::TEXT, 'default' => $this->get_title(), 'title' => esc_html__( 'Enter here place holder', 'metform' ), ] ); } $this->add_control( 'mf_input_help_text', [ 'label' => esc_html__( 'Help Text : ', 'metform' ), 'type' => Controls_Manager::TEXTAREA, 'rows' => 3, 'placeholder' => esc_html__( 'Type your help text here', 'metform' ), ] ); } protected function input_setting_controls($param = []){ if(!in_array('NO_REQUIRED',$param)){ $this->add_control( 'mf_input_required', [ 'label' => esc_html__( 'Required ?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'yes' => esc_html__( 'Yes', 'metform' ), 'no' => esc_html__( 'No', 'metform' ), 'return_value' => 'yes', 'default' => 'no', 'description' => esc_html__('Is this field is required for submit the form?. Make it "Yes".', 'metform'), ] ); } $validation_options = [ 'none' => esc_html__( 'None', 'metform' ), 'by_character_length' => esc_html__( 'By character length', 'metform' ), ]; if( ! in_array('EXCLUDE_WORD_LENGTH', $param ) ) { $validation_options['by_word_length'] = esc_html__( 'By Word length', 'metform' ); } if( class_exists('\MetForm_Pro\Base\Package') ){ $validation_options['by_expresssion_based'] = esc_html__( 'By expression based', 'metform' ); } if( in_array('VALIDATION', $param ) ){ $this->add_control( 'mf_input_validation_type', [ 'label' => esc_html__( 'Validation type', 'metform' ), 'type' => Controls_Manager::SELECT, 'default' => 'none', 'options' => $validation_options, ] ); } if( in_array('NUM_VALIDATION', $param ) ){ $this->add_control( 'mf_input_validation_type', [ 'label' => esc_html__( 'Validation type', 'metform' ), 'type' => Controls_Manager::SELECT, 'default' => 'none', 'options' => ['none' => esc_html__( 'None', 'metform' ), 'by_range' => esc_html__( 'By range', 'metform' ), 'by_expresssion_based' => esc_html__( 'By expression based', 'metform' )], ] ); $this->add_control( 'mf_input_min_value', [ 'label' => esc_html__( 'Min Value', 'metform' ), 'type' => Controls_Manager::NUMBER, 'step' => 1, 'condition' => [ 'mf_input_validation_type' => ['by_range'] ], ] ); $this->add_control( 'mf_input_max_value', [ 'label' => esc_html__( 'Max Value', 'metform' ), 'type' => Controls_Manager::NUMBER, 'step' => 1, 'condition' => [ 'mf_input_validation_type' => ['by_range'] ], ] ); } $this->add_control( 'mf_input_min_length', [ 'label' => esc_html__( 'Min Length', 'metform' ), 'type' => Controls_Manager::NUMBER, 'step' => 1, 'condition' => [ 'mf_input_validation_type' => ['by_character_length', 'by_word_length'] ], ] ); $this->add_control( 'mf_input_max_length', [ 'label' => esc_html__( 'Max Length', 'metform' ), 'type' => Controls_Manager::NUMBER, 'step' => 1, 'condition' => [ 'mf_input_validation_type' => ['by_character_length', 'by_word_length'] ], ] ); if( class_exists('\MetForm_Pro\Base\Package') ){ $this->add_control( 'mf_input_validation_expression', [ 'label' => esc_html__( 'Expression for validate ', 'metform' ), 'type' => Controls_Manager::TEXTAREA, 'rows' => 2, 'placeholder' => esc_html__( 'Ex: [a-zA-Z]+ ', 'metform' ), 'condition' => [ 'mf_input_validation_type' => 'by_expresssion_based' ], ] ); } $this->add_control( 'mf_input_validation_warning_message', [ 'label' => esc_html__( 'Warning message', 'metform' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Warning message', 'metform' ), 'default' => esc_html__( 'This field is required.', 'metform' ), 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'name' => 'mf_input_required', 'operator' => '===', 'value' => 'yes', ], [ 'name' => 'mf_input_validation_type', 'operator' => '!=', 'value' => 'none', ], ], ], ] ); } protected function input_general_control(){ $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'mf_input_label_box_shadow', 'label' => esc_html__( 'Box Shadow', 'metform' ), 'selector' => '{{WRAPPER}} .mf-input-wrapper', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'mf_input_label_border', 'label' => esc_html__( 'Border', 'metform' ), 'selector' => '{{WRAPPER}} .mf-input-wrapper', ] ); $this->add_responsive_control( 'mf_input_label_border_radius', [ 'label' => esc_html__( 'Border Radius', 'metform' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px','%'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ] ], 'default' => [ 'unit' => 'px', 'size' => 0, ], 'selectors' => [ '{{WRAPPER}} .mf-input-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'mf_input_label_border_border!' => '', ], ] ); } protected function input_label_controls($param = []){ $this->add_control( 'mf_input_label_width', [ 'label' => esc_html__( 'Width', 'metform' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 5, ] ], 'default' => [ 'unit' => '%', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .mf-input-wrapper .mf-input:not(.mf-left-parent), {{WRAPPER}} .mf-input-wrapper .multi-option-input-type' => 'display: inline-block; width: calc(100% - {{SIZE}}{{UNIT}} - 7px)', '{{WRAPPER}} .mf-input-wrapper > .iti' => 'width: calc(100% - {{SIZE}}{{UNIT}} - 7px)', '{{WRAPPER}} .mf-input-calculation-total' => 'width: calc(100% - {{SIZE}}{{UNIT}} - 7px); display: inline-block;', '{{WRAPPER}} .range-slider' => 'width: calc(100% - {{SIZE}}{{UNIT}} - 7px)', '{{WRAPPER}} .mf-input-wrapper .flatpickr-wrapper, {{WRAPPER}} .mf-input-wrapper .react-tel-input' => 'display: inline-block; width: calc(100% - {{SIZE}}{{UNIT}} - 7px);', '{{WRAPPER}} .mf-form-wrapper label' => 'margin-right: 4px;', ], 'condition' => [ 'mf_input_label_display_property' => 'inline-block', ], ] ); $this->add_control( 'mf_input_label_color', [ 'label' => esc_html__( 'Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'color: {{VALUE}}', ], 'default' => '#000000', 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_label_typography', 'label' => esc_html__( 'Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .mf-input-label', 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_responsive_control( 'mf_input_label_padding', [ 'label' => esc_html__( 'Padding', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_responsive_control( 'mf_input_label_margin', [ 'label' => esc_html__( 'Margin', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_control( 'mf_input_required_indicator_color', [ 'label' => esc_html__( 'Required Indicator Color:', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'default' => '#f00', 'selectors' => [ '{{WRAPPER}} .mf-input-required-indicator' => 'color: {{VALUE}}', '{{WRAPPER}} .mf-input-wrapper .mf-input[aria-invalid="true"], {{WRAPPER}} .mf-input-wrapper .mf-input.mf-invalid' => 'border-color: {{VALUE}}', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'name' => 'mf_input_required', 'operator' => '===', 'value' => 'yes', ], [ 'name' => 'mf_input_validation_type', 'operator' => '!=', 'value' => 'none', ], ], ], ] ); $warning_condition = [ [ 'name' => 'mf_input_required', 'operator' => '===', 'value' => 'yes', ], [ 'name' => 'mf_input_validation_type', 'operator' => '!=', 'value' => 'none', ] ]; if( in_array('FILE_SIZE_WARNING', $param) ){ array_push($warning_condition, [ 'name' => 'mf_input_file_size_status', 'operator' => '===', 'value' => 'on', ] ); } $this->add_control( 'mf_input_warning_text_color', [ 'label' => esc_html__( 'Warning Text Color:', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'default' => '#f00', 'selectors' => [ '{{WRAPPER}} .mf-error-message' => 'color: {{VALUE}}' ], 'conditions' => [ 'relation' => 'or', 'terms' => $warning_condition, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_warning_text_typography', 'label' => esc_html__( 'Warning Text Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .mf-error-message', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'name' => 'mf_input_required', 'operator' => '===', 'value' => 'yes', ], [ 'name' => 'mf_input_validation_type', 'operator' => '!=', 'value' => 'none', ], ], ], ] ); } protected function summary_input_label_controls($param = []){ $this->add_control( 'mf_input_label_width', [ 'label' => esc_html__( 'Width', 'metform' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 5, ] ], 'default' => [ 'unit' => '%', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .mf-input-wrapper .mf-input:not(.mf-left-parent), {{WRAPPER}} .mf-input-wrapper .multi-option-input-type' => 'display: inline-block; width: calc(100% - {{SIZE}}{{UNIT}} - 7px)', '{{WRAPPER}} .mf-input-wrapper > .iti' => 'width: calc(100% - {{SIZE}}{{UNIT}} - 7px)', '{{WRAPPER}} .mf-input-calculation-total' => 'width: calc(100% - {{SIZE}}{{UNIT}} - 7px); display: inline-block;', '{{WRAPPER}} .range-slider' => 'width: calc(100% - {{SIZE}}{{UNIT}} - 7px)', '{{WRAPPER}} .mf-input-wrapper .flatpickr-wrapper, {{WRAPPER}} .mf-input-wrapper .react-tel-input' => 'display: inline-block; width: calc(100% - {{SIZE}}{{UNIT}} - 7px);', '{{WRAPPER}} .mf-form-wrapper label' => 'margin-right: 4px;', ], 'condition' => [ 'mf_input_label_display_property' => 'inline-block', ], ] ); $this->add_control( 'mf_input_label_color', [ 'label' => esc_html__( 'Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'color: {{VALUE}}', ], 'default' => '#000000', 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_label_typography', 'label' => esc_html__( 'Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .mf-input-label', 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_responsive_control( 'mf_input_label_padding', [ 'label' => esc_html__( 'Padding', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); $this->add_responsive_control( 'mf_input_label_margin', [ 'label' => esc_html__( 'Margin', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'mf_input_label_status' => 'yes', ], ] ); } protected function input_controls($param = []){ $this->add_responsive_control( 'mf_input_padding', [ 'label' => esc_html__( 'Padding', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf-input-file-upload-label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf-input-calculation-total' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf_select__control, {{WRAPPER}} .mf_multiselect__control .mf_multiselect__value-container, {{WRAPPER}} .mf_multiselect__option, {{WRAPPER}} .mf_multiselect__menu-notice--no-options' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf-input-wrapper .range-slider' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'mf_input_margin', [ 'label' => esc_html__( 'Margin', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf-input-file-upload-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf-input-calculation-total' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .mf-input-wrapper .range-slider' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}}', ], ] ); if(!in_array('ONLY_BOX_SHADOW', $param)){ $this->start_controls_tabs( 'mf_input_tabs_style' ); $this->start_controls_tab( 'mf_input_tabnormal', [ 'label' =>esc_html__( 'Normal', 'metform' ), ] ); $this->add_control( 'mf_input_color', [ 'label' => esc_html__( 'Input Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input, {{WRAPPER}} {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}', '{{WRAPPER}} .irs--round .irs-bar, {{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'background-color: {{VALUE}}', '{{WRAPPER}} .irs--round .irs-handle' => 'border-color: {{VALUE}}', '{{WRAPPER}} .irs--round .irs-from:before, {{WRAPPER}} .irs--round .irs-to:before, {{WRAPPER}} .irs--round .irs-single:before' => 'border-top-color: {{VALUE}}', '{{WRAPPER}} .mf_select__single-value' => 'color: {{VALUE}}', '{{WRAPPER}} .mf-input-wrapper' => 'border-color: {{VALUE}}', '{{WRAPPER}} .mf-input-wrapper .input-range__track--active' => 'background-color: {{VALUE}}', '{{WRAPPER}} .mf-input-wrapper .asRange .asRange-pointer .asRange-tip' => 'background-color: {{VALUE}}; border-color: {{VALUE}}', '{{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-calculation-total' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input-file-upload-label svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};', '{{WRAPPER}} .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value__remove,{{WRAPPER}} .mf_multiselect__menu-notice--no-options' => 'color: {{VALUE}}', ], 'default' => '#000000', ] ); if(!in_array('NO_BACKGROUND', $param)){ $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'mf_input_background', 'label' => esc_html__( 'Background', 'metform' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total,{{WRAPPER}} .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value__remove,{{WRAPPER}} .mf_multiselect__option,{{WRAPPER}} .mf_multiselect__menu-notice--no-options,{{WRAPPER}} .mf-input-multiselect .mf_multiselect__control', ] ); } if(!in_array('NO_BORDER', $param)){ $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'mf_input_border', 'label' => esc_html__( 'Border', 'metform' ), 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total, {{WRAPPER}} .mf-input-select > .mf_select__control, {{WRAPPER}} .mf-input-multiselect .mf_multiselect__control, {{WRAPPER}} .mf_multiselect__option', ] ); } $this->end_controls_tab(); $this->start_controls_tab( 'mf_input_tabhover', [ 'label' =>esc_html__( 'Hover', 'metform' ), ] ); $this->add_control( 'mf_input_color_hover', [ 'label' => esc_html__( 'Input Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}', '{{WRAPPER}} .irs--round .irs-handle:hover' => 'border-color: {{VALUE}}', '{{WRAPPER}} .mf-input-file-upload-label:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .mf-input:hover .mf_select__single-value' => 'color: {{VALUE}}', '{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label svg path' => 'stroke:{{VALUE}}; fill: {{VALUE}}', '{{WRAPPER}} .mf-input-wrapper' => 'border-color: {{VALUE}}', '{{WRAPPER}} .mf_multiselect__multi-value:hover .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value:hover .mf_multiselect__multi-value__remove,{{WRAPPER}} .mf_multiselect__menu-notice--no-options:hover' => 'color: {{VALUE}}', ], 'default' => '#000000', ] ); if(!in_array('NO_BACKGROUND', $param)){ $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'mf_input_background_hover', 'label' => esc_html__( 'Background', 'metform' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:hover,{{WRAPPER}} .mf_multiselect__option:hover, {{WRAPPER}} .mf_multiselect__multi-value:hover .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value:hover .mf_multiselect__multi-value__remove, {{WRAPPER}} .mf_multiselect__menu-notice--no-options:hover', ] ); } if(!in_array('NO_BORDER', $param)){ $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'mf_input_border_hover', 'label' => esc_html__( 'Border', 'metform' ), 'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:hover, {{WRAPPER}} .mf-input-select > .mf_select__control:hover, {{WRAPPER}} .mf_multiselect__option:hover, {{WRAPPER}} .mf_multiselect__menu-notice--no-options:hover', ] ); } $this->end_controls_tab(); $this->start_controls_tab( 'mf_input_tabfocus', [ 'label' =>esc_html__( 'Focus', 'metform' ), ] ); $this->add_control( 'mf_input_color_focus', [ 'label' => esc_html__( 'Input Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}', '{{WRAPPER}} .irs--round .irs-handle:focus' => 'border-color: {{VALUE}}', '{{WRAPPER}} .mf-input-file-upload-label:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:focus .mf-image-label, {{WRAPPER}} .mf-input-calculation-total:focus' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input > .mf_select__control--is-focused .mf_select__single-value' => 'color: {{VALUE}}', '{{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};', '{{WRAPPER}} .mf-input-wrapper' => 'border-color: {{VALUE}}', '{{WRAPPER}} .mf-input-calculation-total:focus, {{WRAPPER}} .mf_multiselect__option:focus, {{WRAPPER}} .mf_multiselect__multi-value:focus .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value:focus .mf_multiselect__multi-value__remove, {{WRAPPER}} .mf_multiselect__menu-notice--no-options:focus' => 'color: {{VALUE}}' ], 'default' => '#000000', ] ); if(!in_array('NO_BACKGROUND', $param)){ $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'mf_input_background_focus', 'label' => esc_html__( 'Background', 'metform' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input > .mf_select__control--menu-is-open, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:focus,{{WRAPPER}} .mf-input-calculation-total:focus, {{WRAPPER}} .mf_multiselect__option:focus, {{WRAPPER}} .mf_multiselect__multi-value:focus .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value:focus .mf_multiselect__multi-value__remove, {{WRAPPER}} .mf_multiselect__menu-notice--no-options:focus', ] ); } if(!in_array('NO_BORDER', $param)){ $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'mf_input_border_focus', 'label' => esc_html__( 'Border', 'metform' ), 'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total:focus, {{WRAPPER}} .mf-input-wrapper > .mf-input-select > .mf_select__control--is-focused, {{WRAPPER}} .mf_multiselect__option:focus, {{WRAPPER}} .mf_multiselect__menu-notice--no-options:focus', ] ); } $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'hr', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_typgraphy', 'label' => esc_html__( 'Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-single, {{WRAPPER}} .asRange .asRange-pointer .asRange-tip, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total, {{WRAPPER}} .mf-input-wrapper .input-range__label-container', ] ); } $this->add_responsive_control( 'mf_input_border_radius', [ 'label' => esc_html__( 'Border Radius', 'metform' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px','%'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ] ], 'default' => [ 'unit' => 'px', 'size' => 0, ], 'selectors' => [ '{{WRAPPER}} .input-range .input-range__track' => 'border-radius: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .mf-input' => 'border-radius: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total' => 'border-radius: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .mf-input-select > .mf_select__control, {{WRAPPER}} .mf-input-multiselect .mf_multiselect__control, {{WRAPPER}} .mf_multiselect__option, {{WRAPPER}} .mf_multiselect__multi-value__label, {{WRAPPER}} .mf_multiselect__multi-value__remove, {{WRAPPER}} .mf_multiselect__menu-notice--no-options ' => 'border-radius: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'mf_input_box_shadow', 'label' => esc_html__( 'Box Shadow', 'metform' ), 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-line, {{WRAPPER}} .mf-input-switch label.mf-input-control-label:before, {{WRAPPER}} .mf-input-wrapper .asRange, {{WRAPPER}} .asRange .asRange-pointer:before, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-calculation-total, {{WRAPPER}} .mf-input-select > .mf_select__control, {{WRAPPER}} .mf-input-multiselect .mf_multiselect__control, {{WRAPPER}} .mf_multiselect__option, {{WRAPPER}} .mf-input-wrapper .input-range__track--background', ] ); } protected function input_place_holder_controls(){ $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_place_holder_typography', 'label' => esc_html__( 'Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} :is(.mf_select__placeholder, .mf_multiselect__placeholder, .text), {{WRAPPER}} .mf-input::placeholder, {{WRAPPER}} .mf-time-input::before', ] ); $this->add_control( 'mf_input_placeholder_color', [ 'label' => esc_html__( 'Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input:not([type="submit"]):not([type="checkbox"]):not([type="radio"])::-webkit-input-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input:not([type="submit"]):not([type="checkbox"]):not([type="radio"])::-moz-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):-ms-input-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):-moz-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-time-input::before' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input::-webkit-input-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input::-moz-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input:-ms-input-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} .mf-input:-moz-placeholder' => 'color: {{VALUE}};', '{{WRAPPER}} :is(.mf_select__placeholder, .mf_multiselect__placeholder)' => 'color: {{VALUE}};', ], 'default' => '#c9c1c1', ] ); } protected function input_help_text_controls(){ $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'mf_input_help_text_typography', 'label' => esc_html__( 'Typography', 'metform' ), 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY, ], 'selector' => '{{WRAPPER}} .mf-input-help', ] ); $this->add_control( 'mf_input_help_text_color', [ 'label' => esc_html__( 'Color', 'metform' ), 'type' => Controls_Manager::COLOR, 'global' => [ 'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .mf-input-help' => 'color: {{VALUE}}', ], 'default' => '#939393', ] ); $this->add_responsive_control( 'mf_input_help_text_padding', [ 'label' => esc_html__( 'Padding', 'metform' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .mf-input-help' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); } public function input_get_params_controls() { if(class_exists('\MetForm_Pro\Plugin')){ $this->add_control( 'mf_input_get_params_enable', [ 'label' => esc_html__( 'Get Value From URL?', 'metform' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'metform' ), 'label_off' => esc_html__( 'No', 'metform' ), 'return_value' => 'yes', 'default' => 'no', 'frontend_available' => true ] ); } } public function help_text_control($text) { if(class_exists('\MetForm_Pro\Plugin')){ $this->add_control( 'mf_layout_note', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => esc_html($text), 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', ] ); } } }
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings