You are here

function responsive_menus_explode_list in Responsive Menus 7

Return array of selectors for JS settings.

Return value

array Array of settings to pass with drupal_add_js().

3 calls to responsive_menus_explode_list()
responsive_menus_google_nexus_style_js_settings in ./responsive_menus.module
JS callback from hook_responsive_menus_style_info().
responsive_menus_sidr_style_js_settings in ./responsive_menus.module
JS callback from hook_responsive_menus_style_info().
responsive_menus_simple_style_js_settings in ./responsive_menus.module
JS callback from hook_responsive_menus_style_info().

File

./responsive_menus.module, line 1145
Responsify menus in Drupal.

Code

function responsive_menus_explode_list($style_var, $default, $js_defaults = array()) {
  $selectors = responsive_menus_var_get($style_var, $default, $js_defaults);
  $delimiter = ', ';

  // Strip out carriage returns.
  $selectors = str_replace("\r", '', $selectors);

  // Replace new lines with delimiter.
  $selectors = str_replace("\n", $delimiter, $selectors);

  // Explode to include original delimited.
  $values = explode($delimiter, $selectors);
  $values = array_filter($values);
  return $values;
}