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

If this file is called directly, abort. More...

Public Member Functions

 __construct ()
 
 add_custom_column_content ($column_name=NULL, $post_id)
 Add the Data Source information. More...
 
 add_post_type_columns ($columns)
 Add the Data Source column to the Views page. More...
 
 add_view_dropdown ()
 
 default_field_blacklist ($array=array(), $context=NULL)
 List the field types without presentation properties (on a View context) More...
 
 filter_pre_get_posts_by_gravityview_form_id (&$query)
 
 get_available_fields ($form= '', $zone=NULL)
 Calculate the available fields. More...
 
 get_entry_default_fields ($form, $zone)
 Retrieve the default fields id, label and type. More...
 
 get_registered_widgets ()
 Get the list of registered widgets. More...
 
 register_no_conflict ($registered)
 Add GravityView scripts and styles to Gravity Forms and GravityView No-Conflict modes. More...
 
 render_active_areas ($template_id, $type, $zone, $rows, $values)
 Generic function to render rows and columns of active areas for widgets & fields. More...
 
 render_additional_fields ($form=0, $context= 'single')
 Render html for displaying additional fields based on a Form ID. More...
 
 render_available_fields ($form=0, $context= 'single')
 Render html for displaying available fields based on a Form ID $blacklist_field_types - contains the field types which are not proper to be shown in a directory. More...
 
 render_available_widgets ()
 Render html for displaying available widgets. More...
 
 render_directory_active_areas ($template_id= '', $context= 'single', $post_id= '', $echo=false)
 Render the Template Active Areas and configured active fields for a given template id and post id. More...
 
 render_label ()
 
 render_widgets_active_areas ($template_id= '', $zone, $post_id= '')
 Render the widget active areas. More...
 
 save_postdata ($post_id)
 Save View configuration. More...
 
 tooltips ($tooltips=array())
 Add tooltip text for use throughout the UI. More...
 

Static Public Member Functions

static add_scripts_and_styles ($hook)
 Enqueue scripts and styles at Views editor. More...
 
static enqueue_gravity_forms_scripts ()
 
static get_connected_form_links ($form, $include_form_link=true)
 Get HTML links relating to a connected form, like Edit, Entries, Settings, Preview. More...
 
static gform_toolbar_menu ($menu_items=array(), $id=NULL)
 Add a GravityView menu to the Form Toolbar with connected views. More...
 
static render_field_option ($name= '', $option, $curr_value=NULL)
 
static render_setting_row ($key= '', $current_settings=array(), $override_input=null, $name= 'template_settings[%s]', $id= 'gravityview_se_%s')
 

Detailed Description

If this file is called directly, abort.

Definition at line 19 of file class-admin-views.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 23 of file class-admin-views.php.

Member Function Documentation

add_custom_column_content (   $column_name = NULL,
  $post_id 
)

Add the Data Source information.

Parameters
null$column_name
$post_id
Returns
void

Definition at line 291 of file class-admin-views.php.

References $form, $form_id, $output, $templates, gravityview_get_form(), gravityview_get_form_id(), gravityview_get_registered_templates(), and gravityview_get_template_id().

add_post_type_columns (   $columns)

Add the Data Source column to the Views page.

Parameters
array$columnsColumns array

Definition at line 412 of file class-admin-views.php.

References GVCommon\has_cap().

static add_scripts_and_styles (   $hook)
static

Enqueue scripts and styles at Views editor.

public

Parameters
mixed$hook
Returns
void

Definition at line 1000 of file class-admin-views.php.

References GRAVITYVIEW_FILE, gravityview_is_admin_page(), and GravityView_Plugin\version.

add_view_dropdown ( )

Definition at line 87 of file class-admin-views.php.

References $current_form, $form, $forms, and gravityview_get_forms().

default_field_blacklist (   $array = array(),
  $context = NULL 
)

List the field types without presentation properties (on a View context)

Parameters
array$arrayExisting field types to add to a blacklist
string | null$contextContext for the blacklist. Default: NULL. public
Returns
array Default blacklist fields merged with existing blacklist fields

Definition at line 210 of file class-admin-views.php.

