public function CalendarSystemsBef::exposedFormAlter in Calendar Systems 8.3
File
- calendar_systems_bef/
src/ Plugin/ views/ exposed_form/ CalendarSystemsBef.php, line 21
Class
- CalendarSystemsBef
- Adds date localization support to Bef.
Namespace
Drupal\calendar_systems_bef\Plugin\views\exposed_formCode
public function exposedFormAlter(&$form, FormStateInterface $form_state) {
parent::exposedFormAlter($form, $form_state);
if (_calendar_systems_factory()
->getCalendarName() !== 'persian') {
return;
}
if (isset($form['#attached']['library'])) {
$l = [];
$found = FALSE;
foreach ($form['#attached']['library'] as $lib) {
if ($lib === 'core/jquery.ui.datepicker' || $lib === 'better_exposed_filters/datepickers') {
$found = TRUE;
}
else {
$l[] = $lib;
}
}
$form['#attached']['library'] = $l;
if ($found) {
$form['#attached']['library'][] = 'calendar_systems_bef/picker';
}
}
}