more simplifications, and less echoes
authorx2000habouzit <x2000habouzit>
Tue, 31 Aug 2004 21:39:00 +0000 (21:39 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 31 Aug 2004 21:39:00 +0000 (21:39 +0000)
htdocs/profil.php
include/profil.inc.php [deleted file]
include/tabs.inc.php
templates/profil.tpl

index ba44514..b443773 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: profil.php,v 1.8 2004-08-31 16:04:11 x2000habouzit Exp $
+        $Id: profil.php,v 1.9 2004-08-31 21:39:00 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
 new_skinned_page('profil.tpl',AUTH_MDP, true, 'profil.head.tpl');
 
-//on charge les fonctions
-require_once('profil.inc.php');
+require_once('tabs.inc.php');
+require_once('profil.func.inc.php');
 
 //on met a jour $opened_tab et $new_tab qui sont le tab du POST et le tab demande
 // Tout d'abord, quel est le tab actuel ?
diff --git a/include/profil.inc.php b/include/profil.inc.php
deleted file mode 100644 (file)
index 9ab46ec..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************
-        $Id: profil.inc.php,v 1.4 2004-08-31 11:16:48 x2000habouzit Exp $
- ***************************************************************************/
-
-
-require_once('tabs.inc.php');
-
-require_once('profil.func.inc.php');
-
-$page->register_function('draw_onglets','draw_all_tabs');
-
-?>
index c460b95..9d20f0e 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: tabs.inc.php,v 1.5 2004-08-31 19:48:46 x2000habouzit Exp $
+        $Id: tabs.inc.php,v 1.6 2004-08-31 21:39:01 x2000habouzit Exp $
  ***************************************************************************/
 
 
 $tabname_array = Array(
-    "general"  => "Informations<br/>générales",
-    "adresses" => "Adresses<br/>personnelles",
-    "poly"     => "Informations<br/>polytechniciennes",
-    "emploi"   => "Informations<br/>professionnelles",
-    "skill"    => "Compétences<br/>diverses",
+    "general"  => "Informations\ngénérales",
+    "adresses" => "Adresses\npersonnelles",
+    "poly"     => "Informations\npolytechniciennes",
+    "emploi"   => "Informations\nprofessionnelles",
+    "skill"    => "Compétences\ndiverses",
     "mentor"   => "Mentoring"
 );
     
@@ -61,39 +61,4 @@ function get_next_tab($tabname){
     return key($tabname_array);
 }
 
-function draw_all_tabs(){
-    global $tabname_array, $new_tab;
-    reset($tabname_array);
-?>
-<ul id="onglet">
-<?php
-    while(list($current_tab,$current_tab_desc) = each($tabname_array)){
-        if($current_tab == $new_tab){
-            draw_tab($current_tab, true);
-        }
-        else{
-            draw_tab($current_tab, false);
-        }
-    }?>
-</ul>
-<?php
-}
-
-function draw_tab($tab_name, $is_opened){
-    global $tabname_array;
-    if($is_opened){?>
-           <li class="actif">
-              <?php echo $tabname_array["$tab_name"];?>
-           </li>
-  <?php }
-    else{ ?>
-           <li>
-          <a href="<?php echo "{$_SERVER['PHP_SELF']}?old_tab=$tab_name";?>">
-                 <?php echo $tabname_array["$tab_name"];?>
-              </a>
-           </li>
-  <?php }
-}
-
-
 ?>
index e64ab95..1603ca4 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: profil.tpl,v 1.9 2004-08-31 15:03:33 x2000habouzit Exp $
+        $Id: profil.tpl,v 1.10 2004-08-31 21:39:01 x2000habouzit Exp $
  ***************************************************************************}
 
 
   <table class="cadre_a_onglet" cellpadding="0" cellspacing="0">
     <tr>
       <td>
-        {draw_onglets}
+        <ul id='onglet'>
+          {foreach from=$onglets key=o item=i}
+          {if $o eq $onglet}
+          <li class="actif">{$i|nl2br}</li>
+          {else}
+          <li><a href="{$smarty.server.PHP_SELF}?old_tab={$o}">{$i|nl2br}</a></li>
+          {/if}
+          {/foreach}
+        </ul>
         <input type="hidden" value="" name="binet_op" />
         <input type="hidden" value="" name="binet_id" />
         <input type="hidden" value="" name="groupex_op" />