<?php
/**
 * Static Block Navigation
 *
 * @category Plugins
 * @package  Mtc_Static_Blocks
 * @author   mtc. Martins Fridenbergs <martins.fridenbergs@mtcmedia.co.uk>
 */
?>
<ul class="tabnav el">
    <?php
    if ($_SERVER['SCRIPT_NAME']=='/plugins/StaticBlocks/admin/index.php'
        ||  ($_SERVER['SCRIPT_NAME']=='/plugins/StaticBlocks/admin/edit.php'
        && !empty($_REQUEST['id']) && $_REQUEST['id']>0)
    ) {
        $selected = ' class="selected"';
    } else {
        $selected = '';
    }
    ?>
    <li <?= $selected ?>>
        <a href="/plugins/StaticBlocks/admin/index.php">Manage</a>
    </li>
    <?php if ($is_admin) { ?>
        <?php
        if ($_SERVER['SCRIPT_NAME']=='/plugins/StaticBlocks/admin/edit.php'
            && empty($_REQUEST['id'])
        ) {
            $selected = ' class="selected"';
        } else {
            $selected = '';
        } ?>
        <li <?= $selected ?>>
            <a href="/plugins/StaticBlocks/admin/edit.php">Add</a>
        </li>
        <?php
        if (defined('STATIC_BLOCKS_IMAGES_ENABLED')) {
            if(STATIC_BLOCKS_IMAGES_ENABLED) {
                if ($_SERVER['SCRIPT_NAME']
                    == '/plugins/StaticBlocks/admin/paths.php') {
                    $selected = ' class="selected"';
                } else {
                    $selected = '';
                } ?>
                <li <?= $selected ?>>
                    <a href="/plugins/StaticBlocks/admin/paths.php">
                        Manage Image Sizes
                    </a>
                </li>
                <?php
            }
        }
    } ?>
</ul>
