You are here

function flexiform_display_info in Flexiform 7

Get information about flexiform displays.

7 calls to flexiform_display_info()
Flexiform::createDisplay in ./flexiform.entity.inc
Flexiform::getDisplay in ./flexiform.entity.inc
Get hold of a particular display.
FlexiformController::invoke in ./flexiform.entity.inc
Overrides EntityAPIController::invoke().
flexiform_entity_type_get_displays in ./flexiform.module
Get display plugins for a particular entity type.
flexiform_form in ./flexiform.admin.inc
Generates the model type editing form.

... See full list

File

./flexiform.module, line 680
Module for the Flexiform system.

Code

function flexiform_display_info($display = FALSE) {
  $displays =& drupal_static(__FUNCTION__, array());
  if (empty($displays)) {
    if ($cache = cache_get('flexiform:display_info', 'cache')) {
      $displays = $cache->data;
    }
    else {
      $displays = array();
      foreach (module_implements('flexiform_display_info') as $module) {

        // Due to http://drupal.org/node/890660 we can't use module_invoke_all()
        // because we need to know the provenance of each set.
        $displays_module = module_invoke($module, 'flexiform_display_info');
        foreach ($displays_module as $display_name => $display_info) {
          $display_info += array(
            'class' => $display_name,
            'label' => $display_name,
            'module' => $module,
            'entity_types' => array(),
          );
          $displays[$display_name] = $display_info;
        }
      }

      // Alter the data sets with hook_party_data_set_info_alter().
      drupal_alter('flexiform_display_info', $displays);
      cache_set('flexiform:display_info', $displays);
    }
  }
  if (!empty($display)) {
    return empty($displays[$display]) ? FALSE : $displays[$display];
  }
  return $displays;
}