GravityView  1.19.4
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...
 
 process_bulk_action ()
 Capture bulk actions - gf_entries table. 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_bulk_actions ($form_id)
 Get an array of options to be added to the Gravity Forms "Bulk action" dropdown in a "GravityView" option group. More...
 
 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_gv_bulk_action ()
 Get the Bulk Action submitted value if it is a GravityView Approve/Unapprove action. More...
 
 get_sort_link ($form_id=0)
 Generate a link to sort by approval status (if there is an Approve/Disapprove field) 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 ( )

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

References add_hooks().

Member Function Documentation

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 389 of file class-admin-approve-entries.php.

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

add_field_buttons (   $field_groups)

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

public

Parameters
mixed$field_groups
Returns
array Array of fields

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

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 (   $hook)
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 76 of file class-admin-approve-entries.php.

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

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 372 of file class-admin-approve-entries.php.

References $form.

get_bulk_actions (   $form_id)
private

Get an array of options to be added to the Gravity Forms "Bulk action" dropdown in a "GravityView" option group.

Since
1.16.3
Parameters
int$form_idID of the form currently being displayed
Returns
array Array of actions to be added to the GravityView option group
Runs Filter:
gravityview/approve_entries/bulk_actions Modify the GravityView "Bulk action" dropdown list. Return an empty array to hide.
See also
https://gist.github.com/zackkatz/82785402c996b51b4dc9 for an example of how to use this filter
Since
1.16.3
Parameters
array$bulk_actionsAssociative array of actions to be added to "Bulk action" dropdown inside GravityView <optgroup>. Parent array key is the <optgroup> label, then each child array must have label (displayed text) and value (input value) keys
int$form_idID of the form currently being displayed

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

References $form_id, $i, and GravityView_Entry_Approval_Status\get_string().

Referenced by add_scripts_and_styles().

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 434 of file class-admin-approve-entries.php.

References $form_id, and $forms.

Referenced by 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 413 of file class-admin-approve-entries.php.

References $form_id, and get_first_form_id().

Referenced by add_scripts_and_styles().

get_gv_bulk_action ( )
private

Get the Bulk Action submitted value if it is a GravityView Approve/Unapprove action.

Since
1.17.1
Returns
string|false If the bulk action was GravityView Approve/Unapprove, return the full string (gvapprove-16, gvunapprove-16). Otherwise, return false.

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

Referenced by process_bulk_action().

get_sort_link (   $form_id = 0)
private

Generate a link to sort by approval status (if there is an Approve/Disapprove field)

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.

Parameters
int$form_id
Returns
string Sorting link

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

References $form_id.

Referenced by add_scripts_and_styles().

process_bulk_action ( )

Capture bulk actions - gf_entries table.

GravityView_frontend::get_search_criteria() Convert the $_POST search request into a properly formatted request. public

Returns
void|boolean

The extra '-' is to make sure that there are at least two items in array.

See also
https://github.com/katzwebservices/GravityView/issues/370

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

References $entries, $form_id, GravityView_Entry_Approval_Status\APPROVED, GravityView_Entry_Approval_Status\DISAPPROVED, get_gv_bulk_action(), GravityView_frontend\get_search_criteria(), gravityview_get_entry_ids(), GravityView_Entry_Approval_Status\UNAPPROVED, and GravityView_Entry_Approval\update_bulk().

register_gform_noconflict_script (   $scripts)

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

register_gform_noconflict_style (   $styles)

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

set_defaults ( )

At edit form page, set the field Approve defaults.

Returns
void

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

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 586 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)

Add the GravityView Fields group tooltip.

Parameters
$tooltips
Returns
array Tooltips array with GravityView fields tooltip

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

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 359 of file class-admin-approve-entries.php.

References $form_id, and GravityView_Entry_Approval\update_approved().

Field Documentation

$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 = ''

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


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