You are here

function theme_fb_user_profile in Facebook Connect 5

Return themed user profile

Parameters

array $data: An array containing the data to display

object $account: Drupal user object

Return value

formated HTML

1 theme call to theme_fb_user_profile()
fbconnect_profile_user in modules/fbconnect_profile/fbconnect_profile.module
Implementation of hook_user().

File

modules/fbconnect_profile/fbconnect_profile.module, line 192
This module allows users to import their personal information from Facebook.

Code

function theme_fb_user_profile($data, $account) {
  if (!empty($data) && !empty($account)) {
    $label = variable_get('facebook_user_fields', '');
    foreach ($data as $key => $value) {
      if (!is_array($value)) {
        $item[] = array(
          'data' => $label[$key] . ': ' . $value,
          'class' => $key,
        );
      }
      else {
        switch ($key) {
          case 'affiliations':
            $item[] = array(
              'data' => $label[$key] . ' : ' . $value[0]['name'],
              'class' => $key,
            );
            break;
          case 'hometown_location':
            $location = $label[$key] . ': ' . $value['city'] . ', ' . $value['state'] . ', ' . $value['country'];
            $item[] = array(
              'data' => $location,
              'class' => $key,
            );
            break;
        }
      }
    }
    return theme('item_list', $item);
  }
}