297 lines
13 KiB
PHP
297 lines
13 KiB
PHP
<?php
|
|
/**
|
|
* فوتر — لینکهای پیشفرض و رندر ستونها (ویجت یا fallback)
|
|
*
|
|
* @package Hesabix2
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* لینکهای ستون «دسترسی سریع» (همان عناوین پیشفرض footer.php)
|
|
*
|
|
* @return array<int, array{label: string, url: string, external?: bool}>
|
|
*/
|
|
function hesabix2_footer_quick_links() {
|
|
$home = home_url('/');
|
|
$blog = get_option('page_for_posts') ? get_permalink(get_option('page_for_posts')) : $home;
|
|
$compare = function_exists('hesabix2_versions_compare_url')
|
|
? hesabix2_versions_compare_url()
|
|
: home_url('/arc-shadoman/');
|
|
$mod = function_exists('hesabix2_module_page_url') ? 'hesabix2_module_page_url' : null;
|
|
|
|
$links = array(
|
|
array(
|
|
'label' => 'امکانات پلتفرم',
|
|
'url' => $mod ? $mod('platform') : $home . '#features',
|
|
),
|
|
array('label' => 'آرک و شادمان', 'url' => $compare),
|
|
array(
|
|
'label' => 'ورود به شادمان',
|
|
'url' => function_exists('hesabix2_fp_shad_url') ? hesabix2_fp_shad_url() : 'https://app.hesabix.ir',
|
|
'external' => true,
|
|
),
|
|
array(
|
|
'label' => 'یک تن باشیم',
|
|
'url' => function_exists('hesabix2_hamdeli_page_url') ? hesabix2_hamdeli_page_url() : home_url('/hamdeli/'),
|
|
),
|
|
array(
|
|
'label' => 'داستان حسابیکس',
|
|
'url' => function_exists('hesabix2_about_page_url') ? hesabix2_about_page_url() : home_url('/about/'),
|
|
),
|
|
array(
|
|
'label' => 'دستورالعمل برند',
|
|
'url' => function_exists('hesabix2_brand_page_url') ? hesabix2_brand_page_url() : home_url('/brand/'),
|
|
),
|
|
array(
|
|
'label' => 'اپلیکیشن اندروید',
|
|
'url' => function_exists('hesabix2_android_page_url') ? hesabix2_android_page_url() : home_url('/android/'),
|
|
),
|
|
array(
|
|
'label' => 'اپلیکیشن ویندوز',
|
|
'url' => function_exists('hesabix2_windows_page_url') ? hesabix2_windows_page_url() : home_url('/windows/'),
|
|
),
|
|
array(
|
|
'label' => 'مهاجرت از هلو',
|
|
'url' => function_exists('hesabix2_helo_page_url') ? hesabix2_helo_page_url() : home_url('/helo/'),
|
|
),
|
|
array(
|
|
'label' => 'کسبوکار آنلاین',
|
|
'url' => $mod ? $mod('online-business') : $home . '#online-business',
|
|
),
|
|
array(
|
|
'label' => 'کارخانه و تولید',
|
|
'url' => $mod ? $mod('for-factory') : $home,
|
|
),
|
|
array(
|
|
'label' => 'پخش مویرگی',
|
|
'url' => $mod ? $mod('for-pakhsh') : $home,
|
|
),
|
|
array(
|
|
'label' => 'انرژی و پتروشیمی',
|
|
'url' => $mod ? $mod('for-energy') : $home,
|
|
),
|
|
array(
|
|
'label' => 'ایجنت و MCP',
|
|
'url' => $mod ? $mod('agents') : $home,
|
|
),
|
|
array(
|
|
'label' => 'راهنمای جامع',
|
|
'url' => $mod ? $mod('guide') : $home . '#guide',
|
|
),
|
|
array('label' => 'پشتیبانی سازمانی', 'url' => home_url('/pishibani-sazmani/')),
|
|
array('label' => 'وبلاگ', 'url' => $blog),
|
|
array(
|
|
'label' => 'حامیان',
|
|
'url' => function_exists('hesabix2_sponsors_page_url') ? hesabix2_sponsors_page_url() : home_url('/sponsors/'),
|
|
),
|
|
array('label' => 'تماس با ما', 'url' => home_url('/contact/')),
|
|
);
|
|
|
|
return apply_filters('hesabix2_footer_quick_links', $links);
|
|
}
|
|
|
|
/**
|
|
* لینکهای ستون «منابع»
|
|
*
|
|
* @return array<int, array{label: string, url: string, external?: bool}>
|
|
*/
|
|
function hesabix2_footer_resources_links() {
|
|
$home = home_url('/');
|
|
$wiki = function_exists( 'hwiki_hub_url' ) ? hwiki_hub_url() : home_url( '/docs/' );
|
|
$api = function_exists('hesabix2_api_docs_page_url') ? hesabix2_api_docs_page_url() : home_url('/api/');
|
|
|
|
$dev = function_exists('hesabix2_development_page_url')
|
|
? hesabix2_development_page_url()
|
|
: home_url('/development/');
|
|
|
|
$links = array(
|
|
array(
|
|
'label' => 'مخازن کد',
|
|
'url' => 'https://source.hesabix.ir',
|
|
'external' => true,
|
|
),
|
|
array('label' => 'وضعیت توسعه', 'url' => $dev),
|
|
array('label' => 'دانشنامه', 'url' => $wiki),
|
|
array(
|
|
'label' => 'داستان حسابیکس',
|
|
'url' => function_exists('hesabix2_about_page_url') ? hesabix2_about_page_url() : home_url('/about/'),
|
|
),
|
|
array(
|
|
'label' => 'دستورالعمل برند',
|
|
'url' => function_exists('hesabix2_brand_page_url') ? hesabix2_brand_page_url() : home_url('/brand/'),
|
|
),
|
|
array('label' => 'مرجع API', 'url' => $api),
|
|
array(
|
|
'label' => 'انجمن پرسش و پاسخ',
|
|
'url' => function_exists('hesabix2_anspress_base_url') ? hesabix2_anspress_base_url() : home_url('/'),
|
|
),
|
|
array(
|
|
'label' => 'پرسشهای متداول',
|
|
'url' => function_exists('hesabix2_module_page_url') ? hesabix2_module_page_url('faq') : $home . '#faq',
|
|
),
|
|
);
|
|
|
|
return apply_filters('hesabix2_footer_resources_links', $links);
|
|
}
|
|
|
|
/**
|
|
* @param array<int, array{label: string, url: string, external?: bool}> $links
|
|
*/
|
|
function hesabix2_render_footer_link_list($links) {
|
|
if (empty($links)) {
|
|
return;
|
|
}
|
|
echo '<ul class="footer-links">';
|
|
foreach ($links as $item) {
|
|
$ext = !empty($item['external']);
|
|
echo '<li><a href="' . esc_url($item['url']) . '"';
|
|
if ($ext) {
|
|
echo ' target="_blank" rel="noopener noreferrer"';
|
|
}
|
|
echo '>' . esc_html($item['label']) . '</a></li>';
|
|
}
|
|
echo '</ul>';
|
|
}
|
|
|
|
/**
|
|
* ستون برند
|
|
*/
|
|
function hesabix2_render_footer_brand_column() {
|
|
$custom_logo_id = get_theme_mod('custom_logo');
|
|
$site_icon_url = get_site_icon_url(96);
|
|
$arc_url = function_exists('hesabix2_fp_arc_url') ? hesabix2_fp_arc_url() : '';
|
|
$wiki_url = function_exists( 'hwiki_hub_url' ) ? hwiki_hub_url() : home_url( '/docs/' );
|
|
?>
|
|
<div class="footer-col footer-col--brand">
|
|
<a href="<?php echo esc_url(home_url('/')); ?>" class="footer-brand">
|
|
<?php if ($custom_logo_id) :
|
|
$logo = wp_get_attachment_image_src($custom_logo_id, 'medium');
|
|
if ($logo) : ?>
|
|
<span class="footer-brand__icon" aria-hidden="true">
|
|
<img src="<?php echo esc_url($logo[0]); ?>" alt="" width="48" height="48" loading="lazy" decoding="async">
|
|
</span>
|
|
<?php endif;
|
|
elseif ($site_icon_url) : ?>
|
|
<span class="footer-brand__icon" aria-hidden="true">
|
|
<img src="<?php echo esc_url($site_icon_url); ?>" alt="" width="48" height="48" loading="lazy" decoding="async">
|
|
</span>
|
|
<?php else : ?>
|
|
<span class="footer-brand__letter" aria-hidden="true"><?php echo esc_html(mb_substr(get_bloginfo('name'), 0, 1)); ?></span>
|
|
<?php endif; ?>
|
|
<span class="footer-brand__name"><?php echo esc_html(get_bloginfo('name')); ?></span>
|
|
</a>
|
|
<?php if (get_bloginfo('description')) : ?>
|
|
<p class="footer-brand__tagline">
|
|
<?php echo esc_html(get_bloginfo('description')); ?>
|
|
</p>
|
|
<?php else : ?>
|
|
<p class="footer-brand__tagline">
|
|
پلتفرم جامع مدیریت کسبوکار از مغازه تا صنعت: مالی، تولید، پخش، CRM و ایجنت MCP — ابری، متنباز و رایگان.
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($arc_url) : ?>
|
|
<div class="footer-brand__ctas">
|
|
<a href="<?php echo esc_url($arc_url); ?>" target="_blank" rel="noopener noreferrer" class="footer-cta footer-cta--primary"<?php echo function_exists('hesabix2_entry_link_attrs') ? hesabix2_entry_link_attrs('arc', $arc_url) : ''; ?>>شروع رایگان</a>
|
|
<a href="<?php echo esc_url($wiki_url); ?>" class="footer-cta footer-cta--secondary">دانشنامه</a>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="footer-social" aria-label="<?php esc_attr_e('شبکههای اجتماعی', 'hesabix2'); ?>">
|
|
<a href="https://t.me/hesabixacc" target="_blank" rel="noopener noreferrer" class="footer-social__link footer-social__link--telegram" aria-label="تلگرام حسابیکس">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>
|
|
</a>
|
|
<a href="https://ble.ir/join/AZcuMtW5u8" target="_blank" rel="noopener noreferrer" class="footer-social__link footer-social__link--bale" aria-label="کانال بله حسابیکس">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
/**
|
|
* ستون دسترسی سریع — ویجت footer-1 یا پیشفرض
|
|
*/
|
|
function hesabix2_render_footer_quick_column() {
|
|
if (is_active_sidebar('footer-1')) {
|
|
echo '<div class="footer-col footer-col--widgets footer-col--quick">';
|
|
dynamic_sidebar('footer-1');
|
|
echo '</div>';
|
|
return;
|
|
}
|
|
?>
|
|
<div class="footer-col footer-col--quick">
|
|
<nav aria-label="<?php esc_attr_e('دسترسی سریع', 'hesabix2'); ?>">
|
|
<h4 class="footer-heading">دسترسی سریع</h4>
|
|
<?php if (has_nav_menu('footer')) : ?>
|
|
<?php
|
|
wp_nav_menu(
|
|
array(
|
|
'theme_location' => 'footer',
|
|
'container' => false,
|
|
'menu_class' => 'footer-links',
|
|
'fallback_cb' => false,
|
|
)
|
|
);
|
|
?>
|
|
<?php else : ?>
|
|
<?php hesabix2_render_footer_link_list(hesabix2_footer_quick_links()); ?>
|
|
<?php endif; ?>
|
|
</nav>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
/**
|
|
* ستون منابع — ویجت footer-2 یا پیشفرض
|
|
*/
|
|
function hesabix2_render_footer_resources_column() {
|
|
if (is_active_sidebar('footer-2')) {
|
|
echo '<div class="footer-col footer-col--widgets footer-col--resources">';
|
|
dynamic_sidebar('footer-2');
|
|
echo '</div>';
|
|
return;
|
|
}
|
|
?>
|
|
<div class="footer-col footer-col--resources">
|
|
<nav aria-label="<?php esc_attr_e('منابع', 'hesabix2'); ?>">
|
|
<h4 class="footer-heading">منابع</h4>
|
|
<?php hesabix2_render_footer_link_list(hesabix2_footer_resources_links()); ?>
|
|
</nav>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
/**
|
|
* ستون تماس — ویجت footer-3 یا پیشفرض (متنهای اصلی بدون تغییر)
|
|
*/
|
|
function hesabix2_render_footer_contact_column() {
|
|
if (is_active_sidebar('footer-3')) {
|
|
echo '<div class="footer-col footer-col--widgets">';
|
|
dynamic_sidebar('footer-3');
|
|
echo '</div>';
|
|
return;
|
|
}
|
|
?>
|
|
<div class="footer-col footer-col--contact">
|
|
<h4 class="footer-heading">در ارتباط باشید</h4>
|
|
<p class="footer-contact__lead">
|
|
سوال یا پیشنهاد دارید؟ با تیم پشتیبانی در تماس باشید.
|
|
</p>
|
|
<ul class="footer-contact__meta">
|
|
<li>
|
|
<a href="mailto:info@hesabix.ir" class="footer-contact__meta-link">info@hesabix.ir</a>
|
|
</li>
|
|
<li>
|
|
<a href="tel:02191550290" class="footer-contact__meta-link dir-ltr">۰۲۱-۹۱۵۵۰۲۹۰</a>
|
|
</li>
|
|
</ul>
|
|
<a href="<?php echo esc_url(home_url('/contact/')); ?>" class="footer-cta footer-cta--support">
|
|
تماس با پشتیبانی
|
|
</a>
|
|
</div>
|
|
<?php
|
|
}
|