function fico_field_formatter_third_party_settings_form in Field Formatter Condition 8
Implements hook_field_formatter_third_party_settings_form().
File
- ./
fico.module, line 35 - Contains fico.module.
Code
function fico_field_formatter_third_party_settings_form(FormatterInterface $plugin, FieldDefinitionInterface $field_definition, $view_mode, $form, FormStateInterface $form_state) {
$fieldStorage = $field_definition
->getFieldStorageDefinition();
$settings = $plugin
->getThirdPartySetting('fico', 'fico');
$settings['entity_type'] = $form['#entity_type'];
$settings['bundle'] = $form['#bundle'];
$settings['field_name'] = $fieldStorage
->getName();
$settings['field_type'] = $fieldStorage
->getType();
$element = array();
$element['fico'] = [
'#type' => 'details',
'#title' => t('Conditions'),
'#weight' => 100,
];
$context = array(
'instance' => $field_definition,
'formatter' => $plugin,
'settings' => $settings,
);
fico_condition_settings_form($element, $form_state, $context);
return $element;
}