Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/field/PhabricatorCustomField.php
Show First 20 Lines • Show All 1,642 Lines • ▼ Show 20 Lines | private static function adjustCustomFieldsForObjectSubtype( | ||||
// We only apply subtype adjustment for some roles. For example, when | // We only apply subtype adjustment for some roles. For example, when | ||||
// writing Herald rules or building a Search interface, we always want to | // writing Herald rules or building a Search interface, we always want to | ||||
// show all the fields in their default state, so we do not apply any | // show all the fields in their default state, so we do not apply any | ||||
// adjustments. | // adjustments. | ||||
$subtype_roles = array( | $subtype_roles = array( | ||||
self::ROLE_EDITENGINE, | self::ROLE_EDITENGINE, | ||||
self::ROLE_VIEW, | self::ROLE_VIEW, | ||||
self::ROLE_EDIT, | |||||
); | ); | ||||
$subtype_roles = array_fuse($subtype_roles); | $subtype_roles = array_fuse($subtype_roles); | ||||
if (!isset($subtype_roles[$role])) { | if (!isset($subtype_roles[$role])) { | ||||
return $fields; | return $fields; | ||||
} | } | ||||
// If the object doesn't support subtypes, we can't possibly make | // If the object doesn't support subtypes, we can't possibly make | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |