You are here

function global_filter_forms in Views Global Filter 8

Same name and namespace in other branches
  1. 6 global_filter.module \global_filter_forms()
  2. 7 global_filter.widgets.inc \global_filter_forms()

Implements hook_forms().

Called as a result of the fact that there are no hard-coded handlers for the unique form_id's ('global_filter_block_1', 'global_filter_block_2'...), generated in global_filter_block_info(). Here we map these form_id's back to the same 'global_filter_submission_form'.

File

./global_filter.widgets.inc, line 33
global_filter.widgets.inc

Code

function global_filter_forms($form_id, $args) {
  if (strpos($form_id, GLOBAL_FILTER_BLOCK_ID_PREFIX) === 0) {

    // Convert $form_id to block#
    $block_number = drupal_substr($form_id, -1);
    $form = array(
      $form_id => array(
        'callback' => 'global_filter_submission_form',
        'callback arguments' => array(
          $block_number,
        ),
      ),
    );
    return $form;
  }
}