You are here

function pcp_block_info in Profile Complete Percent 7

Implements hook_block_info().

File

./pcp.module, line 64
Allows users with valid permissions to tag profile fields (core fields or Profile2 fields) for a users profile to be considered complete.

Code

function pcp_block_info() {

  // Create block for core user profiles.
  $blocks['pcp_profile_percent_complete'] = array(
    'info' => t('Profile Complete Percentage - Core Profile'),
    'cache' => DRUPAL_NO_CACHE,
  );

  // Create a block for each profile2 profile type.
  if ($profile2_entity = entity_get_info('profile2')) {
    foreach ($profile2_entity['bundles'] as $bundle => $values) {
      $block_name = _pcp_block_identifier($bundle);
      $blocks[$block_name] = array(
        'info' => t('Profile Complete Percentage - ' . $values['label']),
        'cache' => DRUPAL_NO_CACHE,
      );
    }
  }
  return $blocks;
}