Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F114244006
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
Sat, May 24, 13:51
Size
2 KB
Mime Type
text/x-php
Expires
Mon, May 26, 13:51 (2 d)
Engine
blob
Format
Raw Data
Handle
26377069
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
(
phutil_escape_html
(
$list
->
getName
()),
phutil_escape_html
(
$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