Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102699726
PonderController.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
Sun, Feb 23, 08:02
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Feb 25, 08:02 (2 d)
Engine
blob
Format
Raw Data
Handle
24398370
Attached To
rPH Phabricator
PonderController.php
View Options
<?php
abstract
class
PonderController
extends
PhabricatorController
{
public
function
buildStandardPageResponse
(
$view
,
array
$data
)
{
$page
=
$this
->
buildStandardPageView
();
$page
->
setApplicationName
(
pht
(
'Ponder!'
));
$page
->
setBaseURI
(
'/ponder/'
);
$page
->
setTitle
(
idx
(
$data
,
'title'
));
$page
->
setGlyph
(
"
\x
E2
\x
97
\x
B3"
);
$page
->
appendChild
(
$view
);
$page
->
setSearchDefaultScope
(
PhabricatorSearchScope
::
SCOPE_QUESTIONS
);
$response
=
new
AphrontWebpageResponse
();
return
$response
->
setContent
(
$page
->
render
());
}
protected
function
buildSideNavView
(
PonderQuestion
$question
=
null
)
{
$side_nav
=
new
AphrontSideNavFilterView
();
$side_nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
$side_nav
->
addLabel
(
pht
(
'Questions'
));
$side_nav
->
addFilter
(
'feed'
,
pht
(
'All Questions'
));
$side_nav
->
addFilter
(
'questions'
,
pht
(
'Your Questions'
));
$side_nav
->
addFilter
(
'answers'
,
pht
(
'Your Answers'
));
return
$side_nav
;
}
public
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'New Question'
))
->
setHref
(
'/ponder/question/ask'
)
->
setIcon
(
'create'
));
return
$crumbs
;
}
}
Event Timeline
Log In to Comment