<?php

function toolButtonExists($fileName) {
	$toolPathFs = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..') . DIRECTORY_SEPARATOR . $fileName . '.php';
	return file_exists($toolPathFs);
}

$hasAddDomains   = toolButtonExists('add-domains');
$hasExport       = toolButtonExists('export-domains');
$hasPortfolio    = toolButtonExists('portfolio');
$hasDiagnostics  = toolButtonExists('diagnostics');
$hasWcag         = toolButtonExists('wcag');
$hasLighthouse   = toolButtonExists('lighthouse');
$hasIndex        = toolButtonExists('index');
?>

<div id="appheader">
	<div><a href="/tools/"><div class="biglogo" alt="Watch My Domains Server Edition v6"></div></a></div>
	<div id="apptoolbar">
		<?php
			if (THIS_TOOL_NAME != "add-domains" && toolButtonExists("add-domains")) {
		?>
				<div tabindex="0" title="Add Domains" class="btn btn-tb-add btn-danger event" data-id="tool-add"></div>
		<?php
			}
			if (THIS_TOOL_NAME != "export-domains" && toolButtonExists("export-domains")) {
		?>
				<div tabindex="0" title="Export Domains" class="btn btn-tb-export btn-danger event" data-id="tool-export"></div>
		<?php
			}
			if (THIS_TOOL_NAME != "portfolio" && toolButtonExists("portfolio")) {
		?>
				<div tabindex="0" title="Domain Portfolio" class="btn btn-tb-portfolio btn-danger event" data-id="tool-portfolio"></div>
		<?php
			}
			if (THIS_TOOL_NAME != "diagnostics" && toolButtonExists("diagnostics")) {
		?>
				<div tabindex="0" title="System Diagnostics" class="btn btn-tb-diagnostics btn-danger event" data-id="tool-diagnostics"></div>
		<?php
			}
			if (THIS_TOOL_NAME != "wcag" && toolButtonExists("wcag")) {
		?>
				<div tabindex="0" title="WCAG Reports" class="btn btn-tb-wcag btn-danger event" data-id="tool-wcag"></div>
		<?php
			}
			if (THIS_TOOL_NAME != "lighthouse" && toolButtonExists("lighthouse")) {
		?>
				<div tabindex="0" title="Lighthouse Reports" class="btn btn-tb-lighthouse btn-danger event" data-id="tool-lighthouse"></div>
		<?php
			}
		?>
		<div tabindex="0" title="Settings" class="btn btn-tb-settings btn-settings event" data-id="admin"></div>
		<div tabindex="0" title="Dashboard" class="btn btn-tb-dashboard event btn-monitor" data-id="dashboard"></div>
		<div tabindex="0" title="Registrar Tools" class="require-admin-rights btn btn-tb-toolbox event btn-tools" data-id="toolbox"></div>
		<div tabindex="0" title="SSL Vault" class="require-admin-rights btn btn-tb-sslview event btn-monitor" data-id="sslview"></div>
		<div tabindex="0" title="Report Viewer" class="btn btn-tb-reports event btn-monitor" data-id="reports"></div>
		<?php
			if (THIS_TOOL_NAME != "index" && toolButtonExists("index")) {
		?>
				<div tabindex="0" title="Custom Tools" class="btn btn-tb-customtools btn-tools event" data-id="tools"></div>
		<?php
			}
		?>
		<div tabindex="0" title="Domain Table View" class="btn btn-tb-data event btn-monitor" data-id="data"></div>
		<div tabindex="0" title="Domain Alerts" class="btn btn-tb-monitor event btn-monitor" data-id="monitor"></div>
		<div tabindex="0" title="Logout" class="btn btn-tb-logout event btn-auth" data-id="logout"></div>
	</div>
</div>

<div id="tooltip"></div>