You are here

function sharemessage_entity_info in Share Message 7

Implements hook_entity_info().

File

./sharemessage.module, line 26
New Sharing Module.

Code

function sharemessage_entity_info() {
  $entities = array(
    'sharemessage' => array(
      'module' => 'sharemessage',
      'label' => t('ShareMessage'),
      'access callback' => 'sharemessage_access',
      'entity class' => 'ShareMessage',
      'controller class' => 'ShareMessageController',
      'metadata controller class' => 'ShareMessageMetadataController',
      'fieldable' => TRUE,
      'exportable' => TRUE,
      'base table' => 'sharemessage',
      'entity keys' => array(
        'id' => 'smid',
        'label' => 'label',
        'name' => 'name',
      ),
      'view modes' => array(
        'full' => array(
          'label' => t('Share links with OG tags and AddThis attributes'),
          'custom settings' => FALSE,
        ),
        'only_og_tags' => array(
          'label' => t('Only OG tags'),
          'custom settings' => FALSE,
        ),
        'no_attributes' => array(
          'label' => t('Share links with OG tags only'),
          'custom settings' => FALSE,
        ),
        'attributes_only' => array(
          'label' => t('Share links with AddThis attributes only'),
          'custom settings' => FALSE,
        ),
      ),
      'bundles' => array(
        'sharemessage' => array(
          'label' => t('Sharemessage'),
          'admin' => array(
            'path' => 'admin/config/services/sharemessage',
            'access arguments' => array(
              'administer sharemessage entities',
            ),
          ),
        ),
      ),
      'admin ui' => array(
        'controller class' => 'ShareMessageUIController',
        'path' => 'admin/config/services/sharemessage',
        'menu wildcard' => '%sharemessage',
      ),
      'translation' => array(
        'entity_translation' => array(
          'base path' => 'admin/config/services/sharemessage/manage/%sharemessage',
          'edit path' => 'admin/config/services/sharemessage/manage/%sharemessage',
          'path wildcard' => '%sharemessage',
        ),
      ),
      'field replacement' => array(
        'label' => array(
          'field' => array(
            'type' => 'text',
            'cardinality' => 1,
            'translatable' => TRUE,
          ),
          'instance' => array(
            'label' => t('Label'),
            'description' => '',
            'required' => TRUE,
            'settings' => array(
              'text_processing' => 0,
            ),
            'widget' => array(
              'weight' => -5,
            ),
            'display' => array(
              'default' => array(
                'type' => 'hidden',
              ),
            ),
          ),
        ),
      ),
    ),
  );
  return $entities;
}