user_view

Versions
4.6 – 5
user_view($uid = 0)
6
user_view($account)

Code

modules/user.module, line 1472

<?php
function user_view($uid = 0) {
  global $user;

  $account = user_load(array('uid' => $uid));
  if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
    return drupal_not_found();
  }
  // Retrieve and merge all profile fields:
  $fields = array();
  foreach (module_list() as $module) {
    if ($data = module_invoke($module, 'user', 'view', '', $account)) {
      foreach ($data as $category => $items) {
        foreach ($items as $item) {
          $item['class'] = "$module-". $item['class'];
          $fields[$category][] = $item;
        }
      }
    }
  }
  drupal_set_title(check_plain($account->name));
  return theme('user_profile', $account, $fields);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.