/home/techb158/on-time-movers.com/wp-content/plugins/wpforms/src/Pro/Admin/Entries/Export
Edit: /home/techb158/on-time-movers.com/wp-content/plugins/wpforms/src/Pro/Admin/Entries/Export/Admin.php (12200B)
export = $export;
$this->hooks();
}
/**
* Register hooks.
*
* @since 1.5.5
*/
public function hooks() {
add_action( 'admin_enqueue_scripts', [ $this, 'scripts' ] );
add_action( 'wpforms_admin_tools_export_top', [ $this, 'display_entries_export_form' ] );
}
/**
* Output HTML of the Entries export form.
*
* @since 1.5.5
*/
public function display_entries_export_form() {
wp_enqueue_style( 'wpforms-flatpickr' );
wp_enqueue_script( 'wpforms-flatpickr' );
wp_enqueue_script( 'wpforms-tools-entries-export' );
?>
form->get(
'',
[
'orderby' => 'title',
'cap' => 'view_entries_form_single',
]
);
$form_id = $this->export->data['get_args']['form_id'];
if ( ! empty( $forms ) ) {
?>
' . esc_html__( 'You need to have at least one form before you can use entries export.', 'wpforms' ) . '';
}
}
/**
* Form fields checkboxes block HTML.
*
* @since 1.5.5
*/
public function display_fields_selection_block() {
$form_data = $this->export->data['form_data'];
$fields = $this->export->data['get_args']['fields'];
if ( empty( $form_data['fields'] ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
printf( '
%s', $this->export->errors['form_empty'] );
return;
}
$this->display_select_all_toggle();
$i = 0;
foreach ( $form_data['fields'] as $id => $field ) {
if ( in_array( $field['type'], $this->export->configuration['disallowed_fields'], true ) ) {
continue;
}
$name = ! empty( $field['label'] )
? trim( wp_strip_all_tags( $field['label'] ) )
: sprintf( /* translators: %d - Field ID. */
esc_html__( 'Field #%d', 'wpforms' ),
(int) $id
);
printf(
'
',
(int) $i,
(int) $id,
esc_attr( $this->get_checked_property( $id, $fields ) ),
esc_html( $name )
);
$i ++;
}
}
/**
* Additional information block HTML.
*
* @since 1.5.5
*/
public function display_additional_info_block() {
$additional_info = $this->export->data['get_args']['additional_info'];
$additional_info_fields = $this->export->additional_info_fields;
$this->display_select_all_toggle( false );
$i = 0;
foreach ( $additional_info_fields as $slug => $label ) {
if (
$slug === 'pginfo'
&& ! ( class_exists( 'WPForms_Paypal_Standard' ) || class_exists( '\WPFormsStripe\Loader' ) || class_exists( '\WPFormsAuthorizeNet\Loader' ) || class_exists( '\WPFormsSquare\Plugin' ) || class_exists( '\WPFormsPaypalCommerce\Plugin' ) )
) {
continue;
}
printf(
'
',
(int) $i,
esc_attr( $slug ),
esc_attr( $this->get_checked_property( $slug, $additional_info, '' ) ),
esc_html( $label )
);
$i ++;
}
}
/**
* Export options block.
*
* @since 1.6.5
*/
private function display_export_options_block() {
$export_option = $this->export->data['get_args']['export_options'];
$export_options = $this->export->export_options_fields;
if ( empty( $export_options ) ) {
return;
}
echo '
';
}
/**
* Search block HTML.
*
* @since 1.5.5
*/
public function display_search_block() {
$search = $this->export->data['get_args']['search'];
$form_data = $this->export->data['form_data'];
$advanced_options = Helpers::get_search_fields_advanced_options();
?>
export->get_localized_data()
);
}
/**
* Get checked property according to value and array of values.
* Only for checkboxes.
*
* @since 1.5.5
*
* @param string $val Value.
* @param array $arr Array of values.
* @param string $default Either ' checked' OR ''.
*
* @return string
*/
public function get_checked_property( $val, $arr, $default = ' checked' ) {
$checked = $default !== ' checked' ? '' : $default;
if ( empty( $arr ) || ! is_array( $arr ) ) {
return $checked;
}
$checked = ' checked';
if ( ! in_array( $val, $arr, true ) ) {
$checked = '';
}
return $checked;
}
/**
* Display "Select All" checkbox toggle for a list of options.
*
* @since 1.7.6
*
* @param bool $checked Whether to check the box. Defaults to checked.
*/
private function display_select_all_toggle( $checked = true ) {
printf(
'
',
esc_attr( $checked ? ' checked' : '' ),
esc_html__( 'Select All', 'wpforms' )
);
}
}