<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * ADMIN TOPBAR
 * Expects: $page_title, $user.
 */
$user = isset($user) ? $user : array('name' => 'Admin', 'role' => 'editor');
$initial = strtoupper(substr($user['name'], 0, 1));
?>
<header class="topbar">
	<button class="menu-toggle" aria-label="Toggle menu"><?= bloom_icon('menu', 22) ?></button>
	<div>
		<h1><?= html_escape($page_title) ?></h1>
	</div>
	<div class="topbar-spacer"></div>
	<div class="topbar-user">
		<div class="info text-right">
			<div class="nm"><?= html_escape($user['name']) ?></div>
			<div class="rl"><?= html_escape(str_replace('_', ' ', $user['role'])) ?></div>
		</div>
		<div class="avatar"><?= $initial ?></div>
	</div>
</header>
