You are here

function domain_user_domainview in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_user/domain_user.module \domain_user_domainview()

Implement hook_domainview()

File

domain_user/domain_user.module, line 407
Creates unique subdomains for registered users.

Code

function domain_user_domainview($op, $domain = array()) {
  switch ($op) {
    case 'header':
      return array(
        array(
          'data' => t('User'),
          'field' => 'du.uid',
        ),
      );
      break;
    case 'select':
      return 'du.uid';
    case 'join':
      return "LEFT JOIN {domain_user} du ON du.domain_id = d.domain_id";
      break;
    case 'data':
      if ($domain['uid']) {
        $account = user_load(array(
          'uid' => $domain['uid'],
        ));
        return l($account->name, 'user/' . $account->uid);
      }
      break;
  }
}