function HistoryUserTimestamp::valueForm
Same name in other branches
- 9 core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php \Drupal\history\Plugin\views\filter\HistoryUserTimestamp::valueForm()
- 8.9.x core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php \Drupal\history\Plugin\views\filter\HistoryUserTimestamp::valueForm()
- 11.x core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php \Drupal\history\Plugin\views\filter\HistoryUserTimestamp::valueForm()
Overrides FilterPluginBase::valueForm
File
-
core/
modules/ history/ src/ Plugin/ views/ filter/ HistoryUserTimestamp.php, line 84
Class
- HistoryUserTimestamp
- Filter for new content.
Namespace
Drupal\history\Plugin\views\filterCode
protected function valueForm(&$form, FormStateInterface $form_state) {
// Only present a checkbox for the exposed filter itself. There's no way
// to tell the difference between not checked and the default value, so
// specifying the default value via the views UI is meaningless.
if ($form_state->get('exposed')) {
if (isset($this->options['expose']['label'])) {
$label = $this->options['expose']['label'];
}
else {
$label = $this->t('Has new content');
}
$form['value'] = [
'#type' => 'checkbox',
'#title' => $label,
'#default_value' => $this->value,
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.