]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
groups/all didn't work, also fixed pagination in directory/users, and a convenient...
authorHannes Mannerheim <h@nnesmannerhe.im>
Mon, 20 Oct 2014 14:24:53 +0000 (16:24 +0200)
committerHannes Mannerheim <h@nnesmannerhe.im>
Mon, 20 Oct 2014 14:24:53 +0000 (16:24 +0200)
plugins/Directory/DirectoryPlugin.php
plugins/Directory/actions/userdirectory.php
plugins/Directory/lib/sortablesubscriptionlist.php

index e061b89e467ea61215af4b70a4eeca880db0de76..caf137c29ec6ad0d171248d5a457d5caa9b1f45e 100644 (file)
@@ -79,11 +79,40 @@ class DirectoryPlugin extends Plugin
     function onRouterInitialized($m)
     {
 
+        $m->connect(
+            'directory/users/:filter/sort_by/:sort/reverse/:reverse',
+            array('action' => 'userdirectory'),
+            array('filter' => '[0-9a-zA-Z]|(0-9)'),            
+            array('sort' => '[a-z]+'),
+            array('reverse' => '[0-9]')                        
+        );
+
+        $m->connect(
+            'directory/users/:filter/sort_by/:sort',
+            array('action' => 'userdirectory'),
+            array('filter' => '[0-9a-zA-Z]|(0-9)'),            
+            array('sort' => '[a-z]+')            
+        );  
+
+
         $m->connect(
             'directory/users/:filter',
             array('action' => 'userdirectory'),
             array('filter' => '[0-9a-zA-Z]|(0-9)')
         );
+        
+        $m->connect(
+            'directory/users/sort_by/:sort/reverse/:reverse',
+            array('action' => 'userdirectory'),
+            array('sort' => '[a-z]+'),
+            array('reverse' => '[0-9]')                        
+        );
+
+        $m->connect(
+            'directory/users/sort_by/:sort',
+            array('action' => 'userdirectory'),
+            array('sort' => '[a-z]+')            
+        );        
 
         $m->connect(
             'directory/users',
@@ -101,6 +130,12 @@ class DirectoryPlugin extends Plugin
             array('action' => 'groupdirectory')
         );
 
+        $m->connect(
+            'groups/all',
+            array('action' => 'groupdirectory')
+        );
+
+
         return true;
     }
 
index 2a4bc7c76b640adce3a58e048d591075fb04b613..77ffb5206b22ee24d33930cdd1050110e2ec43ed 100644 (file)
@@ -233,6 +233,13 @@ class UserdirectoryAction extends Action
         } elseif (isset($this->filter) && $this->filter != 'all') {
             $args['filter'] = $this->filter;
         }
+        
+        if (isset($this->sort)) {
+            $args['sort'] = $this->sort;
+        }        
+        if (!empty($this->reverse)) {
+            $args['reverse'] = $this->reverse;
+        }
 
         $this->pagination(
             $this->page > 1,
index 4a9d50110b55e2d81a6f01e4d1645378352b0d91..9fc1dd6a10e066d77045c8b8de302f12d3b85046 100644 (file)
@@ -207,6 +207,18 @@ class SortableSubscriptionListItem extends SubscriptionListItem
 
     function endActions()
     {
+               
+               // delete button
+               $cur = common_current_user();
+        list($action, $r2args) = $this->out->returnToArgs();
+        $r2args['action'] = $action;        
+               if ($cur->hasRight(Right::DELETEUSER)) {
+                       $this->out->elementStart('li', 'entity_delete');
+                       $df = new DeleteUserForm($this->out, $this->profile, $r2args);
+                       $df->show();            
+                       $this->out->elementEnd('li');
+               }
+                       
         $this->out->elementEnd('ul');
         $this->out->elementEnd('td');
     }