backport fix lien pour remonter en haut des events
[platal.git] / modules / xnet.php
index 551f02d..c36cf59 100644 (file)
@@ -25,15 +25,9 @@ class XnetModule extends PLModule
     {
         return array(
             'index'     => $this->make_hook('index',     AUTH_PUBLIC),
+            'login'     => $this->make_hook('login',     AUTH_MDP),
             '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),
-
             'admin'     => $this->make_hook('admin',     AUTH_MDP, 'admin'),
             'groups'    => $this->make_hook('groups',    AUTH_PUBLIC),
             'groupes.php' => $this->make_hook('groups2', AUTH_PUBLIC),
@@ -46,48 +40,16 @@ class XnetModule extends PLModule
         $page->changeTpl('xnet/index.tpl');
     }
 
-    function handler_exit(&$page)
+    function handler_login(&$page)
     {
-        XnetSession::destroy();
-        $page->changeTpl('xnet/deconnexion.tpl');
-        $page->useMenu();
+        pl_redirect('');
     }
 
-    function handler_about(&$page)
-    {
-        $page->changeTpl('xnet/apropos.tpl');
-        $page->useMenu();
-    }
-
-    function handler_article12(&$page)
-    {
-        $page->changeTpl('xnet/article12.tpl');
-        $page->useMenu();
-    }
-
-    function handler_article16(&$page)
-    {
-        $page->changeTpl('xnet/article16.tpl');
-        $page->useMenu();
-    }
-
-    function handler_creategpx(&$page)
-    {
-        $page->changeTpl('xnet/creation-groupex.tpl');
-        $page->useMenu();
-    }
-
-    function handler_services(&$page)
-    {
-        $page->changeTpl('xnet/services.tpl');
-        $page->useMenu();
-    }
-
-    function handler_manuel(&$page, $type = null)
+    function handler_exit(&$page)
     {
-        $page->changeTpl('xnet/manuel.tpl');
+        XnetSession::destroy();
+        $page->changeTpl('xnet/deconnexion.tpl');
         $page->useMenu();
-        $page->assign('type', $type);
     }
 
     function handler_admin(&$page)
@@ -180,6 +142,7 @@ class XnetModule extends PLModule
                   WHERE  FIND_IN_SET("Institutions", cat)
                ORDER BY  diminutif');
         $page->assign('inst', $res);
+        $page->useMenu();
     }
 
     function handler_groups2(&$page)
@@ -200,21 +163,22 @@ class XnetModule extends PLModule
         $page->assign('dom', $dom);
 
         $res  = XDB::query("SELECT id,nom FROM groupex.dom
-                                       WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat);
+                             WHERE FIND_IN_SET({?}, cat)
+                          ORDER BY nom", $cat);
         $doms = $res->fetchAllAssoc();
         $page->assign('doms', $doms);
 
         if (empty($doms)) {
-            $res = XDB::iterator("SELECT diminutif, nom FROM groupex.asso
-                                             WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat);
+            $res = XDB::query("SELECT diminutif, nom FROM groupex.asso
+                                   WHERE FIND_IN_SET({?}, cat)
+                                ORDER BY nom", $cat);
+            $page->assign('gps', $res->fetchAllAssoc());
         } elseif (!is_null($dom)) {
-            $res = XDB::iterator("SELECT diminutif, nom FROM groupex.asso
-                                             WHERE FIND_IN_SET({?}, cat) AND dom={?}
-                                          ORDER BY nom", $cat, $dom);
-        } else {
-            $res = null;
+            $res = XDB::query("SELECT diminutif, nom FROM groupex.asso
+                                WHERE FIND_IN_SET({?}, cat) AND dom={?}
+                             ORDER BY nom", $cat, $dom);
+            $page->assign('gps', $res->fetchAllAssoc());
         }
-        $page->assign('gps', $res);
 
         $page->useMenu();
         $page->setType($cat);