<?php
defined('ABSPATH') || exit('No Access!');

$faqs = $options->get_option('faqs');
$faqs = is_array($faqs) ? $faqs : [];
$faqs_align = $options->get_option('faqs-align');
?>
<div class="irk-settings-area irk-settings-misc">
    <h2 class="irk-settings-title">
        <span class="irk-title-icon"><span uk-icon="database"></span></span>
        <strong><?php _e('Misc', 'irk'); ?></strong>
    </h2>
    <div class="uk-margin" style="display: none;">
        <label class="uk-form-label"><?php _e('Material design icons', 'irk'); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="materialdesignicons" value="1" checked>
                <?php _e('Active', 'irk'); ?>
            </label>
        </div>
        <div class="irk-description">
            <span uk-icon="info"></span>
            <a href="https://materialdesignicons.com/" target="_blank"><?php _e('Enable this option to use material design icons.', 'irk'); ?></a>
        </div>
    </div>
    <div class="uk-margin">
        <label class="uk-form-label">
            <?php _e('Faqs', 'irk'); ?>
            <?php echo '<a href="' . get_permalink($options->get_option('faqs-page')) . '" class="irk-view-page uk-text-primary" target="_blank"> (' . __('View page', 'irk') . ')</a>'; ?>
        </label>
        <div class="uk-margin-small">
            <div uk-form-custom="target: > * > span:first-child">
                <?php
                wp_dropdown_pages([
                    'post_type' => 'page',
                    'selected' => $options->get_option('faqs-page'),
                    'name' => 'faqs-page',
                    'show_option_none' => __('None', 'irk'),
                    'echo' => 1,
                ]);
                ?>
                <button class="irk-confirm uk-button uk-button-default" type="button" tabindex="-1">
                    <span></span>
                    <span uk-icon="icon: chevron-down"></span>
                </button>
            </div>
        </div>
        <div class="uk-margin-small">
            <div>
                <?php if (count($faqs)): ?>
                    <?php foreach ($faqs as $faq): ?>
                        <div class="uk-margin-small">
                            <input type="text" class="uk-input" name="faqs[]" value="<?php echo esc_attr($faq); ?>" placeholder="<?php _e('Title@Content', 'irk'); ?>">
                        </div>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
            <a href="#" class="irk-new-faq uk-button uk-button-default uk-button-small"><?php _e('New item', 'irk'); ?></a>
        </div>
        <div class="uk-margin-small">
            <div class="uk-margin-small">
                <label>
                    <input class="uk-radio" type="radio" name="faqs-align" value="right" <?php checked($faqs_align, 'right'); ?>>
                    <?php _e('Right', 'irk'); ?>
                </label>
            </div>
            <div class="uk-margin-small">
                <label>
                    <input class="uk-radio" type="radio" name="faqs-align" value="left" <?php checked($faqs_align, 'left'); ?>>
                    <?php _e('Left', 'irk'); ?>
                </label>
            </div>
        </div>
    </div>
    <div class="uk-margin">
        <label class="uk-form-label" for="irk-redirect404"><?php _e('Error 404 redirect', 'irk'); ?></label>
        <input type="text" class="uk-input" id="irk-redirect404" name="redirect404" value="<?php echo esc_attr($options->get_option('redirect404')); ?>">
    </div>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e('Head tag', 'irk'); ?></label>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-mainbar-widget-title" value="<?php echo esc_attr($options->get_option('ht-mainbar-widget-title')); ?>" placeholder="<?php _e('Mainbar widget title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-sidebar-widget-title" value="<?php echo esc_attr($options->get_option('ht-sidebar-widget-title')); ?>" placeholder="<?php _e('Sidebar widget title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-footer-widget-title" value="<?php echo esc_attr($options->get_option('ht-footer-widget-title')); ?>" placeholder="<?php _e('Footer widget title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-footer-menu-title" value="<?php echo esc_attr($options->get_option('ht-footer-menu-title')); ?>" placeholder="<?php _e('Footer menu title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-products-slider" value="<?php echo esc_attr($options->get_option('ht-products-slider')); ?>" placeholder="<?php _e('Products slider widget product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-catalog-products" value="<?php echo esc_attr($options->get_option('ht-slider-catalog-products')); ?>" placeholder="<?php _e('Slider catalog products product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-catalog-products-title" value="<?php echo esc_attr($options->get_option('ht-slider-catalog-products-title')); ?>" placeholder="<?php _e('Slider catalog products title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-related-products" value="<?php echo esc_attr($options->get_option('ht-slider-related-products')); ?>" placeholder="<?php _e('Slider related products product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-upsell" value="<?php echo esc_attr($options->get_option('ht-slider-upsell')); ?>" placeholder="<?php _e('Slider upsell product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-crosssell" value="<?php echo esc_attr($options->get_option('ht-slider-crosssell')); ?>" placeholder="<?php _e('Slider crosssell product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-related-products-title" value="<?php echo esc_attr($options->get_option('ht-slider-related-products-title')); ?>" placeholder="<?php _e('Slider related products title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-upsell-title" value="<?php echo esc_attr($options->get_option('ht-slider-upsell-title')); ?>" placeholder="<?php _e('Slider upsell title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-slider-crosssell-title" value="<?php echo esc_attr($options->get_option('ht-slider-crosssell-title')); ?>" placeholder="<?php _e('Slider crosssell title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-related-products-title" value="<?php echo esc_attr($options->get_option('ht-related-products-title')); ?>" placeholder="<?php _e('Related products title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-upsell-title" value="<?php echo esc_attr($options->get_option('ht-upsell-title')); ?>" placeholder="<?php _e('Upsell title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-posts-slider" value="<?php echo esc_attr($options->get_option('ht-posts-slider')); ?>" placeholder="<?php _e('Posts slider widget post title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-posts" value="<?php echo esc_attr($options->get_option('ht-posts')); ?>" placeholder="<?php _e('Posts widget post title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-related-posts" value="<?php echo esc_attr($options->get_option('ht-related-posts')); ?>" placeholder="<?php _e('Related posts widget post title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-post-related-products" value="<?php echo esc_attr($options->get_option('ht-post-related-products')); ?>" placeholder="<?php _e('Post related products widget product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-amazing-slider" value="<?php echo esc_attr($options->get_option('ht-amazing-slider')); ?>" placeholder="<?php _e('Amazing slider widget product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-promotion-single" value="<?php echo esc_attr($options->get_option('ht-promotion-single')); ?>" placeholder="<?php _e('Promotion single widget product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-product-ads" value="<?php echo esc_attr($options->get_option('ht-product-ads')); ?>" placeholder="<?php _e('Product ads widget product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-catalog-product" value="<?php echo esc_attr($options->get_option('ht-catalog-product')); ?>" placeholder="<?php _e('Catalog product title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-catalog-cat" value="<?php echo esc_attr($options->get_option('ht-catalog-cat')); ?>" placeholder="<?php _e('Catalog category title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-catalog-subcat" value="<?php echo esc_attr($options->get_option('ht-catalog-subcat')); ?>" placeholder="<?php _e('Catalog subcategory title', 'irk'); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="ht-archive-post" value="<?php echo esc_attr($options->get_option('ht-archive-post')); ?>" placeholder="<?php _e('Archive post title', 'irk'); ?>">
        </div>
    </div>
</div>