static enqueue_gravity_forms_scripts ( )
static
filter_pre_get_posts_by_gravityview_form_id ( $query)
Since
1.15
Parameters
WP_Query$query

Definition at line 66 of file class-admin-views.php.

get_available_fields (   $form = '',
  $zone = NULL 
)

Calculate the available fields.

Parameters
string | array$formform_ID or form object
string$zoneEither 'single', 'directory', 'header', 'footer'
Returns
array fields

Definition at line 738 of file class-admin-views.php.

References $form, get_entry_default_fields(), gravityview_get_entry_meta(), and gravityview_get_form_fields().

Referenced by render_active_areas(), and render_available_fields().

static get_connected_form_links (   $form,
  $include_form_link = true 
)
static

Get HTML links relating to a connected form, like Edit, Entries, Settings, Preview.

Parameters
array | int$formGravity Forms forms array, or the form ID
boolean$include_form_linkWhether to include the bold name of the form in the output
Returns
string HTML links
Runs Filter:
gravityview_connected_form_links Modify the links shown in the Connected Form links
Since
1.6
Parameters
array$linksLinks to show
array$formGravity Forms form array

Definition at line 351 of file class-admin-views.php.

References $form, $form_id, $output, gravityview_get_form(), and GVCommon\has_cap().

Referenced by GravityView_Admin_Metaboxes\get_data_source_header().

get_entry_default_fields (   $form,
  $zone 
)

Retrieve the default fields id, label and type.

Parameters
string | array$formform_ID or form object
string$zoneEither 'single', 'directory', 'header', 'footer'
Returns
array
Since
1.7.2
1.2
Runs Filter:
gravityview_entry_default_fields Modify the default fields for each zone and context
Parameters
array$entry_default_fieldsArray of fields shown by default
string | array$formform_ID or form object
string$zoneEither 'single', 'directory', 'header', 'footer'

Definition at line 660 of file class-admin-views.php.

References $form.

Referenced by get_available_fields().

get_registered_widgets ( )

Get the list of registered widgets.

Each item is used to instantiate a GravityView_Admin_View_Widget object

Since
1.13.1
Returns
array
Runs Filter:
gravityview_register_directory_widgets Get the list of registered widgets. Each item is used to instantiate a GravityView_Admin_View_Widget object
Parameters
array$registered_widgetsEmpty array

Definition at line 789 of file class-admin-views.php.

Referenced by render_active_areas(), and render_available_widgets().

static gform_toolbar_menu (   $menu_items = array(),
  $id = NULL 
)
static

Add a GravityView menu to the Form Toolbar with connected views.

Parameters
array$menu_itemsMenu items, as set in GFForms::top_toolbar()
int$idID of the current Gravity form
Returns
array Modified array

Definition at line 133 of file class-admin-views.php.

References $label, gravityview_get_connected_views(), and GVCommon\has_cap().

register_no_conflict (   $registered)

Add GravityView scripts and styles to Gravity Forms and GravityView No-Conflict modes.

Parameters
array$registeredExisting scripts or styles that have been registered (array of the handles)
Returns
array

Definition at line 1074 of file class-admin-views.php.

render_active_areas (   $template_id,
  $type,
  $zone,
  $rows,
  $values 
)

Generic function to render rows and columns of active areas for widgets & fields.

Parameters
string$template_idThe current slug of the selected View template
string$typeEither 'widget' or 'field'
string$zoneEither 'single', 'directory', 'header', 'footer'
array$rowsThe layout structure: rows, columns and areas
array$valuesSaved objects
Returns
void

Definition at line 808 of file class-admin-views.php.

References $field, $form, $post, endforeach, get_available_fields(), get_registered_widgets(), gravityview_get_form_id(), GravityView_Ajax\pre_get_form_fields(), and GravityView_Render_Settings\render_field_options().

Referenced by render_directory_active_areas(), and render_widgets_active_areas().

render_additional_fields (   $form = 0,
  $context = 'single' 
)

Render html for displaying additional fields based on a Form ID.

public

