<?php
defined('ABSPATH') or die('No script kiddies please!!');
$greeting_header_text = (!empty($ciws_floating_settings['layout']['greeting_header_text'])) ? esc_attr($ciws_floating_settings['layout']['greeting_header_text']) : 'Start a Conversation';
$greeting_button_text = (!empty($ciws_floating_settings['layout']['greeting_button_text'])) ? esc_attr($ciws_floating_settings['layout']['greeting_button_text']) : 'Whatsapp';
$greeting_message_text = (!empty($ciws_floating_settings['layout']['greeting_message_text'])) ? esc_attr($ciws_floating_settings['layout']['greeting_message_text']) : '';
$greeting_footer_text = (!empty($ciws_floating_settings['layout']['greeting_footer_text'])) ? esc_attr($ciws_floating_settings['layout']['greeting_footer_text']) : '';
$selected_greeting_box_template = (!empty($ciws_floating_settings['layout']['greeting_box_template'])) ? esc_attr($ciws_floating_settings['layout']['greeting_box_template']) : 'ciws-customize-specific';
$form_label = (!empty($ciws_floating_settings['layout']['form_label'])) ? $ciws_floating_settings['layout']['form_label'] : [];
$form_label_array = maybe_unserialize($form_label);


?>


<div class="ciws-field-wrap ciws-greeting-box-template ciws-greeting-header <?php echo ($box_status == 'greeting') ? '' : esc_attr("ciws-field-hide"); ?> <?php echo ($selected_greeting_box_template == 'ciws-content-specific') ? esc_attr("ciws-field-hide") : ''; ?> ">
    <label>
        <?php esc_html_e('Greeting Box Header Text', 'chat-in-website'); ?>
    </label>
    <div class="ciws-field ciws-checkbox-toggle">
        <?php
        $desc = !empty($ciws_floating_settings['layout']['greeting_header_text']) ? stripslashes($ciws_floating_settings['layout']['greeting_header_text']) : '';
        $field_name = 'ciws_floating_settings[layout][greeting_header_text]';
        $content = $desc;
        $custom_editor_id = "greeting_header_text";

        $args = array(
            'media_buttons' => false, // Remove the media button.
            'textarea_name' => $field_name, // Set the custom name for the field.
            'textarea_rows' => get_option('default_post_edit_rows', 10), // Number of rows for the textarea.
            'quicktags' => true, // Enable quicktags for the text view.
            'tinymce' => array( // Customize TinyMCE settings.
                'toolbar1' => 'bold,italic,underline,strikethrough,bullist,numlist,blockquote,link,alignleft,aligncenter,alignright,fontselect,fontsizeselect',
                'fontsize_formats' => '12px 14px 16px 18px 20px 24px 30px 36px 48px 72px',
            ),
        );

        wp_editor($content, $custom_editor_id, $args);
        ?>


    </div>
</div>
<div class="ciws-field-wrap ciws-greeting-box-template <?php echo ($box_status == 'greeting') ? '' : esc_attr("ciws-field-hide") ?>">
    <label>
        <?php esc_html_e('Greeting Message Text', 'chat-in-website'); ?>
    </label>
    <div class="ciws-field ciws-checkbox-toggle">
        <?php
        $desc1 = (!empty($ciws_floating_settings['layout']['greeting_message_text'])) ? stripslashes($ciws_floating_settings['layout']['greeting_message_text']) : '';
        $field_name1 = 'ciws_floating_settings[layout][greeting_message_text]';

        $custom_editor_id1 = "greeting_message_box";

        $args1 = array(
            'media_buttons' => false, // This setting removes the media button.
            'textarea_name' => $field_name1, // Set custom name.
            'textarea_rows' => get_option('default_post_edit_rows', 10), // Determine the number of rows.
            'quicktags' => true, // Set to true to have the Text view.
            'tinymce' => array( // Customize TinyMCE settings.
                'toolbar1' => 'bold,italic,underline,strikethrough,bullist,numlist,blockquote,link,alignleft,aligncenter,alignright,fontselect,fontsizeselect',
                'fontsize_formats' => '12px 14px 16px 18px 20px 24px 30px 36px 48px 72px',
            ),
        );

        wp_editor($desc1, $custom_editor_id1, $args1);
        ?>

    </div>
</div>
<div class="ciws-field-wrap ciws-greeting-box-template <?php echo ($box_status == 'greeting') ? '' : esc_attr("ciws-field-hide"); ?>">
    <label>
        <?php esc_html_e('Button Text', 'chat-in-website'); ?>
    </label>
    <div class="ciws-field ciws-checkbox-toggle">
        <input name="ciws_floating_settings[layout][greeting_button_text]" type="text" class="ciws-floating-box-title greeting-click-btn" value="<?php echo esc_attr($greeting_button_text); ?>" required="required" />
    </div>
</div>
<div class="ciws-field-wrap ciws-greeting-box-template <?php echo ($box_status == 'greeting') ? '' : esc_attr("ciws-field-hide"); ?>">
    <label>
        <?php esc_html_e('Greeting Footer Text', 'chat-in-website'); ?>
    </label>
    <div class="ciws-field ciws-checkbox-toggle">
        <?php
        $desc2 = (!empty($ciws_floating_settings['layout']['greeting_footer_text'])) ? stripslashes($ciws_floating_settings['layout']['greeting_footer_text']) : '';
        $field_name2 = 'ciws_floating_settings[layout][greeting_footer_text]';

        $custom_editor_id2 = "greeting_footer_box";

        $args2 = array(
            'media_buttons' => false, // This setting removes the media button.
            'textarea_name' => $field_name2, // Set custom name.
            'textarea_rows' => get_option('default_post_edit_rows', 10), // Determine the number of rows.
            'quicktags' => true, // Set to true to have the Text view.
            'tinymce' => array( // Customize TinyMCE settings.
                'toolbar1' => 'bold,italic,underline,strikethrough,bullist,numlist,blockquote,link,alignleft,aligncenter,alignright,fontselect,fontsizeselect',
                'fontsize_formats' => '12px 14px 16px 18px 20px 24px 30px 36px 48px 72px',
            ),
        );

        wp_editor($desc2, $custom_editor_id2, $args2);
        ?>

    </div>
</div>