$tpl->assign('button', $button); $tpl->assign('description', $description); $users = User::getAllUsers(); $ranks = new Rank(); $ranks = $ranks->populate(); $ranksLabel = array(); foreach ($ranks as $rank) { $ranksLabel[$rank->getId()] = $rank->getLabel(); } $tpl->assign('ranksLabel', $ranksLabel); $tpl->assign('users', $users); $tpl->assign('ranks', $ranks); break; case 'access': $rankManager = new Rank(); $ranks = $rankManager->populate(); //Gestion de la modification des rank if (isset($_['id_rank'])) { $id_modrank = $_['id_rank']; $selected = $rankManager->getById($id_modrank); $description = $selected->getLabel(); $button = "Modifier"; $tpl->assign('id_modrank', $id_modrank); $tpl->assign('label_rank', $selected->getLabel()); $tpl->assign('description_rank', $selected->getDescription()); } else { $description = "Ajout d'un rang"; $button = "Ajouter"; } $tpl->assign('description', $description); $tpl->assign('button', $button);