<?php
/**
 * Admin partial: branded masthead shared by every BitForgeNet Guest Tickets screen.
 *
 * The screen-reader <h1> and the <hr class="wp-header-end"> marker before the band are
 * not decoration: WordPress relocates every admin notice — ours and other plugins' — to
 * sit immediately after that marker. Without it, core guesses, and notices end up
 * underneath or on top of the header band. With it, notices always land above the band
 * and the band stays where it belongs.
 *
 * @package BitForgeNet_Guest_Tickets
 *
 * @var string $bfnet_title    Screen title.
 * @var string $bfnet_subtitle Optional subtitle.
 * @var string $bfnet_actions  Optional pre-escaped action buttons markup.
 */

defined( 'ABSPATH' ) || exit;

// This file is a template: it is included from a method -- never at file
// scope -- so everything declared here belongs to that method's variable
// scope and not to the global one. PHPCS reads each file on its own and has
// no way to see where the include happens, so it reads these as globals.
// Stated once, for the whole file, per this plugin's suppression rule.
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

$bfnet_title    = isset( $bfnet_title ) ? $bfnet_title : __( 'BitForgeNet Guest Tickets', 'bitforgenet-guest-tickets' );
$bfnet_subtitle = isset( $bfnet_subtitle ) ? $bfnet_subtitle : '';
$bfnet_actions  = isset( $bfnet_actions ) ? $bfnet_actions : '';
?>
<h1 class="screen-reader-text"><?php echo esc_html( $bfnet_title ); ?></h1>
<hr class="wp-header-end">

<div class="bfnet-masthead">
	<div class="bfnet-masthead__logo">
		<img src="<?php echo esc_url( BFNET_URL . 'assets/images/bitforgenet-guest-tickets-crest.png' ); ?>" alt="">
	</div>
	<div class="bfnet-masthead__text">
		<div class="bfnet-masthead__title"><?php echo esc_html( $bfnet_title ); ?></div>
		<?php if ( $bfnet_subtitle ) : ?>
			<p><?php echo esc_html( $bfnet_subtitle ); ?></p>
		<?php endif; ?>
	</div>
	<?php if ( $bfnet_actions ) : ?>
		<?php /* Markup, not text: every screen that sets $bfnet_actions builds it
		         from esc_url() and esc_html__() and passes it here already safe.
		         Escaping it again would print the tags. */ ?>
		<div class="bfnet-masthead__actions"><?php echo $bfnet_actions; // phpcs:ignore WordPress.Security.EscapeOutput ?></div>
	<?php endif; ?>
</div>

<?php
/*
 * Every screen gets the section bar, because it is included from here rather
 * than pasted into eleven views. Add a screen to the plugin and it appears in
 * the bar the moment it is listed in the partial.
 */
include BFNET_PATH . 'admin/views/partial-tabs.php';
?>
