made EqualOpps fields configurable
This commit is contained in:
parent
aa6d580d62
commit
2f06caa261
@ -112,7 +112,9 @@ class OCEqualOpps extends ContentEntityBase implements OCEqualOppsInterface {
|
||||
->setSettings([
|
||||
'max_length' => 50,
|
||||
'text_processing' => 0,
|
||||
]);
|
||||
])
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true);
|
||||
|
||||
$fields['oc_actor'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
|
||||
->setLabel(t('Person'))
|
||||
@ -120,14 +122,8 @@ class OCEqualOpps extends ContentEntityBase implements OCEqualOppsInterface {
|
||||
->setSetting('target_type', 'oc_actor')
|
||||
->setSetting('handler', 'default')
|
||||
->setCardinality(1)
|
||||
->setDisplayOptions('view', [
|
||||
'type' => 'string',
|
||||
'weight' => -100,
|
||||
])
|
||||
->setDisplayOptions('form', [
|
||||
'type' => 'entity_reference_autocomplete_tags',
|
||||
'weight' => -100,
|
||||
])
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true)
|
||||
->setRequired(TRUE);
|
||||
|
||||
$fields['age'] = BaseFieldDefinition::create('list_string')
|
||||
@ -144,27 +140,13 @@ class OCEqualOpps extends ContentEntityBase implements OCEqualOppsInterface {
|
||||
],
|
||||
])
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayOptions('view', array(
|
||||
'label' => 'above',
|
||||
'type' => 'string',
|
||||
'weight' => -5,
|
||||
))
|
||||
->setDisplayOptions('form', array(
|
||||
'type' => 'options_select',
|
||||
'weight' => -5,
|
||||
));
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true);
|
||||
$fields['access_needs'] = BaseFieldDefinition::create('string_long')
|
||||
->setLabel(t('Access Needs'))
|
||||
->setRevisionable(TRUE)
|
||||
->setDisplayOptions('view', array(
|
||||
'label' => 'above',
|
||||
'type' => 'string',
|
||||
'weight' => -4,
|
||||
))
|
||||
->setDisplayOptions('form', array(
|
||||
'type' => 'string_long',
|
||||
'weight' => -4,
|
||||
));
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true);
|
||||
$fields['gender'] = BaseFieldDefinition::create('list_string')
|
||||
->setRevisionable(TRUE)
|
||||
->setLabel(t('Gender'))
|
||||
@ -180,15 +162,7 @@ class OCEqualOpps extends ContentEntityBase implements OCEqualOppsInterface {
|
||||
],
|
||||
])
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayOptions('view', array(
|
||||
'label' => 'above',
|
||||
'type' => 'string',
|
||||
'weight' => -5,
|
||||
))
|
||||
->setDisplayOptions('form', array(
|
||||
'type' => 'options_select',
|
||||
'weight' => -5,
|
||||
));
|
||||
->setDisplayConfigurable('view', true);
|
||||
$fields['race_ethnicity'] = BaseFieldDefinition::create('list_string')
|
||||
->setRevisionable(TRUE)
|
||||
->setLabel(t('Race/Ethnicity'))
|
||||
@ -215,15 +189,7 @@ class OCEqualOpps extends ContentEntityBase implements OCEqualOppsInterface {
|
||||
],
|
||||
])
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayOptions('view', array(
|
||||
'label' => 'above',
|
||||
'type' => 'string',
|
||||
'weight' => -5,
|
||||
))
|
||||
->setDisplayOptions('form', array(
|
||||
'type' => 'options_select',
|
||||
'weight' => -5,
|
||||
));
|
||||
->setDisplayConfigurable('view', true);
|
||||
$fields['sexuality'] = BaseFieldDefinition::create('string')
|
||||
->setLabel(t('Sexuality'))
|
||||
->setRevisionable(TRUE)
|
||||
@ -231,18 +197,9 @@ class OCEqualOpps extends ContentEntityBase implements OCEqualOppsInterface {
|
||||
'max_length' => 20,
|
||||
'text_processing' => 0,
|
||||
])
|
||||
->setDisplayConfigurable("form", true)
|
||||
->setDisplayConfigurable("view", true)
|
||||
->setDefaultValue('')
|
||||
->setDisplayOptions('view', array(
|
||||
'label' => 'above',
|
||||
'type' => 'string',
|
||||
'weight' => -1,
|
||||
))
|
||||
->setDisplayOptions('form', [
|
||||
'type' => 'string_textfield',
|
||||
'weight' => -1,
|
||||
]);
|
||||
->setDisplayConfigurable('form', true)
|
||||
->setDisplayConfigurable('view', true);
|
||||
|
||||
$fields['status']->setDescription(t('A boolean indicating whether the Equal Opps is published.'));
|
||||
|
||||
|
Reference in New Issue
Block a user