X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Ftabs.inc.php;h=25d9568d4ac3cf9ffca62259a3b56092e8a06f78;hb=315fa6ae2cbee21fec0ad56bda592a184860737a;hp=559179f38da94d79704ea0512e77c3c481f48db4;hpb=0337d704b62718d7c77106c0e4c4e26fb02beacf;p=platal.git diff --git a/include/tabs.inc.php b/include/tabs.inc.php index 559179f..25d9568 100644 --- a/include/tabs.inc.php +++ b/include/tabs.inc.php @@ -1,6 +1,6 @@ "Informations\ngénérales", +$GLOBALS['tabname_array'] = Array( + "general" => "Général", "adresses" => "Adresses\npersonnelles", - "poly" => "Informations\npolytechniciennes", + "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'); +$page->assign('onglets', $GLOBALS['tabname_array']); -function get_last_tab(){ - end($GLOBALS['tabname_array']); - return key($GLOBALS['tabname_array']); -} +function get_next_tab($tabname) { + $tabname_array = $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){ + reset ($tabname_array); + while (list($current_tab, ) = 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{ + if (is_null($res)) { reset($tabname_array); return key($tabname_array); } + return $res; } } - // We should not arrive to this point, but at least, we return the first key - reset($tabname_array); - return key($tabname_array); + + return null; } ?>