Add a mechanism for forcing the skin from within a view.
[platal.git] / modules / xnetevents.php
index d2d8390..3d2118f 100644 (file)
@@ -26,8 +26,8 @@ class XnetEventsModule extends PLModule
     function handlers()
     {
         return array(
-            '%grp/events'       => $this->make_hook('events', AUTH_MDP),
-            '%grp/events/sub'   => $this->make_hook('sub',    AUTH_MDP),
+            '%grp/events'       => $this->make_hook('events', AUTH_MDP, 'user'),
+            '%grp/events/sub'   => $this->make_hook('sub',    AUTH_MDP, 'user'),
             '%grp/events/csv'   => $this->make_hook('csv',    AUTH_MDP, 'user', NO_HTTPS),
             '%grp/events/ical'  => $this->make_hook('ical',   AUTH_MDP, 'user', NO_HTTPS),
             '%grp/events/edit'  => $this->make_hook('edit',   AUTH_MDP, 'groupadmin'),
@@ -630,8 +630,7 @@ class XnetEventsModule extends PLModule
                                            GROUP BY  p.uid', $evt['eid']);
 
         $ofs = Env::i('offset');
-        $tot = (is_null($evt['nb_tot']) ? $evt['nb'] : $evt['nb_tot']);
-        $nbp = ceil($tot / NB_PER_PAGE);
+        $nbp = ceil($evt['user_count'] / NB_PER_PAGE);
         if ($nbp > 1) {
             $links = array();
             if ($ofs) {