Пример #1
0
$tpl->HEADER_BREAD_CRUMB = '<li><a href="home-home"><i class="fa fa-home"> </i> Home</a></li>
                                        <li><a href="perfil-main"><i class="fa fa-users"> </i> Perfil</a></li>
                                         <li class="active">Editar</li>';
//TRATA O CONTEUDO------------------------------------------------------------------------------------------------------------
$obj = new Perfil();
$objPermissao = new Permissao();
$objMenu = new Menu();
$tpl->LABEL = "Incluir Perfil";
$tpl->ACAO = "incluir";
$tpl->id = 0;
$arrayMenusSelecionados = array();
if (isset($_REQUEST['id'])) {
    $tpl->LABEL = "Editar Perfil";
    $tpl->ACAO = "editar";
    $tpl->id = $_REQUEST['id'];
    $obj->getById($obj->md5_decrypt($_REQUEST['id']));
    $tpl->nome = $obj->descricao;
    $listaPermissaos = $objPermissao->recuperaMenuAcessos($obj->id);
    foreach ($listaPermissaos as $key => $m) {
        $arrayMenusSelecionados[] = $m->menu->id;
    }
}
$menus = $objMenu->recuperaMenusCompletos(0);
foreach ($menus as $key => $m) {
    $tpl->DESC_MENU = $m->nome;
    $tpl->IDMENU = $m->id;
    if (in_array($m->id, $arrayMenusSelecionados)) {
        $tpl->CHECKMENU = 'checked="checked"';
    }
    $submenus = $objMenu->recuperaMenusCompletos($m->id);
    foreach ($submenus as $key2 => $sm) {