class views_autocomplete_filters_exposed_form_plugin in Views Autocomplete Filters 6.3
@file Provides an Views Autocomplete Filters exposed form plugin for View 3.x.
Hierarchy
- class \views_object
Expanded class hierarchy of views_autocomplete_filters_exposed_form_plugin
File
- ./
views_autocomplete_filters_exposed_form_plugin.inc, line 7 - Provides an Views Autocomplete Filters exposed form plugin for View 3.x.
View source
class views_autocomplete_filters_exposed_form_plugin extends views_plugin_exposed_form_basic {
function summary_title() {
return t('Views Autocomplete Filters');
}
function option_definition() {
$options = parent::option_definition();
$options['views_autocomplete'] = array(
'default' => array(),
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$options = array();
// Go through each filter and add the same options we used to add in hook_form_alter()
foreach ($this->display->handler
->get_handlers('filter') as $label => $filter) {
if (!$filter->options['exposed']) {
continue;
}
if (!$options_header) {
$options['header'] = array(
'#value' => '<strong>' . t("Autocomplete Filters") . '</strong>',
);
}
$options[$label]['autocomplete_enabled'] = array(
'#title' => t("Enable autocomplete for ") . $label,
'#type' => 'checkbox',
'#default_value' => $this->options['views_autocomplete'][$label]['autocomplete_enabled'],
);
}
$form['views_autocomplete'] = $options;
}
function exposed_form_alter(&$form, &$form_state) {
parent::exposed_form_alter($form, $form_state);
$filters = $form_state['view']->display_handler->handlers['filter'];
foreach ($filters as $label => $filter) {
if ($filter->options['exposed'] && $this->options['views_autocomplete'][$label]['autocomplete_enabled']) {
$form[$label]['#autocomplete_path'] = 'autocomplete_filter/' . $label . '/' . $this->view->name . '/' . $this->view->current_display;
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_autocomplete_filters_exposed_form_plugin:: |
function |
Overrides views_plugin_exposed_form:: |
||
views_autocomplete_filters_exposed_form_plugin:: |
function |
Provide a form to edit options for this plugin. Overrides views_plugin_exposed_form:: |
||
views_autocomplete_filters_exposed_form_plugin:: |
function |
Information about options for all kinds of purposes will be held here. Overrides views_plugin_exposed_form:: |
||
views_autocomplete_filters_exposed_form_plugin:: |
function |
Return a string to display as the clickable title for the
control. Overrides views_plugin_exposed_form_basic:: |
||
views_object:: |
property | Handler's definition | ||
views_object:: |
property | Except for displays, options for the object will be held here. | 1 | |
views_object:: |
function | Views handlers use a special construct function so that we can more easily construct them with variable arguments. | 6 | |
views_object:: |
function | 2 | ||
views_object:: |
function | 1 | ||
views_object:: |
function | |||
views_object:: |
function | Set default options on this object. Called by the constructor in a complex chain to deal with backward compatibility. | 1 | |
views_object:: |
function | Set default options. For backward compatibility, it sends the options array; this is a feature that will likely disappear at some point. | ||
views_object:: |
function | Let the handler know what its full definition is. | ||
views_object:: |
function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | ||
views_object:: |
function | Unpack a single option definition. | ||
views_object:: |
function | Unpacks each handler to store translatable texts. | ||
views_object:: |
function | |||
views_plugin:: |
property | The current used views display. | ||
views_plugin:: |
property | The plugin type of this plugin, for example style or query. | ||
views_plugin:: |
property |
The top object of a view. Overrides views_object:: |
1 | |
views_plugin:: |
function | Provide a list of additional theme functions for the theme information page | ||
views_plugin:: |
function | Handle any special handling on the validate form. | 9 | |
views_plugin:: |
function | Validate the options form. | 8 | |
views_plugin:: |
function | Provide a full list of possible theme templates used by this style. | ||
views_plugin:: |
function | Validate that the plugin is correct and can be saved. | 2 | |
views_plugin_exposed_form:: |
function | This function is executed when exposed form is submited. | ||
views_plugin_exposed_form:: |
function | |||
views_plugin_exposed_form:: |
function | Initialize the plugin. | ||
views_plugin_exposed_form:: |
function | |||
views_plugin_exposed_form:: |
function | |||
views_plugin_exposed_form:: |
function | 1 | ||
views_plugin_exposed_form:: |
function |
Add anything to the query that we might need to. Overrides views_plugin:: |
1 | |
views_plugin_exposed_form:: |
function | Render the exposed filter form. | ||
views_plugin_exposed_form:: |
function | Provide a reset form if one was requested. |