You are here

function fasttoggle_user_link in Fasttoggle 7

Implements hook_link().

1 call to fasttoggle_user_link()
fasttoggle_user_view in module/fasttoggle_user/fasttoggle_user.module
Implements hook_user().

File

module/fasttoggle_user/fasttoggle_user.module, line 242

Code

function fasttoggle_user_link($type, $obj = NULL, $teaser = FALSE) {
  $links = array();
  $options = fasttoggle_get_allowed_links($type, $obj);
  if (!empty($options)) {
    $label_style = variable_get('fasttoggle_label_style', FASTTOGGLE_LABEL_STATUS);
    switch ($type) {

      // User is not one of the standard types for hook_link(). This
      // use enables adding of user links to a user profile. It may be called
      // from a view field handler without a proper user object loaded.
      case 'user':
        if (!empty($options['fields'])) {
          foreach ($options['fields'] as $group => $flags) {
            if (!empty($flags['instances'])) {
              foreach ($flags['instances'] as $key => $data) {
                $links[$group . "_" . $key] = fasttoggle($options, $group, $key, $obj, FASTTOGGLE_FORMAT_LINK_ARRAY);
              }
            }
          }
        }
        break;
    }
  }
  return $links;
}