You are here

function views_ui_build_identifier in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 includes/admin.inc \views_ui_build_identifier()
  2. 6.2 includes/admin.inc \views_ui_build_identifier()

Build a form identifier that we can use to see if one form is the same as another. Since the arguments differ slightly we do a lot of spiffy concatenation here.

2 calls to views_ui_build_identifier()
views_ui_add_form_to_stack in includes/admin.inc
Add another form to the stack; clicking 'apply' will go to this form rather than closing the ajax popup.
views_ui_ajax_form in includes/admin.inc
Generic entry point to handle forms.

File

includes/admin.inc, line 2942
Provides the Views' administrative interface.

Code

function views_ui_build_identifier($key, $view, $display_id, $args) {
  $form = views_ui_ajax_forms($key);

  // Automatically remove the single-form cache if it exists and
  // does not match the key.
  $identifier = implode('-', array(
    $key,
    $view->name,
    $display_id,
  ));
  foreach ($form['args'] as $id) {
    $arg = !empty($args) ? array_shift($args) : NULL;
    $identifier .= '-' . $arg;
  }
  return $identifier;
}