You are here

function profile2_page_entity_info_alter in Profile 2 7.2

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

Implements hook_entity_info_alter().

File

contrib/profile2_page.module, line 361
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'] += array(
    'page' => array(
      'label' => t('Profile page'),
      'custom settings' => FALSE,
    ),
    '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;
  }
}