class views_plugin_exposed_form_asset_widget in Asset 7
Exposed form plugin that provides an specific exposed form for asset widget.
Hierarchy
- class \views_object
- class \views_plugin
Expanded class hierarchy of views_plugin_exposed_form_asset_widget
1 string reference to 'views_plugin_exposed_form_asset_widget'
- asset_widget_views_plugins in modules/
asset_widget/ views/ asset_widget.views.inc - Implements hook_views_plugins().
File
- modules/
asset_widget/ views/ plugins/ views_plugin_exposed_form_asset_widget.inc, line 12 - Definition of views_plugin_exposed_form_asset_widget.
View source
class views_plugin_exposed_form_asset_widget extends views_plugin_exposed_form {
function render_exposed_form($block = FALSE) {
// Deal with any exposed filters we may have, before building.
$form_state = array(
'view' => &$this->view,
'display' => &$this->display,
'method' => 'get',
'rerender' => TRUE,
'no_redirect' => TRUE,
'always_process' => TRUE,
);
// Some types of displays (eg. attachments) may wish to use the exposed
// filters of their parent displays instead of showing an additional
// exposed filter form for the attachment as well as that for the parent.
if (!$this->view->display_handler
->displays_exposed() || !$block && $this->view->display_handler
->get_option('exposed_block')) {
unset($form_state['rerender']);
}
if (!empty($this->ajax)) {
$form_state['ajax'] = TRUE;
}
$form_state['exposed_form_plugin'] = $this;
$form = drupal_build_form('views_exposed_form', $form_state);
// Show exposed form only on live preview, or in when flag manually setted.
if (!empty($this->view->render_exposed_form) || !empty($this->view->live_preview)) {
// We add special class to get our form in JS.
$form['#attributes']['class'][] = 'asset-widget-search-exposed-form';
// Move all field descriptions to tooltips.
foreach (element_children($form) as $child_key) {
if (isset($form[$child_key]['#name']) && isset($form['#info']['filter-' . $form[$child_key]['#name']])) {
if (!empty($form[$child_key]['#description'])) {
$widget =& $form['#info']['filter-' . $form[$child_key]['#name']];
if (empty($widget['description'])) {
$widget['description'] = $form[$child_key]['#description'];
}
unset($form[$child_key]['#description']);
}
}
}
$output = drupal_render($form);
if (!$this->view->display_handler
->displays_exposed() || !$block && $this->view->display_handler
->get_option('exposed_block')) {
return "";
}
else {
return $output;
}
}
return "";
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_object:: |
public | property | Handler's definition. | |
views_object:: |
public | property | Except for displays, options for the object will be held here. | 1 |
views_object:: |
function | Collect this handler's option definition and alter them, ready for use. | ||
views_object:: |
public | function | Views handlers use a special construct function. | 4 |
views_object:: |
public | function | Destructor. | 2 |
views_object:: |
public | function | 1 | |
views_object:: |
public | function | ||
views_object:: |
public | function | Always exports the option, regardless of the default value. | |
views_object:: |
public | function | Set default options on this object. | 1 |
views_object:: |
public | function | Set default options. | |
views_object:: |
public | function | Let the handler know what its full definition is. | |
views_object:: |
public | function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | |
views_object:: |
public | function | Unpack a single option definition. | |
views_object:: |
public | function | Unpacks each handler to store translatable texts. | |
views_object:: |
public | function | ||
views_plugin:: |
public | property | The current used views display. | |
views_plugin:: |
public | property | The plugin name of this plugin, for example table or full. | |
views_plugin:: |
public | property | The plugin type of this plugin, for example style or query. | |
views_plugin:: |
public | property |
The top object of a view. Overrides views_object:: |
1 |
views_plugin:: |
public | function | Provide a list of additional theme functions for the theme info page. | |
views_plugin:: |
public | function | Handle any special handling on the validate form. | 9 |
views_plugin:: |
public | function | Validate the options form. | 10 |
views_plugin:: |
public | function | Return the human readable name of the display. | |
views_plugin:: |
public | function | Returns the summary of the settings in the display. | 8 |
views_plugin:: |
public | function | Provide a full list of possible theme templates used by this style. | |
views_plugin:: |
public | function | Validate that the plugin is correct and can be saved. | 3 |
views_plugin_exposed_form:: |
public | function | ||
views_plugin_exposed_form:: |
public | function | This function is executed when exposed form is submited. | |
views_plugin_exposed_form:: |
public | function | ||
views_plugin_exposed_form:: |
public | function | Initialize the plugin. | |
views_plugin_exposed_form:: |
public | function |
Provide a form to edit options for this plugin. Overrides views_plugin:: |
1 |
views_plugin_exposed_form:: |
public | function |
Information about options for all kinds of purposes will be held here. Overrides views_object:: |
1 |
views_plugin_exposed_form:: |
public | function | ||
views_plugin_exposed_form:: |
public | function | ||
views_plugin_exposed_form:: |
public | function | ||
views_plugin_exposed_form:: |
public | function | 1 | |
views_plugin_exposed_form:: |
public | function |
Add anything to the query that we might need to. Overrides views_plugin:: |
1 |
views_plugin_exposed_form:: |
public | function | ||
views_plugin_exposed_form_asset_widget:: |
function |
Render the exposed filter form. Overrides views_plugin_exposed_form:: |