You are here

function facebook_album_ajax_get_album_cover in Facebook Album 7.2

Fetch an individual album cover

Parameters

$id: The album id to fetch the cover for

Return value

mixed A json object containing html template

1 string reference to 'facebook_album_ajax_get_album_cover'
facebook_album_menu in ./facebook_album.module
Implements menu_hook()

File

./facebook_album.module, line 243

Code

function facebook_album_ajax_get_album_cover($id) {
  $settings = facebook_album_get_settings();
  $module_response = array(
    'data' => null,
  );
  $url = _facebook_album_build_api_request($id . '/picture', array(
    'access_token' => $settings['appToken'],
    'redirect' => 'false',
  ));
  $response = _facebook_album_fetch_api_response($url);
  if (!isset($response['error'])) {
    $module_response = $response;
  }
  return drupal_json_output($module_response);
}