You are here

function farm_ui_entities in farmOS 7

Load farmOS entity UI information.

Parameters

string $type: Optionally specify the entity type.

string $bundle: Optionally specify the entity bundle.

Return value

array Returns an array of entity UI information.

11 calls to farm_ui_entities()
farm_import_farm_ui_actions in modules/farm/farm_import/farm_import.module
Implements hook_farm_ui_actions().
farm_ui_area_links in modules/farm/farm_ui/farm_ui.farm_area.inc
Generate area links for farm_asset or log entity types.
farm_ui_entity_type_breadcrumb in modules/farm/farm_ui/farm_ui.breadcrumb.inc
Build breadcrumbs for a specific entity type and bundle.
farm_ui_entity_views in modules/farm/farm_ui/farm_ui.entity_views.inc
Build a renderable array of Views to add to a farmOS entity.
farm_ui_farm_info in modules/farm/farm_ui/farm_ui.module
Implements hook_farm_info().

... See full list

File

modules/farm/farm_ui/farm_ui.module, line 287
Farm UI module code.

Code

function farm_ui_entities($type = '', $bundle = '') {

  // Ask modules for entity UI information and static cache the results.
  $entity_info =& drupal_static(__FUNCTION__);
  if (!isset($entity_info)) {
    $entity_info = module_invoke_all('farm_ui_entities');
  }

  // If a type and bundle are specified, return specific info.
  if (!empty($type) && !empty($bundle)) {
    $bundle_info = array();
    if (!empty($entity_info[$type][$bundle])) {
      $bundle_info = $entity_info[$type][$bundle];
    }
    return $bundle_info;
  }

  // Return the entity UI information.
  return $entity_info;
}