Submission_Export_Handler::render_export_form()

Renders the export form.

Description

Source

File: src/components/submission-export-handler.php

	public function render_export_form() {
		if ( ! isset( $_REQUEST['form_id'] ) ) {
			return;
		}

		?>
		<form class="torro-export-form" action="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>" method="POST">
			<input type="hidden" name="action" value="<?php echo esc_attr( $this->get_export_action_name() ); ?>" />
			<input type="hidden" name="form_id" value="<?php echo absint( $_REQUEST['form_id'] ); ?>" />
			<?php wp_nonce_field( $this->nonce_action ); ?>

			<h3><?php _e( 'Export Submissions', 'torro-forms' ); ?></h3>

			<p class="description">
				<?php _e( 'Here you can export all completed submissions in a file format of your choice.', 'torro-forms' ); ?>
			</p>

			<label for="torro-export-mode"><?php _e( 'Export as', 'torro-forms' ); ?></label>
			<select id="torro-export-mode" name="mode" style="margin-right:15px;">
				<?php foreach ( $this->modes as $slug => $mode ) : ?>
					<option value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $mode->get_title() ); ?></option>
				<?php endforeach; ?>
			</select>

			<label for="torro-export-orderby"><?php _e( 'Order by', 'torro-forms' ); ?></label>
			<select id="torro-export-orderby" name="orderby">
				<option value="id"><?php _e( 'ID', 'torro-forms' ); ?></option>
				<option value="timestamp"><?php _e( 'Date', 'torro-forms' ); ?></option>
			</select>

			<label for="torro-export-order" class="screen-reader-text"><?php _e( 'Order', 'torro-forms' ); ?></label>
			<select id="torro-export-order" name="order" style="margin-right:15px;">
				<option value="ASC"><?php _e( 'Ascending', 'torro-forms' ); ?></option>
				<option value="DESC"><?php _e( 'Descending', 'torro-forms' ); ?></option>
			</select>

			<button type="submit" class="button"><?php _e( 'Export', 'torro-forms' ); ?></button>
		</form>
		<?php
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.