You are here

function finder_admin_get_element_options in Finder 7

Same name and namespace in other branches
  1. 6 includes/finder.admin.inc \finder_admin_get_element_options()

Get element handlers and convert to options array.

2 calls to finder_admin_get_element_options()
finder_admin_edit in includes/finder.admin.inc
Admin finder edit page.
finder_admin_element_edit in includes/finder.admin.inc
Admin finder element add/edit page. Must have a Finder object at this point.

File

includes/finder.admin.inc, line 902
The finder admin screens.

Code

function finder_admin_get_element_options() {
  $elements = finder_element_handlers();
  $element_options = array(
    '' => t('- Select an element type -'),
  );
  if (!empty($elements)) {
    foreach ($elements as $element_key => $element_data) {
      $element_options[$element_key] = t($element_data['#title']);
    }
  }
  else {
    drupal_set_message(t('Error: You must activate a finder element handler module such as Finder Autocomplete or Finder Optionwidgets to begin.'), 'error');
    return array(
      '' => t('- No element types to choose from -'),
    );
  }
  return $element_options;
}