From 71fe935c7d548595482e912fff605cd7a0390708 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Thu, 13 Jul 2006 22:56:53 +0000 Subject: [PATCH] migrate trivial pages into xnet module =============================================================================== hooks/tmp.inc.php | 2 htdocs.net/article12.php | 7 -- htdocs.net/article16.php | 7 -- htdocs.net/creation-groupex.php | 7 -- htdocs.net/deconnexion.php | 10 --- htdocs.net/fiche.php | 4 - htdocs.net/manuel.php | 7 -- htdocs.net/plan.php | 42 -------------- htdocs.net/services.php | 7 -- include/xnet/page.inc.php | 4 - include/xnet/session.inc.php | 2 modules/xnet.php | 102 +++++++++++++++++++++++++++++++++++- templates/xnet/article12.tpl | 2 templates/xnet/article16.tpl | 2 templates/xnet/creation-groupex.tpl | 2 templates/xnet/include/descr.tpl | 8 +- templates/xnet/index.tpl | 4 - templates/xnet/services.tpl | 6 +- templates/xnet/skin.tpl | 8 +- =============================================================================== 19 files changed, 120 insertions(+), 113 deletions(-) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@475 839d8a87-29fc-0310-9880-83ba4fa771e5 --- hooks/tmp.inc.php | 2 +- htdocs.net/article12.php | 7 --- htdocs.net/article16.php | 7 --- htdocs.net/creation-groupex.php | 7 --- htdocs.net/deconnexion.php | 10 ---- htdocs.net/fiche.php | 4 -- htdocs.net/manuel.php | 7 --- htdocs.net/plan.php | 42 --------------- htdocs.net/services.php | 7 --- include/xnet/page.inc.php | 4 +- include/xnet/session.inc.php | 2 +- modules/xnet.php | 102 +++++++++++++++++++++++++++++++++++- templates/xnet/article12.tpl | 2 +- templates/xnet/article16.tpl | 2 +- templates/xnet/creation-groupex.tpl | 2 +- templates/xnet/include/descr.tpl | 8 +-- templates/xnet/index.tpl | 4 +- templates/xnet/services.tpl | 6 +-- templates/xnet/skin.tpl | 8 +-- 19 files changed, 120 insertions(+), 113 deletions(-) delete mode 100644 htdocs.net/article12.php delete mode 100644 htdocs.net/article16.php delete mode 100644 htdocs.net/creation-groupex.php delete mode 100644 htdocs.net/deconnexion.php delete mode 100644 htdocs.net/fiche.php delete mode 100644 htdocs.net/manuel.php delete mode 100644 htdocs.net/plan.php delete mode 100644 htdocs.net/services.php diff --git a/hooks/tmp.inc.php b/hooks/tmp.inc.php index 736b998..a965508 100644 --- a/hooks/tmp.inc.php +++ b/hooks/tmp.inc.php @@ -33,7 +33,7 @@ function tmp_menu() $globals->menu->addPrivateEntry(XOM_GROUPS, 20, 'Conseil Pro.', 'referent'); if ($globals->geoloc->use_map()) $globals->menu->addPrivateEntry(XOM_GROUPS, 10, 'Planisphère', 'geoloc/'); - $globals->menu->addPrivateEntry(XOM_GROUPS, 30, 'Groupes X', 'http://www.polytechnique.net/plan.php'); + $globals->menu->addPrivateEntry(XOM_GROUPS, 30, 'Groupes X', 'http://www.polytechnique.net/plan'); $globals->menu->addPrivateEntry(XOM_INFOS, 10, 'Documentations', 'Docs/'); $globals->menu->addPrivateEntry(XOM_INFOS, 20, 'Nous contacter', 'Docs/NousContacter'); diff --git a/htdocs.net/article12.php b/htdocs.net/article12.php deleted file mode 100644 index 63ee697..0000000 --- a/htdocs.net/article12.php +++ /dev/null @@ -1,7 +0,0 @@ -useMenu(); - $page->run(); -?> diff --git a/htdocs.net/article16.php b/htdocs.net/article16.php deleted file mode 100644 index b735d50..0000000 --- a/htdocs.net/article16.php +++ /dev/null @@ -1,7 +0,0 @@ -useMenu(); - $page->run(); -?> diff --git a/htdocs.net/creation-groupex.php b/htdocs.net/creation-groupex.php deleted file mode 100644 index 65f7bef..0000000 --- a/htdocs.net/creation-groupex.php +++ /dev/null @@ -1,7 +0,0 @@ -useMenu(); - $page->run(); -?> diff --git a/htdocs.net/deconnexion.php b/htdocs.net/deconnexion.php deleted file mode 100644 index 2f51784..0000000 --- a/htdocs.net/deconnexion.php +++ /dev/null @@ -1,10 +0,0 @@ -useMenu(); - $page->run(); - -?> diff --git a/htdocs.net/fiche.php b/htdocs.net/fiche.php deleted file mode 100644 index 8058809..0000000 --- a/htdocs.net/fiche.php +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/htdocs.net/manuel.php b/htdocs.net/manuel.php deleted file mode 100644 index 0f1f070..0000000 --- a/htdocs.net/manuel.php +++ /dev/null @@ -1,7 +0,0 @@ -useMenu(); - $page->run(); -?> diff --git a/htdocs.net/plan.php b/htdocs.net/plan.php deleted file mode 100644 index 52728e6..0000000 --- a/htdocs.net/plan.php +++ /dev/null @@ -1,42 +0,0 @@ -setType('plan'); - - $res = $globals->xdb->iterator( - 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom - FROM groupex.dom - INNER JOIN groupex.asso ON dom.id = asso.dom - WHERE FIND_IN_SET("GroupesX", dom.cat) AND FIND_IN_SET("GroupesX", asso.cat) - ORDER BY dom.nom, asso.nom'); - $groupesx = array(); - while ($tmp = $res->next()) { $groupesx[$tmp['id']][] = $tmp; } - $page->assign('groupesx', $groupesx); - - $res = $globals->xdb->iterator( - 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom - FROM groupex.dom - INNER JOIN groupex.asso ON dom.id = asso.dom - WHERE FIND_IN_SET("Binets", dom.cat) AND FIND_IN_SET("Binets", asso.cat) - ORDER BY dom.nom, asso.nom'); - $binets = array(); - while ($tmp = $res->next()) { $binets[$tmp['id']][] = $tmp; } - $page->assign('binets', $binets); - - $res = $globals->xdb->iterator( - 'SELECT asso.diminutif, asso.nom - FROM groupex.asso - WHERE cat LIKE "%Promotions%" - ORDER BY diminutif'); - $page->assign('promos', $res); - - $res = $globals->xdb->iterator( - 'SELECT asso.diminutif, asso.nom - FROM groupex.asso - WHERE FIND_IN_SET("Institutions", cat) - ORDER BY diminutif'); - $page->assign('inst', $res); - - $page->run(); -?> diff --git a/htdocs.net/services.php b/htdocs.net/services.php deleted file mode 100644 index 192a1a6..0000000 --- a/htdocs.net/services.php +++ /dev/null @@ -1,7 +0,0 @@ -useMenu(); - $page->run(); -?> diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index 6b91e9e..2449623 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -60,12 +60,12 @@ class XnetPage extends PlatalPage $sub = array(); $sub['accueil'] = ''; - $sub['liste des groupes'] = 'plan.php'; + $sub['liste des groupes'] = 'plan'; if (logged()) { if (has_perms()) { $sub['admin X.net'] = 'admin.php'; } - $sub['déconnexion'] = 'deconnexion.php'; + $sub['déconnexion'] = 'exit'; } $menu["Menu Principal"] = $sub; diff --git a/include/xnet/session.inc.php b/include/xnet/session.inc.php index 95f1b34..eef22e2 100644 --- a/include/xnet/session.inc.php +++ b/include/xnet/session.inc.php @@ -44,7 +44,7 @@ class XnetSession extends DiogenesCoreSession } if (!logged()) { // prevent connexion to be linked to deconnexion - if (($i = strpos($_SERVER['REQUEST_URI'], 'deconnexion.php')) !== false) + if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false) $returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i); else $returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; diff --git a/modules/xnet.php b/modules/xnet.php index aa81ac7..867a97c 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -24,8 +24,17 @@ class XnetModule extends PLModule function handlers() { return array( - 'index' => $this->make_hook('index', AUTH_PUBLIC), - 'about' => $this->make_hook('about', AUTH_PUBLIC), + 'index' => $this->make_hook('index', AUTH_PUBLIC), + 'exit' => $this->make_hook('exit', AUTH_PUBLIC), + + 'about' => $this->make_hook('about', AUTH_PUBLIC), + 'article12' => $this->make_hook('article12', AUTH_PUBLIC), + 'article16' => $this->make_hook('article16', AUTH_PUBLIC), + 'creategpx' => $this->make_hook('creategpx', AUTH_PUBLIC), + 'services' => $this->make_hook('services', AUTH_PUBLIC), + 'manuel' => $this->make_hook('manuel', AUTH_PUBLIC), + + 'plan' => $this->make_hook('plan', AUTH_PUBLIC), ); } @@ -35,10 +44,99 @@ class XnetModule extends PLModule return PL_OK; } + function handler_exit(&$page) + { + XnetSession::destroy(); + $page->changeTpl('xnet/deconnexion.tpl'); + $page->useMenu(); + return PL_OK; + } + function handler_about(&$page) { $page->changeTpl('xnet/apropos.tpl'); $page->useMenu(); + return PL_OK; + } + + function handler_article12(&$page) + { + $page->changeTpl('xnet/article12.tpl'); + $page->useMenu(); + return PL_OK; + } + + function handler_article16(&$page) + { + $page->changeTpl('xnet/article16.tpl'); + $page->useMenu(); + return PL_OK; + } + + function handler_creategpx(&$page) + { + $page->changeTpl('xnet/creation-groupex.tpl'); + $page->useMenu(); + return PL_OK; + } + + function handler_creategpx(&$page) + { + $page->changeTpl('xnet/services.tpl'); + $page->useMenu(); + return PL_OK; + } + + function handler_manuel(&$page) + { + $page->changeTpl('xnet/manuel.tpl'); + $page->useMenu(); + return PL_OK; + } + + function handler_plan(&$page) + { + global $globals; + + $page->changeTpl('xnet/plan.tpl'); + + $page->setType('plan'); + + $res = $globals->xdb->iterator( + 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom + FROM groupex.dom + INNER JOIN groupex.asso ON dom.id = asso.dom + WHERE FIND_IN_SET("GroupesX", dom.cat) AND FIND_IN_SET("GroupesX", asso.cat) + ORDER BY dom.nom, asso.nom'); + $groupesx = array(); + while ($tmp = $res->next()) { $groupesx[$tmp['id']][] = $tmp; } + $page->assign('groupesx', $groupesx); + + $res = $globals->xdb->iterator( + 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom + FROM groupex.dom + INNER JOIN groupex.asso ON dom.id = asso.dom + WHERE FIND_IN_SET("Binets", dom.cat) AND FIND_IN_SET("Binets", asso.cat) + ORDER BY dom.nom, asso.nom'); + $binets = array(); + while ($tmp = $res->next()) { $binets[$tmp['id']][] = $tmp; } + $page->assign('binets', $binets); + + $res = $globals->xdb->iterator( + 'SELECT asso.diminutif, asso.nom + FROM groupex.asso + WHERE cat LIKE "%Promotions%" + ORDER BY diminutif'); + $page->assign('promos', $res); + + $res = $globals->xdb->iterator( + 'SELECT asso.diminutif, asso.nom + FROM groupex.asso + WHERE FIND_IN_SET("Institutions", cat) + ORDER BY diminutif'); + $page->assign('inst', $res); + + return PL_OK; } } diff --git a/templates/xnet/article12.tpl b/templates/xnet/article12.tpl index 10c754e..5633864 100644 --- a/templates/xnet/article12.tpl +++ b/templates/xnet/article12.tpl @@ -48,7 +48,7 @@ l'assemblée générale qui se prononce en dernier ressort.

- Revenir à la page décrivant les services... + Revenir à la page décrivant les services...

{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/article16.tpl b/templates/xnet/article16.tpl index 1fb7053..2583c2a 100644 --- a/templates/xnet/article16.tpl +++ b/templates/xnet/article16.tpl @@ -47,7 +47,7 @@ retirés de cette liste. Ce retrait vaut retrait de l'agrément.

- Revenir à la page décrivant les services... + Revenir à la page décrivant les services...

diff --git a/templates/xnet/creation-groupex.tpl b/templates/xnet/creation-groupex.tpl index 6a55c39..3eff4d4 100644 --- a/templates/xnet/creation-groupex.tpl +++ b/templates/xnet/creation-groupex.tpl @@ -220,7 +220,7 @@ association loi 1901.

- Revenir à la page décrivant les services... + Revenir à la page décrivant les services...

diff --git a/templates/xnet/include/descr.tpl b/templates/xnet/include/descr.tpl index 13cea6e..7fe328e 100644 --- a/templates/xnet/include/descr.tpl +++ b/templates/xnet/include/descr.tpl @@ -25,18 +25,18 @@

Les groupes X rassemblent des polytechniciens partageant les mêmes centres d'intérêt, autour de sujets très différents. Certains de ces groupes sont des associations -dépendant de l'Amicale des Anciens, définis par l'article 12 +dépendant de l'Amicale des Anciens, définis par l'article 12 des statuts de l'AX. Les groupes déclarés auprès de l'AX sont indiqués par une petite note en bas de la page qui leur est dédiée sur ce site.

Pour créer un nouveau Groupe X agréé par l'AX au titre de -l'article 12 des statuts, tu peux te référer - aux documents de l'AX. +l'article 12 des statuts, tu peux te référer + aux documents de l'AX.

Si tu souhaites obtenir le statut d'association loi de 1901, tu peux obtenir des -renseignements auprès de sites spécialisés. +renseignements auprès de sites spécialisés.

{elseif $cat eq binets} diff --git a/templates/xnet/index.tpl b/templates/xnet/index.tpl index eb9adb1..de613b7 100644 --- a/templates/xnet/index.tpl +++ b/templates/xnet/index.tpl @@ -36,11 +36,11 @@ Ce site vous propose des liens vers les forums de discussions et les sites webs des différentes associations, des adresses où les contacter, et tous les renseignements utiles pour mieux les connaître. Il offre d'autre part des - outils de gestion de groupe à l'intention de leurs responsables. + outils de gestion de groupe à l'intention de leurs responsables.

Si vous recherchez la page d'un groupe particulier, vous pouvez - en consulter la liste. + en consulter la liste.

diff --git a/templates/xnet/services.tpl b/templates/xnet/services.tpl index 4ac7abe..1f98131 100644 --- a/templates/xnet/services.tpl +++ b/templates/xnet/services.tpl @@ -77,13 +77,13 @@

diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index 4336106..c3a24d1 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -125,7 +125,7 @@ - + @@ -149,7 +149,7 @@