Exemplo n.º 1
0
 private function ajax_setup()
 {
     // load resources required to handle Ajax requests only.
     $handler = awpcp_users_autocomplete_ajax_handler();
     add_action('wp_ajax_awpcp-autocomplete-users', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-autocomplete-users', array($handler, 'ajax'));
     $handler = awpcp_set_file_as_primary_ajax_handler();
     add_action('wp_ajax_awpcp-set-file-as-primary', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-set-file-as-primary', array($handler, 'ajax'));
     $handler = awpcp_update_file_enabled_status_ajax_handler();
     add_action('wp_ajax_awpcp-update-file-enabled-status', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-update-file-enabled-status', array($handler, 'ajax'));
     $handler = awpcp_delete_file_ajax_handler();
     add_action('wp_ajax_awpcp-delete-file', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-delete-file', array($handler, 'ajax'));
     $handler = awpcp_update_file_status_ajax_handler();
     add_action('wp_ajax_awpcp-approve-file', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-approve-file', array($handler, 'ajax'));
     add_action('wp_ajax_awpcp-reject-file', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-reject-file', array($handler, 'ajax'));
     $handler = awpcp_upload_listing_media_ajax_handler();
     add_action('wp_ajax_awpcp-upload-listing-media', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-upload-listing-media', array($handler, 'ajax'));
     $handler = awpcp_upload_generated_thumbnail_ajax_handler();
     add_action('wp_ajax_awpcp-upload-generated-thumbnail', array($handler, 'ajax'));
     add_action('wp_ajax_nopriv_awpcp-upload-generated-thumbnail', array($handler, 'ajax'));
     $handler = awpcp_update_form_fields_order_ajax_handler();
     add_action('wp_ajax_awpcp-update-form-fields-order', array($handler, 'ajax'));
     $media_manager = awpcp_new_media_manager();
     $media_manager->register_file_handler(awpcp_image_file_handler());
     $handler = awpcp_drip_autoresponder_ajax_handler();
     add_action('wp_ajax_awpcp-autoresponder-user-subscribed', array($handler, 'ajax'));
     add_action('wp_ajax_awpcp-autoresponder-dismissed', array($handler, 'ajax'));
 }
function awpcp_upload_listing_media_ajax_handler()
{
    return new AWPCP_UploadListingMediaAjaxHandler(awpcp_listings_collection(), awpcp_file_uploader(), awpcp_new_media_manager(), awpcp_request(), awpcp_ajax_response());
}