You are here

function pcp_block in Profile Complete Percent 5

Same name and namespace in other branches
  1. 6.2 pcp.module \pcp_block()
  2. 6 pcp.module \pcp_block()

Implementation of hook_block()

File

./pcp.module, line 38
Allows users with valid permissions to tag profile fields created from the profile module as required fields for a users profile to be considered complete.

Code

function pcp_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks = array();
      $blocks[0]['info'] = t('Profile Complete Percentage');
      return $blocks;
      break;
    case 'view':
      $block = array();
      switch ($delta) {
        case 0:
          global $user;
          $complete_data = pcp_get_complete_percentage_data($user);
          $block = array(
            'subject' => t('Profile Complete'),
            'content' => theme('pcp_profile_percent_complete', $complete_data),
          );
          break;
      }
      return $block;
      break;
  }
}