| @@ -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" |