From 0e02493eeb0714d750f9b9ceb0d566ac7d9dd2d4 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Thu, 13 Jul 2006 23:37:05 +0000 Subject: [PATCH] migrate groupes.php also git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@480 839d8a87-29fc-0310-9880-83ba4fa771e5 --- htdocs.net/groupes.php | 29 --------------------------- modules/xnet.php | 42 ++++++++++++++++++++++++++++++++++++++++ templates/xnet/groupes.tpl | 14 +++++++------- templates/xnet/manuel-public.tpl | 8 ++++---- templates/xnet/plan.tpl | 10 +++++----- templates/xnet/skin.tpl | 18 ++++++++--------- 6 files changed, 67 insertions(+), 54 deletions(-) delete mode 100644 htdocs.net/groupes.php diff --git a/htdocs.net/groupes.php b/htdocs.net/groupes.php deleted file mode 100644 index f083b95..0000000 --- a/htdocs.net/groupes.php +++ /dev/null @@ -1,29 +0,0 @@ -xdb->query("SELECT id,nom FROM groupex.dom WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat); - $doms = $res->fetchAllAssoc(); - $page->assign('doms', $doms); - - if (empty($doms)) { - $res = $globals->xdb->iterator("SELECT diminutif, nom FROM groupex.asso WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat); - } elseif (Get::has('dom')) { - $res = $globals->xdb->iterator("SELECT diminutif, nom FROM groupex.asso WHERE FIND_IN_SET({?}, cat) AND dom={?} ORDER BY nom", $cat, Get::getInt('dom')); - } else { - $res = null; - } - $page->assign('gps', $res); - - $page->useMenu(); - $page->setType($cat); - $page->run(); -?> diff --git a/modules/xnet.php b/modules/xnet.php index 282d7c8..2d4a983 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -35,6 +35,8 @@ class XnetModule extends PLModule 'manuel' => $this->make_hook('manuel', AUTH_PUBLIC), 'admin' => $this->make_hook('admin', AUTH_MDP, 'admin'), + 'groups' => $this->make_hook('groups', AUTH_PUBLIC), + 'groupes.php' => $this->make_hook('groups2', AUTH_PUBLIC), 'plan' => $this->make_hook('plan', AUTH_PUBLIC), ); } @@ -182,6 +184,46 @@ class XnetModule extends PLModule ORDER BY diminutif'); $page->assign('inst', $res); } + + function handler_groups2(&$page) + { + $this->handler_groups(&$page, Get::get('cat'), Get::get('dom')); + } + + function handler_groups(&$page, $cat = null, $dom = null) + { + global $globals; + + if (!$cat) { + $this->handler_index(&$page); + } + + $cat = strtolower($cat); + + $page->changeTpl('xnet/groupes.tpl'); + $page->assign('cat', $cat); + $page->assign('dom', $dom); + + $res = $globals->xdb->query("SELECT id,nom FROM groupex.dom + WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat); + $doms = $res->fetchAllAssoc(); + $page->assign('doms', $doms); + + if (empty($doms)) { + $res = $globals->xdb->iterator("SELECT diminutif, nom FROM groupex.asso + WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat); + } elseif (!is_null($dom)) { + $res = $globals->xdb->iterator("SELECT diminutif, nom FROM groupex.asso + WHERE FIND_IN_SET({?}, cat) AND dom={?} + ORDER BY nom", $cat, $dom); + } else { + $res = null; + } + $page->assign('gps', $res); + + $page->useMenu(); + $page->setType($cat); + } } ?> diff --git a/templates/xnet/groupes.tpl b/templates/xnet/groupes.tpl index b7f27d0..a158168 100644 --- a/templates/xnet/groupes.tpl +++ b/templates/xnet/groupes.tpl @@ -23,24 +23,24 @@ {if !$doms || !$gps} {/if} {if $doms} diff --git a/templates/xnet/manuel-public.tpl b/templates/xnet/manuel-public.tpl index 99ad61a..c5e815c 100644 --- a/templates/xnet/manuel-public.tpl +++ b/templates/xnet/manuel-public.tpl @@ -63,10 +63,10 @@ associations, en cliquant sur plan du site. Chacune des 4 catégories dispose d'une page descriptive. L'adresse de cette page varie suivant la catégorie représentée : diff --git a/templates/xnet/plan.tpl b/templates/xnet/plan.tpl index b386971..d12b294 100644 --- a/templates/xnet/plan.tpl +++ b/templates/xnet/plan.tpl @@ -25,12 +25,12 @@
- {include file="xnet/include/descr.tpl" cat=$smarty.get.cat} + {include file="xnet/include/descr.tpl"}
- - - - + + + + {foreach from=$doms item=g} -
- {$g.nom} + {/foreach}
- +
Groupes XGroupes X
{foreach from=$groupesx key=id item=dom} - {$dom[0].domnom} + {$dom[0].domnom} {foreach from=$dom item=g} {$g.nom} {/foreach} @@ -43,7 +43,7 @@ - +
BinetsBinets
@@ -61,7 +61,7 @@ - +
PromotionsPromotions
@@ -76,7 +76,7 @@ - + -- 2.1.4
InstitutionsInstitutions
diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index c3a24d1..7e569f3 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -95,14 +95,14 @@