"Général", "adresses" => "Adresses\npersonnelles", "poly" => "Groupes X\nBinets", "deco" => "Décorations\nMédailles", "emploi" => "Informations\nprofessionnelles", "skill" => "Compétences\ndiverses", "mentor" => "Mentoring" ); $opened_tab = 'general'; $page->assign("onglets",$tabname_array); $page->assign("onglet_last",'mentor'); function get_last_tab(){ end($GLOBALS['tabname_array']); return key($GLOBALS['tabname_array']); } function get_next_tab($tabname){ global $tabname_array; reset($tabname_array); $marker = false; while(list($current_tab,$current_tab_desc) = each($tabname_array)){ if($current_tab == $tabname){ $res = key($tabname_array);// each() sets key to the next element if($res != NULL)// if it was the last call of each(), key == NULL => we return the first key return $res; else{ reset($tabname_array); return key($tabname_array); } } } // We should not arrive to this point, but at least, we return the first key reset($tabname_array); return key($tabname_array); } ?>