Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97390748
PhabricatorSystemSelectHighlightController.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
Sat, Jan 4, 08:26
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 6, 08:26 (2 d)
Engine
blob
Format
Raw Data
Handle
23399596
Attached To
rPH Phabricator
PhabricatorSystemSelectHighlightController.php
View Options
<?php
final
class
PhabricatorSystemSelectHighlightController
extends
PhabricatorController
{
public
function
shouldRequireLogin
()
{
return
false
;
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
if
(
$request
->
isFormPost
())
{
$result
=
array
(
'highlight'
=>
$request
->
getStr
(
'highlight'
));
return
id
(
new
AphrontAjaxResponse
())->
setContent
(
$result
);
}
$languages
=
array
(
''
=>
pht
(
'(Use Default)'
),
)
+
PhabricatorEnv
::
getEnvConfig
(
'pygments.dropdown-choices'
);
$form
=
id
(
new
AphrontFormView
())
->
setUser
(
$this
->
getRequest
()->
getUser
())
->
appendRemarkupInstructions
(
pht
(
'Choose a syntax highlighting to use.'
))
->
appendChild
(
id
(
new
AphrontFormSelectControl
())
->
setLabel
(
pht
(
'Highlighting'
))
->
setName
(
'highlight'
)
->
setValue
(
$request
->
getStr
(
'highlight'
))
->
setOptions
(
$languages
));
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Select Syntax Highlighting'
))
->
appendChild
(
$form
->
buildLayoutView
())
->
addSubmitButton
(
pht
(
'Choose Highlighting'
))
->
addCancelButton
(
'/'
);
}
}
Event Timeline
Log In to Comment