@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Paginate the user list view.

+27 -15
+20 -14
src/applications/people/controller/list/PhabricatorPeopleListController.php
··· 19 19 class PhabricatorPeopleListController extends PhabricatorPeopleController { 20 20 21 21 public function processRequest() { 22 + $request = $this->getRequest(); 23 + 24 + $user = new PhabricatorUser(); 25 + 26 + $count = queryfx_one( 27 + $user->establishConnection('r'), 28 + 'SELECT COUNT(*) N FROM %T', 29 + $user->getTableName()); 30 + $count = idx($count, 'N', 0); 31 + 32 + $pager = new AphrontPagerView(); 33 + $pager->setOffset($request->getInt('page', 0)); 34 + $pager->setCount($count); 35 + $pager->setURI($request->getRequestURI(), 'page'); 36 + 22 37 $users = id(new PhabricatorUser())->loadAllWhere( 23 - '1 = 1 ORDER BY id DESC LIMIT 100'); 38 + '1 = 1 ORDER BY id DESC LIMIT %d, %d', 39 + $pager->getOffset(), 40 + $pager->getPageSize()); 24 41 25 42 $rows = array(); 26 43 foreach ($users as $user) { ··· 35 52 'href' => '/p/'.$user->getUsername().'/', 36 53 ), 37 54 'View Profile'), 38 - /* 39 - phutil_render_tag( 40 - 'a', 41 - array( 42 - 'class' => 'button grey small', 43 - 'href' => '/people/edit/'.$user->getUsername().'/', 44 - ), 45 - 'Edit'), 46 - */ 47 55 ); 48 56 } 49 57 ··· 54 62 'Username', 55 63 'Real Name', 56 64 '', 57 - // '', 58 65 )); 59 66 $table->setColumnClasses( 60 67 array( ··· 62 69 null, 63 70 'wide', 64 71 'action', 65 - // 'action', 66 72 )); 67 73 68 74 $panel = new AphrontPanelView(); 69 - $panel->appendChild($table); 70 75 $panel->setHeader('People'); 71 - // $panel->setCreateButton('Create New User', '/people/edit/'); 76 + $panel->appendChild($table); 77 + $panel->appendChild($pager); 72 78 73 79 return $this->buildStandardPageResponse($panel, array( 74 80 'title' => 'People',
+2
src/applications/people/controller/list/__init__.php
··· 8 8 9 9 phutil_require_module('phabricator', 'applications/people/controller/base'); 10 10 phutil_require_module('phabricator', 'applications/people/storage/user'); 11 + phutil_require_module('phabricator', 'storage/queryfx'); 12 + phutil_require_module('phabricator', 'view/control/pager'); 11 13 phutil_require_module('phabricator', 'view/control/table'); 12 14 phutil_require_module('phabricator', 'view/layout/panel'); 13 15
+5 -1
src/view/control/pager/AphrontPagerView.php
··· 19 19 final class AphrontPagerView extends AphrontView { 20 20 21 21 private $offset; 22 - private $pageSize; 22 + private $pageSize = 100; 23 23 24 24 private $count; 25 25 private $hasMorePages; ··· 81 81 } 82 82 83 83 public function render() { 84 + if (!$this->uri) { 85 + throw new Exception( 86 + "You must call setURI() before you can call render()."); 87 + } 84 88 85 89 require_celerity_resource('aphront-pager-view-css'); 86 90