Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
add_style_depends('flatpickr');
}
public function get_name() {
return 'mf-time';
}
public function get_icon() {
return 'mf-widget-icon icon-metform_time';
}
public function get_title() {
return esc_html__( 'Time', 'metform' );
}
public function has_widget_inner_wrapper(): bool {
return ! Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
}
public function show_in_panel() {
return 'metform-form' == get_post_type();
}
public function get_categories() {
return [ 'metform' ];
}
public function get_keywords() {
return ['metform', 'input', 'time', 'clock'];
}
public function get_help_url() {
return 'https://wpmet.com/doc/form-widgets/#time';
}
protected function register_controls() {
$this->start_controls_section(
'content_section',
[
'label' => esc_html__( 'Content', 'metform' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->input_content_controls();
$this->end_controls_section();
$this->start_controls_section(
'settings_section',
[
'label' => esc_html__( 'Settings', 'metform' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->input_setting_controls();
$this->add_control(
'mf_input_validation_type',
[
'label' => __( 'Validation Type', 'metform' ),
'type' => \Elementor\Controls_Manager::HIDDEN,
'default' => 'none',
]
);
$this->add_control(
'mf_input_time_24h',
[
'label' => esc_html__( 'Use time 24H', 'metform' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'metform' ),
'label_off' => esc_html__( 'No', 'metform' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->end_controls_section();
if(class_exists('\MetForm_Pro\Base\Package')){
$this->input_conditional_control();
}
$this->start_controls_section(
'label_section',
[
'label' => esc_html__( 'Label', 'metform' ),
'tab' => Controls_Manager::TAB_STYLE,
'conditions' => [
'relation' => 'or',
'terms' => [
[
'name' => 'mf_input_label_status',
'operator' => '===',
'value' => 'yes',
],
[
'name' => 'mf_input_required',
'operator' => '===',
'value' => 'yes',
],
],
],
]
);
$this->input_label_controls();
$this->end_controls_section();
$this->start_controls_section(
'input_section',
[
'label' => esc_html__( 'Input', 'metform' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->input_controls();
$this->end_controls_section();
$this->start_controls_section(
'placeholder_section',
[
'label' => esc_html__( 'Place Holder', 'metform' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->input_place_holder_controls();
$this->end_controls_section();
$this->start_controls_section(
'help_text_section',
[
'label' => esc_html__( 'Help Text', 'metform' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'mf_input_help_text!' => ''
]
]
);
$this->input_help_text_controls();
$this->end_controls_section();
$this->insert_pro_message();
}
protected function render($instance = []){
$settings = $this->get_settings_for_display();
$inputWrapStart = $inputWrapEnd = '';
extract($settings);
$render_on_editor = true;
$is_edit_mode = 'metform-form' === get_post_type() && \Elementor\Plugin::$instance->editor->is_edit_mode();
/**
* Loads the below markup on 'Editor' view, only when 'metform-form' post type
*/
if ( $is_edit_mode ):
$inputWrapStart = '';
endif;
$class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
$configData = [
'message' => $errorMessage = isset($mf_input_validation_warning_message) ? !empty($mf_input_validation_warning_message) ? $mf_input_validation_warning_message : esc_html__('This field is required.', 'metform') : esc_html__('This field is required.', 'metform'),
'required' => isset($mf_input_required) && $mf_input_required == 'yes' ? true : false,
];
$timeConfig = [
'enableTime' => true,
'dateFormat' => 'h:i K',
'noCalendar' => true,
'time_24hr' => false,
'static' => true
];
if(isset($mf_input_time_24h) && $mf_input_time_24h === 'yes'){
$timeConfig['time_24hr'] = true;
$timeConfig['dateFormat'] = 'H:i';
}
?>
<${props.Flatpickr}
name=""
className="mf-input mf-date-input mf-time-input mf-left-parent "
placeholder=""
options=${}
value=${parent.getValue('')}
onInput=${parent.handleDateTime}
aria-invalid=${validation.errors[''] ? 'true' : 'false'}
ref=${
el => {
if( el && el.node.nextSibling ) {
if( el.props.value.trim().length ) {
el.node.nextSibling.classList.add('value-found');
}else {
el.node.nextSibling.classList.remove('value-found');
}
}
register({ name: "" }, parent.activateValidation())
}
}
/>
<${validation.ErrorMessage}
errors=${validation.errors}
name=""
as=${html``}
/>
%s ', esc_html( \MetForm\Utils\Util::react_entity_support(trim($mf_input_help_text), $render_on_editor))) : ''); ?>