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

Static Public Member Functions

static _sort_by_priority ( $a, $b)
 Sort field settings by the priority key. More...
 
static get_cap_choices ( $template_id='', $field_id='', $context='', $input_type='')
 Get capabilities options for GravityView. More...
 
static get_default_field_options ( $field_type, $template_id, $field_id, $context, $input_type, $form_id, $grouped=false)
 Get the default options for a standard field. More...
 
static get_field_groups ()
 Get available field groups. More...
 
static load_type_class ( $field=NULL)
 Given a field type calculates the php class. More...
 
static render_checkbox_option ( $name='', $id='', $current='')
 
static render_field_option ( $name='', $option=array(), $curr_value=null)
 Handle rendering a field option form element. More...
 
static render_field_options ( $form_id, $field_type, $template_id, $field_id, $field_label, $area, $input_type=NULL, $uniqid='', $current='', $context='single', $item=array())
 Render Field Options html (shown through a dialog box) More...
 
static render_select_option ( $name='', $id='', $choices=array(), $current='')
 Render the HTML for a select box to be used on the field & widgets options. More...
 
static render_setting_row ( $key='', $current_settings=array(), $override_input=null, $name='template_settings[%s]', $id='gravityview_se_%s')
 Output a table row for view settings. More...
 
static render_text_option ( $name='', $id='', $current='', $add_merge_tags=NULL, $args=array())
 
static render_textarea_option ( $name='', $id='', $current='', $add_merge_tags=NULL, $args=array())
 

Detailed Description

Definition at line 14 of file class.render.settings.php.

Member Function Documentation

◆ _sort_by_priority()

static _sort_by_priority (   $a,
  $b 
)
static

Sort field settings by the priority key.

Default priority is 10001. Lower is higher.

Since
3.0

Definition at line 208 of file class.render.settings.php.

References Utils\get().

◆ get_cap_choices()

static get_cap_choices (   $template_id = '',
  $field_id = '',
  $context = '',
  $input_type = '' 
)
static

Get capabilities options for GravityView.

Parameters are only to pass to the filter.

Parameters
string$template_idOptional. View slug
string$field_idOptional. GF Field ID - Example: 3, 5.2, entry_link, created_by
string$contextOptional. What context are we in? Example: single or directory
string$input_typeOptional. (textarea, list, select, etc.)
Returns
array Associative array, with the key being the capability and the value being the label shown.
Runs Filter:
gravityview_field_visibility_caps Modify the capabilities shown in the field dropdown
See also
https://docs.gravityview.co/article/96-how-to-modify-capabilities-shown-in-the-field-only-visible-to-dropdown
Since
1.0.1
Parameters
array$select_cap_choicesAssociative rray of role slugs with labels ( manage_options => Administrator )
string$template_idOptional. View slug
string$field_idOptional. GF Field ID - Example: 3, 5.2, entry_link, created_by
string$contextOptional. What context are we in? Example: single or directory
string$input_typeOptional. (textarea, list, select, etc.)

Definition at line 231 of file class.render.settings.php.

References $field_id.

Referenced by GravityView_Delete_Entry_Admin\delete_link_field_options(), GravityView_Duplicate_Entry\duplicate_link_field_options(), and GravityView_Edit_Entry_Admin\field_options().

◆ get_default_field_options()

static get_default_field_options (   $field_type,
  $template_id,
  $field_id,
  $context,
  $input_type,
  $form_id,
  $grouped = false 
)
static

Get the default options for a standard field.

