You are here

function views_block_filter_block_form_views_exposed_form_alter in Views Block Exposed Filter Blocks 7

Same name and namespace in other branches
  1. 8 views_block_filter_block.module \views_block_filter_block_form_views_exposed_form_alter()

Implements hook_form_FORM_ID_alter().

File

./views_block_filter_block.module, line 22
Hooks and functions for the Views Block Exposed Filter Block module.

Code

function views_block_filter_block_form_views_exposed_form_alter(&$form, &$form_state) {
  $view = $form_state['view'];

  // Only react on block Views specifically configured with exposed form blocks.
  if (get_class($view->display_handler) == 'vbfb_plugin_display_block') {
    if ($view->display_handler
      ->get_option('exposed_block')) {

      // Ensure that the fallback form action is the current page.
      $form['#action'] = url(drupal_get_path_alias(), array(
        'absolute' => TRUE,
      ));
    }
  }
}