Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 42 additions & 30 deletions classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,18 @@ private static function get_action_links( $id, $entry ) {
$page = FrmAppHelper::get_param( 'frm_action' );
$actions = array();

$actions['frm_edit'] = array(
'url' => '#',
'label' => __( 'Edit Entry', 'formidable' ),
'class' => 'frm_noallow',
'data' => array(
'upgrade' => __( 'Entry edits', 'formidable' ),
'medium' => 'edit-entries',
'content' => 'entry',
),
'icon' => 'frmfont frm_pencil_icon',
);

if ( $page !== 'show' ) {
$actions['frm_view'] = array(
'url' => admin_url( 'admin.php?page=formidable-entries&frm_action=show&id=' . $id . '&form=' . $entry->form_id ),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot access property $form_id on array|object


The property you are trying to access is not defined and will cause unexpected behavior when used.

Expand All @@ -770,18 +782,6 @@ private static function get_action_links( $id, $entry ) {
);
}

if ( current_user_can( 'frm_delete_entries' ) ) {
$actions['frm_delete'] = array(
'url' => wp_nonce_url( admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id ) ),
'label' => __( 'Delete Entry', 'formidable' ),
'icon' => 'frmfont frm_delete_icon',
'data' => array(
'frmverify' => __( 'Permanently delete this entry?', 'formidable' ),
'frmverify-btn' => 'frm-button-red',
),
);
}

if ( $page === 'show' ) {
$actions['frm_print'] = array(
'url' => '#',
Expand All @@ -793,18 +793,6 @@ private static function get_action_links( $id, $entry ) {
);
}

$actions['frm_resend'] = array(
'url' => '#',
'label' => __( 'Resend Emails', 'formidable' ),
'class' => 'frm_noallow',
'data' => array(
'upgrade' => __( 'Resend Emails', 'formidable' ),
'medium' => 'resend-email',
'content' => 'entry',
),
'icon' => 'frmfont frm_email_icon',
);

if ( ! function_exists( 'frm_pdfs_autoloader' ) ) {
$actions['frm_download_pdf'] = array(
'url' => '#',
Expand All @@ -815,19 +803,43 @@ private static function get_action_links( $id, $entry ) {
);
}

$actions['frm_edit'] = array(
$actions['frm_resend'] = array(
'url' => '#',
'label' => __( 'Edit Entry', 'formidable' ),
'label' => __( 'Resend Emails', 'formidable' ),
'class' => 'frm_noallow',
'data' => array(
'upgrade' => __( 'Entry edits', 'formidable' ),
'medium' => 'edit-entries',
'upgrade' => __( 'Resend Emails', 'formidable' ),
'medium' => 'resend-email',
'content' => 'entry',
),
'icon' => 'frmfont frm_pencil_icon',
'icon' => 'frmfont frm_email_icon',
);

return apply_filters( 'frm_entry_actions_dropdown', $actions, compact( 'id', 'entry' ) );
if ( current_user_can( 'frm_delete_entries' ) ) {
$actions['frm_delete'] = array(
'url' => wp_nonce_url( admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id ) ),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot access property $form_id on array|object


The property you are trying to access is not defined and will cause unexpected behavior when used.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot access property $form_id on array|object


The property you are trying to access is not defined and will cause unexpected behavior when used.

'label' => __( 'Delete Entry', 'formidable' ),
'class' => 'frm_delete_entry',
'icon' => 'frmfont frm_delete_icon',
'data' => array(
'frmverify' => __( 'Permanently delete this entry?', 'formidable' ),
'frmverify-btn' => 'frm-button-red',
),
);
}

$actions = apply_filters( 'frm_entry_actions_dropdown', $actions, compact( 'id', 'entry' ) );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function apply_filters invoked with 3 parameters, 2 required


The function call is not valid, which will result in a fatal runtime error.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function apply_filters invoked with 3 parameters, 2 required


The function call is not valid, which will result in a fatal runtime error.


if ( ! isset( $actions['frm_delete'] ) ) {
return $actions;
}

// Make delete the last link.
$delete_action = $actions['frm_delete'];
unset( $actions['frm_delete'] );
$actions['frm_delete'] = $delete_action;

return $actions;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion css/frm_admin.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions resources/scss/admin/layout/page/_single-entry-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@
.frm_single_entry_page .hndle a {
font-size: 13px;
}

#form_show_entry_page .misc-pub-section .frm_delete_entry,
#form_entries_page .misc-pub-section .frm_delete_entry,
#form_show_entry_page .misc-pub-section .frm_delete_entry .frmsvg,
#form_entries_page .misc-pub-section .frm_delete_entry .frmsvg {
color: var(--error-700);
}
Loading