hesabixWpTheme/page-hesabix-module.php

621 lines
31 KiB
PHP

<?php
/**
* Template Name: صفحهٔ ماژول / راه‌حل حسابیکس
*
* @package Hesabix2
*/
get_header();
$key = get_post_meta(get_queried_object_id(), '_hesabix_module_key', true);
if (!$key) {
$key = get_post_field('post_name', get_queried_object_id());
}
$def = function_exists('hesabix2_module_page_def') ? hesabix2_module_page_def((string) $key) : null;
if (!$def) {
echo '<main class="site-main hx-module"><div class="hx-module__wrap"><p class="hx-module-section__text">';
esc_html_e('محتوای این صفحه یافت نشد.', 'hesabix2');
echo '</p></div></main>';
get_footer();
return;
}
$wrap = 'hx-module__wrap';
$arc = function_exists('hesabix2_fp_arc_url') ? hesabix2_fp_arc_url() : 'https://arc.hesabix.ir';
$layout = isset($def['layout']) ? (string) $def['layout'] : 'default';
$title = isset($def['title']) ? (string) $def['title'] : get_the_title();
$badge = isset($def['badge']) ? (string) $def['badge'] : '';
$lead = isset($def['lead']) ? (string) $def['lead'] : '';
$intro = isset($def['intro']) ? (string) $def['intro'] : '';
$related = !empty($def['related']) && is_array($def['related']) ? $def['related'] : array();
$is_rich = !empty($def['page_design']) && 'rich' === $def['page_design'];
$skin = !empty($def['skin']) ? sanitize_html_class((string) $def['skin']) : '';
$cta_title = !empty($def['cta_title']) ? (string) $def['cta_title'] : __('آمادهٔ امتحان در آرک هستید؟', 'hesabix2');
$cta_text = !empty($def['cta_text']) ? (string) $def['cta_text'] : __('ثبت‌نام رایگان است؛ همین حالا پنل را بسازید و این ماژول را در عمل ببینید.', 'hesabix2');
$cta_primary = !empty($def['cta_primary']) ? (string) $def['cta_primary'] : __('شروع رایگان — آرک', 'hesabix2');
$main_class = 'hx-module';
if ($is_rich) {
$main_class .= ' hx-module--rich';
}
if ($skin) {
$main_class .= ' hx-module--skin-' . $skin;
}
$main_class .= ' hx-module--layout-' . sanitize_html_class($layout);
$hero_points = array();
if (!empty($def['features']) && is_array($def['features'])) {
$hero_points = array_slice(array_values($def['features']), 0, 3);
} elseif (!empty($def['benefits']) && is_array($def['benefits'])) {
foreach (array_slice(array_values($def['benefits']), 0, 3) as $benefit) {
if (!empty($benefit['title'])) {
$hero_points[] = $benefit['title'];
}
}
}
$hero_metrics = array();
if (!empty($def['rich']['stats']) && is_array($def['rich']['stats'])) {
$hero_metrics = array_slice(array_values($def['rich']['stats']), 0, 2);
} elseif (!empty($def['benefits']) && is_array($def['benefits'])) {
foreach (array_slice(array_values($def['benefits']), 0, 2) as $benefit) {
if (!empty($benefit['title'])) {
$hero_metrics[] = array(
'value' => '✓',
'label' => $benefit['title'],
);
}
}
}
?>
<main id="main-content" class="<?php echo esc_attr($main_class); ?>">
<section class="hx-module-hero<?php echo $skin ? ' hx-module-hero--' . esc_attr($skin) : ''; ?>">
<div class="<?php echo esc_attr($wrap); ?> hx-module-hero__inner">
<?php if (function_exists('hesabix2_seo_render_breadcrumb')) : ?>
<div class="hx-module-breadcrumb"><?php hesabix2_seo_render_breadcrumb('hesabix2-breadcrumb hesabix2-breadcrumb--on-dark'); ?></div>
<?php endif; ?>
<div class="hx-module-hero__layout">
<div class="hx-module-hero__copy">
<?php if ($badge) : ?>
<span class="hx-module-hero__badge"><?php echo esc_html($badge); ?></span>
<?php endif; ?>
<h1 class="hx-module-hero__title"><?php echo esc_html($title); ?></h1>
<?php if ($lead) : ?>
<p class="hx-module-hero__lead"><?php echo esc_html($lead); ?></p>
<?php endif; ?>
<?php if (!empty($hero_points)) : ?>
<ul class="hx-module-hero__chips" aria-label="<?php esc_attr_e('نکات کلیدی', 'hesabix2'); ?>">
<?php foreach ($hero_points as $point) : ?>
<li><?php echo esc_html($point); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<?php
if (function_exists('hesabix2_module_render_hero_visual')) {
hesabix2_module_render_hero_visual($def);
}
?>
</div>
</div>
</section>
<?php
if ($is_rich && function_exists('hesabix2_module_render_rich_sections')) {
hesabix2_module_render_rich_sections((string) $key, $def);
}
?>
<?php if ('faq' === $layout) : ?>
<?php if ($intro) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<p class="hx-module-section__text"><?php echo esc_html($intro); ?></p>
</div>
</section>
<?php endif; ?>
<?php
if (!empty($def['sections']) && is_array($def['sections'])) :
foreach ($def['sections'] as $sec) :
?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<?php if (!empty($sec['title'])) : ?>
<h2 class="hx-module-section__title"><?php echo esc_html($sec['title']); ?></h2>
<?php endif; ?>
<?php
if (!empty($sec['paragraphs']) && is_array($sec['paragraphs'])) :
foreach ($sec['paragraphs'] as $p) :
?>
<p class="hx-module-section__text"><?php echo esc_html($p); ?></p>
<?php
endforeach;
endif;
?>
</div>
</section>
<?php
endforeach;
endif;
?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<div class="fp-faq-list hx-module-faq">
<?php
$faq_items = function_exists('hesabix2_module_faq_items') ? hesabix2_module_faq_items((string) $key) : array();
foreach ($faq_items as $faq) :
?>
<div class="fp-faq-item hx-module-faq__item">
<button type="button" class="fp-faq-question hx-module-faq__q" aria-expanded="false">
<span><?php echo esc_html($faq['q']); ?></span>
<span class="fp-faq-icon hx-module-faq__icon" aria-hidden="true">+</span>
</button>
<div class="fp-faq-answer hx-module-faq__a" hidden>
<p><?php echo esc_html($faq['a']); ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php elseif ('story' === $layout) : ?>
<?php if ($intro) : ?>
<section class="hx-module-story-lead">
<div class="<?php echo esc_attr($wrap); ?> hx-module-story-lead__grid">
<p class="hx-module-story-lead__text"><?php echo esc_html($intro); ?></p>
<?php if (!empty($def['story_aside']) && is_array($def['story_aside'])) : ?>
<aside class="hx-module-story-aside">
<?php foreach ($def['story_aside'] as $aside) : ?>
<div class="hx-module-story-aside__item">
<strong><?php echo esc_html($aside['title'] ?? ''); ?></strong>
<span><?php echo esc_html($aside['text'] ?? ''); ?></span>
</div>
<?php endforeach; ?>
</aside>
<?php endif; ?>
</div>
</section>
<?php endif; ?>
<?php
if (!empty($def['sections']) && is_array($def['sections'])) :
$story_i = 0;
foreach ($def['sections'] as $sec) :
++$story_i;
$alt = (0 === $story_i % 2) ? ' hx-module-section--alt' : '';
?>
<section class="hx-module-section hx-module-section--story<?php echo esc_attr($alt); ?>">
<div class="<?php echo esc_attr($wrap); ?>">
<?php if (!empty($sec['title'])) : ?>
<h2 class="hx-module-section__title"><?php echo esc_html($sec['title']); ?></h2>
<?php endif; ?>
<?php
if (!empty($sec['paragraphs']) && is_array($sec['paragraphs'])) :
foreach ($sec['paragraphs'] as $p) :
?>
<p class="hx-module-section__text"><?php echo esc_html($p); ?></p>
<?php
endforeach;
endif;
if (!empty($sec['points']) && is_array($sec['points'])) :
?>
<ul class="hx-module-story-points">
<?php foreach ($sec['points'] as $point) : ?>
<li><?php echo esc_html($point); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</section>
<?php
endforeach;
endif;
?>
<?php if (!empty($def['scenarios']) && is_array($def['scenarios'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('نمونه سناریوها', 'hesabix2'); ?></h2>
<ul class="hx-module-grid hx-module-grid--2" style="list-style:none;margin:0;padding:0;max-width:48rem;">
<?php foreach ($def['scenarios'] as $scenario) : ?>
<li class="hx-module-scenario">
<span class="hx-module-scenario__arrow" aria-hidden="true">→</span>
<?php echo esc_html($scenario); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['use_cases']) && is_array($def['use_cases'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('مناسب برای', 'hesabix2'); ?></h2>
<div class="hx-module-tags">
<?php foreach ($def['use_cases'] as $uc) : ?>
<span class="hx-module-tag"><?php echo esc_html($uc); ?></span>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['faq']) && is_array($def['faq'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('سوالات رایج این بخش', 'hesabix2'); ?></h2>
<div class="fp-faq-list hx-module-faq">
<?php foreach ($def['faq'] as $faq) : ?>
<div class="fp-faq-item hx-module-faq__item">
<button type="button" class="fp-faq-question hx-module-faq__q" aria-expanded="false">
<span><?php echo esc_html($faq['q']); ?></span>
<span class="fp-faq-icon hx-module-faq__icon" aria-hidden="true">+</span>
</button>
<div class="fp-faq-answer hx-module-faq__a" hidden>
<p><?php echo esc_html($faq['a']); ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['extra_link']['url'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<a href="<?php echo esc_url($def['extra_link']['url']); ?>" class="hx-module-link"><?php echo esc_html($def['extra_link']['label']); ?> ←</a>
</div>
</section>
<?php endif; ?>
<?php elseif ('guide' === $layout) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<div class="hx-module-guide">
<div>
<?php if ($intro) : ?>
<p class="hx-module-section__text"><?php echo esc_html($intro); ?></p>
<?php endif; ?>
<?php
if (!empty($def['sections']) && is_array($def['sections'])) :
foreach ($def['sections'] as $sec) :
?>
<div class="hx-module-section" style="padding:0;border:0;">
<?php if (!empty($sec['title'])) : ?>
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php echo esc_html($sec['title']); ?></h2>
<?php endif; ?>
<?php
if (!empty($sec['paragraphs']) && is_array($sec['paragraphs'])) :
foreach ($sec['paragraphs'] as $p) :
?>
<p class="hx-module-section__text"><?php echo esc_html($p); ?></p>
<?php
endforeach;
endif;
?>
</div>
<?php
endforeach;
endif;
?>
<?php if (!empty($def['checklist']) && is_array($def['checklist'])) : ?>
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('چک‌لیست شروع', 'hesabix2'); ?></h2>
<ul class="hx-module-checklist">
<?php foreach ($def['checklist'] as $item) : ?>
<li><?php echo esc_html($item); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if (!empty($def['steps']) && is_array($def['steps'])) : ?>
<?php
$n = 1;
foreach ($def['steps'] as $step) :
?>
<div class="hx-module-guide-step">
<span class="hx-module-guide-step__num"><?php echo (int) $n; ?></span>
<div>
<p class="hx-module-step__title"><?php echo esc_html($step['title']); ?></p>
<p class="hx-module-step__text"><?php echo esc_html($step['text']); ?></p>
</div>
</div>
<?php
++$n;
endforeach;
?>
<?php endif; ?>
</div>
<aside class="hx-module-sidebar">
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('مستندات بیشتر', 'hesabix2'); ?></h2>
<ul>
<li><a href="<?php echo esc_url( function_exists( 'hwiki_hub_url' ) ? hwiki_hub_url() : 'https://wiki.hesabix.ir' ); ?>"><?php esc_html_e('دانشنامه', 'hesabix2'); ?></a></li>
<?php if (function_exists('hesabix2_api_docs_page_url')) : ?>
<li><a href="<?php echo esc_url(hesabix2_api_docs_page_url()); ?>"><?php esc_html_e('مرجع API', 'hesabix2'); ?></a></li>
<?php endif; ?>
<li><a href="<?php echo esc_url(hesabix2_module_page_url('platform')); ?>"><?php esc_html_e('همهٔ امکانات', 'hesabix2'); ?></a></li>
</ul>
</aside>
</div>
</div>
</section>
<?php elseif ('overview' === $layout) : ?>
<?php if ($intro) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<p class="hx-module-section__text"><?php echo esc_html($intro); ?></p>
</div>
</section>
<?php endif; ?>
<?php
if (!empty($def['sections']) && is_array($def['sections'])) :
foreach ($def['sections'] as $sec) :
?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<?php if (!empty($sec['title'])) : ?>
<h2 class="hx-module-section__title"><?php echo esc_html($sec['title']); ?></h2>
<?php endif; ?>
<?php
if (!empty($sec['paragraphs']) && is_array($sec['paragraphs'])) :
foreach ($sec['paragraphs'] as $p) :
?>
<p class="hx-module-section__text"><?php echo esc_html($p); ?></p>
<?php
endforeach;
endif;
?>
</div>
</section>
<?php
endforeach;
endif;
?>
<?php if (!empty($def['how_it_works']) && is_array($def['how_it_works'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('چطور کار می‌کند؟', 'hesabix2'); ?></h2>
<div class="hx-module-steps">
<?php
$step_n = 1;
foreach ($def['how_it_works'] as $step) :
?>
<div class="hx-module-step">
<span class="hx-module-step__num"><?php echo (int) $step_n; ?></span>
<h3 class="hx-module-step__title"><?php echo esc_html($step['title']); ?></h3>
<p class="hx-module-step__text"><?php echo esc_html($step['text']); ?></p>
</div>
<?php
++$step_n;
endforeach;
?>
</div>
</div>
</section>
<?php endif; ?>
<section class="hx-module-section" id="modules">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('هسته عملیاتی', 'hesabix2'); ?></h2>
<p class="hx-module-section__text"><?php esc_html_e('مالی، فروش، انبار، CRM و اتوماسیون — روی یک منبع حقیقت.', 'hesabix2'); ?></p>
<?php hesabix2_render_module_catalog_cards('module', array('platform', 'faq', 'guide')); ?>
</div>
</section>
<section class="hx-module-section hx-module-section--alt" id="plugins">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('افزونه‌ها و ماژول‌های تخصصی', 'hesabix2'); ?></h2>
<p class="hx-module-section__text"><?php esc_html_e('پخش، تولید، حقوق، دارایی ثابت، ایجنت MCP و خدمات فنی را وقتی نیاز دارید روشن کنید.', 'hesabix2'); ?></p>
<?php hesabix2_render_module_catalog_cards('plugin'); ?>
</div>
</section>
<section class="hx-module-section" id="scope">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('از مغازه تا مجتمع صنعتی', 'hesabix2'); ?></h2>
<p class="hx-module-section__text"><?php esc_html_e('یک پلتفرم منعطف؛ مقیاس و صنعت را انتخاب کنید. هسته عوض نمی‌شود.', 'hesabix2'); ?></p>
<?php hesabix2_render_module_catalog_cards('industry'); ?>
</div>
</section>
<?php if (!empty($def['benefits']) && is_array($def['benefits'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('چرا حسابیکس؟', 'hesabix2'); ?></h2>
<div class="hx-module-grid hx-module-grid--3">
<?php foreach ($def['benefits'] as $benefit) : ?>
<div class="hx-module-benefit">
<h3 class="hx-module-benefit__title"><?php echo esc_html($benefit['title']); ?></h3>
<p class="hx-module-benefit__text"><?php echo esc_html($benefit['text']); ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['faq']) && is_array($def['faq'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('سوالات رایج', 'hesabix2'); ?></h2>
<div class="fp-faq-list hx-module-faq">
<?php foreach ($def['faq'] as $faq) : ?>
<div class="fp-faq-item hx-module-faq__item">
<button type="button" class="fp-faq-question hx-module-faq__q" aria-expanded="false">
<span><?php echo esc_html($faq['q']); ?></span>
<span class="fp-faq-icon hx-module-faq__icon" aria-hidden="true">+</span>
</button>
<div class="fp-faq-answer hx-module-faq__a" hidden>
<p><?php echo esc_html($faq['a']); ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php else : ?>
<?php if ($intro) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<p class="hx-module-section__text"><?php echo esc_html($intro); ?></p>
</div>
</section>
<?php endif; ?>
<?php
if (!empty($def['sections']) && is_array($def['sections'])) :
foreach ($def['sections'] as $sec) :
?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<?php if (!empty($sec['title'])) : ?>
<h2 class="hx-module-section__title"><?php echo esc_html($sec['title']); ?></h2>
<?php endif; ?>
<?php
if (!empty($sec['paragraphs']) && is_array($sec['paragraphs'])) :
foreach ($sec['paragraphs'] as $p) :
?>
<p class="hx-module-section__text"><?php echo esc_html($p); ?></p>
<?php
endforeach;
endif;
?>
</div>
</section>
<?php
endforeach;
endif;
?>
<?php if (!empty($def['how_it_works']) && is_array($def['how_it_works'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('چطور کار می‌کند؟', 'hesabix2'); ?></h2>
<div class="hx-module-steps">
<?php
$step_n = 1;
foreach ($def['how_it_works'] as $step) :
?>
<div class="hx-module-step">
<span class="hx-module-step__num"><?php echo (int) $step_n; ?></span>
<h3 class="hx-module-step__title"><?php echo esc_html($step['title']); ?></h3>
<p class="hx-module-step__text"><?php echo esc_html($step['text']); ?></p>
</div>
<?php
++$step_n;
endforeach;
?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['benefits']) && is_array($def['benefits'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('چرا این ماژول؟', 'hesabix2'); ?></h2>
<div class="hx-module-grid hx-module-grid--3">
<?php foreach ($def['benefits'] as $benefit) : ?>
<div class="hx-module-benefit">
<h3 class="hx-module-benefit__title"><?php echo esc_html($benefit['title']); ?></h3>
<p class="hx-module-benefit__text"><?php echo esc_html($benefit['text']); ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['features']) && is_array($def['features'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('امکانات کلیدی', 'hesabix2'); ?></h2>
<ul class="hx-module-features">
<?php foreach ($def['features'] as $feature) : ?>
<li><?php echo esc_html($feature); ?></li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['scenarios']) && is_array($def['scenarios'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('نمونه سناریوها', 'hesabix2'); ?></h2>
<ul class="hx-module-grid hx-module-grid--2" style="list-style:none;margin:0;padding:0;max-width:48rem;">
<?php foreach ($def['scenarios'] as $scenario) : ?>
<li class="hx-module-scenario">
<span class="hx-module-scenario__arrow" aria-hidden="true">→</span>
<?php echo esc_html($scenario); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['use_cases']) && is_array($def['use_cases'])) : ?>
<section class="hx-module-section hx-module-section--alt">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('مناسب برای', 'hesabix2'); ?></h2>
<div class="hx-module-tags">
<?php foreach ($def['use_cases'] as $uc) : ?>
<span class="hx-module-tag"><?php echo esc_html($uc); ?></span>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['faq']) && is_array($def['faq'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title"><?php esc_html_e('سوالات رایج این بخش', 'hesabix2'); ?></h2>
<div class="fp-faq-list hx-module-faq">
<?php foreach ($def['faq'] as $faq) : ?>
<div class="fp-faq-item hx-module-faq__item">
<button type="button" class="fp-faq-question hx-module-faq__q" aria-expanded="false">
<span><?php echo esc_html($faq['q']); ?></span>
<span class="fp-faq-icon hx-module-faq__icon" aria-hidden="true">+</span>
</button>
<div class="fp-faq-answer hx-module-faq__a" hidden>
<p><?php echo esc_html($faq['a']); ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<?php if (!empty($def['extra_link']['url'])) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<a href="<?php echo esc_url($def['extra_link']['url']); ?>" class="hx-module-link"><?php echo esc_html($def['extra_link']['label']); ?> ←</a>
</div>
</section>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($related)) : ?>
<section class="hx-module-section">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-section__title hx-module-section__title--sm"><?php esc_html_e('مطالب مرتبط', 'hesabix2'); ?></h2>
<div class="hx-module-related">
<?php foreach ($related as $rel_key) :
$rel = hesabix2_module_page_def($rel_key);
if (!$rel) {
continue;
}
?>
<a href="<?php echo esc_url(hesabix2_module_page_url($rel_key)); ?>"><?php echo esc_html($rel['title']); ?></a>
<?php endforeach; ?>
</div>
</div>
</section>
<?php endif; ?>
<section class="hx-module-cta">
<div class="<?php echo esc_attr($wrap); ?>">
<h2 class="hx-module-cta__title"><?php echo esc_html($cta_title); ?></h2>
<p class="hx-module-cta__text"><?php echo esc_html($cta_text); ?></p>
<div class="hx-module-cta__actions">
<a href="<?php echo esc_url($arc); ?>" target="_blank" rel="noopener noreferrer" class="hx-module-btn hx-module-btn--primary"<?php echo function_exists('hesabix2_entry_link_attrs') ? hesabix2_entry_link_attrs('arc', $arc) : ''; ?>><?php echo esc_html($cta_primary); ?></a>
<a href="<?php echo esc_url(function_exists('hesabix2_contact_page_url') ? hesabix2_contact_page_url() : home_url('/contact/')); ?>" class="hx-module-btn hx-module-btn--ghost"><?php esc_html_e('تماس با ما', 'hesabix2'); ?></a>
</div>
</div>
</section>
</main>
<?php
get_footer();