| @@ -848,39 +848,15 @@ | ||
| 848 | 848 | </form> |
| 849 | 849 | <!-- Delete Button Container - transforms between Delete All and Delete Selected --> |
| 850 | 850 | <div class="mxchat-delete-container" id="mxchat-delete-container"> |
| 851 | 851 | <!-- Delete All Form (shown when nothing selected) --> |
| 852 | - <?php | |
| 853 | - // Build confirm message and button text based on active filter | |
| 854 | - $delete_all_label = __('Delete All', 'mxchat'); | |
| 855 | - $delete_all_confirm = __('Are you sure you want to delete all knowledge?', 'mxchat'); | |
| 856 | - if (!empty($content_type_filter)) { | |
| 857 | - $filter_display = $content_type_filter; | |
| 858 | - // Try to get a human-readable label | |
| 859 | - $pt_obj = get_post_type_object($content_type_filter); | |
| 860 | - if ($pt_obj) { | |
| 861 | - $filter_display = $pt_obj->label; | |
| 862 | - } elseif ($content_type_filter === 'pdf') { | |
| 863 | - $filter_display = 'PDFs'; | |
| 864 | - } elseif ($content_type_filter === 'url') { | |
| 865 | - $filter_display = 'URLs'; | |
| 866 | - } | |
| 867 | - /* translators: %s: content type label (e.g. "Pages", "PDFs") */ | |
| 868 | - $delete_all_label = sprintf(__('Delete All %s', 'mxchat'), $filter_display); | |
| 869 | - /* translators: %s: content type label */ | |
| 870 | - $delete_all_confirm = sprintf(__('Are you sure you want to delete all %s from the knowledge base?', 'mxchat'), $filter_display); | |
| 871 | - } | |
| 872 | - ?> | |
| 873 | - <form method="post" action="<?php echo esc_url(admin_url('admin-post.php?action=mxchat_delete_all_prompts')); ?>" id="mxchat-delete-all-form" onsubmit="return confirm('<?php echo esc_attr($delete_all_confirm); ?>');"> | |
| 852 | + <form method="post" action="<?php echo esc_url(admin_url('admin-post.php?action=mxchat_delete_all_prompts')); ?>" id="mxchat-delete-all-form" onsubmit="return confirm('<?php esc_attr_e('Are you sure you want to delete all knowledge?', 'mxchat'); ?>');"> | |
| 874 | 853 | <?php wp_nonce_field('mxchat_delete_all_prompts_action', 'mxchat_delete_all_prompts_nonce'); ?> |
| 875 | 854 | <input type="hidden" name="data_source" value="<?php echo esc_attr($data_source); ?>" /> |
| 876 | 855 | <input type="hidden" name="bot_id" value="<?php echo esc_attr($current_bot_id); ?>" /> |
| 877 | - <?php if (!empty($content_type_filter)) : ?> | |
| 878 | - <input type="hidden" name="content_type_filter" value="<?php echo esc_attr($content_type_filter); ?>" /> | |
| 879 | - <?php endif; ?> | |
| 880 | 856 | <button type="submit" class="mxch-btn mxch-btn-secondary mxch-btn-sm" style="color: var(--mxch-error);"> |
| 881 | 857 | <span class="dashicons dashicons-trash" style="font-size: 14px;"></span> |
| 882 | - <?php echo esc_html($delete_all_label); ?> | |
| 858 | + <?php esc_html_e('Delete All', 'mxchat'); ?> | |
| 883 | 859 | </button> |
| 884 | 860 | </form> |
| 885 | 861 | <!-- Delete Selected Button (shown when items selected) --> |
| 886 | 862 | <button type="button" |
| @@ -1246,19 +1222,8 @@ | ||
| 1246 | 1222 | <span style="font-weight: 500;"><?php esc_html_e('Auto-sync Pages', 'mxchat'); ?></span> |
| 1247 | 1223 | </div> |
| 1248 | 1224 | </div> |
| 1249 | 1225 | |
| 1250 | - <div class="mxch-field" style="margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--mxch-card-border);"> | |
| 1251 | - <div style="display: flex; align-items: center; gap: 12px;"> | |
| 1252 | - <label class="mxchat-toggle-switch"> | |
| 1253 | - <input type="checkbox" name="mxchat_auto_sync_acf_pdfs" class="mxchat-autosave-field" value="1" data-nonce="<?php echo wp_create_nonce('mxchat_prompts_setting_nonce'); ?>" <?php checked(get_option('mxchat_auto_sync_acf_pdfs', '0'), '1'); ?>> | |
| 1254 | - <span class="mxchat-toggle-slider"></span> | |
| 1255 | - </label> | |
| 1256 | - <span style="font-weight: 500;"><?php esc_html_e('Extract text from PDFs in ACF fields on save', 'mxchat'); ?></span> | |
| 1257 | - </div> | |
| 1258 | - <p class="mxch-field-description" style="margin-top: 8px;"><?php esc_html_e('When ON, editor saves re-extract every PDF referenced in ACF fields. Default OFF — saves stay fast and don\'t re-parse the same PDFs on every edit. The manual content selector has its own per-batch checkbox; this setting only controls the auto-sync path.', 'mxchat'); ?></p> | |
| 1259 | - </div> | |
| 1260 | - | |
| 1261 | 1226 | <div style="margin-top: 24px;"> |
| 1262 | 1227 | <button id="mxchat-custom-post-types-toggle" class="mxch-btn mxch-btn-secondary"> |
| 1263 | 1228 | <?php esc_html_e('Advanced Custom Post Sync Settings', 'mxchat'); ?> |
| 1264 | 1229 | <span style="margin-left: 5px;">▼</span> |
| @@ -1776,15 +1741,8 @@ | ||
| 1776 | 1741 | </div> |
| 1777 | 1742 | </div> |
| 1778 | 1743 | <div class="mxchat-kb-modal-footer"> |
| 1779 | 1744 | <div class="mxchat-kb-pagination"></div> |
| 1780 | - <div class="mxchat-kb-acf-pdf-option" style="display:flex; align-items:flex-start; gap:8px; padding:8px 0; font-size:12px; color: var(--mxch-text-secondary, #64748b);"> | |
| 1781 | - <input type="checkbox" id="mxchat-kb-acf-pdf-extract" style="margin-top:2px;"> | |
| 1782 | - <label for="mxchat-kb-acf-pdf-extract" style="cursor:pointer; line-height:1.4;"> | |
| 1783 | - <strong style="color: var(--mxch-text-primary, #1a1a2e);"><?php esc_html_e('Also extract text from PDFs linked in ACF File/Image fields', 'mxchat'); ?></strong><br> | |
| 1784 | - <span><?php esc_html_e('Adds 200-500ms per post and ~30 KB to each KB entry. Recommended only if your ACF setup uses PDF attachments for primary content.', 'mxchat'); ?></span> | |
| 1785 | - </label> | |
| 1786 | - </div> | |
| 1787 | 1745 | <div class="mxchat-kb-footer-actions"> |
| 1788 | 1746 | <button type="button" id="mxchat-kb-process-selected" class="mxchat-kb-button-primary" disabled> |
| 1789 | 1747 | <?php esc_html_e('Process Selected Content', 'mxchat'); ?> |
| 1790 | 1748 | <span class="mxchat-kb-selected-count">(0)</span> |