first draft for the menu
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 18 Apr 2005 17:13:45 +0000 (17:13 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:40 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-573

14 files changed:
htdocs.net/apropos.php
htdocs.net/article12.php
htdocs.net/article16.php
htdocs.net/creation-groupex.php
htdocs.net/css/xnet.css
htdocs.net/deconnexion.php
htdocs.net/index.php
htdocs.net/login.php
htdocs.net/manuel.php
htdocs.net/plan.php
htdocs.net/services.php
include/xnet/page.inc.php
templates/xnet/deconnexion.tpl
templates/xnet/skin.tpl

index 53a426a..785863f 100644 (file)
@@ -1,6 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/apropos.tpl', AUTH_PUBLIC);
+    new_page('xnet/apropos.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 ?>
index 2564df5..63ee697 100644 (file)
@@ -1,6 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/article12.tpl', AUTH_PUBLIC);
+    new_page('xnet/article12.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 ?>
index 76bc42d..b735d50 100644 (file)
@@ -1,6 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/article16.tpl', AUTH_PUBLIC);
+    new_page('xnet/article16.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 ?>
index 7aaf99c..65f7bef 100644 (file)
@@ -1,6 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/creation-groupex.tpl', AUTH_PUBLIC);
+    new_page('xnet/creation-groupex.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 ?>
index c05920e..a0fdbc7 100644 (file)
@@ -104,25 +104,25 @@ td#search {
     width: 100%;
 }
 
-td#menu { width: 150px; }
+td#menu {
+    width: 150px;
+    padding-right: 1em;
+    font-family: "Trebuchet MS", "Arial",sans-serif;
+    font-weight: bold;
+}
 
-#menu th {
+#menu h1 {
     padding: 0.5em 0em 0.6em 0em;
-    font-size: 95%;
-    text-align: left;
-    font-family: "Arial",sans-serif;
-    vertical-align: middle;
+    font-size: 90%;
     text-align: center;
-    font-weight: bold;
-    background: url('images/barre.png') bottom left no-repeat;
+    background: url('../images/barre.png') bottom left no-repeat;
 }
 
-#menu td {
-    padding: 0.2em 0em 0.2em 0em;
-    font-size: 95%;
-    text-align: left;
-    font-family: "Arial",sans-serif;
-    vertical-align: middle;
+#menu a {
+    display: block;
+    padding: 0.2em 0em 0.2em 15px;
+    font-size: 90%;
+    background: url('../images/puce.png') no-repeat center left;
 }
 
 /***************************************************************************
index 9672536..2f51784 100644 (file)
@@ -4,6 +4,7 @@
     XnetSession::destroy();
 
     new_page('xnet/deconnexion.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 
 ?>
index 7db4380..c8eb659 100644 (file)
@@ -1,6 +1,6 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/index.tpl', AUTH_PUBLIC);
+    new_page('xnet/index.tpl', AUTH_PUBLIC);
     $page->run();
 ?>
index 73207b5..9d6034f 100644 (file)
@@ -5,6 +5,6 @@
         header("Location: index.php");
     }
 
-    new_skinned_page('index.tpl', AUTH_MDP);
+    new_page('index.tpl', AUTH_MDP);
     $page->run();
 ?>
index d7d651d..0f1f070 100644 (file)
@@ -1,6 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/manuel.tpl', AUTH_PUBLIC);
+    new_page('xnet/manuel.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 ?>
index cf17d49..52728e6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/plan.tpl', AUTH_PUBLIC);
+    new_page('xnet/plan.tpl', AUTH_PUBLIC);
     $page->setType('plan');
 
     $res = $globals->xdb->iterator(
index 306212d..192a1a6 100644 (file)
@@ -1,6 +1,7 @@
 <?php
     require 'xnet.inc.php';
 
-    new_skinned_page('xnet/services.tpl', AUTH_PUBLIC);
+    new_page('xnet/services.tpl', AUTH_PUBLIC);
+    $page->useMenu();
     $page->run();
 ?>
index b4d0a57..e0dbcc5 100644 (file)
@@ -54,7 +54,52 @@ class XnetPage extends PlatalPage
 
     function useMenu()
     {
-        $this->assign('menu', true);
+        global $globals;
+
+        $menu = array();
+
+        $sub = array();
+        $sub['accueil']           = 'index.php';
+        $sub['liste des groupes'] = 'plan.php';
+        if (logged()) {
+            $sub['déconnexion']   = 'deconnexion.php';
+        }
+        $menu["Menu Principal"]   = $sub;
+
+        if (logged() && (is_member() || may_update())) {
+            $sub = array();
+            $dim = $globals->asso('diminutif');
+            $sub['accueil'] = "$dim/asso.php";
+            $sub['annuaire du groupe'] = "$dim/annuaire.php";
+            if ($globals->asso('mail_domain')) {
+                $sub['listes de diffusion'] = "$dim/listes.php";
+            }
+            $sub['evenement'] = "$dim/evenement.php";
+            $sub['carnet'] = "$dim/carnet.php";
+            $sub['telepaiement'] = "$dim/telepaiement.php";
+
+            $menu[$globals->asso('nom')] = $sub;
+        } else {
+            $sub = array();
+            $sub['Groupes X']    = "groupes.php?cat=groupesx";
+            $sub['Binets']       = "groupes.php?cat=binets";
+            $sub['Promotions']   = "groupes.php?cat=promotions";
+            $sub['Institutions'] = "groupes.php?cat=institutions";
+
+            $menu['Navigation']  = $sub;
+        }
+
+        if (logged() && may_update()) {
+            $sub = array();
+            $sub['modifier l\'acceuil'] = "$dim/editer.php";
+            $sub['envoyer un mail']     = "$dim/mail.php";
+            $sub['créer une liste']     = "$dim/listes-create.php";
+            $sub['créer un alias']      = "$dim/alias-create.php";
+
+            $menu['Administrer Groupe'] = $sub;
+        }
+
+        $this->assign('menu', $menu);
     }
 
     // }}}
@@ -64,7 +109,7 @@ class XnetPage extends PlatalPage
     {
         $this->register_function('list_all_my_groups', 'list_all_my_groups');
         $this->assign('it_is_xnet', true);
-        if (Get::has('auth')) {
+        if (!logged() && Get::has('auth')) {
             $_SESSION['session']->doAuthX($this);
         }
     }
index 7aaa6c6..eb4ab81 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
 
+<h1> déconnexion de Polytechnique.net </h1>
 
-<div id="content">
-  Au revoir  !
-  <br />
-  Tu as bien été déconnecté du site Polytechnique.net.
-</div>
+<p class="descr">
+Au revoir  !
+<br />
+Tu as bien été déconnecté du site Polytechnique.net.
+</p>
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index d4e41aa..155018d 100644 (file)
       {if $menu}
       <tr>
         <td id="menu">
-          Place du menu
+          {foreach from=$menu key=title item=submenu}
+          <h1>{$title}</h1>
+          {foreach from=$submenu key=tit item=url}
+          <a href="{rel}/{$url}">{$tit}</a>
+          {/foreach}
+          {/foreach}
+          {only_public}
+          <h1>me connecter</h1>
+          <a href="{$smarty.session.session->loginX}">polytechnicien</a>
+          <a href="{rel}/login.php">extérieur</a>
+          {/only_public}
         </td>
         <td colspan="3">
           {include file="skin/common.content.tpl"}
         <td colspan="4">
           <table class="links" summary="liens" cellspacing="0" cellpadding="0">
             <tr>
-              <td> <a href="groupes.php?cat=groupesx">groupes X</a> </td>
-              <td> <a href="groupes.php?cat=binets">binets</a> </td>
-              <td> <a href="groupes.php?cat=promotions">promotions</a> </td>
-              <td> <a href="groupes.php?cat=institutions">institutions</a> </td>
-              <td> <a href="plan.php">plan du site</a> </td>
+              <td> <a href="{rel}/plan.php">PLAN DU SITE</a> </td>
+              <td> <a href="{rel}/groupes.php?cat=groupesx">groupes X</a> </td>
+              <td> <a href="{rel}/groupes.php?cat=binets">binets</a> </td>
+              <td> <a href="{rel}/groupes.php?cat=promotions">promotions</a> </td>
+              <td> <a href="{rel}/groupes.php?cat=institutions">institutions</a> </td>
             </tr>
           </table>
         </td>
 
       <tr>
         <td colspan="3" id="perso">
-          {only_public}
-          <strong>Se connecter en tant que:</strong>
-          <ul>
-            <li><a href="{$smarty.session.session->loginX}">polytechnicien</a></li>
-            <li><a href="login.php">extérieur</a></li>
-          </ul>
-          {/only_public}
           {list_all_my_groups}
         </td>
         <td id="search">