public function MentionsFilter::settingsForm in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.2 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.3 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.4 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.5 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.6 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.7 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 8.8 modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 10.3.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 10.0.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 10.1.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
- 10.2.x modules/custom/mentions/src/Plugin/Filter/MentionsFilter.php \Drupal\mentions\Plugin\Filter\MentionsFilter::settingsForm()
Generates a filter's settings form.
Parameters
array $form: A minimally prepopulated form array.
\Drupal\Core\Form\FormStateInterface $form_state: The state of the (entire) configuration form.
Return value
array The $form array with additional form elements for the settings of this filter. The submitted form values should match $this->settings.
Overrides FilterBase::settingsForm
File
- modules/
custom/ mentions/ src/ Plugin/ Filter/ MentionsFilter.php, line 253
Class
- MentionsFilter
- Class FilterMentions.
Namespace
Drupal\mentions\Plugin\FilterCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$configs = $this->config
->listAll('mentions.mentions_type');
$candidate_entitytypes = [];
foreach ($configs as $config) {
$mentions_name = str_replace('mentions.mentions_type.', '', $config);
$candidate_entitytypes[$mentions_name] = $mentions_name;
}
if (count($candidate_entitytypes) == 0) {
return NULL;
}
$form['mentions_filter'] = [
'#type' => 'checkboxes',
'#options' => $candidate_entitytypes,
'#default_value' => $this->settings['mentions_filter'],
'#title' => $this
->t('Mentions types'),
];
return $form;
}