Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93121778
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
Tue, Nov 26, 09:02
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 09:02 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22579321
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