Since
2.10 added $grouped parameter
Parameters
string$field_typeType of field options to render (field or widget)
string$template_idLayout slug (default_table, default_list, datatables_table, etc.
float$field_idGF Field ID - Example: 3, 5.2, entry_link, created_by
string$contextWhat context are we in? Example: single or directory
string$input_type(textarea, list, select, etc.)
int$form_idThe form ID.
Since
develop
Parameters
bool$groupedWhether to group the field settings by group key
Returns
array Array of field options with label, value, type, default keys
Runs Filter:
gravityview_template_{$field_type}_options Filter the field options by field type. Filter names: gravityview_template_field_options and gravityview_template_widget_options
Parameters
arrayArray of field options with label, value, type, default keys
string$template_idTable slug
float$field_idGF Field ID - Example: 3, 5.2, entry_link, created_by
string$contextWhat context are we in? Example: single or directory
string$input_type(textarea, list, select, etc.)
int$form_idThe form ID. {
Since
2.5}
Runs Filter:
gravityview_template_{$input_type}_options Filter the field options by input type ($input_type examples: textarea, list, select, etc.)
Parameters
arrayArray of field options with label, value, type, default keys
string$template_idTable slug
float$field_idGF Field ID - Example: 3, 5.2, entry_link, created_by
string$contextWhat context are we in? Example: single or directory
string$input_type(textarea, list, select, etc.)
int$form_idThe form ID. {
Since
2.5}

Definition at line 50 of file class.render.settings.php.

References $field_id, $form_id, and Utils\get().

◆ get_field_groups()

static get_field_groups ( )
static

Get available field groups.

Since
2.10
Returns
array

Definition at line 23 of file class.render.settings.php.

◆ load_type_class()

static load_type_class (   $field = NULL)
static

Given a field type calculates the php class.

If not found try to load it.

Parameters
array$field
Returns
string type class name
Runs Filter:
gravityview/setting/class/{field_type}
Parameters
string$class_suffixfield class suffix; GravityView_FieldType_{$class_suffix}
array$fieldfield data
Runs Filter:
gravityview/setting/class_file/{field_type}
Parameters
string$field_type_include_pathfield class file path
array$fieldfield data

Definition at line 607 of file class.render.settings.php.

References $field, and GRAVITYVIEW_DIR.

◆ render_checkbox_option()

static render_checkbox_option (   $name = '',
  $id = '',
  $current = '' 
)
static
Parameters
string$name,nameattribute
string$currentcurrent value
Returns
string html tags

Definition at line 649 of file class.render.settings.php.

References $name, and $output.

◆ render_field_option()

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

Handle rendering a field option form element.

Parameters
string$nameInput name attribute
array$optionAssociative array of options. See the $defaults variable for available keys.
mixed$curr_valueCurrent value of option
Returns
string HTML output of option
See also
GravityView_FieldType::get_field_defaults

GravityView_FieldType $render_type

Runs Filter:
gravityview/option/output/{option_type} Modify the output for a GravityView setting.
$option_type is the type of setting (radio, text, etc.)
Parameters
string$outputfield class name
array$optionoption field data

Definition at line 471 of file class.render.settings.php.

References $name, and $output.

Referenced by GravityView_Admin_Views\render_field_option().

◆ render_field_options()

static render_field_options (   $form_id,
  $field_type,
  $template_id,
  $field_id,
  $field_label,
  $area,
  $input_type = NULL,
  $uniqid = '',
  $current = '',
  $context = 'single',
  $item = array() 
)
static

Render Field Options html (shown through a dialog box)

See also
GravityView_Ajax::get_field_options
GravityView_Admin_Views::render_active_areas
Parameters
string$form_id
string$field_typefield / widget
string$template_id
string$field_id
string$field_label
string$area
string$uniqid(default: '')
string$current(default: '')
string$context(default: 'single')
array$itemField or widget array that's being rendered
Returns
string HTML of dialog box

Definition at line 281 of file class.render.settings.php.

References $field_id, $field_settings, GV\$form, $form_id, $gv_field, $output, $template, $value, Utils\get(), GravityView_Fields\get(), and GVCommon\get_form_or_form_template().

Referenced by GravityView_Ajax\get_field_options(), and GravityView_Admin_Views\render_active_areas().

◆ render_select_option()

static render_select_option (   $name = '',
  $id = '',
  $choices = array(),
  $current = '' 
)
static

Render the HTML for a select box to be used on the field & widgets options.

Parameters
string$name[name attribute]
array$choices[select options]
string$current[current value]
Returns
string [html tags]

Definition at line 732 of file class.render.settings.php.

References $label, $name, $output, and $value.

◆ render_setting_row()

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

Output a table row for view settings.

Parameters
string$keyThe key of the input
array$current_settingsAssociative array of current settings to use as input values, if set. If not set, the defaults are used.
string$override_input[description]
string$name[description]
string$id[description]
Returns
void [description]
See also
GravityView_FieldType::get_field_defaults

GravityView_FieldType $render_type

Definition at line 528 of file class.render.settings.php.

References $current_settings, $name, $output, $settings, and View_Settings\with_defaults().

Referenced by GravityView_Admin_Add_Shortcode\add_shortcode_popup(), GravityView_Admin_Views\render_setting_row(), GravityView_Delete_Entry_Admin\view_settings_delete_entry_metabox(), GravityView_Delete_Entry_Admin\view_settings_edit_entry_metabox(), GravityView_Delete_Entry_Admin\view_settings_metabox(), and GravityView_Edit_Entry_Admin\view_settings_metabox().

◆ render_text_option()

static render_text_option (   $name = '',
  $id = '',
  $current = '',
  $add_merge_tags = NULL,
  $args = array() 
)
static
Parameters
string$nameUnique name of the field. Exampe: fields[directory_list-title][5374ff6ab128b][custom_label]
string$current[current value]
string$add_merge_tagsAdd merge tags to the input?
array$argsField settings, including class key for CSS class
Returns
string [html tags]

Definition at line 669 of file class.render.settings.php.

References $args, $class, and $name.

◆ render_textarea_option()

static render_textarea_option (   $name = '',
  $id = '',
  $current = '',
  $add_merge_tags = NULL,
  $args = array() 
)
static
Parameters
string$nameUnique name of the field. Exampe: fields[directory_list-title][5374ff6ab128b][custom_label]
string$current[current value]
string | boolean$add_merge_tagsAdd merge tags to the input?
array$argsField settings, including class key for CSS class
Returns
string [html tags]

Definition at line 701 of file class.render.settings.php.

References $args, $class, and $name.


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