GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Data Fields | Private Member Functions
GravityView_Template Class Reference

Class used to register a new template to be shown in GravityView presets. More...

Inheritance diagram for GravityView_Template:
GravityView_Default_Template_Edit GravityView_Default_Template_List GravityView_Default_Template_Table GravityView_Placeholder_Template GravityView_Preset_Business_Listings GravityView_Preset_Event_Listings GravityView_Preset_Job_Board GravityView_Preset_Profiles GravityView_Preset_Staff_Profiles GravityView_Preset_Website_Showcase GravityView_Preset_Business_Data GravityView_Preset_Issue_Tracker GravityView_Preset_Resume_Board

Public Member Functions

 __construct ( $id, $settings=array(), $field_options=array(), $areas=array())
 
 assign_active_areas ( $areas, $template='', $context='directory')
 Assign active areas (for admin configuration) More...
 
 assign_field_options ( $field_options, $template_id, $field_id=NULL, $context='directory', $input_type='')
 Assign template specific field options. More...
 
 assign_fields_xml ( $xml='', $template='')
 Set the Gravity Forms import form by using the preset_fields field defined in the template. More...
 
 assign_form_xml ( $xml='', $template='')
 Set the Gravity Forms import form information by using the preset_form field defined in the template. More...
 
 assign_view_slug ( $default, $context)
 Assign the template slug when loading the presentation template (frontend) More...
 
 get_active_areas ( $context)
 
 register_styles ()
 If the template has a CSS file defined in the css_source setting, register it It will be registered using gravityview_style_{template_id} format. More...
 
 register_template ( $templates)
 Register the template to display in the admin. More...
 

Data Fields

 $active_areas
 
 $field_options
 
 $settings
 
 $template_id
 

Private Member Functions

 add_hooks ()
 Add filters and actions for the templates. More...
 
 merge_defaults ( $settings=array())
 Merge the template settings with the default settings. More...
 

Detailed Description

Class used to register a new template to be shown in GravityView presets.

Definition at line 6 of file class-gravityview-template.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id,
  $settings = array(),
  $field_options = array(),
  $areas = array() 
)

Member Function Documentation

◆ add_hooks()

add_hooks ( )
private

Add filters and actions for the templates.

Since
1.15

Definition at line 61 of file class-gravityview-template.php.

Referenced by __construct().

◆ assign_active_areas()

assign_active_areas (   $areas,
  $template = '',
  $context = 'directory' 
)

Assign active areas (for admin configuration)

protected

Parameters
array$areas
string$template(default: '')
Returns
array Array of active areas

Definition at line 139 of file class-gravityview-template.php.

References $template, and get_active_areas().

◆ assign_field_options()

assign_field_options (   $field_options,
  $template_id,
  $field_id = NULL,
  $context = 'directory',
  $input_type = '' 
)

Assign template specific field options.

Parameters
array$options(default: array())
string$template(default: '')
string$field_idkey for the field
string | array$contextContext for the field; directory or single for example.
Returns
array Array of field options

Definition at line 166 of file class-gravityview-template.php.

References $field_options, $template_id, and Utils\get().

◆ assign_fields_xml()

assign_fields_xml (   $xml = '',
  $template = '' 
)

Set the Gravity Forms import form by using the preset_fields field defined in the template.

See also
GravityView_Admin_Views::pre_get_form_fields()
Returns
string Path to XML file

Definition at line 209 of file class-gravityview-template.php.

References $template.

◆ assign_form_xml()

assign_form_xml (   $xml = '',
  $template = '' 
)

Set the Gravity Forms import form information by using the preset_form field defined in the template.

See also
GravityView_Admin_Views::pre_get_form_fields()
GravityView_Admin_Views::create_preset_form()
Returns
string Path to XML file

Definition at line 195 of file class-gravityview-template.php.

References $template.

◆ assign_view_slug()

assign_view_slug (   $default,
  $context 
)

Assign the template slug when loading the presentation template (frontend)

protected

Parameters
mixed$default
Returns
string

Definition at line 227 of file class-gravityview-template.php.

References $template_id.

◆ get_active_areas()

get_active_areas (   $context)

Definition at line 147 of file class-gravityview-template.php.

References $active_areas.

Referenced by assign_active_areas().

◆ merge_defaults()

merge_defaults (   $settings = array())
private

Merge the template settings with the default settings.

Sets the settings object var.

Parameters
array$settingsDefined template settings
Returns
array Merged template settings.

Definition at line 93 of file class-gravityview-template.php.

References $settings.

Referenced by __construct().

◆ register_styles()

register_styles ( )

If the template has a CSS file defined in the css_source setting, register it It will be registered using gravityview_style_{template_id} format.

Returns
void

Definition at line 246 of file class-gravityview-template.php.

References GV_PLUGIN_VERSION.

◆ register_template()

register_template (   $templates)

Register the template to display in the admin.

private

Parameters
mixed$templates
Returns
array Array of templates available for GV

Definition at line 122 of file class-gravityview-template.php.

References $settings, $template_id, and $templates.

Field Documentation

◆ $active_areas

$active_areas

Definition at line 37 of file class-gravityview-template.php.

Referenced by get_active_areas().

◆ $field_options

$field_options

◆ $settings

$settings

◆ $template_id

$template_id

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