<?php
    if ('' != $i) {
        $replace = array('-inserir', '-editar', '-processo', '-ordenar');
        $param = str_replace($replace, '', $i);

        $objTela = Tela::buscar($param, 'slug');

        $nomeModulo = ($objTela) ? $objTela->nome : '';

        $cms = explode('-', $i);
        array_shift($cms);

        if ($cms && 'home' != $cms[0]) {
            ?>
            <div class="breadcrumb">
                <a href="<?= $baseUrl; ?>" title="">Painel de Controle</a>

                <?php if (isset($cms[1])) : ?>
                    / <a href="<?= $baseUrl . '?i=cms-' . $cms[0]; ?>" title=""><?= $nomeModulo; ?></a>
                <?php else : ?>
                    / <strong><?= $nomeModulo; ?></strong>
                <?php endif; ?>

                <?php if (isset($cms[1])) : ?>
                    / <strong><?= $cms[1]; ?></strong>
                <?php endif; ?>
            </div>
<?php
        }
    }
?>
