bbp_converter_settings_page()

The main settings page


Description Description


Source Source

File: includes/admin/settings.php

function bbp_converter_settings_page() {

	// Status
	$step = (int) get_option( '_bbp_converter_step', 0 );
	$max  = (int) bbp_admin()->converter->max_steps;

	// Starting or continuing?
	$status_text = ! empty( $step )
		? sprintf( esc_html__( 'Up next: step %s', 'bbpress' ), $step )
		: esc_html__( 'Ready', 'bbpress' );

	// Starting or continuing?
	$start_text = ! empty( $step )
		? esc_html__( 'Resume', 'bbpress' )
		: esc_html__( 'Start',  'bbpress' );

	// Starting or continuing?
	$progress_text = ! empty( $step )
		? sprintf( esc_html__( 'Previously stopped at step %d of %d', 'bbpress' ), $step, $max )
		: esc_html__( 'Ready to go.', 'bbpress' ); ?>

	<div class="wrap">
		<h1 class="wp-heading-inline"><?php esc_html_e( 'Forum Tools', 'bbpress' ); ?></h1>
		<hr class="wp-header-end">
		<h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( 'bbp-converter' ); ?></h2>

		<div class="bbp-converter-wrap">
			<div id="poststuff" class="bbp-converter-monitor-wrap">
				<div id="post-body" class="metabox-holder columns-1">
					<div id="postbox-container-1" class="postbox-container">
						<div id="normal-sortables" class="meta-box-sortables ui-sortable">
							<div id="bbp-converter-monitor" class="postbox">
								<button type="button" class="handlediv" aria-expanded="true">
									<span class="screen-reader-text"><?php esc_html_e( 'Toggle panel: Import Status', 'bbpress' ); ?></span>
									<span class="toggle-indicator" aria-hidden="true"></span>
								</button>
								<h2 class="hndle ui-sortable-handle">
									<span><?php esc_html_e( 'Import Monitor', 'bbpress' ); ?></span>
									<span id="bbp-converter-status"><?php echo esc_html( $status_text ); ?></span>
									<span id="bbp-converter-step-percentage" class="bbp-progress-bar"></span>
									<span id="bbp-converter-total-percentage" class="bbp-progress-bar"></span>
								</h2>
								<div class="inside">
									<div id="bbp-converter-message" class="bbp-converter-log">
										<p><?php echo esc_html( $progress_text ); ?></p>
									</div>
								</div>
								<div class="actions">
									<input type="button" name="submit" class="button-primary" id="bbp-converter-start" value="<?php echo esc_attr( $start_text ); ?>" />
									<input type="button" name="submit" class="button-primary" id="bbp-converter-stop" value="<?php esc_attr_e( 'Pause', 'bbpress' ); ?>" />
									<span class="spinner" id="bbp-converter-spinner"></span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

			<form action="#" method="post" id="bbp-converter-settings" class="bbp-converter-settings-wrap"><?php

				// Fields
				settings_fields( 'converter' );

				// Sections
				do_settings_sections( 'converter' );

			?></form>
		</div>
	</div>
<?php
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.