You are here

function entity_theme in Entity API 7

Same name and namespace in other branches
  1. 8.0 entity.module \entity_theme()

Implements hook_theme().

File

./entity.module, line 1115

Code

function entity_theme() {

  // Build a pattern in the form of "(type1|type2|...)(\.|__)" such that all
  // templates starting with an entity type or named like the entity type
  // are found.
  // This has to match the template suggestions provided in
  // template_preprocess_entity().
  $types = array_keys(entity_crud_get_info());
  $pattern = '(' . implode('|', $types) . ')(\\.|__)';
  return array(
    'entity_status' => array(
      'variables' => array(
        'status' => NULL,
        'html' => TRUE,
      ),
      'file' => 'theme/entity.theme.inc',
    ),
    'entity' => array(
      'render element' => 'elements',
      'template' => 'entity',
      'pattern' => $pattern,
      'path' => drupal_get_path('module', 'entity') . '/theme',
      'file' => 'entity.theme.inc',
    ),
    'entity_property' => array(
      'render element' => 'elements',
      'file' => 'theme/entity.theme.inc',
    ),
    'entity_ui_overview_item' => array(
      'variables' => array(
        'label' => NULL,
        'entity_type' => NULL,
        'url' => FALSE,
        'name' => FALSE,
      ),
      'file' => 'includes/entity.ui.inc',
    ),
  );
}