feat: tambahkan toggle kontrol visibilitas FAQ dan modul aksesibilitas disabilitas WCAG

This commit is contained in:
Mas Budi Kusuma
2026-09-15 23:50:05 +07:00
parent 9dd84e2c23
commit 3b8d105623
3 changed files with 223 additions and 6 deletions
+31 -6
View File
@@ -45,6 +45,7 @@ function edukarsa_register_settings() {
$options = array(
'edukarsa_font_choice', 'edukarsa_primary_color', 'edukarsa_secondary_color', 'edukarsa_heading_color',
'edukarsa_tampil_bilingual', 'edukarsa_lang_en', 'edukarsa_lang_ar', 'edukarsa_lang_zh', 'edukarsa_lang_ja',
'edukarsa_tampil_accessibility',
'edukarsa_tampil_slider', 'edukarsa_tampil_stats', 'edukarsa_tampil_about', 'edukarsa_tampil_milestone', 'edukarsa_tampil_program', 'edukarsa_tampil_video', 'edukarsa_tampil_keunggulan', 'edukarsa_tampil_cta', 'edukarsa_tampil_faq', 'edukarsa_tampil_news',
'edukarsa_header_logo',
'edukarsa_milestone_subtitle', 'edukarsa_milestone_title',
@@ -142,7 +143,7 @@ function edukarsa_settings_page_html() {
<div class="edukarsa-admin-layout">
<div class="edukarsa-admin-main">
<!-- 1. Header, Logo, Slider & Multilingual Switcher -->
<!-- 1. Header, Logo, Slider, Bahasa & Aksesibilitas -->
<div class="edukarsa-card">
<div class="edukarsa-card-header"><h2>🏛️ 1. Header, Logo & Slider</h2></div>
<div class="edukarsa-card-body">
@@ -169,8 +170,7 @@ function edukarsa_settings_page_html() {
</label>
</div>
<!-- Checkbox Pilihan Bahasa Tambahan -->
<div id="lang-options-box" style="background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px;">
<div id="lang-options-box" style="background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 14px 18px; margin-bottom: 14px;">
<span style="font-weight: 700; font-size: 12px; color: #475569; display: block; margin-bottom: 10px;">Bahasa Tambahan yang Diaktifkan:</span>
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
<label style="font-size: 13px; font-weight: 600; color: #334155; cursor: pointer;">
@@ -188,6 +188,21 @@ function edukarsa_settings_page_html() {
</div>
</div>
<!-- Opsi Fitur Aksesibilitas Disabilitas -->
<div class="switch-row" style="background: #f0fdf4; border-color: #bbf7d0;">
<div class="switch-label-wrap">
<div class="switch-label" style="color: #166534;">
<span>♿ Fitur Aksesibilitas Disabilitas (WCAG Toolbar)</span>
<span class="tooltip-hint">?<span class="tooltip-text">Menampilkan tombol melayang di pojok kiri bawah untuk pengunjung berkebutuhan khusus (ukuran huruf, kontras, monokrom, garis tautan).</span></span>
</div>
<span style="font-size: 11px; color: #15803d;">Toolbar ramah disabilitas yang dapat dioperasikan langsung oleh pengunjung situs.</span>
</div>
<label class="edukarsa-switch">
<input type="checkbox" name="edukarsa_tampil_accessibility" value="1" <?php checked(1, get_option('edukarsa_tampil_accessibility', 1)); ?>>
<span class="slider-round"></span>
</label>
</div>
<div class="switch-row-inline" style="margin-top: 15px;">
<div class="switch-row">
<div class="switch-label-wrap">
@@ -332,13 +347,22 @@ function edukarsa_settings_page_html() {
<div class="switch-label-wrap"><span class="switch-label">Tampilkan CTA Banner</span><span style="font-size: 11px; color: #64748b;">Pengaturan Khusus PPDB</span></div>
<label class="edukarsa-switch"><input type="checkbox" class="section-toggle" data-target="#cta-settings-box" name="edukarsa_tampil_cta" value="1" <?php checked(1, get_option('edukarsa_tampil_cta', 1)); ?>><span class="slider-round"></span></label>
</div>
<!-- Toggle FAQ (Sembunyikan/Aktifkan tanpa menghapus CPT) -->
<div class="switch-row">
<div class="switch-label-wrap">
<div class="switch-label"><span>Tampilkan Seksi FAQ</span><span class="tooltip-hint">?<span class="tooltip-text">Daftar tanya jawab diisi lewat menu ❓ Tanya Jawab (FAQ).</span></span></div>
<a href="<?php echo admin_url('edit.php?post_type=faq'); ?>" class="cpt-shortcut-link">Kelola FAQ ↗</a>
<div class="switch-label">
<span>Tampilkan Seksi FAQ</span>
<span class="tooltip-hint">?<span class="tooltip-text">Jika dimatikan, seksi FAQ disembunyikan dari beranda. Seluruh item FAQ yang sudah dibuat tetap tersimpan aman.</span></span>
</div>
<a href="<?php echo admin_url('edit.php?post_type=faq'); ?>" class="cpt-shortcut-link">Kelola Data FAQ ↗</a>
</div>
<label class="edukarsa-switch"><input type="checkbox" class="section-toggle" data-target="#faq-settings-box" name="edukarsa_tampil_faq" value="1" <?php checked(1, get_option('edukarsa_tampil_faq', 1)); ?>><span class="slider-round"></span></label>
<label class="edukarsa-switch">
<input type="checkbox" class="section-toggle" data-target="#faq-settings-box" name="edukarsa_tampil_faq" value="1" <?php checked(1, get_option('edukarsa_tampil_faq', 1)); ?>>
<span class="slider-round"></span>
</label>
</div>
<div class="switch-row">
<div class="switch-label-wrap"><div class="switch-label"><span>Tampilkan Berita Kampus</span><span class="tooltip-hint">?<span class="tooltip-text">Berita otomatis diambil dari menu 'Pos'.</span></span></div><a href="<?php echo admin_url('edit.php'); ?>" class="cpt-shortcut-link">Kelola Berita ↗</a></div>
<label class="edukarsa-switch"><input type="checkbox" name="edukarsa_tampil_news" value="1" <?php checked(1, get_option('edukarsa_tampil_news', 1)); ?>><span class="slider-round"></span></label>
@@ -357,6 +381,7 @@ function edukarsa_settings_page_html() {
</div>
</div>
<!-- Panel Pengaturan Label FAQ -->
<div id="faq-settings-box" class="stat-config-box" style="margin-bottom: 20px;">
<h4>Label Tampilan Seksi FAQ (Tanya Jawab)</h4>
<div class="form-grid-2">