function entity_translation_handler_filter_translation_exists::options_form in Entity Translation 7
Add option for setting entity type either directly or through a filter.
Overrides views_handler_filter::options_form
See also
views_handler_field::options_form()
File
- views/
entity_translation_handler_filter_translation_exists.inc, line 38 - Contains an entity type filter handler.
Class
- entity_translation_handler_filter_translation_exists
- This handler determines if a translation exists for a particular translation.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$filters = $this
->get_entity_type_filters();
if (!empty($filters)) {
$form['use_filter'] = array(
'#type' => 'checkbox',
'#title' => t('Use an entity type filter.'),
'#default_value' => $this->options['use_filter'],
);
$form['filter'] = array(
'#type' => 'select',
'#title' => t('Filter'),
'#options' => $filters,
'#dependency' => array(
'edit-options-use-filter' => array(
1,
),
),
'#default_value' => $this->options['filter'],
);
}
$form['entity_type'] = array(
'#title' => t('Entity type'),
'#type' => 'select',
'#options' => $this
->get_allowed_types(),
'#dependency' => array(
'edit-options-use-filter' => array(
0,
),
),
'#default_value' => $this->options['entity_type'],
'#description' => t('You have to filter on a particular entity type when you use this filter'),
);
}