Builds the form structure for selecting the view's filters.
By default, this adds "of type" and "tagged with" filters (when they are available).
protected function buildFilters(&$form, &$form_state) {
module_load_include('inc', 'views_ui', 'admin');
$bundles = entity_get_bundles($this->entity_type);
// If the current base table support bundles and has more than one (like user).
if (isset($this->entity_info['bundle_keys']) && !empty($bundles)) {
// Get all bundles and their human readable names.
$options = array(
'all' => t('All'),
);
foreach ($bundles as $type => $bundle) {
$options[$type] = $bundle['label'];
}
$form['displays']['show']['type'] = array(
'#type' => 'select',
'#title' => t('of type'),
'#options' => $options,
);
$selected_bundle = static::getSelected($form_state, array(
'show',
'type',
), 'all', $form['displays']['show']['type']);
$form['displays']['show']['type']['#default_value'] = $selected_bundle;
// Changing this dropdown updates the entire content of $form['displays']
// via AJAX, since each bundle might have entirely different fields
// attached to it, etc.
views_ui_add_ajax_trigger($form['displays']['show'], 'type', array(
'displays',
));
}
}