You are here

function user_badges_entity_info in User Badges 7.4

Implements hook_entity_info().

File

./user_badges.module, line 38
Hooks and other stuff related to user badge.

Code

function user_badges_entity_info() {
  $user_badge_entity_info['user_badge'] = array(
    'label' => t('User Badge'),
    'label callback' => 'user_badges_label_callback',
    'view callback' => 'user_badge_view_multiple',
    'entity class' => 'UserBadge',
    'controller class' => 'UserBadgeController',
    'base table' => 'user_badge',
    'uri callback' => 'user_badges_uri',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'bid',
      'label' => 'name',
    ),
    'load hook' => 'user_badges_load',
    'static cache' => TRUE,
    'admin ui' => array(
      'path' => USER_BADGES_ADMIN_USER_BADGES_URI,
      'controller class' => 'UserBadgeUIController',
      'file' => 'includes/user_badges.admin.inc',
    ),
    'module' => 'user_badges',
    'views controller class' => 'UserBadgeViewsController',
    'access callback' => 'user_badges_access_callback',
    'bundles' => array(
      'user_badge' => array(
        'label' => 'User Badge',
        'admin' => array(
          'path' => USER_BADGES_ADMIN_USER_BADGES_MANAGE_URI,
          'access arguments' => array(
            'administer user badges',
          ),
        ),
      ),
    ),
    'view modes' => array(
      'default' => array(
        'label' => t('Default'),
        'custom settings' => TRUE,
      ),
      'full' => array(
        'label' => t('Full User Badge'),
        'custom settings' => TRUE,
      ),
      'teaser' => array(
        'label' => t('Teaser'),
        'custom settings' => TRUE,
      ),
    ),
  );
  return $user_badge_entity_info;
}