You are here

function views_exposed_form_cache in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 views.module \views_exposed_form_cache()
  2. 6.3 views.module \views_exposed_form_cache()
  3. 6.2 views.module \views_exposed_form_cache()

Save the Views exposed form for later use.

Parameters

string $views_name: The views name.

string $display_name: The current view display name.

array $form_output: An optional form structure. Only needed when inserting the value.

Return value

array|bool Array. The form structure, if any. Otherwise, return FALSE.

1 call to views_exposed_form_cache()
views_exposed_form in ./views.module
Form builder for the exposed widgets form.
1 string reference to 'views_exposed_form_cache'
ViewsSqlTest::getBasicPageView in tests/views_query.test
Build and return a Page view of the views_test table.

File

./views.module, line 2356
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_exposed_form_cache($views_name, $display_name, $form_output = NULL) {

  // When running tests for exposed filters, this cache should
  // be cleared between each test.
  $views_exposed =& drupal_static(__FUNCTION__);

  // Save the form output.
  if (!empty($form_output)) {
    $views_exposed[$views_name][$display_name] = $form_output;
  }

  // Return the form output, if any.
  return empty($views_exposed[$views_name][$display_name]) ? FALSE : $views_exposed[$views_name][$display_name];
}