You are here

function theme_user_relationship_block_subject in User Relationships 5.2

Same name and namespace in other branches
  1. 6 user_relationship_blocks/user_relationship_blocks.module \theme_user_relationship_block_subject()
  2. 7 user_relationship_blocks/user_relationship_blocks.module \theme_user_relationship_block_subject()

Generate the title of a My/User Relationships block

1 theme call to theme_user_relationship_block_subject()
theme_user_relationship_block in plugins/user_relationship_blocks/user_relationship_blocks.module
In our case it's a delegator block that just pulls data in from whichever function is more appropriate

File

plugins/user_relationship_blocks/user_relationship_blocks.module, line 250

Code

function theme_user_relationship_block_subject($account, $rtid, $relationships) {
  if (!$account) {
    return;
  }
  global $user;
  $user_name = $account->uid == $user->uid ? t('My') : t("@username's", array(
    '@username' => $account->name,
  ));
  if ($rtid == UR_BLOCK_ALL_TYPES) {
    $type_name = t('Relationships');
  }
  else {
    $rtype = user_relationships_type_load($rtid);
    $type_name = t($rtype->plural_name);
  }
  $output = t('@user @type', array(
    '@user' => $user_name,
    '@type' => $type_name,
  ));
  return $output;
}