Move 'isvalid_email' into platal.inc.php
[platal.git] / modules / xnetgrp.php
index 9049d47..88547d8 100644 (file)
@@ -83,6 +83,7 @@ class XnetGrpModule extends PLModule
             '%grp/annuaire'       => $this->make_hook('annuaire',  AUTH_MDP, 'groupannu'),
             '%grp/annuaire/vcard' => $this->make_hook('vcard',     AUTH_MDP, 'groupmember:groupannu'),
             '%grp/trombi'         => $this->make_hook('trombi',    AUTH_MDP, 'groupannu'),
+            '%grp/geoloc'         => $this->make_hook('geoloc',    AUTH_MDP, 'groupannu'),
             '%grp/subscribe'      => $this->make_hook('subscribe', AUTH_MDP),
             '%grp/unsubscribe'    => $this->make_hook('unsubscribe', AUTH_MDP, 'groupmember'),
 
@@ -323,9 +324,19 @@ class XnetGrpModule extends PLModule
         run_banana($page, 'ForumsBanana', $get);
     }
 
-    function handler_annuaire(&$page)
+    function handler_annuaire(&$page, $action = null, $subaction = null)
     {
         global $globals;
+
+        if ($action == 'geoloc' || $action == 'trombi') {
+            $view = new UserSet();
+            $view->addMod('trombi', 'Trombinoscope');
+            $view->addMod('geoloc', 'Planisphère');
+            $view->apply('annuaire', $page, $action, $subaction);
+            if ($action == 'geoloc' && $subaction) {
+                return;
+            }
+        }
         $page->changeTpl('xnetgrp/annuaire.tpl');
 
         $sort = Env::v('order');
@@ -426,11 +437,14 @@ class XnetGrpModule extends PLModule
         $page->jsonAssign('ann', $ann);
     }
 
-    function handler_trombi(&$page, $action = null, $subaction = null)
+    function handler_trombi(&$page)
+    {
+        pl_redirect('annuaire/trombi');
+    }
+
+    function handler_geoloc(&$page)
     {
-        $view = new UserSet();
-        $view->addMod('trombi', 'Trombinoscope', true, array('with_admin' => false, 'with_promo' => true));
-        $view->apply('trombi', $page,  'trombi', $action, $subaction);
+        pl_redirect('annuaire/geoloc');
     }
     
     function handler_vcard(&$page, $photos = null)
@@ -1053,22 +1067,6 @@ class XnetGrpModule extends PLModule
             }
         }
 
-        $select = '';
-        for ($i = 1 ; $i < 30 ; $i++) {
-            $time    = time() + 3600 * 24 * $i;
-            $p_stamp = date('Ymd', $time);
-            $year    = date('Y',   $time);
-            $month   = date('m',   $time);
-            $day     = date('d',   $time);
-
-            $select .= "<option value=\"$p_stamp\"";
-            if ($p_stamp == strtr(@$art['peremption'], array("-" => ""))) {
-                $select .= " selected='selected'";
-            }
-            $select .= "> $day / $month / $year</option>\n";
-        }
-        $page->assign('select', $select);
-
         if (is_null($aid)) {
             $events = XDB::iterator("SELECT *
                                       FROM groupex.evenements