Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121318131
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
Thu, Jul 10, 01:08
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jul 12, 01:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27262283
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