2026-08-07 11:52:31 +00:00

56 lines
3.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// ─── День открытых дверей (CF school_open_day_*) ───
if (! defined('ABSPATH')) exit;
$open_day_phone = get_option('branch_phone') ?: carbon_get_theme_option('site_phone') ?: '';
$open_day_clean = $open_day_phone ? preg_replace('/[\s\-\–\(\)]/', '', $open_day_phone) : '';
$od_post_id = get_the_ID();
$od_photo_id = crb_get_post_meta($od_post_id, 'school_open_day_photo');
$od_photo_url = $od_photo_id ? wp_get_attachment_url((int)$od_photo_id) : wp_get_attachment_url(752);
$od_lead = crb_get_post_meta($od_post_id, 'school_open_day_lead', 'Хотите убедиться, что наша школа идеально подойдёт вашему ребёнку?');
$od_title = crb_get_post_meta($od_post_id, 'school_open_day_title', 'Записаться на день открытых дверей');
$od_footnote = crb_get_post_meta($od_post_id, 'school_open_day_footnote', 'Бесплатно · 30 минут · Без обязательств');
$open_day_points = crb_get_post_meta($od_post_id, 'school_open_day_points');
if (empty($open_day_points) || ! is_array($open_day_points)) {
$open_day_points = [
'Индивидуальный формат встречи',
'Экскурсия по школе',
'Знакомство с преподавателем',
'Бесплатное тестирование ребёнка',
];
}
if (is_array($open_day_points) && isset($open_day_points[0]['text'])) {
$open_day_points = wp_list_pluck($open_day_points, 'text');
}
$open_day_points = array_values(array_filter((array) $open_day_points));
?>
<section class="school-open-day section-bg reveal" data-bg="open-day" id="open-day" aria-label="День открытых дверей">
<div class="container">
<div class="school-open-day__inner">
<div class="school-open-day__content">
<span class="bento-label">День открытых дверей</span>
<h2 class="bento-h2"><?php echo esc_html($od_title); ?></h2>
<p class="school-open-day__lead"><?php echo esc_html($od_lead); ?></p>
<ul class="school-open-day__list">
<?php foreach ($open_day_points as $point) : ?>
<li class="school-open-day__point">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#2563EB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="M22 4 12 14.01l-3-3"/></svg>
<span><?php echo esc_html($point); ?></span>
</li>
<?php endforeach; ?>
</ul>
<div class="school-open-day__actions">
<button class="btn-write btn-primary open-bitrix-form" data-track="open-day-cta"><?php echo esc_html(crb_get_post_meta($od_post_id, 'school_cta_label', 'Записаться на экскурсию')); ?></button>
<?php if ($open_day_phone && $open_day_clean) : ?>
<a class="school-open-day__phone" href="tel:<?php echo esc_attr($open_day_clean); ?>"><?php echo esc_html($open_day_phone); ?></a>
<?php endif; ?>
</div>
<p class="school-open-day__footnote"><?php echo esc_html($od_footnote); ?></p>
</div>
<div class="school-open-day__visual">
<img src="<?php echo esc_url($od_photo_url); ?>" alt="Начальные классы школы Декарт в Щелково" loading="lazy" width="550" height="390" class="school-open-day__photo">
</div>
</div>
</div>
</section>