Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F479920
NuanceSourceCreateController.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
NuanceSourceCreateController.php
View Options
<?php
final
class
NuanceSourceCreateController
extends
NuanceController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$can_edit
=
$this
->
requireApplicationCapability
(
NuanceSourceManageCapability
::
CAPABILITY
);
$viewer
=
$this
->
getViewer
();
$map
=
NuanceSourceDefinition
::
getAllDefinitions
();
$cancel_uri
=
$this
->
getApplicationURI
(
'source/'
);
if
(
$request
->
isFormPost
())
{
$type
=
$request
->
getStr
(
'type'
);
if
(
isset
(
$map
[
$type
]))
{
$uri
=
$this
->
getApplicationURI
(
'source/new/'
.
$type
.
'/'
);
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$uri
);
}
}
$source_types
=
id
(
new
AphrontFormRadioButtonControl
())
->
setName
(
'type'
)
->
setLabel
(
pht
(
'Source Type'
));
foreach
(
$map
as
$type
=>
$definition
)
{
$source_types
->
addButton
(
$type
,
$definition
->
getName
(),
$definition
->
getSourceDescription
());
}
$form
=
id
(
new
AphrontFormView
())
->
setUser
(
$viewer
)
->
appendChild
(
$source_types
)
->
appendChild
(
id
(
new
AphrontFormSubmitControl
())
->
setValue
(
pht
(
'Continue'
))
->
addCancelButton
(
$cancel_uri
));
$box
=
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Choose Source Type'
))
->
appendChild
(
$form
);
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Sources'
),
$cancel_uri
);
$crumbs
->
addTextCrumb
(
pht
(
'New'
));
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$box
,
),
array
(
'title'
=>
pht
(
'Choose Source Type'
),
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 9:29 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
87398
Default Alt Text
NuanceSourceCreateController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment