Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4852454
PhabricatorJSONConfigType.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
989 B
Referenced Files
None
Subscribers
None
PhabricatorJSONConfigType.php
View Options
<?php
abstract
class
PhabricatorJSONConfigType
extends
PhabricatorTextConfigType
{
protected
function
newCanonicalValue
(
PhabricatorConfigOption
$option
,
$value
)
{
try
{
$value
=
phutil_json_decode
(
$value
)
;
}
catch
(
Exception
$ex
)
{
throw
$this
->
newException
(
pht
(
'Value for option "%s" (of type "%s") must be specified in JSON, '
.
'but input could not be decoded: %s'
,
$option
->
getKey
(
)
,
$this
->
getTypeKey
(
)
,
$ex
->
getMessage
(
)
)
)
;
}
return
$value
;
}
protected
function
newControl
(
PhabricatorConfigOption
$option
)
{
return
id
(
new
AphrontFormTextAreaControl
(
)
)
->
setHeight
(
AphrontFormTextAreaControl
::
HEIGHT_VERY_TALL
)
->
setCustomClass
(
'PhabricatorMonospaced'
)
->
setCaption
(
pht
(
'Enter value in JSON.'
)
)
;
}
public
function
newDisplayValue
(
PhabricatorConfigOption
$option
,
$value
)
{
return
PhabricatorConfigJSON
::
prettyPrintJSON
(
$value
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 9, 06:34 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1768444
Default Alt Text
PhabricatorJSONConfigType.php (989 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment