You are here

function entity_view_mode_load in Entity view modes 7

Load a custom entity view mode by entity type and machine name.

4 calls to entity_view_mode_load()
entity_view_mode_delete in ./entity_view_mode.module
Delete a custom entity view mode.
entity_view_mode_delete_form in ./entity_view_mode.admin.inc
entity_view_mode_edit_form in ./entity_view_mode.admin.inc
Form builder; edit a custom view mode.
entity_view_mode_save in ./entity_view_mode.module
Save a custom entity view mode.

File

./entity_view_mode.module, line 125

Code

function entity_view_mode_load($entity_type, $machine_name) {
  $view_modes = variable_get('entity_view_modes', array());
  if (!empty($view_modes[$entity_type][$machine_name])) {

    // Ensure that the machine name is always available.
    return $view_modes[$entity_type][$machine_name] + array(
      'machine_name' => $machine_name,
    );
  }
  return FALSE;
}