Parameters
int$formGravity Forms Form ID (default: '')
string$context(default: 'single')
Returns
void
Runs Filter:
gravityview_additional_fields non-standard Fields to show at the bottom of the field picker
Parameters
array$additional_fieldsAssociative array of field arrays, with label_text, desc, field_id, label_type, input_type, field_options, and settings_html keys

Definition at line 609 of file class-admin-views.php.

Referenced by render_available_fields().

render_available_fields (   $form = 0,
  $context = 'single' 
)

Render html for displaying available fields based on a Form ID $blacklist_field_types - contains the field types which are not proper to be shown in a directory.

See also
GravityView_Ajax::get_available_fields_html() Triggers gravityview_render_available_fields action public
Parameters
int$formGravity Forms Form ID (default: '')
string$context(default: 'single')
Returns
void
Runs Filter:
gravityview_blacklist_field_types Modify the types of fields that shouldn't be shown in a View.
Parameters
[in,out]array$blacklist_field_typesArray of field types to block for this context.
[in]string$contextView context ('single', 'directory', or 'edit')

Definition at line 560 of file class-admin-views.php.

References $form, $output, get_available_fields(), and render_additional_fields().

render_available_widgets ( )

Render html for displaying available widgets.

Returns
string html

Definition at line 769 of file class-admin-views.php.

References get_registered_widgets().

render_directory_active_areas (   $template_id = '',
  $context = 'single',
  $post_id = '',
  $echo = false 
)

Render the Template Active Areas and configured active fields for a given template id and post id.

public

Parameters
string$template_id(default: '') Template ID, like default_list, default_table, preset_business_data, etc. {
See also
GravityView_Template::__construct()}
Parameters
string$post_id(default: '')
string$context(default: 'single')
Returns
string HTML of the active areas
Runs Filter:
gravityview_template_active_areas
See also
GravityView_Template::assign_active_areas()
Parameters
array$template_areasEmpty array, to be filled in by the template class
string$template_idTemplate ID, like default_list, default_table, preset_business_data, etc. {
See also
GravityView_Template::__construct()}
Parameters
string$contextCurrent View context: directory, single, or edit (default: 'single')

Definition at line 950 of file class-admin-views.php.

References $output, gravityview_get_directory_fields(), and render_active_areas().

static render_field_option (   $name = '',
  $option,
  $curr_value = NULL 
)
static

Definition at line 121 of file class-admin-views.php.

References $name.

render_label ( )

Definition at line 544 of file class-admin-views.php.

static render_setting_row (   $key = '',
  $current_settings = array(),
  $override_input = null,
  $name = 'template_settings[%s]',
  $id = 'gravityview_se_%s' 
)
static

Definition at line 112 of file class-admin-views.php.

References $current_settings, and $name.

render_widgets_active_areas (   $template_id = '',
  $zone,
  $post_id = '' 
)

Render the widget active areas.

Parameters
string$zoneEither 'header' or 'footer'
string$post_idCurrent Post ID (view)
Returns
string html

Definition at line 917 of file class-admin-views.php.

References $output, GravityView_Plugin\get_default_widget_areas(), gravityview_get_directory_widgets(), and render_active_areas().

save_postdata (   $post_id)

Save View configuration.

public

Parameters
int$post_idCurrently saved Post ID
Returns
void
Runs Actions:
gravityview_view_saved After a View has been saved in the admin
Parameters
int$post_idID of the View that has been saved
array$statiiArray of statuses of the post meta saving processes. If saving worked, each key should be mapped to a value of the post ID (directory_widgets => 124). If failed (or didn't change), the value will be false.
Since
1.17.2

Definition at line 448 of file class-admin-views.php.

References $form_id, _gravityview_process_posted_fields(), gravityview_set_directory_widgets(), and GVCommon\has_cap().

tooltips (   $tooltips = array())

Add tooltip text for use throughout the UI.

Parameters
array$tooltipsArray of Gravity Forms tooltips
Returns
array Modified tooltips array
Runs Filter:
gravityview_tooltips The tooltips GravityView adds to the Gravity Forms tooltip array
Parameters
array$gv_tooltipsAssociative array with unique keys containing array of title and value keys, as expected by gform_tooltips filter

Definition at line 229 of file class-admin-views.php.

References $title, and GravityView_View_Data\get_default_args().


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