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

Public Member Functions

 __construct ()
 
 add_field_buttons ( $field_groups)
 Inject new add field buttons in the gravity form editor page. More...
 
 add_scripts_and_styles ( $hook)
 
 filter_links_entry_list ( $filter_links=array(), $form=array(), $include_counts=true)
 Add filter links to the Entries page. More...
 
 register_gform_noconflict_script ( $scripts)
 
 register_gform_noconflict_style ( $styles)
 
 set_defaults ()
 At edit form page, set the field Approve defaults. More...
 
 tooltips ( $tooltips)
 Add the GravityView Fields group tooltip. More...
 

Static Public Member Functions

static add_entry_approved_hidden_input ( $form_id, $field_id, $value, $entry, $query_string)
 Add a hidden input that is used in the Javascript to show approved/disapproved entries checkbox. More...
 
static get_approved_column ( $form)
 Calculate the approve field.input id. More...
 
static update_approved ( $entry_id=0, $approved=0, $form_id=0, $approvedcolumn=0)
 update_approved function. More...
 

Data Fields

 $bulk_update_message = ''
 

Private Member Functions

 add_hooks ()
 
 get_first_form_id ()
 Get the first form ID from Gravity Forms, sorted in the same order as in the All Forms page. More...
 
 get_form_id ()
 Get the form ID of the form currently being displayed. More...
 
 get_sort_link ( $form_id=0)
 Generate a link to sort by approval status. More...
 
 show_approve_entry_column ( $form_id)
 Should the Approve/Reject Entry column be shown in the GF Entries page? More...
 

Private Attributes

 $bulk_action_prefixes
 

Detailed Description

Definition at line 15 of file class-admin-approve-entries.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 30 of file class-admin-approve-entries.php.

References add_hooks().

Member Function Documentation

◆ add_entry_approved_hidden_input()

static add_entry_approved_hidden_input (   $form_id,
  $field_id,
  $value,
  $entry,
  $query_string 
)
static

Add a hidden input that is used in the Javascript to show approved/disapproved entries checkbox.

See the /assets/js/admin-entries-list.js setInitialApprovedEntries method

Parameters
$form_id
$field_id
$value
$entry
$query_string
Returns
void

Definition at line 293 of file class-admin-approve-entries.php.

References $entry, GravityView_Entry_Approval\get_entry_status(), and GVCommon\has_cap().

◆ add_field_buttons()

add_field_buttons (   $field_groups)

Inject new add field buttons in the gravity form editor page.

Parameters
mixed$field_groups
Returns
array Array of fields

Definition at line 163 of file class-admin-approve-entries.php.

◆ add_hooks()

add_hooks ( )
private

Edit Gravity Form page

gf_entries page - entries table screen

Definition at line 36 of file class-admin-approve-entries.php.

Referenced by __construct().

◆ add_scripts_and_styles()

add_scripts_and_styles (   $hook)

◆ filter_links_entry_list()

filter_links_entry_list (   $filter_links = array(),
  $form = array(),
  $include_counts = true 
)

Add filter links to the Entries page.

Can be disabled by returning false on the gravityview/approve_entries/show_filter_links_entry_list filter

Since
1.17.1
Parameters
array$filter_linksArray of links to include in the subsubsub filter list. Includes id, field_filters, count, and label keys
array$formGF Form object of current form
bool$include_countsWhether to include counts in the output
Returns
array Filter links, with GravityView approved/disapproved links added
Runs Filter:
gravityview/approve_entries/show_filter_links_entry_list Disable filter links
Since
1.17.1
Parameters
bool$show_filter_linksTrue: show the "approved"/"disapproved" filter links. False: hide them.
array$formGF Form object of current form

Definition at line 73 of file class-admin-approve-entries.php.

References GV\$form, GravityView_Entry_Approval_Status\APPROVED, GravityView_Entry_Approval_Status\DISAPPROVED, GravityView_Entry_Approval_Status\get_label(), gravityview_get_entry_ids(), GravityView_Entry_Approval\meta_key, and GravityView_Entry_Approval_Status\UNAPPROVED.

◆ get_approved_column()

static get_approved_column (   $form)
static

Calculate the approve field.input id.

