Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104783734
PhabricatorMailingListsListController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Mar 12, 08:56
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Mar 14, 08:56 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24852553
Attached To
rPH Phabricator
PhabricatorMailingListsListController.php
View Options
<?php
final
class
PhabricatorMailingListsListController
extends
PhabricatorMailingListsController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$offset
=
$request
->
getInt
(
'offset'
,
0
);
$pager
=
new
AphrontPagerView
();
$pager
->
setPageSize
(
250
);
$pager
->
setOffset
(
$offset
);
$pager
->
setURI
(
$request
->
getRequestURI
(),
'offset'
);
$list
=
new
PhabricatorMetaMTAMailingList
();
$conn_r
=
$list
->
establishConnection
(
'r'
);
$data
=
queryfx_all
(
$conn_r
,
'SELECT * FROM %T
ORDER BY name ASC
LIMIT %d, %d'
,
$list
->
getTableName
(),
$pager
->
getOffset
(),
$pager
->
getPageSize
()
+
1
);
$data
=
$pager
->
sliceResults
(
$data
);
$nav
=
$this
->
buildSideNavView
(
'all'
);
$lists
=
$list
->
loadAllFromArray
(
$data
);
$rows
=
array
();
foreach
(
$lists
as
$list
)
{
$rows
[]
=
array
(
$list
->
getName
(),
$list
->
getEmail
(),
phutil_tag
(
'a'
,
array
(
'class'
=>
'button grey small'
,
'href'
=>
$this
->
getApplicationURI
(
'/edit/'
.
$list
->
getID
().
'/'
),
),
pht
(
'Edit'
)),
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
pht
(
'Name'
),
pht
(
'Email'
),
''
,
));
$table
->
setColumnClasses
(
array
(
null
,
'wide'
,
'action'
,
));
$crumbs
=
$this
->
buildApplicationCrumbs
(
$this
->
buildSideNavView
());
$crumbs
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
pht
(
'All Lists'
))
->
setHref
(
$this
->
getApplicationURI
())
);
$nav
->
setCrumbs
(
$crumbs
);
$panel
=
new
AphrontPanelView
();
$panel
->
appendChild
(
$table
);
$panel
->
setHeader
(
pht
(
'Mailing Lists'
));
$panel
->
appendChild
(
$pager
);
$panel
->
setNoBackground
();
$nav
->
appendChild
(
$panel
);
return
$this
->
buildApplicationPage
(
array
(
$nav
,
),
array
(
'title'
=>
pht
(
'Mailing Lists'
),
'device'
=>
true
,
));
}
}
Event Timeline
Log In to Comment