Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F455351
PhabricatorCustomFieldEditEngineExtension.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
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
newBulkEditGroups
(
PhabricatorEditEngine
$engine
)
{
return
array
(
id
(
new
PhabricatorBulkEditGroup
())
->
setKey
(
'custom'
)
->
setLabel
(
pht
(
'Custom Fields'
)),
);
}
public
function
buildCustomEditFields
(
PhabricatorEditEngine
$engine
,
PhabricatorApplicationTransactionInterface
$object
)
{
$viewer
=
$this
->
getViewer
();
$field_list
=
PhabricatorCustomField
::
getObjectFields
(
$object
,
PhabricatorCustomField
::
ROLE_EDITENGINE
);
$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
)
{
$group_key
=
$edit_field
->
getBulkEditGroupKey
();
if
(
$group_key
===
null
)
{
$edit_field
->
setBulkEditGroupKey
(
'custom'
);
}
$results
[]
=
$edit_field
;
}
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 6:55 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69887
Default Alt Text
PhabricatorCustomFieldEditEngineExtension.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment