function _form_options_search

cis7 options_element.inc _form_options_search($needle, $haystack, $include_pattern)
cle7 options_element.inc _form_options_search($needle, $haystack, $include_pattern)
elmsmedia7 options_element.inc _form_options_search($needle, $haystack, $include_pattern)
icor7 options_element.inc _form_options_search($needle, $haystack, $include_pattern)
meedjum_blog7 options_element.inc _form_options_search($needle, $haystack, $include_pattern)
mooc7 options_element.inc _form_options_search($needle, $haystack, $include_pattern)

Recursive function for finding default value keys. Matches on keys or values.

1 call to _form_options_search()
_form_type_options_value in sites/all/modules/ulmus/options_element/options_element.inc
Logic function for form_type_options_value(). Do not call directly.

File

sites/all/modules/ulmus/options_element/options_element.inc, line 442
All logic for options_element form elements.

Code

function _form_options_search($needle, $haystack, $include_pattern) {
  if (isset($haystack[$needle])) {
    return $needle;
  }
  elseif ($include_pattern && preg_match('/' . $include_pattern . '/', $needle)) {
    return $needle;
  }
  foreach ($haystack as $key => $value) {
    if (is_array($value)) {
      return _form_options_search($needle, $value, $include_pattern);
    }
    elseif ($value == $needle) {
      return $key;
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.