Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92658320
HeraldController.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
Fri, Nov 22, 11:48
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 11:48 (2 d)
Engine
blob
Format
Raw Data
Handle
22479940
Attached To
rPH Phabricator
HeraldController.php
View Options
<?php
abstract
class
HeraldController
extends
PhabricatorController
{
public
function
buildStandardPageResponse
(
$view
,
array
$data
)
{
$page
=
$this
->
buildStandardPageView
();
$page
->
setApplicationName
(
pht
(
'Herald'
));
$page
->
setBaseURI
(
'/herald/'
);
$page
->
setTitle
(
idx
(
$data
,
'title'
));
$page
->
setGlyph
(
"
\x
E2
\x
98
\x
BF"
);
$page
->
appendChild
(
$view
);
$response
=
new
AphrontWebpageResponse
();
return
$response
->
setContent
(
$page
->
render
());
}
public
function
buildApplicationMenu
()
{
return
$this
->
buildSideNavView
(
true
)->
getMenu
();
}
public
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'Create Herald Rule'
))
->
setHref
(
$this
->
getApplicationURI
(
'new/'
))
->
setIcon
(
'fa-plus-square'
));
return
$crumbs
;
}
public
function
buildSideNavView
(
$for_app
=
false
)
{
$user
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
if
(
$for_app
)
{
$nav
->
addFilter
(
'new'
,
pht
(
'Create Rule'
));
}
id
(
new
HeraldRuleSearchEngine
())
->
setViewer
(
$user
)
->
addNavigationItems
(
$nav
->
getMenu
());
$nav
->
addLabel
(
pht
(
'Utilities'
))
->
addFilter
(
'test'
,
pht
(
'Test Console'
))
->
addFilter
(
'transcript'
,
pht
(
'Transcripts'
))
->
addFilter
(
'history'
,
pht
(
'Edit Log'
));
$nav
->
selectFilter
(
null
);
return
$nav
;
}
}
Event Timeline
Log In to Comment