Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F465769
PhabricatorDashboardPanelCreateController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorDashboardPanelCreateController.php
View Options
<?php
final
class
PhabricatorDashboardPanelCreateController
extends
PhabricatorDashboardController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$types
=
PhabricatorDashboardPanelType
::
getAllPanelTypes
();
$v_type
=
null
;
$errors
=
array
();
if
(
$request
->
isFormPost
())
{
$v_type
=
$request
->
getStr
(
'type'
);
if
(!
isset
(
$types
[
$v_type
]))
{
$errors
[]
=
pht
(
'You must select a type of panel to create.'
);
}
if
(!
$errors
)
{
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$this
->
getApplicationURI
(
'panel/edit/?type='
.
$v_type
));
}
}
$cancel_uri
=
$this
->
getApplicationURI
(
'panel/'
);
if
(!
$v_type
)
{
$v_type
=
key
(
$types
);
}
$panel_types
=
id
(
new
AphrontFormRadioButtonControl
())
->
setName
(
'type'
)
->
setValue
(
$v_type
);
foreach
(
$types
as
$key
=>
$type
)
{
$panel_types
->
addButton
(
$key
,
$type
->
getPanelTypeName
(),
$type
->
getPanelTypeDescription
());
}
$form
=
id
(
new
AphrontFormView
())
->
setUser
(
$viewer
)
->
appendChild
(
$panel_types
)
->
appendChild
(
id
(
new
AphrontFormSubmitControl
())
->
setValue
(
pht
(
'Continue'
))
->
addCancelButton
(
$cancel_uri
));
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Panels'
),
$this
->
getApplicationURI
(
'panel/'
));
$crumbs
->
addTextCrumb
(
pht
(
'New Panel'
));
$title
=
pht
(
'Create Dashboard Panel'
);
$box
=
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
$title
)
->
setFormErrors
(
$errors
)
->
setForm
(
$form
);
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$box
,
),
array
(
'title'
=>
$title
,
'device'
=>
true
,
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 11:30 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71078
Default Alt Text
PhabricatorDashboardPanelCreateController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment