You are here

function theme_user_relationships_relationships_block_subject in User Relationships 5

Generate the title of a My/User Relationships block

1 theme call to theme_user_relationships_relationships_block_subject()
user_relationships_block in ./user_relationships_hooks.inc

File

./user_relationships_theme.inc, line 218

Code

function theme_user_relationships_relationships_block_subject($viewing_user, $relationships, $rtid, $all_types) {
  global $user;
  $user_name = $viewing_user->uid == $user->uid ? 'My' : $viewing_user->name . "'s";
  if ($all_types) {
    $type_name = 'Relationships';
  }
  else {
    $rtype = user_relationships_relationship_type_load(array(
      'rtid' => $rtid,
    ));
    $type_name = drupal_ucfirst($rtype->plural_name);
  }
  $output = t('@user @type', array(
    '@user' => $user_name,
    '@type' => $type_name,
  ));
  return $output;
}