Submissions_List_Page::render_header()

Renders the list page header.

Description

Source

File: src/db-objects/submissions/submissions-list-page.php

	protected function render_header() {
		$capabilities = $this->model_manager->capabilities();

		$new_page_url = '';
		if ( ! empty( $this->edit_page_slug ) ) {
			$new_page_url = add_query_arg( 'page', $this->edit_page_slug, $this->url );
		}

		?>
		<h1 class="wp-heading-inline">
			<?php echo $this->title; ?>
		</h1>

		<?php if ( ! empty( $_GET['form_id'] ) ) : ?>
			<a href="<?php echo esc_url( $this->url ); ?>" class="page-title-action"><?php _ex( 'Back to Overview', 'submission admin list', 'torro-forms' ); ?></a>
		<?php elseif ( ! empty( $new_page_url ) && $capabilities && $capabilities->user_can_create() ) : ?>
			<a href="<?php echo esc_url( $new_page_url ); ?>" class="page-title-action"><?php echo $this->model_manager->get_message( 'list_page_add_new' ); ?></a>
		<?php endif; ?>

		<?php if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) : ?>
			<span class="subtitle"><?php printf( $this->model_manager->get_message( 'list_page_search_results_for' ), esc_attr( wp_unslash( $_REQUEST['s'] ) ) ); ?></span>
		<?php endif; ?>

		<hr class="wp-header-end">

		<?php

		$this->print_current_message( 'bulk_action' );
		$this->print_current_message( 'row_action' );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.