GravityView  2.17
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=0)
 Add the Data Source information. More...
 
 add_gf_version_css_class ( $class)
 Allow targeting different versions of Gravity Forms using CSS selectors. More...
 
 add_post_type_columns ( $columns)
 Add the Data Source column to the Views page. More...
 
 add_view_dropdown ()
 Adds dropdown selects to filter Views by connected form and layout. More...
 
 default_field_blacklist ( $array, $context)
 
 default_field_blocklist ( $array=array(), $context=NULL)
 List the field types without presentation properties (on a View context) More...
 
 filter_pre_get_posts (&$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_id=0, $context='single')
 Render html for displaying additional fields based on a Form ID. More...
 
 render_available_fields ( $form_id=0, $context='single')
 Render html for displaying available fields based on a Form ID. More...
 
 render_available_widgets ()
 Render html for displaying available widgets. More...
 
 render_directory_active_areas ( $template_id='', $context='single', $post_id=0, $echo=false, $form_id=0)
 Render the Template Active Areas and configured active fields for a given template id and post id. More...
 
 render_field_pickers ( $context='directory', $form_ids=array())
 Renders "Add Field" tooltips. 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...
 
 set_default_view_fields ( $fields=array(), $view=null, $form_id=0)
 Set the default fields for new Views. More...
 
 suggest_support_articles ( $localization_data=array())
 When on the Add/Edit View screen, suggest most popular articles related to that. 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 ()
 Enqueue Gravity Forms scripts, needed for Merge Tags. More...
 
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=array(), $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()

__construct ( )

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

Member Function Documentation

◆ add_custom_column_content()

add_custom_column_content (   $column_name = null,
  $post_id = 0 
)

Add the Data Source information.

Parameters
null$column_nameName of the column in the Views table.
int$post_idPost ID.
Returns
void

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

References GV\$form, $form_id, $output, $template, $templates, gravityview(), gravityview_get_form(), gravityview_get_form_id(), gravityview_get_registered_templates(), and gravityview_get_template_id().

◆ add_gf_version_css_class()

add_gf_version_css_class (   $class)

Allow targeting different versions of Gravity Forms using CSS selectors.

Adds specific version class: .gf-version-2.6.1.3 as well as point updates: .gf-minor-version-2.6.

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

References $class.

Referenced by GravityView_Welcome\getting_started_screen().

◆ add_post_type_columns()

add_post_type_columns (   $columns)

Add the Data Source column to the Views page.

Parameters
array$columnsColumns array

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

References GVCommon\has_cap().

◆ add_scripts_and_styles()

static add_scripts_and_styles (   $hook)
static

Enqueue scripts and styles at Views editor.

Parameters
mixed$hook
Returns
void

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

References gravityview(), and GRAVITYVIEW_FILE.

◆ add_view_dropdown()

add_view_dropdown ( )

Adds dropdown selects to filter Views by connected form and layout.

Returns
void

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

References $current_form, GV\$form, $forms, Utils\_GET(), gravityview_get_forms(), and gravityview_get_registered_templates().

◆ default_field_blacklist()

default_field_blacklist (   $array,
  $context 
)

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

References default_field_blocklist().

◆ default_field_blocklist()

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

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

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

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

Referenced by default_field_blacklist().

◆ enqueue_gravity_forms_scripts()

static enqueue_gravity_forms_scripts ( )
static

Enqueue Gravity Forms scripts, needed for Merge Tags.

Since
1.0.5-beta
Returns
void

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

◆ filter_pre_get_posts()

filter_pre_get_posts ( $query)
Since
1.15
Parameters
WP_Query$query

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

References $form_id, and Utils\_GET().

◆ get_available_fields()

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
Runs Filter:
gravityview/admin/available_fields Modify the available fields that can be used in a View.
Parameters
array$fieldsThe fields.
string | array$formform_ID or form object
string$zoneEither 'single', 'directory', 'header', 'footer'

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

References $field, GV\$form, $gv_field, GravityView_Fields\get_all(), get_entry_default_fields(), gravityview(), gravityview_get_entry_meta(), and gravityview_get_form_fields().

Referenced by render_active_areas(), and render_available_fields().

◆ get_connected_form_links()

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 493 of file class-admin-views.php.

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

Referenced by GravityView_Admin_Metaboxes\get_data_source_header().

