<?php
use Mtc\Core\Admin\Menu;
?>

<ol<?php
    if ($start == 0) {
    ?> id="menuSortable"<?php
    }
    ?> class="el">
        <?php
        foreach ($sub_pages as $nav) {
            $url = 'edit.menu.php?id=' . $nav['id'];
            ?>
            <li id="page_<?= $nav['id'] ?>">
                <span><i class="fa fa-bars"></i></span>
                    <?php
                    if (!empty($nav['icon'])) {
                    ?>
                        <i class="left <?= clean_page($nav['icon']) ?>"></i>
                    <?php
                    }
                    ?>

                    <a href="<?= $url ?>">
                        <?= clean_page($nav['title']) ?>
                    </a>
                <a href="menu.php?action=delete&delete_id=<?= $nav['id']; ?>"
                    class="right alert error"
                    name="delete_<?= $nav['id']; ?>"
                    title="Are you sure you want to delete this?"
                >
                    <i class="fa fa-times"></i>
                </a>
                <?php
                Menu::getSubPages($nav['id']);
                ?>
            </li>
    <?php
    }
    ?>
</ol>
