<?php
/**
 * Tab: Admin Bar (Free)
 * @package Panelra
 */
if ( ! defined( 'ABSPATH' ) ) { exit; }
$pnlrdb_hide_roles = get_option( 'pnlrdb_hide_admin_bar_roles', array() );
?>
<h2 class="ap773-section-title"><?php esc_html_e( 'Admin Bar', 'panelra-dashboard-builder' ); ?></h2>
<p class="ap773-section-desc"><?php esc_html_e( 'Control the visibility of the WordPress admin bar per user role.', 'panelra-dashboard-builder' ); ?></p>

<div class="ap773-card">
	<div class="ap773-card-title">
		<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="4" rx="1"/></svg>
		<?php esc_html_e( 'Hide admin bar for roles', 'panelra-dashboard-builder' ); ?>
	</div>
	<p class="ap773-desc" style="margin-bottom:16px;"><?php esc_html_e( 'The admin bar will be hidden for users with the selected roles.', 'panelra-dashboard-builder' ); ?></p>
	<div class="ap773-checkbox-group">
	<?php foreach ( get_editable_roles() as $pnlrdb_role_slug => $pnlrdb_role_info ) : ?>
		<label class="ap773-checkbox-item">
			<input type="checkbox" name="pnlrdb_hide_admin_bar_roles[]"
			       value="<?php echo esc_attr( $pnlrdb_role_slug ); ?>"
			       <?php checked( in_array( $pnlrdb_role_slug, $pnlrdb_hide_roles, true ) ); ?>>
			<?php echo esc_html( $pnlrdb_role_info['name'] ); ?>
			<span class="ap773-slug"><?php echo esc_html( $pnlrdb_role_slug ); ?></span>
		</label>
	<?php endforeach; ?>
	</div>
</div>

<?php do_action( 'pnlrdb_after_adminbar_settings' );
do_action( 'pnlrdb_after_adminbar_settings' ); ?>
