Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100490586
PhabricatorFactHomeController.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, Jan 31, 05:25
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 2, 05:25 (2 d)
Engine
blob
Format
Raw Data
Handle
23959153
Attached To
rPH Phabricator
PhabricatorFactHomeController.php
View Options
<?php
final
class
PhabricatorFactHomeController
extends
PhabricatorFactController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
if
(
$request
->
isFormPost
())
{
$uri
=
new
PhutilURI
(
'/fact/chart/'
);
$uri
->
setQueryParam
(
'y1'
,
$request
->
getStr
(
'y1'
));
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$uri
);
}
$chart_form
=
$this
->
buildChartForm
();
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Home'
));
$title
=
pht
(
'Facts'
);
return
$this
->
newPage
()
->
setTitle
(
$title
)
->
setCrumbs
(
$crumbs
)
->
appendChild
(
array
(
$chart_form
,
));
}
private
function
buildChartForm
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$specs
=
PhabricatorFact
::
getAllFacts
();
$options
=
mpull
(
$specs
,
'getName'
,
'getKey'
);
$form
=
id
(
new
AphrontFormView
())
->
setUser
(
$viewer
)
->
appendChild
(
id
(
new
AphrontFormSelectControl
())
->
setLabel
(
pht
(
'Y-Axis'
))
->
setName
(
'y1'
)
->
setOptions
(
$options
))
->
appendChild
(
id
(
new
AphrontFormSubmitControl
())
->
setValue
(
pht
(
'Plot Chart'
)));
$panel
=
new
PHUIObjectBoxView
();
$panel
->
setForm
(
$form
);
$panel
->
setHeaderText
(
pht
(
'Plot Chart'
));
return
$panel
;
}
}
Event Timeline
Log In to Comment