<?php
require_once(__DIR__.'/../includes/sysinit.php'); //-->needed here for AJAX calls. "require_once" eliminates it being included twice.
require_once(SABLE_THEME_WORKING_PATH."/includes/functions.php");
if (!SableSystem::loggedIn())
{
	// define who may/may not access this page:
	$allowedPages = ['register.php', 'confirm.php', 'join.php', 'done.php'];
	$allow = SableSystem::loggedIn()||in_array($_SESSION['current_page'], $allowedPages)||isSableAdmin();
	if (!$allow) 
	{
		SableGeneralFunctions::revertToLoginPage();
	}
}

function addTabItem($title, $icon)
{
	$html = '';
	$sty = "font-size:1.5em;";
	$fa = '<i class="fa '.$icon.'" style="'.$sty.'"></i>';
	$html.='<div class="col-sm-2 col-md-2 col-lg-2 pointer">
				<div class="sable-tab" title="'.$title.'">'.$fa.'&nbsp;'.$title.'</div>
			</div>';
	echo($html);
}