You are here

function emimage_flickr_error_check in Embedded Media Field 6

This will log an error if we don't have a key yet. In addition, if the user is an admin, we'll display an error.

1 call to emimage_flickr_error_check()
emimage_flickr_request in contrib/emimage/providers/flickr.inc
this is a wrapper for emimage_request_xml that includes flickr's api key

File

contrib/emimage/providers/flickr.inc, line 178
This include processes flickr.com image files for use by emfield.module.

Code

function emimage_flickr_error_check() {
  static $checked;
  if (!$checked && variable_get('emimage_flickr_api_key', '') == '') {
    global $user;
    $error = t('You do not yet have a Flickr API key set. You will need to <a href="@apply" target="_blank">apply for a Flickr API key</a> and enter your key at the <a href="@settings">settings administration page</a> before Flickr images may be displayed.', array(
      '@apply' => EMIMAGE_FLICKR_API_APPLICATION_URL,
      '@settings' => url('admin/content/emfield'),
    ));
    if (user_access('administer site configuration')) {
      drupal_set_message($error, 'error');
    }
    watchdog('Embedded Media Field', '!error', array(
      '!error' => $error,
    ));
  }
  $checked = TRUE;
}