UTF-8 fixes
[platal.git] / include / tabs.inc.php
index 559179f..34b74ae 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  ***************************************************************************/
 
 
-$tabname_array = Array(
-    "general"  => "Informations\ngénérales",
+$GLOBALS['tabname_array'] = Array(
+    "general"  => "Général",
     "adresses" => "Adresses\npersonnelles",
-    "poly"     => "Informations\npolytechniciennes",
-    "deco"     => "Décorations\nMédailles",
+    "poly"     => "Groupes X\nBinets",
+    "deco"     => "Décorations\nMédailles",
     "emploi"   => "Informations\nprofessionnelles",
-    "skill"    => "Compétences\ndiverses",
+    "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;
 }
 
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>