You are here

function flexiform_field_element_options in Flexiform 7

Get all available elements for a given entity

1 call to flexiform_field_element_options()
flexiform_manage_form_fields_form in ./flexiform.admin.inc
flexiform_manage_form_fields_form

File

./flexiform.admin.inc, line 1653
Model type editing UI.

Code

function flexiform_field_element_options($flexiform, $entity_namespace = NULL) {
  if (!isset($entity_namespace) || !isset($flexiform->entities[$entity_namespace])) {
    return array();
  }
  $entity_info = $flexiform->entities[$entity_namespace];
  $elements = flexiform_get_element_info($entity_info['entity_type'], $entity_info['bundle']);
  $options = array();
  foreach ($elements as $name => $element) {
    $options[$element['group']][$name] = $element['label'];
  }
  return $options;
}