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

global $options, $labels;

$contact_text = $options->get_option('contact-text');
$shop_phone = $options->get_option('shop-phone');
$shop_email = $options->get_option('shop-email');
?>
<div class="footer-contact">
    <ul>
        <?php echo $contact_text ? '<li class="contact-text">' . esc_html(irk_translated_string($contact_text)) . '</li>' : null; ?>
        <?php
        if ($shop_phone) {
            echo '<li class="shop-phone">';
            echo $labels->get_label('phone-number') . ': ';
            $shop_phone = explode(',', $shop_phone);
            $i = 0;
            foreach ($shop_phone as $phone) {
                echo '<a href="tel:' . esc_html($phone) . '">' . esc_html($phone) . '</a>';
                if (count($shop_phone) != ($i + 1)) {
                    echo ', ';
                }
                $i++;
            }
            echo '</li>';
        }
        ?>
        <?php echo $shop_email ? '<li class="shop-email">' . $labels->get_label('email-address') . ': <a href="mailto:' . esc_attr($shop_email) . '">' . esc_html($shop_email) . '</a></li>' : null; ?>
    </ul>
</div>