You are here

function flickrapi_admin_settings in Flickr API 5

Same name and namespace in other branches
  1. 6 flickrapi.module \flickrapi_admin_settings()
  2. 7.2 flickrapi.admin.inc \flickrapi_admin_settings()
  3. 7 flickrapi.admin.inc \flickrapi_admin_settings()

Implementation of hook_settings

1 string reference to 'flickrapi_admin_settings'
flickrapi_menu in ./flickrapi.module
Implementation of hook_menu

File

./flickrapi.module, line 26

Code

function flickrapi_admin_settings() {
  $form['#validate'] = array(
    'flickrapi_admin_settings_validate' => array(),
  );
  $form['flickrapi_api_key'] = array(
    '#type' => 'textfield',
    '#title' => t('API Key'),
    '#required' => TRUE,
    '#default_value' => variable_get('flickrapi_api_key', ''),
    '#description' => t('API Key from Flickr'),
  );
  $form['flickrapi_api_secret'] = array(
    '#type' => 'textfield',
    '#title' => t('API Shared Secret'),
    '#required' => FALSE,
    '#default_value' => variable_get('flickrapi_api_secret', ''),
    '#description' => t("API key's secret from Flickr."),
  );
  $times = array(
    900,
    1800,
    2700,
    3600,
    7200,
    10800,
    14400,
    18000,
    21600,
    43200,
    86400,
  );
  $ageoptions = drupal_map_assoc($times, 'format_interval');
  $form['flickrapi_cache_duration'] = array(
    '#type' => 'select',
    '#title' => t('Update interval'),
    '#options' => $ageoptions,
    '#default_value' => variable_get('flickrapi_cache_duration', 3600),
    '#description' => t("The refresh interval indicating how often you want to check cached Flickr API calls are up to date."),
  );
  return system_settings_form($form);
}