From aa3ccc05221c33aa8a1086468b21f10d58ac9472 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Mon, 18 Apr 2005 17:13:45 +0000 Subject: [PATCH] first draft for the menu git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-573 --- htdocs.net/apropos.php | 3 ++- htdocs.net/article12.php | 3 ++- htdocs.net/article16.php | 3 ++- htdocs.net/creation-groupex.php | 3 ++- htdocs.net/css/xnet.css | 28 +++++++++++------------ htdocs.net/deconnexion.php | 1 + htdocs.net/index.php | 2 +- htdocs.net/login.php | 2 +- htdocs.net/manuel.php | 3 ++- htdocs.net/plan.php | 2 +- htdocs.net/services.php | 3 ++- include/xnet/page.inc.php | 49 +++++++++++++++++++++++++++++++++++++++-- templates/xnet/deconnexion.tpl | 11 ++++----- templates/xnet/skin.tpl | 29 +++++++++++++----------- 14 files changed, 99 insertions(+), 43 deletions(-) diff --git a/htdocs.net/apropos.php b/htdocs.net/apropos.php index 53a426a..785863f 100644 --- a/htdocs.net/apropos.php +++ b/htdocs.net/apropos.php @@ -1,6 +1,7 @@ useMenu(); $page->run(); ?> diff --git a/htdocs.net/article12.php b/htdocs.net/article12.php index 2564df5..63ee697 100644 --- a/htdocs.net/article12.php +++ b/htdocs.net/article12.php @@ -1,6 +1,7 @@ useMenu(); $page->run(); ?> diff --git a/htdocs.net/article16.php b/htdocs.net/article16.php index 76bc42d..b735d50 100644 --- a/htdocs.net/article16.php +++ b/htdocs.net/article16.php @@ -1,6 +1,7 @@ useMenu(); $page->run(); ?> diff --git a/htdocs.net/creation-groupex.php b/htdocs.net/creation-groupex.php index 7aaf99c..65f7bef 100644 --- a/htdocs.net/creation-groupex.php +++ b/htdocs.net/creation-groupex.php @@ -1,6 +1,7 @@ useMenu(); $page->run(); ?> diff --git a/htdocs.net/css/xnet.css b/htdocs.net/css/xnet.css index c05920e..a0fdbc7 100644 --- a/htdocs.net/css/xnet.css +++ b/htdocs.net/css/xnet.css @@ -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; } /*************************************************************************** diff --git a/htdocs.net/deconnexion.php b/htdocs.net/deconnexion.php index 9672536..2f51784 100644 --- a/htdocs.net/deconnexion.php +++ b/htdocs.net/deconnexion.php @@ -4,6 +4,7 @@ XnetSession::destroy(); new_page('xnet/deconnexion.tpl', AUTH_PUBLIC); + $page->useMenu(); $page->run(); ?> diff --git a/htdocs.net/index.php b/htdocs.net/index.php index 7db4380..c8eb659 100644 --- a/htdocs.net/index.php +++ b/htdocs.net/index.php @@ -1,6 +1,6 @@ run(); ?> diff --git a/htdocs.net/login.php b/htdocs.net/login.php index 73207b5..9d6034f 100644 --- a/htdocs.net/login.php +++ b/htdocs.net/login.php @@ -5,6 +5,6 @@ header("Location: index.php"); } - new_skinned_page('index.tpl', AUTH_MDP); + new_page('index.tpl', AUTH_MDP); $page->run(); ?> diff --git a/htdocs.net/manuel.php b/htdocs.net/manuel.php index d7d651d..0f1f070 100644 --- a/htdocs.net/manuel.php +++ b/htdocs.net/manuel.php @@ -1,6 +1,7 @@ useMenu(); $page->run(); ?> diff --git a/htdocs.net/plan.php b/htdocs.net/plan.php index cf17d49..52728e6 100644 --- a/htdocs.net/plan.php +++ b/htdocs.net/plan.php @@ -1,7 +1,7 @@ setType('plan'); $res = $globals->xdb->iterator( diff --git a/htdocs.net/services.php b/htdocs.net/services.php index 306212d..192a1a6 100644 --- a/htdocs.net/services.php +++ b/htdocs.net/services.php @@ -1,6 +1,7 @@ useMenu(); $page->run(); ?> diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index b4d0a57..e0dbcc5 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -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); } } diff --git a/templates/xnet/deconnexion.tpl b/templates/xnet/deconnexion.tpl index 7aaa6c6..eb4ab81 100644 --- a/templates/xnet/deconnexion.tpl +++ b/templates/xnet/deconnexion.tpl @@ -18,11 +18,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************} +

déconnexion de Polytechnique.net

-
- Au revoir ! -
- Tu as bien été déconnecté du site Polytechnique.net. -
+

+Au revoir ! +
+Tu as bien été déconnecté du site Polytechnique.net. +

{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index d4e41aa..155018d 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -80,7 +80,17 @@ {if $menu} - Place du menu + {foreach from=$menu key=title item=submenu} +

{$title}

+ {foreach from=$submenu key=tit item=url} + {$tit} + {/foreach} + {/foreach} + {only_public} +

me connecter

+ polytechnicien + extérieur + {/only_public} {include file="skin/common.content.tpl"} @@ -99,11 +109,11 @@ - - - - - + + + + + @@ -114,13 +124,6 @@ - {only_public} - Se connecter en tant que: - - {/only_public} {list_all_my_groups} -- 2.1.4