You are here

function flickr_tags_list in Flickr 7

Same name and namespace in other branches
  1. 5 tags/flickr_tags.module \flickr_tags_list()
  2. 6 tags/flickr_tags.module \flickr_tags_list()

Returns a given user's tags.

1 string reference to 'flickr_tags_list'
flickr_tags_menu in tags/flickr_tags.module
Implements hook_menu().

File

tags/flickr_tags.module, line 94
The Flickr tags module.

Code

function flickr_tags_list($account, $nsid = NULL) {
  if (variable_get('flickr_css', 1)) {
    drupal_add_css(drupal_get_path('module', 'flickr_tags') . '/flickr_tags.css');
  }
  drupal_set_title(t('Flickr tags list - @name', array(
    '@name' => $account->name,
  )));
  $nsid = $account->flickr['nsid'];

  // Get all tags.
  $taglist_response = flickr_tags_getlistuser($nsid);
  if ($taglist_response === FALSE) {
    drupal_set_message(t("Error retrieving %user's tags from Flickr", array(
      '%user' => $account->name,
    )));
    return '';
  }
  elseif (empty($taglist_response)) {
    drupal_set_message(t('%user has no tags', array(
      '%user' => $account->name,
    )));
    return '';
  }
  $tags = array();
  foreach ($taglist_response as $tag) {
    $tags[] = $tag['_content'];
  }

  // Pass array to the theme function.
  return theme('flickr_tags_list', array(
    'uid' => $account->uid,
    'nsid' => $nsid,
    'tags' => $tags,
  ));
}