You are here

function template_preprocess_fieldset_helper_toggle_all in Fieldset helper 7.2

Same name and namespace in other branches
  1. 6.2 fieldset_helper.theme.inc \template_preprocess_fieldset_helper_toggle_all()

Preprocess variables for the fieldset-helper-toggle-all.tpl.php file.

File

./fieldset_helper.theme.inc, line 48
Theme functions for fieldset helper module

Code

function template_preprocess_fieldset_helper_toggle_all(&$variables) {

  // Get id
  $id = 'fieldset-helper-toggle-all';
  $id .= !empty($variables['selector']) ? preg_replace('/[^-a-z0-9]+/', '-', $variables['selector']) : '';
  $id = drupal_html_id($id);

  // Add id to template variables
  $variables['id'] = $id;

  // Add toggle all id and selector to js settings.
  $settings['fieldset_helper_toggle_all'][$id] = $variables['selector'];
  drupal_add_js($settings, 'setting');
}