function HistoryUserTimestamp::value_form in Views (for Drupal 7) 8.3
Options form subform for setting options.
This should be overridden by all child classes and it must define $form['value']
Overrides FilterPluginBase::value_form
See also
buildOptionsForm()
File
- lib/
Views/ node/ Plugin/ views/ filter/ HistoryUserTimestamp.php, line 39 - Definition of Views\node\Plugin\views\filter\HistoryUserTimestamp.
Class
- HistoryUserTimestamp
- Filter for new content.
Namespace
Views\node\Plugin\views\filterCode
function value_form(&$form, &$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 (!empty($form_state['exposed'])) {
if (isset($this->options['expose']['label'])) {
$label = $this->options['expose']['label'];
}
else {
$label = t('Has new content');
}
$form['value'] = array(
'#type' => 'checkbox',
'#title' => $label,
'#default_value' => $this->value,
);
}
}