GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Private Member Functions
GravityView_Ajax Class Reference

Public Member Functions

 __construct ()
 
 check_ajax_nonce ()
 --—— AJAX ----—— More...
 
 create_preset_form ()
 Create the preset form requested before the View save. More...
 
 get_active_areas ()
 Returns template active areas given a template ID AJAX callback. More...
 
 get_available_fields_html ()
 Returns available fields given a form ID or a preset template ID AJAX callback. More...
 
 get_field_options ()
 Returns field options - called by ajax when dropping fields into active areas AJAX callback. More...
 
 get_preset_fields_config ()
 Fill in active areas with preset configuration according to the template selected. More...
 
 get_sortable_fields ()
 Given a View id, calculates the assigned form, and returns the form fields (only the sortable ones ) AJAX callback. More...
 
 import_fields ($file)
 Import fields configuration from an exported WordPress View preset. More...
 
 import_form ($xml_or_json_path= '')
 Import Gravity Form XML or JSON. More...
 

Static Public Member Functions

static pre_get_form_fields ($template_id= '')
 Get the the form fields for a preset (no form created yet) More...
 

Private Member Functions

 _exit ($mixed=NULL)
 Handle exiting the script (for unit testing) More...
 

Detailed Description

Definition at line 3 of file class-ajax.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 5 of file class-ajax.php.

Member Function Documentation

_exit (   $mixed = NULL)
private

Handle exiting the script (for unit testing)

Since
1.15
Parameters
bool | false$mixed
Returns
bool

Don't exit if we're running test suite.

Since
1.15

Definition at line 33 of file class-ajax.php.

Referenced by check_ajax_nonce(), create_preset_form(), get_active_areas(), get_available_fields_html(), get_field_options(), get_preset_fields_config(), and get_sortable_fields().

check_ajax_nonce ( )

--—— AJAX ----——

Verify the nonce. Exit if not verified.

Returns
void

Definition at line 52 of file class-ajax.php.

References _exit().

Referenced by create_preset_form(), get_active_areas(), get_available_fields_html(), get_field_options(), get_preset_fields_config(), and get_sortable_fields().

create_preset_form ( )

Create the preset form requested before the View save.

Returns
void

Definition at line 174 of file class-ajax.php.

References $form, _exit(), check_ajax_nonce(), and import_form().

get_active_areas ( )

Returns template active areas given a template ID AJAX callback.

public

Returns
void

Definition at line 96 of file class-ajax.php.

References _exit(), and check_ajax_nonce().

get_available_fields_html ( )

Returns available fields given a form ID or a preset template ID AJAX callback.

public

Returns
void
See also
GravityView_Admin_Views::render_available_fields

Definition at line 65 of file class-ajax.php.

References $form, _exit(), check_ajax_nonce(), and pre_get_form_fields().

get_field_options ( )

Returns field options - called by ajax when dropping fields into active areas AJAX callback.

public

Returns
void

Definition at line 240 of file class-ajax.php.

References _exit(), check_ajax_nonce(), gravityview_strip_whitespace(), and GravityView_Render_Settings\render_field_options().

get_preset_fields_config ( )

Fill in active areas with preset configuration according to the template selected.

Returns
void

Definition at line 120 of file class-ajax.php.

References _exit(), check_ajax_nonce(), GravityView_Plugin\get_default_widget_areas(), and import_fields().

get_sortable_fields ( )

Given a View id, calculates the assigned form, and returns the form fields (only the sortable ones ) AJAX callback.

public

Returns
void

Definition at line 273 of file class-ajax.php.

References $form, _exit(), check_ajax_nonce(), gravityview_get_sortable_fields(), gravityview_strip_whitespace(), and pre_get_form_fields().

import_fields (   $file)

Import fields configuration from an exported WordPress View preset.

Parameters
string$filepath to file
Returns
array Fields config array (unserialized)

Definition at line 376 of file class-ajax.php.

References GRAVITYVIEW_DIR.

Referenced by get_preset_fields_config().

import_form (   $xml_or_json_path = '')

Import Gravity Form XML or JSON.

Parameters
string$xml_or_json_pathPath to form XML or JSON file
Returns
int|bool Imported form ID or false

Definition at line 207 of file class-ajax.php.

References $forms.

Referenced by create_preset_form().

static pre_get_form_fields (   $template_id = '')
static

Get the the form fields for a preset (no form created yet)

Parameters
string$template_idPreset template

Definition at line 303 of file class-ajax.php.

References $form, and $forms.

Referenced by get_available_fields_html(), GravityView_Widget_Search\get_searchable_fields(), get_sortable_fields(), and GravityView_Admin_Views\render_active_areas().


The documentation for this class was generated from the following file: