/**
  * getTree
  *
  * DEBUG: Affiche l'arbre d'information de l'utilisateur connecté.
  * @author	Frédéric Mossmann <*****@*****.**>
  */
 public function processGetTree()
 {
     $tpl = new CopixTpl();
     $tpl->assign('TITLE_PAGE', "getTree");
     $tpl->assign('MAIN', '<pre>' . print_r(Kernel::getTree(), true) . '</pre>');
     return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $tree = Kernel::getTree();
     $tpl->assign('tree', $tree);
     $toReturn = $tpl->fetch('navigation.tpl');
     // $toReturn = '<pre>'.print_r($tree,true).'</pre>';
     return true;
 }
 public function getTree($racine_type = "ROOT", $racine_node = 0)
 {
     switch ($racine_type) {
         case "ROOT":
             // Recherche des groupes dans l'ENT...
             $grv_dao = _dao("kernel|kernel_tree_grv");
             $grv_list = $grv_dao->findAll();
             $tree->groupes = array();
             foreach ($grv_list as $key => $value) {
                 $tree->groupes[$value->grv_id_grv]->info["nom"] = $value->grv_nom_groupe;
                 $tree->groupes[$value->grv_id_grv]->info["crea"] = $value->grv_date_creation;
                 $tree->groupes[$value->grv_id_grv]->info["level"] = 0 + Kernel::getLevel('BU_GRVILLE', $value->grv_id_grv);
                 // Recherche des villes dans chaque groupe trouvÈ
                 $villes = Kernel::getTree("BU_GRVILLE", $value->grv_id_grv);
                 $tree->groupes[$value->grv_id_grv]->villes = $villes->villes;
             }
             break;
         case "BU_GRVILLE":
             // Recherche des villes dans un groupe...
             $vil_dao = _dao("kernel|kernel_tree_vil");
             $vil_list = $vil_dao->getByGroupeVille($racine_node);
             $tree->villes = array();
             foreach ($vil_list as $key => $value) {
                 $tree->villes[$value->vil_id_vi]->info["nom"] = $value->vil_nom;
                 $tree->villes[$value->vil_id_vi]->info["crea"] = $value->vil_date_creation;
                 $tree->villes[$value->vil_id_vi]->info["level"] = 0 + Kernel::getLevel('BU_VILLE', $value->vil_id_vi);
                 // Recherche des ecoles dans chaque ville trouvÈe
                 $ecoles = Kernel::getTree("BU_VILLE", $value->vil_id_vi);
                 $tree->villes[$value->vil_id_vi]->ecoles = $ecoles->ecoles;
             }
             break;
         case "BU_VILLE":
             // Recherche des Ècoles dans une ville...
             $eco_dao = _dao("kernel|kernel_tree_eco");
             $eco_list = $eco_dao->getByVille($racine_node);
             $tree->ecoles = array();
             foreach ($eco_list as $key => $value) {
                 $tree->ecoles[$value->eco_numero]->info["nom"] = $value->eco_nom;
                 $tree->ecoles[$value->eco_numero]->info["type"] = $value->eco_type;
                 $tree->ecoles[$value->eco_numero]->info["level"] = 0 + Kernel::getLevel('BU_ECOLE', $value->eco_numero);
                 // Recherche des classes dans chaque Ècole trouvÈe
                 $classes = Kernel::getTree("BU_ECOLE", $value->eco_numero);
                 $tree->ecoles[$value->eco_numero]->classes = $classes->classes;
             }
             break;
         case "BU_ECOLE":
             // Recherche des Ècoles dans une ville...
             $cla_dao = _dao("kernel|kernel_tree_claniv");
             $cla_list = $cla_dao->getByEcole($racine_node);
             $tree->classes = array();
             foreach ($cla_list as $key => $value) {
                 $tree->classes[$value->cla_id]->info["nom"] = $value->cla_nom;
                 $tree->classes[$value->cla_id]->info["niveau"] = $value->niv_niveau;
                 $tree->classes[$value->cla_id]->info["type"] = $value->niv_type;
                 $tree->classes[$value->cla_id]->info["level"] = 0 + Kernel::getLevel('BU_CLASSE', $value->cla_id);
             }
             break;
     }
     reset($tree);
     return $tree;
 }