public function EntitySharePathautoEnhancer::getSettingsForm in Entity Share 8.3
Same name and namespace in other branches
- 8.2 src/Plugin/jsonapi/FieldEnhancer/EntitySharePathautoEnhancer.php \Drupal\entity_share\Plugin\jsonapi\FieldEnhancer\EntitySharePathautoEnhancer::getSettingsForm()
File
- src/
Plugin/ jsonapi/ FieldEnhancer/ EntitySharePathautoEnhancer.php, line 138
Class
- EntitySharePathautoEnhancer
- Prepare path value to be able to handle pathauto metadata.
Namespace
Drupal\entity_share\Plugin\jsonapi\FieldEnhancerCode
public function getSettingsForm(array $resource_field_info) {
$settings = empty($resource_field_info['enhancer']['settings']) ? $this
->getConfiguration() : $resource_field_info['enhancer']['settings'];
return [
'behavior' => [
'#type' => 'select',
'#title' => $this
->t('Expose pathauto value'),
'#description' => $this
->t('If pathauto state is 0, the client website will use the path on the server website (generated with Pathauto or not). If pathauto state is 1, the client website will generate a new alias according to its own configuration if Pathauto patterns are used on the client website.'),
'#required' => TRUE,
'#options' => [
self::EXPOSE_CURRENT_PATHAUTO => $this
->t('Expose current pathauto state'),
self::FORCE_ENABLE_PATHAUTO => $this
->t('Force to expose a pathauto state enabled'),
self::FORCE_DISABLE_PATHAUTO => $this
->t('Force to expose a pathauto state disabled'),
],
'#default_value' => $settings['behavior'],
],
];
}