You are here

function fb_get_name in Drupal for Facebook 7.4

Helper function determines a name from data returned from fb_graph(). Almost always, graph data includes a 'name'. But in rare cases that is not present and we use an id instead.

7 calls to fb_get_name()
fb_admin_application_delete_form in ./fb.admin.inc
Form creator -- ask for confirmation of deletion
fb_admin_replace_token_form_submit in ./fb.admin.inc
fb_admin_tokens_form in ./fb.admin.inc
fb_admin_token_generate_process in ./fb.admin.inc
fb_admin_token_info in ./fb.admin.inc
Display detailed information about a token.

... See full list

File

./fb.module, line 1712

Code

function fb_get_name($graph_data) {
  if (!empty($graph_data['name'])) {
    return $graph_data['name'];
  }
  elseif (!empty($graph_data['id'])) {
    return $graph_data['id'];
  }
  else {
    return t('Unknown');
  }
}