<ul class="tabnav el">
    <?php

    use Mtc\Core\Permissions;

    $selected = '';
    if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/index.php') {
        $selected = 'class="selected"';
    } ?>
    <li <?= $selected ?>>
        <a href="/plugins/MembersMessaging/admin/index.php">Messages</a>
    </li>

    <?php
    $selected = '';
    if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/all_messages.php') {
        $selected = 'class="selected"';
    } ?>
    <li <?= $selected ?>>
        <a href="/plugins/MembersMessaging/admin/all_messages.php">All Messages</a>
    </li>

    <?php
    $selected = '';
    if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/my_messages.php') {
        $selected = 'class="selected"';
    } ?>
    <li <?= $selected ?>>
        <a href="/plugins/MembersMessaging/admin/my_messages.php">My Messages</a>
    </li>

    <?php
    $admin_user = \Mtc\Core\AdminUser::getCurrent();

    if(Permissions::can(Permissions::EDIT_MESSAGE_TEMPLATES)) {
        $selected = '';
        if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/edit_templates.php') {
            $selected = 'class="selected"';
        } ?>
        <li <?= $selected ?>>
            <a href="/plugins/MembersMessaging/admin/edit_templates.php">Edit Templates</a>
        </li>
        <?php
        $selected = '';
        if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/edit_template.php') {
            $selected = 'class="selected"';
        } ?>
        <li <?= $selected ?>>
            <a href="/plugins/MembersMessaging/admin/edit_template.php">Add Template</a>
        </li>
        <?php
        $selected = '';
        if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/archive.php') {
            $selected = 'class="selected"';
        } ?>
        <li <?= $selected ?>>
            <a href="/plugins/MembersMessaging/admin/archive.php">Message archive</a>
        </li>
        <?php
        $selected = '';
        if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/satisfactory.php') {
            $selected = 'class="selected"';
        } ?>
        <li <?= $selected ?>>
            <a href="/plugins/MembersMessaging/admin/satisfactory.php">Satisfactory</a>
        </li>
        <?php
        $selected = '';
        if ($_SERVER['SCRIPT_NAME'] == '/plugins/MembersMessaging/admin/response_time.php') {
            $selected = 'class="selected"';
        } ?>
        <li <?= $selected ?>>
            <a href="/plugins/MembersMessaging/admin/response_time.php">Response time</a>
        </li>
    <?php
    }
    ?>
</ul>
