You are here

function mobile_tools_entity_info_alter in Mobile Tools 7.3

Same name and namespace in other branches
  1. 7.2 mobile_tools.module \mobile_tools_entity_info_alter()

Implements of hook_entity_info_alter()

We provide new build modes for all entities

File

./mobile_tools.module, line 238
Functionality to ease the creation of mixed device environments.

Code

function mobile_tools_entity_info_alter(&$entity_info) {

  // Check if view modes is enabled
  // @todo do we need some kind of static cache on the view modes?
  if (MOBILE_TOOLS_ENABLE_VIEW_MODES) {
    $device_groups = mobile_tools_device_group_load_all();
    foreach ($entity_info as $entity_type => $entity) {
      foreach ($device_groups as $device_group) {
        $entity_info[$entity_type]['view modes'][$device_group->dgid] = array(
          'label' => $device_group->title,
          'custom settings' => FALSE,
        );
      }
    }
  }
}