Since
1.18 Moved to GravityView_Entry_Approval::get_approved_column
See also
GravityView_Entry_Approval::get_approved_column
Parameters
mixed$formGF Form or Form ID
Returns
false|null|string Returns the input ID of the approved field. Returns NULL if no approved fields were found. Returns false if $form_id wasn't set.

Definition at line 276 of file class-admin-approve-entries.php.

References GV\$form.

◆ get_first_form_id()

get_first_form_id ( )
private

Get the first form ID from Gravity Forms, sorted in the same order as in the All Forms page.

See also
GFEntryList::all_entries_page() This method is based on the form-selecting code here
Since
1.17.2
Returns
int ID of the first form, sorted by title. 0 if no forms were found.

Definition at line 338 of file class-admin-approve-entries.php.

References $form_id, $forms, and gravityview().

Referenced by get_form_id().

◆ get_form_id()

get_form_id ( )
private

Get the form ID of the form currently being displayed.

Since
1.17.1
Returns
int ID of the current form being displayed. 0 is returned if no forms are found.

Definition at line 317 of file class-admin-approve-entries.php.

References $form_id, and get_first_form_id().

Referenced by add_scripts_and_styles().

◆ get_sort_link()

get_sort_link (   $form_id = 0)
private

Generate a link to sort by approval status.

Note: Sorting by approval will never be great because it's not possible currently to declare the sorting as numeric, but it does group the approved entries together.

Since
2.0.14 Remove need for approval field for sorting by approval status
Parameters
int$form_id[NO LONGER USED]
Returns
string Sorting link

Definition at line 419 of file class-admin-approve-entries.php.

References $args.

Referenced by add_scripts_and_styles().

◆ register_gform_noconflict_script()

register_gform_noconflict_script (   $scripts)

Definition at line 468 of file class-admin-approve-entries.php.

◆ register_gform_noconflict_style()

register_gform_noconflict_style (   $styles)

Definition at line 475 of file class-admin-approve-entries.php.

◆ set_defaults()

set_defaults ( )

At edit form page, set the field Approve defaults.

Returns
void

Definition at line 199 of file class-admin-approve-entries.php.

◆ show_approve_entry_column()

show_approve_entry_column (   $form_id)
private

Should the Approve/Reject Entry column be shown in the GF Entries page?

Since
1.7.2
Parameters
int$form_idThe ID of the Gravity Forms form for which entries are being shown
Returns
bool True: Show column; False: hide column
Runs Filter:
gravityview/approve_entries/hide-if-no-connections Return true to hide reject/approve if there are no connected Views
Since
1.7.2
Parameters
boolean$hide_if_no_connections
Runs Filter:
gravityview/approve_entries/show-column Override whether the column is shown
Parameters
boolean$show_approve_columnWhether the column will be shown
int$form_idThe ID of the Gravity Forms form for which entries are being shown

Definition at line 438 of file class-admin-approve-entries.php.

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

Referenced by add_scripts_and_styles().

◆ tooltips()

tooltips (   $tooltips)

Add the GravityView Fields group tooltip.

Parameters
$tooltips
Returns
array Tooltips array with GravityView fields tooltip

Definition at line 146 of file class-admin-approve-entries.php.

◆ update_approved()

static update_approved (   $entry_id = 0,
  $approved = 0,
  $form_id = 0,
  $approvedcolumn = 0 
)
static

update_approved function.

Since
1.18 Moved to GravityView_Entry_Approval::update_approved
See also
GravityView_Entry_Approval::update_approved
Parameters
int$entry_id(default: 0)
int$approved(default: 0)
int$form_id(default: 0)
int$approvedcolumn(default: 0)
Returns
boolean True: It worked; False: it failed

Definition at line 263 of file class-admin-approve-entries.php.

References $form_id, and GravityView_Entry_Approval\update_approved().

Field Documentation

◆ $bulk_action_prefixes

$bulk_action_prefixes
private
Initial value:
= array(
'approve' => 'gvapprove',
'disapprove' => 'gvdisapprove',
'unapprove' => 'gvunapprove',
)

Definition at line 24 of file class-admin-approve-entries.php.

◆ $bulk_update_message

$bulk_update_message = ''

Definition at line 18 of file class-admin-approve-entries.php.


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