<?php
class WP_File_Manager_Pro_Ajax {
    private function register_ajax_handlers() {
        $actions = [
            'get_contents',
            'edit_file',
            'save_file',
            'upload',
            'create_directory',
            'delete_item',
            'rename_item',
            'download_file',
            'preview_file',
            'search_files',
            'compress_files',
            'extract_archive',
            'change_permissions',
            'get_file_info',
            'copy_item'
        ];

        foreach ($actions as $action) {
            add_action('wp_ajax_fm_' . $action, [$this, 'ajax_' . $action]);
        }
    }

    public function ajax_get_contents() {
        // 实现内容获取逻辑
    }

    public function ajax_edit_file() {
        // 实现文件编辑逻辑
    }

    public function ajax_save_file() {
        // 实现文件保存逻辑
    }

    // 其他AJAX处理方法...
}
