You are here

function rules_get_entity_view_modes in Rules 7.2

Gets all view modes of an entity for an entity_view event.

Related topics

2 string references to 'rules_get_entity_view_modes'
rules_node_event_info in modules/node.rules.inc
Implements hook_rules_event_info() on behalf of the node module.
rules_user_event_info in modules/user.rules.inc
Implements hook_rules_event_info().

File

modules/events.inc, line 213
Invokes events on behalf core modules.

Code

function rules_get_entity_view_modes($name, $var_info) {

  // Read the entity type from a special key out of the variable info.
  $entity_type = $var_info['options list entity type'];
  $info = entity_get_info($entity_type);
  foreach ($info['view modes'] as $mode => $mode_info) {
    $modes[$mode] = $mode_info['label'];
  }
  return $modes;
}