You are here

function profile2_page_entity_info_alter in Profile 2 7

Same name and namespace in other branches
  1. 7.2 contrib/profile2_page.module \profile2_page_entity_info_alter()

Implements hook_entity_info_alter().

File

contrib/profile2_page.module, line 229
Adds separate pages for viewing and editing profiles.

Code

function profile2_page_entity_info_alter(&$entity_info) {

  // Add new view modes for the page.
  $entity_info['profile2']['view modes']['page'] = array(
    'label' => t('Profile page'),
    'custom settings' => FALSE,
  );
  $entity_info['profile2']['view modes']['teaser'] = array(
    'label' => t('Teaser'),
    'custom settings' => FALSE,
  );
  $entity_info['profile2']['uri callback'] = 'profile2_page_uri_callback';
  $entity_info['profile2']['form callback'] = 'profile2_page_form_callback';

  // Integrate with Metatag module to enable metatags support for separate
  // profile pages.
  if (module_exists('metatag')) {
    $entity_info['profile2']['metatags'] = TRUE;
  }
}