◆ get_entry_default_fields()

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
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 827 of file class-admin-views.php.

References GV\$form, and GravityView_Fields\get_all().

Referenced by get_available_fields().

◆ get_registered_widgets()

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

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

◆ gform_toolbar_menu()

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 251 of file class-admin-views.php.

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

◆ register_no_conflict()

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 1467 of file class-admin-views.php.

◆ render_active_areas()

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', 'edit', 'header', 'footer'
array$rowsThe layout structure: rows, columns and areas
array$valuesSaved objects
Returns
void

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

References $field, GV\$form, $form_id, $post, endforeach, View\from_post(), get_available_fields(), gravityview(), gravityview_get_form(), gravityview_get_form_id(), gravityview_get_joined_forms(), GravityView_Ajax\pre_get_form_fields(), Widget\registered(), and GravityView_Render_Settings\render_field_options().

Referenced by render_directory_active_areas(), and render_widgets_active_areas().

◆ render_additional_fields()

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

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

Parameters
int | string$form_idGravity Forms form ID. Default: 0.
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 773 of file class-admin-views.php.

References GV\$form, $form_id, $settings, and GVCommon\get_form_or_form_template().

Referenced by render_available_fields().

◆ render_available_fields()

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

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

See also
GravityView_Ajax::get_available_fields_html() Triggers gravityview_render_available_fields action
Parameters
int | string$form_idGravity Forms form ID. Default: 0.
string$context(default: 'single')
Returns
void
Runs Filter:
gravityview_blocklist_field_types Modify the types of fields that shouldn't be shown in a View.
Parameters
array$blocklist_field_typesArray of field types which are not proper to be shown for the $context.
string$contextView context ('single', 'directory', or 'edit').
Since
2.9

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

References GV\$form, $form_id, $output, get_available_fields(), GVCommon\get_form_or_form_template(), gravityview(), and render_additional_fields().

◆ render_available_widgets()

render_available_widgets ( )

Render html for displaying available widgets.

Returns
string html

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

References Widget\registered().

◆ render_directory_active_areas()

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

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

Parameters
string$template_id(default: '') Template ID, like default_list, default_table, preset_business_data, etc. {
See also
GravityView_Template::__construct()}
Parameters
string$context(default: 'single') Context of the template. single or directory (edit not implemented but valid).
string$post_id(default: '')
bool$echo(default: false) Whether to echo the output or return it. Default: false.
int$form_id(default: 0) Main form ID for the View. Used to set default fields for a new View.
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 1238 of file class-admin-views.php.

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

◆ render_field_option()

static render_field_option (   $name = '',
  $option = array(),
  $curr_value = null 
)
static

◆ render_field_pickers()

render_field_pickers (   $context = 'directory',
  $form_ids = array() 
)

Renders "Add Field" tooltips.

Since
2.0.11
Parameters
string$context"directory", "single", or "edit"
array$form_ids(default: array) Array of form IDs
Returns
void

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

References $form_id, $post, View\get_joined_forms(), and gravityview_get_form_id().

◆ render_label()

render_label ( )

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

◆ render_setting_row()

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

◆ render_widgets_active_areas()

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

Render the widget active areas.

Parameters
string$template_idThe current slug of the selected View template
string$zoneEither 'header' or 'footer'
string$post_idCurrent Post ID (view)
Returns
string html
Runs Filter:
gravityview/view/widgets/default Modify the default widgets for new Views
Parameters
array$widgetsA Widget configuration array
string$zoneThe widget zone that's being requested
int$post_idThe auto-draft post ID

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

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

◆ save_postdata()

save_postdata (   $post_id)

Save View configuration.

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 600 of file class-admin-views.php.

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

◆ set_default_view_fields()

set_default_view_fields (   $fields = array(),
  $view = null,
  $form_id = 0 
)

Set the default fields for new Views.

Since
2.17

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

References $column_id, GV\$form, $form_id, $gv_field, GF_Form\by_id(), and GravityView_Fields\get_instance().

◆ suggest_support_articles()

suggest_support_articles (   $localization_data = array())

When on the Add/Edit View screen, suggest most popular articles related to that.

Parameters
array$localization_dataData to be passed to the Support Port JS
Returns
array

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

References gravityview().

◆ tooltips()

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
Runs Filter:
gravityview/metaboxes/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 369 of file class-admin-views.php.

References $title, and View_Settings\defaults().


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