class DatexBef in Datex 8
Adds date localization support to Bef.
Hierarchy
- class \Drupal\datex_bef\Plugin\views\exposed_form\DatexBef extends \Drupal\better_exposed_filters\Plugin\views\exposed_form\BetterExposedFilters
Expanded class hierarchy of DatexBef
1 file declares its use of DatexBef
- datex_bef.module in datex_bef/
datex_bef.module
File
- datex_bef/
src/ Plugin/ views/ exposed_form/ DatexBef.php, line 11
Namespace
Drupal\datex_bef\Plugin\views\exposed_formView source
class DatexBef extends BetterExposedFilters {
public function buildOptionsForm(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
}
public function validateOptionsForm(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {
parent::validateOptionsForm($form, $form_state);
}
public function exposedFormAlter(&$form, FormStateInterface $form_state) {
parent::exposedFormAlter($form, $form_state);
if (datex_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'][] = 'datex_bef/picker';
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DatexBef:: |
public | function | ||
DatexBef:: |
public | function | ||
DatexBef:: |
public | function |