migrate groupes.php also
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 13 Jul 2006 23:37:05 +0000 (23:37 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 13 Jul 2006 23:37:05 +0000 (23:37 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@480 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs.net/groupes.php [deleted file]
modules/xnet.php
templates/xnet/groupes.tpl
templates/xnet/manuel-public.tpl
templates/xnet/plan.tpl
templates/xnet/skin.tpl

diff --git a/htdocs.net/groupes.php b/htdocs.net/groupes.php
deleted file mode 100644 (file)
index f083b95..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-    require 'xnet.inc.php';
-
-    if (!($cat = Get::get('cat'))) {
-        redirect("index.php");
-        exit;
-    }
-
-    $_GET['cat'] = strtolower($cat);
-
-    new_page('xnet/groupes.tpl', AUTH_PUBLIC);
-
-    $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 (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();
-?>
index 282d7c8..2d4a983 100644 (file)
@@ -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);
+    }
 }
 
 ?>
index b7f27d0..a158168 100644 (file)
 <table id="content" cellspacing="0" cellpadding="4">
   <tr>
     <td colspan="2">
-      {include file="xnet/include/descr.tpl" cat=$smarty.get.cat}
+      {include file="xnet/include/descr.tpl"}
     </td>
   </tr>
   <tr>
     {if !$doms || !$gps}
     <td style="vertical-align: top">
-      <div class="cat {if $smarty.get.cat eq groupesx}sel{/if}"><a href="?cat=groupesx">Groupes X</a></div>
-      <div class="cat {if $smarty.get.cat eq binets}sel{/if}"><a href="?cat=binets">Binets</a></div>
-      <div class="cat {if $smarty.get.cat eq institutions}sel{/if}"><a href="?cat=institutions">Institutions</a></div>
-      <div class="cat {if $smarty.get.cat eq promotions}sel{/if}"><a href="?cat=promotions">Promotions</a></div>
+      <div class="cat {if $cat eq groupesx}sel{/if}"><a href="{rel}/groups/groupesx">Groupes X</a></div>
+      <div class="cat {if $cat eq binets}sel{/if}"><a href="{rel}/groups/binets">Binets</a></div>
+      <div class="cat {if $cat eq institutions}sel{/if}"><a href="{rel}/groups/institutions">Institutions</a></div>
+      <div class="cat {if $cat eq promotions}sel{/if}"><a href="{rel}/groups/promotions">Promotions</a></div>
     </td>
     {/if}
     
     {if $doms}
     <td style="vertical-align: top">
       {foreach from=$doms item=g}
-      <div class="cat {if $g.id eq $smarty.get.dom}sel{/if}">
-        <a href="?cat={$smarty.get.cat}&amp;dom={$g.id}">{$g.nom}</a>
+      <div class="cat {if $g.id eq $dom}sel{/if}">
+        <a href="{rel}/groups/{$cat}/{$g.id}">{$g.nom}</a>
       </div>
       {/foreach}
     </td>
index 99ad61a..c5e815c 100644 (file)
@@ -63,10 +63,10 @@ associations, en cliquant sur <i>plan du site</i>.
 Chacune des 4 catégories dispose d'une page descriptive. L'adresse de cette page varie
 suivant la catégorie représentée :
 <ul>
-<li><a href="http://www.polytechnique.net/groupes.php?cat=GroupesX">pour les Groupes X</a></li>
-<li><a href="http://www.polytechnique.net/groupes.php?cat=Binets">pour les Binets</a></li>
-<li><a href="http://www.polytechnique.net/autres.php?cat=Institutions">pour les Institutions</a></li>
-<li><a href="http://www.polytechnique.net/autres.php?cat=Promotions">Pour les promotions</a></li>
+<li><a href="http://www.polytechnique.net/groups/GroupesX">pour les Groupes X</a></li>
+<li><a href="http://www.polytechnique.net/groups/Binets">pour les Binets</a></li>
+<li><a href="http://www.polytechnique.net/groups/Institutions">pour les Institutions</a></li>
+<li><a href="http://www.polytechnique.net/groups/Promotions">Pour les promotions</a></li>
 </ul>
 
 
index b386971..d12b294 100644 (file)
     <td class="fourth">
       <table>
         <tr>
-          <td class="oval"><a href="groupes.php?cat=groupesx">Groupes X</a></td>
+          <td class="oval"><a href="{rel}/groups/groupesx">Groupes X</a></td>
         </tr>
         <tr>
           <td class="liste">
             {foreach from=$groupesx key=id item=dom}
-            <a class="cat" href="groupes.php?cat=groupesx&amp;dom={$id}">{$dom[0].domnom}</a>
+            <a class="cat" href="{rel}/groups/groupesx/{$id}">{$dom[0].domnom}</a>
             {foreach from=$dom item=g}
             <a href="{$g.diminutif}/asso.php">{$g.nom}</a>
             {/foreach}
@@ -43,7 +43,7 @@
     <td class="fourth">
       <table>
         <tr>
-          <td class="oval"><a href="groupes.php?cat=binets">Binets</a></td>
+          <td class="oval"><a href="{rel}/groups/binets">Binets</a></td>
         </tr>
         <tr>
           <td class="liste">
@@ -61,7 +61,7 @@
     <td class="fourth">
       <table>
         <tr>
-          <td class="oval"><a href="groupes.php?cat=promotions">Promotions</a></td>
+          <td class="oval"><a href="{rel}/groups/promotions">Promotions</a></td>
         </tr>
         <tr>
           <td class="listec">
@@ -76,7 +76,7 @@
     <td class="fourth">
       <table>
         <tr>
-          <td class="oval"><a href="groupes.php?cat=institutions">Institutions</a></td>
+          <td class="oval"><a href="{rel}/groups/institutions">Institutions</a></td>
         </tr>
         <tr>
           <td class="listec">
index c3a24d1..7e569f3 100644 (file)
         <td colspan="3">
           <div class="breadcrumb">
             {if $asso}
-            <a href="{rel}/groupes.php?cat={$asso.cat}">{$asso.cat|cat_pp}</a> »
+            <a href="{rel}/groups/{$asso.cat}">{$asso.cat|cat_pp}</a> »
             {if $asso.dom}
-            <a href="{rel}/groupes.php?cat={$asso.cat}&amp;dom={$asso.dom}">{$asso.domnom}</a> »
+            <a href="{rel}/groups/{$asso.cat}/{$asso.dom}">{$asso.domnom}</a> »
             {/if}
             {$asso.nom}
-            {elseif $smarty.request.cat}
-            <a href="{rel}/groupes.php?cat={$smarty.request.cat}">{$smarty.request.cat|cat_pp}</a> »
-            {if $smarty.request.dom || !$doms}
+            {elseif $cat}
+            <a href="{rel}/groups/{$cat}">{$cat|cat_pp}</a> »
+            {if $dom || !$doms}
             Choix de l'Asso
             {else}
             Choix du domaine
           <table class="links" summary="liens" cellspacing="0" cellpadding="0">
             <tr>
               <td> <a href="{rel}/plan">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>
+              <td> <a href="{rel}/groups/groupesx">groupes X</a> </td>
+              <td> <a href="{rel}/groups/binets">binets</a> </td>
+              <td> <a href="{rel}/groups/promotions">promotions</a> </td>
+              <td> <a href="{rel}/groups/institutions">institutions</a> </td>
             </tr>
           </table>
         </td>