Dropdown menu with submenu and heredocs
Excessive perens in your ternary - they don't help with readability, scrap em...

$showAdminPanel = hasPerms($_SESSION['users_perms'], $_SESSION['role_perms'], 8) ? "&lt;li&gt;&lt;a href='{$backwards}../admin/'&gt;Admin Panel&lt;/a&gt;&lt;/li&gt;" : "";


For long ternary lines I sometimes like to put a line break and a tab before the ? and :.

$showAdminPanel = hasPerms($_SESSION['users_perms'], $_SESSION['role_perms'], 8) 
    ? "&lt;li&gt;&lt;a href='{$backwards}../admin/'&gt;Admin Panel&lt;/a&gt;&lt;/li&gt;" 
    : "";


The second ternary operator contains invalid HTML. &lt;li&gt; must be a child of &lt;ul&gt; or &lt;ol&gt;, not another &lt;li&gt;.

Using strcmp seems like overkill in the scandir loop. it would be faster to just use an == operator. Also, it's generally better practice to creatte and append to an array than to a string. Every time you add to taht string in that loop, the entire string has to be loaded into memory all over again. It's much quicker to use a buffer liek this...

$themes = array();
foreach(scandir($assetsDir."themes/") as $file) {
    if($file == "." || $file == "..") continue;
    $themes[] = '&lt;li&gt;&lt;a class="theme" href="#" rel="'.$themePath."/".$file.'"&gt;'.substr(ucfirst($file),0,-4).'&lt;/a&gt;&lt;/li&gt;';
}
// Turn the buffer into a string
$themes = implode('', $themes);


There is no reason for a heredoc here since you're at the end of the script. Just close the php tag and put the stuff after that (replacing the curlies with &lt;?php= and ;?&gt;), that way you don't have the PHP interpreter interpreting things it doesn't need to interpret.