Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93896551
PhabricatorCustomFieldEditEngineExtension.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
Mon, Dec 2, 08:27
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 4, 08:27 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22720973
Attached To
rPH Phabricator
PhabricatorCustomFieldEditEngineExtension.php
View Options
<?php
final
class
PhabricatorCustomFieldEditEngineExtension
extends
PhabricatorEditEngineExtension
{
const
EXTENSIONKEY
=
'customfield.fields'
;
public
function
getExtensionPriority
()
{
return
5000
;
}
public
function
isExtensionEnabled
()
{
return
true
;
}
public
function
getExtensionName
()
{
return
pht
(
'Custom Fields'
);
}
public
function
supportsObject
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
return
(
$object
instanceof
PhabricatorCustomFieldInterface
);
}
public
function
buildCustomEditFields
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
$viewer
=
$this
->
getViewer
();
$field_list
=
PhabricatorCustomField
::
getObjectFields
(
$object
,
PhabricatorCustomField
::
ROLE_EDIT
);
$field_list
->
setViewer
(
$viewer
);
if
(
$object
->
getID
())
{
$field_list
->
readFieldsFromStorage
(
$object
);
}
$results
=
array
();
foreach
(
$field_list
->
getFields
()
as
$field
)
{
$edit_fields
=
$field
->
getEditEngineFields
(
$engine
);
foreach
(
$edit_fields
as
$edit_field
)
{
$results
[]
=
$edit_field
;
}
}
return
$results
;
}
}
Event Timeline
Log In to Comment