<?php
/**
 *
 *
 * @var int     $form_id            Which form we are dealing with.
 * @var array   $entries            Which entries we are modifying.
 * @var array   $selected_fields    Which fields were selected.
 * @var array   $current_query_args Which query args are we using.
 * @var boolean $is_all_entries     Which fields were selected.
 * @var string  $view               Which view are in.
 * @var string  $bulk_action        Which bulk action these fields are for.
 * @var mixed   $form               Form settings.
 */

use GravityKit\GravityActions\Admin;


if ( empty( $entries ) ) {
	$entries = [];
}

$is_all_entries = $is_all_entries ?: false;

?>
<input type="hidden" name="form_id" value="<?php echo esc_attr( $this->get( 'form_id', null ) ); ?>"/>
<input type="hidden" name="bulk_action" value="<?php echo esc_attr( $bulk_action ); ?>"/>
<input type="hidden" name="is_all_entries" value="<?php echo (bool) $is_all_entries; ?>"/>
<?php foreach ( $current_query_args as $query_arg_name => $query_arg_value ) { ?>
	<input type="hidden" name="current_query_args[<?php echo esc_attr( $query_arg_name ); ?>]" value="<?php echo esc_attr( $query_arg_value ); ?>"/>
<?php } ?>
<?php if ( ! $is_all_entries ) { ?>
	<?php foreach ( $entries as $entry_id ) { ?>
		<input type="hidden" name="entries" value="<?php echo esc_attr( $entry_id ); ?>"/>
	<?php } ?>
<?php } ?>
<?php wp_nonce_field( Admin::$modal_nonce_action, Admin::$modal_nonce_name ); ?>
